@esri/solutions-components 0.8.2 → 0.8.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (117) hide show
  1. package/dist/cjs/calcite-action-pad_2.cjs.entry.js +1 -1
  2. package/dist/cjs/calcite-input-date-picker_3.cjs.entry.js +16 -10
  3. package/dist/cjs/card-manager_3.cjs.entry.js +1 -1
  4. package/dist/cjs/{downloadUtils-c2bd7c80.js → downloadUtils-8b05d7cc.js} +39 -8
  5. package/dist/cjs/{helpers-81779c18.js → helpers-b014d9a9.js} +1 -1
  6. package/dist/cjs/{index.es-22b3d1a2.js → index.es-e7587227.js} +1 -1
  7. package/dist/cjs/instant-apps-ckeditor-wrapper_3.cjs.entry.js +4 -4
  8. package/dist/cjs/instant-apps-control-panel.cjs.entry.js +1 -1
  9. package/dist/cjs/instant-apps-export.cjs.entry.js +16 -10
  10. package/dist/cjs/instant-apps-header.cjs.entry.js +1 -1
  11. package/dist/cjs/instant-apps-interactive-legend-classic.cjs.entry.js +2 -2
  12. package/dist/cjs/instant-apps-interactive-legend-count_2.cjs.entry.js +2 -2
  13. package/dist/cjs/instant-apps-interactive-legend-group-legend-element-caption.cjs.entry.js +2 -2
  14. package/dist/cjs/instant-apps-interactive-legend-group-legend-element_5.cjs.entry.js +2 -2
  15. package/dist/cjs/instant-apps-interactive-legend.cjs.entry.js +4 -4
  16. package/dist/cjs/instant-apps-keyboard-shortcuts.cjs.entry.js +3 -3
  17. package/dist/cjs/instant-apps-landing-page.cjs.entry.js +1 -1
  18. package/dist/cjs/instant-apps-language-switcher.cjs.entry.js +5 -5
  19. package/dist/cjs/instant-apps-language-translator.cjs.entry.js +5 -5
  20. package/dist/cjs/instant-apps-measurement.cjs.entry.js +4 -4
  21. package/dist/cjs/instant-apps-popover.cjs.entry.js +3 -3
  22. package/dist/cjs/instant-apps-scoreboard.cjs.entry.js +3 -3
  23. package/dist/cjs/instant-apps-splash.cjs.entry.js +14 -5
  24. package/dist/cjs/{languageSwitcher-4822684b.js → languageSwitcher-3870c772.js} +1 -1
  25. package/dist/cjs/{languageUtil-9bd00bad.js → languageUtil-0df39c0c.js} +1 -1
  26. package/dist/cjs/{loadModules-69fc5b98.js → loadModules-01306709.js} +1 -1
  27. package/dist/cjs/loader.cjs.js +1 -1
  28. package/dist/cjs/{locale-3e33f44c.js → locale-4cef466e.js} +2 -2
  29. package/dist/cjs/map-select-tools_3.cjs.entry.js +1 -1
  30. package/dist/cjs/public-notification.cjs.entry.js +1 -1
  31. package/dist/cjs/solutions-components.cjs.js +1 -1
  32. package/dist/cjs/{utils-ea7a5a63.js → utils-ac836e7a.js} +1 -1
  33. package/dist/collection/utils/downloadUtils.js +38 -7
  34. package/dist/collection/utils/downloadUtils.ts +46 -7
  35. package/dist/collection/utils/test/downloadUtils.spec.js +33 -1
  36. package/dist/collection/utils/test/downloadUtils.spec.tsx +40 -1
  37. package/dist/components/downloadUtils.js +38 -7
  38. package/dist/components/instant-apps-export.js +13 -7
  39. package/dist/components/instant-apps-landing-page.js +1 -1
  40. package/dist/components/instant-apps-measurement.js +1 -1
  41. package/dist/components/instant-apps-social-share2.js +13 -7
  42. package/dist/components/instant-apps-splash.js +16 -2
  43. package/dist/components/languageUtil.js +1 -1
  44. package/dist/components/loadModules2.js +1 -1
  45. package/dist/esm/calcite-action-pad_2.entry.js +1 -1
  46. package/dist/esm/calcite-input-date-picker_3.entry.js +16 -10
  47. package/dist/esm/card-manager_3.entry.js +1 -1
  48. package/dist/esm/{downloadUtils-a6c0e25f.js → downloadUtils-0c13073b.js} +39 -8
  49. package/dist/esm/{helpers-aeddac74.js → helpers-f9256189.js} +1 -1
  50. package/dist/esm/{index.es-b0a676ae.js → index.es-ad250bc6.js} +1 -1
  51. package/dist/esm/instant-apps-ckeditor-wrapper_3.entry.js +4 -4
  52. package/dist/esm/instant-apps-control-panel.entry.js +1 -1
  53. package/dist/esm/instant-apps-export.entry.js +16 -10
  54. package/dist/esm/instant-apps-header.entry.js +1 -1
  55. package/dist/esm/instant-apps-interactive-legend-classic.entry.js +2 -2
  56. package/dist/esm/instant-apps-interactive-legend-count_2.entry.js +2 -2
  57. package/dist/esm/instant-apps-interactive-legend-group-legend-element-caption.entry.js +2 -2
  58. package/dist/esm/instant-apps-interactive-legend-group-legend-element_5.entry.js +2 -2
  59. package/dist/esm/instant-apps-interactive-legend.entry.js +4 -4
  60. package/dist/esm/instant-apps-keyboard-shortcuts.entry.js +3 -3
  61. package/dist/esm/instant-apps-landing-page.entry.js +1 -1
  62. package/dist/esm/instant-apps-language-switcher.entry.js +5 -5
  63. package/dist/esm/instant-apps-language-translator.entry.js +5 -5
  64. package/dist/esm/instant-apps-measurement.entry.js +4 -4
  65. package/dist/esm/instant-apps-popover.entry.js +3 -3
  66. package/dist/esm/instant-apps-scoreboard.entry.js +3 -3
  67. package/dist/esm/instant-apps-splash.entry.js +14 -5
  68. package/dist/esm/{languageSwitcher-4faa659f.js → languageSwitcher-068998b1.js} +1 -1
  69. package/dist/esm/{languageUtil-dc3111c1.js → languageUtil-035e7728.js} +1 -1
  70. package/dist/esm/{loadModules-877bbb89.js → loadModules-7a5f1022.js} +1 -1
  71. package/dist/esm/loader.js +1 -1
  72. package/dist/esm/{locale-bd9034e1.js → locale-4cab280d.js} +2 -2
  73. package/dist/esm/map-select-tools_3.entry.js +1 -1
  74. package/dist/esm/public-notification.entry.js +1 -1
  75. package/dist/esm/solutions-components.js +1 -1
  76. package/dist/esm/{utils-28d0a086.js → utils-78fe6e5b.js} +1 -1
  77. package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-header/instant-apps-header.css +1 -1
  78. package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-scoreboard/instant-apps-scoreboard.css +1 -1
  79. package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-social-share/instant-apps-social-share.css +8 -1
  80. package/dist/solutions-components/{p-a455c3f0.entry.js → p-00524417.entry.js} +1 -1
  81. package/dist/solutions-components/{p-8e9f96db.js → p-12a7d0d1.js} +1 -1
  82. package/dist/solutions-components/{p-a7b7f8d1.js → p-15a0e7fb.js} +1 -1
  83. package/dist/solutions-components/{p-b41e2c4c.js → p-1d3a1794.js} +11 -11
  84. package/dist/solutions-components/p-2d72eac3.entry.js +6 -0
  85. package/dist/solutions-components/{p-a2544cba.entry.js → p-30edeb79.entry.js} +1 -1
  86. package/dist/solutions-components/{p-220c46c2.entry.js → p-3a6a1ce9.entry.js} +1 -1
  87. package/dist/solutions-components/{p-a59078ee.entry.js → p-3b9e4882.entry.js} +1 -1
  88. package/dist/solutions-components/{p-8ad937b4.entry.js → p-465aa7d9.entry.js} +1 -1
  89. package/dist/solutions-components/p-4dcc150d.entry.js +6 -0
  90. package/dist/solutions-components/{p-1bca71bf.entry.js → p-4efd2af6.entry.js} +1 -1
  91. package/dist/solutions-components/{p-5a28d60c.entry.js → p-5320dc25.entry.js} +1 -1
  92. package/dist/solutions-components/{p-734d1dc5.js → p-590a2a26.js} +1 -1
  93. package/dist/solutions-components/{p-0d72a9ca.entry.js → p-5f6e7429.entry.js} +1 -1
  94. package/dist/solutions-components/{p-015a45e2.entry.js → p-65ad1625.entry.js} +1 -1
  95. package/dist/solutions-components/{p-2e7a9b9b.entry.js → p-88932d2f.entry.js} +2 -2
  96. package/dist/solutions-components/{p-104f07e3.entry.js → p-954dc86f.entry.js} +1 -1
  97. package/dist/solutions-components/{p-52b37bad.entry.js → p-989bf0bf.entry.js} +1 -1
  98. package/dist/solutions-components/{p-0f427774.entry.js → p-a0611720.entry.js} +1 -1
  99. package/dist/solutions-components/{p-c302bbea.entry.js → p-a3132356.entry.js} +1 -1
  100. package/dist/solutions-components/{p-c10b44ee.entry.js → p-a886ab7f.entry.js} +1 -1
  101. package/dist/solutions-components/{p-03037cf9.js → p-ad98c346.js} +1 -1
  102. package/dist/solutions-components/{p-03a65871.entry.js → p-bf6b4eb7.entry.js} +1 -1
  103. package/dist/solutions-components/{p-09801ba6.entry.js → p-c4ff3b52.entry.js} +3 -3
  104. package/dist/solutions-components/p-d599cfa8.entry.js +6 -0
  105. package/dist/solutions-components/{p-cfe890f6.entry.js → p-f313b45b.entry.js} +1 -1
  106. package/dist/solutions-components/{p-aec4441b.entry.js → p-fc1367d9.entry.js} +1 -1
  107. package/dist/solutions-components/{p-07626c45.js → p-fc2fb61b.js} +1 -1
  108. package/dist/solutions-components/solutions-components.esm.js +1 -1
  109. package/dist/solutions-components/utils/downloadUtils.ts +46 -7
  110. package/dist/solutions-components/utils/test/downloadUtils.spec.tsx +40 -1
  111. package/dist/types/utils/downloadUtils.d.ts +18 -4
  112. package/package.json +6 -6
  113. package/dist/solutions-components/p-7d6ee026.entry.js +0 -6
  114. package/dist/solutions-components/p-b80bc5b9.entry.js +0 -6
  115. package/dist/solutions-components/p-dd45738e.entry.js +0 -6
  116. /package/dist/solutions-components/{p-70359c2b.js → p-89218b6e.js} +0 -0
  117. /package/dist/solutions-components/{p-090e0241.js → p-e85ba21c.js} +0 -0
@@ -23,7 +23,7 @@ import{c as t,d as n}from"./p-e2d0ad1b.js";import{a as i}from"./p-7d280d8a.js";i
23
23
  * See the License for the specific language governing permissions and
24
24
  * limitations under the License.
25
25
  */
26
- var f;!function(t){t.A4="A4",t.ANSI_A="ANSI A"}(f||(f={}));class c{dataPath="";lang="en";title="";fontProps={fontResolutionInchesPerPoint:1/72,fontFullHeightRatio:1.28};imageOptions={x:0,y:0,width:0,height:0};lineOptions={x1:0,y1:0,x2:0,y2:0,lineProperties:{thickness:.1,color:"000000",opacity:1}};pageOptions={pageType:f.ANSI_A,width:8.5,height:11,leftMargin:.25,rightMargin:.25,topMargin:.25,bottomMargin:.25,drawNeatline:!1};rectangleOptions={left:0,top:0,width:8.5,height:11,lineProperties:{thickness:.1,color:"000000",opacity:1},fillColor:"",fillOpacity:1};tableOptions={lineProperties:{thickness:.1,color:"",opacity:1},textProperties:{left:0,top:0,fontPoints:1,fontColor:"000000"}};textOptions={left:0,top:0,fontPoints:1,fontColor:"000000"};static getPageSize(t){switch("string"==typeof t&&(t=t===f.A4?f.A4:f.ANSI_A),t){case f.A4:return{width:8.25,height:11.708333};case f.ANSI_A:return{width:8.5,height:11}}}addPage(){}applyOpacity(t,n){return t*n+1*(1-n)}drawImage(t,n){}drawLine(t){const n={...this.lineOptions,...t};n.lineProperties={...this.lineOptions.lineProperties,...t.lineProperties},this.updateLineProperties(n.lineProperties),this.lineOptions=n}drawNeatline(t={thickness:.005,color:"0000ff",opacity:.2}){this.drawRectangle({left:0,top:0,width:this.pageOptions.width-this.pageOptions.leftMargin-this.pageOptions.rightMargin,height:this.pageOptions.height-this.pageOptions.topMargin-this.pageOptions.bottomMargin,lineProperties:t})}drawRectangle(t){const n={...this.rectangleOptions,...t};n.lineProperties={...this.lineOptions.lineProperties,...t.lineProperties},this.updateLineProperties(n.lineProperties),this.rectangleOptions.fillColor===n.fillColor&&this.rectangleOptions.fillOpacity===n.fillOpacity||this.setFillColor(n.fillColor,n.fillOpacity),this.rectangleOptions=n}drawTable(t,n){const i={};i.lineProperties={...this.tableOptions.lineProperties,...n.lineProperties},i.textProperties={...this.tableOptions.textProperties,...n.textProperties},this.tableOptions.textProperties.fontPoints!==i.textProperties.fontPoints&&this.setFontSize(i.textProperties.fontPoints),this.tableOptions.textProperties.fontColor!==i.textProperties.fontColor&&this.setFontColor(i.textProperties.fontColor),this.updateLineProperties(i.lineProperties),this.tableOptions=i}drawText(t,n){const i={...this.textOptions,...n};this.textOptions.fontPoints!==i.fontPoints&&this.setFontSize(i.fontPoints),this.textOptions.fontColor!==i.fontColor&&this.setFontColor(i.fontColor),this.textOptions=i}fontAscenderBaselineHeight(t){return t*this.fontProps.fontResolutionInchesPerPoint}fontAscenderDescenderHeight(t){return this.fontProps.fontFullHeightRatio*this.fontAscenderBaselineHeight(t)}getFontFileName(t){let n="0b7681dc140844ee9f409bdac249fbf0-general";return"ja"===t?n="0b7681dc140844ee9f409bdac249fbf0-japanese":"ko"===t?n="0b7681dc140844ee9f409bdac249fbf0-korean":"zh-cn"===t?n="0b7681dc140844ee9f409bdac249fbf0-simplified-chinese":"zh-hk"!==t&&"zh-tw"!==t||(n="0b7681dc140844ee9f409bdac249fbf0-traditional-chinese"),n}getTextWidth(t,n){return t.length*n*this.fontProps.fontResolutionInchesPerPoint*.6}hexToRGB(t,n=1){const i=/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return i?{r:this.applyOpacity(parseInt(i[1],16)/255,n),g:this.applyOpacity(parseInt(i[2],16)/255,n),b:this.applyOpacity(parseInt(i[3],16)/255,n)}:{r:0,g:0,b:0}}async initialize(t={},n="",i="en",r="",e=!1){if("{}"!==JSON.stringify(t)){this.pageOptions.pageType=t.pageType===f.A4?f.A4:f.ANSI_A;const n=c.getPageSize(this.pageOptions.pageType);this.pageOptions.width=n.width,this.pageOptions.height=n.height,this.pageOptions.leftMargin=t.leftMargin??this.pageOptions.leftMargin,this.pageOptions.rightMargin=t.rightMargin??this.pageOptions.rightMargin,this.pageOptions.topMargin=t.topMargin??this.pageOptions.topMargin,this.pageOptions.bottomMargin=t.bottomMargin??this.pageOptions.bottomMargin}return this.dataPath=n,this.lang=i,this.title=r||"PDF Document",this.pageOptions.drawNeatline=e,Promise.resolve()}save(){}setDrawColor(t,n=1){}setFillColor(t,n=1){}setFont(t){return Promise.resolve()}setFontColor(t){}setFontSize(t){}setLang(t){return this.lang!==t?(this.lang=t,this.setFont(t)):Promise.resolve()}setLineWidth(t){}updateLineProperties(t){this.lineOptions.lineProperties.thickness!==t.thickness&&this.setLineWidth(t.thickness),this.lineOptions.lineProperties.color===t.color&&this.lineOptions.lineProperties.opacity===t.opacity||this.setDrawColor(t.color,t.opacity),this.lineOptions.lineProperties=t}}var h=t((function(t){function n(i){return t.exports=n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,n(i)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}));const l=n(h);var v=Uint8Array,d=Uint16Array,w=Uint32Array,m=new v([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,0,0,0]),b=new v([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,0,0]),p=new v([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),N=function(t,n){for(var i=new d(31),r=0;r<31;++r)i[r]=n+=1<<t[r-1];var e=new w(i[30]);for(r=1;r<30;++r)for(var s=i[r];s<i[r+1];++s)e[s]=s-i[r]<<5|r;return[i,e]},L=N(m,2),g=L[0],A=L[1];g[28]=258,A[258]=28;for(var y=N(b,0),k=y[0],S=y[1],x=new d(32768),q=0;q<32768;++q){var j=(43690&q)>>>1|(21845&q)<<1;x[q]=((65280&(j=(61680&(j=(52428&j)>>>2|(13107&j)<<2))>>>4|(3855&j)<<4))>>>8|(255&j)<<8)>>>1}var M=function(t,n,i){for(var r=t.length,e=0,s=new d(n);e<r;++e)++s[t[e]-1];var o,a=new d(n);for(e=0;e<n;++e)a[e]=a[e-1]+s[e-1]<<1;if(i){o=new d(1<<n);var u=15-n;for(e=0;e<r;++e)if(t[e])for(var f=e<<4|t[e],c=n-t[e],h=a[t[e]-1]++<<c,l=h|(1<<c)-1;h<=l;++h)o[x[h]>>>u]=f}else for(o=new d(r),e=0;e<r;++e)o[e]=x[a[t[e]-1]++]>>>15-t[e];return o},E=new v(288);for(q=0;q<144;++q)E[q]=8;for(q=144;q<256;++q)E[q]=9;for(q=256;q<280;++q)E[q]=7;for(q=280;q<288;++q)E[q]=8;var P=new v(32);for(q=0;q<32;++q)P[q]=5;var O=M(E,9,0),I=M(E,9,1),F=M(P,5,0),B=M(P,5,1),R=function(t){for(var n=t[0],i=1;i<t.length;++i)t[i]>n&&(n=t[i]);return n},T=function(t,n,i){var r=n/8>>0;return(t[r]|t[r+1]<<8)>>>(7&n)&i},C=function(t,n){var i=n/8>>0;return(t[i]|t[i+1]<<8|t[i+2]<<16)>>>(7&n)},D=function(t){return(t/8>>0)+(7&t&&1)},z=function(t,n,i){(null==n||n<0)&&(n=0),(null==i||i>t.length)&&(i=t.length);var r=new(t instanceof d?d:t instanceof w?w:v)(i-n);return r.set(t.subarray(n,i)),r},U=function(t,n,i){var r=n/8>>0;t[r]|=i<<=7&n,t[r+1]|=i>>>8},V=function(t,n,i){var r=n/8>>0;t[r]|=i<<=7&n,t[r+1]|=i>>>8,t[r+2]|=i>>>16},W=function(t,n){for(var i=[],r=0;r<t.length;++r)t[r]&&i.push({s:r,f:t[r]});var e=i.length,s=i.slice();if(!e)return[new v(0),0];if(1==e){var o=new v(i[0].s+1);return o[i[0].s]=1,[o,1]}i.sort((function(t,n){return t.f-n.f})),i.push({s:-1,f:25001});var a=i[0],u=i[1],f=0,c=1,h=2;for(i[0]={s:-1,f:a.f+u.f,l:a,r:u};c!=e-1;)a=i[i[f].f<i[h].f?f++:h++],u=i[f!=c&&i[f].f<i[h].f?f++:h++],i[c++]={s:-1,f:a.f+u.f,l:a,r:u};var l=s[0].s;for(r=1;r<e;++r)s[r].s>l&&(l=s[r].s);var w=new d(l+1),m=H(i[c-1],w,0);if(m>n){r=0;var b=0,p=m-n,N=1<<p;for(s.sort((function(t,n){return w[n.s]-w[t.s]||t.f-n.f}));r<e;++r){var L=s[r].s;if(!(w[L]>n))break;b+=N-(1<<m-w[L]),w[L]=n}for(b>>>=p;b>0;){var g=s[r].s;w[g]<n?b-=1<<n-w[g]++-1:++r}for(;r>=0&&b;--r){var A=s[r].s;w[A]==n&&(--w[A],++b)}m=n}return[new v(w),m]},H=function(t,n,i){return-1==t.s?Math.max(H(t.l,n,i+1),H(t.r,n,i+1)):n[t.s]=i},_=function(t){for(var n=t.length;n&&!t[--n];);for(var i=new d(++n),r=0,e=t[0],s=1,o=function(t){i[r++]=t},a=1;a<=n;++a)if(t[a]==e&&a!=n)++s;else{if(!e&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(e),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(e);s=1,e=t[a]}return[i.subarray(0,r),n]},G=function(t,n){for(var i=0,r=0;r<n.length;++r)i+=t[r]*n[r];return i},J=function(t,n,i){var r=i.length,e=D(n+2);t[e]=255&r,t[e+1]=r>>>8,t[e+2]=255^t[e],t[e+3]=255^t[e+1];for(var s=0;s<r;++s)t[e+s+4]=i[s];return 8*(e+4+r)},Y=function(t,n,i,r,e,s,o,a,u,f,c){U(n,c++,i),++e[256];for(var h=W(e,15),l=h[0],v=h[1],w=W(s,15),N=w[0],L=w[1],g=_(l),A=g[0],y=g[1],k=_(N),S=k[0],x=k[1],q=new d(19),j=0;j<A.length;++j)q[31&A[j]]++;for(j=0;j<S.length;++j)q[31&S[j]]++;for(var I=W(q,7),B=I[0],R=I[1],T=19;T>4&&!B[p[T-1]];--T);var C,D,z,H,Y=f+5<<3,$=G(e,E)+G(s,P)+o,K=G(e,l)+G(s,N)+o+14+3*T+G(q,B)+(2*q[16]+3*q[17]+7*q[18]);if(Y<=$&&Y<=K)return J(n,c,t.subarray(u,u+f));if(U(n,c,1+(K<$)),c+=2,K<$){C=M(l,v,0),D=l,z=M(N,L,0),H=N;var X=M(B,R,0);for(U(n,c,y-257),U(n,c+5,x-1),U(n,c+10,T-4),c+=14,j=0;j<T;++j)U(n,c+3*j,B[p[j]]);c+=3*T;for(var Z=[A,S],Q=0;Q<2;++Q){var tt=Z[Q];for(j=0;j<tt.length;++j)U(n,c,X[nt=31&tt[j]]),c+=B[nt],nt>15&&(U(n,c,tt[j]>>>5&127),c+=tt[j]>>>12)}}else C=O,D=E,z=F,H=P;for(j=0;j<a;++j)if(r[j]>255){var nt;V(n,c,C[257+(nt=r[j]>>>18&31)]),c+=D[nt+257],nt>7&&(U(n,c,r[j]>>>23&31),c+=m[nt]);var it=31&r[j];V(n,c,z[it]),c+=H[it],it>3&&(V(n,c,r[j]>>>5&8191),c+=b[it])}else V(n,c,C[r[j]]),c+=D[r[j]];return V(n,c,C[256]),c+D[256]},$=new w([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),K=new v(0);function X(t,n){void 0===n&&(n={});var i=function(){var t=1,n=0;return{p:function(i){for(var r=t,e=n,s=i.length,o=0;o!=s;){for(var a=Math.min(o+5552,s);o<a;++o)e+=r+=i[o];r%=65521,e%=65521}t=r,n=e},d:function(){return(t>>>8<<16|(255&n)<<8|n>>>8)+2*((255&t)<<23)}}}();i.p(t);var r=function(t,n,i,r,e){return function(t,n,i,r,e,s){var o=t.length,a=new v(r+o+5*(1+Math.floor(o/7e3))+e),u=a.subarray(r,a.length-e),f=0;if(!n||o<8)for(var c=0;c<=o;c+=65535){var h=c+65535;h<o?f=J(u,f,t.subarray(c,h)):(u[c]=s,f=J(u,f,t.subarray(c,o)))}else{for(var l=$[n-1],p=l>>>13,N=8191&l,L=(1<<i)-1,g=new d(32768),y=new d(L+1),k=Math.ceil(i/3),x=2*k,q=function(n){return(t[n]^t[n+1]<<k^t[n+2]<<x)&L},j=new w(25e3),M=new d(288),E=new d(32),P=0,O=0,I=(c=0,0),F=0,B=0;c<o;++c){var R=q(c),T=32767&c,C=y[R];if(g[T]=C,y[R]=T,F<=c){var U=o-c;if((P>7e3||I>24576)&&U>423){f=Y(t,u,0,j,M,E,O,I,B,c-B,f),I=P=O=0,B=c;for(var V=0;V<286;++V)M[V]=0;for(V=0;V<30;++V)E[V]=0}var W=2,H=0,_=N,G=T-C&32767;if(U>2&&R==q(c-G))for(var X=Math.min(p,U)-1,Z=Math.min(32767,c),Q=Math.min(258,U);G<=Z&&--_&&T!=C;){if(t[c+W]==t[c+W-G]){for(var tt=0;tt<Q&&t[c+tt]==t[c+tt-G];++tt);if(tt>W){if(W=tt,H=G,tt>X)break;var nt=Math.min(G,tt-2),it=0;for(V=0;V<nt;++V){var rt=c-G+V+32768&32767,et=rt-g[rt]+32768&32767;et>it&&(it=et,C=rt)}}}G+=(T=C)-(C=g[T])+32768&32767}if(H){j[I++]=268435456|A[W]<<18|S[H];var st=31&A[W],ot=31&S[H];O+=m[st]+b[ot],++M[257+st],++E[ot],F=c+W,++P}else j[I++]=t[c],++M[t[c]]}}f=Y(t,u,s,j,M,E,O,I,B,c-B,f),s||(f=J(u,f,K))}return z(a,0,r+D(f)+e)}(t,null==n.level?6:n.level,null==n.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+n.mem,i,r,!e)}(t,n,2,4);return function(t,n){var i=n.level,r=0==i?0:i<6?1:9==i?3:2;t[0]=120,t[1]=r<<6|(r?32-2*r:1)}(r,n),function(t,n,i){for(;i;++n)t[n]=i,i>>>=8}(r,r.length-4,i.d()),r}
26
+ var f;!function(t){t.A4="A4",t.ANSI_A="ANSI A"}(f||(f={}));class c{dataPath="";lang="en";title="";fontProps={fontResolutionInchesPerPoint:1/72,fontFullHeightRatio:1.28};imageOptions={x:0,y:0,width:0,height:0};lineOptions={x1:0,y1:0,x2:0,y2:0,lineProperties:{thickness:.1,color:"000000",opacity:1}};pageOptions={pageType:f.ANSI_A,width:8.5,height:11,leftMargin:.25,rightMargin:.25,topMargin:.25,bottomMargin:.25,drawNeatline:!1};rectangleOptions={left:0,top:0,width:8.5,height:11,lineProperties:{thickness:.1,color:"000000",opacity:1},fillColor:"",fillOpacity:1};tableOptions={lineProperties:{thickness:.1,color:"",opacity:1},textProperties:{left:0,top:0,fontPoints:1,fontColor:"000000"}};textOptions={left:0,top:0,fontPoints:1,fontColor:"000000"};static getPageSize(t){switch("string"==typeof t&&(t=t===f.A4?f.A4:f.ANSI_A),t){case f.A4:return{width:8.25,height:11.708333};case f.ANSI_A:return{width:8.5,height:11}}}addPage(){}applyOpacity(t,n){return t*n+1*(1-n)}drawImage(t,n){}drawLine(t){const n={...this.lineOptions,...t};n.lineProperties={...this.lineOptions.lineProperties,...t.lineProperties},this.updateLineProperties(n.lineProperties),this.lineOptions=n}drawNeatline(t={thickness:.005,color:"0000ff",opacity:.2}){this.drawRectangle({left:0,top:0,width:this.pageOptions.width-this.pageOptions.leftMargin-this.pageOptions.rightMargin,height:this.pageOptions.height-this.pageOptions.topMargin-this.pageOptions.bottomMargin,lineProperties:t})}drawRectangle(t){const n={...this.rectangleOptions,...t};n.lineProperties={...this.lineOptions.lineProperties,...t.lineProperties},this.updateLineProperties(n.lineProperties),this.rectangleOptions.fillColor===n.fillColor&&this.rectangleOptions.fillOpacity===n.fillOpacity||this.setFillColor(n.fillColor,n.fillOpacity),this.rectangleOptions=n}drawTable(t,n){const i={};i.lineProperties={...this.tableOptions.lineProperties,...n.lineProperties},i.textProperties={...this.tableOptions.textProperties,...n.textProperties},this.tableOptions.textProperties.fontPoints!==i.textProperties.fontPoints&&this.setFontSize(i.textProperties.fontPoints),this.tableOptions.textProperties.fontColor!==i.textProperties.fontColor&&this.setFontColor(i.textProperties.fontColor),this.updateLineProperties(i.lineProperties),this.tableOptions=i}drawText(t,n){const i={...this.textOptions,...n};this.textOptions.fontPoints!==i.fontPoints&&this.setFontSize(i.fontPoints),this.textOptions.fontColor!==i.fontColor&&this.setFontColor(i.fontColor),this.textOptions=i}fontAscenderBaselineHeight(t){return t*this.fontProps.fontResolutionInchesPerPoint}fontAscenderDescenderHeight(t){return this.fontProps.fontFullHeightRatio*this.fontAscenderBaselineHeight(t)}getFontFileName(t){let n="0b7681dc140844ee9f409bdac249fbf0-general";return"ja"===t?n="0b7681dc140844ee9f409bdac249fbf0-japanese":"ko"===t?n="0b7681dc140844ee9f409bdac249fbf0-korean":"zh-cn"===t?n="0b7681dc140844ee9f409bdac249fbf0-simplified-chinese":"zh-hk"!==t&&"zh-tw"!==t||(n="0b7681dc140844ee9f409bdac249fbf0-traditional-chinese"),n}getTextWidth(t,n){return t.length*n*this.fontProps.fontResolutionInchesPerPoint*.6}hexToRGB(t,n=1){const i=/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return i?{r:this.applyOpacity(parseInt(i[1],16)/255,n),g:this.applyOpacity(parseInt(i[2],16)/255,n),b:this.applyOpacity(parseInt(i[3],16)/255,n)}:{r:0,g:0,b:0}}async initialize(t={},n="",i="en",r="",e=!1){if("{}"!==JSON.stringify(t)){this.pageOptions.pageType=t.pageType===f.A4?f.A4:f.ANSI_A;const n=c.getPageSize(this.pageOptions.pageType);this.pageOptions.width=n.width,this.pageOptions.height=n.height,this.pageOptions.leftMargin=t.leftMargin??this.pageOptions.leftMargin,this.pageOptions.rightMargin=t.rightMargin??this.pageOptions.rightMargin,this.pageOptions.topMargin=t.topMargin??this.pageOptions.topMargin,this.pageOptions.bottomMargin=t.bottomMargin??this.pageOptions.bottomMargin}return this.dataPath=n,this.lang=i,this.title=r||"PDF Document",this.pageOptions.drawNeatline=e,Promise.resolve()}save(){}setDrawColor(t,n=1){}setFillColor(t,n=1){}setFont(t){return Promise.resolve()}setFontColor(t){}setFontSize(t){}setLang(t){return this.lang!==t?(this.lang=t,this.setFont(t)):Promise.resolve()}setLineWidth(t){}updateLineProperties(t){this.lineOptions.lineProperties.thickness!==t.thickness&&this.setLineWidth(t.thickness),this.lineOptions.lineProperties.color===t.color&&this.lineOptions.lineProperties.opacity===t.opacity||this.setDrawColor(t.color,t.opacity),this.lineOptions.lineProperties=t}}var h=t((function(t){function n(i){return t.exports=n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,n(i)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}));const l=n(h);var v=Uint8Array,d=Uint16Array,w=Uint32Array,m=new v([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,0,0,0]),b=new v([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,0,0]),p=new v([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),N=function(t,n){for(var i=new d(31),r=0;r<31;++r)i[r]=n+=1<<t[r-1];var e=new w(i[30]);for(r=1;r<30;++r)for(var s=i[r];s<i[r+1];++s)e[s]=s-i[r]<<5|r;return[i,e]},L=N(m,2),g=L[0],A=L[1];g[28]=258,A[258]=28;for(var y=N(b,0),k=y[0],S=y[1],x=new d(32768),q=0;q<32768;++q){var j=(43690&q)>>>1|(21845&q)<<1;x[q]=((65280&(j=(61680&(j=(52428&j)>>>2|(13107&j)<<2))>>>4|(3855&j)<<4))>>>8|(255&j)<<8)>>>1}var M=function(t,n,i){for(var r=t.length,e=0,s=new d(n);e<r;++e)++s[t[e]-1];var o,a=new d(n);for(e=0;e<n;++e)a[e]=a[e-1]+s[e-1]<<1;if(i){o=new d(1<<n);var u=15-n;for(e=0;e<r;++e)if(t[e])for(var f=e<<4|t[e],c=n-t[e],h=a[t[e]-1]++<<c,l=h|(1<<c)-1;h<=l;++h)o[x[h]>>>u]=f}else for(o=new d(r),e=0;e<r;++e)o[e]=x[a[t[e]-1]++]>>>15-t[e];return o},E=new v(288);for(q=0;q<144;++q)E[q]=8;for(q=144;q<256;++q)E[q]=9;for(q=256;q<280;++q)E[q]=7;for(q=280;q<288;++q)E[q]=8;var P=new v(32);for(q=0;q<32;++q)P[q]=5;var O=M(E,9,0),I=M(E,9,1),F=M(P,5,0),B=M(P,5,1),R=function(t){for(var n=t[0],i=1;i<t.length;++i)t[i]>n&&(n=t[i]);return n},T=function(t,n,i){var r=n/8>>0;return(t[r]|t[r+1]<<8)>>>(7&n)&i},C=function(t,n){var i=n/8>>0;return(t[i]|t[i+1]<<8|t[i+2]<<16)>>>(7&n)},D=function(t){return(t/8>>0)+(7&t&&1)},z=function(t,n,i){(null==n||n<0)&&(n=0),(null==i||i>t.length)&&(i=t.length);var r=new(t instanceof d?d:t instanceof w?w:v)(i-n);return r.set(t.subarray(n,i)),r},U=function(t,n,i){var r=n/8>>0;t[r]|=i<<=7&n,t[r+1]|=i>>>8},V=function(t,n,i){var r=n/8>>0;t[r]|=i<<=7&n,t[r+1]|=i>>>8,t[r+2]|=i>>>16},W=function(t,n){for(var i=[],r=0;r<t.length;++r)t[r]&&i.push({s:r,f:t[r]});var e=i.length,s=i.slice();if(!e)return[new v(0),0];if(1==e){var o=new v(i[0].s+1);return o[i[0].s]=1,[o,1]}i.sort((function(t,n){return t.f-n.f})),i.push({s:-1,f:25001});var a=i[0],u=i[1],f=0,c=1,h=2;for(i[0]={s:-1,f:a.f+u.f,l:a,r:u};c!=e-1;)a=i[i[f].f<i[h].f?f++:h++],u=i[f!=c&&i[f].f<i[h].f?f++:h++],i[c++]={s:-1,f:a.f+u.f,l:a,r:u};var l=s[0].s;for(r=1;r<e;++r)s[r].s>l&&(l=s[r].s);var w=new d(l+1),m=_(i[c-1],w,0);if(m>n){r=0;var b=0,p=m-n,N=1<<p;for(s.sort((function(t,n){return w[n.s]-w[t.s]||t.f-n.f}));r<e;++r){var L=s[r].s;if(!(w[L]>n))break;b+=N-(1<<m-w[L]),w[L]=n}for(b>>>=p;b>0;){var g=s[r].s;w[g]<n?b-=1<<n-w[g]++-1:++r}for(;r>=0&&b;--r){var A=s[r].s;w[A]==n&&(--w[A],++b)}m=n}return[new v(w),m]},_=function(t,n,i){return-1==t.s?Math.max(_(t.l,n,i+1),_(t.r,n,i+1)):n[t.s]=i},H=function(t){for(var n=t.length;n&&!t[--n];);for(var i=new d(++n),r=0,e=t[0],s=1,o=function(t){i[r++]=t},a=1;a<=n;++a)if(t[a]==e&&a!=n)++s;else{if(!e&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(e),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(e);s=1,e=t[a]}return[i.subarray(0,r),n]},G=function(t,n){for(var i=0,r=0;r<n.length;++r)i+=t[r]*n[r];return i},J=function(t,n,i){var r=i.length,e=D(n+2);t[e]=255&r,t[e+1]=r>>>8,t[e+2]=255^t[e],t[e+3]=255^t[e+1];for(var s=0;s<r;++s)t[e+s+4]=i[s];return 8*(e+4+r)},Y=function(t,n,i,r,e,s,o,a,u,f,c){U(n,c++,i),++e[256];for(var h=W(e,15),l=h[0],v=h[1],w=W(s,15),N=w[0],L=w[1],g=H(l),A=g[0],y=g[1],k=H(N),S=k[0],x=k[1],q=new d(19),j=0;j<A.length;++j)q[31&A[j]]++;for(j=0;j<S.length;++j)q[31&S[j]]++;for(var I=W(q,7),B=I[0],R=I[1],T=19;T>4&&!B[p[T-1]];--T);var C,D,z,_,Y=f+5<<3,$=G(e,E)+G(s,P)+o,K=G(e,l)+G(s,N)+o+14+3*T+G(q,B)+(2*q[16]+3*q[17]+7*q[18]);if(Y<=$&&Y<=K)return J(n,c,t.subarray(u,u+f));if(U(n,c,1+(K<$)),c+=2,K<$){C=M(l,v,0),D=l,z=M(N,L,0),_=N;var X=M(B,R,0);for(U(n,c,y-257),U(n,c+5,x-1),U(n,c+10,T-4),c+=14,j=0;j<T;++j)U(n,c+3*j,B[p[j]]);c+=3*T;for(var Z=[A,S],Q=0;Q<2;++Q){var tt=Z[Q];for(j=0;j<tt.length;++j)U(n,c,X[nt=31&tt[j]]),c+=B[nt],nt>15&&(U(n,c,tt[j]>>>5&127),c+=tt[j]>>>12)}}else C=O,D=E,z=F,_=P;for(j=0;j<a;++j)if(r[j]>255){var nt;V(n,c,C[257+(nt=r[j]>>>18&31)]),c+=D[nt+257],nt>7&&(U(n,c,r[j]>>>23&31),c+=m[nt]);var it=31&r[j];V(n,c,z[it]),c+=_[it],it>3&&(V(n,c,r[j]>>>5&8191),c+=b[it])}else V(n,c,C[r[j]]),c+=D[r[j]];return V(n,c,C[256]),c+D[256]},$=new w([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),K=new v(0);function X(t,n){void 0===n&&(n={});var i=function(){var t=1,n=0;return{p:function(i){for(var r=t,e=n,s=i.length,o=0;o!=s;){for(var a=Math.min(o+5552,s);o<a;++o)e+=r+=i[o];r%=65521,e%=65521}t=r,n=e},d:function(){return(t>>>8<<16|(255&n)<<8|n>>>8)+2*((255&t)<<23)}}}();i.p(t);var r=function(t,n,i,r,e){return function(t,n,i,r,e,s){var o=t.length,a=new v(r+o+5*(1+Math.floor(o/7e3))+e),u=a.subarray(r,a.length-e),f=0;if(!n||o<8)for(var c=0;c<=o;c+=65535){var h=c+65535;h<o?f=J(u,f,t.subarray(c,h)):(u[c]=s,f=J(u,f,t.subarray(c,o)))}else{for(var l=$[n-1],p=l>>>13,N=8191&l,L=(1<<i)-1,g=new d(32768),y=new d(L+1),k=Math.ceil(i/3),x=2*k,q=function(n){return(t[n]^t[n+1]<<k^t[n+2]<<x)&L},j=new w(25e3),M=new d(288),E=new d(32),P=0,O=0,I=(c=0,0),F=0,B=0;c<o;++c){var R=q(c),T=32767&c,C=y[R];if(g[T]=C,y[R]=T,F<=c){var U=o-c;if((P>7e3||I>24576)&&U>423){f=Y(t,u,0,j,M,E,O,I,B,c-B,f),I=P=O=0,B=c;for(var V=0;V<286;++V)M[V]=0;for(V=0;V<30;++V)E[V]=0}var W=2,_=0,H=N,G=T-C&32767;if(U>2&&R==q(c-G))for(var X=Math.min(p,U)-1,Z=Math.min(32767,c),Q=Math.min(258,U);G<=Z&&--H&&T!=C;){if(t[c+W]==t[c+W-G]){for(var tt=0;tt<Q&&t[c+tt]==t[c+tt-G];++tt);if(tt>W){if(W=tt,_=G,tt>X)break;var nt=Math.min(G,tt-2),it=0;for(V=0;V<nt;++V){var rt=c-G+V+32768&32767,et=rt-g[rt]+32768&32767;et>it&&(it=et,C=rt)}}}G+=(T=C)-(C=g[T])+32768&32767}if(_){j[I++]=268435456|A[W]<<18|S[_];var st=31&A[W],ot=31&S[_];O+=m[st]+b[ot],++M[257+st],++E[ot],F=c+W,++P}else j[I++]=t[c],++M[t[c]]}}f=Y(t,u,s,j,M,E,O,I,B,c-B,f),s||(f=J(u,f,K))}return z(a,0,r+D(f)+e)}(t,null==n.level?6:n.level,null==n.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+n.mem,i,r,!e)}(t,n,2,4);return function(t,n){var i=n.level,r=0==i?0:i<6?1:9==i?3:2;t[0]=120,t[1]=r<<6|(r?32-2*r:1)}(r,n),function(t,n,i){for(;i;++n)t[n]=i,i>>>=8}(r,r.length-4,i.d()),r}
27
27
  /** @license
28
28
  *
29
29
  * jsPDF - PDF Document creation from JavaScript
@@ -107,7 +107,7 @@ var Z=function(){return"undefined"!=typeof window?window:"undefined"!=typeof glo
107
107
  * https://www.cs.cmu.edu/~dst/Adobe/Gallery/anon21jul01-pdf-encryption.txt
108
108
  * https://github.com/foliojs/pdfkit/blob/master/lib/security.js
109
109
  * http://www.fpdf.org/en/script/script37.php
110
- */var yt={print:4,modify:8,copy:16,"annot-forms":32};function kt(t,n,i,r){this.v=1,this.r=2;var e=192;t.forEach((function(t){if(void 0!==yt.perm)throw new Error("Invalid permission: "+t);e+=yt[t]})),this.padding="(¿N^NuŠAd\0NVÿú\b..\0¶Ðh>€/\f©þdSiz";var s=(n+this.padding).substr(0,32),o=(i+this.padding).substr(0,32);this.O=this.processOwnerPassword(s,o),this.P=-(1+(255^e)),this.encryptionKey=Nt(s+this.O+this.lsbFirstWord(this.P)+this.hexToBytes(r)).substr(0,5),this.U=At(this.encryptionKey,this.padding)}function St(t){if(/[^\u0000-\u00ff]/.test(t))throw new Error("Invalid PDF Name Object: "+t+", Only accept ASCII characters.");for(var n="",i=t.length,r=0;r<i;r++){var e=t.charCodeAt(r);n+=e<33||35===e||37===e||40===e||41===e||47===e||60===e||62===e||91===e||93===e||123===e||125===e||e>126?"#"+("0"+e.toString(16)).slice(-2):t[r]}return n}function xt(t){if("object"!==l(t))throw new Error("Invalid Context passed to initialize PubSub (jsPDF-module)");var n={};this.subscribe=function(t,i,r){if(r=r||!1,"string"!=typeof t||"function"!=typeof i||"boolean"!=typeof r)throw new Error("Invalid arguments passed to PubSub.subscribe (jsPDF-module)");n.hasOwnProperty(t)||(n[t]={});var e=Math.random().toString(35);return n[t][e]=[i,!!r],e},this.unsubscribe=function(t){for(var i in n)if(n[i][t])return delete n[i][t],0===Object.keys(n[i]).length&&delete n[i],!0;return!1},this.publish=function(i){if(n.hasOwnProperty(i)){var r=Array.prototype.slice.call(arguments,1),e=[];for(var s in n[i]){var o=n[i][s];try{o[0].apply(t,r)}catch(i){Z.console&&tt.error("jsPDF PubSub Error",i.message,i)}o[1]&&e.push(s)}e.length&&e.forEach(this.unsubscribe)}},this.getTopics=function(){return n}}function qt(t){if(!(this instanceof qt))return new qt(t);var n="opacity,stroke-opacity".split(",");for(var i in t)t.hasOwnProperty(i)&&n.indexOf(i)>=0&&(this[i]=t[i]);this.id="",this.objectNumber=-1}function jt(t,n){this.gState=t,this.matrix=n,this.id="",this.objectNumber=-1}function Mt(t,n,i,r,e){if(!(this instanceof Mt))return new Mt(t,n,i,r,e);this.type="axial"===t?2:3,this.coords=n,this.colors=i,jt.call(this,r,e)}function Et(t,n,i,r,e){if(!(this instanceof Et))return new Et(t,n,i,r,e);this.boundingBox=t,this.xStep=n,this.yStep=i,this.stream="",this.cloneIndex=0,jt.call(this,r,e)}function Pt(t){var n,i="string"==typeof arguments[0]?arguments[0]:"p",r=arguments[1],e=arguments[2],s=arguments[3],o=[],a=1,u=16,f="S",c=null;"object"===l(t=t||{})&&(i=t.orientation,r=t.unit||r,e=t.format||e,s=t.compress||t.compressPdf||s,null!==(c=t.encryption||null)&&(c.userPassword=c.userPassword||"",c.ownerPassword=c.ownerPassword||"",c.userPermissions=c.userPermissions||[]),a="number"==typeof t.userUnit?Math.abs(t.userUnit):1,void 0!==t.precision&&(n=t.precision),void 0!==t.floatPrecision&&(u=t.floatPrecision),f=t.defaultPathOperation||"S"),o=t.filters||(!0===s?["FlateEncode"]:o),r=r||"mm",i=(""+(i||"P")).toLowerCase();var h=t.putOnlyUsedFonts||!1,v={},d={internal:{},__private__:{}};d.__private__.PubSub=xt;var w="1.3",m=d.__private__.getPdfVersion=function(){return w};d.__private__.setPdfVersion=function(t){w=t};var b={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};d.__private__.getPageFormats=function(){return b};var p=d.__private__.getPageFormat=function(t){return b[t]};e=e||"a4";var N="compat",L="advanced",g=N;function A(){this.saveGraphicsState(),Q(new Ht(pt,0,0,-pt,0,gi()*pt).toString()+" cm"),this.setFontSize(this.getFontSize()/pt),f="n",g=L}function y(){this.restoreGraphicsState(),f="S",g=N}var k=d.__private__.combineFontStyleAndFontWeight=function(t,n){if("bold"==t&&"normal"==n||"bold"==t&&400==n||"normal"==t&&"italic"==n||"bold"==t&&"italic"==n)throw new Error("Invalid Combination of fontweight and fontstyle");return n&&(t=400==n||"normal"===n?"italic"===t?"italic":"normal":700!=n&&"bold"!==n||"normal"!==t?(700==n?"bold":n)+""+t:"bold"),t};d.advancedAPI=function(t){var n=g===N;return n&&A.call(this),"function"!=typeof t||(t(this),n&&y.call(this)),this},d.compatAPI=function(t){var n=g===L;return n&&y.call(this),"function"!=typeof t||(t(this),n&&A.call(this)),this},d.isAdvancedAPI=function(){return g===L};var S,x=function(t){if(g!==L)throw new Error(t+" is only available in 'advanced' API mode. You need to call advancedAPI() first.")},q=d.roundToPrecision=d.__private__.roundToPrecision=function(t,i){var r=n||i;if(isNaN(t)||isNaN(r))throw new Error("Invalid argument passed to jsPDF.roundToPrecision");return t.toFixed(r).replace(/0+$/,"")};S=d.hpf=d.__private__.hpf="number"==typeof u?function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.hpf");return q(t,u)}:"smart"===u?function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.hpf");return q(t,t>-1&&t<1?16:5)}:function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.hpf");return q(t,16)};var j=d.f2=d.__private__.f2=function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.f2");return q(t,2)},M=d.__private__.f3=function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.f3");return q(t,3)},E=d.scale=d.__private__.scale=function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.scale");return g===N?t*pt:g===L?t:void 0},P=function(t){return E(function(t){return g===N?gi()-t:g===L?t:void 0}(t))};d.__private__.setPrecision=d.setPrecision=function(t){"number"==typeof parseInt(t,10)&&(n=parseInt(t,10))};var O,I="00000000000000000000000000000000",F=d.__private__.getFileId=function(){return I},B=d.__private__.setFileId=function(t){return I=void 0!==t&&/^[a-fA-F0-9]{32}$/.test(t)?t.toUpperCase():I.split("").map((function(){return"ABCDEF0123456789".charAt(Math.floor(16*Math.random()))})).join(""),null!==c&&(Pn=new kt(c.userPermissions,c.userPassword,c.ownerPassword,I)),I};d.setFileId=function(t){return B(t),this},d.getFileId=function(){return F()};var R=d.__private__.convertDateToPDFDate=function(t){var n=t.getTimezoneOffset(),i=n<0?"+":"-",r=Math.floor(Math.abs(n/60)),e=Math.abs(n%60),s=[i,U(r),"'",U(e),"'"].join("");return["D:",t.getFullYear(),U(t.getMonth()+1),U(t.getDate()),U(t.getHours()),U(t.getMinutes()),U(t.getSeconds()),s].join("")},T=d.__private__.convertPDFDateToDate=function(t){var n=parseInt(t.substr(2,4),10),i=parseInt(t.substr(6,2),10)-1,r=parseInt(t.substr(8,2),10),e=parseInt(t.substr(10,2),10),s=parseInt(t.substr(12,2),10),o=parseInt(t.substr(14,2),10);return new Date(n,i,r,e,s,o,0)},C=d.__private__.setCreationDate=function(t){var n;if(void 0===t&&(t=new Date),t instanceof Date)n=R(t);else{if(!/^D:(20[0-2][0-9]|203[0-7]|19[7-9][0-9])(0[0-9]|1[0-2])([0-2][0-9]|3[0-1])(0[0-9]|1[0-9]|2[0-3])(0[0-9]|[1-5][0-9])(0[0-9]|[1-5][0-9])(\+0[0-9]|\+1[0-4]|-0[0-9]|-1[0-1])'(0[0-9]|[1-5][0-9])'?$/.test(t))throw new Error("Invalid argument passed to jsPDF.setCreationDate");n=t}return O=n},D=d.__private__.getCreationDate=function(t){var n=O;return"jsDate"===t&&(n=T(O)),n};d.setCreationDate=function(t){return C(t),this},d.getCreationDate=function(t){return D(t)};var z,U=d.__private__.padd2=function(t){return("0"+parseInt(t)).slice(-2)},V=d.__private__.padd2Hex=function(t){return("00"+(t=t.toString())).substr(t.length)},W=0,H=[],_=[],G=0,J=[],Y=[],$=!1,K=_;d.__private__.setCustomOutputDestination=function(t){$=!0,K=t};var X=function(t){$||(K=t)};d.__private__.resetCustomOutputDestination=function(){$=!1,K=_};var Q=d.__private__.out=function(t){return t=t.toString(),G+=t.length+1,K.push(t),K},nt=d.__private__.write=function(t){return Q(1===arguments.length?t.toString():Array.prototype.join.call(arguments," "))},it=d.__private__.getArrayBuffer=function(t){for(var n=t.length,i=new ArrayBuffer(n),r=new Uint8Array(i);n--;)r[n]=t.charCodeAt(n);return i},rt=[["Helvetica","helvetica","normal","WinAnsiEncoding"],["Helvetica-Bold","helvetica","bold","WinAnsiEncoding"],["Helvetica-Oblique","helvetica","italic","WinAnsiEncoding"],["Helvetica-BoldOblique","helvetica","bolditalic","WinAnsiEncoding"],["Courier","courier","normal","WinAnsiEncoding"],["Courier-Bold","courier","bold","WinAnsiEncoding"],["Courier-Oblique","courier","italic","WinAnsiEncoding"],["Courier-BoldOblique","courier","bolditalic","WinAnsiEncoding"],["Times-Roman","times","normal","WinAnsiEncoding"],["Times-Bold","times","bold","WinAnsiEncoding"],["Times-Italic","times","italic","WinAnsiEncoding"],["Times-BoldItalic","times","bolditalic","WinAnsiEncoding"],["ZapfDingbats","zapfdingbats","normal",null],["Symbol","symbol","normal",null]];d.__private__.getStandardFonts=function(){return rt};var et=t.fontSize||16;d.__private__.setFontSize=d.setFontSize=function(t){return et=g===L?t/pt:t,this};var ut,ft=d.__private__.getFontSize=d.getFontSize=function(){return g===N?et:et*pt},ct=t.R2L||!1;d.__private__.setR2L=d.setR2L=function(t){return ct=t,this},d.__private__.getR2L=d.getR2L=function(){return ct};var ht,lt=d.__private__.setZoomMode=function(t){if(/^(?:\d+\.\d*|\d*\.\d+|\d+)%$/.test(t))ut=t;else if(isNaN(t)){if(-1===[void 0,null,"fullwidth","fullheight","fullpage","original"].indexOf(t))throw new Error('zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. "'+t+'" is not recognized.');ut=t}else ut=parseInt(t,10)};d.__private__.getZoomMode=function(){return ut};var vt,dt=d.__private__.setPageMode=function(t){if(-1==[void 0,null,"UseNone","UseOutlines","UseThumbs","FullScreen"].indexOf(t))throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "'+t+'" is not recognized.');ht=t};d.__private__.getPageMode=function(){return ht};var wt=d.__private__.setLayoutMode=function(t){if(-1==[void 0,null,"continuous","single","twoleft","tworight","two"].indexOf(t))throw new Error('Layout mode must be one of continuous, single, twoleft, tworight. "'+t+'" is not recognized.');vt=t};d.__private__.getLayoutMode=function(){return vt},d.__private__.setDisplayMode=d.setDisplayMode=function(t,n,i){return lt(t),wt(n),dt(i),this};var mt={title:"",subject:"",author:"",keywords:"",creator:""};d.__private__.getDocumentProperty=function(t){if(-1===Object.keys(mt).indexOf(t))throw new Error("Invalid argument passed to jsPDF.getDocumentProperty");return mt[t]},d.__private__.getDocumentProperties=function(){return mt},d.__private__.setDocumentProperties=d.setProperties=d.setDocumentProperties=function(t){for(var n in mt)mt.hasOwnProperty(n)&&t[n]&&(mt[n]=t[n]);return this},d.__private__.setDocumentProperty=function(t,n){if(-1===Object.keys(mt).indexOf(t))throw new Error("Invalid arguments passed to jsPDF.setDocumentProperty");return mt[t]=n};var bt,pt,Nt,Lt,gt,At={},yt={},jt=[],Ot={},It={},Ft={},Bt={},Rt=null,Tt=0,Ct=[],Dt=new xt(d),zt=t.hotfixes||[],Ut={},Vt={},Wt=[],Ht=function t(n,i,r,e,s,o){if(!(this instanceof t))return new t(n,i,r,e,s,o);isNaN(n)&&(n=1),isNaN(i)&&(i=0),isNaN(r)&&(r=0),isNaN(e)&&(e=1),isNaN(s)&&(s=0),isNaN(o)&&(o=0),this._matrix=[n,i,r,e,s,o]};Object.defineProperty(Ht.prototype,"sx",{get:function(){return this._matrix[0]},set:function(t){this._matrix[0]=t}}),Object.defineProperty(Ht.prototype,"shy",{get:function(){return this._matrix[1]},set:function(t){this._matrix[1]=t}}),Object.defineProperty(Ht.prototype,"shx",{get:function(){return this._matrix[2]},set:function(t){this._matrix[2]=t}}),Object.defineProperty(Ht.prototype,"sy",{get:function(){return this._matrix[3]},set:function(t){this._matrix[3]=t}}),Object.defineProperty(Ht.prototype,"tx",{get:function(){return this._matrix[4]},set:function(t){this._matrix[4]=t}}),Object.defineProperty(Ht.prototype,"ty",{get:function(){return this._matrix[5]},set:function(t){this._matrix[5]=t}}),Object.defineProperty(Ht.prototype,"a",{get:function(){return this._matrix[0]},set:function(t){this._matrix[0]=t}}),Object.defineProperty(Ht.prototype,"b",{get:function(){return this._matrix[1]},set:function(t){this._matrix[1]=t}}),Object.defineProperty(Ht.prototype,"c",{get:function(){return this._matrix[2]},set:function(t){this._matrix[2]=t}}),Object.defineProperty(Ht.prototype,"d",{get:function(){return this._matrix[3]},set:function(t){this._matrix[3]=t}}),Object.defineProperty(Ht.prototype,"e",{get:function(){return this._matrix[4]},set:function(t){this._matrix[4]=t}}),Object.defineProperty(Ht.prototype,"f",{get:function(){return this._matrix[5]},set:function(t){this._matrix[5]=t}}),Object.defineProperty(Ht.prototype,"rotation",{get:function(){return Math.atan2(this.shx,this.sx)}}),Object.defineProperty(Ht.prototype,"scaleX",{get:function(){return this.decompose().scale.sx}}),Object.defineProperty(Ht.prototype,"scaleY",{get:function(){return this.decompose().scale.sy}}),Object.defineProperty(Ht.prototype,"isIdentity",{get:function(){return 1===this.sx&&0===this.shy&&0===this.shx&&1===this.sy&&0===this.tx&&0===this.ty}}),Ht.prototype.join=function(t){return[this.sx,this.shy,this.shx,this.sy,this.tx,this.ty].map(S).join(t)},Ht.prototype.multiply=function(t){return new Ht(t.sx*this.sx+t.shy*this.shx,t.sx*this.shy+t.shy*this.sy,t.shx*this.sx+t.sy*this.shx,t.shx*this.shy+t.sy*this.sy,t.tx*this.sx+t.ty*this.shx+this.tx,t.tx*this.shy+t.ty*this.sy+this.ty)},Ht.prototype.decompose=function(){var t=this.sx,n=this.shy,i=this.shx,r=this.sy,e=this.tx,s=this.ty,o=Math.sqrt(t*t+n*n),a=(t/=o)*i+(n/=o)*r;i-=t*a,r-=n*a;var u=Math.sqrt(i*i+r*r);return a/=u,t*(r/=u)<n*(i/=u)&&(t=-t,n=-n,a=-a,o=-o),{scale:new Ht(o,0,0,u,0,0),translate:new Ht(1,0,0,1,e,s),rotate:new Ht(t,n,-n,t,0,0),skew:new Ht(1,0,a,1,0,0)}},Ht.prototype.toString=function(){return this.join(" ")},Ht.prototype.inversed=function(){var t=this.sx,n=this.shy,i=this.shx,r=this.sy,e=this.tx,s=this.ty,o=1/(t*r-n*i),a=r*o,u=-n*o,f=-i*o,c=t*o;return new Ht(a,u,f,c,-a*e-f*s,-u*e-c*s)},Ht.prototype.applyToPoint=function(t){return new di(t.x*this.sx+t.y*this.shx+this.tx,t.x*this.shy+t.y*this.sy+this.ty)},Ht.prototype.applyToRectangle=function(t){var n=this.applyToPoint(t),i=this.applyToPoint(new di(t.x+t.w,t.y+t.h));return new wi(n.x,n.y,i.x-n.x,i.y-n.y)},Ht.prototype.clone=function(){return new Ht(this.sx,this.shy,this.shx,this.sy,this.tx,this.ty)},d.Matrix=Ht;var _t=d.matrixMult=function(t,n){return n.multiply(t)},Gt=new Ht(1,0,0,1,0,0);d.unitMatrix=d.identityMatrix=Gt;var Jt=function(t,n){if(!It[t]){var i=(n instanceof Mt?"Sh":"P")+(Object.keys(Ot).length+1).toString(10);n.id=i,It[t]=i,Ot[i]=n,Dt.publish("addPattern",n)}};d.ShadingPattern=Mt,d.TilingPattern=Et,d.addShadingPattern=function(t,n){return x("addShadingPattern()"),Jt(t,n),this},d.beginTilingPattern=function(t){x("beginTilingPattern()"),bi(t.boundingBox[0],t.boundingBox[1],t.boundingBox[2]-t.boundingBox[0],t.boundingBox[3]-t.boundingBox[1],t.matrix)},d.endTilingPattern=function(t,n){x("endTilingPattern()"),n.stream=Y[z].join("\n"),Jt(t,n),Dt.publish("endTilingPattern",n),Wt.pop().restore()};var Yt=d.__private__.newObject=function(){var t=$t();return Kt(t,!0),t},$t=d.__private__.newObjectDeferred=function(){return W++,H[W]=function(){return G},W},Kt=function(t,n){return n="boolean"==typeof n&&n,H[t]=G,n&&Q(t+" 0 obj"),t},Xt=d.__private__.newAdditionalObject=function(){var t={objId:$t(),content:""};return J.push(t),t},Zt=$t(),Qt=$t(),tn=d.__private__.decodeColorString=function(t){var n=t.split(" ");if(2!==n.length||"g"!==n[1]&&"G"!==n[1])5!==n.length||"k"!==n[4]&&"K"!==n[4]||(n=[(1-n[0])*(1-n[3]),(1-n[1])*(1-n[3]),(1-n[2])*(1-n[3]),"r"]);else{var i=parseFloat(n[0]);n=[i,i,i,"r"]}for(var r="#",e=0;e<3;e++)r+=("0"+Math.floor(255*parseFloat(n[e])).toString(16)).slice(-2);return r},nn=d.__private__.encodeColorString=function(t){var n;"string"==typeof t&&(t={ch1:t});var i=t.ch1,r=t.ch2,e=t.ch3,s=t.ch4,o="draw"===t.pdfColorType?["G","RG","K"]:["g","rg","k"];if("string"==typeof i&&"#"!==i.charAt(0)){var a=new at(i);if(a.ok)i=a.toHex();else if(!/^\d*\.?\d*$/.test(i))throw new Error('Invalid color "'+i+'" passed to jsPDF.encodeColorString.')}if("string"==typeof i&&/^#[0-9A-Fa-f]{3}$/.test(i)&&(i="#"+i[1]+i[1]+i[2]+i[2]+i[3]+i[3]),"string"==typeof i&&/^#[0-9A-Fa-f]{6}$/.test(i)){var u=parseInt(i.substr(1),16);i=u>>16&255,r=u>>8&255,e=255&u}if(void 0===r||void 0===s&&i===r&&r===e)n="string"==typeof i?i+" "+o[0]:2===t.precision?j(i/255)+" "+o[0]:M(i/255)+" "+o[0];else if(void 0===s||"object"===l(s)){if(s&&!isNaN(s.a)&&0===s.a)return["1.","1.","1.",o[1]].join(" ");n="string"==typeof i?[i,r,e,o[1]].join(" "):2===t.precision?[j(i/255),j(r/255),j(e/255),o[1]].join(" "):[M(i/255),M(r/255),M(e/255),o[1]].join(" ")}else n="string"==typeof i?[i,r,e,s,o[2]].join(" "):2===t.precision?[j(i),j(r),j(e),j(s),o[2]].join(" "):[M(i),M(r),M(e),M(s),o[2]].join(" ");return n},rn=d.__private__.getFilters=function(){return o},en=d.__private__.putStream=function(t){var n=(t=t||{}).data||"",i=t.filters||rn(),r=t.alreadyAppliedFilters||[],e=t.addLength1||!1,s=n.length,o=t.objectId,a=function(t){return t};if(null!==c&&void 0===o)throw new Error("ObjectId must be passed to putStream for file encryption");null!==c&&(a=Pn.encryptor(o,0));var u={};!0===i&&(i=["FlateEncode"]);var f=t.additionalKeyValues||[],h=(u=void 0!==Pt.API.processDataByFilters?Pt.API.processDataByFilters(n,i):{data:n,reverseChain:[]}).reverseChain+(Array.isArray(r)?r.join(" "):r.toString());if(0!==u.data.length&&(f.push({key:"Length",value:u.data.length}),!0===e&&f.push({key:"Length1",value:s})),0!=h.length)if(h.split("/").length-1==1)f.push({key:"Filter",value:h});else{f.push({key:"Filter",value:"["+h+"]"});for(var l=0;l<f.length;l+=1)if("DecodeParms"===f[l].key){for(var v=[],d=0;d<u.reverseChain.split("/").length-1;d+=1)v.push("null");v.push(f[l].value),f[l].value="["+v.join(" ")+"]"}}Q("<<");for(var w=0;w<f.length;w++)Q("/"+f[w].key+" "+f[w].value);Q(">>"),0!==u.data.length&&(Q("stream"),Q(a(u.data)),Q("endstream"))},sn=d.__private__.putPage=function(t){var n=t.number,i=t.data,r=t.objId,e=t.contentsObjId;Kt(r,!0),Q("<</Type /Page"),Q("/Parent "+t.rootDictionaryObjId+" 0 R"),Q("/Resources "+t.resourceDictionaryObjId+" 0 R"),Q("/MediaBox ["+parseFloat(S(t.mediaBox.bottomLeftX))+" "+parseFloat(S(t.mediaBox.bottomLeftY))+" "+S(t.mediaBox.topRightX)+" "+S(t.mediaBox.topRightY)+"]"),null!==t.cropBox&&Q("/CropBox ["+S(t.cropBox.bottomLeftX)+" "+S(t.cropBox.bottomLeftY)+" "+S(t.cropBox.topRightX)+" "+S(t.cropBox.topRightY)+"]"),null!==t.bleedBox&&Q("/BleedBox ["+S(t.bleedBox.bottomLeftX)+" "+S(t.bleedBox.bottomLeftY)+" "+S(t.bleedBox.topRightX)+" "+S(t.bleedBox.topRightY)+"]"),null!==t.trimBox&&Q("/TrimBox ["+S(t.trimBox.bottomLeftX)+" "+S(t.trimBox.bottomLeftY)+" "+S(t.trimBox.topRightX)+" "+S(t.trimBox.topRightY)+"]"),null!==t.artBox&&Q("/ArtBox ["+S(t.artBox.bottomLeftX)+" "+S(t.artBox.bottomLeftY)+" "+S(t.artBox.topRightX)+" "+S(t.artBox.topRightY)+"]"),"number"==typeof t.userUnit&&1!==t.userUnit&&Q("/UserUnit "+t.userUnit),Dt.publish("putPage",{objId:r,pageContext:Ct[n],pageNumber:n,page:i}),Q("/Contents "+e+" 0 R"),Q(">>"),Q("endobj");var s=i.join("\n");return g===L&&(s+="\nQ"),Kt(e,!0),en({data:s,filters:rn(),objectId:e}),Q("endobj"),r},on=d.__private__.putPages=function(){var t,n,i=[];for(t=1;t<=Tt;t++)Ct[t].objId=$t(),Ct[t].contentsObjId=$t();for(t=1;t<=Tt;t++)i.push(sn({number:t,data:Y[t],objId:Ct[t].objId,contentsObjId:Ct[t].contentsObjId,mediaBox:Ct[t].mediaBox,cropBox:Ct[t].cropBox,bleedBox:Ct[t].bleedBox,trimBox:Ct[t].trimBox,artBox:Ct[t].artBox,userUnit:Ct[t].userUnit,rootDictionaryObjId:Zt,resourceDictionaryObjId:Qt}));Kt(Zt,!0),Q("<</Type /Pages");var r="/Kids [";for(n=0;n<Tt;n++)r+=i[n]+" 0 R ";Q(r+"]"),Q("/Count "+Tt),Q(">>"),Q("endobj"),Dt.publish("postPutPages")},an=function(t){Dt.publish("putFont",{font:t,out:Q,newObject:Yt,putStream:en}),!0!==t.isAlreadyPutted&&(t.objectNumber=Yt(),Q("<<"),Q("/Type /Font"),Q("/BaseFont /"+St(t.postScriptName)),Q("/Subtype /Type1"),"string"==typeof t.encoding&&Q("/Encoding /"+t.encoding),Q("/FirstChar 32"),Q("/LastChar 255"),Q(">>"),Q("endobj"))},un=function(t){t.objectNumber=Yt();var n=[];n.push({key:"Type",value:"/XObject"}),n.push({key:"Subtype",value:"/Form"}),n.push({key:"BBox",value:"["+[S(t.x),S(t.y),S(t.x+t.width),S(t.y+t.height)].join(" ")+"]"}),n.push({key:"Matrix",value:"["+t.matrix.toString()+"]"});var i=t.pages[1].join("\n");en({data:i,additionalKeyValues:n,objectId:t.objectNumber}),Q("endobj")},fn=function(t,n){n||(n=21);var i=Yt(),r=function(t,n){var i,r=[],e=1/(n-1);for(i=0;i<1;i+=e)r.push(i);r.push(1),0!=t[0].offset&&t.unshift({offset:0,color:t[0].color}),1!=t[t.length-1].offset&&t.push({offset:1,color:t[t.length-1].color});for(var s="",o=0,a=0;a<r.length;a++){for(i=r[a];i>t[o+1].offset;)o++;var u=t[o].offset,f=(i-u)/(t[o+1].offset-u),c=t[o].color,h=t[o+1].color;s+=V(Math.round((1-f)*c[0]+f*h[0]).toString(16))+V(Math.round((1-f)*c[1]+f*h[1]).toString(16))+V(Math.round((1-f)*c[2]+f*h[2]).toString(16))}return s.trim()}(t.colors,n),e=[];e.push({key:"FunctionType",value:"0"}),e.push({key:"Domain",value:"[0.0 1.0]"}),e.push({key:"Size",value:"["+n+"]"}),e.push({key:"BitsPerSample",value:"8"}),e.push({key:"Range",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),e.push({key:"Decode",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),en({data:r,additionalKeyValues:e,alreadyAppliedFilters:["/ASCIIHexDecode"],objectId:i}),Q("endobj"),t.objectNumber=Yt(),Q("<< /ShadingType "+t.type),Q("/ColorSpace /DeviceRGB");var s="/Coords ["+S(parseFloat(t.coords[0]))+" "+S(parseFloat(t.coords[1]))+" ";s+=2===t.type?S(parseFloat(t.coords[2]))+" "+S(parseFloat(t.coords[3])):S(parseFloat(t.coords[2]))+" "+S(parseFloat(t.coords[3]))+" "+S(parseFloat(t.coords[4]))+" "+S(parseFloat(t.coords[5])),Q(s+="]"),t.matrix&&Q("/Matrix ["+t.matrix.toString()+"]"),Q("/Function "+i+" 0 R"),Q("/Extend [true true]"),Q(">>"),Q("endobj")},cn=function(t,n){var i=$t(),r=Yt();n.push({resourcesOid:i,objectOid:r}),t.objectNumber=r;var e=[];e.push({key:"Type",value:"/Pattern"}),e.push({key:"PatternType",value:"1"}),e.push({key:"PaintType",value:"1"}),e.push({key:"TilingType",value:"1"}),e.push({key:"BBox",value:"["+t.boundingBox.map(S).join(" ")+"]"}),e.push({key:"XStep",value:S(t.xStep)}),e.push({key:"YStep",value:S(t.yStep)}),e.push({key:"Resources",value:i+" 0 R"}),t.matrix&&e.push({key:"Matrix",value:"["+t.matrix.toString()+"]"}),en({data:t.stream,additionalKeyValues:e,objectId:t.objectNumber}),Q("endobj")},hn=function(t){for(var n in t.objectNumber=Yt(),Q("<<"),t)switch(n){case"opacity":Q("/ca "+j(t[n]));break;case"stroke-opacity":Q("/CA "+j(t[n]))}Q(">>"),Q("endobj")},ln=function(t){Kt(t.resourcesOid,!0),Q("<<"),Q("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),function(){for(var t in Q("/Font <<"),At)At.hasOwnProperty(t)&&(!1===h||!0===h&&v.hasOwnProperty(t))&&Q("/"+t+" "+At[t].objectNumber+" 0 R");Q(">>")}(),function(){if(Object.keys(Ot).length>0){for(var t in Q("/Shading <<"),Ot)Ot.hasOwnProperty(t)&&Ot[t]instanceof Mt&&Ot[t].objectNumber>=0&&Q("/"+t+" "+Ot[t].objectNumber+" 0 R");Dt.publish("putShadingPatternDict"),Q(">>")}}(),function(t){if(Object.keys(Ot).length>0){for(var n in Q("/Pattern <<"),Ot)Ot.hasOwnProperty(n)&&Ot[n]instanceof d.TilingPattern&&Ot[n].objectNumber>=0&&Ot[n].objectNumber<t&&Q("/"+n+" "+Ot[n].objectNumber+" 0 R");Dt.publish("putTilingPatternDict"),Q(">>")}}(t.objectOid),function(){if(Object.keys(Ft).length>0){var t;for(t in Q("/ExtGState <<"),Ft)Ft.hasOwnProperty(t)&&Ft[t].objectNumber>=0&&Q("/"+t+" "+Ft[t].objectNumber+" 0 R");Dt.publish("putGStateDict"),Q(">>")}}(),function(){for(var t in Q("/XObject <<"),Ut)Ut.hasOwnProperty(t)&&Ut[t].objectNumber>=0&&Q("/"+t+" "+Ut[t].objectNumber+" 0 R");Dt.publish("putXobjectDict"),Q(">>")}(),Q(">>"),Q("endobj")},vn=function(t){yt[t.fontName]=yt[t.fontName]||{},yt[t.fontName][t.fontStyle]=t.id},dn=function(t,n,i,r,e){var s={id:"F"+(Object.keys(At).length+1).toString(10),postScriptName:t,fontName:n,fontStyle:i,encoding:r,isStandardFont:e||!1,metadata:{}};return Dt.publish("addFont",{font:s,instance:this}),At[s.id]=s,vn(s),s.id},wn=d.__private__.pdfEscape=d.pdfEscape=function(t,n){return function(t,n){var i,r,e,s,o,a,u,f,c;if(e=(n=n||{}).sourceEncoding||"Unicode",o=n.outputEncoding,(n.autoencode||o)&&At[bt].metadata&&At[bt].metadata[e]&&At[bt].metadata[e].encoding&&(s=At[bt].metadata[e].encoding,!o&&At[bt].encoding&&(o=At[bt].encoding),!o&&s.codePages&&(o=s.codePages[0]),"string"==typeof o&&(o=s[o]),o)){for(u=!1,a=[],i=0,r=t.length;i<r;i++)(f=o[t.charCodeAt(i)])?a.push(String.fromCharCode(f)):a.push(t[i]),a[i].charCodeAt(0)>>8&&(u=!0);t=a.join("")}for(i=t.length;void 0===u&&0!==i;)t.charCodeAt(i-1)>>8&&(u=!0),i--;if(!u)return t;for(a=n.noBOM?[]:[254,255],i=0,r=t.length;i<r;i++){if((c=(f=t.charCodeAt(i))>>8)>>8)throw new Error("Character at position "+i+" of string '"+t+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");a.push(c),a.push(f-(c<<8))}return String.fromCharCode.apply(void 0,a)}(t,n).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},mn=d.__private__.beginPage=function(t){Y[++Tt]=[],Ct[Tt]={objId:0,contentsObjId:0,userUnit:Number(a),artBox:null,bleedBox:null,cropBox:null,trimBox:null,mediaBox:{bottomLeftX:0,bottomLeftY:0,topRightX:Number(t[0]),topRightY:Number(t[1])}},Nn(Tt),X(Y[z])},bn=function(t,n){var r,s,o;switch(i=n||i,"string"==typeof t&&(r=p(t.toLowerCase()),Array.isArray(r)&&(s=r[0],o=r[1])),Array.isArray(t)&&(s=t[0]*pt,o=t[1]*pt),isNaN(s)&&(s=e[0],o=e[1]),(s>14400||o>14400)&&(tt.warn("A page in a PDF can not be wider or taller than 14400 userUnit. jsPDF limits the width/height to 14400"),s=Math.min(14400,s),o=Math.min(14400,o)),e=[s,o],i.substr(0,1)){case"l":o>s&&(e=[o,s]);break;case"p":s>o&&(e=[o,s])}mn(e),Xn($n),Q(si),0!==hi&&Q(hi+" J"),0!==li&&Q(li+" j"),Dt.publish("addPage",{pageNumber:Tt})},pn=function(t){t>0&&t<=Tt&&(Y.splice(t,1),Ct.splice(t,1),Tt--,z>Tt&&(z=Tt),this.setPage(z))},Nn=function(t){t>0&&t<=Tt&&(z=t)},Ln=d.__private__.getNumberOfPages=d.getNumberOfPages=function(){return Y.length-1},gn=function(t,n,i){var r,e=void 0;return i=i||{},n=void 0!==n?n:At[bt].fontStyle,r=(t=void 0!==t?t:At[bt].fontName).toLowerCase(),void 0!==yt[r]&&void 0!==yt[r][n]?e=yt[r][n]:void 0!==yt[t]&&void 0!==yt[t][n]?e=yt[t][n]:!1===i.disableWarning&&tt.warn("Unable to look up font label for font '"+t+"', '"+n+"'. Refer to getFontList() for available fonts."),e||i.noFallback||null==(e=yt.times[n])&&(e=yt.times.normal),e},An=d.__private__.putInfo=function(){var t=Yt(),n=function(t){return t};for(var i in null!==c&&(n=Pn.encryptor(t,0)),Q("<<"),Q("/Producer ("+wn(n("jsPDF "+Pt.version))+")"),mt)mt.hasOwnProperty(i)&&mt[i]&&Q("/"+i.substr(0,1).toUpperCase()+i.substr(1)+" ("+wn(n(mt[i]))+")");Q("/CreationDate ("+wn(n(O))+")"),Q(">>"),Q("endobj")},yn=d.__private__.putCatalog=function(t){var n=(t=t||{}).rootDictionaryObjId||Zt;switch(Yt(),Q("<<"),Q("/Type /Catalog"),Q("/Pages "+n+" 0 R"),ut||(ut="fullwidth"),ut){case"fullwidth":Q("/OpenAction [3 0 R /FitH null]");break;case"fullheight":Q("/OpenAction [3 0 R /FitV null]");break;case"fullpage":Q("/OpenAction [3 0 R /Fit]");break;case"original":Q("/OpenAction [3 0 R /XYZ null null 1]");break;default:var i=""+ut;"%"===i.substr(i.length-1)&&(ut=parseInt(ut)/100),"number"==typeof ut&&Q("/OpenAction [3 0 R /XYZ null null "+j(ut)+"]")}switch(vt||(vt="continuous"),vt){case"continuous":Q("/PageLayout /OneColumn");break;case"single":Q("/PageLayout /SinglePage");break;case"two":case"twoleft":Q("/PageLayout /TwoColumnLeft");break;case"tworight":Q("/PageLayout /TwoColumnRight")}ht&&Q("/PageMode /"+ht),Dt.publish("putCatalog"),Q(">>"),Q("endobj")},kn=d.__private__.putTrailer=function(){Q("trailer"),Q("<<"),Q("/Size "+(W+1)),Q("/Root "+W+" 0 R"),Q("/Info "+(W-1)+" 0 R"),null!==c&&Q("/Encrypt "+Pn.oid+" 0 R"),Q("/ID [ <"+I+"> <"+I+"> ]"),Q(">>")},Sn=d.__private__.putHeader=function(){Q("%PDF-"+w),Q("%ºß¬à")},xn=d.__private__.putXRef=function(){var t="0000000000";Q("xref"),Q("0 "+(W+1)),Q("0000000000 65535 f ");for(var n=1;n<=W;n++)Q("function"==typeof H[n]?(t+H[n]()).slice(-10)+" 00000 n ":void 0!==H[n]?(t+H[n]).slice(-10)+" 00000 n ":"0000000000 00000 n ")},qn=d.__private__.buildDocument=function(){W=0,G=0,_=[],H=[],J=[],Zt=$t(),Qt=$t(),X(_),Dt.publish("buildDocument"),Sn(),on(),function(){Dt.publish("putAdditionalObjects");for(var t=0;t<J.length;t++){var n=J[t];Kt(n.objId,!0),Q(n.content),Q("endobj")}Dt.publish("postPutAdditionalObjects")}(),function(){var t=[];(function(){for(var t in At)At.hasOwnProperty(t)&&(!1===h||!0===h&&v.hasOwnProperty(t))&&an(At[t])})(),function(){var t;for(t in Ft)Ft.hasOwnProperty(t)&&hn(Ft[t])}(),function(){for(var t in Ut)Ut.hasOwnProperty(t)&&un(Ut[t])}(),function(t){var n;for(n in Ot)Ot.hasOwnProperty(n)&&(Ot[n]instanceof Mt?fn(Ot[n]):Ot[n]instanceof Et&&cn(Ot[n],t))}(t),Dt.publish("putResources"),t.forEach(ln),ln({resourcesOid:Qt,objectOid:Number.MAX_SAFE_INTEGER}),Dt.publish("postPutResources")}(),null!==c&&(Pn.oid=Yt(),Q("<<"),Q("/Filter /Standard"),Q("/V "+Pn.v),Q("/R "+Pn.r),Q("/U <"+Pn.toHexString(Pn.U)+">"),Q("/O <"+Pn.toHexString(Pn.O)+">"),Q("/P "+Pn.P),Q(">>"),Q("endobj")),An(),yn();var t=G;return xn(),kn(),Q("startxref"),Q(""+t),Q("%%EOF"),X(Y[z]),_.join("\n")},jn=d.__private__.getBlob=function(t){return new Blob([it(t)],{type:"application/pdf"})},Mn=d.output=d.__private__.output=function(t){return t.foo=function(){try{return t.apply(this,arguments)}catch(t){var n=t.stack||"";~n.indexOf(" at ")&&(n=n.split(" at ")[1]);var i="Error in function "+n.split("\n")[0].split("<")[0]+": "+t.message;if(!Z.console)throw new Error(i);Z.console.error(i,t),Z.alert&&alert(i)}},t.foo.bar=t,t.foo}((function(t,n){switch("string"==typeof(n=n||{})?n={filename:n}:n.filename=n.filename||"generated.pdf",t){case void 0:return qn();case"save":d.save(n.filename);break;case"arraybuffer":return it(qn());case"blob":return jn(qn());case"bloburi":case"bloburl":if(void 0!==Z.URL&&"function"==typeof Z.URL.createObjectURL)return Z.URL&&Z.URL.createObjectURL(jn(qn()))||void 0;tt.warn("bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.");break;case"datauristring":case"dataurlstring":var i="",r=qn();try{i=st(r)}catch(t){i=st(unescape(encodeURIComponent(r)))}return"data:application/pdf;filename="+n.filename+";base64,"+i;case"pdfobjectnewwindow":if("[object Window]"===Object.prototype.toString.call(Z)){var e="https://cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js",s=' integrity="sha512-4ze/a9/4jqu+tX9dfOqJYSvyYd5M6qum/3HpCLr+/Jqf0whc37VUbkpNGHR7/8pSnCFw47T1fmIpwBV7UySh3g==" crossorigin="anonymous"';n.pdfObjectUrl&&(e=n.pdfObjectUrl,s="");var o='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><script src="'+e+'"'+s+'><\/script><script >PDFObject.embed("'+this.output("dataurlstring")+'", '+JSON.stringify(n)+");<\/script></body></html>",a=Z.open();return null!==a&&a.document.write(o),a}throw new Error("The option pdfobjectnewwindow just works in a browser-environment.");case"pdfjsnewwindow":if("[object Window]"===Object.prototype.toString.call(Z)){var u='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><iframe id="pdfViewer" src="'+(n.pdfJsUrl||"examples/PDF.js/web/viewer.html")+"?file=&downloadName="+n.filename+'" width="500px" height="400px" /></body></html>',f=Z.open();if(null!==f){f.document.write(u);var c=this;f.document.documentElement.querySelector("#pdfViewer").onload=function(){f.document.title=n.filename,f.document.documentElement.querySelector("#pdfViewer").contentWindow.PDFViewerApplication.open(c.output("bloburl"))}}return f}throw new Error("The option pdfjsnewwindow just works in a browser-environment.");case"dataurlnewwindow":if("[object Window]"!==Object.prototype.toString.call(Z))throw new Error("The option dataurlnewwindow just works in a browser-environment.");var h='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><iframe src="'+this.output("datauristring",n)+'"></iframe></body></html>',l=Z.open();if(null!==l&&(l.document.write(h),l.document.title=n.filename),l||"undefined"==typeof safari)return l;break;case"datauri":case"dataurl":return Z.document.location.href=this.output("datauristring",n);default:return null}})),En=function(t){return!0===Array.isArray(zt)&&zt.indexOf(t)>-1};switch(r){case"pt":pt=1;break;case"mm":pt=72/25.4;break;case"cm":pt=72/2.54;break;case"in":pt=72;break;case"px":pt=1==En("px_scaling")?.75:96/72;break;case"pc":case"em":pt=12;break;case"ex":pt=6;break;default:if("number"!=typeof r)throw new Error("Invalid unit: "+r);pt=r}var Pn=null;C(),B();var On=d.__private__.getPageInfo=d.getPageInfo=function(t){if(isNaN(t)||t%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfo");return{objId:Ct[t].objId,pageNumber:t,pageContext:Ct[t]}},In=d.__private__.getPageInfoByObjId=function(t){if(isNaN(t)||t%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfoByObjId");for(var n in Ct)if(Ct[n].objId===t)break;return On(n)},Fn=d.__private__.getCurrentPageInfo=d.getCurrentPageInfo=function(){return{objId:Ct[z].objId,pageNumber:z,pageContext:Ct[z]}};d.addPage=function(){return bn.apply(this,arguments),this},d.setPage=function(){return Nn.apply(this,arguments),X.call(this,Y[z]),this},d.insertPage=function(t){return this.addPage(),this.movePage(z,t),this},d.movePage=function(t,n){var i,r;if(t>n){i=Y[t],r=Ct[t];for(var e=t;e>n;e--)Y[e]=Y[e-1],Ct[e]=Ct[e-1];Y[n]=i,Ct[n]=r,this.setPage(n)}else if(t<n){i=Y[t],r=Ct[t];for(var s=t;s<n;s++)Y[s]=Y[s+1],Ct[s]=Ct[s+1];Y[n]=i,Ct[n]=r,this.setPage(n)}return this},d.deletePage=function(){return pn.apply(this,arguments),this},d.__private__.text=d.text=function(t,n,i,r,e){var s,o,a,u,f,c,h,d,w,m=(r=r||{}).scope||this;if("number"==typeof t&&"number"==typeof n&&("string"==typeof i||Array.isArray(i))){var b=i;i=n,n=t,t=b}if(arguments[3]instanceof Ht==0?(a=arguments[4],u=arguments[5],"object"===l(h=arguments[3])&&null!==h||("string"==typeof a&&(u=a,a=null),"string"==typeof h&&(u=h,h=null),"number"==typeof h&&(a=h,h=null),r={flags:h,angle:a,align:u})):(x("The transform parameter of text() with a Matrix value"),w=e),isNaN(n)||isNaN(i)||null==t)throw new Error("Invalid arguments passed to jsPDF.text");if(0===t.length)return m;var p,N="",A="number"==typeof r.lineHeightFactor?r.lineHeightFactor:Yn,y=m.internal.scaleFactor;function k(t){return t=t.split("\t").join(Array(r.TabLen||9).join(" ")),wn(t,h)}function q(t){for(var n,i=t.concat(),r=[],e=i.length;e--;)"string"==typeof(n=i.shift())?r.push(n):Array.isArray(t)&&(1===n.length||void 0===n[1]&&void 0===n[2])?r.push(n[0]):r.push([n[0],n[1],n[2]]);return r}function j(t,n){var i;if("string"==typeof t)i=n(t)[0];else if(Array.isArray(t)){for(var r,e,s=t.concat(),o=[],a=s.length;a--;)"string"==typeof(r=s.shift())?o.push(n(r)[0]):Array.isArray(r)&&"string"==typeof r[0]&&(e=n(r[0],r[1],r[2]),o.push([e[0],e[1],e[2]]));i=o}return i}var M=!1,P=!0;if("string"==typeof t)M=!0;else if(Array.isArray(t)){var O=t.concat();o=[];for(var I,F=O.length;F--;)("string"!=typeof(I=O.shift())||Array.isArray(I)&&"string"!=typeof I[0])&&(P=!1);M=P}if(!1===M)throw new Error('Type of text must be string or Array. "'+t+'" is not recognized.');"string"==typeof t&&(t=t.match(/[\r?\n]/)?t.split(/\r\n|\r|\n/g):[t]);var B=et/m.internal.scaleFactor,R=B*(A-1);switch(r.baseline){case"bottom":i-=R;break;case"top":i+=B-R;break;case"hanging":i+=B-2*R;break;case"middle":i+=B/2-R}if((c=r.maxWidth||0)>0&&("string"==typeof t?t=m.splitTextToSize(t,c):"[object Array]"===Object.prototype.toString.call(t)&&(t=t.reduce((function(t,n){return t.concat(m.splitTextToSize(n,c))}),[]))),Dt.publish("preProcessText",s={text:t,x:n,y:i,options:r,mutex:{pdfEscape:wn,activeFontKey:bt,fonts:At,activeFontSize:et}}),t=s.text,a=(r=s.options).angle,w instanceof Ht==0&&a&&"number"==typeof a){a*=Math.PI/180,0===r.rotationDirection&&(a=-a),g===L&&(a=-a);var T=Math.cos(a),C=Math.sin(a);w=new Ht(T,C,-C,T,0,0)}else a&&a instanceof Ht&&(w=a);g!==L||w||(w=Gt),void 0!==(f=r.charSpace||fi)&&(N+=S(E(f))+" Tc\n",this.setCharSpace(this.getCharSpace()||0)),void 0!==(d=r.horizontalScale)&&(N+=S(100*d)+" Tz\n");var D=-1,z=void 0!==r.renderingMode?r.renderingMode:r.stroke,U=m.internal.getCurrentPageInfo().pageContext;switch(z){case 0:case!1:case"fill":D=0;break;case 1:case!0:case"stroke":D=1;break;case 2:case"fillThenStroke":D=2;break;case 3:case"invisible":D=3;break;case 4:case"fillAndAddForClipping":D=4;break;case 5:case"strokeAndAddPathForClipping":D=5;break;case 6:case"fillThenStrokeAndAddToPathForClipping":D=6;break;case 7:case"addToPathForClipping":D=7}-1!==D?N+=D+" Tr\n":-1!==(void 0!==U.usedRenderingMode?U.usedRenderingMode:-1)&&(N+="0 Tr\n"),-1!==D&&(U.usedRenderingMode=D),u=r.align||"left";var V,W=et*A,H=m.internal.pageSize.getWidth(),_=At[bt];f=r.charSpace||fi,c=r.maxWidth||0,h=Object.assign({autoencode:!0,noBOM:!0},r.flags);var G=[];if("[object Array]"===Object.prototype.toString.call(t)){var J;o=q(t),"left"!==u&&(V=o.map((function(t){return m.getStringUnitWidth(t,{font:_,charSpace:f,fontSize:et,doKerning:!1})*et/y})));var Y,$=0;if("right"===u){n-=V[0],t=[],F=o.length;for(var K=0;K<F;K++)0===K?(Y=ni(n),J=ii(i)):(Y=E($-V[K]),J=-W),t.push([o[K],Y,J]),$=V[K]}else if("center"===u){n-=V[0]/2,t=[],F=o.length;for(var X=0;X<F;X++)0===X?(Y=ni(n),J=ii(i)):(Y=E(($-V[X])/2),J=-W),t.push([o[X],Y,J]),$=V[X]}else if("left"===u){t=[],F=o.length;for(var Z=0;Z<F;Z++)t.push(o[Z])}else{if("justify"!==u)throw new Error('Unrecognized alignment option, use "left", "center", "right" or "justify".');t=[],F=o.length,c=0!==c?c:H;for(var tt=0;tt<F;tt++)J=0===tt?ii(i):-W,Y=0===tt?ni(n):0,G.push(tt<F-1?S(E((c-V[tt])/(o[tt].split(" ").length-1))):0),t.push([o[tt],Y,J])}}!0===("boolean"==typeof r.R2L?r.R2L:ct)&&(t=j(t,(function(t,n,i){return[t.split("").reverse().join(""),n,i]}))),Dt.publish("postProcessText",s={text:t,x:n,y:i,options:r,mutex:{pdfEscape:wn,activeFontKey:bt,fonts:At,activeFontSize:et}}),t=s.text,p=s.mutex.isHex||!1;var nt=At[bt].encoding;"WinAnsiEncoding"!==nt&&"StandardEncoding"!==nt||(t=j(t,(function(t,n,i){return[k(t),n,i]}))),o=q(t),t=[];for(var it,rt,st,ot=Array.isArray(o[0])?1:0,at="",ut=function(t,n,i){var e="";return i instanceof Ht?(i="number"==typeof r.angle?_t(i,new Ht(1,0,0,1,t,n)):_t(new Ht(1,0,0,1,t,n),i),g===L&&(i=_t(new Ht(1,0,0,-1,0,0),i)),e=i.join(" ")+" Tm\n"):e=S(t)+" "+S(n)+" Td\n",e},ft=0;ft<o.length;ft++){switch(at="",ot){case 1:st=(p?"<":"(")+o[ft][0]+(p?">":")"),it=parseFloat(o[ft][1]),rt=parseFloat(o[ft][2]);break;case 0:st=(p?"<":"(")+o[ft]+(p?">":")"),it=ni(n),rt=ii(i)}void 0!==G&&void 0!==G[ft]&&(at=G[ft]+" Tw\n"),0===ft?t.push(at+ut(it,rt,w)+st):0===ot?t.push(at+st):1===ot&&t.push(at+ut(it,rt,w)+st)}t=t.join(0===ot?" Tj\nT* ":" Tj\n"),t+=" Tj\n";var ht="BT\n/";return ht+=bt+" "+et+" Tf\n",ht+=S(et*A)+" TL\n",ht+=ai+"\n",ht+=N,ht+=t,Q(ht+="ET"),v[bt]=!0,m};var Bn=d.__private__.clip=d.clip=function(t){return Q("evenodd"===t?"W*":"W"),this};d.clipEvenOdd=function(){return Bn("evenodd")},d.__private__.discardPath=d.discardPath=function(){return Q("n"),this};var Rn=d.__private__.isValidStyle=function(t){var n=!1;return-1!==[void 0,null,"S","D","F","DF","FD","f","f*","B","B*","n"].indexOf(t)&&(n=!0),n};d.__private__.setDefaultPathOperation=d.setDefaultPathOperation=function(t){return Rn(t)&&(f=t),this};var Tn=d.__private__.getStyle=d.getStyle=function(t){var n=f;switch(t){case"D":case"S":n="S";break;case"F":n="f";break;case"FD":case"DF":n="B";break;case"f":case"f*":case"B":case"B*":n=t}return n},Cn=d.close=function(){return Q("h"),this};d.stroke=function(){return Q("S"),this},d.fill=function(t){return Dn("f",t),this},d.fillEvenOdd=function(t){return Dn("f*",t),this},d.fillStroke=function(t){return Dn("B",t),this},d.fillStrokeEvenOdd=function(t){return Dn("B*",t),this};var Dn=function(t,n){"object"===l(n)?Vn(n,t):Q(t)},zn=function(t){null===t||g===L&&void 0===t||(t=Tn(t),Q(t))};function Un(t,n,i,r,e){var s=new Et(n||this.boundingBox,i||this.xStep,r||this.yStep,this.gState,e||this.matrix);s.stream=this.stream;var o=t+"$$"+this.cloneIndex+++"$$";return Jt(o,s),s}var Vn=function(t,n){var i=It[t.key],r=Ot[i];if(r instanceof Mt)Q("q"),Q(Wn(n)),r.gState&&d.setGState(r.gState),Q(t.matrix.toString()+" cm"),Q("/"+i+" sh"),Q("Q");else if(r instanceof Et){var e=new Ht(1,0,0,-1,0,gi());t.matrix&&(e=e.multiply(t.matrix||Gt),i=Un.call(r,t.key,t.boundingBox,t.xStep,t.yStep,e).id),Q("q"),Q("/Pattern cs"),Q("/"+i+" scn"),r.gState&&d.setGState(r.gState),Q(n),Q("Q")}},Wn=function(t){switch(t){case"f":case"F":case"n":return"W n";case"f*":return"W* n";case"B":case"S":return"W S";case"B*":return"W* S"}},Hn=d.moveTo=function(t,n){return Q(S(E(t))+" "+S(P(n))+" m"),this},_n=d.lineTo=function(t,n){return Q(S(E(t))+" "+S(P(n))+" l"),this},Gn=d.curveTo=function(t,n,i,r,e,s){return Q([S(E(t)),S(P(n)),S(E(i)),S(P(r)),S(E(e)),S(P(s)),"c"].join(" ")),this};d.__private__.line=d.line=function(t,n,i,r,e){if(isNaN(t)||isNaN(n)||isNaN(i)||isNaN(r)||!Rn(e))throw new Error("Invalid arguments passed to jsPDF.line");return g===N?this.lines([[i-t,r-n]],t,n,[1,1],e||"S"):this.lines([[i-t,r-n]],t,n,[1,1]).stroke()},d.__private__.lines=d.lines=function(t,n,i,r,e,s){var o,a,u,f,c,h,l,v;if("number"==typeof t&&(v=i,i=n,n=t,t=v),r=r||[1,1],s=s||!1,isNaN(n)||isNaN(i)||!Array.isArray(t)||!Array.isArray(r)||!Rn(e)||"boolean"!=typeof s)throw new Error("Invalid arguments passed to jsPDF.lines");for(Hn(n,i),o=r[0],a=r[1],f=t.length,h=n,l=i,u=0;u<f;u++)2===(c=t[u]).length?_n(h=c[0]*o+h,l=c[1]*a+l):Gn(c[0]*o+h,c[1]*a+l,c[2]*o+h,c[3]*a+l,h=c[4]*o+h,l=c[5]*a+l);return s&&Cn(),zn(e),this},d.path=function(t){for(var n=0;n<t.length;n++){var i=t[n],r=i.c;switch(i.op){case"m":Hn(r[0],r[1]);break;case"l":_n(r[0],r[1]);break;case"c":Gn.apply(this,r);break;case"h":Cn()}}return this},d.__private__.rect=d.rect=function(t,n,i,r,e){if(isNaN(t)||isNaN(n)||isNaN(i)||isNaN(r)||!Rn(e))throw new Error("Invalid arguments passed to jsPDF.rect");return g===N&&(r=-r),Q([S(E(t)),S(P(n)),S(E(i)),S(E(r)),"re"].join(" ")),zn(e),this},d.__private__.triangle=d.triangle=function(t,n,i,r,e,s,o){if(isNaN(t)||isNaN(n)||isNaN(i)||isNaN(r)||isNaN(e)||isNaN(s)||!Rn(o))throw new Error("Invalid arguments passed to jsPDF.triangle");return this.lines([[i-t,r-n],[e-i,s-r],[t-e,n-s]],t,n,[1,1],o,!0),this},d.__private__.roundedRect=d.roundedRect=function(t,n,i,r,e,s,o){if(isNaN(t)||isNaN(n)||isNaN(i)||isNaN(r)||isNaN(e)||isNaN(s)||!Rn(o))throw new Error("Invalid arguments passed to jsPDF.roundedRect");var a=4/3*(Math.SQRT2-1);return e=Math.min(e,.5*i),s=Math.min(s,.5*r),this.lines([[i-2*e,0],[e*a,0,e,s-s*a,e,s],[0,r-2*s],[0,s*a,-e*a,s,-e,s],[2*e-i,0],[-e*a,0,-e,-s*a,-e,-s],[0,2*s-r],[0,-s*a,e*a,-s,e,-s]],t+e,n,[1,1],o,!0),this},d.__private__.ellipse=d.ellipse=function(t,n,i,r,e){if(isNaN(t)||isNaN(n)||isNaN(i)||isNaN(r)||!Rn(e))throw new Error("Invalid arguments passed to jsPDF.ellipse");var s=4/3*(Math.SQRT2-1)*i,o=4/3*(Math.SQRT2-1)*r;return Hn(t+i,n),Gn(t+i,n-o,t+s,n-r,t,n-r),Gn(t-s,n-r,t-i,n-o,t-i,n),Gn(t-i,n+o,t-s,n+r,t,n+r),Gn(t+s,n+r,t+i,n+o,t+i,n),zn(e),this},d.__private__.circle=d.circle=function(t,n,i,r){if(isNaN(t)||isNaN(n)||isNaN(i)||!Rn(r))throw new Error("Invalid arguments passed to jsPDF.circle");return this.ellipse(t,n,i,i,r)},d.setFont=function(t,n,i){return i&&(n=k(n,i)),bt=gn(t,n,{disableWarning:!1}),this};var Jn=d.__private__.getFont=d.getFont=function(){return At[gn.apply(d,arguments)]};d.__private__.getFontList=d.getFontList=function(){var t,n,i={};for(t in yt)if(yt.hasOwnProperty(t))for(n in i[t]=[],yt[t])yt[t].hasOwnProperty(n)&&i[t].push(n);return i},d.addFont=function(t,n,i,r,e){var s=["StandardEncoding","MacRomanEncoding","Identity-H","WinAnsiEncoding"];return arguments[3]&&-1!==s.indexOf(arguments[3])?e=arguments[3]:arguments[3]&&-1==s.indexOf(arguments[3])&&(i=k(i,r)),dn.call(this,t,n,i,e=e||"Identity-H")};var Yn,$n=t.lineWidth||.200025,Kn=d.__private__.getLineWidth=d.getLineWidth=function(){return $n},Xn=d.__private__.setLineWidth=d.setLineWidth=function(t){return $n=t,Q(S(E(t))+" w"),this};d.__private__.setLineDash=Pt.API.setLineDash=Pt.API.setLineDashPattern=function(t,n){if(t=t||[],n=n||0,isNaN(n)||!Array.isArray(t))throw new Error("Invalid arguments passed to jsPDF.setLineDash");return t=t.map((function(t){return S(E(t))})).join(" "),n=S(E(n)),Q("["+t+"] "+n+" d"),this};var Zn=d.__private__.getLineHeight=d.getLineHeight=function(){return et*Yn};d.__private__.getLineHeight=d.getLineHeight=function(){return et*Yn};var Qn=d.__private__.setLineHeightFactor=d.setLineHeightFactor=function(t){return"number"==typeof(t=t||1.15)&&(Yn=t),this},ti=d.__private__.getLineHeightFactor=d.getLineHeightFactor=function(){return Yn};Qn(t.lineHeight);var ni=d.__private__.getHorizontalCoordinate=function(t){return E(t)},ii=d.__private__.getVerticalCoordinate=function(t){return g===L?t:Ct[z].mediaBox.topRightY-Ct[z].mediaBox.bottomLeftY-E(t)},ri=d.__private__.getHorizontalCoordinateString=d.getHorizontalCoordinateString=function(t){return S(ni(t))},ei=d.__private__.getVerticalCoordinateString=d.getVerticalCoordinateString=function(t){return S(ii(t))},si=t.strokeColor||"0 G";d.__private__.getStrokeColor=d.getDrawColor=function(){return tn(si)},d.__private__.setStrokeColor=d.setDrawColor=function(t,n,i,r){return si=nn({ch1:t,ch2:n,ch3:i,ch4:r,pdfColorType:"draw",precision:2}),Q(si),this};var oi=t.fillColor||"0 g";d.__private__.getFillColor=d.getFillColor=function(){return tn(oi)},d.__private__.setFillColor=d.setFillColor=function(t,n,i,r){return oi=nn({ch1:t,ch2:n,ch3:i,ch4:r,pdfColorType:"fill",precision:2}),Q(oi),this};var ai=t.textColor||"0 g",ui=d.__private__.getTextColor=d.getTextColor=function(){return tn(ai)};d.__private__.setTextColor=d.setTextColor=function(t,n,i,r){return ai=nn({ch1:t,ch2:n,ch3:i,ch4:r,pdfColorType:"text",precision:3}),this};var fi=t.charSpace,ci=d.__private__.getCharSpace=d.getCharSpace=function(){return parseFloat(fi||0)};d.__private__.setCharSpace=d.setCharSpace=function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.setCharSpace");return fi=t,this};var hi=0;d.CapJoinStyles={0:0,butt:0,but:0,miter:0,1:1,round:1,rounded:1,circle:1,2:2,projecting:2,project:2,square:2,bevel:2},d.__private__.setLineCap=d.setLineCap=function(t){var n=d.CapJoinStyles[t];if(void 0===n)throw new Error("Line cap style of '"+t+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return hi=n,Q(n+" J"),this};var li=0;d.__private__.setLineJoin=d.setLineJoin=function(t){var n=d.CapJoinStyles[t];if(void 0===n)throw new Error("Line join style of '"+t+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return li=n,Q(n+" j"),this},d.__private__.setLineMiterLimit=d.__private__.setMiterLimit=d.setLineMiterLimit=d.setMiterLimit=function(t){if(t=t||0,isNaN(t))throw new Error("Invalid argument passed to jsPDF.setLineMiterLimit");return Q(S(E(t))+" M"),this},d.GState=qt,d.setGState=function(t){(t="string"==typeof t?Ft[Bt[t]]:vi(null,t)).equals(Rt)||(Q("/"+t.id+" gs"),Rt=t)};var vi=function(t,n){if(!t||!Bt[t]){var i=!1;for(var r in Ft)if(Ft.hasOwnProperty(r)&&Ft[r].equals(n)){i=!0;break}if(i)n=Ft[r];else{var e="GS"+(Object.keys(Ft).length+1).toString(10);Ft[e]=n,n.id=e}return t&&(Bt[t]=n.id),Dt.publish("addGState",n),n}};d.addGState=function(t,n){return vi(t,n),this},d.saveGraphicsState=function(){return Q("q"),jt.push({key:bt,size:et,color:ai}),this},d.restoreGraphicsState=function(){Q("Q");var t=jt.pop();return bt=t.key,et=t.size,ai=t.color,Rt=null,this},d.setCurrentTransformationMatrix=function(t){return Q(t.toString()+" cm"),this},d.comment=function(t){return Q("#"+t),this};var di=function(t,n){var i=t||0;Object.defineProperty(this,"x",{enumerable:!0,get:function(){return i},set:function(t){isNaN(t)||(i=parseFloat(t))}});var r=n||0;Object.defineProperty(this,"y",{enumerable:!0,get:function(){return r},set:function(t){isNaN(t)||(r=parseFloat(t))}});var e="pt";return Object.defineProperty(this,"type",{enumerable:!0,get:function(){return e},set:function(t){e=t.toString()}}),this},wi=function(t,n,i,r){di.call(this,t,n),this.type="rect";var e=i||0;Object.defineProperty(this,"w",{enumerable:!0,get:function(){return e},set:function(t){isNaN(t)||(e=parseFloat(t))}});var s=r||0;return Object.defineProperty(this,"h",{enumerable:!0,get:function(){return s},set:function(t){isNaN(t)||(s=parseFloat(t))}}),this},mi=function(){this.page=Tt,this.currentPage=z,this.pages=Y.slice(0),this.pagesContext=Ct.slice(0),this.x=Nt,this.y=Lt,this.matrix=gt,this.width=Ni(z),this.height=gi(z),this.outputDestination=K,this.id="",this.objectNumber=-1};mi.prototype.restore=function(){Tt=this.page,Ct=this.pagesContext,Y=this.pages,Nt=this.x,Lt=this.y,gt=this.matrix,Li(z=this.currentPage,this.width),Ai(z,this.height),K=this.outputDestination};var bi=function(t,n,i,r,e){Wt.push(new mi),Tt=z=0,Y=[],Nt=t,Lt=n,gt=e,mn([i,r])};for(var pi in d.beginFormObject=function(t,n,i,r,e){return bi(t,n,i,r,e),this},d.endFormObject=function(t){return function(t){if(Vt[t])Wt.pop().restore();else{var n=new mi,i="Xo"+(Object.keys(Ut).length+1).toString(10);n.id=i,Vt[t]=i,Ut[i]=n,Dt.publish("addFormObject",n),Wt.pop().restore()}}(t),this},d.doFormObject=function(t,n){var i=Ut[Vt[t]];return Q("q"),Q(n.toString()+" cm"),Q("/"+i.id+" Do"),Q("Q"),this},d.getFormObject=function(t){var n=Ut[Vt[t]];return{x:n.x,y:n.y,width:n.width,height:n.height,matrix:n.matrix}},d.save=function(t,n){return t=t||"generated.pdf",(n=n||{}).returnPromise=n.returnPromise||!1,!1===n.returnPromise?(ot(jn(qn()),t),"function"==typeof ot.unload&&Z.setTimeout&&setTimeout(ot.unload,911),this):new Promise((function(n,i){try{var r=ot(jn(qn()),t);"function"==typeof ot.unload&&Z.setTimeout&&setTimeout(ot.unload,911),n(r)}catch(t){i(t.message)}}))},Pt.API)Pt.API.hasOwnProperty(pi)&&("events"===pi&&Pt.API.events.length?function(t,n){var i,r;for(r=n.length-1;-1!==r;r--)t.subscribe.apply(t,[n[r][0]].concat("function"==typeof(i=n[r][1])?[i]:i))}(Dt,Pt.API.events):d[pi]=Pt.API[pi]);var Ni=d.getPageWidth=function(t){return(Ct[t=t||z].mediaBox.topRightX-Ct[t].mediaBox.bottomLeftX)/pt},Li=d.setPageWidth=function(t,n){Ct[t].mediaBox.topRightX=n*pt+Ct[t].mediaBox.bottomLeftX},gi=d.getPageHeight=function(t){return(Ct[t=t||z].mediaBox.topRightY-Ct[t].mediaBox.bottomLeftY)/pt},Ai=d.setPageHeight=function(t,n){Ct[t].mediaBox.topRightY=n*pt+Ct[t].mediaBox.bottomLeftY};return d.internal={pdfEscape:wn,getStyle:Tn,getFont:Jn,getFontSize:ft,getCharSpace:ci,getTextColor:ui,getLineHeight:Zn,getLineHeightFactor:ti,getLineWidth:Kn,write:nt,getHorizontalCoordinate:ni,getVerticalCoordinate:ii,getCoordinateString:ri,getVerticalCoordinateString:ei,collections:{},newObject:Yt,newAdditionalObject:Xt,newObjectDeferred:$t,newObjectDeferredBegin:Kt,getFilters:rn,putStream:en,events:Dt,scaleFactor:pt,pageSize:{getWidth:function(){return Ni(z)},setWidth:function(t){Li(z,t)},getHeight:function(){return gi(z)},setHeight:function(t){Ai(z,t)}},encryptionOptions:c,encryption:Pn,getEncryptor:function(t){return null!==c?Pn.encryptor(t,0):function(t){return t}},output:Mn,getNumberOfPages:Ln,pages:Y,out:Q,f2:j,f3:M,getPageInfo:On,getPageInfoByObjId:In,getCurrentPageInfo:Fn,getPDFVersion:m,Point:di,Rectangle:wi,Matrix:Ht,hasHotfix:En},Object.defineProperty(d.internal.pageSize,"width",{get:function(){return Ni(z)},set:function(t){Li(z,t)},enumerable:!0,configurable:!0}),Object.defineProperty(d.internal.pageSize,"height",{get:function(){return gi(z)},set:function(t){Ai(z,t)},enumerable:!0,configurable:!0}),function(t){for(var n=0,i=rt.length;n<i;n++){var r=dn.call(this,t[n][0],t[n][1],t[n][2],rt[n][3],!0);!1===h&&(v[r]=!0);var e=t[n][0].split("-");vn({id:r,fontName:e[0],fontStyle:e[1]||""})}Dt.publish("addFonts",{fonts:At,dictionary:yt})}.call(d,rt),bt="F1",bn(e,i),Dt.publish("initialized"),d}kt.prototype.lsbFirstWord=function(t){return String.fromCharCode(t>>0&255,t>>8&255,t>>16&255,t>>24&255)},kt.prototype.toHexString=function(t){return t.split("").map((function(t){return("0"+(255&t.charCodeAt(0)).toString(16)).slice(-2)})).join("")},kt.prototype.hexToBytes=function(t){for(var n=[],i=0;i<t.length;i+=2)n.push(String.fromCharCode(parseInt(t.substr(i,2),16)));return n.join("")},kt.prototype.processOwnerPassword=function(t,n){return At(Nt(n).substr(0,5),t)},kt.prototype.encryptor=function(t,n){var i=Nt(this.encryptionKey+String.fromCharCode(255&t,t>>8&255,t>>16&255,255&n,n>>8&255)).substr(0,10);return function(t){return At(i,t)}},qt.prototype.equals=function(t){var n,i="id,objectNumber,equals";if(!t||l(t)!==l(this))return!1;var r=0;for(n in this)if(!(i.indexOf(n)>=0)){if(this.hasOwnProperty(n)&&!t.hasOwnProperty(n))return!1;if(this[n]!==t[n])return!1;r++}for(n in t)t.hasOwnProperty(n)&&i.indexOf(n)<0&&r--;return 0===r},Pt.API={events:[]},Pt.version="2.5.1";var Ot=Pt.API,It=1,Ft=function(t){return t.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},Bt=function(t){return t.replace(/\\\\/g,"\\").replace(/\\\(/g,"(").replace(/\\\)/g,")")},Rt=function(t){return t.toFixed(2)},Tt=function(t){return t.toFixed(5)};Ot.__acroform__={};var Ct=function(t,n){t.prototype=Object.create(n.prototype),t.prototype.constructor=t},Dt=function(t){return t*It},zt=function(t){var n=new en,i=pn.internal.getHeight(t)||0,r=pn.internal.getWidth(t)||0;return n.BBox=[0,0,Number(Rt(r)),Number(Rt(i))],n},Ut=Ot.__acroform__.setBit=function(t,n){if(t=t||0,n=n||0,isNaN(t)||isNaN(n))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBit");return t|1<<n},Vt=Ot.__acroform__.clearBit=function(t,n){if(t=t||0,n=n||0,isNaN(t)||isNaN(n))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBit");return t&~(1<<n)},Wt=Ot.__acroform__.getBit=function(t,n){if(isNaN(t)||isNaN(n))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBit");return 0==(t&1<<n)?0:1},Ht=Ot.__acroform__.getBitForPdf=function(t,n){if(isNaN(t)||isNaN(n))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBitForPdf");return Wt(t,n-1)},_t=Ot.__acroform__.setBitForPdf=function(t,n){if(isNaN(t)||isNaN(n))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBitForPdf");return Ut(t,n-1)},Gt=Ot.__acroform__.clearBitForPdf=function(t,n){if(isNaN(t)||isNaN(n))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBitForPdf");return Vt(t,n-1)},Jt=Ot.__acroform__.calculateCoordinates=function(t,n){var i=n.internal.getHorizontalCoordinate,r=n.internal.getVerticalCoordinate,e=t[0],s=t[1],o=t[2],a=t[3],u={};return u.lowerLeft_X=i(e)||0,u.lowerLeft_Y=r(s+a)||0,u.upperRight_X=i(e+o)||0,u.upperRight_Y=r(s)||0,[Number(Rt(u.lowerLeft_X)),Number(Rt(u.lowerLeft_Y)),Number(Rt(u.upperRight_X)),Number(Rt(u.upperRight_Y))]},Yt=function(t){if(t.appearanceStreamContent)return t.appearanceStreamContent;if(t.V||t.DV){var n=[],i=$t(t,t._V||t.DV),r=t.scope.internal.getFont(t.fontName,t.fontStyle).id;n.push("/Tx BMC"),n.push("q"),n.push("BT"),n.push(t.scope.__private__.encodeColorString(t.color)),n.push("/"+r+" "+Rt(i.fontSize)+" Tf"),n.push("1 0 0 1 0 0 Tm"),n.push(i.text),n.push("ET"),n.push("Q"),n.push("EMC");var e=zt(t);return e.scope=t.scope,e.stream=n.join("\n"),e}},$t=function(t,n){var i=0===t.fontSize?t.maxFontSize:t.fontSize,r={text:"",fontSize:""},e=(n=")"==(n="("==n.substr(0,1)?n.substr(1):n).substr(n.length-1)?n.substr(0,n.length-1):n).split(" ");e=e.map(t.multiline?function(t){return t.split("\n")}:function(t){return[t]});var s=i,o=pn.internal.getHeight(t)||0;o=o<0?-o:o;var a=pn.internal.getWidth(t)||0;a=a<0?-a:a;var u=function(n,i,r){return n+1<e.length&&Kt(i+" "+e[n+1][0],t,r).width<=a-4};s++;t:for(;s>0;){n="",s--;var f,c,h=Kt("3",t,s).height,l=t.multiline?o-s:(o-h)/2,v=l+=2,d=0,w=0,m=0;if(s<=0){n="(...) Tj\n",n+="% Width of Text: "+Kt(n,t,s=12).width+", FieldWidth:"+a+"\n";break}for(var b="",p=0,N=0;N<e.length;N++)if(e.hasOwnProperty(N)){var L=!1;if(1!==e[N].length&&m!==e[N].length-1){if((h+2)*(p+2)+2>o)continue t;b+=e[N][m],L=!0,w=N,N--}else{b=" "==(b+=e[N][m]+" ").substr(b.length-1)?b.substr(0,b.length-1):b;var g=parseInt(N),A=u(g,b,s),y=N>=e.length-1;if(A&&!y){b+=" ",m=0;continue}if(A||y){if(y)w=g;else if(t.multiline&&(h+2)*(p+2)+2>o)continue t}else{if(!t.multiline)continue t;if((h+2)*(p+2)+2>o)continue t;w=g}}for(var k="",S=d;S<=w;S++){var x=e[S];if(t.multiline){if(S===w){k+=x[m]+" ",m=(m+1)%x.length;continue}if(S===d){k+=x[x.length-1]+" ";continue}}k+=x[0]+" "}switch(k=" "==k.substr(k.length-1)?k.substr(0,k.length-1):k,c=Kt(k,t,s).width,t.textAlign){case"right":f=a-c-2;break;case"center":f=(a-c)/2;break;default:f=2}n+=Rt(f)+" "+Rt(v)+" Td\n",n+="("+Ft(k)+") Tj\n",n+=-Rt(f)+" 0 Td\n",v=-(s+2),c=0,d=L?w:w+1,p++,b=""}break}return r.text=n,r.fontSize=s,r},Kt=function(t,n,i){var r=n.scope.internal.getFont(n.fontName,n.fontStyle),e=n.scope.getStringUnitWidth(t,{font:r,fontSize:parseFloat(i),charSpace:0})*parseFloat(i);return{height:n.scope.getStringUnitWidth("3",{font:r,fontSize:parseFloat(i),charSpace:0})*parseFloat(i)*1.5,width:e}},Xt={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},Zt=function(t,n){var i={type:"reference",object:t};void 0===n.internal.getPageInfo(t.page).pageContext.annotations.find((function(t){return t.type===i.type&&t.object===i.object}))&&n.internal.getPageInfo(t.page).pageContext.annotations.push(i)},Qt=function(t,n){if(n.scope=t,void 0!==t.internal&&(void 0===t.internal.acroformPlugin||!1===t.internal.acroformPlugin.isInitialized)){if(on.FieldNum=0,t.internal.acroformPlugin=JSON.parse(JSON.stringify(Xt)),t.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("Exception while creating AcroformDictionary");It=t.internal.scaleFactor,t.internal.acroformPlugin.acroFormDictionaryRoot=new sn,t.internal.acroformPlugin.acroFormDictionaryRoot.scope=t,t.internal.acroformPlugin.acroFormDictionaryRoot._eventID=t.internal.events.subscribe("postPutResources",(function(){!function(t){t.internal.events.unsubscribe(t.internal.acroformPlugin.acroFormDictionaryRoot._eventID),delete t.internal.acroformPlugin.acroFormDictionaryRoot._eventID,t.internal.acroformPlugin.printedOut=!0}(t)})),t.internal.events.subscribe("buildDocument",(function(){!function(t){t.internal.acroformPlugin.acroFormDictionaryRoot.objId=void 0;var n=t.internal.acroformPlugin.acroFormDictionaryRoot.Fields;for(var i in n)if(n.hasOwnProperty(i)){var r=n[i];r.objId=void 0,r.hasAnnotation&&Zt(r,t)}}(t)})),t.internal.events.subscribe("putCatalog",(function(){!function(t){if(void 0===t.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("putCatalogCallback: Root missing.");t.internal.write("/AcroForm "+t.internal.acroformPlugin.acroFormDictionaryRoot.objId+" 0 R")}(t)})),t.internal.events.subscribe("postPutPages",(function(n){!function(t,n){var i=!t;for(var r in t||(n.internal.newObjectDeferredBegin(n.internal.acroformPlugin.acroFormDictionaryRoot.objId,!0),n.internal.acroformPlugin.acroFormDictionaryRoot.putStream()),t=t||n.internal.acroformPlugin.acroFormDictionaryRoot.Kids)if(t.hasOwnProperty(r)){var e=t[r],s=[],o=e.Rect;if(e.Rect&&(e.Rect=Jt(e.Rect,n)),n.internal.newObjectDeferredBegin(e.objId,!0),e.DA=pn.createDefaultAppearanceStream(e),"object"===l(e)&&"function"==typeof e.getKeyValueListForStream&&(s=e.getKeyValueListForStream()),e.Rect=o,e.hasAppearanceStream&&!e.appearanceStreamContent){var a=Yt(e);s.push({key:"AP",value:"<</N "+a+">>"}),n.internal.acroformPlugin.xForms.push(a)}if(e.appearanceStreamContent){var u="";for(var f in e.appearanceStreamContent)if(e.appearanceStreamContent.hasOwnProperty(f)){var c=e.appearanceStreamContent[f];if(u+="/"+f+" ",u+="<<",Object.keys(c).length>=1||Array.isArray(c)){for(var r in c)if(c.hasOwnProperty(r)){var h=c[r];"function"==typeof h&&(h=h.call(n,e)),u+="/"+r+" "+h+" ",n.internal.acroformPlugin.xForms.indexOf(h)>=0||n.internal.acroformPlugin.xForms.push(h)}}else"function"==typeof(h=c)&&(h=h.call(n,e)),u+="/"+r+" "+h,n.internal.acroformPlugin.xForms.indexOf(h)>=0||n.internal.acroformPlugin.xForms.push(h);u+=">>"}s.push({key:"AP",value:"<<\n"+u+">>"})}n.internal.putStream({additionalKeyValues:s,objectId:e.objId}),n.internal.out("endobj")}i&&function(t,n){for(var i in t)if(t.hasOwnProperty(i)){var r=i,e=t[i];n.internal.newObjectDeferredBegin(e.objId,!0),"object"===l(e)&&"function"==typeof e.putStream&&e.putStream(),delete t[r]}}(n.internal.acroformPlugin.xForms,n)}(n,t)})),t.internal.acroformPlugin.isInitialized=!0}},tn=Ot.__acroform__.arrayToPdfArray=function(t,n,i){var r=function(t){return t};if(Array.isArray(t)){for(var e="[",s=0;s<t.length;s++)switch(0!==s&&(e+=" "),l(t[s])){case"boolean":case"number":case"object":e+=t[s].toString();break;case"string":"/"!==t[s].substr(0,1)?(void 0!==n&&i&&(r=i.internal.getEncryptor(n)),e+="("+Ft(r(t[s].toString()))+")"):e+=t[s].toString()}return e+"]"}throw new Error("Invalid argument passed to jsPDF.__acroform__.arrayToPdfArray")},nn=function(t,n,i){var r=function(t){return t};return void 0!==n&&i&&(r=i.internal.getEncryptor(n)),(t=t||"").toString(),"("+Ft(r(t))+")"},rn=function(){this._objId=void 0,this._scope=void 0,Object.defineProperty(this,"objId",{get:function(){if(void 0===this._objId){if(void 0===this.scope)return;this._objId=this.scope.internal.newObjectDeferred()}return this._objId},set:function(t){this._objId=t}}),Object.defineProperty(this,"scope",{value:this._scope,writable:!0})};rn.prototype.toString=function(){return this.objId+" 0 R"},rn.prototype.putStream=function(){var t=this.getKeyValueListForStream();this.scope.internal.putStream({data:this.stream,additionalKeyValues:t,objectId:this.objId}),this.scope.internal.out("endobj")},rn.prototype.getKeyValueListForStream=function(){var t=[],n=Object.getOwnPropertyNames(this).filter((function(t){return"content"!=t&&"appearanceStreamContent"!=t&&"scope"!=t&&"objId"!=t&&"_"!=t.substring(0,1)}));for(var i in n)if(!1===Object.getOwnPropertyDescriptor(this,n[i]).configurable){var r=n[i],e=this[r];e&&(Array.isArray(e)?t.push({key:r,value:tn(e,this.objId,this.scope)}):e instanceof rn?(e.scope=this.scope,t.push({key:r,value:e.objId+" 0 R"})):"function"!=typeof e&&t.push({key:r,value:e}))}return t};var en=function(){rn.call(this),Object.defineProperty(this,"Type",{value:"/XObject",configurable:!1,writable:!0}),Object.defineProperty(this,"Subtype",{value:"/Form",configurable:!1,writable:!0}),Object.defineProperty(this,"FormType",{value:1,configurable:!1,writable:!0});var t,n=[];Object.defineProperty(this,"BBox",{configurable:!1,get:function(){return n},set:function(t){n=t}}),Object.defineProperty(this,"Resources",{value:"2 0 R",configurable:!1,writable:!0}),Object.defineProperty(this,"stream",{enumerable:!1,configurable:!0,set:function(n){t=n.trim()},get:function(){return t||null}})};Ct(en,rn);var sn=function(){rn.call(this);var t,n=[];Object.defineProperty(this,"Kids",{enumerable:!1,configurable:!0,get:function(){return n.length>0?n:void 0}}),Object.defineProperty(this,"Fields",{enumerable:!1,configurable:!1,get:function(){return n}}),Object.defineProperty(this,"DA",{enumerable:!1,configurable:!1,get:function(){if(t){var n=function(t){return t};return this.scope&&(n=this.scope.internal.getEncryptor(this.objId)),"("+Ft(n(t))+")"}},set:function(n){t=n}})};Ct(sn,rn);var on=function t(){rn.call(this);var n=4;Object.defineProperty(this,"F",{enumerable:!1,configurable:!1,get:function(){return n},set:function(t){if(isNaN(t))throw new Error('Invalid value "'+t+'" for attribute F supplied.');n=t}}),Object.defineProperty(this,"showWhenPrinted",{enumerable:!0,configurable:!0,get:function(){return Boolean(Ht(n,3))},set:function(t){this.F=!0===Boolean(t)?_t(n,3):Gt(n,3)}});var i=0;Object.defineProperty(this,"Ff",{enumerable:!1,configurable:!1,get:function(){return i},set:function(t){if(isNaN(t))throw new Error('Invalid value "'+t+'" for attribute Ff supplied.');i=t}});var r=[];Object.defineProperty(this,"Rect",{enumerable:!1,configurable:!1,get:function(){if(0!==r.length)return r},set:function(t){r=void 0!==t?t:[]}}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[0])?0:r[0]},set:function(t){r[0]=t}}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[1])?0:r[1]},set:function(t){r[1]=t}}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[2])?0:r[2]},set:function(t){r[2]=t}}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[3])?0:r[3]},set:function(t){r[3]=t}});var e="";Object.defineProperty(this,"FT",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){switch(t){case"/Btn":case"/Tx":case"/Ch":case"/Sig":e=t;break;default:throw new Error('Invalid value "'+t+'" for attribute FT supplied.')}}});var s=null;Object.defineProperty(this,"T",{enumerable:!0,configurable:!1,get:function(){if(!s||s.length<1){if(this instanceof dn)return;s="FieldObject"+t.FieldNum++}var n=function(t){return t};return this.scope&&(n=this.scope.internal.getEncryptor(this.objId)),"("+Ft(n(s))+")"},set:function(t){s=t.toString()}}),Object.defineProperty(this,"fieldName",{configurable:!0,enumerable:!0,get:function(){return s},set:function(t){s=t}});var o="helvetica";Object.defineProperty(this,"fontName",{enumerable:!0,configurable:!0,get:function(){return o},set:function(t){o=t}});var a="normal";Object.defineProperty(this,"fontStyle",{enumerable:!0,configurable:!0,get:function(){return a},set:function(t){a=t}});var u=0;Object.defineProperty(this,"fontSize",{enumerable:!0,configurable:!0,get:function(){return u},set:function(t){u=t}});var f=void 0;Object.defineProperty(this,"maxFontSize",{enumerable:!0,configurable:!0,get:function(){return void 0===f?50/It:f},set:function(t){f=t}});var c="black";Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,get:function(){return c},set:function(t){c=t}});var h="/F1 0 Tf 0 g";Object.defineProperty(this,"DA",{enumerable:!0,configurable:!1,get:function(){if(!(!h||this instanceof dn||this instanceof mn))return nn(h,this.objId,this.scope)},set:function(t){t=t.toString(),h=t}});var l=null;Object.defineProperty(this,"DV",{enumerable:!1,configurable:!1,get:function(){if(l)return this instanceof hn==0?nn(l,this.objId,this.scope):l},set:function(t){t=t.toString(),l=this instanceof hn==0?"("===t.substr(0,1)?Bt(t.substr(1,t.length-2)):Bt(t):t}}),Object.defineProperty(this,"defaultValue",{enumerable:!0,configurable:!0,get:function(){return this instanceof hn==1?Bt(l.substr(1,l.length-1)):l},set:function(t){t=t.toString(),l=this instanceof hn==1?"/"+t:t}});var v=null;Object.defineProperty(this,"_V",{enumerable:!1,configurable:!1,get:function(){if(v)return v},set:function(t){this.V=t}}),Object.defineProperty(this,"V",{enumerable:!1,configurable:!1,get:function(){if(v)return this instanceof hn==0?nn(v,this.objId,this.scope):v},set:function(t){t=t.toString(),v=this instanceof hn==0?"("===t.substr(0,1)?Bt(t.substr(1,t.length-2)):Bt(t):t}}),Object.defineProperty(this,"value",{enumerable:!0,configurable:!0,get:function(){return this instanceof hn==1?Bt(v.substr(1,v.length-1)):v},set:function(t){t=t.toString(),v=this instanceof hn==1?"/"+t:t}}),Object.defineProperty(this,"hasAnnotation",{enumerable:!0,configurable:!0,get:function(){return this.Rect}}),Object.defineProperty(this,"Type",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Annot":null}}),Object.defineProperty(this,"Subtype",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Widget":null}});var d,w=!1;Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return w},set:function(t){t=Boolean(t),w=t}}),Object.defineProperty(this,"page",{enumerable:!0,configurable:!0,get:function(){if(d)return d},set:function(t){d=t}}),Object.defineProperty(this,"readOnly",{enumerable:!0,configurable:!0,get:function(){return Boolean(Ht(this.Ff,1))},set:function(t){this.Ff=!0===Boolean(t)?_t(this.Ff,1):Gt(this.Ff,1)}}),Object.defineProperty(this,"required",{enumerable:!0,configurable:!0,get:function(){return Boolean(Ht(this.Ff,2))},set:function(t){this.Ff=!0===Boolean(t)?_t(this.Ff,2):Gt(this.Ff,2)}}),Object.defineProperty(this,"noExport",{enumerable:!0,configurable:!0,get:function(){return Boolean(Ht(this.Ff,3))},set:function(t){this.Ff=!0===Boolean(t)?_t(this.Ff,3):Gt(this.Ff,3)}});var m=null;Object.defineProperty(this,"Q",{enumerable:!0,configurable:!1,get:function(){if(null!==m)return m},set:function(t){if(-1===[0,1,2].indexOf(t))throw new Error('Invalid value "'+t+'" for attribute Q supplied.');m=t}}),Object.defineProperty(this,"textAlign",{get:function(){var t;switch(m){case 0:default:t="left";break;case 1:t="center";break;case 2:t="right"}return t},configurable:!0,enumerable:!0,set:function(t){switch(t){case"right":case 2:m=2;break;case"center":case 1:m=1;break;default:m=0}}})};Ct(on,rn);var an=function(){on.call(this),this.FT="/Ch",this.V="()",this.fontName="zapfdingbats";var t=0;Object.defineProperty(this,"TI",{enumerable:!0,configurable:!1,get:function(){return t},set:function(n){t=n}}),Object.defineProperty(this,"topIndex",{enumerable:!0,configurable:!0,get:function(){return t},set:function(n){t=n}});var n=[];Object.defineProperty(this,"Opt",{enumerable:!0,configurable:!1,get:function(){return tn(n,this.objId,this.scope)},set:function(t){var i,r;r=[],"string"==typeof(i=t)&&(r=function(t,n,i){i||(i=1);for(var r,e=[];r=n.exec(t);)e.push(r[i]);return e}(i,/\((.*?)\)/g)),n=r}}),this.getOptions=function(){return n},this.setOptions=function(t){n=t,this.sort&&n.sort()},this.addOption=function(t){t=(t=t||"").toString(),n.push(t),this.sort&&n.sort()},this.removeOption=function(t,i){for(i=i||!1,t=(t=t||"").toString();-1!==n.indexOf(t)&&(n.splice(n.indexOf(t),1),!1!==i););},Object.defineProperty(this,"combo",{enumerable:!0,configurable:!0,get:function(){return Boolean(Ht(this.Ff,18))},set:function(t){this.Ff=!0===Boolean(t)?_t(this.Ff,18):Gt(this.Ff,18)}}),Object.defineProperty(this,"edit",{enumerable:!0,configurable:!0,get:function(){return Boolean(Ht(this.Ff,19))},set:function(t){!0===this.combo&&(this.Ff=!0===Boolean(t)?_t(this.Ff,19):Gt(this.Ff,19))}}),Object.defineProperty(this,"sort",{enumerable:!0,configurable:!0,get:function(){return Boolean(Ht(this.Ff,20))},set:function(t){!0===Boolean(t)?(this.Ff=_t(this.Ff,20),n.sort()):this.Ff=Gt(this.Ff,20)}}),Object.defineProperty(this,"multiSelect",{enumerable:!0,configurable:!0,get:function(){return Boolean(Ht(this.Ff,22))},set:function(t){this.Ff=!0===Boolean(t)?_t(this.Ff,22):Gt(this.Ff,22)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return Boolean(Ht(this.Ff,23))},set:function(t){this.Ff=!0===Boolean(t)?_t(this.Ff,23):Gt(this.Ff,23)}}),Object.defineProperty(this,"commitOnSelChange",{enumerable:!0,configurable:!0,get:function(){return Boolean(Ht(this.Ff,27))},set:function(t){this.Ff=!0===Boolean(t)?_t(this.Ff,27):Gt(this.Ff,27)}}),this.hasAppearanceStream=!1};Ct(an,on);var un=function(){an.call(this),this.fontName="helvetica",this.combo=!1};Ct(un,an);var fn=function(){un.call(this),this.combo=!0};Ct(fn,un);var cn=function(){fn.call(this),this.edit=!0};Ct(cn,fn);var hn=function(){on.call(this),this.FT="/Btn",Object.defineProperty(this,"noToggleToOff",{enumerable:!0,configurable:!0,get:function(){return Boolean(Ht(this.Ff,15))},set:function(t){this.Ff=!0===Boolean(t)?_t(this.Ff,15):Gt(this.Ff,15)}}),Object.defineProperty(this,"radio",{enumerable:!0,configurable:!0,get:function(){return Boolean(Ht(this.Ff,16))},set:function(t){this.Ff=!0===Boolean(t)?_t(this.Ff,16):Gt(this.Ff,16)}}),Object.defineProperty(this,"pushButton",{enumerable:!0,configurable:!0,get:function(){return Boolean(Ht(this.Ff,17))},set:function(t){this.Ff=!0===Boolean(t)?_t(this.Ff,17):Gt(this.Ff,17)}}),Object.defineProperty(this,"radioIsUnison",{enumerable:!0,configurable:!0,get:function(){return Boolean(Ht(this.Ff,26))},set:function(t){this.Ff=!0===Boolean(t)?_t(this.Ff,26):Gt(this.Ff,26)}});var t,n={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var t=function(t){return t};if(this.scope&&(t=this.scope.internal.getEncryptor(this.objId)),0!==Object.keys(n).length){var i,r=[];for(i in r.push("<<"),n)r.push("/"+i+" ("+Ft(t(n[i]))+")");return r.push(">>"),r.join("\n")}},set:function(t){"object"===l(t)&&(n=t)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return n.CA||""},set:function(t){"string"==typeof t&&(n.CA=t)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return t},set:function(n){t=n}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return t.substr(1,t.length-1)},set:function(n){t="/"+n}})};Ct(hn,on);var ln=function(){hn.call(this),this.pushButton=!0};Ct(ln,hn);var vn=function(){hn.call(this),this.radio=!0,this.pushButton=!1;var t=[];Object.defineProperty(this,"Kids",{enumerable:!0,configurable:!1,get:function(){return t},set:function(n){t=void 0!==n?n:[]}})};Ct(vn,hn);var dn=function(){var t,n;on.call(this),Object.defineProperty(this,"Parent",{enumerable:!1,configurable:!1,get:function(){return t},set:function(n){t=n}}),Object.defineProperty(this,"optionName",{enumerable:!1,configurable:!0,get:function(){return n},set:function(t){n=t}});var i,r={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var t=function(t){return t};this.scope&&(t=this.scope.internal.getEncryptor(this.objId));var n,i=[];for(n in i.push("<<"),r)i.push("/"+n+" ("+Ft(t(r[n]))+")");return i.push(">>"),i.join("\n")},set:function(t){"object"===l(t)&&(r=t)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return r.CA||""},set:function(t){"string"==typeof t&&(r.CA=t)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return i},set:function(t){i=t}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return i.substr(1,i.length-1)},set:function(t){i="/"+t}}),this.caption="l",this.appearanceState="Off",this._AppearanceType=pn.RadioButton.Circle,this.appearanceStreamContent=this._AppearanceType.createAppearanceStream(this.optionName)};Ct(dn,on),vn.prototype.setAppearance=function(t){if(!("createAppearanceStream"in t)||!("getCA"in t))throw new Error("Couldn't assign Appearance to RadioButton. Appearance was Invalid!");for(var n in this.Kids)if(this.Kids.hasOwnProperty(n)){var i=this.Kids[n];i.appearanceStreamContent=t.createAppearanceStream(i.optionName),i.caption=t.getCA()}},vn.prototype.createOption=function(t){var n=new dn;return n.Parent=this,n.optionName=t,this.Kids.push(n),Nn.call(this.scope,n),n};var wn=function(){hn.call(this),this.fontName="zapfdingbats",this.caption="3",this.appearanceState="On",this.value="On",this.textAlign="center",this.appearanceStreamContent=pn.CheckBox.createAppearanceStream()};Ct(wn,hn);var mn=function(){on.call(this),this.FT="/Tx",Object.defineProperty(this,"multiline",{enumerable:!0,configurable:!0,get:function(){return Boolean(Ht(this.Ff,13))},set:function(t){this.Ff=!0===Boolean(t)?_t(this.Ff,13):Gt(this.Ff,13)}}),Object.defineProperty(this,"fileSelect",{enumerable:!0,configurable:!0,get:function(){return Boolean(Ht(this.Ff,21))},set:function(t){this.Ff=!0===Boolean(t)?_t(this.Ff,21):Gt(this.Ff,21)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return Boolean(Ht(this.Ff,23))},set:function(t){this.Ff=!0===Boolean(t)?_t(this.Ff,23):Gt(this.Ff,23)}}),Object.defineProperty(this,"doNotScroll",{enumerable:!0,configurable:!0,get:function(){return Boolean(Ht(this.Ff,24))},set:function(t){this.Ff=!0===Boolean(t)?_t(this.Ff,24):Gt(this.Ff,24)}}),Object.defineProperty(this,"comb",{enumerable:!0,configurable:!0,get:function(){return Boolean(Ht(this.Ff,25))},set:function(t){this.Ff=!0===Boolean(t)?_t(this.Ff,25):Gt(this.Ff,25)}}),Object.defineProperty(this,"richText",{enumerable:!0,configurable:!0,get:function(){return Boolean(Ht(this.Ff,26))},set:function(t){this.Ff=!0===Boolean(t)?_t(this.Ff,26):Gt(this.Ff,26)}});var t=null;Object.defineProperty(this,"MaxLen",{enumerable:!0,configurable:!1,get:function(){return t},set:function(n){t=n}}),Object.defineProperty(this,"maxLength",{enumerable:!0,configurable:!0,get:function(){return t},set:function(n){Number.isInteger(n)&&(t=n)}}),Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return this.V||this.DV}})};Ct(mn,on);var bn=function(){mn.call(this),Object.defineProperty(this,"password",{enumerable:!0,configurable:!0,get:function(){return Boolean(Ht(this.Ff,14))},set:function(t){this.Ff=!0===Boolean(t)?_t(this.Ff,14):Gt(this.Ff,14)}}),this.password=!0};Ct(bn,mn);var pn={CheckBox:{createAppearanceStream:function(){return{N:{On:pn.CheckBox.YesNormal},D:{On:pn.CheckBox.YesPushDown,Off:pn.CheckBox.OffPushDown}}},YesPushDown:function(t){var n=zt(t);n.scope=t.scope;var i=[],r=t.scope.internal.getFont(t.fontName,t.fontStyle).id,e=t.scope.__private__.encodeColorString(t.color),s=$t(t,t.caption);return i.push("0.749023 g"),i.push("0 0 "+Rt(pn.internal.getWidth(t))+" "+Rt(pn.internal.getHeight(t))+" re"),i.push("f"),i.push("BMC"),i.push("q"),i.push("0 0 1 rg"),i.push("/"+r+" "+Rt(s.fontSize)+" Tf "+e),i.push("BT"),i.push(s.text),i.push("ET"),i.push("Q"),i.push("EMC"),n.stream=i.join("\n"),n},YesNormal:function(t){var n=zt(t);n.scope=t.scope;var i=t.scope.internal.getFont(t.fontName,t.fontStyle).id,r=t.scope.__private__.encodeColorString(t.color),e=[],s=pn.internal.getHeight(t),o=pn.internal.getWidth(t),a=$t(t,t.caption);return e.push("1 g"),e.push("0 0 "+Rt(o)+" "+Rt(s)+" re"),e.push("f"),e.push("q"),e.push("0 0 1 rg"),e.push("0 0 "+Rt(o-1)+" "+Rt(s-1)+" re"),e.push("W"),e.push("n"),e.push("0 g"),e.push("BT"),e.push("/"+i+" "+Rt(a.fontSize)+" Tf "+r),e.push(a.text),e.push("ET"),e.push("Q"),n.stream=e.join("\n"),n},OffPushDown:function(t){var n=zt(t);n.scope=t.scope;var i=[];return i.push("0.749023 g"),i.push("0 0 "+Rt(pn.internal.getWidth(t))+" "+Rt(pn.internal.getHeight(t))+" re"),i.push("f"),n.stream=i.join("\n"),n}},RadioButton:{Circle:{createAppearanceStream:function(t){var n={D:{Off:pn.RadioButton.Circle.OffPushDown},N:{}};return n.N[t]=pn.RadioButton.Circle.YesNormal,n.D[t]=pn.RadioButton.Circle.YesPushDown,n},getCA:function(){return"l"},YesNormal:function(t){var n=zt(t);n.scope=t.scope;var i=[],r=pn.internal.getWidth(t)<=pn.internal.getHeight(t)?pn.internal.getWidth(t)/4:pn.internal.getHeight(t)/4;r=Number((.9*r).toFixed(5));var e=Number((r*pn.internal.Bezier_C).toFixed(5));return i.push("q"),i.push("1 0 0 1 "+Tt(pn.internal.getWidth(t)/2)+" "+Tt(pn.internal.getHeight(t)/2)+" cm"),i.push(r+" 0 m"),i.push(r+" "+e+" "+e+" "+r+" 0 "+r+" c"),i.push("-"+e+" "+r+" -"+r+" "+e+" -"+r+" 0 c"),i.push("-"+r+" -"+e+" -"+e+" -"+r+" 0 -"+r+" c"),i.push(e+" -"+r+" "+r+" -"+e+" "+r+" 0 c"),i.push("f"),i.push("Q"),n.stream=i.join("\n"),n},YesPushDown:function(t){var n=zt(t);n.scope=t.scope;var i=[],r=pn.internal.getWidth(t)<=pn.internal.getHeight(t)?pn.internal.getWidth(t)/4:pn.internal.getHeight(t)/4;r=Number((.9*r).toFixed(5));var e=Number((2*r).toFixed(5)),s=Number((e*pn.internal.Bezier_C).toFixed(5)),o=Number((r*pn.internal.Bezier_C).toFixed(5));return i.push("0.749023 g"),i.push("q"),i.push("1 0 0 1 "+Tt(pn.internal.getWidth(t)/2)+" "+Tt(pn.internal.getHeight(t)/2)+" cm"),i.push(e+" 0 m"),i.push(e+" "+s+" "+s+" "+e+" 0 "+e+" c"),i.push("-"+s+" "+e+" -"+e+" "+s+" -"+e+" 0 c"),i.push("-"+e+" -"+s+" -"+s+" -"+e+" 0 -"+e+" c"),i.push(s+" -"+e+" "+e+" -"+s+" "+e+" 0 c"),i.push("f"),i.push("Q"),i.push("0 g"),i.push("q"),i.push("1 0 0 1 "+Tt(pn.internal.getWidth(t)/2)+" "+Tt(pn.internal.getHeight(t)/2)+" cm"),i.push(r+" 0 m"),i.push(r+" "+o+" "+o+" "+r+" 0 "+r+" c"),i.push("-"+o+" "+r+" -"+r+" "+o+" -"+r+" 0 c"),i.push("-"+r+" -"+o+" -"+o+" -"+r+" 0 -"+r+" c"),i.push(o+" -"+r+" "+r+" -"+o+" "+r+" 0 c"),i.push("f"),i.push("Q"),n.stream=i.join("\n"),n},OffPushDown:function(t){var n=zt(t);n.scope=t.scope;var i=[],r=pn.internal.getWidth(t)<=pn.internal.getHeight(t)?pn.internal.getWidth(t)/4:pn.internal.getHeight(t)/4;r=Number((.9*r).toFixed(5));var e=Number((2*r).toFixed(5)),s=Number((e*pn.internal.Bezier_C).toFixed(5));return i.push("0.749023 g"),i.push("q"),i.push("1 0 0 1 "+Tt(pn.internal.getWidth(t)/2)+" "+Tt(pn.internal.getHeight(t)/2)+" cm"),i.push(e+" 0 m"),i.push(e+" "+s+" "+s+" "+e+" 0 "+e+" c"),i.push("-"+s+" "+e+" -"+e+" "+s+" -"+e+" 0 c"),i.push("-"+e+" -"+s+" -"+s+" -"+e+" 0 -"+e+" c"),i.push(s+" -"+e+" "+e+" -"+s+" "+e+" 0 c"),i.push("f"),i.push("Q"),n.stream=i.join("\n"),n}},Cross:{createAppearanceStream:function(t){var n={D:{Off:pn.RadioButton.Cross.OffPushDown},N:{}};return n.N[t]=pn.RadioButton.Cross.YesNormal,n.D[t]=pn.RadioButton.Cross.YesPushDown,n},getCA:function(){return"8"},YesNormal:function(t){var n=zt(t);n.scope=t.scope;var i=[],r=pn.internal.calculateCross(t);return i.push("q"),i.push("1 1 "+Rt(pn.internal.getWidth(t)-2)+" "+Rt(pn.internal.getHeight(t)-2)+" re"),i.push("W"),i.push("n"),i.push(Rt(r.x1.x)+" "+Rt(r.x1.y)+" m"),i.push(Rt(r.x2.x)+" "+Rt(r.x2.y)+" l"),i.push(Rt(r.x4.x)+" "+Rt(r.x4.y)+" m"),i.push(Rt(r.x3.x)+" "+Rt(r.x3.y)+" l"),i.push("s"),i.push("Q"),n.stream=i.join("\n"),n},YesPushDown:function(t){var n=zt(t);n.scope=t.scope;var i=pn.internal.calculateCross(t),r=[];return r.push("0.749023 g"),r.push("0 0 "+Rt(pn.internal.getWidth(t))+" "+Rt(pn.internal.getHeight(t))+" re"),r.push("f"),r.push("q"),r.push("1 1 "+Rt(pn.internal.getWidth(t)-2)+" "+Rt(pn.internal.getHeight(t)-2)+" re"),r.push("W"),r.push("n"),r.push(Rt(i.x1.x)+" "+Rt(i.x1.y)+" m"),r.push(Rt(i.x2.x)+" "+Rt(i.x2.y)+" l"),r.push(Rt(i.x4.x)+" "+Rt(i.x4.y)+" m"),r.push(Rt(i.x3.x)+" "+Rt(i.x3.y)+" l"),r.push("s"),r.push("Q"),n.stream=r.join("\n"),n},OffPushDown:function(t){var n=zt(t);n.scope=t.scope;var i=[];return i.push("0.749023 g"),i.push("0 0 "+Rt(pn.internal.getWidth(t))+" "+Rt(pn.internal.getHeight(t))+" re"),i.push("f"),n.stream=i.join("\n"),n}}},createDefaultAppearanceStream:function(t){var n=t.scope.internal.getFont(t.fontName,t.fontStyle).id,i=t.scope.__private__.encodeColorString(t.color);return"/"+n+" "+t.fontSize+" Tf "+i}};pn.internal={Bezier_C:.551915024494,calculateCross:function(t){var n=pn.internal.getWidth(t),i=pn.internal.getHeight(t),r=Math.min(n,i);return{x1:{x:(n-r)/2,y:(i-r)/2+r},x2:{x:(n-r)/2+r,y:(i-r)/2},x3:{x:(n-r)/2,y:(i-r)/2},x4:{x:(n-r)/2+r,y:(i-r)/2+r}}}},pn.internal.getWidth=function(t){var n=0;return"object"===l(t)&&(n=Dt(t.Rect[2])),n},pn.internal.getHeight=function(t){var n=0;return"object"===l(t)&&(n=Dt(t.Rect[3])),n};var Nn=Ot.addField=function(t){if(Qt(this,t),!(t instanceof on))throw new Error("Invalid argument passed to jsPDF.addField.");var n;return(n=t).scope.internal.acroformPlugin.printedOut&&(n.scope.internal.acroformPlugin.printedOut=!1,n.scope.internal.acroformPlugin.acroFormDictionaryRoot=null),n.scope.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(n),t.page=t.scope.internal.getCurrentPageInfo().pageNumber,this};function Ln(t){return t.reduce((function(t,n,i){return t[n]=i,t}),{})}Ot.AcroFormChoiceField=an,Ot.AcroFormListBox=un,Ot.AcroFormComboBox=fn,Ot.AcroFormEditBox=cn,Ot.AcroFormButton=hn,Ot.AcroFormPushButton=ln,Ot.AcroFormRadioButton=vn,Ot.AcroFormCheckBox=wn,Ot.AcroFormTextField=mn,Ot.AcroFormPasswordField=bn,Ot.AcroFormAppearance=pn,Ot.AcroForm={ChoiceField:an,ListBox:un,ComboBox:fn,EditBox:cn,Button:hn,PushButton:ln,RadioButton:vn,CheckBox:wn,TextField:mn,PasswordField:bn,Appearance:pn},Pt.AcroForm={ChoiceField:an,ListBox:un,ComboBox:fn,EditBox:cn,Button:hn,PushButton:ln,RadioButton:vn,CheckBox:wn,TextField:mn,PasswordField:bn,Appearance:pn},function(t){t.__addimage__={};var n="UNKNOWN",i={PNG:[[137,80,78,71]],TIFF:[[77,77,0,42],[73,73,42,0]],JPEG:[[255,216,255,224,void 0,void 0,74,70,73,70,0],[255,216,255,225,void 0,void 0,69,120,105,102,0,0],[255,216,255,219],[255,216,255,238]],JPEG2000:[[0,0,0,12,106,80,32,32]],GIF87a:[[71,73,70,56,55,97]],GIF89a:[[71,73,70,56,57,97]],WEBP:[[82,73,70,70,void 0,void 0,void 0,void 0,87,69,66,80]],BMP:[[66,77],[66,65],[67,73],[67,80],[73,67],[80,84]]},r=t.__addimage__.getImageFileTypeByImageData=function(t,r){var e,s,o,a,u,f=n;if("RGBA"===(r=r||n)||void 0!==t.data&&t.data instanceof Uint8ClampedArray&&"height"in t&&"width"in t)return"RGBA";if(y(t))for(u in i)for(o=i[u],e=0;e<o.length;e+=1){for(a=!0,s=0;s<o[e].length;s+=1)if(void 0!==o[e][s]&&o[e][s]!==t[s]){a=!1;break}if(!0===a){f=u;break}}else for(u in i)for(o=i[u],e=0;e<o.length;e+=1){for(a=!0,s=0;s<o[e].length;s+=1)if(void 0!==o[e][s]&&o[e][s]!==t.charCodeAt(s)){a=!1;break}if(!0===a){f=u;break}}return f===n&&r!==n&&(f=r),f},e=function t(n){for(var i=this.internal.write,r=this.internal.putStream,e=(0,this.internal.getFilters)();-1!==e.indexOf("FlateEncode");)e.splice(e.indexOf("FlateEncode"),1);n.objectId=this.internal.newObject();var s=[];if(s.push({key:"Type",value:"/XObject"}),s.push({key:"Subtype",value:"/Image"}),s.push({key:"Width",value:n.width}),s.push({key:"Height",value:n.height}),n.colorSpace===b.INDEXED?s.push({key:"ColorSpace",value:"[/Indexed /DeviceRGB "+(n.palette.length/3-1)+" "+("sMask"in n&&void 0!==n.sMask?n.objectId+2:n.objectId+1)+" 0 R]"}):(s.push({key:"ColorSpace",value:"/"+n.colorSpace}),n.colorSpace===b.DEVICE_CMYK&&s.push({key:"Decode",value:"[1 0 1 0 1 0 1 0]"})),s.push({key:"BitsPerComponent",value:n.bitsPerComponent}),"decodeParameters"in n&&void 0!==n.decodeParameters&&s.push({key:"DecodeParms",value:"<<"+n.decodeParameters+">>"}),"transparency"in n&&Array.isArray(n.transparency)){for(var o="",a=0,u=n.transparency.length;a<u;a++)o+=n.transparency[a]+" "+n.transparency[a]+" ";s.push({key:"Mask",value:"["+o+"]"})}if(void 0!==n.sMask&&s.push({key:"SMask",value:n.objectId+1+" 0 R"}),r({data:n.data,additionalKeyValues:s,alreadyAppliedFilters:void 0!==n.filter?["/"+n.filter]:void 0,objectId:n.objectId}),i("endobj"),"sMask"in n&&void 0!==n.sMask){var f={width:n.width,height:n.height,colorSpace:"DeviceGray",bitsPerComponent:n.bitsPerComponent,decodeParameters:"/Predictor "+n.predictor+" /Colors 1 /BitsPerComponent "+n.bitsPerComponent+" /Columns "+n.width,data:n.sMask};"filter"in n&&(f.filter=n.filter),t.call(this,f)}if(n.colorSpace===b.INDEXED){var c=this.internal.newObject();r({data:S(new Uint8Array(n.palette)),objectId:c}),i("endobj")}},s=function(){var t=this.internal.collections.addImage_images;for(var n in t)e.call(this,t[n])},o=function(){var t,n=this.internal.collections.addImage_images,i=this.internal.write;for(var r in n)i("/I"+(t=n[r]).index,t.objectId,"0","R")},a=function(){this.internal.collections.addImage_images||(this.internal.collections.addImage_images={},this.internal.events.subscribe("putResources",s),this.internal.events.subscribe("putXobjectDict",o))},u=function(){var t=this.internal.collections.addImage_images;return a.call(this),t},f=function(){return Object.keys(this.internal.collections.addImage_images).length},c=function(n){return"function"==typeof t["process"+n.toUpperCase()]},h=function(t){return"object"===l(t)&&1===t.nodeType},v=function(n,i){if("IMG"===n.nodeName&&n.hasAttribute("src")){var r=""+n.getAttribute("src");if(0===r.indexOf("data:image/"))return et(unescape(r).split("base64,").pop());var e=t.loadFile(r,!0);if(void 0!==e)return e}if("CANVAS"===n.nodeName){if(0===n.width||0===n.height)throw new Error("Given canvas must have data. Canvas width: "+n.width+", height: "+n.height);var s;switch(i){case"PNG":s="image/png";break;case"WEBP":s="image/webp";break;default:s="image/jpeg"}return et(n.toDataURL(s,1).split("base64,").pop())}},d=function(t){var n=this.internal.collections.addImage_images;if(n)for(var i in n)if(t===n[i].alias)return n[i]},w=function(t,n,i){return t||n||(t=-96,n=-96),t<0&&(t=-1*i.width*72/t/this.internal.scaleFactor),n<0&&(n=-1*i.height*72/n/this.internal.scaleFactor),0===t&&(t=n*i.width/i.height),0===n&&(n=t*i.height/i.width),[t,n]},m=function(t,n,i,r,e,s){var o=w.call(this,i,r,e),a=this.internal.getCoordinateString,f=this.internal.getVerticalCoordinateString,c=u.call(this);if(i=o[0],r=o[1],c[e.index]=e,s){s*=Math.PI/180;var h=Math.cos(s),l=Math.sin(s),v=function(t){return t.toFixed(4)},d=[v(h),v(l),v(-1*l),v(h),0,0,"cm"]}this.internal.write("q"),s?(this.internal.write([1,"0","0",1,a(t),f(n+r),"cm"].join(" ")),this.internal.write(d.join(" ")),this.internal.write([a(i),"0","0",a(r),"0","0","cm"].join(" "))):this.internal.write([a(i),"0","0",a(r),a(t),f(n+r),"cm"].join(" ")),this.isAdvancedAPI()&&this.internal.write([1,0,0,-1,0,0,"cm"].join(" ")),this.internal.write("/I"+e.index+" Do"),this.internal.write("Q")},b=t.color_spaces={DEVICE_RGB:"DeviceRGB",DEVICE_GRAY:"DeviceGray",DEVICE_CMYK:"DeviceCMYK",CAL_GREY:"CalGray",CAL_RGB:"CalRGB",LAB:"Lab",ICC_BASED:"ICCBased",INDEXED:"Indexed",PATTERN:"Pattern",SEPARATION:"Separation",DEVICE_N:"DeviceN"};t.decode={DCT_DECODE:"DCTDecode",FLATE_DECODE:"FlateDecode",LZW_DECODE:"LZWDecode",JPX_DECODE:"JPXDecode",JBIG2_DECODE:"JBIG2Decode",ASCII85_DECODE:"ASCII85Decode",ASCII_HEX_DECODE:"ASCIIHexDecode",RUN_LENGTH_DECODE:"RunLengthDecode",CCITT_FAX_DECODE:"CCITTFaxDecode"};var p=t.image_compression={NONE:"NONE",FAST:"FAST",MEDIUM:"MEDIUM",SLOW:"SLOW"},N=t.__addimage__.sHashCode=function(t){var n,i,r=0;if("string"==typeof t)for(i=t.length,n=0;n<i;n++)r=(r<<5)-r+t.charCodeAt(n),r|=0;else if(y(t))for(i=t.byteLength/2,n=0;n<i;n++)r=(r<<5)-r+t[n],r|=0;return r},L=t.__addimage__.validateStringAsBase64=function(t){(t=t||"").toString().trim();var n=!0;return 0===t.length&&(n=!1),t.length%4!=0&&(n=!1),!1===/^[A-Za-z0-9+/]+$/.test(t.substr(0,t.length-2))&&(n=!1),!1===/^[A-Za-z0-9/][A-Za-z0-9+/]|[A-Za-z0-9+/]=|==$/.test(t.substr(-2))&&(n=!1),n},g=t.__addimage__.extractImageFromDataUrl=function(t){var n=(t=t||"").split("base64,"),i=null;if(2===n.length){var r=/^data:(\w*\/\w*);*(charset=(?!charset=)[\w=-]*)*;*$/.exec(n[0]);Array.isArray(r)&&(i={mimeType:r[1],charset:r[2],data:n[1]})}return i},A=t.__addimage__.supportsArrayBuffer=function(){return"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array};t.__addimage__.isArrayBuffer=function(t){return A()&&t instanceof ArrayBuffer};var y=t.__addimage__.isArrayBufferView=function(t){return A()&&"undefined"!=typeof Uint32Array&&(t instanceof Int8Array||t instanceof Uint8Array||"undefined"!=typeof Uint8ClampedArray&&t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array||t instanceof Float64Array)},k=t.__addimage__.binaryStringToUint8Array=function(t){for(var n=t.length,i=new Uint8Array(n),r=0;r<n;r++)i[r]=t.charCodeAt(r);return i},S=t.__addimage__.arrayBufferToBinaryString=function(t){for(var n="",i=y(t)?t:new Uint8Array(t),r=0;r<i.length;r+=8192)n+=String.fromCharCode.apply(null,i.subarray(r,r+8192));return n};t.addImage=function(){var t,i,r,e,s,o,u,f,c;if("number"==typeof arguments[1]?(i=n,r=arguments[1],e=arguments[2],s=arguments[3],o=arguments[4],u=arguments[5],f=arguments[6],c=arguments[7]):(i=arguments[1],r=arguments[2],e=arguments[3],s=arguments[4],o=arguments[5],u=arguments[6],f=arguments[7],c=arguments[8]),"object"===l(t=arguments[0])&&!h(t)&&"imageData"in t){var v=t;t=v.imageData,i=v.format||i||n,r=v.x||r||0,e=v.y||e||0,s=v.w||v.width||s,o=v.h||v.height||o,u=v.alias||u,f=v.compression||f,c=v.rotation||v.angle||c}var d=this.internal.getFilters();if(void 0===f&&-1!==d.indexOf("FlateEncode")&&(f="SLOW"),isNaN(r)||isNaN(e))throw new Error("Invalid coordinates passed to jsPDF.addImage");a.call(this);var w=x.call(this,t,i,u,f);return m.call(this,r,e,s,o,w,c),this};var x=function(i,e,s,o){var a,u,l;if("string"==typeof i&&r(i)===n){i=unescape(i);var w=q(i,!1);(""!==w||void 0!==(w=t.loadFile(i,!0)))&&(i=w)}if(h(i)&&(i=v(i,e)),e=r(i,e),!c(e))throw new Error("addImage does not support files of type '"+e+"', please ensure that a plugin for '"+e+"' support is added.");if((null==(l=s)||0===l.length)&&(s=function(t){return"string"==typeof t||y(t)?N(t):y(t.data)?N(t.data):null}(i)),(a=d.call(this,s))||(A()&&(i instanceof Uint8Array||"RGBA"===e||(u=i,i=k(i))),a=this["process"+e.toUpperCase()](i,f.call(this),s,function(n){return n&&"string"==typeof n&&(n=n.toUpperCase()),n in t.image_compression?n:p.NONE}(o),u)),!a)throw new Error("An unknown error occurred whilst processing the image.");return a},q=t.__addimage__.convertBase64ToBinaryString=function(t,n){var i;n="boolean"!=typeof n||n;var r,e="";if("string"==typeof t){r=null!==(i=g(t))?i.data:t;try{e=et(r)}catch(t){if(n)throw L(r)?new Error("atob-Error in jsPDF.convertBase64ToBinaryString "+t.message):new Error("Supplied Data is not a valid base64-String jsPDF.convertBase64ToBinaryString ")}}return e};t.getImageProperties=function(i){var e,s,o="";if(h(i)&&(i=v(i)),"string"==typeof i&&r(i)===n&&(""===(o=q(i,!1))&&(o=t.loadFile(i)||""),i=o),s=r(i),!c(s))throw new Error("addImage does not support files of type '"+s+"', please ensure that a plugin for '"+s+"' support is added.");if(!A()||i instanceof Uint8Array||(i=k(i)),!(e=this["process"+s.toUpperCase()](i)))throw new Error("An unknown error occurred whilst processing the image");return e.fileType=s,e}}(Pt.API),
110
+ */var yt={print:4,modify:8,copy:16,"annot-forms":32};function kt(t,n,i,r){this.v=1,this.r=2;var e=192;t.forEach((function(t){if(void 0!==yt.perm)throw new Error("Invalid permission: "+t);e+=yt[t]})),this.padding="(¿N^NuŠAd\0NVÿú\b..\0¶Ðh>€/\f©þdSiz";var s=(n+this.padding).substr(0,32),o=(i+this.padding).substr(0,32);this.O=this.processOwnerPassword(s,o),this.P=-(1+(255^e)),this.encryptionKey=Nt(s+this.O+this.lsbFirstWord(this.P)+this.hexToBytes(r)).substr(0,5),this.U=At(this.encryptionKey,this.padding)}function St(t){if(/[^\u0000-\u00ff]/.test(t))throw new Error("Invalid PDF Name Object: "+t+", Only accept ASCII characters.");for(var n="",i=t.length,r=0;r<i;r++){var e=t.charCodeAt(r);n+=e<33||35===e||37===e||40===e||41===e||47===e||60===e||62===e||91===e||93===e||123===e||125===e||e>126?"#"+("0"+e.toString(16)).slice(-2):t[r]}return n}function xt(t){if("object"!==l(t))throw new Error("Invalid Context passed to initialize PubSub (jsPDF-module)");var n={};this.subscribe=function(t,i,r){if(r=r||!1,"string"!=typeof t||"function"!=typeof i||"boolean"!=typeof r)throw new Error("Invalid arguments passed to PubSub.subscribe (jsPDF-module)");n.hasOwnProperty(t)||(n[t]={});var e=Math.random().toString(35);return n[t][e]=[i,!!r],e},this.unsubscribe=function(t){for(var i in n)if(n[i][t])return delete n[i][t],0===Object.keys(n[i]).length&&delete n[i],!0;return!1},this.publish=function(i){if(n.hasOwnProperty(i)){var r=Array.prototype.slice.call(arguments,1),e=[];for(var s in n[i]){var o=n[i][s];try{o[0].apply(t,r)}catch(i){Z.console&&tt.error("jsPDF PubSub Error",i.message,i)}o[1]&&e.push(s)}e.length&&e.forEach(this.unsubscribe)}},this.getTopics=function(){return n}}function qt(t){if(!(this instanceof qt))return new qt(t);var n="opacity,stroke-opacity".split(",");for(var i in t)t.hasOwnProperty(i)&&n.indexOf(i)>=0&&(this[i]=t[i]);this.id="",this.objectNumber=-1}function jt(t,n){this.gState=t,this.matrix=n,this.id="",this.objectNumber=-1}function Mt(t,n,i,r,e){if(!(this instanceof Mt))return new Mt(t,n,i,r,e);this.type="axial"===t?2:3,this.coords=n,this.colors=i,jt.call(this,r,e)}function Et(t,n,i,r,e){if(!(this instanceof Et))return new Et(t,n,i,r,e);this.boundingBox=t,this.xStep=n,this.yStep=i,this.stream="",this.cloneIndex=0,jt.call(this,r,e)}function Pt(t){var n,i="string"==typeof arguments[0]?arguments[0]:"p",r=arguments[1],e=arguments[2],s=arguments[3],o=[],a=1,u=16,f="S",c=null;"object"===l(t=t||{})&&(i=t.orientation,r=t.unit||r,e=t.format||e,s=t.compress||t.compressPdf||s,null!==(c=t.encryption||null)&&(c.userPassword=c.userPassword||"",c.ownerPassword=c.ownerPassword||"",c.userPermissions=c.userPermissions||[]),a="number"==typeof t.userUnit?Math.abs(t.userUnit):1,void 0!==t.precision&&(n=t.precision),void 0!==t.floatPrecision&&(u=t.floatPrecision),f=t.defaultPathOperation||"S"),o=t.filters||(!0===s?["FlateEncode"]:o),r=r||"mm",i=(""+(i||"P")).toLowerCase();var h=t.putOnlyUsedFonts||!1,v={},d={internal:{},__private__:{}};d.__private__.PubSub=xt;var w="1.3",m=d.__private__.getPdfVersion=function(){return w};d.__private__.setPdfVersion=function(t){w=t};var b={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};d.__private__.getPageFormats=function(){return b};var p=d.__private__.getPageFormat=function(t){return b[t]};e=e||"a4";var N="compat",L="advanced",g=N;function A(){this.saveGraphicsState(),Q(new _t(pt,0,0,-pt,0,gi()*pt).toString()+" cm"),this.setFontSize(this.getFontSize()/pt),f="n",g=L}function y(){this.restoreGraphicsState(),f="S",g=N}var k=d.__private__.combineFontStyleAndFontWeight=function(t,n){if("bold"==t&&"normal"==n||"bold"==t&&400==n||"normal"==t&&"italic"==n||"bold"==t&&"italic"==n)throw new Error("Invalid Combination of fontweight and fontstyle");return n&&(t=400==n||"normal"===n?"italic"===t?"italic":"normal":700!=n&&"bold"!==n||"normal"!==t?(700==n?"bold":n)+""+t:"bold"),t};d.advancedAPI=function(t){var n=g===N;return n&&A.call(this),"function"!=typeof t||(t(this),n&&y.call(this)),this},d.compatAPI=function(t){var n=g===L;return n&&y.call(this),"function"!=typeof t||(t(this),n&&A.call(this)),this},d.isAdvancedAPI=function(){return g===L};var S,x=function(t){if(g!==L)throw new Error(t+" is only available in 'advanced' API mode. You need to call advancedAPI() first.")},q=d.roundToPrecision=d.__private__.roundToPrecision=function(t,i){var r=n||i;if(isNaN(t)||isNaN(r))throw new Error("Invalid argument passed to jsPDF.roundToPrecision");return t.toFixed(r).replace(/0+$/,"")};S=d.hpf=d.__private__.hpf="number"==typeof u?function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.hpf");return q(t,u)}:"smart"===u?function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.hpf");return q(t,t>-1&&t<1?16:5)}:function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.hpf");return q(t,16)};var j=d.f2=d.__private__.f2=function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.f2");return q(t,2)},M=d.__private__.f3=function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.f3");return q(t,3)},E=d.scale=d.__private__.scale=function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.scale");return g===N?t*pt:g===L?t:void 0},P=function(t){return E(function(t){return g===N?gi()-t:g===L?t:void 0}(t))};d.__private__.setPrecision=d.setPrecision=function(t){"number"==typeof parseInt(t,10)&&(n=parseInt(t,10))};var O,I="00000000000000000000000000000000",F=d.__private__.getFileId=function(){return I},B=d.__private__.setFileId=function(t){return I=void 0!==t&&/^[a-fA-F0-9]{32}$/.test(t)?t.toUpperCase():I.split("").map((function(){return"ABCDEF0123456789".charAt(Math.floor(16*Math.random()))})).join(""),null!==c&&(Pn=new kt(c.userPermissions,c.userPassword,c.ownerPassword,I)),I};d.setFileId=function(t){return B(t),this},d.getFileId=function(){return F()};var R=d.__private__.convertDateToPDFDate=function(t){var n=t.getTimezoneOffset(),i=n<0?"+":"-",r=Math.floor(Math.abs(n/60)),e=Math.abs(n%60),s=[i,U(r),"'",U(e),"'"].join("");return["D:",t.getFullYear(),U(t.getMonth()+1),U(t.getDate()),U(t.getHours()),U(t.getMinutes()),U(t.getSeconds()),s].join("")},T=d.__private__.convertPDFDateToDate=function(t){var n=parseInt(t.substr(2,4),10),i=parseInt(t.substr(6,2),10)-1,r=parseInt(t.substr(8,2),10),e=parseInt(t.substr(10,2),10),s=parseInt(t.substr(12,2),10),o=parseInt(t.substr(14,2),10);return new Date(n,i,r,e,s,o,0)},C=d.__private__.setCreationDate=function(t){var n;if(void 0===t&&(t=new Date),t instanceof Date)n=R(t);else{if(!/^D:(20[0-2][0-9]|203[0-7]|19[7-9][0-9])(0[0-9]|1[0-2])([0-2][0-9]|3[0-1])(0[0-9]|1[0-9]|2[0-3])(0[0-9]|[1-5][0-9])(0[0-9]|[1-5][0-9])(\+0[0-9]|\+1[0-4]|-0[0-9]|-1[0-1])'(0[0-9]|[1-5][0-9])'?$/.test(t))throw new Error("Invalid argument passed to jsPDF.setCreationDate");n=t}return O=n},D=d.__private__.getCreationDate=function(t){var n=O;return"jsDate"===t&&(n=T(O)),n};d.setCreationDate=function(t){return C(t),this},d.getCreationDate=function(t){return D(t)};var z,U=d.__private__.padd2=function(t){return("0"+parseInt(t)).slice(-2)},V=d.__private__.padd2Hex=function(t){return("00"+(t=t.toString())).substr(t.length)},W=0,_=[],H=[],G=0,J=[],Y=[],$=!1,K=H;d.__private__.setCustomOutputDestination=function(t){$=!0,K=t};var X=function(t){$||(K=t)};d.__private__.resetCustomOutputDestination=function(){$=!1,K=H};var Q=d.__private__.out=function(t){return t=t.toString(),G+=t.length+1,K.push(t),K},nt=d.__private__.write=function(t){return Q(1===arguments.length?t.toString():Array.prototype.join.call(arguments," "))},it=d.__private__.getArrayBuffer=function(t){for(var n=t.length,i=new ArrayBuffer(n),r=new Uint8Array(i);n--;)r[n]=t.charCodeAt(n);return i},rt=[["Helvetica","helvetica","normal","WinAnsiEncoding"],["Helvetica-Bold","helvetica","bold","WinAnsiEncoding"],["Helvetica-Oblique","helvetica","italic","WinAnsiEncoding"],["Helvetica-BoldOblique","helvetica","bolditalic","WinAnsiEncoding"],["Courier","courier","normal","WinAnsiEncoding"],["Courier-Bold","courier","bold","WinAnsiEncoding"],["Courier-Oblique","courier","italic","WinAnsiEncoding"],["Courier-BoldOblique","courier","bolditalic","WinAnsiEncoding"],["Times-Roman","times","normal","WinAnsiEncoding"],["Times-Bold","times","bold","WinAnsiEncoding"],["Times-Italic","times","italic","WinAnsiEncoding"],["Times-BoldItalic","times","bolditalic","WinAnsiEncoding"],["ZapfDingbats","zapfdingbats","normal",null],["Symbol","symbol","normal",null]];d.__private__.getStandardFonts=function(){return rt};var et=t.fontSize||16;d.__private__.setFontSize=d.setFontSize=function(t){return et=g===L?t/pt:t,this};var ut,ft=d.__private__.getFontSize=d.getFontSize=function(){return g===N?et:et*pt},ct=t.R2L||!1;d.__private__.setR2L=d.setR2L=function(t){return ct=t,this},d.__private__.getR2L=d.getR2L=function(){return ct};var ht,lt=d.__private__.setZoomMode=function(t){if(/^(?:\d+\.\d*|\d*\.\d+|\d+)%$/.test(t))ut=t;else if(isNaN(t)){if(-1===[void 0,null,"fullwidth","fullheight","fullpage","original"].indexOf(t))throw new Error('zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. "'+t+'" is not recognized.');ut=t}else ut=parseInt(t,10)};d.__private__.getZoomMode=function(){return ut};var vt,dt=d.__private__.setPageMode=function(t){if(-1==[void 0,null,"UseNone","UseOutlines","UseThumbs","FullScreen"].indexOf(t))throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "'+t+'" is not recognized.');ht=t};d.__private__.getPageMode=function(){return ht};var wt=d.__private__.setLayoutMode=function(t){if(-1==[void 0,null,"continuous","single","twoleft","tworight","two"].indexOf(t))throw new Error('Layout mode must be one of continuous, single, twoleft, tworight. "'+t+'" is not recognized.');vt=t};d.__private__.getLayoutMode=function(){return vt},d.__private__.setDisplayMode=d.setDisplayMode=function(t,n,i){return lt(t),wt(n),dt(i),this};var mt={title:"",subject:"",author:"",keywords:"",creator:""};d.__private__.getDocumentProperty=function(t){if(-1===Object.keys(mt).indexOf(t))throw new Error("Invalid argument passed to jsPDF.getDocumentProperty");return mt[t]},d.__private__.getDocumentProperties=function(){return mt},d.__private__.setDocumentProperties=d.setProperties=d.setDocumentProperties=function(t){for(var n in mt)mt.hasOwnProperty(n)&&t[n]&&(mt[n]=t[n]);return this},d.__private__.setDocumentProperty=function(t,n){if(-1===Object.keys(mt).indexOf(t))throw new Error("Invalid arguments passed to jsPDF.setDocumentProperty");return mt[t]=n};var bt,pt,Nt,Lt,gt,At={},yt={},jt=[],Ot={},It={},Ft={},Bt={},Rt=null,Tt=0,Ct=[],Dt=new xt(d),zt=t.hotfixes||[],Ut={},Vt={},Wt=[],_t=function t(n,i,r,e,s,o){if(!(this instanceof t))return new t(n,i,r,e,s,o);isNaN(n)&&(n=1),isNaN(i)&&(i=0),isNaN(r)&&(r=0),isNaN(e)&&(e=1),isNaN(s)&&(s=0),isNaN(o)&&(o=0),this._matrix=[n,i,r,e,s,o]};Object.defineProperty(_t.prototype,"sx",{get:function(){return this._matrix[0]},set:function(t){this._matrix[0]=t}}),Object.defineProperty(_t.prototype,"shy",{get:function(){return this._matrix[1]},set:function(t){this._matrix[1]=t}}),Object.defineProperty(_t.prototype,"shx",{get:function(){return this._matrix[2]},set:function(t){this._matrix[2]=t}}),Object.defineProperty(_t.prototype,"sy",{get:function(){return this._matrix[3]},set:function(t){this._matrix[3]=t}}),Object.defineProperty(_t.prototype,"tx",{get:function(){return this._matrix[4]},set:function(t){this._matrix[4]=t}}),Object.defineProperty(_t.prototype,"ty",{get:function(){return this._matrix[5]},set:function(t){this._matrix[5]=t}}),Object.defineProperty(_t.prototype,"a",{get:function(){return this._matrix[0]},set:function(t){this._matrix[0]=t}}),Object.defineProperty(_t.prototype,"b",{get:function(){return this._matrix[1]},set:function(t){this._matrix[1]=t}}),Object.defineProperty(_t.prototype,"c",{get:function(){return this._matrix[2]},set:function(t){this._matrix[2]=t}}),Object.defineProperty(_t.prototype,"d",{get:function(){return this._matrix[3]},set:function(t){this._matrix[3]=t}}),Object.defineProperty(_t.prototype,"e",{get:function(){return this._matrix[4]},set:function(t){this._matrix[4]=t}}),Object.defineProperty(_t.prototype,"f",{get:function(){return this._matrix[5]},set:function(t){this._matrix[5]=t}}),Object.defineProperty(_t.prototype,"rotation",{get:function(){return Math.atan2(this.shx,this.sx)}}),Object.defineProperty(_t.prototype,"scaleX",{get:function(){return this.decompose().scale.sx}}),Object.defineProperty(_t.prototype,"scaleY",{get:function(){return this.decompose().scale.sy}}),Object.defineProperty(_t.prototype,"isIdentity",{get:function(){return 1===this.sx&&0===this.shy&&0===this.shx&&1===this.sy&&0===this.tx&&0===this.ty}}),_t.prototype.join=function(t){return[this.sx,this.shy,this.shx,this.sy,this.tx,this.ty].map(S).join(t)},_t.prototype.multiply=function(t){return new _t(t.sx*this.sx+t.shy*this.shx,t.sx*this.shy+t.shy*this.sy,t.shx*this.sx+t.sy*this.shx,t.shx*this.shy+t.sy*this.sy,t.tx*this.sx+t.ty*this.shx+this.tx,t.tx*this.shy+t.ty*this.sy+this.ty)},_t.prototype.decompose=function(){var t=this.sx,n=this.shy,i=this.shx,r=this.sy,e=this.tx,s=this.ty,o=Math.sqrt(t*t+n*n),a=(t/=o)*i+(n/=o)*r;i-=t*a,r-=n*a;var u=Math.sqrt(i*i+r*r);return a/=u,t*(r/=u)<n*(i/=u)&&(t=-t,n=-n,a=-a,o=-o),{scale:new _t(o,0,0,u,0,0),translate:new _t(1,0,0,1,e,s),rotate:new _t(t,n,-n,t,0,0),skew:new _t(1,0,a,1,0,0)}},_t.prototype.toString=function(){return this.join(" ")},_t.prototype.inversed=function(){var t=this.sx,n=this.shy,i=this.shx,r=this.sy,e=this.tx,s=this.ty,o=1/(t*r-n*i),a=r*o,u=-n*o,f=-i*o,c=t*o;return new _t(a,u,f,c,-a*e-f*s,-u*e-c*s)},_t.prototype.applyToPoint=function(t){return new di(t.x*this.sx+t.y*this.shx+this.tx,t.x*this.shy+t.y*this.sy+this.ty)},_t.prototype.applyToRectangle=function(t){var n=this.applyToPoint(t),i=this.applyToPoint(new di(t.x+t.w,t.y+t.h));return new wi(n.x,n.y,i.x-n.x,i.y-n.y)},_t.prototype.clone=function(){return new _t(this.sx,this.shy,this.shx,this.sy,this.tx,this.ty)},d.Matrix=_t;var Ht=d.matrixMult=function(t,n){return n.multiply(t)},Gt=new _t(1,0,0,1,0,0);d.unitMatrix=d.identityMatrix=Gt;var Jt=function(t,n){if(!It[t]){var i=(n instanceof Mt?"Sh":"P")+(Object.keys(Ot).length+1).toString(10);n.id=i,It[t]=i,Ot[i]=n,Dt.publish("addPattern",n)}};d.ShadingPattern=Mt,d.TilingPattern=Et,d.addShadingPattern=function(t,n){return x("addShadingPattern()"),Jt(t,n),this},d.beginTilingPattern=function(t){x("beginTilingPattern()"),bi(t.boundingBox[0],t.boundingBox[1],t.boundingBox[2]-t.boundingBox[0],t.boundingBox[3]-t.boundingBox[1],t.matrix)},d.endTilingPattern=function(t,n){x("endTilingPattern()"),n.stream=Y[z].join("\n"),Jt(t,n),Dt.publish("endTilingPattern",n),Wt.pop().restore()};var Yt=d.__private__.newObject=function(){var t=$t();return Kt(t,!0),t},$t=d.__private__.newObjectDeferred=function(){return W++,_[W]=function(){return G},W},Kt=function(t,n){return n="boolean"==typeof n&&n,_[t]=G,n&&Q(t+" 0 obj"),t},Xt=d.__private__.newAdditionalObject=function(){var t={objId:$t(),content:""};return J.push(t),t},Zt=$t(),Qt=$t(),tn=d.__private__.decodeColorString=function(t){var n=t.split(" ");if(2!==n.length||"g"!==n[1]&&"G"!==n[1])5!==n.length||"k"!==n[4]&&"K"!==n[4]||(n=[(1-n[0])*(1-n[3]),(1-n[1])*(1-n[3]),(1-n[2])*(1-n[3]),"r"]);else{var i=parseFloat(n[0]);n=[i,i,i,"r"]}for(var r="#",e=0;e<3;e++)r+=("0"+Math.floor(255*parseFloat(n[e])).toString(16)).slice(-2);return r},nn=d.__private__.encodeColorString=function(t){var n;"string"==typeof t&&(t={ch1:t});var i=t.ch1,r=t.ch2,e=t.ch3,s=t.ch4,o="draw"===t.pdfColorType?["G","RG","K"]:["g","rg","k"];if("string"==typeof i&&"#"!==i.charAt(0)){var a=new at(i);if(a.ok)i=a.toHex();else if(!/^\d*\.?\d*$/.test(i))throw new Error('Invalid color "'+i+'" passed to jsPDF.encodeColorString.')}if("string"==typeof i&&/^#[0-9A-Fa-f]{3}$/.test(i)&&(i="#"+i[1]+i[1]+i[2]+i[2]+i[3]+i[3]),"string"==typeof i&&/^#[0-9A-Fa-f]{6}$/.test(i)){var u=parseInt(i.substr(1),16);i=u>>16&255,r=u>>8&255,e=255&u}if(void 0===r||void 0===s&&i===r&&r===e)n="string"==typeof i?i+" "+o[0]:2===t.precision?j(i/255)+" "+o[0]:M(i/255)+" "+o[0];else if(void 0===s||"object"===l(s)){if(s&&!isNaN(s.a)&&0===s.a)return["1.","1.","1.",o[1]].join(" ");n="string"==typeof i?[i,r,e,o[1]].join(" "):2===t.precision?[j(i/255),j(r/255),j(e/255),o[1]].join(" "):[M(i/255),M(r/255),M(e/255),o[1]].join(" ")}else n="string"==typeof i?[i,r,e,s,o[2]].join(" "):2===t.precision?[j(i),j(r),j(e),j(s),o[2]].join(" "):[M(i),M(r),M(e),M(s),o[2]].join(" ");return n},rn=d.__private__.getFilters=function(){return o},en=d.__private__.putStream=function(t){var n=(t=t||{}).data||"",i=t.filters||rn(),r=t.alreadyAppliedFilters||[],e=t.addLength1||!1,s=n.length,o=t.objectId,a=function(t){return t};if(null!==c&&void 0===o)throw new Error("ObjectId must be passed to putStream for file encryption");null!==c&&(a=Pn.encryptor(o,0));var u={};!0===i&&(i=["FlateEncode"]);var f=t.additionalKeyValues||[],h=(u=void 0!==Pt.API.processDataByFilters?Pt.API.processDataByFilters(n,i):{data:n,reverseChain:[]}).reverseChain+(Array.isArray(r)?r.join(" "):r.toString());if(0!==u.data.length&&(f.push({key:"Length",value:u.data.length}),!0===e&&f.push({key:"Length1",value:s})),0!=h.length)if(h.split("/").length-1==1)f.push({key:"Filter",value:h});else{f.push({key:"Filter",value:"["+h+"]"});for(var l=0;l<f.length;l+=1)if("DecodeParms"===f[l].key){for(var v=[],d=0;d<u.reverseChain.split("/").length-1;d+=1)v.push("null");v.push(f[l].value),f[l].value="["+v.join(" ")+"]"}}Q("<<");for(var w=0;w<f.length;w++)Q("/"+f[w].key+" "+f[w].value);Q(">>"),0!==u.data.length&&(Q("stream"),Q(a(u.data)),Q("endstream"))},sn=d.__private__.putPage=function(t){var n=t.number,i=t.data,r=t.objId,e=t.contentsObjId;Kt(r,!0),Q("<</Type /Page"),Q("/Parent "+t.rootDictionaryObjId+" 0 R"),Q("/Resources "+t.resourceDictionaryObjId+" 0 R"),Q("/MediaBox ["+parseFloat(S(t.mediaBox.bottomLeftX))+" "+parseFloat(S(t.mediaBox.bottomLeftY))+" "+S(t.mediaBox.topRightX)+" "+S(t.mediaBox.topRightY)+"]"),null!==t.cropBox&&Q("/CropBox ["+S(t.cropBox.bottomLeftX)+" "+S(t.cropBox.bottomLeftY)+" "+S(t.cropBox.topRightX)+" "+S(t.cropBox.topRightY)+"]"),null!==t.bleedBox&&Q("/BleedBox ["+S(t.bleedBox.bottomLeftX)+" "+S(t.bleedBox.bottomLeftY)+" "+S(t.bleedBox.topRightX)+" "+S(t.bleedBox.topRightY)+"]"),null!==t.trimBox&&Q("/TrimBox ["+S(t.trimBox.bottomLeftX)+" "+S(t.trimBox.bottomLeftY)+" "+S(t.trimBox.topRightX)+" "+S(t.trimBox.topRightY)+"]"),null!==t.artBox&&Q("/ArtBox ["+S(t.artBox.bottomLeftX)+" "+S(t.artBox.bottomLeftY)+" "+S(t.artBox.topRightX)+" "+S(t.artBox.topRightY)+"]"),"number"==typeof t.userUnit&&1!==t.userUnit&&Q("/UserUnit "+t.userUnit),Dt.publish("putPage",{objId:r,pageContext:Ct[n],pageNumber:n,page:i}),Q("/Contents "+e+" 0 R"),Q(">>"),Q("endobj");var s=i.join("\n");return g===L&&(s+="\nQ"),Kt(e,!0),en({data:s,filters:rn(),objectId:e}),Q("endobj"),r},on=d.__private__.putPages=function(){var t,n,i=[];for(t=1;t<=Tt;t++)Ct[t].objId=$t(),Ct[t].contentsObjId=$t();for(t=1;t<=Tt;t++)i.push(sn({number:t,data:Y[t],objId:Ct[t].objId,contentsObjId:Ct[t].contentsObjId,mediaBox:Ct[t].mediaBox,cropBox:Ct[t].cropBox,bleedBox:Ct[t].bleedBox,trimBox:Ct[t].trimBox,artBox:Ct[t].artBox,userUnit:Ct[t].userUnit,rootDictionaryObjId:Zt,resourceDictionaryObjId:Qt}));Kt(Zt,!0),Q("<</Type /Pages");var r="/Kids [";for(n=0;n<Tt;n++)r+=i[n]+" 0 R ";Q(r+"]"),Q("/Count "+Tt),Q(">>"),Q("endobj"),Dt.publish("postPutPages")},an=function(t){Dt.publish("putFont",{font:t,out:Q,newObject:Yt,putStream:en}),!0!==t.isAlreadyPutted&&(t.objectNumber=Yt(),Q("<<"),Q("/Type /Font"),Q("/BaseFont /"+St(t.postScriptName)),Q("/Subtype /Type1"),"string"==typeof t.encoding&&Q("/Encoding /"+t.encoding),Q("/FirstChar 32"),Q("/LastChar 255"),Q(">>"),Q("endobj"))},un=function(t){t.objectNumber=Yt();var n=[];n.push({key:"Type",value:"/XObject"}),n.push({key:"Subtype",value:"/Form"}),n.push({key:"BBox",value:"["+[S(t.x),S(t.y),S(t.x+t.width),S(t.y+t.height)].join(" ")+"]"}),n.push({key:"Matrix",value:"["+t.matrix.toString()+"]"});var i=t.pages[1].join("\n");en({data:i,additionalKeyValues:n,objectId:t.objectNumber}),Q("endobj")},fn=function(t,n){n||(n=21);var i=Yt(),r=function(t,n){var i,r=[],e=1/(n-1);for(i=0;i<1;i+=e)r.push(i);r.push(1),0!=t[0].offset&&t.unshift({offset:0,color:t[0].color}),1!=t[t.length-1].offset&&t.push({offset:1,color:t[t.length-1].color});for(var s="",o=0,a=0;a<r.length;a++){for(i=r[a];i>t[o+1].offset;)o++;var u=t[o].offset,f=(i-u)/(t[o+1].offset-u),c=t[o].color,h=t[o+1].color;s+=V(Math.round((1-f)*c[0]+f*h[0]).toString(16))+V(Math.round((1-f)*c[1]+f*h[1]).toString(16))+V(Math.round((1-f)*c[2]+f*h[2]).toString(16))}return s.trim()}(t.colors,n),e=[];e.push({key:"FunctionType",value:"0"}),e.push({key:"Domain",value:"[0.0 1.0]"}),e.push({key:"Size",value:"["+n+"]"}),e.push({key:"BitsPerSample",value:"8"}),e.push({key:"Range",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),e.push({key:"Decode",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),en({data:r,additionalKeyValues:e,alreadyAppliedFilters:["/ASCIIHexDecode"],objectId:i}),Q("endobj"),t.objectNumber=Yt(),Q("<< /ShadingType "+t.type),Q("/ColorSpace /DeviceRGB");var s="/Coords ["+S(parseFloat(t.coords[0]))+" "+S(parseFloat(t.coords[1]))+" ";s+=2===t.type?S(parseFloat(t.coords[2]))+" "+S(parseFloat(t.coords[3])):S(parseFloat(t.coords[2]))+" "+S(parseFloat(t.coords[3]))+" "+S(parseFloat(t.coords[4]))+" "+S(parseFloat(t.coords[5])),Q(s+="]"),t.matrix&&Q("/Matrix ["+t.matrix.toString()+"]"),Q("/Function "+i+" 0 R"),Q("/Extend [true true]"),Q(">>"),Q("endobj")},cn=function(t,n){var i=$t(),r=Yt();n.push({resourcesOid:i,objectOid:r}),t.objectNumber=r;var e=[];e.push({key:"Type",value:"/Pattern"}),e.push({key:"PatternType",value:"1"}),e.push({key:"PaintType",value:"1"}),e.push({key:"TilingType",value:"1"}),e.push({key:"BBox",value:"["+t.boundingBox.map(S).join(" ")+"]"}),e.push({key:"XStep",value:S(t.xStep)}),e.push({key:"YStep",value:S(t.yStep)}),e.push({key:"Resources",value:i+" 0 R"}),t.matrix&&e.push({key:"Matrix",value:"["+t.matrix.toString()+"]"}),en({data:t.stream,additionalKeyValues:e,objectId:t.objectNumber}),Q("endobj")},hn=function(t){for(var n in t.objectNumber=Yt(),Q("<<"),t)switch(n){case"opacity":Q("/ca "+j(t[n]));break;case"stroke-opacity":Q("/CA "+j(t[n]))}Q(">>"),Q("endobj")},ln=function(t){Kt(t.resourcesOid,!0),Q("<<"),Q("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),function(){for(var t in Q("/Font <<"),At)At.hasOwnProperty(t)&&(!1===h||!0===h&&v.hasOwnProperty(t))&&Q("/"+t+" "+At[t].objectNumber+" 0 R");Q(">>")}(),function(){if(Object.keys(Ot).length>0){for(var t in Q("/Shading <<"),Ot)Ot.hasOwnProperty(t)&&Ot[t]instanceof Mt&&Ot[t].objectNumber>=0&&Q("/"+t+" "+Ot[t].objectNumber+" 0 R");Dt.publish("putShadingPatternDict"),Q(">>")}}(),function(t){if(Object.keys(Ot).length>0){for(var n in Q("/Pattern <<"),Ot)Ot.hasOwnProperty(n)&&Ot[n]instanceof d.TilingPattern&&Ot[n].objectNumber>=0&&Ot[n].objectNumber<t&&Q("/"+n+" "+Ot[n].objectNumber+" 0 R");Dt.publish("putTilingPatternDict"),Q(">>")}}(t.objectOid),function(){if(Object.keys(Ft).length>0){var t;for(t in Q("/ExtGState <<"),Ft)Ft.hasOwnProperty(t)&&Ft[t].objectNumber>=0&&Q("/"+t+" "+Ft[t].objectNumber+" 0 R");Dt.publish("putGStateDict"),Q(">>")}}(),function(){for(var t in Q("/XObject <<"),Ut)Ut.hasOwnProperty(t)&&Ut[t].objectNumber>=0&&Q("/"+t+" "+Ut[t].objectNumber+" 0 R");Dt.publish("putXobjectDict"),Q(">>")}(),Q(">>"),Q("endobj")},vn=function(t){yt[t.fontName]=yt[t.fontName]||{},yt[t.fontName][t.fontStyle]=t.id},dn=function(t,n,i,r,e){var s={id:"F"+(Object.keys(At).length+1).toString(10),postScriptName:t,fontName:n,fontStyle:i,encoding:r,isStandardFont:e||!1,metadata:{}};return Dt.publish("addFont",{font:s,instance:this}),At[s.id]=s,vn(s),s.id},wn=d.__private__.pdfEscape=d.pdfEscape=function(t,n){return function(t,n){var i,r,e,s,o,a,u,f,c;if(e=(n=n||{}).sourceEncoding||"Unicode",o=n.outputEncoding,(n.autoencode||o)&&At[bt].metadata&&At[bt].metadata[e]&&At[bt].metadata[e].encoding&&(s=At[bt].metadata[e].encoding,!o&&At[bt].encoding&&(o=At[bt].encoding),!o&&s.codePages&&(o=s.codePages[0]),"string"==typeof o&&(o=s[o]),o)){for(u=!1,a=[],i=0,r=t.length;i<r;i++)(f=o[t.charCodeAt(i)])?a.push(String.fromCharCode(f)):a.push(t[i]),a[i].charCodeAt(0)>>8&&(u=!0);t=a.join("")}for(i=t.length;void 0===u&&0!==i;)t.charCodeAt(i-1)>>8&&(u=!0),i--;if(!u)return t;for(a=n.noBOM?[]:[254,255],i=0,r=t.length;i<r;i++){if((c=(f=t.charCodeAt(i))>>8)>>8)throw new Error("Character at position "+i+" of string '"+t+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");a.push(c),a.push(f-(c<<8))}return String.fromCharCode.apply(void 0,a)}(t,n).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},mn=d.__private__.beginPage=function(t){Y[++Tt]=[],Ct[Tt]={objId:0,contentsObjId:0,userUnit:Number(a),artBox:null,bleedBox:null,cropBox:null,trimBox:null,mediaBox:{bottomLeftX:0,bottomLeftY:0,topRightX:Number(t[0]),topRightY:Number(t[1])}},Nn(Tt),X(Y[z])},bn=function(t,n){var r,s,o;switch(i=n||i,"string"==typeof t&&(r=p(t.toLowerCase()),Array.isArray(r)&&(s=r[0],o=r[1])),Array.isArray(t)&&(s=t[0]*pt,o=t[1]*pt),isNaN(s)&&(s=e[0],o=e[1]),(s>14400||o>14400)&&(tt.warn("A page in a PDF can not be wider or taller than 14400 userUnit. jsPDF limits the width/height to 14400"),s=Math.min(14400,s),o=Math.min(14400,o)),e=[s,o],i.substr(0,1)){case"l":o>s&&(e=[o,s]);break;case"p":s>o&&(e=[o,s])}mn(e),Xn($n),Q(si),0!==hi&&Q(hi+" J"),0!==li&&Q(li+" j"),Dt.publish("addPage",{pageNumber:Tt})},pn=function(t){t>0&&t<=Tt&&(Y.splice(t,1),Ct.splice(t,1),Tt--,z>Tt&&(z=Tt),this.setPage(z))},Nn=function(t){t>0&&t<=Tt&&(z=t)},Ln=d.__private__.getNumberOfPages=d.getNumberOfPages=function(){return Y.length-1},gn=function(t,n,i){var r,e=void 0;return i=i||{},n=void 0!==n?n:At[bt].fontStyle,r=(t=void 0!==t?t:At[bt].fontName).toLowerCase(),void 0!==yt[r]&&void 0!==yt[r][n]?e=yt[r][n]:void 0!==yt[t]&&void 0!==yt[t][n]?e=yt[t][n]:!1===i.disableWarning&&tt.warn("Unable to look up font label for font '"+t+"', '"+n+"'. Refer to getFontList() for available fonts."),e||i.noFallback||null==(e=yt.times[n])&&(e=yt.times.normal),e},An=d.__private__.putInfo=function(){var t=Yt(),n=function(t){return t};for(var i in null!==c&&(n=Pn.encryptor(t,0)),Q("<<"),Q("/Producer ("+wn(n("jsPDF "+Pt.version))+")"),mt)mt.hasOwnProperty(i)&&mt[i]&&Q("/"+i.substr(0,1).toUpperCase()+i.substr(1)+" ("+wn(n(mt[i]))+")");Q("/CreationDate ("+wn(n(O))+")"),Q(">>"),Q("endobj")},yn=d.__private__.putCatalog=function(t){var n=(t=t||{}).rootDictionaryObjId||Zt;switch(Yt(),Q("<<"),Q("/Type /Catalog"),Q("/Pages "+n+" 0 R"),ut||(ut="fullwidth"),ut){case"fullwidth":Q("/OpenAction [3 0 R /FitH null]");break;case"fullheight":Q("/OpenAction [3 0 R /FitV null]");break;case"fullpage":Q("/OpenAction [3 0 R /Fit]");break;case"original":Q("/OpenAction [3 0 R /XYZ null null 1]");break;default:var i=""+ut;"%"===i.substr(i.length-1)&&(ut=parseInt(ut)/100),"number"==typeof ut&&Q("/OpenAction [3 0 R /XYZ null null "+j(ut)+"]")}switch(vt||(vt="continuous"),vt){case"continuous":Q("/PageLayout /OneColumn");break;case"single":Q("/PageLayout /SinglePage");break;case"two":case"twoleft":Q("/PageLayout /TwoColumnLeft");break;case"tworight":Q("/PageLayout /TwoColumnRight")}ht&&Q("/PageMode /"+ht),Dt.publish("putCatalog"),Q(">>"),Q("endobj")},kn=d.__private__.putTrailer=function(){Q("trailer"),Q("<<"),Q("/Size "+(W+1)),Q("/Root "+W+" 0 R"),Q("/Info "+(W-1)+" 0 R"),null!==c&&Q("/Encrypt "+Pn.oid+" 0 R"),Q("/ID [ <"+I+"> <"+I+"> ]"),Q(">>")},Sn=d.__private__.putHeader=function(){Q("%PDF-"+w),Q("%ºß¬à")},xn=d.__private__.putXRef=function(){var t="0000000000";Q("xref"),Q("0 "+(W+1)),Q("0000000000 65535 f ");for(var n=1;n<=W;n++)Q("function"==typeof _[n]?(t+_[n]()).slice(-10)+" 00000 n ":void 0!==_[n]?(t+_[n]).slice(-10)+" 00000 n ":"0000000000 00000 n ")},qn=d.__private__.buildDocument=function(){W=0,G=0,H=[],_=[],J=[],Zt=$t(),Qt=$t(),X(H),Dt.publish("buildDocument"),Sn(),on(),function(){Dt.publish("putAdditionalObjects");for(var t=0;t<J.length;t++){var n=J[t];Kt(n.objId,!0),Q(n.content),Q("endobj")}Dt.publish("postPutAdditionalObjects")}(),function(){var t=[];(function(){for(var t in At)At.hasOwnProperty(t)&&(!1===h||!0===h&&v.hasOwnProperty(t))&&an(At[t])})(),function(){var t;for(t in Ft)Ft.hasOwnProperty(t)&&hn(Ft[t])}(),function(){for(var t in Ut)Ut.hasOwnProperty(t)&&un(Ut[t])}(),function(t){var n;for(n in Ot)Ot.hasOwnProperty(n)&&(Ot[n]instanceof Mt?fn(Ot[n]):Ot[n]instanceof Et&&cn(Ot[n],t))}(t),Dt.publish("putResources"),t.forEach(ln),ln({resourcesOid:Qt,objectOid:Number.MAX_SAFE_INTEGER}),Dt.publish("postPutResources")}(),null!==c&&(Pn.oid=Yt(),Q("<<"),Q("/Filter /Standard"),Q("/V "+Pn.v),Q("/R "+Pn.r),Q("/U <"+Pn.toHexString(Pn.U)+">"),Q("/O <"+Pn.toHexString(Pn.O)+">"),Q("/P "+Pn.P),Q(">>"),Q("endobj")),An(),yn();var t=G;return xn(),kn(),Q("startxref"),Q(""+t),Q("%%EOF"),X(Y[z]),H.join("\n")},jn=d.__private__.getBlob=function(t){return new Blob([it(t)],{type:"application/pdf"})},Mn=d.output=d.__private__.output=function(t){return t.foo=function(){try{return t.apply(this,arguments)}catch(t){var n=t.stack||"";~n.indexOf(" at ")&&(n=n.split(" at ")[1]);var i="Error in function "+n.split("\n")[0].split("<")[0]+": "+t.message;if(!Z.console)throw new Error(i);Z.console.error(i,t),Z.alert&&alert(i)}},t.foo.bar=t,t.foo}((function(t,n){switch("string"==typeof(n=n||{})?n={filename:n}:n.filename=n.filename||"generated.pdf",t){case void 0:return qn();case"save":d.save(n.filename);break;case"arraybuffer":return it(qn());case"blob":return jn(qn());case"bloburi":case"bloburl":if(void 0!==Z.URL&&"function"==typeof Z.URL.createObjectURL)return Z.URL&&Z.URL.createObjectURL(jn(qn()))||void 0;tt.warn("bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.");break;case"datauristring":case"dataurlstring":var i="",r=qn();try{i=st(r)}catch(t){i=st(unescape(encodeURIComponent(r)))}return"data:application/pdf;filename="+n.filename+";base64,"+i;case"pdfobjectnewwindow":if("[object Window]"===Object.prototype.toString.call(Z)){var e="https://cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js",s=' integrity="sha512-4ze/a9/4jqu+tX9dfOqJYSvyYd5M6qum/3HpCLr+/Jqf0whc37VUbkpNGHR7/8pSnCFw47T1fmIpwBV7UySh3g==" crossorigin="anonymous"';n.pdfObjectUrl&&(e=n.pdfObjectUrl,s="");var o='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><script src="'+e+'"'+s+'><\/script><script >PDFObject.embed("'+this.output("dataurlstring")+'", '+JSON.stringify(n)+");<\/script></body></html>",a=Z.open();return null!==a&&a.document.write(o),a}throw new Error("The option pdfobjectnewwindow just works in a browser-environment.");case"pdfjsnewwindow":if("[object Window]"===Object.prototype.toString.call(Z)){var u='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><iframe id="pdfViewer" src="'+(n.pdfJsUrl||"examples/PDF.js/web/viewer.html")+"?file=&downloadName="+n.filename+'" width="500px" height="400px" /></body></html>',f=Z.open();if(null!==f){f.document.write(u);var c=this;f.document.documentElement.querySelector("#pdfViewer").onload=function(){f.document.title=n.filename,f.document.documentElement.querySelector("#pdfViewer").contentWindow.PDFViewerApplication.open(c.output("bloburl"))}}return f}throw new Error("The option pdfjsnewwindow just works in a browser-environment.");case"dataurlnewwindow":if("[object Window]"!==Object.prototype.toString.call(Z))throw new Error("The option dataurlnewwindow just works in a browser-environment.");var h='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><iframe src="'+this.output("datauristring",n)+'"></iframe></body></html>',l=Z.open();if(null!==l&&(l.document.write(h),l.document.title=n.filename),l||"undefined"==typeof safari)return l;break;case"datauri":case"dataurl":return Z.document.location.href=this.output("datauristring",n);default:return null}})),En=function(t){return!0===Array.isArray(zt)&&zt.indexOf(t)>-1};switch(r){case"pt":pt=1;break;case"mm":pt=72/25.4;break;case"cm":pt=72/2.54;break;case"in":pt=72;break;case"px":pt=1==En("px_scaling")?.75:96/72;break;case"pc":case"em":pt=12;break;case"ex":pt=6;break;default:if("number"!=typeof r)throw new Error("Invalid unit: "+r);pt=r}var Pn=null;C(),B();var On=d.__private__.getPageInfo=d.getPageInfo=function(t){if(isNaN(t)||t%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfo");return{objId:Ct[t].objId,pageNumber:t,pageContext:Ct[t]}},In=d.__private__.getPageInfoByObjId=function(t){if(isNaN(t)||t%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfoByObjId");for(var n in Ct)if(Ct[n].objId===t)break;return On(n)},Fn=d.__private__.getCurrentPageInfo=d.getCurrentPageInfo=function(){return{objId:Ct[z].objId,pageNumber:z,pageContext:Ct[z]}};d.addPage=function(){return bn.apply(this,arguments),this},d.setPage=function(){return Nn.apply(this,arguments),X.call(this,Y[z]),this},d.insertPage=function(t){return this.addPage(),this.movePage(z,t),this},d.movePage=function(t,n){var i,r;if(t>n){i=Y[t],r=Ct[t];for(var e=t;e>n;e--)Y[e]=Y[e-1],Ct[e]=Ct[e-1];Y[n]=i,Ct[n]=r,this.setPage(n)}else if(t<n){i=Y[t],r=Ct[t];for(var s=t;s<n;s++)Y[s]=Y[s+1],Ct[s]=Ct[s+1];Y[n]=i,Ct[n]=r,this.setPage(n)}return this},d.deletePage=function(){return pn.apply(this,arguments),this},d.__private__.text=d.text=function(t,n,i,r,e){var s,o,a,u,f,c,h,d,w,m=(r=r||{}).scope||this;if("number"==typeof t&&"number"==typeof n&&("string"==typeof i||Array.isArray(i))){var b=i;i=n,n=t,t=b}if(arguments[3]instanceof _t==0?(a=arguments[4],u=arguments[5],"object"===l(h=arguments[3])&&null!==h||("string"==typeof a&&(u=a,a=null),"string"==typeof h&&(u=h,h=null),"number"==typeof h&&(a=h,h=null),r={flags:h,angle:a,align:u})):(x("The transform parameter of text() with a Matrix value"),w=e),isNaN(n)||isNaN(i)||null==t)throw new Error("Invalid arguments passed to jsPDF.text");if(0===t.length)return m;var p,N="",A="number"==typeof r.lineHeightFactor?r.lineHeightFactor:Yn,y=m.internal.scaleFactor;function k(t){return t=t.split("\t").join(Array(r.TabLen||9).join(" ")),wn(t,h)}function q(t){for(var n,i=t.concat(),r=[],e=i.length;e--;)"string"==typeof(n=i.shift())?r.push(n):Array.isArray(t)&&(1===n.length||void 0===n[1]&&void 0===n[2])?r.push(n[0]):r.push([n[0],n[1],n[2]]);return r}function j(t,n){var i;if("string"==typeof t)i=n(t)[0];else if(Array.isArray(t)){for(var r,e,s=t.concat(),o=[],a=s.length;a--;)"string"==typeof(r=s.shift())?o.push(n(r)[0]):Array.isArray(r)&&"string"==typeof r[0]&&(e=n(r[0],r[1],r[2]),o.push([e[0],e[1],e[2]]));i=o}return i}var M=!1,P=!0;if("string"==typeof t)M=!0;else if(Array.isArray(t)){var O=t.concat();o=[];for(var I,F=O.length;F--;)("string"!=typeof(I=O.shift())||Array.isArray(I)&&"string"!=typeof I[0])&&(P=!1);M=P}if(!1===M)throw new Error('Type of text must be string or Array. "'+t+'" is not recognized.');"string"==typeof t&&(t=t.match(/[\r?\n]/)?t.split(/\r\n|\r|\n/g):[t]);var B=et/m.internal.scaleFactor,R=B*(A-1);switch(r.baseline){case"bottom":i-=R;break;case"top":i+=B-R;break;case"hanging":i+=B-2*R;break;case"middle":i+=B/2-R}if((c=r.maxWidth||0)>0&&("string"==typeof t?t=m.splitTextToSize(t,c):"[object Array]"===Object.prototype.toString.call(t)&&(t=t.reduce((function(t,n){return t.concat(m.splitTextToSize(n,c))}),[]))),Dt.publish("preProcessText",s={text:t,x:n,y:i,options:r,mutex:{pdfEscape:wn,activeFontKey:bt,fonts:At,activeFontSize:et}}),t=s.text,a=(r=s.options).angle,w instanceof _t==0&&a&&"number"==typeof a){a*=Math.PI/180,0===r.rotationDirection&&(a=-a),g===L&&(a=-a);var T=Math.cos(a),C=Math.sin(a);w=new _t(T,C,-C,T,0,0)}else a&&a instanceof _t&&(w=a);g!==L||w||(w=Gt),void 0!==(f=r.charSpace||fi)&&(N+=S(E(f))+" Tc\n",this.setCharSpace(this.getCharSpace()||0)),void 0!==(d=r.horizontalScale)&&(N+=S(100*d)+" Tz\n");var D=-1,z=void 0!==r.renderingMode?r.renderingMode:r.stroke,U=m.internal.getCurrentPageInfo().pageContext;switch(z){case 0:case!1:case"fill":D=0;break;case 1:case!0:case"stroke":D=1;break;case 2:case"fillThenStroke":D=2;break;case 3:case"invisible":D=3;break;case 4:case"fillAndAddForClipping":D=4;break;case 5:case"strokeAndAddPathForClipping":D=5;break;case 6:case"fillThenStrokeAndAddToPathForClipping":D=6;break;case 7:case"addToPathForClipping":D=7}-1!==D?N+=D+" Tr\n":-1!==(void 0!==U.usedRenderingMode?U.usedRenderingMode:-1)&&(N+="0 Tr\n"),-1!==D&&(U.usedRenderingMode=D),u=r.align||"left";var V,W=et*A,_=m.internal.pageSize.getWidth(),H=At[bt];f=r.charSpace||fi,c=r.maxWidth||0,h=Object.assign({autoencode:!0,noBOM:!0},r.flags);var G=[];if("[object Array]"===Object.prototype.toString.call(t)){var J;o=q(t),"left"!==u&&(V=o.map((function(t){return m.getStringUnitWidth(t,{font:H,charSpace:f,fontSize:et,doKerning:!1})*et/y})));var Y,$=0;if("right"===u){n-=V[0],t=[],F=o.length;for(var K=0;K<F;K++)0===K?(Y=ni(n),J=ii(i)):(Y=E($-V[K]),J=-W),t.push([o[K],Y,J]),$=V[K]}else if("center"===u){n-=V[0]/2,t=[],F=o.length;for(var X=0;X<F;X++)0===X?(Y=ni(n),J=ii(i)):(Y=E(($-V[X])/2),J=-W),t.push([o[X],Y,J]),$=V[X]}else if("left"===u){t=[],F=o.length;for(var Z=0;Z<F;Z++)t.push(o[Z])}else{if("justify"!==u)throw new Error('Unrecognized alignment option, use "left", "center", "right" or "justify".');t=[],F=o.length,c=0!==c?c:_;for(var tt=0;tt<F;tt++)J=0===tt?ii(i):-W,Y=0===tt?ni(n):0,G.push(tt<F-1?S(E((c-V[tt])/(o[tt].split(" ").length-1))):0),t.push([o[tt],Y,J])}}!0===("boolean"==typeof r.R2L?r.R2L:ct)&&(t=j(t,(function(t,n,i){return[t.split("").reverse().join(""),n,i]}))),Dt.publish("postProcessText",s={text:t,x:n,y:i,options:r,mutex:{pdfEscape:wn,activeFontKey:bt,fonts:At,activeFontSize:et}}),t=s.text,p=s.mutex.isHex||!1;var nt=At[bt].encoding;"WinAnsiEncoding"!==nt&&"StandardEncoding"!==nt||(t=j(t,(function(t,n,i){return[k(t),n,i]}))),o=q(t),t=[];for(var it,rt,st,ot=Array.isArray(o[0])?1:0,at="",ut=function(t,n,i){var e="";return i instanceof _t?(i="number"==typeof r.angle?Ht(i,new _t(1,0,0,1,t,n)):Ht(new _t(1,0,0,1,t,n),i),g===L&&(i=Ht(new _t(1,0,0,-1,0,0),i)),e=i.join(" ")+" Tm\n"):e=S(t)+" "+S(n)+" Td\n",e},ft=0;ft<o.length;ft++){switch(at="",ot){case 1:st=(p?"<":"(")+o[ft][0]+(p?">":")"),it=parseFloat(o[ft][1]),rt=parseFloat(o[ft][2]);break;case 0:st=(p?"<":"(")+o[ft]+(p?">":")"),it=ni(n),rt=ii(i)}void 0!==G&&void 0!==G[ft]&&(at=G[ft]+" Tw\n"),0===ft?t.push(at+ut(it,rt,w)+st):0===ot?t.push(at+st):1===ot&&t.push(at+ut(it,rt,w)+st)}t=t.join(0===ot?" Tj\nT* ":" Tj\n"),t+=" Tj\n";var ht="BT\n/";return ht+=bt+" "+et+" Tf\n",ht+=S(et*A)+" TL\n",ht+=ai+"\n",ht+=N,ht+=t,Q(ht+="ET"),v[bt]=!0,m};var Bn=d.__private__.clip=d.clip=function(t){return Q("evenodd"===t?"W*":"W"),this};d.clipEvenOdd=function(){return Bn("evenodd")},d.__private__.discardPath=d.discardPath=function(){return Q("n"),this};var Rn=d.__private__.isValidStyle=function(t){var n=!1;return-1!==[void 0,null,"S","D","F","DF","FD","f","f*","B","B*","n"].indexOf(t)&&(n=!0),n};d.__private__.setDefaultPathOperation=d.setDefaultPathOperation=function(t){return Rn(t)&&(f=t),this};var Tn=d.__private__.getStyle=d.getStyle=function(t){var n=f;switch(t){case"D":case"S":n="S";break;case"F":n="f";break;case"FD":case"DF":n="B";break;case"f":case"f*":case"B":case"B*":n=t}return n},Cn=d.close=function(){return Q("h"),this};d.stroke=function(){return Q("S"),this},d.fill=function(t){return Dn("f",t),this},d.fillEvenOdd=function(t){return Dn("f*",t),this},d.fillStroke=function(t){return Dn("B",t),this},d.fillStrokeEvenOdd=function(t){return Dn("B*",t),this};var Dn=function(t,n){"object"===l(n)?Vn(n,t):Q(t)},zn=function(t){null===t||g===L&&void 0===t||(t=Tn(t),Q(t))};function Un(t,n,i,r,e){var s=new Et(n||this.boundingBox,i||this.xStep,r||this.yStep,this.gState,e||this.matrix);s.stream=this.stream;var o=t+"$$"+this.cloneIndex+++"$$";return Jt(o,s),s}var Vn=function(t,n){var i=It[t.key],r=Ot[i];if(r instanceof Mt)Q("q"),Q(Wn(n)),r.gState&&d.setGState(r.gState),Q(t.matrix.toString()+" cm"),Q("/"+i+" sh"),Q("Q");else if(r instanceof Et){var e=new _t(1,0,0,-1,0,gi());t.matrix&&(e=e.multiply(t.matrix||Gt),i=Un.call(r,t.key,t.boundingBox,t.xStep,t.yStep,e).id),Q("q"),Q("/Pattern cs"),Q("/"+i+" scn"),r.gState&&d.setGState(r.gState),Q(n),Q("Q")}},Wn=function(t){switch(t){case"f":case"F":case"n":return"W n";case"f*":return"W* n";case"B":case"S":return"W S";case"B*":return"W* S"}},_n=d.moveTo=function(t,n){return Q(S(E(t))+" "+S(P(n))+" m"),this},Hn=d.lineTo=function(t,n){return Q(S(E(t))+" "+S(P(n))+" l"),this},Gn=d.curveTo=function(t,n,i,r,e,s){return Q([S(E(t)),S(P(n)),S(E(i)),S(P(r)),S(E(e)),S(P(s)),"c"].join(" ")),this};d.__private__.line=d.line=function(t,n,i,r,e){if(isNaN(t)||isNaN(n)||isNaN(i)||isNaN(r)||!Rn(e))throw new Error("Invalid arguments passed to jsPDF.line");return g===N?this.lines([[i-t,r-n]],t,n,[1,1],e||"S"):this.lines([[i-t,r-n]],t,n,[1,1]).stroke()},d.__private__.lines=d.lines=function(t,n,i,r,e,s){var o,a,u,f,c,h,l,v;if("number"==typeof t&&(v=i,i=n,n=t,t=v),r=r||[1,1],s=s||!1,isNaN(n)||isNaN(i)||!Array.isArray(t)||!Array.isArray(r)||!Rn(e)||"boolean"!=typeof s)throw new Error("Invalid arguments passed to jsPDF.lines");for(_n(n,i),o=r[0],a=r[1],f=t.length,h=n,l=i,u=0;u<f;u++)2===(c=t[u]).length?Hn(h=c[0]*o+h,l=c[1]*a+l):Gn(c[0]*o+h,c[1]*a+l,c[2]*o+h,c[3]*a+l,h=c[4]*o+h,l=c[5]*a+l);return s&&Cn(),zn(e),this},d.path=function(t){for(var n=0;n<t.length;n++){var i=t[n],r=i.c;switch(i.op){case"m":_n(r[0],r[1]);break;case"l":Hn(r[0],r[1]);break;case"c":Gn.apply(this,r);break;case"h":Cn()}}return this},d.__private__.rect=d.rect=function(t,n,i,r,e){if(isNaN(t)||isNaN(n)||isNaN(i)||isNaN(r)||!Rn(e))throw new Error("Invalid arguments passed to jsPDF.rect");return g===N&&(r=-r),Q([S(E(t)),S(P(n)),S(E(i)),S(E(r)),"re"].join(" ")),zn(e),this},d.__private__.triangle=d.triangle=function(t,n,i,r,e,s,o){if(isNaN(t)||isNaN(n)||isNaN(i)||isNaN(r)||isNaN(e)||isNaN(s)||!Rn(o))throw new Error("Invalid arguments passed to jsPDF.triangle");return this.lines([[i-t,r-n],[e-i,s-r],[t-e,n-s]],t,n,[1,1],o,!0),this},d.__private__.roundedRect=d.roundedRect=function(t,n,i,r,e,s,o){if(isNaN(t)||isNaN(n)||isNaN(i)||isNaN(r)||isNaN(e)||isNaN(s)||!Rn(o))throw new Error("Invalid arguments passed to jsPDF.roundedRect");var a=4/3*(Math.SQRT2-1);return e=Math.min(e,.5*i),s=Math.min(s,.5*r),this.lines([[i-2*e,0],[e*a,0,e,s-s*a,e,s],[0,r-2*s],[0,s*a,-e*a,s,-e,s],[2*e-i,0],[-e*a,0,-e,-s*a,-e,-s],[0,2*s-r],[0,-s*a,e*a,-s,e,-s]],t+e,n,[1,1],o,!0),this},d.__private__.ellipse=d.ellipse=function(t,n,i,r,e){if(isNaN(t)||isNaN(n)||isNaN(i)||isNaN(r)||!Rn(e))throw new Error("Invalid arguments passed to jsPDF.ellipse");var s=4/3*(Math.SQRT2-1)*i,o=4/3*(Math.SQRT2-1)*r;return _n(t+i,n),Gn(t+i,n-o,t+s,n-r,t,n-r),Gn(t-s,n-r,t-i,n-o,t-i,n),Gn(t-i,n+o,t-s,n+r,t,n+r),Gn(t+s,n+r,t+i,n+o,t+i,n),zn(e),this},d.__private__.circle=d.circle=function(t,n,i,r){if(isNaN(t)||isNaN(n)||isNaN(i)||!Rn(r))throw new Error("Invalid arguments passed to jsPDF.circle");return this.ellipse(t,n,i,i,r)},d.setFont=function(t,n,i){return i&&(n=k(n,i)),bt=gn(t,n,{disableWarning:!1}),this};var Jn=d.__private__.getFont=d.getFont=function(){return At[gn.apply(d,arguments)]};d.__private__.getFontList=d.getFontList=function(){var t,n,i={};for(t in yt)if(yt.hasOwnProperty(t))for(n in i[t]=[],yt[t])yt[t].hasOwnProperty(n)&&i[t].push(n);return i},d.addFont=function(t,n,i,r,e){var s=["StandardEncoding","MacRomanEncoding","Identity-H","WinAnsiEncoding"];return arguments[3]&&-1!==s.indexOf(arguments[3])?e=arguments[3]:arguments[3]&&-1==s.indexOf(arguments[3])&&(i=k(i,r)),dn.call(this,t,n,i,e=e||"Identity-H")};var Yn,$n=t.lineWidth||.200025,Kn=d.__private__.getLineWidth=d.getLineWidth=function(){return $n},Xn=d.__private__.setLineWidth=d.setLineWidth=function(t){return $n=t,Q(S(E(t))+" w"),this};d.__private__.setLineDash=Pt.API.setLineDash=Pt.API.setLineDashPattern=function(t,n){if(t=t||[],n=n||0,isNaN(n)||!Array.isArray(t))throw new Error("Invalid arguments passed to jsPDF.setLineDash");return t=t.map((function(t){return S(E(t))})).join(" "),n=S(E(n)),Q("["+t+"] "+n+" d"),this};var Zn=d.__private__.getLineHeight=d.getLineHeight=function(){return et*Yn};d.__private__.getLineHeight=d.getLineHeight=function(){return et*Yn};var Qn=d.__private__.setLineHeightFactor=d.setLineHeightFactor=function(t){return"number"==typeof(t=t||1.15)&&(Yn=t),this},ti=d.__private__.getLineHeightFactor=d.getLineHeightFactor=function(){return Yn};Qn(t.lineHeight);var ni=d.__private__.getHorizontalCoordinate=function(t){return E(t)},ii=d.__private__.getVerticalCoordinate=function(t){return g===L?t:Ct[z].mediaBox.topRightY-Ct[z].mediaBox.bottomLeftY-E(t)},ri=d.__private__.getHorizontalCoordinateString=d.getHorizontalCoordinateString=function(t){return S(ni(t))},ei=d.__private__.getVerticalCoordinateString=d.getVerticalCoordinateString=function(t){return S(ii(t))},si=t.strokeColor||"0 G";d.__private__.getStrokeColor=d.getDrawColor=function(){return tn(si)},d.__private__.setStrokeColor=d.setDrawColor=function(t,n,i,r){return si=nn({ch1:t,ch2:n,ch3:i,ch4:r,pdfColorType:"draw",precision:2}),Q(si),this};var oi=t.fillColor||"0 g";d.__private__.getFillColor=d.getFillColor=function(){return tn(oi)},d.__private__.setFillColor=d.setFillColor=function(t,n,i,r){return oi=nn({ch1:t,ch2:n,ch3:i,ch4:r,pdfColorType:"fill",precision:2}),Q(oi),this};var ai=t.textColor||"0 g",ui=d.__private__.getTextColor=d.getTextColor=function(){return tn(ai)};d.__private__.setTextColor=d.setTextColor=function(t,n,i,r){return ai=nn({ch1:t,ch2:n,ch3:i,ch4:r,pdfColorType:"text",precision:3}),this};var fi=t.charSpace,ci=d.__private__.getCharSpace=d.getCharSpace=function(){return parseFloat(fi||0)};d.__private__.setCharSpace=d.setCharSpace=function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.setCharSpace");return fi=t,this};var hi=0;d.CapJoinStyles={0:0,butt:0,but:0,miter:0,1:1,round:1,rounded:1,circle:1,2:2,projecting:2,project:2,square:2,bevel:2},d.__private__.setLineCap=d.setLineCap=function(t){var n=d.CapJoinStyles[t];if(void 0===n)throw new Error("Line cap style of '"+t+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return hi=n,Q(n+" J"),this};var li=0;d.__private__.setLineJoin=d.setLineJoin=function(t){var n=d.CapJoinStyles[t];if(void 0===n)throw new Error("Line join style of '"+t+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return li=n,Q(n+" j"),this},d.__private__.setLineMiterLimit=d.__private__.setMiterLimit=d.setLineMiterLimit=d.setMiterLimit=function(t){if(t=t||0,isNaN(t))throw new Error("Invalid argument passed to jsPDF.setLineMiterLimit");return Q(S(E(t))+" M"),this},d.GState=qt,d.setGState=function(t){(t="string"==typeof t?Ft[Bt[t]]:vi(null,t)).equals(Rt)||(Q("/"+t.id+" gs"),Rt=t)};var vi=function(t,n){if(!t||!Bt[t]){var i=!1;for(var r in Ft)if(Ft.hasOwnProperty(r)&&Ft[r].equals(n)){i=!0;break}if(i)n=Ft[r];else{var e="GS"+(Object.keys(Ft).length+1).toString(10);Ft[e]=n,n.id=e}return t&&(Bt[t]=n.id),Dt.publish("addGState",n),n}};d.addGState=function(t,n){return vi(t,n),this},d.saveGraphicsState=function(){return Q("q"),jt.push({key:bt,size:et,color:ai}),this},d.restoreGraphicsState=function(){Q("Q");var t=jt.pop();return bt=t.key,et=t.size,ai=t.color,Rt=null,this},d.setCurrentTransformationMatrix=function(t){return Q(t.toString()+" cm"),this},d.comment=function(t){return Q("#"+t),this};var di=function(t,n){var i=t||0;Object.defineProperty(this,"x",{enumerable:!0,get:function(){return i},set:function(t){isNaN(t)||(i=parseFloat(t))}});var r=n||0;Object.defineProperty(this,"y",{enumerable:!0,get:function(){return r},set:function(t){isNaN(t)||(r=parseFloat(t))}});var e="pt";return Object.defineProperty(this,"type",{enumerable:!0,get:function(){return e},set:function(t){e=t.toString()}}),this},wi=function(t,n,i,r){di.call(this,t,n),this.type="rect";var e=i||0;Object.defineProperty(this,"w",{enumerable:!0,get:function(){return e},set:function(t){isNaN(t)||(e=parseFloat(t))}});var s=r||0;return Object.defineProperty(this,"h",{enumerable:!0,get:function(){return s},set:function(t){isNaN(t)||(s=parseFloat(t))}}),this},mi=function(){this.page=Tt,this.currentPage=z,this.pages=Y.slice(0),this.pagesContext=Ct.slice(0),this.x=Nt,this.y=Lt,this.matrix=gt,this.width=Ni(z),this.height=gi(z),this.outputDestination=K,this.id="",this.objectNumber=-1};mi.prototype.restore=function(){Tt=this.page,Ct=this.pagesContext,Y=this.pages,Nt=this.x,Lt=this.y,gt=this.matrix,Li(z=this.currentPage,this.width),Ai(z,this.height),K=this.outputDestination};var bi=function(t,n,i,r,e){Wt.push(new mi),Tt=z=0,Y=[],Nt=t,Lt=n,gt=e,mn([i,r])};for(var pi in d.beginFormObject=function(t,n,i,r,e){return bi(t,n,i,r,e),this},d.endFormObject=function(t){return function(t){if(Vt[t])Wt.pop().restore();else{var n=new mi,i="Xo"+(Object.keys(Ut).length+1).toString(10);n.id=i,Vt[t]=i,Ut[i]=n,Dt.publish("addFormObject",n),Wt.pop().restore()}}(t),this},d.doFormObject=function(t,n){var i=Ut[Vt[t]];return Q("q"),Q(n.toString()+" cm"),Q("/"+i.id+" Do"),Q("Q"),this},d.getFormObject=function(t){var n=Ut[Vt[t]];return{x:n.x,y:n.y,width:n.width,height:n.height,matrix:n.matrix}},d.save=function(t,n){return t=t||"generated.pdf",(n=n||{}).returnPromise=n.returnPromise||!1,!1===n.returnPromise?(ot(jn(qn()),t),"function"==typeof ot.unload&&Z.setTimeout&&setTimeout(ot.unload,911),this):new Promise((function(n,i){try{var r=ot(jn(qn()),t);"function"==typeof ot.unload&&Z.setTimeout&&setTimeout(ot.unload,911),n(r)}catch(t){i(t.message)}}))},Pt.API)Pt.API.hasOwnProperty(pi)&&("events"===pi&&Pt.API.events.length?function(t,n){var i,r;for(r=n.length-1;-1!==r;r--)t.subscribe.apply(t,[n[r][0]].concat("function"==typeof(i=n[r][1])?[i]:i))}(Dt,Pt.API.events):d[pi]=Pt.API[pi]);var Ni=d.getPageWidth=function(t){return(Ct[t=t||z].mediaBox.topRightX-Ct[t].mediaBox.bottomLeftX)/pt},Li=d.setPageWidth=function(t,n){Ct[t].mediaBox.topRightX=n*pt+Ct[t].mediaBox.bottomLeftX},gi=d.getPageHeight=function(t){return(Ct[t=t||z].mediaBox.topRightY-Ct[t].mediaBox.bottomLeftY)/pt},Ai=d.setPageHeight=function(t,n){Ct[t].mediaBox.topRightY=n*pt+Ct[t].mediaBox.bottomLeftY};return d.internal={pdfEscape:wn,getStyle:Tn,getFont:Jn,getFontSize:ft,getCharSpace:ci,getTextColor:ui,getLineHeight:Zn,getLineHeightFactor:ti,getLineWidth:Kn,write:nt,getHorizontalCoordinate:ni,getVerticalCoordinate:ii,getCoordinateString:ri,getVerticalCoordinateString:ei,collections:{},newObject:Yt,newAdditionalObject:Xt,newObjectDeferred:$t,newObjectDeferredBegin:Kt,getFilters:rn,putStream:en,events:Dt,scaleFactor:pt,pageSize:{getWidth:function(){return Ni(z)},setWidth:function(t){Li(z,t)},getHeight:function(){return gi(z)},setHeight:function(t){Ai(z,t)}},encryptionOptions:c,encryption:Pn,getEncryptor:function(t){return null!==c?Pn.encryptor(t,0):function(t){return t}},output:Mn,getNumberOfPages:Ln,pages:Y,out:Q,f2:j,f3:M,getPageInfo:On,getPageInfoByObjId:In,getCurrentPageInfo:Fn,getPDFVersion:m,Point:di,Rectangle:wi,Matrix:_t,hasHotfix:En},Object.defineProperty(d.internal.pageSize,"width",{get:function(){return Ni(z)},set:function(t){Li(z,t)},enumerable:!0,configurable:!0}),Object.defineProperty(d.internal.pageSize,"height",{get:function(){return gi(z)},set:function(t){Ai(z,t)},enumerable:!0,configurable:!0}),function(t){for(var n=0,i=rt.length;n<i;n++){var r=dn.call(this,t[n][0],t[n][1],t[n][2],rt[n][3],!0);!1===h&&(v[r]=!0);var e=t[n][0].split("-");vn({id:r,fontName:e[0],fontStyle:e[1]||""})}Dt.publish("addFonts",{fonts:At,dictionary:yt})}.call(d,rt),bt="F1",bn(e,i),Dt.publish("initialized"),d}kt.prototype.lsbFirstWord=function(t){return String.fromCharCode(t>>0&255,t>>8&255,t>>16&255,t>>24&255)},kt.prototype.toHexString=function(t){return t.split("").map((function(t){return("0"+(255&t.charCodeAt(0)).toString(16)).slice(-2)})).join("")},kt.prototype.hexToBytes=function(t){for(var n=[],i=0;i<t.length;i+=2)n.push(String.fromCharCode(parseInt(t.substr(i,2),16)));return n.join("")},kt.prototype.processOwnerPassword=function(t,n){return At(Nt(n).substr(0,5),t)},kt.prototype.encryptor=function(t,n){var i=Nt(this.encryptionKey+String.fromCharCode(255&t,t>>8&255,t>>16&255,255&n,n>>8&255)).substr(0,10);return function(t){return At(i,t)}},qt.prototype.equals=function(t){var n,i="id,objectNumber,equals";if(!t||l(t)!==l(this))return!1;var r=0;for(n in this)if(!(i.indexOf(n)>=0)){if(this.hasOwnProperty(n)&&!t.hasOwnProperty(n))return!1;if(this[n]!==t[n])return!1;r++}for(n in t)t.hasOwnProperty(n)&&i.indexOf(n)<0&&r--;return 0===r},Pt.API={events:[]},Pt.version="2.5.1";var Ot=Pt.API,It=1,Ft=function(t){return t.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},Bt=function(t){return t.replace(/\\\\/g,"\\").replace(/\\\(/g,"(").replace(/\\\)/g,")")},Rt=function(t){return t.toFixed(2)},Tt=function(t){return t.toFixed(5)};Ot.__acroform__={};var Ct=function(t,n){t.prototype=Object.create(n.prototype),t.prototype.constructor=t},Dt=function(t){return t*It},zt=function(t){var n=new en,i=pn.internal.getHeight(t)||0,r=pn.internal.getWidth(t)||0;return n.BBox=[0,0,Number(Rt(r)),Number(Rt(i))],n},Ut=Ot.__acroform__.setBit=function(t,n){if(t=t||0,n=n||0,isNaN(t)||isNaN(n))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBit");return t|1<<n},Vt=Ot.__acroform__.clearBit=function(t,n){if(t=t||0,n=n||0,isNaN(t)||isNaN(n))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBit");return t&~(1<<n)},Wt=Ot.__acroform__.getBit=function(t,n){if(isNaN(t)||isNaN(n))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBit");return 0==(t&1<<n)?0:1},_t=Ot.__acroform__.getBitForPdf=function(t,n){if(isNaN(t)||isNaN(n))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBitForPdf");return Wt(t,n-1)},Ht=Ot.__acroform__.setBitForPdf=function(t,n){if(isNaN(t)||isNaN(n))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBitForPdf");return Ut(t,n-1)},Gt=Ot.__acroform__.clearBitForPdf=function(t,n){if(isNaN(t)||isNaN(n))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBitForPdf");return Vt(t,n-1)},Jt=Ot.__acroform__.calculateCoordinates=function(t,n){var i=n.internal.getHorizontalCoordinate,r=n.internal.getVerticalCoordinate,e=t[0],s=t[1],o=t[2],a=t[3],u={};return u.lowerLeft_X=i(e)||0,u.lowerLeft_Y=r(s+a)||0,u.upperRight_X=i(e+o)||0,u.upperRight_Y=r(s)||0,[Number(Rt(u.lowerLeft_X)),Number(Rt(u.lowerLeft_Y)),Number(Rt(u.upperRight_X)),Number(Rt(u.upperRight_Y))]},Yt=function(t){if(t.appearanceStreamContent)return t.appearanceStreamContent;if(t.V||t.DV){var n=[],i=$t(t,t._V||t.DV),r=t.scope.internal.getFont(t.fontName,t.fontStyle).id;n.push("/Tx BMC"),n.push("q"),n.push("BT"),n.push(t.scope.__private__.encodeColorString(t.color)),n.push("/"+r+" "+Rt(i.fontSize)+" Tf"),n.push("1 0 0 1 0 0 Tm"),n.push(i.text),n.push("ET"),n.push("Q"),n.push("EMC");var e=zt(t);return e.scope=t.scope,e.stream=n.join("\n"),e}},$t=function(t,n){var i=0===t.fontSize?t.maxFontSize:t.fontSize,r={text:"",fontSize:""},e=(n=")"==(n="("==n.substr(0,1)?n.substr(1):n).substr(n.length-1)?n.substr(0,n.length-1):n).split(" ");e=e.map(t.multiline?function(t){return t.split("\n")}:function(t){return[t]});var s=i,o=pn.internal.getHeight(t)||0;o=o<0?-o:o;var a=pn.internal.getWidth(t)||0;a=a<0?-a:a;var u=function(n,i,r){return n+1<e.length&&Kt(i+" "+e[n+1][0],t,r).width<=a-4};s++;t:for(;s>0;){n="",s--;var f,c,h=Kt("3",t,s).height,l=t.multiline?o-s:(o-h)/2,v=l+=2,d=0,w=0,m=0;if(s<=0){n="(...) Tj\n",n+="% Width of Text: "+Kt(n,t,s=12).width+", FieldWidth:"+a+"\n";break}for(var b="",p=0,N=0;N<e.length;N++)if(e.hasOwnProperty(N)){var L=!1;if(1!==e[N].length&&m!==e[N].length-1){if((h+2)*(p+2)+2>o)continue t;b+=e[N][m],L=!0,w=N,N--}else{b=" "==(b+=e[N][m]+" ").substr(b.length-1)?b.substr(0,b.length-1):b;var g=parseInt(N),A=u(g,b,s),y=N>=e.length-1;if(A&&!y){b+=" ",m=0;continue}if(A||y){if(y)w=g;else if(t.multiline&&(h+2)*(p+2)+2>o)continue t}else{if(!t.multiline)continue t;if((h+2)*(p+2)+2>o)continue t;w=g}}for(var k="",S=d;S<=w;S++){var x=e[S];if(t.multiline){if(S===w){k+=x[m]+" ",m=(m+1)%x.length;continue}if(S===d){k+=x[x.length-1]+" ";continue}}k+=x[0]+" "}switch(k=" "==k.substr(k.length-1)?k.substr(0,k.length-1):k,c=Kt(k,t,s).width,t.textAlign){case"right":f=a-c-2;break;case"center":f=(a-c)/2;break;default:f=2}n+=Rt(f)+" "+Rt(v)+" Td\n",n+="("+Ft(k)+") Tj\n",n+=-Rt(f)+" 0 Td\n",v=-(s+2),c=0,d=L?w:w+1,p++,b=""}break}return r.text=n,r.fontSize=s,r},Kt=function(t,n,i){var r=n.scope.internal.getFont(n.fontName,n.fontStyle),e=n.scope.getStringUnitWidth(t,{font:r,fontSize:parseFloat(i),charSpace:0})*parseFloat(i);return{height:n.scope.getStringUnitWidth("3",{font:r,fontSize:parseFloat(i),charSpace:0})*parseFloat(i)*1.5,width:e}},Xt={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},Zt=function(t,n){var i={type:"reference",object:t};void 0===n.internal.getPageInfo(t.page).pageContext.annotations.find((function(t){return t.type===i.type&&t.object===i.object}))&&n.internal.getPageInfo(t.page).pageContext.annotations.push(i)},Qt=function(t,n){if(n.scope=t,void 0!==t.internal&&(void 0===t.internal.acroformPlugin||!1===t.internal.acroformPlugin.isInitialized)){if(on.FieldNum=0,t.internal.acroformPlugin=JSON.parse(JSON.stringify(Xt)),t.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("Exception while creating AcroformDictionary");It=t.internal.scaleFactor,t.internal.acroformPlugin.acroFormDictionaryRoot=new sn,t.internal.acroformPlugin.acroFormDictionaryRoot.scope=t,t.internal.acroformPlugin.acroFormDictionaryRoot._eventID=t.internal.events.subscribe("postPutResources",(function(){!function(t){t.internal.events.unsubscribe(t.internal.acroformPlugin.acroFormDictionaryRoot._eventID),delete t.internal.acroformPlugin.acroFormDictionaryRoot._eventID,t.internal.acroformPlugin.printedOut=!0}(t)})),t.internal.events.subscribe("buildDocument",(function(){!function(t){t.internal.acroformPlugin.acroFormDictionaryRoot.objId=void 0;var n=t.internal.acroformPlugin.acroFormDictionaryRoot.Fields;for(var i in n)if(n.hasOwnProperty(i)){var r=n[i];r.objId=void 0,r.hasAnnotation&&Zt(r,t)}}(t)})),t.internal.events.subscribe("putCatalog",(function(){!function(t){if(void 0===t.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("putCatalogCallback: Root missing.");t.internal.write("/AcroForm "+t.internal.acroformPlugin.acroFormDictionaryRoot.objId+" 0 R")}(t)})),t.internal.events.subscribe("postPutPages",(function(n){!function(t,n){var i=!t;for(var r in t||(n.internal.newObjectDeferredBegin(n.internal.acroformPlugin.acroFormDictionaryRoot.objId,!0),n.internal.acroformPlugin.acroFormDictionaryRoot.putStream()),t=t||n.internal.acroformPlugin.acroFormDictionaryRoot.Kids)if(t.hasOwnProperty(r)){var e=t[r],s=[],o=e.Rect;if(e.Rect&&(e.Rect=Jt(e.Rect,n)),n.internal.newObjectDeferredBegin(e.objId,!0),e.DA=pn.createDefaultAppearanceStream(e),"object"===l(e)&&"function"==typeof e.getKeyValueListForStream&&(s=e.getKeyValueListForStream()),e.Rect=o,e.hasAppearanceStream&&!e.appearanceStreamContent){var a=Yt(e);s.push({key:"AP",value:"<</N "+a+">>"}),n.internal.acroformPlugin.xForms.push(a)}if(e.appearanceStreamContent){var u="";for(var f in e.appearanceStreamContent)if(e.appearanceStreamContent.hasOwnProperty(f)){var c=e.appearanceStreamContent[f];if(u+="/"+f+" ",u+="<<",Object.keys(c).length>=1||Array.isArray(c)){for(var r in c)if(c.hasOwnProperty(r)){var h=c[r];"function"==typeof h&&(h=h.call(n,e)),u+="/"+r+" "+h+" ",n.internal.acroformPlugin.xForms.indexOf(h)>=0||n.internal.acroformPlugin.xForms.push(h)}}else"function"==typeof(h=c)&&(h=h.call(n,e)),u+="/"+r+" "+h,n.internal.acroformPlugin.xForms.indexOf(h)>=0||n.internal.acroformPlugin.xForms.push(h);u+=">>"}s.push({key:"AP",value:"<<\n"+u+">>"})}n.internal.putStream({additionalKeyValues:s,objectId:e.objId}),n.internal.out("endobj")}i&&function(t,n){for(var i in t)if(t.hasOwnProperty(i)){var r=i,e=t[i];n.internal.newObjectDeferredBegin(e.objId,!0),"object"===l(e)&&"function"==typeof e.putStream&&e.putStream(),delete t[r]}}(n.internal.acroformPlugin.xForms,n)}(n,t)})),t.internal.acroformPlugin.isInitialized=!0}},tn=Ot.__acroform__.arrayToPdfArray=function(t,n,i){var r=function(t){return t};if(Array.isArray(t)){for(var e="[",s=0;s<t.length;s++)switch(0!==s&&(e+=" "),l(t[s])){case"boolean":case"number":case"object":e+=t[s].toString();break;case"string":"/"!==t[s].substr(0,1)?(void 0!==n&&i&&(r=i.internal.getEncryptor(n)),e+="("+Ft(r(t[s].toString()))+")"):e+=t[s].toString()}return e+"]"}throw new Error("Invalid argument passed to jsPDF.__acroform__.arrayToPdfArray")},nn=function(t,n,i){var r=function(t){return t};return void 0!==n&&i&&(r=i.internal.getEncryptor(n)),(t=t||"").toString(),"("+Ft(r(t))+")"},rn=function(){this._objId=void 0,this._scope=void 0,Object.defineProperty(this,"objId",{get:function(){if(void 0===this._objId){if(void 0===this.scope)return;this._objId=this.scope.internal.newObjectDeferred()}return this._objId},set:function(t){this._objId=t}}),Object.defineProperty(this,"scope",{value:this._scope,writable:!0})};rn.prototype.toString=function(){return this.objId+" 0 R"},rn.prototype.putStream=function(){var t=this.getKeyValueListForStream();this.scope.internal.putStream({data:this.stream,additionalKeyValues:t,objectId:this.objId}),this.scope.internal.out("endobj")},rn.prototype.getKeyValueListForStream=function(){var t=[],n=Object.getOwnPropertyNames(this).filter((function(t){return"content"!=t&&"appearanceStreamContent"!=t&&"scope"!=t&&"objId"!=t&&"_"!=t.substring(0,1)}));for(var i in n)if(!1===Object.getOwnPropertyDescriptor(this,n[i]).configurable){var r=n[i],e=this[r];e&&(Array.isArray(e)?t.push({key:r,value:tn(e,this.objId,this.scope)}):e instanceof rn?(e.scope=this.scope,t.push({key:r,value:e.objId+" 0 R"})):"function"!=typeof e&&t.push({key:r,value:e}))}return t};var en=function(){rn.call(this),Object.defineProperty(this,"Type",{value:"/XObject",configurable:!1,writable:!0}),Object.defineProperty(this,"Subtype",{value:"/Form",configurable:!1,writable:!0}),Object.defineProperty(this,"FormType",{value:1,configurable:!1,writable:!0});var t,n=[];Object.defineProperty(this,"BBox",{configurable:!1,get:function(){return n},set:function(t){n=t}}),Object.defineProperty(this,"Resources",{value:"2 0 R",configurable:!1,writable:!0}),Object.defineProperty(this,"stream",{enumerable:!1,configurable:!0,set:function(n){t=n.trim()},get:function(){return t||null}})};Ct(en,rn);var sn=function(){rn.call(this);var t,n=[];Object.defineProperty(this,"Kids",{enumerable:!1,configurable:!0,get:function(){return n.length>0?n:void 0}}),Object.defineProperty(this,"Fields",{enumerable:!1,configurable:!1,get:function(){return n}}),Object.defineProperty(this,"DA",{enumerable:!1,configurable:!1,get:function(){if(t){var n=function(t){return t};return this.scope&&(n=this.scope.internal.getEncryptor(this.objId)),"("+Ft(n(t))+")"}},set:function(n){t=n}})};Ct(sn,rn);var on=function t(){rn.call(this);var n=4;Object.defineProperty(this,"F",{enumerable:!1,configurable:!1,get:function(){return n},set:function(t){if(isNaN(t))throw new Error('Invalid value "'+t+'" for attribute F supplied.');n=t}}),Object.defineProperty(this,"showWhenPrinted",{enumerable:!0,configurable:!0,get:function(){return Boolean(_t(n,3))},set:function(t){this.F=!0===Boolean(t)?Ht(n,3):Gt(n,3)}});var i=0;Object.defineProperty(this,"Ff",{enumerable:!1,configurable:!1,get:function(){return i},set:function(t){if(isNaN(t))throw new Error('Invalid value "'+t+'" for attribute Ff supplied.');i=t}});var r=[];Object.defineProperty(this,"Rect",{enumerable:!1,configurable:!1,get:function(){if(0!==r.length)return r},set:function(t){r=void 0!==t?t:[]}}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[0])?0:r[0]},set:function(t){r[0]=t}}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[1])?0:r[1]},set:function(t){r[1]=t}}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[2])?0:r[2]},set:function(t){r[2]=t}}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[3])?0:r[3]},set:function(t){r[3]=t}});var e="";Object.defineProperty(this,"FT",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){switch(t){case"/Btn":case"/Tx":case"/Ch":case"/Sig":e=t;break;default:throw new Error('Invalid value "'+t+'" for attribute FT supplied.')}}});var s=null;Object.defineProperty(this,"T",{enumerable:!0,configurable:!1,get:function(){if(!s||s.length<1){if(this instanceof dn)return;s="FieldObject"+t.FieldNum++}var n=function(t){return t};return this.scope&&(n=this.scope.internal.getEncryptor(this.objId)),"("+Ft(n(s))+")"},set:function(t){s=t.toString()}}),Object.defineProperty(this,"fieldName",{configurable:!0,enumerable:!0,get:function(){return s},set:function(t){s=t}});var o="helvetica";Object.defineProperty(this,"fontName",{enumerable:!0,configurable:!0,get:function(){return o},set:function(t){o=t}});var a="normal";Object.defineProperty(this,"fontStyle",{enumerable:!0,configurable:!0,get:function(){return a},set:function(t){a=t}});var u=0;Object.defineProperty(this,"fontSize",{enumerable:!0,configurable:!0,get:function(){return u},set:function(t){u=t}});var f=void 0;Object.defineProperty(this,"maxFontSize",{enumerable:!0,configurable:!0,get:function(){return void 0===f?50/It:f},set:function(t){f=t}});var c="black";Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,get:function(){return c},set:function(t){c=t}});var h="/F1 0 Tf 0 g";Object.defineProperty(this,"DA",{enumerable:!0,configurable:!1,get:function(){if(!(!h||this instanceof dn||this instanceof mn))return nn(h,this.objId,this.scope)},set:function(t){t=t.toString(),h=t}});var l=null;Object.defineProperty(this,"DV",{enumerable:!1,configurable:!1,get:function(){if(l)return this instanceof hn==0?nn(l,this.objId,this.scope):l},set:function(t){t=t.toString(),l=this instanceof hn==0?"("===t.substr(0,1)?Bt(t.substr(1,t.length-2)):Bt(t):t}}),Object.defineProperty(this,"defaultValue",{enumerable:!0,configurable:!0,get:function(){return this instanceof hn==1?Bt(l.substr(1,l.length-1)):l},set:function(t){t=t.toString(),l=this instanceof hn==1?"/"+t:t}});var v=null;Object.defineProperty(this,"_V",{enumerable:!1,configurable:!1,get:function(){if(v)return v},set:function(t){this.V=t}}),Object.defineProperty(this,"V",{enumerable:!1,configurable:!1,get:function(){if(v)return this instanceof hn==0?nn(v,this.objId,this.scope):v},set:function(t){t=t.toString(),v=this instanceof hn==0?"("===t.substr(0,1)?Bt(t.substr(1,t.length-2)):Bt(t):t}}),Object.defineProperty(this,"value",{enumerable:!0,configurable:!0,get:function(){return this instanceof hn==1?Bt(v.substr(1,v.length-1)):v},set:function(t){t=t.toString(),v=this instanceof hn==1?"/"+t:t}}),Object.defineProperty(this,"hasAnnotation",{enumerable:!0,configurable:!0,get:function(){return this.Rect}}),Object.defineProperty(this,"Type",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Annot":null}}),Object.defineProperty(this,"Subtype",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Widget":null}});var d,w=!1;Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return w},set:function(t){t=Boolean(t),w=t}}),Object.defineProperty(this,"page",{enumerable:!0,configurable:!0,get:function(){if(d)return d},set:function(t){d=t}}),Object.defineProperty(this,"readOnly",{enumerable:!0,configurable:!0,get:function(){return Boolean(_t(this.Ff,1))},set:function(t){this.Ff=!0===Boolean(t)?Ht(this.Ff,1):Gt(this.Ff,1)}}),Object.defineProperty(this,"required",{enumerable:!0,configurable:!0,get:function(){return Boolean(_t(this.Ff,2))},set:function(t){this.Ff=!0===Boolean(t)?Ht(this.Ff,2):Gt(this.Ff,2)}}),Object.defineProperty(this,"noExport",{enumerable:!0,configurable:!0,get:function(){return Boolean(_t(this.Ff,3))},set:function(t){this.Ff=!0===Boolean(t)?Ht(this.Ff,3):Gt(this.Ff,3)}});var m=null;Object.defineProperty(this,"Q",{enumerable:!0,configurable:!1,get:function(){if(null!==m)return m},set:function(t){if(-1===[0,1,2].indexOf(t))throw new Error('Invalid value "'+t+'" for attribute Q supplied.');m=t}}),Object.defineProperty(this,"textAlign",{get:function(){var t;switch(m){case 0:default:t="left";break;case 1:t="center";break;case 2:t="right"}return t},configurable:!0,enumerable:!0,set:function(t){switch(t){case"right":case 2:m=2;break;case"center":case 1:m=1;break;default:m=0}}})};Ct(on,rn);var an=function(){on.call(this),this.FT="/Ch",this.V="()",this.fontName="zapfdingbats";var t=0;Object.defineProperty(this,"TI",{enumerable:!0,configurable:!1,get:function(){return t},set:function(n){t=n}}),Object.defineProperty(this,"topIndex",{enumerable:!0,configurable:!0,get:function(){return t},set:function(n){t=n}});var n=[];Object.defineProperty(this,"Opt",{enumerable:!0,configurable:!1,get:function(){return tn(n,this.objId,this.scope)},set:function(t){var i,r;r=[],"string"==typeof(i=t)&&(r=function(t,n,i){i||(i=1);for(var r,e=[];r=n.exec(t);)e.push(r[i]);return e}(i,/\((.*?)\)/g)),n=r}}),this.getOptions=function(){return n},this.setOptions=function(t){n=t,this.sort&&n.sort()},this.addOption=function(t){t=(t=t||"").toString(),n.push(t),this.sort&&n.sort()},this.removeOption=function(t,i){for(i=i||!1,t=(t=t||"").toString();-1!==n.indexOf(t)&&(n.splice(n.indexOf(t),1),!1!==i););},Object.defineProperty(this,"combo",{enumerable:!0,configurable:!0,get:function(){return Boolean(_t(this.Ff,18))},set:function(t){this.Ff=!0===Boolean(t)?Ht(this.Ff,18):Gt(this.Ff,18)}}),Object.defineProperty(this,"edit",{enumerable:!0,configurable:!0,get:function(){return Boolean(_t(this.Ff,19))},set:function(t){!0===this.combo&&(this.Ff=!0===Boolean(t)?Ht(this.Ff,19):Gt(this.Ff,19))}}),Object.defineProperty(this,"sort",{enumerable:!0,configurable:!0,get:function(){return Boolean(_t(this.Ff,20))},set:function(t){!0===Boolean(t)?(this.Ff=Ht(this.Ff,20),n.sort()):this.Ff=Gt(this.Ff,20)}}),Object.defineProperty(this,"multiSelect",{enumerable:!0,configurable:!0,get:function(){return Boolean(_t(this.Ff,22))},set:function(t){this.Ff=!0===Boolean(t)?Ht(this.Ff,22):Gt(this.Ff,22)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return Boolean(_t(this.Ff,23))},set:function(t){this.Ff=!0===Boolean(t)?Ht(this.Ff,23):Gt(this.Ff,23)}}),Object.defineProperty(this,"commitOnSelChange",{enumerable:!0,configurable:!0,get:function(){return Boolean(_t(this.Ff,27))},set:function(t){this.Ff=!0===Boolean(t)?Ht(this.Ff,27):Gt(this.Ff,27)}}),this.hasAppearanceStream=!1};Ct(an,on);var un=function(){an.call(this),this.fontName="helvetica",this.combo=!1};Ct(un,an);var fn=function(){un.call(this),this.combo=!0};Ct(fn,un);var cn=function(){fn.call(this),this.edit=!0};Ct(cn,fn);var hn=function(){on.call(this),this.FT="/Btn",Object.defineProperty(this,"noToggleToOff",{enumerable:!0,configurable:!0,get:function(){return Boolean(_t(this.Ff,15))},set:function(t){this.Ff=!0===Boolean(t)?Ht(this.Ff,15):Gt(this.Ff,15)}}),Object.defineProperty(this,"radio",{enumerable:!0,configurable:!0,get:function(){return Boolean(_t(this.Ff,16))},set:function(t){this.Ff=!0===Boolean(t)?Ht(this.Ff,16):Gt(this.Ff,16)}}),Object.defineProperty(this,"pushButton",{enumerable:!0,configurable:!0,get:function(){return Boolean(_t(this.Ff,17))},set:function(t){this.Ff=!0===Boolean(t)?Ht(this.Ff,17):Gt(this.Ff,17)}}),Object.defineProperty(this,"radioIsUnison",{enumerable:!0,configurable:!0,get:function(){return Boolean(_t(this.Ff,26))},set:function(t){this.Ff=!0===Boolean(t)?Ht(this.Ff,26):Gt(this.Ff,26)}});var t,n={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var t=function(t){return t};if(this.scope&&(t=this.scope.internal.getEncryptor(this.objId)),0!==Object.keys(n).length){var i,r=[];for(i in r.push("<<"),n)r.push("/"+i+" ("+Ft(t(n[i]))+")");return r.push(">>"),r.join("\n")}},set:function(t){"object"===l(t)&&(n=t)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return n.CA||""},set:function(t){"string"==typeof t&&(n.CA=t)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return t},set:function(n){t=n}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return t.substr(1,t.length-1)},set:function(n){t="/"+n}})};Ct(hn,on);var ln=function(){hn.call(this),this.pushButton=!0};Ct(ln,hn);var vn=function(){hn.call(this),this.radio=!0,this.pushButton=!1;var t=[];Object.defineProperty(this,"Kids",{enumerable:!0,configurable:!1,get:function(){return t},set:function(n){t=void 0!==n?n:[]}})};Ct(vn,hn);var dn=function(){var t,n;on.call(this),Object.defineProperty(this,"Parent",{enumerable:!1,configurable:!1,get:function(){return t},set:function(n){t=n}}),Object.defineProperty(this,"optionName",{enumerable:!1,configurable:!0,get:function(){return n},set:function(t){n=t}});var i,r={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var t=function(t){return t};this.scope&&(t=this.scope.internal.getEncryptor(this.objId));var n,i=[];for(n in i.push("<<"),r)i.push("/"+n+" ("+Ft(t(r[n]))+")");return i.push(">>"),i.join("\n")},set:function(t){"object"===l(t)&&(r=t)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return r.CA||""},set:function(t){"string"==typeof t&&(r.CA=t)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return i},set:function(t){i=t}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return i.substr(1,i.length-1)},set:function(t){i="/"+t}}),this.caption="l",this.appearanceState="Off",this._AppearanceType=pn.RadioButton.Circle,this.appearanceStreamContent=this._AppearanceType.createAppearanceStream(this.optionName)};Ct(dn,on),vn.prototype.setAppearance=function(t){if(!("createAppearanceStream"in t)||!("getCA"in t))throw new Error("Couldn't assign Appearance to RadioButton. Appearance was Invalid!");for(var n in this.Kids)if(this.Kids.hasOwnProperty(n)){var i=this.Kids[n];i.appearanceStreamContent=t.createAppearanceStream(i.optionName),i.caption=t.getCA()}},vn.prototype.createOption=function(t){var n=new dn;return n.Parent=this,n.optionName=t,this.Kids.push(n),Nn.call(this.scope,n),n};var wn=function(){hn.call(this),this.fontName="zapfdingbats",this.caption="3",this.appearanceState="On",this.value="On",this.textAlign="center",this.appearanceStreamContent=pn.CheckBox.createAppearanceStream()};Ct(wn,hn);var mn=function(){on.call(this),this.FT="/Tx",Object.defineProperty(this,"multiline",{enumerable:!0,configurable:!0,get:function(){return Boolean(_t(this.Ff,13))},set:function(t){this.Ff=!0===Boolean(t)?Ht(this.Ff,13):Gt(this.Ff,13)}}),Object.defineProperty(this,"fileSelect",{enumerable:!0,configurable:!0,get:function(){return Boolean(_t(this.Ff,21))},set:function(t){this.Ff=!0===Boolean(t)?Ht(this.Ff,21):Gt(this.Ff,21)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return Boolean(_t(this.Ff,23))},set:function(t){this.Ff=!0===Boolean(t)?Ht(this.Ff,23):Gt(this.Ff,23)}}),Object.defineProperty(this,"doNotScroll",{enumerable:!0,configurable:!0,get:function(){return Boolean(_t(this.Ff,24))},set:function(t){this.Ff=!0===Boolean(t)?Ht(this.Ff,24):Gt(this.Ff,24)}}),Object.defineProperty(this,"comb",{enumerable:!0,configurable:!0,get:function(){return Boolean(_t(this.Ff,25))},set:function(t){this.Ff=!0===Boolean(t)?Ht(this.Ff,25):Gt(this.Ff,25)}}),Object.defineProperty(this,"richText",{enumerable:!0,configurable:!0,get:function(){return Boolean(_t(this.Ff,26))},set:function(t){this.Ff=!0===Boolean(t)?Ht(this.Ff,26):Gt(this.Ff,26)}});var t=null;Object.defineProperty(this,"MaxLen",{enumerable:!0,configurable:!1,get:function(){return t},set:function(n){t=n}}),Object.defineProperty(this,"maxLength",{enumerable:!0,configurable:!0,get:function(){return t},set:function(n){Number.isInteger(n)&&(t=n)}}),Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return this.V||this.DV}})};Ct(mn,on);var bn=function(){mn.call(this),Object.defineProperty(this,"password",{enumerable:!0,configurable:!0,get:function(){return Boolean(_t(this.Ff,14))},set:function(t){this.Ff=!0===Boolean(t)?Ht(this.Ff,14):Gt(this.Ff,14)}}),this.password=!0};Ct(bn,mn);var pn={CheckBox:{createAppearanceStream:function(){return{N:{On:pn.CheckBox.YesNormal},D:{On:pn.CheckBox.YesPushDown,Off:pn.CheckBox.OffPushDown}}},YesPushDown:function(t){var n=zt(t);n.scope=t.scope;var i=[],r=t.scope.internal.getFont(t.fontName,t.fontStyle).id,e=t.scope.__private__.encodeColorString(t.color),s=$t(t,t.caption);return i.push("0.749023 g"),i.push("0 0 "+Rt(pn.internal.getWidth(t))+" "+Rt(pn.internal.getHeight(t))+" re"),i.push("f"),i.push("BMC"),i.push("q"),i.push("0 0 1 rg"),i.push("/"+r+" "+Rt(s.fontSize)+" Tf "+e),i.push("BT"),i.push(s.text),i.push("ET"),i.push("Q"),i.push("EMC"),n.stream=i.join("\n"),n},YesNormal:function(t){var n=zt(t);n.scope=t.scope;var i=t.scope.internal.getFont(t.fontName,t.fontStyle).id,r=t.scope.__private__.encodeColorString(t.color),e=[],s=pn.internal.getHeight(t),o=pn.internal.getWidth(t),a=$t(t,t.caption);return e.push("1 g"),e.push("0 0 "+Rt(o)+" "+Rt(s)+" re"),e.push("f"),e.push("q"),e.push("0 0 1 rg"),e.push("0 0 "+Rt(o-1)+" "+Rt(s-1)+" re"),e.push("W"),e.push("n"),e.push("0 g"),e.push("BT"),e.push("/"+i+" "+Rt(a.fontSize)+" Tf "+r),e.push(a.text),e.push("ET"),e.push("Q"),n.stream=e.join("\n"),n},OffPushDown:function(t){var n=zt(t);n.scope=t.scope;var i=[];return i.push("0.749023 g"),i.push("0 0 "+Rt(pn.internal.getWidth(t))+" "+Rt(pn.internal.getHeight(t))+" re"),i.push("f"),n.stream=i.join("\n"),n}},RadioButton:{Circle:{createAppearanceStream:function(t){var n={D:{Off:pn.RadioButton.Circle.OffPushDown},N:{}};return n.N[t]=pn.RadioButton.Circle.YesNormal,n.D[t]=pn.RadioButton.Circle.YesPushDown,n},getCA:function(){return"l"},YesNormal:function(t){var n=zt(t);n.scope=t.scope;var i=[],r=pn.internal.getWidth(t)<=pn.internal.getHeight(t)?pn.internal.getWidth(t)/4:pn.internal.getHeight(t)/4;r=Number((.9*r).toFixed(5));var e=Number((r*pn.internal.Bezier_C).toFixed(5));return i.push("q"),i.push("1 0 0 1 "+Tt(pn.internal.getWidth(t)/2)+" "+Tt(pn.internal.getHeight(t)/2)+" cm"),i.push(r+" 0 m"),i.push(r+" "+e+" "+e+" "+r+" 0 "+r+" c"),i.push("-"+e+" "+r+" -"+r+" "+e+" -"+r+" 0 c"),i.push("-"+r+" -"+e+" -"+e+" -"+r+" 0 -"+r+" c"),i.push(e+" -"+r+" "+r+" -"+e+" "+r+" 0 c"),i.push("f"),i.push("Q"),n.stream=i.join("\n"),n},YesPushDown:function(t){var n=zt(t);n.scope=t.scope;var i=[],r=pn.internal.getWidth(t)<=pn.internal.getHeight(t)?pn.internal.getWidth(t)/4:pn.internal.getHeight(t)/4;r=Number((.9*r).toFixed(5));var e=Number((2*r).toFixed(5)),s=Number((e*pn.internal.Bezier_C).toFixed(5)),o=Number((r*pn.internal.Bezier_C).toFixed(5));return i.push("0.749023 g"),i.push("q"),i.push("1 0 0 1 "+Tt(pn.internal.getWidth(t)/2)+" "+Tt(pn.internal.getHeight(t)/2)+" cm"),i.push(e+" 0 m"),i.push(e+" "+s+" "+s+" "+e+" 0 "+e+" c"),i.push("-"+s+" "+e+" -"+e+" "+s+" -"+e+" 0 c"),i.push("-"+e+" -"+s+" -"+s+" -"+e+" 0 -"+e+" c"),i.push(s+" -"+e+" "+e+" -"+s+" "+e+" 0 c"),i.push("f"),i.push("Q"),i.push("0 g"),i.push("q"),i.push("1 0 0 1 "+Tt(pn.internal.getWidth(t)/2)+" "+Tt(pn.internal.getHeight(t)/2)+" cm"),i.push(r+" 0 m"),i.push(r+" "+o+" "+o+" "+r+" 0 "+r+" c"),i.push("-"+o+" "+r+" -"+r+" "+o+" -"+r+" 0 c"),i.push("-"+r+" -"+o+" -"+o+" -"+r+" 0 -"+r+" c"),i.push(o+" -"+r+" "+r+" -"+o+" "+r+" 0 c"),i.push("f"),i.push("Q"),n.stream=i.join("\n"),n},OffPushDown:function(t){var n=zt(t);n.scope=t.scope;var i=[],r=pn.internal.getWidth(t)<=pn.internal.getHeight(t)?pn.internal.getWidth(t)/4:pn.internal.getHeight(t)/4;r=Number((.9*r).toFixed(5));var e=Number((2*r).toFixed(5)),s=Number((e*pn.internal.Bezier_C).toFixed(5));return i.push("0.749023 g"),i.push("q"),i.push("1 0 0 1 "+Tt(pn.internal.getWidth(t)/2)+" "+Tt(pn.internal.getHeight(t)/2)+" cm"),i.push(e+" 0 m"),i.push(e+" "+s+" "+s+" "+e+" 0 "+e+" c"),i.push("-"+s+" "+e+" -"+e+" "+s+" -"+e+" 0 c"),i.push("-"+e+" -"+s+" -"+s+" -"+e+" 0 -"+e+" c"),i.push(s+" -"+e+" "+e+" -"+s+" "+e+" 0 c"),i.push("f"),i.push("Q"),n.stream=i.join("\n"),n}},Cross:{createAppearanceStream:function(t){var n={D:{Off:pn.RadioButton.Cross.OffPushDown},N:{}};return n.N[t]=pn.RadioButton.Cross.YesNormal,n.D[t]=pn.RadioButton.Cross.YesPushDown,n},getCA:function(){return"8"},YesNormal:function(t){var n=zt(t);n.scope=t.scope;var i=[],r=pn.internal.calculateCross(t);return i.push("q"),i.push("1 1 "+Rt(pn.internal.getWidth(t)-2)+" "+Rt(pn.internal.getHeight(t)-2)+" re"),i.push("W"),i.push("n"),i.push(Rt(r.x1.x)+" "+Rt(r.x1.y)+" m"),i.push(Rt(r.x2.x)+" "+Rt(r.x2.y)+" l"),i.push(Rt(r.x4.x)+" "+Rt(r.x4.y)+" m"),i.push(Rt(r.x3.x)+" "+Rt(r.x3.y)+" l"),i.push("s"),i.push("Q"),n.stream=i.join("\n"),n},YesPushDown:function(t){var n=zt(t);n.scope=t.scope;var i=pn.internal.calculateCross(t),r=[];return r.push("0.749023 g"),r.push("0 0 "+Rt(pn.internal.getWidth(t))+" "+Rt(pn.internal.getHeight(t))+" re"),r.push("f"),r.push("q"),r.push("1 1 "+Rt(pn.internal.getWidth(t)-2)+" "+Rt(pn.internal.getHeight(t)-2)+" re"),r.push("W"),r.push("n"),r.push(Rt(i.x1.x)+" "+Rt(i.x1.y)+" m"),r.push(Rt(i.x2.x)+" "+Rt(i.x2.y)+" l"),r.push(Rt(i.x4.x)+" "+Rt(i.x4.y)+" m"),r.push(Rt(i.x3.x)+" "+Rt(i.x3.y)+" l"),r.push("s"),r.push("Q"),n.stream=r.join("\n"),n},OffPushDown:function(t){var n=zt(t);n.scope=t.scope;var i=[];return i.push("0.749023 g"),i.push("0 0 "+Rt(pn.internal.getWidth(t))+" "+Rt(pn.internal.getHeight(t))+" re"),i.push("f"),n.stream=i.join("\n"),n}}},createDefaultAppearanceStream:function(t){var n=t.scope.internal.getFont(t.fontName,t.fontStyle).id,i=t.scope.__private__.encodeColorString(t.color);return"/"+n+" "+t.fontSize+" Tf "+i}};pn.internal={Bezier_C:.551915024494,calculateCross:function(t){var n=pn.internal.getWidth(t),i=pn.internal.getHeight(t),r=Math.min(n,i);return{x1:{x:(n-r)/2,y:(i-r)/2+r},x2:{x:(n-r)/2+r,y:(i-r)/2},x3:{x:(n-r)/2,y:(i-r)/2},x4:{x:(n-r)/2+r,y:(i-r)/2+r}}}},pn.internal.getWidth=function(t){var n=0;return"object"===l(t)&&(n=Dt(t.Rect[2])),n},pn.internal.getHeight=function(t){var n=0;return"object"===l(t)&&(n=Dt(t.Rect[3])),n};var Nn=Ot.addField=function(t){if(Qt(this,t),!(t instanceof on))throw new Error("Invalid argument passed to jsPDF.addField.");var n;return(n=t).scope.internal.acroformPlugin.printedOut&&(n.scope.internal.acroformPlugin.printedOut=!1,n.scope.internal.acroformPlugin.acroFormDictionaryRoot=null),n.scope.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(n),t.page=t.scope.internal.getCurrentPageInfo().pageNumber,this};function Ln(t){return t.reduce((function(t,n,i){return t[n]=i,t}),{})}Ot.AcroFormChoiceField=an,Ot.AcroFormListBox=un,Ot.AcroFormComboBox=fn,Ot.AcroFormEditBox=cn,Ot.AcroFormButton=hn,Ot.AcroFormPushButton=ln,Ot.AcroFormRadioButton=vn,Ot.AcroFormCheckBox=wn,Ot.AcroFormTextField=mn,Ot.AcroFormPasswordField=bn,Ot.AcroFormAppearance=pn,Ot.AcroForm={ChoiceField:an,ListBox:un,ComboBox:fn,EditBox:cn,Button:hn,PushButton:ln,RadioButton:vn,CheckBox:wn,TextField:mn,PasswordField:bn,Appearance:pn},Pt.AcroForm={ChoiceField:an,ListBox:un,ComboBox:fn,EditBox:cn,Button:hn,PushButton:ln,RadioButton:vn,CheckBox:wn,TextField:mn,PasswordField:bn,Appearance:pn},function(t){t.__addimage__={};var n="UNKNOWN",i={PNG:[[137,80,78,71]],TIFF:[[77,77,0,42],[73,73,42,0]],JPEG:[[255,216,255,224,void 0,void 0,74,70,73,70,0],[255,216,255,225,void 0,void 0,69,120,105,102,0,0],[255,216,255,219],[255,216,255,238]],JPEG2000:[[0,0,0,12,106,80,32,32]],GIF87a:[[71,73,70,56,55,97]],GIF89a:[[71,73,70,56,57,97]],WEBP:[[82,73,70,70,void 0,void 0,void 0,void 0,87,69,66,80]],BMP:[[66,77],[66,65],[67,73],[67,80],[73,67],[80,84]]},r=t.__addimage__.getImageFileTypeByImageData=function(t,r){var e,s,o,a,u,f=n;if("RGBA"===(r=r||n)||void 0!==t.data&&t.data instanceof Uint8ClampedArray&&"height"in t&&"width"in t)return"RGBA";if(y(t))for(u in i)for(o=i[u],e=0;e<o.length;e+=1){for(a=!0,s=0;s<o[e].length;s+=1)if(void 0!==o[e][s]&&o[e][s]!==t[s]){a=!1;break}if(!0===a){f=u;break}}else for(u in i)for(o=i[u],e=0;e<o.length;e+=1){for(a=!0,s=0;s<o[e].length;s+=1)if(void 0!==o[e][s]&&o[e][s]!==t.charCodeAt(s)){a=!1;break}if(!0===a){f=u;break}}return f===n&&r!==n&&(f=r),f},e=function t(n){for(var i=this.internal.write,r=this.internal.putStream,e=(0,this.internal.getFilters)();-1!==e.indexOf("FlateEncode");)e.splice(e.indexOf("FlateEncode"),1);n.objectId=this.internal.newObject();var s=[];if(s.push({key:"Type",value:"/XObject"}),s.push({key:"Subtype",value:"/Image"}),s.push({key:"Width",value:n.width}),s.push({key:"Height",value:n.height}),n.colorSpace===b.INDEXED?s.push({key:"ColorSpace",value:"[/Indexed /DeviceRGB "+(n.palette.length/3-1)+" "+("sMask"in n&&void 0!==n.sMask?n.objectId+2:n.objectId+1)+" 0 R]"}):(s.push({key:"ColorSpace",value:"/"+n.colorSpace}),n.colorSpace===b.DEVICE_CMYK&&s.push({key:"Decode",value:"[1 0 1 0 1 0 1 0]"})),s.push({key:"BitsPerComponent",value:n.bitsPerComponent}),"decodeParameters"in n&&void 0!==n.decodeParameters&&s.push({key:"DecodeParms",value:"<<"+n.decodeParameters+">>"}),"transparency"in n&&Array.isArray(n.transparency)){for(var o="",a=0,u=n.transparency.length;a<u;a++)o+=n.transparency[a]+" "+n.transparency[a]+" ";s.push({key:"Mask",value:"["+o+"]"})}if(void 0!==n.sMask&&s.push({key:"SMask",value:n.objectId+1+" 0 R"}),r({data:n.data,additionalKeyValues:s,alreadyAppliedFilters:void 0!==n.filter?["/"+n.filter]:void 0,objectId:n.objectId}),i("endobj"),"sMask"in n&&void 0!==n.sMask){var f={width:n.width,height:n.height,colorSpace:"DeviceGray",bitsPerComponent:n.bitsPerComponent,decodeParameters:"/Predictor "+n.predictor+" /Colors 1 /BitsPerComponent "+n.bitsPerComponent+" /Columns "+n.width,data:n.sMask};"filter"in n&&(f.filter=n.filter),t.call(this,f)}if(n.colorSpace===b.INDEXED){var c=this.internal.newObject();r({data:S(new Uint8Array(n.palette)),objectId:c}),i("endobj")}},s=function(){var t=this.internal.collections.addImage_images;for(var n in t)e.call(this,t[n])},o=function(){var t,n=this.internal.collections.addImage_images,i=this.internal.write;for(var r in n)i("/I"+(t=n[r]).index,t.objectId,"0","R")},a=function(){this.internal.collections.addImage_images||(this.internal.collections.addImage_images={},this.internal.events.subscribe("putResources",s),this.internal.events.subscribe("putXobjectDict",o))},u=function(){var t=this.internal.collections.addImage_images;return a.call(this),t},f=function(){return Object.keys(this.internal.collections.addImage_images).length},c=function(n){return"function"==typeof t["process"+n.toUpperCase()]},h=function(t){return"object"===l(t)&&1===t.nodeType},v=function(n,i){if("IMG"===n.nodeName&&n.hasAttribute("src")){var r=""+n.getAttribute("src");if(0===r.indexOf("data:image/"))return et(unescape(r).split("base64,").pop());var e=t.loadFile(r,!0);if(void 0!==e)return e}if("CANVAS"===n.nodeName){if(0===n.width||0===n.height)throw new Error("Given canvas must have data. Canvas width: "+n.width+", height: "+n.height);var s;switch(i){case"PNG":s="image/png";break;case"WEBP":s="image/webp";break;default:s="image/jpeg"}return et(n.toDataURL(s,1).split("base64,").pop())}},d=function(t){var n=this.internal.collections.addImage_images;if(n)for(var i in n)if(t===n[i].alias)return n[i]},w=function(t,n,i){return t||n||(t=-96,n=-96),t<0&&(t=-1*i.width*72/t/this.internal.scaleFactor),n<0&&(n=-1*i.height*72/n/this.internal.scaleFactor),0===t&&(t=n*i.width/i.height),0===n&&(n=t*i.height/i.width),[t,n]},m=function(t,n,i,r,e,s){var o=w.call(this,i,r,e),a=this.internal.getCoordinateString,f=this.internal.getVerticalCoordinateString,c=u.call(this);if(i=o[0],r=o[1],c[e.index]=e,s){s*=Math.PI/180;var h=Math.cos(s),l=Math.sin(s),v=function(t){return t.toFixed(4)},d=[v(h),v(l),v(-1*l),v(h),0,0,"cm"]}this.internal.write("q"),s?(this.internal.write([1,"0","0",1,a(t),f(n+r),"cm"].join(" ")),this.internal.write(d.join(" ")),this.internal.write([a(i),"0","0",a(r),"0","0","cm"].join(" "))):this.internal.write([a(i),"0","0",a(r),a(t),f(n+r),"cm"].join(" ")),this.isAdvancedAPI()&&this.internal.write([1,0,0,-1,0,0,"cm"].join(" ")),this.internal.write("/I"+e.index+" Do"),this.internal.write("Q")},b=t.color_spaces={DEVICE_RGB:"DeviceRGB",DEVICE_GRAY:"DeviceGray",DEVICE_CMYK:"DeviceCMYK",CAL_GREY:"CalGray",CAL_RGB:"CalRGB",LAB:"Lab",ICC_BASED:"ICCBased",INDEXED:"Indexed",PATTERN:"Pattern",SEPARATION:"Separation",DEVICE_N:"DeviceN"};t.decode={DCT_DECODE:"DCTDecode",FLATE_DECODE:"FlateDecode",LZW_DECODE:"LZWDecode",JPX_DECODE:"JPXDecode",JBIG2_DECODE:"JBIG2Decode",ASCII85_DECODE:"ASCII85Decode",ASCII_HEX_DECODE:"ASCIIHexDecode",RUN_LENGTH_DECODE:"RunLengthDecode",CCITT_FAX_DECODE:"CCITTFaxDecode"};var p=t.image_compression={NONE:"NONE",FAST:"FAST",MEDIUM:"MEDIUM",SLOW:"SLOW"},N=t.__addimage__.sHashCode=function(t){var n,i,r=0;if("string"==typeof t)for(i=t.length,n=0;n<i;n++)r=(r<<5)-r+t.charCodeAt(n),r|=0;else if(y(t))for(i=t.byteLength/2,n=0;n<i;n++)r=(r<<5)-r+t[n],r|=0;return r},L=t.__addimage__.validateStringAsBase64=function(t){(t=t||"").toString().trim();var n=!0;return 0===t.length&&(n=!1),t.length%4!=0&&(n=!1),!1===/^[A-Za-z0-9+/]+$/.test(t.substr(0,t.length-2))&&(n=!1),!1===/^[A-Za-z0-9/][A-Za-z0-9+/]|[A-Za-z0-9+/]=|==$/.test(t.substr(-2))&&(n=!1),n},g=t.__addimage__.extractImageFromDataUrl=function(t){var n=(t=t||"").split("base64,"),i=null;if(2===n.length){var r=/^data:(\w*\/\w*);*(charset=(?!charset=)[\w=-]*)*;*$/.exec(n[0]);Array.isArray(r)&&(i={mimeType:r[1],charset:r[2],data:n[1]})}return i},A=t.__addimage__.supportsArrayBuffer=function(){return"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array};t.__addimage__.isArrayBuffer=function(t){return A()&&t instanceof ArrayBuffer};var y=t.__addimage__.isArrayBufferView=function(t){return A()&&"undefined"!=typeof Uint32Array&&(t instanceof Int8Array||t instanceof Uint8Array||"undefined"!=typeof Uint8ClampedArray&&t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array||t instanceof Float64Array)},k=t.__addimage__.binaryStringToUint8Array=function(t){for(var n=t.length,i=new Uint8Array(n),r=0;r<n;r++)i[r]=t.charCodeAt(r);return i},S=t.__addimage__.arrayBufferToBinaryString=function(t){for(var n="",i=y(t)?t:new Uint8Array(t),r=0;r<i.length;r+=8192)n+=String.fromCharCode.apply(null,i.subarray(r,r+8192));return n};t.addImage=function(){var t,i,r,e,s,o,u,f,c;if("number"==typeof arguments[1]?(i=n,r=arguments[1],e=arguments[2],s=arguments[3],o=arguments[4],u=arguments[5],f=arguments[6],c=arguments[7]):(i=arguments[1],r=arguments[2],e=arguments[3],s=arguments[4],o=arguments[5],u=arguments[6],f=arguments[7],c=arguments[8]),"object"===l(t=arguments[0])&&!h(t)&&"imageData"in t){var v=t;t=v.imageData,i=v.format||i||n,r=v.x||r||0,e=v.y||e||0,s=v.w||v.width||s,o=v.h||v.height||o,u=v.alias||u,f=v.compression||f,c=v.rotation||v.angle||c}var d=this.internal.getFilters();if(void 0===f&&-1!==d.indexOf("FlateEncode")&&(f="SLOW"),isNaN(r)||isNaN(e))throw new Error("Invalid coordinates passed to jsPDF.addImage");a.call(this);var w=x.call(this,t,i,u,f);return m.call(this,r,e,s,o,w,c),this};var x=function(i,e,s,o){var a,u,l;if("string"==typeof i&&r(i)===n){i=unescape(i);var w=q(i,!1);(""!==w||void 0!==(w=t.loadFile(i,!0)))&&(i=w)}if(h(i)&&(i=v(i,e)),e=r(i,e),!c(e))throw new Error("addImage does not support files of type '"+e+"', please ensure that a plugin for '"+e+"' support is added.");if((null==(l=s)||0===l.length)&&(s=function(t){return"string"==typeof t||y(t)?N(t):y(t.data)?N(t.data):null}(i)),(a=d.call(this,s))||(A()&&(i instanceof Uint8Array||"RGBA"===e||(u=i,i=k(i))),a=this["process"+e.toUpperCase()](i,f.call(this),s,function(n){return n&&"string"==typeof n&&(n=n.toUpperCase()),n in t.image_compression?n:p.NONE}(o),u)),!a)throw new Error("An unknown error occurred whilst processing the image.");return a},q=t.__addimage__.convertBase64ToBinaryString=function(t,n){var i;n="boolean"!=typeof n||n;var r,e="";if("string"==typeof t){r=null!==(i=g(t))?i.data:t;try{e=et(r)}catch(t){if(n)throw L(r)?new Error("atob-Error in jsPDF.convertBase64ToBinaryString "+t.message):new Error("Supplied Data is not a valid base64-String jsPDF.convertBase64ToBinaryString ")}}return e};t.getImageProperties=function(i){var e,s,o="";if(h(i)&&(i=v(i)),"string"==typeof i&&r(i)===n&&(""===(o=q(i,!1))&&(o=t.loadFile(i)||""),i=o),s=r(i),!c(s))throw new Error("addImage does not support files of type '"+s+"', please ensure that a plugin for '"+s+"' support is added.");if(!A()||i instanceof Uint8Array||(i=k(i)),!(e=this["process"+s.toUpperCase()](i)))throw new Error("An unknown error occurred whilst processing the image");return e.fileType=s,e}}(Pt.API),
111
111
  /**
112
112
  * @license
113
113
  * Copyright (c) 2014 Steven Spungin (TwelveTone LLC) steven@twelvetone.tv
@@ -163,7 +163,7 @@ function(t){t.loadFile=function(t,n,i){return function(t,n,i){n=!1!==n,i="functi
163
163
  * Licensed under the MIT License.
164
164
  * http://opensource.org/licenses/mit-license
165
165
  */
166
- Tn=[192,193,194,195,196,197,198,199],Pt.API.processJPEG=function(t,n,i,r,e,s){var o,a=this.decode.DCT_DECODE,u=null;if("string"==typeof t||this.__addimage__.isArrayBuffer(t)||this.__addimage__.isArrayBufferView(t)){switch(t=this.__addimage__.isArrayBuffer(t=e||t)?new Uint8Array(t):t,(o=function(t){for(var n,i=256*t.charCodeAt(4)+t.charCodeAt(5),r=t.length,e={width:0,height:0,numcomponents:1},s=4;s<r;s+=2){if(-1!==Tn.indexOf(t.charCodeAt((s+=i)+1))){n=256*t.charCodeAt(s+5)+t.charCodeAt(s+6),e={width:256*t.charCodeAt(s+7)+t.charCodeAt(s+8),height:n,numcomponents:t.charCodeAt(s+9)};break}i=256*t.charCodeAt(s+2)+t.charCodeAt(s+3)}return e}(t=this.__addimage__.isArrayBufferView(t)?this.__addimage__.arrayBufferToBinaryString(t):t)).numcomponents){case 1:s=this.color_spaces.DEVICE_GRAY;break;case 4:s=this.color_spaces.DEVICE_CMYK;break;case 3:s=this.color_spaces.DEVICE_RGB}u={data:t,width:o.width,height:o.height,colorSpace:s,bitsPerComponent:8,filter:a,index:n,alias:i}}return u};var Dn,zn,Un,Vn,Wn,Hn=function(){var t,n,i;function r(t){var n,i,r,e,s,o,a,u,f,c,h,l,v;for(this.data=t,this.pos=8,this.palette=[],this.imgData=[],this.transparency={},this.animation=null,this.text={},s=null;;){switch(n=this.readUInt32(),u=function(){var t,n;for(n=[],t=0;t<4;++t)n.push(String.fromCharCode(this.data[this.pos++]));return n}.call(this).join("")){case"IHDR":this.width=this.readUInt32(),this.height=this.readUInt32(),this.bits=this.data[this.pos++],this.colorType=this.data[this.pos++],this.compressionMethod=this.data[this.pos++],this.filterMethod=this.data[this.pos++],this.interlaceMethod=this.data[this.pos++];break;case"acTL":this.animation={numFrames:this.readUInt32(),numPlays:this.readUInt32()||1/0,frames:[]};break;case"PLTE":this.palette=this.read(n);break;case"fcTL":s&&this.animation.frames.push(s),this.pos+=4,s={width:this.readUInt32(),height:this.readUInt32(),xOffset:this.readUInt32(),yOffset:this.readUInt32()},e=this.readUInt16(),r=this.readUInt16()||100,s.delay=1e3*e/r,s.disposeOp=this.data[this.pos++],s.blendOp=this.data[this.pos++],s.data=[];break;case"IDAT":case"fdAT":for("fdAT"===u&&(this.pos+=4,n-=4),t=(null!=s?s.data:void 0)||this.imgData,h=0;0<=n?h<n:h>n;0<=n?++h:--h)t.push(this.data[this.pos++]);break;case"tRNS":switch(this.transparency={},this.colorType){case 3:if(i=this.palette.length/3,this.transparency.indexed=this.read(n),this.transparency.indexed.length>i)throw new Error("More transparent colors than palette size");if((f=i-this.transparency.indexed.length)>0)for(l=0;0<=f?l<f:l>f;0<=f?++l:--l)this.transparency.indexed.push(255);break;case 0:this.transparency.grayscale=this.read(n)[0];break;case 2:this.transparency.rgb=this.read(n)}break;case"tEXt":o=(c=this.read(n)).indexOf(0),a=String.fromCharCode.apply(String,c.slice(0,o)),this.text[a]=String.fromCharCode.apply(String,c.slice(o+1));break;case"IEND":return s&&this.animation.frames.push(s),this.colors=function(){switch(this.colorType){case 0:case 3:case 4:return 1;case 2:case 6:return 3}}.call(this),this.hasAlphaChannel=4===(v=this.colorType)||6===v,this.pixelBitlength=this.bits*(this.colors+(this.hasAlphaChannel?1:0)),this.colorSpace=function(){switch(this.colors){case 1:return"DeviceGray";case 3:return"DeviceRGB"}}.call(this),void(this.imgData=new Uint8Array(this.imgData));default:this.pos+=n}if(this.pos+=4,this.pos>this.data.length)throw new Error("Incomplete or corrupt PNG file")}}r.prototype.read=function(t){var n,i;for(i=[],n=0;0<=t?n<t:n>t;0<=t?++n:--n)i.push(this.data[this.pos++]);return i},r.prototype.readUInt32=function(){return this.data[this.pos++]<<24|this.data[this.pos++]<<16|this.data[this.pos++]<<8|this.data[this.pos++]},r.prototype.readUInt16=function(){return this.data[this.pos++]<<8|this.data[this.pos++]},r.prototype.decodePixels=function(t){var n,i,r=this.pixelBitlength/8,e=new Uint8Array(this.width*this.height*r),s=0,o=this;if(null==t&&(t=this.imgData),0===t.length)return new Uint8Array(0);function a(n,i,a,u){var f,c,h,l,v,d,w,m,b,p,N,L,g,A,y,k,S,x,q,j,M=Math.ceil((o.width-n)/a),E=Math.ceil((o.height-i)/u),P=o.width==M&&o.height==E;for(g=r*M,N=P?e:new Uint8Array(g*E),d=t.length,L=0,c=0;L<E&&s<d;){switch(t[s++]){case 0:for(l=k=0;k<g;l=k+=1)N[c++]=t[s++];break;case 1:for(l=S=0;S<g;l=S+=1)f=t[s++],v=l<r?0:N[c-r],N[c++]=(f+v)%256;break;case 2:for(l=x=0;x<g;l=x+=1)f=t[s++],h=(l-l%r)/r,N[c++]=((A=L&&N[(L-1)*g+h*r+l%r])+f)%256;break;case 3:for(l=q=0;q<g;l=q+=1)f=t[s++],h=(l-l%r)/r,v=l<r?0:N[c-r],A=L&&N[(L-1)*g+h*r+l%r],N[c++]=(f+Math.floor((v+A)/2))%256;break;case 4:for(l=j=0;j<g;l=j+=1)f=t[s++],h=(l-l%r)/r,0===L?A=y=0:(A=N[(L-1)*g+h*r+l%r],y=h&&N[(L-1)*g+(h-1)*r+l%r]),w=(v=l<r?0:N[c-r])+A-y,m=Math.abs(w-v),b=Math.abs(w-A),p=Math.abs(w-y),N[c++]=(f+(m<=b&&m<=p?v:b<=p?A:y))%256;break;default:throw new Error("Invalid filter algorithm: "+t[s-1])}if(!P){var O=((i+L*u)*o.width+n)*r,I=L*g;for(l=0;l<M;l+=1){for(var F=0;F<r;F+=1)e[O++]=N[I++];O+=(a-1)*r}}L++}}return t=function(t,n,i){var r=t.length,e=!n||i,s=!i||i.i;i||(i={}),n||(n=new v(3*r));var o=function(t){var i=n.length;if(t>i){var r=new v(Math.max(2*i,t));r.set(n),n=r}},a=i.f||0,u=i.p||0,f=i.b||0,c=i.l,h=i.d,l=i.m,d=i.n,w=8*r;do{if(!c){i.f=a=T(t,u,1);var N=T(t,u+1,3);if(u+=3,!N){var L=t[(U=D(u)+4)-4]|t[U-3]<<8,A=U+L;if(A>r){if(s)throw"unexpected EOF";break}e&&o(f+L),n.set(t.subarray(U,A),f),i.b=f+=L,i.p=u=8*A;continue}if(1==N)c=I,h=B,l=9,d=5;else{if(2!=N)throw"invalid block type";var y=T(t,u,31)+257,S=T(t,u+10,15)+4,x=y+T(t,u+5,31)+1;u+=14;for(var q=new v(x),j=new v(19),E=0;E<S;++E)j[p[E]]=T(t,u+3*E,7);u+=3*S;var P=R(j),O=(1<<P)-1;if(!s&&u+x*(P+7)>w)break;var F=M(j,P,1);for(E=0;E<x;){var U,V=F[T(t,u,O)];if(u+=15&V,(U=V>>>4)<16)q[E++]=U;else{var W=0,H=0;for(16==U?(H=3+T(t,u,3),u+=2,W=q[E-1]):17==U?(H=3+T(t,u,7),u+=3):18==U&&(H=11+T(t,u,127),u+=7);H--;)q[E++]=W}}var _=q.subarray(0,y),G=q.subarray(y);l=R(_),d=R(G),c=M(_,l,1),h=M(G,d,1)}if(u>w)throw"unexpected EOF"}e&&o(f+131072);for(var J=(1<<l)-1,Y=(1<<d)-1,$=l+d+18;s||u+$<w;){var K=(W=c[C(t,u)&J])>>>4;if((u+=15&W)>w)throw"unexpected EOF";if(!W)throw"invalid length/literal";if(K<256)n[f++]=K;else{if(256==K){c=null;break}var X=K-254;K>264&&(X=T(t,u,(1<<(tt=m[E=K-257]))-1)+g[E],u+=tt);var Z=h[C(t,u)&Y],Q=Z>>>4;if(!Z)throw"invalid distance";if(u+=15&Z,G=k[Q],Q>3){var tt=b[Q];G+=C(t,u)&(1<<tt)-1,u+=tt}if(u>w)throw"unexpected EOF";e&&o(f+131072);for(var nt=f+X;f<nt;f+=4)n[f]=n[f-G],n[f+1]=n[f+1-G],n[f+2]=n[f+2-G],n[f+3]=n[f+3-G];f=nt}}i.l=c,i.p=u,i.b=f,c&&(a=1,i.m=l,i.d=h,i.n=d)}while(!a);return f==n.length?n:z(n,0,f)}((function(t){if(8!=(15&t[0])||t[0]>>>4>7||(t[0]<<8|t[1])%31)throw"invalid zlib data";if(32&t[1])throw"invalid zlib data: preset dictionaries not supported"}(n=t),n.subarray(2,-4)),i),1==o.interlaceMethod?(a(0,0,8,8),a(4,0,8,8),a(0,4,4,8),a(2,0,4,4),a(0,2,2,4),a(1,0,2,2),a(0,1,1,2)):a(0,0,1,1),e},r.prototype.decodePalette=function(){var t,n,i,r,e,s,o,a,u;for(i=this.palette,s=this.transparency.indexed||[],e=new Uint8Array((s.length||0)+i.length),r=0,t=0,n=o=0,a=i.length;o<a;n=o+=3)e[r++]=i[n],e[r++]=i[n+1],e[r++]=i[n+2],e[r++]=null!=(u=s[t++])?u:255;return e},r.prototype.copyToImageData=function(t,n){var i,r,e,s,o,a,u,f,c,h,l;if(r=this.colors,c=null,i=this.hasAlphaChannel,this.palette.length&&(c=null!=(l=this._decodedPalette)?l:this._decodedPalette=this.decodePalette(),r=4,i=!0),f=(e=t.data||t).length,o=c||n,s=a=0,1===r)for(;s<f;)u=c?4*n[s/4]:a,h=o[u++],e[s++]=h,e[s++]=h,e[s++]=h,e[s++]=i?o[u++]:255,a=u;else for(;s<f;)u=c?4*n[s/4]:a,e[s++]=o[u++],e[s++]=o[u++],e[s++]=o[u++],e[s++]=i?o[u++]:255,a=u},r.prototype.decode=function(){var t;return t=new Uint8Array(this.width*this.height*4),this.copyToImageData(t,this.decodePixels()),t};var e=function(){if("[object Window]"===Object.prototype.toString.call(Z)){try{n=Z.document.createElement("canvas"),i=n.getContext("2d")}catch(t){return!1}return!0}return!1};return e(),t=function(t){var r;if(!0===e())return i.width=t.width,i.height=t.height,i.clearRect(0,0,t.width,t.height),i.putImageData(t,0,0),(r=new Image).src=n.toDataURL(),r;throw new Error("This method requires a Browser with Canvas-capability.")},r.prototype.decodeFrames=function(n){var i,r,e,s,o,a,u,f;if(this.animation){for(f=[],r=o=0,a=(u=this.animation.frames).length;o<a;r=++o)e=n.createImageData((i=u[r]).width,i.height),s=this.decodePixels(new Uint8Array(i.data)),this.copyToImageData(e,s),i.imageData=e,f.push(i.image=t(e));return f}},r.prototype.renderFrame=function(t,n){var i,r,e;return i=(r=this.animation.frames)[n],e=r[n-1],0===n&&t.clearRect(0,0,this.width,this.height),1===(null!=e?e.disposeOp:void 0)?t.clearRect(e.xOffset,e.yOffset,e.width,e.height):2===(null!=e?e.disposeOp:void 0)&&t.putImageData(e.imageData,e.xOffset,e.yOffset),0===i.blendOp&&t.clearRect(i.xOffset,i.yOffset,i.width,i.height),t.drawImage(i.image,i.xOffset,i.yOffset)},r.prototype.animate=function(t){var n,i,r,e,s,o,a=this;return i=0,e=(o=this.animation).numFrames,r=o.frames,s=o.numPlays,(n=function(){var o,u;if(o=i++%e,u=r[o],a.renderFrame(t,o),e>1&&i/e<s)return a.animation._timeout=setTimeout(n,u.delay)})()},r.prototype.stopAnimation=function(){var t;return clearTimeout(null!=(t=this.animation)?t._timeout:void 0)},r.prototype.render=function(t){var n,i;return t._png&&t._png.stopAnimation(),t._png=this,t.width=this.width,t.height=this.height,n=t.getContext("2d"),this.animation?(this.decodeFrames(n),this.animate(n)):(i=n.createImageData(this.width,this.height),this.copyToImageData(i,this.decodePixels()),n.putImageData(i,0,0))},r}();
166
+ Tn=[192,193,194,195,196,197,198,199],Pt.API.processJPEG=function(t,n,i,r,e,s){var o,a=this.decode.DCT_DECODE,u=null;if("string"==typeof t||this.__addimage__.isArrayBuffer(t)||this.__addimage__.isArrayBufferView(t)){switch(t=this.__addimage__.isArrayBuffer(t=e||t)?new Uint8Array(t):t,(o=function(t){for(var n,i=256*t.charCodeAt(4)+t.charCodeAt(5),r=t.length,e={width:0,height:0,numcomponents:1},s=4;s<r;s+=2){if(-1!==Tn.indexOf(t.charCodeAt((s+=i)+1))){n=256*t.charCodeAt(s+5)+t.charCodeAt(s+6),e={width:256*t.charCodeAt(s+7)+t.charCodeAt(s+8),height:n,numcomponents:t.charCodeAt(s+9)};break}i=256*t.charCodeAt(s+2)+t.charCodeAt(s+3)}return e}(t=this.__addimage__.isArrayBufferView(t)?this.__addimage__.arrayBufferToBinaryString(t):t)).numcomponents){case 1:s=this.color_spaces.DEVICE_GRAY;break;case 4:s=this.color_spaces.DEVICE_CMYK;break;case 3:s=this.color_spaces.DEVICE_RGB}u={data:t,width:o.width,height:o.height,colorSpace:s,bitsPerComponent:8,filter:a,index:n,alias:i}}return u};var Dn,zn,Un,Vn,Wn,_n=function(){var t,n,i;function r(t){var n,i,r,e,s,o,a,u,f,c,h,l,v;for(this.data=t,this.pos=8,this.palette=[],this.imgData=[],this.transparency={},this.animation=null,this.text={},s=null;;){switch(n=this.readUInt32(),u=function(){var t,n;for(n=[],t=0;t<4;++t)n.push(String.fromCharCode(this.data[this.pos++]));return n}.call(this).join("")){case"IHDR":this.width=this.readUInt32(),this.height=this.readUInt32(),this.bits=this.data[this.pos++],this.colorType=this.data[this.pos++],this.compressionMethod=this.data[this.pos++],this.filterMethod=this.data[this.pos++],this.interlaceMethod=this.data[this.pos++];break;case"acTL":this.animation={numFrames:this.readUInt32(),numPlays:this.readUInt32()||1/0,frames:[]};break;case"PLTE":this.palette=this.read(n);break;case"fcTL":s&&this.animation.frames.push(s),this.pos+=4,s={width:this.readUInt32(),height:this.readUInt32(),xOffset:this.readUInt32(),yOffset:this.readUInt32()},e=this.readUInt16(),r=this.readUInt16()||100,s.delay=1e3*e/r,s.disposeOp=this.data[this.pos++],s.blendOp=this.data[this.pos++],s.data=[];break;case"IDAT":case"fdAT":for("fdAT"===u&&(this.pos+=4,n-=4),t=(null!=s?s.data:void 0)||this.imgData,h=0;0<=n?h<n:h>n;0<=n?++h:--h)t.push(this.data[this.pos++]);break;case"tRNS":switch(this.transparency={},this.colorType){case 3:if(i=this.palette.length/3,this.transparency.indexed=this.read(n),this.transparency.indexed.length>i)throw new Error("More transparent colors than palette size");if((f=i-this.transparency.indexed.length)>0)for(l=0;0<=f?l<f:l>f;0<=f?++l:--l)this.transparency.indexed.push(255);break;case 0:this.transparency.grayscale=this.read(n)[0];break;case 2:this.transparency.rgb=this.read(n)}break;case"tEXt":o=(c=this.read(n)).indexOf(0),a=String.fromCharCode.apply(String,c.slice(0,o)),this.text[a]=String.fromCharCode.apply(String,c.slice(o+1));break;case"IEND":return s&&this.animation.frames.push(s),this.colors=function(){switch(this.colorType){case 0:case 3:case 4:return 1;case 2:case 6:return 3}}.call(this),this.hasAlphaChannel=4===(v=this.colorType)||6===v,this.pixelBitlength=this.bits*(this.colors+(this.hasAlphaChannel?1:0)),this.colorSpace=function(){switch(this.colors){case 1:return"DeviceGray";case 3:return"DeviceRGB"}}.call(this),void(this.imgData=new Uint8Array(this.imgData));default:this.pos+=n}if(this.pos+=4,this.pos>this.data.length)throw new Error("Incomplete or corrupt PNG file")}}r.prototype.read=function(t){var n,i;for(i=[],n=0;0<=t?n<t:n>t;0<=t?++n:--n)i.push(this.data[this.pos++]);return i},r.prototype.readUInt32=function(){return this.data[this.pos++]<<24|this.data[this.pos++]<<16|this.data[this.pos++]<<8|this.data[this.pos++]},r.prototype.readUInt16=function(){return this.data[this.pos++]<<8|this.data[this.pos++]},r.prototype.decodePixels=function(t){var n,i,r=this.pixelBitlength/8,e=new Uint8Array(this.width*this.height*r),s=0,o=this;if(null==t&&(t=this.imgData),0===t.length)return new Uint8Array(0);function a(n,i,a,u){var f,c,h,l,v,d,w,m,b,p,N,L,g,A,y,k,S,x,q,j,M=Math.ceil((o.width-n)/a),E=Math.ceil((o.height-i)/u),P=o.width==M&&o.height==E;for(g=r*M,N=P?e:new Uint8Array(g*E),d=t.length,L=0,c=0;L<E&&s<d;){switch(t[s++]){case 0:for(l=k=0;k<g;l=k+=1)N[c++]=t[s++];break;case 1:for(l=S=0;S<g;l=S+=1)f=t[s++],v=l<r?0:N[c-r],N[c++]=(f+v)%256;break;case 2:for(l=x=0;x<g;l=x+=1)f=t[s++],h=(l-l%r)/r,N[c++]=((A=L&&N[(L-1)*g+h*r+l%r])+f)%256;break;case 3:for(l=q=0;q<g;l=q+=1)f=t[s++],h=(l-l%r)/r,v=l<r?0:N[c-r],A=L&&N[(L-1)*g+h*r+l%r],N[c++]=(f+Math.floor((v+A)/2))%256;break;case 4:for(l=j=0;j<g;l=j+=1)f=t[s++],h=(l-l%r)/r,0===L?A=y=0:(A=N[(L-1)*g+h*r+l%r],y=h&&N[(L-1)*g+(h-1)*r+l%r]),w=(v=l<r?0:N[c-r])+A-y,m=Math.abs(w-v),b=Math.abs(w-A),p=Math.abs(w-y),N[c++]=(f+(m<=b&&m<=p?v:b<=p?A:y))%256;break;default:throw new Error("Invalid filter algorithm: "+t[s-1])}if(!P){var O=((i+L*u)*o.width+n)*r,I=L*g;for(l=0;l<M;l+=1){for(var F=0;F<r;F+=1)e[O++]=N[I++];O+=(a-1)*r}}L++}}return t=function(t,n,i){var r=t.length,e=!n||i,s=!i||i.i;i||(i={}),n||(n=new v(3*r));var o=function(t){var i=n.length;if(t>i){var r=new v(Math.max(2*i,t));r.set(n),n=r}},a=i.f||0,u=i.p||0,f=i.b||0,c=i.l,h=i.d,l=i.m,d=i.n,w=8*r;do{if(!c){i.f=a=T(t,u,1);var N=T(t,u+1,3);if(u+=3,!N){var L=t[(U=D(u)+4)-4]|t[U-3]<<8,A=U+L;if(A>r){if(s)throw"unexpected EOF";break}e&&o(f+L),n.set(t.subarray(U,A),f),i.b=f+=L,i.p=u=8*A;continue}if(1==N)c=I,h=B,l=9,d=5;else{if(2!=N)throw"invalid block type";var y=T(t,u,31)+257,S=T(t,u+10,15)+4,x=y+T(t,u+5,31)+1;u+=14;for(var q=new v(x),j=new v(19),E=0;E<S;++E)j[p[E]]=T(t,u+3*E,7);u+=3*S;var P=R(j),O=(1<<P)-1;if(!s&&u+x*(P+7)>w)break;var F=M(j,P,1);for(E=0;E<x;){var U,V=F[T(t,u,O)];if(u+=15&V,(U=V>>>4)<16)q[E++]=U;else{var W=0,_=0;for(16==U?(_=3+T(t,u,3),u+=2,W=q[E-1]):17==U?(_=3+T(t,u,7),u+=3):18==U&&(_=11+T(t,u,127),u+=7);_--;)q[E++]=W}}var H=q.subarray(0,y),G=q.subarray(y);l=R(H),d=R(G),c=M(H,l,1),h=M(G,d,1)}if(u>w)throw"unexpected EOF"}e&&o(f+131072);for(var J=(1<<l)-1,Y=(1<<d)-1,$=l+d+18;s||u+$<w;){var K=(W=c[C(t,u)&J])>>>4;if((u+=15&W)>w)throw"unexpected EOF";if(!W)throw"invalid length/literal";if(K<256)n[f++]=K;else{if(256==K){c=null;break}var X=K-254;K>264&&(X=T(t,u,(1<<(tt=m[E=K-257]))-1)+g[E],u+=tt);var Z=h[C(t,u)&Y],Q=Z>>>4;if(!Z)throw"invalid distance";if(u+=15&Z,G=k[Q],Q>3){var tt=b[Q];G+=C(t,u)&(1<<tt)-1,u+=tt}if(u>w)throw"unexpected EOF";e&&o(f+131072);for(var nt=f+X;f<nt;f+=4)n[f]=n[f-G],n[f+1]=n[f+1-G],n[f+2]=n[f+2-G],n[f+3]=n[f+3-G];f=nt}}i.l=c,i.p=u,i.b=f,c&&(a=1,i.m=l,i.d=h,i.n=d)}while(!a);return f==n.length?n:z(n,0,f)}((function(t){if(8!=(15&t[0])||t[0]>>>4>7||(t[0]<<8|t[1])%31)throw"invalid zlib data";if(32&t[1])throw"invalid zlib data: preset dictionaries not supported"}(n=t),n.subarray(2,-4)),i),1==o.interlaceMethod?(a(0,0,8,8),a(4,0,8,8),a(0,4,4,8),a(2,0,4,4),a(0,2,2,4),a(1,0,2,2),a(0,1,1,2)):a(0,0,1,1),e},r.prototype.decodePalette=function(){var t,n,i,r,e,s,o,a,u;for(i=this.palette,s=this.transparency.indexed||[],e=new Uint8Array((s.length||0)+i.length),r=0,t=0,n=o=0,a=i.length;o<a;n=o+=3)e[r++]=i[n],e[r++]=i[n+1],e[r++]=i[n+2],e[r++]=null!=(u=s[t++])?u:255;return e},r.prototype.copyToImageData=function(t,n){var i,r,e,s,o,a,u,f,c,h,l;if(r=this.colors,c=null,i=this.hasAlphaChannel,this.palette.length&&(c=null!=(l=this._decodedPalette)?l:this._decodedPalette=this.decodePalette(),r=4,i=!0),f=(e=t.data||t).length,o=c||n,s=a=0,1===r)for(;s<f;)u=c?4*n[s/4]:a,h=o[u++],e[s++]=h,e[s++]=h,e[s++]=h,e[s++]=i?o[u++]:255,a=u;else for(;s<f;)u=c?4*n[s/4]:a,e[s++]=o[u++],e[s++]=o[u++],e[s++]=o[u++],e[s++]=i?o[u++]:255,a=u},r.prototype.decode=function(){var t;return t=new Uint8Array(this.width*this.height*4),this.copyToImageData(t,this.decodePixels()),t};var e=function(){if("[object Window]"===Object.prototype.toString.call(Z)){try{n=Z.document.createElement("canvas"),i=n.getContext("2d")}catch(t){return!1}return!0}return!1};return e(),t=function(t){var r;if(!0===e())return i.width=t.width,i.height=t.height,i.clearRect(0,0,t.width,t.height),i.putImageData(t,0,0),(r=new Image).src=n.toDataURL(),r;throw new Error("This method requires a Browser with Canvas-capability.")},r.prototype.decodeFrames=function(n){var i,r,e,s,o,a,u,f;if(this.animation){for(f=[],r=o=0,a=(u=this.animation.frames).length;o<a;r=++o)e=n.createImageData((i=u[r]).width,i.height),s=this.decodePixels(new Uint8Array(i.data)),this.copyToImageData(e,s),i.imageData=e,f.push(i.image=t(e));return f}},r.prototype.renderFrame=function(t,n){var i,r,e;return i=(r=this.animation.frames)[n],e=r[n-1],0===n&&t.clearRect(0,0,this.width,this.height),1===(null!=e?e.disposeOp:void 0)?t.clearRect(e.xOffset,e.yOffset,e.width,e.height):2===(null!=e?e.disposeOp:void 0)&&t.putImageData(e.imageData,e.xOffset,e.yOffset),0===i.blendOp&&t.clearRect(i.xOffset,i.yOffset,i.width,i.height),t.drawImage(i.image,i.xOffset,i.yOffset)},r.prototype.animate=function(t){var n,i,r,e,s,o,a=this;return i=0,e=(o=this.animation).numFrames,r=o.frames,s=o.numPlays,(n=function(){var o,u;if(o=i++%e,u=r[o],a.renderFrame(t,o),e>1&&i/e<s)return a.animation._timeout=setTimeout(n,u.delay)})()},r.prototype.stopAnimation=function(){var t;return clearTimeout(null!=(t=this.animation)?t._timeout:void 0)},r.prototype.render=function(t){var n,i;return t._png&&t._png.stopAnimation(),t._png=this,t.width=this.width,t.height=this.height,n=t.getContext("2d"),this.animation?(this.decodeFrames(n),this.animate(n)):(i=n.createImageData(this.width,this.height),this.copyToImageData(i,this.decodePixels()),n.putImageData(i,0,0))},r}();
167
167
  /**
168
168
  * @license
169
169
  *
@@ -216,7 +216,7 @@ Tn=[192,193,194,195,196,197,198,199],Pt.API.processJPEG=function(t,n,i,r,e,s){va
216
216
  * omggif is a JavaScript implementation of a GIF 89a encoder and decoder,
217
217
  * including animation and compression. It does not rely on any specific
218
218
  * underlying system, so should run in the browser, Node, or Plask.
219
- */function _n(t){var n=0;if(71!==t[n++]||73!==t[n++]||70!==t[n++]||56!==t[n++]||56!=(t[n++]+1&253)||97!==t[n++])throw new Error("Invalid GIF 87a/89a header.");var i=t[n++]|t[n++]<<8,r=t[n++]|t[n++]<<8,e=t[n++],s=1<<1+(7&e);n++,n++;var o=null,a=null;e>>7&&(o=n,a=s,n+=3*s);var u=!0,f=[],c=0,h=null,l=0,v=null;for(this.width=i,this.height=r;u&&n<t.length;)switch(t[n++]){case 33:switch(t[n++]){case 255:if(11!==t[n]||78==t[n+1]&&69==t[n+2]&&84==t[n+3]&&83==t[n+4]&&67==t[n+5]&&65==t[n+6]&&80==t[n+7]&&69==t[n+8]&&50==t[n+9]&&46==t[n+10]&&48==t[n+11]&&3==t[n+12]&&1==t[n+13]&&0==t[n+16])n+=14,v=t[n++]|t[n++]<<8,n++;else for(n+=12;;){if(!((x=t[n++])>=0))throw Error("Invalid block size");if(0===x)break;n+=x}break;case 249:if(4!==t[n++]||0!==t[n+4])throw new Error("Invalid graphics extension block.");var d=t[n++];c=t[n++]|t[n++]<<8,h=t[n++],0==(1&d)&&(h=null),l=d>>2&7,n++;break;case 254:for(;;){if(!((x=t[n++])>=0))throw Error("Invalid block size");if(0===x)break;n+=x}break;default:throw new Error("Unknown graphic control label: 0x"+t[n-1].toString(16))}break;case 44:var w=t[n++]|t[n++]<<8,m=t[n++]|t[n++]<<8,b=t[n++]|t[n++]<<8,p=t[n++]|t[n++]<<8,N=t[n++],L=N>>6&1,g=1<<1+(7&N),A=o,y=a,k=!1;N>>7&&(k=!0,A=n,y=g,n+=3*g);var S=n;for(n++;;){var x;if(!((x=t[n++])>=0))throw Error("Invalid block size");if(0===x)break;n+=x}f.push({x:w,y:m,width:b,height:p,has_local_palette:k,palette_offset:A,palette_size:y,data_offset:S,data_length:n-S,transparent_index:h,interlaced:!!L,delay:c,disposal:l});break;case 59:u=!1;break;default:throw new Error("Unknown gif block: 0x"+t[n-1].toString(16))}this.numFrames=function(){return f.length},this.loopCount=function(){return v},this.frameInfo=function(t){if(t<0||t>=f.length)throw new Error("Frame index out of range.");return f[t]},this.decodeAndBlitFrameBGRA=function(n,r){var e=this.frameInfo(n),s=e.width*e.height,o=new Uint8Array(s);Gn(t,e.data_offset,o,s);var a=e.palette_offset,u=e.transparent_index;null===u&&(u=256);var f=e.width,c=i-f,h=f,l=4*(e.y*i+e.x),v=4*((e.y+e.height)*i+e.x),d=l,w=4*c;!0===e.interlaced&&(w+=4*i*7);for(var m=8,b=0,p=o.length;b<p;++b){var N=o[b];if(0===h&&(h=f,(d+=w)>=v&&(w=4*c+4*i*(m-1),d=l+(f+c)*(m<<1),m>>=1)),N===u)d+=4;else{var L=t[a+3*N],g=t[a+3*N+1];r[d++]=t[a+3*N+2],r[d++]=g,r[d++]=L,r[d++]=255}--h}},this.decodeAndBlitFrameRGBA=function(n,r){var e=this.frameInfo(n),s=e.width*e.height,o=new Uint8Array(s);Gn(t,e.data_offset,o,s);var a=e.palette_offset,u=e.transparent_index;null===u&&(u=256);var f=e.width,c=i-f,h=f,l=4*(e.y*i+e.x),v=4*((e.y+e.height)*i+e.x),d=l,w=4*c;!0===e.interlaced&&(w+=4*i*7);for(var m=8,b=0,p=o.length;b<p;++b){var N=o[b];if(0===h&&(h=f,(d+=w)>=v&&(w=4*c+4*i*(m-1),d=l+(f+c)*(m<<1),m>>=1)),N===u)d+=4;else{var L=t[a+3*N+1],g=t[a+3*N+2];r[d++]=t[a+3*N],r[d++]=L,r[d++]=g,r[d++]=255}--h}}}function Gn(t,n,i,r){for(var e=t[n++],s=1<<e,o=s+1,a=o+1,u=e+1,f=(1<<u)-1,c=0,h=0,l=0,v=t[n++],d=new Int32Array(4096),w=null;;){for(;c<16&&0!==v;)h|=t[n++]<<c,c+=8,1===v?v=t[n++]:--v;if(c<u)break;var m=h&f;if(h>>=u,c-=u,m!==s){if(m===o)break;for(var b=m<a?m:w,p=0,N=b;N>s;)N=d[N]>>8,++p;var L=N;if(l+p+(b!==m?1:0)>r)return void tt.log("Warning, gif stream longer than expected.");i[l++]=L;var g=l+=p;for(b!==m&&(i[l++]=L),N=b;p--;)i[--g]=255&(N=d[N]),N>>=8;null!==w&&a<4096&&(d[a++]=w<<8|L,a>=f+1&&u<12&&(++u,f=f<<1|1)),w=m}else a=o+1,f=(1<<(u=e+1))-1,w=null}return l!==r&&tt.log("Warning, gif stream shorter than expected."),i}
219
+ */function Hn(t){var n=0;if(71!==t[n++]||73!==t[n++]||70!==t[n++]||56!==t[n++]||56!=(t[n++]+1&253)||97!==t[n++])throw new Error("Invalid GIF 87a/89a header.");var i=t[n++]|t[n++]<<8,r=t[n++]|t[n++]<<8,e=t[n++],s=1<<1+(7&e);n++,n++;var o=null,a=null;e>>7&&(o=n,a=s,n+=3*s);var u=!0,f=[],c=0,h=null,l=0,v=null;for(this.width=i,this.height=r;u&&n<t.length;)switch(t[n++]){case 33:switch(t[n++]){case 255:if(11!==t[n]||78==t[n+1]&&69==t[n+2]&&84==t[n+3]&&83==t[n+4]&&67==t[n+5]&&65==t[n+6]&&80==t[n+7]&&69==t[n+8]&&50==t[n+9]&&46==t[n+10]&&48==t[n+11]&&3==t[n+12]&&1==t[n+13]&&0==t[n+16])n+=14,v=t[n++]|t[n++]<<8,n++;else for(n+=12;;){if(!((x=t[n++])>=0))throw Error("Invalid block size");if(0===x)break;n+=x}break;case 249:if(4!==t[n++]||0!==t[n+4])throw new Error("Invalid graphics extension block.");var d=t[n++];c=t[n++]|t[n++]<<8,h=t[n++],0==(1&d)&&(h=null),l=d>>2&7,n++;break;case 254:for(;;){if(!((x=t[n++])>=0))throw Error("Invalid block size");if(0===x)break;n+=x}break;default:throw new Error("Unknown graphic control label: 0x"+t[n-1].toString(16))}break;case 44:var w=t[n++]|t[n++]<<8,m=t[n++]|t[n++]<<8,b=t[n++]|t[n++]<<8,p=t[n++]|t[n++]<<8,N=t[n++],L=N>>6&1,g=1<<1+(7&N),A=o,y=a,k=!1;N>>7&&(k=!0,A=n,y=g,n+=3*g);var S=n;for(n++;;){var x;if(!((x=t[n++])>=0))throw Error("Invalid block size");if(0===x)break;n+=x}f.push({x:w,y:m,width:b,height:p,has_local_palette:k,palette_offset:A,palette_size:y,data_offset:S,data_length:n-S,transparent_index:h,interlaced:!!L,delay:c,disposal:l});break;case 59:u=!1;break;default:throw new Error("Unknown gif block: 0x"+t[n-1].toString(16))}this.numFrames=function(){return f.length},this.loopCount=function(){return v},this.frameInfo=function(t){if(t<0||t>=f.length)throw new Error("Frame index out of range.");return f[t]},this.decodeAndBlitFrameBGRA=function(n,r){var e=this.frameInfo(n),s=e.width*e.height,o=new Uint8Array(s);Gn(t,e.data_offset,o,s);var a=e.palette_offset,u=e.transparent_index;null===u&&(u=256);var f=e.width,c=i-f,h=f,l=4*(e.y*i+e.x),v=4*((e.y+e.height)*i+e.x),d=l,w=4*c;!0===e.interlaced&&(w+=4*i*7);for(var m=8,b=0,p=o.length;b<p;++b){var N=o[b];if(0===h&&(h=f,(d+=w)>=v&&(w=4*c+4*i*(m-1),d=l+(f+c)*(m<<1),m>>=1)),N===u)d+=4;else{var L=t[a+3*N],g=t[a+3*N+1];r[d++]=t[a+3*N+2],r[d++]=g,r[d++]=L,r[d++]=255}--h}},this.decodeAndBlitFrameRGBA=function(n,r){var e=this.frameInfo(n),s=e.width*e.height,o=new Uint8Array(s);Gn(t,e.data_offset,o,s);var a=e.palette_offset,u=e.transparent_index;null===u&&(u=256);var f=e.width,c=i-f,h=f,l=4*(e.y*i+e.x),v=4*((e.y+e.height)*i+e.x),d=l,w=4*c;!0===e.interlaced&&(w+=4*i*7);for(var m=8,b=0,p=o.length;b<p;++b){var N=o[b];if(0===h&&(h=f,(d+=w)>=v&&(w=4*c+4*i*(m-1),d=l+(f+c)*(m<<1),m>>=1)),N===u)d+=4;else{var L=t[a+3*N+1],g=t[a+3*N+2];r[d++]=t[a+3*N],r[d++]=L,r[d++]=g,r[d++]=255}--h}}}function Gn(t,n,i,r){for(var e=t[n++],s=1<<e,o=s+1,a=o+1,u=e+1,f=(1<<u)-1,c=0,h=0,l=0,v=t[n++],d=new Int32Array(4096),w=null;;){for(;c<16&&0!==v;)h|=t[n++]<<c,c+=8,1===v?v=t[n++]:--v;if(c<u)break;var m=h&f;if(h>>=u,c-=u,m!==s){if(m===o)break;for(var b=m<a?m:w,p=0,N=b;N>s;)N=d[N]>>8,++p;var L=N;if(l+p+(b!==m?1:0)>r)return void tt.log("Warning, gif stream longer than expected.");i[l++]=L;var g=l+=p;for(b!==m&&(i[l++]=L),N=b;p--;)i[--g]=255&(N=d[N]),N>>=8;null!==w&&a<4096&&(d[a++]=w<<8|L,a>=f+1&&u<12&&(++u,f=f<<1|1)),w=m}else a=o+1,f=(1<<(u=e+1))-1,w=null}return l!==r&&tt.log("Warning, gif stream shorter than expected."),i}
220
220
  /**
221
221
  * @license
222
222
  Copyright (c) 2008, Adobe Systems Incorporated
@@ -248,14 +248,14 @@ Tn=[192,193,194,195,196,197,198,199],Pt.API.processJPEG=function(t,n,i,r,e,s){va
248
248
  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
249
249
  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
250
250
  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
251
- */function Jn(t){var n,i,r,e,s,o=Math.floor,a=new Array(64),u=new Array(64),f=new Array(64),c=new Array(64),h=new Array(65535),l=new Array(65535),v=new Array(64),d=new Array(64),w=[],m=0,b=7,p=new Array(64),N=new Array(64),L=new Array(64),g=new Array(256),A=new Array(2048),y=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],k=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],S=[0,1,2,3,4,5,6,7,8,9,10,11],x=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],q=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],j=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],M=[0,1,2,3,4,5,6,7,8,9,10,11],E=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],P=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function O(t,n){for(var i=0,r=0,e=new Array,s=1;s<=16;s++){for(var o=1;o<=t[s];o++)e[n[r]]=[],e[n[r]][0]=i,e[n[r]][1]=s,r++,i++;i*=2}return e}function I(t){for(var n=t[0],i=t[1]-1;i>=0;)n&1<<i&&(m|=1<<b),i--,--b<0&&(255==m?(F(255),F(0)):F(m),b=7,m=0)}function F(t){w.push(t)}function B(t){F(t>>8&255),F(255&t)}function R(t,n,i,r,e){for(var s,o=e[0],a=e[240],u=function(t,n){var i,r,e,s,o,a,u,f,c,h,l=0;for(c=0;c<8;++c){var d=(i=t[l])+(f=t[l+7]),w=i-f,m=(r=t[l+1])+(u=t[l+6]),b=r-u,p=(e=t[l+2])+(a=t[l+5]),N=e-a,L=(s=t[l+3])+(o=t[l+4]),g=s-o,A=d+L,y=d-L,k=m+p,S=m-p;t[l]=A+k,t[l+4]=A-k;var x=.707106781*(S+y);t[l+2]=y+x,t[l+6]=y-x;var q=.382683433*((A=g+N)-(S=b+w)),j=.5411961*A+q,M=1.306562965*S+q,E=.707106781*(k=N+b),P=w+E,O=w-E;t[l+5]=O+j,t[l+3]=O-j,t[l+1]=P+M,t[l+7]=P-M,l+=8}for(l=0,c=0;c<8;++c){var I=(i=t[l])+(f=t[l+56]),F=i-f,B=(r=t[l+8])+(u=t[l+48]),R=r-u,T=(e=t[l+16])+(a=t[l+40]),C=e-a,D=(s=t[l+24])+(o=t[l+32]),z=s-o,U=I+D,V=I-D,W=B+T,H=B-T;t[l]=U+W,t[l+32]=U-W;var _=.707106781*(H+V);t[l+16]=V+_,t[l+48]=V-_;var G=.382683433*((U=z+C)-(H=R+F)),J=.5411961*U+G,Y=1.306562965*H+G,$=.707106781*(W=C+R),K=F+$,X=F-$;t[l+40]=X+J,t[l+24]=X-J,t[l+8]=K+Y,t[l+56]=K-Y,l++}for(c=0;c<64;++c)v[c]=(h=t[c]*n[c])>0?h+.5|0:h-.5|0;return v}(t,n),f=0;f<64;++f)d[y[f]]=u[f];var c=d[0]-i;i=d[0],0==c?I(r[0]):(I(r[l[s=32767+c]]),I(h[s]));for(var w=63;w>0&&0==d[w];)w--;if(0==w)return I(o),i;for(var m,b=1;b<=w;){for(var p=b;0==d[b]&&b<=w;)++b;var N=b-p;if(N>=16){m=N>>4;for(var L=1;L<=m;++L)I(a);N&=15}I(e[(N<<4)+l[s=32767+d[b]]]),I(h[s]),b++}return 63!=w&&I(o),i}function T(t){t=Math.min(Math.max(t,1),100),s!=t&&(function(t){for(var n=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],i=0;i<64;i++){var r=o((n[i]*t+50)/100);r=Math.min(Math.max(r,1),255),a[y[i]]=r}for(var e=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],s=0;s<64;s++){var h=o((e[s]*t+50)/100);h=Math.min(Math.max(h,1),255),u[y[s]]=h}for(var l=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],v=0,d=0;d<8;d++)for(var w=0;w<8;w++)f[v]=1/(a[y[v]]*l[d]*l[w]*8),c[v]=1/(u[y[v]]*l[d]*l[w]*8),v++}(t<50?Math.floor(5e3/t):Math.floor(200-2*t)),s=t)}this.encode=function(t,s){s&&T(s),w=new Array,m=0,b=7,B(65496),B(65504),B(16),F(74),F(70),F(73),F(70),F(0),F(1),F(1),F(0),B(1),B(1),F(0),F(0),function(){B(65499),B(132),F(0);for(var t=0;t<64;t++)F(a[t]);F(1);for(var n=0;n<64;n++)F(u[n])}(),function(t,n){B(65472),B(17),F(8),B(n),B(t),F(3),F(1),F(17),F(0),F(2),F(17),F(1),F(3),F(17),F(1)}(t.width,t.height),function(){B(65476),B(418),F(0);for(var t=0;t<16;t++)F(k[t+1]);for(var n=0;n<=11;n++)F(S[n]);F(16);for(var i=0;i<16;i++)F(x[i+1]);for(var r=0;r<=161;r++)F(q[r]);F(1);for(var e=0;e<16;e++)F(j[e+1]);for(var s=0;s<=11;s++)F(M[s]);F(17);for(var o=0;o<16;o++)F(E[o+1]);for(var a=0;a<=161;a++)F(P[a])}(),B(65498),B(12),F(3),F(1),F(0),F(2),F(17),F(3),F(17),F(0),F(63),F(0);var o=0,h=0,l=0;m=0,b=7,this.encode.displayName="_encode_";for(var v,d,g,y,O,C,D,z,U,V=t.data,W=t.height,H=4*t.width,_=0;_<W;){for(v=0;v<H;){for(O=H*_+v,D=-1,z=0,U=0;U<64;U++)C=O+(z=U>>3)*H+(D=4*(7&U)),_+z>=W&&(C-=H*(_+1+z-W)),v+D>=H&&(C-=v+D-H+4),d=V[C++],g=V[C++],y=V[C++],p[U]=(A[d]+A[g+256>>0]+A[y+512>>0]>>16)-128,N[U]=(A[d+768>>0]+A[g+1024>>0]+A[y+1280>>0]>>16)-128,L[U]=(A[d+1280>>0]+A[g+1536>>0]+A[y+1792>>0]>>16)-128;o=R(p,f,o,n,r),h=R(N,c,h,i,e),l=R(L,c,l,i,e),v+=32}_+=8}if(b>=0){var G=[];G[1]=b+1,G[0]=(1<<b+1)-1,I(G)}return B(65497),new Uint8Array(w)},t=t||50,function(){for(var t=String.fromCharCode,n=0;n<256;n++)g[n]=t(n)}(),n=O(k,S),i=O(j,M),r=O(x,q),e=O(E,P),function(){for(var t=1,n=2,i=1;i<=15;i++){for(var r=t;r<n;r++)l[32767+r]=i,h[32767+r]=[],h[32767+r][1]=i,h[32767+r][0]=r;for(var e=-(n-1);e<=-t;e++)l[32767+e]=i,h[32767+e]=[],h[32767+e][1]=i,h[32767+e][0]=n-1+e;t<<=1,n<<=1}}(),function(){for(var t=0;t<256;t++)A[t]=19595*t,A[t+256>>0]=38470*t,A[t+512>>0]=7471*t+32768,A[t+768>>0]=-11059*t,A[t+1024>>0]=-21709*t,A[t+1280>>0]=32768*t+8421375,A[t+1536>>0]=-27439*t,A[t+1792>>0]=-5329*t}(),T(t)}
251
+ */function Jn(t){var n,i,r,e,s,o=Math.floor,a=new Array(64),u=new Array(64),f=new Array(64),c=new Array(64),h=new Array(65535),l=new Array(65535),v=new Array(64),d=new Array(64),w=[],m=0,b=7,p=new Array(64),N=new Array(64),L=new Array(64),g=new Array(256),A=new Array(2048),y=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],k=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],S=[0,1,2,3,4,5,6,7,8,9,10,11],x=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],q=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],j=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],M=[0,1,2,3,4,5,6,7,8,9,10,11],E=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],P=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function O(t,n){for(var i=0,r=0,e=new Array,s=1;s<=16;s++){for(var o=1;o<=t[s];o++)e[n[r]]=[],e[n[r]][0]=i,e[n[r]][1]=s,r++,i++;i*=2}return e}function I(t){for(var n=t[0],i=t[1]-1;i>=0;)n&1<<i&&(m|=1<<b),i--,--b<0&&(255==m?(F(255),F(0)):F(m),b=7,m=0)}function F(t){w.push(t)}function B(t){F(t>>8&255),F(255&t)}function R(t,n,i,r,e){for(var s,o=e[0],a=e[240],u=function(t,n){var i,r,e,s,o,a,u,f,c,h,l=0;for(c=0;c<8;++c){var d=(i=t[l])+(f=t[l+7]),w=i-f,m=(r=t[l+1])+(u=t[l+6]),b=r-u,p=(e=t[l+2])+(a=t[l+5]),N=e-a,L=(s=t[l+3])+(o=t[l+4]),g=s-o,A=d+L,y=d-L,k=m+p,S=m-p;t[l]=A+k,t[l+4]=A-k;var x=.707106781*(S+y);t[l+2]=y+x,t[l+6]=y-x;var q=.382683433*((A=g+N)-(S=b+w)),j=.5411961*A+q,M=1.306562965*S+q,E=.707106781*(k=N+b),P=w+E,O=w-E;t[l+5]=O+j,t[l+3]=O-j,t[l+1]=P+M,t[l+7]=P-M,l+=8}for(l=0,c=0;c<8;++c){var I=(i=t[l])+(f=t[l+56]),F=i-f,B=(r=t[l+8])+(u=t[l+48]),R=r-u,T=(e=t[l+16])+(a=t[l+40]),C=e-a,D=(s=t[l+24])+(o=t[l+32]),z=s-o,U=I+D,V=I-D,W=B+T,_=B-T;t[l]=U+W,t[l+32]=U-W;var H=.707106781*(_+V);t[l+16]=V+H,t[l+48]=V-H;var G=.382683433*((U=z+C)-(_=R+F)),J=.5411961*U+G,Y=1.306562965*_+G,$=.707106781*(W=C+R),K=F+$,X=F-$;t[l+40]=X+J,t[l+24]=X-J,t[l+8]=K+Y,t[l+56]=K-Y,l++}for(c=0;c<64;++c)v[c]=(h=t[c]*n[c])>0?h+.5|0:h-.5|0;return v}(t,n),f=0;f<64;++f)d[y[f]]=u[f];var c=d[0]-i;i=d[0],0==c?I(r[0]):(I(r[l[s=32767+c]]),I(h[s]));for(var w=63;w>0&&0==d[w];)w--;if(0==w)return I(o),i;for(var m,b=1;b<=w;){for(var p=b;0==d[b]&&b<=w;)++b;var N=b-p;if(N>=16){m=N>>4;for(var L=1;L<=m;++L)I(a);N&=15}I(e[(N<<4)+l[s=32767+d[b]]]),I(h[s]),b++}return 63!=w&&I(o),i}function T(t){t=Math.min(Math.max(t,1),100),s!=t&&(function(t){for(var n=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],i=0;i<64;i++){var r=o((n[i]*t+50)/100);r=Math.min(Math.max(r,1),255),a[y[i]]=r}for(var e=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],s=0;s<64;s++){var h=o((e[s]*t+50)/100);h=Math.min(Math.max(h,1),255),u[y[s]]=h}for(var l=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],v=0,d=0;d<8;d++)for(var w=0;w<8;w++)f[v]=1/(a[y[v]]*l[d]*l[w]*8),c[v]=1/(u[y[v]]*l[d]*l[w]*8),v++}(t<50?Math.floor(5e3/t):Math.floor(200-2*t)),s=t)}this.encode=function(t,s){s&&T(s),w=new Array,m=0,b=7,B(65496),B(65504),B(16),F(74),F(70),F(73),F(70),F(0),F(1),F(1),F(0),B(1),B(1),F(0),F(0),function(){B(65499),B(132),F(0);for(var t=0;t<64;t++)F(a[t]);F(1);for(var n=0;n<64;n++)F(u[n])}(),function(t,n){B(65472),B(17),F(8),B(n),B(t),F(3),F(1),F(17),F(0),F(2),F(17),F(1),F(3),F(17),F(1)}(t.width,t.height),function(){B(65476),B(418),F(0);for(var t=0;t<16;t++)F(k[t+1]);for(var n=0;n<=11;n++)F(S[n]);F(16);for(var i=0;i<16;i++)F(x[i+1]);for(var r=0;r<=161;r++)F(q[r]);F(1);for(var e=0;e<16;e++)F(j[e+1]);for(var s=0;s<=11;s++)F(M[s]);F(17);for(var o=0;o<16;o++)F(E[o+1]);for(var a=0;a<=161;a++)F(P[a])}(),B(65498),B(12),F(3),F(1),F(0),F(2),F(17),F(3),F(17),F(0),F(63),F(0);var o=0,h=0,l=0;m=0,b=7,this.encode.displayName="_encode_";for(var v,d,g,y,O,C,D,z,U,V=t.data,W=t.height,_=4*t.width,H=0;H<W;){for(v=0;v<_;){for(O=_*H+v,D=-1,z=0,U=0;U<64;U++)C=O+(z=U>>3)*_+(D=4*(7&U)),H+z>=W&&(C-=_*(H+1+z-W)),v+D>=_&&(C-=v+D-_+4),d=V[C++],g=V[C++],y=V[C++],p[U]=(A[d]+A[g+256>>0]+A[y+512>>0]>>16)-128,N[U]=(A[d+768>>0]+A[g+1024>>0]+A[y+1280>>0]>>16)-128,L[U]=(A[d+1280>>0]+A[g+1536>>0]+A[y+1792>>0]>>16)-128;o=R(p,f,o,n,r),h=R(N,c,h,i,e),l=R(L,c,l,i,e),v+=32}H+=8}if(b>=0){var G=[];G[1]=b+1,G[0]=(1<<b+1)-1,I(G)}return B(65497),new Uint8Array(w)},t=t||50,function(){for(var t=String.fromCharCode,n=0;n<256;n++)g[n]=t(n)}(),n=O(k,S),i=O(j,M),r=O(x,q),e=O(E,P),function(){for(var t=1,n=2,i=1;i<=15;i++){for(var r=t;r<n;r++)l[32767+r]=i,h[32767+r]=[],h[32767+r][1]=i,h[32767+r][0]=r;for(var e=-(n-1);e<=-t;e++)l[32767+e]=i,h[32767+e]=[],h[32767+e][1]=i,h[32767+e][0]=n-1+e;t<<=1,n<<=1}}(),function(){for(var t=0;t<256;t++)A[t]=19595*t,A[t+256>>0]=38470*t,A[t+512>>0]=7471*t+32768,A[t+768>>0]=-11059*t,A[t+1024>>0]=-21709*t,A[t+1280>>0]=32768*t+8421375,A[t+1536>>0]=-27439*t,A[t+1792>>0]=-5329*t}(),T(t)}
252
252
  /**
253
253
  * @license
254
254
  * Copyright (c) 2017 Aras Abbasi
255
255
  *
256
256
  * Licensed under the MIT License.
257
257
  * http://opensource.org/licenses/mit-license
258
- */function Yn(t,n){if(this.pos=0,this.buffer=t,this.datav=new DataView(t.buffer),this.is_with_alpha=!!n,this.bottom_up=!0,this.flag=String.fromCharCode(this.buffer[0])+String.fromCharCode(this.buffer[1]),this.pos+=2,-1===["BM","BA","CI","CP","IC","PT"].indexOf(this.flag))throw new Error("Invalid BMP File");this.parseHeader(),this.parseBGR()}function $n(t){function n(t){if(!t)throw Error("assert :P")}function i(t,n,i){for(var r=0;4>r;r++)if(t[n+r]!=i.charCodeAt(r))return!0;return!1}function r(t,n,i,r,e){for(var s=0;s<e;s++)t[n+s]=i[r+s]}function e(t,n,i,r){for(var e=0;e<r;e++)t[n+e]=i}function s(t){return new Int32Array(t)}function o(t,n){for(var i=[],r=0;r<t;r++)i.push(new n);return i}function a(t,n){var i=[];return function t(i,r,e){for(var s=e[r],o=0;o<s&&(i.push(e.length>r+1?[]:new n),!(e.length<r+1));o++)t(i[o],r+1,e)}(i,0,t),i}var u=function(){var t=this;function u(t,n){for(var i=1<<n-1>>>0;t&i;)i>>>=1;return i?(t&i-1)+i:t}function f(t,i,r,e,s){n(!(e%r));do{t[i+(e-=r)]=s}while(0<e)}function c(t,i,r,e,o){if(n(2328>=o),512>=o)var a=s(512);else if(null==(a=s(o)))return 0;return function(t,i,r,e,o,a){var c,l,v=i,d=1<<r,w=s(16),m=s(16);for(n(0!=o),n(null!=e),n(null!=t),n(0<r),l=0;l<o;++l){if(15<e[l])return 0;++w[e[l]]}if(w[0]==o)return 0;for(m[1]=0,c=1;15>c;++c){if(w[c]>1<<c)return 0;m[c+1]=m[c]+w[c]}for(l=0;l<o;++l)c=e[l],0<e[l]&&(a[m[c]++]=l);if(1==m[15])return(e=new h).g=0,e.value=a[0],f(t,v,1,d,e),d;var b,p=-1,N=d-1,L=0,g=1,A=1,y=1<<r;for(l=0,c=1,o=2;c<=r;++c,o<<=1){if(g+=A<<=1,0>(A-=w[c]))return 0;for(;0<w[c];--w[c])(e=new h).g=c,e.value=a[l++],f(t,v+L,o,y,e),L=u(L,c)}for(c=r+1,o=2;15>=c;++c,o<<=1){if(g+=A<<=1,0>(A-=w[c]))return 0;for(;0<w[c];--w[c]){if(e=new h,(L&N)!=p){for(v+=y,b=1<<(p=c)-r;15>p&&!(0>=(b-=w[p]));)++p,b<<=1;d+=y=1<<(b=p-r),t[i+(p=L&N)].g=b+r,t[i+p].value=v-i-p}e.g=c-r,e.value=a[l++],f(t,v+(L>>r),o,y,e),L=u(L,c)}}return g!=2*m[15]-1?0:d}(t,i,r,e,o,a)}function h(){this.value=this.g=0}function l(){this.value=this.g=0}function v(){this.G=o(5,h),this.H=s(5),this.jc=this.Qb=this.qb=this.nd=0,this.pd=o(Di,l)}function d(t,i,r,e){n(null!=t),n(null!=i),n(2147483648>e),t.Ca=254,t.I=0,t.b=-8,t.Ka=0,t.oa=i,t.pa=r,t.Jd=i,t.Yc=r+e,t.Zc=4<=e?r+e-4+1:r,x(t)}function w(t,n){for(var i=0;0<n--;)i|=j(t,128)<<n;return i}function m(t,n){var i=w(t,n);return q(t)?-i:i}function b(t,i,r,e){var s,o=0;for(n(null!=t),n(null!=i),n(4294967288>e),t.Sb=e,t.Ra=0,t.u=0,t.h=0,4<e&&(e=4),s=0;s<e;++s)o+=i[r+s]<<8*s;t.Ra=o,t.bb=e,t.oa=i,t.pa=r}function p(t){for(;8<=t.u&&t.bb<t.Sb;)t.Ra>>>=8,t.Ra+=t.oa[t.pa+t.bb]<<Vi-8>>>0,++t.bb,t.u-=8;y(t)&&(t.h=1,t.u=0)}function N(t,i){if(n(0<=i),!t.h&&i<=Ui){var r=A(t)&zi[i];return t.u+=i,p(t),r}return t.h=1,t.u=0}function L(){this.b=this.Ca=this.I=0,this.oa=[],this.pa=0,this.Jd=[],this.Yc=0,this.Zc=[],this.Ka=0}function g(){this.Ra=0,this.oa=[],this.h=this.u=this.bb=this.Sb=this.pa=0}function A(t){return t.Ra>>>(t.u&Vi-1)>>>0}function y(t){return n(t.bb<=t.Sb),t.h||t.bb==t.Sb&&t.u>Vi}function k(t,n){t.u=n,t.h=y(t)}function S(t){t.u>=Wi&&(n(t.u>=Wi),p(t))}function x(t){n(null!=t&&null!=t.oa),t.pa<t.Zc?(t.I=(t.oa[t.pa++]|t.I<<8)>>>0,t.b+=8):(n(null!=t&&null!=t.oa),t.pa<t.Yc?(t.b+=8,t.I=t.oa[t.pa++]|t.I<<8):t.Ka?t.b=0:(t.I<<=8,t.b+=8,t.Ka=1))}function q(t){return w(t,1)}function j(t,n){var i=t.Ca;0>t.b&&x(t);var r=t.b,e=i*n>>>8,s=(t.I>>>r>e)+0;for(s?(i-=e,t.I-=e+1<<r>>>0):i=e+1,r=i,e=0;256<=r;)e+=8,r>>=8;return t.b-=r=7^e+Hi[r],t.Ca=(i<<r)-1,s}function M(t,n,i){t[n+0]=i>>24&255,t[n+1]=i>>16&255,t[n+2]=i>>8&255,t[n+3]=i>>0&255}function E(t,n){return t[n+0]<<0|t[n+1]<<8}function P(t,n){return E(t,n)|t[n+2]<<16}function O(t,n){return E(t,n)|E(t,n+2)<<16}function I(t,i){var r=1<<i;return n(null!=t),n(0<i),t.X=s(r),null==t.X?0:(t.Mb=32-i,t.Xa=i,1)}function F(t,i){n(null!=t),n(null!=i),n(t.Xa==i.Xa),r(i.X,0,t.X,0,1<<i.Xa)}function B(){this.X=[],this.Xa=this.Mb=0}function R(t,i,r,e){n(null!=r),n(null!=e);var s=r[0],o=e[0];return 0==s&&(s=(t*o+i/2)/i),0==o&&(o=(i*s+t/2)/t),0>=s||0>=o?0:(r[0]=s,e[0]=o,1)}function T(t,n){return t+(1<<n)-1>>>n}function C(t,n){return((4278255360&t)+(4278255360&n)>>>0&4278255360)+((16711935&t)+(16711935&n)>>>0&16711935)>>>0}function D(n,i){t[i]=function(i,r,e,s,o,a,u){var f;for(f=0;f<o;++f){var c=t[n](a[u+f-1],e,s+f);a[u+f]=C(i[r+f],c)}}}function z(){this.ud=this.hd=this.jd=0}function U(t,n){return((4278124286&(t^n))>>>1)+(t&n)>>>0}function V(t){return 0<=t&&256>t?t:0>t?0:255<t?255:void 0}function W(t,n){return V(t+(t-n+.5>>1))}function H(t,n,i){return Math.abs(n-i)-Math.abs(t-i)}function _(t,n,i,r,e,s,o){for(r=s[o-1],i=0;i<e;++i)s[o+i]=r=C(t[n+i],r)}function G(t,n,i,r,e){var s;for(s=0;s<i;++s){var o=t[n+s],a=o>>8&255,u=16711935&(u=(u=16711935&o)+((a<<16)+a));r[e+s]=(4278255360&o)+u>>>0}}function J(t,n){n.jd=t>>0&255,n.hd=t>>8&255,n.ud=t>>16&255}function Y(t,n,i,r,e,s){var o;for(o=0;o<r;++o){var a=n[i+o],u=a>>>8,f=a,c=255&(c=(c=a>>>16)+((t.jd<<24>>24)*(u<<24>>24)>>>5));f=255&(f=(f+=(t.hd<<24>>24)*(u<<24>>24)>>>5)+((t.ud<<24>>24)*(c<<24>>24)>>>5)),e[s+o]=(4278255360&a)+(c<<16)+f}}function $(n,i,r,e,s){t[i]=function(t,n,i,r,o,a,u,f,c){for(r=u;r<f;++r)for(u=0;u<c;++u)o[a++]=s(i[e(t[n++])])},t[n]=function(n,i,o,a,u,f,c){var h=8>>n.b,l=n.Ea,v=n.K[0],d=n.w;if(8>h)for(n=(1<<n.b)-1,d=(1<<h)-1;i<o;++i){var w,m=0;for(w=0;w<l;++w)w&n||(m=e(a[u++])),f[c++]=s(v[m&d]),m>>=h}else t["VP8LMapColor"+r](a,u,v,d,f,c,i,o,l)}}function K(t,n,i,r,e){for(i=n+i;n<i;){var s=t[n++];r[e++]=s>>16&255,r[e++]=s>>8&255,r[e++]=s>>0&255}}function X(t,n,i,r,e){for(i=n+i;n<i;){var s=t[n++];r[e++]=s>>16&255,r[e++]=s>>8&255,r[e++]=s>>0&255,r[e++]=s>>24&255}}function Z(t,n,i,r,e){for(i=n+i;n<i;){var s=(o=t[n++])>>16&240|o>>12&15,o=o>>0&240|o>>28&15;r[e++]=s,r[e++]=o}}function Q(t,n,i,r,e){for(i=n+i;n<i;){var s=(o=t[n++])>>16&248|o>>13&7,o=o>>5&224|o>>3&31;r[e++]=s,r[e++]=o}}function tt(t,n,i,r,e){for(i=n+i;n<i;){var s=t[n++];r[e++]=s>>0&255,r[e++]=s>>8&255,r[e++]=s>>16&255}}function nt(t,n,i,e,s,o){if(0==o)for(i=n+i;n<i;)M(e,((o=t[n++])[0]>>24|o[1]>>8&65280|o[2]<<8&16711680|o[3]<<24)>>>0),s+=32;else r(e,s,t,n,i)}function it(n,i){t[i][0]=t[n+"0"],t[i][1]=t[n+"1"],t[i][2]=t[n+"2"],t[i][3]=t[n+"3"],t[i][4]=t[n+"4"],t[i][5]=t[n+"5"],t[i][6]=t[n+"6"],t[i][7]=t[n+"7"],t[i][8]=t[n+"8"],t[i][9]=t[n+"9"],t[i][10]=t[n+"10"],t[i][11]=t[n+"11"],t[i][12]=t[n+"12"],t[i][13]=t[n+"13"],t[i][14]=t[n+"0"],t[i][15]=t[n+"0"]}function rt(t){return t==Wr||t==Hr||t==_r||t==Gr}function et(){this.eb=[],this.size=this.A=this.fb=0}function st(){this.y=[],this.f=[],this.ea=[],this.F=[],this.Tc=this.Ed=this.Cd=this.Fd=this.lb=this.Db=this.Ab=this.fa=this.J=this.W=this.N=this.O=0}function ot(){this.Rd=this.height=this.width=this.S=0,this.f={},this.f.RGBA=new et,this.f.kb=new st,this.sd=null}function at(){this.width=[0],this.height=[0],this.Pd=[0],this.Qd=[0],this.format=[0]}function ut(){this.Id=this.fd=this.Md=this.hb=this.ib=this.da=this.bd=this.cd=this.j=this.v=this.Da=this.Sd=this.ob=0}function ft(t){return alert("todo:WebPSamplerProcessPlane"),t.T}function ct(t,n){var i=t.T,e=n.ba.f.RGBA,s=e.eb,o=e.fb+t.ka*e.A,a=be[n.ba.S],u=t.y,f=t.O,c=t.f,h=t.N,l=t.ea,v=t.W,d=n.cc,w=n.dc,m=n.Mc,b=n.Nc,p=t.ka,N=t.ka+t.T,L=t.U,g=L+1>>1;for(0==p?a(u,f,null,null,c,h,l,v,c,h,l,v,s,o,null,null,L):(a(n.ec,n.fc,u,f,d,w,m,b,c,h,l,v,s,o-e.A,s,o,L),++i);p+2<N;p+=2)a(u,(f+=2*t.fa)-t.fa,u,f,d=c,w=h,m=l,b=v,c,h+=t.Rc,l,v+=t.Rc,s,(o+=2*e.A)-e.A,s,o,L);return f+=t.fa,t.j+N<t.o?(r(n.ec,n.fc,u,f,L),r(n.cc,n.dc,c,h,g),r(n.Mc,n.Nc,l,v,g),i--):1&N||a(u,f,null,null,c,h,l,v,c,h,l,v,s,o+e.A,null,null,L),i}function ht(t,i,r){var e=t.F,s=[t.J];if(null!=e){var o=t.U,a=i.ba.S,u=a==zr||a==_r;i=i.ba.f.RGBA;var f=[0],c=t.ka;f[0]=t.T,t.Kb&&(0==c?--f[0]:(--c,s[0]-=t.width),t.j+t.ka+t.T==t.o&&(f[0]=t.o-t.j-c));var h=i.eb;t=Sr(e,s[0],t.width,o,f,h,(c=i.fb+c*i.A)+(u?0:3),i.A),n(r==f),t&&rt(a)&&yr(h,c,u,o,f,i.A)}return 0}function lt(t){var n=t.ma,i=n.ba.S,r=11>i,e=i==Tr||i==Dr||i==zr||i==Ur||12==i||rt(i);if(n.memory=null,n.Ib=null,n.Jb=null,n.Nd=null,!Ri(n.Oa,t,e?11:12))return 0;if(e&&rt(i)&&Ni(),t.da)alert("todo:use_scaling");else{if(r){if(n.Ib=ft,t.Kb){if(n.memory=s(t.U+2*(i=t.U+1>>1)),null==n.memory)return 0;n.ec=n.memory,n.fc=0,n.cc=n.ec,n.dc=n.fc+t.U,n.Mc=n.cc,n.Nc=n.dc+i,n.Ib=ct,Ni()}}else alert("todo:EmitYUV");e&&(n.Jb=ht,r&&bi())}if(r&&!Pe){for(t=0;256>t;++t)Oe[t]=89858*(t-128)+xe>>Se,Be[t]=-22014*(t-128)+xe,Fe[t]=-45773*(t-128),Ie[t]=113618*(t-128)+xe>>Se;for(t=qe;t<je;++t)Re[t-qe]=_t(n=76283*(t-16)+xe>>Se,255),Te[t-qe]=_t(n+8>>4,15);Pe=1}return 1}function vt(t){var i=t.ma,r=t.U,e=t.T;return n(!(1&t.ka)),0>=r||0>=e?0:(r=i.Ib(t,i),null!=i.Jb&&i.Jb(t,i,r),i.Dc+=r,1)}function dt(t){t.ma.memory=null}function wt(t,n,i,r){return 47!=N(t,8)?0:(n[0]=N(t,14)+1,i[0]=N(t,14)+1,r[0]=N(t,1),0!=N(t,3)?0:!t.h)}function mt(t,n){if(4>t)return t+1;var i=t-2>>1;return(2+(1&t)<<i)+N(n,i)+1}function bt(t,n){return 120<n?n-120:1<=(i=((i=Zr[n-1])>>4)*t+(8-(15&i)))?i:1;var i}function pt(t,n,i){var r=A(i),e=t[n+=255&r].g-8;return 0<e&&(k(i,i.u+8),r=A(i),n+=t[n].value,n+=r&(1<<e)-1),k(i,i.u+t[n].g),t[n].value}function Nt(t,i,r){return r.g+=t.g,r.value+=t.value<<i>>>0,n(8>=r.g),t.g}function Lt(t,i,r){var e=t.xc;return n((i=0==e?0:t.vc[t.md*(r>>e)+(i>>e)])<t.Wb),t.Ya[i]}function gt(t,i,e,s){var o=t.ab,a=t.c*i,u=t.C;i=u+i;var f=e,c=s;for(s=t.Ta,e=t.Ua;0<o--;){var h=t.gc[o],l=u,v=i,d=f,w=c,m=(c=s,f=e,h.Ea);switch(n(l<v),n(v<=h.nc),h.hc){case 2:Ji(d,w,(v-l)*m,c,f);break;case 0:var b=l,p=v,N=c,L=f,g=(x=h).Ea;0==b&&(_i(d,w,null,null,1,N,L),_(d,w+1,0,0,g-1,N,L+1),w+=g,L+=g,++b);for(var A=1<<x.b,y=A-1,k=T(g,x.b),S=x.K,x=x.w+(b>>x.b)*k;b<p;){var q=S,j=x,M=1;for(Gi(d,w,N,L-g,1,N,L);M<g;){var E=(M&~y)+A;E>g&&(E=g),(0,Zi[q[j++]>>8&15])(d,w+ +M,N,L+M-g,E-M,N,L+M),M=E}w+=g,L+=g,++b&y||(x+=k)}v!=h.nc&&r(c,f-m,c,f+(v-l-1)*m,m);break;case 1:for(m=d,p=w,g=(d=h.Ea)-(L=d&~(N=(w=1<<h.b)-1)),b=T(d,h.b),A=h.K,h=h.w+(l>>h.b)*b;l<v;){for(y=A,k=h,S=new z,x=p+L,q=p+d;p<x;)J(y[k++],S),Qi(S,m,p,w,c,f),p+=w,f+=w;p<q&&(J(y[k++],S),Qi(S,m,p,g,c,f),p+=g,f+=g),++l&N||(h+=b)}break;case 3:if(d==c&&w==f&&0<h.b){for(p=c,d=m=f+(v-l)*m-(L=(v-l)*T(h.Ea,h.b)),w=c,N=f,b=[],L=(g=L)-1;0<=L;--L)b[L]=w[N+L];for(L=g-1;0<=L;--L)p[d+L]=b[L];Yi(h,l,v,c,m,c,f)}else Yi(h,l,v,d,w,c,f)}f=s,c=e}c!=e&&r(s,e,f,c,a)}function At(t,i){var r=t.V,e=t.Ba+t.c*t.C,s=i-t.C;if(n(i<=t.l.o),n(16>=s),0<s){var o=t.l,a=t.Ta,u=t.Ua,f=o.width;if(gt(t,s,r,e),s=u=[u],n((r=t.C)<(e=i)),n(o.v<o.va),e>o.o&&(e=o.o),r<o.j){var c=o.j-r;r=o.j,s[0]+=c*f}if(r>=e?r=0:(s[0]+=4*o.v,o.ka=r-o.j,o.U=o.va-o.v,o.T=e-r,r=1),r){if(u=u[0],11>(r=t.ca).S){var h=r.f.RGBA,l=(e=r.S,s=o.U,o=o.T,c=h.eb,h.A),v=o;for(h=h.fb+t.Ma*h.A;0<v--;){var d=a,w=u,m=s,b=c,p=h;switch(e){case Rr:tr(d,w,m,b,p);break;case Tr:nr(d,w,m,b,p);break;case Wr:nr(d,w,m,b,p),yr(b,p,0,m,1,0);break;case Cr:er(d,w,m,b,p);break;case Dr:nt(d,w,m,b,p,1);break;case Hr:nt(d,w,m,b,p,1),yr(b,p,0,m,1,0);break;case zr:nt(d,w,m,b,p,0);break;case _r:nt(d,w,m,b,p,0),yr(b,p,1,m,1,0);break;case Ur:ir(d,w,m,b,p);break;case Gr:ir(d,w,m,b,p),kr(b,p,m,1,0);break;case Vr:rr(d,w,m,b,p);break;default:n(0)}u+=f,h+=l}t.Ma+=o}else alert("todo:EmitRescaledRowsYUVA");n(t.Ma<=r.height)}}t.C=i,n(t.C<=t.i)}function yt(t){var n;if(0<t.ua)return 0;for(n=0;n<t.Wb;++n){var i=t.Ya[n].G,r=t.Ya[n].H;if(0<i[1][r[1]+0].g||0<i[2][r[2]+0].g||0<i[3][r[3]+0].g)return 0}return 1}function kt(t,i,r,e,s,o){if(0!=t.Z){var a=t.qd,u=t.rd;for(n(null!=me[t.Z]);i<r;++i)me[t.Z](a,u,e,s,e,s,o),a=e,u=s,s+=o;t.qd=a,t.rd=u}}function St(t,i){var r=t.l.ma,e=0==r.Z||1==r.Z?t.l.j:t.C;if(e=t.C<e?e:t.C,n(i<=t.l.o),i>e){var s=t.l.width,o=r.ca,a=r.tb+s*e,u=t.V,f=t.Ba+t.c*e,c=t.gc;n(1==t.ab),n(3==c[0].hc),Ki(c[0],e,i,u,f,o,a),kt(r,e,i,o,a,s)}t.C=t.Ma=i}function xt(t,i,r,e,s,o,a){var u=t.$/e,f=t.$%e,c=t.m,h=t.s,l=r+t.$,v=l;s=r+e*s;var d=r+e*o,w=280+h.ua,m=t.Pb?u:16777216,b=0<h.ua?h.Wa:null,p=h.wc,N=l<d?Lt(h,f,u):null;n(t.C<o),n(d<=s);var L=!1;t:for(;;){for(;L||l<d;){var g=0;if(u>=m){var x=l-r;n((m=t).Pb),m.wd=m.m,m.xd=x,0<m.s.ua&&F(m.s.Wa,m.s.vb),m=u+te}if(f&p||(N=Lt(h,f,u)),n(null!=N),N.Qb&&(i[l]=N.qb,L=!0),!L)if(S(c),N.jc){x=i;var q=l,j=N.pd[A(g=c)&Di-1];n(N.jc),256>j.g?(k(g,g.u+j.g),x[q]=j.value,g=0):(k(g,g.u+j.g-256),n(256<=j.value),g=j.value),0==g&&(L=!0)}else g=pt(N.G[0],N.H[0],c);if(c.h)break;if(L||256>g){if(!L)if(N.nd)i[l]=(N.qb|g<<8)>>>0;else{if(S(c),L=pt(N.G[1],N.H[1],c),S(c),x=pt(N.G[2],N.H[2],c),q=pt(N.G[3],N.H[3],c),c.h)break;i[l]=(q<<24|L<<16|g<<8|x)>>>0}if(L=!1,++l,++f>=e&&(f=0,++u,null!=a&&u<=o&&!(u%16)&&a(t,u),null!=b))for(;v<l;)g=i[v++],b.X[(506832829*g&4294967295)>>>b.Mb]=g}else if(280>g){if(g=mt(g-256,c),x=pt(N.G[4],N.H[4],c),S(c),x=bt(e,x=mt(x,c)),c.h)break;if(l-r<x||s-l<g)break t;for(q=0;q<g;++q)i[l+q]=i[l+q-x];for(l+=g,f+=g;f>=e;)f-=e,++u,null!=a&&u<=o&&!(u%16)&&a(t,u);if(n(l<=s),f&p&&(N=Lt(h,f,u)),null!=b)for(;v<l;)g=i[v++],b.X[(506832829*g&4294967295)>>>b.Mb]=g}else{if(!(g<w))break t;for(L=g-280,n(null!=b);v<l;)g=i[v++],b.X[(506832829*g&4294967295)>>>b.Mb]=g;g=l,n(!(L>>>(x=b).Xa)),i[g]=x.X[L],L=!0}L||n(c.h==y(c))}if(t.Pb&&c.h&&l<s)n(t.m.h),t.a=5,t.m=t.wd,t.$=t.xd,0<t.s.ua&&F(t.s.vb,t.s.Wa);else{if(c.h)break t;null!=a&&a(t,u>o?o:u),t.a=0,t.$=l-r}return 1}return t.a=3,0}function qt(t){n(null!=t),t.vc=null,t.yc=null,t.Ya=null;var i=t.Wa;null!=i&&(i.X=null),t.vb=null,n(null!=t)}function jt(){var n=new ai;return null==n?null:(n.a=0,n.xb=we,it("Predictor","VP8LPredictors"),it("Predictor","VP8LPredictors_C"),it("PredictorAdd","VP8LPredictorsAdd"),it("PredictorAdd","VP8LPredictorsAdd_C"),Ji=G,Qi=Y,tr=K,nr=X,ir=Z,rr=Q,er=tt,t.VP8LMapColor32b=$i,t.VP8LMapColor8b=Xi,n)}function Mt(t,i,r,a,u){var f=1,l=[t],d=[i],w=a.m,m=a.s,b=null,p=0;t:for(;;){if(r)for(;f&&N(w,1);){var L=l,g=d,y=a,x=1,q=y.m,j=y.gc[y.ab],M=N(q,2);if(y.Oc&1<<M)f=0;else{switch(y.Oc|=1<<M,j.hc=M,j.Ea=L[0],j.nc=g[0],j.K=[null],++y.ab,n(4>=y.ab),M){case 0:case 1:j.b=N(q,3)+2,x=Mt(T(j.Ea,j.b),T(j.nc,j.b),0,y,j.K),j.K=j.K[0];break;case 3:var E,P=N(q,8)+1,O=16<P?0:4<P?1:2<P?2:3;if(L[0]=T(j.Ea,O),j.b=O,E=x=Mt(P,1,0,y,j.K)){var F,B=P,R=j,D=1<<(8>>R.b),z=s(D);if(null==z)E=0;else{var U=R.K[0],V=R.w;for(z[0]=R.K[0][0],F=1;F<1*B;++F)z[F]=C(U[V+F],z[F-1]);for(;F<4*D;++F)z[F]=0;R.K[0]=null,R.K[0]=z,E=1}}x=E;break;case 2:break;default:n(0)}f=x}}if(l=l[0],d=d[0],f&&N(w,1)&&!(f=1<=(p=N(w,4))&&11>=p)){a.a=3;break t}var W;if(W=f)n:{var H,_,G,J=a,Y=l,$=d,K=p,X=r,Z=J.m,Q=J.s,tt=[null],nt=1,it=0,rt=Qr[K];i:for(;;){if(X&&N(Z,1)){var et=N(Z,3)+2,st=T(Y,et),ot=T($,et),at=st*ot;if(!Mt(st,ot,0,J,tt))break i;for(tt=tt[0],Q.xc=et,H=0;H<at;++H){var ut=tt[H]>>8&65535;tt[H]=ut,ut>=nt&&(nt=ut+1)}}if(Z.h)break i;for(_=0;5>_;++_){var ft=$r[_];!_&&0<K&&(ft+=1<<K),it<ft&&(it=ft)}var ct=o(nt*rt,h),ht=nt,lt=o(ht,v);if(null==lt)var vt=null;else n(65536>=ht),vt=lt;var dt=s(it);if(null==vt||null==dt||null==ct){J.a=1;break i}var wt=ct;for(H=G=0;H<nt;++H){var mt=vt[H],bt=mt.G,pt=mt.H,Lt=0,gt=1,At=0;for(_=0;5>_;++_){ft=$r[_],bt[_]=wt,pt[_]=G,!_&&0<K&&(ft+=1<<K);r:{var yt,kt=ft,St=J,jt=dt,Et=wt,Pt=G,Ot=0,It=St.m,Ft=N(It,1);if(e(jt,0,0,kt),Ft){var Bt=N(It,1)+1,Rt=N(It,1),Tt=N(It,0==Rt?1:8);jt[Tt]=1,2==Bt&&(jt[Tt=N(It,8)]=1);var Ct=1}else{var Dt=s(19),zt=N(It,4)+4;if(19<zt){St.a=3;var Ut=0;break r}for(yt=0;yt<zt;++yt)Dt[Xr[yt]]=N(It,3);var Vt=void 0,Wt=void 0,Ht=St,_t=Dt,Gt=kt,Jt=jt,Yt=0,$t=Ht.m,Kt=8,Xt=o(128,h);e:for(;c(Xt,0,7,_t,19);){if(N($t,1)){var Zt=2+2*N($t,3);if((Vt=2+N($t,Zt))>Gt)break e}else Vt=Gt;for(Wt=0;Wt<Gt&&Vt--;){S($t);var Qt=Xt[0+(127&A($t))];k($t,$t.u+Qt.g);var tn=Qt.value;if(16>tn)Jt[Wt++]=tn,0!=tn&&(Kt=tn);else{var nn=16==tn,rn=tn-16,en=Yr[rn],sn=N($t,Jr[rn])+en;if(Wt+sn>Gt)break e;for(var on=nn?Kt:0;0<sn--;)Jt[Wt++]=on}}Yt=1;break e}Yt||(Ht.a=3),Ct=Yt}(Ct=Ct&&!It.h)&&(Ot=c(Et,Pt,8,jt,kt)),Ct&&0!=Ot?Ut=Ot:(St.a=3,Ut=0)}if(0==Ut)break i;if(gt&&1==Kr[_]&&(gt=0==wt[G].g),Lt+=wt[G].g,G+=Ut,3>=_){var an,un=dt[0];for(an=1;an<ft;++an)dt[an]>un&&(un=dt[an]);At+=un}}if(mt.nd=gt,mt.Qb=0,gt&&(mt.qb=(bt[3][pt[3]+0].value<<24|bt[1][pt[1]+0].value<<16|bt[2][pt[2]+0].value)>>>0,0==Lt&&256>bt[0][pt[0]+0].value&&(mt.Qb=1,mt.qb+=bt[0][pt[0]+0].value<<8)),mt.jc=!mt.Qb&&6>At,mt.jc){var fn,cn=mt;for(fn=0;fn<Di;++fn){var hn=fn,ln=cn.pd[hn],vn=cn.G[0][cn.H[0]+hn];256<=vn.value?(ln.g=vn.g+256,ln.value=vn.value):(ln.g=0,ln.value=0,hn>>=Nt(vn,8,ln),hn>>=Nt(cn.G[1][cn.H[1]+hn],16,ln),hn>>=Nt(cn.G[2][cn.H[2]+hn],0,ln),Nt(cn.G[3][cn.H[3]+hn],24,ln))}}}Q.vc=tt,Q.Wb=nt,Q.Ya=vt,Q.yc=ct,W=1;break n}W=0}if(!(f=W)){a.a=3;break t}if(0<p){if(m.ua=1<<p,!I(m.Wa,p)){a.a=1,f=0;break t}}else m.ua=0;var dn=a,wn=l,mn=d,bn=dn.s,pn=bn.xc;if(dn.c=wn,dn.i=mn,bn.md=T(wn,pn),bn.wc=0==pn?-1:(1<<pn)-1,r){a.xb=de;break t}if(null==(b=s(l*d))){a.a=1,f=0;break t}f=(f=xt(a,b,0,l,d,d,null))&&!w.h;break t}return f?(null!=u?u[0]=b:(n(null==b),n(r)),a.$=0,r||qt(m)):qt(m),f}function Et(t,i){var r=t.c*t.i,e=r+i+16*i;return n(t.c<=i),t.V=s(e),null==t.V?(t.Ta=null,t.Ua=0,t.a=1,0):(t.Ta=t.V,t.Ua=t.Ba+r+i,1)}function Pt(t,i){var r=t.C,e=i-r,s=t.V,o=t.Ba+t.c*r;for(n(i<=t.l.o);0<e;){var a=16<e?16:e,u=t.l.ma,f=t.l.width,c=f*a,h=u.ca,l=u.tb+f*r,v=t.Ta,d=t.Ua;gt(t,a,s,o),xr(v,d,h,l,c),kt(u,r,r+a,h,l,f),e-=a,s+=a*t.c,r+=a}n(r==i),t.C=t.Ma=i}function Ot(){this.ub=this.yd=this.td=this.Rb=0}function It(){this.Kd=this.Ld=this.Ud=this.Td=this.i=this.c=0}function Ft(){this.Fb=this.Bb=this.Cb=0,this.Zb=s(4),this.Lb=s(4)}function Bt(){this.Yb=function(){var t=[];return function t(n,i,r){for(var e=r[i],s=0;s<e&&(n.push(r.length>i+1?[]:0),!(r.length<i+1));s++)t(n[s],i+1,r)}(t,0,[3,11]),t}()}function Rt(){this.jb=s(3),this.Wc=a([4,8],Bt),this.Xc=a([4,17],Bt)}function Tt(){this.Pc=this.wb=this.Tb=this.zd=0,this.vd=new s(4),this.od=new s(4)}function Ct(){this.ld=this.La=this.dd=this.tc=0}function Dt(){this.Na=this.la=0}function zt(){this.Sc=[0,0],this.Eb=[0,0],this.Qc=[0,0],this.ia=this.lc=0}function Ut(){this.ad=s(384),this.Za=0,this.Ob=s(16),this.$b=this.Ad=this.ia=this.Gc=this.Hc=this.Dd=0}function Vt(){this.uc=this.M=this.Nb=0,this.wa=Array(new Ct),this.Y=0,this.ya=Array(new Ut),this.aa=0,this.l=new Gt}function Wt(){this.y=s(16),this.f=s(8),this.ea=s(8)}function Ht(){this.cb=this.a=0,this.sc="",this.m=new L,this.Od=new Ot,this.Kc=new It,this.ed=new Tt,this.Qa=new Ft,this.Ic=this.$c=this.Aa=0,this.D=new Vt,this.Xb=this.Va=this.Hb=this.zb=this.yb=this.Ub=this.za=0,this.Jc=o(8,L),this.ia=0,this.pb=o(4,zt),this.Pa=new Rt,this.Bd=this.kc=0,this.Ac=[],this.Bc=0,this.zc=[0,0,0,0],this.Gd=Array(new Wt),this.Hd=0,this.rb=Array(new Dt),this.sb=0,this.wa=Array(new Ct),this.Y=0,this.oc=[],this.pc=0,this.sa=[],this.ta=0,this.qa=[],this.ra=0,this.Ha=[],this.B=this.R=this.Ia=0,this.Ec=[],this.M=this.ja=this.Vb=this.Fc=0,this.ya=Array(new Ut),this.L=this.aa=0,this.gd=a([4,2],Ct),this.ga=null,this.Fa=[],this.Cc=this.qc=this.P=0,this.Gb=[],this.Uc=0,this.mb=[],this.nb=0,this.rc=[],this.Ga=this.Vc=0}function _t(t,n){return 0>t?0:t>n?n:t}function Gt(){this.T=this.U=this.ka=this.height=this.width=0,this.y=[],this.f=[],this.ea=[],this.Rc=this.fa=this.W=this.N=this.O=0,this.ma="void",this.put="VP8IoPutHook",this.ac="VP8IoSetupHook",this.bc="VP8IoTeardownHook",this.ha=this.Kb=0,this.data=[],this.hb=this.ib=this.da=this.o=this.j=this.va=this.v=this.Da=this.ob=this.w=0,this.F=[],this.J=0}function Jt(){var t=new Ht;return null!=t&&(t.a=0,t.sc="OK",t.cb=0,t.Xb=0,re||(re=Xt)),t}function Yt(t,n,i){return 0==t.a&&(t.a=n,t.sc=i,t.cb=0),0}function $t(t,n,i){return 3<=i&&157==t[n+0]&&1==t[n+1]&&42==t[n+2]}function Kt(t,i){if(null==t)return 0;if(t.a=0,t.sc="OK",null==i)return Yt(t,2,"null VP8Io passed to VP8GetHeaders()");var r=i.data,s=i.w,o=i.ha;if(4>o)return Yt(t,7,"Truncated header.");var a=r[s+0]|r[s+1]<<8|r[s+2]<<16,u=t.Od;if(u.Rb=!(1&a),u.td=a>>1&7,u.yd=a>>4&1,u.ub=a>>5,3<u.td)return Yt(t,3,"Incorrect keyframe parameters.");if(!u.yd)return Yt(t,4,"Frame not displayable.");s+=3,o-=3;var f=t.Kc;if(u.Rb){if(7>o)return Yt(t,7,"cannot parse picture header");if(!$t(r,s,o))return Yt(t,3,"Bad code word");f.c=16383&(r[s+4]<<8|r[s+3]),f.Td=r[s+4]>>6,f.i=16383&(r[s+6]<<8|r[s+5]),f.Ud=r[s+6]>>6,s+=7,o-=7,t.za=f.c+15>>4,t.Ub=f.i+15>>4,i.width=f.c,i.height=f.i,i.Da=0,i.j=0,i.v=0,i.va=i.width,i.o=i.height,i.da=0,i.ib=i.width,i.hb=i.height,i.U=i.width,i.T=i.height,e((a=t.Pa).jb,0,255,a.jb.length),n(null!=(a=t.Qa)),a.Cb=0,a.Bb=0,a.Fb=1,e(a.Zb,0,0,a.Zb.length),e(a.Lb,0,0,a.Lb)}if(u.ub>o)return Yt(t,7,"bad partition length");d(a=t.m,r,s,u.ub),s+=u.ub,o-=u.ub,u.Rb&&(f.Ld=q(a),f.Kd=q(a)),f=t.Qa;var c,h=t.Pa;if(n(null!=a),n(null!=f),f.Cb=q(a),f.Cb){if(f.Bb=q(a),q(a)){for(f.Fb=q(a),c=0;4>c;++c)f.Zb[c]=q(a)?m(a,7):0;for(c=0;4>c;++c)f.Lb[c]=q(a)?m(a,6):0}if(f.Bb)for(c=0;3>c;++c)h.jb[c]=q(a)?w(a,8):255}else f.Bb=0;if(a.Ka)return Yt(t,3,"cannot parse segment header");if((f=t.ed).zd=q(a),f.Tb=w(a,6),f.wb=w(a,3),f.Pc=q(a),f.Pc&&q(a)){for(h=0;4>h;++h)q(a)&&(f.vd[h]=m(a,6));for(h=0;4>h;++h)q(a)&&(f.od[h]=m(a,6))}if(t.L=0==f.Tb?0:f.zd?1:2,a.Ka)return Yt(t,3,"cannot parse filter header");var l=o;if(o=c=s,s=c+l,f=l,t.Xb=(1<<w(t.m,2))-1,l<3*(h=t.Xb))r=7;else{for(c+=3*h,f-=3*h,l=0;l<h;++l){var v=r[o+0]|r[o+1]<<8|r[o+2]<<16;v>f&&(v=f),d(t.Jc[+l],r,c,v),c+=v,f-=v,o+=3}d(t.Jc[+h],r,c,f),r=c<s?0:5}if(0!=r)return Yt(t,r,"cannot parse partitions");for(r=w(c=t.m,7),o=q(c)?m(c,4):0,s=q(c)?m(c,4):0,f=q(c)?m(c,4):0,h=q(c)?m(c,4):0,c=q(c)?m(c,4):0,l=t.Qa,v=0;4>v;++v){if(l.Cb){var b=l.Zb[v];l.Fb||(b+=r)}else{if(0<v){t.pb[v]=t.pb[0];continue}b=r}var p=t.pb[v];p.Sc[0]=ne[_t(b+o,127)],p.Sc[1]=ie[_t(b+0,127)],p.Eb[0]=2*ne[_t(b+s,127)],p.Eb[1]=101581*ie[_t(b+f,127)]>>16,8>p.Eb[1]&&(p.Eb[1]=8),p.Qc[0]=ne[_t(b+h,117)],p.Qc[1]=ie[_t(b+c,127)],p.lc=b+c}if(!u.Rb)return Yt(t,4,"Not a key frame.");for(q(a),u=t.Pa,r=0;4>r;++r){for(o=0;8>o;++o)for(s=0;3>s;++s)for(f=0;11>f;++f)h=j(a,fe[r][o][s][f])?w(a,8):ae[r][o][s][f],u.Wc[r][o].Yb[s][f]=h;for(o=0;17>o;++o)u.Xc[r][o]=u.Wc[r][ce[o]]}return t.kc=q(a),t.kc&&(t.Bd=w(a,8)),t.cb=1}function Xt(t,n,i,r,e,s,o){var a=n[e].Yb[i];for(i=0;16>e;++e){if(!j(t,a[i+0]))return e;for(;!j(t,a[i+1]);)if(a=n[++e].Yb[0],i=0,16==e)return 16;var u=n[e+1].Yb;if(j(t,a[i+2])){var f=t,c=0;if(j(f,(l=a)[(h=i)+3]))if(j(f,l[h+6])){for(a=0,h=2*(c=j(f,l[h+8]))+(l=j(f,l[h+9+c])),c=0,l=ee[h];l[a];++a)c+=c+j(f,l[a]);c+=3+(8<<h)}else j(f,l[h+7])?(c=7+2*j(f,165),c+=j(f,145)):c=5+j(f,159);else c=j(f,l[h+4])?3+j(f,l[h+5]):2;a=u[2]}else c=1,a=u[1];u=o+se[e],0>(f=t).b&&x(f);var h,l=f.b,v=(h=f.Ca>>1)-(f.I>>l)>>31;--f.b,f.Ca+=v,f.Ca|=1,f.I-=(h+1&v)<<l,s[u]=((c^v)-v)*r[(0<e)+0]}return 16}function Zt(t){var n=t.rb[t.sb-1];n.la=0,n.Na=0,e(t.zc,0,0,t.zc.length),t.ja=0}function Qt(t,i){if(null==t)return 0;if(null==i)return Yt(t,2,"NULL VP8Io parameter in VP8Decode().");if(!t.cb&&!Kt(t,i))return 0;if(n(t.cb),null==i.ac||i.ac(i)){i.ob&&(t.L=0);var a=De[t.L];if(2==t.L?(t.yb=0,t.zb=0):(t.yb=i.v-a>>4,t.zb=i.j-a>>4,0>t.yb&&(t.yb=0),0>t.zb&&(t.zb=0)),t.Va=i.o+15+a>>4,t.Hb=i.va+15+a>>4,t.Hb>t.za&&(t.Hb=t.za),t.Va>t.Ub&&(t.Va=t.Ub),0<t.L){var u=t.ed;for(a=0;4>a;++a){var f;if(t.Qa.Cb){var c=t.Qa.Lb[a];t.Qa.Fb||(c+=u.Tb)}else c=u.Tb;for(f=0;1>=f;++f){var h=t.gd[a][f],l=c;if(u.Pc&&(l+=u.vd[0],f&&(l+=u.od[0])),0<(l=0>l?0:63<l?63:l)){var v=l;0<u.wb&&(v=4<u.wb?v>>2:v>>1)>9-u.wb&&(v=9-u.wb),1>v&&(v=1),h.dd=v,h.tc=2*l+v,h.ld=40<=l?2:15<=l?1:0}else h.tc=0;h.La=f}}}a=0}else Yt(t,6,"Frame setup failed"),a=t.a;if(a=0==a){if(a){t.$c=0,0<t.Aa||(t.Ic=Ue);t:{u=4*(v=t.za);var d=32*v,w=v+1,m=0<t.L?v*(0<t.Aa?2:1):0,b=(2==t.Aa?2:1)*v;if((h=u+832+(f=3*(16*(a=t.Ic)+De[t.L])/2*d)+(c=null!=t.Fa&&0<t.Fa.length?t.Kc.c*t.Kc.i:0))!=h)a=0;else{if(h>t.Vb){if(t.Vb=0,t.Ec=s(h),t.Fc=0,null==t.Ec){a=Yt(t,1,"no memory during frame initialization.");break t}t.Vb=h}l=t.Fc,t.Ac=h=t.Ec,t.Bc=l,l+=u,t.Gd=o(d,Wt),t.Hd=0,t.rb=o(w+1,Dt),t.sb=1,t.wa=m?o(m,Ct):null,t.Y=0,t.D.Nb=0,t.D.wa=t.wa,t.D.Y=t.Y,0<t.Aa&&(t.D.Y+=v),n(!0),t.oc=h,t.pc=l,l+=832,t.ya=o(b,Ut),t.aa=0,t.D.ya=t.ya,t.D.aa=t.aa,2==t.Aa&&(t.D.aa+=v),t.R=16*v,t.B=8*v,v=(d=De[t.L])*t.R,d=d/2*t.B,t.sa=h,t.ta=l+v,t.qa=t.sa,t.ra=t.ta+16*a*t.R+d,t.Ha=t.qa,t.Ia=t.ra+8*a*t.B+d,t.$c=0,l+=f,t.mb=c?h:null,t.nb=c?l:null,n(l+c<=t.Fc+t.Vb),Zt(t),e(t.Ac,t.Bc,0,u),a=1}}if(a){if(i.ka=0,i.y=t.sa,i.O=t.ta,i.f=t.qa,i.N=t.ra,i.ea=t.Ha,i.Vd=t.Ia,i.fa=t.R,i.Rc=t.B,i.F=null,i.J=0,!Pr){for(a=-255;255>=a;++a)qr[255+a]=0>a?-a:a;for(a=-1020;1020>=a;++a)jr[1020+a]=-128>a?-128:127<a?127:a;for(a=-112;112>=a;++a)Mr[112+a]=-16>a?-16:15<a?15:a;for(a=-255;510>=a;++a)Er[255+a]=0>a?0:255<a?255:a;Pr=1}sr=cn,or=on,ur=an,fr=un,cr=fn,ar=sn,hr=$n,lr=Kn,vr=Qn,dr=ti,wr=Xn,mr=Zn,br=ni,pr=ii,Nr=Wn,Lr=Hn,gr=_n,Ar=Gn,le[0]=Sn,le[1]=ln,le[2]=yn,le[3]=kn,le[4]=xn,le[5]=jn,le[6]=qn,le[7]=Mn,le[8]=Pn,le[9]=En,he[0]=pn,he[1]=dn,he[2]=wn,he[3]=mn,he[4]=Nn,he[5]=Ln,he[6]=gn,ve[0]=Bn,ve[1]=vn,ve[2]=On,ve[3]=In,ve[4]=Tn,ve[5]=Rn,ve[6]=Cn,a=1}else a=0}a&&(a=function(t,i){for(t.M=0;t.M<t.Va;++t.M){var o,a=t.Jc[t.M&t.Xb],u=t.m,f=t;for(o=0;o<f.za;++o){var c=u,h=f,l=h.Ac,v=h.Bc+4*o,d=h.zc,w=h.ya[h.aa+o];if(w.$b=h.Qa.Bb?j(c,h.Pa.jb[0])?2+j(c,h.Pa.jb[2]):j(c,h.Pa.jb[1]):0,h.kc&&(w.Ad=j(c,h.Bd)),w.Za=!j(c,145)+0,w.Za){var m=w.Ob,b=0;for(h=0;4>h;++h){var p,N=d[0+h];for(p=0;4>p;++p){for(var L=oe[j(c,(N=ue[l[v+p]][N])[0])];0<L;)L=oe[2*L+j(c,N[L])];l[v+p]=N=-L}r(m,b,l,v,4),b+=4,d[0+h]=N}}else N=j(c,156)?j(c,128)?1:3:j(c,163)?2:0,w.Ob[0]=N,e(l,v,N,4),e(d,0,N,4);w.Dd=j(c,142)?j(c,114)?j(c,183)?1:3:2:0}if(f.m.Ka)return Yt(t,7,"Premature end-of-partition0 encountered.");for(;t.ja<t.za;++t.ja){if(f=a,c=(u=t).rb[u.sb-1],l=u.rb[u.sb+u.ja],o=u.ya[u.aa+u.ja],v=u.kc?o.Ad:0)c.la=l.la=0,o.Za||(c.Na=l.Na=0),o.Hc=0,o.Gc=0,o.ia=0;else{var g,A;if(c=l,l=f,v=u.Pa.Xc,w=u.pb[(d=u.ya[u.aa+u.ja]).$b],b=u.rb[u.sb-1],N=p=0,e(h=d.ad,m=0,0,384),d.Za)var y=0,k=v[3];else{L=s(16);var S=c.Na+b.Na;if(S=re(l,v[1],S,w.Eb,0,L,0),c.Na=b.Na=(0<S)+0,1<S)sr(L,0,h,m);else{var x=L[0]+3>>3;for(L=0;256>L;L+=16)h[m+L]=x}y=1,k=v[0]}var q=15&c.la,M=15&b.la;for(L=0;4>L;++L){var E=1&M;for(x=A=0;4>x;++x)q=q>>1|(E=(S=re(l,k,S=E+(1&q),w.Sc,y,h,m))>y)<<7,A=A<<2|(3<S?3:1<S?2:0!=h[m+0]),m+=16;q>>=4,M=M>>1|E<<7,p=(p<<8|A)>>>0}for(k=q,y=M>>4,g=0;4>g;g+=2){for(A=0,q=c.la>>4+g,M=b.la>>4+g,L=0;2>L;++L){for(E=1&M,x=0;2>x;++x)q=q>>1|(E=0<(S=re(l,v[2],S=E+(1&q),w.Qc,0,h,m)))<<3,A=A<<2|(3<S?3:1<S?2:0!=h[m+0]),m+=16;q>>=2,M=M>>1|E<<5}N|=A<<4*g,k|=q<<4<<g,y|=(240&M)<<g}c.la=k,b.la=y,d.Hc=p,d.Gc=N,d.ia=43690&N?0:w.ia,v=!(p|N)}if(0<u.L&&(u.wa[u.Y+u.ja]=u.gd[o.$b][o.Za],u.wa[u.Y+u.ja].La|=!v),f.Ka)return Yt(t,7,"Premature end-of-file encountered.")}if(Zt(t),u=i,f=1,o=(a=t).D,c=0<a.L&&a.M>=a.zb&&a.M<=a.Va,0==a.Aa)t:{if(o.M=a.M,o.uc=c,Fi(a,o),f=1,o=(A=a.D).Nb,c=(N=De[a.L])*a.R,v=a.sa,d=a.ta-c+(L=16*o*a.R),w=a.qa,h=a.ra-(l=N/2*a.B)+(x=8*o*a.B),m=a.Ha,b=a.Ia-l+x,M=0==(q=A.M),p=q>=a.Va-1,2==a.Aa&&Fi(a,A),A.uc)for(E=(S=a).D.M,n(S.D.uc),A=S.yb;A<S.Hb;++A){k=E;var P=(O=(U=S).D).Nb,O=O.wa[O.Y+(y=A)],I=U.sa,F=U.ta+16*P*(g=U.R)+16*y,B=O.dd,R=O.tc;if(0!=R)if(n(3<=R),1==U.L)0<y&&Lr(I,F,g,R+4),O.La&&Ar(I,F,g,R),0<k&&Nr(I,F,g,R+4),O.La&&gr(I,F,g,R);else{var T=U.B,C=U.qa,D=U.ra+8*P*T+8*y,z=U.Ha,U=U.Ia+8*P*T+8*y;P=O.ld,0<y&&(lr(I,F,g,R+4,B,P),dr(C,D,z,U,T,R+4,B,P)),O.La&&(mr(I,F,g,R,B,P),pr(C,D,z,U,T,R,B,P)),0<k&&(hr(I,F,g,R+4,B,P),vr(C,D,z,U,T,R+4,B,P)),O.La&&(wr(I,F,g,R,B,P),br(C,D,z,U,T,R,B,P))}}if(a.ia&&alert("todo:DitherRow"),null!=u.put){if(A=16*q,q=16*(q+1),M?(u.y=a.sa,u.O=a.ta+L,u.f=a.qa,u.N=a.ra+x,u.ea=a.Ha,u.W=a.Ia+x):(A-=N,u.y=v,u.O=d,u.f=w,u.N=h,u.ea=m,u.W=b),p||(q-=N),q>u.o&&(q=u.o),u.F=null,u.J=null,null!=a.Fa&&0<a.Fa.length&&A<q&&(u.J=li(a,u,A,q-A),u.F=a.mb,null==u.F&&0==u.F.length)){f=Yt(a,3,"Could not decode alpha data.");break t}A<u.j&&(N=u.j-A,A=u.j,n(!(1&N)),u.O+=a.R*N,u.N+=a.B*(N>>1),u.W+=a.B*(N>>1),null!=u.F&&(u.J+=u.width*N)),A<q&&(u.O+=u.v,u.N+=u.v>>1,u.W+=u.v>>1,null!=u.F&&(u.J+=u.v),u.ka=A-u.j,u.U=u.va-u.v,u.T=q-A,f=u.put(u))}o+1!=a.Ic||p||(r(a.sa,a.ta-c,v,d+16*a.R,c),r(a.qa,a.ra-l,w,h+8*a.B,l),r(a.Ha,a.Ia-l,m,b+8*a.B,l))}if(!f)return Yt(t,6,"Output aborted.")}return 1}(t,i)),null!=i.bc&&i.bc(i),a&=1}return a?(t.cb=0,a):0}function tn(t,n,i,r,e){t[n+i+32*r]=-256&(e=t[n+i+32*r]+(e>>3))?0>e?0:255:e}function nn(t,n,i,r,e,s){tn(t,n,0,i,r+e),tn(t,n,1,i,r+s),tn(t,n,2,i,r-s),tn(t,n,3,i,r-e)}function rn(t){return(20091*t>>16)+t}function en(t,n,i,r){var e,o=0,a=s(16);for(e=0;4>e;++e){var u=t[n+0]+t[n+8],f=t[n+0]-t[n+8],c=(35468*t[n+4]>>16)-rn(t[n+12]),h=rn(t[n+4])+(35468*t[n+12]>>16);a[o+0]=u+h,a[o+1]=f+c,a[o+2]=f-c,a[o+3]=u-h,o+=4,n++}for(e=o=0;4>e;++e)u=(t=a[o+0]+4)+a[o+8],f=t-a[o+8],c=(35468*a[o+4]>>16)-rn(a[o+12]),tn(i,r,0,0,u+(h=rn(a[o+4])+(35468*a[o+12]>>16))),tn(i,r,1,0,f+c),tn(i,r,2,0,f-c),tn(i,r,3,0,u-h),o++,r+=32}function sn(t,n,i,r){var e=t[n+0]+4,s=35468*t[n+4]>>16,o=rn(t[n+4]),a=35468*t[n+1]>>16;nn(i,r,0,e+o,t=rn(t[n+1]),a),nn(i,r,1,e+s,t,a),nn(i,r,2,e-s,t,a),nn(i,r,3,e-o,t,a)}function on(t,n,i,r,e){en(t,n,i,r),e&&en(t,n+16,i,r+4)}function an(t,n,i,r){or(t,n+0,i,r,1),or(t,n+32,i,r+128,1)}function un(t,n,i,r){var e;for(t=t[n+0]+4,e=0;4>e;++e)for(n=0;4>n;++n)tn(i,r,n,e,t)}function fn(t,n,i,r){t[n+0]&&fr(t,n+0,i,r),t[n+16]&&fr(t,n+16,i,r+4),t[n+32]&&fr(t,n+32,i,r+128),t[n+48]&&fr(t,n+48,i,r+128+4)}function cn(t,n,i,r){var e,o=s(16);for(e=0;4>e;++e){var a=t[n+0+e]+t[n+12+e],u=t[n+4+e]+t[n+8+e],f=t[n+4+e]-t[n+8+e],c=t[n+0+e]-t[n+12+e];o[0+e]=a+u,o[8+e]=a-u,o[4+e]=c+f,o[12+e]=c-f}for(e=0;4>e;++e)a=(t=o[0+4*e]+3)+o[3+4*e],f=o[1+4*e]-o[2+4*e],c=t-o[3+4*e],i[r+0]=a+(u=o[1+4*e]+o[2+4*e])>>3,i[r+16]=c+f>>3,i[r+32]=a-u>>3,i[r+48]=c-f>>3,r+=64}function hn(t,n,i){var r,e=n-32,s=Fr,o=255-t[e-1];for(r=0;r<i;++r){var a,u=s,f=o+t[n-1];for(a=0;a<i;++a)t[n+a]=u[f+t[e+a]];n+=32}}function ln(t,n){hn(t,n,4)}function vn(t,n){hn(t,n,8)}function dn(t,n){hn(t,n,16)}function wn(t,n){var i;for(i=0;16>i;++i)r(t,n+32*i,t,n-32,16)}function mn(t,n){var i;for(i=16;0<i;--i)e(t,n,t[n-1],16),n+=32}function bn(t,n,i){var r;for(r=0;16>r;++r)e(n,i+32*r,t,16)}function pn(t,n){var i,r=16;for(i=0;16>i;++i)r+=t[n-1+32*i]+t[n+i-32];bn(r>>5,t,n)}function Nn(t,n){var i,r=8;for(i=0;16>i;++i)r+=t[n-1+32*i];bn(r>>4,t,n)}function Ln(t,n){var i,r=8;for(i=0;16>i;++i)r+=t[n+i-32];bn(r>>4,t,n)}function gn(t,n){bn(128,t,n)}function An(t,n,i){return t+2*n+i+2>>2}function yn(t,n){var i,e=n-32;for(e=new Uint8Array([An(t[e-1],t[e+0],t[e+1]),An(t[e+0],t[e+1],t[e+2]),An(t[e+1],t[e+2],t[e+3]),An(t[e+2],t[e+3],t[e+4])]),i=0;4>i;++i)r(t,n+32*i,e,0,e.length)}function kn(t,n){var i=t[n-1],r=t[n-1+32],e=t[n-1+64],s=t[n-1+96];M(t,n+0,16843009*An(t[n-1-32],i,r)),M(t,n+32,16843009*An(i,r,e)),M(t,n+64,16843009*An(r,e,s)),M(t,n+96,16843009*An(e,s,s))}function Sn(t,n){var i,r=4;for(i=0;4>i;++i)r+=t[n+i-32]+t[n-1+32*i];for(r>>=3,i=0;4>i;++i)e(t,n+32*i,r,4)}function xn(t,n){var i=t[n-1+0],r=t[n-1+32],e=t[n-1+64],s=t[n-1-32],o=t[n+0-32],a=t[n+1-32],u=t[n+2-32],f=t[n+3-32];t[n+0+96]=An(r,e,t[n-1+96]),t[n+1+96]=t[n+0+64]=An(i,r,e),t[n+2+96]=t[n+1+64]=t[n+0+32]=An(s,i,r),t[n+3+96]=t[n+2+64]=t[n+1+32]=t[n+0+0]=An(o,s,i),t[n+3+64]=t[n+2+32]=t[n+1+0]=An(a,o,s),t[n+3+32]=t[n+2+0]=An(u,a,o),t[n+3+0]=An(f,u,a)}function qn(t,n){var i=t[n+1-32],r=t[n+2-32],e=t[n+3-32],s=t[n+4-32],o=t[n+5-32],a=t[n+6-32],u=t[n+7-32];t[n+0+0]=An(t[n+0-32],i,r),t[n+1+0]=t[n+0+32]=An(i,r,e),t[n+2+0]=t[n+1+32]=t[n+0+64]=An(r,e,s),t[n+3+0]=t[n+2+32]=t[n+1+64]=t[n+0+96]=An(e,s,o),t[n+3+32]=t[n+2+64]=t[n+1+96]=An(s,o,a),t[n+3+64]=t[n+2+96]=An(o,a,u),t[n+3+96]=An(a,u,u)}function jn(t,n){var i=t[n-1+0],r=t[n-1+32],e=t[n-1+64],s=t[n-1-32],o=t[n+0-32],a=t[n+1-32],u=t[n+2-32],f=t[n+3-32];t[n+0+0]=t[n+1+64]=s+o+1>>1,t[n+1+0]=t[n+2+64]=o+a+1>>1,t[n+2+0]=t[n+3+64]=a+u+1>>1,t[n+3+0]=u+f+1>>1,t[n+0+96]=An(e,r,i),t[n+0+64]=An(r,i,s),t[n+0+32]=t[n+1+96]=An(i,s,o),t[n+1+32]=t[n+2+96]=An(s,o,a),t[n+2+32]=t[n+3+96]=An(o,a,u),t[n+3+32]=An(a,u,f)}function Mn(t,n){var i=t[n+0-32],r=t[n+1-32],e=t[n+2-32],s=t[n+3-32],o=t[n+4-32],a=t[n+5-32],u=t[n+6-32],f=t[n+7-32];t[n+0+0]=i+r+1>>1,t[n+1+0]=t[n+0+64]=r+e+1>>1,t[n+2+0]=t[n+1+64]=e+s+1>>1,t[n+3+0]=t[n+2+64]=s+o+1>>1,t[n+0+32]=An(i,r,e),t[n+1+32]=t[n+0+96]=An(r,e,s),t[n+2+32]=t[n+1+96]=An(e,s,o),t[n+3+32]=t[n+2+96]=An(s,o,a),t[n+3+64]=An(o,a,u),t[n+3+96]=An(a,u,f)}function En(t,n){var i=t[n-1+0],r=t[n-1+32],e=t[n-1+64],s=t[n-1+96];t[n+0+0]=i+r+1>>1,t[n+2+0]=t[n+0+32]=r+e+1>>1,t[n+2+32]=t[n+0+64]=e+s+1>>1,t[n+1+0]=An(i,r,e),t[n+3+0]=t[n+1+32]=An(r,e,s),t[n+3+32]=t[n+1+64]=An(e,s,s),t[n+3+64]=t[n+2+64]=t[n+0+96]=t[n+1+96]=t[n+2+96]=t[n+3+96]=s}function Pn(t,n){var i=t[n-1+0],r=t[n-1+32],e=t[n-1+64],s=t[n-1+96],o=t[n-1-32],a=t[n+0-32],u=t[n+1-32],f=t[n+2-32];t[n+0+0]=t[n+2+32]=i+o+1>>1,t[n+0+32]=t[n+2+64]=r+i+1>>1,t[n+0+64]=t[n+2+96]=e+r+1>>1,t[n+0+96]=s+e+1>>1,t[n+3+0]=An(a,u,f),t[n+2+0]=An(o,a,u),t[n+1+0]=t[n+3+32]=An(i,o,a),t[n+1+32]=t[n+3+64]=An(r,i,o),t[n+1+64]=t[n+3+96]=An(e,r,i),t[n+1+96]=An(s,e,r)}function On(t,n){var i;for(i=0;8>i;++i)r(t,n+32*i,t,n-32,8)}function In(t,n){var i;for(i=0;8>i;++i)e(t,n,t[n-1],8),n+=32}function Fn(t,n,i){var r;for(r=0;8>r;++r)e(n,i+32*r,t,8)}function Bn(t,n){var i,r=8;for(i=0;8>i;++i)r+=t[n+i-32]+t[n-1+32*i];Fn(r>>4,t,n)}function Rn(t,n){var i,r=4;for(i=0;8>i;++i)r+=t[n+i-32];Fn(r>>3,t,n)}function Tn(t,n){var i,r=4;for(i=0;8>i;++i)r+=t[n-1+32*i];Fn(r>>3,t,n)}function Cn(t,n){Fn(128,t,n)}function Dn(t,n,i){var r=t[n-i],e=t[n+0],s=3*(e-r)+Or[1020+t[n-2*i]-t[n+i]],o=Ir[112+(s+4>>3)];t[n-i]=Fr[255+r+Ir[112+(s+3>>3)]],t[n+0]=Fr[255+e-o]}function zn(t,n,i,r){return Br[255+t[n-2*i]-t[n-i]]>r||Br[255+t[n+i]-t[n+0]]>r}function Un(t,n,i,r){return 4*Br[255+t[n-i]-t[n+0]]+Br[255+t[n-2*i]-t[n+i]]<=r}function Vn(t,n,i,r,e){var s=t[n-3*i],o=t[n-2*i],a=t[n-i],u=t[n+0],f=t[n+i],c=t[n+2*i];return 4*Br[255+a-u]+Br[255+o-f]>r?0:Br[255+t[n-4*i]-s]<=e&&Br[255+s-o]<=e&&Br[255+o-a]<=e&&Br[255+t[n+3*i]-c]<=e&&Br[255+c-f]<=e&&Br[255+f-u]<=e}function Wn(t,n,i,r){var e=2*r+1;for(r=0;16>r;++r)Un(t,n+r,i,e)&&Dn(t,n+r,i)}function Hn(t,n,i,r){var e=2*r+1;for(r=0;16>r;++r)Un(t,n+r*i,1,e)&&Dn(t,n+r*i,1)}function _n(t,n,i,r){var e;for(e=3;0<e;--e)Wn(t,n+=4*i,i,r)}function Gn(t,n,i,r){var e;for(e=3;0<e;--e)Hn(t,n+=4,i,r)}function Jn(t,n,i,r,e,s,o,a){for(s=2*s+1;0<e--;){if(Vn(t,n,i,s,o))if(zn(t,n,i,a))Dn(t,n,i);else{var u=t,f=n,c=i,h=u[f-2*c],l=u[f-c],v=u[f+0],d=u[f+c],w=u[f+2*c],m=27*(p=Or[1020+3*(v-l)+Or[1020+h-d]])+63>>7,b=18*p+63>>7,p=9*p+63>>7;u[f-3*c]=Fr[255+u[f-3*c]+p],u[f-2*c]=Fr[255+h+b],u[f-c]=Fr[255+l+m],u[f+0]=Fr[255+v-m],u[f+c]=Fr[255+d-b],u[f+2*c]=Fr[255+w-p]}n+=r}}function Yn(t,n,i,r,e,s,o,a){for(s=2*s+1;0<e--;){if(Vn(t,n,i,s,o))if(zn(t,n,i,a))Dn(t,n,i);else{var u=t,f=n,c=i,h=u[f-c],l=u[f+0],v=u[f+c],d=Ir[112+(4+(w=3*(l-h))>>3)],w=Ir[112+(w+3>>3)],m=d+1>>1;u[f-2*c]=Fr[255+u[f-2*c]+m],u[f-c]=Fr[255+h+w],u[f+0]=Fr[255+l-d],u[f+c]=Fr[255+v-m]}n+=r}}function $n(t,n,i,r,e,s){Jn(t,n,i,1,16,r,e,s)}function Kn(t,n,i,r,e,s){Jn(t,n,1,i,16,r,e,s)}function Xn(t,n,i,r,e,s){var o;for(o=3;0<o;--o)Yn(t,n+=4*i,i,1,16,r,e,s)}function Zn(t,n,i,r,e,s){var o;for(o=3;0<o;--o)Yn(t,n+=4,1,i,16,r,e,s)}function Qn(t,n,i,r,e,s,o,a){Jn(t,n,e,1,8,s,o,a),Jn(i,r,e,1,8,s,o,a)}function ti(t,n,i,r,e,s,o,a){Jn(t,n,1,e,8,s,o,a),Jn(i,r,1,e,8,s,o,a)}function ni(t,n,i,r,e,s,o,a){Yn(t,n+4*e,e,1,8,s,o,a),Yn(i,r+4*e,e,1,8,s,o,a)}function ii(t,n,i,r,e,s,o,a){Yn(t,n+4,1,e,8,s,o,a),Yn(i,r+4,1,e,8,s,o,a)}function ri(){this.ba=new ot,this.ec=[],this.cc=[],this.Mc=[],this.Dc=this.Nc=this.dc=this.fc=0,this.Oa=new ut,this.memory=0,this.Ib="OutputFunc",this.Jb="OutputAlphaFunc",this.Nd="OutputRowFunc"}function ei(){this.data=[],this.offset=this.kd=this.ha=this.w=0,this.na=[],this.xa=this.gb=this.Ja=this.Sa=this.P=0}function si(){this.nc=this.Ea=this.b=this.hc=0,this.K=[],this.w=0}function oi(){this.ua=0,this.Wa=new B,this.vb=new B,this.md=this.xc=this.wc=0,this.vc=[],this.Wb=0,this.Ya=new v,this.yc=new h}function ai(){this.xb=this.a=0,this.l=new Gt,this.ca=new ot,this.V=[],this.Ba=0,this.Ta=[],this.Ua=0,this.m=new g,this.Pb=0,this.wd=new g,this.Ma=this.$=this.C=this.i=this.c=this.xd=0,this.s=new oi,this.ab=0,this.gc=o(4,si),this.Oc=0}function ui(){this.Lc=this.Z=this.$a=this.i=this.c=0,this.l=new Gt,this.ic=0,this.ca=[],this.tb=0,this.qd=null,this.rd=0}function fi(t,n,i,r,e,s,o){for(t=null==t?0:t[n+0],n=0;n<o;++n)e[s+n]=t+i[r+n]&255,t=e[s+n]}function ci(t,n,i,r,e,s,o){var a;if(null==t)fi(null,null,i,r,e,s,o);else for(a=0;a<o;++a)e[s+a]=t[n+a]+i[r+a]&255}function hi(t,n,i,r,e,s,o){if(null==t)fi(null,null,i,r,e,s,o);else{var a,u=t[n+0],f=u,c=u;for(a=0;a<o;++a)f=c+(u=t[n+a])-f,c=i[r+a]+(-256&f?0>f?0:255:f)&255,f=u,e[s+a]=c}}function li(t,i,e,o){var a=i.width,u=i.o;if(n(null!=t&&null!=i),0>e||0>=o||e+o>u)return null;if(!t.Cc){if(null==t.ga){var f;if(t.ga=new ui,(f=null==t.ga)||(f=i.width*i.o,n(0==t.Gb.length),t.Gb=s(f),t.Uc=0,null==t.Gb?f=0:(t.mb=t.Gb,t.nb=t.Uc,t.rc=null,f=1),f=!f),!f){var c=t.Fa,h=t.P,l=t.qc,v=t.mb,d=t.nb,w=h+1,m=l-1,p=(f=t.ga).l;if(n(null!=c&&null!=v&&null!=i),me[0]=null,me[1]=fi,me[2]=ci,me[3]=hi,f.ca=v,f.tb=d,f.c=i.width,f.i=i.height,n(0<f.c&&0<f.i),1>=l)i=0;else if(f.$a=c[h+0]>>0&3,f.Z=c[h+0]>>2&3,f.Lc=c[h+0]>>4&3,h=c[h+0]>>6&3,0>f.$a||1<f.$a||4<=f.Z||1<f.Lc||h)i=0;else if(p.put=vt,p.ac=lt,p.bc=dt,p.ma=f,p.width=i.width,p.height=i.height,p.Da=i.Da,p.v=i.v,p.va=i.va,p.j=i.j,p.o=i.o,f.$a)t:{n(1==f.$a),i=jt();n:for(;;){if(null==i){i=0;break t}if(n(null!=f),f.mc=i,i.c=f.c,i.i=f.i,i.l=f.l,i.l.ma=f,i.l.width=f.c,i.l.height=f.i,i.a=0,b(i.m,c,w,m),!Mt(f.c,f.i,1,i,null))break n;if(1==i.ab&&3==i.gc[0].hc&&yt(i.s)?(f.ic=1,c=i.c*i.i,i.Ta=null,i.Ua=0,i.V=s(c),i.Ba=0,null==i.V?(i.a=1,i=0):i=1):(f.ic=0,i=Et(i,f.c)),!i)break n;i=1;break t}f.mc=null,i=0}else i=m>=f.c*f.i;f=!i}if(f)return null;1!=t.ga.Lc?t.Ga=0:o=u-e}n(null!=t.ga),n(e+o<=u);t:{if(i=(c=t.ga).c,u=c.l.o,0==c.$a){if(w=t.rc,m=t.Vc,p=t.Fa,l=t.mb,v=t.nb+e*i,n((h=t.P+1+e*i)<=t.P+t.qc),0!=c.Z)for(n(null!=me[c.Z]),f=0;f<o;++f)me[c.Z](w,m,p,h,l,v,i),w=l,m=v,v+=i,h+=i;else for(f=0;f<o;++f)r(l,v,p,h,i),w=l,m=v,v+=i,h+=i;t.rc=w,t.Vc=m}else{if(n(null!=c.mc),i=e+o,n(null!=(f=c.mc)),n(i<=f.i),f.C>=i)i=1;else if(c.ic||bi(),c.ic){c=f.V,w=f.Ba;var N=f.i,L=(p=1,h=f.$/(m=f.c),l=f.$%m,v=f.m,d=f.s,f.$),g=m*N,A=m*i,k=d.wc,x=L<A?Lt(d,l,h):null;n(L<=g),n(i<=N),n(yt(d));n:for(;;){for(;!v.h&&L<A;){if(l&k||(x=Lt(d,l,h)),n(null!=x),S(v),256>(N=pt(x.G[0],x.H[0],v)))c[w+L]=N,++L,++l>=m&&(l=0,++h<=i&&!(h%16)&&St(f,h));else{if(!(280>N)){p=0;break n}N=mt(N-256,v);var q,j=pt(x.G[4],x.H[4],v);if(S(v),!(L>=(j=bt(m,j=mt(j,v)))&&g-L>=N)){p=0;break n}for(q=0;q<N;++q)c[w+L+q]=c[w+L+q-j];for(L+=N,l+=N;l>=m;)l-=m,++h<=i&&!(h%16)&&St(f,h);L<A&&l&k&&(x=Lt(d,l,h))}n(v.h==y(v))}St(f,h>i?i:h);break n}!p||v.h&&L<g?(p=0,f.a=v.h?5:3):f.$=L,i=p}else i=xt(f,f.V,f.Ba,f.c,f.i,i,Pt);if(!i){o=0;break t}}e+o>=u&&(t.Cc=1),o=1}if(!o)return null;if(t.Cc&&(null!=(o=t.ga)&&(o.mc=null),t.ga=null,0<t.Ga))return alert("todo:WebPDequantizeLevels"),null}return t.nb+e*a}function vi(t,n,i,r,e,s){for(;0<e--;){var o,a=t,u=n+(i?1:0),f=t,c=n+(i?0:3);for(o=0;o<r;++o){var h=f[c+4*o];255!=h&&(a[u+4*o+0]=a[u+4*o+0]*(h*=32897)>>23,a[u+4*o+1]=a[u+4*o+1]*h>>23,a[u+4*o+2]=a[u+4*o+2]*h>>23)}n+=s}}function di(t,n,i,r,e){for(;0<r--;){var s;for(s=0;s<i;++s){var o=t[n+2*s+0],a=15&(f=t[n+2*s+1]),u=4369*a,f=(240&f|f>>4)*u>>16;t[n+2*s+0]=(240&o|o>>4)*u>>16&240|(15&o|o<<4)*u>>16>>4&15,t[n+2*s+1]=240&f|a}n+=e}}function wi(t,n,i,r,e,s,o,a){var u,f,c=255;for(f=0;f<e;++f){for(u=0;u<r;++u){var h=t[n+u];s[o+4*u]=h,c&=h}n+=i,o+=a}return 255!=c}function mi(t,n,i,r,e){var s;for(s=0;s<e;++s)i[r+s]=t[n+s]>>8}function bi(){yr=vi,kr=di,Sr=wi,xr=mi}function pi(i,r,e){t[i]=function(t,i,s,o,a,u,f,c,h,l,v,d,w,m,b,p,N){var L,g=N-1>>1,A=a[u+0]|f[c+0]<<16,y=h[l+0]|v[d+0]<<16;n(null!=t);var k=3*A+y+131074>>2;for(r(t[i+0],255&k,k>>16,w,m),null!=s&&r(s[o+0],255&(k=3*y+A+131074>>2),k>>16,b,p),L=1;L<=g;++L){var S=a[u+L]|f[c+L]<<16,x=h[l+L]|v[d+L]<<16,q=A+S+y+x+524296,j=q+2*(S+y)>>3;k=j+A>>1,A=(q=q+2*(A+x)>>3)+S>>1,r(t[i+2*L-1],255&k,k>>16,w,m+(2*L-1)*e),r(t[i+2*L-0],255&A,A>>16,w,m+(2*L-0)*e),null!=s&&(A=j+x>>1,r(s[o+2*L-1],255&(k=q+y>>1),k>>16,b,p+(2*L-1)*e),r(s[o+2*L+0],255&A,A>>16,b,p+(2*L+0)*e)),A=S,y=x}1&N||(r(t[i+N-1],255&(k=3*A+y+131074>>2),k>>16,w,m+(N-1)*e),null!=s&&r(s[o+N-1],255&(k=3*y+A+131074>>2),k>>16,b,p+(N-1)*e))}}function Ni(){be[Rr]=pe,be[Tr]=Le,be[Cr]=Ne,be[Dr]=ge,be[zr]=Ae,be[Ur]=ye,be[Vr]=ke,be[Wr]=Le,be[Hr]=ge,be[_r]=Ae,be[Gr]=ye}function Li(t){return t&~Ee?0>t?0:255:t>>Me}function gi(t,n){return Li((19077*t>>8)+(26149*n>>8)-14234)}function Ai(t,n,i){return Li((19077*t>>8)-(6419*n>>8)-(13320*i>>8)+8708)}function yi(t,n){return Li((19077*t>>8)+(33050*n>>8)-17685)}function ki(t,n,i,r,e){r[e+0]=gi(t,i),r[e+1]=Ai(t,n,i),r[e+2]=yi(t,n)}function Si(t,n,i,r,e){r[e+0]=yi(t,n),r[e+1]=Ai(t,n,i),r[e+2]=gi(t,i)}function xi(t,n,i,r,e){var s=Ai(t,n,i);n=s<<3&224|yi(t,n)>>3,r[e+0]=248&gi(t,i)|s>>5,r[e+1]=n}function qi(t,n,i,r,e){var s=240&yi(t,n)|15;r[e+0]=240&gi(t,i)|Ai(t,n,i)>>4,r[e+1]=s}function ji(t,n,i,r,e){r[e+0]=255,ki(t,n,i,r,e+1)}function Mi(t,n,i,r,e){Si(t,n,i,r,e),r[e+3]=255}function Ei(t,n,i,r,e){ki(t,n,i,r,e),r[e+3]=255}function _t(t,n){return 0>t?0:t>n?n:t}function Pi(n,i,r){t[n]=function(t,n,e,s,o,a,u,f,c){for(var h=f+(-2&c)*r;f!=h;)i(t[n+0],e[s+0],o[a+0],u,f),i(t[n+1],e[s+0],o[a+0],u,f+r),n+=2,++s,++a,f+=2*r;1&c&&i(t[n+0],e[s+0],o[a+0],u,f)}}function Oi(t,n,i){return 0==i?0==t?0==n?6:5:0==n?4:0:i}function Ii(t,n,i,r,e){switch(t>>>30){case 3:or(n,i,r,e,0);break;case 2:ar(n,i,r,e);break;case 1:fr(n,i,r,e)}}function Fi(t,n){var i,s,o=n.M,a=n.Nb,u=t.oc,f=t.pc+40,c=t.oc,h=t.pc+584,l=t.oc,v=t.pc+600;for(i=0;16>i;++i)u[f+32*i-1]=129;for(i=0;8>i;++i)c[h+32*i-1]=129,l[v+32*i-1]=129;for(0<o?u[f-1-32]=c[h-1-32]=l[v-1-32]=129:(e(u,f-32-1,127,21),e(c,h-32-1,127,9),e(l,v-32-1,127,9)),s=0;s<t.za;++s){var d=n.ya[n.aa+s];if(0<s){for(i=-1;16>i;++i)r(u,f+32*i-4,u,f+32*i+12,4);for(i=-1;8>i;++i)r(c,h+32*i-4,c,h+32*i+4,4),r(l,v+32*i-4,l,v+32*i+4,4)}var w=t.Gd,m=t.Hd+s,b=d.ad,p=d.Hc;if(0<o&&(r(u,f-32,w[m].y,0,16),r(c,h-32,w[m].f,0,8),r(l,v-32,w[m].ea,0,8)),d.Za){var N=u,L=f-32+16;for(0<o&&(s>=t.za-1?e(N,L,w[m].y[15],4):r(N,L,w[m+1].y,0,4)),i=0;4>i;i++)N[L+128+i]=N[L+256+i]=N[L+384+i]=N[L+0+i];for(i=0;16>i;++i,p<<=2)le[d.Ob[i]](N=u,L=f+Ce[i]),Ii(p,b,16*+i,N,L)}else if(N=Oi(s,o,d.Ob[0]),he[N](u,f),0!=p)for(i=0;16>i;++i,p<<=2)Ii(p,b,16*+i,u,f+Ce[i]);for(i=d.Gc,N=Oi(s,o,d.Dd),ve[N](c,h),ve[N](l,v),p=b,N=c,L=h,255&(d=i>>0)&&(170&d?ur(p,256,N,L):cr(p,256,N,L)),d=l,p=v,255&(i>>=8)&&(170&i?ur(b,320,d,p):cr(b,320,d,p)),o<t.Ub-1&&(r(w[m].y,0,u,f+480,16),r(w[m].f,0,c,h+224,8),r(w[m].ea,0,l,v+224,8)),w=t.sa,m=t.ta+16*s+16*a*t.R,b=t.qa,d=t.ra+8*s+(i=8*a*t.B),p=t.Ha,N=t.Ia+8*s+i,i=0;16>i;++i)r(w,m+i*t.R,u,f+32*i,16);for(i=0;8>i;++i)r(b,d+i*t.B,c,h+32*i,8),r(p,N+i*t.B,l,v+32*i,8)}}function Bi(t,r,e,s,o,a,u,f,c){var h=[0],l=[0],v=0,d=null!=c?c.kd:0,w=null!=c?c:new ei;if(null==t||12>e)return 7;w.data=t,w.w=r,w.ha=e,r=[r],e=[e],w.gb=[w.gb];t:{var m=r,p=e,N=w.gb;if(n(null!=t),n(null!=p),n(null!=N),N[0]=0,12<=p[0]&&!i(t,m[0],"RIFF")){if(i(t,m[0]+8,"WEBP")){N=3;break t}var L=O(t,m[0]+4);if(12>L||4294967286<L){N=3;break t}if(d&&L>p[0]-8){N=7;break t}N[0]=L,m[0]+=12,p[0]-=12}N=0}if(0!=N)return N;for(L=0<w.gb[0],e=e[0];;){t:{var A=t;p=r,N=e;var y=h,k=l,S=m=[0];if((j=v=[v])[0]=0,8>N[0])N=7;else{if(!i(A,p[0],"VP8X")){if(10!=O(A,p[0]+4)){N=3;break t}if(18>N[0]){N=7;break t}var x=O(A,p[0]+8),q=1+P(A,p[0]+12);if(2147483648<=q*(A=1+P(A,p[0]+15))){N=3;break t}null!=S&&(S[0]=x),null!=y&&(y[0]=q),null!=k&&(k[0]=A),p[0]+=18,N[0]-=18,j[0]=1}N=0}}if(v=v[0],0!=N)return N;if(p=!!(2&(m=m[0])),!L&&v)return 3;if(null!=a&&(a[0]=!!(16&m)),null!=u&&(u[0]=p),null!=f&&(f[0]=0),u=h[0],m=l[0],v&&p&&null==c){N=0;break}if(4>e){N=7;break}if(L&&v||!L&&!v&&!i(t,r[0],"ALPH")){e=[e],w.na=[w.na],w.P=[w.P],w.Sa=[w.Sa];t:{N=r,L=e;var j=w.gb;y=w.na,k=w.P,S=w.Sa,q=22,n(null!=(x=t)),n(null!=L),A=N[0];var M=L[0];for(n(null!=y),n(null!=S),y[0]=null,k[0]=null,S[0]=0;;){if(N[0]=A,L[0]=M,8>M){N=7;break t}var E=O(x,A+4);if(4294967286<E){N=3;break t}var I=8+E+1&-2;if(q+=I,0<j&&q>j){N=3;break t}if(!i(x,A,"VP8 ")||!i(x,A,"VP8L")){N=0;break t}if(M[0]<I){N=7;break t}i(x,A,"ALPH")||(y[0]=x,k[0]=A+8,S[0]=E),A+=I,M-=I}}if(e=e[0],w.na=w.na[0],w.P=w.P[0],w.Sa=w.Sa[0],0!=N)break}e=[e],w.Ja=[w.Ja],w.xa=[w.xa];t:if(j=t,N=r,L=e,y=w.gb[0],k=w.Ja,S=w.xa,x=N[0],A=!i(j,x,"VP8 "),q=!i(j,x,"VP8L"),n(null!=j),n(null!=L),n(null!=k),n(null!=S),8>L[0])N=7;else{if(A||q){if(j=O(j,x+4),12<=y&&j>y-12){N=3;break t}if(d&&j>L[0]-8){N=7;break t}k[0]=j,N[0]+=8,L[0]-=8,S[0]=q}else S[0]=5<=L[0]&&47==j[x+0]&&!(j[x+4]>>5),k[0]=L[0];N=0}if(e=e[0],w.Ja=w.Ja[0],w.xa=w.xa[0],r=r[0],0!=N)break;if(4294967286<w.Ja)return 3;if(null==f||p||(f[0]=w.xa?2:1),u=[u],m=[m],w.xa){if(5>e){N=7;break}f=u,d=m,p=a,null==t||5>e?t=0:5<=e&&47==t[r+0]&&!(t[r+4]>>5)?(L=[0],j=[0],y=[0],b(k=new g,t,r,e),wt(k,L,j,y)?(null!=f&&(f[0]=L[0]),null!=d&&(d[0]=j[0]),null!=p&&(p[0]=y[0]),t=1):t=0):t=0}else{if(10>e){N=7;break}f=m,null==t||10>e||!$t(t,r+3,e-3)?t=0:(d=t[r+0]|t[r+1]<<8|t[r+2]<<16,p=16383&(t[r+7]<<8|t[r+6]),t=16383&(t[r+9]<<8|t[r+8]),1&d||3<(d>>1&7)||!(d>>4&1)||d>>5>=w.Ja||!p||!t?t=0:(u&&(u[0]=p),f&&(f[0]=t),t=1))}if(!t)return 3;if(u=u[0],m=m[0],v&&(h[0]!=u||l[0]!=m))return 3;null!=c&&(c[0]=w,c.offset=r-c.w,n(4294967286>r-c.w),n(c.offset==c.ha-e));break}return 0==N||7==N&&v&&null==c?(null!=a&&(a[0]|=null!=w.na&&0<w.na.length),null!=s&&(s[0]=u),null!=o&&(o[0]=m),0):N}function Ri(t,n,i){var r=n.width,e=n.height,s=0,o=0,a=r,u=e;if(n.Da=null!=t&&0<t.Da,n.Da&&(a=t.cd,u=t.bd,s=t.v,o=t.j,11>i||(s&=-2,o&=-2),0>s||0>o||0>=a||0>=u||s+a>r||o+u>e))return 0;if(n.v=s,n.j=o,n.va=s+a,n.o=o+u,n.U=a,n.T=u,n.da=null!=t&&0<t.da,n.da){if(!R(a,u,i=[t.ib],s=[t.hb]))return 0;n.ib=i[0],n.hb=s[0]}return n.ob=null!=t&&t.ob,n.Kb=null==t||!t.Sd,n.da&&(n.ob=n.ib<3*r/4&&n.hb<3*e/4,n.Kb=0),1}function Ti(t){if(null==t)return 2;if(11>t.S){var n=t.f.RGBA;n.fb+=(t.height-1)*n.A,n.A=-n.A}else(n=t.f.kb).O+=((t=t.height)-1)*n.fa,n.fa=-n.fa,n.N+=(t-1>>1)*n.Ab,n.Ab=-n.Ab,n.W+=(t-1>>1)*n.Db,n.Db=-n.Db,null!=n.F&&(n.J+=(t-1)*n.lb,n.lb=-n.lb);return 0}function Ci(t,n,i,r){if(null==r||0>=t||0>=n)return 2;if(null!=i){if(i.Da){var e=i.cd,o=i.bd,a=-2&i.v,u=-2&i.j;if(0>a||0>u||0>=e||0>=o||a+e>t||u+o>n)return 2;t=e,n=o}if(i.da){if(!R(t,n,e=[i.ib],o=[i.hb]))return 2;t=e[0],n=o[0]}}r.width=t,r.height=n;t:{var f=r.width,c=r.height;if(t=r.S,0>=f||0>=c||!(t>=Rr&&13>t))t=2;else{if(0>=r.Rd&&null==r.sd){a=o=e=n=0;var h=(u=f*Ve[t])*c;if(11>t||(o=(c+1)/2*(n=(f+1)/2),12==t&&(a=(e=f)*c)),null==(c=s(h+2*o+a))){t=1;break t}r.sd=c,11>t?((f=r.f.RGBA).eb=c,f.fb=0,f.A=u,f.size=h):((f=r.f.kb).y=c,f.O=0,f.fa=u,f.Fd=h,f.f=c,f.N=0+h,f.Ab=n,f.Cd=o,f.ea=c,f.W=0+h+o,f.Db=n,f.Ed=o,12==t&&(f.F=c,f.J=0+h+2*o),f.Tc=a,f.lb=e)}if(n=1,o=r.width,a=r.height,(e=r.S)>=Rr&&13>e)if(11>e)t=r.f.RGBA,n&=(u=Math.abs(t.A))*(a-1)+o<=t.size,n&=u>=o*Ve[e],n&=null!=t.eb;else{t=r.f.kb,u=(o+1)/2,h=(a+1)/2,f=Math.abs(t.fa),c=Math.abs(t.Ab);var l=Math.abs(t.Db),v=Math.abs(t.lb);n&=f*(a-1)+o<=t.Fd,n&=c*(h-1)+u<=t.Cd,n=(n&=l*(h-1)+u<=t.Ed)&f>=o&c>=u&l>=u,n&=null!=t.y,n&=null!=t.f,n&=null!=t.ea,12==e&&(n&=v>=o,n&=v*(a-1)+o<=t.Tc,n&=null!=t.F)}else n=0;t=n?0:2}}return 0!=t||null!=i&&i.fd&&(t=Ti(r)),t}var Di=64,zi=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535,131071,262143,524287,1048575,2097151,4194303,8388607,16777215],Ui=24,Vi=32,Wi=8,Hi=[0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7];D("Predictor0","PredictorAdd0"),t.Predictor0=function(){return 4278190080},t.Predictor1=function(t){return t},t.Predictor2=function(t,n,i){return n[i+0]},t.Predictor3=function(t,n,i){return n[i+1]},t.Predictor4=function(t,n,i){return n[i-1]},t.Predictor5=function(t,n,i){return U(U(t,n[i+1]),n[i+0])},t.Predictor6=function(t,n,i){return U(t,n[i-1])},t.Predictor7=function(t,n,i){return U(t,n[i+0])},t.Predictor8=function(t,n,i){return U(n[i-1],n[i+0])},t.Predictor9=function(t,n,i){return U(n[i+0],n[i+1])},t.Predictor10=function(t,n,i){return U(U(t,n[i-1]),U(n[i+0],n[i+1]))},t.Predictor11=function(t,n,i){var r=n[i+0];return 0>=H(r>>24&255,t>>24&255,(n=n[i-1])>>24&255)+H(r>>16&255,t>>16&255,n>>16&255)+H(r>>8&255,t>>8&255,n>>8&255)+H(255&r,255&t,255&n)?r:t},t.Predictor12=function(t,n,i){var r=n[i+0];return(V((t>>24&255)+(r>>24&255)-((n=n[i-1])>>24&255))<<24|V((t>>16&255)+(r>>16&255)-(n>>16&255))<<16|V((t>>8&255)+(r>>8&255)-(n>>8&255))<<8|V((255&t)+(255&r)-(255&n)))>>>0},t.Predictor13=function(t,n,i){var r=n[i-1];return(W((t=U(t,n[i+0]))>>24&255,r>>24&255)<<24|W(t>>16&255,r>>16&255)<<16|W(t>>8&255,r>>8&255)<<8|W(t>>0&255,r>>0&255))>>>0};var _i=t.PredictorAdd0;t.PredictorAdd1=_,D("Predictor2","PredictorAdd2"),D("Predictor3","PredictorAdd3"),D("Predictor4","PredictorAdd4"),D("Predictor5","PredictorAdd5"),D("Predictor6","PredictorAdd6"),D("Predictor7","PredictorAdd7"),D("Predictor8","PredictorAdd8"),D("Predictor9","PredictorAdd9"),D("Predictor10","PredictorAdd10"),D("Predictor11","PredictorAdd11"),D("Predictor12","PredictorAdd12"),D("Predictor13","PredictorAdd13");var Gi=t.PredictorAdd2;$("ColorIndexInverseTransform","MapARGB","32b",(function(t){return t>>8&255}),(function(t){return t})),$("VP8LColorIndexInverseTransformAlpha","MapAlpha","8b",(function(t){return t}),(function(t){return t>>8&255}));var Ji,Yi=t.ColorIndexInverseTransform,$i=t.MapARGB,Ki=t.VP8LColorIndexInverseTransformAlpha,Xi=t.MapAlpha,Zi=t.VP8LPredictorsAdd=[];Zi.length=16,(t.VP8LPredictors=[]).length=16,(t.VP8LPredictorsAdd_C=[]).length=16,(t.VP8LPredictors_C=[]).length=16;var Qi,tr,nr,ir,rr,er,sr,or,ar,ur,fr,cr,hr,lr,vr,dr,wr,mr,br,pr,Nr,Lr,gr,Ar,yr,kr,Sr,xr,qr=s(511),jr=s(2041),Mr=s(225),Er=s(767),Pr=0,Or=jr,Ir=Mr,Fr=Er,Br=qr,Rr=0,Tr=1,Cr=2,Dr=3,zr=4,Ur=5,Vr=6,Wr=7,Hr=8,_r=9,Gr=10,Jr=[2,3,7],Yr=[3,3,11],$r=[280,256,256,256,40],Kr=[0,1,1,1,0],Xr=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],Zr=[24,7,23,25,40,6,39,41,22,26,38,42,56,5,55,57,21,27,54,58,37,43,72,4,71,73,20,28,53,59,70,74,36,44,88,69,75,52,60,3,87,89,19,29,86,90,35,45,68,76,85,91,51,61,104,2,103,105,18,30,102,106,34,46,84,92,67,77,101,107,50,62,120,1,119,121,83,93,17,31,100,108,66,78,118,122,33,47,117,123,49,63,99,109,82,94,0,116,124,65,79,16,32,98,110,48,115,125,81,95,64,114,126,97,111,80,113,127,96,112],Qr=[2954,2956,2958,2962,2970,2986,3018,3082,3212,3468,3980,5004],te=8,ne=[4,5,6,7,8,9,10,10,11,12,13,14,15,16,17,17,18,19,20,20,21,21,22,22,23,23,24,25,25,26,27,28,29,30,31,32,33,34,35,36,37,37,38,39,40,41,42,43,44,45,46,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,76,77,78,79,80,81,82,83,84,85,86,87,88,89,91,93,95,96,98,100,101,102,104,106,108,110,112,114,116,118,122,124,126,128,130,132,134,136,138,140,143,145,148,151,154,157],ie=[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,119,122,125,128,131,134,137,140,143,146,149,152,155,158,161,164,167,170,173,177,181,185,189,193,197,201,205,209,213,217,221,225,229,234,239,245,249,254,259,264,269,274,279,284],re=null,ee=[[173,148,140,0],[176,155,140,135,0],[180,157,141,134,130,0],[254,254,243,230,196,177,153,140,133,130,129,0]],se=[0,1,4,8,5,2,3,6,9,12,13,10,7,11,14,15],oe=[-0,1,-1,2,-2,3,4,6,-3,5,-4,-5,-6,7,-7,8,-8,-9],ae=[[[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]],[[253,136,254,255,228,219,128,128,128,128,128],[189,129,242,255,227,213,255,219,128,128,128],[106,126,227,252,214,209,255,255,128,128,128]],[[1,98,248,255,236,226,255,255,128,128,128],[181,133,238,254,221,234,255,154,128,128,128],[78,134,202,247,198,180,255,219,128,128,128]],[[1,185,249,255,243,255,128,128,128,128,128],[184,150,247,255,236,224,128,128,128,128,128],[77,110,216,255,236,230,128,128,128,128,128]],[[1,101,251,255,241,255,128,128,128,128,128],[170,139,241,252,236,209,255,255,128,128,128],[37,116,196,243,228,255,255,255,128,128,128]],[[1,204,254,255,245,255,128,128,128,128,128],[207,160,250,255,238,128,128,128,128,128,128],[102,103,231,255,211,171,128,128,128,128,128]],[[1,152,252,255,240,255,128,128,128,128,128],[177,135,243,255,234,225,128,128,128,128,128],[80,129,211,255,194,224,128,128,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[246,1,255,128,128,128,128,128,128,128,128],[255,128,128,128,128,128,128,128,128,128,128]]],[[[198,35,237,223,193,187,162,160,145,155,62],[131,45,198,221,172,176,220,157,252,221,1],[68,47,146,208,149,167,221,162,255,223,128]],[[1,149,241,255,221,224,255,255,128,128,128],[184,141,234,253,222,220,255,199,128,128,128],[81,99,181,242,176,190,249,202,255,255,128]],[[1,129,232,253,214,197,242,196,255,255,128],[99,121,210,250,201,198,255,202,128,128,128],[23,91,163,242,170,187,247,210,255,255,128]],[[1,200,246,255,234,255,128,128,128,128,128],[109,178,241,255,231,245,255,255,128,128,128],[44,130,201,253,205,192,255,255,128,128,128]],[[1,132,239,251,219,209,255,165,128,128,128],[94,136,225,251,218,190,255,255,128,128,128],[22,100,174,245,186,161,255,199,128,128,128]],[[1,182,249,255,232,235,128,128,128,128,128],[124,143,241,255,227,234,128,128,128,128,128],[35,77,181,251,193,211,255,205,128,128,128]],[[1,157,247,255,236,231,255,255,128,128,128],[121,141,235,255,225,227,255,255,128,128,128],[45,99,188,251,195,217,255,224,128,128,128]],[[1,1,251,255,213,255,128,128,128,128,128],[203,1,248,255,255,128,128,128,128,128,128],[137,1,177,255,224,255,128,128,128,128,128]]],[[[253,9,248,251,207,208,255,192,128,128,128],[175,13,224,243,193,185,249,198,255,255,128],[73,17,171,221,161,179,236,167,255,234,128]],[[1,95,247,253,212,183,255,255,128,128,128],[239,90,244,250,211,209,255,255,128,128,128],[155,77,195,248,188,195,255,255,128,128,128]],[[1,24,239,251,218,219,255,205,128,128,128],[201,51,219,255,196,186,128,128,128,128,128],[69,46,190,239,201,218,255,228,128,128,128]],[[1,191,251,255,255,128,128,128,128,128,128],[223,165,249,255,213,255,128,128,128,128,128],[141,124,248,255,255,128,128,128,128,128,128]],[[1,16,248,255,255,128,128,128,128,128,128],[190,36,230,255,236,255,128,128,128,128,128],[149,1,255,128,128,128,128,128,128,128,128]],[[1,226,255,128,128,128,128,128,128,128,128],[247,192,255,128,128,128,128,128,128,128,128],[240,128,255,128,128,128,128,128,128,128,128]],[[1,134,252,255,255,128,128,128,128,128,128],[213,62,250,255,255,128,128,128,128,128,128],[55,93,255,128,128,128,128,128,128,128,128]],[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]]],[[[202,24,213,235,186,191,220,160,240,175,255],[126,38,182,232,169,184,228,174,255,187,128],[61,46,138,219,151,178,240,170,255,216,128]],[[1,112,230,250,199,191,247,159,255,255,128],[166,109,228,252,211,215,255,174,128,128,128],[39,77,162,232,172,180,245,178,255,255,128]],[[1,52,220,246,198,199,249,220,255,255,128],[124,74,191,243,183,193,250,221,255,255,128],[24,71,130,219,154,170,243,182,255,255,128]],[[1,182,225,249,219,240,255,224,128,128,128],[149,150,226,252,216,205,255,171,128,128,128],[28,108,170,242,183,194,254,223,255,255,128]],[[1,81,230,252,204,203,255,192,128,128,128],[123,102,209,247,188,196,255,233,128,128,128],[20,95,153,243,164,173,255,203,128,128,128]],[[1,222,248,255,216,213,128,128,128,128,128],[168,175,246,252,235,205,255,255,128,128,128],[47,116,215,255,211,212,255,255,128,128,128]],[[1,121,236,253,212,214,255,255,128,128,128],[141,84,213,252,201,202,255,219,128,128,128],[42,80,160,240,162,185,255,205,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[244,1,255,128,128,128,128,128,128,128,128],[238,1,255,128,128,128,128,128,128,128,128]]]],ue=[[[231,120,48,89,115,113,120,152,112],[152,179,64,126,170,118,46,70,95],[175,69,143,80,85,82,72,155,103],[56,58,10,171,218,189,17,13,152],[114,26,17,163,44,195,21,10,173],[121,24,80,195,26,62,44,64,85],[144,71,10,38,171,213,144,34,26],[170,46,55,19,136,160,33,206,71],[63,20,8,114,114,208,12,9,226],[81,40,11,96,182,84,29,16,36]],[[134,183,89,137,98,101,106,165,148],[72,187,100,130,157,111,32,75,80],[66,102,167,99,74,62,40,234,128],[41,53,9,178,241,141,26,8,107],[74,43,26,146,73,166,49,23,157],[65,38,105,160,51,52,31,115,128],[104,79,12,27,217,255,87,17,7],[87,68,71,44,114,51,15,186,23],[47,41,14,110,182,183,21,17,194],[66,45,25,102,197,189,23,18,22]],[[88,88,147,150,42,46,45,196,205],[43,97,183,117,85,38,35,179,61],[39,53,200,87,26,21,43,232,171],[56,34,51,104,114,102,29,93,77],[39,28,85,171,58,165,90,98,64],[34,22,116,206,23,34,43,166,73],[107,54,32,26,51,1,81,43,31],[68,25,106,22,64,171,36,225,114],[34,19,21,102,132,188,16,76,124],[62,18,78,95,85,57,50,48,51]],[[193,101,35,159,215,111,89,46,111],[60,148,31,172,219,228,21,18,111],[112,113,77,85,179,255,38,120,114],[40,42,1,196,245,209,10,25,109],[88,43,29,140,166,213,37,43,154],[61,63,30,155,67,45,68,1,209],[100,80,8,43,154,1,51,26,71],[142,78,78,16,255,128,34,197,171],[41,40,5,102,211,183,4,1,221],[51,50,17,168,209,192,23,25,82]],[[138,31,36,171,27,166,38,44,229],[67,87,58,169,82,115,26,59,179],[63,59,90,180,59,166,93,73,154],[40,40,21,116,143,209,34,39,175],[47,15,16,183,34,223,49,45,183],[46,17,33,183,6,98,15,32,183],[57,46,22,24,128,1,54,17,37],[65,32,73,115,28,128,23,128,205],[40,3,9,115,51,192,18,6,223],[87,37,9,115,59,77,64,21,47]],[[104,55,44,218,9,54,53,130,226],[64,90,70,205,40,41,23,26,57],[54,57,112,184,5,41,38,166,213],[30,34,26,133,152,116,10,32,134],[39,19,53,221,26,114,32,73,255],[31,9,65,234,2,15,1,118,73],[75,32,12,51,192,255,160,43,51],[88,31,35,67,102,85,55,186,85],[56,21,23,111,59,205,45,37,192],[55,38,70,124,73,102,1,34,98]],[[125,98,42,88,104,85,117,175,82],[95,84,53,89,128,100,113,101,45],[75,79,123,47,51,128,81,171,1],[57,17,5,71,102,57,53,41,49],[38,33,13,121,57,73,26,1,85],[41,10,67,138,77,110,90,47,114],[115,21,2,10,102,255,166,23,6],[101,29,16,10,85,128,101,196,26],[57,18,10,102,102,213,34,20,43],[117,20,15,36,163,128,68,1,26]],[[102,61,71,37,34,53,31,243,192],[69,60,71,38,73,119,28,222,37],[68,45,128,34,1,47,11,245,171],[62,17,19,70,146,85,55,62,70],[37,43,37,154,100,163,85,160,1],[63,9,92,136,28,64,32,201,85],[75,15,9,9,64,255,184,119,16],[86,6,28,5,64,255,25,248,1],[56,8,17,132,137,255,55,116,128],[58,15,20,82,135,57,26,121,40]],[[164,50,31,137,154,133,25,35,218],[51,103,44,131,131,123,31,6,158],[86,40,64,135,148,224,45,183,128],[22,26,17,131,240,154,14,1,209],[45,16,21,91,64,222,7,1,197],[56,21,39,155,60,138,23,102,213],[83,12,13,54,192,255,68,47,28],[85,26,85,85,128,128,32,146,171],[18,11,7,63,144,171,4,4,246],[35,27,10,146,174,171,12,26,128]],[[190,80,35,99,180,80,126,54,45],[85,126,47,87,176,51,41,20,32],[101,75,128,139,118,146,116,128,85],[56,41,15,176,236,85,37,9,62],[71,30,17,119,118,255,17,18,138],[101,38,60,138,55,70,43,26,142],[146,36,19,30,171,255,97,27,20],[138,45,61,62,219,1,81,188,64],[32,41,20,117,151,142,20,21,163],[112,19,12,61,195,128,48,4,24]]],fe=[[[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[176,246,255,255,255,255,255,255,255,255,255],[223,241,252,255,255,255,255,255,255,255,255],[249,253,253,255,255,255,255,255,255,255,255]],[[255,244,252,255,255,255,255,255,255,255,255],[234,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255]],[[255,246,254,255,255,255,255,255,255,255,255],[239,253,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[251,255,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[251,254,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,254,253,255,254,255,255,255,255,255,255],[250,255,254,255,254,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[217,255,255,255,255,255,255,255,255,255,255],[225,252,241,253,255,255,254,255,255,255,255],[234,250,241,250,253,255,253,254,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[223,254,254,255,255,255,255,255,255,255,255],[238,253,254,254,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[249,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,255,255,255,255,255,255,255,255,255],[247,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[252,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[186,251,250,255,255,255,255,255,255,255,255],[234,251,244,254,255,255,255,255,255,255,255],[251,251,243,253,254,255,254,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[236,253,254,255,255,255,255,255,255,255,255],[251,253,253,254,254,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[254,254,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[254,254,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[248,255,255,255,255,255,255,255,255,255,255],[250,254,252,254,255,255,255,255,255,255,255],[248,254,249,253,255,255,255,255,255,255,255]],[[255,253,253,255,255,255,255,255,255,255,255],[246,253,253,255,255,255,255,255,255,255,255],[252,254,251,254,254,255,255,255,255,255,255]],[[255,254,252,255,255,255,255,255,255,255,255],[248,254,253,255,255,255,255,255,255,255,255],[253,255,254,254,255,255,255,255,255,255,255]],[[255,251,254,255,255,255,255,255,255,255,255],[245,251,254,255,255,255,255,255,255,255,255],[253,253,254,255,255,255,255,255,255,255,255]],[[255,251,253,255,255,255,255,255,255,255,255],[252,253,254,255,255,255,255,255,255,255,255],[255,254,255,255,255,255,255,255,255,255,255]],[[255,252,255,255,255,255,255,255,255,255,255],[249,255,254,255,255,255,255,255,255,255,255],[255,255,254,255,255,255,255,255,255,255,255]],[[255,255,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]]],ce=[0,1,2,3,6,4,5,6,6,6,6,6,6,6,6,7,0],he=[],le=[],ve=[],de=1,we=2,me=[],be=[];pi("UpsampleRgbLinePair",ki,3),pi("UpsampleBgrLinePair",Si,3),pi("UpsampleRgbaLinePair",Ei,4),pi("UpsampleBgraLinePair",Mi,4),pi("UpsampleArgbLinePair",ji,4),pi("UpsampleRgba4444LinePair",qi,2),pi("UpsampleRgb565LinePair",xi,2);var pe=t.UpsampleRgbLinePair,Ne=t.UpsampleBgrLinePair,Le=t.UpsampleRgbaLinePair,ge=t.UpsampleBgraLinePair,Ae=t.UpsampleArgbLinePair,ye=t.UpsampleRgba4444LinePair,ke=t.UpsampleRgb565LinePair,Se=16,xe=1<<Se-1,qe=-227,je=482,Me=6,Ee=(256<<Me)-1,Pe=0,Oe=s(256),Ie=s(256),Fe=s(256),Be=s(256),Re=s(je-qe),Te=s(je-qe);Pi("YuvToRgbRow",ki,3),Pi("YuvToBgrRow",Si,3),Pi("YuvToRgbaRow",Ei,4),Pi("YuvToBgraRow",Mi,4),Pi("YuvToArgbRow",ji,4),Pi("YuvToRgba4444Row",qi,2),Pi("YuvToRgb565Row",xi,2);var Ce=[0,4,8,12,128,132,136,140,256,260,264,268,384,388,392,396],De=[0,2,8],ze=[8,7,6,4,4,2,2,2,1,1,1,1],Ue=1;this.WebPDecodeRGBA=function(t,i,r,e,s){var o=Tr,a=new ri,u=new ot;a.ba=u,u.S=o,u.width=[u.width],u.height=[u.height];var f=u.width,c=u.height,h=new at;if(null==h||null==t)var l=2;else n(null!=h),l=Bi(t,i,r,h.width,h.height,h.Pd,h.Qd,h.format,null);if(0!=l?f=0:(null!=f&&(f[0]=h.width[0]),null!=c&&(c[0]=h.height[0]),f=1),f){u.width=u.width[0],u.height=u.height[0],null!=e&&(e[0]=u.width),null!=s&&(s[0]=u.height);t:{if(e=new Gt,(s=new ei).data=t,s.w=i,s.ha=r,s.kd=1,i=[0],n(null!=s),(0==(t=Bi(s.data,s.w,s.ha,null,null,null,i,null,s))||7==t)&&i[0]&&(t=4),0==(i=t)){if(n(null!=a),e.data=s.data,e.w=s.w+s.offset,e.ha=s.ha-s.offset,e.put=vt,e.ac=lt,e.bc=dt,e.ma=a,s.xa){if(null==(t=jt())){a=1;break t}if(function(t,i){var r=[0],e=[0],s=[0];n:for(;;){if(null==t)return 0;if(null==i)return t.a=2,0;if(t.l=i,t.a=0,b(t.m,i.data,i.w,i.ha),!wt(t.m,r,e,s)){t.a=3;break n}if(t.xb=we,i.width=r[0],i.height=e[0],!Mt(r[0],e[0],1,t,null))break n;return 1}return n(0!=t.a),0}(t,e)){if(e=0==(i=Ci(e.width,e.height,a.Oa,a.ba))){n:{e=t;i:for(;;){if(null==e){e=0;break n}if(n(null!=e.s.yc),n(null!=e.s.Ya),n(0<e.s.Wb),n(null!=(r=e.l)),n(null!=(s=r.ma)),0!=e.xb){if(e.ca=s.ba,e.tb=s.tb,n(null!=e.ca),!Ri(s.Oa,r,Dr)){e.a=2;break i}if(!Et(e,r.width))break i;if(r.da)break i;if((r.da||rt(e.ca.S))&&bi(),11>e.ca.S||(alert("todo:WebPInitConvertARGBToYUV"),null!=e.ca.f.kb.F&&bi()),e.Pb&&0<e.s.ua&&null==e.s.vb.X&&!I(e.s.vb,e.s.Wa.Xa)){e.a=1;break i}e.xb=0}if(!xt(e,e.V,e.Ba,e.c,e.i,r.o,At))break i;s.Dc=e.Ma,e=1;break n}n(0!=e.a),e=0}e=!e}e&&(i=t.a)}else i=t.a}else{if(null==(t=new Jt)){a=1;break t}if(t.Fa=s.na,t.P=s.P,t.qc=s.Sa,Kt(t,e)){if(0==(i=Ci(e.width,e.height,a.Oa,a.ba))){if(t.Aa=0,r=a.Oa,n(null!=(s=t)),null!=r){if(0<(f=0>(f=r.Md)?0:100<f?255:255*f/100)){for(c=h=0;4>c;++c)12>(l=s.pb[c]).lc&&(l.ia=f*ze[0>l.lc?0:l.lc]>>3),h|=l.ia;h&&(alert("todo:VP8InitRandom"),s.ia=1)}s.Ga=r.Id,100<s.Ga?s.Ga=100:0>s.Ga&&(s.Ga=0)}Qt(t,e)||(i=t.a)}}else i=t.a}0==i&&null!=a.Oa&&a.Oa.fd&&(i=Ti(a.ba))}a=i}o=0!=a?null:11>o?u.f.RGBA.eb:u.f.kb.y}else o=null;return o};var Ve=[3,4,3,4,4,2,2,4,4,4,2,1,1]};function f(t,n){for(var i="",r=0;r<4;r++)i+=String.fromCharCode(t[n++]);return i}function c(t,n){return(t[n+0]<<0|t[n+1]<<8|t[n+2]<<16)>>>0}function h(t,n){return(t[n+0]<<0|t[n+1]<<8|t[n+2]<<16|t[n+3]<<24)>>>0}new u;var l=[0],v=[0],d=[],w=new u,m=t,b=function(t,n){var i={},r=0,e=!1,s=0,o=0;if(i.frames=[],!
258
+ */function Yn(t,n){if(this.pos=0,this.buffer=t,this.datav=new DataView(t.buffer),this.is_with_alpha=!!n,this.bottom_up=!0,this.flag=String.fromCharCode(this.buffer[0])+String.fromCharCode(this.buffer[1]),this.pos+=2,-1===["BM","BA","CI","CP","IC","PT"].indexOf(this.flag))throw new Error("Invalid BMP File");this.parseHeader(),this.parseBGR()}function $n(t){function n(t){if(!t)throw Error("assert :P")}function i(t,n,i){for(var r=0;4>r;r++)if(t[n+r]!=i.charCodeAt(r))return!0;return!1}function r(t,n,i,r,e){for(var s=0;s<e;s++)t[n+s]=i[r+s]}function e(t,n,i,r){for(var e=0;e<r;e++)t[n+e]=i}function s(t){return new Int32Array(t)}function o(t,n){for(var i=[],r=0;r<t;r++)i.push(new n);return i}function a(t,n){var i=[];return function t(i,r,e){for(var s=e[r],o=0;o<s&&(i.push(e.length>r+1?[]:new n),!(e.length<r+1));o++)t(i[o],r+1,e)}(i,0,t),i}var u=function(){var t=this;function u(t,n){for(var i=1<<n-1>>>0;t&i;)i>>>=1;return i?(t&i-1)+i:t}function f(t,i,r,e,s){n(!(e%r));do{t[i+(e-=r)]=s}while(0<e)}function c(t,i,r,e,o){if(n(2328>=o),512>=o)var a=s(512);else if(null==(a=s(o)))return 0;return function(t,i,r,e,o,a){var c,l,v=i,d=1<<r,w=s(16),m=s(16);for(n(0!=o),n(null!=e),n(null!=t),n(0<r),l=0;l<o;++l){if(15<e[l])return 0;++w[e[l]]}if(w[0]==o)return 0;for(m[1]=0,c=1;15>c;++c){if(w[c]>1<<c)return 0;m[c+1]=m[c]+w[c]}for(l=0;l<o;++l)c=e[l],0<e[l]&&(a[m[c]++]=l);if(1==m[15])return(e=new h).g=0,e.value=a[0],f(t,v,1,d,e),d;var b,p=-1,N=d-1,L=0,g=1,A=1,y=1<<r;for(l=0,c=1,o=2;c<=r;++c,o<<=1){if(g+=A<<=1,0>(A-=w[c]))return 0;for(;0<w[c];--w[c])(e=new h).g=c,e.value=a[l++],f(t,v+L,o,y,e),L=u(L,c)}for(c=r+1,o=2;15>=c;++c,o<<=1){if(g+=A<<=1,0>(A-=w[c]))return 0;for(;0<w[c];--w[c]){if(e=new h,(L&N)!=p){for(v+=y,b=1<<(p=c)-r;15>p&&!(0>=(b-=w[p]));)++p,b<<=1;d+=y=1<<(b=p-r),t[i+(p=L&N)].g=b+r,t[i+p].value=v-i-p}e.g=c-r,e.value=a[l++],f(t,v+(L>>r),o,y,e),L=u(L,c)}}return g!=2*m[15]-1?0:d}(t,i,r,e,o,a)}function h(){this.value=this.g=0}function l(){this.value=this.g=0}function v(){this.G=o(5,h),this.H=s(5),this.jc=this.Qb=this.qb=this.nd=0,this.pd=o(Di,l)}function d(t,i,r,e){n(null!=t),n(null!=i),n(2147483648>e),t.Ca=254,t.I=0,t.b=-8,t.Ka=0,t.oa=i,t.pa=r,t.Jd=i,t.Yc=r+e,t.Zc=4<=e?r+e-4+1:r,x(t)}function w(t,n){for(var i=0;0<n--;)i|=j(t,128)<<n;return i}function m(t,n){var i=w(t,n);return q(t)?-i:i}function b(t,i,r,e){var s,o=0;for(n(null!=t),n(null!=i),n(4294967288>e),t.Sb=e,t.Ra=0,t.u=0,t.h=0,4<e&&(e=4),s=0;s<e;++s)o+=i[r+s]<<8*s;t.Ra=o,t.bb=e,t.oa=i,t.pa=r}function p(t){for(;8<=t.u&&t.bb<t.Sb;)t.Ra>>>=8,t.Ra+=t.oa[t.pa+t.bb]<<Vi-8>>>0,++t.bb,t.u-=8;y(t)&&(t.h=1,t.u=0)}function N(t,i){if(n(0<=i),!t.h&&i<=Ui){var r=A(t)&zi[i];return t.u+=i,p(t),r}return t.h=1,t.u=0}function L(){this.b=this.Ca=this.I=0,this.oa=[],this.pa=0,this.Jd=[],this.Yc=0,this.Zc=[],this.Ka=0}function g(){this.Ra=0,this.oa=[],this.h=this.u=this.bb=this.Sb=this.pa=0}function A(t){return t.Ra>>>(t.u&Vi-1)>>>0}function y(t){return n(t.bb<=t.Sb),t.h||t.bb==t.Sb&&t.u>Vi}function k(t,n){t.u=n,t.h=y(t)}function S(t){t.u>=Wi&&(n(t.u>=Wi),p(t))}function x(t){n(null!=t&&null!=t.oa),t.pa<t.Zc?(t.I=(t.oa[t.pa++]|t.I<<8)>>>0,t.b+=8):(n(null!=t&&null!=t.oa),t.pa<t.Yc?(t.b+=8,t.I=t.oa[t.pa++]|t.I<<8):t.Ka?t.b=0:(t.I<<=8,t.b+=8,t.Ka=1))}function q(t){return w(t,1)}function j(t,n){var i=t.Ca;0>t.b&&x(t);var r=t.b,e=i*n>>>8,s=(t.I>>>r>e)+0;for(s?(i-=e,t.I-=e+1<<r>>>0):i=e+1,r=i,e=0;256<=r;)e+=8,r>>=8;return t.b-=r=7^e+_i[r],t.Ca=(i<<r)-1,s}function M(t,n,i){t[n+0]=i>>24&255,t[n+1]=i>>16&255,t[n+2]=i>>8&255,t[n+3]=i>>0&255}function E(t,n){return t[n+0]<<0|t[n+1]<<8}function P(t,n){return E(t,n)|t[n+2]<<16}function O(t,n){return E(t,n)|E(t,n+2)<<16}function I(t,i){var r=1<<i;return n(null!=t),n(0<i),t.X=s(r),null==t.X?0:(t.Mb=32-i,t.Xa=i,1)}function F(t,i){n(null!=t),n(null!=i),n(t.Xa==i.Xa),r(i.X,0,t.X,0,1<<i.Xa)}function B(){this.X=[],this.Xa=this.Mb=0}function R(t,i,r,e){n(null!=r),n(null!=e);var s=r[0],o=e[0];return 0==s&&(s=(t*o+i/2)/i),0==o&&(o=(i*s+t/2)/t),0>=s||0>=o?0:(r[0]=s,e[0]=o,1)}function T(t,n){return t+(1<<n)-1>>>n}function C(t,n){return((4278255360&t)+(4278255360&n)>>>0&4278255360)+((16711935&t)+(16711935&n)>>>0&16711935)>>>0}function D(n,i){t[i]=function(i,r,e,s,o,a,u){var f;for(f=0;f<o;++f){var c=t[n](a[u+f-1],e,s+f);a[u+f]=C(i[r+f],c)}}}function z(){this.ud=this.hd=this.jd=0}function U(t,n){return((4278124286&(t^n))>>>1)+(t&n)>>>0}function V(t){return 0<=t&&256>t?t:0>t?0:255<t?255:void 0}function W(t,n){return V(t+(t-n+.5>>1))}function _(t,n,i){return Math.abs(n-i)-Math.abs(t-i)}function H(t,n,i,r,e,s,o){for(r=s[o-1],i=0;i<e;++i)s[o+i]=r=C(t[n+i],r)}function G(t,n,i,r,e){var s;for(s=0;s<i;++s){var o=t[n+s],a=o>>8&255,u=16711935&(u=(u=16711935&o)+((a<<16)+a));r[e+s]=(4278255360&o)+u>>>0}}function J(t,n){n.jd=t>>0&255,n.hd=t>>8&255,n.ud=t>>16&255}function Y(t,n,i,r,e,s){var o;for(o=0;o<r;++o){var a=n[i+o],u=a>>>8,f=a,c=255&(c=(c=a>>>16)+((t.jd<<24>>24)*(u<<24>>24)>>>5));f=255&(f=(f+=(t.hd<<24>>24)*(u<<24>>24)>>>5)+((t.ud<<24>>24)*(c<<24>>24)>>>5)),e[s+o]=(4278255360&a)+(c<<16)+f}}function $(n,i,r,e,s){t[i]=function(t,n,i,r,o,a,u,f,c){for(r=u;r<f;++r)for(u=0;u<c;++u)o[a++]=s(i[e(t[n++])])},t[n]=function(n,i,o,a,u,f,c){var h=8>>n.b,l=n.Ea,v=n.K[0],d=n.w;if(8>h)for(n=(1<<n.b)-1,d=(1<<h)-1;i<o;++i){var w,m=0;for(w=0;w<l;++w)w&n||(m=e(a[u++])),f[c++]=s(v[m&d]),m>>=h}else t["VP8LMapColor"+r](a,u,v,d,f,c,i,o,l)}}function K(t,n,i,r,e){for(i=n+i;n<i;){var s=t[n++];r[e++]=s>>16&255,r[e++]=s>>8&255,r[e++]=s>>0&255}}function X(t,n,i,r,e){for(i=n+i;n<i;){var s=t[n++];r[e++]=s>>16&255,r[e++]=s>>8&255,r[e++]=s>>0&255,r[e++]=s>>24&255}}function Z(t,n,i,r,e){for(i=n+i;n<i;){var s=(o=t[n++])>>16&240|o>>12&15,o=o>>0&240|o>>28&15;r[e++]=s,r[e++]=o}}function Q(t,n,i,r,e){for(i=n+i;n<i;){var s=(o=t[n++])>>16&248|o>>13&7,o=o>>5&224|o>>3&31;r[e++]=s,r[e++]=o}}function tt(t,n,i,r,e){for(i=n+i;n<i;){var s=t[n++];r[e++]=s>>0&255,r[e++]=s>>8&255,r[e++]=s>>16&255}}function nt(t,n,i,e,s,o){if(0==o)for(i=n+i;n<i;)M(e,((o=t[n++])[0]>>24|o[1]>>8&65280|o[2]<<8&16711680|o[3]<<24)>>>0),s+=32;else r(e,s,t,n,i)}function it(n,i){t[i][0]=t[n+"0"],t[i][1]=t[n+"1"],t[i][2]=t[n+"2"],t[i][3]=t[n+"3"],t[i][4]=t[n+"4"],t[i][5]=t[n+"5"],t[i][6]=t[n+"6"],t[i][7]=t[n+"7"],t[i][8]=t[n+"8"],t[i][9]=t[n+"9"],t[i][10]=t[n+"10"],t[i][11]=t[n+"11"],t[i][12]=t[n+"12"],t[i][13]=t[n+"13"],t[i][14]=t[n+"0"],t[i][15]=t[n+"0"]}function rt(t){return t==Wr||t==_r||t==Hr||t==Gr}function et(){this.eb=[],this.size=this.A=this.fb=0}function st(){this.y=[],this.f=[],this.ea=[],this.F=[],this.Tc=this.Ed=this.Cd=this.Fd=this.lb=this.Db=this.Ab=this.fa=this.J=this.W=this.N=this.O=0}function ot(){this.Rd=this.height=this.width=this.S=0,this.f={},this.f.RGBA=new et,this.f.kb=new st,this.sd=null}function at(){this.width=[0],this.height=[0],this.Pd=[0],this.Qd=[0],this.format=[0]}function ut(){this.Id=this.fd=this.Md=this.hb=this.ib=this.da=this.bd=this.cd=this.j=this.v=this.Da=this.Sd=this.ob=0}function ft(t){return alert("todo:WebPSamplerProcessPlane"),t.T}function ct(t,n){var i=t.T,e=n.ba.f.RGBA,s=e.eb,o=e.fb+t.ka*e.A,a=be[n.ba.S],u=t.y,f=t.O,c=t.f,h=t.N,l=t.ea,v=t.W,d=n.cc,w=n.dc,m=n.Mc,b=n.Nc,p=t.ka,N=t.ka+t.T,L=t.U,g=L+1>>1;for(0==p?a(u,f,null,null,c,h,l,v,c,h,l,v,s,o,null,null,L):(a(n.ec,n.fc,u,f,d,w,m,b,c,h,l,v,s,o-e.A,s,o,L),++i);p+2<N;p+=2)a(u,(f+=2*t.fa)-t.fa,u,f,d=c,w=h,m=l,b=v,c,h+=t.Rc,l,v+=t.Rc,s,(o+=2*e.A)-e.A,s,o,L);return f+=t.fa,t.j+N<t.o?(r(n.ec,n.fc,u,f,L),r(n.cc,n.dc,c,h,g),r(n.Mc,n.Nc,l,v,g),i--):1&N||a(u,f,null,null,c,h,l,v,c,h,l,v,s,o+e.A,null,null,L),i}function ht(t,i,r){var e=t.F,s=[t.J];if(null!=e){var o=t.U,a=i.ba.S,u=a==zr||a==Hr;i=i.ba.f.RGBA;var f=[0],c=t.ka;f[0]=t.T,t.Kb&&(0==c?--f[0]:(--c,s[0]-=t.width),t.j+t.ka+t.T==t.o&&(f[0]=t.o-t.j-c));var h=i.eb;t=Sr(e,s[0],t.width,o,f,h,(c=i.fb+c*i.A)+(u?0:3),i.A),n(r==f),t&&rt(a)&&yr(h,c,u,o,f,i.A)}return 0}function lt(t){var n=t.ma,i=n.ba.S,r=11>i,e=i==Tr||i==Dr||i==zr||i==Ur||12==i||rt(i);if(n.memory=null,n.Ib=null,n.Jb=null,n.Nd=null,!Ri(n.Oa,t,e?11:12))return 0;if(e&&rt(i)&&Ni(),t.da)alert("todo:use_scaling");else{if(r){if(n.Ib=ft,t.Kb){if(n.memory=s(t.U+2*(i=t.U+1>>1)),null==n.memory)return 0;n.ec=n.memory,n.fc=0,n.cc=n.ec,n.dc=n.fc+t.U,n.Mc=n.cc,n.Nc=n.dc+i,n.Ib=ct,Ni()}}else alert("todo:EmitYUV");e&&(n.Jb=ht,r&&bi())}if(r&&!Pe){for(t=0;256>t;++t)Oe[t]=89858*(t-128)+xe>>Se,Be[t]=-22014*(t-128)+xe,Fe[t]=-45773*(t-128),Ie[t]=113618*(t-128)+xe>>Se;for(t=qe;t<je;++t)Re[t-qe]=Ht(n=76283*(t-16)+xe>>Se,255),Te[t-qe]=Ht(n+8>>4,15);Pe=1}return 1}function vt(t){var i=t.ma,r=t.U,e=t.T;return n(!(1&t.ka)),0>=r||0>=e?0:(r=i.Ib(t,i),null!=i.Jb&&i.Jb(t,i,r),i.Dc+=r,1)}function dt(t){t.ma.memory=null}function wt(t,n,i,r){return 47!=N(t,8)?0:(n[0]=N(t,14)+1,i[0]=N(t,14)+1,r[0]=N(t,1),0!=N(t,3)?0:!t.h)}function mt(t,n){if(4>t)return t+1;var i=t-2>>1;return(2+(1&t)<<i)+N(n,i)+1}function bt(t,n){return 120<n?n-120:1<=(i=((i=Zr[n-1])>>4)*t+(8-(15&i)))?i:1;var i}function pt(t,n,i){var r=A(i),e=t[n+=255&r].g-8;return 0<e&&(k(i,i.u+8),r=A(i),n+=t[n].value,n+=r&(1<<e)-1),k(i,i.u+t[n].g),t[n].value}function Nt(t,i,r){return r.g+=t.g,r.value+=t.value<<i>>>0,n(8>=r.g),t.g}function Lt(t,i,r){var e=t.xc;return n((i=0==e?0:t.vc[t.md*(r>>e)+(i>>e)])<t.Wb),t.Ya[i]}function gt(t,i,e,s){var o=t.ab,a=t.c*i,u=t.C;i=u+i;var f=e,c=s;for(s=t.Ta,e=t.Ua;0<o--;){var h=t.gc[o],l=u,v=i,d=f,w=c,m=(c=s,f=e,h.Ea);switch(n(l<v),n(v<=h.nc),h.hc){case 2:Ji(d,w,(v-l)*m,c,f);break;case 0:var b=l,p=v,N=c,L=f,g=(x=h).Ea;0==b&&(Hi(d,w,null,null,1,N,L),H(d,w+1,0,0,g-1,N,L+1),w+=g,L+=g,++b);for(var A=1<<x.b,y=A-1,k=T(g,x.b),S=x.K,x=x.w+(b>>x.b)*k;b<p;){var q=S,j=x,M=1;for(Gi(d,w,N,L-g,1,N,L);M<g;){var E=(M&~y)+A;E>g&&(E=g),(0,Zi[q[j++]>>8&15])(d,w+ +M,N,L+M-g,E-M,N,L+M),M=E}w+=g,L+=g,++b&y||(x+=k)}v!=h.nc&&r(c,f-m,c,f+(v-l-1)*m,m);break;case 1:for(m=d,p=w,g=(d=h.Ea)-(L=d&~(N=(w=1<<h.b)-1)),b=T(d,h.b),A=h.K,h=h.w+(l>>h.b)*b;l<v;){for(y=A,k=h,S=new z,x=p+L,q=p+d;p<x;)J(y[k++],S),Qi(S,m,p,w,c,f),p+=w,f+=w;p<q&&(J(y[k++],S),Qi(S,m,p,g,c,f),p+=g,f+=g),++l&N||(h+=b)}break;case 3:if(d==c&&w==f&&0<h.b){for(p=c,d=m=f+(v-l)*m-(L=(v-l)*T(h.Ea,h.b)),w=c,N=f,b=[],L=(g=L)-1;0<=L;--L)b[L]=w[N+L];for(L=g-1;0<=L;--L)p[d+L]=b[L];Yi(h,l,v,c,m,c,f)}else Yi(h,l,v,d,w,c,f)}f=s,c=e}c!=e&&r(s,e,f,c,a)}function At(t,i){var r=t.V,e=t.Ba+t.c*t.C,s=i-t.C;if(n(i<=t.l.o),n(16>=s),0<s){var o=t.l,a=t.Ta,u=t.Ua,f=o.width;if(gt(t,s,r,e),s=u=[u],n((r=t.C)<(e=i)),n(o.v<o.va),e>o.o&&(e=o.o),r<o.j){var c=o.j-r;r=o.j,s[0]+=c*f}if(r>=e?r=0:(s[0]+=4*o.v,o.ka=r-o.j,o.U=o.va-o.v,o.T=e-r,r=1),r){if(u=u[0],11>(r=t.ca).S){var h=r.f.RGBA,l=(e=r.S,s=o.U,o=o.T,c=h.eb,h.A),v=o;for(h=h.fb+t.Ma*h.A;0<v--;){var d=a,w=u,m=s,b=c,p=h;switch(e){case Rr:tr(d,w,m,b,p);break;case Tr:nr(d,w,m,b,p);break;case Wr:nr(d,w,m,b,p),yr(b,p,0,m,1,0);break;case Cr:er(d,w,m,b,p);break;case Dr:nt(d,w,m,b,p,1);break;case _r:nt(d,w,m,b,p,1),yr(b,p,0,m,1,0);break;case zr:nt(d,w,m,b,p,0);break;case Hr:nt(d,w,m,b,p,0),yr(b,p,1,m,1,0);break;case Ur:ir(d,w,m,b,p);break;case Gr:ir(d,w,m,b,p),kr(b,p,m,1,0);break;case Vr:rr(d,w,m,b,p);break;default:n(0)}u+=f,h+=l}t.Ma+=o}else alert("todo:EmitRescaledRowsYUVA");n(t.Ma<=r.height)}}t.C=i,n(t.C<=t.i)}function yt(t){var n;if(0<t.ua)return 0;for(n=0;n<t.Wb;++n){var i=t.Ya[n].G,r=t.Ya[n].H;if(0<i[1][r[1]+0].g||0<i[2][r[2]+0].g||0<i[3][r[3]+0].g)return 0}return 1}function kt(t,i,r,e,s,o){if(0!=t.Z){var a=t.qd,u=t.rd;for(n(null!=me[t.Z]);i<r;++i)me[t.Z](a,u,e,s,e,s,o),a=e,u=s,s+=o;t.qd=a,t.rd=u}}function St(t,i){var r=t.l.ma,e=0==r.Z||1==r.Z?t.l.j:t.C;if(e=t.C<e?e:t.C,n(i<=t.l.o),i>e){var s=t.l.width,o=r.ca,a=r.tb+s*e,u=t.V,f=t.Ba+t.c*e,c=t.gc;n(1==t.ab),n(3==c[0].hc),Ki(c[0],e,i,u,f,o,a),kt(r,e,i,o,a,s)}t.C=t.Ma=i}function xt(t,i,r,e,s,o,a){var u=t.$/e,f=t.$%e,c=t.m,h=t.s,l=r+t.$,v=l;s=r+e*s;var d=r+e*o,w=280+h.ua,m=t.Pb?u:16777216,b=0<h.ua?h.Wa:null,p=h.wc,N=l<d?Lt(h,f,u):null;n(t.C<o),n(d<=s);var L=!1;t:for(;;){for(;L||l<d;){var g=0;if(u>=m){var x=l-r;n((m=t).Pb),m.wd=m.m,m.xd=x,0<m.s.ua&&F(m.s.Wa,m.s.vb),m=u+te}if(f&p||(N=Lt(h,f,u)),n(null!=N),N.Qb&&(i[l]=N.qb,L=!0),!L)if(S(c),N.jc){x=i;var q=l,j=N.pd[A(g=c)&Di-1];n(N.jc),256>j.g?(k(g,g.u+j.g),x[q]=j.value,g=0):(k(g,g.u+j.g-256),n(256<=j.value),g=j.value),0==g&&(L=!0)}else g=pt(N.G[0],N.H[0],c);if(c.h)break;if(L||256>g){if(!L)if(N.nd)i[l]=(N.qb|g<<8)>>>0;else{if(S(c),L=pt(N.G[1],N.H[1],c),S(c),x=pt(N.G[2],N.H[2],c),q=pt(N.G[3],N.H[3],c),c.h)break;i[l]=(q<<24|L<<16|g<<8|x)>>>0}if(L=!1,++l,++f>=e&&(f=0,++u,null!=a&&u<=o&&!(u%16)&&a(t,u),null!=b))for(;v<l;)g=i[v++],b.X[(506832829*g&4294967295)>>>b.Mb]=g}else if(280>g){if(g=mt(g-256,c),x=pt(N.G[4],N.H[4],c),S(c),x=bt(e,x=mt(x,c)),c.h)break;if(l-r<x||s-l<g)break t;for(q=0;q<g;++q)i[l+q]=i[l+q-x];for(l+=g,f+=g;f>=e;)f-=e,++u,null!=a&&u<=o&&!(u%16)&&a(t,u);if(n(l<=s),f&p&&(N=Lt(h,f,u)),null!=b)for(;v<l;)g=i[v++],b.X[(506832829*g&4294967295)>>>b.Mb]=g}else{if(!(g<w))break t;for(L=g-280,n(null!=b);v<l;)g=i[v++],b.X[(506832829*g&4294967295)>>>b.Mb]=g;g=l,n(!(L>>>(x=b).Xa)),i[g]=x.X[L],L=!0}L||n(c.h==y(c))}if(t.Pb&&c.h&&l<s)n(t.m.h),t.a=5,t.m=t.wd,t.$=t.xd,0<t.s.ua&&F(t.s.vb,t.s.Wa);else{if(c.h)break t;null!=a&&a(t,u>o?o:u),t.a=0,t.$=l-r}return 1}return t.a=3,0}function qt(t){n(null!=t),t.vc=null,t.yc=null,t.Ya=null;var i=t.Wa;null!=i&&(i.X=null),t.vb=null,n(null!=t)}function jt(){var n=new ai;return null==n?null:(n.a=0,n.xb=we,it("Predictor","VP8LPredictors"),it("Predictor","VP8LPredictors_C"),it("PredictorAdd","VP8LPredictorsAdd"),it("PredictorAdd","VP8LPredictorsAdd_C"),Ji=G,Qi=Y,tr=K,nr=X,ir=Z,rr=Q,er=tt,t.VP8LMapColor32b=$i,t.VP8LMapColor8b=Xi,n)}function Mt(t,i,r,a,u){var f=1,l=[t],d=[i],w=a.m,m=a.s,b=null,p=0;t:for(;;){if(r)for(;f&&N(w,1);){var L=l,g=d,y=a,x=1,q=y.m,j=y.gc[y.ab],M=N(q,2);if(y.Oc&1<<M)f=0;else{switch(y.Oc|=1<<M,j.hc=M,j.Ea=L[0],j.nc=g[0],j.K=[null],++y.ab,n(4>=y.ab),M){case 0:case 1:j.b=N(q,3)+2,x=Mt(T(j.Ea,j.b),T(j.nc,j.b),0,y,j.K),j.K=j.K[0];break;case 3:var E,P=N(q,8)+1,O=16<P?0:4<P?1:2<P?2:3;if(L[0]=T(j.Ea,O),j.b=O,E=x=Mt(P,1,0,y,j.K)){var F,B=P,R=j,D=1<<(8>>R.b),z=s(D);if(null==z)E=0;else{var U=R.K[0],V=R.w;for(z[0]=R.K[0][0],F=1;F<1*B;++F)z[F]=C(U[V+F],z[F-1]);for(;F<4*D;++F)z[F]=0;R.K[0]=null,R.K[0]=z,E=1}}x=E;break;case 2:break;default:n(0)}f=x}}if(l=l[0],d=d[0],f&&N(w,1)&&!(f=1<=(p=N(w,4))&&11>=p)){a.a=3;break t}var W;if(W=f)n:{var _,H,G,J=a,Y=l,$=d,K=p,X=r,Z=J.m,Q=J.s,tt=[null],nt=1,it=0,rt=Qr[K];i:for(;;){if(X&&N(Z,1)){var et=N(Z,3)+2,st=T(Y,et),ot=T($,et),at=st*ot;if(!Mt(st,ot,0,J,tt))break i;for(tt=tt[0],Q.xc=et,_=0;_<at;++_){var ut=tt[_]>>8&65535;tt[_]=ut,ut>=nt&&(nt=ut+1)}}if(Z.h)break i;for(H=0;5>H;++H){var ft=$r[H];!H&&0<K&&(ft+=1<<K),it<ft&&(it=ft)}var ct=o(nt*rt,h),ht=nt,lt=o(ht,v);if(null==lt)var vt=null;else n(65536>=ht),vt=lt;var dt=s(it);if(null==vt||null==dt||null==ct){J.a=1;break i}var wt=ct;for(_=G=0;_<nt;++_){var mt=vt[_],bt=mt.G,pt=mt.H,Lt=0,gt=1,At=0;for(H=0;5>H;++H){ft=$r[H],bt[H]=wt,pt[H]=G,!H&&0<K&&(ft+=1<<K);r:{var yt,kt=ft,St=J,jt=dt,Et=wt,Pt=G,Ot=0,It=St.m,Ft=N(It,1);if(e(jt,0,0,kt),Ft){var Bt=N(It,1)+1,Rt=N(It,1),Tt=N(It,0==Rt?1:8);jt[Tt]=1,2==Bt&&(jt[Tt=N(It,8)]=1);var Ct=1}else{var Dt=s(19),zt=N(It,4)+4;if(19<zt){St.a=3;var Ut=0;break r}for(yt=0;yt<zt;++yt)Dt[Xr[yt]]=N(It,3);var Vt=void 0,Wt=void 0,_t=St,Ht=Dt,Gt=kt,Jt=jt,Yt=0,$t=_t.m,Kt=8,Xt=o(128,h);e:for(;c(Xt,0,7,Ht,19);){if(N($t,1)){var Zt=2+2*N($t,3);if((Vt=2+N($t,Zt))>Gt)break e}else Vt=Gt;for(Wt=0;Wt<Gt&&Vt--;){S($t);var Qt=Xt[0+(127&A($t))];k($t,$t.u+Qt.g);var tn=Qt.value;if(16>tn)Jt[Wt++]=tn,0!=tn&&(Kt=tn);else{var nn=16==tn,rn=tn-16,en=Yr[rn],sn=N($t,Jr[rn])+en;if(Wt+sn>Gt)break e;for(var on=nn?Kt:0;0<sn--;)Jt[Wt++]=on}}Yt=1;break e}Yt||(_t.a=3),Ct=Yt}(Ct=Ct&&!It.h)&&(Ot=c(Et,Pt,8,jt,kt)),Ct&&0!=Ot?Ut=Ot:(St.a=3,Ut=0)}if(0==Ut)break i;if(gt&&1==Kr[H]&&(gt=0==wt[G].g),Lt+=wt[G].g,G+=Ut,3>=H){var an,un=dt[0];for(an=1;an<ft;++an)dt[an]>un&&(un=dt[an]);At+=un}}if(mt.nd=gt,mt.Qb=0,gt&&(mt.qb=(bt[3][pt[3]+0].value<<24|bt[1][pt[1]+0].value<<16|bt[2][pt[2]+0].value)>>>0,0==Lt&&256>bt[0][pt[0]+0].value&&(mt.Qb=1,mt.qb+=bt[0][pt[0]+0].value<<8)),mt.jc=!mt.Qb&&6>At,mt.jc){var fn,cn=mt;for(fn=0;fn<Di;++fn){var hn=fn,ln=cn.pd[hn],vn=cn.G[0][cn.H[0]+hn];256<=vn.value?(ln.g=vn.g+256,ln.value=vn.value):(ln.g=0,ln.value=0,hn>>=Nt(vn,8,ln),hn>>=Nt(cn.G[1][cn.H[1]+hn],16,ln),hn>>=Nt(cn.G[2][cn.H[2]+hn],0,ln),Nt(cn.G[3][cn.H[3]+hn],24,ln))}}}Q.vc=tt,Q.Wb=nt,Q.Ya=vt,Q.yc=ct,W=1;break n}W=0}if(!(f=W)){a.a=3;break t}if(0<p){if(m.ua=1<<p,!I(m.Wa,p)){a.a=1,f=0;break t}}else m.ua=0;var dn=a,wn=l,mn=d,bn=dn.s,pn=bn.xc;if(dn.c=wn,dn.i=mn,bn.md=T(wn,pn),bn.wc=0==pn?-1:(1<<pn)-1,r){a.xb=de;break t}if(null==(b=s(l*d))){a.a=1,f=0;break t}f=(f=xt(a,b,0,l,d,d,null))&&!w.h;break t}return f?(null!=u?u[0]=b:(n(null==b),n(r)),a.$=0,r||qt(m)):qt(m),f}function Et(t,i){var r=t.c*t.i,e=r+i+16*i;return n(t.c<=i),t.V=s(e),null==t.V?(t.Ta=null,t.Ua=0,t.a=1,0):(t.Ta=t.V,t.Ua=t.Ba+r+i,1)}function Pt(t,i){var r=t.C,e=i-r,s=t.V,o=t.Ba+t.c*r;for(n(i<=t.l.o);0<e;){var a=16<e?16:e,u=t.l.ma,f=t.l.width,c=f*a,h=u.ca,l=u.tb+f*r,v=t.Ta,d=t.Ua;gt(t,a,s,o),xr(v,d,h,l,c),kt(u,r,r+a,h,l,f),e-=a,s+=a*t.c,r+=a}n(r==i),t.C=t.Ma=i}function Ot(){this.ub=this.yd=this.td=this.Rb=0}function It(){this.Kd=this.Ld=this.Ud=this.Td=this.i=this.c=0}function Ft(){this.Fb=this.Bb=this.Cb=0,this.Zb=s(4),this.Lb=s(4)}function Bt(){this.Yb=function(){var t=[];return function t(n,i,r){for(var e=r[i],s=0;s<e&&(n.push(r.length>i+1?[]:0),!(r.length<i+1));s++)t(n[s],i+1,r)}(t,0,[3,11]),t}()}function Rt(){this.jb=s(3),this.Wc=a([4,8],Bt),this.Xc=a([4,17],Bt)}function Tt(){this.Pc=this.wb=this.Tb=this.zd=0,this.vd=new s(4),this.od=new s(4)}function Ct(){this.ld=this.La=this.dd=this.tc=0}function Dt(){this.Na=this.la=0}function zt(){this.Sc=[0,0],this.Eb=[0,0],this.Qc=[0,0],this.ia=this.lc=0}function Ut(){this.ad=s(384),this.Za=0,this.Ob=s(16),this.$b=this.Ad=this.ia=this.Gc=this.Hc=this.Dd=0}function Vt(){this.uc=this.M=this.Nb=0,this.wa=Array(new Ct),this.Y=0,this.ya=Array(new Ut),this.aa=0,this.l=new Gt}function Wt(){this.y=s(16),this.f=s(8),this.ea=s(8)}function _t(){this.cb=this.a=0,this.sc="",this.m=new L,this.Od=new Ot,this.Kc=new It,this.ed=new Tt,this.Qa=new Ft,this.Ic=this.$c=this.Aa=0,this.D=new Vt,this.Xb=this.Va=this.Hb=this.zb=this.yb=this.Ub=this.za=0,this.Jc=o(8,L),this.ia=0,this.pb=o(4,zt),this.Pa=new Rt,this.Bd=this.kc=0,this.Ac=[],this.Bc=0,this.zc=[0,0,0,0],this.Gd=Array(new Wt),this.Hd=0,this.rb=Array(new Dt),this.sb=0,this.wa=Array(new Ct),this.Y=0,this.oc=[],this.pc=0,this.sa=[],this.ta=0,this.qa=[],this.ra=0,this.Ha=[],this.B=this.R=this.Ia=0,this.Ec=[],this.M=this.ja=this.Vb=this.Fc=0,this.ya=Array(new Ut),this.L=this.aa=0,this.gd=a([4,2],Ct),this.ga=null,this.Fa=[],this.Cc=this.qc=this.P=0,this.Gb=[],this.Uc=0,this.mb=[],this.nb=0,this.rc=[],this.Ga=this.Vc=0}function Ht(t,n){return 0>t?0:t>n?n:t}function Gt(){this.T=this.U=this.ka=this.height=this.width=0,this.y=[],this.f=[],this.ea=[],this.Rc=this.fa=this.W=this.N=this.O=0,this.ma="void",this.put="VP8IoPutHook",this.ac="VP8IoSetupHook",this.bc="VP8IoTeardownHook",this.ha=this.Kb=0,this.data=[],this.hb=this.ib=this.da=this.o=this.j=this.va=this.v=this.Da=this.ob=this.w=0,this.F=[],this.J=0}function Jt(){var t=new _t;return null!=t&&(t.a=0,t.sc="OK",t.cb=0,t.Xb=0,re||(re=Xt)),t}function Yt(t,n,i){return 0==t.a&&(t.a=n,t.sc=i,t.cb=0),0}function $t(t,n,i){return 3<=i&&157==t[n+0]&&1==t[n+1]&&42==t[n+2]}function Kt(t,i){if(null==t)return 0;if(t.a=0,t.sc="OK",null==i)return Yt(t,2,"null VP8Io passed to VP8GetHeaders()");var r=i.data,s=i.w,o=i.ha;if(4>o)return Yt(t,7,"Truncated header.");var a=r[s+0]|r[s+1]<<8|r[s+2]<<16,u=t.Od;if(u.Rb=!(1&a),u.td=a>>1&7,u.yd=a>>4&1,u.ub=a>>5,3<u.td)return Yt(t,3,"Incorrect keyframe parameters.");if(!u.yd)return Yt(t,4,"Frame not displayable.");s+=3,o-=3;var f=t.Kc;if(u.Rb){if(7>o)return Yt(t,7,"cannot parse picture header");if(!$t(r,s,o))return Yt(t,3,"Bad code word");f.c=16383&(r[s+4]<<8|r[s+3]),f.Td=r[s+4]>>6,f.i=16383&(r[s+6]<<8|r[s+5]),f.Ud=r[s+6]>>6,s+=7,o-=7,t.za=f.c+15>>4,t.Ub=f.i+15>>4,i.width=f.c,i.height=f.i,i.Da=0,i.j=0,i.v=0,i.va=i.width,i.o=i.height,i.da=0,i.ib=i.width,i.hb=i.height,i.U=i.width,i.T=i.height,e((a=t.Pa).jb,0,255,a.jb.length),n(null!=(a=t.Qa)),a.Cb=0,a.Bb=0,a.Fb=1,e(a.Zb,0,0,a.Zb.length),e(a.Lb,0,0,a.Lb)}if(u.ub>o)return Yt(t,7,"bad partition length");d(a=t.m,r,s,u.ub),s+=u.ub,o-=u.ub,u.Rb&&(f.Ld=q(a),f.Kd=q(a)),f=t.Qa;var c,h=t.Pa;if(n(null!=a),n(null!=f),f.Cb=q(a),f.Cb){if(f.Bb=q(a),q(a)){for(f.Fb=q(a),c=0;4>c;++c)f.Zb[c]=q(a)?m(a,7):0;for(c=0;4>c;++c)f.Lb[c]=q(a)?m(a,6):0}if(f.Bb)for(c=0;3>c;++c)h.jb[c]=q(a)?w(a,8):255}else f.Bb=0;if(a.Ka)return Yt(t,3,"cannot parse segment header");if((f=t.ed).zd=q(a),f.Tb=w(a,6),f.wb=w(a,3),f.Pc=q(a),f.Pc&&q(a)){for(h=0;4>h;++h)q(a)&&(f.vd[h]=m(a,6));for(h=0;4>h;++h)q(a)&&(f.od[h]=m(a,6))}if(t.L=0==f.Tb?0:f.zd?1:2,a.Ka)return Yt(t,3,"cannot parse filter header");var l=o;if(o=c=s,s=c+l,f=l,t.Xb=(1<<w(t.m,2))-1,l<3*(h=t.Xb))r=7;else{for(c+=3*h,f-=3*h,l=0;l<h;++l){var v=r[o+0]|r[o+1]<<8|r[o+2]<<16;v>f&&(v=f),d(t.Jc[+l],r,c,v),c+=v,f-=v,o+=3}d(t.Jc[+h],r,c,f),r=c<s?0:5}if(0!=r)return Yt(t,r,"cannot parse partitions");for(r=w(c=t.m,7),o=q(c)?m(c,4):0,s=q(c)?m(c,4):0,f=q(c)?m(c,4):0,h=q(c)?m(c,4):0,c=q(c)?m(c,4):0,l=t.Qa,v=0;4>v;++v){if(l.Cb){var b=l.Zb[v];l.Fb||(b+=r)}else{if(0<v){t.pb[v]=t.pb[0];continue}b=r}var p=t.pb[v];p.Sc[0]=ne[Ht(b+o,127)],p.Sc[1]=ie[Ht(b+0,127)],p.Eb[0]=2*ne[Ht(b+s,127)],p.Eb[1]=101581*ie[Ht(b+f,127)]>>16,8>p.Eb[1]&&(p.Eb[1]=8),p.Qc[0]=ne[Ht(b+h,117)],p.Qc[1]=ie[Ht(b+c,127)],p.lc=b+c}if(!u.Rb)return Yt(t,4,"Not a key frame.");for(q(a),u=t.Pa,r=0;4>r;++r){for(o=0;8>o;++o)for(s=0;3>s;++s)for(f=0;11>f;++f)h=j(a,fe[r][o][s][f])?w(a,8):ae[r][o][s][f],u.Wc[r][o].Yb[s][f]=h;for(o=0;17>o;++o)u.Xc[r][o]=u.Wc[r][ce[o]]}return t.kc=q(a),t.kc&&(t.Bd=w(a,8)),t.cb=1}function Xt(t,n,i,r,e,s,o){var a=n[e].Yb[i];for(i=0;16>e;++e){if(!j(t,a[i+0]))return e;for(;!j(t,a[i+1]);)if(a=n[++e].Yb[0],i=0,16==e)return 16;var u=n[e+1].Yb;if(j(t,a[i+2])){var f=t,c=0;if(j(f,(l=a)[(h=i)+3]))if(j(f,l[h+6])){for(a=0,h=2*(c=j(f,l[h+8]))+(l=j(f,l[h+9+c])),c=0,l=ee[h];l[a];++a)c+=c+j(f,l[a]);c+=3+(8<<h)}else j(f,l[h+7])?(c=7+2*j(f,165),c+=j(f,145)):c=5+j(f,159);else c=j(f,l[h+4])?3+j(f,l[h+5]):2;a=u[2]}else c=1,a=u[1];u=o+se[e],0>(f=t).b&&x(f);var h,l=f.b,v=(h=f.Ca>>1)-(f.I>>l)>>31;--f.b,f.Ca+=v,f.Ca|=1,f.I-=(h+1&v)<<l,s[u]=((c^v)-v)*r[(0<e)+0]}return 16}function Zt(t){var n=t.rb[t.sb-1];n.la=0,n.Na=0,e(t.zc,0,0,t.zc.length),t.ja=0}function Qt(t,i){if(null==t)return 0;if(null==i)return Yt(t,2,"NULL VP8Io parameter in VP8Decode().");if(!t.cb&&!Kt(t,i))return 0;if(n(t.cb),null==i.ac||i.ac(i)){i.ob&&(t.L=0);var a=De[t.L];if(2==t.L?(t.yb=0,t.zb=0):(t.yb=i.v-a>>4,t.zb=i.j-a>>4,0>t.yb&&(t.yb=0),0>t.zb&&(t.zb=0)),t.Va=i.o+15+a>>4,t.Hb=i.va+15+a>>4,t.Hb>t.za&&(t.Hb=t.za),t.Va>t.Ub&&(t.Va=t.Ub),0<t.L){var u=t.ed;for(a=0;4>a;++a){var f;if(t.Qa.Cb){var c=t.Qa.Lb[a];t.Qa.Fb||(c+=u.Tb)}else c=u.Tb;for(f=0;1>=f;++f){var h=t.gd[a][f],l=c;if(u.Pc&&(l+=u.vd[0],f&&(l+=u.od[0])),0<(l=0>l?0:63<l?63:l)){var v=l;0<u.wb&&(v=4<u.wb?v>>2:v>>1)>9-u.wb&&(v=9-u.wb),1>v&&(v=1),h.dd=v,h.tc=2*l+v,h.ld=40<=l?2:15<=l?1:0}else h.tc=0;h.La=f}}}a=0}else Yt(t,6,"Frame setup failed"),a=t.a;if(a=0==a){if(a){t.$c=0,0<t.Aa||(t.Ic=Ue);t:{u=4*(v=t.za);var d=32*v,w=v+1,m=0<t.L?v*(0<t.Aa?2:1):0,b=(2==t.Aa?2:1)*v;if((h=u+832+(f=3*(16*(a=t.Ic)+De[t.L])/2*d)+(c=null!=t.Fa&&0<t.Fa.length?t.Kc.c*t.Kc.i:0))!=h)a=0;else{if(h>t.Vb){if(t.Vb=0,t.Ec=s(h),t.Fc=0,null==t.Ec){a=Yt(t,1,"no memory during frame initialization.");break t}t.Vb=h}l=t.Fc,t.Ac=h=t.Ec,t.Bc=l,l+=u,t.Gd=o(d,Wt),t.Hd=0,t.rb=o(w+1,Dt),t.sb=1,t.wa=m?o(m,Ct):null,t.Y=0,t.D.Nb=0,t.D.wa=t.wa,t.D.Y=t.Y,0<t.Aa&&(t.D.Y+=v),n(!0),t.oc=h,t.pc=l,l+=832,t.ya=o(b,Ut),t.aa=0,t.D.ya=t.ya,t.D.aa=t.aa,2==t.Aa&&(t.D.aa+=v),t.R=16*v,t.B=8*v,v=(d=De[t.L])*t.R,d=d/2*t.B,t.sa=h,t.ta=l+v,t.qa=t.sa,t.ra=t.ta+16*a*t.R+d,t.Ha=t.qa,t.Ia=t.ra+8*a*t.B+d,t.$c=0,l+=f,t.mb=c?h:null,t.nb=c?l:null,n(l+c<=t.Fc+t.Vb),Zt(t),e(t.Ac,t.Bc,0,u),a=1}}if(a){if(i.ka=0,i.y=t.sa,i.O=t.ta,i.f=t.qa,i.N=t.ra,i.ea=t.Ha,i.Vd=t.Ia,i.fa=t.R,i.Rc=t.B,i.F=null,i.J=0,!Pr){for(a=-255;255>=a;++a)qr[255+a]=0>a?-a:a;for(a=-1020;1020>=a;++a)jr[1020+a]=-128>a?-128:127<a?127:a;for(a=-112;112>=a;++a)Mr[112+a]=-16>a?-16:15<a?15:a;for(a=-255;510>=a;++a)Er[255+a]=0>a?0:255<a?255:a;Pr=1}sr=cn,or=on,ur=an,fr=un,cr=fn,ar=sn,hr=$n,lr=Kn,vr=Qn,dr=ti,wr=Xn,mr=Zn,br=ni,pr=ii,Nr=Wn,Lr=_n,gr=Hn,Ar=Gn,le[0]=Sn,le[1]=ln,le[2]=yn,le[3]=kn,le[4]=xn,le[5]=jn,le[6]=qn,le[7]=Mn,le[8]=Pn,le[9]=En,he[0]=pn,he[1]=dn,he[2]=wn,he[3]=mn,he[4]=Nn,he[5]=Ln,he[6]=gn,ve[0]=Bn,ve[1]=vn,ve[2]=On,ve[3]=In,ve[4]=Tn,ve[5]=Rn,ve[6]=Cn,a=1}else a=0}a&&(a=function(t,i){for(t.M=0;t.M<t.Va;++t.M){var o,a=t.Jc[t.M&t.Xb],u=t.m,f=t;for(o=0;o<f.za;++o){var c=u,h=f,l=h.Ac,v=h.Bc+4*o,d=h.zc,w=h.ya[h.aa+o];if(w.$b=h.Qa.Bb?j(c,h.Pa.jb[0])?2+j(c,h.Pa.jb[2]):j(c,h.Pa.jb[1]):0,h.kc&&(w.Ad=j(c,h.Bd)),w.Za=!j(c,145)+0,w.Za){var m=w.Ob,b=0;for(h=0;4>h;++h){var p,N=d[0+h];for(p=0;4>p;++p){for(var L=oe[j(c,(N=ue[l[v+p]][N])[0])];0<L;)L=oe[2*L+j(c,N[L])];l[v+p]=N=-L}r(m,b,l,v,4),b+=4,d[0+h]=N}}else N=j(c,156)?j(c,128)?1:3:j(c,163)?2:0,w.Ob[0]=N,e(l,v,N,4),e(d,0,N,4);w.Dd=j(c,142)?j(c,114)?j(c,183)?1:3:2:0}if(f.m.Ka)return Yt(t,7,"Premature end-of-partition0 encountered.");for(;t.ja<t.za;++t.ja){if(f=a,c=(u=t).rb[u.sb-1],l=u.rb[u.sb+u.ja],o=u.ya[u.aa+u.ja],v=u.kc?o.Ad:0)c.la=l.la=0,o.Za||(c.Na=l.Na=0),o.Hc=0,o.Gc=0,o.ia=0;else{var g,A;if(c=l,l=f,v=u.Pa.Xc,w=u.pb[(d=u.ya[u.aa+u.ja]).$b],b=u.rb[u.sb-1],N=p=0,e(h=d.ad,m=0,0,384),d.Za)var y=0,k=v[3];else{L=s(16);var S=c.Na+b.Na;if(S=re(l,v[1],S,w.Eb,0,L,0),c.Na=b.Na=(0<S)+0,1<S)sr(L,0,h,m);else{var x=L[0]+3>>3;for(L=0;256>L;L+=16)h[m+L]=x}y=1,k=v[0]}var q=15&c.la,M=15&b.la;for(L=0;4>L;++L){var E=1&M;for(x=A=0;4>x;++x)q=q>>1|(E=(S=re(l,k,S=E+(1&q),w.Sc,y,h,m))>y)<<7,A=A<<2|(3<S?3:1<S?2:0!=h[m+0]),m+=16;q>>=4,M=M>>1|E<<7,p=(p<<8|A)>>>0}for(k=q,y=M>>4,g=0;4>g;g+=2){for(A=0,q=c.la>>4+g,M=b.la>>4+g,L=0;2>L;++L){for(E=1&M,x=0;2>x;++x)q=q>>1|(E=0<(S=re(l,v[2],S=E+(1&q),w.Qc,0,h,m)))<<3,A=A<<2|(3<S?3:1<S?2:0!=h[m+0]),m+=16;q>>=2,M=M>>1|E<<5}N|=A<<4*g,k|=q<<4<<g,y|=(240&M)<<g}c.la=k,b.la=y,d.Hc=p,d.Gc=N,d.ia=43690&N?0:w.ia,v=!(p|N)}if(0<u.L&&(u.wa[u.Y+u.ja]=u.gd[o.$b][o.Za],u.wa[u.Y+u.ja].La|=!v),f.Ka)return Yt(t,7,"Premature end-of-file encountered.")}if(Zt(t),u=i,f=1,o=(a=t).D,c=0<a.L&&a.M>=a.zb&&a.M<=a.Va,0==a.Aa)t:{if(o.M=a.M,o.uc=c,Fi(a,o),f=1,o=(A=a.D).Nb,c=(N=De[a.L])*a.R,v=a.sa,d=a.ta-c+(L=16*o*a.R),w=a.qa,h=a.ra-(l=N/2*a.B)+(x=8*o*a.B),m=a.Ha,b=a.Ia-l+x,M=0==(q=A.M),p=q>=a.Va-1,2==a.Aa&&Fi(a,A),A.uc)for(E=(S=a).D.M,n(S.D.uc),A=S.yb;A<S.Hb;++A){k=E;var P=(O=(U=S).D).Nb,O=O.wa[O.Y+(y=A)],I=U.sa,F=U.ta+16*P*(g=U.R)+16*y,B=O.dd,R=O.tc;if(0!=R)if(n(3<=R),1==U.L)0<y&&Lr(I,F,g,R+4),O.La&&Ar(I,F,g,R),0<k&&Nr(I,F,g,R+4),O.La&&gr(I,F,g,R);else{var T=U.B,C=U.qa,D=U.ra+8*P*T+8*y,z=U.Ha,U=U.Ia+8*P*T+8*y;P=O.ld,0<y&&(lr(I,F,g,R+4,B,P),dr(C,D,z,U,T,R+4,B,P)),O.La&&(mr(I,F,g,R,B,P),pr(C,D,z,U,T,R,B,P)),0<k&&(hr(I,F,g,R+4,B,P),vr(C,D,z,U,T,R+4,B,P)),O.La&&(wr(I,F,g,R,B,P),br(C,D,z,U,T,R,B,P))}}if(a.ia&&alert("todo:DitherRow"),null!=u.put){if(A=16*q,q=16*(q+1),M?(u.y=a.sa,u.O=a.ta+L,u.f=a.qa,u.N=a.ra+x,u.ea=a.Ha,u.W=a.Ia+x):(A-=N,u.y=v,u.O=d,u.f=w,u.N=h,u.ea=m,u.W=b),p||(q-=N),q>u.o&&(q=u.o),u.F=null,u.J=null,null!=a.Fa&&0<a.Fa.length&&A<q&&(u.J=li(a,u,A,q-A),u.F=a.mb,null==u.F&&0==u.F.length)){f=Yt(a,3,"Could not decode alpha data.");break t}A<u.j&&(N=u.j-A,A=u.j,n(!(1&N)),u.O+=a.R*N,u.N+=a.B*(N>>1),u.W+=a.B*(N>>1),null!=u.F&&(u.J+=u.width*N)),A<q&&(u.O+=u.v,u.N+=u.v>>1,u.W+=u.v>>1,null!=u.F&&(u.J+=u.v),u.ka=A-u.j,u.U=u.va-u.v,u.T=q-A,f=u.put(u))}o+1!=a.Ic||p||(r(a.sa,a.ta-c,v,d+16*a.R,c),r(a.qa,a.ra-l,w,h+8*a.B,l),r(a.Ha,a.Ia-l,m,b+8*a.B,l))}if(!f)return Yt(t,6,"Output aborted.")}return 1}(t,i)),null!=i.bc&&i.bc(i),a&=1}return a?(t.cb=0,a):0}function tn(t,n,i,r,e){t[n+i+32*r]=-256&(e=t[n+i+32*r]+(e>>3))?0>e?0:255:e}function nn(t,n,i,r,e,s){tn(t,n,0,i,r+e),tn(t,n,1,i,r+s),tn(t,n,2,i,r-s),tn(t,n,3,i,r-e)}function rn(t){return(20091*t>>16)+t}function en(t,n,i,r){var e,o=0,a=s(16);for(e=0;4>e;++e){var u=t[n+0]+t[n+8],f=t[n+0]-t[n+8],c=(35468*t[n+4]>>16)-rn(t[n+12]),h=rn(t[n+4])+(35468*t[n+12]>>16);a[o+0]=u+h,a[o+1]=f+c,a[o+2]=f-c,a[o+3]=u-h,o+=4,n++}for(e=o=0;4>e;++e)u=(t=a[o+0]+4)+a[o+8],f=t-a[o+8],c=(35468*a[o+4]>>16)-rn(a[o+12]),tn(i,r,0,0,u+(h=rn(a[o+4])+(35468*a[o+12]>>16))),tn(i,r,1,0,f+c),tn(i,r,2,0,f-c),tn(i,r,3,0,u-h),o++,r+=32}function sn(t,n,i,r){var e=t[n+0]+4,s=35468*t[n+4]>>16,o=rn(t[n+4]),a=35468*t[n+1]>>16;nn(i,r,0,e+o,t=rn(t[n+1]),a),nn(i,r,1,e+s,t,a),nn(i,r,2,e-s,t,a),nn(i,r,3,e-o,t,a)}function on(t,n,i,r,e){en(t,n,i,r),e&&en(t,n+16,i,r+4)}function an(t,n,i,r){or(t,n+0,i,r,1),or(t,n+32,i,r+128,1)}function un(t,n,i,r){var e;for(t=t[n+0]+4,e=0;4>e;++e)for(n=0;4>n;++n)tn(i,r,n,e,t)}function fn(t,n,i,r){t[n+0]&&fr(t,n+0,i,r),t[n+16]&&fr(t,n+16,i,r+4),t[n+32]&&fr(t,n+32,i,r+128),t[n+48]&&fr(t,n+48,i,r+128+4)}function cn(t,n,i,r){var e,o=s(16);for(e=0;4>e;++e){var a=t[n+0+e]+t[n+12+e],u=t[n+4+e]+t[n+8+e],f=t[n+4+e]-t[n+8+e],c=t[n+0+e]-t[n+12+e];o[0+e]=a+u,o[8+e]=a-u,o[4+e]=c+f,o[12+e]=c-f}for(e=0;4>e;++e)a=(t=o[0+4*e]+3)+o[3+4*e],f=o[1+4*e]-o[2+4*e],c=t-o[3+4*e],i[r+0]=a+(u=o[1+4*e]+o[2+4*e])>>3,i[r+16]=c+f>>3,i[r+32]=a-u>>3,i[r+48]=c-f>>3,r+=64}function hn(t,n,i){var r,e=n-32,s=Fr,o=255-t[e-1];for(r=0;r<i;++r){var a,u=s,f=o+t[n-1];for(a=0;a<i;++a)t[n+a]=u[f+t[e+a]];n+=32}}function ln(t,n){hn(t,n,4)}function vn(t,n){hn(t,n,8)}function dn(t,n){hn(t,n,16)}function wn(t,n){var i;for(i=0;16>i;++i)r(t,n+32*i,t,n-32,16)}function mn(t,n){var i;for(i=16;0<i;--i)e(t,n,t[n-1],16),n+=32}function bn(t,n,i){var r;for(r=0;16>r;++r)e(n,i+32*r,t,16)}function pn(t,n){var i,r=16;for(i=0;16>i;++i)r+=t[n-1+32*i]+t[n+i-32];bn(r>>5,t,n)}function Nn(t,n){var i,r=8;for(i=0;16>i;++i)r+=t[n-1+32*i];bn(r>>4,t,n)}function Ln(t,n){var i,r=8;for(i=0;16>i;++i)r+=t[n+i-32];bn(r>>4,t,n)}function gn(t,n){bn(128,t,n)}function An(t,n,i){return t+2*n+i+2>>2}function yn(t,n){var i,e=n-32;for(e=new Uint8Array([An(t[e-1],t[e+0],t[e+1]),An(t[e+0],t[e+1],t[e+2]),An(t[e+1],t[e+2],t[e+3]),An(t[e+2],t[e+3],t[e+4])]),i=0;4>i;++i)r(t,n+32*i,e,0,e.length)}function kn(t,n){var i=t[n-1],r=t[n-1+32],e=t[n-1+64],s=t[n-1+96];M(t,n+0,16843009*An(t[n-1-32],i,r)),M(t,n+32,16843009*An(i,r,e)),M(t,n+64,16843009*An(r,e,s)),M(t,n+96,16843009*An(e,s,s))}function Sn(t,n){var i,r=4;for(i=0;4>i;++i)r+=t[n+i-32]+t[n-1+32*i];for(r>>=3,i=0;4>i;++i)e(t,n+32*i,r,4)}function xn(t,n){var i=t[n-1+0],r=t[n-1+32],e=t[n-1+64],s=t[n-1-32],o=t[n+0-32],a=t[n+1-32],u=t[n+2-32],f=t[n+3-32];t[n+0+96]=An(r,e,t[n-1+96]),t[n+1+96]=t[n+0+64]=An(i,r,e),t[n+2+96]=t[n+1+64]=t[n+0+32]=An(s,i,r),t[n+3+96]=t[n+2+64]=t[n+1+32]=t[n+0+0]=An(o,s,i),t[n+3+64]=t[n+2+32]=t[n+1+0]=An(a,o,s),t[n+3+32]=t[n+2+0]=An(u,a,o),t[n+3+0]=An(f,u,a)}function qn(t,n){var i=t[n+1-32],r=t[n+2-32],e=t[n+3-32],s=t[n+4-32],o=t[n+5-32],a=t[n+6-32],u=t[n+7-32];t[n+0+0]=An(t[n+0-32],i,r),t[n+1+0]=t[n+0+32]=An(i,r,e),t[n+2+0]=t[n+1+32]=t[n+0+64]=An(r,e,s),t[n+3+0]=t[n+2+32]=t[n+1+64]=t[n+0+96]=An(e,s,o),t[n+3+32]=t[n+2+64]=t[n+1+96]=An(s,o,a),t[n+3+64]=t[n+2+96]=An(o,a,u),t[n+3+96]=An(a,u,u)}function jn(t,n){var i=t[n-1+0],r=t[n-1+32],e=t[n-1+64],s=t[n-1-32],o=t[n+0-32],a=t[n+1-32],u=t[n+2-32],f=t[n+3-32];t[n+0+0]=t[n+1+64]=s+o+1>>1,t[n+1+0]=t[n+2+64]=o+a+1>>1,t[n+2+0]=t[n+3+64]=a+u+1>>1,t[n+3+0]=u+f+1>>1,t[n+0+96]=An(e,r,i),t[n+0+64]=An(r,i,s),t[n+0+32]=t[n+1+96]=An(i,s,o),t[n+1+32]=t[n+2+96]=An(s,o,a),t[n+2+32]=t[n+3+96]=An(o,a,u),t[n+3+32]=An(a,u,f)}function Mn(t,n){var i=t[n+0-32],r=t[n+1-32],e=t[n+2-32],s=t[n+3-32],o=t[n+4-32],a=t[n+5-32],u=t[n+6-32],f=t[n+7-32];t[n+0+0]=i+r+1>>1,t[n+1+0]=t[n+0+64]=r+e+1>>1,t[n+2+0]=t[n+1+64]=e+s+1>>1,t[n+3+0]=t[n+2+64]=s+o+1>>1,t[n+0+32]=An(i,r,e),t[n+1+32]=t[n+0+96]=An(r,e,s),t[n+2+32]=t[n+1+96]=An(e,s,o),t[n+3+32]=t[n+2+96]=An(s,o,a),t[n+3+64]=An(o,a,u),t[n+3+96]=An(a,u,f)}function En(t,n){var i=t[n-1+0],r=t[n-1+32],e=t[n-1+64],s=t[n-1+96];t[n+0+0]=i+r+1>>1,t[n+2+0]=t[n+0+32]=r+e+1>>1,t[n+2+32]=t[n+0+64]=e+s+1>>1,t[n+1+0]=An(i,r,e),t[n+3+0]=t[n+1+32]=An(r,e,s),t[n+3+32]=t[n+1+64]=An(e,s,s),t[n+3+64]=t[n+2+64]=t[n+0+96]=t[n+1+96]=t[n+2+96]=t[n+3+96]=s}function Pn(t,n){var i=t[n-1+0],r=t[n-1+32],e=t[n-1+64],s=t[n-1+96],o=t[n-1-32],a=t[n+0-32],u=t[n+1-32],f=t[n+2-32];t[n+0+0]=t[n+2+32]=i+o+1>>1,t[n+0+32]=t[n+2+64]=r+i+1>>1,t[n+0+64]=t[n+2+96]=e+r+1>>1,t[n+0+96]=s+e+1>>1,t[n+3+0]=An(a,u,f),t[n+2+0]=An(o,a,u),t[n+1+0]=t[n+3+32]=An(i,o,a),t[n+1+32]=t[n+3+64]=An(r,i,o),t[n+1+64]=t[n+3+96]=An(e,r,i),t[n+1+96]=An(s,e,r)}function On(t,n){var i;for(i=0;8>i;++i)r(t,n+32*i,t,n-32,8)}function In(t,n){var i;for(i=0;8>i;++i)e(t,n,t[n-1],8),n+=32}function Fn(t,n,i){var r;for(r=0;8>r;++r)e(n,i+32*r,t,8)}function Bn(t,n){var i,r=8;for(i=0;8>i;++i)r+=t[n+i-32]+t[n-1+32*i];Fn(r>>4,t,n)}function Rn(t,n){var i,r=4;for(i=0;8>i;++i)r+=t[n+i-32];Fn(r>>3,t,n)}function Tn(t,n){var i,r=4;for(i=0;8>i;++i)r+=t[n-1+32*i];Fn(r>>3,t,n)}function Cn(t,n){Fn(128,t,n)}function Dn(t,n,i){var r=t[n-i],e=t[n+0],s=3*(e-r)+Or[1020+t[n-2*i]-t[n+i]],o=Ir[112+(s+4>>3)];t[n-i]=Fr[255+r+Ir[112+(s+3>>3)]],t[n+0]=Fr[255+e-o]}function zn(t,n,i,r){return Br[255+t[n-2*i]-t[n-i]]>r||Br[255+t[n+i]-t[n+0]]>r}function Un(t,n,i,r){return 4*Br[255+t[n-i]-t[n+0]]+Br[255+t[n-2*i]-t[n+i]]<=r}function Vn(t,n,i,r,e){var s=t[n-3*i],o=t[n-2*i],a=t[n-i],u=t[n+0],f=t[n+i],c=t[n+2*i];return 4*Br[255+a-u]+Br[255+o-f]>r?0:Br[255+t[n-4*i]-s]<=e&&Br[255+s-o]<=e&&Br[255+o-a]<=e&&Br[255+t[n+3*i]-c]<=e&&Br[255+c-f]<=e&&Br[255+f-u]<=e}function Wn(t,n,i,r){var e=2*r+1;for(r=0;16>r;++r)Un(t,n+r,i,e)&&Dn(t,n+r,i)}function _n(t,n,i,r){var e=2*r+1;for(r=0;16>r;++r)Un(t,n+r*i,1,e)&&Dn(t,n+r*i,1)}function Hn(t,n,i,r){var e;for(e=3;0<e;--e)Wn(t,n+=4*i,i,r)}function Gn(t,n,i,r){var e;for(e=3;0<e;--e)_n(t,n+=4,i,r)}function Jn(t,n,i,r,e,s,o,a){for(s=2*s+1;0<e--;){if(Vn(t,n,i,s,o))if(zn(t,n,i,a))Dn(t,n,i);else{var u=t,f=n,c=i,h=u[f-2*c],l=u[f-c],v=u[f+0],d=u[f+c],w=u[f+2*c],m=27*(p=Or[1020+3*(v-l)+Or[1020+h-d]])+63>>7,b=18*p+63>>7,p=9*p+63>>7;u[f-3*c]=Fr[255+u[f-3*c]+p],u[f-2*c]=Fr[255+h+b],u[f-c]=Fr[255+l+m],u[f+0]=Fr[255+v-m],u[f+c]=Fr[255+d-b],u[f+2*c]=Fr[255+w-p]}n+=r}}function Yn(t,n,i,r,e,s,o,a){for(s=2*s+1;0<e--;){if(Vn(t,n,i,s,o))if(zn(t,n,i,a))Dn(t,n,i);else{var u=t,f=n,c=i,h=u[f-c],l=u[f+0],v=u[f+c],d=Ir[112+(4+(w=3*(l-h))>>3)],w=Ir[112+(w+3>>3)],m=d+1>>1;u[f-2*c]=Fr[255+u[f-2*c]+m],u[f-c]=Fr[255+h+w],u[f+0]=Fr[255+l-d],u[f+c]=Fr[255+v-m]}n+=r}}function $n(t,n,i,r,e,s){Jn(t,n,i,1,16,r,e,s)}function Kn(t,n,i,r,e,s){Jn(t,n,1,i,16,r,e,s)}function Xn(t,n,i,r,e,s){var o;for(o=3;0<o;--o)Yn(t,n+=4*i,i,1,16,r,e,s)}function Zn(t,n,i,r,e,s){var o;for(o=3;0<o;--o)Yn(t,n+=4,1,i,16,r,e,s)}function Qn(t,n,i,r,e,s,o,a){Jn(t,n,e,1,8,s,o,a),Jn(i,r,e,1,8,s,o,a)}function ti(t,n,i,r,e,s,o,a){Jn(t,n,1,e,8,s,o,a),Jn(i,r,1,e,8,s,o,a)}function ni(t,n,i,r,e,s,o,a){Yn(t,n+4*e,e,1,8,s,o,a),Yn(i,r+4*e,e,1,8,s,o,a)}function ii(t,n,i,r,e,s,o,a){Yn(t,n+4,1,e,8,s,o,a),Yn(i,r+4,1,e,8,s,o,a)}function ri(){this.ba=new ot,this.ec=[],this.cc=[],this.Mc=[],this.Dc=this.Nc=this.dc=this.fc=0,this.Oa=new ut,this.memory=0,this.Ib="OutputFunc",this.Jb="OutputAlphaFunc",this.Nd="OutputRowFunc"}function ei(){this.data=[],this.offset=this.kd=this.ha=this.w=0,this.na=[],this.xa=this.gb=this.Ja=this.Sa=this.P=0}function si(){this.nc=this.Ea=this.b=this.hc=0,this.K=[],this.w=0}function oi(){this.ua=0,this.Wa=new B,this.vb=new B,this.md=this.xc=this.wc=0,this.vc=[],this.Wb=0,this.Ya=new v,this.yc=new h}function ai(){this.xb=this.a=0,this.l=new Gt,this.ca=new ot,this.V=[],this.Ba=0,this.Ta=[],this.Ua=0,this.m=new g,this.Pb=0,this.wd=new g,this.Ma=this.$=this.C=this.i=this.c=this.xd=0,this.s=new oi,this.ab=0,this.gc=o(4,si),this.Oc=0}function ui(){this.Lc=this.Z=this.$a=this.i=this.c=0,this.l=new Gt,this.ic=0,this.ca=[],this.tb=0,this.qd=null,this.rd=0}function fi(t,n,i,r,e,s,o){for(t=null==t?0:t[n+0],n=0;n<o;++n)e[s+n]=t+i[r+n]&255,t=e[s+n]}function ci(t,n,i,r,e,s,o){var a;if(null==t)fi(null,null,i,r,e,s,o);else for(a=0;a<o;++a)e[s+a]=t[n+a]+i[r+a]&255}function hi(t,n,i,r,e,s,o){if(null==t)fi(null,null,i,r,e,s,o);else{var a,u=t[n+0],f=u,c=u;for(a=0;a<o;++a)f=c+(u=t[n+a])-f,c=i[r+a]+(-256&f?0>f?0:255:f)&255,f=u,e[s+a]=c}}function li(t,i,e,o){var a=i.width,u=i.o;if(n(null!=t&&null!=i),0>e||0>=o||e+o>u)return null;if(!t.Cc){if(null==t.ga){var f;if(t.ga=new ui,(f=null==t.ga)||(f=i.width*i.o,n(0==t.Gb.length),t.Gb=s(f),t.Uc=0,null==t.Gb?f=0:(t.mb=t.Gb,t.nb=t.Uc,t.rc=null,f=1),f=!f),!f){var c=t.Fa,h=t.P,l=t.qc,v=t.mb,d=t.nb,w=h+1,m=l-1,p=(f=t.ga).l;if(n(null!=c&&null!=v&&null!=i),me[0]=null,me[1]=fi,me[2]=ci,me[3]=hi,f.ca=v,f.tb=d,f.c=i.width,f.i=i.height,n(0<f.c&&0<f.i),1>=l)i=0;else if(f.$a=c[h+0]>>0&3,f.Z=c[h+0]>>2&3,f.Lc=c[h+0]>>4&3,h=c[h+0]>>6&3,0>f.$a||1<f.$a||4<=f.Z||1<f.Lc||h)i=0;else if(p.put=vt,p.ac=lt,p.bc=dt,p.ma=f,p.width=i.width,p.height=i.height,p.Da=i.Da,p.v=i.v,p.va=i.va,p.j=i.j,p.o=i.o,f.$a)t:{n(1==f.$a),i=jt();n:for(;;){if(null==i){i=0;break t}if(n(null!=f),f.mc=i,i.c=f.c,i.i=f.i,i.l=f.l,i.l.ma=f,i.l.width=f.c,i.l.height=f.i,i.a=0,b(i.m,c,w,m),!Mt(f.c,f.i,1,i,null))break n;if(1==i.ab&&3==i.gc[0].hc&&yt(i.s)?(f.ic=1,c=i.c*i.i,i.Ta=null,i.Ua=0,i.V=s(c),i.Ba=0,null==i.V?(i.a=1,i=0):i=1):(f.ic=0,i=Et(i,f.c)),!i)break n;i=1;break t}f.mc=null,i=0}else i=m>=f.c*f.i;f=!i}if(f)return null;1!=t.ga.Lc?t.Ga=0:o=u-e}n(null!=t.ga),n(e+o<=u);t:{if(i=(c=t.ga).c,u=c.l.o,0==c.$a){if(w=t.rc,m=t.Vc,p=t.Fa,l=t.mb,v=t.nb+e*i,n((h=t.P+1+e*i)<=t.P+t.qc),0!=c.Z)for(n(null!=me[c.Z]),f=0;f<o;++f)me[c.Z](w,m,p,h,l,v,i),w=l,m=v,v+=i,h+=i;else for(f=0;f<o;++f)r(l,v,p,h,i),w=l,m=v,v+=i,h+=i;t.rc=w,t.Vc=m}else{if(n(null!=c.mc),i=e+o,n(null!=(f=c.mc)),n(i<=f.i),f.C>=i)i=1;else if(c.ic||bi(),c.ic){c=f.V,w=f.Ba;var N=f.i,L=(p=1,h=f.$/(m=f.c),l=f.$%m,v=f.m,d=f.s,f.$),g=m*N,A=m*i,k=d.wc,x=L<A?Lt(d,l,h):null;n(L<=g),n(i<=N),n(yt(d));n:for(;;){for(;!v.h&&L<A;){if(l&k||(x=Lt(d,l,h)),n(null!=x),S(v),256>(N=pt(x.G[0],x.H[0],v)))c[w+L]=N,++L,++l>=m&&(l=0,++h<=i&&!(h%16)&&St(f,h));else{if(!(280>N)){p=0;break n}N=mt(N-256,v);var q,j=pt(x.G[4],x.H[4],v);if(S(v),!(L>=(j=bt(m,j=mt(j,v)))&&g-L>=N)){p=0;break n}for(q=0;q<N;++q)c[w+L+q]=c[w+L+q-j];for(L+=N,l+=N;l>=m;)l-=m,++h<=i&&!(h%16)&&St(f,h);L<A&&l&k&&(x=Lt(d,l,h))}n(v.h==y(v))}St(f,h>i?i:h);break n}!p||v.h&&L<g?(p=0,f.a=v.h?5:3):f.$=L,i=p}else i=xt(f,f.V,f.Ba,f.c,f.i,i,Pt);if(!i){o=0;break t}}e+o>=u&&(t.Cc=1),o=1}if(!o)return null;if(t.Cc&&(null!=(o=t.ga)&&(o.mc=null),t.ga=null,0<t.Ga))return alert("todo:WebPDequantizeLevels"),null}return t.nb+e*a}function vi(t,n,i,r,e,s){for(;0<e--;){var o,a=t,u=n+(i?1:0),f=t,c=n+(i?0:3);for(o=0;o<r;++o){var h=f[c+4*o];255!=h&&(a[u+4*o+0]=a[u+4*o+0]*(h*=32897)>>23,a[u+4*o+1]=a[u+4*o+1]*h>>23,a[u+4*o+2]=a[u+4*o+2]*h>>23)}n+=s}}function di(t,n,i,r,e){for(;0<r--;){var s;for(s=0;s<i;++s){var o=t[n+2*s+0],a=15&(f=t[n+2*s+1]),u=4369*a,f=(240&f|f>>4)*u>>16;t[n+2*s+0]=(240&o|o>>4)*u>>16&240|(15&o|o<<4)*u>>16>>4&15,t[n+2*s+1]=240&f|a}n+=e}}function wi(t,n,i,r,e,s,o,a){var u,f,c=255;for(f=0;f<e;++f){for(u=0;u<r;++u){var h=t[n+u];s[o+4*u]=h,c&=h}n+=i,o+=a}return 255!=c}function mi(t,n,i,r,e){var s;for(s=0;s<e;++s)i[r+s]=t[n+s]>>8}function bi(){yr=vi,kr=di,Sr=wi,xr=mi}function pi(i,r,e){t[i]=function(t,i,s,o,a,u,f,c,h,l,v,d,w,m,b,p,N){var L,g=N-1>>1,A=a[u+0]|f[c+0]<<16,y=h[l+0]|v[d+0]<<16;n(null!=t);var k=3*A+y+131074>>2;for(r(t[i+0],255&k,k>>16,w,m),null!=s&&r(s[o+0],255&(k=3*y+A+131074>>2),k>>16,b,p),L=1;L<=g;++L){var S=a[u+L]|f[c+L]<<16,x=h[l+L]|v[d+L]<<16,q=A+S+y+x+524296,j=q+2*(S+y)>>3;k=j+A>>1,A=(q=q+2*(A+x)>>3)+S>>1,r(t[i+2*L-1],255&k,k>>16,w,m+(2*L-1)*e),r(t[i+2*L-0],255&A,A>>16,w,m+(2*L-0)*e),null!=s&&(A=j+x>>1,r(s[o+2*L-1],255&(k=q+y>>1),k>>16,b,p+(2*L-1)*e),r(s[o+2*L+0],255&A,A>>16,b,p+(2*L+0)*e)),A=S,y=x}1&N||(r(t[i+N-1],255&(k=3*A+y+131074>>2),k>>16,w,m+(N-1)*e),null!=s&&r(s[o+N-1],255&(k=3*y+A+131074>>2),k>>16,b,p+(N-1)*e))}}function Ni(){be[Rr]=pe,be[Tr]=Le,be[Cr]=Ne,be[Dr]=ge,be[zr]=Ae,be[Ur]=ye,be[Vr]=ke,be[Wr]=Le,be[_r]=ge,be[Hr]=Ae,be[Gr]=ye}function Li(t){return t&~Ee?0>t?0:255:t>>Me}function gi(t,n){return Li((19077*t>>8)+(26149*n>>8)-14234)}function Ai(t,n,i){return Li((19077*t>>8)-(6419*n>>8)-(13320*i>>8)+8708)}function yi(t,n){return Li((19077*t>>8)+(33050*n>>8)-17685)}function ki(t,n,i,r,e){r[e+0]=gi(t,i),r[e+1]=Ai(t,n,i),r[e+2]=yi(t,n)}function Si(t,n,i,r,e){r[e+0]=yi(t,n),r[e+1]=Ai(t,n,i),r[e+2]=gi(t,i)}function xi(t,n,i,r,e){var s=Ai(t,n,i);n=s<<3&224|yi(t,n)>>3,r[e+0]=248&gi(t,i)|s>>5,r[e+1]=n}function qi(t,n,i,r,e){var s=240&yi(t,n)|15;r[e+0]=240&gi(t,i)|Ai(t,n,i)>>4,r[e+1]=s}function ji(t,n,i,r,e){r[e+0]=255,ki(t,n,i,r,e+1)}function Mi(t,n,i,r,e){Si(t,n,i,r,e),r[e+3]=255}function Ei(t,n,i,r,e){ki(t,n,i,r,e),r[e+3]=255}function Ht(t,n){return 0>t?0:t>n?n:t}function Pi(n,i,r){t[n]=function(t,n,e,s,o,a,u,f,c){for(var h=f+(-2&c)*r;f!=h;)i(t[n+0],e[s+0],o[a+0],u,f),i(t[n+1],e[s+0],o[a+0],u,f+r),n+=2,++s,++a,f+=2*r;1&c&&i(t[n+0],e[s+0],o[a+0],u,f)}}function Oi(t,n,i){return 0==i?0==t?0==n?6:5:0==n?4:0:i}function Ii(t,n,i,r,e){switch(t>>>30){case 3:or(n,i,r,e,0);break;case 2:ar(n,i,r,e);break;case 1:fr(n,i,r,e)}}function Fi(t,n){var i,s,o=n.M,a=n.Nb,u=t.oc,f=t.pc+40,c=t.oc,h=t.pc+584,l=t.oc,v=t.pc+600;for(i=0;16>i;++i)u[f+32*i-1]=129;for(i=0;8>i;++i)c[h+32*i-1]=129,l[v+32*i-1]=129;for(0<o?u[f-1-32]=c[h-1-32]=l[v-1-32]=129:(e(u,f-32-1,127,21),e(c,h-32-1,127,9),e(l,v-32-1,127,9)),s=0;s<t.za;++s){var d=n.ya[n.aa+s];if(0<s){for(i=-1;16>i;++i)r(u,f+32*i-4,u,f+32*i+12,4);for(i=-1;8>i;++i)r(c,h+32*i-4,c,h+32*i+4,4),r(l,v+32*i-4,l,v+32*i+4,4)}var w=t.Gd,m=t.Hd+s,b=d.ad,p=d.Hc;if(0<o&&(r(u,f-32,w[m].y,0,16),r(c,h-32,w[m].f,0,8),r(l,v-32,w[m].ea,0,8)),d.Za){var N=u,L=f-32+16;for(0<o&&(s>=t.za-1?e(N,L,w[m].y[15],4):r(N,L,w[m+1].y,0,4)),i=0;4>i;i++)N[L+128+i]=N[L+256+i]=N[L+384+i]=N[L+0+i];for(i=0;16>i;++i,p<<=2)le[d.Ob[i]](N=u,L=f+Ce[i]),Ii(p,b,16*+i,N,L)}else if(N=Oi(s,o,d.Ob[0]),he[N](u,f),0!=p)for(i=0;16>i;++i,p<<=2)Ii(p,b,16*+i,u,f+Ce[i]);for(i=d.Gc,N=Oi(s,o,d.Dd),ve[N](c,h),ve[N](l,v),p=b,N=c,L=h,255&(d=i>>0)&&(170&d?ur(p,256,N,L):cr(p,256,N,L)),d=l,p=v,255&(i>>=8)&&(170&i?ur(b,320,d,p):cr(b,320,d,p)),o<t.Ub-1&&(r(w[m].y,0,u,f+480,16),r(w[m].f,0,c,h+224,8),r(w[m].ea,0,l,v+224,8)),w=t.sa,m=t.ta+16*s+16*a*t.R,b=t.qa,d=t.ra+8*s+(i=8*a*t.B),p=t.Ha,N=t.Ia+8*s+i,i=0;16>i;++i)r(w,m+i*t.R,u,f+32*i,16);for(i=0;8>i;++i)r(b,d+i*t.B,c,h+32*i,8),r(p,N+i*t.B,l,v+32*i,8)}}function Bi(t,r,e,s,o,a,u,f,c){var h=[0],l=[0],v=0,d=null!=c?c.kd:0,w=null!=c?c:new ei;if(null==t||12>e)return 7;w.data=t,w.w=r,w.ha=e,r=[r],e=[e],w.gb=[w.gb];t:{var m=r,p=e,N=w.gb;if(n(null!=t),n(null!=p),n(null!=N),N[0]=0,12<=p[0]&&!i(t,m[0],"RIFF")){if(i(t,m[0]+8,"WEBP")){N=3;break t}var L=O(t,m[0]+4);if(12>L||4294967286<L){N=3;break t}if(d&&L>p[0]-8){N=7;break t}N[0]=L,m[0]+=12,p[0]-=12}N=0}if(0!=N)return N;for(L=0<w.gb[0],e=e[0];;){t:{var A=t;p=r,N=e;var y=h,k=l,S=m=[0];if((j=v=[v])[0]=0,8>N[0])N=7;else{if(!i(A,p[0],"VP8X")){if(10!=O(A,p[0]+4)){N=3;break t}if(18>N[0]){N=7;break t}var x=O(A,p[0]+8),q=1+P(A,p[0]+12);if(2147483648<=q*(A=1+P(A,p[0]+15))){N=3;break t}null!=S&&(S[0]=x),null!=y&&(y[0]=q),null!=k&&(k[0]=A),p[0]+=18,N[0]-=18,j[0]=1}N=0}}if(v=v[0],0!=N)return N;if(p=!!(2&(m=m[0])),!L&&v)return 3;if(null!=a&&(a[0]=!!(16&m)),null!=u&&(u[0]=p),null!=f&&(f[0]=0),u=h[0],m=l[0],v&&p&&null==c){N=0;break}if(4>e){N=7;break}if(L&&v||!L&&!v&&!i(t,r[0],"ALPH")){e=[e],w.na=[w.na],w.P=[w.P],w.Sa=[w.Sa];t:{N=r,L=e;var j=w.gb;y=w.na,k=w.P,S=w.Sa,q=22,n(null!=(x=t)),n(null!=L),A=N[0];var M=L[0];for(n(null!=y),n(null!=S),y[0]=null,k[0]=null,S[0]=0;;){if(N[0]=A,L[0]=M,8>M){N=7;break t}var E=O(x,A+4);if(4294967286<E){N=3;break t}var I=8+E+1&-2;if(q+=I,0<j&&q>j){N=3;break t}if(!i(x,A,"VP8 ")||!i(x,A,"VP8L")){N=0;break t}if(M[0]<I){N=7;break t}i(x,A,"ALPH")||(y[0]=x,k[0]=A+8,S[0]=E),A+=I,M-=I}}if(e=e[0],w.na=w.na[0],w.P=w.P[0],w.Sa=w.Sa[0],0!=N)break}e=[e],w.Ja=[w.Ja],w.xa=[w.xa];t:if(j=t,N=r,L=e,y=w.gb[0],k=w.Ja,S=w.xa,x=N[0],A=!i(j,x,"VP8 "),q=!i(j,x,"VP8L"),n(null!=j),n(null!=L),n(null!=k),n(null!=S),8>L[0])N=7;else{if(A||q){if(j=O(j,x+4),12<=y&&j>y-12){N=3;break t}if(d&&j>L[0]-8){N=7;break t}k[0]=j,N[0]+=8,L[0]-=8,S[0]=q}else S[0]=5<=L[0]&&47==j[x+0]&&!(j[x+4]>>5),k[0]=L[0];N=0}if(e=e[0],w.Ja=w.Ja[0],w.xa=w.xa[0],r=r[0],0!=N)break;if(4294967286<w.Ja)return 3;if(null==f||p||(f[0]=w.xa?2:1),u=[u],m=[m],w.xa){if(5>e){N=7;break}f=u,d=m,p=a,null==t||5>e?t=0:5<=e&&47==t[r+0]&&!(t[r+4]>>5)?(L=[0],j=[0],y=[0],b(k=new g,t,r,e),wt(k,L,j,y)?(null!=f&&(f[0]=L[0]),null!=d&&(d[0]=j[0]),null!=p&&(p[0]=y[0]),t=1):t=0):t=0}else{if(10>e){N=7;break}f=m,null==t||10>e||!$t(t,r+3,e-3)?t=0:(d=t[r+0]|t[r+1]<<8|t[r+2]<<16,p=16383&(t[r+7]<<8|t[r+6]),t=16383&(t[r+9]<<8|t[r+8]),1&d||3<(d>>1&7)||!(d>>4&1)||d>>5>=w.Ja||!p||!t?t=0:(u&&(u[0]=p),f&&(f[0]=t),t=1))}if(!t)return 3;if(u=u[0],m=m[0],v&&(h[0]!=u||l[0]!=m))return 3;null!=c&&(c[0]=w,c.offset=r-c.w,n(4294967286>r-c.w),n(c.offset==c.ha-e));break}return 0==N||7==N&&v&&null==c?(null!=a&&(a[0]|=null!=w.na&&0<w.na.length),null!=s&&(s[0]=u),null!=o&&(o[0]=m),0):N}function Ri(t,n,i){var r=n.width,e=n.height,s=0,o=0,a=r,u=e;if(n.Da=null!=t&&0<t.Da,n.Da&&(a=t.cd,u=t.bd,s=t.v,o=t.j,11>i||(s&=-2,o&=-2),0>s||0>o||0>=a||0>=u||s+a>r||o+u>e))return 0;if(n.v=s,n.j=o,n.va=s+a,n.o=o+u,n.U=a,n.T=u,n.da=null!=t&&0<t.da,n.da){if(!R(a,u,i=[t.ib],s=[t.hb]))return 0;n.ib=i[0],n.hb=s[0]}return n.ob=null!=t&&t.ob,n.Kb=null==t||!t.Sd,n.da&&(n.ob=n.ib<3*r/4&&n.hb<3*e/4,n.Kb=0),1}function Ti(t){if(null==t)return 2;if(11>t.S){var n=t.f.RGBA;n.fb+=(t.height-1)*n.A,n.A=-n.A}else(n=t.f.kb).O+=((t=t.height)-1)*n.fa,n.fa=-n.fa,n.N+=(t-1>>1)*n.Ab,n.Ab=-n.Ab,n.W+=(t-1>>1)*n.Db,n.Db=-n.Db,null!=n.F&&(n.J+=(t-1)*n.lb,n.lb=-n.lb);return 0}function Ci(t,n,i,r){if(null==r||0>=t||0>=n)return 2;if(null!=i){if(i.Da){var e=i.cd,o=i.bd,a=-2&i.v,u=-2&i.j;if(0>a||0>u||0>=e||0>=o||a+e>t||u+o>n)return 2;t=e,n=o}if(i.da){if(!R(t,n,e=[i.ib],o=[i.hb]))return 2;t=e[0],n=o[0]}}r.width=t,r.height=n;t:{var f=r.width,c=r.height;if(t=r.S,0>=f||0>=c||!(t>=Rr&&13>t))t=2;else{if(0>=r.Rd&&null==r.sd){a=o=e=n=0;var h=(u=f*Ve[t])*c;if(11>t||(o=(c+1)/2*(n=(f+1)/2),12==t&&(a=(e=f)*c)),null==(c=s(h+2*o+a))){t=1;break t}r.sd=c,11>t?((f=r.f.RGBA).eb=c,f.fb=0,f.A=u,f.size=h):((f=r.f.kb).y=c,f.O=0,f.fa=u,f.Fd=h,f.f=c,f.N=0+h,f.Ab=n,f.Cd=o,f.ea=c,f.W=0+h+o,f.Db=n,f.Ed=o,12==t&&(f.F=c,f.J=0+h+2*o),f.Tc=a,f.lb=e)}if(n=1,o=r.width,a=r.height,(e=r.S)>=Rr&&13>e)if(11>e)t=r.f.RGBA,n&=(u=Math.abs(t.A))*(a-1)+o<=t.size,n&=u>=o*Ve[e],n&=null!=t.eb;else{t=r.f.kb,u=(o+1)/2,h=(a+1)/2,f=Math.abs(t.fa),c=Math.abs(t.Ab);var l=Math.abs(t.Db),v=Math.abs(t.lb);n&=f*(a-1)+o<=t.Fd,n&=c*(h-1)+u<=t.Cd,n=(n&=l*(h-1)+u<=t.Ed)&f>=o&c>=u&l>=u,n&=null!=t.y,n&=null!=t.f,n&=null!=t.ea,12==e&&(n&=v>=o,n&=v*(a-1)+o<=t.Tc,n&=null!=t.F)}else n=0;t=n?0:2}}return 0!=t||null!=i&&i.fd&&(t=Ti(r)),t}var Di=64,zi=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535,131071,262143,524287,1048575,2097151,4194303,8388607,16777215],Ui=24,Vi=32,Wi=8,_i=[0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7];D("Predictor0","PredictorAdd0"),t.Predictor0=function(){return 4278190080},t.Predictor1=function(t){return t},t.Predictor2=function(t,n,i){return n[i+0]},t.Predictor3=function(t,n,i){return n[i+1]},t.Predictor4=function(t,n,i){return n[i-1]},t.Predictor5=function(t,n,i){return U(U(t,n[i+1]),n[i+0])},t.Predictor6=function(t,n,i){return U(t,n[i-1])},t.Predictor7=function(t,n,i){return U(t,n[i+0])},t.Predictor8=function(t,n,i){return U(n[i-1],n[i+0])},t.Predictor9=function(t,n,i){return U(n[i+0],n[i+1])},t.Predictor10=function(t,n,i){return U(U(t,n[i-1]),U(n[i+0],n[i+1]))},t.Predictor11=function(t,n,i){var r=n[i+0];return 0>=_(r>>24&255,t>>24&255,(n=n[i-1])>>24&255)+_(r>>16&255,t>>16&255,n>>16&255)+_(r>>8&255,t>>8&255,n>>8&255)+_(255&r,255&t,255&n)?r:t},t.Predictor12=function(t,n,i){var r=n[i+0];return(V((t>>24&255)+(r>>24&255)-((n=n[i-1])>>24&255))<<24|V((t>>16&255)+(r>>16&255)-(n>>16&255))<<16|V((t>>8&255)+(r>>8&255)-(n>>8&255))<<8|V((255&t)+(255&r)-(255&n)))>>>0},t.Predictor13=function(t,n,i){var r=n[i-1];return(W((t=U(t,n[i+0]))>>24&255,r>>24&255)<<24|W(t>>16&255,r>>16&255)<<16|W(t>>8&255,r>>8&255)<<8|W(t>>0&255,r>>0&255))>>>0};var Hi=t.PredictorAdd0;t.PredictorAdd1=H,D("Predictor2","PredictorAdd2"),D("Predictor3","PredictorAdd3"),D("Predictor4","PredictorAdd4"),D("Predictor5","PredictorAdd5"),D("Predictor6","PredictorAdd6"),D("Predictor7","PredictorAdd7"),D("Predictor8","PredictorAdd8"),D("Predictor9","PredictorAdd9"),D("Predictor10","PredictorAdd10"),D("Predictor11","PredictorAdd11"),D("Predictor12","PredictorAdd12"),D("Predictor13","PredictorAdd13");var Gi=t.PredictorAdd2;$("ColorIndexInverseTransform","MapARGB","32b",(function(t){return t>>8&255}),(function(t){return t})),$("VP8LColorIndexInverseTransformAlpha","MapAlpha","8b",(function(t){return t}),(function(t){return t>>8&255}));var Ji,Yi=t.ColorIndexInverseTransform,$i=t.MapARGB,Ki=t.VP8LColorIndexInverseTransformAlpha,Xi=t.MapAlpha,Zi=t.VP8LPredictorsAdd=[];Zi.length=16,(t.VP8LPredictors=[]).length=16,(t.VP8LPredictorsAdd_C=[]).length=16,(t.VP8LPredictors_C=[]).length=16;var Qi,tr,nr,ir,rr,er,sr,or,ar,ur,fr,cr,hr,lr,vr,dr,wr,mr,br,pr,Nr,Lr,gr,Ar,yr,kr,Sr,xr,qr=s(511),jr=s(2041),Mr=s(225),Er=s(767),Pr=0,Or=jr,Ir=Mr,Fr=Er,Br=qr,Rr=0,Tr=1,Cr=2,Dr=3,zr=4,Ur=5,Vr=6,Wr=7,_r=8,Hr=9,Gr=10,Jr=[2,3,7],Yr=[3,3,11],$r=[280,256,256,256,40],Kr=[0,1,1,1,0],Xr=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],Zr=[24,7,23,25,40,6,39,41,22,26,38,42,56,5,55,57,21,27,54,58,37,43,72,4,71,73,20,28,53,59,70,74,36,44,88,69,75,52,60,3,87,89,19,29,86,90,35,45,68,76,85,91,51,61,104,2,103,105,18,30,102,106,34,46,84,92,67,77,101,107,50,62,120,1,119,121,83,93,17,31,100,108,66,78,118,122,33,47,117,123,49,63,99,109,82,94,0,116,124,65,79,16,32,98,110,48,115,125,81,95,64,114,126,97,111,80,113,127,96,112],Qr=[2954,2956,2958,2962,2970,2986,3018,3082,3212,3468,3980,5004],te=8,ne=[4,5,6,7,8,9,10,10,11,12,13,14,15,16,17,17,18,19,20,20,21,21,22,22,23,23,24,25,25,26,27,28,29,30,31,32,33,34,35,36,37,37,38,39,40,41,42,43,44,45,46,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,76,77,78,79,80,81,82,83,84,85,86,87,88,89,91,93,95,96,98,100,101,102,104,106,108,110,112,114,116,118,122,124,126,128,130,132,134,136,138,140,143,145,148,151,154,157],ie=[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,119,122,125,128,131,134,137,140,143,146,149,152,155,158,161,164,167,170,173,177,181,185,189,193,197,201,205,209,213,217,221,225,229,234,239,245,249,254,259,264,269,274,279,284],re=null,ee=[[173,148,140,0],[176,155,140,135,0],[180,157,141,134,130,0],[254,254,243,230,196,177,153,140,133,130,129,0]],se=[0,1,4,8,5,2,3,6,9,12,13,10,7,11,14,15],oe=[-0,1,-1,2,-2,3,4,6,-3,5,-4,-5,-6,7,-7,8,-8,-9],ae=[[[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]],[[253,136,254,255,228,219,128,128,128,128,128],[189,129,242,255,227,213,255,219,128,128,128],[106,126,227,252,214,209,255,255,128,128,128]],[[1,98,248,255,236,226,255,255,128,128,128],[181,133,238,254,221,234,255,154,128,128,128],[78,134,202,247,198,180,255,219,128,128,128]],[[1,185,249,255,243,255,128,128,128,128,128],[184,150,247,255,236,224,128,128,128,128,128],[77,110,216,255,236,230,128,128,128,128,128]],[[1,101,251,255,241,255,128,128,128,128,128],[170,139,241,252,236,209,255,255,128,128,128],[37,116,196,243,228,255,255,255,128,128,128]],[[1,204,254,255,245,255,128,128,128,128,128],[207,160,250,255,238,128,128,128,128,128,128],[102,103,231,255,211,171,128,128,128,128,128]],[[1,152,252,255,240,255,128,128,128,128,128],[177,135,243,255,234,225,128,128,128,128,128],[80,129,211,255,194,224,128,128,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[246,1,255,128,128,128,128,128,128,128,128],[255,128,128,128,128,128,128,128,128,128,128]]],[[[198,35,237,223,193,187,162,160,145,155,62],[131,45,198,221,172,176,220,157,252,221,1],[68,47,146,208,149,167,221,162,255,223,128]],[[1,149,241,255,221,224,255,255,128,128,128],[184,141,234,253,222,220,255,199,128,128,128],[81,99,181,242,176,190,249,202,255,255,128]],[[1,129,232,253,214,197,242,196,255,255,128],[99,121,210,250,201,198,255,202,128,128,128],[23,91,163,242,170,187,247,210,255,255,128]],[[1,200,246,255,234,255,128,128,128,128,128],[109,178,241,255,231,245,255,255,128,128,128],[44,130,201,253,205,192,255,255,128,128,128]],[[1,132,239,251,219,209,255,165,128,128,128],[94,136,225,251,218,190,255,255,128,128,128],[22,100,174,245,186,161,255,199,128,128,128]],[[1,182,249,255,232,235,128,128,128,128,128],[124,143,241,255,227,234,128,128,128,128,128],[35,77,181,251,193,211,255,205,128,128,128]],[[1,157,247,255,236,231,255,255,128,128,128],[121,141,235,255,225,227,255,255,128,128,128],[45,99,188,251,195,217,255,224,128,128,128]],[[1,1,251,255,213,255,128,128,128,128,128],[203,1,248,255,255,128,128,128,128,128,128],[137,1,177,255,224,255,128,128,128,128,128]]],[[[253,9,248,251,207,208,255,192,128,128,128],[175,13,224,243,193,185,249,198,255,255,128],[73,17,171,221,161,179,236,167,255,234,128]],[[1,95,247,253,212,183,255,255,128,128,128],[239,90,244,250,211,209,255,255,128,128,128],[155,77,195,248,188,195,255,255,128,128,128]],[[1,24,239,251,218,219,255,205,128,128,128],[201,51,219,255,196,186,128,128,128,128,128],[69,46,190,239,201,218,255,228,128,128,128]],[[1,191,251,255,255,128,128,128,128,128,128],[223,165,249,255,213,255,128,128,128,128,128],[141,124,248,255,255,128,128,128,128,128,128]],[[1,16,248,255,255,128,128,128,128,128,128],[190,36,230,255,236,255,128,128,128,128,128],[149,1,255,128,128,128,128,128,128,128,128]],[[1,226,255,128,128,128,128,128,128,128,128],[247,192,255,128,128,128,128,128,128,128,128],[240,128,255,128,128,128,128,128,128,128,128]],[[1,134,252,255,255,128,128,128,128,128,128],[213,62,250,255,255,128,128,128,128,128,128],[55,93,255,128,128,128,128,128,128,128,128]],[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]]],[[[202,24,213,235,186,191,220,160,240,175,255],[126,38,182,232,169,184,228,174,255,187,128],[61,46,138,219,151,178,240,170,255,216,128]],[[1,112,230,250,199,191,247,159,255,255,128],[166,109,228,252,211,215,255,174,128,128,128],[39,77,162,232,172,180,245,178,255,255,128]],[[1,52,220,246,198,199,249,220,255,255,128],[124,74,191,243,183,193,250,221,255,255,128],[24,71,130,219,154,170,243,182,255,255,128]],[[1,182,225,249,219,240,255,224,128,128,128],[149,150,226,252,216,205,255,171,128,128,128],[28,108,170,242,183,194,254,223,255,255,128]],[[1,81,230,252,204,203,255,192,128,128,128],[123,102,209,247,188,196,255,233,128,128,128],[20,95,153,243,164,173,255,203,128,128,128]],[[1,222,248,255,216,213,128,128,128,128,128],[168,175,246,252,235,205,255,255,128,128,128],[47,116,215,255,211,212,255,255,128,128,128]],[[1,121,236,253,212,214,255,255,128,128,128],[141,84,213,252,201,202,255,219,128,128,128],[42,80,160,240,162,185,255,205,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[244,1,255,128,128,128,128,128,128,128,128],[238,1,255,128,128,128,128,128,128,128,128]]]],ue=[[[231,120,48,89,115,113,120,152,112],[152,179,64,126,170,118,46,70,95],[175,69,143,80,85,82,72,155,103],[56,58,10,171,218,189,17,13,152],[114,26,17,163,44,195,21,10,173],[121,24,80,195,26,62,44,64,85],[144,71,10,38,171,213,144,34,26],[170,46,55,19,136,160,33,206,71],[63,20,8,114,114,208,12,9,226],[81,40,11,96,182,84,29,16,36]],[[134,183,89,137,98,101,106,165,148],[72,187,100,130,157,111,32,75,80],[66,102,167,99,74,62,40,234,128],[41,53,9,178,241,141,26,8,107],[74,43,26,146,73,166,49,23,157],[65,38,105,160,51,52,31,115,128],[104,79,12,27,217,255,87,17,7],[87,68,71,44,114,51,15,186,23],[47,41,14,110,182,183,21,17,194],[66,45,25,102,197,189,23,18,22]],[[88,88,147,150,42,46,45,196,205],[43,97,183,117,85,38,35,179,61],[39,53,200,87,26,21,43,232,171],[56,34,51,104,114,102,29,93,77],[39,28,85,171,58,165,90,98,64],[34,22,116,206,23,34,43,166,73],[107,54,32,26,51,1,81,43,31],[68,25,106,22,64,171,36,225,114],[34,19,21,102,132,188,16,76,124],[62,18,78,95,85,57,50,48,51]],[[193,101,35,159,215,111,89,46,111],[60,148,31,172,219,228,21,18,111],[112,113,77,85,179,255,38,120,114],[40,42,1,196,245,209,10,25,109],[88,43,29,140,166,213,37,43,154],[61,63,30,155,67,45,68,1,209],[100,80,8,43,154,1,51,26,71],[142,78,78,16,255,128,34,197,171],[41,40,5,102,211,183,4,1,221],[51,50,17,168,209,192,23,25,82]],[[138,31,36,171,27,166,38,44,229],[67,87,58,169,82,115,26,59,179],[63,59,90,180,59,166,93,73,154],[40,40,21,116,143,209,34,39,175],[47,15,16,183,34,223,49,45,183],[46,17,33,183,6,98,15,32,183],[57,46,22,24,128,1,54,17,37],[65,32,73,115,28,128,23,128,205],[40,3,9,115,51,192,18,6,223],[87,37,9,115,59,77,64,21,47]],[[104,55,44,218,9,54,53,130,226],[64,90,70,205,40,41,23,26,57],[54,57,112,184,5,41,38,166,213],[30,34,26,133,152,116,10,32,134],[39,19,53,221,26,114,32,73,255],[31,9,65,234,2,15,1,118,73],[75,32,12,51,192,255,160,43,51],[88,31,35,67,102,85,55,186,85],[56,21,23,111,59,205,45,37,192],[55,38,70,124,73,102,1,34,98]],[[125,98,42,88,104,85,117,175,82],[95,84,53,89,128,100,113,101,45],[75,79,123,47,51,128,81,171,1],[57,17,5,71,102,57,53,41,49],[38,33,13,121,57,73,26,1,85],[41,10,67,138,77,110,90,47,114],[115,21,2,10,102,255,166,23,6],[101,29,16,10,85,128,101,196,26],[57,18,10,102,102,213,34,20,43],[117,20,15,36,163,128,68,1,26]],[[102,61,71,37,34,53,31,243,192],[69,60,71,38,73,119,28,222,37],[68,45,128,34,1,47,11,245,171],[62,17,19,70,146,85,55,62,70],[37,43,37,154,100,163,85,160,1],[63,9,92,136,28,64,32,201,85],[75,15,9,9,64,255,184,119,16],[86,6,28,5,64,255,25,248,1],[56,8,17,132,137,255,55,116,128],[58,15,20,82,135,57,26,121,40]],[[164,50,31,137,154,133,25,35,218],[51,103,44,131,131,123,31,6,158],[86,40,64,135,148,224,45,183,128],[22,26,17,131,240,154,14,1,209],[45,16,21,91,64,222,7,1,197],[56,21,39,155,60,138,23,102,213],[83,12,13,54,192,255,68,47,28],[85,26,85,85,128,128,32,146,171],[18,11,7,63,144,171,4,4,246],[35,27,10,146,174,171,12,26,128]],[[190,80,35,99,180,80,126,54,45],[85,126,47,87,176,51,41,20,32],[101,75,128,139,118,146,116,128,85],[56,41,15,176,236,85,37,9,62],[71,30,17,119,118,255,17,18,138],[101,38,60,138,55,70,43,26,142],[146,36,19,30,171,255,97,27,20],[138,45,61,62,219,1,81,188,64],[32,41,20,117,151,142,20,21,163],[112,19,12,61,195,128,48,4,24]]],fe=[[[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[176,246,255,255,255,255,255,255,255,255,255],[223,241,252,255,255,255,255,255,255,255,255],[249,253,253,255,255,255,255,255,255,255,255]],[[255,244,252,255,255,255,255,255,255,255,255],[234,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255]],[[255,246,254,255,255,255,255,255,255,255,255],[239,253,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[251,255,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[251,254,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,254,253,255,254,255,255,255,255,255,255],[250,255,254,255,254,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[217,255,255,255,255,255,255,255,255,255,255],[225,252,241,253,255,255,254,255,255,255,255],[234,250,241,250,253,255,253,254,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[223,254,254,255,255,255,255,255,255,255,255],[238,253,254,254,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[249,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,255,255,255,255,255,255,255,255,255],[247,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[252,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[186,251,250,255,255,255,255,255,255,255,255],[234,251,244,254,255,255,255,255,255,255,255],[251,251,243,253,254,255,254,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[236,253,254,255,255,255,255,255,255,255,255],[251,253,253,254,254,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[254,254,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[254,254,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[248,255,255,255,255,255,255,255,255,255,255],[250,254,252,254,255,255,255,255,255,255,255],[248,254,249,253,255,255,255,255,255,255,255]],[[255,253,253,255,255,255,255,255,255,255,255],[246,253,253,255,255,255,255,255,255,255,255],[252,254,251,254,254,255,255,255,255,255,255]],[[255,254,252,255,255,255,255,255,255,255,255],[248,254,253,255,255,255,255,255,255,255,255],[253,255,254,254,255,255,255,255,255,255,255]],[[255,251,254,255,255,255,255,255,255,255,255],[245,251,254,255,255,255,255,255,255,255,255],[253,253,254,255,255,255,255,255,255,255,255]],[[255,251,253,255,255,255,255,255,255,255,255],[252,253,254,255,255,255,255,255,255,255,255],[255,254,255,255,255,255,255,255,255,255,255]],[[255,252,255,255,255,255,255,255,255,255,255],[249,255,254,255,255,255,255,255,255,255,255],[255,255,254,255,255,255,255,255,255,255,255]],[[255,255,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]]],ce=[0,1,2,3,6,4,5,6,6,6,6,6,6,6,6,7,0],he=[],le=[],ve=[],de=1,we=2,me=[],be=[];pi("UpsampleRgbLinePair",ki,3),pi("UpsampleBgrLinePair",Si,3),pi("UpsampleRgbaLinePair",Ei,4),pi("UpsampleBgraLinePair",Mi,4),pi("UpsampleArgbLinePair",ji,4),pi("UpsampleRgba4444LinePair",qi,2),pi("UpsampleRgb565LinePair",xi,2);var pe=t.UpsampleRgbLinePair,Ne=t.UpsampleBgrLinePair,Le=t.UpsampleRgbaLinePair,ge=t.UpsampleBgraLinePair,Ae=t.UpsampleArgbLinePair,ye=t.UpsampleRgba4444LinePair,ke=t.UpsampleRgb565LinePair,Se=16,xe=1<<Se-1,qe=-227,je=482,Me=6,Ee=(256<<Me)-1,Pe=0,Oe=s(256),Ie=s(256),Fe=s(256),Be=s(256),Re=s(je-qe),Te=s(je-qe);Pi("YuvToRgbRow",ki,3),Pi("YuvToBgrRow",Si,3),Pi("YuvToRgbaRow",Ei,4),Pi("YuvToBgraRow",Mi,4),Pi("YuvToArgbRow",ji,4),Pi("YuvToRgba4444Row",qi,2),Pi("YuvToRgb565Row",xi,2);var Ce=[0,4,8,12,128,132,136,140,256,260,264,268,384,388,392,396],De=[0,2,8],ze=[8,7,6,4,4,2,2,2,1,1,1,1],Ue=1;this.WebPDecodeRGBA=function(t,i,r,e,s){var o=Tr,a=new ri,u=new ot;a.ba=u,u.S=o,u.width=[u.width],u.height=[u.height];var f=u.width,c=u.height,h=new at;if(null==h||null==t)var l=2;else n(null!=h),l=Bi(t,i,r,h.width,h.height,h.Pd,h.Qd,h.format,null);if(0!=l?f=0:(null!=f&&(f[0]=h.width[0]),null!=c&&(c[0]=h.height[0]),f=1),f){u.width=u.width[0],u.height=u.height[0],null!=e&&(e[0]=u.width),null!=s&&(s[0]=u.height);t:{if(e=new Gt,(s=new ei).data=t,s.w=i,s.ha=r,s.kd=1,i=[0],n(null!=s),(0==(t=Bi(s.data,s.w,s.ha,null,null,null,i,null,s))||7==t)&&i[0]&&(t=4),0==(i=t)){if(n(null!=a),e.data=s.data,e.w=s.w+s.offset,e.ha=s.ha-s.offset,e.put=vt,e.ac=lt,e.bc=dt,e.ma=a,s.xa){if(null==(t=jt())){a=1;break t}if(function(t,i){var r=[0],e=[0],s=[0];n:for(;;){if(null==t)return 0;if(null==i)return t.a=2,0;if(t.l=i,t.a=0,b(t.m,i.data,i.w,i.ha),!wt(t.m,r,e,s)){t.a=3;break n}if(t.xb=we,i.width=r[0],i.height=e[0],!Mt(r[0],e[0],1,t,null))break n;return 1}return n(0!=t.a),0}(t,e)){if(e=0==(i=Ci(e.width,e.height,a.Oa,a.ba))){n:{e=t;i:for(;;){if(null==e){e=0;break n}if(n(null!=e.s.yc),n(null!=e.s.Ya),n(0<e.s.Wb),n(null!=(r=e.l)),n(null!=(s=r.ma)),0!=e.xb){if(e.ca=s.ba,e.tb=s.tb,n(null!=e.ca),!Ri(s.Oa,r,Dr)){e.a=2;break i}if(!Et(e,r.width))break i;if(r.da)break i;if((r.da||rt(e.ca.S))&&bi(),11>e.ca.S||(alert("todo:WebPInitConvertARGBToYUV"),null!=e.ca.f.kb.F&&bi()),e.Pb&&0<e.s.ua&&null==e.s.vb.X&&!I(e.s.vb,e.s.Wa.Xa)){e.a=1;break i}e.xb=0}if(!xt(e,e.V,e.Ba,e.c,e.i,r.o,At))break i;s.Dc=e.Ma,e=1;break n}n(0!=e.a),e=0}e=!e}e&&(i=t.a)}else i=t.a}else{if(null==(t=new Jt)){a=1;break t}if(t.Fa=s.na,t.P=s.P,t.qc=s.Sa,Kt(t,e)){if(0==(i=Ci(e.width,e.height,a.Oa,a.ba))){if(t.Aa=0,r=a.Oa,n(null!=(s=t)),null!=r){if(0<(f=0>(f=r.Md)?0:100<f?255:255*f/100)){for(c=h=0;4>c;++c)12>(l=s.pb[c]).lc&&(l.ia=f*ze[0>l.lc?0:l.lc]>>3),h|=l.ia;h&&(alert("todo:VP8InitRandom"),s.ia=1)}s.Ga=r.Id,100<s.Ga?s.Ga=100:0>s.Ga&&(s.Ga=0)}Qt(t,e)||(i=t.a)}}else i=t.a}0==i&&null!=a.Oa&&a.Oa.fd&&(i=Ti(a.ba))}a=i}o=0!=a?null:11>o?u.f.RGBA.eb:u.f.kb.y}else o=null;return o};var Ve=[3,4,3,4,4,2,2,4,4,4,2,1,1]};function f(t,n){for(var i="",r=0;r<4;r++)i+=String.fromCharCode(t[n++]);return i}function c(t,n){return(t[n+0]<<0|t[n+1]<<8|t[n+2]<<16)>>>0}function h(t,n){return(t[n+0]<<0|t[n+1]<<8|t[n+2]<<16|t[n+3]<<24)>>>0}new u;var l=[0],v=[0],d=[],w=new u,m=t,b=function(t,n){var i={},r=0,e=!1,s=0,o=0;if(i.frames=[],!
259
259
  /** @license
260
260
  * Copyright (c) 2017 Dominik Homberger
261
261
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
@@ -264,7 +264,7 @@ Tn=[192,193,194,195,196,197,198,199],Pt.API.processJPEG=function(t,n,i,r,e,s){va
264
264
  https://webpjs.appspot.com
265
265
  WebPRiffParser dominikhlbg@gmail.com
266
266
  */
267
- function(t,n){for(var i=0;i<4;i++)if(t[n+i]!="RIFF".charCodeAt(i))return!0;return!1}(t,n)){var a,u;for(h(t,n+=4),n+=8;n<t.length;){var l=f(t,n),v=h(t,n+=4);n+=4;var d=v+(1&v);switch(l){case"VP8 ":case"VP8L":void 0===i.frames[r]&&(i.frames[r]={}),(b=i.frames[r]).src_off=e?o:n-8,b.src_size=s+v+8,r++,e&&(e=!1,s=0,o=0);break;case"VP8X":(b=i.header={}).feature_flags=t[n];var w=n+4;b.canvas_width=1+c(t,w),b.canvas_height=1+c(t,w+=3),w+=3;break;case"ALPH":e=!0,s=d+8,o=n-8;break;case"ANIM":(b=i.header).bgcolor=h(t,n),b.loop_count=(a=t)[(u=w=n+4)+0]<<0|a[u+1]<<8,w+=2;break;case"ANMF":var m,b;(b=i.frames[r]={}).offset_x=2*c(t,n),b.offset_y=2*c(t,n+=3),b.width=1+c(t,n+=3),b.height=1+c(t,n+=3),b.duration=c(t,n+=3),n+=3,m=t[n++],b.dispose=1&m,b.blend=m>>1&1}"ANMF"!=l&&(n+=d)}return i}}(m,0);b.response=m,b.rgbaoutput=!0,b.dataurl=!1;var p=b.header?b.header:null,N=b.frames?b.frames:null;p&&(p.loop_counter=p.loop_count,l=[p.canvas_height],v=[p.canvas_width]);var L=N[0],g=w.WebPDecodeRGBA(m,L.src_off,L.src_size,v,l);L.rgba=g,L.imgwidth=v[0],L.imgheight=l[0];for(var A=0;A<v[0]*l[0]*4;A++)d[A]=g[A];return this.width=v,this.height=l,this.data=d,this}!function(t){var n=function(n,r,u,f){var c=4,h=s;switch(f){case t.image_compression.FAST:c=1,h=e;break;case t.image_compression.MEDIUM:c=6,h=o;break;case t.image_compression.SLOW:c=9,h=a}var l=X(n=i(n,r,u,h),{level:c});return t.__addimage__.arrayBufferToBinaryString(l)},i=function(t,n,i,r){for(var e,s,o,a=t.length/n,u=new Uint8Array(t.length+a),h=f(),l=0;l<a;l+=1){if(e=t.subarray(o=l*n,o+n),r)u.set(r(e,i,s),o+l);else{for(var v,d=h.length,w=[];v<d;v+=1)w[v]=h[v](e,i,s);var m=c(w.concat());u.set(w[m],o+l)}s=e}return u},r=function(t){var n=Array.apply([],t);return n.unshift(0),n},e=function(t,n){var i=[],r=t.length;i[0]=1;for(var e=0;e<r;e+=1)i[e+1]=t[e]-(t[e-n]||0)+256&255;return i},s=function(t,n,i){var r=[],e=t.length;r[0]=2;for(var s=0;s<e;s+=1)r[s+1]=t[s]-(i&&i[s]||0)+256&255;return r},o=function(t,n,i){var r=[],e=t.length;r[0]=3;for(var s=0;s<e;s+=1)r[s+1]=t[s]+256-((t[s-n]||0)+(i&&i[s]||0)>>>1)&255;return r},a=function(t,n,i){var r,e=[],s=t.length;e[0]=4;for(var o=0;o<s;o+=1)r=u(t[o-n]||0,i&&i[o]||0,i&&i[o-n]||0),e[o+1]=t[o]-r+256&255;return e},u=function(t,n,i){if(t===n&&n===i)return t;var r=Math.abs(n-i),e=Math.abs(t-i),s=Math.abs(t+n-i-i);return r<=e&&r<=s?t:e<=s?n:i},f=function(){return[r,e,s,o,a]},c=function(t){var n=t.map((function(t){return t.reduce((function(t,n){return t+Math.abs(n)}),0)}));return n.indexOf(Math.min.apply(null,n))};t.processPNG=function(i,r,e,s){var o,a,u,f,c,h,l,v,d,w,m,b,p,N,L,g=this.decode.FLATE_DECODE,A="";if(this.__addimage__.isArrayBuffer(i)&&(i=new Uint8Array(i)),this.__addimage__.isArrayBufferView(i)){if(i=(u=new Hn(i)).imgData,a=u.bits,o=u.colorSpace,c=u.colors,-1!==[4,6].indexOf(u.colorType)){if(8===u.bits){d=(v=32==u.pixelBitlength?new Uint32Array(u.decodePixels().buffer):16==u.pixelBitlength?new Uint16Array(u.decodePixels().buffer):new Uint8Array(u.decodePixels().buffer)).length,m=new Uint8Array(d*u.colors),w=new Uint8Array(d);var y,k=u.pixelBitlength-u.bits;for(N=0,L=0;N<d;N++){for(p=v[N],y=0;y<k;)m[L++]=p>>>y&255,y+=u.bits;w[N]=p>>>y&255}}if(16===u.bits){d=(v=new Uint32Array(u.decodePixels().buffer)).length,m=new Uint8Array(d*(32/u.pixelBitlength)*u.colors),w=new Uint8Array(d*(32/u.pixelBitlength)),b=u.colors>1,N=0,L=0;for(var S=0;N<d;)p=v[N++],m[L++]=p>>>0&255,b&&(m[L++]=p>>>16&255,p=v[N++],m[L++]=p>>>0&255),w[S++]=p>>>16&255;a=8}s!==t.image_compression.NONE?(i=n(m,u.width*u.colors,u.colors,s),l=n(w,u.width,1,s)):(i=m,l=w,g=void 0)}if(3===u.colorType&&(o=this.color_spaces.INDEXED,h=u.palette,u.transparency.indexed)){var x=u.transparency.indexed,q=0;for(N=0,d=x.length;N<d;++N)q+=x[N];if((q/=255)==d-1&&-1!==x.indexOf(0))f=[x.indexOf(0)];else if(q!==d){for(v=u.decodePixels(),w=new Uint8Array(v.length),N=0,d=v.length;N<d;N++)w[N]=x[v[N]];l=n(w,u.width,1)}}var j=function(n){var i;switch(n){case t.image_compression.FAST:i=11;break;case t.image_compression.MEDIUM:i=13;break;case t.image_compression.SLOW:i=14;break;default:i=12}return i}(s);return g===this.decode.FLATE_DECODE&&(A="/Predictor "+j+" "),A+="/Colors "+c+" /BitsPerComponent "+a+" /Columns "+u.width,(this.__addimage__.isArrayBuffer(i)||this.__addimage__.isArrayBufferView(i))&&(i=this.__addimage__.arrayBufferToBinaryString(i)),(l&&this.__addimage__.isArrayBuffer(l)||this.__addimage__.isArrayBufferView(l))&&(l=this.__addimage__.arrayBufferToBinaryString(l)),{alias:e,data:i,index:r,filter:g,decodeParameters:A,transparency:f,palette:h,sMask:l,predictor:j,width:u.width,height:u.height,bitsPerComponent:a,colorSpace:o}}}}(Pt.API),function(t){t.processGIF89A=function(n,i,r,e){var s=new _n(n),o=s.width,a=s.height,u=[];s.decodeAndBlitFrameRGBA(0,u);var f={data:u,width:o,height:a},c=new Jn(100).encode(f,100);return t.processJPEG.call(this,c,i,r,e)},t.processGIF87A=t.processGIF89A}(Pt.API),Yn.prototype.parseHeader=function(){if(this.fileSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.reserved=this.datav.getUint32(this.pos,!0),this.pos+=4,this.offset=this.datav.getUint32(this.pos,!0),this.pos+=4,this.headerSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.width=this.datav.getUint32(this.pos,!0),this.pos+=4,this.height=this.datav.getInt32(this.pos,!0),this.pos+=4,this.planes=this.datav.getUint16(this.pos,!0),this.pos+=2,this.bitPP=this.datav.getUint16(this.pos,!0),this.pos+=2,this.compress=this.datav.getUint32(this.pos,!0),this.pos+=4,this.rawSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.hr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.vr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.colors=this.datav.getUint32(this.pos,!0),this.pos+=4,this.importantColors=this.datav.getUint32(this.pos,!0),this.pos+=4,16===this.bitPP&&this.is_with_alpha&&(this.bitPP=15),this.bitPP<15){var t=0===this.colors?1<<this.bitPP:this.colors;this.palette=new Array(t);for(var n=0;n<t;n++){var i=this.datav.getUint8(this.pos++,!0),r=this.datav.getUint8(this.pos++,!0),e=this.datav.getUint8(this.pos++,!0),s=this.datav.getUint8(this.pos++,!0);this.palette[n]={red:e,green:r,blue:i,quad:s}}}this.height<0&&(this.height*=-1,this.bottom_up=!1)},Yn.prototype.parseBGR=function(){this.pos=this.offset;try{var t="bit"+this.bitPP;this.data=new Uint8Array(this.width*this.height*4),this[t]()}catch(t){tt.log("bit decode error:"+t)}},Yn.prototype.bit1=function(){var t,n=Math.ceil(this.width/8),i=n%4;for(t=this.height-1;t>=0;t--){for(var r=this.bottom_up?t:this.height-1-t,e=0;e<n;e++)for(var s=this.datav.getUint8(this.pos++,!0),o=r*this.width*4+8*e*4,a=0;a<8&&8*e+a<this.width;a++){var u=this.palette[s>>7-a&1];this.data[o+4*a]=u.blue,this.data[o+4*a+1]=u.green,this.data[o+4*a+2]=u.red,this.data[o+4*a+3]=255}0!==i&&(this.pos+=4-i)}},Yn.prototype.bit4=function(){for(var t=Math.ceil(this.width/2),n=t%4,i=this.height-1;i>=0;i--){for(var r=this.bottom_up?i:this.height-1-i,e=0;e<t;e++){var s=this.datav.getUint8(this.pos++,!0),o=r*this.width*4+2*e*4,a=15&s,u=this.palette[s>>4];if(this.data[o]=u.blue,this.data[o+1]=u.green,this.data[o+2]=u.red,this.data[o+3]=255,2*e+1>=this.width)break;this.data[o+4]=(u=this.palette[a]).blue,this.data[o+4+1]=u.green,this.data[o+4+2]=u.red,this.data[o+4+3]=255}0!==n&&(this.pos+=4-n)}},Yn.prototype.bit8=function(){for(var t=this.width%4,n=this.height-1;n>=0;n--){for(var i=this.bottom_up?n:this.height-1-n,r=0;r<this.width;r++){var e=this.datav.getUint8(this.pos++,!0),s=i*this.width*4+4*r;if(e<this.palette.length){var o=this.palette[e];this.data[s]=o.red,this.data[s+1]=o.green,this.data[s+2]=o.blue,this.data[s+3]=255}else this.data[s]=255,this.data[s+1]=255,this.data[s+2]=255,this.data[s+3]=255}0!==t&&(this.pos+=4-t)}},Yn.prototype.bit15=function(){for(var t=this.width%3,n=parseInt("11111",2),i=this.height-1;i>=0;i--){for(var r=this.bottom_up?i:this.height-1-i,e=0;e<this.width;e++){var s=this.datav.getUint16(this.pos,!0);this.pos+=2;var o=(s&n)/n*255|0,a=(s>>5&n)/n*255|0,u=s>>15?255:0,f=r*this.width*4+4*e;this.data[f]=(s>>10&n)/n*255|0,this.data[f+1]=a,this.data[f+2]=o,this.data[f+3]=u}this.pos+=t}},Yn.prototype.bit16=function(){for(var t=this.width%3,n=parseInt("11111",2),i=parseInt("111111",2),r=this.height-1;r>=0;r--){for(var e=this.bottom_up?r:this.height-1-r,s=0;s<this.width;s++){var o=this.datav.getUint16(this.pos,!0);this.pos+=2;var a=(o&n)/n*255|0,u=(o>>5&i)/i*255|0,f=e*this.width*4+4*s;this.data[f]=(o>>11)/n*255|0,this.data[f+1]=u,this.data[f+2]=a,this.data[f+3]=255}this.pos+=t}},Yn.prototype.bit24=function(){for(var t=this.height-1;t>=0;t--){for(var n=this.bottom_up?t:this.height-1-t,i=0;i<this.width;i++){var r=this.datav.getUint8(this.pos++,!0),e=this.datav.getUint8(this.pos++,!0),s=this.datav.getUint8(this.pos++,!0),o=n*this.width*4+4*i;this.data[o]=s,this.data[o+1]=e,this.data[o+2]=r,this.data[o+3]=255}this.pos+=this.width%4}},Yn.prototype.bit32=function(){for(var t=this.height-1;t>=0;t--)for(var n=this.bottom_up?t:this.height-1-t,i=0;i<this.width;i++){var r=this.datav.getUint8(this.pos++,!0),e=this.datav.getUint8(this.pos++,!0),s=this.datav.getUint8(this.pos++,!0),o=this.datav.getUint8(this.pos++,!0),a=n*this.width*4+4*i;this.data[a]=s,this.data[a+1]=e,this.data[a+2]=r,this.data[a+3]=o}},Yn.prototype.getData=function(){return this.data},
267
+ function(t,n){for(var i=0;i<4;i++)if(t[n+i]!="RIFF".charCodeAt(i))return!0;return!1}(t,n)){var a,u;for(h(t,n+=4),n+=8;n<t.length;){var l=f(t,n),v=h(t,n+=4);n+=4;var d=v+(1&v);switch(l){case"VP8 ":case"VP8L":void 0===i.frames[r]&&(i.frames[r]={}),(b=i.frames[r]).src_off=e?o:n-8,b.src_size=s+v+8,r++,e&&(e=!1,s=0,o=0);break;case"VP8X":(b=i.header={}).feature_flags=t[n];var w=n+4;b.canvas_width=1+c(t,w),b.canvas_height=1+c(t,w+=3),w+=3;break;case"ALPH":e=!0,s=d+8,o=n-8;break;case"ANIM":(b=i.header).bgcolor=h(t,n),b.loop_count=(a=t)[(u=w=n+4)+0]<<0|a[u+1]<<8,w+=2;break;case"ANMF":var m,b;(b=i.frames[r]={}).offset_x=2*c(t,n),b.offset_y=2*c(t,n+=3),b.width=1+c(t,n+=3),b.height=1+c(t,n+=3),b.duration=c(t,n+=3),n+=3,m=t[n++],b.dispose=1&m,b.blend=m>>1&1}"ANMF"!=l&&(n+=d)}return i}}(m,0);b.response=m,b.rgbaoutput=!0,b.dataurl=!1;var p=b.header?b.header:null,N=b.frames?b.frames:null;p&&(p.loop_counter=p.loop_count,l=[p.canvas_height],v=[p.canvas_width]);var L=N[0],g=w.WebPDecodeRGBA(m,L.src_off,L.src_size,v,l);L.rgba=g,L.imgwidth=v[0],L.imgheight=l[0];for(var A=0;A<v[0]*l[0]*4;A++)d[A]=g[A];return this.width=v,this.height=l,this.data=d,this}!function(t){var n=function(n,r,u,f){var c=4,h=s;switch(f){case t.image_compression.FAST:c=1,h=e;break;case t.image_compression.MEDIUM:c=6,h=o;break;case t.image_compression.SLOW:c=9,h=a}var l=X(n=i(n,r,u,h),{level:c});return t.__addimage__.arrayBufferToBinaryString(l)},i=function(t,n,i,r){for(var e,s,o,a=t.length/n,u=new Uint8Array(t.length+a),h=f(),l=0;l<a;l+=1){if(e=t.subarray(o=l*n,o+n),r)u.set(r(e,i,s),o+l);else{for(var v,d=h.length,w=[];v<d;v+=1)w[v]=h[v](e,i,s);var m=c(w.concat());u.set(w[m],o+l)}s=e}return u},r=function(t){var n=Array.apply([],t);return n.unshift(0),n},e=function(t,n){var i=[],r=t.length;i[0]=1;for(var e=0;e<r;e+=1)i[e+1]=t[e]-(t[e-n]||0)+256&255;return i},s=function(t,n,i){var r=[],e=t.length;r[0]=2;for(var s=0;s<e;s+=1)r[s+1]=t[s]-(i&&i[s]||0)+256&255;return r},o=function(t,n,i){var r=[],e=t.length;r[0]=3;for(var s=0;s<e;s+=1)r[s+1]=t[s]+256-((t[s-n]||0)+(i&&i[s]||0)>>>1)&255;return r},a=function(t,n,i){var r,e=[],s=t.length;e[0]=4;for(var o=0;o<s;o+=1)r=u(t[o-n]||0,i&&i[o]||0,i&&i[o-n]||0),e[o+1]=t[o]-r+256&255;return e},u=function(t,n,i){if(t===n&&n===i)return t;var r=Math.abs(n-i),e=Math.abs(t-i),s=Math.abs(t+n-i-i);return r<=e&&r<=s?t:e<=s?n:i},f=function(){return[r,e,s,o,a]},c=function(t){var n=t.map((function(t){return t.reduce((function(t,n){return t+Math.abs(n)}),0)}));return n.indexOf(Math.min.apply(null,n))};t.processPNG=function(i,r,e,s){var o,a,u,f,c,h,l,v,d,w,m,b,p,N,L,g=this.decode.FLATE_DECODE,A="";if(this.__addimage__.isArrayBuffer(i)&&(i=new Uint8Array(i)),this.__addimage__.isArrayBufferView(i)){if(i=(u=new _n(i)).imgData,a=u.bits,o=u.colorSpace,c=u.colors,-1!==[4,6].indexOf(u.colorType)){if(8===u.bits){d=(v=32==u.pixelBitlength?new Uint32Array(u.decodePixels().buffer):16==u.pixelBitlength?new Uint16Array(u.decodePixels().buffer):new Uint8Array(u.decodePixels().buffer)).length,m=new Uint8Array(d*u.colors),w=new Uint8Array(d);var y,k=u.pixelBitlength-u.bits;for(N=0,L=0;N<d;N++){for(p=v[N],y=0;y<k;)m[L++]=p>>>y&255,y+=u.bits;w[N]=p>>>y&255}}if(16===u.bits){d=(v=new Uint32Array(u.decodePixels().buffer)).length,m=new Uint8Array(d*(32/u.pixelBitlength)*u.colors),w=new Uint8Array(d*(32/u.pixelBitlength)),b=u.colors>1,N=0,L=0;for(var S=0;N<d;)p=v[N++],m[L++]=p>>>0&255,b&&(m[L++]=p>>>16&255,p=v[N++],m[L++]=p>>>0&255),w[S++]=p>>>16&255;a=8}s!==t.image_compression.NONE?(i=n(m,u.width*u.colors,u.colors,s),l=n(w,u.width,1,s)):(i=m,l=w,g=void 0)}if(3===u.colorType&&(o=this.color_spaces.INDEXED,h=u.palette,u.transparency.indexed)){var x=u.transparency.indexed,q=0;for(N=0,d=x.length;N<d;++N)q+=x[N];if((q/=255)==d-1&&-1!==x.indexOf(0))f=[x.indexOf(0)];else if(q!==d){for(v=u.decodePixels(),w=new Uint8Array(v.length),N=0,d=v.length;N<d;N++)w[N]=x[v[N]];l=n(w,u.width,1)}}var j=function(n){var i;switch(n){case t.image_compression.FAST:i=11;break;case t.image_compression.MEDIUM:i=13;break;case t.image_compression.SLOW:i=14;break;default:i=12}return i}(s);return g===this.decode.FLATE_DECODE&&(A="/Predictor "+j+" "),A+="/Colors "+c+" /BitsPerComponent "+a+" /Columns "+u.width,(this.__addimage__.isArrayBuffer(i)||this.__addimage__.isArrayBufferView(i))&&(i=this.__addimage__.arrayBufferToBinaryString(i)),(l&&this.__addimage__.isArrayBuffer(l)||this.__addimage__.isArrayBufferView(l))&&(l=this.__addimage__.arrayBufferToBinaryString(l)),{alias:e,data:i,index:r,filter:g,decodeParameters:A,transparency:f,palette:h,sMask:l,predictor:j,width:u.width,height:u.height,bitsPerComponent:a,colorSpace:o}}}}(Pt.API),function(t){t.processGIF89A=function(n,i,r,e){var s=new Hn(n),o=s.width,a=s.height,u=[];s.decodeAndBlitFrameRGBA(0,u);var f={data:u,width:o,height:a},c=new Jn(100).encode(f,100);return t.processJPEG.call(this,c,i,r,e)},t.processGIF87A=t.processGIF89A}(Pt.API),Yn.prototype.parseHeader=function(){if(this.fileSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.reserved=this.datav.getUint32(this.pos,!0),this.pos+=4,this.offset=this.datav.getUint32(this.pos,!0),this.pos+=4,this.headerSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.width=this.datav.getUint32(this.pos,!0),this.pos+=4,this.height=this.datav.getInt32(this.pos,!0),this.pos+=4,this.planes=this.datav.getUint16(this.pos,!0),this.pos+=2,this.bitPP=this.datav.getUint16(this.pos,!0),this.pos+=2,this.compress=this.datav.getUint32(this.pos,!0),this.pos+=4,this.rawSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.hr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.vr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.colors=this.datav.getUint32(this.pos,!0),this.pos+=4,this.importantColors=this.datav.getUint32(this.pos,!0),this.pos+=4,16===this.bitPP&&this.is_with_alpha&&(this.bitPP=15),this.bitPP<15){var t=0===this.colors?1<<this.bitPP:this.colors;this.palette=new Array(t);for(var n=0;n<t;n++){var i=this.datav.getUint8(this.pos++,!0),r=this.datav.getUint8(this.pos++,!0),e=this.datav.getUint8(this.pos++,!0),s=this.datav.getUint8(this.pos++,!0);this.palette[n]={red:e,green:r,blue:i,quad:s}}}this.height<0&&(this.height*=-1,this.bottom_up=!1)},Yn.prototype.parseBGR=function(){this.pos=this.offset;try{var t="bit"+this.bitPP;this.data=new Uint8Array(this.width*this.height*4),this[t]()}catch(t){tt.log("bit decode error:"+t)}},Yn.prototype.bit1=function(){var t,n=Math.ceil(this.width/8),i=n%4;for(t=this.height-1;t>=0;t--){for(var r=this.bottom_up?t:this.height-1-t,e=0;e<n;e++)for(var s=this.datav.getUint8(this.pos++,!0),o=r*this.width*4+8*e*4,a=0;a<8&&8*e+a<this.width;a++){var u=this.palette[s>>7-a&1];this.data[o+4*a]=u.blue,this.data[o+4*a+1]=u.green,this.data[o+4*a+2]=u.red,this.data[o+4*a+3]=255}0!==i&&(this.pos+=4-i)}},Yn.prototype.bit4=function(){for(var t=Math.ceil(this.width/2),n=t%4,i=this.height-1;i>=0;i--){for(var r=this.bottom_up?i:this.height-1-i,e=0;e<t;e++){var s=this.datav.getUint8(this.pos++,!0),o=r*this.width*4+2*e*4,a=15&s,u=this.palette[s>>4];if(this.data[o]=u.blue,this.data[o+1]=u.green,this.data[o+2]=u.red,this.data[o+3]=255,2*e+1>=this.width)break;this.data[o+4]=(u=this.palette[a]).blue,this.data[o+4+1]=u.green,this.data[o+4+2]=u.red,this.data[o+4+3]=255}0!==n&&(this.pos+=4-n)}},Yn.prototype.bit8=function(){for(var t=this.width%4,n=this.height-1;n>=0;n--){for(var i=this.bottom_up?n:this.height-1-n,r=0;r<this.width;r++){var e=this.datav.getUint8(this.pos++,!0),s=i*this.width*4+4*r;if(e<this.palette.length){var o=this.palette[e];this.data[s]=o.red,this.data[s+1]=o.green,this.data[s+2]=o.blue,this.data[s+3]=255}else this.data[s]=255,this.data[s+1]=255,this.data[s+2]=255,this.data[s+3]=255}0!==t&&(this.pos+=4-t)}},Yn.prototype.bit15=function(){for(var t=this.width%3,n=parseInt("11111",2),i=this.height-1;i>=0;i--){for(var r=this.bottom_up?i:this.height-1-i,e=0;e<this.width;e++){var s=this.datav.getUint16(this.pos,!0);this.pos+=2;var o=(s&n)/n*255|0,a=(s>>5&n)/n*255|0,u=s>>15?255:0,f=r*this.width*4+4*e;this.data[f]=(s>>10&n)/n*255|0,this.data[f+1]=a,this.data[f+2]=o,this.data[f+3]=u}this.pos+=t}},Yn.prototype.bit16=function(){for(var t=this.width%3,n=parseInt("11111",2),i=parseInt("111111",2),r=this.height-1;r>=0;r--){for(var e=this.bottom_up?r:this.height-1-r,s=0;s<this.width;s++){var o=this.datav.getUint16(this.pos,!0);this.pos+=2;var a=(o&n)/n*255|0,u=(o>>5&i)/i*255|0,f=e*this.width*4+4*s;this.data[f]=(o>>11)/n*255|0,this.data[f+1]=u,this.data[f+2]=a,this.data[f+3]=255}this.pos+=t}},Yn.prototype.bit24=function(){for(var t=this.height-1;t>=0;t--){for(var n=this.bottom_up?t:this.height-1-t,i=0;i<this.width;i++){var r=this.datav.getUint8(this.pos++,!0),e=this.datav.getUint8(this.pos++,!0),s=this.datav.getUint8(this.pos++,!0),o=n*this.width*4+4*i;this.data[o]=s,this.data[o+1]=e,this.data[o+2]=r,this.data[o+3]=255}this.pos+=this.width%4}},Yn.prototype.bit32=function(){for(var t=this.height-1;t>=0;t--)for(var n=this.bottom_up?t:this.height-1-t,i=0;i<this.width;i++){var r=this.datav.getUint8(this.pos++,!0),e=this.datav.getUint8(this.pos++,!0),s=this.datav.getUint8(this.pos++,!0),o=this.datav.getUint8(this.pos++,!0),a=n*this.width*4+4*i;this.data[a]=s,this.data[a+1]=e,this.data[a+2]=r,this.data[a+3]=o}},Yn.prototype.getData=function(){return this.data},
268
268
  /**
269
269
  * @license
270
270
  * Copyright (c) 2018 Aras Abbasi
@@ -310,7 +310,7 @@ function(t){var n=function(t){for(var n=t.length,i=new Uint8Array(n),r=0;r<n;r++
310
310
  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
311
311
  * ====================================================================
312
312
  */
313
- function(){function t(){return(Z.canvg?Promise.resolve(Z.canvg):import("./p-734d1dc5.js")).catch((function(t){return Promise.reject(new Error("Could not load canvg: "+t))})).then((function(t){return t.default?t.default:t}))}Pt.API.addSvgAsImage=function(n,i,r,e,s,o,a,u){if(isNaN(i)||isNaN(r))throw tt.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(e)||isNaN(s))throw tt.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var f=document.createElement("canvas");f.width=e,f.height=s;var c=f.getContext("2d");c.fillStyle="#fff",c.fillRect(0,0,f.width,f.height);var h={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},l=this;return t().then((function(t){return t.fromString(c,n,h)}),(function(){return Promise.reject(new Error("Could not load canvg."))})).then((function(t){return t.render(h)})).then((function(){l.addImage(f.toDataURL("image/jpeg",1),i,r,e,s,a,u)}))}}(),Pt.API.putTotalPages=function(t){var n,i=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(n=new RegExp(t,"g"),i=this.internal.getNumberOfPages()):(n=new RegExp(this.pdfEscape16(t,this.internal.getFont()),"g"),i=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var r=1;r<=this.internal.getNumberOfPages();r++)for(var e=0;e<this.internal.pages[r].length;e++)this.internal.pages[r][e]=this.internal.pages[r][e].replace(n,i);return this},Pt.API.viewerPreferences=function(t,n){var i;t=t||{},n=n||!1;var r,e,s,o={HideToolbar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideMenubar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideWindowUI:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},FitWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},CenterWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},DisplayDocTitle:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.4},NonFullScreenPageMode:{defaultValue:"UseNone",value:"UseNone",type:"name",explicitSet:!1,valueSet:["UseNone","UseOutlines","UseThumbs","UseOC"],pdfVersion:1.3},Direction:{defaultValue:"L2R",value:"L2R",type:"name",explicitSet:!1,valueSet:["L2R","R2L"],pdfVersion:1.3},ViewArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},ViewClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintScaling:{defaultValue:"AppDefault",value:"AppDefault",type:"name",explicitSet:!1,valueSet:["AppDefault","None"],pdfVersion:1.6},Duplex:{defaultValue:"",value:"none",type:"name",explicitSet:!1,valueSet:["Simplex","DuplexFlipShortEdge","DuplexFlipLongEdge","none"],pdfVersion:1.7},PickTrayByPDFSize:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.7},PrintPageRange:{defaultValue:"",value:"",type:"array",explicitSet:!1,valueSet:null,pdfVersion:1.7},NumCopies:{defaultValue:1,value:1,type:"integer",explicitSet:!1,valueSet:null,pdfVersion:1.7}},a=Object.keys(o),u=[],f=0,c=0,h=0;function v(t,n){var i,r=!1;for(i=0;i<t.length;i+=1)t[i]===n&&(r=!0);return r}if(void 0===this.internal.viewerpreferences&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(o)),this.internal.viewerpreferences.isSubscribed=!1),i=this.internal.viewerpreferences.configuration,"reset"===t||!0===n){var d=a.length;for(h=0;h<d;h+=1)i[a[h]].value=i[a[h]].defaultValue,i[a[h]].explicitSet=!1}if("object"===l(t))for(e in t)if(s=t[e],v(a,e)&&void 0!==s){if("boolean"===i[e].type&&"boolean"==typeof s)i[e].value=s;else if("name"===i[e].type&&v(i[e].valueSet,s))i[e].value=s;else if("integer"===i[e].type&&Number.isInteger(s))i[e].value=s;else if("array"===i[e].type){for(f=0;f<s.length;f+=1)if(r=!0,1===s[f].length&&"number"==typeof s[f][0])u.push(String(s[f]-1));else if(s[f].length>1){for(c=0;c<s[f].length;c+=1)"number"!=typeof s[f][c]&&(r=!1);!0===r&&u.push([s[f][0]-1,s[f][1]-1].join(" "))}i[e].value="["+u.join(" ")+"]"}else i[e].value=i[e].defaultValue;i[e].explicitSet=!0}return!1===this.internal.viewerpreferences.isSubscribed&&(this.internal.events.subscribe("putCatalog",(function(){var t,n=[];for(t in i)!0===i[t].explicitSet&&n.push("name"===i[t].type?"/"+t+" /"+i[t].value:"/"+t+" "+i[t].value);0!==n.length&&this.internal.write("/ViewerPreferences\n<<\n"+n.join("\n")+"\n>>")})),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=i,this
313
+ function(){function t(){return(Z.canvg?Promise.resolve(Z.canvg):import("./p-590a2a26.js")).catch((function(t){return Promise.reject(new Error("Could not load canvg: "+t))})).then((function(t){return t.default?t.default:t}))}Pt.API.addSvgAsImage=function(n,i,r,e,s,o,a,u){if(isNaN(i)||isNaN(r))throw tt.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(e)||isNaN(s))throw tt.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var f=document.createElement("canvas");f.width=e,f.height=s;var c=f.getContext("2d");c.fillStyle="#fff",c.fillRect(0,0,f.width,f.height);var h={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},l=this;return t().then((function(t){return t.fromString(c,n,h)}),(function(){return Promise.reject(new Error("Could not load canvg."))})).then((function(t){return t.render(h)})).then((function(){l.addImage(f.toDataURL("image/jpeg",1),i,r,e,s,a,u)}))}}(),Pt.API.putTotalPages=function(t){var n,i=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(n=new RegExp(t,"g"),i=this.internal.getNumberOfPages()):(n=new RegExp(this.pdfEscape16(t,this.internal.getFont()),"g"),i=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var r=1;r<=this.internal.getNumberOfPages();r++)for(var e=0;e<this.internal.pages[r].length;e++)this.internal.pages[r][e]=this.internal.pages[r][e].replace(n,i);return this},Pt.API.viewerPreferences=function(t,n){var i;t=t||{},n=n||!1;var r,e,s,o={HideToolbar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideMenubar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideWindowUI:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},FitWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},CenterWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},DisplayDocTitle:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.4},NonFullScreenPageMode:{defaultValue:"UseNone",value:"UseNone",type:"name",explicitSet:!1,valueSet:["UseNone","UseOutlines","UseThumbs","UseOC"],pdfVersion:1.3},Direction:{defaultValue:"L2R",value:"L2R",type:"name",explicitSet:!1,valueSet:["L2R","R2L"],pdfVersion:1.3},ViewArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},ViewClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintScaling:{defaultValue:"AppDefault",value:"AppDefault",type:"name",explicitSet:!1,valueSet:["AppDefault","None"],pdfVersion:1.6},Duplex:{defaultValue:"",value:"none",type:"name",explicitSet:!1,valueSet:["Simplex","DuplexFlipShortEdge","DuplexFlipLongEdge","none"],pdfVersion:1.7},PickTrayByPDFSize:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.7},PrintPageRange:{defaultValue:"",value:"",type:"array",explicitSet:!1,valueSet:null,pdfVersion:1.7},NumCopies:{defaultValue:1,value:1,type:"integer",explicitSet:!1,valueSet:null,pdfVersion:1.7}},a=Object.keys(o),u=[],f=0,c=0,h=0;function v(t,n){var i,r=!1;for(i=0;i<t.length;i+=1)t[i]===n&&(r=!0);return r}if(void 0===this.internal.viewerpreferences&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(o)),this.internal.viewerpreferences.isSubscribed=!1),i=this.internal.viewerpreferences.configuration,"reset"===t||!0===n){var d=a.length;for(h=0;h<d;h+=1)i[a[h]].value=i[a[h]].defaultValue,i[a[h]].explicitSet=!1}if("object"===l(t))for(e in t)if(s=t[e],v(a,e)&&void 0!==s){if("boolean"===i[e].type&&"boolean"==typeof s)i[e].value=s;else if("name"===i[e].type&&v(i[e].valueSet,s))i[e].value=s;else if("integer"===i[e].type&&Number.isInteger(s))i[e].value=s;else if("array"===i[e].type){for(f=0;f<s.length;f+=1)if(r=!0,1===s[f].length&&"number"==typeof s[f][0])u.push(String(s[f]-1));else if(s[f].length>1){for(c=0;c<s[f].length;c+=1)"number"!=typeof s[f][c]&&(r=!1);!0===r&&u.push([s[f][0]-1,s[f][1]-1].join(" "))}i[e].value="["+u.join(" ")+"]"}else i[e].value=i[e].defaultValue;i[e].explicitSet=!0}return!1===this.internal.viewerpreferences.isSubscribed&&(this.internal.events.subscribe("putCatalog",(function(){var t,n=[];for(t in i)!0===i[t].explicitSet&&n.push("name"===i[t].type?"/"+t+" /"+i[t].value:"/"+t+" "+i[t].value);0!==n.length&&this.internal.write("/ViewerPreferences\n<<\n"+n.join("\n")+"\n>>")})),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=i,this
314
314
  /** ====================================================================
315
315
  * @license
316
316
  * jsPDF XMP metadata plugin
@@ -349,7 +349,7 @@ function(t){var n=function(){return void 0===this.internal.vFS&&(this.internal.v
349
349
  * Unicode Bidi Engine based on the work of Alex Shensis (@asthensis)
350
350
  * MIT License
351
351
  */
352
- function(t){t.__bidiEngine__=t.prototype.__bidiEngine__=function(t){var i,r,e,s,o,a,u,f=n,c=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],h=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],l={L:0,R:1,EN:2,AN:3,N:4,B:5,S:6},v={0:0,5:1,6:2,7:3,32:4,251:5,254:6,255:7},d=["(",")","(","<",">","<","[","]","[","{","}","{","«","»","«","‹","›","‹","⁅","⁆","⁅","⁽","⁾","⁽","₍","₎","₍","≤","≥","≤","〈","〉","〈","﹙","﹚","﹙","﹛","﹜","﹛","﹝","﹞","﹝","﹤","﹥","﹤"],w=new RegExp(/^([1-4|9]|1[0-9]|2[0-9]|3[0168]|4[04589]|5[012]|7[78]|159|16[0-9]|17[0-2]|21[569]|22[03489]|250)$/),m=!1,b=0;this.__bidiEngine__={};var p=function(t){var n=t.charCodeAt(),i=n>>8,r=v[i];return void 0!==r?f[256*r+(255&n)]:252===i||253===i?"AL":w.test(i)?"L":8===i?"R":"N"},N=function(t){for(var n,i=0;i<t.length;i++){if("L"===(n=p(t.charAt(i))))return!1;if("R"===n)return!0}return!1},L=function(t,n,o,a){var u,f,c,h,l=n[a];switch(l){case"L":case"R":case"LRE":case"RLE":case"LRO":case"RLO":case"PDF":m=!1;break;case"N":case"AN":break;case"EN":m&&(l="AN");break;case"AL":m=!0,l="R";break;case"WS":case"BN":l="N";break;case"CS":a<1||a+1>=n.length||"EN"!==(u=o[a-1])&&"AN"!==u||"EN"!==(f=n[a+1])&&"AN"!==f?l="N":m&&(f="AN"),l=f===u?f:"N";break;case"ES":l="EN"===(u=a>0?o[a-1]:"B")&&a+1<n.length&&"EN"===n[a+1]?"EN":"N";break;case"ET":if(a>0&&"EN"===o[a-1]){l="EN";break}if(m){l="N";break}for(c=a+1,h=n.length;c<h&&"ET"===n[c];)c++;l=c<h&&"EN"===n[c]?"EN":"N";break;case"NSM":if(e&&!s){for(h=n.length,c=a+1;c<h&&"NSM"===n[c];)c++;if(c<h){var v=t[a];if(u=n[c],(v>=1425&&v<=2303||64286===v)&&("R"===u||"AL"===u)){l="R";break}}}l=a<1||"B"===(u=n[a-1])?"N":o[a-1];break;case"B":m=!1,i=!0,l=b;break;case"S":r=!0,l="N"}return l},g=function(t,n,i){var r=t.split("");return i&&A(r,i,{hiLevel:b}),r.reverse(),n&&n.reverse(),r.join("")},A=function(t,n,e){var s,o,a,u,f,v=-1,d=t.length,w=0,N=[],g=b?h:c,A=[];for(m=!1,i=!1,r=!1,o=0;o<d;o++)A[o]=p(t[o]);for(a=0;a<d;a++){if(f=w,N[a]=L(t,A,N,a),s=240&(w=g[f][l[N[a]]]),n[a]=u=g[w&=15][5],s>0)if(16===s){for(o=v;o<a;o++)n[o]=1;v=-1}else v=-1;if(g[w][6])-1===v&&(v=a);else if(v>-1){for(o=v;o<a;o++)n[o]=u;v=-1}"B"===A[a]&&(n[a]=0),e.hiLevel|=u}r&&function(t,n,i){for(var r=0;r<i;r++)if("S"===t[r]){n[r]=b;for(var e=r-1;e>=0&&"WS"===t[e];e--)n[e]=b}}(A,n,d)},y=function(t,n,r,e,s){if(!(s.hiLevel<t)){if(1===t&&1===b&&!i)return n.reverse(),void(r&&r.reverse());for(var o,a,u,f,c=n.length,h=0;h<c;){if(e[h]>=t){for(u=h+1;u<c&&e[u]>=t;)u++;for(f=h,a=u-1;f<a;f++,a--)o=n[f],n[f]=n[a],n[a]=o,r&&(o=r[f],r[f]=r[a],r[a]=o);h=u}h++}}},k=function(t,n,i){var r=t.split(""),e={hiLevel:b};return i||(i=[]),A(r,i,e),function(t,n,i){if(0!==i.hiLevel&&u)for(var r,e=0;e<t.length;e++)1===n[e]&&(r=d.indexOf(t[e]))>=0&&(t[e]=d[r+1])}(r,i,e),y(2,r,n,i,e),y(1,r,n,i,e),r.join("")};return this.__bidiEngine__.doBidiReorder=function(t,n,i){if(function(t,n){if(n)for(var i=0;i<t.length;i++)n[i]=i;void 0===s&&(s=N(t)),void 0===a&&(a=N(t))}(t,n),e||!o||a)if(e&&o&&s^a)b=s?1:0,t=g(t,n,i);else if(!e&&o&&a)b=s?1:0,t=k(t,n,i),t=g(t,n);else if(!e||s||o||a){if(e&&!o&&s^a)t=g(t,n),s?(b=0,t=k(t,n,i)):(b=1,t=k(t,n,i),t=g(t,n));else if(e&&s&&!o&&a)b=1,t=k(t,n,i),t=g(t,n);else if(!e&&!o&&s^a){var r=u;s?(b=1,t=k(t,n,i),b=0,u=!1,t=k(t,n,i),u=r):(b=0,t=k(t,n,i),t=g(t,n),b=1,u=!1,t=k(t,n,i),u=r,t=g(t,n))}}else b=0,t=k(t,n,i);else b=s?1:0,t=k(t,n,i);return t},this.__bidiEngine__.setOptions=function(t){t&&(e=t.isInputVisual,o=t.isOutputVisual,s=t.isInputRtl,a=t.isOutputRtl,u=t.isSymmetricSwapping)},this.__bidiEngine__.setOptions(t),this.__bidiEngine__};var n=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","N","N","ET","ET","ET","N","N","N","N","N","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","N","ET","ET","ET","ET","N","N","N","N","L","N","N","BN","N","N","ET","ET","EN","EN","N","L","N","N","N","EN","L","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","N","N","N","N","N","ET","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","R","NSM","R","NSM","NSM","R","NSM","NSM","R","NSM","N","N","N","N","N","N","N","N","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","N","N","N","N","N","R","R","R","R","R","N","N","N","N","N","N","N","N","N","N","N","AN","AN","AN","AN","AN","AN","N","N","AL","ET","ET","AL","CS","AL","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","AN","AN","AN","AN","AN","AN","AN","AN","AN","ET","AN","AN","AL","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","N","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","NSM","NSM","N","NSM","NSM","NSM","NSM","AL","AL","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","N","N","N","N","N","N","N","N","N","N","N","N","N","N","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","R","R","N","N","N","N","R","N","N","N","N","N","WS","WS","WS","WS","WS","WS","WS","WS","WS","WS","WS","BN","BN","BN","L","R","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","WS","B","LRE","RLE","PDF","LRO","RLO","CS","ET","ET","ET","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","CS","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","WS","BN","BN","BN","BN","BN","N","LRI","RLI","FSI","PDI","BN","BN","BN","BN","BN","BN","EN","L","N","N","EN","EN","EN","EN","EN","EN","ES","ES","N","N","N","L","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","ES","ES","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","L","L","N","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","N","N","N","N","N","R","NSM","R","R","R","R","R","R","R","R","R","R","ES","R","R","R","R","R","R","R","R","R","R","R","R","R","N","R","R","R","R","R","N","R","N","R","R","N","R","R","N","R","R","R","R","R","R","R","R","R","R","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","CS","N","CS","N","N","CS","N","N","N","N","N","N","N","N","N","ET","N","N","ES","ES","N","N","N","N","N","ET","ET","N","N","N","N","N","AL","AL","AL","AL","AL","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","N","BN","N","N","N","ET","ET","ET","N","N","N","N","N","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","L","L","L","L","L","L","N","N","L","L","L","L","L","L","N","N","L","L","L","L","L","L","N","N","L","L","L","N","N","N","ET","ET","N","N","N","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N"],i=new t.__bidiEngine__({isInputVisual:!0});t.API.events.push(["postProcessText",function(t){var n=t.text,r=t.options||{},e=[];if(r.isInputVisual="boolean"!=typeof r.isInputVisual||r.isInputVisual,i.setOptions(r),"[object Array]"===Object.prototype.toString.call(n)){var s=0;for(e=[],s=0;s<n.length;s+=1)"[object Array]"===Object.prototype.toString.call(n[s])?e.push([i.doBidiReorder(n[s][0]),n[s][1],n[s][2]]):e.push([i.doBidiReorder(n[s])]);t.text=e}else t.text=i.doBidiReorder(n);i.setOptions({isInputVisual:!0})}])}(Pt),Pt.API.TTFFont=function(){function t(t){var n;if(this.rawData=t,n=this.contents=new Xn(t),this.contents.pos=4,"ttcf"===n.readString(4))throw new Error("TTCF not supported.");n.pos=0,this.parse(),this.subset=new mi(this),this.registerTTF()}return t.open=function(n){return new t(n)},t.prototype.parse=function(){return this.directory=new Zn(this.contents),this.head=new ni(this),this.name=new ui(this),this.cmap=new ri(this),this.toUnicode={},this.hhea=new ei(this),this.maxp=new fi(this),this.hmtx=new ci(this),this.post=new oi(this),this.os2=new si(this),this.loca=new wi(this),this.glyf=new li(this),this.ascender=this.os2.exists&&this.os2.ascender||this.hhea.ascender,this.decender=this.os2.exists&&this.os2.decender||this.hhea.decender,this.lineGap=this.os2.exists&&this.os2.lineGap||this.hhea.lineGap,this.bbox=[this.head.xMin,this.head.yMin,this.head.xMax,this.head.yMax]},t.prototype.registerTTF=function(){var t,n,i,r;if(this.scaleFactor=1e3/this.head.unitsPerEm,this.bbox=function(){var t,n,i,r;for(r=[],t=0,n=(i=this.bbox).length;t<n;t++)r.push(Math.round(i[t]*this.scaleFactor));return r}.call(this),this.stemV=0,this.post.exists?(n=255&(i=this.post.italic_angle),0!=(32768&(t=i>>16))&&(t=-(1+(65535^t))),this.italicAngle=+(t+"."+n)):this.italicAngle=0,this.ascender=Math.round(this.ascender*this.scaleFactor),this.decender=Math.round(this.decender*this.scaleFactor),this.lineGap=Math.round(this.lineGap*this.scaleFactor),this.capHeight=this.os2.exists&&this.os2.capHeight||this.ascender,this.xHeight=this.os2.exists&&this.os2.xHeight||0,this.familyClass=(this.os2.exists&&this.os2.familyClass||0)>>8,this.isSerif=1===(r=this.familyClass)||2===r||3===r||4===r||5===r||7===r,this.isScript=10===this.familyClass,this.flags=0,this.post.isFixedPitch&&(this.flags|=1),this.isSerif&&(this.flags|=2),this.isScript&&(this.flags|=8),0!==this.italicAngle&&(this.flags|=64),this.flags|=32,!this.cmap.unicode)throw new Error("No unicode cmap for font")},t.prototype.characterToGlyph=function(t){var n;return(null!=(n=this.cmap.unicode)?n.codeMap[t]:void 0)||0},t.prototype.widthOfGlyph=function(t){var n;return n=1e3/this.head.unitsPerEm,this.hmtx.forGlyph(t).advance*n},t.prototype.widthOfString=function(t,n,i){var r,e,s,o;for(s=0,e=0,o=(t=""+t).length;0<=o?e<o:e>o;e=0<=o?++e:--e)r=t.charCodeAt(e),s+=this.widthOfGlyph(this.characterToGlyph(r))+i*(1e3/n)||0;return s*(n/1e3)},t.prototype.lineHeight=function(t,n){return null==n&&(n=!1),(this.ascender+(n?this.lineGap:0)-this.decender)/1e3*t},t}();var Kn,Xn=function(){function t(t){this.data=null!=t?t:[],this.pos=0,this.length=this.data.length}return t.prototype.readByte=function(){return this.data[this.pos++]},t.prototype.writeByte=function(t){return this.data[this.pos++]=t},t.prototype.readUInt32=function(){return 16777216*this.readByte()+(this.readByte()<<16)+(this.readByte()<<8)+this.readByte()},t.prototype.writeUInt32=function(t){return this.writeByte(t>>>24&255),this.writeByte(t>>16&255),this.writeByte(t>>8&255),this.writeByte(255&t)},t.prototype.readInt32=function(){var t;return(t=this.readUInt32())>=2147483648?t-4294967296:t},t.prototype.writeInt32=function(t){return t<0&&(t+=4294967296),this.writeUInt32(t)},t.prototype.readUInt16=function(){return this.readByte()<<8|this.readByte()},t.prototype.writeUInt16=function(t){return this.writeByte(t>>8&255),this.writeByte(255&t)},t.prototype.readInt16=function(){var t;return(t=this.readUInt16())>=32768?t-65536:t},t.prototype.writeInt16=function(t){return t<0&&(t+=65536),this.writeUInt16(t)},t.prototype.readString=function(t){var n,i;for(i=[],n=0;0<=t?n<t:n>t;n=0<=t?++n:--n)i[n]=String.fromCharCode(this.readByte());return i.join("")},t.prototype.writeString=function(t){var n,i,r;for(r=[],n=0,i=t.length;0<=i?n<i:n>i;n=0<=i?++n:--n)r.push(this.writeByte(t.charCodeAt(n)));return r},t.prototype.readShort=function(){return this.readInt16()},t.prototype.writeShort=function(t){return this.writeInt16(t)},t.prototype.readLongLong=function(){var t,n,i,r,e,s,o,a;return t=this.readByte(),n=this.readByte(),i=this.readByte(),r=this.readByte(),e=this.readByte(),s=this.readByte(),o=this.readByte(),a=this.readByte(),128&t?-1*(72057594037927940*(255^t)+281474976710656*(255^n)+1099511627776*(255^i)+4294967296*(255^r)+16777216*(255^e)+65536*(255^s)+256*(255^o)+(255^a)+1):72057594037927940*t+281474976710656*n+1099511627776*i+4294967296*r+16777216*e+65536*s+256*o+a},t.prototype.writeLongLong=function(t){var n,i;return n=Math.floor(t/4294967296),i=4294967295&t,this.writeByte(n>>24&255),this.writeByte(n>>16&255),this.writeByte(n>>8&255),this.writeByte(255&n),this.writeByte(i>>24&255),this.writeByte(i>>16&255),this.writeByte(i>>8&255),this.writeByte(255&i)},t.prototype.readInt=function(){return this.readInt32()},t.prototype.writeInt=function(t){return this.writeInt32(t)},t.prototype.read=function(t){var n,i;for(n=[],i=0;0<=t?i<t:i>t;i=0<=t?++i:--i)n.push(this.readByte());return n},t.prototype.write=function(t){var n,i,r;for(r=[],n=0,i=t.length;n<i;n++)r.push(this.writeByte(t[n]));return r},t}(),Zn=function(){var t;function n(t){var n,i,r;for(this.scalarType=t.readInt(),this.tableCount=t.readShort(),this.searchRange=t.readShort(),this.entrySelector=t.readShort(),this.rangeShift=t.readShort(),this.tables={},i=0,r=this.tableCount;0<=r?i<r:i>r;i=0<=r?++i:--i)n={tag:t.readString(4),checksum:t.readInt(),offset:t.readInt(),length:t.readInt()},this.tables[n.tag]=n}return n.prototype.encode=function(n){var i,r,e,s,o,a,u,f,c,h,l,v;for(v in h=Object.keys(n).length,o=Math.log(2),f=16*Math.floor(Math.log(h)/o),e=Math.floor(f/o),u=16*h-f,(r=new Xn).writeInt(this.scalarType),r.writeShort(h),r.writeShort(f),r.writeShort(e),r.writeShort(u),a=r.pos+16*h,s=null,l=[],n)for(c=n[v],r.writeString(v),r.writeInt(t(c)),r.writeInt(a),r.writeInt(c.length),l=l.concat(c),"head"===v&&(s=a),a+=c.length;a%4;)l.push(0),a++;return r.write(l),i=2981146554-t(r.data),r.pos=s+8,r.writeUInt32(i),r.data},t=function(t){var n,i,r,e;for(t=hi.call(t);t.length%4;)t.push(0);for(r=new Xn(t),i=0,n=0,e=t.length;n<e;n=n+=4)i+=r.readUInt32();return 4294967295&i},n}(),Qn={}.hasOwnProperty,ti=function(t,n){for(var i in n)Qn.call(n,i)&&(t[i]=n[i]);function r(){this.constructor=t}return r.prototype=n.prototype,t.prototype=new r,t.__super__=n.prototype,t};Kn=function(){function t(t){var n;this.file=t,this.exists=!!(n=this.file.directory.tables[this.tag]),n&&(this.offset=n.offset,this.length=n.length,this.parse(this.file.contents))}return t.prototype.parse=function(){},t.prototype.encode=function(){},t.prototype.raw=function(){return this.exists?(this.file.contents.pos=this.offset,this.file.contents.read(this.length)):null},t}();var ni=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return ti(t,Kn),t.prototype.tag="head",t.prototype.parse=function(t){return t.pos=this.offset,this.version=t.readInt(),this.revision=t.readInt(),this.checkSumAdjustment=t.readInt(),this.magicNumber=t.readInt(),this.flags=t.readShort(),this.unitsPerEm=t.readShort(),this.created=t.readLongLong(),this.modified=t.readLongLong(),this.xMin=t.readShort(),this.yMin=t.readShort(),this.xMax=t.readShort(),this.yMax=t.readShort(),this.macStyle=t.readShort(),this.lowestRecPPEM=t.readShort(),this.fontDirectionHint=t.readShort(),this.indexToLocFormat=t.readShort(),this.glyphDataFormat=t.readShort()},t.prototype.encode=function(t){var n;return(n=new Xn).writeInt(this.version),n.writeInt(this.revision),n.writeInt(this.checkSumAdjustment),n.writeInt(this.magicNumber),n.writeShort(this.flags),n.writeShort(this.unitsPerEm),n.writeLongLong(this.created),n.writeLongLong(this.modified),n.writeShort(this.xMin),n.writeShort(this.yMin),n.writeShort(this.xMax),n.writeShort(this.yMax),n.writeShort(this.macStyle),n.writeShort(this.lowestRecPPEM),n.writeShort(this.fontDirectionHint),n.writeShort(t),n.writeShort(this.glyphDataFormat),n.data},t}(),ii=function(){function t(t,n){var i,r,e,s,o,a,u,f,c,h,l,v,d,w,m,b,p;switch(this.platformID=t.readUInt16(),this.encodingID=t.readShort(),this.offset=n+t.readInt(),c=t.pos,t.pos=this.offset,this.format=t.readUInt16(),this.length=t.readUInt16(),this.language=t.readUInt16(),this.isUnicode=3===this.platformID&&1===this.encodingID&&4===this.format||0===this.platformID&&4===this.format,this.codeMap={},this.format){case 0:for(a=0;a<256;++a)this.codeMap[a]=t.readByte();break;case 4:for(l=t.readUInt16(),h=l/2,t.pos+=6,e=function(){var n,i;for(i=[],a=n=0;0<=h?n<h:n>h;a=0<=h?++n:--n)i.push(t.readUInt16());return i}(),t.pos+=2,d=function(){var n,i;for(i=[],a=n=0;0<=h?n<h:n>h;a=0<=h?++n:--n)i.push(t.readUInt16());return i}(),u=function(){var n,i;for(i=[],a=n=0;0<=h?n<h:n>h;a=0<=h?++n:--n)i.push(t.readUInt16());return i}(),f=function(){var n,i;for(i=[],a=n=0;0<=h?n<h:n>h;a=0<=h?++n:--n)i.push(t.readUInt16());return i}(),r=(this.length-t.pos+this.offset)/2,o=function(){var n,i;for(i=[],a=n=0;0<=r?n<r:n>r;a=0<=r?++n:--n)i.push(t.readUInt16());return i}(),a=m=0,p=e.length;m<p;a=++m)for(w=e[a],i=b=v=d[a];v<=w?b<=w:b>=w;i=v<=w?++b:--b)0===f[a]?s=i+u[a]:0!==(s=o[f[a]/2+(i-v)-(h-a)]||0)&&(s+=u[a]),this.codeMap[i]=65535&s}t.pos=c}return t.encode=function(t,n){var i,r,e,s,o,a,u,f,c,h,l,v,d,w,m,b,p,N,L,g,A,y,k,S,x,q,j,M,E,P,O,I,F,B,R,T,C,D,z,U,V,W,H,_,G;switch(j=new Xn,s=Object.keys(t).sort((function(t,n){return t-n})),n){case"macroman":for(d=0,w=function(){var t=[];for(v=0;v<256;++v)t.push(0);return t}(),b={0:0},e={},M=0,I=s.length;M<I;M++)null==b[W=t[r=s[M]]]&&(b[W]=++d),e[r]={old:t[r],new:b[t[r]]},w[r]=b[t[r]];return j.writeUInt16(1),j.writeUInt16(0),j.writeUInt32(12),j.writeUInt16(0),j.writeUInt16(262),j.writeUInt16(0),j.write(w),{charMap:e,subtable:j.data,maxGlyphID:d+1};case"unicode":for(x=[],c=[],p=0,b={},i={},m=u=null,E=0,F=s.length;E<F;E++)null==b[N=t[r=s[E]]]&&(b[N]=++p),i[r]={old:N,new:b[N]},o=b[N]-r,null!=m&&o===u||(m&&c.push(m),x.push(r),u=o),m=r;for(m&&c.push(m),c.push(65535),x.push(65535),k=2*(y=x.length),A=2*Math.pow(Math.log(y)/Math.LN2,2),h=Math.log(A/2)/Math.LN2,g=2*y-A,a=[],L=[],l=[],v=P=0,B=x.length;P<B;v=++P){if(f=c[v],65535===(S=x[v])){a.push(0),L.push(0);break}if(S-(q=i[S].new)>=32768)for(a.push(0),L.push(2*(l.length+y-v)),r=O=S;S<=f?O<=f:O>=f;r=S<=f?++O:--O)l.push(i[r].new);else a.push(q-S),L.push(0)}for(j.writeUInt16(3),j.writeUInt16(1),j.writeUInt32(12),j.writeUInt16(4),j.writeUInt16(16+8*y+2*l.length),j.writeUInt16(0),j.writeUInt16(k),j.writeUInt16(A),j.writeUInt16(h),j.writeUInt16(g),U=0,R=c.length;U<R;U++)j.writeUInt16(r=c[U]);for(j.writeUInt16(0),V=0,T=x.length;V<T;V++)j.writeUInt16(r=x[V]);for(H=0,C=a.length;H<C;H++)j.writeUInt16(o=a[H]);for(_=0,D=L.length;_<D;_++)j.writeUInt16(L[_]);for(G=0,z=l.length;G<z;G++)j.writeUInt16(d=l[G]);return{charMap:i,subtable:j.data,maxGlyphID:p+1}}},t}(),ri=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return ti(t,Kn),t.prototype.tag="cmap",t.prototype.parse=function(t){var n,i,r;for(t.pos=this.offset,this.version=t.readUInt16(),r=t.readUInt16(),this.tables=[],this.unicode=null,i=0;0<=r?i<r:i>r;i=0<=r?++i:--i)n=new ii(t,this.offset),this.tables.push(n),n.isUnicode&&null==this.unicode&&(this.unicode=n);return!0},t.encode=function(t,n){var i,r;return null==n&&(n="macroman"),i=ii.encode(t,n),(r=new Xn).writeUInt16(0),r.writeUInt16(1),i.table=r.data.concat(i.subtable),i},t}(),ei=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return ti(t,Kn),t.prototype.tag="hhea",t.prototype.parse=function(t){return t.pos=this.offset,this.version=t.readInt(),this.ascender=t.readShort(),this.decender=t.readShort(),this.lineGap=t.readShort(),this.advanceWidthMax=t.readShort(),this.minLeftSideBearing=t.readShort(),this.minRightSideBearing=t.readShort(),this.xMaxExtent=t.readShort(),this.caretSlopeRise=t.readShort(),this.caretSlopeRun=t.readShort(),this.caretOffset=t.readShort(),t.pos+=8,this.metricDataFormat=t.readShort(),this.numberOfMetrics=t.readUInt16()},t}(),si=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return ti(t,Kn),t.prototype.tag="OS/2",t.prototype.parse=function(t){if(t.pos=this.offset,this.version=t.readUInt16(),this.averageCharWidth=t.readShort(),this.weightClass=t.readUInt16(),this.widthClass=t.readUInt16(),this.type=t.readShort(),this.ySubscriptXSize=t.readShort(),this.ySubscriptYSize=t.readShort(),this.ySubscriptXOffset=t.readShort(),this.ySubscriptYOffset=t.readShort(),this.ySuperscriptXSize=t.readShort(),this.ySuperscriptYSize=t.readShort(),this.ySuperscriptXOffset=t.readShort(),this.ySuperscriptYOffset=t.readShort(),this.yStrikeoutSize=t.readShort(),this.yStrikeoutPosition=t.readShort(),this.familyClass=t.readShort(),this.panose=function(){var n,i;for(i=[],n=0;n<10;++n)i.push(t.readByte());return i}(),this.charRange=function(){var n,i;for(i=[],n=0;n<4;++n)i.push(t.readInt());return i}(),this.vendorID=t.readString(4),this.selection=t.readShort(),this.firstCharIndex=t.readShort(),this.lastCharIndex=t.readShort(),this.version>0&&(this.ascent=t.readShort(),this.descent=t.readShort(),this.lineGap=t.readShort(),this.winAscent=t.readShort(),this.winDescent=t.readShort(),this.codePageRange=function(){var n,i;for(i=[],n=0;n<2;n=++n)i.push(t.readInt());return i}(),this.version>1))return this.xHeight=t.readShort(),this.capHeight=t.readShort(),this.defaultChar=t.readShort(),this.breakChar=t.readShort(),this.maxContext=t.readShort()},t}(),oi=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return ti(t,Kn),t.prototype.tag="post",t.prototype.parse=function(t){var n,i,r;switch(t.pos=this.offset,this.format=t.readInt(),this.italicAngle=t.readInt(),this.underlinePosition=t.readShort(),this.underlineThickness=t.readShort(),this.isFixedPitch=t.readInt(),this.minMemType42=t.readInt(),this.maxMemType42=t.readInt(),this.minMemType1=t.readInt(),this.maxMemType1=t.readInt(),this.format){case 65536:case 196608:break;case 131072:var e;for(i=t.readUInt16(),this.glyphNameIndex=[],e=0;0<=i?e<i:e>i;e=0<=i?++e:--e)this.glyphNameIndex.push(t.readUInt16());for(this.names=[],r=[];t.pos<this.offset+this.length;)n=t.readByte(),r.push(this.names.push(t.readString(n)));return r;case 151552:return i=t.readUInt16(),this.offsets=t.read(i);case 262144:return this.map=function(){var n,i,r;for(r=[],e=n=0,i=this.file.maxp.numGlyphs;0<=i?n<i:n>i;e=0<=i?++n:--n)r.push(t.readUInt32());return r}.call(this)}},t}(),ai=function(t,n){this.raw=t,this.length=t.length,this.platformID=n.platformID,this.encodingID=n.encodingID,this.languageID=n.languageID},ui=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return ti(t,Kn),t.prototype.tag="name",t.prototype.parse=function(t){var n,i,r,e,s,o,a,u,f,c,h;for(t.pos=this.offset,t.readShort(),n=t.readShort(),o=t.readShort(),i=[],e=0;0<=n?e<n:e>n;e=0<=n?++e:--e)i.push({platformID:t.readShort(),encodingID:t.readShort(),languageID:t.readShort(),nameID:t.readShort(),length:t.readShort(),offset:this.offset+o+t.readShort()});for(a={},e=f=0,c=i.length;f<c;e=++f)t.pos=(r=i[e]).offset,u=t.readString(r.length),s=new ai(u,r),null==a[h=r.nameID]&&(a[h]=[]),a[r.nameID].push(s);this.strings=a,this.copyright=a[0],this.fontFamily=a[1],this.fontSubfamily=a[2],this.uniqueSubfamily=a[3],this.fontName=a[4],this.version=a[5];try{this.postscriptName=a[6][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}catch(t){this.postscriptName=a[4][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}return this.trademark=a[7],this.manufacturer=a[8],this.designer=a[9],this.description=a[10],this.vendorUrl=a[11],this.designerUrl=a[12],this.license=a[13],this.licenseUrl=a[14],this.preferredFamily=a[15],this.preferredSubfamily=a[17],this.compatibleFull=a[18],this.sampleText=a[19]},t}(),fi=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return ti(t,Kn),t.prototype.tag="maxp",t.prototype.parse=function(t){return t.pos=this.offset,this.version=t.readInt(),this.numGlyphs=t.readUInt16(),this.maxPoints=t.readUInt16(),this.maxContours=t.readUInt16(),this.maxCompositePoints=t.readUInt16(),this.maxComponentContours=t.readUInt16(),this.maxZones=t.readUInt16(),this.maxTwilightPoints=t.readUInt16(),this.maxStorage=t.readUInt16(),this.maxFunctionDefs=t.readUInt16(),this.maxInstructionDefs=t.readUInt16(),this.maxStackElements=t.readUInt16(),this.maxSizeOfInstructions=t.readUInt16(),this.maxComponentElements=t.readUInt16(),this.maxComponentDepth=t.readUInt16()},t}(),ci=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return ti(t,Kn),t.prototype.tag="hmtx",t.prototype.parse=function(t){var n,i,r,e,s,o;for(t.pos=this.offset,this.metrics=[],n=0,s=this.file.hhea.numberOfMetrics;0<=s?n<s:n>s;n=0<=s?++n:--n)this.metrics.push({advance:t.readUInt16(),lsb:t.readInt16()});for(r=this.file.maxp.numGlyphs-this.file.hhea.numberOfMetrics,this.leftSideBearings=function(){var i,e;for(e=[],n=i=0;0<=r?i<r:i>r;n=0<=r?++i:--i)e.push(t.readInt16());return e}(),this.widths=function(){var t,n,i,r;for(r=[],t=0,n=(i=this.metrics).length;t<n;t++)r.push(i[t].advance);return r}.call(this),i=this.widths[this.widths.length-1],o=[],n=e=0;0<=r?e<r:e>r;n=0<=r?++e:--e)o.push(this.widths.push(i));return o},t.prototype.forGlyph=function(t){return t in this.metrics?this.metrics[t]:{advance:this.metrics[this.metrics.length-1].advance,lsb:this.leftSideBearings[t-this.metrics.length]}},t}(),hi=[].slice,li=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return ti(t,Kn),t.prototype.tag="glyf",t.prototype.parse=function(){return this.cache={}},t.prototype.glyphFor=function(t){var n,i,r,e,s,o,a,u,f,c;return t in this.cache?this.cache[t]:(n=this.file.contents,i=(e=this.file.loca).indexOf(t),0===(r=e.lengthOf(t))?this.cache[t]=null:(n.pos=this.offset+i,s=(o=new Xn(n.read(r))).readShort(),u=o.readShort(),c=o.readShort(),a=o.readShort(),f=o.readShort(),this.cache[t]=-1===s?new di(o,u,c,a,f):new vi(o,s,u,c,a,f),this.cache[t]))},t.prototype.encode=function(t,n,i){var r,e,s,o,a;for(s=[],e=[],o=0,a=n.length;o<a;o++)r=t[n[o]],e.push(s.length),r&&(s=s.concat(r.encode(i)));return e.push(s.length),{table:s,offsets:e}},t}(),vi=function(){function t(t,n,i,r,e,s){this.raw=t,this.numberOfContours=n,this.xMin=i,this.yMin=r,this.xMax=e,this.yMax=s,this.compound=!1}return t.prototype.encode=function(){return this.raw.data},t}(),di=function(){function t(t,n,i,r,e){var s,o;for(this.raw=t,this.xMin=n,this.yMin=i,this.xMax=r,this.yMax=e,this.compound=!0,this.glyphIDs=[],this.glyphOffsets=[],s=this.raw;o=s.readShort(),this.glyphOffsets.push(s.pos),this.glyphIDs.push(s.readUInt16()),32&o;)s.pos+=1&o?4:2,128&o?s.pos+=8:64&o?s.pos+=4:8&o&&(s.pos+=2)}return t.prototype.encode=function(){var t,n,i;for(n=new Xn(hi.call(this.raw.data)),t=0,i=this.glyphIDs.length;t<i;++t)n.pos=this.glyphOffsets[t];return n.data},t}(),wi=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return ti(t,Kn),t.prototype.tag="loca",t.prototype.parse=function(t){var n;return t.pos=this.offset,this.offsets=0===this.file.head.indexToLocFormat?function(){var i,r;for(r=[],n=0,i=this.length;n<i;n+=2)r.push(2*t.readUInt16());return r}.call(this):function(){var i,r;for(r=[],n=0,i=this.length;n<i;n+=4)r.push(t.readUInt32());return r}.call(this)},t.prototype.indexOf=function(t){return this.offsets[t]},t.prototype.lengthOf=function(t){return this.offsets[t+1]-this.offsets[t]},t.prototype.encode=function(t,n){for(var i=new Uint32Array(this.offsets.length),r=0,e=0,s=0;s<i.length;++s)if(i[s]=r,e<n.length&&n[e]==s){++e,i[s]=r;var o=this.offsets[s+1]-this.offsets[s];o>0&&(r+=o)}for(var a=new Array(4*i.length),u=0;u<i.length;++u)a[4*u+3]=255&i[u],a[4*u+2]=(65280&i[u])>>8,a[4*u+1]=(16711680&i[u])>>16,a[4*u]=(4278190080&i[u])>>24;return a},t}(),mi=function(){function t(t){this.font=t,this.subset={},this.unicodes={},this.next=33}return t.prototype.generateCmap=function(){var t,n,i,r;for(n in i=this.font.cmap.tables[0].codeMap,t={},r=this.subset)t[n]=i[r[n]];return t},t.prototype.glyphsFor=function(t){var n,i,r,e,s,o,a;for(r={},s=0,o=t.length;s<o;s++)r[e=t[s]]=this.font.glyf.glyphFor(e);for(e in n=[],r)(null!=(i=r[e])?i.compound:void 0)&&n.push.apply(n,i.glyphIDs);if(n.length>0)for(e in a=this.glyphsFor(n))r[e]=i=a[e];return r},t.prototype.encode=function(t,n){var i,r,e,s,o,a,u,f,c,h,l,v,d,w;for(r in i=ri.encode(this.generateCmap(),"unicode"),s=this.glyphsFor(t),h={0:0},w=i.charMap)h[(o=w[r]).old]=o.new;for(l in c=i.maxGlyphID,s)l in h||(h[l]=c++);return u=function(t){var n,i;for(n in i={},t)i[t[n]]=n;return i}(h),f=Object.keys(u).sort((function(t,n){return t-n})),v=function(){var t,n,i;for(i=[],t=0,n=f.length;t<n;t++)i.push(u[f[t]]);return i}(),e=this.font.glyf.encode(s,v,h),a=this.font.loca.encode(e.offsets,v),d={cmap:this.font.cmap.raw(),glyf:e.table,loca:a,hmtx:this.font.hmtx.raw(),hhea:this.font.hhea.raw(),maxp:this.font.maxp.raw(),post:this.font.post.raw(),name:this.font.name.raw(),head:this.font.head.encode(n)},this.font.os2.exists&&(d["OS/2"]=this.font.os2.raw()),this.font.directory.encode(d)},t}();Pt.API.PDFObject=function(){var t;function n(){}return t=function(t,n){return(Array(n+1).join("0")+t).slice(-n)},n.convert=function(i){var r,e;if(Array.isArray(i))return"["+function(){var t,r,e;for(e=[],t=0,r=i.length;t<r;t++)e.push(n.convert(i[t]));return e}().join(" ")+"]";if("string"==typeof i)return"/"+i;if(null!=i?i.isString:void 0)return"("+i+")";if(i instanceof Date)return"(D:"+t(i.getUTCFullYear(),4)+t(i.getUTCMonth(),2)+t(i.getUTCDate(),2)+t(i.getUTCHours(),2)+t(i.getUTCMinutes(),2)+t(i.getUTCSeconds(),2)+"Z)";if("[object Object]"==={}.toString.call(i)){for(r in e=["<<"],i)e.push("/"+r+" "+n.convert(i[r]));return e.push(">>"),e.join("\n")}return""+i},n}();
352
+ function(t){t.__bidiEngine__=t.prototype.__bidiEngine__=function(t){var i,r,e,s,o,a,u,f=n,c=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],h=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],l={L:0,R:1,EN:2,AN:3,N:4,B:5,S:6},v={0:0,5:1,6:2,7:3,32:4,251:5,254:6,255:7},d=["(",")","(","<",">","<","[","]","[","{","}","{","«","»","«","‹","›","‹","⁅","⁆","⁅","⁽","⁾","⁽","₍","₎","₍","≤","≥","≤","〈","〉","〈","﹙","﹚","﹙","﹛","﹜","﹛","﹝","﹞","﹝","﹤","﹥","﹤"],w=new RegExp(/^([1-4|9]|1[0-9]|2[0-9]|3[0168]|4[04589]|5[012]|7[78]|159|16[0-9]|17[0-2]|21[569]|22[03489]|250)$/),m=!1,b=0;this.__bidiEngine__={};var p=function(t){var n=t.charCodeAt(),i=n>>8,r=v[i];return void 0!==r?f[256*r+(255&n)]:252===i||253===i?"AL":w.test(i)?"L":8===i?"R":"N"},N=function(t){for(var n,i=0;i<t.length;i++){if("L"===(n=p(t.charAt(i))))return!1;if("R"===n)return!0}return!1},L=function(t,n,o,a){var u,f,c,h,l=n[a];switch(l){case"L":case"R":case"LRE":case"RLE":case"LRO":case"RLO":case"PDF":m=!1;break;case"N":case"AN":break;case"EN":m&&(l="AN");break;case"AL":m=!0,l="R";break;case"WS":case"BN":l="N";break;case"CS":a<1||a+1>=n.length||"EN"!==(u=o[a-1])&&"AN"!==u||"EN"!==(f=n[a+1])&&"AN"!==f?l="N":m&&(f="AN"),l=f===u?f:"N";break;case"ES":l="EN"===(u=a>0?o[a-1]:"B")&&a+1<n.length&&"EN"===n[a+1]?"EN":"N";break;case"ET":if(a>0&&"EN"===o[a-1]){l="EN";break}if(m){l="N";break}for(c=a+1,h=n.length;c<h&&"ET"===n[c];)c++;l=c<h&&"EN"===n[c]?"EN":"N";break;case"NSM":if(e&&!s){for(h=n.length,c=a+1;c<h&&"NSM"===n[c];)c++;if(c<h){var v=t[a];if(u=n[c],(v>=1425&&v<=2303||64286===v)&&("R"===u||"AL"===u)){l="R";break}}}l=a<1||"B"===(u=n[a-1])?"N":o[a-1];break;case"B":m=!1,i=!0,l=b;break;case"S":r=!0,l="N"}return l},g=function(t,n,i){var r=t.split("");return i&&A(r,i,{hiLevel:b}),r.reverse(),n&&n.reverse(),r.join("")},A=function(t,n,e){var s,o,a,u,f,v=-1,d=t.length,w=0,N=[],g=b?h:c,A=[];for(m=!1,i=!1,r=!1,o=0;o<d;o++)A[o]=p(t[o]);for(a=0;a<d;a++){if(f=w,N[a]=L(t,A,N,a),s=240&(w=g[f][l[N[a]]]),n[a]=u=g[w&=15][5],s>0)if(16===s){for(o=v;o<a;o++)n[o]=1;v=-1}else v=-1;if(g[w][6])-1===v&&(v=a);else if(v>-1){for(o=v;o<a;o++)n[o]=u;v=-1}"B"===A[a]&&(n[a]=0),e.hiLevel|=u}r&&function(t,n,i){for(var r=0;r<i;r++)if("S"===t[r]){n[r]=b;for(var e=r-1;e>=0&&"WS"===t[e];e--)n[e]=b}}(A,n,d)},y=function(t,n,r,e,s){if(!(s.hiLevel<t)){if(1===t&&1===b&&!i)return n.reverse(),void(r&&r.reverse());for(var o,a,u,f,c=n.length,h=0;h<c;){if(e[h]>=t){for(u=h+1;u<c&&e[u]>=t;)u++;for(f=h,a=u-1;f<a;f++,a--)o=n[f],n[f]=n[a],n[a]=o,r&&(o=r[f],r[f]=r[a],r[a]=o);h=u}h++}}},k=function(t,n,i){var r=t.split(""),e={hiLevel:b};return i||(i=[]),A(r,i,e),function(t,n,i){if(0!==i.hiLevel&&u)for(var r,e=0;e<t.length;e++)1===n[e]&&(r=d.indexOf(t[e]))>=0&&(t[e]=d[r+1])}(r,i,e),y(2,r,n,i,e),y(1,r,n,i,e),r.join("")};return this.__bidiEngine__.doBidiReorder=function(t,n,i){if(function(t,n){if(n)for(var i=0;i<t.length;i++)n[i]=i;void 0===s&&(s=N(t)),void 0===a&&(a=N(t))}(t,n),e||!o||a)if(e&&o&&s^a)b=s?1:0,t=g(t,n,i);else if(!e&&o&&a)b=s?1:0,t=k(t,n,i),t=g(t,n);else if(!e||s||o||a){if(e&&!o&&s^a)t=g(t,n),s?(b=0,t=k(t,n,i)):(b=1,t=k(t,n,i),t=g(t,n));else if(e&&s&&!o&&a)b=1,t=k(t,n,i),t=g(t,n);else if(!e&&!o&&s^a){var r=u;s?(b=1,t=k(t,n,i),b=0,u=!1,t=k(t,n,i),u=r):(b=0,t=k(t,n,i),t=g(t,n),b=1,u=!1,t=k(t,n,i),u=r,t=g(t,n))}}else b=0,t=k(t,n,i);else b=s?1:0,t=k(t,n,i);return t},this.__bidiEngine__.setOptions=function(t){t&&(e=t.isInputVisual,o=t.isOutputVisual,s=t.isInputRtl,a=t.isOutputRtl,u=t.isSymmetricSwapping)},this.__bidiEngine__.setOptions(t),this.__bidiEngine__};var n=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","N","N","ET","ET","ET","N","N","N","N","N","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","N","ET","ET","ET","ET","N","N","N","N","L","N","N","BN","N","N","ET","ET","EN","EN","N","L","N","N","N","EN","L","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","N","N","N","N","N","ET","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","R","NSM","R","NSM","NSM","R","NSM","NSM","R","NSM","N","N","N","N","N","N","N","N","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","N","N","N","N","N","R","R","R","R","R","N","N","N","N","N","N","N","N","N","N","N","AN","AN","AN","AN","AN","AN","N","N","AL","ET","ET","AL","CS","AL","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","AN","AN","AN","AN","AN","AN","AN","AN","AN","ET","AN","AN","AL","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","N","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","NSM","NSM","N","NSM","NSM","NSM","NSM","AL","AL","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","N","N","N","N","N","N","N","N","N","N","N","N","N","N","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","R","R","N","N","N","N","R","N","N","N","N","N","WS","WS","WS","WS","WS","WS","WS","WS","WS","WS","WS","BN","BN","BN","L","R","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","WS","B","LRE","RLE","PDF","LRO","RLO","CS","ET","ET","ET","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","CS","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","WS","BN","BN","BN","BN","BN","N","LRI","RLI","FSI","PDI","BN","BN","BN","BN","BN","BN","EN","L","N","N","EN","EN","EN","EN","EN","EN","ES","ES","N","N","N","L","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","ES","ES","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","L","L","N","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","N","N","N","N","N","R","NSM","R","R","R","R","R","R","R","R","R","R","ES","R","R","R","R","R","R","R","R","R","R","R","R","R","N","R","R","R","R","R","N","R","N","R","R","N","R","R","N","R","R","R","R","R","R","R","R","R","R","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","CS","N","CS","N","N","CS","N","N","N","N","N","N","N","N","N","ET","N","N","ES","ES","N","N","N","N","N","ET","ET","N","N","N","N","N","AL","AL","AL","AL","AL","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","N","BN","N","N","N","ET","ET","ET","N","N","N","N","N","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","L","L","L","L","L","L","N","N","L","L","L","L","L","L","N","N","L","L","L","L","L","L","N","N","L","L","L","N","N","N","ET","ET","N","N","N","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N"],i=new t.__bidiEngine__({isInputVisual:!0});t.API.events.push(["postProcessText",function(t){var n=t.text,r=t.options||{},e=[];if(r.isInputVisual="boolean"!=typeof r.isInputVisual||r.isInputVisual,i.setOptions(r),"[object Array]"===Object.prototype.toString.call(n)){var s=0;for(e=[],s=0;s<n.length;s+=1)"[object Array]"===Object.prototype.toString.call(n[s])?e.push([i.doBidiReorder(n[s][0]),n[s][1],n[s][2]]):e.push([i.doBidiReorder(n[s])]);t.text=e}else t.text=i.doBidiReorder(n);i.setOptions({isInputVisual:!0})}])}(Pt),Pt.API.TTFFont=function(){function t(t){var n;if(this.rawData=t,n=this.contents=new Xn(t),this.contents.pos=4,"ttcf"===n.readString(4))throw new Error("TTCF not supported.");n.pos=0,this.parse(),this.subset=new mi(this),this.registerTTF()}return t.open=function(n){return new t(n)},t.prototype.parse=function(){return this.directory=new Zn(this.contents),this.head=new ni(this),this.name=new ui(this),this.cmap=new ri(this),this.toUnicode={},this.hhea=new ei(this),this.maxp=new fi(this),this.hmtx=new ci(this),this.post=new oi(this),this.os2=new si(this),this.loca=new wi(this),this.glyf=new li(this),this.ascender=this.os2.exists&&this.os2.ascender||this.hhea.ascender,this.decender=this.os2.exists&&this.os2.decender||this.hhea.decender,this.lineGap=this.os2.exists&&this.os2.lineGap||this.hhea.lineGap,this.bbox=[this.head.xMin,this.head.yMin,this.head.xMax,this.head.yMax]},t.prototype.registerTTF=function(){var t,n,i,r;if(this.scaleFactor=1e3/this.head.unitsPerEm,this.bbox=function(){var t,n,i,r;for(r=[],t=0,n=(i=this.bbox).length;t<n;t++)r.push(Math.round(i[t]*this.scaleFactor));return r}.call(this),this.stemV=0,this.post.exists?(n=255&(i=this.post.italic_angle),0!=(32768&(t=i>>16))&&(t=-(1+(65535^t))),this.italicAngle=+(t+"."+n)):this.italicAngle=0,this.ascender=Math.round(this.ascender*this.scaleFactor),this.decender=Math.round(this.decender*this.scaleFactor),this.lineGap=Math.round(this.lineGap*this.scaleFactor),this.capHeight=this.os2.exists&&this.os2.capHeight||this.ascender,this.xHeight=this.os2.exists&&this.os2.xHeight||0,this.familyClass=(this.os2.exists&&this.os2.familyClass||0)>>8,this.isSerif=1===(r=this.familyClass)||2===r||3===r||4===r||5===r||7===r,this.isScript=10===this.familyClass,this.flags=0,this.post.isFixedPitch&&(this.flags|=1),this.isSerif&&(this.flags|=2),this.isScript&&(this.flags|=8),0!==this.italicAngle&&(this.flags|=64),this.flags|=32,!this.cmap.unicode)throw new Error("No unicode cmap for font")},t.prototype.characterToGlyph=function(t){var n;return(null!=(n=this.cmap.unicode)?n.codeMap[t]:void 0)||0},t.prototype.widthOfGlyph=function(t){var n;return n=1e3/this.head.unitsPerEm,this.hmtx.forGlyph(t).advance*n},t.prototype.widthOfString=function(t,n,i){var r,e,s,o;for(s=0,e=0,o=(t=""+t).length;0<=o?e<o:e>o;e=0<=o?++e:--e)r=t.charCodeAt(e),s+=this.widthOfGlyph(this.characterToGlyph(r))+i*(1e3/n)||0;return s*(n/1e3)},t.prototype.lineHeight=function(t,n){return null==n&&(n=!1),(this.ascender+(n?this.lineGap:0)-this.decender)/1e3*t},t}();var Kn,Xn=function(){function t(t){this.data=null!=t?t:[],this.pos=0,this.length=this.data.length}return t.prototype.readByte=function(){return this.data[this.pos++]},t.prototype.writeByte=function(t){return this.data[this.pos++]=t},t.prototype.readUInt32=function(){return 16777216*this.readByte()+(this.readByte()<<16)+(this.readByte()<<8)+this.readByte()},t.prototype.writeUInt32=function(t){return this.writeByte(t>>>24&255),this.writeByte(t>>16&255),this.writeByte(t>>8&255),this.writeByte(255&t)},t.prototype.readInt32=function(){var t;return(t=this.readUInt32())>=2147483648?t-4294967296:t},t.prototype.writeInt32=function(t){return t<0&&(t+=4294967296),this.writeUInt32(t)},t.prototype.readUInt16=function(){return this.readByte()<<8|this.readByte()},t.prototype.writeUInt16=function(t){return this.writeByte(t>>8&255),this.writeByte(255&t)},t.prototype.readInt16=function(){var t;return(t=this.readUInt16())>=32768?t-65536:t},t.prototype.writeInt16=function(t){return t<0&&(t+=65536),this.writeUInt16(t)},t.prototype.readString=function(t){var n,i;for(i=[],n=0;0<=t?n<t:n>t;n=0<=t?++n:--n)i[n]=String.fromCharCode(this.readByte());return i.join("")},t.prototype.writeString=function(t){var n,i,r;for(r=[],n=0,i=t.length;0<=i?n<i:n>i;n=0<=i?++n:--n)r.push(this.writeByte(t.charCodeAt(n)));return r},t.prototype.readShort=function(){return this.readInt16()},t.prototype.writeShort=function(t){return this.writeInt16(t)},t.prototype.readLongLong=function(){var t,n,i,r,e,s,o,a;return t=this.readByte(),n=this.readByte(),i=this.readByte(),r=this.readByte(),e=this.readByte(),s=this.readByte(),o=this.readByte(),a=this.readByte(),128&t?-1*(72057594037927940*(255^t)+281474976710656*(255^n)+1099511627776*(255^i)+4294967296*(255^r)+16777216*(255^e)+65536*(255^s)+256*(255^o)+(255^a)+1):72057594037927940*t+281474976710656*n+1099511627776*i+4294967296*r+16777216*e+65536*s+256*o+a},t.prototype.writeLongLong=function(t){var n,i;return n=Math.floor(t/4294967296),i=4294967295&t,this.writeByte(n>>24&255),this.writeByte(n>>16&255),this.writeByte(n>>8&255),this.writeByte(255&n),this.writeByte(i>>24&255),this.writeByte(i>>16&255),this.writeByte(i>>8&255),this.writeByte(255&i)},t.prototype.readInt=function(){return this.readInt32()},t.prototype.writeInt=function(t){return this.writeInt32(t)},t.prototype.read=function(t){var n,i;for(n=[],i=0;0<=t?i<t:i>t;i=0<=t?++i:--i)n.push(this.readByte());return n},t.prototype.write=function(t){var n,i,r;for(r=[],n=0,i=t.length;n<i;n++)r.push(this.writeByte(t[n]));return r},t}(),Zn=function(){var t;function n(t){var n,i,r;for(this.scalarType=t.readInt(),this.tableCount=t.readShort(),this.searchRange=t.readShort(),this.entrySelector=t.readShort(),this.rangeShift=t.readShort(),this.tables={},i=0,r=this.tableCount;0<=r?i<r:i>r;i=0<=r?++i:--i)n={tag:t.readString(4),checksum:t.readInt(),offset:t.readInt(),length:t.readInt()},this.tables[n.tag]=n}return n.prototype.encode=function(n){var i,r,e,s,o,a,u,f,c,h,l,v;for(v in h=Object.keys(n).length,o=Math.log(2),f=16*Math.floor(Math.log(h)/o),e=Math.floor(f/o),u=16*h-f,(r=new Xn).writeInt(this.scalarType),r.writeShort(h),r.writeShort(f),r.writeShort(e),r.writeShort(u),a=r.pos+16*h,s=null,l=[],n)for(c=n[v],r.writeString(v),r.writeInt(t(c)),r.writeInt(a),r.writeInt(c.length),l=l.concat(c),"head"===v&&(s=a),a+=c.length;a%4;)l.push(0),a++;return r.write(l),i=2981146554-t(r.data),r.pos=s+8,r.writeUInt32(i),r.data},t=function(t){var n,i,r,e;for(t=hi.call(t);t.length%4;)t.push(0);for(r=new Xn(t),i=0,n=0,e=t.length;n<e;n=n+=4)i+=r.readUInt32();return 4294967295&i},n}(),Qn={}.hasOwnProperty,ti=function(t,n){for(var i in n)Qn.call(n,i)&&(t[i]=n[i]);function r(){this.constructor=t}return r.prototype=n.prototype,t.prototype=new r,t.__super__=n.prototype,t};Kn=function(){function t(t){var n;this.file=t,this.exists=!!(n=this.file.directory.tables[this.tag]),n&&(this.offset=n.offset,this.length=n.length,this.parse(this.file.contents))}return t.prototype.parse=function(){},t.prototype.encode=function(){},t.prototype.raw=function(){return this.exists?(this.file.contents.pos=this.offset,this.file.contents.read(this.length)):null},t}();var ni=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return ti(t,Kn),t.prototype.tag="head",t.prototype.parse=function(t){return t.pos=this.offset,this.version=t.readInt(),this.revision=t.readInt(),this.checkSumAdjustment=t.readInt(),this.magicNumber=t.readInt(),this.flags=t.readShort(),this.unitsPerEm=t.readShort(),this.created=t.readLongLong(),this.modified=t.readLongLong(),this.xMin=t.readShort(),this.yMin=t.readShort(),this.xMax=t.readShort(),this.yMax=t.readShort(),this.macStyle=t.readShort(),this.lowestRecPPEM=t.readShort(),this.fontDirectionHint=t.readShort(),this.indexToLocFormat=t.readShort(),this.glyphDataFormat=t.readShort()},t.prototype.encode=function(t){var n;return(n=new Xn).writeInt(this.version),n.writeInt(this.revision),n.writeInt(this.checkSumAdjustment),n.writeInt(this.magicNumber),n.writeShort(this.flags),n.writeShort(this.unitsPerEm),n.writeLongLong(this.created),n.writeLongLong(this.modified),n.writeShort(this.xMin),n.writeShort(this.yMin),n.writeShort(this.xMax),n.writeShort(this.yMax),n.writeShort(this.macStyle),n.writeShort(this.lowestRecPPEM),n.writeShort(this.fontDirectionHint),n.writeShort(t),n.writeShort(this.glyphDataFormat),n.data},t}(),ii=function(){function t(t,n){var i,r,e,s,o,a,u,f,c,h,l,v,d,w,m,b,p;switch(this.platformID=t.readUInt16(),this.encodingID=t.readShort(),this.offset=n+t.readInt(),c=t.pos,t.pos=this.offset,this.format=t.readUInt16(),this.length=t.readUInt16(),this.language=t.readUInt16(),this.isUnicode=3===this.platformID&&1===this.encodingID&&4===this.format||0===this.platformID&&4===this.format,this.codeMap={},this.format){case 0:for(a=0;a<256;++a)this.codeMap[a]=t.readByte();break;case 4:for(l=t.readUInt16(),h=l/2,t.pos+=6,e=function(){var n,i;for(i=[],a=n=0;0<=h?n<h:n>h;a=0<=h?++n:--n)i.push(t.readUInt16());return i}(),t.pos+=2,d=function(){var n,i;for(i=[],a=n=0;0<=h?n<h:n>h;a=0<=h?++n:--n)i.push(t.readUInt16());return i}(),u=function(){var n,i;for(i=[],a=n=0;0<=h?n<h:n>h;a=0<=h?++n:--n)i.push(t.readUInt16());return i}(),f=function(){var n,i;for(i=[],a=n=0;0<=h?n<h:n>h;a=0<=h?++n:--n)i.push(t.readUInt16());return i}(),r=(this.length-t.pos+this.offset)/2,o=function(){var n,i;for(i=[],a=n=0;0<=r?n<r:n>r;a=0<=r?++n:--n)i.push(t.readUInt16());return i}(),a=m=0,p=e.length;m<p;a=++m)for(w=e[a],i=b=v=d[a];v<=w?b<=w:b>=w;i=v<=w?++b:--b)0===f[a]?s=i+u[a]:0!==(s=o[f[a]/2+(i-v)-(h-a)]||0)&&(s+=u[a]),this.codeMap[i]=65535&s}t.pos=c}return t.encode=function(t,n){var i,r,e,s,o,a,u,f,c,h,l,v,d,w,m,b,p,N,L,g,A,y,k,S,x,q,j,M,E,P,O,I,F,B,R,T,C,D,z,U,V,W,_,H,G;switch(j=new Xn,s=Object.keys(t).sort((function(t,n){return t-n})),n){case"macroman":for(d=0,w=function(){var t=[];for(v=0;v<256;++v)t.push(0);return t}(),b={0:0},e={},M=0,I=s.length;M<I;M++)null==b[W=t[r=s[M]]]&&(b[W]=++d),e[r]={old:t[r],new:b[t[r]]},w[r]=b[t[r]];return j.writeUInt16(1),j.writeUInt16(0),j.writeUInt32(12),j.writeUInt16(0),j.writeUInt16(262),j.writeUInt16(0),j.write(w),{charMap:e,subtable:j.data,maxGlyphID:d+1};case"unicode":for(x=[],c=[],p=0,b={},i={},m=u=null,E=0,F=s.length;E<F;E++)null==b[N=t[r=s[E]]]&&(b[N]=++p),i[r]={old:N,new:b[N]},o=b[N]-r,null!=m&&o===u||(m&&c.push(m),x.push(r),u=o),m=r;for(m&&c.push(m),c.push(65535),x.push(65535),k=2*(y=x.length),A=2*Math.pow(Math.log(y)/Math.LN2,2),h=Math.log(A/2)/Math.LN2,g=2*y-A,a=[],L=[],l=[],v=P=0,B=x.length;P<B;v=++P){if(f=c[v],65535===(S=x[v])){a.push(0),L.push(0);break}if(S-(q=i[S].new)>=32768)for(a.push(0),L.push(2*(l.length+y-v)),r=O=S;S<=f?O<=f:O>=f;r=S<=f?++O:--O)l.push(i[r].new);else a.push(q-S),L.push(0)}for(j.writeUInt16(3),j.writeUInt16(1),j.writeUInt32(12),j.writeUInt16(4),j.writeUInt16(16+8*y+2*l.length),j.writeUInt16(0),j.writeUInt16(k),j.writeUInt16(A),j.writeUInt16(h),j.writeUInt16(g),U=0,R=c.length;U<R;U++)j.writeUInt16(r=c[U]);for(j.writeUInt16(0),V=0,T=x.length;V<T;V++)j.writeUInt16(r=x[V]);for(_=0,C=a.length;_<C;_++)j.writeUInt16(o=a[_]);for(H=0,D=L.length;H<D;H++)j.writeUInt16(L[H]);for(G=0,z=l.length;G<z;G++)j.writeUInt16(d=l[G]);return{charMap:i,subtable:j.data,maxGlyphID:p+1}}},t}(),ri=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return ti(t,Kn),t.prototype.tag="cmap",t.prototype.parse=function(t){var n,i,r;for(t.pos=this.offset,this.version=t.readUInt16(),r=t.readUInt16(),this.tables=[],this.unicode=null,i=0;0<=r?i<r:i>r;i=0<=r?++i:--i)n=new ii(t,this.offset),this.tables.push(n),n.isUnicode&&null==this.unicode&&(this.unicode=n);return!0},t.encode=function(t,n){var i,r;return null==n&&(n="macroman"),i=ii.encode(t,n),(r=new Xn).writeUInt16(0),r.writeUInt16(1),i.table=r.data.concat(i.subtable),i},t}(),ei=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return ti(t,Kn),t.prototype.tag="hhea",t.prototype.parse=function(t){return t.pos=this.offset,this.version=t.readInt(),this.ascender=t.readShort(),this.decender=t.readShort(),this.lineGap=t.readShort(),this.advanceWidthMax=t.readShort(),this.minLeftSideBearing=t.readShort(),this.minRightSideBearing=t.readShort(),this.xMaxExtent=t.readShort(),this.caretSlopeRise=t.readShort(),this.caretSlopeRun=t.readShort(),this.caretOffset=t.readShort(),t.pos+=8,this.metricDataFormat=t.readShort(),this.numberOfMetrics=t.readUInt16()},t}(),si=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return ti(t,Kn),t.prototype.tag="OS/2",t.prototype.parse=function(t){if(t.pos=this.offset,this.version=t.readUInt16(),this.averageCharWidth=t.readShort(),this.weightClass=t.readUInt16(),this.widthClass=t.readUInt16(),this.type=t.readShort(),this.ySubscriptXSize=t.readShort(),this.ySubscriptYSize=t.readShort(),this.ySubscriptXOffset=t.readShort(),this.ySubscriptYOffset=t.readShort(),this.ySuperscriptXSize=t.readShort(),this.ySuperscriptYSize=t.readShort(),this.ySuperscriptXOffset=t.readShort(),this.ySuperscriptYOffset=t.readShort(),this.yStrikeoutSize=t.readShort(),this.yStrikeoutPosition=t.readShort(),this.familyClass=t.readShort(),this.panose=function(){var n,i;for(i=[],n=0;n<10;++n)i.push(t.readByte());return i}(),this.charRange=function(){var n,i;for(i=[],n=0;n<4;++n)i.push(t.readInt());return i}(),this.vendorID=t.readString(4),this.selection=t.readShort(),this.firstCharIndex=t.readShort(),this.lastCharIndex=t.readShort(),this.version>0&&(this.ascent=t.readShort(),this.descent=t.readShort(),this.lineGap=t.readShort(),this.winAscent=t.readShort(),this.winDescent=t.readShort(),this.codePageRange=function(){var n,i;for(i=[],n=0;n<2;n=++n)i.push(t.readInt());return i}(),this.version>1))return this.xHeight=t.readShort(),this.capHeight=t.readShort(),this.defaultChar=t.readShort(),this.breakChar=t.readShort(),this.maxContext=t.readShort()},t}(),oi=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return ti(t,Kn),t.prototype.tag="post",t.prototype.parse=function(t){var n,i,r;switch(t.pos=this.offset,this.format=t.readInt(),this.italicAngle=t.readInt(),this.underlinePosition=t.readShort(),this.underlineThickness=t.readShort(),this.isFixedPitch=t.readInt(),this.minMemType42=t.readInt(),this.maxMemType42=t.readInt(),this.minMemType1=t.readInt(),this.maxMemType1=t.readInt(),this.format){case 65536:case 196608:break;case 131072:var e;for(i=t.readUInt16(),this.glyphNameIndex=[],e=0;0<=i?e<i:e>i;e=0<=i?++e:--e)this.glyphNameIndex.push(t.readUInt16());for(this.names=[],r=[];t.pos<this.offset+this.length;)n=t.readByte(),r.push(this.names.push(t.readString(n)));return r;case 151552:return i=t.readUInt16(),this.offsets=t.read(i);case 262144:return this.map=function(){var n,i,r;for(r=[],e=n=0,i=this.file.maxp.numGlyphs;0<=i?n<i:n>i;e=0<=i?++n:--n)r.push(t.readUInt32());return r}.call(this)}},t}(),ai=function(t,n){this.raw=t,this.length=t.length,this.platformID=n.platformID,this.encodingID=n.encodingID,this.languageID=n.languageID},ui=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return ti(t,Kn),t.prototype.tag="name",t.prototype.parse=function(t){var n,i,r,e,s,o,a,u,f,c,h;for(t.pos=this.offset,t.readShort(),n=t.readShort(),o=t.readShort(),i=[],e=0;0<=n?e<n:e>n;e=0<=n?++e:--e)i.push({platformID:t.readShort(),encodingID:t.readShort(),languageID:t.readShort(),nameID:t.readShort(),length:t.readShort(),offset:this.offset+o+t.readShort()});for(a={},e=f=0,c=i.length;f<c;e=++f)t.pos=(r=i[e]).offset,u=t.readString(r.length),s=new ai(u,r),null==a[h=r.nameID]&&(a[h]=[]),a[r.nameID].push(s);this.strings=a,this.copyright=a[0],this.fontFamily=a[1],this.fontSubfamily=a[2],this.uniqueSubfamily=a[3],this.fontName=a[4],this.version=a[5];try{this.postscriptName=a[6][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}catch(t){this.postscriptName=a[4][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}return this.trademark=a[7],this.manufacturer=a[8],this.designer=a[9],this.description=a[10],this.vendorUrl=a[11],this.designerUrl=a[12],this.license=a[13],this.licenseUrl=a[14],this.preferredFamily=a[15],this.preferredSubfamily=a[17],this.compatibleFull=a[18],this.sampleText=a[19]},t}(),fi=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return ti(t,Kn),t.prototype.tag="maxp",t.prototype.parse=function(t){return t.pos=this.offset,this.version=t.readInt(),this.numGlyphs=t.readUInt16(),this.maxPoints=t.readUInt16(),this.maxContours=t.readUInt16(),this.maxCompositePoints=t.readUInt16(),this.maxComponentContours=t.readUInt16(),this.maxZones=t.readUInt16(),this.maxTwilightPoints=t.readUInt16(),this.maxStorage=t.readUInt16(),this.maxFunctionDefs=t.readUInt16(),this.maxInstructionDefs=t.readUInt16(),this.maxStackElements=t.readUInt16(),this.maxSizeOfInstructions=t.readUInt16(),this.maxComponentElements=t.readUInt16(),this.maxComponentDepth=t.readUInt16()},t}(),ci=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return ti(t,Kn),t.prototype.tag="hmtx",t.prototype.parse=function(t){var n,i,r,e,s,o;for(t.pos=this.offset,this.metrics=[],n=0,s=this.file.hhea.numberOfMetrics;0<=s?n<s:n>s;n=0<=s?++n:--n)this.metrics.push({advance:t.readUInt16(),lsb:t.readInt16()});for(r=this.file.maxp.numGlyphs-this.file.hhea.numberOfMetrics,this.leftSideBearings=function(){var i,e;for(e=[],n=i=0;0<=r?i<r:i>r;n=0<=r?++i:--i)e.push(t.readInt16());return e}(),this.widths=function(){var t,n,i,r;for(r=[],t=0,n=(i=this.metrics).length;t<n;t++)r.push(i[t].advance);return r}.call(this),i=this.widths[this.widths.length-1],o=[],n=e=0;0<=r?e<r:e>r;n=0<=r?++e:--e)o.push(this.widths.push(i));return o},t.prototype.forGlyph=function(t){return t in this.metrics?this.metrics[t]:{advance:this.metrics[this.metrics.length-1].advance,lsb:this.leftSideBearings[t-this.metrics.length]}},t}(),hi=[].slice,li=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return ti(t,Kn),t.prototype.tag="glyf",t.prototype.parse=function(){return this.cache={}},t.prototype.glyphFor=function(t){var n,i,r,e,s,o,a,u,f,c;return t in this.cache?this.cache[t]:(n=this.file.contents,i=(e=this.file.loca).indexOf(t),0===(r=e.lengthOf(t))?this.cache[t]=null:(n.pos=this.offset+i,s=(o=new Xn(n.read(r))).readShort(),u=o.readShort(),c=o.readShort(),a=o.readShort(),f=o.readShort(),this.cache[t]=-1===s?new di(o,u,c,a,f):new vi(o,s,u,c,a,f),this.cache[t]))},t.prototype.encode=function(t,n,i){var r,e,s,o,a;for(s=[],e=[],o=0,a=n.length;o<a;o++)r=t[n[o]],e.push(s.length),r&&(s=s.concat(r.encode(i)));return e.push(s.length),{table:s,offsets:e}},t}(),vi=function(){function t(t,n,i,r,e,s){this.raw=t,this.numberOfContours=n,this.xMin=i,this.yMin=r,this.xMax=e,this.yMax=s,this.compound=!1}return t.prototype.encode=function(){return this.raw.data},t}(),di=function(){function t(t,n,i,r,e){var s,o;for(this.raw=t,this.xMin=n,this.yMin=i,this.xMax=r,this.yMax=e,this.compound=!0,this.glyphIDs=[],this.glyphOffsets=[],s=this.raw;o=s.readShort(),this.glyphOffsets.push(s.pos),this.glyphIDs.push(s.readUInt16()),32&o;)s.pos+=1&o?4:2,128&o?s.pos+=8:64&o?s.pos+=4:8&o&&(s.pos+=2)}return t.prototype.encode=function(){var t,n,i;for(n=new Xn(hi.call(this.raw.data)),t=0,i=this.glyphIDs.length;t<i;++t)n.pos=this.glyphOffsets[t];return n.data},t}(),wi=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return ti(t,Kn),t.prototype.tag="loca",t.prototype.parse=function(t){var n;return t.pos=this.offset,this.offsets=0===this.file.head.indexToLocFormat?function(){var i,r;for(r=[],n=0,i=this.length;n<i;n+=2)r.push(2*t.readUInt16());return r}.call(this):function(){var i,r;for(r=[],n=0,i=this.length;n<i;n+=4)r.push(t.readUInt32());return r}.call(this)},t.prototype.indexOf=function(t){return this.offsets[t]},t.prototype.lengthOf=function(t){return this.offsets[t+1]-this.offsets[t]},t.prototype.encode=function(t,n){for(var i=new Uint32Array(this.offsets.length),r=0,e=0,s=0;s<i.length;++s)if(i[s]=r,e<n.length&&n[e]==s){++e,i[s]=r;var o=this.offsets[s+1]-this.offsets[s];o>0&&(r+=o)}for(var a=new Array(4*i.length),u=0;u<i.length;++u)a[4*u+3]=255&i[u],a[4*u+2]=(65280&i[u])>>8,a[4*u+1]=(16711680&i[u])>>16,a[4*u]=(4278190080&i[u])>>24;return a},t}(),mi=function(){function t(t){this.font=t,this.subset={},this.unicodes={},this.next=33}return t.prototype.generateCmap=function(){var t,n,i,r;for(n in i=this.font.cmap.tables[0].codeMap,t={},r=this.subset)t[n]=i[r[n]];return t},t.prototype.glyphsFor=function(t){var n,i,r,e,s,o,a;for(r={},s=0,o=t.length;s<o;s++)r[e=t[s]]=this.font.glyf.glyphFor(e);for(e in n=[],r)(null!=(i=r[e])?i.compound:void 0)&&n.push.apply(n,i.glyphIDs);if(n.length>0)for(e in a=this.glyphsFor(n))r[e]=i=a[e];return r},t.prototype.encode=function(t,n){var i,r,e,s,o,a,u,f,c,h,l,v,d,w;for(r in i=ri.encode(this.generateCmap(),"unicode"),s=this.glyphsFor(t),h={0:0},w=i.charMap)h[(o=w[r]).old]=o.new;for(l in c=i.maxGlyphID,s)l in h||(h[l]=c++);return u=function(t){var n,i;for(n in i={},t)i[t[n]]=n;return i}(h),f=Object.keys(u).sort((function(t,n){return t-n})),v=function(){var t,n,i;for(i=[],t=0,n=f.length;t<n;t++)i.push(u[f[t]]);return i}(),e=this.font.glyf.encode(s,v,h),a=this.font.loca.encode(e.offsets,v),d={cmap:this.font.cmap.raw(),glyf:e.table,loca:a,hmtx:this.font.hmtx.raw(),hhea:this.font.hhea.raw(),maxp:this.font.maxp.raw(),post:this.font.post.raw(),name:this.font.name.raw(),head:this.font.head.encode(n)},this.font.os2.exists&&(d["OS/2"]=this.font.os2.raw()),this.font.directory.encode(d)},t}();Pt.API.PDFObject=function(){var t;function n(){}return t=function(t,n){return(Array(n+1).join("0")+t).slice(-n)},n.convert=function(i){var r,e;if(Array.isArray(i))return"["+function(){var t,r,e;for(e=[],t=0,r=i.length;t<r;t++)e.push(n.convert(i[t]));return e}().join(" ")+"]";if("string"==typeof i)return"/"+i;if(null!=i?i.isString:void 0)return"("+i+")";if(i instanceof Date)return"(D:"+t(i.getUTCFullYear(),4)+t(i.getUTCMonth(),2)+t(i.getUTCDate(),2)+t(i.getUTCHours(),2)+t(i.getUTCMinutes(),2)+t(i.getUTCSeconds(),2)+"Z)";if("[object Object]"==={}.toString.call(i)){for(r in e=["<<"],i)e.push("/"+r+" "+n.convert(i[r]));return e.push(">>"),e.join("\n")}return""+i},n}();
353
353
  /* @preserve
354
354
  * arcgis-pdf-creator v0.0.1
355
355
  * Thu Apr 27 2023 17:20:32 GMT-0700 (Pacific Daylight Time)
@@ -454,7 +454,7 @@ var Ni=function(){return Ni=Object.assign||function(t){for(var n,i=1,r=arguments
454
454
  * See the License for the specific language governing permissions and
455
455
  * limitations under the License.
456
456
  */
457
- const Li="|";async function gi(t,n,i=!0,s=!1,o=!1,a,u=!1,f=!1){const c=[];return Object.keys(n).forEach((h=>{var l;const v=n[h];c.push(async function(t,n,i,s=!0,o=!1,a,u=!1,f=!1){const c=await Mi(t,n,s),h=c.layer;let l=[];if(void 0!==c.relationshipId){const t=await function(t,n,i,r){const e=t.substring(t.lastIndexOf("/")+1);return isNaN(parseInt(e))&&(t+="/"+n.toString()),ji({definitionExpression:"1=1",httpMethod:"POST",objectIds:r,outFields:"*",relationshipId:i,url:t})}(n.url,n.layerId,c.relationshipId,i),r=[];t.forEach((t=>{t.relatedRecords.forEach((t=>{r.push(t.attributes)}))}));const e=n.objectIdField;if(r.sort(((t,n)=>t[e]<n[e]?-1:t[e]>n[e]?1:0)),l=r.filter(((t,n)=>0===n||t[e]!==r[n-1][e])),0===l.length)return Promise.resolve([])}else l=await e(i,h,[],!1,void 0,a);const v={},d={},w={};h.fields?h.fields.forEach((t=>{if(!f||a.indexOf(t.name.toLowerCase())>-1){const n=t.name.toLowerCase();v[n]=t.name,w[n]=t.domain,d[n]=t.type}})):Object.keys(l[0]).forEach((t=>{if(!f||a.indexOf(t.toLowerCase())>-1){const n=t.toLowerCase();v[n]=t}}));const m="pattern"===c.labelFormat.type?await async function(t,n,i,e,s,o,a,u=!1){var f;const[c]=await r(["esri/intl"]),h=function(t){const n=[];let i=0;for(;i<t.length;){const r=t.indexOf("{",i);if(r<0)break;const e=t.indexOf("}",r);if(e<0)break;const s=t.substring(r,e+1);n.push(s),i=e+1}const r=function(t){var n;return null!==(n=t.match(/\{expression\/\w+\}/g))&&void 0!==n?n:[]}(t);return n.filter((t=>r.indexOf(t)<0))}(a),l=h.map((t=>t.substring(1,t.length-1))),v=await async function(t,n){const i={};if(!Array.isArray(n.popupTemplate.expressionInfos)||0===n.popupTemplate.expressionInfos.length)return Promise.resolve(i);const e=t.match(/\{expression\/\w+\}/g);if(!e)return Promise.resolve(i);const[s]=await r(["esri/arcade"]),o={variables:[{name:"$feature",type:"feature"},{name:"$layer",type:"featureSet"},{name:"$datastore",type:"featureSetCollection"},{name:"$map",type:"featureSetCollection"}]},a={};e.forEach((t=>{const i=t.substring(t.indexOf("/")+1,t.length-1);(n.popupTemplate.expressionInfos||[]).forEach((t=>{t.name===i&&(a[i]=s.createArcadeExecutor(t.expression,o))}))}));const u=Object.values(a);return Promise.all(u).then((t=>{const n=Object.keys(a);for(let r=0;r<n.length;++r)i[n[r]]=t[r].valueOf();return i}))}(a,t),d=null!==(f=a.match(/\{expression\/\w+\}/g))&&void 0!==f?f:[],w=await Promise.all(n.map((async n=>{var r;let u=a;for(let i=0;i<d.length;i++){const r=d[i],e=r.substring(r.indexOf("/")+1,r.length-1),s=await v[e].executeAsync({$feature:n,$layer:t});u=u.replace(r,s).replace(/\n/gi,"|")}const f=null!==(r=n.attributes)&&void 0!==r?r:n;l.forEach(((t,n)=>{const r=t.toLowerCase(),a=Pi(f[i[r]],e[r],s[r],o[r],c);u=u.replace(h[n],a)}));let w=u.split(Li);return w=w.map((t=>Si(t))),w})));return u&&w.unshift(l),Promise.resolve(w)}(n,l,v,d,w,c.attributeFormats,c.labelFormat.format,o):"executor"===c.labelFormat.type?await async function(t,n){const i=(await Promise.all(t.map((async t=>n.executeAsync({$feature:t}))))).filter((t=>t.text)).map((t=>Si(t.text).split(Li)));return Promise.resolve(i)}(l,c.labelFormat.format):await async function(t,n,i,e=!1,s=!1){var o,a;const[u]=await r(["esri/intl"]),f=t.map((t=>Object.keys(t.attributes).map((r=>{const e=r.toLowerCase();return Pi(t.attributes[r],n[e],i[e],null,u)}))));if(e){const n=[],i=t[0].attributes,r=null===(a=null===(o=t[0])||void 0===o?void 0:o.layer)||void 0===a?void 0:a.fields.reduce(((t,n)=>(t[n.name]=n.alias,t)),{});Object.keys(i).forEach((t=>{n.push(s&&r?r[t]:t)})),f.unshift(n)}return Promise.resolve(f)}(l,d,w,o,u);return Promise.resolve(m)}(t,(null===(l=v.layerView)||void 0===l?void 0:l.layer)||v.layer,v.ids,i,s,a,u,f)),o&&c.push(Promise.resolve([[h]]))})),(await Promise.all(c)).reduce(((t,n)=>t.concat(n)),[])}async function Ai(t,n,i,r=!1,e=!1,s,o=!1,a=!1){let u=await gi(t,n,i,e,!0,s,o,a);u=r?ki(u):u;const f=Object.keys(n);let c=[];return u.forEach((t=>{const i=t[0];f.indexOf(i)<0?c.push(t):(
457
+ const Li="|";async function gi(t,n,i=!0,s=!1,o=!1,a,u=!1,f=!1){const c=[];return Object.keys(n).forEach((h=>{var l;const v=n[h];c.push(async function(t,n,i,s=!0,o=!1,a,u=!1,f=!1){const c=await Mi(t,n,s),h=c.layer;let l=[];if(void 0!==c.relationshipId){const t=await function(t,n,i,r){const e=t.substring(t.lastIndexOf("/")+1);return isNaN(parseInt(e))&&(t+="/"+n.toString()),ji({definitionExpression:"1=1",httpMethod:"POST",objectIds:r,outFields:"*",relationshipId:i,url:t})}(n.url,n.layerId,c.relationshipId,i),r=[];t.forEach((t=>{t.relatedRecords.forEach((t=>{r.push(t.attributes)}))}));const e=n.objectIdField;if(r.sort(((t,n)=>t[e]<n[e]?-1:t[e]>n[e]?1:0)),l=r.filter(((t,n)=>0===n||t[e]!==r[n-1][e])),0===l.length)return Promise.resolve([])}else l=await e(i,h,[],!1,void 0,a);const v={},d={},w={};h.fields?h.fields.forEach((t=>{if(!f||a.indexOf(t.name.toLowerCase())>-1){const n=t.name.toLowerCase();v[n]=t.name,w[n]=t.domain,d[n]=t.type}})):Object.keys(l[0]).forEach((t=>{if(!f||a.indexOf(t.toLowerCase())>-1){const n=t.toLowerCase();v[n]=t}}));const m="pattern"===c.labelFormat.type?await async function(t,n,i,e,s,o,a,u=!1){var f;const[c]=await r(["esri/intl"]),h=function(t){const n=[];let i=0;for(;i<t.length;){const r=t.indexOf("{",i);if(r<0)break;const e=t.indexOf("}",r);if(e<0)break;const s=t.substring(r,e+1);n.push(s),i=e+1}const r=function(t){var n;return null!==(n=t.match(/\{expression\/\w+\}/g))&&void 0!==n?n:[]}(t);return n.filter((t=>r.indexOf(t)<0))}(a),l=h.map((t=>t.substring(1,t.length-1))),v=await async function(t,n){const i={};if(!Array.isArray(n.popupTemplate.expressionInfos)||0===n.popupTemplate.expressionInfos.length)return Promise.resolve(i);const e=t.match(/\{expression\/\w+\}/g);if(!e)return Promise.resolve(i);const[s]=await r(["esri/arcade"]),o={variables:[{name:"$feature",type:"feature"},{name:"$layer",type:"featureSet"},{name:"$datastore",type:"featureSetCollection"},{name:"$map",type:"featureSetCollection"}]},a={};e.forEach((t=>{const i=t.substring(t.indexOf("/")+1,t.length-1);(n.popupTemplate.expressionInfos||[]).forEach((t=>{t.name===i&&(a[i]=s.createArcadeExecutor(t.expression,o))}))}));const u=Object.values(a);return Promise.all(u).then((t=>{const n=Object.keys(a);for(let r=0;r<n.length;++r)i[n[r]]=t[r].valueOf();return i}))}(a,t),d=null!==(f=a.match(/\{expression\/\w+\}/g))&&void 0!==f?f:[],w=await Promise.all(n.map((async n=>{var r;let u=a;for(let i=0;i<d.length;i++){const r=d[i],e=r.substring(r.indexOf("/")+1,r.length-1),s=await v[e].executeAsync({$feature:n,$layer:t});u=u.replace(r,s).replace(/\n/gi,"|")}const f=null!==(r=n.attributes)&&void 0!==r?r:n;l.forEach(((t,n)=>{const r=t.toLowerCase(),a=Pi(f[i[r]],e[r],s[r],o[r],c);u=u.replace(h[n],a)}));let w=u.split(Li);return w=w.map((t=>Si(t))),w})));return u&&w.unshift(function(t){const n=t.split(Li).map(((t,n)=>{const i=t.match(/\{[^\}]*\}/g);return i?i.map((t=>t.substring(1,t.length-1))).map((t=>t.startsWith("expression/")?t.substring(t.indexOf("/")+1):t)).join("__"):`column_${n+1}`}));return n}(a)),Promise.resolve(w)}(n,l,v,d,w,c.attributeFormats,c.labelFormat.format,o):"executor"===c.labelFormat.type?await async function(t,n){const i=(await Promise.all(t.map((async t=>n.executeAsync({$feature:t}))))).filter((t=>t.text)).map((t=>Si(t.text).split(Li)));return Promise.resolve(i)}(l,c.labelFormat.format):await async function(t,n,i,e=!1,s=!1){var o,a;const[u]=await r(["esri/intl"]),f=t.map((t=>Object.keys(t.attributes).map((r=>{const e=r.toLowerCase();return Pi(t.attributes[r],n[e],i[e],null,u)}))));if(e){const n=[],i=t[0].attributes,r=null===(a=null===(o=t[0])||void 0===o?void 0:o.layer)||void 0===a?void 0:a.fields.reduce(((t,n)=>(t[n.name]=n.alias,t)),{});Object.keys(i).forEach((t=>{n.push(s&&r?r[t]:t)})),f.unshift(n)}return Promise.resolve(f)}(l,d,w,o,u);return Promise.resolve(m)}(t,(null===(l=v.layerView)||void 0===l?void 0:l.layer)||v.layer,v.ids,i,s,a,u,f)),o&&c.push(Promise.resolve([[h]]))})),(await Promise.all(c)).reduce(((t,n)=>t.concat(n)),[])}async function Ai(t,n,i,r=!1,e=!1,s,o=!1,a=!1){let u=await gi(t,n,i,e,!0,s,o,a);u=r?ki(u):u;const f=Object.keys(n);let c=[];return u.forEach((t=>{const i=t[0];f.indexOf(i)<0?c.push(t):(
458
458
  /** @license
459
459
  * Copyright 2022 Esri
460
460
  *
@@ -486,4 +486,4 @@ function(t,n){const i=n.map((t=>Object.values(t).map((t=>`"${t}"`)).join(",")+"\
486
486
  * See the License for the specific language governing permissions and
487
487
  * limitations under the License.
488
488
  */
489
- function(t,n){const i=document.createElement("a");void 0!==i.download&&(i.href=URL.createObjectURL(new Blob(n,{type:"text/csv;charset=utf-8;"})),i.download=`${t}.csv`||"export.csv",i.style.visibility="hidden",document.body.appendChild(i),i.click(),document.body.removeChild(i))}(t,i)}(qi(Ei(n,new RegExp(`\\b${i}\\b`))),c),c=[])})),Promise.resolve()}async function yi(t,n,r,e=!1,s="",o=""){let a=await gi(t,n);const u=Ei(n);return a=a.map((t=>t.filter((t=>t.length>0)))).filter((t=>t.length>0)),a=e?ki(a):a,function(t,n,r,e="",s=""){!function(t,n,r,e="",s=""){const o=new bi;o.initialize({pageType:"ANSI_A"},i("../assets/arcgis-pdf-creator/"),"en",t).then((()=>{const t=new pi;t.initialize(o).then((async()=>{const i=r.labelSpec;let a=1;if(s){const r=i.pageProperties,u=c.getPageSize(r.pageType);o.drawImage(s,{x:r.leftMargin,y:r.topMargin,width:u.width-r.leftMargin-r.rightMargin,height:u.height-r.topMargin-r.bottomMargin}),e&&t.drawSupplementalText(e,0,-.1),n.length>0&&(o.addPage(),++a)}await t.addLabelsToDoc(n,i,a,e),o.save()}))}))}(t,n,r,e,s)}(s||qi(u),a,r,s,o),Promise.resolve()}function ki(t){const n=t.map((t=>JSON.stringify(t))),i=new Set(n);return Array.from(i,(t=>JSON.parse(t)))}function Si(t){for(t=(t=(t=(t=(t=(t=t.replace(/<br\s*\/?>/gi,Li)).replace(/<p[^>]*>/gi,Li).trim().replace(/^\|/,"")).replace(/<\/p>/gi,"")).replace(/\n/gi,"|")).replace(/<[\s.]*[^<>]*\/?>/gi,"").replace(/\xA0/gi," ").replace(/&lt;/gi,"<").replace(/&gt;/gi,">").replace(/&nbsp;/gi," ")).replace(/\s*\|\s*/g,"|");t.match(/\|\|/);)t=t.replace(/\|\|/,"|");return(t=t.replace(/^\|/,"")).replace(/\|$/,"")}function xi(t,n=!1){const i=[];return t.forEach((t=>{(t.visible||n)&&i.push(`{${t.fieldName}}`)})),{type:"pattern",format:i.join(Li)}}function qi(t){return t.length>0?t.join(", "):"download"}function ji(t,n=[],i=0){return function(t){var n=function(t,n,i){var r=s(s({params:{}},i),t);return r.params=["objectIds","relationshipId","definitionExpression","outFields"].reduce((function(n,i){return(t[i]||"boolean"==typeof t[i])&&(n[i]=t[i]),n}),r.params),["params","httpMethod","rawResponse","authentication","portal","fetch","maxUrlLength","headers"].reduce((function(t,n){return r[n]&&(t[n]=r[n]),t}),{})}(t,0,{httpMethod:"GET",params:Ni({definitionExpression:"1=1",outFields:"*",relationshipId:0},t.params)});return o(a(t.url)+"/queryRelatedRecords",n)}(Object.assign(Object.assign({},t),{params:{resultOffset:i}})).then((r=>(n.push(...r.relatedRecordGroups),r.exceededTransferLimit?ji(t,n,i+r.relatedRecordGroups.length):Promise.resolve(n))))}async function Mi(t,n,i){var e,s;let o={layer:n,attributeFormats:{},relationshipId:void 0,labelFormat:{type:"unsupported",format:void 0}};if(n.popupEnabled&&(n.popupTemplate.fieldInfos.forEach((t=>{t.format&&(o.attributeFormats[t.fieldName.toLowerCase()]=t.format)})),i)){const a=null===(s=null===(e=n.popupTemplate)||void 0===e?void 0:e.content[0])||void 0===s?void 0:s.type;if("relationship"===a){const r=n.popupTemplate.content[0].relationshipId,e=n.relationships.find((t=>t.id===r));let s=t.layers.toArray().concat(t.tables.toArray());if(s=s.filter((t=>"feature"===t.type&&t.layerId===e.relatedTableId)),s.length>0)o=await Mi(t,s[0],i),o.relationshipId=r;else{s=t.layers.toArray().concat(t.tables.toArray());const e=[];let a;s=s.filter((t=>{if("feature"===t.type&&t.layerId!=n.layerId&&t.url){const n=t.url+"/"+t.layerId.toString();return e.push(u(n)),!0}return!1})),(await Promise.all(e)).some(((n,e)=>!(!n.relationships||!n.relationships.some((t=>t.id===r))||(a=Mi(t,s[e],i),0))))?(o=await a,o.relationshipId=r):o.labelFormat=xi(n.popupTemplate.fieldInfos)}}else"fields"===a?(o.labelFormat=xi(n.popupTemplate.fieldInfos),0===o.labelFormat.format.length&&(o.labelFormat=n.popupTemplate.title&&"string"==typeof n.popupTemplate.title?{type:"pattern",format:n.popupTemplate.title}:xi(n.popupTemplate.fieldInfos,!0))):o.labelFormat="text"===a?{type:"pattern",format:Si(n.popupTemplate.content[0].text)}:"expression"===a?await async function(t){const[n]=await r(["esri/arcade"]),i=await n.createArcadeExecutor(t.expression,{variables:[{name:"$feature",type:"feature"},{name:"$layer",type:"featureSet"},{name:"$datastore",type:"featureSetCollection"},{name:"$map",type:"featureSetCollection"}]});return Promise.resolve({type:"executor",format:i})}(n.popupTemplate.content[0].expressionInfo):xi(n.popupTemplate.fieldInfos)}return Promise.resolve(o)}function Ei(t,n=/.+/){let i=[];return Object.keys(t).forEach((r=>{const e=t[r];n.test(r)&&(i=i.concat(e.selectionSetNames))})),i}function Pi(t,n,i,r,e){if(null==t)return"";if(i&&"coded-value"===i.type){const n=i.getName(t);return null==n?void 0:n.toString()}{let i=t;switch(n){case"date":if(null==r?void 0:r.dateFormat){const t=e.convertDateFormatToIntlOptions(r.dateFormat);i=e.formatDate(i,t)}else i=e.formatDate(i);i=i.replace(/\xe2\x80\xaf/g,"");break;case"date-only":if(null==r?void 0:r.dateFormat){const t=e.convertDateFormatToIntlOptions(r.dateFormat);i=e.formatDateOnly(i,t)}else i=e.formatDateOnly(i);break;case"time-only":if(null==r?void 0:r.dateFormat){const t=e.convertDateFormatToIntlOptions(r.dateFormat);i=e.formatTimeOnly(i,t)}else i=e.formatTimeOnly(i);break;case"double":case"integer":case"long":case"small-integer":if(r){const t=e.convertNumberFormatToIntlOptions(r);i=e.formatNumber(i,t)}else i=e.formatNumber(i)}return i}}export{h as _,yi as a,gi as c,Ai as d,ki as r}
489
+ function(t,n){const i=document.createElement("a");void 0!==i.download&&(i.href=URL.createObjectURL(new Blob(n,{type:"text/csv;charset=utf-8;"})),i.download=`${t}.csv`||"export.csv",i.style.visibility="hidden",document.body.appendChild(i),i.click(),document.body.removeChild(i))}(t,i)}(qi(Ei(n,new RegExp(`\\b${i}\\b`))),c),c=[])})),Promise.resolve()}async function yi(t,n,r,e=!1,s="",o=""){let a=await gi(t,n);const u=Ei(n);return a=a.map((t=>t.filter((t=>t.length>0)))).filter((t=>t.length>0)),a=e?ki(a):a,function(t,n,r,e="",s=""){!function(t,n,r,e="",s=""){const o=new bi;o.initialize({pageType:"ANSI_A"},i("../assets/arcgis-pdf-creator/"),"en",t).then((()=>{const t=new pi;t.initialize(o).then((async()=>{const i=r.labelSpec;let a=1;if(s){const r=i.pageProperties,u=c.getPageSize(r.pageType);o.drawImage(s,{x:r.leftMargin,y:r.topMargin,width:u.width-r.leftMargin-r.rightMargin,height:u.height-r.topMargin-r.bottomMargin}),e&&t.drawSupplementalText(e,0,-.1),n.length>0&&(o.addPage(),++a)}await t.addLabelsToDoc(n,i,a,e),o.save()}))}))}(t,n,r,e,s)}(s||qi(u),a,r,s,o),Promise.resolve()}function ki(t){const n=t.map((t=>JSON.stringify(t))),i=new Set(n);return Array.from(i,(t=>JSON.parse(t)))}function Si(t){for(t=(t=(t=(t=(t=(t=t.replace(/<br\s*\/?>/gi,Li)).replace(/<p[^>]*>/gi,Li).trim().replace(/^\|/,"")).replace(/<\/p>/gi,"")).replace(/\n/gi,"|")).replace(/<[\s.]*[^<>]*\/?>/gi,"").replace(/\xA0/gi," ").replace(/&lt;/gi,"<").replace(/&gt;/gi,">").replace(/&nbsp;/gi," ")).replace(/\s*\|\s*/g,"|");t.match(/\|\|/);)t=t.replace(/\|\|/,"|");return(t=t.replace(/^\|/,"")).replace(/\|$/,"")}function xi(t,n=!1){const i=[];return t.forEach((t=>{(t.visible||n)&&i.push(`{${t.fieldName}}`)})),{type:"pattern",format:i.join(Li)}}function qi(t){return t.length>0?t.join(", "):"download"}function ji(t,n=[],i=0){return function(t){var n=function(t,n,i){var r=s(s({params:{}},i),t);return r.params=["objectIds","relationshipId","definitionExpression","outFields"].reduce((function(n,i){return(t[i]||"boolean"==typeof t[i])&&(n[i]=t[i]),n}),r.params),["params","httpMethod","rawResponse","authentication","portal","fetch","maxUrlLength","headers"].reduce((function(t,n){return r[n]&&(t[n]=r[n]),t}),{})}(t,0,{httpMethod:"GET",params:Ni({definitionExpression:"1=1",outFields:"*",relationshipId:0},t.params)});return o(a(t.url)+"/queryRelatedRecords",n)}(Object.assign(Object.assign({},t),{params:{resultOffset:i}})).then((r=>(n.push(...r.relatedRecordGroups),r.exceededTransferLimit?ji(t,n,i+r.relatedRecordGroups.length):Promise.resolve(n))))}async function Mi(t,n,i){var e,s;let o={layer:n,attributeFormats:{},relationshipId:void 0,labelFormat:{type:"unsupported",format:void 0}};if(n.popupEnabled&&(n.popupTemplate.fieldInfos.forEach((t=>{t.format&&(o.attributeFormats[t.fieldName.toLowerCase()]=t.format)})),i)){const a=null===(s=null===(e=n.popupTemplate)||void 0===e?void 0:e.content[0])||void 0===s?void 0:s.type;if("relationship"===a){const r=n.popupTemplate.content[0].relationshipId,e=n.relationships.find((t=>t.id===r));let s=t.layers.toArray().concat(t.tables.toArray());if(s=s.filter((t=>"feature"===t.type&&t.layerId===e.relatedTableId)),s.length>0)o=await Mi(t,s[0],i),o.relationshipId=r.toString();else{s=t.layers.toArray().concat(t.tables.toArray());const e=[];let a;s=s.filter((t=>{if("feature"===t.type&&t.layerId!=n.layerId&&t.url){const n=t.url+"/"+t.layerId.toString();return e.push(u(n)),!0}return!1})),(await Promise.all(e)).some(((n,e)=>!(!n.relationships||!n.relationships.some((t=>t.id===r))||(a=Mi(t,s[e],i),0))))?(o=await a,o.relationshipId=r.toString()):o.labelFormat=xi(n.popupTemplate.fieldInfos)}}else"fields"===a?(o.labelFormat=xi(n.popupTemplate.fieldInfos),0===o.labelFormat.format.length&&(o.labelFormat=n.popupTemplate.title&&"string"==typeof n.popupTemplate.title?{type:"pattern",format:n.popupTemplate.title}:xi(n.popupTemplate.fieldInfos,!0))):o.labelFormat="text"===a?{type:"pattern",format:Si(n.popupTemplate.content[0].text)}:"expression"===a?await async function(t){const[n]=await r(["esri/arcade"]),i=await n.createArcadeExecutor(t.expression,{variables:[{name:"$feature",type:"feature"},{name:"$layer",type:"featureSet"},{name:"$datastore",type:"featureSetCollection"},{name:"$map",type:"featureSetCollection"}]});return Promise.resolve({type:"executor",format:i})}(n.popupTemplate.content[0].expressionInfo):xi(n.popupTemplate.fieldInfos)}return Promise.resolve(o)}function Ei(t,n=/.+/){let i=[];return Object.keys(t).forEach((r=>{const e=t[r];n.test(r)&&(i=i.concat(e.selectionSetNames))})),i}function Pi(t,n,i,r,e){if(null==t)return"";if(i&&"coded-value"===i.type){const n=i.getName(t);return null==n?void 0:n.toString()}{let i=t;switch(n){case"date":if(null==r?void 0:r.dateFormat){const t=e.convertDateFormatToIntlOptions(r.dateFormat);i=e.formatDate(i,t)}else i=e.formatDate(i);i=i.replace(/\xe2\x80\xaf/g,"");break;case"date-only":if(null==r?void 0:r.dateFormat){const t=e.convertDateFormatToIntlOptions(r.dateFormat);i=e.formatDateOnly(i,t)}else i=e.formatDateOnly(i);break;case"time-only":if(null==r?void 0:r.dateFormat){const t=e.convertDateFormatToIntlOptions(r.dateFormat);i=e.formatTimeOnly(i,t)}else i=e.formatTimeOnly(i);break;case"double":case"integer":case"long":case"small-integer":if(r){const t=e.convertNumberFormatToIntlOptions(r);i=e.formatNumber(i,t)}else i=e.formatNumber(i)}return i}}export{h as _,yi as a,gi as c,Ai as d,ki as r}