@esri/solutions-components 0.3.8 → 0.3.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. package/dist/cjs/buffer-tools_6.cjs.entry.js +32 -31
  2. package/dist/cjs/calcite-combobox_3.cjs.entry.js +1 -1
  3. package/dist/cjs/{calcite-input-message.calcite-notice.map-select-tools.pdf-download.refine-selection-d5d5499f.js → calcite-input-message.calcite-notice.map-select-tools.pdf-download.refine-selection-cd8ad61e.js} +53 -19
  4. package/dist/cjs/calcite-input-message_5.cjs.entry.js +2 -2
  5. package/dist/cjs/{index.es-43f519b3.js → index.es-e89ba2a1.js} +2 -2
  6. package/dist/cjs/layer-table.cjs.entry.js +1 -1
  7. package/dist/cjs/loader.cjs.js +1 -1
  8. package/dist/cjs/{mapViewUtils-24d1d859.js → mapViewUtils-d250b1ed.js} +11 -6
  9. package/dist/cjs/public-notification.cjs.entry.js +3 -11
  10. package/dist/cjs/solutions-components.cjs.js +1 -1
  11. package/dist/collection/components/buffer-tools/buffer-tools.js +22 -20
  12. package/dist/collection/components/map-select-tools/map-select-tools.js +13 -0
  13. package/dist/collection/components/pdf-download/pdf-download.js +9 -19
  14. package/dist/collection/components/public-notification/public-notification.js +2 -30
  15. package/dist/collection/components/refine-selection/refine-selection.js +34 -14
  16. package/dist/collection/components/refine-selection-tools/refine-selection-tools.js +34 -16
  17. package/dist/collection/demos/new-public-notification.html +1 -11
  18. package/dist/collection/utils/interfaces.ts +2 -0
  19. package/dist/collection/utils/mapViewUtils.js +11 -6
  20. package/dist/collection/utils/mapViewUtils.ts +11 -6
  21. package/dist/components/buffer-tools2.js +19 -16
  22. package/dist/components/map-layer-picker2.js +11 -6
  23. package/dist/components/map-select-tools2.js +11 -0
  24. package/dist/components/pdf-download2.js +9 -4
  25. package/dist/components/public-notification.js +2 -11
  26. package/dist/components/refine-selection-tools2.js +15 -16
  27. package/dist/components/refine-selection2.js +32 -15
  28. package/dist/esm/buffer-tools_6.entry.js +32 -31
  29. package/dist/esm/calcite-combobox_3.entry.js +1 -1
  30. package/dist/esm/{calcite-input-message.calcite-notice.map-select-tools.pdf-download.refine-selection-b60306b8.js → calcite-input-message.calcite-notice.map-select-tools.pdf-download.refine-selection-ddd74bd6.js} +53 -19
  31. package/dist/esm/calcite-input-message_5.entry.js +2 -2
  32. package/dist/esm/{index.es-4a2bee8f.js → index.es-8edafdb2.js} +2 -2
  33. package/dist/esm/layer-table.entry.js +1 -1
  34. package/dist/esm/loader.js +1 -1
  35. package/dist/esm/{mapViewUtils-c2fb048d.js → mapViewUtils-63e118f8.js} +11 -6
  36. package/dist/esm/public-notification.entry.js +3 -11
  37. package/dist/esm/solutions-components.js +1 -1
  38. package/dist/solutions-components/demos/new-public-notification.html +1 -11
  39. package/dist/solutions-components/{p-21ae3f97.entry.js → p-117174e8.entry.js} +1 -1
  40. package/dist/solutions-components/p-15f9b0a0.entry.js +6 -0
  41. package/dist/solutions-components/{p-547cbe8a.js → p-238db156.js} +11 -11
  42. package/dist/solutions-components/{p-709c3f22.entry.js → p-2a96314a.entry.js} +2 -2
  43. package/dist/solutions-components/{p-b4be1c30.entry.js → p-6d28f991.entry.js} +1 -1
  44. package/dist/solutions-components/{p-1b7c13f8.js → p-98884f44.js} +1 -1
  45. package/dist/solutions-components/{p-c5f670fb.entry.js → p-c5341977.entry.js} +1 -1
  46. package/dist/solutions-components/p-cc2e20c8.js +36 -0
  47. package/dist/solutions-components/solutions-components.esm.js +1 -1
  48. package/dist/solutions-components/utils/interfaces.ts +2 -0
  49. package/dist/solutions-components/utils/mapViewUtils.ts +11 -6
  50. package/dist/types/components/buffer-tools/buffer-tools.d.ts +2 -2
  51. package/dist/types/components/map-select-tools/map-select-tools.d.ts +6 -0
  52. package/dist/types/components/pdf-download/pdf-download.d.ts +0 -5
  53. package/dist/types/components/public-notification/public-notification.d.ts +1 -6
  54. package/dist/types/components/refine-selection/refine-selection.d.ts +6 -4
  55. package/dist/types/components/refine-selection-tools/refine-selection-tools.d.ts +5 -9
  56. package/dist/types/components.d.ts +19 -27
  57. package/dist/types/utils/interfaces.d.ts +2 -0
  58. package/package.json +1 -1
  59. package/dist/solutions-components/p-b47d1a9a.entry.js +0 -6
  60. package/dist/solutions-components/p-cd7606eb.js +0 -36
  61. package/dist/types/components/json-editor/assets/monaco-editor/monaco.d.ts +0 -8262
@@ -3,7 +3,7 @@
3
3
  * Licensed under the Apache License, Version 2.0
4
4
  * http://www.apache.org/licenses/LICENSE-2.0
5
5
  */
6
- import{r as t,h as i,H as n,g as e,c as r,a as s}from"./p-c2f00d41.js";import{s as o,g as a,a as u}from"./p-83166522.js";import{S as c}from"./p-6fe17794.js";import{c as h,d as f}from"./p-1c247f54.js";import{l}from"./p-eea93a37.js";import{g as d,h as v,d as m,e as w,q as p}from"./p-cd7606eb.js";import{E as b,f as g,g as N,c as L}from"./p-dbc9a5a8.js";import{s as y}from"./p-4557d5a8.js";import{g as A}from"./p-9260d75a.js";import{e as k}from"./p-3069e3b7.js";import{c as S,g as x}from"./p-e1a4994d.js";import{a as q,g as M}from"./p-fc884dd6.js";
6
+ import{r as t,h as i,H as n,g as e,c as r,a as s}from"./p-c2f00d41.js";import{s as o,g as a,a as u}from"./p-83166522.js";import{S as c}from"./p-6fe17794.js";import{c as h,d as f}from"./p-1c247f54.js";import{l}from"./p-eea93a37.js";import{g as d,h as v,d as m,e as w,q as p}from"./p-cc2e20c8.js";import{E as b,f as g,g as N,c as L}from"./p-dbc9a5a8.js";import{s as y}from"./p-4557d5a8.js";import{g as A}from"./p-9260d75a.js";import{e as k}from"./p-3069e3b7.js";import{c as S,g as x}from"./p-e1a4994d.js";import{a as q,g as M}from"./p-fc884dd6.js";
7
7
  /*!
8
8
  * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
9
9
  * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
@@ -14,7 +14,7 @@ import{r as t,h as i,H as n,g as e,c as r,a as s}from"./p-c2f00d41.js";import{s
14
14
  * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
15
15
  * v1.0.0-beta.97
16
16
  */
17
- const P="actions-end",I=class{constructor(i){t(this,i),this.calciteNoticeClose=r(this,"calciteNoticeClose",6),this.calciteNoticeOpen=r(this,"calciteNoticeOpen",6),this.active=!1,this.open=!1,this.color="blue",this.dismissible=!1,this.closable=!1,this.intlClose="Close",this.scale="m",this.width="auto",this.close=()=>{this.open=!1,this.calciteNoticeClose.emit()}}activeHandler(t){this.open=t}openHandler(t){this.active=t}handleDismissible(t){this.closable=t}handleClosable(t){this.dismissible=t}updateRequestedIcon(){this.requestedIcon=o(c,this.icon,this.color)}connectedCallback(){h(this);const t=this.active||this.open;t&&(this.activeHandler(t),this.openHandler(t)),this.dismissible&&this.handleDismissible(this.dismissible),this.closable&&this.handleClosable(this.closable)}disconnectedCallback(){f(this)}componentWillLoad(){this.requestedIcon=o(c,this.icon,this.color)}render(){const{el:t}=this,n=i("button",{"aria-label":this.intlClose,class:"notice-close",onClick:this.close,ref:t=>this.closeButton=t},i("calcite-icon",{icon:"x",scale:"l"===this.scale?"m":"s"})),e=u(t,P);return i("div",{class:"container"},this.requestedIcon?i("div",{class:"notice-icon"},i("calcite-icon",{icon:this.requestedIcon,scale:"l"===this.scale?"m":"s"})):null,i("div",{class:"notice-content"},i("slot",{name:"title"}),i("slot",{name:"message"}),i("slot",{name:"link"})),e?i("div",{class:"actions-end"},i("slot",{name:P})):null,this.closable?n:null)}async setFocus(){const t=this.el.querySelector("calcite-link");(this.closeButton||t)&&(t?t.setFocus():this.closeButton&&this.closeButton.focus())}get el(){return e(this)}static get watchers(){return{active:["activeHandler"],open:["openHandler"],dismissible:["handleDismissible"],closable:["handleClosable"],icon:["updateRequestedIcon"],color:["updateRequestedIcon"]}}};I.style="@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0.01}}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing)}:host([hidden]){display:none}:host([scale=s]){--calcite-notice-spacing-token-small:0.5rem;--calcite-notice-spacing-token-large:0.75rem}:host([scale=s]) .container slot[name=title]::slotted(*),:host([scale=s]) .container *::slotted([slot=title]){margin-block:0.125rem;font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=s]) .container slot[name=message]::slotted(*),:host([scale=s]) .container *::slotted([slot=message]){margin-block:0.125rem;font-size:var(--calcite-font-size--2);line-height:1.375}:host([scale=s]) ::slotted(calcite-link){margin-block:0.125rem;font-size:var(--calcite-font-size--2);line-height:1.375}:host([scale=s]) .notice-close{padding:0.5rem}:host([scale=m]){--calcite-notice-spacing-token-small:0.75rem;--calcite-notice-spacing-token-large:1rem}:host([scale=m]) .container slot[name=title]::slotted(*),:host([scale=m]) .container *::slotted([slot=title]){margin-block:0.125rem;font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=m]) .container slot[name=message]::slotted(*),:host([scale=m]) .container *::slotted([slot=message]){margin-block:0.125rem;font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=m]) ::slotted(calcite-link){margin-block:0.125rem;font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=l]){--calcite-notice-spacing-token-small:1rem;--calcite-notice-spacing-token-large:1.25rem}:host([scale=l]) .container slot[name=title]::slotted(*),:host([scale=l]) .container *::slotted([slot=title]){margin-block:0.125rem;font-size:var(--calcite-font-size-1);line-height:1.375}:host([scale=l]) .container slot[name=message]::slotted(*),:host([scale=l]) .container *::slotted([slot=message]){margin-block:0.125rem;font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=l]) ::slotted(calcite-link){margin-block:0.125rem;font-size:var(--calcite-font-size-0);line-height:1.375}:host([width=auto]){--calcite-notice-width:auto}:host([width=half]){--calcite-notice-width:50%}:host([width=full]){--calcite-notice-width:100%}:host{margin-inline:auto;display:none;max-inline-size:100%;align-items:center;inline-size:var(--calcite-notice-width)}.container{pointer-events:none;margin-block:0px;box-sizing:border-box;display:none;inline-size:100%;background-color:var(--calcite-ui-foreground-1);opacity:0;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;max-block-size:0;text-align:start;-webkit-border-start:0px solid;border-inline-start:0px solid;box-shadow:0 0 0 0 transparent}.notice-close{outline-color:transparent}.notice-close:focus{outline:2px solid var(--calcite-ui-brand);outline-offset:-2px}:host{display:flex}:host([open]) .container{pointer-events:auto;display:flex;max-block-size:100%;align-items:center;border-width:2px;opacity:1;--tw-shadow:0 4px 8px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);--tw-shadow-colored:0 4px 8px -1px var(--tw-shadow-color), 0 2px 4px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.container slot[name=title]::slotted(*),.container *::slotted([slot=title]){margin:0px;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-1)}.container slot[name=message]::slotted(*),.container *::slotted([slot=message]){margin:0px;display:inline;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-ui-text-2);-webkit-margin-end:var(--calcite-notice-spacing-token-small);margin-inline-end:var(--calcite-notice-spacing-token-small)}.notice-content{box-sizing:border-box;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;padding-inline:var(--calcite-notice-spacing-token-large);flex:0 0 auto;display:flex;min-inline-size:0px;flex-direction:column;overflow-wrap:break-word;flex:1 1 0;padding-block:var(--calcite-notice-spacing-token-small);padding-inline:0 var(--calcite-notice-spacing-token-small)}.notice-content:first-of-type:not(:only-child){-webkit-padding-start:var(--calcite-notice-spacing-token-large);padding-inline-start:var(--calcite-notice-spacing-token-large)}.notice-content:only-of-type{padding-block:var(--calcite-notice-spacing-token-small);padding-inline:var(--calcite-notice-spacing-token-large)}.notice-icon{display:flex;align-items:center;box-sizing:border-box;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;padding-block:var(--calcite-notice-spacing-token-small);padding-inline:var(--calcite-notice-spacing-token-large);flex:0 0 auto}.notice-close{display:flex;cursor:pointer;align-items:center;align-self:stretch;border-style:none;background-color:transparent;color:var(--calcite-ui-text-3);outline:2px solid transparent;outline-offset:2px;box-sizing:border-box;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;padding-block:var(--calcite-notice-spacing-token-small);padding-inline:var(--calcite-notice-spacing-token-large);flex:0 0 auto;-webkit-appearance:none}.notice-close:hover,.notice-close:focus{background-color:var(--calcite-ui-foreground-2);color:var(--calcite-ui-text-1)}.notice-close:active{background-color:var(--calcite-ui-foreground-3)}.actions-end{display:flex;align-self:stretch}:host([color=blue]) .container{border-color:var(--calcite-ui-brand)}:host([color=blue]) .container .notice-icon{color:var(--calcite-ui-brand)}:host([color=red]) .container{border-color:var(--calcite-ui-danger)}:host([color=red]) .container .notice-icon{color:var(--calcite-ui-danger)}:host([color=yellow]) .container{border-color:var(--calcite-ui-warning)}:host([color=yellow]) .container .notice-icon{color:var(--calcite-ui-warning)}:host([color=green]) .container{border-color:var(--calcite-ui-success)}:host([color=green]) .container .notice-icon{color:var(--calcite-ui-success)}";const F=class{constructor(i){t(this,i),this.selectionSetChange=r(this,"selectionSetChange",7),this.sketchTypeChange=r(this,"sketchTypeChange",7),this.workflowTypeChange=r(this,"workflowTypeChange",7),this._selectedIds=[],this._selectionLabel="",this.bufferColor=[227,139,79,.8],this.bufferOutlineColor=[255,255,255],this.enabledLayerIds=[],this.defaultBufferDistance=void 0,this.defaultBufferUnit=void 0,this.geometries=void 0,this.isUpdate=!1,this.mapView=void 0,this.searchConfiguration=void 0,this.selectionSet=void 0,this.selectLayerView=void 0,this.showBufferTools=!0,this._layerSelectChecked=void 0,this._searchTerm=void 0,this._translations=void 0,this._workflowType=void 0}async watchGeometriesHandler(t,i){if(t!==i){if(t.length>0)return this._geomQuery(this.geometries);if(0===t.length)return this._clearResults(!0,!0)}}async workflowTypeHandler(t,i){t!==i&&(this.mapView.popup.autoOpenEnabled=["SELECT","SKETCH","REFINE"].indexOf(t)<0,this.workflowTypeChange.emit(t))}async clearSelection(){return this._clearResults()}async getSelection(){/\S+/gm.test(this._selectionLabel)||(this._selectionLabel=this._getSelectionBaseLabel());const t=this._selectionLabel===this._getSelectionBaseLabel();return{id:this.isUpdate?this.selectionSet.id:Date.now(),workflowType:this._workflowType,searchResult:this._searchResult,buffer:this._bufferGeometry,distance:this._bufferTools.distance,download:!0,unit:this._bufferTools.unit,label:this._selectionLabel&&!t?this._selectionLabel:`${this._selectionLabel} ${this._bufferTools.distance} ${this._bufferTools.unit}`,selectedIds:this._selectedIds,layerView:this.selectLayerView,geometries:this.geometries,refineSelectLayers:this._refineTools.layerViews}}labelChange(t){this._selectionLabel=t.detail}sketchGraphicsChange(t){this._updateSelection(b.SKETCH,t.detail,this._selectionLabel||this._translations.sketch)}refineSelectionGraphicsChange(t){const i=t.detail;this._updateSelection(b.SELECT,i,this._selectionLabel||this._translations.select);const n=Array.isArray(i)?i.map((t=>t.attributes[t.layer.objectIdField])):[];return this._highlightFeatures(n)}async componentWillLoad(){await this._getTranslations(),await this._initModules()}async componentDidLoad(){return this._init()}render(){var t,e,r;const s=this._workflowType===b.SEARCH,o=s?" div-visible-search":" div-not-visible",a=this._workflowType===b.SKETCH||this._workflowType===b.SELECT,u=this.showBufferTools?"search-distance":"div-not-visible",c=this._layerSelectChecked&&!s?" div-visible":" div-not-visible",h=this._layerSelectChecked||s?" div-not-visible":" div-visible",f=s?"div-not-visible":"div-visible";return i(n,null,i("div",{class:"padding-bottom-1"},i("calcite-radio-group",{class:"w-100",onCalciteRadioGroupChange:t=>this._workflowChange(t)},i("calcite-radio-group-item",{checked:s,class:"w-50 end-border",value:b.SEARCH},this._translations.search),i("calcite-radio-group-item",{checked:a,class:"w-50",value:b.SKETCH},this._translations.sketch))),i("div",{class:o},i("div",{class:"search-widget",ref:t=>{this._searchElement=t}})),i("div",{class:f},i("calcite-label",{layout:"inline"},i("calcite-checkbox",{checked:(null===(t=this.selectionSet)||void 0===t?void 0:t.workflowType)===b.SELECT,onCalciteCheckboxChange:()=>this._layerSelectChanged(),ref:t=>this._selectFromLayerElement=t}),"Use layer features")),i("div",{class:h},i("map-draw-tools",{active:!0,border:!0,mapView:this.mapView,ref:t=>{this._drawTools=t}})),i("div",{class:c},i("refine-selection-tools",{active:!0,border:!0,enabledLayerIds:this.enabledLayerIds,layerViews:this._refineSelectLayers,mapView:this.mapView,mode:g.ADD,ref:t=>{this._refineTools=t},refineMode:N.SUBSET})),i("calcite-label",{class:u},this._translations.searchDistance,i("buffer-tools",{distance:(null===(e=this.selectionSet)||void 0===e?void 0:e.distance)||this.defaultBufferDistance,geometries:this.geometries,onBufferComplete:t=>this._bufferComplete(t),ref:t=>this._bufferTools=t,unit:(null===(r=this.selectionSet)||void 0===r?void 0:r.unit)||this.defaultBufferUnit})),i("slot",null))}async _initModules(){const[t,i,n,e,r]=await l(["esri/layers/GraphicsLayer","esri/Graphic","esri/widgets/Search","esri/geometry/geometryEngine","esri/layers/FeatureLayer"]);this.GraphicsLayer=t,this.Graphic=i,this.Search=n,this._geometryEngine=e,this.FeatureLayer=r}async _init(){this._initGraphicsLayer(),this._initSelectionSet(),this._initSearchWidget()}_initSelectionSet(){var t,i,n,e,r,s,o;this.selectionSet?(this._searchTerm=null===(i=null===(t=this.selectionSet)||void 0===t?void 0:t.searchResult)||void 0===i?void 0:i.name,this._workflowType=null===(n=this.selectionSet)||void 0===n?void 0:n.workflowType,this._searchResult=null===(e=this.selectionSet)||void 0===e?void 0:e.searchResult,this._refineSelectLayers=null===(r=this.selectionSet)||void 0===r?void 0:r.refineSelectLayers,this.geometries=[...null===(s=this.selectionSet)||void 0===s?void 0:s.geometries],this._selectionLabel=(null===(o=this.selectionSet)||void 0===o?void 0:o.label)||this._getSelectionBaseLabel(),d(this.selectionSet.selectedIds,this.selectionSet.layerView,this.mapView,!1)):this._workflowType=b.SEARCH}_getSelectionBaseLabel(){var t,i;return this._workflowType===b.SKETCH?this._translations.sketch:this._workflowType===b.SELECT?this._translations.select:this._workflowType===b.SEARCH&&this._searchResult?null===(t=this._searchResult)||void 0===t?void 0:t.name:null===(i=this.selectionSet)||void 0===i?void 0:i.label}_initSearchWidget(){if(this.mapView&&this._searchElement){const t=this._getSearchConfig(this.searchConfiguration,this.mapView),i=Object.assign({view:this.mapView,container:this._searchElement,searchTerm:this._searchTerm},t);this._searchWidget=new this.Search(i),this._searchWidget.on("search-clear",(()=>{this._clearResults(!1)})),this._searchWidget.on("select-result",(t=>{var i;this._clearResults(!1),t.result&&(this._searchResult=t.result,this._updateSelection(b.SEARCH,[t.result.feature],null===(i=null==t?void 0:t.result)||void 0===i?void 0:i.name))}))}}_getSearchConfig(t,i){var n;const e=null==t?void 0:t.sources;return e&&e.forEach((t=>{var n,e,r;if(t.hasOwnProperty("layer")){const s=t,o=(null===(n=s.layer)||void 0===n?void 0:n.id)?i.map.findLayerById(s.layer.id):null;o?s.layer=o:(null===(e=null==s?void 0:s.layer)||void 0===e?void 0:e.url)&&(s.layer=new this.FeatureLayer(null===(r=null==s?void 0:s.layer)||void 0===r?void 0:r.url))}})),null===(n=null==t?void 0:t.sources)||void 0===n||n.forEach((t=>{if(t.hasOwnProperty("locator")){const i=t;i.url=i.url,delete i.url}})),t}_initGraphicsLayer(){const t=this._translations.bufferLayer,i=this.mapView.map.layers.findIndex((i=>i.title===t));if(i>-1)this._bufferGraphicsLayer=this.mapView.map.layers.getItemAt(i);else{this._bufferGraphicsLayer=new this.GraphicsLayer({title:t}),y.managedLayers.push(t);const i=this.mapView.map.layers.findIndex((t=>t.title===this._translations.sketchLayer));i>-1?this.mapView.map.layers.add(this._bufferGraphicsLayer,i):this.mapView.map.layers.add(this._bufferGraphicsLayer)}}_layerSelectChanged(){this._layerSelectChecked=this._selectFromLayerElement.checked,this.sketchTypeChange.emit(this._layerSelectChecked?L.LAYER:L.INTERACTIVE)}_workflowChange(t){this._workflowType=t.detail}async _highlightFeatures(t){var i;null===(i=y.highlightHandle)||void 0===i||i.remove(),t.length>0&&(y.highlightHandle=await v(t,this.selectLayerView,this.mapView)),this.selectionSetChange.emit(t.length)}async _selectFeatures(t){this._selectedIds=await m(t,this.selectLayerView.layer),this._drawTools.graphics=this.geometries.map((t=>{var i,n,e;const r={geometry:t,symbol:"point"===t.type?null===(i=this._drawTools)||void 0===i?void 0:i.pointSymbol:"polyline"===t.type?null===(n=this._drawTools)||void 0===n?void 0:n.polylineSymbol:"polygon"===t.type?null===(e=this._drawTools)||void 0===e?void 0:e.polygonSymbol:void 0};return new this.Graphic(r)})),this._highlightFeatures(this._selectedIds)}async _bufferComplete(t){if(this._bufferGeometry=Array.isArray(t.detail)?t.detail[0]:t.detail,this._bufferGeometry){const t=new this.Graphic({geometry:this._bufferGeometry,symbol:{type:"simple-fill",color:this.bufferColor,outline:{color:this.bufferOutlineColor,width:1}}});this._bufferGraphicsLayer.removeAll(),this._bufferGraphicsLayer.add(t),this._selectFeatures([this._bufferGeometry]),this.mapView.goTo(t.geometry.extent)}else this._bufferGraphicsLayer&&this._bufferGraphicsLayer.removeAll(),this._geomQuery(this.geometries)}_geomQuery(t){const i=w(t,this._geometryEngine);return this._selectFeatures(i)}async _clearResults(t=!0,i=!0){var n,e;this._selectedIds=[],i&&(this._selectionLabel=""),this._bufferGraphicsLayer&&this._bufferGraphicsLayer.removeAll(),t&&this._searchWidget&&this._searchWidget.clear(),null===(n=y.highlightHandle)||void 0===n||n.remove(),(null===(e=this._drawTools)||void 0===e?void 0:e.clear)&&this._drawTools.clear(),this.selectionSetChange.emit(this._selectedIds.length)}_updateSelection(t,i,n){this.geometries=Array.isArray(i)?i.map((t=>t.geometry)):this.geometries,this._workflowType=t,this._selectionLabel=n}async _getTranslations(){const t=await A(this.el);this._translations=t[0]}get el(){return e(this)}static get watchers(){return{geometries:["watchGeometriesHandler"],_workflowType:["workflowTypeHandler"]}}};F.style=':host{display:block}.div-visible{display:inherit}.div-visible-search{display:flex;height:44px;align-items:center;padding-bottom:0}.div-not-visible{display:none}.padding-bottom-1{padding-bottom:1rem}.search-widget{width:100% !important;border:1px solid var(--calcite-ui-border-input)}.w-100{width:100%}.w-50{width:50%}.search-distance-container{padding-top:"1rem" !important}.end-border{-webkit-border-end:1px solid var(--calcite-ui-border-2);border-inline-end:1px solid var(--calcite-ui-border-2)}.search-distance{display:flex;padding-top:1rem}';const R=Object.freeze({__proto__:null,default:[{descriptionPDF:{labelWidthDisplay:"2-5/8",labelHeightDisplay:"1",labelsPerPageDisplay:"30",averyPartNumber:"*60"},labelSpec:{type:"AVERY",pageProperties:{pageType:"ANSI A",leftMargin:.1875,rightMargin:.1875,topMargin:.5,bottomMargin:.5},numLabelsAcross:3,numLabelsDown:10,labelWidth:2.625,labelHeight:1,horizGapIn:.125,vertGapIn:0,labelPadding:.1,fontSizePx:11,maxNumLabelLines:4}},{descriptionPDF:{labelWidthDisplay:"4",labelHeightDisplay:"1",labelsPerPageDisplay:"20",averyPartNumber:"*61"},labelSpec:{type:"AVERY",pageProperties:{pageType:"ANSI A",leftMargin:.15625,rightMargin:.15625,topMargin:.47637821,bottomMargin:.5},numLabelsAcross:2,numLabelsDown:10,labelWidth:4,labelHeight:1.0025,horizGapIn:.1875,vertGapIn:0,labelPadding:.1,fontSizePx:11,maxNumLabelLines:4}},{descriptionPDF:{labelWidthDisplay:"4",labelHeightDisplay:"1-1/3",labelsPerPageDisplay:"14",averyPartNumber:"*62"},labelSpec:{type:"AVERY",pageProperties:{pageType:"ANSI A",leftMargin:.15625,rightMargin:.15625,topMargin:.81889808,bottomMargin:.83464612},numLabelsAcross:2,numLabelsDown:7,labelWidth:4,labelHeight:1.3352,horizGapIn:.1875,vertGapIn:0,labelPadding:.1,fontSizePx:11,maxNumLabelLines:6}},{descriptionPDF:{labelWidthDisplay:"4",labelHeightDisplay:"2",labelsPerPageDisplay:"10",averyPartNumber:"*63"},labelSpec:{type:"AVERY",pageProperties:{pageType:"ANSI A",leftMargin:.15625,rightMargin:.15625,topMargin:.5,bottomMargin:.5},numLabelsAcross:2,numLabelsDown:5,labelWidth:4,labelHeight:2,horizGapIn:.1875,vertGapIn:0,labelPadding:.1,fontSizePx:12,maxNumLabelLines:10}},{descriptionPDF:{labelWidthDisplay:"4",labelHeightDisplay:"3-1/3",labelsPerPageDisplay:"6",averyPartNumber:"*64"},labelSpec:{type:"AVERY",pageProperties:{pageType:"ANSI A",leftMargin:.15625,rightMargin:.15625,topMargin:.4724412,bottomMargin:.50000027},numLabelsAcross:2,numLabelsDown:3,labelWidth:4,labelHeight:3.342,horizGapIn:.1875,vertGapIn:0,labelPadding:.1,fontSizePx:14,maxNumLabelLines:12}},{descriptionPDF:{labelWidthDisplay:"1-3/4",labelHeightDisplay:"1/2",labelsPerPageDisplay:"80",averyPartNumber:"*67"},labelSpec:{type:"AVERY",pageProperties:{pageType:"ANSI A",leftMargin:.307086375,rightMargin:.307086375,topMargin:.4724412,bottomMargin:.49606326},numLabelsAcross:4,numLabelsDown:20,labelWidth:1.75,labelHeight:.50155,horizGapIn:.29527575,vertGapIn:0,labelPadding:.1,fontSizePx:8,maxNumLabelLines:3}},{descriptionPDF:{labelWidthDisplay:"1-3/4",labelHeightDisplay:"2/3",labelsPerPageDisplay:"60",averyPartNumber:"*95"},labelSpec:{type:"AVERY",pageProperties:{pageType:"ANSI A",leftMargin:.28936983,rightMargin:.28936983,topMargin:.53937037,bottomMargin:.5511814},numLabelsAcross:4,numLabelsDown:15,labelWidth:1.75,labelHeight:.6605,horizGapIn:.30708678,vertGapIn:0,labelPadding:.1,fontSizePx:8,maxNumLabelLines:4}}]});var O=S((function(t){function i(n){return t.exports=i="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,i(n)}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports}));const B=x(O);var D=Uint8Array,C=Uint16Array,T=Uint32Array,z=new D([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]),_=new D([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]),U=new D([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),V=function(t,i){for(var n=new C(31),e=0;e<31;++e)n[e]=i+=1<<t[e-1];var r=new T(n[30]);for(e=1;e<30;++e)for(var s=n[e];s<n[e+1];++s)r[s]=s-n[e]<<5|e;return[n,r]},W=V(z,2),H=W[0],G=W[1];H[28]=258,G[258]=28;for(var J=V(_,0),Y=J[0],K=J[1],X=new C(32768),$=0;$<32768;++$){var Q=(43690&$)>>>1|(21845&$)<<1;X[$]=((65280&(Q=(61680&(Q=(52428&Q)>>>2|(13107&Q)<<2))>>>4|(3855&Q)<<4))>>>8|(255&Q)<<8)>>>1}var Z=function(t,i,n){for(var e=t.length,r=0,s=new C(i);r<e;++r)++s[t[r]-1];var o,a=new C(i);for(r=0;r<i;++r)a[r]=a[r-1]+s[r-1]<<1;if(n){o=new C(1<<i);var u=15-i;for(r=0;r<e;++r)if(t[r])for(var c=r<<4|t[r],h=i-t[r],f=a[t[r]-1]++<<h,l=f|(1<<h)-1;f<=l;++f)o[X[f]>>>u]=c}else for(o=new C(e),r=0;r<e;++r)o[r]=X[a[t[r]-1]++]>>>15-t[r];return o},tt=new D(288);for($=0;$<144;++$)tt[$]=8;for($=144;$<256;++$)tt[$]=9;for($=256;$<280;++$)tt[$]=7;for($=280;$<288;++$)tt[$]=8;var it=new D(32);for($=0;$<32;++$)it[$]=5;var nt=Z(tt,9,0),et=Z(tt,9,1),rt=Z(it,5,0),st=Z(it,5,1),ot=function(t){for(var i=t[0],n=1;n<t.length;++n)t[n]>i&&(i=t[n]);return i},at=function(t,i,n){var e=i/8>>0;return(t[e]|t[e+1]<<8)>>>(7&i)&n},ut=function(t,i){var n=i/8>>0;return(t[n]|t[n+1]<<8|t[n+2]<<16)>>>(7&i)},ct=function(t){return(t/8>>0)+(7&t&&1)},ht=function(t,i,n){(null==i||i<0)&&(i=0),(null==n||n>t.length)&&(n=t.length);var e=new(t instanceof C?C:t instanceof T?T:D)(n-i);return e.set(t.subarray(i,n)),e},ft=function(t,i,n){var e=i/8>>0;t[e]|=n<<=7&i,t[e+1]|=n>>>8},lt=function(t,i,n){var e=i/8>>0;t[e]|=n<<=7&i,t[e+1]|=n>>>8,t[e+2]|=n>>>16},dt=function(t,i){for(var n=[],e=0;e<t.length;++e)t[e]&&n.push({s:e,f:t[e]});var r=n.length,s=n.slice();if(!r)return[new D(0),0];if(1==r){var o=new D(n[0].s+1);return o[n[0].s]=1,[o,1]}n.sort((function(t,i){return t.f-i.f})),n.push({s:-1,f:25001});var a=n[0],u=n[1],c=0,h=1,f=2;for(n[0]={s:-1,f:a.f+u.f,l:a,r:u};h!=r-1;)a=n[n[c].f<n[f].f?c++:f++],u=n[c!=h&&n[c].f<n[f].f?c++:f++],n[h++]={s:-1,f:a.f+u.f,l:a,r:u};var l=s[0].s;for(e=1;e<r;++e)s[e].s>l&&(l=s[e].s);var d=new C(l+1),v=vt(n[h-1],d,0);if(v>i){e=0;var m=0,w=v-i,p=1<<w;for(s.sort((function(t,i){return d[i.s]-d[t.s]||t.f-i.f}));e<r;++e){var b=s[e].s;if(!(d[b]>i))break;m+=p-(1<<v-d[b]),d[b]=i}for(m>>>=w;m>0;){var g=s[e].s;d[g]<i?m-=1<<i-d[g]++-1:++e}for(;e>=0&&m;--e){var N=s[e].s;d[N]==i&&(--d[N],++m)}v=i}return[new D(d),v]},vt=function(t,i,n){return-1==t.s?Math.max(vt(t.l,i,n+1),vt(t.r,i,n+1)):i[t.s]=n},mt=function(t){for(var i=t.length;i&&!t[--i];);for(var n=new C(++i),e=0,r=t[0],s=1,o=function(t){n[e++]=t},a=1;a<=i;++a)if(t[a]==r&&a!=i)++s;else{if(!r&&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(r),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(r);s=1,r=t[a]}return[n.subarray(0,e),i]},wt=function(t,i){for(var n=0,e=0;e<i.length;++e)n+=t[e]*i[e];return n},pt=function(t,i,n){var e=n.length,r=ct(i+2);t[r]=255&e,t[r+1]=e>>>8,t[r+2]=255^t[r],t[r+3]=255^t[r+1];for(var s=0;s<e;++s)t[r+s+4]=n[s];return 8*(r+4+e)},bt=function(t,i,n,e,r,s,o,a,u,c,h){ft(i,h++,n),++r[256];for(var f=dt(r,15),l=f[0],d=f[1],v=dt(s,15),m=v[0],w=v[1],p=mt(l),b=p[0],g=p[1],N=mt(m),L=N[0],y=N[1],A=new C(19),k=0;k<b.length;++k)A[31&b[k]]++;for(k=0;k<L.length;++k)A[31&L[k]]++;for(var S=dt(A,7),x=S[0],q=S[1],M=19;M>4&&!x[U[M-1]];--M);var j,E,P,I,F=c+5<<3,R=wt(r,tt)+wt(s,it)+o,O=wt(r,l)+wt(s,m)+o+14+3*M+wt(A,x)+(2*A[16]+3*A[17]+7*A[18]);if(F<=R&&F<=O)return pt(i,h,t.subarray(u,u+c));if(ft(i,h,1+(O<R)),h+=2,O<R){j=Z(l,d,0),E=l,P=Z(m,w,0),I=m;var B=Z(x,q,0);for(ft(i,h,g-257),ft(i,h+5,y-1),ft(i,h+10,M-4),h+=14,k=0;k<M;++k)ft(i,h+3*k,x[U[k]]);h+=3*M;for(var D=[b,L],T=0;T<2;++T){var V=D[T];for(k=0;k<V.length;++k)ft(i,h,B[W=31&V[k]]),h+=x[W],W>15&&(ft(i,h,V[k]>>>5&127),h+=V[k]>>>12)}}else j=nt,E=tt,P=rt,I=it;for(k=0;k<a;++k)if(e[k]>255){var W;lt(i,h,j[257+(W=e[k]>>>18&31)]),h+=E[W+257],W>7&&(ft(i,h,e[k]>>>23&31),h+=z[W]);var H=31&e[k];lt(i,h,P[H]),h+=I[H],H>3&&(lt(i,h,e[k]>>>5&8191),h+=_[H])}else lt(i,h,j[e[k]]),h+=E[e[k]];return lt(i,h,j[256]),h+E[256]},gt=new T([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Nt=new D(0);function Lt(t,i){void 0===i&&(i={});var n=function(){var t=1,i=0;return{p:function(n){for(var e=t,r=i,s=n.length,o=0;o!=s;){for(var a=Math.min(o+5552,s);o<a;++o)r+=e+=n[o];e%=65521,r%=65521}t=e,i=r},d:function(){return(t>>>8<<16|(255&i)<<8|i>>>8)+2*((255&t)<<23)}}}();n.p(t);var e=function(t,i,n,e,r){return function(t,i,n,e,r,s){var o=t.length,a=new D(e+o+5*(1+Math.floor(o/7e3))+r),u=a.subarray(e,a.length-r),c=0;if(!i||o<8)for(var h=0;h<=o;h+=65535){var f=h+65535;f<o?c=pt(u,c,t.subarray(h,f)):(u[h]=s,c=pt(u,c,t.subarray(h,o)))}else{for(var l=gt[i-1],d=l>>>13,v=8191&l,m=(1<<n)-1,w=new C(32768),p=new C(m+1),b=Math.ceil(n/3),g=2*b,N=function(i){return(t[i]^t[i+1]<<b^t[i+2]<<g)&m},L=new T(25e3),y=new C(288),A=new C(32),k=0,S=0,x=(h=0,0),q=0,M=0;h<o;++h){var j=N(h),E=32767&h,P=p[j];if(w[E]=P,p[j]=E,q<=h){var I=o-h;if((k>7e3||x>24576)&&I>423){c=bt(t,u,0,L,y,A,S,x,M,h-M,c),x=k=S=0,M=h;for(var F=0;F<286;++F)y[F]=0;for(F=0;F<30;++F)A[F]=0}var R=2,O=0,B=v,U=E-P&32767;if(I>2&&j==N(h-U))for(var V=Math.min(d,I)-1,W=Math.min(32767,h),H=Math.min(258,I);U<=W&&--B&&E!=P;){if(t[h+R]==t[h+R-U]){for(var J=0;J<H&&t[h+J]==t[h+J-U];++J);if(J>R){if(R=J,O=U,J>V)break;var Y=Math.min(U,J-2),X=0;for(F=0;F<Y;++F){var $=h-U+F+32768&32767,Q=$-w[$]+32768&32767;Q>X&&(X=Q,P=$)}}}U+=(E=P)-(P=w[E])+32768&32767}if(O){L[x++]=268435456|G[R]<<18|K[O];var Z=31&G[R],tt=31&K[O];S+=z[Z]+_[tt],++y[257+Z],++A[tt],q=h+R,++k}else L[x++]=t[h],++y[t[h]]}}c=bt(t,u,s,L,y,A,S,x,M,h-M,c),s||(c=pt(u,c,Nt))}return ht(a,0,e+ct(c)+r)}(t,null==i.level?6:i.level,null==i.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+i.mem,n,e,!r)}(t,i,2,4);return function(t,i){var n=i.level,e=0==n?0:n<6?1:9==n?3:2;t[0]=120,t[1]=e<<6|(e?32-2*e:1)}(e,i),function(t,i,n){for(;n;++i)t[i]=n,n>>>=8}(e,e.length-4,n.d()),e}
17
+ const P="actions-end",I=class{constructor(i){t(this,i),this.calciteNoticeClose=r(this,"calciteNoticeClose",6),this.calciteNoticeOpen=r(this,"calciteNoticeOpen",6),this.active=!1,this.open=!1,this.color="blue",this.dismissible=!1,this.closable=!1,this.intlClose="Close",this.scale="m",this.width="auto",this.close=()=>{this.open=!1,this.calciteNoticeClose.emit()}}activeHandler(t){this.open=t}openHandler(t){this.active=t}handleDismissible(t){this.closable=t}handleClosable(t){this.dismissible=t}updateRequestedIcon(){this.requestedIcon=o(c,this.icon,this.color)}connectedCallback(){h(this);const t=this.active||this.open;t&&(this.activeHandler(t),this.openHandler(t)),this.dismissible&&this.handleDismissible(this.dismissible),this.closable&&this.handleClosable(this.closable)}disconnectedCallback(){f(this)}componentWillLoad(){this.requestedIcon=o(c,this.icon,this.color)}render(){const{el:t}=this,n=i("button",{"aria-label":this.intlClose,class:"notice-close",onClick:this.close,ref:t=>this.closeButton=t},i("calcite-icon",{icon:"x",scale:"l"===this.scale?"m":"s"})),e=u(t,P);return i("div",{class:"container"},this.requestedIcon?i("div",{class:"notice-icon"},i("calcite-icon",{icon:this.requestedIcon,scale:"l"===this.scale?"m":"s"})):null,i("div",{class:"notice-content"},i("slot",{name:"title"}),i("slot",{name:"message"}),i("slot",{name:"link"})),e?i("div",{class:"actions-end"},i("slot",{name:P})):null,this.closable?n:null)}async setFocus(){const t=this.el.querySelector("calcite-link");(this.closeButton||t)&&(t?t.setFocus():this.closeButton&&this.closeButton.focus())}get el(){return e(this)}static get watchers(){return{active:["activeHandler"],open:["openHandler"],dismissible:["handleDismissible"],closable:["handleClosable"],icon:["updateRequestedIcon"],color:["updateRequestedIcon"]}}};I.style="@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0.01}}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing)}:host([hidden]){display:none}:host([scale=s]){--calcite-notice-spacing-token-small:0.5rem;--calcite-notice-spacing-token-large:0.75rem}:host([scale=s]) .container slot[name=title]::slotted(*),:host([scale=s]) .container *::slotted([slot=title]){margin-block:0.125rem;font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=s]) .container slot[name=message]::slotted(*),:host([scale=s]) .container *::slotted([slot=message]){margin-block:0.125rem;font-size:var(--calcite-font-size--2);line-height:1.375}:host([scale=s]) ::slotted(calcite-link){margin-block:0.125rem;font-size:var(--calcite-font-size--2);line-height:1.375}:host([scale=s]) .notice-close{padding:0.5rem}:host([scale=m]){--calcite-notice-spacing-token-small:0.75rem;--calcite-notice-spacing-token-large:1rem}:host([scale=m]) .container slot[name=title]::slotted(*),:host([scale=m]) .container *::slotted([slot=title]){margin-block:0.125rem;font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=m]) .container slot[name=message]::slotted(*),:host([scale=m]) .container *::slotted([slot=message]){margin-block:0.125rem;font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=m]) ::slotted(calcite-link){margin-block:0.125rem;font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=l]){--calcite-notice-spacing-token-small:1rem;--calcite-notice-spacing-token-large:1.25rem}:host([scale=l]) .container slot[name=title]::slotted(*),:host([scale=l]) .container *::slotted([slot=title]){margin-block:0.125rem;font-size:var(--calcite-font-size-1);line-height:1.375}:host([scale=l]) .container slot[name=message]::slotted(*),:host([scale=l]) .container *::slotted([slot=message]){margin-block:0.125rem;font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=l]) ::slotted(calcite-link){margin-block:0.125rem;font-size:var(--calcite-font-size-0);line-height:1.375}:host([width=auto]){--calcite-notice-width:auto}:host([width=half]){--calcite-notice-width:50%}:host([width=full]){--calcite-notice-width:100%}:host{margin-inline:auto;display:none;max-inline-size:100%;align-items:center;inline-size:var(--calcite-notice-width)}.container{pointer-events:none;margin-block:0px;box-sizing:border-box;display:none;inline-size:100%;background-color:var(--calcite-ui-foreground-1);opacity:0;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;max-block-size:0;text-align:start;-webkit-border-start:0px solid;border-inline-start:0px solid;box-shadow:0 0 0 0 transparent}.notice-close{outline-color:transparent}.notice-close:focus{outline:2px solid var(--calcite-ui-brand);outline-offset:-2px}:host{display:flex}:host([open]) .container{pointer-events:auto;display:flex;max-block-size:100%;align-items:center;border-width:2px;opacity:1;--tw-shadow:0 4px 8px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);--tw-shadow-colored:0 4px 8px -1px var(--tw-shadow-color), 0 2px 4px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.container slot[name=title]::slotted(*),.container *::slotted([slot=title]){margin:0px;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-1)}.container slot[name=message]::slotted(*),.container *::slotted([slot=message]){margin:0px;display:inline;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-ui-text-2);-webkit-margin-end:var(--calcite-notice-spacing-token-small);margin-inline-end:var(--calcite-notice-spacing-token-small)}.notice-content{box-sizing:border-box;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;padding-inline:var(--calcite-notice-spacing-token-large);flex:0 0 auto;display:flex;min-inline-size:0px;flex-direction:column;overflow-wrap:break-word;flex:1 1 0;padding-block:var(--calcite-notice-spacing-token-small);padding-inline:0 var(--calcite-notice-spacing-token-small)}.notice-content:first-of-type:not(:only-child){-webkit-padding-start:var(--calcite-notice-spacing-token-large);padding-inline-start:var(--calcite-notice-spacing-token-large)}.notice-content:only-of-type{padding-block:var(--calcite-notice-spacing-token-small);padding-inline:var(--calcite-notice-spacing-token-large)}.notice-icon{display:flex;align-items:center;box-sizing:border-box;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;padding-block:var(--calcite-notice-spacing-token-small);padding-inline:var(--calcite-notice-spacing-token-large);flex:0 0 auto}.notice-close{display:flex;cursor:pointer;align-items:center;align-self:stretch;border-style:none;background-color:transparent;color:var(--calcite-ui-text-3);outline:2px solid transparent;outline-offset:2px;box-sizing:border-box;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;padding-block:var(--calcite-notice-spacing-token-small);padding-inline:var(--calcite-notice-spacing-token-large);flex:0 0 auto;-webkit-appearance:none}.notice-close:hover,.notice-close:focus{background-color:var(--calcite-ui-foreground-2);color:var(--calcite-ui-text-1)}.notice-close:active{background-color:var(--calcite-ui-foreground-3)}.actions-end{display:flex;align-self:stretch}:host([color=blue]) .container{border-color:var(--calcite-ui-brand)}:host([color=blue]) .container .notice-icon{color:var(--calcite-ui-brand)}:host([color=red]) .container{border-color:var(--calcite-ui-danger)}:host([color=red]) .container .notice-icon{color:var(--calcite-ui-danger)}:host([color=yellow]) .container{border-color:var(--calcite-ui-warning)}:host([color=yellow]) .container .notice-icon{color:var(--calcite-ui-warning)}:host([color=green]) .container{border-color:var(--calcite-ui-success)}:host([color=green]) .container .notice-icon{color:var(--calcite-ui-success)}";const O=class{constructor(i){t(this,i),this.selectionSetChange=r(this,"selectionSetChange",7),this.sketchTypeChange=r(this,"sketchTypeChange",7),this.workflowTypeChange=r(this,"workflowTypeChange",7),this._selectedIds=[],this._selectionLabel="",this.bufferColor=[227,139,79,.8],this.bufferOutlineColor=[255,255,255],this.enabledLayerIds=[],this.defaultBufferDistance=void 0,this.defaultBufferUnit=void 0,this.geometries=void 0,this.isUpdate=!1,this.mapView=void 0,this.searchConfiguration=void 0,this.selectionSet=void 0,this.selectLayerView=void 0,this.showBufferTools=!0,this._layerSelectChecked=void 0,this._searchTerm=void 0,this._translations=void 0,this._workflowType=void 0}async watchGeometriesHandler(t,i){if(t!==i){if(t.length>0)return this._geomQuery(this.geometries);if(0===t.length)return this._clearResults(!0,!0)}}async watchSearchConfigurationHandler(t,i){JSON.stringify(t)!==JSON.stringify(i)&&this._initSearchWidget()}async workflowTypeHandler(t,i){t!==i&&(this.mapView.popup.autoOpenEnabled=["SELECT","SKETCH","REFINE"].indexOf(t)<0,this.workflowTypeChange.emit(t))}async clearSelection(){return this._clearResults()}async getSelection(){/\S+/gm.test(this._selectionLabel)||(this._selectionLabel=this._getSelectionBaseLabel());const t=this._selectionLabel===this._getSelectionBaseLabel();return{id:this.isUpdate?this.selectionSet.id:Date.now(),workflowType:this._workflowType,searchResult:this._searchResult,buffer:this._bufferGeometry,distance:this._bufferTools.distance,download:!0,unit:this._bufferTools.unit,label:this._selectionLabel&&!t?this._selectionLabel:`${this._selectionLabel} ${this._bufferTools.distance} ${this._bufferTools.unit}`,selectedIds:this._selectedIds,layerView:this.selectLayerView,geometries:this.geometries,refineSelectLayers:this._refineTools.layerViews}}labelChange(t){this._selectionLabel=t.detail}sketchGraphicsChange(t){this._updateSelection(b.SKETCH,t.detail,this._selectionLabel||this._translations.sketch)}refineSelectionGraphicsChange(t){const i=t.detail;this._updateSelection(b.SELECT,i,this._selectionLabel||this._translations.select);const n=Array.isArray(i)?i.map((t=>t.attributes[t.layer.objectIdField])):[];return this._highlightFeatures(n)}async componentWillLoad(){await this._getTranslations(),await this._initModules()}async componentDidLoad(){return this._init()}render(){var t,e,r;const s=this._workflowType===b.SEARCH,o=s?" div-visible-search":" div-not-visible",a=this._workflowType===b.SKETCH||this._workflowType===b.SELECT,u=this.showBufferTools?"search-distance":"div-not-visible",c=this._layerSelectChecked&&!s?" div-visible":" div-not-visible",h=this._layerSelectChecked||s?" div-not-visible":" div-visible",f=s?"div-not-visible":"div-visible";return i(n,null,i("div",{class:"padding-bottom-1"},i("calcite-radio-group",{class:"w-100",onCalciteRadioGroupChange:t=>this._workflowChange(t)},i("calcite-radio-group-item",{checked:s,class:"w-50 end-border",value:b.SEARCH},this._translations.search),i("calcite-radio-group-item",{checked:a,class:"w-50",value:b.SKETCH},this._translations.sketch))),i("div",{class:o},i("div",{class:"search-widget",ref:t=>{this._searchElement=t}})),i("div",{class:f},i("calcite-label",{layout:"inline"},i("calcite-checkbox",{checked:(null===(t=this.selectionSet)||void 0===t?void 0:t.workflowType)===b.SELECT,onCalciteCheckboxChange:()=>this._layerSelectChanged(),ref:t=>this._selectFromLayerElement=t}),"Use layer features")),i("div",{class:h},i("map-draw-tools",{active:!0,border:!0,mapView:this.mapView,ref:t=>{this._drawTools=t}})),i("div",{class:c},i("refine-selection-tools",{active:!0,border:!0,enabledLayerIds:this.enabledLayerIds,layerViews:this._refineSelectLayers,mapView:this.mapView,mode:g.ADD,ref:t=>{this._refineTools=t},refineMode:N.SUBSET})),i("calcite-label",{class:u},this._translations.searchDistance,i("buffer-tools",{distance:(null===(e=this.selectionSet)||void 0===e?void 0:e.distance)||this.defaultBufferDistance,geometries:this.geometries,onBufferComplete:t=>this._bufferComplete(t),ref:t=>this._bufferTools=t,unit:(null===(r=this.selectionSet)||void 0===r?void 0:r.unit)||this.defaultBufferUnit})),i("slot",null))}async _initModules(){const[t,i,n,e,r]=await l(["esri/layers/GraphicsLayer","esri/Graphic","esri/widgets/Search","esri/geometry/geometryEngine","esri/layers/FeatureLayer"]);this.GraphicsLayer=t,this.Graphic=i,this.Search=n,this._geometryEngine=e,this.FeatureLayer=r}async _init(){this._initGraphicsLayer(),this._initSelectionSet(),this._initSearchWidget()}_initSelectionSet(){var t,i,n,e,r,s,o;this.selectionSet?(this._searchTerm=null===(i=null===(t=this.selectionSet)||void 0===t?void 0:t.searchResult)||void 0===i?void 0:i.name,this._workflowType=null===(n=this.selectionSet)||void 0===n?void 0:n.workflowType,this._searchResult=null===(e=this.selectionSet)||void 0===e?void 0:e.searchResult,this._refineSelectLayers=null===(r=this.selectionSet)||void 0===r?void 0:r.refineSelectLayers,this.geometries=[...null===(s=this.selectionSet)||void 0===s?void 0:s.geometries],this._selectionLabel=(null===(o=this.selectionSet)||void 0===o?void 0:o.label)||this._getSelectionBaseLabel(),d(this.selectionSet.selectedIds,this.selectionSet.layerView,this.mapView,!1)):this._workflowType=b.SEARCH}_getSelectionBaseLabel(){var t,i;return this._workflowType===b.SKETCH?this._translations.sketch:this._workflowType===b.SELECT?this._translations.select:this._workflowType===b.SEARCH&&this._searchResult?null===(t=this._searchResult)||void 0===t?void 0:t.name:null===(i=this.selectionSet)||void 0===i?void 0:i.label}_initSearchWidget(){if(this.mapView&&this._searchElement){const t=this._getSearchConfig(this.searchConfiguration,this.mapView),i=Object.assign({view:this.mapView,container:this._searchElement,searchTerm:this._searchTerm},t);this._searchWidget=new this.Search(i),this._searchWidget.on("search-clear",(()=>{this._clearResults(!1)})),this._searchWidget.on("select-result",(t=>{var i;this._clearResults(!1),t.result&&(this._searchResult=t.result,this._updateSelection(b.SEARCH,[t.result.feature],null===(i=null==t?void 0:t.result)||void 0===i?void 0:i.name))}))}}_getSearchConfig(t,i){var n;const e=null==t?void 0:t.sources;return e&&e.forEach((t=>{var n,e,r;if(t.hasOwnProperty("layer")){const s=t,o=(null===(n=s.layer)||void 0===n?void 0:n.id)?i.map.findLayerById(s.layer.id):null;o?s.layer=o:(null===(e=null==s?void 0:s.layer)||void 0===e?void 0:e.url)&&(s.layer=new this.FeatureLayer(null===(r=null==s?void 0:s.layer)||void 0===r?void 0:r.url))}})),null===(n=null==t?void 0:t.sources)||void 0===n||n.forEach((t=>{if(t.hasOwnProperty("locator")){const i=t;i.url=i.url,delete i.url}})),t}_initGraphicsLayer(){const t=this._translations.bufferLayer,i=this.mapView.map.layers.findIndex((i=>i.title===t));if(i>-1)this._bufferGraphicsLayer=this.mapView.map.layers.getItemAt(i);else{this._bufferGraphicsLayer=new this.GraphicsLayer({title:t}),y.managedLayers.push(t);const i=this.mapView.map.layers.findIndex((t=>t.title===this._translations.sketchLayer));i>-1?this.mapView.map.layers.add(this._bufferGraphicsLayer,i):this.mapView.map.layers.add(this._bufferGraphicsLayer)}}_layerSelectChanged(){this._layerSelectChecked=this._selectFromLayerElement.checked,this.sketchTypeChange.emit(this._layerSelectChecked?L.LAYER:L.INTERACTIVE)}_workflowChange(t){this._workflowType=t.detail}async _highlightFeatures(t){var i;null===(i=y.highlightHandle)||void 0===i||i.remove(),t.length>0&&(y.highlightHandle=await v(t,this.selectLayerView,this.mapView)),this.selectionSetChange.emit(t.length)}async _selectFeatures(t){this._selectedIds=await m(t,this.selectLayerView.layer),this._drawTools.graphics=this.geometries.map((t=>{var i,n,e;const r={geometry:t,symbol:"point"===t.type?null===(i=this._drawTools)||void 0===i?void 0:i.pointSymbol:"polyline"===t.type?null===(n=this._drawTools)||void 0===n?void 0:n.polylineSymbol:"polygon"===t.type?null===(e=this._drawTools)||void 0===e?void 0:e.polygonSymbol:void 0};return new this.Graphic(r)})),this._highlightFeatures(this._selectedIds)}async _bufferComplete(t){if(this._bufferGeometry=Array.isArray(t.detail)?t.detail[0]:t.detail,this._bufferGeometry){const t=new this.Graphic({geometry:this._bufferGeometry,symbol:{type:"simple-fill",color:this.bufferColor,outline:{color:this.bufferOutlineColor,width:1}}});this._bufferGraphicsLayer.removeAll(),this._bufferGraphicsLayer.add(t),this._selectFeatures([this._bufferGeometry]),this.mapView.goTo(t.geometry.extent)}else this._bufferGraphicsLayer&&this._bufferGraphicsLayer.removeAll(),this._geomQuery(this.geometries)}_geomQuery(t){const i=w(t,this._geometryEngine);return this._selectFeatures(i)}async _clearResults(t=!0,i=!0){var n,e;this._selectedIds=[],i&&(this._selectionLabel=""),this._bufferGraphicsLayer&&this._bufferGraphicsLayer.removeAll(),t&&this._searchWidget&&this._searchWidget.clear(),null===(n=y.highlightHandle)||void 0===n||n.remove(),(null===(e=this._drawTools)||void 0===e?void 0:e.clear)&&this._drawTools.clear(),this.selectionSetChange.emit(this._selectedIds.length)}_updateSelection(t,i,n){this.geometries=Array.isArray(i)?i.map((t=>t.geometry)):this.geometries,this._workflowType=t,this._selectionLabel=n}async _getTranslations(){const t=await A(this.el);this._translations=t[0]}get el(){return e(this)}static get watchers(){return{geometries:["watchGeometriesHandler"],searchConfiguration:["watchSearchConfigurationHandler"],_workflowType:["workflowTypeHandler"]}}};O.style=':host{display:block}.div-visible{display:inherit}.div-visible-search{display:flex;height:44px;align-items:center;padding-bottom:0}.div-not-visible{display:none}.padding-bottom-1{padding-bottom:1rem}.search-widget{width:100% !important;border:1px solid var(--calcite-ui-border-input)}.w-100{width:100%}.w-50{width:50%}.search-distance-container{padding-top:"1rem" !important}.end-border{-webkit-border-end:1px solid var(--calcite-ui-border-2);border-inline-end:1px solid var(--calcite-ui-border-2)}.search-distance{display:flex;padding-top:1rem}';const F=Object.freeze({__proto__:null,default:[{descriptionPDF:{labelWidthDisplay:"2-5/8",labelHeightDisplay:"1",labelsPerPageDisplay:"30",averyPartNumber:"*60"},labelSpec:{type:"AVERY",pageProperties:{pageType:"ANSI A",leftMargin:.1875,rightMargin:.1875,topMargin:.5,bottomMargin:.5},numLabelsAcross:3,numLabelsDown:10,labelWidth:2.625,labelHeight:1,horizGapIn:.125,vertGapIn:0,labelPadding:.1,fontSizePx:11,maxNumLabelLines:4}},{descriptionPDF:{labelWidthDisplay:"4",labelHeightDisplay:"1",labelsPerPageDisplay:"20",averyPartNumber:"*61"},labelSpec:{type:"AVERY",pageProperties:{pageType:"ANSI A",leftMargin:.15625,rightMargin:.15625,topMargin:.47637821,bottomMargin:.5},numLabelsAcross:2,numLabelsDown:10,labelWidth:4,labelHeight:1.0025,horizGapIn:.1875,vertGapIn:0,labelPadding:.1,fontSizePx:11,maxNumLabelLines:4}},{descriptionPDF:{labelWidthDisplay:"4",labelHeightDisplay:"1-1/3",labelsPerPageDisplay:"14",averyPartNumber:"*62"},labelSpec:{type:"AVERY",pageProperties:{pageType:"ANSI A",leftMargin:.15625,rightMargin:.15625,topMargin:.81889808,bottomMargin:.83464612},numLabelsAcross:2,numLabelsDown:7,labelWidth:4,labelHeight:1.3352,horizGapIn:.1875,vertGapIn:0,labelPadding:.1,fontSizePx:11,maxNumLabelLines:6}},{descriptionPDF:{labelWidthDisplay:"4",labelHeightDisplay:"2",labelsPerPageDisplay:"10",averyPartNumber:"*63"},labelSpec:{type:"AVERY",pageProperties:{pageType:"ANSI A",leftMargin:.15625,rightMargin:.15625,topMargin:.5,bottomMargin:.5},numLabelsAcross:2,numLabelsDown:5,labelWidth:4,labelHeight:2,horizGapIn:.1875,vertGapIn:0,labelPadding:.1,fontSizePx:12,maxNumLabelLines:10}},{descriptionPDF:{labelWidthDisplay:"4",labelHeightDisplay:"3-1/3",labelsPerPageDisplay:"6",averyPartNumber:"*64"},labelSpec:{type:"AVERY",pageProperties:{pageType:"ANSI A",leftMargin:.15625,rightMargin:.15625,topMargin:.4724412,bottomMargin:.50000027},numLabelsAcross:2,numLabelsDown:3,labelWidth:4,labelHeight:3.342,horizGapIn:.1875,vertGapIn:0,labelPadding:.1,fontSizePx:14,maxNumLabelLines:12}},{descriptionPDF:{labelWidthDisplay:"1-3/4",labelHeightDisplay:"1/2",labelsPerPageDisplay:"80",averyPartNumber:"*67"},labelSpec:{type:"AVERY",pageProperties:{pageType:"ANSI A",leftMargin:.307086375,rightMargin:.307086375,topMargin:.4724412,bottomMargin:.49606326},numLabelsAcross:4,numLabelsDown:20,labelWidth:1.75,labelHeight:.50155,horizGapIn:.29527575,vertGapIn:0,labelPadding:.1,fontSizePx:8,maxNumLabelLines:3}},{descriptionPDF:{labelWidthDisplay:"1-3/4",labelHeightDisplay:"2/3",labelsPerPageDisplay:"60",averyPartNumber:"*95"},labelSpec:{type:"AVERY",pageProperties:{pageType:"ANSI A",leftMargin:.28936983,rightMargin:.28936983,topMargin:.53937037,bottomMargin:.5511814},numLabelsAcross:4,numLabelsDown:15,labelWidth:1.75,labelHeight:.6605,horizGapIn:.30708678,vertGapIn:0,labelPadding:.1,fontSizePx:8,maxNumLabelLines:4}}]});var R=S((function(t){function i(n){return t.exports=i="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,i(n)}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports}));const B=x(R);var C=Uint8Array,D=Uint16Array,T=Uint32Array,z=new C([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]),_=new C([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]),U=new C([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),V=function(t,i){for(var n=new D(31),e=0;e<31;++e)n[e]=i+=1<<t[e-1];var r=new T(n[30]);for(e=1;e<30;++e)for(var s=n[e];s<n[e+1];++s)r[s]=s-n[e]<<5|e;return[n,r]},W=V(z,2),H=W[0],G=W[1];H[28]=258,G[258]=28;for(var J=V(_,0),Y=J[0],K=J[1],X=new D(32768),$=0;$<32768;++$){var Q=(43690&$)>>>1|(21845&$)<<1;X[$]=((65280&(Q=(61680&(Q=(52428&Q)>>>2|(13107&Q)<<2))>>>4|(3855&Q)<<4))>>>8|(255&Q)<<8)>>>1}var Z=function(t,i,n){for(var e=t.length,r=0,s=new D(i);r<e;++r)++s[t[r]-1];var o,a=new D(i);for(r=0;r<i;++r)a[r]=a[r-1]+s[r-1]<<1;if(n){o=new D(1<<i);var u=15-i;for(r=0;r<e;++r)if(t[r])for(var c=r<<4|t[r],h=i-t[r],f=a[t[r]-1]++<<h,l=f|(1<<h)-1;f<=l;++f)o[X[f]>>>u]=c}else for(o=new D(e),r=0;r<e;++r)o[r]=X[a[t[r]-1]++]>>>15-t[r];return o},tt=new C(288);for($=0;$<144;++$)tt[$]=8;for($=144;$<256;++$)tt[$]=9;for($=256;$<280;++$)tt[$]=7;for($=280;$<288;++$)tt[$]=8;var it=new C(32);for($=0;$<32;++$)it[$]=5;var nt=Z(tt,9,0),et=Z(tt,9,1),rt=Z(it,5,0),st=Z(it,5,1),ot=function(t){for(var i=t[0],n=1;n<t.length;++n)t[n]>i&&(i=t[n]);return i},at=function(t,i,n){var e=i/8>>0;return(t[e]|t[e+1]<<8)>>>(7&i)&n},ut=function(t,i){var n=i/8>>0;return(t[n]|t[n+1]<<8|t[n+2]<<16)>>>(7&i)},ct=function(t){return(t/8>>0)+(7&t&&1)},ht=function(t,i,n){(null==i||i<0)&&(i=0),(null==n||n>t.length)&&(n=t.length);var e=new(t instanceof D?D:t instanceof T?T:C)(n-i);return e.set(t.subarray(i,n)),e},ft=function(t,i,n){var e=i/8>>0;t[e]|=n<<=7&i,t[e+1]|=n>>>8},lt=function(t,i,n){var e=i/8>>0;t[e]|=n<<=7&i,t[e+1]|=n>>>8,t[e+2]|=n>>>16},dt=function(t,i){for(var n=[],e=0;e<t.length;++e)t[e]&&n.push({s:e,f:t[e]});var r=n.length,s=n.slice();if(!r)return[new C(0),0];if(1==r){var o=new C(n[0].s+1);return o[n[0].s]=1,[o,1]}n.sort((function(t,i){return t.f-i.f})),n.push({s:-1,f:25001});var a=n[0],u=n[1],c=0,h=1,f=2;for(n[0]={s:-1,f:a.f+u.f,l:a,r:u};h!=r-1;)a=n[n[c].f<n[f].f?c++:f++],u=n[c!=h&&n[c].f<n[f].f?c++:f++],n[h++]={s:-1,f:a.f+u.f,l:a,r:u};var l=s[0].s;for(e=1;e<r;++e)s[e].s>l&&(l=s[e].s);var d=new D(l+1),v=vt(n[h-1],d,0);if(v>i){e=0;var m=0,w=v-i,p=1<<w;for(s.sort((function(t,i){return d[i.s]-d[t.s]||t.f-i.f}));e<r;++e){var b=s[e].s;if(!(d[b]>i))break;m+=p-(1<<v-d[b]),d[b]=i}for(m>>>=w;m>0;){var g=s[e].s;d[g]<i?m-=1<<i-d[g]++-1:++e}for(;e>=0&&m;--e){var N=s[e].s;d[N]==i&&(--d[N],++m)}v=i}return[new C(d),v]},vt=function(t,i,n){return-1==t.s?Math.max(vt(t.l,i,n+1),vt(t.r,i,n+1)):i[t.s]=n},mt=function(t){for(var i=t.length;i&&!t[--i];);for(var n=new D(++i),e=0,r=t[0],s=1,o=function(t){n[e++]=t},a=1;a<=i;++a)if(t[a]==r&&a!=i)++s;else{if(!r&&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(r),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(r);s=1,r=t[a]}return[n.subarray(0,e),i]},wt=function(t,i){for(var n=0,e=0;e<i.length;++e)n+=t[e]*i[e];return n},pt=function(t,i,n){var e=n.length,r=ct(i+2);t[r]=255&e,t[r+1]=e>>>8,t[r+2]=255^t[r],t[r+3]=255^t[r+1];for(var s=0;s<e;++s)t[r+s+4]=n[s];return 8*(r+4+e)},bt=function(t,i,n,e,r,s,o,a,u,c,h){ft(i,h++,n),++r[256];for(var f=dt(r,15),l=f[0],d=f[1],v=dt(s,15),m=v[0],w=v[1],p=mt(l),b=p[0],g=p[1],N=mt(m),L=N[0],y=N[1],A=new D(19),k=0;k<b.length;++k)A[31&b[k]]++;for(k=0;k<L.length;++k)A[31&L[k]]++;for(var S=dt(A,7),x=S[0],q=S[1],M=19;M>4&&!x[U[M-1]];--M);var j,E,P,I,O=c+5<<3,F=wt(r,tt)+wt(s,it)+o,R=wt(r,l)+wt(s,m)+o+14+3*M+wt(A,x)+(2*A[16]+3*A[17]+7*A[18]);if(O<=F&&O<=R)return pt(i,h,t.subarray(u,u+c));if(ft(i,h,1+(R<F)),h+=2,R<F){j=Z(l,d,0),E=l,P=Z(m,w,0),I=m;var B=Z(x,q,0);for(ft(i,h,g-257),ft(i,h+5,y-1),ft(i,h+10,M-4),h+=14,k=0;k<M;++k)ft(i,h+3*k,x[U[k]]);h+=3*M;for(var C=[b,L],T=0;T<2;++T){var V=C[T];for(k=0;k<V.length;++k)ft(i,h,B[W=31&V[k]]),h+=x[W],W>15&&(ft(i,h,V[k]>>>5&127),h+=V[k]>>>12)}}else j=nt,E=tt,P=rt,I=it;for(k=0;k<a;++k)if(e[k]>255){var W;lt(i,h,j[257+(W=e[k]>>>18&31)]),h+=E[W+257],W>7&&(ft(i,h,e[k]>>>23&31),h+=z[W]);var H=31&e[k];lt(i,h,P[H]),h+=I[H],H>3&&(lt(i,h,e[k]>>>5&8191),h+=_[H])}else lt(i,h,j[e[k]]),h+=E[e[k]];return lt(i,h,j[256]),h+E[256]},gt=new T([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Nt=new C(0);function Lt(t,i){void 0===i&&(i={});var n=function(){var t=1,i=0;return{p:function(n){for(var e=t,r=i,s=n.length,o=0;o!=s;){for(var a=Math.min(o+5552,s);o<a;++o)r+=e+=n[o];e%=65521,r%=65521}t=e,i=r},d:function(){return(t>>>8<<16|(255&i)<<8|i>>>8)+2*((255&t)<<23)}}}();n.p(t);var e=function(t,i,n,e,r){return function(t,i,n,e,r,s){var o=t.length,a=new C(e+o+5*(1+Math.floor(o/7e3))+r),u=a.subarray(e,a.length-r),c=0;if(!i||o<8)for(var h=0;h<=o;h+=65535){var f=h+65535;f<o?c=pt(u,c,t.subarray(h,f)):(u[h]=s,c=pt(u,c,t.subarray(h,o)))}else{for(var l=gt[i-1],d=l>>>13,v=8191&l,m=(1<<n)-1,w=new D(32768),p=new D(m+1),b=Math.ceil(n/3),g=2*b,N=function(i){return(t[i]^t[i+1]<<b^t[i+2]<<g)&m},L=new T(25e3),y=new D(288),A=new D(32),k=0,S=0,x=(h=0,0),q=0,M=0;h<o;++h){var j=N(h),E=32767&h,P=p[j];if(w[E]=P,p[j]=E,q<=h){var I=o-h;if((k>7e3||x>24576)&&I>423){c=bt(t,u,0,L,y,A,S,x,M,h-M,c),x=k=S=0,M=h;for(var O=0;O<286;++O)y[O]=0;for(O=0;O<30;++O)A[O]=0}var F=2,R=0,B=v,U=E-P&32767;if(I>2&&j==N(h-U))for(var V=Math.min(d,I)-1,W=Math.min(32767,h),H=Math.min(258,I);U<=W&&--B&&E!=P;){if(t[h+F]==t[h+F-U]){for(var J=0;J<H&&t[h+J]==t[h+J-U];++J);if(J>F){if(F=J,R=U,J>V)break;var Y=Math.min(U,J-2),X=0;for(O=0;O<Y;++O){var $=h-U+O+32768&32767,Q=$-w[$]+32768&32767;Q>X&&(X=Q,P=$)}}}U+=(E=P)-(P=w[E])+32768&32767}if(R){L[x++]=268435456|G[F]<<18|K[R];var Z=31&G[F],tt=31&K[R];S+=z[Z]+_[tt],++y[257+Z],++A[tt],q=h+F,++k}else L[x++]=t[h],++y[t[h]]}}c=bt(t,u,s,L,y,A,S,x,M,h-M,c),s||(c=pt(u,c,Nt))}return ht(a,0,e+ct(c)+r)}(t,null==i.level?6:i.level,null==i.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+i.mem,n,e,!r)}(t,i,2,4);return function(t,i){var n=i.level,e=0==n?0:n<6?1:9==n?3:2;t[0]=120,t[1]=e<<6|(e?32-2*e:1)}(e,i),function(t,i,n){for(;n;++i)t[i]=n,n>>>=8}(e,e.length-4,n.d()),e}
18
18
  /** @license
19
19
  *
20
20
  * jsPDF - PDF Document creation from JavaScript
@@ -79,7 +79,7 @@ var yt=function(){return"undefined"!=typeof window?window:"undefined"!=typeof gl
79
79
  * Accessed from: http://www.myersdaily.org/joseph/javascript/md5.js
80
80
  *
81
81
  * Modified by: Owen Leong
82
- */function It(t,i){var n=t[0],e=t[1],r=t[2],s=t[3];n=Rt(n,e,r,s,i[0],7,-680876936),s=Rt(s,n,e,r,i[1],12,-389564586),r=Rt(r,s,n,e,i[2],17,606105819),e=Rt(e,r,s,n,i[3],22,-1044525330),n=Rt(n,e,r,s,i[4],7,-176418897),s=Rt(s,n,e,r,i[5],12,1200080426),r=Rt(r,s,n,e,i[6],17,-1473231341),e=Rt(e,r,s,n,i[7],22,-45705983),n=Rt(n,e,r,s,i[8],7,1770035416),s=Rt(s,n,e,r,i[9],12,-1958414417),r=Rt(r,s,n,e,i[10],17,-42063),e=Rt(e,r,s,n,i[11],22,-1990404162),n=Rt(n,e,r,s,i[12],7,1804603682),s=Rt(s,n,e,r,i[13],12,-40341101),r=Rt(r,s,n,e,i[14],17,-1502002290),n=Ot(n,e=Rt(e,r,s,n,i[15],22,1236535329),r,s,i[1],5,-165796510),s=Ot(s,n,e,r,i[6],9,-1069501632),r=Ot(r,s,n,e,i[11],14,643717713),e=Ot(e,r,s,n,i[0],20,-373897302),n=Ot(n,e,r,s,i[5],5,-701558691),s=Ot(s,n,e,r,i[10],9,38016083),r=Ot(r,s,n,e,i[15],14,-660478335),e=Ot(e,r,s,n,i[4],20,-405537848),n=Ot(n,e,r,s,i[9],5,568446438),s=Ot(s,n,e,r,i[14],9,-1019803690),r=Ot(r,s,n,e,i[3],14,-187363961),e=Ot(e,r,s,n,i[8],20,1163531501),n=Ot(n,e,r,s,i[13],5,-1444681467),s=Ot(s,n,e,r,i[2],9,-51403784),r=Ot(r,s,n,e,i[7],14,1735328473),n=Bt(n,e=Ot(e,r,s,n,i[12],20,-1926607734),r,s,i[5],4,-378558),s=Bt(s,n,e,r,i[8],11,-2022574463),r=Bt(r,s,n,e,i[11],16,1839030562),e=Bt(e,r,s,n,i[14],23,-35309556),n=Bt(n,e,r,s,i[1],4,-1530992060),s=Bt(s,n,e,r,i[4],11,1272893353),r=Bt(r,s,n,e,i[7],16,-155497632),e=Bt(e,r,s,n,i[10],23,-1094730640),n=Bt(n,e,r,s,i[13],4,681279174),s=Bt(s,n,e,r,i[0],11,-358537222),r=Bt(r,s,n,e,i[3],16,-722521979),e=Bt(e,r,s,n,i[6],23,76029189),n=Bt(n,e,r,s,i[9],4,-640364487),s=Bt(s,n,e,r,i[12],11,-421815835),r=Bt(r,s,n,e,i[15],16,530742520),n=Dt(n,e=Bt(e,r,s,n,i[2],23,-995338651),r,s,i[0],6,-198630844),s=Dt(s,n,e,r,i[7],10,1126891415),r=Dt(r,s,n,e,i[14],15,-1416354905),e=Dt(e,r,s,n,i[5],21,-57434055),n=Dt(n,e,r,s,i[12],6,1700485571),s=Dt(s,n,e,r,i[3],10,-1894986606),r=Dt(r,s,n,e,i[10],15,-1051523),e=Dt(e,r,s,n,i[1],21,-2054922799),n=Dt(n,e,r,s,i[8],6,1873313359),s=Dt(s,n,e,r,i[15],10,-30611744),r=Dt(r,s,n,e,i[6],15,-1560198380),e=Dt(e,r,s,n,i[13],21,1309151649),n=Dt(n,e,r,s,i[4],6,-145523070),s=Dt(s,n,e,r,i[11],10,-1120210379),r=Dt(r,s,n,e,i[2],15,718787259),e=Dt(e,r,s,n,i[9],21,-343485551),t[0]=Ht(n,t[0]),t[1]=Ht(e,t[1]),t[2]=Ht(r,t[2]),t[3]=Ht(s,t[3])}function Ft(t,i,n,e,r,s){return i=Ht(Ht(i,t),Ht(e,s)),Ht(i<<r|i>>>32-r,n)}function Rt(t,i,n,e,r,s,o){return Ft(i&n|~i&e,t,i,r,s,o)}function Ot(t,i,n,e,r,s,o){return Ft(i&e|n&~e,t,i,r,s,o)}function Bt(t,i,n,e,r,s,o){return Ft(i^n^e,t,i,r,s,o)}function Dt(t,i,n,e,r,s,o){return Ft(n^(i|~e),t,i,r,s,o)}function Ct(t){var i,n=t.length,e=[1732584193,-271733879,-1732584194,271733878];for(i=64;i<=t.length;i+=64)It(e,Tt(t.substring(i-64,i)));t=t.substring(i-64);var r=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(i=0;i<t.length;i++)r[i>>2]|=t.charCodeAt(i)<<(i%4<<3);if(r[i>>2]|=128<<(i%4<<3),i>55)for(It(e,r),i=0;i<16;i++)r[i]=0;return r[14]=8*n,It(e,r),e}function Tt(t){var i,n=[];for(i=0;i<64;i+=4)n[i>>2]=t.charCodeAt(i)+(t.charCodeAt(i+1)<<8)+(t.charCodeAt(i+2)<<16)+(t.charCodeAt(i+3)<<24);return n}Mt=yt.atob.bind(yt),jt=yt.btoa.bind(yt);var zt="0123456789abcdef".split("");function _t(t){for(var i="",n=0;n<4;n++)i+=zt[t>>8*n+4&15]+zt[t>>8*n&15];return i}function Ut(t){return String.fromCharCode((255&t)>>0,(65280&t)>>8,(16711680&t)>>16,(4278190080&t)>>24)}function Vt(t){return Ct(t).map(Ut).join("")}var Wt="5d41402abc4b2a76b9719d911017c592"!=function(t){for(var i=0;i<t.length;i++)t[i]=_t(t[i]);return t.join("")}(Ct("hello"));function Ht(t,i){if(Wt){var n=(65535&t)+(65535&i);return(t>>16)+(i>>16)+(n>>16)<<16|65535&n}return t+i&4294967295}
82
+ */function It(t,i){var n=t[0],e=t[1],r=t[2],s=t[3];n=Ft(n,e,r,s,i[0],7,-680876936),s=Ft(s,n,e,r,i[1],12,-389564586),r=Ft(r,s,n,e,i[2],17,606105819),e=Ft(e,r,s,n,i[3],22,-1044525330),n=Ft(n,e,r,s,i[4],7,-176418897),s=Ft(s,n,e,r,i[5],12,1200080426),r=Ft(r,s,n,e,i[6],17,-1473231341),e=Ft(e,r,s,n,i[7],22,-45705983),n=Ft(n,e,r,s,i[8],7,1770035416),s=Ft(s,n,e,r,i[9],12,-1958414417),r=Ft(r,s,n,e,i[10],17,-42063),e=Ft(e,r,s,n,i[11],22,-1990404162),n=Ft(n,e,r,s,i[12],7,1804603682),s=Ft(s,n,e,r,i[13],12,-40341101),r=Ft(r,s,n,e,i[14],17,-1502002290),n=Rt(n,e=Ft(e,r,s,n,i[15],22,1236535329),r,s,i[1],5,-165796510),s=Rt(s,n,e,r,i[6],9,-1069501632),r=Rt(r,s,n,e,i[11],14,643717713),e=Rt(e,r,s,n,i[0],20,-373897302),n=Rt(n,e,r,s,i[5],5,-701558691),s=Rt(s,n,e,r,i[10],9,38016083),r=Rt(r,s,n,e,i[15],14,-660478335),e=Rt(e,r,s,n,i[4],20,-405537848),n=Rt(n,e,r,s,i[9],5,568446438),s=Rt(s,n,e,r,i[14],9,-1019803690),r=Rt(r,s,n,e,i[3],14,-187363961),e=Rt(e,r,s,n,i[8],20,1163531501),n=Rt(n,e,r,s,i[13],5,-1444681467),s=Rt(s,n,e,r,i[2],9,-51403784),r=Rt(r,s,n,e,i[7],14,1735328473),n=Bt(n,e=Rt(e,r,s,n,i[12],20,-1926607734),r,s,i[5],4,-378558),s=Bt(s,n,e,r,i[8],11,-2022574463),r=Bt(r,s,n,e,i[11],16,1839030562),e=Bt(e,r,s,n,i[14],23,-35309556),n=Bt(n,e,r,s,i[1],4,-1530992060),s=Bt(s,n,e,r,i[4],11,1272893353),r=Bt(r,s,n,e,i[7],16,-155497632),e=Bt(e,r,s,n,i[10],23,-1094730640),n=Bt(n,e,r,s,i[13],4,681279174),s=Bt(s,n,e,r,i[0],11,-358537222),r=Bt(r,s,n,e,i[3],16,-722521979),e=Bt(e,r,s,n,i[6],23,76029189),n=Bt(n,e,r,s,i[9],4,-640364487),s=Bt(s,n,e,r,i[12],11,-421815835),r=Bt(r,s,n,e,i[15],16,530742520),n=Ct(n,e=Bt(e,r,s,n,i[2],23,-995338651),r,s,i[0],6,-198630844),s=Ct(s,n,e,r,i[7],10,1126891415),r=Ct(r,s,n,e,i[14],15,-1416354905),e=Ct(e,r,s,n,i[5],21,-57434055),n=Ct(n,e,r,s,i[12],6,1700485571),s=Ct(s,n,e,r,i[3],10,-1894986606),r=Ct(r,s,n,e,i[10],15,-1051523),e=Ct(e,r,s,n,i[1],21,-2054922799),n=Ct(n,e,r,s,i[8],6,1873313359),s=Ct(s,n,e,r,i[15],10,-30611744),r=Ct(r,s,n,e,i[6],15,-1560198380),e=Ct(e,r,s,n,i[13],21,1309151649),n=Ct(n,e,r,s,i[4],6,-145523070),s=Ct(s,n,e,r,i[11],10,-1120210379),r=Ct(r,s,n,e,i[2],15,718787259),e=Ct(e,r,s,n,i[9],21,-343485551),t[0]=Ht(n,t[0]),t[1]=Ht(e,t[1]),t[2]=Ht(r,t[2]),t[3]=Ht(s,t[3])}function Ot(t,i,n,e,r,s){return i=Ht(Ht(i,t),Ht(e,s)),Ht(i<<r|i>>>32-r,n)}function Ft(t,i,n,e,r,s,o){return Ot(i&n|~i&e,t,i,r,s,o)}function Rt(t,i,n,e,r,s,o){return Ot(i&e|n&~e,t,i,r,s,o)}function Bt(t,i,n,e,r,s,o){return Ot(i^n^e,t,i,r,s,o)}function Ct(t,i,n,e,r,s,o){return Ot(n^(i|~e),t,i,r,s,o)}function Dt(t){var i,n=t.length,e=[1732584193,-271733879,-1732584194,271733878];for(i=64;i<=t.length;i+=64)It(e,Tt(t.substring(i-64,i)));t=t.substring(i-64);var r=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(i=0;i<t.length;i++)r[i>>2]|=t.charCodeAt(i)<<(i%4<<3);if(r[i>>2]|=128<<(i%4<<3),i>55)for(It(e,r),i=0;i<16;i++)r[i]=0;return r[14]=8*n,It(e,r),e}function Tt(t){var i,n=[];for(i=0;i<64;i+=4)n[i>>2]=t.charCodeAt(i)+(t.charCodeAt(i+1)<<8)+(t.charCodeAt(i+2)<<16)+(t.charCodeAt(i+3)<<24);return n}Mt=yt.atob.bind(yt),jt=yt.btoa.bind(yt);var zt="0123456789abcdef".split("");function _t(t){for(var i="",n=0;n<4;n++)i+=zt[t>>8*n+4&15]+zt[t>>8*n&15];return i}function Ut(t){return String.fromCharCode((255&t)>>0,(65280&t)>>8,(16711680&t)>>16,(4278190080&t)>>24)}function Vt(t){return Dt(t).map(Ut).join("")}var Wt="5d41402abc4b2a76b9719d911017c592"!=function(t){for(var i=0;i<t.length;i++)t[i]=_t(t[i]);return t.join("")}(Dt("hello"));function Ht(t,i){if(Wt){var n=(65535&t)+(65535&i);return(t>>16)+(i>>16)+(n>>16)<<16|65535&n}return t+i&4294967295}
83
83
  /**
84
84
  * @license
85
85
  * FPDF is released under a permissive license: there is no usage restriction.
@@ -98,7 +98,7 @@ var yt=function(){return"undefined"!=typeof window?window:"undefined"!=typeof gl
98
98
  * https://www.cs.cmu.edu/~dst/Adobe/Gallery/anon21jul01-pdf-encryption.txt
99
99
  * https://github.com/foliojs/pdfkit/blob/master/lib/security.js
100
100
  * http://www.fpdf.org/en/script/script37.php
101
- */var Jt={print:4,modify:8,copy:16,"annot-forms":32};function Yt(t,i,n,e){this.v=1,this.r=2;var r=192;t.forEach((function(t){if(void 0!==Jt.perm)throw new Error("Invalid permission: "+t);r+=Jt[t]})),this.padding="(¿N^NuŠAd\0NVÿú\b..\0¶Ðh>€/\f©þdSiz";var s=(i+this.padding).substr(0,32),o=(n+this.padding).substr(0,32);this.O=this.processOwnerPassword(s,o),this.P=-(1+(255^r)),this.encryptionKey=Vt(s+this.O+this.lsbFirstWord(this.P)+this.hexToBytes(e)).substr(0,5),this.U=Gt(this.encryptionKey,this.padding)}function Kt(t){if(/[^\u0000-\u00ff]/.test(t))throw new Error("Invalid PDF Name Object: "+t+", Only accept ASCII characters.");for(var i="",n=t.length,e=0;e<n;e++){var r=t.charCodeAt(e);i+=r<33||35===r||37===r||40===r||41===r||47===r||60===r||62===r||91===r||93===r||123===r||125===r||r>126?"#"+("0"+r.toString(16)).slice(-2):t[e]}return i}function Xt(t){if("object"!==B(t))throw new Error("Invalid Context passed to initialize PubSub (jsPDF-module)");var i={};this.subscribe=function(t,n,e){if(e=e||!1,"string"!=typeof t||"function"!=typeof n||"boolean"!=typeof e)throw new Error("Invalid arguments passed to PubSub.subscribe (jsPDF-module)");i.hasOwnProperty(t)||(i[t]={});var r=Math.random().toString(35);return i[t][r]=[n,!!e],r},this.unsubscribe=function(t){for(var n in i)if(i[n][t])return delete i[n][t],0===Object.keys(i[n]).length&&delete i[n],!0;return!1},this.publish=function(n){if(i.hasOwnProperty(n)){var e=Array.prototype.slice.call(arguments,1),r=[];for(var s in i[n]){var o=i[n][s];try{o[0].apply(t,e)}catch(n){yt.console&&kt.error("jsPDF PubSub Error",n.message,n)}o[1]&&r.push(s)}r.length&&r.forEach(this.unsubscribe)}},this.getTopics=function(){return i}}function $t(t){if(!(this instanceof $t))return new $t(t);var i="opacity,stroke-opacity".split(",");for(var n in t)t.hasOwnProperty(n)&&i.indexOf(n)>=0&&(this[n]=t[n]);this.id="",this.objectNumber=-1}function Qt(t,i){this.gState=t,this.matrix=i,this.id="",this.objectNumber=-1}function Zt(t,i,n,e,r){if(!(this instanceof Zt))return new Zt(t,i,n,e,r);this.type="axial"===t?2:3,this.coords=i,this.colors=n,Qt.call(this,e,r)}function ti(t,i,n,e,r){if(!(this instanceof ti))return new ti(t,i,n,e,r);this.boundingBox=t,this.xStep=i,this.yStep=n,this.stream="",this.cloneIndex=0,Qt.call(this,e,r)}function ii(t){var i,n="string"==typeof arguments[0]?arguments[0]:"p",e=arguments[1],r=arguments[2],s=arguments[3],o=[],a=1,u=16,c="S",h=null;"object"===B(t=t||{})&&(n=t.orientation,e=t.unit||e,r=t.format||r,s=t.compress||t.compressPdf||s,null!==(h=t.encryption||null)&&(h.userPassword=h.userPassword||"",h.ownerPassword=h.ownerPassword||"",h.userPermissions=h.userPermissions||[]),a="number"==typeof t.userUnit?Math.abs(t.userUnit):1,void 0!==t.precision&&(i=t.precision),void 0!==t.floatPrecision&&(u=t.floatPrecision),c=t.defaultPathOperation||"S"),o=t.filters||(!0===s?["FlateEncode"]:o),e=e||"mm",n=(""+(n||"P")).toLowerCase();var f=t.putOnlyUsedFonts||!1,l={},d={internal:{},__private__:{}};d.__private__.PubSub=Xt;var v="1.3",m=d.__private__.getPdfVersion=function(){return v};d.__private__.setPdfVersion=function(t){v=t};var w={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 w};var p=d.__private__.getPageFormat=function(t){return w[t]};r=r||"a4";var b={COMPAT:"compat",ADVANCED:"advanced"},g=b.COMPAT;function N(){this.saveGraphicsState(),Z(new Ct(vt,0,0,-vt,0,zn()*vt).toString()+" cm"),this.setFontSize(this.getFontSize()/vt),c="n",g=b.ADVANCED}function L(){this.restoreGraphicsState(),c="S",g=b.COMPAT}var y=d.__private__.combineFontStyleAndFontWeight=function(t,i){if("bold"==t&&"normal"==i||"bold"==t&&400==i||"normal"==t&&"italic"==i||"bold"==t&&"italic"==i)throw new Error("Invalid Combination of fontweight and fontstyle");return i&&(t=400==i||"normal"===i?"italic"===t?"italic":"normal":700!=i&&"bold"!==i||"normal"!==t?(700==i?"bold":i)+""+t:"bold"),t};d.advancedAPI=function(t){var i=g===b.COMPAT;return i&&N.call(this),"function"!=typeof t||(t(this),i&&L.call(this)),this},d.compatAPI=function(t){var i=g===b.ADVANCED;return i&&L.call(this),"function"!=typeof t||(t(this),i&&N.call(this)),this},d.isAdvancedAPI=function(){return g===b.ADVANCED};var A,k=function(t){if(g!==b.ADVANCED)throw new Error(t+" is only available in 'advanced' API mode. You need to call advancedAPI() first.")},S=d.roundToPrecision=d.__private__.roundToPrecision=function(t,n){var e=i||n;if(isNaN(t)||isNaN(e))throw new Error("Invalid argument passed to jsPDF.roundToPrecision");return t.toFixed(e).replace(/0+$/,"")};A=d.hpf=d.__private__.hpf="number"==typeof u?function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.hpf");return S(t,u)}:"smart"===u?function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.hpf");return S(t,t>-1&&t<1?16:5)}:function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.hpf");return S(t,16)};var x=d.f2=d.__private__.f2=function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.f2");return S(t,2)},q=d.__private__.f3=function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.f3");return S(t,3)},M=d.scale=d.__private__.scale=function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.scale");return g===b.COMPAT?t*vt:g===b.ADVANCED?t:void 0},j=function(t){return g===b.COMPAT?zn()-t:g===b.ADVANCED?t:void 0},E=function(t){return M(j(t))};d.__private__.setPrecision=d.setPrecision=function(t){"number"==typeof parseInt(t,10)&&(i=parseInt(t,10))};var P,I="00000000000000000000000000000000",F=d.__private__.getFileId=function(){return I},R=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!==h&&(Ji=new Yt(h.userPermissions,h.userPassword,h.ownerPassword,I)),I};d.setFileId=function(t){return R(t),this},d.getFileId=function(){return F()};var O=d.__private__.convertDateToPDFDate=function(t){var i=t.getTimezoneOffset(),n=i<0?"+":"-",e=Math.floor(Math.abs(i/60)),r=Math.abs(i%60),s=[n,_(e),"'",_(r),"'"].join("");return["D:",t.getFullYear(),_(t.getMonth()+1),_(t.getDate()),_(t.getHours()),_(t.getMinutes()),_(t.getSeconds()),s].join("")},D=d.__private__.convertPDFDateToDate=function(t){var i=parseInt(t.substr(2,4),10),n=parseInt(t.substr(6,2),10)-1,e=parseInt(t.substr(8,2),10),r=parseInt(t.substr(10,2),10),s=parseInt(t.substr(12,2),10),o=parseInt(t.substr(14,2),10);return new Date(i,n,e,r,s,o,0)},C=d.__private__.setCreationDate=function(t){var i;if(void 0===t&&(t=new Date),t instanceof Date)i=O(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");i=t}return P=i},T=d.__private__.getCreationDate=function(t){var i=P;return"jsDate"===t&&(i=D(P)),i};d.setCreationDate=function(t){return C(t),this},d.getCreationDate=function(t){return T(t)};var z,_=d.__private__.padd2=function(t){return("0"+parseInt(t)).slice(-2)},U=d.__private__.padd2Hex=function(t){return("00"+(t=t.toString())).substr(t.length)},V=0,W=[],H=[],G=0,J=[],Y=[],K=!1,X=H,$=function(){V=0,G=0,H=[],W=[],J=[],Gt=Vt(),Jt=Vt()};d.__private__.setCustomOutputDestination=function(t){K=!0,X=t};var Q=function(t){K||(X=t)};d.__private__.resetCustomOutputDestination=function(){K=!1,X=H};var Z=d.__private__.out=function(t){return t=t.toString(),G+=t.length+1,X.push(t),X},tt=d.__private__.write=function(t){return Z(1===arguments.length?t.toString():Array.prototype.join.call(arguments," "))},it=d.__private__.getArrayBuffer=function(t){for(var i=t.length,n=new ArrayBuffer(i),e=new Uint8Array(n);i--;)e[i]=t.charCodeAt(i);return n},nt=[["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 nt};var et=t.fontSize||16;d.__private__.setFontSize=d.setFontSize=function(t){return et=g===b.ADVANCED?t/vt:t,this};var rt,st=d.__private__.getFontSize=d.getFontSize=function(){return g===b.COMPAT?et:et*vt},ot=t.R2L||!1;d.__private__.setR2L=d.setR2L=function(t){return ot=t,this},d.__private__.getR2L=d.getR2L=function(){return ot};var at,ut=d.__private__.setZoomMode=function(t){if(/^(?:\d+\.\d*|\d*\.\d+|\d+)%$/.test(t))rt=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.');rt=t}else rt=parseInt(t,10)};d.__private__.getZoomMode=function(){return rt};var ct,ht=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.');at=t};d.__private__.getPageMode=function(){return at};var ft=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.');ct=t};d.__private__.getLayoutMode=function(){return ct},d.__private__.setDisplayMode=d.setDisplayMode=function(t,i,n){return ut(t),ft(i),ht(n),this};var lt={title:"",subject:"",author:"",keywords:"",creator:""};d.__private__.getDocumentProperty=function(t){if(-1===Object.keys(lt).indexOf(t))throw new Error("Invalid argument passed to jsPDF.getDocumentProperty");return lt[t]},d.__private__.getDocumentProperties=function(){return lt},d.__private__.setDocumentProperties=d.setProperties=d.setDocumentProperties=function(t){for(var i in lt)lt.hasOwnProperty(i)&&t[i]&&(lt[i]=t[i]);return this},d.__private__.setDocumentProperty=function(t,i){if(-1===Object.keys(lt).indexOf(t))throw new Error("Invalid arguments passed to jsPDF.setDocumentProperty");return lt[t]=i};var dt,vt,mt,wt,pt,bt={},gt={},Nt=[],Lt={},At={},St={},xt={},qt=null,Mt=0,It=[],Ft=new Xt(d),Rt=t.hotfixes||[],Ot={},Bt={},Dt=[],Ct=function t(i,n,e,r,s,o){if(!(this instanceof t))return new t(i,n,e,r,s,o);isNaN(i)&&(i=1),isNaN(n)&&(n=0),isNaN(e)&&(e=0),isNaN(r)&&(r=1),isNaN(s)&&(s=0),isNaN(o)&&(o=0),this._matrix=[i,n,e,r,s,o]};Object.defineProperty(Ct.prototype,"sx",{get:function(){return this._matrix[0]},set:function(t){this._matrix[0]=t}}),Object.defineProperty(Ct.prototype,"shy",{get:function(){return this._matrix[1]},set:function(t){this._matrix[1]=t}}),Object.defineProperty(Ct.prototype,"shx",{get:function(){return this._matrix[2]},set:function(t){this._matrix[2]=t}}),Object.defineProperty(Ct.prototype,"sy",{get:function(){return this._matrix[3]},set:function(t){this._matrix[3]=t}}),Object.defineProperty(Ct.prototype,"tx",{get:function(){return this._matrix[4]},set:function(t){this._matrix[4]=t}}),Object.defineProperty(Ct.prototype,"ty",{get:function(){return this._matrix[5]},set:function(t){this._matrix[5]=t}}),Object.defineProperty(Ct.prototype,"a",{get:function(){return this._matrix[0]},set:function(t){this._matrix[0]=t}}),Object.defineProperty(Ct.prototype,"b",{get:function(){return this._matrix[1]},set:function(t){this._matrix[1]=t}}),Object.defineProperty(Ct.prototype,"c",{get:function(){return this._matrix[2]},set:function(t){this._matrix[2]=t}}),Object.defineProperty(Ct.prototype,"d",{get:function(){return this._matrix[3]},set:function(t){this._matrix[3]=t}}),Object.defineProperty(Ct.prototype,"e",{get:function(){return this._matrix[4]},set:function(t){this._matrix[4]=t}}),Object.defineProperty(Ct.prototype,"f",{get:function(){return this._matrix[5]},set:function(t){this._matrix[5]=t}}),Object.defineProperty(Ct.prototype,"rotation",{get:function(){return Math.atan2(this.shx,this.sx)}}),Object.defineProperty(Ct.prototype,"scaleX",{get:function(){return this.decompose().scale.sx}}),Object.defineProperty(Ct.prototype,"scaleY",{get:function(){return this.decompose().scale.sy}}),Object.defineProperty(Ct.prototype,"isIdentity",{get:function(){return 1===this.sx&&0===this.shy&&0===this.shx&&1===this.sy&&0===this.tx&&0===this.ty}}),Ct.prototype.join=function(t){return[this.sx,this.shy,this.shx,this.sy,this.tx,this.ty].map(A).join(t)},Ct.prototype.multiply=function(t){return new Ct(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)},Ct.prototype.decompose=function(){var t=this.sx,i=this.shy,n=this.shx,e=this.sy,r=this.tx,s=this.ty,o=Math.sqrt(t*t+i*i),a=(t/=o)*n+(i/=o)*e;n-=t*a,e-=i*a;var u=Math.sqrt(n*n+e*e);return a/=u,t*(e/=u)<i*(n/=u)&&(t=-t,i=-i,a=-a,o=-o),{scale:new Ct(o,0,0,u,0,0),translate:new Ct(1,0,0,1,r,s),rotate:new Ct(t,i,-i,t,0,0),skew:new Ct(1,0,a,1,0,0)}},Ct.prototype.toString=function(){return this.join(" ")},Ct.prototype.inversed=function(){var t=this.sx,i=this.shy,n=this.shx,e=this.sy,r=this.tx,s=this.ty,o=1/(t*e-i*n),a=e*o,u=-i*o,c=-n*o,h=t*o;return new Ct(a,u,c,h,-a*r-c*s,-u*r-h*s)},Ct.prototype.applyToPoint=function(t){return new In(t.x*this.sx+t.y*this.shx+this.tx,t.x*this.shy+t.y*this.sy+this.ty)},Ct.prototype.applyToRectangle=function(t){var i=this.applyToPoint(t),n=this.applyToPoint(new In(t.x+t.w,t.y+t.h));return new Fn(i.x,i.y,n.x-i.x,n.y-i.y)},Ct.prototype.clone=function(){return new Ct(this.sx,this.shy,this.shx,this.sy,this.tx,this.ty)},d.Matrix=Ct;var Tt=d.matrixMult=function(t,i){return i.multiply(t)},zt=new Ct(1,0,0,1,0,0);d.unitMatrix=d.identityMatrix=zt;var _t=function(t,i){if(!At[t]){var n=(i instanceof Zt?"Sh":"P")+(Object.keys(Lt).length+1).toString(10);i.id=n,At[t]=n,Lt[n]=i,Ft.publish("addPattern",i)}};d.ShadingPattern=Zt,d.TilingPattern=ti,d.addShadingPattern=function(t,i){return k("addShadingPattern()"),_t(t,i),this},d.beginTilingPattern=function(t){k("beginTilingPattern()"),On(t.boundingBox[0],t.boundingBox[1],t.boundingBox[2]-t.boundingBox[0],t.boundingBox[3]-t.boundingBox[1],t.matrix)},d.endTilingPattern=function(t,i){k("endTilingPattern()"),i.stream=Y[z].join("\n"),_t(t,i),Ft.publish("endTilingPattern",i),Dt.pop().restore()};var Ut=d.__private__.newObject=function(){var t=Vt();return Wt(t,!0),t},Vt=d.__private__.newObjectDeferred=function(){return V++,W[V]=function(){return G},V},Wt=function(t,i){return i="boolean"==typeof i&&i,W[t]=G,i&&Z(t+" 0 obj"),t},Ht=d.__private__.newAdditionalObject=function(){var t={objId:Vt(),content:""};return J.push(t),t},Gt=Vt(),Jt=Vt(),Qt=d.__private__.decodeColorString=function(t){var i=t.split(" ");if(2!==i.length||"g"!==i[1]&&"G"!==i[1])5!==i.length||"k"!==i[4]&&"K"!==i[4]||(i=[(1-i[0])*(1-i[3]),(1-i[1])*(1-i[3]),(1-i[2])*(1-i[3]),"r"]);else{var n=parseFloat(i[0]);i=[n,n,n,"r"]}for(var e="#",r=0;r<3;r++)e+=("0"+Math.floor(255*parseFloat(i[r])).toString(16)).slice(-2);return e},ni=d.__private__.encodeColorString=function(t){var i;"string"==typeof t&&(t={ch1:t});var n=t.ch1,e=t.ch2,r=t.ch3,s=t.ch4,o="draw"===t.pdfColorType?["G","RG","K"]:["g","rg","k"];if("string"==typeof n&&"#"!==n.charAt(0)){var a=new Pt(n);if(a.ok)n=a.toHex();else if(!/^\d*\.?\d*$/.test(n))throw new Error('Invalid color "'+n+'" passed to jsPDF.encodeColorString.')}if("string"==typeof n&&/^#[0-9A-Fa-f]{3}$/.test(n)&&(n="#"+n[1]+n[1]+n[2]+n[2]+n[3]+n[3]),"string"==typeof n&&/^#[0-9A-Fa-f]{6}$/.test(n)){var u=parseInt(n.substr(1),16);n=u>>16&255,e=u>>8&255,r=255&u}if(void 0===e||void 0===s&&n===e&&e===r)i="string"==typeof n?n+" "+o[0]:2===t.precision?x(n/255)+" "+o[0]:q(n/255)+" "+o[0];else if(void 0===s||"object"===B(s)){if(s&&!isNaN(s.a)&&0===s.a)return["1.","1.","1.",o[1]].join(" ");i="string"==typeof n?[n,e,r,o[1]].join(" "):2===t.precision?[x(n/255),x(e/255),x(r/255),o[1]].join(" "):[q(n/255),q(e/255),q(r/255),o[1]].join(" ")}else i="string"==typeof n?[n,e,r,s,o[2]].join(" "):2===t.precision?[x(n),x(e),x(r),x(s),o[2]].join(" "):[q(n),q(e),q(r),q(s),o[2]].join(" ");return i},ei=d.__private__.getFilters=function(){return o},ri=d.__private__.putStream=function(t){var i=(t=t||{}).data||"",n=t.filters||ei(),e=t.alreadyAppliedFilters||[],r=t.addLength1||!1,s=i.length,o=t.objectId,a=function(t){return t};if(null!==h&&void 0===o)throw new Error("ObjectId must be passed to putStream for file encryption");null!==h&&(a=Ji.encryptor(o,0));var u={};!0===n&&(n=["FlateEncode"]);var c=t.additionalKeyValues||[],f=(u=void 0!==ii.API.processDataByFilters?ii.API.processDataByFilters(i,n):{data:i,reverseChain:[]}).reverseChain+(Array.isArray(e)?e.join(" "):e.toString());if(0!==u.data.length&&(c.push({key:"Length",value:u.data.length}),!0===r&&c.push({key:"Length1",value:s})),0!=f.length)if(f.split("/").length-1==1)c.push({key:"Filter",value:f});else{c.push({key:"Filter",value:"["+f+"]"});for(var l=0;l<c.length;l+=1)if("DecodeParms"===c[l].key){for(var d=[],v=0;v<u.reverseChain.split("/").length-1;v+=1)d.push("null");d.push(c[l].value),c[l].value="["+d.join(" ")+"]"}}Z("<<");for(var m=0;m<c.length;m++)Z("/"+c[m].key+" "+c[m].value);Z(">>"),0!==u.data.length&&(Z("stream"),Z(a(u.data)),Z("endstream"))},si=d.__private__.putPage=function(t){var i=t.number,n=t.data,e=t.objId,r=t.contentsObjId;Wt(e,!0),Z("<</Type /Page"),Z("/Parent "+t.rootDictionaryObjId+" 0 R"),Z("/Resources "+t.resourceDictionaryObjId+" 0 R"),Z("/MediaBox ["+parseFloat(A(t.mediaBox.bottomLeftX))+" "+parseFloat(A(t.mediaBox.bottomLeftY))+" "+A(t.mediaBox.topRightX)+" "+A(t.mediaBox.topRightY)+"]"),null!==t.cropBox&&Z("/CropBox ["+A(t.cropBox.bottomLeftX)+" "+A(t.cropBox.bottomLeftY)+" "+A(t.cropBox.topRightX)+" "+A(t.cropBox.topRightY)+"]"),null!==t.bleedBox&&Z("/BleedBox ["+A(t.bleedBox.bottomLeftX)+" "+A(t.bleedBox.bottomLeftY)+" "+A(t.bleedBox.topRightX)+" "+A(t.bleedBox.topRightY)+"]"),null!==t.trimBox&&Z("/TrimBox ["+A(t.trimBox.bottomLeftX)+" "+A(t.trimBox.bottomLeftY)+" "+A(t.trimBox.topRightX)+" "+A(t.trimBox.topRightY)+"]"),null!==t.artBox&&Z("/ArtBox ["+A(t.artBox.bottomLeftX)+" "+A(t.artBox.bottomLeftY)+" "+A(t.artBox.topRightX)+" "+A(t.artBox.topRightY)+"]"),"number"==typeof t.userUnit&&1!==t.userUnit&&Z("/UserUnit "+t.userUnit),Ft.publish("putPage",{objId:e,pageContext:It[i],pageNumber:i,page:n}),Z("/Contents "+r+" 0 R"),Z(">>"),Z("endobj");var s=n.join("\n");return g===b.ADVANCED&&(s+="\nQ"),Wt(r,!0),ri({data:s,filters:ei(),objectId:r}),Z("endobj"),e},oi=d.__private__.putPages=function(){var t,i,n=[];for(t=1;t<=Mt;t++)It[t].objId=Vt(),It[t].contentsObjId=Vt();for(t=1;t<=Mt;t++)n.push(si({number:t,data:Y[t],objId:It[t].objId,contentsObjId:It[t].contentsObjId,mediaBox:It[t].mediaBox,cropBox:It[t].cropBox,bleedBox:It[t].bleedBox,trimBox:It[t].trimBox,artBox:It[t].artBox,userUnit:It[t].userUnit,rootDictionaryObjId:Gt,resourceDictionaryObjId:Jt}));Wt(Gt,!0),Z("<</Type /Pages");var e="/Kids [";for(i=0;i<Mt;i++)e+=n[i]+" 0 R ";Z(e+"]"),Z("/Count "+Mt),Z(">>"),Z("endobj"),Ft.publish("postPutPages")},ai=function(t){Ft.publish("putFont",{font:t,out:Z,newObject:Ut,putStream:ri}),!0!==t.isAlreadyPutted&&(t.objectNumber=Ut(),Z("<<"),Z("/Type /Font"),Z("/BaseFont /"+Kt(t.postScriptName)),Z("/Subtype /Type1"),"string"==typeof t.encoding&&Z("/Encoding /"+t.encoding),Z("/FirstChar 32"),Z("/LastChar 255"),Z(">>"),Z("endobj"))},ui=function(){for(var t in bt)bt.hasOwnProperty(t)&&(!1===f||!0===f&&l.hasOwnProperty(t))&&ai(bt[t])},ci=function(t){t.objectNumber=Ut();var i=[];i.push({key:"Type",value:"/XObject"}),i.push({key:"Subtype",value:"/Form"}),i.push({key:"BBox",value:"["+[A(t.x),A(t.y),A(t.x+t.width),A(t.y+t.height)].join(" ")+"]"}),i.push({key:"Matrix",value:"["+t.matrix.toString()+"]"});var n=t.pages[1].join("\n");ri({data:n,additionalKeyValues:i,objectId:t.objectNumber}),Z("endobj")},hi=function(){for(var t in Ot)Ot.hasOwnProperty(t)&&ci(Ot[t])},fi=function(t,i){var n,e=[],r=1/(i-1);for(n=0;n<1;n+=r)e.push(n);e.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<e.length;a++){for(n=e[a];n>t[o+1].offset;)o++;var u=t[o].offset,c=(n-u)/(t[o+1].offset-u),h=t[o].color,f=t[o+1].color;s+=U(Math.round((1-c)*h[0]+c*f[0]).toString(16))+U(Math.round((1-c)*h[1]+c*f[1]).toString(16))+U(Math.round((1-c)*h[2]+c*f[2]).toString(16))}return s.trim()},li=function(t,i){i||(i=21);var n=Ut(),e=fi(t.colors,i),r=[];r.push({key:"FunctionType",value:"0"}),r.push({key:"Domain",value:"[0.0 1.0]"}),r.push({key:"Size",value:"["+i+"]"}),r.push({key:"BitsPerSample",value:"8"}),r.push({key:"Range",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),r.push({key:"Decode",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),ri({data:e,additionalKeyValues:r,alreadyAppliedFilters:["/ASCIIHexDecode"],objectId:n}),Z("endobj"),t.objectNumber=Ut(),Z("<< /ShadingType "+t.type),Z("/ColorSpace /DeviceRGB");var s="/Coords ["+A(parseFloat(t.coords[0]))+" "+A(parseFloat(t.coords[1]))+" ";s+=2===t.type?A(parseFloat(t.coords[2]))+" "+A(parseFloat(t.coords[3])):A(parseFloat(t.coords[2]))+" "+A(parseFloat(t.coords[3]))+" "+A(parseFloat(t.coords[4]))+" "+A(parseFloat(t.coords[5])),Z(s+="]"),t.matrix&&Z("/Matrix ["+t.matrix.toString()+"]"),Z("/Function "+n+" 0 R"),Z("/Extend [true true]"),Z(">>"),Z("endobj")},di=function(t,i){var n=Vt(),e=Ut();i.push({resourcesOid:n,objectOid:e}),t.objectNumber=e;var r=[];r.push({key:"Type",value:"/Pattern"}),r.push({key:"PatternType",value:"1"}),r.push({key:"PaintType",value:"1"}),r.push({key:"TilingType",value:"1"}),r.push({key:"BBox",value:"["+t.boundingBox.map(A).join(" ")+"]"}),r.push({key:"XStep",value:A(t.xStep)}),r.push({key:"YStep",value:A(t.yStep)}),r.push({key:"Resources",value:n+" 0 R"}),t.matrix&&r.push({key:"Matrix",value:"["+t.matrix.toString()+"]"}),ri({data:t.stream,additionalKeyValues:r,objectId:t.objectNumber}),Z("endobj")},vi=function(t){var i;for(i in Lt)Lt.hasOwnProperty(i)&&(Lt[i]instanceof Zt?li(Lt[i]):Lt[i]instanceof ti&&di(Lt[i],t))},mi=function(t){for(var i in t.objectNumber=Ut(),Z("<<"),t)switch(i){case"opacity":Z("/ca "+x(t[i]));break;case"stroke-opacity":Z("/CA "+x(t[i]))}Z(">>"),Z("endobj")},wi=function(){var t;for(t in St)St.hasOwnProperty(t)&&mi(St[t])},pi=function(){for(var t in Z("/XObject <<"),Ot)Ot.hasOwnProperty(t)&&Ot[t].objectNumber>=0&&Z("/"+t+" "+Ot[t].objectNumber+" 0 R");Ft.publish("putXobjectDict"),Z(">>")},bi=function(){Ji.oid=Ut(),Z("<<"),Z("/Filter /Standard"),Z("/V "+Ji.v),Z("/R "+Ji.r),Z("/U <"+Ji.toHexString(Ji.U)+">"),Z("/O <"+Ji.toHexString(Ji.O)+">"),Z("/P "+Ji.P),Z(">>"),Z("endobj")},gi=function(){for(var t in Z("/Font <<"),bt)bt.hasOwnProperty(t)&&(!1===f||!0===f&&l.hasOwnProperty(t))&&Z("/"+t+" "+bt[t].objectNumber+" 0 R");Z(">>")},Ni=function(){if(Object.keys(Lt).length>0){for(var t in Z("/Shading <<"),Lt)Lt.hasOwnProperty(t)&&Lt[t]instanceof Zt&&Lt[t].objectNumber>=0&&Z("/"+t+" "+Lt[t].objectNumber+" 0 R");Ft.publish("putShadingPatternDict"),Z(">>")}},Li=function(t){if(Object.keys(Lt).length>0){for(var i in Z("/Pattern <<"),Lt)Lt.hasOwnProperty(i)&&Lt[i]instanceof d.TilingPattern&&Lt[i].objectNumber>=0&&Lt[i].objectNumber<t&&Z("/"+i+" "+Lt[i].objectNumber+" 0 R");Ft.publish("putTilingPatternDict"),Z(">>")}},yi=function(){if(Object.keys(St).length>0){var t;for(t in Z("/ExtGState <<"),St)St.hasOwnProperty(t)&&St[t].objectNumber>=0&&Z("/"+t+" "+St[t].objectNumber+" 0 R");Ft.publish("putGStateDict"),Z(">>")}},Ai=function(t){Wt(t.resourcesOid,!0),Z("<<"),Z("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),gi(),Ni(),Li(t.objectOid),yi(),pi(),Z(">>"),Z("endobj")},ki=function(){var t=[];ui(),wi(),hi(),vi(t),Ft.publish("putResources"),t.forEach(Ai),Ai({resourcesOid:Jt,objectOid:Number.MAX_SAFE_INTEGER}),Ft.publish("postPutResources")},Si=function(){Ft.publish("putAdditionalObjects");for(var t=0;t<J.length;t++){var i=J[t];Wt(i.objId,!0),Z(i.content),Z("endobj")}Ft.publish("postPutAdditionalObjects")},xi=function(t){gt[t.fontName]=gt[t.fontName]||{},gt[t.fontName][t.fontStyle]=t.id},qi=function(t,i,n,e,r){var s={id:"F"+(Object.keys(bt).length+1).toString(10),postScriptName:t,fontName:i,fontStyle:n,encoding:e,isStandardFont:r||!1,metadata:{}};return Ft.publish("addFont",{font:s,instance:this}),bt[s.id]=s,xi(s),s.id},Mi=function(t){for(var i=0,n=nt.length;i<n;i++){var e=qi.call(this,t[i][0],t[i][1],t[i][2],nt[i][3],!0);!1===f&&(l[e]=!0);var r=t[i][0].split("-");xi({id:e,fontName:r[0],fontStyle:r[1]||""})}Ft.publish("addFonts",{fonts:bt,dictionary:gt})},ji=function(t){return t.foo=function(){try{return t.apply(this,arguments)}catch(t){var i=t.stack||"";~i.indexOf(" at ")&&(i=i.split(" at ")[1]);var n="Error in function "+i.split("\n")[0].split("<")[0]+": "+t.message;if(!yt.console)throw new Error(n);yt.console.error(n,t),yt.alert&&alert(n)}},t.foo.bar=t,t.foo},Ei=function(t,i){var n,e,r,s,o,a,u,c,h;if(r=(i=i||{}).sourceEncoding||"Unicode",o=i.outputEncoding,(i.autoencode||o)&&bt[dt].metadata&&bt[dt].metadata[r]&&bt[dt].metadata[r].encoding&&(s=bt[dt].metadata[r].encoding,!o&&bt[dt].encoding&&(o=bt[dt].encoding),!o&&s.codePages&&(o=s.codePages[0]),"string"==typeof o&&(o=s[o]),o)){for(u=!1,a=[],n=0,e=t.length;n<e;n++)(c=o[t.charCodeAt(n)])?a.push(String.fromCharCode(c)):a.push(t[n]),a[n].charCodeAt(0)>>8&&(u=!0);t=a.join("")}for(n=t.length;void 0===u&&0!==n;)t.charCodeAt(n-1)>>8&&(u=!0),n--;if(!u)return t;for(a=i.noBOM?[]:[254,255],n=0,e=t.length;n<e;n++){if((h=(c=t.charCodeAt(n))>>8)>>8)throw new Error("Character at position "+n+" of string '"+t+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");a.push(h),a.push(c-(h<<8))}return String.fromCharCode.apply(void 0,a)},Pi=d.__private__.pdfEscape=d.pdfEscape=function(t,i){return Ei(t,i).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},Ii=d.__private__.beginPage=function(t){Y[++Mt]=[],It[Mt]={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])}},Oi(Mt),Q(Y[z])},Fi=function(t,i){var e,s,o;switch(n=i||n,"string"==typeof t&&(e=p(t.toLowerCase()),Array.isArray(e)&&(s=e[0],o=e[1])),Array.isArray(t)&&(s=t[0]*vt,o=t[1]*vt),isNaN(s)&&(s=r[0],o=r[1]),(s>14400||o>14400)&&(kt.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)),r=[s,o],n.substr(0,1)){case"l":o>s&&(r=[o,s]);break;case"p":s>o&&(r=[o,s])}Ii(r),mn(dn),Z(An),0!==jn&&Z(jn+" J"),0!==En&&Z(En+" j"),Ft.publish("addPage",{pageNumber:Mt})},Ri=function(t){t>0&&t<=Mt&&(Y.splice(t,1),It.splice(t,1),Mt--,z>Mt&&(z=Mt),this.setPage(z))},Oi=function(t){t>0&&t<=Mt&&(z=t)},Bi=d.__private__.getNumberOfPages=d.getNumberOfPages=function(){return Y.length-1},Di=function(t,i,n){var e,r=void 0;return n=n||{},i=void 0!==i?i:bt[dt].fontStyle,e=(t=void 0!==t?t:bt[dt].fontName).toLowerCase(),void 0!==gt[e]&&void 0!==gt[e][i]?r=gt[e][i]:void 0!==gt[t]&&void 0!==gt[t][i]?r=gt[t][i]:!1===n.disableWarning&&kt.warn("Unable to look up font label for font '"+t+"', '"+i+"'. Refer to getFontList() for available fonts."),r||n.noFallback||null==(r=gt.times[i])&&(r=gt.times.normal),r},Ci=d.__private__.putInfo=function(){var t=Ut(),i=function(t){return t};for(var n in null!==h&&(i=Ji.encryptor(t,0)),Z("<<"),Z("/Producer ("+Pi(i("jsPDF "+ii.version))+")"),lt)lt.hasOwnProperty(n)&&lt[n]&&Z("/"+n.substr(0,1).toUpperCase()+n.substr(1)+" ("+Pi(i(lt[n]))+")");Z("/CreationDate ("+Pi(i(P))+")"),Z(">>"),Z("endobj")},Ti=d.__private__.putCatalog=function(t){var i=(t=t||{}).rootDictionaryObjId||Gt;switch(Ut(),Z("<<"),Z("/Type /Catalog"),Z("/Pages "+i+" 0 R"),rt||(rt="fullwidth"),rt){case"fullwidth":Z("/OpenAction [3 0 R /FitH null]");break;case"fullheight":Z("/OpenAction [3 0 R /FitV null]");break;case"fullpage":Z("/OpenAction [3 0 R /Fit]");break;case"original":Z("/OpenAction [3 0 R /XYZ null null 1]");break;default:var n=""+rt;"%"===n.substr(n.length-1)&&(rt=parseInt(rt)/100),"number"==typeof rt&&Z("/OpenAction [3 0 R /XYZ null null "+x(rt)+"]")}switch(ct||(ct="continuous"),ct){case"continuous":Z("/PageLayout /OneColumn");break;case"single":Z("/PageLayout /SinglePage");break;case"two":case"twoleft":Z("/PageLayout /TwoColumnLeft");break;case"tworight":Z("/PageLayout /TwoColumnRight")}at&&Z("/PageMode /"+at),Ft.publish("putCatalog"),Z(">>"),Z("endobj")},zi=d.__private__.putTrailer=function(){Z("trailer"),Z("<<"),Z("/Size "+(V+1)),Z("/Root "+V+" 0 R"),Z("/Info "+(V-1)+" 0 R"),null!==h&&Z("/Encrypt "+Ji.oid+" 0 R"),Z("/ID [ <"+I+"> <"+I+"> ]"),Z(">>")},_i=d.__private__.putHeader=function(){Z("%PDF-"+v),Z("%ºß¬à")},Ui=d.__private__.putXRef=function(){var t="0000000000";Z("xref"),Z("0 "+(V+1)),Z("0000000000 65535 f ");for(var i=1;i<=V;i++)Z("function"==typeof W[i]?(t+W[i]()).slice(-10)+" 00000 n ":void 0!==W[i]?(t+W[i]).slice(-10)+" 00000 n ":"0000000000 00000 n ")},Vi=d.__private__.buildDocument=function(){$(),Q(H),Ft.publish("buildDocument"),_i(),oi(),Si(),ki(),null!==h&&bi(),Ci(),Ti();var t=G;return Ui(),zi(),Z("startxref"),Z(""+t),Z("%%EOF"),Q(Y[z]),H.join("\n")},Wi=d.__private__.getBlob=function(t){return new Blob([it(t)],{type:"application/pdf"})},Hi=d.output=d.__private__.output=ji((function(t,i){switch("string"==typeof(i=i||{})?i={filename:i}:i.filename=i.filename||"generated.pdf",t){case void 0:return Vi();case"save":d.save(i.filename);break;case"arraybuffer":return it(Vi());case"blob":return Wi(Vi());case"bloburi":case"bloburl":if(void 0!==yt.URL&&"function"==typeof yt.URL.createObjectURL)return yt.URL&&yt.URL.createObjectURL(Wi(Vi()))||void 0;kt.warn("bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.");break;case"datauristring":case"dataurlstring":var n="",e=Vi();try{n=jt(e)}catch(t){n=jt(unescape(encodeURIComponent(e)))}return"data:application/pdf;filename="+i.filename+";base64,"+n;case"pdfobjectnewwindow":if("[object Window]"===Object.prototype.toString.call(yt)){var r="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"';i.pdfObjectUrl&&(r=i.pdfObjectUrl,s="");var o='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><script src="'+r+'"'+s+'><\/script><script >PDFObject.embed("'+this.output("dataurlstring")+'", '+JSON.stringify(i)+");<\/script></body></html>",a=yt.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(yt)){var u='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><iframe id="pdfViewer" src="'+(i.pdfJsUrl||"examples/PDF.js/web/viewer.html")+"?file=&downloadName="+i.filename+'" width="500px" height="400px" /></body></html>',c=yt.open();if(null!==c){c.document.write(u);var h=this;c.document.documentElement.querySelector("#pdfViewer").onload=function(){c.document.title=i.filename,c.document.documentElement.querySelector("#pdfViewer").contentWindow.PDFViewerApplication.open(h.output("bloburl"))}}return c}throw new Error("The option pdfjsnewwindow just works in a browser-environment.");case"dataurlnewwindow":if("[object Window]"!==Object.prototype.toString.call(yt))throw new Error("The option dataurlnewwindow just works in a browser-environment.");var f='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><iframe src="'+this.output("datauristring",i)+'"></iframe></body></html>',l=yt.open();if(null!==l&&(l.document.write(f),l.document.title=i.filename),l||"undefined"==typeof safari)return l;break;case"datauri":case"dataurl":return yt.document.location.href=this.output("datauristring",i);default:return null}})),Gi=function(t){return!0===Array.isArray(Rt)&&Rt.indexOf(t)>-1};switch(e){case"pt":vt=1;break;case"mm":vt=72/25.4;break;case"cm":vt=72/2.54;break;case"in":vt=72;break;case"px":vt=1==Gi("px_scaling")?.75:96/72;break;case"pc":case"em":vt=12;break;case"ex":vt=6;break;default:if("number"!=typeof e)throw new Error("Invalid unit: "+e);vt=e}var Ji=null;C(),R();var Yi=function(t){return null!==h?Ji.encryptor(t,0):function(t){return t}},Ki=d.__private__.getPageInfo=d.getPageInfo=function(t){if(isNaN(t)||t%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfo");return{objId:It[t].objId,pageNumber:t,pageContext:It[t]}},Xi=d.__private__.getPageInfoByObjId=function(t){if(isNaN(t)||t%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfoByObjId");for(var i in It)if(It[i].objId===t)break;return Ki(i)},$i=d.__private__.getCurrentPageInfo=d.getCurrentPageInfo=function(){return{objId:It[z].objId,pageNumber:z,pageContext:It[z]}};d.addPage=function(){return Fi.apply(this,arguments),this},d.setPage=function(){return Oi.apply(this,arguments),Q.call(this,Y[z]),this},d.insertPage=function(t){return this.addPage(),this.movePage(z,t),this},d.movePage=function(t,i){var n,e;if(t>i){n=Y[t],e=It[t];for(var r=t;r>i;r--)Y[r]=Y[r-1],It[r]=It[r-1];Y[i]=n,It[i]=e,this.setPage(i)}else if(t<i){n=Y[t],e=It[t];for(var s=t;s<i;s++)Y[s]=Y[s+1],It[s]=It[s+1];Y[i]=n,It[i]=e,this.setPage(i)}return this},d.deletePage=function(){return Ri.apply(this,arguments),this},d.__private__.text=d.text=function(t,i,n,e,r){var s,o,a,u,c,h,f,d,v,m=(e=e||{}).scope||this;if("number"==typeof t&&"number"==typeof i&&("string"==typeof n||Array.isArray(n))){var w=n;n=i,i=t,t=w}if(arguments[3]instanceof Ct==0?(a=arguments[4],u=arguments[5],"object"===B(f=arguments[3])&&null!==f||("string"==typeof a&&(u=a,a=null),"string"==typeof f&&(u=f,f=null),"number"==typeof f&&(a=f,f=null),e={flags:f,angle:a,align:u})):(k("The transform parameter of text() with a Matrix value"),v=r),isNaN(i)||isNaN(n)||null==t)throw new Error("Invalid arguments passed to jsPDF.text");if(0===t.length)return m;var p="",N=!1,L="number"==typeof e.lineHeightFactor?e.lineHeightFactor:ln,y=m.internal.scaleFactor;function S(t){return t=t.split("\t").join(Array(e.TabLen||9).join(" ")),Pi(t,f)}function x(t){for(var i,n=t.concat(),e=[],r=n.length;r--;)"string"==typeof(i=n.shift())?e.push(i):Array.isArray(t)&&(1===i.length||void 0===i[1]&&void 0===i[2])?e.push(i[0]):e.push([i[0],i[1],i[2]]);return e}function q(t,i){var n;if("string"==typeof t)n=i(t)[0];else if(Array.isArray(t)){for(var e,r,s=t.concat(),o=[],a=s.length;a--;)"string"==typeof(e=s.shift())?o.push(i(e)[0]):Array.isArray(e)&&"string"==typeof e[0]&&(r=i(e[0],e[1],e[2]),o.push([r[0],r[1],r[2]]));n=o}return n}var j=!1,E=!0;if("string"==typeof t)j=!0;else if(Array.isArray(t)){var P=t.concat();o=[];for(var I,F=P.length;F--;)("string"!=typeof(I=P.shift())||Array.isArray(I)&&"string"!=typeof I[0])&&(E=!1);j=E}if(!1===j)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 R=et/m.internal.scaleFactor,O=R*(L-1);switch(e.baseline){case"bottom":n-=O;break;case"top":n+=R-O;break;case"hanging":n+=R-2*O;break;case"middle":n+=R/2-O}if((h=e.maxWidth||0)>0&&("string"==typeof t?t=m.splitTextToSize(t,h):"[object Array]"===Object.prototype.toString.call(t)&&(t=t.reduce((function(t,i){return t.concat(m.splitTextToSize(i,h))}),[]))),Ft.publish("preProcessText",s={text:t,x:i,y:n,options:e,mutex:{pdfEscape:Pi,activeFontKey:dt,fonts:bt,activeFontSize:et}}),t=s.text,a=(e=s.options).angle,v instanceof Ct==0&&a&&"number"==typeof a){a*=Math.PI/180,0===e.rotationDirection&&(a=-a),g===b.ADVANCED&&(a=-a);var D=Math.cos(a),C=Math.sin(a);v=new Ct(D,C,-C,D,0,0)}else a&&a instanceof Ct&&(v=a);g!==b.ADVANCED||v||(v=zt),void 0!==(c=e.charSpace||qn)&&(p+=A(M(c))+" Tc\n",this.setCharSpace(this.getCharSpace()||0)),void 0!==(d=e.horizontalScale)&&(p+=A(100*d)+" Tz\n");var T=-1,z=void 0!==e.renderingMode?e.renderingMode:e.stroke,_=m.internal.getCurrentPageInfo().pageContext;switch(z){case 0:case!1:case"fill":T=0;break;case 1:case!0:case"stroke":T=1;break;case 2:case"fillThenStroke":T=2;break;case 3:case"invisible":T=3;break;case 4:case"fillAndAddForClipping":T=4;break;case 5:case"strokeAndAddPathForClipping":T=5;break;case 6:case"fillThenStrokeAndAddToPathForClipping":T=6;break;case 7:case"addToPathForClipping":T=7}var U=void 0!==_.usedRenderingMode?_.usedRenderingMode:-1;-1!==T?p+=T+" Tr\n":-1!==U&&(p+="0 Tr\n"),-1!==T&&(_.usedRenderingMode=T),u=e.align||"left";var V,W=et*L,H=m.internal.pageSize.getWidth(),G=bt[dt];c=e.charSpace||qn,h=e.maxWidth||0,f=Object.assign({autoencode:!0,noBOM:!0},e.flags);var J=[];if("[object Array]"===Object.prototype.toString.call(t)){var Y;o=x(t),"left"!==u&&(V=o.map((function(t){return m.getStringUnitWidth(t,{font:G,charSpace:c,fontSize:et,doKerning:!1})*et/y})));var K,X=0;if("right"===u){i-=V[0],t=[],F=o.length;for(var $=0;$<F;$++)0===$?(K=gn(i),Y=Nn(n)):(K=M(X-V[$]),Y=-W),t.push([o[$],K,Y]),X=V[$]}else if("center"===u){i-=V[0]/2,t=[],F=o.length;for(var Q=0;Q<F;Q++)0===Q?(K=gn(i),Y=Nn(n)):(K=M((X-V[Q])/2),Y=-W),t.push([o[Q],K,Y]),X=V[Q]}else if("left"===u){t=[],F=o.length;for(var tt=0;tt<F;tt++)t.push(o[tt])}else{if("justify"!==u)throw new Error('Unrecognized alignment option, use "left", "center", "right" or "justify".');t=[],F=o.length,h=0!==h?h:H;for(var it=0;it<F;it++)Y=0===it?Nn(n):-W,K=0===it?gn(i):0,J.push(it<F-1?A(M((h-V[it])/(o[it].split(" ").length-1))):0),t.push([o[it],K,Y])}}var nt="boolean"==typeof e.R2L?e.R2L:ot;!0===nt&&(t=q(t,(function(t,i,n){return[t.split("").reverse().join(""),i,n]}))),Ft.publish("postProcessText",s={text:t,x:i,y:n,options:e,mutex:{pdfEscape:Pi,activeFontKey:dt,fonts:bt,activeFontSize:et}}),t=s.text,N=s.mutex.isHex||!1;var rt=bt[dt].encoding;"WinAnsiEncoding"!==rt&&"StandardEncoding"!==rt||(t=q(t,(function(t,i,n){return[S(t),i,n]}))),o=x(t),t=[];for(var st,at,ut,ct=0,ht=1,ft=Array.isArray(o[0])?ht:ct,lt="",vt=function(t,i,n){var r="";return n instanceof Ct?(n="number"==typeof e.angle?Tt(n,new Ct(1,0,0,1,t,i)):Tt(new Ct(1,0,0,1,t,i),n),g===b.ADVANCED&&(n=Tt(new Ct(1,0,0,-1,0,0),n)),r=n.join(" ")+" Tm\n"):r=A(t)+" "+A(i)+" Td\n",r},mt=0;mt<o.length;mt++){switch(lt="",ft){case ht:ut=(N?"<":"(")+o[mt][0]+(N?">":")"),st=parseFloat(o[mt][1]),at=parseFloat(o[mt][2]);break;case ct:ut=(N?"<":"(")+o[mt]+(N?">":")"),st=gn(i),at=Nn(n)}void 0!==J&&void 0!==J[mt]&&(lt=J[mt]+" Tw\n"),0===mt?t.push(lt+vt(st,at,v)+ut):ft===ct?t.push(lt+ut):ft===ht&&t.push(lt+vt(st,at,v)+ut)}t=t.join(ft===ct?" Tj\nT* ":" Tj\n"),t+=" Tj\n";var wt="BT\n/";return wt+=dt+" "+et+" Tf\n",wt+=A(et*L)+" TL\n",wt+=Sn+"\n",wt+=p,wt+=t,Z(wt+="ET"),l[dt]=!0,m};var Qi=d.__private__.clip=d.clip=function(t){return Z("evenodd"===t?"W*":"W"),this};d.clipEvenOdd=function(){return Qi("evenodd")},d.__private__.discardPath=d.discardPath=function(){return Z("n"),this};var Zi=d.__private__.isValidStyle=function(t){var i=!1;return-1!==[void 0,null,"S","D","F","DF","FD","f","f*","B","B*","n"].indexOf(t)&&(i=!0),i};d.__private__.setDefaultPathOperation=d.setDefaultPathOperation=function(t){return Zi(t)&&(c=t),this};var tn=d.__private__.getStyle=d.getStyle=function(t){var i=c;switch(t){case"D":case"S":i="S";break;case"F":i="f";break;case"FD":case"DF":i="B";break;case"f":case"f*":case"B":case"B*":i=t}return i},nn=d.close=function(){return Z("h"),this};d.stroke=function(){return Z("S"),this},d.fill=function(t){return en("f",t),this},d.fillEvenOdd=function(t){return en("f*",t),this},d.fillStroke=function(t){return en("B",t),this},d.fillStrokeEvenOdd=function(t){return en("B*",t),this};var en=function(t,i){"object"===B(i)?on(i,t):Z(t)},rn=function(t){null===t||g===b.ADVANCED&&void 0===t||(t=tn(t),Z(t))};function sn(t,i,n,e,r){var s=new ti(i||this.boundingBox,n||this.xStep,e||this.yStep,this.gState,r||this.matrix);s.stream=this.stream;var o=t+"$$"+this.cloneIndex+++"$$";return _t(o,s),s}var on=function(t,i){var n=At[t.key],e=Lt[n];if(e instanceof Zt)Z("q"),Z(an(i)),e.gState&&d.setGState(e.gState),Z(t.matrix.toString()+" cm"),Z("/"+n+" sh"),Z("Q");else if(e instanceof ti){var r=new Ct(1,0,0,-1,0,zn());t.matrix&&(r=r.multiply(t.matrix||zt),n=sn.call(e,t.key,t.boundingBox,t.xStep,t.yStep,r).id),Z("q"),Z("/Pattern cs"),Z("/"+n+" scn"),e.gState&&d.setGState(e.gState),Z(i),Z("Q")}},an=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"}},un=d.moveTo=function(t,i){return Z(A(M(t))+" "+A(E(i))+" m"),this},cn=d.lineTo=function(t,i){return Z(A(M(t))+" "+A(E(i))+" l"),this},hn=d.curveTo=function(t,i,n,e,r,s){return Z([A(M(t)),A(E(i)),A(M(n)),A(E(e)),A(M(r)),A(E(s)),"c"].join(" ")),this};d.__private__.line=d.line=function(t,i,n,e,r){if(isNaN(t)||isNaN(i)||isNaN(n)||isNaN(e)||!Zi(r))throw new Error("Invalid arguments passed to jsPDF.line");return g===b.COMPAT?this.lines([[n-t,e-i]],t,i,[1,1],r||"S"):this.lines([[n-t,e-i]],t,i,[1,1]).stroke()},d.__private__.lines=d.lines=function(t,i,n,e,r,s){var o,a,u,c,h,f,l,d;if("number"==typeof t&&(d=n,n=i,i=t,t=d),e=e||[1,1],s=s||!1,isNaN(i)||isNaN(n)||!Array.isArray(t)||!Array.isArray(e)||!Zi(r)||"boolean"!=typeof s)throw new Error("Invalid arguments passed to jsPDF.lines");for(un(i,n),o=e[0],a=e[1],c=t.length,f=i,l=n,u=0;u<c;u++)2===(h=t[u]).length?cn(f=h[0]*o+f,l=h[1]*a+l):hn(h[0]*o+f,h[1]*a+l,h[2]*o+f,h[3]*a+l,f=h[4]*o+f,l=h[5]*a+l);return s&&nn(),rn(r),this},d.path=function(t){for(var i=0;i<t.length;i++){var n=t[i],e=n.c;switch(n.op){case"m":un(e[0],e[1]);break;case"l":cn(e[0],e[1]);break;case"c":hn.apply(this,e);break;case"h":nn()}}return this},d.__private__.rect=d.rect=function(t,i,n,e,r){if(isNaN(t)||isNaN(i)||isNaN(n)||isNaN(e)||!Zi(r))throw new Error("Invalid arguments passed to jsPDF.rect");return g===b.COMPAT&&(e=-e),Z([A(M(t)),A(E(i)),A(M(n)),A(M(e)),"re"].join(" ")),rn(r),this},d.__private__.triangle=d.triangle=function(t,i,n,e,r,s,o){if(isNaN(t)||isNaN(i)||isNaN(n)||isNaN(e)||isNaN(r)||isNaN(s)||!Zi(o))throw new Error("Invalid arguments passed to jsPDF.triangle");return this.lines([[n-t,e-i],[r-n,s-e],[t-r,i-s]],t,i,[1,1],o,!0),this},d.__private__.roundedRect=d.roundedRect=function(t,i,n,e,r,s,o){if(isNaN(t)||isNaN(i)||isNaN(n)||isNaN(e)||isNaN(r)||isNaN(s)||!Zi(o))throw new Error("Invalid arguments passed to jsPDF.roundedRect");var a=4/3*(Math.SQRT2-1);return r=Math.min(r,.5*n),s=Math.min(s,.5*e),this.lines([[n-2*r,0],[r*a,0,r,s-s*a,r,s],[0,e-2*s],[0,s*a,-r*a,s,-r,s],[2*r-n,0],[-r*a,0,-r,-s*a,-r,-s],[0,2*s-e],[0,-s*a,r*a,-s,r,-s]],t+r,i,[1,1],o,!0),this},d.__private__.ellipse=d.ellipse=function(t,i,n,e,r){if(isNaN(t)||isNaN(i)||isNaN(n)||isNaN(e)||!Zi(r))throw new Error("Invalid arguments passed to jsPDF.ellipse");var s=4/3*(Math.SQRT2-1)*n,o=4/3*(Math.SQRT2-1)*e;return un(t+n,i),hn(t+n,i-o,t+s,i-e,t,i-e),hn(t-s,i-e,t-n,i-o,t-n,i),hn(t-n,i+o,t-s,i+e,t,i+e),hn(t+s,i+e,t+n,i+o,t+n,i),rn(r),this},d.__private__.circle=d.circle=function(t,i,n,e){if(isNaN(t)||isNaN(i)||isNaN(n)||!Zi(e))throw new Error("Invalid arguments passed to jsPDF.circle");return this.ellipse(t,i,n,n,e)},d.setFont=function(t,i,n){return n&&(i=y(i,n)),dt=Di(t,i,{disableWarning:!1}),this};var fn=d.__private__.getFont=d.getFont=function(){return bt[Di.apply(d,arguments)]};d.__private__.getFontList=d.getFontList=function(){var t,i,n={};for(t in gt)if(gt.hasOwnProperty(t))for(i in n[t]=[],gt[t])gt[t].hasOwnProperty(i)&&n[t].push(i);return n},d.addFont=function(t,i,n,e,r){var s=["StandardEncoding","MacRomanEncoding","Identity-H","WinAnsiEncoding"];return arguments[3]&&-1!==s.indexOf(arguments[3])?r=arguments[3]:arguments[3]&&-1==s.indexOf(arguments[3])&&(n=y(n,e)),qi.call(this,t,i,n,r=r||"Identity-H")};var ln,dn=t.lineWidth||.200025,vn=d.__private__.getLineWidth=d.getLineWidth=function(){return dn},mn=d.__private__.setLineWidth=d.setLineWidth=function(t){return dn=t,Z(A(M(t))+" w"),this};d.__private__.setLineDash=ii.API.setLineDash=ii.API.setLineDashPattern=function(t,i){if(t=t||[],i=i||0,isNaN(i)||!Array.isArray(t))throw new Error("Invalid arguments passed to jsPDF.setLineDash");return t=t.map((function(t){return A(M(t))})).join(" "),i=A(M(i)),Z("["+t+"] "+i+" d"),this};var wn=d.__private__.getLineHeight=d.getLineHeight=function(){return et*ln};d.__private__.getLineHeight=d.getLineHeight=function(){return et*ln};var pn=d.__private__.setLineHeightFactor=d.setLineHeightFactor=function(t){return"number"==typeof(t=t||1.15)&&(ln=t),this},bn=d.__private__.getLineHeightFactor=d.getLineHeightFactor=function(){return ln};pn(t.lineHeight);var gn=d.__private__.getHorizontalCoordinate=function(t){return M(t)},Nn=d.__private__.getVerticalCoordinate=function(t){return g===b.ADVANCED?t:It[z].mediaBox.topRightY-It[z].mediaBox.bottomLeftY-M(t)},Ln=d.__private__.getHorizontalCoordinateString=d.getHorizontalCoordinateString=function(t){return A(gn(t))},yn=d.__private__.getVerticalCoordinateString=d.getVerticalCoordinateString=function(t){return A(Nn(t))},An=t.strokeColor||"0 G";d.__private__.getStrokeColor=d.getDrawColor=function(){return Qt(An)},d.__private__.setStrokeColor=d.setDrawColor=function(t,i,n,e){return An=ni({ch1:t,ch2:i,ch3:n,ch4:e,pdfColorType:"draw",precision:2}),Z(An),this};var kn=t.fillColor||"0 g";d.__private__.getFillColor=d.getFillColor=function(){return Qt(kn)},d.__private__.setFillColor=d.setFillColor=function(t,i,n,e){return kn=ni({ch1:t,ch2:i,ch3:n,ch4:e,pdfColorType:"fill",precision:2}),Z(kn),this};var Sn=t.textColor||"0 g",xn=d.__private__.getTextColor=d.getTextColor=function(){return Qt(Sn)};d.__private__.setTextColor=d.setTextColor=function(t,i,n,e){return Sn=ni({ch1:t,ch2:i,ch3:n,ch4:e,pdfColorType:"text",precision:3}),this};var qn=t.charSpace,Mn=d.__private__.getCharSpace=d.getCharSpace=function(){return parseFloat(qn||0)};d.__private__.setCharSpace=d.setCharSpace=function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.setCharSpace");return qn=t,this};var jn=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 i=d.CapJoinStyles[t];if(void 0===i)throw new Error("Line cap style of '"+t+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return jn=i,Z(i+" J"),this};var En=0;d.__private__.setLineJoin=d.setLineJoin=function(t){var i=d.CapJoinStyles[t];if(void 0===i)throw new Error("Line join style of '"+t+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return En=i,Z(i+" 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 Z(A(M(t))+" M"),this},d.GState=$t,d.setGState=function(t){(t="string"==typeof t?St[xt[t]]:Pn(null,t)).equals(qt)||(Z("/"+t.id+" gs"),qt=t)};var Pn=function(t,i){if(!t||!xt[t]){var n=!1;for(var e in St)if(St.hasOwnProperty(e)&&St[e].equals(i)){n=!0;break}if(n)i=St[e];else{var r="GS"+(Object.keys(St).length+1).toString(10);St[r]=i,i.id=r}return t&&(xt[t]=i.id),Ft.publish("addGState",i),i}};d.addGState=function(t,i){return Pn(t,i),this},d.saveGraphicsState=function(){return Z("q"),Nt.push({key:dt,size:et,color:Sn}),this},d.restoreGraphicsState=function(){Z("Q");var t=Nt.pop();return dt=t.key,et=t.size,Sn=t.color,qt=null,this},d.setCurrentTransformationMatrix=function(t){return Z(t.toString()+" cm"),this},d.comment=function(t){return Z("#"+t),this};var In=function(t,i){var n=t||0;Object.defineProperty(this,"x",{enumerable:!0,get:function(){return n},set:function(t){isNaN(t)||(n=parseFloat(t))}});var e=i||0;Object.defineProperty(this,"y",{enumerable:!0,get:function(){return e},set:function(t){isNaN(t)||(e=parseFloat(t))}});var r="pt";return Object.defineProperty(this,"type",{enumerable:!0,get:function(){return r},set:function(t){r=t.toString()}}),this},Fn=function(t,i,n,e){In.call(this,t,i),this.type="rect";var r=n||0;Object.defineProperty(this,"w",{enumerable:!0,get:function(){return r},set:function(t){isNaN(t)||(r=parseFloat(t))}});var s=e||0;return Object.defineProperty(this,"h",{enumerable:!0,get:function(){return s},set:function(t){isNaN(t)||(s=parseFloat(t))}}),this},Rn=function(){this.page=Mt,this.currentPage=z,this.pages=Y.slice(0),this.pagesContext=It.slice(0),this.x=mt,this.y=wt,this.matrix=pt,this.width=Cn(z),this.height=zn(z),this.outputDestination=X,this.id="",this.objectNumber=-1};Rn.prototype.restore=function(){Mt=this.page,It=this.pagesContext,Y=this.pages,mt=this.x,wt=this.y,pt=this.matrix,Tn(z=this.currentPage,this.width),_n(z,this.height),X=this.outputDestination};var On=function(t,i,n,e,r){Dt.push(new Rn),Mt=z=0,Y=[],mt=t,wt=i,pt=r,Ii([n,e])},Bn=function(t){if(Bt[t])Dt.pop().restore();else{var i=new Rn,n="Xo"+(Object.keys(Ot).length+1).toString(10);i.id=n,Bt[t]=n,Ot[n]=i,Ft.publish("addFormObject",i),Dt.pop().restore()}};for(var Dn in d.beginFormObject=function(t,i,n,e,r){return On(t,i,n,e,r),this},d.endFormObject=function(t){return Bn(t),this},d.doFormObject=function(t,i){var n=Ot[Bt[t]];return Z("q"),Z(i.toString()+" cm"),Z("/"+n.id+" Do"),Z("Q"),this},d.getFormObject=function(t){var i=Ot[Bt[t]];return{x:i.x,y:i.y,width:i.width,height:i.height,matrix:i.matrix}},d.save=function(t,i){return t=t||"generated.pdf",(i=i||{}).returnPromise=i.returnPromise||!1,!1===i.returnPromise?(Et(Wi(Vi()),t),"function"==typeof Et.unload&&yt.setTimeout&&setTimeout(Et.unload,911),this):new Promise((function(i,n){try{var e=Et(Wi(Vi()),t);"function"==typeof Et.unload&&yt.setTimeout&&setTimeout(Et.unload,911),i(e)}catch(t){n(t.message)}}))},ii.API)ii.API.hasOwnProperty(Dn)&&("events"===Dn&&ii.API.events.length?function(t,i){var n,e;for(e=i.length-1;-1!==e;e--)t.subscribe.apply(t,[i[e][0]].concat("function"==typeof(n=i[e][1])?[n]:n))}(Ft,ii.API.events):d[Dn]=ii.API[Dn]);var Cn=d.getPageWidth=function(t){return(It[t=t||z].mediaBox.topRightX-It[t].mediaBox.bottomLeftX)/vt},Tn=d.setPageWidth=function(t,i){It[t].mediaBox.topRightX=i*vt+It[t].mediaBox.bottomLeftX},zn=d.getPageHeight=function(t){return(It[t=t||z].mediaBox.topRightY-It[t].mediaBox.bottomLeftY)/vt},_n=d.setPageHeight=function(t,i){It[t].mediaBox.topRightY=i*vt+It[t].mediaBox.bottomLeftY};return d.internal={pdfEscape:Pi,getStyle:tn,getFont:fn,getFontSize:st,getCharSpace:Mn,getTextColor:xn,getLineHeight:wn,getLineHeightFactor:bn,getLineWidth:vn,write:tt,getHorizontalCoordinate:gn,getVerticalCoordinate:Nn,getCoordinateString:Ln,getVerticalCoordinateString:yn,collections:{},newObject:Ut,newAdditionalObject:Ht,newObjectDeferred:Vt,newObjectDeferredBegin:Wt,getFilters:ei,putStream:ri,events:Ft,scaleFactor:vt,pageSize:{getWidth:function(){return Cn(z)},setWidth:function(t){Tn(z,t)},getHeight:function(){return zn(z)},setHeight:function(t){_n(z,t)}},encryptionOptions:h,encryption:Ji,getEncryptor:Yi,output:Hi,getNumberOfPages:Bi,pages:Y,out:Z,f2:x,f3:q,getPageInfo:Ki,getPageInfoByObjId:Xi,getCurrentPageInfo:$i,getPDFVersion:m,Point:In,Rectangle:Fn,Matrix:Ct,hasHotfix:Gi},Object.defineProperty(d.internal.pageSize,"width",{get:function(){return Cn(z)},set:function(t){Tn(z,t)},enumerable:!0,configurable:!0}),Object.defineProperty(d.internal.pageSize,"height",{get:function(){return zn(z)},set:function(t){_n(z,t)},enumerable:!0,configurable:!0}),Mi.call(d,nt),dt="F1",Fi(r,n),Ft.publish("initialized"),d}Yt.prototype.lsbFirstWord=function(t){return String.fromCharCode(t>>0&255,t>>8&255,t>>16&255,t>>24&255)},Yt.prototype.toHexString=function(t){return t.split("").map((function(t){return("0"+(255&t.charCodeAt(0)).toString(16)).slice(-2)})).join("")},Yt.prototype.hexToBytes=function(t){for(var i=[],n=0;n<t.length;n+=2)i.push(String.fromCharCode(parseInt(t.substr(n,2),16)));return i.join("")},Yt.prototype.processOwnerPassword=function(t,i){return Gt(Vt(i).substr(0,5),t)},Yt.prototype.encryptor=function(t,i){var n=Vt(this.encryptionKey+String.fromCharCode(255&t,t>>8&255,t>>16&255,255&i,i>>8&255)).substr(0,10);return function(t){return Gt(n,t)}},$t.prototype.equals=function(t){var i,n="id,objectNumber,equals";if(!t||B(t)!==B(this))return!1;var e=0;for(i in this)if(!(n.indexOf(i)>=0)){if(this.hasOwnProperty(i)&&!t.hasOwnProperty(i))return!1;if(this[i]!==t[i])return!1;e++}for(i in t)t.hasOwnProperty(i)&&n.indexOf(i)<0&&e--;return 0===e},ii.API={events:[]},ii.version="2.5.1";var ni=ii.API,ei=1,ri=function(t){return t.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},si=function(t){return t.replace(/\\\\/g,"\\").replace(/\\\(/g,"(").replace(/\\\)/g,")")},oi=function(t){return t.toFixed(2)},ai=function(t){return t.toFixed(5)};ni.__acroform__={};var ui=function(t,i){t.prototype=Object.create(i.prototype),t.prototype.constructor=t},ci=function(t){return t*ei},hi=function(t){var i=new qi,n=_i.internal.getHeight(t)||0,e=_i.internal.getWidth(t)||0;return i.BBox=[0,0,Number(oi(e)),Number(oi(n))],i},fi=ni.__acroform__.setBit=function(t,i){if(t=t||0,i=i||0,isNaN(t)||isNaN(i))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBit");return t|1<<i},li=ni.__acroform__.clearBit=function(t,i){if(t=t||0,i=i||0,isNaN(t)||isNaN(i))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBit");return t&~(1<<i)},di=ni.__acroform__.getBit=function(t,i){if(isNaN(t)||isNaN(i))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBit");return 0==(t&1<<i)?0:1},vi=ni.__acroform__.getBitForPdf=function(t,i){if(isNaN(t)||isNaN(i))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBitForPdf");return di(t,i-1)},mi=ni.__acroform__.setBitForPdf=function(t,i){if(isNaN(t)||isNaN(i))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBitForPdf");return fi(t,i-1)},wi=ni.__acroform__.clearBitForPdf=function(t,i){if(isNaN(t)||isNaN(i))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBitForPdf");return li(t,i-1)},pi=ni.__acroform__.calculateCoordinates=function(t,i){var n=i.internal.getHorizontalCoordinate,e=i.internal.getVerticalCoordinate,r=t[0],s=t[1],o=t[2],a=t[3],u={};return u.lowerLeft_X=n(r)||0,u.lowerLeft_Y=e(s+a)||0,u.upperRight_X=n(r+o)||0,u.upperRight_Y=e(s)||0,[Number(oi(u.lowerLeft_X)),Number(oi(u.lowerLeft_Y)),Number(oi(u.upperRight_X)),Number(oi(u.upperRight_Y))]},bi=function(t){if(t.appearanceStreamContent)return t.appearanceStreamContent;if(t.V||t.DV){var i=[],n=gi(t,t._V||t.DV),e=t.scope.internal.getFont(t.fontName,t.fontStyle).id;i.push("/Tx BMC"),i.push("q"),i.push("BT"),i.push(t.scope.__private__.encodeColorString(t.color)),i.push("/"+e+" "+oi(n.fontSize)+" Tf"),i.push("1 0 0 1 0 0 Tm"),i.push(n.text),i.push("ET"),i.push("Q"),i.push("EMC");var r=hi(t);return r.scope=t.scope,r.stream=i.join("\n"),r}},gi=function(t,i){var n=0===t.fontSize?t.maxFontSize:t.fontSize,e={text:"",fontSize:""},r=(i=")"==(i="("==i.substr(0,1)?i.substr(1):i).substr(i.length-1)?i.substr(0,i.length-1):i).split(" ");r=r.map(t.multiline?function(t){return t.split("\n")}:function(t){return[t]});var s=n,o=_i.internal.getHeight(t)||0;o=o<0?-o:o;var a=_i.internal.getWidth(t)||0;a=a<0?-a:a;var u=function(i,n,e){return i+1<r.length&&Ni(n+" "+r[i+1][0],t,e).width<=a-4};s++;t:for(;s>0;){i="",s--;var c,h,f=Ni("3",t,s).height,l=t.multiline?o-s:(o-f)/2,d=l+=2,v=0,m=0,w=0;if(s<=0){i="(...) Tj\n",i+="% Width of Text: "+Ni(i,t,s=12).width+", FieldWidth:"+a+"\n";break}for(var p="",b=0,g=0;g<r.length;g++)if(r.hasOwnProperty(g)){var N=!1;if(1!==r[g].length&&w!==r[g].length-1){if((f+2)*(b+2)+2>o)continue t;p+=r[g][w],N=!0,m=g,g--}else{p=" "==(p+=r[g][w]+" ").substr(p.length-1)?p.substr(0,p.length-1):p;var L=parseInt(g),y=u(L,p,s),A=g>=r.length-1;if(y&&!A){p+=" ",w=0;continue}if(y||A){if(A)m=L;else if(t.multiline&&(f+2)*(b+2)+2>o)continue t}else{if(!t.multiline)continue t;if((f+2)*(b+2)+2>o)continue t;m=L}}for(var k="",S=v;S<=m;S++){var x=r[S];if(t.multiline){if(S===m){k+=x[w]+" ",w=(w+1)%x.length;continue}if(S===v){k+=x[x.length-1]+" ";continue}}k+=x[0]+" "}switch(k=" "==k.substr(k.length-1)?k.substr(0,k.length-1):k,h=Ni(k,t,s).width,t.textAlign){case"right":c=a-h-2;break;case"center":c=(a-h)/2;break;default:c=2}i+=oi(c)+" "+oi(d)+" Td\n",i+="("+ri(k)+") Tj\n",i+=-oi(c)+" 0 Td\n",d=-(s+2),h=0,v=N?m:m+1,b++,p=""}break}return e.text=i,e.fontSize=s,e},Ni=function(t,i,n){var e=i.scope.internal.getFont(i.fontName,i.fontStyle),r=i.scope.getStringUnitWidth(t,{font:e,fontSize:parseFloat(n),charSpace:0})*parseFloat(n);return{height:i.scope.getStringUnitWidth("3",{font:e,fontSize:parseFloat(n),charSpace:0})*parseFloat(n)*1.5,width:r}},Li={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},yi=function(t,i){var n={type:"reference",object:t};void 0===i.internal.getPageInfo(t.page).pageContext.annotations.find((function(t){return t.type===n.type&&t.object===n.object}))&&i.internal.getPageInfo(t.page).pageContext.annotations.push(n)},Ai=function(t,i){if(i.scope=t,void 0!==t.internal&&(void 0===t.internal.acroformPlugin||!1===t.internal.acroformPlugin.isInitialized)){if(ji.FieldNum=0,t.internal.acroformPlugin=JSON.parse(JSON.stringify(Li)),t.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("Exception while creating AcroformDictionary");ei=t.internal.scaleFactor,t.internal.acroformPlugin.acroFormDictionaryRoot=new Mi,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 i=t.internal.acroformPlugin.acroFormDictionaryRoot.Fields;for(var n in i)if(i.hasOwnProperty(n)){var e=i[n];e.objId=void 0,e.hasAnnotation&&yi(e,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(i){!function(t,i){var n=!t;for(var e in t||(i.internal.newObjectDeferredBegin(i.internal.acroformPlugin.acroFormDictionaryRoot.objId,!0),i.internal.acroformPlugin.acroFormDictionaryRoot.putStream()),t=t||i.internal.acroformPlugin.acroFormDictionaryRoot.Kids)if(t.hasOwnProperty(e)){var r=t[e],s=[],o=r.Rect;if(r.Rect&&(r.Rect=pi(r.Rect,i)),i.internal.newObjectDeferredBegin(r.objId,!0),r.DA=_i.createDefaultAppearanceStream(r),"object"===B(r)&&"function"==typeof r.getKeyValueListForStream&&(s=r.getKeyValueListForStream()),r.Rect=o,r.hasAppearanceStream&&!r.appearanceStreamContent){var a=bi(r);s.push({key:"AP",value:"<</N "+a+">>"}),i.internal.acroformPlugin.xForms.push(a)}if(r.appearanceStreamContent){var u="";for(var c in r.appearanceStreamContent)if(r.appearanceStreamContent.hasOwnProperty(c)){var h=r.appearanceStreamContent[c];if(u+="/"+c+" ",u+="<<",Object.keys(h).length>=1||Array.isArray(h)){for(var e in h)if(h.hasOwnProperty(e)){var f=h[e];"function"==typeof f&&(f=f.call(i,r)),u+="/"+e+" "+f+" ",i.internal.acroformPlugin.xForms.indexOf(f)>=0||i.internal.acroformPlugin.xForms.push(f)}}else"function"==typeof(f=h)&&(f=f.call(i,r)),u+="/"+e+" "+f,i.internal.acroformPlugin.xForms.indexOf(f)>=0||i.internal.acroformPlugin.xForms.push(f);u+=">>"}s.push({key:"AP",value:"<<\n"+u+">>"})}i.internal.putStream({additionalKeyValues:s,objectId:r.objId}),i.internal.out("endobj")}n&&function(t,i){for(var n in t)if(t.hasOwnProperty(n)){var e=n,r=t[n];i.internal.newObjectDeferredBegin(r.objId,!0),"object"===B(r)&&"function"==typeof r.putStream&&r.putStream(),delete t[e]}}(i.internal.acroformPlugin.xForms,i)}(i,t)})),t.internal.acroformPlugin.isInitialized=!0}},ki=ni.__acroform__.arrayToPdfArray=function(t,i,n){var e=function(t){return t};if(Array.isArray(t)){for(var r="[",s=0;s<t.length;s++)switch(0!==s&&(r+=" "),B(t[s])){case"boolean":case"number":case"object":r+=t[s].toString();break;case"string":"/"!==t[s].substr(0,1)?(void 0!==i&&n&&(e=n.internal.getEncryptor(i)),r+="("+ri(e(t[s].toString()))+")"):r+=t[s].toString()}return r+"]"}throw new Error("Invalid argument passed to jsPDF.__acroform__.arrayToPdfArray")},Si=function(t,i,n){var e=function(t){return t};return void 0!==i&&n&&(e=n.internal.getEncryptor(i)),(t=t||"").toString(),"("+ri(e(t))+")"},xi=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})};xi.prototype.toString=function(){return this.objId+" 0 R"},xi.prototype.putStream=function(){var t=this.getKeyValueListForStream();this.scope.internal.putStream({data:this.stream,additionalKeyValues:t,objectId:this.objId}),this.scope.internal.out("endobj")},xi.prototype.getKeyValueListForStream=function(){var t=[],i=Object.getOwnPropertyNames(this).filter((function(t){return"content"!=t&&"appearanceStreamContent"!=t&&"scope"!=t&&"objId"!=t&&"_"!=t.substring(0,1)}));for(var n in i)if(!1===Object.getOwnPropertyDescriptor(this,i[n]).configurable){var e=i[n],r=this[e];r&&(Array.isArray(r)?t.push({key:e,value:ki(r,this.objId,this.scope)}):r instanceof xi?(r.scope=this.scope,t.push({key:e,value:r.objId+" 0 R"})):"function"!=typeof r&&t.push({key:e,value:r}))}return t};var qi=function(){xi.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,i=[];Object.defineProperty(this,"BBox",{configurable:!1,get:function(){return i},set:function(t){i=t}}),Object.defineProperty(this,"Resources",{value:"2 0 R",configurable:!1,writable:!0}),Object.defineProperty(this,"stream",{enumerable:!1,configurable:!0,set:function(i){t=i.trim()},get:function(){return t||null}})};ui(qi,xi);var Mi=function(){xi.call(this);var t,i=[];Object.defineProperty(this,"Kids",{enumerable:!1,configurable:!0,get:function(){return i.length>0?i:void 0}}),Object.defineProperty(this,"Fields",{enumerable:!1,configurable:!1,get:function(){return i}}),Object.defineProperty(this,"DA",{enumerable:!1,configurable:!1,get:function(){if(t){var i=function(t){return t};return this.scope&&(i=this.scope.internal.getEncryptor(this.objId)),"("+ri(i(t))+")"}},set:function(i){t=i}})};ui(Mi,xi);var ji=function t(){xi.call(this);var i=4;Object.defineProperty(this,"F",{enumerable:!1,configurable:!1,get:function(){return i},set:function(t){if(isNaN(t))throw new Error('Invalid value "'+t+'" for attribute F supplied.');i=t}}),Object.defineProperty(this,"showWhenPrinted",{enumerable:!0,configurable:!0,get:function(){return Boolean(vi(i,3))},set:function(t){this.F=!0===Boolean(t)?mi(i,3):wi(i,3)}});var n=0;Object.defineProperty(this,"Ff",{enumerable:!1,configurable:!1,get:function(){return n},set:function(t){if(isNaN(t))throw new Error('Invalid value "'+t+'" for attribute Ff supplied.');n=t}});var e=[];Object.defineProperty(this,"Rect",{enumerable:!1,configurable:!1,get:function(){if(0!==e.length)return e},set:function(t){e=void 0!==t?t:[]}}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,get:function(){return!e||isNaN(e[0])?0:e[0]},set:function(t){e[0]=t}}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,get:function(){return!e||isNaN(e[1])?0:e[1]},set:function(t){e[1]=t}}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,get:function(){return!e||isNaN(e[2])?0:e[2]},set:function(t){e[2]=t}}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,get:function(){return!e||isNaN(e[3])?0:e[3]},set:function(t){e[3]=t}});var r="";Object.defineProperty(this,"FT",{enumerable:!0,configurable:!1,get:function(){return r},set:function(t){switch(t){case"/Btn":case"/Tx":case"/Ch":case"/Sig":r=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 Di)return;s="FieldObject"+t.FieldNum++}var i=function(t){return t};return this.scope&&(i=this.scope.internal.getEncryptor(this.objId)),"("+ri(i(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 c=void 0;Object.defineProperty(this,"maxFontSize",{enumerable:!0,configurable:!0,get:function(){return void 0===c?50/ei:c},set:function(t){c=t}});var h="black";Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,get:function(){return h},set:function(t){h=t}});var f="/F1 0 Tf 0 g";Object.defineProperty(this,"DA",{enumerable:!0,configurable:!1,get:function(){if(!(!f||this instanceof Di||this instanceof Ti))return Si(f,this.objId,this.scope)},set:function(t){t=t.toString(),f=t}});var l=null;Object.defineProperty(this,"DV",{enumerable:!1,configurable:!1,get:function(){if(l)return this instanceof Ri==0?Si(l,this.objId,this.scope):l},set:function(t){t=t.toString(),l=this instanceof Ri==0?"("===t.substr(0,1)?si(t.substr(1,t.length-2)):si(t):t}}),Object.defineProperty(this,"defaultValue",{enumerable:!0,configurable:!0,get:function(){return this instanceof Ri==1?si(l.substr(1,l.length-1)):l},set:function(t){t=t.toString(),l=this instanceof Ri==1?"/"+t:t}});var d=null;Object.defineProperty(this,"_V",{enumerable:!1,configurable:!1,get:function(){if(d)return d},set:function(t){this.V=t}}),Object.defineProperty(this,"V",{enumerable:!1,configurable:!1,get:function(){if(d)return this instanceof Ri==0?Si(d,this.objId,this.scope):d},set:function(t){t=t.toString(),d=this instanceof Ri==0?"("===t.substr(0,1)?si(t.substr(1,t.length-2)):si(t):t}}),Object.defineProperty(this,"value",{enumerable:!0,configurable:!0,get:function(){return this instanceof Ri==1?si(d.substr(1,d.length-1)):d},set:function(t){t=t.toString(),d=this instanceof Ri==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 v,m=!1;Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return m},set:function(t){t=Boolean(t),m=t}}),Object.defineProperty(this,"page",{enumerable:!0,configurable:!0,get:function(){if(v)return v},set:function(t){v=t}}),Object.defineProperty(this,"readOnly",{enumerable:!0,configurable:!0,get:function(){return Boolean(vi(this.Ff,1))},set:function(t){this.Ff=!0===Boolean(t)?mi(this.Ff,1):wi(this.Ff,1)}}),Object.defineProperty(this,"required",{enumerable:!0,configurable:!0,get:function(){return Boolean(vi(this.Ff,2))},set:function(t){this.Ff=!0===Boolean(t)?mi(this.Ff,2):wi(this.Ff,2)}}),Object.defineProperty(this,"noExport",{enumerable:!0,configurable:!0,get:function(){return Boolean(vi(this.Ff,3))},set:function(t){this.Ff=!0===Boolean(t)?mi(this.Ff,3):wi(this.Ff,3)}});var w=null;Object.defineProperty(this,"Q",{enumerable:!0,configurable:!1,get:function(){if(null!==w)return w},set:function(t){if(-1===[0,1,2].indexOf(t))throw new Error('Invalid value "'+t+'" for attribute Q supplied.');w=t}}),Object.defineProperty(this,"textAlign",{get:function(){var t;switch(w){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:w=2;break;case"center":case 1:w=1;break;default:w=0}}})};ui(ji,xi);var Ei=function(){ji.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(i){t=i}}),Object.defineProperty(this,"topIndex",{enumerable:!0,configurable:!0,get:function(){return t},set:function(i){t=i}});var i=[];Object.defineProperty(this,"Opt",{enumerable:!0,configurable:!1,get:function(){return ki(i,this.objId,this.scope)},set:function(t){var n,e;e=[],"string"==typeof(n=t)&&(e=function(t,i,n){n||(n=1);for(var e,r=[];e=i.exec(t);)r.push(e[n]);return r}(n,/\((.*?)\)/g)),i=e}}),this.getOptions=function(){return i},this.setOptions=function(t){i=t,this.sort&&i.sort()},this.addOption=function(t){t=(t=t||"").toString(),i.push(t),this.sort&&i.sort()},this.removeOption=function(t,n){for(n=n||!1,t=(t=t||"").toString();-1!==i.indexOf(t)&&(i.splice(i.indexOf(t),1),!1!==n););},Object.defineProperty(this,"combo",{enumerable:!0,configurable:!0,get:function(){return Boolean(vi(this.Ff,18))},set:function(t){this.Ff=!0===Boolean(t)?mi(this.Ff,18):wi(this.Ff,18)}}),Object.defineProperty(this,"edit",{enumerable:!0,configurable:!0,get:function(){return Boolean(vi(this.Ff,19))},set:function(t){!0===this.combo&&(this.Ff=!0===Boolean(t)?mi(this.Ff,19):wi(this.Ff,19))}}),Object.defineProperty(this,"sort",{enumerable:!0,configurable:!0,get:function(){return Boolean(vi(this.Ff,20))},set:function(t){!0===Boolean(t)?(this.Ff=mi(this.Ff,20),i.sort()):this.Ff=wi(this.Ff,20)}}),Object.defineProperty(this,"multiSelect",{enumerable:!0,configurable:!0,get:function(){return Boolean(vi(this.Ff,22))},set:function(t){this.Ff=!0===Boolean(t)?mi(this.Ff,22):wi(this.Ff,22)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return Boolean(vi(this.Ff,23))},set:function(t){this.Ff=!0===Boolean(t)?mi(this.Ff,23):wi(this.Ff,23)}}),Object.defineProperty(this,"commitOnSelChange",{enumerable:!0,configurable:!0,get:function(){return Boolean(vi(this.Ff,27))},set:function(t){this.Ff=!0===Boolean(t)?mi(this.Ff,27):wi(this.Ff,27)}}),this.hasAppearanceStream=!1};ui(Ei,ji);var Pi=function(){Ei.call(this),this.fontName="helvetica",this.combo=!1};ui(Pi,Ei);var Ii=function(){Pi.call(this),this.combo=!0};ui(Ii,Pi);var Fi=function(){Ii.call(this),this.edit=!0};ui(Fi,Ii);var Ri=function(){ji.call(this),this.FT="/Btn",Object.defineProperty(this,"noToggleToOff",{enumerable:!0,configurable:!0,get:function(){return Boolean(vi(this.Ff,15))},set:function(t){this.Ff=!0===Boolean(t)?mi(this.Ff,15):wi(this.Ff,15)}}),Object.defineProperty(this,"radio",{enumerable:!0,configurable:!0,get:function(){return Boolean(vi(this.Ff,16))},set:function(t){this.Ff=!0===Boolean(t)?mi(this.Ff,16):wi(this.Ff,16)}}),Object.defineProperty(this,"pushButton",{enumerable:!0,configurable:!0,get:function(){return Boolean(vi(this.Ff,17))},set:function(t){this.Ff=!0===Boolean(t)?mi(this.Ff,17):wi(this.Ff,17)}}),Object.defineProperty(this,"radioIsUnison",{enumerable:!0,configurable:!0,get:function(){return Boolean(vi(this.Ff,26))},set:function(t){this.Ff=!0===Boolean(t)?mi(this.Ff,26):wi(this.Ff,26)}});var t,i={};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(i).length){var n,e=[];for(n in e.push("<<"),i)e.push("/"+n+" ("+ri(t(i[n]))+")");return e.push(">>"),e.join("\n")}},set:function(t){"object"===B(t)&&(i=t)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return i.CA||""},set:function(t){"string"==typeof t&&(i.CA=t)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return t},set:function(i){t=i}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return t.substr(1,t.length-1)},set:function(i){t="/"+i}})};ui(Ri,ji);var Oi=function(){Ri.call(this),this.pushButton=!0};ui(Oi,Ri);var Bi=function(){Ri.call(this),this.radio=!0,this.pushButton=!1;var t=[];Object.defineProperty(this,"Kids",{enumerable:!0,configurable:!1,get:function(){return t},set:function(i){t=void 0!==i?i:[]}})};ui(Bi,Ri);var Di=function(){var t,i;ji.call(this),Object.defineProperty(this,"Parent",{enumerable:!1,configurable:!1,get:function(){return t},set:function(i){t=i}}),Object.defineProperty(this,"optionName",{enumerable:!1,configurable:!0,get:function(){return i},set:function(t){i=t}});var n,e={};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 i,n=[];for(i in n.push("<<"),e)n.push("/"+i+" ("+ri(t(e[i]))+")");return n.push(">>"),n.join("\n")},set:function(t){"object"===B(t)&&(e=t)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return e.CA||""},set:function(t){"string"==typeof t&&(e.CA=t)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return n},set:function(t){n=t}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return n.substr(1,n.length-1)},set:function(t){n="/"+t}}),this.caption="l",this.appearanceState="Off",this._AppearanceType=_i.RadioButton.Circle,this.appearanceStreamContent=this._AppearanceType.createAppearanceStream(this.optionName)};ui(Di,ji),Bi.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 i in this.Kids)if(this.Kids.hasOwnProperty(i)){var n=this.Kids[i];n.appearanceStreamContent=t.createAppearanceStream(n.optionName),n.caption=t.getCA()}},Bi.prototype.createOption=function(t){var i=new Di;return i.Parent=this,i.optionName=t,this.Kids.push(i),Ui.call(this.scope,i),i};var Ci=function(){Ri.call(this),this.fontName="zapfdingbats",this.caption="3",this.appearanceState="On",this.value="On",this.textAlign="center",this.appearanceStreamContent=_i.CheckBox.createAppearanceStream()};ui(Ci,Ri);var Ti=function(){ji.call(this),this.FT="/Tx",Object.defineProperty(this,"multiline",{enumerable:!0,configurable:!0,get:function(){return Boolean(vi(this.Ff,13))},set:function(t){this.Ff=!0===Boolean(t)?mi(this.Ff,13):wi(this.Ff,13)}}),Object.defineProperty(this,"fileSelect",{enumerable:!0,configurable:!0,get:function(){return Boolean(vi(this.Ff,21))},set:function(t){this.Ff=!0===Boolean(t)?mi(this.Ff,21):wi(this.Ff,21)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return Boolean(vi(this.Ff,23))},set:function(t){this.Ff=!0===Boolean(t)?mi(this.Ff,23):wi(this.Ff,23)}}),Object.defineProperty(this,"doNotScroll",{enumerable:!0,configurable:!0,get:function(){return Boolean(vi(this.Ff,24))},set:function(t){this.Ff=!0===Boolean(t)?mi(this.Ff,24):wi(this.Ff,24)}}),Object.defineProperty(this,"comb",{enumerable:!0,configurable:!0,get:function(){return Boolean(vi(this.Ff,25))},set:function(t){this.Ff=!0===Boolean(t)?mi(this.Ff,25):wi(this.Ff,25)}}),Object.defineProperty(this,"richText",{enumerable:!0,configurable:!0,get:function(){return Boolean(vi(this.Ff,26))},set:function(t){this.Ff=!0===Boolean(t)?mi(this.Ff,26):wi(this.Ff,26)}});var t=null;Object.defineProperty(this,"MaxLen",{enumerable:!0,configurable:!1,get:function(){return t},set:function(i){t=i}}),Object.defineProperty(this,"maxLength",{enumerable:!0,configurable:!0,get:function(){return t},set:function(i){Number.isInteger(i)&&(t=i)}}),Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return this.V||this.DV}})};ui(Ti,ji);var zi=function(){Ti.call(this),Object.defineProperty(this,"password",{enumerable:!0,configurable:!0,get:function(){return Boolean(vi(this.Ff,14))},set:function(t){this.Ff=!0===Boolean(t)?mi(this.Ff,14):wi(this.Ff,14)}}),this.password=!0};ui(zi,Ti);var _i={CheckBox:{createAppearanceStream:function(){return{N:{On:_i.CheckBox.YesNormal},D:{On:_i.CheckBox.YesPushDown,Off:_i.CheckBox.OffPushDown}}},YesPushDown:function(t){var i=hi(t);i.scope=t.scope;var n=[],e=t.scope.internal.getFont(t.fontName,t.fontStyle).id,r=t.scope.__private__.encodeColorString(t.color),s=gi(t,t.caption);return n.push("0.749023 g"),n.push("0 0 "+oi(_i.internal.getWidth(t))+" "+oi(_i.internal.getHeight(t))+" re"),n.push("f"),n.push("BMC"),n.push("q"),n.push("0 0 1 rg"),n.push("/"+e+" "+oi(s.fontSize)+" Tf "+r),n.push("BT"),n.push(s.text),n.push("ET"),n.push("Q"),n.push("EMC"),i.stream=n.join("\n"),i},YesNormal:function(t){var i=hi(t);i.scope=t.scope;var n=t.scope.internal.getFont(t.fontName,t.fontStyle).id,e=t.scope.__private__.encodeColorString(t.color),r=[],s=_i.internal.getHeight(t),o=_i.internal.getWidth(t),a=gi(t,t.caption);return r.push("1 g"),r.push("0 0 "+oi(o)+" "+oi(s)+" re"),r.push("f"),r.push("q"),r.push("0 0 1 rg"),r.push("0 0 "+oi(o-1)+" "+oi(s-1)+" re"),r.push("W"),r.push("n"),r.push("0 g"),r.push("BT"),r.push("/"+n+" "+oi(a.fontSize)+" Tf "+e),r.push(a.text),r.push("ET"),r.push("Q"),i.stream=r.join("\n"),i},OffPushDown:function(t){var i=hi(t);i.scope=t.scope;var n=[];return n.push("0.749023 g"),n.push("0 0 "+oi(_i.internal.getWidth(t))+" "+oi(_i.internal.getHeight(t))+" re"),n.push("f"),i.stream=n.join("\n"),i}},RadioButton:{Circle:{createAppearanceStream:function(t){var i={D:{Off:_i.RadioButton.Circle.OffPushDown},N:{}};return i.N[t]=_i.RadioButton.Circle.YesNormal,i.D[t]=_i.RadioButton.Circle.YesPushDown,i},getCA:function(){return"l"},YesNormal:function(t){var i=hi(t);i.scope=t.scope;var n=[],e=_i.internal.getWidth(t)<=_i.internal.getHeight(t)?_i.internal.getWidth(t)/4:_i.internal.getHeight(t)/4;e=Number((.9*e).toFixed(5));var r=Number((e*_i.internal.Bezier_C).toFixed(5));return n.push("q"),n.push("1 0 0 1 "+ai(_i.internal.getWidth(t)/2)+" "+ai(_i.internal.getHeight(t)/2)+" cm"),n.push(e+" 0 m"),n.push(e+" "+r+" "+r+" "+e+" 0 "+e+" c"),n.push("-"+r+" "+e+" -"+e+" "+r+" -"+e+" 0 c"),n.push("-"+e+" -"+r+" -"+r+" -"+e+" 0 -"+e+" c"),n.push(r+" -"+e+" "+e+" -"+r+" "+e+" 0 c"),n.push("f"),n.push("Q"),i.stream=n.join("\n"),i},YesPushDown:function(t){var i=hi(t);i.scope=t.scope;var n=[],e=_i.internal.getWidth(t)<=_i.internal.getHeight(t)?_i.internal.getWidth(t)/4:_i.internal.getHeight(t)/4;e=Number((.9*e).toFixed(5));var r=Number((2*e).toFixed(5)),s=Number((r*_i.internal.Bezier_C).toFixed(5)),o=Number((e*_i.internal.Bezier_C).toFixed(5));return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+ai(_i.internal.getWidth(t)/2)+" "+ai(_i.internal.getHeight(t)/2)+" cm"),n.push(r+" 0 m"),n.push(r+" "+s+" "+s+" "+r+" 0 "+r+" c"),n.push("-"+s+" "+r+" -"+r+" "+s+" -"+r+" 0 c"),n.push("-"+r+" -"+s+" -"+s+" -"+r+" 0 -"+r+" c"),n.push(s+" -"+r+" "+r+" -"+s+" "+r+" 0 c"),n.push("f"),n.push("Q"),n.push("0 g"),n.push("q"),n.push("1 0 0 1 "+ai(_i.internal.getWidth(t)/2)+" "+ai(_i.internal.getHeight(t)/2)+" cm"),n.push(e+" 0 m"),n.push(e+" "+o+" "+o+" "+e+" 0 "+e+" c"),n.push("-"+o+" "+e+" -"+e+" "+o+" -"+e+" 0 c"),n.push("-"+e+" -"+o+" -"+o+" -"+e+" 0 -"+e+" c"),n.push(o+" -"+e+" "+e+" -"+o+" "+e+" 0 c"),n.push("f"),n.push("Q"),i.stream=n.join("\n"),i},OffPushDown:function(t){var i=hi(t);i.scope=t.scope;var n=[],e=_i.internal.getWidth(t)<=_i.internal.getHeight(t)?_i.internal.getWidth(t)/4:_i.internal.getHeight(t)/4;e=Number((.9*e).toFixed(5));var r=Number((2*e).toFixed(5)),s=Number((r*_i.internal.Bezier_C).toFixed(5));return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+ai(_i.internal.getWidth(t)/2)+" "+ai(_i.internal.getHeight(t)/2)+" cm"),n.push(r+" 0 m"),n.push(r+" "+s+" "+s+" "+r+" 0 "+r+" c"),n.push("-"+s+" "+r+" -"+r+" "+s+" -"+r+" 0 c"),n.push("-"+r+" -"+s+" -"+s+" -"+r+" 0 -"+r+" c"),n.push(s+" -"+r+" "+r+" -"+s+" "+r+" 0 c"),n.push("f"),n.push("Q"),i.stream=n.join("\n"),i}},Cross:{createAppearanceStream:function(t){var i={D:{Off:_i.RadioButton.Cross.OffPushDown},N:{}};return i.N[t]=_i.RadioButton.Cross.YesNormal,i.D[t]=_i.RadioButton.Cross.YesPushDown,i},getCA:function(){return"8"},YesNormal:function(t){var i=hi(t);i.scope=t.scope;var n=[],e=_i.internal.calculateCross(t);return n.push("q"),n.push("1 1 "+oi(_i.internal.getWidth(t)-2)+" "+oi(_i.internal.getHeight(t)-2)+" re"),n.push("W"),n.push("n"),n.push(oi(e.x1.x)+" "+oi(e.x1.y)+" m"),n.push(oi(e.x2.x)+" "+oi(e.x2.y)+" l"),n.push(oi(e.x4.x)+" "+oi(e.x4.y)+" m"),n.push(oi(e.x3.x)+" "+oi(e.x3.y)+" l"),n.push("s"),n.push("Q"),i.stream=n.join("\n"),i},YesPushDown:function(t){var i=hi(t);i.scope=t.scope;var n=_i.internal.calculateCross(t),e=[];return e.push("0.749023 g"),e.push("0 0 "+oi(_i.internal.getWidth(t))+" "+oi(_i.internal.getHeight(t))+" re"),e.push("f"),e.push("q"),e.push("1 1 "+oi(_i.internal.getWidth(t)-2)+" "+oi(_i.internal.getHeight(t)-2)+" re"),e.push("W"),e.push("n"),e.push(oi(n.x1.x)+" "+oi(n.x1.y)+" m"),e.push(oi(n.x2.x)+" "+oi(n.x2.y)+" l"),e.push(oi(n.x4.x)+" "+oi(n.x4.y)+" m"),e.push(oi(n.x3.x)+" "+oi(n.x3.y)+" l"),e.push("s"),e.push("Q"),i.stream=e.join("\n"),i},OffPushDown:function(t){var i=hi(t);i.scope=t.scope;var n=[];return n.push("0.749023 g"),n.push("0 0 "+oi(_i.internal.getWidth(t))+" "+oi(_i.internal.getHeight(t))+" re"),n.push("f"),i.stream=n.join("\n"),i}}},createDefaultAppearanceStream:function(t){var i=t.scope.internal.getFont(t.fontName,t.fontStyle).id,n=t.scope.__private__.encodeColorString(t.color);return"/"+i+" "+t.fontSize+" Tf "+n}};_i.internal={Bezier_C:.551915024494,calculateCross:function(t){var i=_i.internal.getWidth(t),n=_i.internal.getHeight(t),e=Math.min(i,n);return{x1:{x:(i-e)/2,y:(n-e)/2+e},x2:{x:(i-e)/2+e,y:(n-e)/2},x3:{x:(i-e)/2,y:(n-e)/2},x4:{x:(i-e)/2+e,y:(n-e)/2+e}}}},_i.internal.getWidth=function(t){var i=0;return"object"===B(t)&&(i=ci(t.Rect[2])),i},_i.internal.getHeight=function(t){var i=0;return"object"===B(t)&&(i=ci(t.Rect[3])),i};var Ui=ni.addField=function(t){if(Ai(this,t),!(t instanceof ji))throw new Error("Invalid argument passed to jsPDF.addField.");var i;return(i=t).scope.internal.acroformPlugin.printedOut&&(i.scope.internal.acroformPlugin.printedOut=!1,i.scope.internal.acroformPlugin.acroFormDictionaryRoot=null),i.scope.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(i),t.page=t.scope.internal.getCurrentPageInfo().pageNumber,this};function Vi(t){return t.reduce((function(t,i,n){return t[i]=n,t}),{})}ni.AcroFormChoiceField=Ei,ni.AcroFormListBox=Pi,ni.AcroFormComboBox=Ii,ni.AcroFormEditBox=Fi,ni.AcroFormButton=Ri,ni.AcroFormPushButton=Oi,ni.AcroFormRadioButton=Bi,ni.AcroFormCheckBox=Ci,ni.AcroFormTextField=Ti,ni.AcroFormPasswordField=zi,ni.AcroFormAppearance=_i,ni.AcroForm={ChoiceField:Ei,ListBox:Pi,ComboBox:Ii,EditBox:Fi,Button:Ri,PushButton:Oi,RadioButton:Bi,CheckBox:Ci,TextField:Ti,PasswordField:zi,Appearance:_i},ii.AcroForm={ChoiceField:Ei,ListBox:Pi,ComboBox:Ii,EditBox:Fi,Button:Ri,PushButton:Oi,RadioButton:Bi,CheckBox:Ci,TextField:Ti,PasswordField:zi,Appearance:_i},function(t){t.__addimage__={};var i="UNKNOWN",n={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]]},e=t.__addimage__.getImageFileTypeByImageData=function(t,e){var r,s,o,a,u,c=i;if("RGBA"===(e=e||i)||void 0!==t.data&&t.data instanceof Uint8ClampedArray&&"height"in t&&"width"in t)return"RGBA";if(y(t))for(u in n)for(o=n[u],r=0;r<o.length;r+=1){for(a=!0,s=0;s<o[r].length;s+=1)if(void 0!==o[r][s]&&o[r][s]!==t[s]){a=!1;break}if(!0===a){c=u;break}}else for(u in n)for(o=n[u],r=0;r<o.length;r+=1){for(a=!0,s=0;s<o[r].length;s+=1)if(void 0!==o[r][s]&&o[r][s]!==t.charCodeAt(s)){a=!1;break}if(!0===a){c=u;break}}return c===i&&e!==i&&(c=e),c},r=function t(i){for(var n=this.internal.write,e=this.internal.putStream,r=(0,this.internal.getFilters)();-1!==r.indexOf("FlateEncode");)r.splice(r.indexOf("FlateEncode"),1);i.objectId=this.internal.newObject();var s=[];if(s.push({key:"Type",value:"/XObject"}),s.push({key:"Subtype",value:"/Image"}),s.push({key:"Width",value:i.width}),s.push({key:"Height",value:i.height}),i.colorSpace===w.INDEXED?s.push({key:"ColorSpace",value:"[/Indexed /DeviceRGB "+(i.palette.length/3-1)+" "+("sMask"in i&&void 0!==i.sMask?i.objectId+2:i.objectId+1)+" 0 R]"}):(s.push({key:"ColorSpace",value:"/"+i.colorSpace}),i.colorSpace===w.DEVICE_CMYK&&s.push({key:"Decode",value:"[1 0 1 0 1 0 1 0]"})),s.push({key:"BitsPerComponent",value:i.bitsPerComponent}),"decodeParameters"in i&&void 0!==i.decodeParameters&&s.push({key:"DecodeParms",value:"<<"+i.decodeParameters+">>"}),"transparency"in i&&Array.isArray(i.transparency)){for(var o="",a=0,u=i.transparency.length;a<u;a++)o+=i.transparency[a]+" "+i.transparency[a]+" ";s.push({key:"Mask",value:"["+o+"]"})}if(void 0!==i.sMask&&s.push({key:"SMask",value:i.objectId+1+" 0 R"}),e({data:i.data,additionalKeyValues:s,alreadyAppliedFilters:void 0!==i.filter?["/"+i.filter]:void 0,objectId:i.objectId}),n("endobj"),"sMask"in i&&void 0!==i.sMask){var c={width:i.width,height:i.height,colorSpace:"DeviceGray",bitsPerComponent:i.bitsPerComponent,decodeParameters:"/Predictor "+i.predictor+" /Colors 1 /BitsPerComponent "+i.bitsPerComponent+" /Columns "+i.width,data:i.sMask};"filter"in i&&(c.filter=i.filter),t.call(this,c)}if(i.colorSpace===w.INDEXED){var h=this.internal.newObject();e({data:k(new Uint8Array(i.palette)),objectId:h}),n("endobj")}},s=function(){var t=this.internal.collections.addImage_images;for(var i in t)r.call(this,t[i])},o=function(){var t,i=this.internal.collections.addImage_images,n=this.internal.write;for(var e in i)n("/I"+(t=i[e]).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},c=function(){return Object.keys(this.internal.collections.addImage_images).length},h=function(i){return"function"==typeof t["process"+i.toUpperCase()]},f=function(t){return"object"===B(t)&&1===t.nodeType},l=function(i,n){if("IMG"===i.nodeName&&i.hasAttribute("src")){var e=""+i.getAttribute("src");if(0===e.indexOf("data:image/"))return Mt(unescape(e).split("base64,").pop());var r=t.loadFile(e,!0);if(void 0!==r)return r}if("CANVAS"===i.nodeName){if(0===i.width||0===i.height)throw new Error("Given canvas must have data. Canvas width: "+i.width+", height: "+i.height);var s;switch(n){case"PNG":s="image/png";break;case"WEBP":s="image/webp";break;default:s="image/jpeg"}return Mt(i.toDataURL(s,1).split("base64,").pop())}},d=function(t){var i=this.internal.collections.addImage_images;if(i)for(var n in i)if(t===i[n].alias)return i[n]},v=function(t,i,n){return t||i||(t=-96,i=-96),t<0&&(t=-1*n.width*72/t/this.internal.scaleFactor),i<0&&(i=-1*n.height*72/i/this.internal.scaleFactor),0===t&&(t=i*n.width/n.height),0===i&&(i=t*n.height/n.width),[t,i]},m=function(t,i,n,e,r,s){var o=v.call(this,n,e,r),a=this.internal.getCoordinateString,c=this.internal.getVerticalCoordinateString,h=u.call(this);if(n=o[0],e=o[1],h[r.index]=r,s){s*=Math.PI/180;var f=Math.cos(s),l=Math.sin(s),d=function(t){return t.toFixed(4)},m=[d(f),d(l),d(-1*l),d(f),0,0,"cm"]}this.internal.write("q"),s?(this.internal.write([1,"0","0",1,a(t),c(i+e),"cm"].join(" ")),this.internal.write(m.join(" ")),this.internal.write([a(n),"0","0",a(e),"0","0","cm"].join(" "))):this.internal.write([a(n),"0","0",a(e),a(t),c(i+e),"cm"].join(" ")),this.isAdvancedAPI()&&this.internal.write([1,0,0,-1,0,0,"cm"].join(" ")),this.internal.write("/I"+r.index+" Do"),this.internal.write("Q")},w=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"},b=t.__addimage__.sHashCode=function(t){var i,n,e=0;if("string"==typeof t)for(n=t.length,i=0;i<n;i++)e=(e<<5)-e+t.charCodeAt(i),e|=0;else if(y(t))for(n=t.byteLength/2,i=0;i<n;i++)e=(e<<5)-e+t[i],e|=0;return e},g=t.__addimage__.validateStringAsBase64=function(t){(t=t||"").toString().trim();var i=!0;return 0===t.length&&(i=!1),t.length%4!=0&&(i=!1),!1===/^[A-Za-z0-9+/]+$/.test(t.substr(0,t.length-2))&&(i=!1),!1===/^[A-Za-z0-9/][A-Za-z0-9+/]|[A-Za-z0-9+/]=|==$/.test(t.substr(-2))&&(i=!1),i},N=t.__addimage__.extractImageFromDataUrl=function(t){var i=(t=t||"").split("base64,"),n=null;if(2===i.length){var e=/^data:(\w*\/\w*);*(charset=(?!charset=)[\w=-]*)*;*$/.exec(i[0]);Array.isArray(e)&&(n={mimeType:e[1],charset:e[2],data:i[1]})}return n},L=t.__addimage__.supportsArrayBuffer=function(){return"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array};t.__addimage__.isArrayBuffer=function(t){return L()&&t instanceof ArrayBuffer};var y=t.__addimage__.isArrayBufferView=function(t){return L()&&"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)},A=t.__addimage__.binaryStringToUint8Array=function(t){for(var i=t.length,n=new Uint8Array(i),e=0;e<i;e++)n[e]=t.charCodeAt(e);return n},k=t.__addimage__.arrayBufferToBinaryString=function(t){for(var i="",n=y(t)?t:new Uint8Array(t),e=0;e<n.length;e+=8192)i+=String.fromCharCode.apply(null,n.subarray(e,e+8192));return i};t.addImage=function(){var t,n,e,r,s,o,u,c,h;if("number"==typeof arguments[1]?(n=i,e=arguments[1],r=arguments[2],s=arguments[3],o=arguments[4],u=arguments[5],c=arguments[6],h=arguments[7]):(n=arguments[1],e=arguments[2],r=arguments[3],s=arguments[4],o=arguments[5],u=arguments[6],c=arguments[7],h=arguments[8]),"object"===B(t=arguments[0])&&!f(t)&&"imageData"in t){var l=t;t=l.imageData,n=l.format||n||i,e=l.x||e||0,r=l.y||r||0,s=l.w||l.width||s,o=l.h||l.height||o,u=l.alias||u,c=l.compression||c,h=l.rotation||l.angle||h}var d=this.internal.getFilters();if(void 0===c&&-1!==d.indexOf("FlateEncode")&&(c="SLOW"),isNaN(e)||isNaN(r))throw new Error("Invalid coordinates passed to jsPDF.addImage");a.call(this);var v=S.call(this,t,n,u,c);return m.call(this,e,r,s,o,v,h),this};var S=function(n,r,s,o){var a,u,v;if("string"==typeof n&&e(n)===i){n=unescape(n);var m=x(n,!1);(""!==m||void 0!==(m=t.loadFile(n,!0)))&&(n=m)}if(f(n)&&(n=l(n,r)),r=e(n,r),!h(r))throw new Error("addImage does not support files of type '"+r+"', please ensure that a plugin for '"+r+"' support is added.");if((null==(v=s)||0===v.length)&&(s=function(t){return"string"==typeof t||y(t)?b(t):y(t.data)?b(t.data):null}(n)),(a=d.call(this,s))||(L()&&(n instanceof Uint8Array||"RGBA"===r||(u=n,n=A(n))),a=this["process"+r.toUpperCase()](n,c.call(this),s,function(i){return i&&"string"==typeof i&&(i=i.toUpperCase()),i in t.image_compression?i:p.NONE}(o),u)),!a)throw new Error("An unknown error occurred whilst processing the image.");return a},x=t.__addimage__.convertBase64ToBinaryString=function(t,i){var n;i="boolean"!=typeof i||i;var e,r="";if("string"==typeof t){e=null!==(n=N(t))?n.data:t;try{r=Mt(e)}catch(t){if(i)throw g(e)?new Error("atob-Error in jsPDF.convertBase64ToBinaryString "+t.message):new Error("Supplied Data is not a valid base64-String jsPDF.convertBase64ToBinaryString ")}}return r};t.getImageProperties=function(n){var r,s,o="";if(f(n)&&(n=l(n)),"string"==typeof n&&e(n)===i&&(""===(o=x(n,!1))&&(o=t.loadFile(n)||""),n=o),s=e(n),!h(s))throw new Error("addImage does not support files of type '"+s+"', please ensure that a plugin for '"+s+"' support is added.");if(!L()||n instanceof Uint8Array||(n=A(n)),!(r=this["process"+s.toUpperCase()](n)))throw new Error("An unknown error occurred whilst processing the image");return r.fileType=s,r}}(ii.API),
101
+ */var Jt={print:4,modify:8,copy:16,"annot-forms":32};function Yt(t,i,n,e){this.v=1,this.r=2;var r=192;t.forEach((function(t){if(void 0!==Jt.perm)throw new Error("Invalid permission: "+t);r+=Jt[t]})),this.padding="(¿N^NuŠAd\0NVÿú\b..\0¶Ðh>€/\f©þdSiz";var s=(i+this.padding).substr(0,32),o=(n+this.padding).substr(0,32);this.O=this.processOwnerPassword(s,o),this.P=-(1+(255^r)),this.encryptionKey=Vt(s+this.O+this.lsbFirstWord(this.P)+this.hexToBytes(e)).substr(0,5),this.U=Gt(this.encryptionKey,this.padding)}function Kt(t){if(/[^\u0000-\u00ff]/.test(t))throw new Error("Invalid PDF Name Object: "+t+", Only accept ASCII characters.");for(var i="",n=t.length,e=0;e<n;e++){var r=t.charCodeAt(e);i+=r<33||35===r||37===r||40===r||41===r||47===r||60===r||62===r||91===r||93===r||123===r||125===r||r>126?"#"+("0"+r.toString(16)).slice(-2):t[e]}return i}function Xt(t){if("object"!==B(t))throw new Error("Invalid Context passed to initialize PubSub (jsPDF-module)");var i={};this.subscribe=function(t,n,e){if(e=e||!1,"string"!=typeof t||"function"!=typeof n||"boolean"!=typeof e)throw new Error("Invalid arguments passed to PubSub.subscribe (jsPDF-module)");i.hasOwnProperty(t)||(i[t]={});var r=Math.random().toString(35);return i[t][r]=[n,!!e],r},this.unsubscribe=function(t){for(var n in i)if(i[n][t])return delete i[n][t],0===Object.keys(i[n]).length&&delete i[n],!0;return!1},this.publish=function(n){if(i.hasOwnProperty(n)){var e=Array.prototype.slice.call(arguments,1),r=[];for(var s in i[n]){var o=i[n][s];try{o[0].apply(t,e)}catch(n){yt.console&&kt.error("jsPDF PubSub Error",n.message,n)}o[1]&&r.push(s)}r.length&&r.forEach(this.unsubscribe)}},this.getTopics=function(){return i}}function $t(t){if(!(this instanceof $t))return new $t(t);var i="opacity,stroke-opacity".split(",");for(var n in t)t.hasOwnProperty(n)&&i.indexOf(n)>=0&&(this[n]=t[n]);this.id="",this.objectNumber=-1}function Qt(t,i){this.gState=t,this.matrix=i,this.id="",this.objectNumber=-1}function Zt(t,i,n,e,r){if(!(this instanceof Zt))return new Zt(t,i,n,e,r);this.type="axial"===t?2:3,this.coords=i,this.colors=n,Qt.call(this,e,r)}function ti(t,i,n,e,r){if(!(this instanceof ti))return new ti(t,i,n,e,r);this.boundingBox=t,this.xStep=i,this.yStep=n,this.stream="",this.cloneIndex=0,Qt.call(this,e,r)}function ii(t){var i,n="string"==typeof arguments[0]?arguments[0]:"p",e=arguments[1],r=arguments[2],s=arguments[3],o=[],a=1,u=16,c="S",h=null;"object"===B(t=t||{})&&(n=t.orientation,e=t.unit||e,r=t.format||r,s=t.compress||t.compressPdf||s,null!==(h=t.encryption||null)&&(h.userPassword=h.userPassword||"",h.ownerPassword=h.ownerPassword||"",h.userPermissions=h.userPermissions||[]),a="number"==typeof t.userUnit?Math.abs(t.userUnit):1,void 0!==t.precision&&(i=t.precision),void 0!==t.floatPrecision&&(u=t.floatPrecision),c=t.defaultPathOperation||"S"),o=t.filters||(!0===s?["FlateEncode"]:o),e=e||"mm",n=(""+(n||"P")).toLowerCase();var f=t.putOnlyUsedFonts||!1,l={},d={internal:{},__private__:{}};d.__private__.PubSub=Xt;var v="1.3",m=d.__private__.getPdfVersion=function(){return v};d.__private__.setPdfVersion=function(t){v=t};var w={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 w};var p=d.__private__.getPageFormat=function(t){return w[t]};r=r||"a4";var b={COMPAT:"compat",ADVANCED:"advanced"},g=b.COMPAT;function N(){this.saveGraphicsState(),Z(new Dt(vt,0,0,-vt,0,zn()*vt).toString()+" cm"),this.setFontSize(this.getFontSize()/vt),c="n",g=b.ADVANCED}function L(){this.restoreGraphicsState(),c="S",g=b.COMPAT}var y=d.__private__.combineFontStyleAndFontWeight=function(t,i){if("bold"==t&&"normal"==i||"bold"==t&&400==i||"normal"==t&&"italic"==i||"bold"==t&&"italic"==i)throw new Error("Invalid Combination of fontweight and fontstyle");return i&&(t=400==i||"normal"===i?"italic"===t?"italic":"normal":700!=i&&"bold"!==i||"normal"!==t?(700==i?"bold":i)+""+t:"bold"),t};d.advancedAPI=function(t){var i=g===b.COMPAT;return i&&N.call(this),"function"!=typeof t||(t(this),i&&L.call(this)),this},d.compatAPI=function(t){var i=g===b.ADVANCED;return i&&L.call(this),"function"!=typeof t||(t(this),i&&N.call(this)),this},d.isAdvancedAPI=function(){return g===b.ADVANCED};var A,k=function(t){if(g!==b.ADVANCED)throw new Error(t+" is only available in 'advanced' API mode. You need to call advancedAPI() first.")},S=d.roundToPrecision=d.__private__.roundToPrecision=function(t,n){var e=i||n;if(isNaN(t)||isNaN(e))throw new Error("Invalid argument passed to jsPDF.roundToPrecision");return t.toFixed(e).replace(/0+$/,"")};A=d.hpf=d.__private__.hpf="number"==typeof u?function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.hpf");return S(t,u)}:"smart"===u?function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.hpf");return S(t,t>-1&&t<1?16:5)}:function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.hpf");return S(t,16)};var x=d.f2=d.__private__.f2=function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.f2");return S(t,2)},q=d.__private__.f3=function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.f3");return S(t,3)},M=d.scale=d.__private__.scale=function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.scale");return g===b.COMPAT?t*vt:g===b.ADVANCED?t:void 0},j=function(t){return g===b.COMPAT?zn()-t:g===b.ADVANCED?t:void 0},E=function(t){return M(j(t))};d.__private__.setPrecision=d.setPrecision=function(t){"number"==typeof parseInt(t,10)&&(i=parseInt(t,10))};var P,I="00000000000000000000000000000000",O=d.__private__.getFileId=function(){return I},F=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!==h&&(Ji=new Yt(h.userPermissions,h.userPassword,h.ownerPassword,I)),I};d.setFileId=function(t){return F(t),this},d.getFileId=function(){return O()};var R=d.__private__.convertDateToPDFDate=function(t){var i=t.getTimezoneOffset(),n=i<0?"+":"-",e=Math.floor(Math.abs(i/60)),r=Math.abs(i%60),s=[n,_(e),"'",_(r),"'"].join("");return["D:",t.getFullYear(),_(t.getMonth()+1),_(t.getDate()),_(t.getHours()),_(t.getMinutes()),_(t.getSeconds()),s].join("")},C=d.__private__.convertPDFDateToDate=function(t){var i=parseInt(t.substr(2,4),10),n=parseInt(t.substr(6,2),10)-1,e=parseInt(t.substr(8,2),10),r=parseInt(t.substr(10,2),10),s=parseInt(t.substr(12,2),10),o=parseInt(t.substr(14,2),10);return new Date(i,n,e,r,s,o,0)},D=d.__private__.setCreationDate=function(t){var i;if(void 0===t&&(t=new Date),t instanceof Date)i=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");i=t}return P=i},T=d.__private__.getCreationDate=function(t){var i=P;return"jsDate"===t&&(i=C(P)),i};d.setCreationDate=function(t){return D(t),this},d.getCreationDate=function(t){return T(t)};var z,_=d.__private__.padd2=function(t){return("0"+parseInt(t)).slice(-2)},U=d.__private__.padd2Hex=function(t){return("00"+(t=t.toString())).substr(t.length)},V=0,W=[],H=[],G=0,J=[],Y=[],K=!1,X=H,$=function(){V=0,G=0,H=[],W=[],J=[],Gt=Vt(),Jt=Vt()};d.__private__.setCustomOutputDestination=function(t){K=!0,X=t};var Q=function(t){K||(X=t)};d.__private__.resetCustomOutputDestination=function(){K=!1,X=H};var Z=d.__private__.out=function(t){return t=t.toString(),G+=t.length+1,X.push(t),X},tt=d.__private__.write=function(t){return Z(1===arguments.length?t.toString():Array.prototype.join.call(arguments," "))},it=d.__private__.getArrayBuffer=function(t){for(var i=t.length,n=new ArrayBuffer(i),e=new Uint8Array(n);i--;)e[i]=t.charCodeAt(i);return n},nt=[["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 nt};var et=t.fontSize||16;d.__private__.setFontSize=d.setFontSize=function(t){return et=g===b.ADVANCED?t/vt:t,this};var rt,st=d.__private__.getFontSize=d.getFontSize=function(){return g===b.COMPAT?et:et*vt},ot=t.R2L||!1;d.__private__.setR2L=d.setR2L=function(t){return ot=t,this},d.__private__.getR2L=d.getR2L=function(){return ot};var at,ut=d.__private__.setZoomMode=function(t){if(/^(?:\d+\.\d*|\d*\.\d+|\d+)%$/.test(t))rt=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.');rt=t}else rt=parseInt(t,10)};d.__private__.getZoomMode=function(){return rt};var ct,ht=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.');at=t};d.__private__.getPageMode=function(){return at};var ft=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.');ct=t};d.__private__.getLayoutMode=function(){return ct},d.__private__.setDisplayMode=d.setDisplayMode=function(t,i,n){return ut(t),ft(i),ht(n),this};var lt={title:"",subject:"",author:"",keywords:"",creator:""};d.__private__.getDocumentProperty=function(t){if(-1===Object.keys(lt).indexOf(t))throw new Error("Invalid argument passed to jsPDF.getDocumentProperty");return lt[t]},d.__private__.getDocumentProperties=function(){return lt},d.__private__.setDocumentProperties=d.setProperties=d.setDocumentProperties=function(t){for(var i in lt)lt.hasOwnProperty(i)&&t[i]&&(lt[i]=t[i]);return this},d.__private__.setDocumentProperty=function(t,i){if(-1===Object.keys(lt).indexOf(t))throw new Error("Invalid arguments passed to jsPDF.setDocumentProperty");return lt[t]=i};var dt,vt,mt,wt,pt,bt={},gt={},Nt=[],Lt={},At={},St={},xt={},qt=null,Mt=0,It=[],Ot=new Xt(d),Ft=t.hotfixes||[],Rt={},Bt={},Ct=[],Dt=function t(i,n,e,r,s,o){if(!(this instanceof t))return new t(i,n,e,r,s,o);isNaN(i)&&(i=1),isNaN(n)&&(n=0),isNaN(e)&&(e=0),isNaN(r)&&(r=1),isNaN(s)&&(s=0),isNaN(o)&&(o=0),this._matrix=[i,n,e,r,s,o]};Object.defineProperty(Dt.prototype,"sx",{get:function(){return this._matrix[0]},set:function(t){this._matrix[0]=t}}),Object.defineProperty(Dt.prototype,"shy",{get:function(){return this._matrix[1]},set:function(t){this._matrix[1]=t}}),Object.defineProperty(Dt.prototype,"shx",{get:function(){return this._matrix[2]},set:function(t){this._matrix[2]=t}}),Object.defineProperty(Dt.prototype,"sy",{get:function(){return this._matrix[3]},set:function(t){this._matrix[3]=t}}),Object.defineProperty(Dt.prototype,"tx",{get:function(){return this._matrix[4]},set:function(t){this._matrix[4]=t}}),Object.defineProperty(Dt.prototype,"ty",{get:function(){return this._matrix[5]},set:function(t){this._matrix[5]=t}}),Object.defineProperty(Dt.prototype,"a",{get:function(){return this._matrix[0]},set:function(t){this._matrix[0]=t}}),Object.defineProperty(Dt.prototype,"b",{get:function(){return this._matrix[1]},set:function(t){this._matrix[1]=t}}),Object.defineProperty(Dt.prototype,"c",{get:function(){return this._matrix[2]},set:function(t){this._matrix[2]=t}}),Object.defineProperty(Dt.prototype,"d",{get:function(){return this._matrix[3]},set:function(t){this._matrix[3]=t}}),Object.defineProperty(Dt.prototype,"e",{get:function(){return this._matrix[4]},set:function(t){this._matrix[4]=t}}),Object.defineProperty(Dt.prototype,"f",{get:function(){return this._matrix[5]},set:function(t){this._matrix[5]=t}}),Object.defineProperty(Dt.prototype,"rotation",{get:function(){return Math.atan2(this.shx,this.sx)}}),Object.defineProperty(Dt.prototype,"scaleX",{get:function(){return this.decompose().scale.sx}}),Object.defineProperty(Dt.prototype,"scaleY",{get:function(){return this.decompose().scale.sy}}),Object.defineProperty(Dt.prototype,"isIdentity",{get:function(){return 1===this.sx&&0===this.shy&&0===this.shx&&1===this.sy&&0===this.tx&&0===this.ty}}),Dt.prototype.join=function(t){return[this.sx,this.shy,this.shx,this.sy,this.tx,this.ty].map(A).join(t)},Dt.prototype.multiply=function(t){return new Dt(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)},Dt.prototype.decompose=function(){var t=this.sx,i=this.shy,n=this.shx,e=this.sy,r=this.tx,s=this.ty,o=Math.sqrt(t*t+i*i),a=(t/=o)*n+(i/=o)*e;n-=t*a,e-=i*a;var u=Math.sqrt(n*n+e*e);return a/=u,t*(e/=u)<i*(n/=u)&&(t=-t,i=-i,a=-a,o=-o),{scale:new Dt(o,0,0,u,0,0),translate:new Dt(1,0,0,1,r,s),rotate:new Dt(t,i,-i,t,0,0),skew:new Dt(1,0,a,1,0,0)}},Dt.prototype.toString=function(){return this.join(" ")},Dt.prototype.inversed=function(){var t=this.sx,i=this.shy,n=this.shx,e=this.sy,r=this.tx,s=this.ty,o=1/(t*e-i*n),a=e*o,u=-i*o,c=-n*o,h=t*o;return new Dt(a,u,c,h,-a*r-c*s,-u*r-h*s)},Dt.prototype.applyToPoint=function(t){return new In(t.x*this.sx+t.y*this.shx+this.tx,t.x*this.shy+t.y*this.sy+this.ty)},Dt.prototype.applyToRectangle=function(t){var i=this.applyToPoint(t),n=this.applyToPoint(new In(t.x+t.w,t.y+t.h));return new On(i.x,i.y,n.x-i.x,n.y-i.y)},Dt.prototype.clone=function(){return new Dt(this.sx,this.shy,this.shx,this.sy,this.tx,this.ty)},d.Matrix=Dt;var Tt=d.matrixMult=function(t,i){return i.multiply(t)},zt=new Dt(1,0,0,1,0,0);d.unitMatrix=d.identityMatrix=zt;var _t=function(t,i){if(!At[t]){var n=(i instanceof Zt?"Sh":"P")+(Object.keys(Lt).length+1).toString(10);i.id=n,At[t]=n,Lt[n]=i,Ot.publish("addPattern",i)}};d.ShadingPattern=Zt,d.TilingPattern=ti,d.addShadingPattern=function(t,i){return k("addShadingPattern()"),_t(t,i),this},d.beginTilingPattern=function(t){k("beginTilingPattern()"),Rn(t.boundingBox[0],t.boundingBox[1],t.boundingBox[2]-t.boundingBox[0],t.boundingBox[3]-t.boundingBox[1],t.matrix)},d.endTilingPattern=function(t,i){k("endTilingPattern()"),i.stream=Y[z].join("\n"),_t(t,i),Ot.publish("endTilingPattern",i),Ct.pop().restore()};var Ut=d.__private__.newObject=function(){var t=Vt();return Wt(t,!0),t},Vt=d.__private__.newObjectDeferred=function(){return V++,W[V]=function(){return G},V},Wt=function(t,i){return i="boolean"==typeof i&&i,W[t]=G,i&&Z(t+" 0 obj"),t},Ht=d.__private__.newAdditionalObject=function(){var t={objId:Vt(),content:""};return J.push(t),t},Gt=Vt(),Jt=Vt(),Qt=d.__private__.decodeColorString=function(t){var i=t.split(" ");if(2!==i.length||"g"!==i[1]&&"G"!==i[1])5!==i.length||"k"!==i[4]&&"K"!==i[4]||(i=[(1-i[0])*(1-i[3]),(1-i[1])*(1-i[3]),(1-i[2])*(1-i[3]),"r"]);else{var n=parseFloat(i[0]);i=[n,n,n,"r"]}for(var e="#",r=0;r<3;r++)e+=("0"+Math.floor(255*parseFloat(i[r])).toString(16)).slice(-2);return e},ni=d.__private__.encodeColorString=function(t){var i;"string"==typeof t&&(t={ch1:t});var n=t.ch1,e=t.ch2,r=t.ch3,s=t.ch4,o="draw"===t.pdfColorType?["G","RG","K"]:["g","rg","k"];if("string"==typeof n&&"#"!==n.charAt(0)){var a=new Pt(n);if(a.ok)n=a.toHex();else if(!/^\d*\.?\d*$/.test(n))throw new Error('Invalid color "'+n+'" passed to jsPDF.encodeColorString.')}if("string"==typeof n&&/^#[0-9A-Fa-f]{3}$/.test(n)&&(n="#"+n[1]+n[1]+n[2]+n[2]+n[3]+n[3]),"string"==typeof n&&/^#[0-9A-Fa-f]{6}$/.test(n)){var u=parseInt(n.substr(1),16);n=u>>16&255,e=u>>8&255,r=255&u}if(void 0===e||void 0===s&&n===e&&e===r)i="string"==typeof n?n+" "+o[0]:2===t.precision?x(n/255)+" "+o[0]:q(n/255)+" "+o[0];else if(void 0===s||"object"===B(s)){if(s&&!isNaN(s.a)&&0===s.a)return["1.","1.","1.",o[1]].join(" ");i="string"==typeof n?[n,e,r,o[1]].join(" "):2===t.precision?[x(n/255),x(e/255),x(r/255),o[1]].join(" "):[q(n/255),q(e/255),q(r/255),o[1]].join(" ")}else i="string"==typeof n?[n,e,r,s,o[2]].join(" "):2===t.precision?[x(n),x(e),x(r),x(s),o[2]].join(" "):[q(n),q(e),q(r),q(s),o[2]].join(" ");return i},ei=d.__private__.getFilters=function(){return o},ri=d.__private__.putStream=function(t){var i=(t=t||{}).data||"",n=t.filters||ei(),e=t.alreadyAppliedFilters||[],r=t.addLength1||!1,s=i.length,o=t.objectId,a=function(t){return t};if(null!==h&&void 0===o)throw new Error("ObjectId must be passed to putStream for file encryption");null!==h&&(a=Ji.encryptor(o,0));var u={};!0===n&&(n=["FlateEncode"]);var c=t.additionalKeyValues||[],f=(u=void 0!==ii.API.processDataByFilters?ii.API.processDataByFilters(i,n):{data:i,reverseChain:[]}).reverseChain+(Array.isArray(e)?e.join(" "):e.toString());if(0!==u.data.length&&(c.push({key:"Length",value:u.data.length}),!0===r&&c.push({key:"Length1",value:s})),0!=f.length)if(f.split("/").length-1==1)c.push({key:"Filter",value:f});else{c.push({key:"Filter",value:"["+f+"]"});for(var l=0;l<c.length;l+=1)if("DecodeParms"===c[l].key){for(var d=[],v=0;v<u.reverseChain.split("/").length-1;v+=1)d.push("null");d.push(c[l].value),c[l].value="["+d.join(" ")+"]"}}Z("<<");for(var m=0;m<c.length;m++)Z("/"+c[m].key+" "+c[m].value);Z(">>"),0!==u.data.length&&(Z("stream"),Z(a(u.data)),Z("endstream"))},si=d.__private__.putPage=function(t){var i=t.number,n=t.data,e=t.objId,r=t.contentsObjId;Wt(e,!0),Z("<</Type /Page"),Z("/Parent "+t.rootDictionaryObjId+" 0 R"),Z("/Resources "+t.resourceDictionaryObjId+" 0 R"),Z("/MediaBox ["+parseFloat(A(t.mediaBox.bottomLeftX))+" "+parseFloat(A(t.mediaBox.bottomLeftY))+" "+A(t.mediaBox.topRightX)+" "+A(t.mediaBox.topRightY)+"]"),null!==t.cropBox&&Z("/CropBox ["+A(t.cropBox.bottomLeftX)+" "+A(t.cropBox.bottomLeftY)+" "+A(t.cropBox.topRightX)+" "+A(t.cropBox.topRightY)+"]"),null!==t.bleedBox&&Z("/BleedBox ["+A(t.bleedBox.bottomLeftX)+" "+A(t.bleedBox.bottomLeftY)+" "+A(t.bleedBox.topRightX)+" "+A(t.bleedBox.topRightY)+"]"),null!==t.trimBox&&Z("/TrimBox ["+A(t.trimBox.bottomLeftX)+" "+A(t.trimBox.bottomLeftY)+" "+A(t.trimBox.topRightX)+" "+A(t.trimBox.topRightY)+"]"),null!==t.artBox&&Z("/ArtBox ["+A(t.artBox.bottomLeftX)+" "+A(t.artBox.bottomLeftY)+" "+A(t.artBox.topRightX)+" "+A(t.artBox.topRightY)+"]"),"number"==typeof t.userUnit&&1!==t.userUnit&&Z("/UserUnit "+t.userUnit),Ot.publish("putPage",{objId:e,pageContext:It[i],pageNumber:i,page:n}),Z("/Contents "+r+" 0 R"),Z(">>"),Z("endobj");var s=n.join("\n");return g===b.ADVANCED&&(s+="\nQ"),Wt(r,!0),ri({data:s,filters:ei(),objectId:r}),Z("endobj"),e},oi=d.__private__.putPages=function(){var t,i,n=[];for(t=1;t<=Mt;t++)It[t].objId=Vt(),It[t].contentsObjId=Vt();for(t=1;t<=Mt;t++)n.push(si({number:t,data:Y[t],objId:It[t].objId,contentsObjId:It[t].contentsObjId,mediaBox:It[t].mediaBox,cropBox:It[t].cropBox,bleedBox:It[t].bleedBox,trimBox:It[t].trimBox,artBox:It[t].artBox,userUnit:It[t].userUnit,rootDictionaryObjId:Gt,resourceDictionaryObjId:Jt}));Wt(Gt,!0),Z("<</Type /Pages");var e="/Kids [";for(i=0;i<Mt;i++)e+=n[i]+" 0 R ";Z(e+"]"),Z("/Count "+Mt),Z(">>"),Z("endobj"),Ot.publish("postPutPages")},ai=function(t){Ot.publish("putFont",{font:t,out:Z,newObject:Ut,putStream:ri}),!0!==t.isAlreadyPutted&&(t.objectNumber=Ut(),Z("<<"),Z("/Type /Font"),Z("/BaseFont /"+Kt(t.postScriptName)),Z("/Subtype /Type1"),"string"==typeof t.encoding&&Z("/Encoding /"+t.encoding),Z("/FirstChar 32"),Z("/LastChar 255"),Z(">>"),Z("endobj"))},ui=function(){for(var t in bt)bt.hasOwnProperty(t)&&(!1===f||!0===f&&l.hasOwnProperty(t))&&ai(bt[t])},ci=function(t){t.objectNumber=Ut();var i=[];i.push({key:"Type",value:"/XObject"}),i.push({key:"Subtype",value:"/Form"}),i.push({key:"BBox",value:"["+[A(t.x),A(t.y),A(t.x+t.width),A(t.y+t.height)].join(" ")+"]"}),i.push({key:"Matrix",value:"["+t.matrix.toString()+"]"});var n=t.pages[1].join("\n");ri({data:n,additionalKeyValues:i,objectId:t.objectNumber}),Z("endobj")},hi=function(){for(var t in Rt)Rt.hasOwnProperty(t)&&ci(Rt[t])},fi=function(t,i){var n,e=[],r=1/(i-1);for(n=0;n<1;n+=r)e.push(n);e.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<e.length;a++){for(n=e[a];n>t[o+1].offset;)o++;var u=t[o].offset,c=(n-u)/(t[o+1].offset-u),h=t[o].color,f=t[o+1].color;s+=U(Math.round((1-c)*h[0]+c*f[0]).toString(16))+U(Math.round((1-c)*h[1]+c*f[1]).toString(16))+U(Math.round((1-c)*h[2]+c*f[2]).toString(16))}return s.trim()},li=function(t,i){i||(i=21);var n=Ut(),e=fi(t.colors,i),r=[];r.push({key:"FunctionType",value:"0"}),r.push({key:"Domain",value:"[0.0 1.0]"}),r.push({key:"Size",value:"["+i+"]"}),r.push({key:"BitsPerSample",value:"8"}),r.push({key:"Range",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),r.push({key:"Decode",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),ri({data:e,additionalKeyValues:r,alreadyAppliedFilters:["/ASCIIHexDecode"],objectId:n}),Z("endobj"),t.objectNumber=Ut(),Z("<< /ShadingType "+t.type),Z("/ColorSpace /DeviceRGB");var s="/Coords ["+A(parseFloat(t.coords[0]))+" "+A(parseFloat(t.coords[1]))+" ";s+=2===t.type?A(parseFloat(t.coords[2]))+" "+A(parseFloat(t.coords[3])):A(parseFloat(t.coords[2]))+" "+A(parseFloat(t.coords[3]))+" "+A(parseFloat(t.coords[4]))+" "+A(parseFloat(t.coords[5])),Z(s+="]"),t.matrix&&Z("/Matrix ["+t.matrix.toString()+"]"),Z("/Function "+n+" 0 R"),Z("/Extend [true true]"),Z(">>"),Z("endobj")},di=function(t,i){var n=Vt(),e=Ut();i.push({resourcesOid:n,objectOid:e}),t.objectNumber=e;var r=[];r.push({key:"Type",value:"/Pattern"}),r.push({key:"PatternType",value:"1"}),r.push({key:"PaintType",value:"1"}),r.push({key:"TilingType",value:"1"}),r.push({key:"BBox",value:"["+t.boundingBox.map(A).join(" ")+"]"}),r.push({key:"XStep",value:A(t.xStep)}),r.push({key:"YStep",value:A(t.yStep)}),r.push({key:"Resources",value:n+" 0 R"}),t.matrix&&r.push({key:"Matrix",value:"["+t.matrix.toString()+"]"}),ri({data:t.stream,additionalKeyValues:r,objectId:t.objectNumber}),Z("endobj")},vi=function(t){var i;for(i in Lt)Lt.hasOwnProperty(i)&&(Lt[i]instanceof Zt?li(Lt[i]):Lt[i]instanceof ti&&di(Lt[i],t))},mi=function(t){for(var i in t.objectNumber=Ut(),Z("<<"),t)switch(i){case"opacity":Z("/ca "+x(t[i]));break;case"stroke-opacity":Z("/CA "+x(t[i]))}Z(">>"),Z("endobj")},wi=function(){var t;for(t in St)St.hasOwnProperty(t)&&mi(St[t])},pi=function(){for(var t in Z("/XObject <<"),Rt)Rt.hasOwnProperty(t)&&Rt[t].objectNumber>=0&&Z("/"+t+" "+Rt[t].objectNumber+" 0 R");Ot.publish("putXobjectDict"),Z(">>")},bi=function(){Ji.oid=Ut(),Z("<<"),Z("/Filter /Standard"),Z("/V "+Ji.v),Z("/R "+Ji.r),Z("/U <"+Ji.toHexString(Ji.U)+">"),Z("/O <"+Ji.toHexString(Ji.O)+">"),Z("/P "+Ji.P),Z(">>"),Z("endobj")},gi=function(){for(var t in Z("/Font <<"),bt)bt.hasOwnProperty(t)&&(!1===f||!0===f&&l.hasOwnProperty(t))&&Z("/"+t+" "+bt[t].objectNumber+" 0 R");Z(">>")},Ni=function(){if(Object.keys(Lt).length>0){for(var t in Z("/Shading <<"),Lt)Lt.hasOwnProperty(t)&&Lt[t]instanceof Zt&&Lt[t].objectNumber>=0&&Z("/"+t+" "+Lt[t].objectNumber+" 0 R");Ot.publish("putShadingPatternDict"),Z(">>")}},Li=function(t){if(Object.keys(Lt).length>0){for(var i in Z("/Pattern <<"),Lt)Lt.hasOwnProperty(i)&&Lt[i]instanceof d.TilingPattern&&Lt[i].objectNumber>=0&&Lt[i].objectNumber<t&&Z("/"+i+" "+Lt[i].objectNumber+" 0 R");Ot.publish("putTilingPatternDict"),Z(">>")}},yi=function(){if(Object.keys(St).length>0){var t;for(t in Z("/ExtGState <<"),St)St.hasOwnProperty(t)&&St[t].objectNumber>=0&&Z("/"+t+" "+St[t].objectNumber+" 0 R");Ot.publish("putGStateDict"),Z(">>")}},Ai=function(t){Wt(t.resourcesOid,!0),Z("<<"),Z("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),gi(),Ni(),Li(t.objectOid),yi(),pi(),Z(">>"),Z("endobj")},ki=function(){var t=[];ui(),wi(),hi(),vi(t),Ot.publish("putResources"),t.forEach(Ai),Ai({resourcesOid:Jt,objectOid:Number.MAX_SAFE_INTEGER}),Ot.publish("postPutResources")},Si=function(){Ot.publish("putAdditionalObjects");for(var t=0;t<J.length;t++){var i=J[t];Wt(i.objId,!0),Z(i.content),Z("endobj")}Ot.publish("postPutAdditionalObjects")},xi=function(t){gt[t.fontName]=gt[t.fontName]||{},gt[t.fontName][t.fontStyle]=t.id},qi=function(t,i,n,e,r){var s={id:"F"+(Object.keys(bt).length+1).toString(10),postScriptName:t,fontName:i,fontStyle:n,encoding:e,isStandardFont:r||!1,metadata:{}};return Ot.publish("addFont",{font:s,instance:this}),bt[s.id]=s,xi(s),s.id},Mi=function(t){for(var i=0,n=nt.length;i<n;i++){var e=qi.call(this,t[i][0],t[i][1],t[i][2],nt[i][3],!0);!1===f&&(l[e]=!0);var r=t[i][0].split("-");xi({id:e,fontName:r[0],fontStyle:r[1]||""})}Ot.publish("addFonts",{fonts:bt,dictionary:gt})},ji=function(t){return t.foo=function(){try{return t.apply(this,arguments)}catch(t){var i=t.stack||"";~i.indexOf(" at ")&&(i=i.split(" at ")[1]);var n="Error in function "+i.split("\n")[0].split("<")[0]+": "+t.message;if(!yt.console)throw new Error(n);yt.console.error(n,t),yt.alert&&alert(n)}},t.foo.bar=t,t.foo},Ei=function(t,i){var n,e,r,s,o,a,u,c,h;if(r=(i=i||{}).sourceEncoding||"Unicode",o=i.outputEncoding,(i.autoencode||o)&&bt[dt].metadata&&bt[dt].metadata[r]&&bt[dt].metadata[r].encoding&&(s=bt[dt].metadata[r].encoding,!o&&bt[dt].encoding&&(o=bt[dt].encoding),!o&&s.codePages&&(o=s.codePages[0]),"string"==typeof o&&(o=s[o]),o)){for(u=!1,a=[],n=0,e=t.length;n<e;n++)(c=o[t.charCodeAt(n)])?a.push(String.fromCharCode(c)):a.push(t[n]),a[n].charCodeAt(0)>>8&&(u=!0);t=a.join("")}for(n=t.length;void 0===u&&0!==n;)t.charCodeAt(n-1)>>8&&(u=!0),n--;if(!u)return t;for(a=i.noBOM?[]:[254,255],n=0,e=t.length;n<e;n++){if((h=(c=t.charCodeAt(n))>>8)>>8)throw new Error("Character at position "+n+" of string '"+t+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");a.push(h),a.push(c-(h<<8))}return String.fromCharCode.apply(void 0,a)},Pi=d.__private__.pdfEscape=d.pdfEscape=function(t,i){return Ei(t,i).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},Ii=d.__private__.beginPage=function(t){Y[++Mt]=[],It[Mt]={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])}},Ri(Mt),Q(Y[z])},Oi=function(t,i){var e,s,o;switch(n=i||n,"string"==typeof t&&(e=p(t.toLowerCase()),Array.isArray(e)&&(s=e[0],o=e[1])),Array.isArray(t)&&(s=t[0]*vt,o=t[1]*vt),isNaN(s)&&(s=r[0],o=r[1]),(s>14400||o>14400)&&(kt.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)),r=[s,o],n.substr(0,1)){case"l":o>s&&(r=[o,s]);break;case"p":s>o&&(r=[o,s])}Ii(r),mn(dn),Z(An),0!==jn&&Z(jn+" J"),0!==En&&Z(En+" j"),Ot.publish("addPage",{pageNumber:Mt})},Fi=function(t){t>0&&t<=Mt&&(Y.splice(t,1),It.splice(t,1),Mt--,z>Mt&&(z=Mt),this.setPage(z))},Ri=function(t){t>0&&t<=Mt&&(z=t)},Bi=d.__private__.getNumberOfPages=d.getNumberOfPages=function(){return Y.length-1},Ci=function(t,i,n){var e,r=void 0;return n=n||{},i=void 0!==i?i:bt[dt].fontStyle,e=(t=void 0!==t?t:bt[dt].fontName).toLowerCase(),void 0!==gt[e]&&void 0!==gt[e][i]?r=gt[e][i]:void 0!==gt[t]&&void 0!==gt[t][i]?r=gt[t][i]:!1===n.disableWarning&&kt.warn("Unable to look up font label for font '"+t+"', '"+i+"'. Refer to getFontList() for available fonts."),r||n.noFallback||null==(r=gt.times[i])&&(r=gt.times.normal),r},Di=d.__private__.putInfo=function(){var t=Ut(),i=function(t){return t};for(var n in null!==h&&(i=Ji.encryptor(t,0)),Z("<<"),Z("/Producer ("+Pi(i("jsPDF "+ii.version))+")"),lt)lt.hasOwnProperty(n)&&lt[n]&&Z("/"+n.substr(0,1).toUpperCase()+n.substr(1)+" ("+Pi(i(lt[n]))+")");Z("/CreationDate ("+Pi(i(P))+")"),Z(">>"),Z("endobj")},Ti=d.__private__.putCatalog=function(t){var i=(t=t||{}).rootDictionaryObjId||Gt;switch(Ut(),Z("<<"),Z("/Type /Catalog"),Z("/Pages "+i+" 0 R"),rt||(rt="fullwidth"),rt){case"fullwidth":Z("/OpenAction [3 0 R /FitH null]");break;case"fullheight":Z("/OpenAction [3 0 R /FitV null]");break;case"fullpage":Z("/OpenAction [3 0 R /Fit]");break;case"original":Z("/OpenAction [3 0 R /XYZ null null 1]");break;default:var n=""+rt;"%"===n.substr(n.length-1)&&(rt=parseInt(rt)/100),"number"==typeof rt&&Z("/OpenAction [3 0 R /XYZ null null "+x(rt)+"]")}switch(ct||(ct="continuous"),ct){case"continuous":Z("/PageLayout /OneColumn");break;case"single":Z("/PageLayout /SinglePage");break;case"two":case"twoleft":Z("/PageLayout /TwoColumnLeft");break;case"tworight":Z("/PageLayout /TwoColumnRight")}at&&Z("/PageMode /"+at),Ot.publish("putCatalog"),Z(">>"),Z("endobj")},zi=d.__private__.putTrailer=function(){Z("trailer"),Z("<<"),Z("/Size "+(V+1)),Z("/Root "+V+" 0 R"),Z("/Info "+(V-1)+" 0 R"),null!==h&&Z("/Encrypt "+Ji.oid+" 0 R"),Z("/ID [ <"+I+"> <"+I+"> ]"),Z(">>")},_i=d.__private__.putHeader=function(){Z("%PDF-"+v),Z("%ºß¬à")},Ui=d.__private__.putXRef=function(){var t="0000000000";Z("xref"),Z("0 "+(V+1)),Z("0000000000 65535 f ");for(var i=1;i<=V;i++)Z("function"==typeof W[i]?(t+W[i]()).slice(-10)+" 00000 n ":void 0!==W[i]?(t+W[i]).slice(-10)+" 00000 n ":"0000000000 00000 n ")},Vi=d.__private__.buildDocument=function(){$(),Q(H),Ot.publish("buildDocument"),_i(),oi(),Si(),ki(),null!==h&&bi(),Di(),Ti();var t=G;return Ui(),zi(),Z("startxref"),Z(""+t),Z("%%EOF"),Q(Y[z]),H.join("\n")},Wi=d.__private__.getBlob=function(t){return new Blob([it(t)],{type:"application/pdf"})},Hi=d.output=d.__private__.output=ji((function(t,i){switch("string"==typeof(i=i||{})?i={filename:i}:i.filename=i.filename||"generated.pdf",t){case void 0:return Vi();case"save":d.save(i.filename);break;case"arraybuffer":return it(Vi());case"blob":return Wi(Vi());case"bloburi":case"bloburl":if(void 0!==yt.URL&&"function"==typeof yt.URL.createObjectURL)return yt.URL&&yt.URL.createObjectURL(Wi(Vi()))||void 0;kt.warn("bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.");break;case"datauristring":case"dataurlstring":var n="",e=Vi();try{n=jt(e)}catch(t){n=jt(unescape(encodeURIComponent(e)))}return"data:application/pdf;filename="+i.filename+";base64,"+n;case"pdfobjectnewwindow":if("[object Window]"===Object.prototype.toString.call(yt)){var r="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"';i.pdfObjectUrl&&(r=i.pdfObjectUrl,s="");var o='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><script src="'+r+'"'+s+'><\/script><script >PDFObject.embed("'+this.output("dataurlstring")+'", '+JSON.stringify(i)+");<\/script></body></html>",a=yt.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(yt)){var u='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><iframe id="pdfViewer" src="'+(i.pdfJsUrl||"examples/PDF.js/web/viewer.html")+"?file=&downloadName="+i.filename+'" width="500px" height="400px" /></body></html>',c=yt.open();if(null!==c){c.document.write(u);var h=this;c.document.documentElement.querySelector("#pdfViewer").onload=function(){c.document.title=i.filename,c.document.documentElement.querySelector("#pdfViewer").contentWindow.PDFViewerApplication.open(h.output("bloburl"))}}return c}throw new Error("The option pdfjsnewwindow just works in a browser-environment.");case"dataurlnewwindow":if("[object Window]"!==Object.prototype.toString.call(yt))throw new Error("The option dataurlnewwindow just works in a browser-environment.");var f='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><iframe src="'+this.output("datauristring",i)+'"></iframe></body></html>',l=yt.open();if(null!==l&&(l.document.write(f),l.document.title=i.filename),l||"undefined"==typeof safari)return l;break;case"datauri":case"dataurl":return yt.document.location.href=this.output("datauristring",i);default:return null}})),Gi=function(t){return!0===Array.isArray(Ft)&&Ft.indexOf(t)>-1};switch(e){case"pt":vt=1;break;case"mm":vt=72/25.4;break;case"cm":vt=72/2.54;break;case"in":vt=72;break;case"px":vt=1==Gi("px_scaling")?.75:96/72;break;case"pc":case"em":vt=12;break;case"ex":vt=6;break;default:if("number"!=typeof e)throw new Error("Invalid unit: "+e);vt=e}var Ji=null;D(),F();var Yi=function(t){return null!==h?Ji.encryptor(t,0):function(t){return t}},Ki=d.__private__.getPageInfo=d.getPageInfo=function(t){if(isNaN(t)||t%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfo");return{objId:It[t].objId,pageNumber:t,pageContext:It[t]}},Xi=d.__private__.getPageInfoByObjId=function(t){if(isNaN(t)||t%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfoByObjId");for(var i in It)if(It[i].objId===t)break;return Ki(i)},$i=d.__private__.getCurrentPageInfo=d.getCurrentPageInfo=function(){return{objId:It[z].objId,pageNumber:z,pageContext:It[z]}};d.addPage=function(){return Oi.apply(this,arguments),this},d.setPage=function(){return Ri.apply(this,arguments),Q.call(this,Y[z]),this},d.insertPage=function(t){return this.addPage(),this.movePage(z,t),this},d.movePage=function(t,i){var n,e;if(t>i){n=Y[t],e=It[t];for(var r=t;r>i;r--)Y[r]=Y[r-1],It[r]=It[r-1];Y[i]=n,It[i]=e,this.setPage(i)}else if(t<i){n=Y[t],e=It[t];for(var s=t;s<i;s++)Y[s]=Y[s+1],It[s]=It[s+1];Y[i]=n,It[i]=e,this.setPage(i)}return this},d.deletePage=function(){return Fi.apply(this,arguments),this},d.__private__.text=d.text=function(t,i,n,e,r){var s,o,a,u,c,h,f,d,v,m=(e=e||{}).scope||this;if("number"==typeof t&&"number"==typeof i&&("string"==typeof n||Array.isArray(n))){var w=n;n=i,i=t,t=w}if(arguments[3]instanceof Dt==0?(a=arguments[4],u=arguments[5],"object"===B(f=arguments[3])&&null!==f||("string"==typeof a&&(u=a,a=null),"string"==typeof f&&(u=f,f=null),"number"==typeof f&&(a=f,f=null),e={flags:f,angle:a,align:u})):(k("The transform parameter of text() with a Matrix value"),v=r),isNaN(i)||isNaN(n)||null==t)throw new Error("Invalid arguments passed to jsPDF.text");if(0===t.length)return m;var p="",N=!1,L="number"==typeof e.lineHeightFactor?e.lineHeightFactor:ln,y=m.internal.scaleFactor;function S(t){return t=t.split("\t").join(Array(e.TabLen||9).join(" ")),Pi(t,f)}function x(t){for(var i,n=t.concat(),e=[],r=n.length;r--;)"string"==typeof(i=n.shift())?e.push(i):Array.isArray(t)&&(1===i.length||void 0===i[1]&&void 0===i[2])?e.push(i[0]):e.push([i[0],i[1],i[2]]);return e}function q(t,i){var n;if("string"==typeof t)n=i(t)[0];else if(Array.isArray(t)){for(var e,r,s=t.concat(),o=[],a=s.length;a--;)"string"==typeof(e=s.shift())?o.push(i(e)[0]):Array.isArray(e)&&"string"==typeof e[0]&&(r=i(e[0],e[1],e[2]),o.push([r[0],r[1],r[2]]));n=o}return n}var j=!1,E=!0;if("string"==typeof t)j=!0;else if(Array.isArray(t)){var P=t.concat();o=[];for(var I,O=P.length;O--;)("string"!=typeof(I=P.shift())||Array.isArray(I)&&"string"!=typeof I[0])&&(E=!1);j=E}if(!1===j)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 F=et/m.internal.scaleFactor,R=F*(L-1);switch(e.baseline){case"bottom":n-=R;break;case"top":n+=F-R;break;case"hanging":n+=F-2*R;break;case"middle":n+=F/2-R}if((h=e.maxWidth||0)>0&&("string"==typeof t?t=m.splitTextToSize(t,h):"[object Array]"===Object.prototype.toString.call(t)&&(t=t.reduce((function(t,i){return t.concat(m.splitTextToSize(i,h))}),[]))),Ot.publish("preProcessText",s={text:t,x:i,y:n,options:e,mutex:{pdfEscape:Pi,activeFontKey:dt,fonts:bt,activeFontSize:et}}),t=s.text,a=(e=s.options).angle,v instanceof Dt==0&&a&&"number"==typeof a){a*=Math.PI/180,0===e.rotationDirection&&(a=-a),g===b.ADVANCED&&(a=-a);var C=Math.cos(a),D=Math.sin(a);v=new Dt(C,D,-D,C,0,0)}else a&&a instanceof Dt&&(v=a);g!==b.ADVANCED||v||(v=zt),void 0!==(c=e.charSpace||qn)&&(p+=A(M(c))+" Tc\n",this.setCharSpace(this.getCharSpace()||0)),void 0!==(d=e.horizontalScale)&&(p+=A(100*d)+" Tz\n");var T=-1,z=void 0!==e.renderingMode?e.renderingMode:e.stroke,_=m.internal.getCurrentPageInfo().pageContext;switch(z){case 0:case!1:case"fill":T=0;break;case 1:case!0:case"stroke":T=1;break;case 2:case"fillThenStroke":T=2;break;case 3:case"invisible":T=3;break;case 4:case"fillAndAddForClipping":T=4;break;case 5:case"strokeAndAddPathForClipping":T=5;break;case 6:case"fillThenStrokeAndAddToPathForClipping":T=6;break;case 7:case"addToPathForClipping":T=7}var U=void 0!==_.usedRenderingMode?_.usedRenderingMode:-1;-1!==T?p+=T+" Tr\n":-1!==U&&(p+="0 Tr\n"),-1!==T&&(_.usedRenderingMode=T),u=e.align||"left";var V,W=et*L,H=m.internal.pageSize.getWidth(),G=bt[dt];c=e.charSpace||qn,h=e.maxWidth||0,f=Object.assign({autoencode:!0,noBOM:!0},e.flags);var J=[];if("[object Array]"===Object.prototype.toString.call(t)){var Y;o=x(t),"left"!==u&&(V=o.map((function(t){return m.getStringUnitWidth(t,{font:G,charSpace:c,fontSize:et,doKerning:!1})*et/y})));var K,X=0;if("right"===u){i-=V[0],t=[],O=o.length;for(var $=0;$<O;$++)0===$?(K=gn(i),Y=Nn(n)):(K=M(X-V[$]),Y=-W),t.push([o[$],K,Y]),X=V[$]}else if("center"===u){i-=V[0]/2,t=[],O=o.length;for(var Q=0;Q<O;Q++)0===Q?(K=gn(i),Y=Nn(n)):(K=M((X-V[Q])/2),Y=-W),t.push([o[Q],K,Y]),X=V[Q]}else if("left"===u){t=[],O=o.length;for(var tt=0;tt<O;tt++)t.push(o[tt])}else{if("justify"!==u)throw new Error('Unrecognized alignment option, use "left", "center", "right" or "justify".');t=[],O=o.length,h=0!==h?h:H;for(var it=0;it<O;it++)Y=0===it?Nn(n):-W,K=0===it?gn(i):0,J.push(it<O-1?A(M((h-V[it])/(o[it].split(" ").length-1))):0),t.push([o[it],K,Y])}}var nt="boolean"==typeof e.R2L?e.R2L:ot;!0===nt&&(t=q(t,(function(t,i,n){return[t.split("").reverse().join(""),i,n]}))),Ot.publish("postProcessText",s={text:t,x:i,y:n,options:e,mutex:{pdfEscape:Pi,activeFontKey:dt,fonts:bt,activeFontSize:et}}),t=s.text,N=s.mutex.isHex||!1;var rt=bt[dt].encoding;"WinAnsiEncoding"!==rt&&"StandardEncoding"!==rt||(t=q(t,(function(t,i,n){return[S(t),i,n]}))),o=x(t),t=[];for(var st,at,ut,ct=0,ht=1,ft=Array.isArray(o[0])?ht:ct,lt="",vt=function(t,i,n){var r="";return n instanceof Dt?(n="number"==typeof e.angle?Tt(n,new Dt(1,0,0,1,t,i)):Tt(new Dt(1,0,0,1,t,i),n),g===b.ADVANCED&&(n=Tt(new Dt(1,0,0,-1,0,0),n)),r=n.join(" ")+" Tm\n"):r=A(t)+" "+A(i)+" Td\n",r},mt=0;mt<o.length;mt++){switch(lt="",ft){case ht:ut=(N?"<":"(")+o[mt][0]+(N?">":")"),st=parseFloat(o[mt][1]),at=parseFloat(o[mt][2]);break;case ct:ut=(N?"<":"(")+o[mt]+(N?">":")"),st=gn(i),at=Nn(n)}void 0!==J&&void 0!==J[mt]&&(lt=J[mt]+" Tw\n"),0===mt?t.push(lt+vt(st,at,v)+ut):ft===ct?t.push(lt+ut):ft===ht&&t.push(lt+vt(st,at,v)+ut)}t=t.join(ft===ct?" Tj\nT* ":" Tj\n"),t+=" Tj\n";var wt="BT\n/";return wt+=dt+" "+et+" Tf\n",wt+=A(et*L)+" TL\n",wt+=Sn+"\n",wt+=p,wt+=t,Z(wt+="ET"),l[dt]=!0,m};var Qi=d.__private__.clip=d.clip=function(t){return Z("evenodd"===t?"W*":"W"),this};d.clipEvenOdd=function(){return Qi("evenodd")},d.__private__.discardPath=d.discardPath=function(){return Z("n"),this};var Zi=d.__private__.isValidStyle=function(t){var i=!1;return-1!==[void 0,null,"S","D","F","DF","FD","f","f*","B","B*","n"].indexOf(t)&&(i=!0),i};d.__private__.setDefaultPathOperation=d.setDefaultPathOperation=function(t){return Zi(t)&&(c=t),this};var tn=d.__private__.getStyle=d.getStyle=function(t){var i=c;switch(t){case"D":case"S":i="S";break;case"F":i="f";break;case"FD":case"DF":i="B";break;case"f":case"f*":case"B":case"B*":i=t}return i},nn=d.close=function(){return Z("h"),this};d.stroke=function(){return Z("S"),this},d.fill=function(t){return en("f",t),this},d.fillEvenOdd=function(t){return en("f*",t),this},d.fillStroke=function(t){return en("B",t),this},d.fillStrokeEvenOdd=function(t){return en("B*",t),this};var en=function(t,i){"object"===B(i)?on(i,t):Z(t)},rn=function(t){null===t||g===b.ADVANCED&&void 0===t||(t=tn(t),Z(t))};function sn(t,i,n,e,r){var s=new ti(i||this.boundingBox,n||this.xStep,e||this.yStep,this.gState,r||this.matrix);s.stream=this.stream;var o=t+"$$"+this.cloneIndex+++"$$";return _t(o,s),s}var on=function(t,i){var n=At[t.key],e=Lt[n];if(e instanceof Zt)Z("q"),Z(an(i)),e.gState&&d.setGState(e.gState),Z(t.matrix.toString()+" cm"),Z("/"+n+" sh"),Z("Q");else if(e instanceof ti){var r=new Dt(1,0,0,-1,0,zn());t.matrix&&(r=r.multiply(t.matrix||zt),n=sn.call(e,t.key,t.boundingBox,t.xStep,t.yStep,r).id),Z("q"),Z("/Pattern cs"),Z("/"+n+" scn"),e.gState&&d.setGState(e.gState),Z(i),Z("Q")}},an=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"}},un=d.moveTo=function(t,i){return Z(A(M(t))+" "+A(E(i))+" m"),this},cn=d.lineTo=function(t,i){return Z(A(M(t))+" "+A(E(i))+" l"),this},hn=d.curveTo=function(t,i,n,e,r,s){return Z([A(M(t)),A(E(i)),A(M(n)),A(E(e)),A(M(r)),A(E(s)),"c"].join(" ")),this};d.__private__.line=d.line=function(t,i,n,e,r){if(isNaN(t)||isNaN(i)||isNaN(n)||isNaN(e)||!Zi(r))throw new Error("Invalid arguments passed to jsPDF.line");return g===b.COMPAT?this.lines([[n-t,e-i]],t,i,[1,1],r||"S"):this.lines([[n-t,e-i]],t,i,[1,1]).stroke()},d.__private__.lines=d.lines=function(t,i,n,e,r,s){var o,a,u,c,h,f,l,d;if("number"==typeof t&&(d=n,n=i,i=t,t=d),e=e||[1,1],s=s||!1,isNaN(i)||isNaN(n)||!Array.isArray(t)||!Array.isArray(e)||!Zi(r)||"boolean"!=typeof s)throw new Error("Invalid arguments passed to jsPDF.lines");for(un(i,n),o=e[0],a=e[1],c=t.length,f=i,l=n,u=0;u<c;u++)2===(h=t[u]).length?cn(f=h[0]*o+f,l=h[1]*a+l):hn(h[0]*o+f,h[1]*a+l,h[2]*o+f,h[3]*a+l,f=h[4]*o+f,l=h[5]*a+l);return s&&nn(),rn(r),this},d.path=function(t){for(var i=0;i<t.length;i++){var n=t[i],e=n.c;switch(n.op){case"m":un(e[0],e[1]);break;case"l":cn(e[0],e[1]);break;case"c":hn.apply(this,e);break;case"h":nn()}}return this},d.__private__.rect=d.rect=function(t,i,n,e,r){if(isNaN(t)||isNaN(i)||isNaN(n)||isNaN(e)||!Zi(r))throw new Error("Invalid arguments passed to jsPDF.rect");return g===b.COMPAT&&(e=-e),Z([A(M(t)),A(E(i)),A(M(n)),A(M(e)),"re"].join(" ")),rn(r),this},d.__private__.triangle=d.triangle=function(t,i,n,e,r,s,o){if(isNaN(t)||isNaN(i)||isNaN(n)||isNaN(e)||isNaN(r)||isNaN(s)||!Zi(o))throw new Error("Invalid arguments passed to jsPDF.triangle");return this.lines([[n-t,e-i],[r-n,s-e],[t-r,i-s]],t,i,[1,1],o,!0),this},d.__private__.roundedRect=d.roundedRect=function(t,i,n,e,r,s,o){if(isNaN(t)||isNaN(i)||isNaN(n)||isNaN(e)||isNaN(r)||isNaN(s)||!Zi(o))throw new Error("Invalid arguments passed to jsPDF.roundedRect");var a=4/3*(Math.SQRT2-1);return r=Math.min(r,.5*n),s=Math.min(s,.5*e),this.lines([[n-2*r,0],[r*a,0,r,s-s*a,r,s],[0,e-2*s],[0,s*a,-r*a,s,-r,s],[2*r-n,0],[-r*a,0,-r,-s*a,-r,-s],[0,2*s-e],[0,-s*a,r*a,-s,r,-s]],t+r,i,[1,1],o,!0),this},d.__private__.ellipse=d.ellipse=function(t,i,n,e,r){if(isNaN(t)||isNaN(i)||isNaN(n)||isNaN(e)||!Zi(r))throw new Error("Invalid arguments passed to jsPDF.ellipse");var s=4/3*(Math.SQRT2-1)*n,o=4/3*(Math.SQRT2-1)*e;return un(t+n,i),hn(t+n,i-o,t+s,i-e,t,i-e),hn(t-s,i-e,t-n,i-o,t-n,i),hn(t-n,i+o,t-s,i+e,t,i+e),hn(t+s,i+e,t+n,i+o,t+n,i),rn(r),this},d.__private__.circle=d.circle=function(t,i,n,e){if(isNaN(t)||isNaN(i)||isNaN(n)||!Zi(e))throw new Error("Invalid arguments passed to jsPDF.circle");return this.ellipse(t,i,n,n,e)},d.setFont=function(t,i,n){return n&&(i=y(i,n)),dt=Ci(t,i,{disableWarning:!1}),this};var fn=d.__private__.getFont=d.getFont=function(){return bt[Ci.apply(d,arguments)]};d.__private__.getFontList=d.getFontList=function(){var t,i,n={};for(t in gt)if(gt.hasOwnProperty(t))for(i in n[t]=[],gt[t])gt[t].hasOwnProperty(i)&&n[t].push(i);return n},d.addFont=function(t,i,n,e,r){var s=["StandardEncoding","MacRomanEncoding","Identity-H","WinAnsiEncoding"];return arguments[3]&&-1!==s.indexOf(arguments[3])?r=arguments[3]:arguments[3]&&-1==s.indexOf(arguments[3])&&(n=y(n,e)),qi.call(this,t,i,n,r=r||"Identity-H")};var ln,dn=t.lineWidth||.200025,vn=d.__private__.getLineWidth=d.getLineWidth=function(){return dn},mn=d.__private__.setLineWidth=d.setLineWidth=function(t){return dn=t,Z(A(M(t))+" w"),this};d.__private__.setLineDash=ii.API.setLineDash=ii.API.setLineDashPattern=function(t,i){if(t=t||[],i=i||0,isNaN(i)||!Array.isArray(t))throw new Error("Invalid arguments passed to jsPDF.setLineDash");return t=t.map((function(t){return A(M(t))})).join(" "),i=A(M(i)),Z("["+t+"] "+i+" d"),this};var wn=d.__private__.getLineHeight=d.getLineHeight=function(){return et*ln};d.__private__.getLineHeight=d.getLineHeight=function(){return et*ln};var pn=d.__private__.setLineHeightFactor=d.setLineHeightFactor=function(t){return"number"==typeof(t=t||1.15)&&(ln=t),this},bn=d.__private__.getLineHeightFactor=d.getLineHeightFactor=function(){return ln};pn(t.lineHeight);var gn=d.__private__.getHorizontalCoordinate=function(t){return M(t)},Nn=d.__private__.getVerticalCoordinate=function(t){return g===b.ADVANCED?t:It[z].mediaBox.topRightY-It[z].mediaBox.bottomLeftY-M(t)},Ln=d.__private__.getHorizontalCoordinateString=d.getHorizontalCoordinateString=function(t){return A(gn(t))},yn=d.__private__.getVerticalCoordinateString=d.getVerticalCoordinateString=function(t){return A(Nn(t))},An=t.strokeColor||"0 G";d.__private__.getStrokeColor=d.getDrawColor=function(){return Qt(An)},d.__private__.setStrokeColor=d.setDrawColor=function(t,i,n,e){return An=ni({ch1:t,ch2:i,ch3:n,ch4:e,pdfColorType:"draw",precision:2}),Z(An),this};var kn=t.fillColor||"0 g";d.__private__.getFillColor=d.getFillColor=function(){return Qt(kn)},d.__private__.setFillColor=d.setFillColor=function(t,i,n,e){return kn=ni({ch1:t,ch2:i,ch3:n,ch4:e,pdfColorType:"fill",precision:2}),Z(kn),this};var Sn=t.textColor||"0 g",xn=d.__private__.getTextColor=d.getTextColor=function(){return Qt(Sn)};d.__private__.setTextColor=d.setTextColor=function(t,i,n,e){return Sn=ni({ch1:t,ch2:i,ch3:n,ch4:e,pdfColorType:"text",precision:3}),this};var qn=t.charSpace,Mn=d.__private__.getCharSpace=d.getCharSpace=function(){return parseFloat(qn||0)};d.__private__.setCharSpace=d.setCharSpace=function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.setCharSpace");return qn=t,this};var jn=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 i=d.CapJoinStyles[t];if(void 0===i)throw new Error("Line cap style of '"+t+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return jn=i,Z(i+" J"),this};var En=0;d.__private__.setLineJoin=d.setLineJoin=function(t){var i=d.CapJoinStyles[t];if(void 0===i)throw new Error("Line join style of '"+t+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return En=i,Z(i+" 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 Z(A(M(t))+" M"),this},d.GState=$t,d.setGState=function(t){(t="string"==typeof t?St[xt[t]]:Pn(null,t)).equals(qt)||(Z("/"+t.id+" gs"),qt=t)};var Pn=function(t,i){if(!t||!xt[t]){var n=!1;for(var e in St)if(St.hasOwnProperty(e)&&St[e].equals(i)){n=!0;break}if(n)i=St[e];else{var r="GS"+(Object.keys(St).length+1).toString(10);St[r]=i,i.id=r}return t&&(xt[t]=i.id),Ot.publish("addGState",i),i}};d.addGState=function(t,i){return Pn(t,i),this},d.saveGraphicsState=function(){return Z("q"),Nt.push({key:dt,size:et,color:Sn}),this},d.restoreGraphicsState=function(){Z("Q");var t=Nt.pop();return dt=t.key,et=t.size,Sn=t.color,qt=null,this},d.setCurrentTransformationMatrix=function(t){return Z(t.toString()+" cm"),this},d.comment=function(t){return Z("#"+t),this};var In=function(t,i){var n=t||0;Object.defineProperty(this,"x",{enumerable:!0,get:function(){return n},set:function(t){isNaN(t)||(n=parseFloat(t))}});var e=i||0;Object.defineProperty(this,"y",{enumerable:!0,get:function(){return e},set:function(t){isNaN(t)||(e=parseFloat(t))}});var r="pt";return Object.defineProperty(this,"type",{enumerable:!0,get:function(){return r},set:function(t){r=t.toString()}}),this},On=function(t,i,n,e){In.call(this,t,i),this.type="rect";var r=n||0;Object.defineProperty(this,"w",{enumerable:!0,get:function(){return r},set:function(t){isNaN(t)||(r=parseFloat(t))}});var s=e||0;return Object.defineProperty(this,"h",{enumerable:!0,get:function(){return s},set:function(t){isNaN(t)||(s=parseFloat(t))}}),this},Fn=function(){this.page=Mt,this.currentPage=z,this.pages=Y.slice(0),this.pagesContext=It.slice(0),this.x=mt,this.y=wt,this.matrix=pt,this.width=Dn(z),this.height=zn(z),this.outputDestination=X,this.id="",this.objectNumber=-1};Fn.prototype.restore=function(){Mt=this.page,It=this.pagesContext,Y=this.pages,mt=this.x,wt=this.y,pt=this.matrix,Tn(z=this.currentPage,this.width),_n(z,this.height),X=this.outputDestination};var Rn=function(t,i,n,e,r){Ct.push(new Fn),Mt=z=0,Y=[],mt=t,wt=i,pt=r,Ii([n,e])},Bn=function(t){if(Bt[t])Ct.pop().restore();else{var i=new Fn,n="Xo"+(Object.keys(Rt).length+1).toString(10);i.id=n,Bt[t]=n,Rt[n]=i,Ot.publish("addFormObject",i),Ct.pop().restore()}};for(var Cn in d.beginFormObject=function(t,i,n,e,r){return Rn(t,i,n,e,r),this},d.endFormObject=function(t){return Bn(t),this},d.doFormObject=function(t,i){var n=Rt[Bt[t]];return Z("q"),Z(i.toString()+" cm"),Z("/"+n.id+" Do"),Z("Q"),this},d.getFormObject=function(t){var i=Rt[Bt[t]];return{x:i.x,y:i.y,width:i.width,height:i.height,matrix:i.matrix}},d.save=function(t,i){return t=t||"generated.pdf",(i=i||{}).returnPromise=i.returnPromise||!1,!1===i.returnPromise?(Et(Wi(Vi()),t),"function"==typeof Et.unload&&yt.setTimeout&&setTimeout(Et.unload,911),this):new Promise((function(i,n){try{var e=Et(Wi(Vi()),t);"function"==typeof Et.unload&&yt.setTimeout&&setTimeout(Et.unload,911),i(e)}catch(t){n(t.message)}}))},ii.API)ii.API.hasOwnProperty(Cn)&&("events"===Cn&&ii.API.events.length?function(t,i){var n,e;for(e=i.length-1;-1!==e;e--)t.subscribe.apply(t,[i[e][0]].concat("function"==typeof(n=i[e][1])?[n]:n))}(Ot,ii.API.events):d[Cn]=ii.API[Cn]);var Dn=d.getPageWidth=function(t){return(It[t=t||z].mediaBox.topRightX-It[t].mediaBox.bottomLeftX)/vt},Tn=d.setPageWidth=function(t,i){It[t].mediaBox.topRightX=i*vt+It[t].mediaBox.bottomLeftX},zn=d.getPageHeight=function(t){return(It[t=t||z].mediaBox.topRightY-It[t].mediaBox.bottomLeftY)/vt},_n=d.setPageHeight=function(t,i){It[t].mediaBox.topRightY=i*vt+It[t].mediaBox.bottomLeftY};return d.internal={pdfEscape:Pi,getStyle:tn,getFont:fn,getFontSize:st,getCharSpace:Mn,getTextColor:xn,getLineHeight:wn,getLineHeightFactor:bn,getLineWidth:vn,write:tt,getHorizontalCoordinate:gn,getVerticalCoordinate:Nn,getCoordinateString:Ln,getVerticalCoordinateString:yn,collections:{},newObject:Ut,newAdditionalObject:Ht,newObjectDeferred:Vt,newObjectDeferredBegin:Wt,getFilters:ei,putStream:ri,events:Ot,scaleFactor:vt,pageSize:{getWidth:function(){return Dn(z)},setWidth:function(t){Tn(z,t)},getHeight:function(){return zn(z)},setHeight:function(t){_n(z,t)}},encryptionOptions:h,encryption:Ji,getEncryptor:Yi,output:Hi,getNumberOfPages:Bi,pages:Y,out:Z,f2:x,f3:q,getPageInfo:Ki,getPageInfoByObjId:Xi,getCurrentPageInfo:$i,getPDFVersion:m,Point:In,Rectangle:On,Matrix:Dt,hasHotfix:Gi},Object.defineProperty(d.internal.pageSize,"width",{get:function(){return Dn(z)},set:function(t){Tn(z,t)},enumerable:!0,configurable:!0}),Object.defineProperty(d.internal.pageSize,"height",{get:function(){return zn(z)},set:function(t){_n(z,t)},enumerable:!0,configurable:!0}),Mi.call(d,nt),dt="F1",Oi(r,n),Ot.publish("initialized"),d}Yt.prototype.lsbFirstWord=function(t){return String.fromCharCode(t>>0&255,t>>8&255,t>>16&255,t>>24&255)},Yt.prototype.toHexString=function(t){return t.split("").map((function(t){return("0"+(255&t.charCodeAt(0)).toString(16)).slice(-2)})).join("")},Yt.prototype.hexToBytes=function(t){for(var i=[],n=0;n<t.length;n+=2)i.push(String.fromCharCode(parseInt(t.substr(n,2),16)));return i.join("")},Yt.prototype.processOwnerPassword=function(t,i){return Gt(Vt(i).substr(0,5),t)},Yt.prototype.encryptor=function(t,i){var n=Vt(this.encryptionKey+String.fromCharCode(255&t,t>>8&255,t>>16&255,255&i,i>>8&255)).substr(0,10);return function(t){return Gt(n,t)}},$t.prototype.equals=function(t){var i,n="id,objectNumber,equals";if(!t||B(t)!==B(this))return!1;var e=0;for(i in this)if(!(n.indexOf(i)>=0)){if(this.hasOwnProperty(i)&&!t.hasOwnProperty(i))return!1;if(this[i]!==t[i])return!1;e++}for(i in t)t.hasOwnProperty(i)&&n.indexOf(i)<0&&e--;return 0===e},ii.API={events:[]},ii.version="2.5.1";var ni=ii.API,ei=1,ri=function(t){return t.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},si=function(t){return t.replace(/\\\\/g,"\\").replace(/\\\(/g,"(").replace(/\\\)/g,")")},oi=function(t){return t.toFixed(2)},ai=function(t){return t.toFixed(5)};ni.__acroform__={};var ui=function(t,i){t.prototype=Object.create(i.prototype),t.prototype.constructor=t},ci=function(t){return t*ei},hi=function(t){var i=new qi,n=_i.internal.getHeight(t)||0,e=_i.internal.getWidth(t)||0;return i.BBox=[0,0,Number(oi(e)),Number(oi(n))],i},fi=ni.__acroform__.setBit=function(t,i){if(t=t||0,i=i||0,isNaN(t)||isNaN(i))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBit");return t|1<<i},li=ni.__acroform__.clearBit=function(t,i){if(t=t||0,i=i||0,isNaN(t)||isNaN(i))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBit");return t&~(1<<i)},di=ni.__acroform__.getBit=function(t,i){if(isNaN(t)||isNaN(i))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBit");return 0==(t&1<<i)?0:1},vi=ni.__acroform__.getBitForPdf=function(t,i){if(isNaN(t)||isNaN(i))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBitForPdf");return di(t,i-1)},mi=ni.__acroform__.setBitForPdf=function(t,i){if(isNaN(t)||isNaN(i))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBitForPdf");return fi(t,i-1)},wi=ni.__acroform__.clearBitForPdf=function(t,i){if(isNaN(t)||isNaN(i))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBitForPdf");return li(t,i-1)},pi=ni.__acroform__.calculateCoordinates=function(t,i){var n=i.internal.getHorizontalCoordinate,e=i.internal.getVerticalCoordinate,r=t[0],s=t[1],o=t[2],a=t[3],u={};return u.lowerLeft_X=n(r)||0,u.lowerLeft_Y=e(s+a)||0,u.upperRight_X=n(r+o)||0,u.upperRight_Y=e(s)||0,[Number(oi(u.lowerLeft_X)),Number(oi(u.lowerLeft_Y)),Number(oi(u.upperRight_X)),Number(oi(u.upperRight_Y))]},bi=function(t){if(t.appearanceStreamContent)return t.appearanceStreamContent;if(t.V||t.DV){var i=[],n=gi(t,t._V||t.DV),e=t.scope.internal.getFont(t.fontName,t.fontStyle).id;i.push("/Tx BMC"),i.push("q"),i.push("BT"),i.push(t.scope.__private__.encodeColorString(t.color)),i.push("/"+e+" "+oi(n.fontSize)+" Tf"),i.push("1 0 0 1 0 0 Tm"),i.push(n.text),i.push("ET"),i.push("Q"),i.push("EMC");var r=hi(t);return r.scope=t.scope,r.stream=i.join("\n"),r}},gi=function(t,i){var n=0===t.fontSize?t.maxFontSize:t.fontSize,e={text:"",fontSize:""},r=(i=")"==(i="("==i.substr(0,1)?i.substr(1):i).substr(i.length-1)?i.substr(0,i.length-1):i).split(" ");r=r.map(t.multiline?function(t){return t.split("\n")}:function(t){return[t]});var s=n,o=_i.internal.getHeight(t)||0;o=o<0?-o:o;var a=_i.internal.getWidth(t)||0;a=a<0?-a:a;var u=function(i,n,e){return i+1<r.length&&Ni(n+" "+r[i+1][0],t,e).width<=a-4};s++;t:for(;s>0;){i="",s--;var c,h,f=Ni("3",t,s).height,l=t.multiline?o-s:(o-f)/2,d=l+=2,v=0,m=0,w=0;if(s<=0){i="(...) Tj\n",i+="% Width of Text: "+Ni(i,t,s=12).width+", FieldWidth:"+a+"\n";break}for(var p="",b=0,g=0;g<r.length;g++)if(r.hasOwnProperty(g)){var N=!1;if(1!==r[g].length&&w!==r[g].length-1){if((f+2)*(b+2)+2>o)continue t;p+=r[g][w],N=!0,m=g,g--}else{p=" "==(p+=r[g][w]+" ").substr(p.length-1)?p.substr(0,p.length-1):p;var L=parseInt(g),y=u(L,p,s),A=g>=r.length-1;if(y&&!A){p+=" ",w=0;continue}if(y||A){if(A)m=L;else if(t.multiline&&(f+2)*(b+2)+2>o)continue t}else{if(!t.multiline)continue t;if((f+2)*(b+2)+2>o)continue t;m=L}}for(var k="",S=v;S<=m;S++){var x=r[S];if(t.multiline){if(S===m){k+=x[w]+" ",w=(w+1)%x.length;continue}if(S===v){k+=x[x.length-1]+" ";continue}}k+=x[0]+" "}switch(k=" "==k.substr(k.length-1)?k.substr(0,k.length-1):k,h=Ni(k,t,s).width,t.textAlign){case"right":c=a-h-2;break;case"center":c=(a-h)/2;break;default:c=2}i+=oi(c)+" "+oi(d)+" Td\n",i+="("+ri(k)+") Tj\n",i+=-oi(c)+" 0 Td\n",d=-(s+2),h=0,v=N?m:m+1,b++,p=""}break}return e.text=i,e.fontSize=s,e},Ni=function(t,i,n){var e=i.scope.internal.getFont(i.fontName,i.fontStyle),r=i.scope.getStringUnitWidth(t,{font:e,fontSize:parseFloat(n),charSpace:0})*parseFloat(n);return{height:i.scope.getStringUnitWidth("3",{font:e,fontSize:parseFloat(n),charSpace:0})*parseFloat(n)*1.5,width:r}},Li={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},yi=function(t,i){var n={type:"reference",object:t};void 0===i.internal.getPageInfo(t.page).pageContext.annotations.find((function(t){return t.type===n.type&&t.object===n.object}))&&i.internal.getPageInfo(t.page).pageContext.annotations.push(n)},Ai=function(t,i){if(i.scope=t,void 0!==t.internal&&(void 0===t.internal.acroformPlugin||!1===t.internal.acroformPlugin.isInitialized)){if(ji.FieldNum=0,t.internal.acroformPlugin=JSON.parse(JSON.stringify(Li)),t.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("Exception while creating AcroformDictionary");ei=t.internal.scaleFactor,t.internal.acroformPlugin.acroFormDictionaryRoot=new Mi,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 i=t.internal.acroformPlugin.acroFormDictionaryRoot.Fields;for(var n in i)if(i.hasOwnProperty(n)){var e=i[n];e.objId=void 0,e.hasAnnotation&&yi(e,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(i){!function(t,i){var n=!t;for(var e in t||(i.internal.newObjectDeferredBegin(i.internal.acroformPlugin.acroFormDictionaryRoot.objId,!0),i.internal.acroformPlugin.acroFormDictionaryRoot.putStream()),t=t||i.internal.acroformPlugin.acroFormDictionaryRoot.Kids)if(t.hasOwnProperty(e)){var r=t[e],s=[],o=r.Rect;if(r.Rect&&(r.Rect=pi(r.Rect,i)),i.internal.newObjectDeferredBegin(r.objId,!0),r.DA=_i.createDefaultAppearanceStream(r),"object"===B(r)&&"function"==typeof r.getKeyValueListForStream&&(s=r.getKeyValueListForStream()),r.Rect=o,r.hasAppearanceStream&&!r.appearanceStreamContent){var a=bi(r);s.push({key:"AP",value:"<</N "+a+">>"}),i.internal.acroformPlugin.xForms.push(a)}if(r.appearanceStreamContent){var u="";for(var c in r.appearanceStreamContent)if(r.appearanceStreamContent.hasOwnProperty(c)){var h=r.appearanceStreamContent[c];if(u+="/"+c+" ",u+="<<",Object.keys(h).length>=1||Array.isArray(h)){for(var e in h)if(h.hasOwnProperty(e)){var f=h[e];"function"==typeof f&&(f=f.call(i,r)),u+="/"+e+" "+f+" ",i.internal.acroformPlugin.xForms.indexOf(f)>=0||i.internal.acroformPlugin.xForms.push(f)}}else"function"==typeof(f=h)&&(f=f.call(i,r)),u+="/"+e+" "+f,i.internal.acroformPlugin.xForms.indexOf(f)>=0||i.internal.acroformPlugin.xForms.push(f);u+=">>"}s.push({key:"AP",value:"<<\n"+u+">>"})}i.internal.putStream({additionalKeyValues:s,objectId:r.objId}),i.internal.out("endobj")}n&&function(t,i){for(var n in t)if(t.hasOwnProperty(n)){var e=n,r=t[n];i.internal.newObjectDeferredBegin(r.objId,!0),"object"===B(r)&&"function"==typeof r.putStream&&r.putStream(),delete t[e]}}(i.internal.acroformPlugin.xForms,i)}(i,t)})),t.internal.acroformPlugin.isInitialized=!0}},ki=ni.__acroform__.arrayToPdfArray=function(t,i,n){var e=function(t){return t};if(Array.isArray(t)){for(var r="[",s=0;s<t.length;s++)switch(0!==s&&(r+=" "),B(t[s])){case"boolean":case"number":case"object":r+=t[s].toString();break;case"string":"/"!==t[s].substr(0,1)?(void 0!==i&&n&&(e=n.internal.getEncryptor(i)),r+="("+ri(e(t[s].toString()))+")"):r+=t[s].toString()}return r+"]"}throw new Error("Invalid argument passed to jsPDF.__acroform__.arrayToPdfArray")},Si=function(t,i,n){var e=function(t){return t};return void 0!==i&&n&&(e=n.internal.getEncryptor(i)),(t=t||"").toString(),"("+ri(e(t))+")"},xi=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})};xi.prototype.toString=function(){return this.objId+" 0 R"},xi.prototype.putStream=function(){var t=this.getKeyValueListForStream();this.scope.internal.putStream({data:this.stream,additionalKeyValues:t,objectId:this.objId}),this.scope.internal.out("endobj")},xi.prototype.getKeyValueListForStream=function(){var t=[],i=Object.getOwnPropertyNames(this).filter((function(t){return"content"!=t&&"appearanceStreamContent"!=t&&"scope"!=t&&"objId"!=t&&"_"!=t.substring(0,1)}));for(var n in i)if(!1===Object.getOwnPropertyDescriptor(this,i[n]).configurable){var e=i[n],r=this[e];r&&(Array.isArray(r)?t.push({key:e,value:ki(r,this.objId,this.scope)}):r instanceof xi?(r.scope=this.scope,t.push({key:e,value:r.objId+" 0 R"})):"function"!=typeof r&&t.push({key:e,value:r}))}return t};var qi=function(){xi.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,i=[];Object.defineProperty(this,"BBox",{configurable:!1,get:function(){return i},set:function(t){i=t}}),Object.defineProperty(this,"Resources",{value:"2 0 R",configurable:!1,writable:!0}),Object.defineProperty(this,"stream",{enumerable:!1,configurable:!0,set:function(i){t=i.trim()},get:function(){return t||null}})};ui(qi,xi);var Mi=function(){xi.call(this);var t,i=[];Object.defineProperty(this,"Kids",{enumerable:!1,configurable:!0,get:function(){return i.length>0?i:void 0}}),Object.defineProperty(this,"Fields",{enumerable:!1,configurable:!1,get:function(){return i}}),Object.defineProperty(this,"DA",{enumerable:!1,configurable:!1,get:function(){if(t){var i=function(t){return t};return this.scope&&(i=this.scope.internal.getEncryptor(this.objId)),"("+ri(i(t))+")"}},set:function(i){t=i}})};ui(Mi,xi);var ji=function t(){xi.call(this);var i=4;Object.defineProperty(this,"F",{enumerable:!1,configurable:!1,get:function(){return i},set:function(t){if(isNaN(t))throw new Error('Invalid value "'+t+'" for attribute F supplied.');i=t}}),Object.defineProperty(this,"showWhenPrinted",{enumerable:!0,configurable:!0,get:function(){return Boolean(vi(i,3))},set:function(t){this.F=!0===Boolean(t)?mi(i,3):wi(i,3)}});var n=0;Object.defineProperty(this,"Ff",{enumerable:!1,configurable:!1,get:function(){return n},set:function(t){if(isNaN(t))throw new Error('Invalid value "'+t+'" for attribute Ff supplied.');n=t}});var e=[];Object.defineProperty(this,"Rect",{enumerable:!1,configurable:!1,get:function(){if(0!==e.length)return e},set:function(t){e=void 0!==t?t:[]}}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,get:function(){return!e||isNaN(e[0])?0:e[0]},set:function(t){e[0]=t}}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,get:function(){return!e||isNaN(e[1])?0:e[1]},set:function(t){e[1]=t}}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,get:function(){return!e||isNaN(e[2])?0:e[2]},set:function(t){e[2]=t}}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,get:function(){return!e||isNaN(e[3])?0:e[3]},set:function(t){e[3]=t}});var r="";Object.defineProperty(this,"FT",{enumerable:!0,configurable:!1,get:function(){return r},set:function(t){switch(t){case"/Btn":case"/Tx":case"/Ch":case"/Sig":r=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 Ci)return;s="FieldObject"+t.FieldNum++}var i=function(t){return t};return this.scope&&(i=this.scope.internal.getEncryptor(this.objId)),"("+ri(i(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 c=void 0;Object.defineProperty(this,"maxFontSize",{enumerable:!0,configurable:!0,get:function(){return void 0===c?50/ei:c},set:function(t){c=t}});var h="black";Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,get:function(){return h},set:function(t){h=t}});var f="/F1 0 Tf 0 g";Object.defineProperty(this,"DA",{enumerable:!0,configurable:!1,get:function(){if(!(!f||this instanceof Ci||this instanceof Ti))return Si(f,this.objId,this.scope)},set:function(t){t=t.toString(),f=t}});var l=null;Object.defineProperty(this,"DV",{enumerable:!1,configurable:!1,get:function(){if(l)return this instanceof Fi==0?Si(l,this.objId,this.scope):l},set:function(t){t=t.toString(),l=this instanceof Fi==0?"("===t.substr(0,1)?si(t.substr(1,t.length-2)):si(t):t}}),Object.defineProperty(this,"defaultValue",{enumerable:!0,configurable:!0,get:function(){return this instanceof Fi==1?si(l.substr(1,l.length-1)):l},set:function(t){t=t.toString(),l=this instanceof Fi==1?"/"+t:t}});var d=null;Object.defineProperty(this,"_V",{enumerable:!1,configurable:!1,get:function(){if(d)return d},set:function(t){this.V=t}}),Object.defineProperty(this,"V",{enumerable:!1,configurable:!1,get:function(){if(d)return this instanceof Fi==0?Si(d,this.objId,this.scope):d},set:function(t){t=t.toString(),d=this instanceof Fi==0?"("===t.substr(0,1)?si(t.substr(1,t.length-2)):si(t):t}}),Object.defineProperty(this,"value",{enumerable:!0,configurable:!0,get:function(){return this instanceof Fi==1?si(d.substr(1,d.length-1)):d},set:function(t){t=t.toString(),d=this instanceof Fi==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 v,m=!1;Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return m},set:function(t){t=Boolean(t),m=t}}),Object.defineProperty(this,"page",{enumerable:!0,configurable:!0,get:function(){if(v)return v},set:function(t){v=t}}),Object.defineProperty(this,"readOnly",{enumerable:!0,configurable:!0,get:function(){return Boolean(vi(this.Ff,1))},set:function(t){this.Ff=!0===Boolean(t)?mi(this.Ff,1):wi(this.Ff,1)}}),Object.defineProperty(this,"required",{enumerable:!0,configurable:!0,get:function(){return Boolean(vi(this.Ff,2))},set:function(t){this.Ff=!0===Boolean(t)?mi(this.Ff,2):wi(this.Ff,2)}}),Object.defineProperty(this,"noExport",{enumerable:!0,configurable:!0,get:function(){return Boolean(vi(this.Ff,3))},set:function(t){this.Ff=!0===Boolean(t)?mi(this.Ff,3):wi(this.Ff,3)}});var w=null;Object.defineProperty(this,"Q",{enumerable:!0,configurable:!1,get:function(){if(null!==w)return w},set:function(t){if(-1===[0,1,2].indexOf(t))throw new Error('Invalid value "'+t+'" for attribute Q supplied.');w=t}}),Object.defineProperty(this,"textAlign",{get:function(){var t;switch(w){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:w=2;break;case"center":case 1:w=1;break;default:w=0}}})};ui(ji,xi);var Ei=function(){ji.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(i){t=i}}),Object.defineProperty(this,"topIndex",{enumerable:!0,configurable:!0,get:function(){return t},set:function(i){t=i}});var i=[];Object.defineProperty(this,"Opt",{enumerable:!0,configurable:!1,get:function(){return ki(i,this.objId,this.scope)},set:function(t){var n,e;e=[],"string"==typeof(n=t)&&(e=function(t,i,n){n||(n=1);for(var e,r=[];e=i.exec(t);)r.push(e[n]);return r}(n,/\((.*?)\)/g)),i=e}}),this.getOptions=function(){return i},this.setOptions=function(t){i=t,this.sort&&i.sort()},this.addOption=function(t){t=(t=t||"").toString(),i.push(t),this.sort&&i.sort()},this.removeOption=function(t,n){for(n=n||!1,t=(t=t||"").toString();-1!==i.indexOf(t)&&(i.splice(i.indexOf(t),1),!1!==n););},Object.defineProperty(this,"combo",{enumerable:!0,configurable:!0,get:function(){return Boolean(vi(this.Ff,18))},set:function(t){this.Ff=!0===Boolean(t)?mi(this.Ff,18):wi(this.Ff,18)}}),Object.defineProperty(this,"edit",{enumerable:!0,configurable:!0,get:function(){return Boolean(vi(this.Ff,19))},set:function(t){!0===this.combo&&(this.Ff=!0===Boolean(t)?mi(this.Ff,19):wi(this.Ff,19))}}),Object.defineProperty(this,"sort",{enumerable:!0,configurable:!0,get:function(){return Boolean(vi(this.Ff,20))},set:function(t){!0===Boolean(t)?(this.Ff=mi(this.Ff,20),i.sort()):this.Ff=wi(this.Ff,20)}}),Object.defineProperty(this,"multiSelect",{enumerable:!0,configurable:!0,get:function(){return Boolean(vi(this.Ff,22))},set:function(t){this.Ff=!0===Boolean(t)?mi(this.Ff,22):wi(this.Ff,22)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return Boolean(vi(this.Ff,23))},set:function(t){this.Ff=!0===Boolean(t)?mi(this.Ff,23):wi(this.Ff,23)}}),Object.defineProperty(this,"commitOnSelChange",{enumerable:!0,configurable:!0,get:function(){return Boolean(vi(this.Ff,27))},set:function(t){this.Ff=!0===Boolean(t)?mi(this.Ff,27):wi(this.Ff,27)}}),this.hasAppearanceStream=!1};ui(Ei,ji);var Pi=function(){Ei.call(this),this.fontName="helvetica",this.combo=!1};ui(Pi,Ei);var Ii=function(){Pi.call(this),this.combo=!0};ui(Ii,Pi);var Oi=function(){Ii.call(this),this.edit=!0};ui(Oi,Ii);var Fi=function(){ji.call(this),this.FT="/Btn",Object.defineProperty(this,"noToggleToOff",{enumerable:!0,configurable:!0,get:function(){return Boolean(vi(this.Ff,15))},set:function(t){this.Ff=!0===Boolean(t)?mi(this.Ff,15):wi(this.Ff,15)}}),Object.defineProperty(this,"radio",{enumerable:!0,configurable:!0,get:function(){return Boolean(vi(this.Ff,16))},set:function(t){this.Ff=!0===Boolean(t)?mi(this.Ff,16):wi(this.Ff,16)}}),Object.defineProperty(this,"pushButton",{enumerable:!0,configurable:!0,get:function(){return Boolean(vi(this.Ff,17))},set:function(t){this.Ff=!0===Boolean(t)?mi(this.Ff,17):wi(this.Ff,17)}}),Object.defineProperty(this,"radioIsUnison",{enumerable:!0,configurable:!0,get:function(){return Boolean(vi(this.Ff,26))},set:function(t){this.Ff=!0===Boolean(t)?mi(this.Ff,26):wi(this.Ff,26)}});var t,i={};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(i).length){var n,e=[];for(n in e.push("<<"),i)e.push("/"+n+" ("+ri(t(i[n]))+")");return e.push(">>"),e.join("\n")}},set:function(t){"object"===B(t)&&(i=t)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return i.CA||""},set:function(t){"string"==typeof t&&(i.CA=t)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return t},set:function(i){t=i}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return t.substr(1,t.length-1)},set:function(i){t="/"+i}})};ui(Fi,ji);var Ri=function(){Fi.call(this),this.pushButton=!0};ui(Ri,Fi);var Bi=function(){Fi.call(this),this.radio=!0,this.pushButton=!1;var t=[];Object.defineProperty(this,"Kids",{enumerable:!0,configurable:!1,get:function(){return t},set:function(i){t=void 0!==i?i:[]}})};ui(Bi,Fi);var Ci=function(){var t,i;ji.call(this),Object.defineProperty(this,"Parent",{enumerable:!1,configurable:!1,get:function(){return t},set:function(i){t=i}}),Object.defineProperty(this,"optionName",{enumerable:!1,configurable:!0,get:function(){return i},set:function(t){i=t}});var n,e={};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 i,n=[];for(i in n.push("<<"),e)n.push("/"+i+" ("+ri(t(e[i]))+")");return n.push(">>"),n.join("\n")},set:function(t){"object"===B(t)&&(e=t)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return e.CA||""},set:function(t){"string"==typeof t&&(e.CA=t)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return n},set:function(t){n=t}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return n.substr(1,n.length-1)},set:function(t){n="/"+t}}),this.caption="l",this.appearanceState="Off",this._AppearanceType=_i.RadioButton.Circle,this.appearanceStreamContent=this._AppearanceType.createAppearanceStream(this.optionName)};ui(Ci,ji),Bi.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 i in this.Kids)if(this.Kids.hasOwnProperty(i)){var n=this.Kids[i];n.appearanceStreamContent=t.createAppearanceStream(n.optionName),n.caption=t.getCA()}},Bi.prototype.createOption=function(t){var i=new Ci;return i.Parent=this,i.optionName=t,this.Kids.push(i),Ui.call(this.scope,i),i};var Di=function(){Fi.call(this),this.fontName="zapfdingbats",this.caption="3",this.appearanceState="On",this.value="On",this.textAlign="center",this.appearanceStreamContent=_i.CheckBox.createAppearanceStream()};ui(Di,Fi);var Ti=function(){ji.call(this),this.FT="/Tx",Object.defineProperty(this,"multiline",{enumerable:!0,configurable:!0,get:function(){return Boolean(vi(this.Ff,13))},set:function(t){this.Ff=!0===Boolean(t)?mi(this.Ff,13):wi(this.Ff,13)}}),Object.defineProperty(this,"fileSelect",{enumerable:!0,configurable:!0,get:function(){return Boolean(vi(this.Ff,21))},set:function(t){this.Ff=!0===Boolean(t)?mi(this.Ff,21):wi(this.Ff,21)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return Boolean(vi(this.Ff,23))},set:function(t){this.Ff=!0===Boolean(t)?mi(this.Ff,23):wi(this.Ff,23)}}),Object.defineProperty(this,"doNotScroll",{enumerable:!0,configurable:!0,get:function(){return Boolean(vi(this.Ff,24))},set:function(t){this.Ff=!0===Boolean(t)?mi(this.Ff,24):wi(this.Ff,24)}}),Object.defineProperty(this,"comb",{enumerable:!0,configurable:!0,get:function(){return Boolean(vi(this.Ff,25))},set:function(t){this.Ff=!0===Boolean(t)?mi(this.Ff,25):wi(this.Ff,25)}}),Object.defineProperty(this,"richText",{enumerable:!0,configurable:!0,get:function(){return Boolean(vi(this.Ff,26))},set:function(t){this.Ff=!0===Boolean(t)?mi(this.Ff,26):wi(this.Ff,26)}});var t=null;Object.defineProperty(this,"MaxLen",{enumerable:!0,configurable:!1,get:function(){return t},set:function(i){t=i}}),Object.defineProperty(this,"maxLength",{enumerable:!0,configurable:!0,get:function(){return t},set:function(i){Number.isInteger(i)&&(t=i)}}),Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return this.V||this.DV}})};ui(Ti,ji);var zi=function(){Ti.call(this),Object.defineProperty(this,"password",{enumerable:!0,configurable:!0,get:function(){return Boolean(vi(this.Ff,14))},set:function(t){this.Ff=!0===Boolean(t)?mi(this.Ff,14):wi(this.Ff,14)}}),this.password=!0};ui(zi,Ti);var _i={CheckBox:{createAppearanceStream:function(){return{N:{On:_i.CheckBox.YesNormal},D:{On:_i.CheckBox.YesPushDown,Off:_i.CheckBox.OffPushDown}}},YesPushDown:function(t){var i=hi(t);i.scope=t.scope;var n=[],e=t.scope.internal.getFont(t.fontName,t.fontStyle).id,r=t.scope.__private__.encodeColorString(t.color),s=gi(t,t.caption);return n.push("0.749023 g"),n.push("0 0 "+oi(_i.internal.getWidth(t))+" "+oi(_i.internal.getHeight(t))+" re"),n.push("f"),n.push("BMC"),n.push("q"),n.push("0 0 1 rg"),n.push("/"+e+" "+oi(s.fontSize)+" Tf "+r),n.push("BT"),n.push(s.text),n.push("ET"),n.push("Q"),n.push("EMC"),i.stream=n.join("\n"),i},YesNormal:function(t){var i=hi(t);i.scope=t.scope;var n=t.scope.internal.getFont(t.fontName,t.fontStyle).id,e=t.scope.__private__.encodeColorString(t.color),r=[],s=_i.internal.getHeight(t),o=_i.internal.getWidth(t),a=gi(t,t.caption);return r.push("1 g"),r.push("0 0 "+oi(o)+" "+oi(s)+" re"),r.push("f"),r.push("q"),r.push("0 0 1 rg"),r.push("0 0 "+oi(o-1)+" "+oi(s-1)+" re"),r.push("W"),r.push("n"),r.push("0 g"),r.push("BT"),r.push("/"+n+" "+oi(a.fontSize)+" Tf "+e),r.push(a.text),r.push("ET"),r.push("Q"),i.stream=r.join("\n"),i},OffPushDown:function(t){var i=hi(t);i.scope=t.scope;var n=[];return n.push("0.749023 g"),n.push("0 0 "+oi(_i.internal.getWidth(t))+" "+oi(_i.internal.getHeight(t))+" re"),n.push("f"),i.stream=n.join("\n"),i}},RadioButton:{Circle:{createAppearanceStream:function(t){var i={D:{Off:_i.RadioButton.Circle.OffPushDown},N:{}};return i.N[t]=_i.RadioButton.Circle.YesNormal,i.D[t]=_i.RadioButton.Circle.YesPushDown,i},getCA:function(){return"l"},YesNormal:function(t){var i=hi(t);i.scope=t.scope;var n=[],e=_i.internal.getWidth(t)<=_i.internal.getHeight(t)?_i.internal.getWidth(t)/4:_i.internal.getHeight(t)/4;e=Number((.9*e).toFixed(5));var r=Number((e*_i.internal.Bezier_C).toFixed(5));return n.push("q"),n.push("1 0 0 1 "+ai(_i.internal.getWidth(t)/2)+" "+ai(_i.internal.getHeight(t)/2)+" cm"),n.push(e+" 0 m"),n.push(e+" "+r+" "+r+" "+e+" 0 "+e+" c"),n.push("-"+r+" "+e+" -"+e+" "+r+" -"+e+" 0 c"),n.push("-"+e+" -"+r+" -"+r+" -"+e+" 0 -"+e+" c"),n.push(r+" -"+e+" "+e+" -"+r+" "+e+" 0 c"),n.push("f"),n.push("Q"),i.stream=n.join("\n"),i},YesPushDown:function(t){var i=hi(t);i.scope=t.scope;var n=[],e=_i.internal.getWidth(t)<=_i.internal.getHeight(t)?_i.internal.getWidth(t)/4:_i.internal.getHeight(t)/4;e=Number((.9*e).toFixed(5));var r=Number((2*e).toFixed(5)),s=Number((r*_i.internal.Bezier_C).toFixed(5)),o=Number((e*_i.internal.Bezier_C).toFixed(5));return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+ai(_i.internal.getWidth(t)/2)+" "+ai(_i.internal.getHeight(t)/2)+" cm"),n.push(r+" 0 m"),n.push(r+" "+s+" "+s+" "+r+" 0 "+r+" c"),n.push("-"+s+" "+r+" -"+r+" "+s+" -"+r+" 0 c"),n.push("-"+r+" -"+s+" -"+s+" -"+r+" 0 -"+r+" c"),n.push(s+" -"+r+" "+r+" -"+s+" "+r+" 0 c"),n.push("f"),n.push("Q"),n.push("0 g"),n.push("q"),n.push("1 0 0 1 "+ai(_i.internal.getWidth(t)/2)+" "+ai(_i.internal.getHeight(t)/2)+" cm"),n.push(e+" 0 m"),n.push(e+" "+o+" "+o+" "+e+" 0 "+e+" c"),n.push("-"+o+" "+e+" -"+e+" "+o+" -"+e+" 0 c"),n.push("-"+e+" -"+o+" -"+o+" -"+e+" 0 -"+e+" c"),n.push(o+" -"+e+" "+e+" -"+o+" "+e+" 0 c"),n.push("f"),n.push("Q"),i.stream=n.join("\n"),i},OffPushDown:function(t){var i=hi(t);i.scope=t.scope;var n=[],e=_i.internal.getWidth(t)<=_i.internal.getHeight(t)?_i.internal.getWidth(t)/4:_i.internal.getHeight(t)/4;e=Number((.9*e).toFixed(5));var r=Number((2*e).toFixed(5)),s=Number((r*_i.internal.Bezier_C).toFixed(5));return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+ai(_i.internal.getWidth(t)/2)+" "+ai(_i.internal.getHeight(t)/2)+" cm"),n.push(r+" 0 m"),n.push(r+" "+s+" "+s+" "+r+" 0 "+r+" c"),n.push("-"+s+" "+r+" -"+r+" "+s+" -"+r+" 0 c"),n.push("-"+r+" -"+s+" -"+s+" -"+r+" 0 -"+r+" c"),n.push(s+" -"+r+" "+r+" -"+s+" "+r+" 0 c"),n.push("f"),n.push("Q"),i.stream=n.join("\n"),i}},Cross:{createAppearanceStream:function(t){var i={D:{Off:_i.RadioButton.Cross.OffPushDown},N:{}};return i.N[t]=_i.RadioButton.Cross.YesNormal,i.D[t]=_i.RadioButton.Cross.YesPushDown,i},getCA:function(){return"8"},YesNormal:function(t){var i=hi(t);i.scope=t.scope;var n=[],e=_i.internal.calculateCross(t);return n.push("q"),n.push("1 1 "+oi(_i.internal.getWidth(t)-2)+" "+oi(_i.internal.getHeight(t)-2)+" re"),n.push("W"),n.push("n"),n.push(oi(e.x1.x)+" "+oi(e.x1.y)+" m"),n.push(oi(e.x2.x)+" "+oi(e.x2.y)+" l"),n.push(oi(e.x4.x)+" "+oi(e.x4.y)+" m"),n.push(oi(e.x3.x)+" "+oi(e.x3.y)+" l"),n.push("s"),n.push("Q"),i.stream=n.join("\n"),i},YesPushDown:function(t){var i=hi(t);i.scope=t.scope;var n=_i.internal.calculateCross(t),e=[];return e.push("0.749023 g"),e.push("0 0 "+oi(_i.internal.getWidth(t))+" "+oi(_i.internal.getHeight(t))+" re"),e.push("f"),e.push("q"),e.push("1 1 "+oi(_i.internal.getWidth(t)-2)+" "+oi(_i.internal.getHeight(t)-2)+" re"),e.push("W"),e.push("n"),e.push(oi(n.x1.x)+" "+oi(n.x1.y)+" m"),e.push(oi(n.x2.x)+" "+oi(n.x2.y)+" l"),e.push(oi(n.x4.x)+" "+oi(n.x4.y)+" m"),e.push(oi(n.x3.x)+" "+oi(n.x3.y)+" l"),e.push("s"),e.push("Q"),i.stream=e.join("\n"),i},OffPushDown:function(t){var i=hi(t);i.scope=t.scope;var n=[];return n.push("0.749023 g"),n.push("0 0 "+oi(_i.internal.getWidth(t))+" "+oi(_i.internal.getHeight(t))+" re"),n.push("f"),i.stream=n.join("\n"),i}}},createDefaultAppearanceStream:function(t){var i=t.scope.internal.getFont(t.fontName,t.fontStyle).id,n=t.scope.__private__.encodeColorString(t.color);return"/"+i+" "+t.fontSize+" Tf "+n}};_i.internal={Bezier_C:.551915024494,calculateCross:function(t){var i=_i.internal.getWidth(t),n=_i.internal.getHeight(t),e=Math.min(i,n);return{x1:{x:(i-e)/2,y:(n-e)/2+e},x2:{x:(i-e)/2+e,y:(n-e)/2},x3:{x:(i-e)/2,y:(n-e)/2},x4:{x:(i-e)/2+e,y:(n-e)/2+e}}}},_i.internal.getWidth=function(t){var i=0;return"object"===B(t)&&(i=ci(t.Rect[2])),i},_i.internal.getHeight=function(t){var i=0;return"object"===B(t)&&(i=ci(t.Rect[3])),i};var Ui=ni.addField=function(t){if(Ai(this,t),!(t instanceof ji))throw new Error("Invalid argument passed to jsPDF.addField.");var i;return(i=t).scope.internal.acroformPlugin.printedOut&&(i.scope.internal.acroformPlugin.printedOut=!1,i.scope.internal.acroformPlugin.acroFormDictionaryRoot=null),i.scope.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(i),t.page=t.scope.internal.getCurrentPageInfo().pageNumber,this};function Vi(t){return t.reduce((function(t,i,n){return t[i]=n,t}),{})}ni.AcroFormChoiceField=Ei,ni.AcroFormListBox=Pi,ni.AcroFormComboBox=Ii,ni.AcroFormEditBox=Oi,ni.AcroFormButton=Fi,ni.AcroFormPushButton=Ri,ni.AcroFormRadioButton=Bi,ni.AcroFormCheckBox=Di,ni.AcroFormTextField=Ti,ni.AcroFormPasswordField=zi,ni.AcroFormAppearance=_i,ni.AcroForm={ChoiceField:Ei,ListBox:Pi,ComboBox:Ii,EditBox:Oi,Button:Fi,PushButton:Ri,RadioButton:Bi,CheckBox:Di,TextField:Ti,PasswordField:zi,Appearance:_i},ii.AcroForm={ChoiceField:Ei,ListBox:Pi,ComboBox:Ii,EditBox:Oi,Button:Fi,PushButton:Ri,RadioButton:Bi,CheckBox:Di,TextField:Ti,PasswordField:zi,Appearance:_i},function(t){t.__addimage__={};var i="UNKNOWN",n={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]]},e=t.__addimage__.getImageFileTypeByImageData=function(t,e){var r,s,o,a,u,c=i;if("RGBA"===(e=e||i)||void 0!==t.data&&t.data instanceof Uint8ClampedArray&&"height"in t&&"width"in t)return"RGBA";if(y(t))for(u in n)for(o=n[u],r=0;r<o.length;r+=1){for(a=!0,s=0;s<o[r].length;s+=1)if(void 0!==o[r][s]&&o[r][s]!==t[s]){a=!1;break}if(!0===a){c=u;break}}else for(u in n)for(o=n[u],r=0;r<o.length;r+=1){for(a=!0,s=0;s<o[r].length;s+=1)if(void 0!==o[r][s]&&o[r][s]!==t.charCodeAt(s)){a=!1;break}if(!0===a){c=u;break}}return c===i&&e!==i&&(c=e),c},r=function t(i){for(var n=this.internal.write,e=this.internal.putStream,r=(0,this.internal.getFilters)();-1!==r.indexOf("FlateEncode");)r.splice(r.indexOf("FlateEncode"),1);i.objectId=this.internal.newObject();var s=[];if(s.push({key:"Type",value:"/XObject"}),s.push({key:"Subtype",value:"/Image"}),s.push({key:"Width",value:i.width}),s.push({key:"Height",value:i.height}),i.colorSpace===w.INDEXED?s.push({key:"ColorSpace",value:"[/Indexed /DeviceRGB "+(i.palette.length/3-1)+" "+("sMask"in i&&void 0!==i.sMask?i.objectId+2:i.objectId+1)+" 0 R]"}):(s.push({key:"ColorSpace",value:"/"+i.colorSpace}),i.colorSpace===w.DEVICE_CMYK&&s.push({key:"Decode",value:"[1 0 1 0 1 0 1 0]"})),s.push({key:"BitsPerComponent",value:i.bitsPerComponent}),"decodeParameters"in i&&void 0!==i.decodeParameters&&s.push({key:"DecodeParms",value:"<<"+i.decodeParameters+">>"}),"transparency"in i&&Array.isArray(i.transparency)){for(var o="",a=0,u=i.transparency.length;a<u;a++)o+=i.transparency[a]+" "+i.transparency[a]+" ";s.push({key:"Mask",value:"["+o+"]"})}if(void 0!==i.sMask&&s.push({key:"SMask",value:i.objectId+1+" 0 R"}),e({data:i.data,additionalKeyValues:s,alreadyAppliedFilters:void 0!==i.filter?["/"+i.filter]:void 0,objectId:i.objectId}),n("endobj"),"sMask"in i&&void 0!==i.sMask){var c={width:i.width,height:i.height,colorSpace:"DeviceGray",bitsPerComponent:i.bitsPerComponent,decodeParameters:"/Predictor "+i.predictor+" /Colors 1 /BitsPerComponent "+i.bitsPerComponent+" /Columns "+i.width,data:i.sMask};"filter"in i&&(c.filter=i.filter),t.call(this,c)}if(i.colorSpace===w.INDEXED){var h=this.internal.newObject();e({data:k(new Uint8Array(i.palette)),objectId:h}),n("endobj")}},s=function(){var t=this.internal.collections.addImage_images;for(var i in t)r.call(this,t[i])},o=function(){var t,i=this.internal.collections.addImage_images,n=this.internal.write;for(var e in i)n("/I"+(t=i[e]).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},c=function(){return Object.keys(this.internal.collections.addImage_images).length},h=function(i){return"function"==typeof t["process"+i.toUpperCase()]},f=function(t){return"object"===B(t)&&1===t.nodeType},l=function(i,n){if("IMG"===i.nodeName&&i.hasAttribute("src")){var e=""+i.getAttribute("src");if(0===e.indexOf("data:image/"))return Mt(unescape(e).split("base64,").pop());var r=t.loadFile(e,!0);if(void 0!==r)return r}if("CANVAS"===i.nodeName){if(0===i.width||0===i.height)throw new Error("Given canvas must have data. Canvas width: "+i.width+", height: "+i.height);var s;switch(n){case"PNG":s="image/png";break;case"WEBP":s="image/webp";break;default:s="image/jpeg"}return Mt(i.toDataURL(s,1).split("base64,").pop())}},d=function(t){var i=this.internal.collections.addImage_images;if(i)for(var n in i)if(t===i[n].alias)return i[n]},v=function(t,i,n){return t||i||(t=-96,i=-96),t<0&&(t=-1*n.width*72/t/this.internal.scaleFactor),i<0&&(i=-1*n.height*72/i/this.internal.scaleFactor),0===t&&(t=i*n.width/n.height),0===i&&(i=t*n.height/n.width),[t,i]},m=function(t,i,n,e,r,s){var o=v.call(this,n,e,r),a=this.internal.getCoordinateString,c=this.internal.getVerticalCoordinateString,h=u.call(this);if(n=o[0],e=o[1],h[r.index]=r,s){s*=Math.PI/180;var f=Math.cos(s),l=Math.sin(s),d=function(t){return t.toFixed(4)},m=[d(f),d(l),d(-1*l),d(f),0,0,"cm"]}this.internal.write("q"),s?(this.internal.write([1,"0","0",1,a(t),c(i+e),"cm"].join(" ")),this.internal.write(m.join(" ")),this.internal.write([a(n),"0","0",a(e),"0","0","cm"].join(" "))):this.internal.write([a(n),"0","0",a(e),a(t),c(i+e),"cm"].join(" ")),this.isAdvancedAPI()&&this.internal.write([1,0,0,-1,0,0,"cm"].join(" ")),this.internal.write("/I"+r.index+" Do"),this.internal.write("Q")},w=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"},b=t.__addimage__.sHashCode=function(t){var i,n,e=0;if("string"==typeof t)for(n=t.length,i=0;i<n;i++)e=(e<<5)-e+t.charCodeAt(i),e|=0;else if(y(t))for(n=t.byteLength/2,i=0;i<n;i++)e=(e<<5)-e+t[i],e|=0;return e},g=t.__addimage__.validateStringAsBase64=function(t){(t=t||"").toString().trim();var i=!0;return 0===t.length&&(i=!1),t.length%4!=0&&(i=!1),!1===/^[A-Za-z0-9+/]+$/.test(t.substr(0,t.length-2))&&(i=!1),!1===/^[A-Za-z0-9/][A-Za-z0-9+/]|[A-Za-z0-9+/]=|==$/.test(t.substr(-2))&&(i=!1),i},N=t.__addimage__.extractImageFromDataUrl=function(t){var i=(t=t||"").split("base64,"),n=null;if(2===i.length){var e=/^data:(\w*\/\w*);*(charset=(?!charset=)[\w=-]*)*;*$/.exec(i[0]);Array.isArray(e)&&(n={mimeType:e[1],charset:e[2],data:i[1]})}return n},L=t.__addimage__.supportsArrayBuffer=function(){return"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array};t.__addimage__.isArrayBuffer=function(t){return L()&&t instanceof ArrayBuffer};var y=t.__addimage__.isArrayBufferView=function(t){return L()&&"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)},A=t.__addimage__.binaryStringToUint8Array=function(t){for(var i=t.length,n=new Uint8Array(i),e=0;e<i;e++)n[e]=t.charCodeAt(e);return n},k=t.__addimage__.arrayBufferToBinaryString=function(t){for(var i="",n=y(t)?t:new Uint8Array(t),e=0;e<n.length;e+=8192)i+=String.fromCharCode.apply(null,n.subarray(e,e+8192));return i};t.addImage=function(){var t,n,e,r,s,o,u,c,h;if("number"==typeof arguments[1]?(n=i,e=arguments[1],r=arguments[2],s=arguments[3],o=arguments[4],u=arguments[5],c=arguments[6],h=arguments[7]):(n=arguments[1],e=arguments[2],r=arguments[3],s=arguments[4],o=arguments[5],u=arguments[6],c=arguments[7],h=arguments[8]),"object"===B(t=arguments[0])&&!f(t)&&"imageData"in t){var l=t;t=l.imageData,n=l.format||n||i,e=l.x||e||0,r=l.y||r||0,s=l.w||l.width||s,o=l.h||l.height||o,u=l.alias||u,c=l.compression||c,h=l.rotation||l.angle||h}var d=this.internal.getFilters();if(void 0===c&&-1!==d.indexOf("FlateEncode")&&(c="SLOW"),isNaN(e)||isNaN(r))throw new Error("Invalid coordinates passed to jsPDF.addImage");a.call(this);var v=S.call(this,t,n,u,c);return m.call(this,e,r,s,o,v,h),this};var S=function(n,r,s,o){var a,u,v;if("string"==typeof n&&e(n)===i){n=unescape(n);var m=x(n,!1);(""!==m||void 0!==(m=t.loadFile(n,!0)))&&(n=m)}if(f(n)&&(n=l(n,r)),r=e(n,r),!h(r))throw new Error("addImage does not support files of type '"+r+"', please ensure that a plugin for '"+r+"' support is added.");if((null==(v=s)||0===v.length)&&(s=function(t){return"string"==typeof t||y(t)?b(t):y(t.data)?b(t.data):null}(n)),(a=d.call(this,s))||(L()&&(n instanceof Uint8Array||"RGBA"===r||(u=n,n=A(n))),a=this["process"+r.toUpperCase()](n,c.call(this),s,function(i){return i&&"string"==typeof i&&(i=i.toUpperCase()),i in t.image_compression?i:p.NONE}(o),u)),!a)throw new Error("An unknown error occurred whilst processing the image.");return a},x=t.__addimage__.convertBase64ToBinaryString=function(t,i){var n;i="boolean"!=typeof i||i;var e,r="";if("string"==typeof t){e=null!==(n=N(t))?n.data:t;try{r=Mt(e)}catch(t){if(i)throw g(e)?new Error("atob-Error in jsPDF.convertBase64ToBinaryString "+t.message):new Error("Supplied Data is not a valid base64-String jsPDF.convertBase64ToBinaryString ")}}return r};t.getImageProperties=function(n){var r,s,o="";if(f(n)&&(n=l(n)),"string"==typeof n&&e(n)===i&&(""===(o=x(n,!1))&&(o=t.loadFile(n)||""),n=o),s=e(n),!h(s))throw new Error("addImage does not support files of type '"+s+"', please ensure that a plugin for '"+s+"' support is added.");if(!L()||n instanceof Uint8Array||(n=A(n)),!(r=this["process"+s.toUpperCase()](n)))throw new Error("An unknown error occurred whilst processing the image");return r.fileType=s,r}}(ii.API),
102
102
  /**
103
103
  * @license
104
104
  * Copyright (c) 2014 Steven Spungin (TwelveTone LLC) steven@twelvetone.tv
@@ -122,7 +122,7 @@ function(t){var i={1569:[65152],1570:[65153,65154],1571:[65155,65156],1572:[6515
122
122
  * Licensed under the MIT License.
123
123
  * http://opensource.org/licenses/mit-license
124
124
  */
125
- function(t){var i=function(){var t=void 0;Object.defineProperty(this,"pdf",{get:function(){return t},set:function(i){t=i}});var i=150;Object.defineProperty(this,"width",{get:function(){return i},set:function(t){i=isNaN(t)||!1===Number.isInteger(t)||t<0?150:t,this.getContext("2d").pageWrapXEnabled&&(this.getContext("2d").pageWrapX=i+1)}});var n=300;Object.defineProperty(this,"height",{get:function(){return n},set:function(t){n=isNaN(t)||!1===Number.isInteger(t)||t<0?300:t,this.getContext("2d").pageWrapYEnabled&&(this.getContext("2d").pageWrapY=n+1)}});var e=[];Object.defineProperty(this,"childNodes",{get:function(){return e},set:function(t){e=t}});var r={};Object.defineProperty(this,"style",{get:function(){return r},set:function(t){r=t}}),Object.defineProperty(this,"parentNode",{})};i.prototype.getContext=function(t,i){var n;if("2d"!==(t=t||"2d"))return null;for(n in i)this.pdf.context2d.hasOwnProperty(n)&&(this.pdf.context2d[n]=i[n]);return this.pdf.context2d._canvas=this,this.pdf.context2d},i.prototype.toDataURL=function(){throw new Error("toDataURL is not implemented.")},t.events.push(["initialized",function(){this.canvas=new i,this.canvas.pdf=this}])}(ii.API),function(t){var i={left:0,top:0,bottom:0,right:0},n=!1,e=function(){void 0===this.internal.__cell__&&(this.internal.__cell__={},this.internal.__cell__.padding=3,this.internal.__cell__.headerFunction=void 0,this.internal.__cell__.margins=Object.assign({},i),this.internal.__cell__.margins.width=this.getPageWidth(),r.call(this))},r=function(){this.internal.__cell__.lastCell=new s,this.internal.__cell__.pages=1},s=function(){var t=arguments[0];Object.defineProperty(this,"x",{enumerable:!0,get:function(){return t},set:function(i){t=i}});var i=arguments[1];Object.defineProperty(this,"y",{enumerable:!0,get:function(){return i},set:function(t){i=t}});var n=arguments[2];Object.defineProperty(this,"width",{enumerable:!0,get:function(){return n},set:function(t){n=t}});var e=arguments[3];Object.defineProperty(this,"height",{enumerable:!0,get:function(){return e},set:function(t){e=t}});var r=arguments[4];Object.defineProperty(this,"text",{enumerable:!0,get:function(){return r},set:function(t){r=t}});var s=arguments[5];Object.defineProperty(this,"lineNumber",{enumerable:!0,get:function(){return s},set:function(t){s=t}});var o=arguments[6];return Object.defineProperty(this,"align",{enumerable:!0,get:function(){return o},set:function(t){o=t}}),this};s.prototype.clone=function(){return new s(this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align)},s.prototype.toArray=function(){return[this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align]},t.setHeaderFunction=function(t){return e.call(this),this.internal.__cell__.headerFunction="function"==typeof t?t:void 0,this},t.getTextDimensions=function(t,i){e.call(this);var n=(i=i||{}).fontSize||this.getFontSize(),r=i.font||this.getFont(),s=i.scaleFactor||this.internal.scaleFactor,o=0,a=0,u=0,c=this;if(!Array.isArray(t)&&"string"!=typeof t){if("number"!=typeof t)throw new Error("getTextDimensions expects text-parameter to be of type String or type Number or an Array of Strings.");t=String(t)}var h=i.maxWidth;h>0?"string"==typeof t?t=this.splitTextToSize(t,h):"[object Array]"===Object.prototype.toString.call(t)&&(t=t.reduce((function(t,i){return t.concat(c.splitTextToSize(i,h))}),[])):t=Array.isArray(t)?t:[t];for(var f=0;f<t.length;f++)o<(u=this.getStringUnitWidth(t[f],{font:r})*n)&&(o=u);return 0!==o&&(a=t.length),{w:o/=s,h:Math.max((a*n*this.getLineHeightFactor()-n*(this.getLineHeightFactor()-1))/s,0)}},t.cellAddPage=function(){e.call(this),this.addPage();var t=this.internal.__cell__.margins||i;return this.internal.__cell__.lastCell=new s(t.left,t.top,void 0,void 0),this.internal.__cell__.pages+=1,this};var o=t.cell=function(){var t;t=arguments[0]instanceof s?arguments[0]:new s(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5]),e.call(this);var r=this.internal.__cell__.lastCell,o=this.internal.__cell__.padding,a=this.internal.__cell__.margins||i,u=this.internal.__cell__.tableHeaderRow,c=this.internal.__cell__.printHeaders;return void 0!==r.lineNumber&&(r.lineNumber===t.lineNumber?(t.x=(r.x||0)+(r.width||0),t.y=r.y||0):r.y+r.height+t.height+a.bottom>this.getPageHeight()?(this.cellAddPage(),t.y=a.top,c&&u&&(this.printHeaderRow(t.lineNumber,!0),t.y+=u[0].height)):t.y=r.y+r.height||t.y),void 0!==t.text[0]&&(this.rect(t.x,t.y,t.width,t.height,!0===n?"FD":void 0),"right"===t.align?this.text(t.text,t.x+t.width-o,t.y+o,{align:"right",baseline:"top"}):"center"===t.align?this.text(t.text,t.x+t.width/2,t.y+o,{align:"center",baseline:"top",maxWidth:t.width-o-o}):this.text(t.text,t.x+o,t.y+o,{align:"left",baseline:"top",maxWidth:t.width-o-o})),this.internal.__cell__.lastCell=t,this};t.table=function(t,n,u,c,h){if(e.call(this),!u)throw new Error("No data for PDF table.");var f,l,d,v,m=[],w=[],p=[],b={},g={},N=[],L=[],y=(h=h||{}).autoSize||!1,A=!1!==h.printHeaders,k=h.css&&void 0!==h.css["font-size"]?16*h.css["font-size"]:h.fontSize||12,S=h.margins||Object.assign({width:this.getPageWidth()},i),x="number"==typeof h.padding?h.padding:3,q=h.headerBackgroundColor||"#c8c8c8",M=h.headerTextColor||"#000";if(r.call(this),this.internal.__cell__.printHeaders=A,this.internal.__cell__.margins=S,this.internal.__cell__.table_font_size=k,this.internal.__cell__.padding=x,this.internal.__cell__.headerBackgroundColor=q,this.internal.__cell__.headerTextColor=M,this.setFontSize(k),null==c)w=m=Object.keys(u[0]),p=m.map((function(){return"left"}));else if(Array.isArray(c)&&"object"===B(c[0]))for(m=c.map((function(t){return t.name})),w=c.map((function(t){return t.prompt||t.name||""})),p=c.map((function(t){return t.align||"left"})),f=0;f<c.length;f+=1)g[c[f].name]=c[f].width*(19.049976/25.4);else Array.isArray(c)&&"string"==typeof c[0]&&(w=m=c,p=m.map((function(){return"left"})));if(y||Array.isArray(c)&&"string"==typeof c[0])for(f=0;f<m.length;f+=1){for(b[v=m[f]]=u.map((function(t){return t[v]})),this.setFont(void 0,"bold"),N.push(this.getTextDimensions(w[f],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w),l=b[v],this.setFont(void 0,"normal"),d=0;d<l.length;d+=1)N.push(this.getTextDimensions(l[d],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w);g[v]=Math.max.apply(null,N)+x+x,N=[]}if(A){var j={};for(f=0;f<m.length;f+=1)j[m[f]]={},j[m[f]].text=w[f],j[m[f]].align=p[f];var E=a.call(this,j,g);L=m.map((function(i){return new s(t,n,g[i],E,j[i].text,void 0,j[i].align)})),this.setTableHeaderRow(L),this.printHeaderRow(1,!1)}var P=c.reduce((function(t,i){return t[i.name]=i.align,t}),{});for(f=0;f<u.length;f+=1){"rowStart"in h&&h.rowStart instanceof Function&&h.rowStart({row:f,data:u[f]},this);var I=a.call(this,u[f],g);for(d=0;d<m.length;d+=1){var F=u[f][m[d]];"cellStart"in h&&h.cellStart instanceof Function&&h.cellStart({row:f,col:d,data:F},this),o.call(this,new s(t,n,g[m[d]],I,F,f+2,P[m[d]]))}}return this.internal.__cell__.table_x=t,this.internal.__cell__.table_y=n,this};var a=function(t,i){var n=this.internal.__cell__.padding,e=this.internal.__cell__.table_font_size,r=this.internal.scaleFactor;return Object.keys(t).map((function(e){var r=t[e];return this.splitTextToSize(r.hasOwnProperty("text")?r.text:r,i[e]-n-n)}),this).map((function(t){return this.getLineHeightFactor()*t.length*e/r+n+n}),this).reduce((function(t,i){return Math.max(t,i)}),0)};t.setTableHeaderRow=function(t){e.call(this),this.internal.__cell__.tableHeaderRow=t},t.printHeaderRow=function(t,i){if(e.call(this),!this.internal.__cell__.tableHeaderRow)throw new Error("Property tableHeaderRow does not exist.");var r;if(n=!0,"function"==typeof this.internal.__cell__.headerFunction){var a=this.internal.__cell__.headerFunction(this,this.internal.__cell__.pages);this.internal.__cell__.lastCell=new s(a[0],a[1],a[2],a[3],void 0,-1)}this.setFont(void 0,"bold");for(var u=[],c=0;c<this.internal.__cell__.tableHeaderRow.length;c+=1){r=this.internal.__cell__.tableHeaderRow[c].clone(),i&&(r.y=this.internal.__cell__.margins.top||0,u.push(r)),r.lineNumber=t;var h=this.getTextColor();this.setTextColor(this.internal.__cell__.headerTextColor),this.setFillColor(this.internal.__cell__.headerBackgroundColor),o.call(this,r),this.setTextColor(h)}u.length>0&&this.setTableHeaderRow(u),this.setFont(void 0,"normal"),n=!1}}(ii.API);var Wi={italic:["italic","oblique","normal"],oblique:["oblique","italic","normal"],normal:["normal","oblique","italic"]},Hi=["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded"],Gi=Vi(Hi),Ji=[100,200,300,400,500,600,700,800,900],Yi=Vi(Ji);function Ki(t){var i=t.family.replace(/"|'/g,"").toLowerCase(),n=function(t){return Wi[t=t||"normal"]?t:"normal"}(t.style),e=function(t){return t?"number"==typeof t?t>=100&&t<=900&&t%100==0?t:400:/^\d00$/.test(t)?parseInt(t):"bold"===t?700:400:400}(t.weight),r=function(t){return"number"==typeof Gi[t=t||"normal"]?t:"normal"}(t.stretch);return{family:i,style:n,weight:e,stretch:r,src:t.src||[],ref:t.ref||{name:i,style:[r,n,e].join(" ")}}}function Xi(t,i,n,e){var r;for(r=n;r>=0&&r<i.length;r+=e)if(t[i[r]])return t[i[r]];for(r=n;r>=0&&r<i.length;r-=e)if(t[i[r]])return t[i[r]]}var $i={"sans-serif":"helvetica",fixed:"courier",monospace:"courier",terminal:"courier",cursive:"times",fantasy:"times",serif:"times"},Qi={caption:"times",icon:"times",menu:"times","message-box":"times","small-caption":"times","status-bar":"times"};function Zi(t){return[t.stretch,t.style,t.weight,t.family].join(" ")}function tn(t){return t.trimLeft()}function nn(t,i){for(var n=0;n<t.length;){if(t.charAt(n)===i)return[t.substring(0,n),t.substring(n+1)];n+=1}return null}function en(t){var i=t.match(/^(-[a-z_]|[a-z_])[a-z0-9_-]*/i);return null===i?null:[i[0],t.substring(i[0].length)]}var rn,sn,on,an,un=["times"];!function(t){var i,n,e,r,s,o,a,u,c,h=function(t){return this.isStrokeTransparent=(t=t||{}).isStrokeTransparent||!1,this.strokeOpacity=t.strokeOpacity||1,this.strokeStyle=t.strokeStyle||"#000000",this.fillStyle=t.fillStyle||"#000000",this.isFillTransparent=t.isFillTransparent||!1,this.fillOpacity=t.fillOpacity||1,this.font=t.font||"10px sans-serif",this.textBaseline=t.textBaseline||"alphabetic",this.textAlign=t.textAlign||"left",this.lineWidth=t.lineWidth||1,this.lineJoin=t.lineJoin||"miter",this.lineCap=t.lineCap||"butt",this.path=t.path||[],this.transform=void 0!==t.transform?t.transform.clone():new u,this.globalCompositeOperation=t.globalCompositeOperation||"normal",this.globalAlpha=t.globalAlpha||1,this.clip_path=t.clip_path||[],this.currentPoint=t.currentPoint||new o,this.miterLimit=t.miterLimit||10,this.lastPoint=t.lastPoint||new o,this.lineDashOffset=t.lineDashOffset||0,this.lineDash=t.lineDash||[],this.margin=t.margin||[0,0,0,0],this.prevPageLastElemOffset=t.prevPageLastElemOffset||0,this.ignoreClearRect="boolean"!=typeof t.ignoreClearRect||t.ignoreClearRect,this};t.events.push(["initialized",function(){this.context2d=new f(this),i=this.internal.f2,n=this.internal.getCoordinateString,e=this.internal.getVerticalCoordinateString,r=this.internal.getHorizontalCoordinate,s=this.internal.getVerticalCoordinate,o=this.internal.Point,a=this.internal.Rectangle,u=this.internal.Matrix,c=new h}]);var f=function(t){Object.defineProperty(this,"canvas",{get:function(){return{parentNode:!1,style:!1}}});var i=t;Object.defineProperty(this,"pdf",{get:function(){return i}});var n=!1;Object.defineProperty(this,"pageWrapXEnabled",{get:function(){return n},set:function(t){n=Boolean(t)}});var e=!1;Object.defineProperty(this,"pageWrapYEnabled",{get:function(){return e},set:function(t){e=Boolean(t)}});var r=0;Object.defineProperty(this,"posX",{get:function(){return r},set:function(t){isNaN(t)||(r=t)}});var s=0;Object.defineProperty(this,"posY",{get:function(){return s},set:function(t){isNaN(t)||(s=t)}}),Object.defineProperty(this,"margin",{get:function(){return c.margin},set:function(t){var i;"number"==typeof t?i=[t,t,t,t]:((i=new Array(4))[0]=t[0],i[1]=t.length>=2?t[1]:i[0],i[2]=t.length>=3?t[2]:i[0],i[3]=t.length>=4?t[3]:i[1]),c.margin=i}});var o=!1;Object.defineProperty(this,"autoPaging",{get:function(){return o},set:function(t){o=t}});var a=0;Object.defineProperty(this,"lastBreak",{get:function(){return a},set:function(t){a=t}});var u=[];Object.defineProperty(this,"pageBreaks",{get:function(){return u},set:function(t){u=t}}),Object.defineProperty(this,"ctx",{get:function(){return c},set:function(t){t instanceof h&&(c=t)}}),Object.defineProperty(this,"path",{get:function(){return c.path},set:function(t){c.path=t}});var f=[];Object.defineProperty(this,"ctxStack",{get:function(){return f},set:function(t){f=t}}),Object.defineProperty(this,"fillStyle",{get:function(){return this.ctx.fillStyle},set:function(t){var i;i=l(t),this.ctx.fillStyle=i.style,this.ctx.isFillTransparent=0===i.a,this.ctx.fillOpacity=i.a,this.pdf.setFillColor(i.r,i.g,i.b,{a:i.a}),this.pdf.setTextColor(i.r,i.g,i.b,{a:i.a})}}),Object.defineProperty(this,"strokeStyle",{get:function(){return this.ctx.strokeStyle},set:function(t){var i=l(t);this.ctx.strokeStyle=i.style,this.ctx.isStrokeTransparent=0===i.a,this.ctx.strokeOpacity=i.a,0===i.a?this.pdf.setDrawColor(255,255,255):this.pdf.setDrawColor(i.r,i.g,i.b)}}),Object.defineProperty(this,"lineCap",{get:function(){return this.ctx.lineCap},set:function(t){-1!==["butt","round","square"].indexOf(t)&&(this.ctx.lineCap=t,this.pdf.setLineCap(t))}}),Object.defineProperty(this,"lineWidth",{get:function(){return this.ctx.lineWidth},set:function(t){isNaN(t)||(this.ctx.lineWidth=t,this.pdf.setLineWidth(t))}}),Object.defineProperty(this,"lineJoin",{get:function(){return this.ctx.lineJoin},set:function(t){-1!==["bevel","round","miter"].indexOf(t)&&(this.ctx.lineJoin=t,this.pdf.setLineJoin(t))}}),Object.defineProperty(this,"miterLimit",{get:function(){return this.ctx.miterLimit},set:function(t){isNaN(t)||(this.ctx.miterLimit=t,this.pdf.setMiterLimit(t))}}),Object.defineProperty(this,"textBaseline",{get:function(){return this.ctx.textBaseline},set:function(t){this.ctx.textBaseline=t}}),Object.defineProperty(this,"textAlign",{get:function(){return this.ctx.textAlign},set:function(t){-1!==["right","end","center","left","start"].indexOf(t)&&(this.ctx.textAlign=t)}});var d=null;function v(t,i){if(null===d){var n=function(t){var i=[];return Object.keys(t).forEach((function(n){t[n].forEach((function(t){var e=null;switch(t){case"bold":e={family:n,weight:"bold"};break;case"italic":e={family:n,style:"italic"};break;case"bolditalic":e={family:n,weight:"bold",style:"italic"};break;case"":case"normal":e={family:n}}null!==e&&(e.ref={name:n,style:t},i.push(e))}))})),i}(t.getFontList());d=function(t){for(var i={},n=0;n<t.length;++n){var e=Ki(t[n]),r=e.family,s=e.stretch,o=e.style,a=e.weight;i[r]=i[r]||{},i[r][s]=i[r][s]||{},i[r][s][o]=i[r][s][o]||{},i[r][s][o][a]=e}return i}(n.concat(i))}return d}var m=null;Object.defineProperty(this,"fontFaces",{get:function(){return m},set:function(t){d=null,m=t}}),Object.defineProperty(this,"font",{get:function(){return this.ctx.font},set:function(t){var i;if(this.ctx.font=t,null!==(i=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:\%|in|[cem]m|ex|p[ctx]))(?:\s*\/\s*(normal|[.\d]+(?:\%|in|[cem]m|ex|p[ctx])))?\s*([-_,\"\'\sa-z]+?)\s*$/i.exec(t))){var n=i[1],e=i[3],r=i[4],s=i[6],o=/^([.\d]+)((?:%|in|[cem]m|ex|p[ctx]))$/i.exec(r)[2];r="px"===o?Math.floor(parseFloat(r)*this.pdf.internal.scaleFactor):"em"===o?Math.floor(parseFloat(r)*this.pdf.getFontSize()):Math.floor(parseFloat(r)*this.pdf.internal.scaleFactor),this.pdf.setFontSize(r);var a=function(t){var i,n,e=[],r=t.trim();if(""===r)return un;if(r in Qi)return[Qi[r]];for(;""!==r;){switch(n=null,i=(r=tn(r)).charAt(0)){case'"':case"'":n=nn(r.substring(1),i);break;default:n=en(r)}if(null===n)return un;if(e.push(n[0]),""!==(r=tn(n[1]))&&","!==r.charAt(0))return un;r=r.replace(/^,/,"")}return e}(s);if(this.fontFaces){var u=function(t,i,n){for(var e=(n=n||{}).defaultFontFamily||"times",r=Object.assign({},$i,n.genericFontFamilies||{}),s=null,o=null,a=0;a<i.length;++a)if(r[(s=Ki(i[a])).family]&&(s.family=r[s.family]),t.hasOwnProperty(s.family)){o=t[s.family];break}if(!(o=o||t[e]))throw new Error("Could not find a font-family for the rule '"+Zi(s)+"' and default family '"+e+"'.");if(o=function(t,i){if(i[t])return i[t];var n=Gi[t],e=Xi(i,Hi,n,n<=Gi.normal?-1:1);if(!e)throw new Error("Could not find a matching font-stretch value for "+t);return e}(s.stretch,o),o=function(t,i){if(i[t])return i[t];for(var n=Wi[t],e=0;e<n.length;++e)if(i[n[e]])return i[n[e]];throw new Error("Could not find a matching font-style for "+t)}(s.style,o),!(o=function(t,i){if(i[t])return i[t];if(400===t&&i[500])return i[500];if(500===t&&i[400])return i[400];var n=Xi(i,Ji,Yi[t],t<400?-1:1);if(!n)throw new Error("Could not find a matching font-weight for value "+t);return n}(s.weight,o)))throw new Error("Failed to resolve a font for the rule '"+Zi(s)+"'.");return o}(v(this.pdf,this.fontFaces),a.map((function(t){return{family:t,stretch:"normal",weight:e,style:n}})));this.pdf.setFont(u.ref.name,u.ref.style)}else{var c="";("bold"===e||parseInt(e,10)>=700||"bold"===n)&&(c="bold"),"italic"===n&&(c+="italic"),0===c.length&&(c="normal");for(var h="",f={arial:"Helvetica",Arial:"Helvetica",verdana:"Helvetica",Verdana:"Helvetica",helvetica:"Helvetica",Helvetica:"Helvetica","sans-serif":"Helvetica",fixed:"Courier",monospace:"Courier",terminal:"Courier",cursive:"Times",fantasy:"Times",serif:"Times"},l=0;l<a.length;l++){if(void 0!==this.pdf.internal.getFont(a[l],c,{noFallback:!0,disableWarning:!0})){h=a[l];break}if("bolditalic"===c&&void 0!==this.pdf.internal.getFont(a[l],"bold",{noFallback:!0,disableWarning:!0}))h=a[l],c="bold";else if(void 0!==this.pdf.internal.getFont(a[l],"normal",{noFallback:!0,disableWarning:!0})){h=a[l],c="normal";break}}if(""===h)for(var d=0;d<a.length;d++)if(f[a[d]]){h=f[a[d]];break}this.pdf.setFont(h=""===h?"Times":h,c)}}}}),Object.defineProperty(this,"globalCompositeOperation",{get:function(){return this.ctx.globalCompositeOperation},set:function(t){this.ctx.globalCompositeOperation=t}}),Object.defineProperty(this,"globalAlpha",{get:function(){return this.ctx.globalAlpha},set:function(t){this.ctx.globalAlpha=t}}),Object.defineProperty(this,"lineDashOffset",{get:function(){return this.ctx.lineDashOffset},set:function(t){this.ctx.lineDashOffset=t,C.call(this)}}),Object.defineProperty(this,"lineDash",{get:function(){return this.ctx.lineDash},set:function(t){this.ctx.lineDash=t,C.call(this)}}),Object.defineProperty(this,"ignoreClearRect",{get:function(){return this.ctx.ignoreClearRect},set:function(t){this.ctx.ignoreClearRect=Boolean(t)}})};f.prototype.setLineDash=function(t){this.lineDash=t},f.prototype.getLineDash=function(){return this.lineDash.length%2?this.lineDash.concat(this.lineDash):this.lineDash.slice()},f.prototype.fill=function(){N.call(this,"fill",!1)},f.prototype.stroke=function(){N.call(this,"stroke",!1)},f.prototype.beginPath=function(){this.path=[{type:"begin"}]},f.prototype.moveTo=function(t,i){if(isNaN(t)||isNaN(i))throw kt.error("jsPDF.context2d.moveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.moveTo");var n=this.ctx.transform.applyToPoint(new o(t,i));this.path.push({type:"mt",x:n.x,y:n.y}),this.ctx.lastPoint=new o(t,i)},f.prototype.closePath=function(){var t=new o(0,0),i=0;for(i=this.path.length-1;-1!==i;i--)if("begin"===this.path[i].type&&"object"===B(this.path[i+1])&&"number"==typeof this.path[i+1].x){t=new o(this.path[i+1].x,this.path[i+1].y);break}this.path.push({type:"close"}),this.ctx.lastPoint=new o(t.x,t.y)},f.prototype.lineTo=function(t,i){if(isNaN(t)||isNaN(i))throw kt.error("jsPDF.context2d.lineTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.lineTo");var n=this.ctx.transform.applyToPoint(new o(t,i));this.path.push({type:"lt",x:n.x,y:n.y}),this.ctx.lastPoint=new o(n.x,n.y)},f.prototype.clip=function(){this.ctx.clip_path=JSON.parse(JSON.stringify(this.path)),N.call(this,null,!0)},f.prototype.quadraticCurveTo=function(t,i,n,e){if(isNaN(n)||isNaN(e)||isNaN(t)||isNaN(i))throw kt.error("jsPDF.context2d.quadraticCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.quadraticCurveTo");var r=this.ctx.transform.applyToPoint(new o(n,e)),s=this.ctx.transform.applyToPoint(new o(t,i));this.path.push({type:"qct",x1:s.x,y1:s.y,x:r.x,y:r.y}),this.ctx.lastPoint=new o(r.x,r.y)},f.prototype.bezierCurveTo=function(t,i,n,e,r,s){if(isNaN(r)||isNaN(s)||isNaN(t)||isNaN(i)||isNaN(n)||isNaN(e))throw kt.error("jsPDF.context2d.bezierCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.bezierCurveTo");var a=this.ctx.transform.applyToPoint(new o(r,s)),u=this.ctx.transform.applyToPoint(new o(t,i)),c=this.ctx.transform.applyToPoint(new o(n,e));this.path.push({type:"bct",x1:u.x,y1:u.y,x2:c.x,y2:c.y,x:a.x,y:a.y}),this.ctx.lastPoint=new o(a.x,a.y)},f.prototype.arc=function(t,i,n,e,r,s){if(isNaN(t)||isNaN(i)||isNaN(n)||isNaN(e)||isNaN(r))throw kt.error("jsPDF.context2d.arc: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.arc");if(s=Boolean(s),!this.ctx.transform.isIdentity){var a=this.ctx.transform.applyToPoint(new o(t,i));t=a.x,i=a.y;var u=this.ctx.transform.applyToPoint(new o(0,n)),c=this.ctx.transform.applyToPoint(new o(0,0));n=Math.sqrt(Math.pow(u.x-c.x,2)+Math.pow(u.y-c.y,2))}Math.abs(r-e)>=2*Math.PI&&(e=0,r=2*Math.PI),this.path.push({type:"arc",x:t,y:i,radius:n,startAngle:e,endAngle:r,counterclockwise:s})},f.prototype.arcTo=function(){throw new Error("arcTo not implemented.")},f.prototype.rect=function(t,i,n,e){if(isNaN(t)||isNaN(i)||isNaN(n)||isNaN(e))throw kt.error("jsPDF.context2d.rect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rect");this.moveTo(t,i),this.lineTo(t+n,i),this.lineTo(t+n,i+e),this.lineTo(t,i+e),this.lineTo(t,i),this.lineTo(t+n,i),this.lineTo(t,i)},f.prototype.fillRect=function(t,i,n,e){if(isNaN(t)||isNaN(i)||isNaN(n)||isNaN(e))throw kt.error("jsPDF.context2d.fillRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillRect");if(!d.call(this)){var r={};"butt"!==this.lineCap&&(r.lineCap=this.lineCap,this.lineCap="butt"),"miter"!==this.lineJoin&&(r.lineJoin=this.lineJoin,this.lineJoin="miter"),this.beginPath(),this.rect(t,i,n,e),this.fill(),r.hasOwnProperty("lineCap")&&(this.lineCap=r.lineCap),r.hasOwnProperty("lineJoin")&&(this.lineJoin=r.lineJoin)}},f.prototype.strokeRect=function(t,i,n,e){if(isNaN(t)||isNaN(i)||isNaN(n)||isNaN(e))throw kt.error("jsPDF.context2d.strokeRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeRect");v.call(this)||(this.beginPath(),this.rect(t,i,n,e),this.stroke())},f.prototype.clearRect=function(t,i,n,e){if(isNaN(t)||isNaN(i)||isNaN(n)||isNaN(e))throw kt.error("jsPDF.context2d.clearRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.clearRect");this.ignoreClearRect||(this.fillStyle="#ffffff",this.fillRect(t,i,n,e))},f.prototype.save=function(t){t="boolean"!=typeof t||t;for(var i=this.pdf.internal.getCurrentPageInfo().pageNumber,n=0;n<this.pdf.internal.getNumberOfPages();n++)this.pdf.setPage(n+1),this.pdf.internal.out("q");if(this.pdf.setPage(i),t){this.ctx.fontSize=this.pdf.internal.getFontSize();var e=new h(this.ctx);this.ctxStack.push(this.ctx),this.ctx=e}},f.prototype.restore=function(t){t="boolean"!=typeof t||t;for(var i=this.pdf.internal.getCurrentPageInfo().pageNumber,n=0;n<this.pdf.internal.getNumberOfPages();n++)this.pdf.setPage(n+1),this.pdf.internal.out("Q");this.pdf.setPage(i),t&&0!==this.ctxStack.length&&(this.ctx=this.ctxStack.pop(),this.fillStyle=this.ctx.fillStyle,this.strokeStyle=this.ctx.strokeStyle,this.font=this.ctx.font,this.lineCap=this.ctx.lineCap,this.lineWidth=this.ctx.lineWidth,this.lineJoin=this.ctx.lineJoin,this.lineDash=this.ctx.lineDash,this.lineDashOffset=this.ctx.lineDashOffset)},f.prototype.toDataURL=function(){throw new Error("toDataUrl not implemented.")};var l=function(t){var i,n,e,r;if(!0===t.isCanvasGradient&&(t=t.getColor()),!t)return{r:0,g:0,b:0,a:0,style:t};if(/transparent|rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*0+\s*\)/.test(t))i=0,n=0,e=0,r=0;else{var s=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(t);if(null!==s)i=parseInt(s[1]),n=parseInt(s[2]),e=parseInt(s[3]),r=1;else if(null!==(s=/rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)/.exec(t)))i=parseInt(s[1]),n=parseInt(s[2]),e=parseInt(s[3]),r=parseFloat(s[4]);else{if(r=1,"string"==typeof t&&"#"!==t.charAt(0)){var o=new Pt(t);t=o.ok?o.toHex():"#000000"}4===t.length?(i=t.substring(1,2),i+=i,n=t.substring(2,3),n+=n,e=t.substring(3,4),e+=e):(i=t.substring(1,3),n=t.substring(3,5),e=t.substring(5,7)),i=parseInt(i,16),n=parseInt(n,16),e=parseInt(e,16)}}return{r:i,g:n,b:e,a:r,style:t}},d=function(){return this.ctx.isFillTransparent||0==this.globalAlpha},v=function(){return Boolean(this.ctx.isStrokeTransparent||0==this.globalAlpha)};f.prototype.fillText=function(t,i,n,e){if(isNaN(i)||isNaN(n)||"string"!=typeof t)throw kt.error("jsPDF.context2d.fillText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillText");if(e=isNaN(e)?void 0:e,!d.call(this)){var r=R(this.ctx.transform.rotation),s=this.ctx.transform.scaleX;M.call(this,{text:t,x:i,y:n,scale:s,angle:r,align:this.textAlign,maxWidth:e})}},f.prototype.strokeText=function(t,i,n,e){if(isNaN(i)||isNaN(n)||"string"!=typeof t)throw kt.error("jsPDF.context2d.strokeText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeText");if(!v.call(this)){e=isNaN(e)?void 0:e;var r=R(this.ctx.transform.rotation),s=this.ctx.transform.scaleX;M.call(this,{text:t,x:i,y:n,scale:s,renderingMode:"stroke",angle:r,align:this.textAlign,maxWidth:e})}},f.prototype.measureText=function(t){if("string"!=typeof t)throw kt.error("jsPDF.context2d.measureText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.measureText");var i=this.pdf,n=this.pdf.internal.scaleFactor,e=i.internal.getFontSize(),r=i.getStringUnitWidth(t)*e/i.internal.scaleFactor,s=function(t){var i=(t=t||{}).width||0;return Object.defineProperty(this,"width",{get:function(){return i}}),this};return new s({width:r*=Math.round(96*n/72*1e4)/1e4})},f.prototype.scale=function(t,i){if(isNaN(t)||isNaN(i))throw kt.error("jsPDF.context2d.scale: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.scale");var n=new u(t,0,0,i,0,0);this.ctx.transform=this.ctx.transform.multiply(n)},f.prototype.rotate=function(t){if(isNaN(t))throw kt.error("jsPDF.context2d.rotate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rotate");var i=new u(Math.cos(t),Math.sin(t),-Math.sin(t),Math.cos(t),0,0);this.ctx.transform=this.ctx.transform.multiply(i)},f.prototype.translate=function(t,i){if(isNaN(t)||isNaN(i))throw kt.error("jsPDF.context2d.translate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.translate");var n=new u(1,0,0,1,t,i);this.ctx.transform=this.ctx.transform.multiply(n)},f.prototype.transform=function(t,i,n,e,r,s){if(isNaN(t)||isNaN(i)||isNaN(n)||isNaN(e)||isNaN(r)||isNaN(s))throw kt.error("jsPDF.context2d.transform: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.transform");var o=new u(t,i,n,e,r,s);this.ctx.transform=this.ctx.transform.multiply(o)},f.prototype.setTransform=function(t,i,n,e,r,s){t=isNaN(t)?1:t,i=isNaN(i)?0:i,n=isNaN(n)?0:n,e=isNaN(e)?1:e,r=isNaN(r)?0:r,s=isNaN(s)?0:s,this.ctx.transform=new u(t,i,n,e,r,s)};var m=function(){return this.margin[0]>0||this.margin[1]>0||this.margin[2]>0||this.margin[3]>0};f.prototype.drawImage=function(t,i,n,e,r,s,o,c,h){var f=this.pdf.getImageProperties(t),l=1,d=1,v=1,p=1;void 0!==e&&void 0!==c&&(v=c/e,p=h/r,l=f.width/e*c/e,d=f.height/r*h/r),void 0===s&&(s=i,o=n,i=0,n=0),void 0!==e&&void 0===c&&(c=e,h=r),void 0===e&&void 0===c&&(c=f.width,h=f.height);for(var N,y=this.ctx.transform.decompose(),A=R(y.rotate.shx),k=new u,S=(k=(k=(k=k.multiply(y.translate)).multiply(y.skew)).multiply(y.scale)).applyToRectangle(new a(s-i*v,o-n*p,e*l,r*d)),x=w.call(this,S),q=[],M=0;M<x.length;M+=1)-1===q.indexOf(x[M])&&q.push(x[M]);if(g(q),this.autoPaging)for(var j=q[0],E=q[q.length-1],P=j;P<E+1;P++){this.pdf.setPage(P);var I=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],F=1===P?this.posY+this.margin[0]:this.margin[0],O=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],B=1===P?0:this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2]+(P-2)*O;if(0!==this.ctx.clip_path.length){var D=this.path;N=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=b(N,this.posX+this.margin[3],-B+F+this.ctx.prevPageLastElemOffset),L.call(this,"fill",!0),this.path=D}var C=JSON.parse(JSON.stringify(S));C=b([C],this.posX+this.margin[3],-B+F+this.ctx.prevPageLastElemOffset)[0];var T=(P>j||P<E)&&m.call(this);T&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],I,O,null).clip().discardPath()),this.pdf.addImage(t,"JPEG",C.x,C.y,C.w,C.h,null,null,A),T&&this.pdf.restoreGraphicsState()}else this.pdf.addImage(t,"JPEG",S.x,S.y,S.w,S.h,null,null,A)};var w=function(t,i,n){var e=[];n=n||this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2];var r=this.posY+this.ctx.prevPageLastElemOffset;switch(t.type){default:case"mt":case"lt":e.push(Math.floor((t.y+r)/n)+1);break;case"arc":e.push(Math.floor((t.y+r-t.radius)/n)+1),e.push(Math.floor((t.y+r+t.radius)/n)+1);break;case"qct":var s=O(this.ctx.lastPoint.x,this.ctx.lastPoint.y,t.x1,t.y1,t.x,t.y);e.push(Math.floor((s.y+r)/n)+1),e.push(Math.floor((s.y+s.h+r)/n)+1);break;case"bct":var o=D(this.ctx.lastPoint.x,this.ctx.lastPoint.y,t.x1,t.y1,t.x2,t.y2,t.x,t.y);e.push(Math.floor((o.y+r)/n)+1),e.push(Math.floor((o.y+o.h+r)/n)+1);break;case"rect":e.push(Math.floor((t.y+r)/n)+1),e.push(Math.floor((t.y+t.h+r)/n)+1)}for(var a=0;a<e.length;a+=1)for(;this.pdf.internal.getNumberOfPages()<e[a];)p.call(this);return e},p=function(){var t=this.fillStyle,i=this.strokeStyle,n=this.font,e=this.lineCap,r=this.lineWidth,s=this.lineJoin;this.pdf.addPage(),this.fillStyle=t,this.strokeStyle=i,this.font=n,this.lineCap=e,this.lineWidth=r,this.lineJoin=s},b=function(t,i,n){for(var e=0;e<t.length;e++)switch(t[e].type){case"bct":t[e].x2+=i,t[e].y2+=n;case"qct":t[e].x1+=i,t[e].y1+=n;default:t[e].x+=i,t[e].y+=n}return t},g=function(t){return t.sort((function(t,i){return t-i}))},N=function(t,i){for(var n,e,r=this.fillStyle,s=this.strokeStyle,o=this.lineCap,a=this.lineWidth,u=Math.abs(a*this.ctx.transform.scaleX),c=this.lineJoin,h=JSON.parse(JSON.stringify(this.path)),f=JSON.parse(JSON.stringify(this.path)),l=[],d=0;d<f.length;d++)if(void 0!==f[d].x)for(var v=w.call(this,f[d]),N=0;N<v.length;N+=1)-1===l.indexOf(v[N])&&l.push(v[N]);for(var y=0;y<l.length;y++)for(;this.pdf.internal.getNumberOfPages()<l[y];)p.call(this);if(g(l),this.autoPaging)for(var A=l[0],k=l[l.length-1],S=A;S<k+1;S++){this.pdf.setPage(S),this.fillStyle=r,this.strokeStyle=s,this.lineCap=o,this.lineWidth=u,this.lineJoin=c;var x=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],q=1===S?this.posY+this.margin[0]:this.margin[0],M=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],j=1===S?0:this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2]+(S-2)*M;if(0!==this.ctx.clip_path.length){var E=this.path;n=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=b(n,this.posX+this.margin[3],-j+q+this.ctx.prevPageLastElemOffset),L.call(this,t,!0),this.path=E}if(e=JSON.parse(JSON.stringify(h)),this.path=b(e,this.posX+this.margin[3],-j+q+this.ctx.prevPageLastElemOffset),!1===i||0===S){var P=(S>A||S<k)&&m.call(this);P&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],x,M,null).clip().discardPath()),L.call(this,t,i),P&&this.pdf.restoreGraphicsState()}this.lineWidth=a}else this.lineWidth=u,L.call(this,t,i),this.lineWidth=a;this.path=h},L=function(t,i){if(("stroke"!==t||i||!v.call(this))&&("stroke"===t||i||!d.call(this))){for(var n,e,r=[],s=this.path,o=0;o<s.length;o++){var a=s[o];switch(a.type){case"begin":r.push({begin:!0});break;case"close":r.push({close:!0});break;case"mt":r.push({start:a,deltas:[],abs:[]});break;case"lt":var u=r.length;if(s[o-1]&&!isNaN(s[o-1].x)&&(n=[a.x-s[o-1].x,a.y-s[o-1].y],u>0))for(;u>=0;u--)if(!0!==r[u-1].close&&!0!==r[u-1].begin){r[u-1].deltas.push(n),r[u-1].abs.push(a);break}break;case"bct":r[r.length-1].deltas.push(n=[a.x1-s[o-1].x,a.y1-s[o-1].y,a.x2-s[o-1].x,a.y2-s[o-1].y,a.x-s[o-1].x,a.y-s[o-1].y]);break;case"qct":r[r.length-1].deltas.push(n=[s[o-1].x+2/3*(a.x1-s[o-1].x)-s[o-1].x,s[o-1].y+2/3*(a.y1-s[o-1].y)-s[o-1].y,a.x+2/3*(a.x1-a.x)-s[o-1].x,a.y+2/3*(a.y1-a.y)-s[o-1].y,a.x-s[o-1].x,a.y-s[o-1].y]);break;case"arc":r.push({deltas:[],abs:[],arc:!0}),Array.isArray(r[r.length-1].abs)&&r[r.length-1].abs.push(a)}}e=i?null:"stroke"===t?"stroke":"fill";for(var c=!1,h=0;h<r.length;h++)if(r[h].arc)for(var f=r[h].abs,l=0;l<f.length;l++){var m=f[l];"arc"===m.type?k.call(this,m.x,m.y,m.radius,m.startAngle,m.endAngle,m.counterclockwise,void 0,i,!c):j.call(this,m.x,m.y),c=!0}else!0===r[h].close?(this.pdf.internal.out("h"),c=!1):!0!==r[h].begin&&(E.call(this,r[h].deltas,r[h].start.x,r[h].start.y),c=!0);e&&S.call(this,e),i&&x.call(this)}},y=function(t){var i=this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor,n=i*(this.pdf.internal.getLineHeightFactor()-1);switch(this.ctx.textBaseline){case"bottom":return t-n;case"top":return t+i-n;case"hanging":return t+i-2*n;case"middle":return t+i/2-n;default:return t}},A=function(t){return t+this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor*(this.pdf.internal.getLineHeightFactor()-1)};f.prototype.createLinearGradient=function(){var t=function(){};return t.colorStops=[],t.addColorStop=function(t,i){this.colorStops.push([t,i])},t.getColor=function(){return 0===this.colorStops.length?"#000000":this.colorStops[0][1]},t.isCanvasGradient=!0,t},f.prototype.createPattern=function(){return this.createLinearGradient()},f.prototype.createRadialGradient=function(){return this.createLinearGradient()};var k=function(t,i,n,e,r,s,o,a,u){for(var c=I.call(this,n,e,r,s),h=0;h<c.length;h++){var f=c[h];0===h&&(u?q.call(this,f.x1+t,f.y1+i):j.call(this,f.x1+t,f.y1+i)),P.call(this,t,i,f.x2,f.y2,f.x3,f.y3,f.x4,f.y4)}a?x.call(this):S.call(this,o)},S=function(t){switch(t){case"stroke":this.pdf.internal.out("S");break;case"fill":this.pdf.internal.out("f")}},x=function(){this.pdf.clip(),this.pdf.discardPath()},q=function(t,i){this.pdf.internal.out(n(t)+" "+e(i)+" m")},M=function(t){var i;switch(t.align){case"right":case"end":i="right";break;case"center":i="center";break;default:i="left"}var n=this.pdf.getTextDimensions(t.text),e=y.call(this,t.y),r=A.call(this,e)-n.h,s=this.ctx.transform.applyToPoint(new o(t.x,e)),c=this.ctx.transform.decompose(),h=new u;h=(h=(h=h.multiply(c.translate)).multiply(c.skew)).multiply(c.scale);for(var f,l,d,v=this.ctx.transform.applyToRectangle(new a(t.x,e,n.w,n.h)),p=h.applyToRectangle(new a(t.x,r,n.w,n.h)),N=w.call(this,p),k=[],S=0;S<N.length;S+=1)-1===k.indexOf(N[S])&&k.push(N[S]);if(g(k),this.autoPaging)for(var x=k[0],q=k[k.length-1],M=x;M<q+1;M++){this.pdf.setPage(M);var j=1===M?this.posY+this.margin[0]:this.margin[0],E=this.pdf.internal.pageSize.height-this.margin[2],P=E-this.margin[0],I=this.pdf.internal.pageSize.width-this.margin[1],F=I-this.margin[3],R=1===M?0:this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2]+(M-2)*P;if(0!==this.ctx.clip_path.length){var O=this.path;f=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=b(f,this.posX+this.margin[3],-1*R+j),L.call(this,"fill",!0),this.path=O}var B=b([JSON.parse(JSON.stringify(p))],this.posX+this.margin[3],-R+j+this.ctx.prevPageLastElemOffset)[0];t.scale>=.01&&(l=this.pdf.internal.getFontSize(),this.pdf.setFontSize(l*t.scale),this.lineWidth=(d=this.lineWidth)*t.scale);var D="text"!==this.autoPaging;if(D||B.y+B.h<=E){if(D||B.y>=j&&B.x<=I){var C=D?t.text:this.pdf.splitTextToSize(t.text,t.maxWidth||I-B.x)[0],T=b([JSON.parse(JSON.stringify(v))],this.posX+this.margin[3],-R+j+this.ctx.prevPageLastElemOffset)[0],z=D&&(M>x||M<q)&&m.call(this);z&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],F,P,null).clip().discardPath()),this.pdf.text(C,T.x,T.y,{angle:t.angle,align:i,renderingMode:t.renderingMode}),z&&this.pdf.restoreGraphicsState()}}else B.y<E&&(this.ctx.prevPageLastElemOffset+=E-B.y);t.scale>=.01&&(this.pdf.setFontSize(l),this.lineWidth=d)}else t.scale>=.01&&(l=this.pdf.internal.getFontSize(),this.pdf.setFontSize(l*t.scale),this.lineWidth=(d=this.lineWidth)*t.scale),this.pdf.text(t.text,s.x+this.posX,s.y+this.posY,{angle:t.angle,align:i,renderingMode:t.renderingMode,maxWidth:t.maxWidth}),t.scale>=.01&&(this.pdf.setFontSize(l),this.lineWidth=d)},j=function(t,i,r,s){s=s||0,this.pdf.internal.out(n(t+(r=r||0))+" "+e(i+s)+" l")},E=function(t,i,n){return this.pdf.lines(t,i,n,null,null)},P=function(t,n,e,o,a,u,c,h){this.pdf.internal.out([i(r(e+t)),i(s(o+n)),i(r(a+t)),i(s(u+n)),i(r(c+t)),i(s(h+n)),"c"].join(" "))},I=function(t,i,n,e){for(var r=2*Math.PI,s=Math.PI/2;i>n;)i-=r;var o=Math.abs(n-i);o<r&&e&&(o=r-o);for(var a=[],u=e?-1:1,c=i;o>1e-5;){var h=c+u*Math.min(o,s);a.push(F.call(this,t,c,h)),o-=Math.abs(h-c),c=h}return a},F=function(t,i,n){var e=(n-i)/2,r=t*Math.cos(e),s=t*Math.sin(e),o=r,a=-s,u=o*o+a*a,c=u+o*r+a*s,h=4/3*(Math.sqrt(2*u*c)-c)/(o*s-a*r),f=o-h*a,l=a+h*o,d=f,v=-l,m=e+i,w=Math.cos(m),p=Math.sin(m);return{x1:t*Math.cos(i),y1:t*Math.sin(i),x2:f*w-l*p,y2:f*p+l*w,x3:d*w-v*p,y3:d*p+v*w,x4:t*Math.cos(n),y4:t*Math.sin(n)}},R=function(t){return 180*t/Math.PI},O=function(t,i,n,e,r,s){var o=t+.5*(n-t),u=i+.5*(e-i),c=r+.5*(n-r),h=s+.5*(e-s),f=Math.min(t,r,o,c),l=Math.max(t,r,o,c),d=Math.min(i,s,u,h),v=Math.max(i,s,u,h);return new a(f,d,l-f,v-d)},D=function(t,i,n,e,r,s,o,u){var c,h,f,l,d,v,m,w,p,b,g,N,L,y,A=n-t,k=e-i,S=r-n,x=s-e,q=o-r,M=u-s;for(h=0;h<41;h++)p=(m=(f=t+(c=h/40)*A)+c*((d=n+c*S)-f))+c*(d+c*(r+c*q-d)-m),b=(w=(l=i+c*k)+c*((v=e+c*x)-l))+c*(v+c*(s+c*M-v)-w),0==h?(g=p,N=b,L=p,y=b):(g=Math.min(g,p),N=Math.min(N,b),L=Math.max(L,p),y=Math.max(y,b));return new a(Math.round(g),Math.round(N),Math.round(L-g),Math.round(y-N))},C=function(){if(this.prevLineDash||this.ctx.lineDash.length||this.ctx.lineDashOffset){var t=JSON.stringify({lineDash:this.ctx.lineDash,lineDashOffset:this.ctx.lineDashOffset});this.prevLineDash!==t&&(this.pdf.setLineDash(this.ctx.lineDash,this.ctx.lineDashOffset),this.prevLineDash=t)}}}(ii.API),
125
+ function(t){var i=function(){var t=void 0;Object.defineProperty(this,"pdf",{get:function(){return t},set:function(i){t=i}});var i=150;Object.defineProperty(this,"width",{get:function(){return i},set:function(t){i=isNaN(t)||!1===Number.isInteger(t)||t<0?150:t,this.getContext("2d").pageWrapXEnabled&&(this.getContext("2d").pageWrapX=i+1)}});var n=300;Object.defineProperty(this,"height",{get:function(){return n},set:function(t){n=isNaN(t)||!1===Number.isInteger(t)||t<0?300:t,this.getContext("2d").pageWrapYEnabled&&(this.getContext("2d").pageWrapY=n+1)}});var e=[];Object.defineProperty(this,"childNodes",{get:function(){return e},set:function(t){e=t}});var r={};Object.defineProperty(this,"style",{get:function(){return r},set:function(t){r=t}}),Object.defineProperty(this,"parentNode",{})};i.prototype.getContext=function(t,i){var n;if("2d"!==(t=t||"2d"))return null;for(n in i)this.pdf.context2d.hasOwnProperty(n)&&(this.pdf.context2d[n]=i[n]);return this.pdf.context2d._canvas=this,this.pdf.context2d},i.prototype.toDataURL=function(){throw new Error("toDataURL is not implemented.")},t.events.push(["initialized",function(){this.canvas=new i,this.canvas.pdf=this}])}(ii.API),function(t){var i={left:0,top:0,bottom:0,right:0},n=!1,e=function(){void 0===this.internal.__cell__&&(this.internal.__cell__={},this.internal.__cell__.padding=3,this.internal.__cell__.headerFunction=void 0,this.internal.__cell__.margins=Object.assign({},i),this.internal.__cell__.margins.width=this.getPageWidth(),r.call(this))},r=function(){this.internal.__cell__.lastCell=new s,this.internal.__cell__.pages=1},s=function(){var t=arguments[0];Object.defineProperty(this,"x",{enumerable:!0,get:function(){return t},set:function(i){t=i}});var i=arguments[1];Object.defineProperty(this,"y",{enumerable:!0,get:function(){return i},set:function(t){i=t}});var n=arguments[2];Object.defineProperty(this,"width",{enumerable:!0,get:function(){return n},set:function(t){n=t}});var e=arguments[3];Object.defineProperty(this,"height",{enumerable:!0,get:function(){return e},set:function(t){e=t}});var r=arguments[4];Object.defineProperty(this,"text",{enumerable:!0,get:function(){return r},set:function(t){r=t}});var s=arguments[5];Object.defineProperty(this,"lineNumber",{enumerable:!0,get:function(){return s},set:function(t){s=t}});var o=arguments[6];return Object.defineProperty(this,"align",{enumerable:!0,get:function(){return o},set:function(t){o=t}}),this};s.prototype.clone=function(){return new s(this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align)},s.prototype.toArray=function(){return[this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align]},t.setHeaderFunction=function(t){return e.call(this),this.internal.__cell__.headerFunction="function"==typeof t?t:void 0,this},t.getTextDimensions=function(t,i){e.call(this);var n=(i=i||{}).fontSize||this.getFontSize(),r=i.font||this.getFont(),s=i.scaleFactor||this.internal.scaleFactor,o=0,a=0,u=0,c=this;if(!Array.isArray(t)&&"string"!=typeof t){if("number"!=typeof t)throw new Error("getTextDimensions expects text-parameter to be of type String or type Number or an Array of Strings.");t=String(t)}var h=i.maxWidth;h>0?"string"==typeof t?t=this.splitTextToSize(t,h):"[object Array]"===Object.prototype.toString.call(t)&&(t=t.reduce((function(t,i){return t.concat(c.splitTextToSize(i,h))}),[])):t=Array.isArray(t)?t:[t];for(var f=0;f<t.length;f++)o<(u=this.getStringUnitWidth(t[f],{font:r})*n)&&(o=u);return 0!==o&&(a=t.length),{w:o/=s,h:Math.max((a*n*this.getLineHeightFactor()-n*(this.getLineHeightFactor()-1))/s,0)}},t.cellAddPage=function(){e.call(this),this.addPage();var t=this.internal.__cell__.margins||i;return this.internal.__cell__.lastCell=new s(t.left,t.top,void 0,void 0),this.internal.__cell__.pages+=1,this};var o=t.cell=function(){var t;t=arguments[0]instanceof s?arguments[0]:new s(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5]),e.call(this);var r=this.internal.__cell__.lastCell,o=this.internal.__cell__.padding,a=this.internal.__cell__.margins||i,u=this.internal.__cell__.tableHeaderRow,c=this.internal.__cell__.printHeaders;return void 0!==r.lineNumber&&(r.lineNumber===t.lineNumber?(t.x=(r.x||0)+(r.width||0),t.y=r.y||0):r.y+r.height+t.height+a.bottom>this.getPageHeight()?(this.cellAddPage(),t.y=a.top,c&&u&&(this.printHeaderRow(t.lineNumber,!0),t.y+=u[0].height)):t.y=r.y+r.height||t.y),void 0!==t.text[0]&&(this.rect(t.x,t.y,t.width,t.height,!0===n?"FD":void 0),"right"===t.align?this.text(t.text,t.x+t.width-o,t.y+o,{align:"right",baseline:"top"}):"center"===t.align?this.text(t.text,t.x+t.width/2,t.y+o,{align:"center",baseline:"top",maxWidth:t.width-o-o}):this.text(t.text,t.x+o,t.y+o,{align:"left",baseline:"top",maxWidth:t.width-o-o})),this.internal.__cell__.lastCell=t,this};t.table=function(t,n,u,c,h){if(e.call(this),!u)throw new Error("No data for PDF table.");var f,l,d,v,m=[],w=[],p=[],b={},g={},N=[],L=[],y=(h=h||{}).autoSize||!1,A=!1!==h.printHeaders,k=h.css&&void 0!==h.css["font-size"]?16*h.css["font-size"]:h.fontSize||12,S=h.margins||Object.assign({width:this.getPageWidth()},i),x="number"==typeof h.padding?h.padding:3,q=h.headerBackgroundColor||"#c8c8c8",M=h.headerTextColor||"#000";if(r.call(this),this.internal.__cell__.printHeaders=A,this.internal.__cell__.margins=S,this.internal.__cell__.table_font_size=k,this.internal.__cell__.padding=x,this.internal.__cell__.headerBackgroundColor=q,this.internal.__cell__.headerTextColor=M,this.setFontSize(k),null==c)w=m=Object.keys(u[0]),p=m.map((function(){return"left"}));else if(Array.isArray(c)&&"object"===B(c[0]))for(m=c.map((function(t){return t.name})),w=c.map((function(t){return t.prompt||t.name||""})),p=c.map((function(t){return t.align||"left"})),f=0;f<c.length;f+=1)g[c[f].name]=c[f].width*(19.049976/25.4);else Array.isArray(c)&&"string"==typeof c[0]&&(w=m=c,p=m.map((function(){return"left"})));if(y||Array.isArray(c)&&"string"==typeof c[0])for(f=0;f<m.length;f+=1){for(b[v=m[f]]=u.map((function(t){return t[v]})),this.setFont(void 0,"bold"),N.push(this.getTextDimensions(w[f],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w),l=b[v],this.setFont(void 0,"normal"),d=0;d<l.length;d+=1)N.push(this.getTextDimensions(l[d],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w);g[v]=Math.max.apply(null,N)+x+x,N=[]}if(A){var j={};for(f=0;f<m.length;f+=1)j[m[f]]={},j[m[f]].text=w[f],j[m[f]].align=p[f];var E=a.call(this,j,g);L=m.map((function(i){return new s(t,n,g[i],E,j[i].text,void 0,j[i].align)})),this.setTableHeaderRow(L),this.printHeaderRow(1,!1)}var P=c.reduce((function(t,i){return t[i.name]=i.align,t}),{});for(f=0;f<u.length;f+=1){"rowStart"in h&&h.rowStart instanceof Function&&h.rowStart({row:f,data:u[f]},this);var I=a.call(this,u[f],g);for(d=0;d<m.length;d+=1){var O=u[f][m[d]];"cellStart"in h&&h.cellStart instanceof Function&&h.cellStart({row:f,col:d,data:O},this),o.call(this,new s(t,n,g[m[d]],I,O,f+2,P[m[d]]))}}return this.internal.__cell__.table_x=t,this.internal.__cell__.table_y=n,this};var a=function(t,i){var n=this.internal.__cell__.padding,e=this.internal.__cell__.table_font_size,r=this.internal.scaleFactor;return Object.keys(t).map((function(e){var r=t[e];return this.splitTextToSize(r.hasOwnProperty("text")?r.text:r,i[e]-n-n)}),this).map((function(t){return this.getLineHeightFactor()*t.length*e/r+n+n}),this).reduce((function(t,i){return Math.max(t,i)}),0)};t.setTableHeaderRow=function(t){e.call(this),this.internal.__cell__.tableHeaderRow=t},t.printHeaderRow=function(t,i){if(e.call(this),!this.internal.__cell__.tableHeaderRow)throw new Error("Property tableHeaderRow does not exist.");var r;if(n=!0,"function"==typeof this.internal.__cell__.headerFunction){var a=this.internal.__cell__.headerFunction(this,this.internal.__cell__.pages);this.internal.__cell__.lastCell=new s(a[0],a[1],a[2],a[3],void 0,-1)}this.setFont(void 0,"bold");for(var u=[],c=0;c<this.internal.__cell__.tableHeaderRow.length;c+=1){r=this.internal.__cell__.tableHeaderRow[c].clone(),i&&(r.y=this.internal.__cell__.margins.top||0,u.push(r)),r.lineNumber=t;var h=this.getTextColor();this.setTextColor(this.internal.__cell__.headerTextColor),this.setFillColor(this.internal.__cell__.headerBackgroundColor),o.call(this,r),this.setTextColor(h)}u.length>0&&this.setTableHeaderRow(u),this.setFont(void 0,"normal"),n=!1}}(ii.API);var Wi={italic:["italic","oblique","normal"],oblique:["oblique","italic","normal"],normal:["normal","oblique","italic"]},Hi=["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded"],Gi=Vi(Hi),Ji=[100,200,300,400,500,600,700,800,900],Yi=Vi(Ji);function Ki(t){var i=t.family.replace(/"|'/g,"").toLowerCase(),n=function(t){return Wi[t=t||"normal"]?t:"normal"}(t.style),e=function(t){return t?"number"==typeof t?t>=100&&t<=900&&t%100==0?t:400:/^\d00$/.test(t)?parseInt(t):"bold"===t?700:400:400}(t.weight),r=function(t){return"number"==typeof Gi[t=t||"normal"]?t:"normal"}(t.stretch);return{family:i,style:n,weight:e,stretch:r,src:t.src||[],ref:t.ref||{name:i,style:[r,n,e].join(" ")}}}function Xi(t,i,n,e){var r;for(r=n;r>=0&&r<i.length;r+=e)if(t[i[r]])return t[i[r]];for(r=n;r>=0&&r<i.length;r-=e)if(t[i[r]])return t[i[r]]}var $i={"sans-serif":"helvetica",fixed:"courier",monospace:"courier",terminal:"courier",cursive:"times",fantasy:"times",serif:"times"},Qi={caption:"times",icon:"times",menu:"times","message-box":"times","small-caption":"times","status-bar":"times"};function Zi(t){return[t.stretch,t.style,t.weight,t.family].join(" ")}function tn(t){return t.trimLeft()}function nn(t,i){for(var n=0;n<t.length;){if(t.charAt(n)===i)return[t.substring(0,n),t.substring(n+1)];n+=1}return null}function en(t){var i=t.match(/^(-[a-z_]|[a-z_])[a-z0-9_-]*/i);return null===i?null:[i[0],t.substring(i[0].length)]}var rn,sn,on,an,un=["times"];!function(t){var i,n,e,r,s,o,a,u,c,h=function(t){return this.isStrokeTransparent=(t=t||{}).isStrokeTransparent||!1,this.strokeOpacity=t.strokeOpacity||1,this.strokeStyle=t.strokeStyle||"#000000",this.fillStyle=t.fillStyle||"#000000",this.isFillTransparent=t.isFillTransparent||!1,this.fillOpacity=t.fillOpacity||1,this.font=t.font||"10px sans-serif",this.textBaseline=t.textBaseline||"alphabetic",this.textAlign=t.textAlign||"left",this.lineWidth=t.lineWidth||1,this.lineJoin=t.lineJoin||"miter",this.lineCap=t.lineCap||"butt",this.path=t.path||[],this.transform=void 0!==t.transform?t.transform.clone():new u,this.globalCompositeOperation=t.globalCompositeOperation||"normal",this.globalAlpha=t.globalAlpha||1,this.clip_path=t.clip_path||[],this.currentPoint=t.currentPoint||new o,this.miterLimit=t.miterLimit||10,this.lastPoint=t.lastPoint||new o,this.lineDashOffset=t.lineDashOffset||0,this.lineDash=t.lineDash||[],this.margin=t.margin||[0,0,0,0],this.prevPageLastElemOffset=t.prevPageLastElemOffset||0,this.ignoreClearRect="boolean"!=typeof t.ignoreClearRect||t.ignoreClearRect,this};t.events.push(["initialized",function(){this.context2d=new f(this),i=this.internal.f2,n=this.internal.getCoordinateString,e=this.internal.getVerticalCoordinateString,r=this.internal.getHorizontalCoordinate,s=this.internal.getVerticalCoordinate,o=this.internal.Point,a=this.internal.Rectangle,u=this.internal.Matrix,c=new h}]);var f=function(t){Object.defineProperty(this,"canvas",{get:function(){return{parentNode:!1,style:!1}}});var i=t;Object.defineProperty(this,"pdf",{get:function(){return i}});var n=!1;Object.defineProperty(this,"pageWrapXEnabled",{get:function(){return n},set:function(t){n=Boolean(t)}});var e=!1;Object.defineProperty(this,"pageWrapYEnabled",{get:function(){return e},set:function(t){e=Boolean(t)}});var r=0;Object.defineProperty(this,"posX",{get:function(){return r},set:function(t){isNaN(t)||(r=t)}});var s=0;Object.defineProperty(this,"posY",{get:function(){return s},set:function(t){isNaN(t)||(s=t)}}),Object.defineProperty(this,"margin",{get:function(){return c.margin},set:function(t){var i;"number"==typeof t?i=[t,t,t,t]:((i=new Array(4))[0]=t[0],i[1]=t.length>=2?t[1]:i[0],i[2]=t.length>=3?t[2]:i[0],i[3]=t.length>=4?t[3]:i[1]),c.margin=i}});var o=!1;Object.defineProperty(this,"autoPaging",{get:function(){return o},set:function(t){o=t}});var a=0;Object.defineProperty(this,"lastBreak",{get:function(){return a},set:function(t){a=t}});var u=[];Object.defineProperty(this,"pageBreaks",{get:function(){return u},set:function(t){u=t}}),Object.defineProperty(this,"ctx",{get:function(){return c},set:function(t){t instanceof h&&(c=t)}}),Object.defineProperty(this,"path",{get:function(){return c.path},set:function(t){c.path=t}});var f=[];Object.defineProperty(this,"ctxStack",{get:function(){return f},set:function(t){f=t}}),Object.defineProperty(this,"fillStyle",{get:function(){return this.ctx.fillStyle},set:function(t){var i;i=l(t),this.ctx.fillStyle=i.style,this.ctx.isFillTransparent=0===i.a,this.ctx.fillOpacity=i.a,this.pdf.setFillColor(i.r,i.g,i.b,{a:i.a}),this.pdf.setTextColor(i.r,i.g,i.b,{a:i.a})}}),Object.defineProperty(this,"strokeStyle",{get:function(){return this.ctx.strokeStyle},set:function(t){var i=l(t);this.ctx.strokeStyle=i.style,this.ctx.isStrokeTransparent=0===i.a,this.ctx.strokeOpacity=i.a,0===i.a?this.pdf.setDrawColor(255,255,255):this.pdf.setDrawColor(i.r,i.g,i.b)}}),Object.defineProperty(this,"lineCap",{get:function(){return this.ctx.lineCap},set:function(t){-1!==["butt","round","square"].indexOf(t)&&(this.ctx.lineCap=t,this.pdf.setLineCap(t))}}),Object.defineProperty(this,"lineWidth",{get:function(){return this.ctx.lineWidth},set:function(t){isNaN(t)||(this.ctx.lineWidth=t,this.pdf.setLineWidth(t))}}),Object.defineProperty(this,"lineJoin",{get:function(){return this.ctx.lineJoin},set:function(t){-1!==["bevel","round","miter"].indexOf(t)&&(this.ctx.lineJoin=t,this.pdf.setLineJoin(t))}}),Object.defineProperty(this,"miterLimit",{get:function(){return this.ctx.miterLimit},set:function(t){isNaN(t)||(this.ctx.miterLimit=t,this.pdf.setMiterLimit(t))}}),Object.defineProperty(this,"textBaseline",{get:function(){return this.ctx.textBaseline},set:function(t){this.ctx.textBaseline=t}}),Object.defineProperty(this,"textAlign",{get:function(){return this.ctx.textAlign},set:function(t){-1!==["right","end","center","left","start"].indexOf(t)&&(this.ctx.textAlign=t)}});var d=null;function v(t,i){if(null===d){var n=function(t){var i=[];return Object.keys(t).forEach((function(n){t[n].forEach((function(t){var e=null;switch(t){case"bold":e={family:n,weight:"bold"};break;case"italic":e={family:n,style:"italic"};break;case"bolditalic":e={family:n,weight:"bold",style:"italic"};break;case"":case"normal":e={family:n}}null!==e&&(e.ref={name:n,style:t},i.push(e))}))})),i}(t.getFontList());d=function(t){for(var i={},n=0;n<t.length;++n){var e=Ki(t[n]),r=e.family,s=e.stretch,o=e.style,a=e.weight;i[r]=i[r]||{},i[r][s]=i[r][s]||{},i[r][s][o]=i[r][s][o]||{},i[r][s][o][a]=e}return i}(n.concat(i))}return d}var m=null;Object.defineProperty(this,"fontFaces",{get:function(){return m},set:function(t){d=null,m=t}}),Object.defineProperty(this,"font",{get:function(){return this.ctx.font},set:function(t){var i;if(this.ctx.font=t,null!==(i=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:\%|in|[cem]m|ex|p[ctx]))(?:\s*\/\s*(normal|[.\d]+(?:\%|in|[cem]m|ex|p[ctx])))?\s*([-_,\"\'\sa-z]+?)\s*$/i.exec(t))){var n=i[1],e=i[3],r=i[4],s=i[6],o=/^([.\d]+)((?:%|in|[cem]m|ex|p[ctx]))$/i.exec(r)[2];r="px"===o?Math.floor(parseFloat(r)*this.pdf.internal.scaleFactor):"em"===o?Math.floor(parseFloat(r)*this.pdf.getFontSize()):Math.floor(parseFloat(r)*this.pdf.internal.scaleFactor),this.pdf.setFontSize(r);var a=function(t){var i,n,e=[],r=t.trim();if(""===r)return un;if(r in Qi)return[Qi[r]];for(;""!==r;){switch(n=null,i=(r=tn(r)).charAt(0)){case'"':case"'":n=nn(r.substring(1),i);break;default:n=en(r)}if(null===n)return un;if(e.push(n[0]),""!==(r=tn(n[1]))&&","!==r.charAt(0))return un;r=r.replace(/^,/,"")}return e}(s);if(this.fontFaces){var u=function(t,i,n){for(var e=(n=n||{}).defaultFontFamily||"times",r=Object.assign({},$i,n.genericFontFamilies||{}),s=null,o=null,a=0;a<i.length;++a)if(r[(s=Ki(i[a])).family]&&(s.family=r[s.family]),t.hasOwnProperty(s.family)){o=t[s.family];break}if(!(o=o||t[e]))throw new Error("Could not find a font-family for the rule '"+Zi(s)+"' and default family '"+e+"'.");if(o=function(t,i){if(i[t])return i[t];var n=Gi[t],e=Xi(i,Hi,n,n<=Gi.normal?-1:1);if(!e)throw new Error("Could not find a matching font-stretch value for "+t);return e}(s.stretch,o),o=function(t,i){if(i[t])return i[t];for(var n=Wi[t],e=0;e<n.length;++e)if(i[n[e]])return i[n[e]];throw new Error("Could not find a matching font-style for "+t)}(s.style,o),!(o=function(t,i){if(i[t])return i[t];if(400===t&&i[500])return i[500];if(500===t&&i[400])return i[400];var n=Xi(i,Ji,Yi[t],t<400?-1:1);if(!n)throw new Error("Could not find a matching font-weight for value "+t);return n}(s.weight,o)))throw new Error("Failed to resolve a font for the rule '"+Zi(s)+"'.");return o}(v(this.pdf,this.fontFaces),a.map((function(t){return{family:t,stretch:"normal",weight:e,style:n}})));this.pdf.setFont(u.ref.name,u.ref.style)}else{var c="";("bold"===e||parseInt(e,10)>=700||"bold"===n)&&(c="bold"),"italic"===n&&(c+="italic"),0===c.length&&(c="normal");for(var h="",f={arial:"Helvetica",Arial:"Helvetica",verdana:"Helvetica",Verdana:"Helvetica",helvetica:"Helvetica",Helvetica:"Helvetica","sans-serif":"Helvetica",fixed:"Courier",monospace:"Courier",terminal:"Courier",cursive:"Times",fantasy:"Times",serif:"Times"},l=0;l<a.length;l++){if(void 0!==this.pdf.internal.getFont(a[l],c,{noFallback:!0,disableWarning:!0})){h=a[l];break}if("bolditalic"===c&&void 0!==this.pdf.internal.getFont(a[l],"bold",{noFallback:!0,disableWarning:!0}))h=a[l],c="bold";else if(void 0!==this.pdf.internal.getFont(a[l],"normal",{noFallback:!0,disableWarning:!0})){h=a[l],c="normal";break}}if(""===h)for(var d=0;d<a.length;d++)if(f[a[d]]){h=f[a[d]];break}this.pdf.setFont(h=""===h?"Times":h,c)}}}}),Object.defineProperty(this,"globalCompositeOperation",{get:function(){return this.ctx.globalCompositeOperation},set:function(t){this.ctx.globalCompositeOperation=t}}),Object.defineProperty(this,"globalAlpha",{get:function(){return this.ctx.globalAlpha},set:function(t){this.ctx.globalAlpha=t}}),Object.defineProperty(this,"lineDashOffset",{get:function(){return this.ctx.lineDashOffset},set:function(t){this.ctx.lineDashOffset=t,D.call(this)}}),Object.defineProperty(this,"lineDash",{get:function(){return this.ctx.lineDash},set:function(t){this.ctx.lineDash=t,D.call(this)}}),Object.defineProperty(this,"ignoreClearRect",{get:function(){return this.ctx.ignoreClearRect},set:function(t){this.ctx.ignoreClearRect=Boolean(t)}})};f.prototype.setLineDash=function(t){this.lineDash=t},f.prototype.getLineDash=function(){return this.lineDash.length%2?this.lineDash.concat(this.lineDash):this.lineDash.slice()},f.prototype.fill=function(){N.call(this,"fill",!1)},f.prototype.stroke=function(){N.call(this,"stroke",!1)},f.prototype.beginPath=function(){this.path=[{type:"begin"}]},f.prototype.moveTo=function(t,i){if(isNaN(t)||isNaN(i))throw kt.error("jsPDF.context2d.moveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.moveTo");var n=this.ctx.transform.applyToPoint(new o(t,i));this.path.push({type:"mt",x:n.x,y:n.y}),this.ctx.lastPoint=new o(t,i)},f.prototype.closePath=function(){var t=new o(0,0),i=0;for(i=this.path.length-1;-1!==i;i--)if("begin"===this.path[i].type&&"object"===B(this.path[i+1])&&"number"==typeof this.path[i+1].x){t=new o(this.path[i+1].x,this.path[i+1].y);break}this.path.push({type:"close"}),this.ctx.lastPoint=new o(t.x,t.y)},f.prototype.lineTo=function(t,i){if(isNaN(t)||isNaN(i))throw kt.error("jsPDF.context2d.lineTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.lineTo");var n=this.ctx.transform.applyToPoint(new o(t,i));this.path.push({type:"lt",x:n.x,y:n.y}),this.ctx.lastPoint=new o(n.x,n.y)},f.prototype.clip=function(){this.ctx.clip_path=JSON.parse(JSON.stringify(this.path)),N.call(this,null,!0)},f.prototype.quadraticCurveTo=function(t,i,n,e){if(isNaN(n)||isNaN(e)||isNaN(t)||isNaN(i))throw kt.error("jsPDF.context2d.quadraticCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.quadraticCurveTo");var r=this.ctx.transform.applyToPoint(new o(n,e)),s=this.ctx.transform.applyToPoint(new o(t,i));this.path.push({type:"qct",x1:s.x,y1:s.y,x:r.x,y:r.y}),this.ctx.lastPoint=new o(r.x,r.y)},f.prototype.bezierCurveTo=function(t,i,n,e,r,s){if(isNaN(r)||isNaN(s)||isNaN(t)||isNaN(i)||isNaN(n)||isNaN(e))throw kt.error("jsPDF.context2d.bezierCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.bezierCurveTo");var a=this.ctx.transform.applyToPoint(new o(r,s)),u=this.ctx.transform.applyToPoint(new o(t,i)),c=this.ctx.transform.applyToPoint(new o(n,e));this.path.push({type:"bct",x1:u.x,y1:u.y,x2:c.x,y2:c.y,x:a.x,y:a.y}),this.ctx.lastPoint=new o(a.x,a.y)},f.prototype.arc=function(t,i,n,e,r,s){if(isNaN(t)||isNaN(i)||isNaN(n)||isNaN(e)||isNaN(r))throw kt.error("jsPDF.context2d.arc: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.arc");if(s=Boolean(s),!this.ctx.transform.isIdentity){var a=this.ctx.transform.applyToPoint(new o(t,i));t=a.x,i=a.y;var u=this.ctx.transform.applyToPoint(new o(0,n)),c=this.ctx.transform.applyToPoint(new o(0,0));n=Math.sqrt(Math.pow(u.x-c.x,2)+Math.pow(u.y-c.y,2))}Math.abs(r-e)>=2*Math.PI&&(e=0,r=2*Math.PI),this.path.push({type:"arc",x:t,y:i,radius:n,startAngle:e,endAngle:r,counterclockwise:s})},f.prototype.arcTo=function(){throw new Error("arcTo not implemented.")},f.prototype.rect=function(t,i,n,e){if(isNaN(t)||isNaN(i)||isNaN(n)||isNaN(e))throw kt.error("jsPDF.context2d.rect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rect");this.moveTo(t,i),this.lineTo(t+n,i),this.lineTo(t+n,i+e),this.lineTo(t,i+e),this.lineTo(t,i),this.lineTo(t+n,i),this.lineTo(t,i)},f.prototype.fillRect=function(t,i,n,e){if(isNaN(t)||isNaN(i)||isNaN(n)||isNaN(e))throw kt.error("jsPDF.context2d.fillRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillRect");if(!d.call(this)){var r={};"butt"!==this.lineCap&&(r.lineCap=this.lineCap,this.lineCap="butt"),"miter"!==this.lineJoin&&(r.lineJoin=this.lineJoin,this.lineJoin="miter"),this.beginPath(),this.rect(t,i,n,e),this.fill(),r.hasOwnProperty("lineCap")&&(this.lineCap=r.lineCap),r.hasOwnProperty("lineJoin")&&(this.lineJoin=r.lineJoin)}},f.prototype.strokeRect=function(t,i,n,e){if(isNaN(t)||isNaN(i)||isNaN(n)||isNaN(e))throw kt.error("jsPDF.context2d.strokeRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeRect");v.call(this)||(this.beginPath(),this.rect(t,i,n,e),this.stroke())},f.prototype.clearRect=function(t,i,n,e){if(isNaN(t)||isNaN(i)||isNaN(n)||isNaN(e))throw kt.error("jsPDF.context2d.clearRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.clearRect");this.ignoreClearRect||(this.fillStyle="#ffffff",this.fillRect(t,i,n,e))},f.prototype.save=function(t){t="boolean"!=typeof t||t;for(var i=this.pdf.internal.getCurrentPageInfo().pageNumber,n=0;n<this.pdf.internal.getNumberOfPages();n++)this.pdf.setPage(n+1),this.pdf.internal.out("q");if(this.pdf.setPage(i),t){this.ctx.fontSize=this.pdf.internal.getFontSize();var e=new h(this.ctx);this.ctxStack.push(this.ctx),this.ctx=e}},f.prototype.restore=function(t){t="boolean"!=typeof t||t;for(var i=this.pdf.internal.getCurrentPageInfo().pageNumber,n=0;n<this.pdf.internal.getNumberOfPages();n++)this.pdf.setPage(n+1),this.pdf.internal.out("Q");this.pdf.setPage(i),t&&0!==this.ctxStack.length&&(this.ctx=this.ctxStack.pop(),this.fillStyle=this.ctx.fillStyle,this.strokeStyle=this.ctx.strokeStyle,this.font=this.ctx.font,this.lineCap=this.ctx.lineCap,this.lineWidth=this.ctx.lineWidth,this.lineJoin=this.ctx.lineJoin,this.lineDash=this.ctx.lineDash,this.lineDashOffset=this.ctx.lineDashOffset)},f.prototype.toDataURL=function(){throw new Error("toDataUrl not implemented.")};var l=function(t){var i,n,e,r;if(!0===t.isCanvasGradient&&(t=t.getColor()),!t)return{r:0,g:0,b:0,a:0,style:t};if(/transparent|rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*0+\s*\)/.test(t))i=0,n=0,e=0,r=0;else{var s=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(t);if(null!==s)i=parseInt(s[1]),n=parseInt(s[2]),e=parseInt(s[3]),r=1;else if(null!==(s=/rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)/.exec(t)))i=parseInt(s[1]),n=parseInt(s[2]),e=parseInt(s[3]),r=parseFloat(s[4]);else{if(r=1,"string"==typeof t&&"#"!==t.charAt(0)){var o=new Pt(t);t=o.ok?o.toHex():"#000000"}4===t.length?(i=t.substring(1,2),i+=i,n=t.substring(2,3),n+=n,e=t.substring(3,4),e+=e):(i=t.substring(1,3),n=t.substring(3,5),e=t.substring(5,7)),i=parseInt(i,16),n=parseInt(n,16),e=parseInt(e,16)}}return{r:i,g:n,b:e,a:r,style:t}},d=function(){return this.ctx.isFillTransparent||0==this.globalAlpha},v=function(){return Boolean(this.ctx.isStrokeTransparent||0==this.globalAlpha)};f.prototype.fillText=function(t,i,n,e){if(isNaN(i)||isNaN(n)||"string"!=typeof t)throw kt.error("jsPDF.context2d.fillText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillText");if(e=isNaN(e)?void 0:e,!d.call(this)){var r=F(this.ctx.transform.rotation),s=this.ctx.transform.scaleX;M.call(this,{text:t,x:i,y:n,scale:s,angle:r,align:this.textAlign,maxWidth:e})}},f.prototype.strokeText=function(t,i,n,e){if(isNaN(i)||isNaN(n)||"string"!=typeof t)throw kt.error("jsPDF.context2d.strokeText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeText");if(!v.call(this)){e=isNaN(e)?void 0:e;var r=F(this.ctx.transform.rotation),s=this.ctx.transform.scaleX;M.call(this,{text:t,x:i,y:n,scale:s,renderingMode:"stroke",angle:r,align:this.textAlign,maxWidth:e})}},f.prototype.measureText=function(t){if("string"!=typeof t)throw kt.error("jsPDF.context2d.measureText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.measureText");var i=this.pdf,n=this.pdf.internal.scaleFactor,e=i.internal.getFontSize(),r=i.getStringUnitWidth(t)*e/i.internal.scaleFactor,s=function(t){var i=(t=t||{}).width||0;return Object.defineProperty(this,"width",{get:function(){return i}}),this};return new s({width:r*=Math.round(96*n/72*1e4)/1e4})},f.prototype.scale=function(t,i){if(isNaN(t)||isNaN(i))throw kt.error("jsPDF.context2d.scale: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.scale");var n=new u(t,0,0,i,0,0);this.ctx.transform=this.ctx.transform.multiply(n)},f.prototype.rotate=function(t){if(isNaN(t))throw kt.error("jsPDF.context2d.rotate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rotate");var i=new u(Math.cos(t),Math.sin(t),-Math.sin(t),Math.cos(t),0,0);this.ctx.transform=this.ctx.transform.multiply(i)},f.prototype.translate=function(t,i){if(isNaN(t)||isNaN(i))throw kt.error("jsPDF.context2d.translate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.translate");var n=new u(1,0,0,1,t,i);this.ctx.transform=this.ctx.transform.multiply(n)},f.prototype.transform=function(t,i,n,e,r,s){if(isNaN(t)||isNaN(i)||isNaN(n)||isNaN(e)||isNaN(r)||isNaN(s))throw kt.error("jsPDF.context2d.transform: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.transform");var o=new u(t,i,n,e,r,s);this.ctx.transform=this.ctx.transform.multiply(o)},f.prototype.setTransform=function(t,i,n,e,r,s){t=isNaN(t)?1:t,i=isNaN(i)?0:i,n=isNaN(n)?0:n,e=isNaN(e)?1:e,r=isNaN(r)?0:r,s=isNaN(s)?0:s,this.ctx.transform=new u(t,i,n,e,r,s)};var m=function(){return this.margin[0]>0||this.margin[1]>0||this.margin[2]>0||this.margin[3]>0};f.prototype.drawImage=function(t,i,n,e,r,s,o,c,h){var f=this.pdf.getImageProperties(t),l=1,d=1,v=1,p=1;void 0!==e&&void 0!==c&&(v=c/e,p=h/r,l=f.width/e*c/e,d=f.height/r*h/r),void 0===s&&(s=i,o=n,i=0,n=0),void 0!==e&&void 0===c&&(c=e,h=r),void 0===e&&void 0===c&&(c=f.width,h=f.height);for(var N,y=this.ctx.transform.decompose(),A=F(y.rotate.shx),k=new u,S=(k=(k=(k=k.multiply(y.translate)).multiply(y.skew)).multiply(y.scale)).applyToRectangle(new a(s-i*v,o-n*p,e*l,r*d)),x=w.call(this,S),q=[],M=0;M<x.length;M+=1)-1===q.indexOf(x[M])&&q.push(x[M]);if(g(q),this.autoPaging)for(var j=q[0],E=q[q.length-1],P=j;P<E+1;P++){this.pdf.setPage(P);var I=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],O=1===P?this.posY+this.margin[0]:this.margin[0],R=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],B=1===P?0:this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2]+(P-2)*R;if(0!==this.ctx.clip_path.length){var C=this.path;N=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=b(N,this.posX+this.margin[3],-B+O+this.ctx.prevPageLastElemOffset),L.call(this,"fill",!0),this.path=C}var D=JSON.parse(JSON.stringify(S));D=b([D],this.posX+this.margin[3],-B+O+this.ctx.prevPageLastElemOffset)[0];var T=(P>j||P<E)&&m.call(this);T&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],I,R,null).clip().discardPath()),this.pdf.addImage(t,"JPEG",D.x,D.y,D.w,D.h,null,null,A),T&&this.pdf.restoreGraphicsState()}else this.pdf.addImage(t,"JPEG",S.x,S.y,S.w,S.h,null,null,A)};var w=function(t,i,n){var e=[];n=n||this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2];var r=this.posY+this.ctx.prevPageLastElemOffset;switch(t.type){default:case"mt":case"lt":e.push(Math.floor((t.y+r)/n)+1);break;case"arc":e.push(Math.floor((t.y+r-t.radius)/n)+1),e.push(Math.floor((t.y+r+t.radius)/n)+1);break;case"qct":var s=R(this.ctx.lastPoint.x,this.ctx.lastPoint.y,t.x1,t.y1,t.x,t.y);e.push(Math.floor((s.y+r)/n)+1),e.push(Math.floor((s.y+s.h+r)/n)+1);break;case"bct":var o=C(this.ctx.lastPoint.x,this.ctx.lastPoint.y,t.x1,t.y1,t.x2,t.y2,t.x,t.y);e.push(Math.floor((o.y+r)/n)+1),e.push(Math.floor((o.y+o.h+r)/n)+1);break;case"rect":e.push(Math.floor((t.y+r)/n)+1),e.push(Math.floor((t.y+t.h+r)/n)+1)}for(var a=0;a<e.length;a+=1)for(;this.pdf.internal.getNumberOfPages()<e[a];)p.call(this);return e},p=function(){var t=this.fillStyle,i=this.strokeStyle,n=this.font,e=this.lineCap,r=this.lineWidth,s=this.lineJoin;this.pdf.addPage(),this.fillStyle=t,this.strokeStyle=i,this.font=n,this.lineCap=e,this.lineWidth=r,this.lineJoin=s},b=function(t,i,n){for(var e=0;e<t.length;e++)switch(t[e].type){case"bct":t[e].x2+=i,t[e].y2+=n;case"qct":t[e].x1+=i,t[e].y1+=n;default:t[e].x+=i,t[e].y+=n}return t},g=function(t){return t.sort((function(t,i){return t-i}))},N=function(t,i){for(var n,e,r=this.fillStyle,s=this.strokeStyle,o=this.lineCap,a=this.lineWidth,u=Math.abs(a*this.ctx.transform.scaleX),c=this.lineJoin,h=JSON.parse(JSON.stringify(this.path)),f=JSON.parse(JSON.stringify(this.path)),l=[],d=0;d<f.length;d++)if(void 0!==f[d].x)for(var v=w.call(this,f[d]),N=0;N<v.length;N+=1)-1===l.indexOf(v[N])&&l.push(v[N]);for(var y=0;y<l.length;y++)for(;this.pdf.internal.getNumberOfPages()<l[y];)p.call(this);if(g(l),this.autoPaging)for(var A=l[0],k=l[l.length-1],S=A;S<k+1;S++){this.pdf.setPage(S),this.fillStyle=r,this.strokeStyle=s,this.lineCap=o,this.lineWidth=u,this.lineJoin=c;var x=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],q=1===S?this.posY+this.margin[0]:this.margin[0],M=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],j=1===S?0:this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2]+(S-2)*M;if(0!==this.ctx.clip_path.length){var E=this.path;n=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=b(n,this.posX+this.margin[3],-j+q+this.ctx.prevPageLastElemOffset),L.call(this,t,!0),this.path=E}if(e=JSON.parse(JSON.stringify(h)),this.path=b(e,this.posX+this.margin[3],-j+q+this.ctx.prevPageLastElemOffset),!1===i||0===S){var P=(S>A||S<k)&&m.call(this);P&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],x,M,null).clip().discardPath()),L.call(this,t,i),P&&this.pdf.restoreGraphicsState()}this.lineWidth=a}else this.lineWidth=u,L.call(this,t,i),this.lineWidth=a;this.path=h},L=function(t,i){if(("stroke"!==t||i||!v.call(this))&&("stroke"===t||i||!d.call(this))){for(var n,e,r=[],s=this.path,o=0;o<s.length;o++){var a=s[o];switch(a.type){case"begin":r.push({begin:!0});break;case"close":r.push({close:!0});break;case"mt":r.push({start:a,deltas:[],abs:[]});break;case"lt":var u=r.length;if(s[o-1]&&!isNaN(s[o-1].x)&&(n=[a.x-s[o-1].x,a.y-s[o-1].y],u>0))for(;u>=0;u--)if(!0!==r[u-1].close&&!0!==r[u-1].begin){r[u-1].deltas.push(n),r[u-1].abs.push(a);break}break;case"bct":r[r.length-1].deltas.push(n=[a.x1-s[o-1].x,a.y1-s[o-1].y,a.x2-s[o-1].x,a.y2-s[o-1].y,a.x-s[o-1].x,a.y-s[o-1].y]);break;case"qct":r[r.length-1].deltas.push(n=[s[o-1].x+2/3*(a.x1-s[o-1].x)-s[o-1].x,s[o-1].y+2/3*(a.y1-s[o-1].y)-s[o-1].y,a.x+2/3*(a.x1-a.x)-s[o-1].x,a.y+2/3*(a.y1-a.y)-s[o-1].y,a.x-s[o-1].x,a.y-s[o-1].y]);break;case"arc":r.push({deltas:[],abs:[],arc:!0}),Array.isArray(r[r.length-1].abs)&&r[r.length-1].abs.push(a)}}e=i?null:"stroke"===t?"stroke":"fill";for(var c=!1,h=0;h<r.length;h++)if(r[h].arc)for(var f=r[h].abs,l=0;l<f.length;l++){var m=f[l];"arc"===m.type?k.call(this,m.x,m.y,m.radius,m.startAngle,m.endAngle,m.counterclockwise,void 0,i,!c):j.call(this,m.x,m.y),c=!0}else!0===r[h].close?(this.pdf.internal.out("h"),c=!1):!0!==r[h].begin&&(E.call(this,r[h].deltas,r[h].start.x,r[h].start.y),c=!0);e&&S.call(this,e),i&&x.call(this)}},y=function(t){var i=this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor,n=i*(this.pdf.internal.getLineHeightFactor()-1);switch(this.ctx.textBaseline){case"bottom":return t-n;case"top":return t+i-n;case"hanging":return t+i-2*n;case"middle":return t+i/2-n;default:return t}},A=function(t){return t+this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor*(this.pdf.internal.getLineHeightFactor()-1)};f.prototype.createLinearGradient=function(){var t=function(){};return t.colorStops=[],t.addColorStop=function(t,i){this.colorStops.push([t,i])},t.getColor=function(){return 0===this.colorStops.length?"#000000":this.colorStops[0][1]},t.isCanvasGradient=!0,t},f.prototype.createPattern=function(){return this.createLinearGradient()},f.prototype.createRadialGradient=function(){return this.createLinearGradient()};var k=function(t,i,n,e,r,s,o,a,u){for(var c=I.call(this,n,e,r,s),h=0;h<c.length;h++){var f=c[h];0===h&&(u?q.call(this,f.x1+t,f.y1+i):j.call(this,f.x1+t,f.y1+i)),P.call(this,t,i,f.x2,f.y2,f.x3,f.y3,f.x4,f.y4)}a?x.call(this):S.call(this,o)},S=function(t){switch(t){case"stroke":this.pdf.internal.out("S");break;case"fill":this.pdf.internal.out("f")}},x=function(){this.pdf.clip(),this.pdf.discardPath()},q=function(t,i){this.pdf.internal.out(n(t)+" "+e(i)+" m")},M=function(t){var i;switch(t.align){case"right":case"end":i="right";break;case"center":i="center";break;default:i="left"}var n=this.pdf.getTextDimensions(t.text),e=y.call(this,t.y),r=A.call(this,e)-n.h,s=this.ctx.transform.applyToPoint(new o(t.x,e)),c=this.ctx.transform.decompose(),h=new u;h=(h=(h=h.multiply(c.translate)).multiply(c.skew)).multiply(c.scale);for(var f,l,d,v=this.ctx.transform.applyToRectangle(new a(t.x,e,n.w,n.h)),p=h.applyToRectangle(new a(t.x,r,n.w,n.h)),N=w.call(this,p),k=[],S=0;S<N.length;S+=1)-1===k.indexOf(N[S])&&k.push(N[S]);if(g(k),this.autoPaging)for(var x=k[0],q=k[k.length-1],M=x;M<q+1;M++){this.pdf.setPage(M);var j=1===M?this.posY+this.margin[0]:this.margin[0],E=this.pdf.internal.pageSize.height-this.margin[2],P=E-this.margin[0],I=this.pdf.internal.pageSize.width-this.margin[1],O=I-this.margin[3],F=1===M?0:this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2]+(M-2)*P;if(0!==this.ctx.clip_path.length){var R=this.path;f=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=b(f,this.posX+this.margin[3],-1*F+j),L.call(this,"fill",!0),this.path=R}var B=b([JSON.parse(JSON.stringify(p))],this.posX+this.margin[3],-F+j+this.ctx.prevPageLastElemOffset)[0];t.scale>=.01&&(l=this.pdf.internal.getFontSize(),this.pdf.setFontSize(l*t.scale),this.lineWidth=(d=this.lineWidth)*t.scale);var C="text"!==this.autoPaging;if(C||B.y+B.h<=E){if(C||B.y>=j&&B.x<=I){var D=C?t.text:this.pdf.splitTextToSize(t.text,t.maxWidth||I-B.x)[0],T=b([JSON.parse(JSON.stringify(v))],this.posX+this.margin[3],-F+j+this.ctx.prevPageLastElemOffset)[0],z=C&&(M>x||M<q)&&m.call(this);z&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],O,P,null).clip().discardPath()),this.pdf.text(D,T.x,T.y,{angle:t.angle,align:i,renderingMode:t.renderingMode}),z&&this.pdf.restoreGraphicsState()}}else B.y<E&&(this.ctx.prevPageLastElemOffset+=E-B.y);t.scale>=.01&&(this.pdf.setFontSize(l),this.lineWidth=d)}else t.scale>=.01&&(l=this.pdf.internal.getFontSize(),this.pdf.setFontSize(l*t.scale),this.lineWidth=(d=this.lineWidth)*t.scale),this.pdf.text(t.text,s.x+this.posX,s.y+this.posY,{angle:t.angle,align:i,renderingMode:t.renderingMode,maxWidth:t.maxWidth}),t.scale>=.01&&(this.pdf.setFontSize(l),this.lineWidth=d)},j=function(t,i,r,s){s=s||0,this.pdf.internal.out(n(t+(r=r||0))+" "+e(i+s)+" l")},E=function(t,i,n){return this.pdf.lines(t,i,n,null,null)},P=function(t,n,e,o,a,u,c,h){this.pdf.internal.out([i(r(e+t)),i(s(o+n)),i(r(a+t)),i(s(u+n)),i(r(c+t)),i(s(h+n)),"c"].join(" "))},I=function(t,i,n,e){for(var r=2*Math.PI,s=Math.PI/2;i>n;)i-=r;var o=Math.abs(n-i);o<r&&e&&(o=r-o);for(var a=[],u=e?-1:1,c=i;o>1e-5;){var h=c+u*Math.min(o,s);a.push(O.call(this,t,c,h)),o-=Math.abs(h-c),c=h}return a},O=function(t,i,n){var e=(n-i)/2,r=t*Math.cos(e),s=t*Math.sin(e),o=r,a=-s,u=o*o+a*a,c=u+o*r+a*s,h=4/3*(Math.sqrt(2*u*c)-c)/(o*s-a*r),f=o-h*a,l=a+h*o,d=f,v=-l,m=e+i,w=Math.cos(m),p=Math.sin(m);return{x1:t*Math.cos(i),y1:t*Math.sin(i),x2:f*w-l*p,y2:f*p+l*w,x3:d*w-v*p,y3:d*p+v*w,x4:t*Math.cos(n),y4:t*Math.sin(n)}},F=function(t){return 180*t/Math.PI},R=function(t,i,n,e,r,s){var o=t+.5*(n-t),u=i+.5*(e-i),c=r+.5*(n-r),h=s+.5*(e-s),f=Math.min(t,r,o,c),l=Math.max(t,r,o,c),d=Math.min(i,s,u,h),v=Math.max(i,s,u,h);return new a(f,d,l-f,v-d)},C=function(t,i,n,e,r,s,o,u){var c,h,f,l,d,v,m,w,p,b,g,N,L,y,A=n-t,k=e-i,S=r-n,x=s-e,q=o-r,M=u-s;for(h=0;h<41;h++)p=(m=(f=t+(c=h/40)*A)+c*((d=n+c*S)-f))+c*(d+c*(r+c*q-d)-m),b=(w=(l=i+c*k)+c*((v=e+c*x)-l))+c*(v+c*(s+c*M-v)-w),0==h?(g=p,N=b,L=p,y=b):(g=Math.min(g,p),N=Math.min(N,b),L=Math.max(L,p),y=Math.max(y,b));return new a(Math.round(g),Math.round(N),Math.round(L-g),Math.round(y-N))},D=function(){if(this.prevLineDash||this.ctx.lineDash.length||this.ctx.lineDashOffset){var t=JSON.stringify({lineDash:this.ctx.lineDash,lineDashOffset:this.ctx.lineDashOffset});this.prevLineDash!==t&&(this.pdf.setLineDash(this.ctx.lineDash,this.ctx.lineDashOffset),this.prevLineDash=t)}}}(ii.API),
126
126
  /**
127
127
  * @license
128
128
  * jsPDF filters PlugIn
@@ -154,7 +154,7 @@ function(t){t.loadFile=function(t,i,n){return function(t,i,n){i=!1!==i,n="functi
154
154
  * Licensed under the MIT License.
155
155
  * http://opensource.org/licenses/mit-license
156
156
  */
157
- an=[192,193,194,195,196,197,198,199],ii.API.processJPEG=function(t,i,n,e,r,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=r||t)?new Uint8Array(t):t,(o=function(t){for(var i,n=256*t.charCodeAt(4)+t.charCodeAt(5),e=t.length,r={width:0,height:0,numcomponents:1},s=4;s<e;s+=2){if(-1!==an.indexOf(t.charCodeAt((s+=n)+1))){i=256*t.charCodeAt(s+5)+t.charCodeAt(s+6),r={width:256*t.charCodeAt(s+7)+t.charCodeAt(s+8),height:i,numcomponents:t.charCodeAt(s+9)};break}n=256*t.charCodeAt(s+2)+t.charCodeAt(s+3)}return r}(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:i,alias:n}}return u};var cn,hn,fn,ln,dn,vn=function(){var t,i,n;function e(t){var i,n,e,r,s,o,a,u,c,h,f,l,d;for(this.data=t,this.pos=8,this.palette=[],this.imgData=[],this.transparency={},this.animation=null,this.text={},s=null;;){switch(i=this.readUInt32(),u=function(){var t,i;for(i=[],t=0;t<4;++t)i.push(String.fromCharCode(this.data[this.pos++]));return i}.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(i);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()},r=this.readUInt16(),e=this.readUInt16()||100,s.delay=1e3*r/e,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,i-=4),t=(null!=s?s.data:void 0)||this.imgData,f=0;0<=i?f<i:f>i;0<=i?++f:--f)t.push(this.data[this.pos++]);break;case"tRNS":switch(this.transparency={},this.colorType){case 3:if(n=this.palette.length/3,this.transparency.indexed=this.read(i),this.transparency.indexed.length>n)throw new Error("More transparent colors than palette size");if((c=n-this.transparency.indexed.length)>0)for(l=0;0<=c?l<c:l>c;0<=c?++l:--l)this.transparency.indexed.push(255);break;case 0:this.transparency.grayscale=this.read(i)[0];break;case 2:this.transparency.rgb=this.read(i)}break;case"tEXt":o=(h=this.read(i)).indexOf(0),a=String.fromCharCode.apply(String,h.slice(0,o)),this.text[a]=String.fromCharCode.apply(String,h.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===(d=this.colorType)||6===d,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+=i}if(this.pos+=4,this.pos>this.data.length)throw new Error("Incomplete or corrupt PNG file")}}e.prototype.read=function(t){var i,n;for(n=[],i=0;0<=t?i<t:i>t;0<=t?++i:--i)n.push(this.data[this.pos++]);return n},e.prototype.readUInt32=function(){return this.data[this.pos++]<<24|this.data[this.pos++]<<16|this.data[this.pos++]<<8|this.data[this.pos++]},e.prototype.readUInt16=function(){return this.data[this.pos++]<<8|this.data[this.pos++]},e.prototype.decodePixels=function(t){var i,n,e=this.pixelBitlength/8,r=new Uint8Array(this.width*this.height*e),s=0,o=this;if(null==t&&(t=this.imgData),0===t.length)return new Uint8Array(0);function a(i,n,a,u){var c,h,f,l,d,v,m,w,p,b,g,N,L,y,A,k,S,x,q,M,j=Math.ceil((o.width-i)/a),E=Math.ceil((o.height-n)/u),P=o.width==j&&o.height==E;for(L=e*j,g=P?r:new Uint8Array(L*E),v=t.length,N=0,h=0;N<E&&s<v;){switch(t[s++]){case 0:for(l=k=0;k<L;l=k+=1)g[h++]=t[s++];break;case 1:for(l=S=0;S<L;l=S+=1)c=t[s++],d=l<e?0:g[h-e],g[h++]=(c+d)%256;break;case 2:for(l=x=0;x<L;l=x+=1)c=t[s++],f=(l-l%e)/e,g[h++]=((y=N&&g[(N-1)*L+f*e+l%e])+c)%256;break;case 3:for(l=q=0;q<L;l=q+=1)c=t[s++],f=(l-l%e)/e,d=l<e?0:g[h-e],y=N&&g[(N-1)*L+f*e+l%e],g[h++]=(c+Math.floor((d+y)/2))%256;break;case 4:for(l=M=0;M<L;l=M+=1)c=t[s++],f=(l-l%e)/e,0===N?y=A=0:(y=g[(N-1)*L+f*e+l%e],A=f&&g[(N-1)*L+(f-1)*e+l%e]),m=(d=l<e?0:g[h-e])+y-A,w=Math.abs(m-d),p=Math.abs(m-y),b=Math.abs(m-A),g[h++]=(c+(w<=p&&w<=b?d:p<=b?y:A))%256;break;default:throw new Error("Invalid filter algorithm: "+t[s-1])}if(!P){var I=((n+N*u)*o.width+i)*e,F=N*L;for(l=0;l<j;l+=1){for(var R=0;R<e;R+=1)r[I++]=g[F++];I+=(a-1)*e}}N++}}return t=function(t,i,n){var e=t.length,r=!i||n,s=!n||n.i;n||(n={}),i||(i=new D(3*e));var o=function(t){var n=i.length;if(t>n){var e=new D(Math.max(2*n,t));e.set(i),i=e}},a=n.f||0,u=n.p||0,c=n.b||0,h=n.l,f=n.d,l=n.m,d=n.n,v=8*e;do{if(!h){n.f=a=at(t,u,1);var m=at(t,u+1,3);if(u+=3,!m){var w=t[(q=ct(u)+4)-4]|t[q-3]<<8,p=q+w;if(p>e){if(s)throw"unexpected EOF";break}r&&o(c+w),i.set(t.subarray(q,p),c),n.b=c+=w,n.p=u=8*p;continue}if(1==m)h=et,f=st,l=9,d=5;else{if(2!=m)throw"invalid block type";var b=at(t,u,31)+257,g=at(t,u+10,15)+4,N=b+at(t,u+5,31)+1;u+=14;for(var L=new D(N),y=new D(19),A=0;A<g;++A)y[U[A]]=at(t,u+3*A,7);u+=3*g;var k=ot(y),S=(1<<k)-1;if(!s&&u+N*(k+7)>v)break;var x=Z(y,k,1);for(A=0;A<N;){var q,M=x[at(t,u,S)];if(u+=15&M,(q=M>>>4)<16)L[A++]=q;else{var j=0,E=0;for(16==q?(E=3+at(t,u,3),u+=2,j=L[A-1]):17==q?(E=3+at(t,u,7),u+=3):18==q&&(E=11+at(t,u,127),u+=7);E--;)L[A++]=j}}var P=L.subarray(0,b),I=L.subarray(b);l=ot(P),d=ot(I),h=Z(P,l,1),f=Z(I,d,1)}if(u>v)throw"unexpected EOF"}r&&o(c+131072);for(var F=(1<<l)-1,R=(1<<d)-1,O=l+d+18;s||u+O<v;){var B=(j=h[ut(t,u)&F])>>>4;if((u+=15&j)>v)throw"unexpected EOF";if(!j)throw"invalid length/literal";if(B<256)i[c++]=B;else{if(256==B){h=null;break}var C=B-254;B>264&&(C=at(t,u,(1<<(W=z[A=B-257]))-1)+H[A],u+=W);var T=f[ut(t,u)&R],V=T>>>4;if(!T)throw"invalid distance";if(u+=15&T,I=Y[V],V>3){var W=_[V];I+=ut(t,u)&(1<<W)-1,u+=W}if(u>v)throw"unexpected EOF";r&&o(c+131072);for(var G=c+C;c<G;c+=4)i[c]=i[c-I],i[c+1]=i[c+1-I],i[c+2]=i[c+2-I],i[c+3]=i[c+3-I];c=G}}n.l=h,n.p=u,n.b=c,h&&(a=1,n.m=l,n.d=f,n.n=d)}while(!a);return c==i.length?i:ht(i,0,c)}((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"}(i=t),i.subarray(2,-4)),n),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),r},e.prototype.decodePalette=function(){var t,i,n,e,r,s,o,a,u;for(n=this.palette,s=this.transparency.indexed||[],r=new Uint8Array((s.length||0)+n.length),e=0,t=0,i=o=0,a=n.length;o<a;i=o+=3)r[e++]=n[i],r[e++]=n[i+1],r[e++]=n[i+2],r[e++]=null!=(u=s[t++])?u:255;return r},e.prototype.copyToImageData=function(t,i){var n,e,r,s,o,a,u,c,h,f,l;if(e=this.colors,h=null,n=this.hasAlphaChannel,this.palette.length&&(h=null!=(l=this._decodedPalette)?l:this._decodedPalette=this.decodePalette(),e=4,n=!0),c=(r=t.data||t).length,o=h||i,s=a=0,1===e)for(;s<c;)u=h?4*i[s/4]:a,f=o[u++],r[s++]=f,r[s++]=f,r[s++]=f,r[s++]=n?o[u++]:255,a=u;else for(;s<c;)u=h?4*i[s/4]:a,r[s++]=o[u++],r[s++]=o[u++],r[s++]=o[u++],r[s++]=n?o[u++]:255,a=u},e.prototype.decode=function(){var t;return t=new Uint8Array(this.width*this.height*4),this.copyToImageData(t,this.decodePixels()),t};var r=function(){if("[object Window]"===Object.prototype.toString.call(yt)){try{i=yt.document.createElement("canvas"),n=i.getContext("2d")}catch(t){return!1}return!0}return!1};return r(),t=function(t){var e;if(!0===r())return n.width=t.width,n.height=t.height,n.clearRect(0,0,t.width,t.height),n.putImageData(t,0,0),(e=new Image).src=i.toDataURL(),e;throw new Error("This method requires a Browser with Canvas-capability.")},e.prototype.decodeFrames=function(i){var n,e,r,s,o,a,u,c;if(this.animation){for(c=[],e=o=0,a=(u=this.animation.frames).length;o<a;e=++o)r=i.createImageData((n=u[e]).width,n.height),s=this.decodePixels(new Uint8Array(n.data)),this.copyToImageData(r,s),n.imageData=r,c.push(n.image=t(r));return c}},e.prototype.renderFrame=function(t,i){var n,e,r;return n=(e=this.animation.frames)[i],r=e[i-1],0===i&&t.clearRect(0,0,this.width,this.height),1===(null!=r?r.disposeOp:void 0)?t.clearRect(r.xOffset,r.yOffset,r.width,r.height):2===(null!=r?r.disposeOp:void 0)&&t.putImageData(r.imageData,r.xOffset,r.yOffset),0===n.blendOp&&t.clearRect(n.xOffset,n.yOffset,n.width,n.height),t.drawImage(n.image,n.xOffset,n.yOffset)},e.prototype.animate=function(t){var i,n,e,r,s,o,a=this;return n=0,r=(o=this.animation).numFrames,e=o.frames,s=o.numPlays,(i=function(){var o,u;if(o=n++%r,u=e[o],a.renderFrame(t,o),r>1&&n/r<s)return a.animation._timeout=setTimeout(i,u.delay)})()},e.prototype.stopAnimation=function(){var t;return clearTimeout(null!=(t=this.animation)?t._timeout:void 0)},e.prototype.render=function(t){var i,n;return t._png&&t._png.stopAnimation(),t._png=this,t.width=this.width,t.height=this.height,i=t.getContext("2d"),this.animation?(this.decodeFrames(i),this.animate(i)):(n=i.createImageData(this.width,this.height),this.copyToImageData(n,this.decodePixels()),i.putImageData(n,0,0))},e}();
157
+ an=[192,193,194,195,196,197,198,199],ii.API.processJPEG=function(t,i,n,e,r,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=r||t)?new Uint8Array(t):t,(o=function(t){for(var i,n=256*t.charCodeAt(4)+t.charCodeAt(5),e=t.length,r={width:0,height:0,numcomponents:1},s=4;s<e;s+=2){if(-1!==an.indexOf(t.charCodeAt((s+=n)+1))){i=256*t.charCodeAt(s+5)+t.charCodeAt(s+6),r={width:256*t.charCodeAt(s+7)+t.charCodeAt(s+8),height:i,numcomponents:t.charCodeAt(s+9)};break}n=256*t.charCodeAt(s+2)+t.charCodeAt(s+3)}return r}(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:i,alias:n}}return u};var cn,hn,fn,ln,dn,vn=function(){var t,i,n;function e(t){var i,n,e,r,s,o,a,u,c,h,f,l,d;for(this.data=t,this.pos=8,this.palette=[],this.imgData=[],this.transparency={},this.animation=null,this.text={},s=null;;){switch(i=this.readUInt32(),u=function(){var t,i;for(i=[],t=0;t<4;++t)i.push(String.fromCharCode(this.data[this.pos++]));return i}.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(i);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()},r=this.readUInt16(),e=this.readUInt16()||100,s.delay=1e3*r/e,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,i-=4),t=(null!=s?s.data:void 0)||this.imgData,f=0;0<=i?f<i:f>i;0<=i?++f:--f)t.push(this.data[this.pos++]);break;case"tRNS":switch(this.transparency={},this.colorType){case 3:if(n=this.palette.length/3,this.transparency.indexed=this.read(i),this.transparency.indexed.length>n)throw new Error("More transparent colors than palette size");if((c=n-this.transparency.indexed.length)>0)for(l=0;0<=c?l<c:l>c;0<=c?++l:--l)this.transparency.indexed.push(255);break;case 0:this.transparency.grayscale=this.read(i)[0];break;case 2:this.transparency.rgb=this.read(i)}break;case"tEXt":o=(h=this.read(i)).indexOf(0),a=String.fromCharCode.apply(String,h.slice(0,o)),this.text[a]=String.fromCharCode.apply(String,h.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===(d=this.colorType)||6===d,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+=i}if(this.pos+=4,this.pos>this.data.length)throw new Error("Incomplete or corrupt PNG file")}}e.prototype.read=function(t){var i,n;for(n=[],i=0;0<=t?i<t:i>t;0<=t?++i:--i)n.push(this.data[this.pos++]);return n},e.prototype.readUInt32=function(){return this.data[this.pos++]<<24|this.data[this.pos++]<<16|this.data[this.pos++]<<8|this.data[this.pos++]},e.prototype.readUInt16=function(){return this.data[this.pos++]<<8|this.data[this.pos++]},e.prototype.decodePixels=function(t){var i,n,e=this.pixelBitlength/8,r=new Uint8Array(this.width*this.height*e),s=0,o=this;if(null==t&&(t=this.imgData),0===t.length)return new Uint8Array(0);function a(i,n,a,u){var c,h,f,l,d,v,m,w,p,b,g,N,L,y,A,k,S,x,q,M,j=Math.ceil((o.width-i)/a),E=Math.ceil((o.height-n)/u),P=o.width==j&&o.height==E;for(L=e*j,g=P?r:new Uint8Array(L*E),v=t.length,N=0,h=0;N<E&&s<v;){switch(t[s++]){case 0:for(l=k=0;k<L;l=k+=1)g[h++]=t[s++];break;case 1:for(l=S=0;S<L;l=S+=1)c=t[s++],d=l<e?0:g[h-e],g[h++]=(c+d)%256;break;case 2:for(l=x=0;x<L;l=x+=1)c=t[s++],f=(l-l%e)/e,g[h++]=((y=N&&g[(N-1)*L+f*e+l%e])+c)%256;break;case 3:for(l=q=0;q<L;l=q+=1)c=t[s++],f=(l-l%e)/e,d=l<e?0:g[h-e],y=N&&g[(N-1)*L+f*e+l%e],g[h++]=(c+Math.floor((d+y)/2))%256;break;case 4:for(l=M=0;M<L;l=M+=1)c=t[s++],f=(l-l%e)/e,0===N?y=A=0:(y=g[(N-1)*L+f*e+l%e],A=f&&g[(N-1)*L+(f-1)*e+l%e]),m=(d=l<e?0:g[h-e])+y-A,w=Math.abs(m-d),p=Math.abs(m-y),b=Math.abs(m-A),g[h++]=(c+(w<=p&&w<=b?d:p<=b?y:A))%256;break;default:throw new Error("Invalid filter algorithm: "+t[s-1])}if(!P){var I=((n+N*u)*o.width+i)*e,O=N*L;for(l=0;l<j;l+=1){for(var F=0;F<e;F+=1)r[I++]=g[O++];I+=(a-1)*e}}N++}}return t=function(t,i,n){var e=t.length,r=!i||n,s=!n||n.i;n||(n={}),i||(i=new C(3*e));var o=function(t){var n=i.length;if(t>n){var e=new C(Math.max(2*n,t));e.set(i),i=e}},a=n.f||0,u=n.p||0,c=n.b||0,h=n.l,f=n.d,l=n.m,d=n.n,v=8*e;do{if(!h){n.f=a=at(t,u,1);var m=at(t,u+1,3);if(u+=3,!m){var w=t[(q=ct(u)+4)-4]|t[q-3]<<8,p=q+w;if(p>e){if(s)throw"unexpected EOF";break}r&&o(c+w),i.set(t.subarray(q,p),c),n.b=c+=w,n.p=u=8*p;continue}if(1==m)h=et,f=st,l=9,d=5;else{if(2!=m)throw"invalid block type";var b=at(t,u,31)+257,g=at(t,u+10,15)+4,N=b+at(t,u+5,31)+1;u+=14;for(var L=new C(N),y=new C(19),A=0;A<g;++A)y[U[A]]=at(t,u+3*A,7);u+=3*g;var k=ot(y),S=(1<<k)-1;if(!s&&u+N*(k+7)>v)break;var x=Z(y,k,1);for(A=0;A<N;){var q,M=x[at(t,u,S)];if(u+=15&M,(q=M>>>4)<16)L[A++]=q;else{var j=0,E=0;for(16==q?(E=3+at(t,u,3),u+=2,j=L[A-1]):17==q?(E=3+at(t,u,7),u+=3):18==q&&(E=11+at(t,u,127),u+=7);E--;)L[A++]=j}}var P=L.subarray(0,b),I=L.subarray(b);l=ot(P),d=ot(I),h=Z(P,l,1),f=Z(I,d,1)}if(u>v)throw"unexpected EOF"}r&&o(c+131072);for(var O=(1<<l)-1,F=(1<<d)-1,R=l+d+18;s||u+R<v;){var B=(j=h[ut(t,u)&O])>>>4;if((u+=15&j)>v)throw"unexpected EOF";if(!j)throw"invalid length/literal";if(B<256)i[c++]=B;else{if(256==B){h=null;break}var D=B-254;B>264&&(D=at(t,u,(1<<(W=z[A=B-257]))-1)+H[A],u+=W);var T=f[ut(t,u)&F],V=T>>>4;if(!T)throw"invalid distance";if(u+=15&T,I=Y[V],V>3){var W=_[V];I+=ut(t,u)&(1<<W)-1,u+=W}if(u>v)throw"unexpected EOF";r&&o(c+131072);for(var G=c+D;c<G;c+=4)i[c]=i[c-I],i[c+1]=i[c+1-I],i[c+2]=i[c+2-I],i[c+3]=i[c+3-I];c=G}}n.l=h,n.p=u,n.b=c,h&&(a=1,n.m=l,n.d=f,n.n=d)}while(!a);return c==i.length?i:ht(i,0,c)}((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"}(i=t),i.subarray(2,-4)),n),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),r},e.prototype.decodePalette=function(){var t,i,n,e,r,s,o,a,u;for(n=this.palette,s=this.transparency.indexed||[],r=new Uint8Array((s.length||0)+n.length),e=0,t=0,i=o=0,a=n.length;o<a;i=o+=3)r[e++]=n[i],r[e++]=n[i+1],r[e++]=n[i+2],r[e++]=null!=(u=s[t++])?u:255;return r},e.prototype.copyToImageData=function(t,i){var n,e,r,s,o,a,u,c,h,f,l;if(e=this.colors,h=null,n=this.hasAlphaChannel,this.palette.length&&(h=null!=(l=this._decodedPalette)?l:this._decodedPalette=this.decodePalette(),e=4,n=!0),c=(r=t.data||t).length,o=h||i,s=a=0,1===e)for(;s<c;)u=h?4*i[s/4]:a,f=o[u++],r[s++]=f,r[s++]=f,r[s++]=f,r[s++]=n?o[u++]:255,a=u;else for(;s<c;)u=h?4*i[s/4]:a,r[s++]=o[u++],r[s++]=o[u++],r[s++]=o[u++],r[s++]=n?o[u++]:255,a=u},e.prototype.decode=function(){var t;return t=new Uint8Array(this.width*this.height*4),this.copyToImageData(t,this.decodePixels()),t};var r=function(){if("[object Window]"===Object.prototype.toString.call(yt)){try{i=yt.document.createElement("canvas"),n=i.getContext("2d")}catch(t){return!1}return!0}return!1};return r(),t=function(t){var e;if(!0===r())return n.width=t.width,n.height=t.height,n.clearRect(0,0,t.width,t.height),n.putImageData(t,0,0),(e=new Image).src=i.toDataURL(),e;throw new Error("This method requires a Browser with Canvas-capability.")},e.prototype.decodeFrames=function(i){var n,e,r,s,o,a,u,c;if(this.animation){for(c=[],e=o=0,a=(u=this.animation.frames).length;o<a;e=++o)r=i.createImageData((n=u[e]).width,n.height),s=this.decodePixels(new Uint8Array(n.data)),this.copyToImageData(r,s),n.imageData=r,c.push(n.image=t(r));return c}},e.prototype.renderFrame=function(t,i){var n,e,r;return n=(e=this.animation.frames)[i],r=e[i-1],0===i&&t.clearRect(0,0,this.width,this.height),1===(null!=r?r.disposeOp:void 0)?t.clearRect(r.xOffset,r.yOffset,r.width,r.height):2===(null!=r?r.disposeOp:void 0)&&t.putImageData(r.imageData,r.xOffset,r.yOffset),0===n.blendOp&&t.clearRect(n.xOffset,n.yOffset,n.width,n.height),t.drawImage(n.image,n.xOffset,n.yOffset)},e.prototype.animate=function(t){var i,n,e,r,s,o,a=this;return n=0,r=(o=this.animation).numFrames,e=o.frames,s=o.numPlays,(i=function(){var o,u;if(o=n++%r,u=e[o],a.renderFrame(t,o),r>1&&n/r<s)return a.animation._timeout=setTimeout(i,u.delay)})()},e.prototype.stopAnimation=function(){var t;return clearTimeout(null!=(t=this.animation)?t._timeout:void 0)},e.prototype.render=function(t){var i,n;return t._png&&t._png.stopAnimation(),t._png=this,t.width=this.width,t.height=this.height,i=t.getContext("2d"),this.animation?(this.decodeFrames(i),this.animate(i)):(n=i.createImageData(this.width,this.height),this.copyToImageData(n,this.decodePixels()),i.putImageData(n,0,0))},e}();
158
158
  /**
159
159
  * @license
160
160
  *
@@ -239,14 +239,14 @@ an=[192,193,194,195,196,197,198,199],ii.API.processJPEG=function(t,i,n,e,r,s){va
239
239
  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
240
240
  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
241
241
  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
242
- */function pn(t){var i,n,e,r,s,o=Math.floor,a=new Array(64),u=new Array(64),c=new Array(64),h=new Array(64),f=new Array(65535),l=new Array(65535),d=new Array(64),v=new Array(64),m=[],w=0,p=7,b=new Array(64),g=new Array(64),N=new Array(64),L=new Array(256),y=new Array(2048),A=[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],M=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],j=[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 I(t,i){for(var n=0,e=0,r=new Array,s=1;s<=16;s++){for(var o=1;o<=t[s];o++)r[i[e]]=[],r[i[e]][0]=n,r[i[e]][1]=s,e++,n++;n*=2}return r}function F(t){for(var i=t[0],n=t[1]-1;n>=0;)i&1<<n&&(w|=1<<p),n--,--p<0&&(255==w?(R(255),R(0)):R(w),p=7,w=0)}function R(t){m.push(t)}function O(t){R(t>>8&255),R(255&t)}function B(t,i,n,e,r){for(var s,o=r[0],a=r[240],u=function(t,i){var n,e,r,s,o,a,u,c,h,f,l=0;for(h=0;h<8;++h){var v=(n=t[l])+(c=t[l+7]),m=n-c,w=(e=t[l+1])+(u=t[l+6]),p=e-u,b=(r=t[l+2])+(a=t[l+5]),g=r-a,N=(s=t[l+3])+(o=t[l+4]),L=s-o,y=v+N,A=v-N,k=w+b,S=w-b;t[l]=y+k,t[l+4]=y-k;var x=.707106781*(S+A);t[l+2]=A+x,t[l+6]=A-x;var q=.382683433*((y=L+g)-(S=p+m)),M=.5411961*y+q,j=1.306562965*S+q,E=.707106781*(k=g+p),P=m+E,I=m-E;t[l+5]=I+M,t[l+3]=I-M,t[l+1]=P+j,t[l+7]=P-j,l+=8}for(l=0,h=0;h<8;++h){var F=(n=t[l])+(c=t[l+56]),R=n-c,O=(e=t[l+8])+(u=t[l+48]),B=e-u,D=(r=t[l+16])+(a=t[l+40]),C=r-a,T=(s=t[l+24])+(o=t[l+32]),z=s-o,_=F+T,U=F-T,V=O+D,W=O-D;t[l]=_+V,t[l+32]=_-V;var H=.707106781*(W+U);t[l+16]=U+H,t[l+48]=U-H;var G=.382683433*((_=z+C)-(W=B+R)),J=.5411961*_+G,Y=1.306562965*W+G,K=.707106781*(V=C+B),X=R+K,$=R-K;t[l+40]=$+J,t[l+24]=$-J,t[l+8]=X+Y,t[l+56]=X-Y,l++}for(h=0;h<64;++h)d[h]=(f=t[h]*i[h])>0?f+.5|0:f-.5|0;return d}(t,i),c=0;c<64;++c)v[A[c]]=u[c];var h=v[0]-n;n=v[0],0==h?F(e[0]):(F(e[l[s=32767+h]]),F(f[s]));for(var m=63;m>0&&0==v[m];)m--;if(0==m)return F(o),n;for(var w,p=1;p<=m;){for(var b=p;0==v[p]&&p<=m;)++p;var g=p-b;if(g>=16){w=g>>4;for(var N=1;N<=w;++N)F(a);g&=15}F(r[(g<<4)+l[s=32767+v[p]]]),F(f[s]),p++}return 63!=m&&F(o),n}function D(t){t=Math.min(Math.max(t,1),100),s!=t&&(function(t){for(var i=[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],n=0;n<64;n++){var e=o((i[n]*t+50)/100);e=Math.min(Math.max(e,1),255),a[A[n]]=e}for(var r=[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 f=o((r[s]*t+50)/100);f=Math.min(Math.max(f,1),255),u[A[s]]=f}for(var l=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],d=0,v=0;v<8;v++)for(var m=0;m<8;m++)c[d]=1/(a[A[d]]*l[v]*l[m]*8),h[d]=1/(u[A[d]]*l[v]*l[m]*8),d++}(t<50?Math.floor(5e3/t):Math.floor(200-2*t)),s=t)}this.encode=function(t,s){s&&D(s),m=new Array,w=0,p=7,O(65496),O(65504),O(16),R(74),R(70),R(73),R(70),R(0),R(1),R(1),R(0),O(1),O(1),R(0),R(0),function(){O(65499),O(132),R(0);for(var t=0;t<64;t++)R(a[t]);R(1);for(var i=0;i<64;i++)R(u[i])}(),function(t,i){O(65472),O(17),R(8),O(i),O(t),R(3),R(1),R(17),R(0),R(2),R(17),R(1),R(3),R(17),R(1)}(t.width,t.height),function(){O(65476),O(418),R(0);for(var t=0;t<16;t++)R(k[t+1]);for(var i=0;i<=11;i++)R(S[i]);R(16);for(var n=0;n<16;n++)R(x[n+1]);for(var e=0;e<=161;e++)R(q[e]);R(1);for(var r=0;r<16;r++)R(M[r+1]);for(var s=0;s<=11;s++)R(j[s]);R(17);for(var o=0;o<16;o++)R(E[o+1]);for(var a=0;a<=161;a++)R(P[a])}(),O(65498),O(12),R(3),R(1),R(0),R(2),R(17),R(3),R(17),R(0),R(63),R(0);var o=0,f=0,l=0;w=0,p=7,this.encode.displayName="_encode_";for(var d,v,L,A,I,C,T,z,_,U=t.data,V=t.height,W=4*t.width,H=0;H<V;){for(d=0;d<W;){for(I=W*H+d,T=-1,z=0,_=0;_<64;_++)C=I+(z=_>>3)*W+(T=4*(7&_)),H+z>=V&&(C-=W*(H+1+z-V)),d+T>=W&&(C-=d+T-W+4),v=U[C++],L=U[C++],A=U[C++],b[_]=(y[v]+y[L+256>>0]+y[A+512>>0]>>16)-128,g[_]=(y[v+768>>0]+y[L+1024>>0]+y[A+1280>>0]>>16)-128,N[_]=(y[v+1280>>0]+y[L+1536>>0]+y[A+1792>>0]>>16)-128;o=B(b,c,o,i,e),f=B(g,h,f,n,r),l=B(N,h,l,n,r),d+=32}H+=8}if(p>=0){var G=[];G[1]=p+1,G[0]=(1<<p+1)-1,F(G)}return O(65497),new Uint8Array(m)},t=t||50,function(){for(var t=String.fromCharCode,i=0;i<256;i++)L[i]=t(i)}(),i=I(k,S),n=I(M,j),e=I(x,q),r=I(E,P),function(){for(var t=1,i=2,n=1;n<=15;n++){for(var e=t;e<i;e++)l[32767+e]=n,f[32767+e]=[],f[32767+e][1]=n,f[32767+e][0]=e;for(var r=-(i-1);r<=-t;r++)l[32767+r]=n,f[32767+r]=[],f[32767+r][1]=n,f[32767+r][0]=i-1+r;t<<=1,i<<=1}}(),function(){for(var t=0;t<256;t++)y[t]=19595*t,y[t+256>>0]=38470*t,y[t+512>>0]=7471*t+32768,y[t+768>>0]=-11059*t,y[t+1024>>0]=-21709*t,y[t+1280>>0]=32768*t+8421375,y[t+1536>>0]=-27439*t,y[t+1792>>0]=-5329*t}(),D(t)}
242
+ */function pn(t){var i,n,e,r,s,o=Math.floor,a=new Array(64),u=new Array(64),c=new Array(64),h=new Array(64),f=new Array(65535),l=new Array(65535),d=new Array(64),v=new Array(64),m=[],w=0,p=7,b=new Array(64),g=new Array(64),N=new Array(64),L=new Array(256),y=new Array(2048),A=[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],M=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],j=[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 I(t,i){for(var n=0,e=0,r=new Array,s=1;s<=16;s++){for(var o=1;o<=t[s];o++)r[i[e]]=[],r[i[e]][0]=n,r[i[e]][1]=s,e++,n++;n*=2}return r}function O(t){for(var i=t[0],n=t[1]-1;n>=0;)i&1<<n&&(w|=1<<p),n--,--p<0&&(255==w?(F(255),F(0)):F(w),p=7,w=0)}function F(t){m.push(t)}function R(t){F(t>>8&255),F(255&t)}function B(t,i,n,e,r){for(var s,o=r[0],a=r[240],u=function(t,i){var n,e,r,s,o,a,u,c,h,f,l=0;for(h=0;h<8;++h){var v=(n=t[l])+(c=t[l+7]),m=n-c,w=(e=t[l+1])+(u=t[l+6]),p=e-u,b=(r=t[l+2])+(a=t[l+5]),g=r-a,N=(s=t[l+3])+(o=t[l+4]),L=s-o,y=v+N,A=v-N,k=w+b,S=w-b;t[l]=y+k,t[l+4]=y-k;var x=.707106781*(S+A);t[l+2]=A+x,t[l+6]=A-x;var q=.382683433*((y=L+g)-(S=p+m)),M=.5411961*y+q,j=1.306562965*S+q,E=.707106781*(k=g+p),P=m+E,I=m-E;t[l+5]=I+M,t[l+3]=I-M,t[l+1]=P+j,t[l+7]=P-j,l+=8}for(l=0,h=0;h<8;++h){var O=(n=t[l])+(c=t[l+56]),F=n-c,R=(e=t[l+8])+(u=t[l+48]),B=e-u,C=(r=t[l+16])+(a=t[l+40]),D=r-a,T=(s=t[l+24])+(o=t[l+32]),z=s-o,_=O+T,U=O-T,V=R+C,W=R-C;t[l]=_+V,t[l+32]=_-V;var H=.707106781*(W+U);t[l+16]=U+H,t[l+48]=U-H;var G=.382683433*((_=z+D)-(W=B+F)),J=.5411961*_+G,Y=1.306562965*W+G,K=.707106781*(V=D+B),X=F+K,$=F-K;t[l+40]=$+J,t[l+24]=$-J,t[l+8]=X+Y,t[l+56]=X-Y,l++}for(h=0;h<64;++h)d[h]=(f=t[h]*i[h])>0?f+.5|0:f-.5|0;return d}(t,i),c=0;c<64;++c)v[A[c]]=u[c];var h=v[0]-n;n=v[0],0==h?O(e[0]):(O(e[l[s=32767+h]]),O(f[s]));for(var m=63;m>0&&0==v[m];)m--;if(0==m)return O(o),n;for(var w,p=1;p<=m;){for(var b=p;0==v[p]&&p<=m;)++p;var g=p-b;if(g>=16){w=g>>4;for(var N=1;N<=w;++N)O(a);g&=15}O(r[(g<<4)+l[s=32767+v[p]]]),O(f[s]),p++}return 63!=m&&O(o),n}function C(t){t=Math.min(Math.max(t,1),100),s!=t&&(function(t){for(var i=[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],n=0;n<64;n++){var e=o((i[n]*t+50)/100);e=Math.min(Math.max(e,1),255),a[A[n]]=e}for(var r=[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 f=o((r[s]*t+50)/100);f=Math.min(Math.max(f,1),255),u[A[s]]=f}for(var l=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],d=0,v=0;v<8;v++)for(var m=0;m<8;m++)c[d]=1/(a[A[d]]*l[v]*l[m]*8),h[d]=1/(u[A[d]]*l[v]*l[m]*8),d++}(t<50?Math.floor(5e3/t):Math.floor(200-2*t)),s=t)}this.encode=function(t,s){s&&C(s),m=new Array,w=0,p=7,R(65496),R(65504),R(16),F(74),F(70),F(73),F(70),F(0),F(1),F(1),F(0),R(1),R(1),F(0),F(0),function(){R(65499),R(132),F(0);for(var t=0;t<64;t++)F(a[t]);F(1);for(var i=0;i<64;i++)F(u[i])}(),function(t,i){R(65472),R(17),F(8),R(i),R(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(){R(65476),R(418),F(0);for(var t=0;t<16;t++)F(k[t+1]);for(var i=0;i<=11;i++)F(S[i]);F(16);for(var n=0;n<16;n++)F(x[n+1]);for(var e=0;e<=161;e++)F(q[e]);F(1);for(var r=0;r<16;r++)F(M[r+1]);for(var s=0;s<=11;s++)F(j[s]);F(17);for(var o=0;o<16;o++)F(E[o+1]);for(var a=0;a<=161;a++)F(P[a])}(),R(65498),R(12),F(3),F(1),F(0),F(2),F(17),F(3),F(17),F(0),F(63),F(0);var o=0,f=0,l=0;w=0,p=7,this.encode.displayName="_encode_";for(var d,v,L,A,I,D,T,z,_,U=t.data,V=t.height,W=4*t.width,H=0;H<V;){for(d=0;d<W;){for(I=W*H+d,T=-1,z=0,_=0;_<64;_++)D=I+(z=_>>3)*W+(T=4*(7&_)),H+z>=V&&(D-=W*(H+1+z-V)),d+T>=W&&(D-=d+T-W+4),v=U[D++],L=U[D++],A=U[D++],b[_]=(y[v]+y[L+256>>0]+y[A+512>>0]>>16)-128,g[_]=(y[v+768>>0]+y[L+1024>>0]+y[A+1280>>0]>>16)-128,N[_]=(y[v+1280>>0]+y[L+1536>>0]+y[A+1792>>0]>>16)-128;o=B(b,c,o,i,e),f=B(g,h,f,n,r),l=B(N,h,l,n,r),d+=32}H+=8}if(p>=0){var G=[];G[1]=p+1,G[0]=(1<<p+1)-1,O(G)}return R(65497),new Uint8Array(m)},t=t||50,function(){for(var t=String.fromCharCode,i=0;i<256;i++)L[i]=t(i)}(),i=I(k,S),n=I(M,j),e=I(x,q),r=I(E,P),function(){for(var t=1,i=2,n=1;n<=15;n++){for(var e=t;e<i;e++)l[32767+e]=n,f[32767+e]=[],f[32767+e][1]=n,f[32767+e][0]=e;for(var r=-(i-1);r<=-t;r++)l[32767+r]=n,f[32767+r]=[],f[32767+r][1]=n,f[32767+r][0]=i-1+r;t<<=1,i<<=1}}(),function(){for(var t=0;t<256;t++)y[t]=19595*t,y[t+256>>0]=38470*t,y[t+512>>0]=7471*t+32768,y[t+768>>0]=-11059*t,y[t+1024>>0]=-21709*t,y[t+1280>>0]=32768*t+8421375,y[t+1536>>0]=-27439*t,y[t+1792>>0]=-5329*t}(),C(t)}
243
243
  /**
244
244
  * @license
245
245
  * Copyright (c) 2017 Aras Abbasi
246
246
  *
247
247
  * Licensed under the MIT License.
248
248
  * http://opensource.org/licenses/mit-license
249
- */function bn(t,i){if(this.pos=0,this.buffer=t,this.datav=new DataView(t.buffer),this.is_with_alpha=!!i,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 gn(t){function i(t){if(!t)throw Error("assert :P")}function n(t,i,n){for(var e=0;4>e;e++)if(t[i+e]!=n.charCodeAt(e))return!0;return!1}function e(t,i,n,e,r){for(var s=0;s<r;s++)t[i+s]=n[e+s]}function r(t,i,n,e){for(var r=0;r<e;r++)t[i+r]=n}function s(t){return new Int32Array(t)}function o(t,i){for(var n=[],e=0;e<t;e++)n.push(new i);return n}function a(t,i){var n=[];return function t(n,e,r){for(var s=r[e],o=0;o<s&&(n.push(r.length>e+1?[]:new i),!(r.length<e+1));o++)t(n[o],e+1,r)}(n,0,t),n}var u=function(){var t=this;function u(t,i){for(var n=1<<i-1>>>0;t&n;)n>>>=1;return n?(t&n-1)+n:t}function c(t,n,e,r,s){i(!(r%e));do{t[n+(r-=e)]=s}while(0<r)}function h(t,n,e,r,o){if(i(2328>=o),512>=o)var a=s(512);else if(null==(a=s(o)))return 0;return function(t,n,e,r,o,a){var h,l,d=n,v=1<<e,m=s(16),w=s(16);for(i(0!=o),i(null!=r),i(null!=t),i(0<e),l=0;l<o;++l){if(15<r[l])return 0;++m[r[l]]}if(m[0]==o)return 0;for(w[1]=0,h=1;15>h;++h){if(m[h]>1<<h)return 0;w[h+1]=w[h]+m[h]}for(l=0;l<o;++l)h=r[l],0<r[l]&&(a[w[h]++]=l);if(1==w[15])return(r=new f).g=0,r.value=a[0],c(t,d,1,v,r),v;var p,b=-1,g=v-1,N=0,L=1,y=1,A=1<<e;for(l=0,h=1,o=2;h<=e;++h,o<<=1){if(L+=y<<=1,0>(y-=m[h]))return 0;for(;0<m[h];--m[h])(r=new f).g=h,r.value=a[l++],c(t,d+N,o,A,r),N=u(N,h)}for(h=e+1,o=2;15>=h;++h,o<<=1){if(L+=y<<=1,0>(y-=m[h]))return 0;for(;0<m[h];--m[h]){if(r=new f,(N&g)!=b){for(d+=A,p=1<<(b=h)-e;15>b&&!(0>=(p-=m[b]));)++b,p<<=1;v+=A=1<<(p=b-e),t[n+(b=N&g)].g=p+e,t[n+b].value=d-n-b}r.g=h-e,r.value=a[l++],c(t,d+(N>>e),o,A,r),N=u(N,h)}}return L!=2*w[15]-1?0:v}(t,n,e,r,o,a)}function f(){this.value=this.g=0}function l(){this.value=this.g=0}function d(){this.G=o(5,f),this.H=s(5),this.jc=this.Qb=this.qb=this.nd=0,this.pd=o(Tn,l)}function v(t,n,e,r){i(null!=t),i(null!=n),i(2147483648>r),t.Ca=254,t.I=0,t.b=-8,t.Ka=0,t.oa=n,t.pa=e,t.Jd=n,t.Yc=e+r,t.Zc=4<=r?e+r-4+1:e,x(t)}function m(t,i){for(var n=0;0<i--;)n|=M(t,128)<<i;return n}function w(t,i){var n=m(t,i);return q(t)?-n:n}function p(t,n,e,r){var s,o=0;for(i(null!=t),i(null!=n),i(4294967288>r),t.Sb=r,t.Ra=0,t.u=0,t.h=0,4<r&&(r=4),s=0;s<r;++s)o+=n[e+s]<<8*s;t.Ra=o,t.bb=r,t.oa=n,t.pa=e}function b(t){for(;8<=t.u&&t.bb<t.Sb;)t.Ra>>>=8,t.Ra+=t.oa[t.pa+t.bb]<<Un-8>>>0,++t.bb,t.u-=8;A(t)&&(t.h=1,t.u=0)}function g(t,n){if(i(0<=n),!t.h&&n<=_n){var e=y(t)&zn[n];return t.u+=n,b(t),e}return t.h=1,t.u=0}function N(){this.b=this.Ca=this.I=0,this.oa=[],this.pa=0,this.Jd=[],this.Yc=0,this.Zc=[],this.Ka=0}function L(){this.Ra=0,this.oa=[],this.h=this.u=this.bb=this.Sb=this.pa=0}function y(t){return t.Ra>>>(t.u&Un-1)>>>0}function A(t){return i(t.bb<=t.Sb),t.h||t.bb==t.Sb&&t.u>Un}function k(t,i){t.u=i,t.h=A(t)}function S(t){t.u>=Vn&&(i(t.u>=Vn),b(t))}function x(t){i(null!=t&&null!=t.oa),t.pa<t.Zc?(t.I=(t.oa[t.pa++]|t.I<<8)>>>0,t.b+=8):(i(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 m(t,1)}function M(t,i){var n=t.Ca;0>t.b&&x(t);var e=t.b,r=n*i>>>8,s=(t.I>>>e>r)+0;for(s?(n-=r,t.I-=r+1<<e>>>0):n=r+1,e=n,r=0;256<=e;)r+=8,e>>=8;return t.b-=e=7^r+Wn[e],t.Ca=(n<<e)-1,s}function j(t,i,n){t[i+0]=n>>24&255,t[i+1]=n>>16&255,t[i+2]=n>>8&255,t[i+3]=n>>0&255}function E(t,i){return t[i+0]<<0|t[i+1]<<8}function P(t,i){return E(t,i)|t[i+2]<<16}function I(t,i){return E(t,i)|E(t,i+2)<<16}function F(t,n){var e=1<<n;return i(null!=t),i(0<n),t.X=s(e),null==t.X?0:(t.Mb=32-n,t.Xa=n,1)}function R(t,n){i(null!=t),i(null!=n),i(t.Xa==n.Xa),e(n.X,0,t.X,0,1<<n.Xa)}function O(){this.X=[],this.Xa=this.Mb=0}function B(t,n,e,r){i(null!=e),i(null!=r);var s=e[0],o=r[0];return 0==s&&(s=(t*o+n/2)/n),0==o&&(o=(n*s+t/2)/t),0>=s||0>=o?0:(e[0]=s,r[0]=o,1)}function D(t,i){return t+(1<<i)-1>>>i}function C(t,i){return((4278255360&t)+(4278255360&i)>>>0&4278255360)+((16711935&t)+(16711935&i)>>>0&16711935)>>>0}function T(i,n){t[n]=function(n,e,r,s,o,a,u){var c;for(c=0;c<o;++c){var h=t[i](a[u+c-1],r,s+c);a[u+c]=C(n[e+c],h)}}}function z(){this.ud=this.hd=this.jd=0}function _(t,i){return((4278124286&(t^i))>>>1)+(t&i)>>>0}function U(t){return 0<=t&&256>t?t:0>t?0:255<t?255:void 0}function V(t,i){return U(t+(t-i+.5>>1))}function W(t,i,n){return Math.abs(i-n)-Math.abs(t-n)}function H(t,i,n,e,r,s,o){for(e=s[o-1],n=0;n<r;++n)s[o+n]=e=C(t[i+n],e)}function G(t,i,n,e,r){var s;for(s=0;s<n;++s){var o=t[i+s],a=o>>8&255,u=16711935&(u=(u=16711935&o)+((a<<16)+a));e[r+s]=(4278255360&o)+u>>>0}}function J(t,i){i.jd=t>>0&255,i.hd=t>>8&255,i.ud=t>>16&255}function Y(t,i,n,e,r,s){var o;for(o=0;o<e;++o){var a=i[n+o],u=a>>>8,c=a,h=255&(h=(h=a>>>16)+((t.jd<<24>>24)*(u<<24>>24)>>>5));c=255&(c=(c+=(t.hd<<24>>24)*(u<<24>>24)>>>5)+((t.ud<<24>>24)*(h<<24>>24)>>>5)),r[s+o]=(4278255360&a)+(h<<16)+c}}function K(i,n,e,r,s){t[n]=function(t,i,n,e,o,a,u,c,h){for(e=u;e<c;++e)for(u=0;u<h;++u)o[a++]=s(n[r(t[i++])])},t[i]=function(i,n,o,a,u,c,h){var f=8>>i.b,l=i.Ea,d=i.K[0],v=i.w;if(8>f)for(i=(1<<i.b)-1,v=(1<<f)-1;n<o;++n){var m,w=0;for(m=0;m<l;++m)m&i||(w=r(a[u++])),c[h++]=s(d[w&v]),w>>=f}else t["VP8LMapColor"+e](a,u,d,v,c,h,n,o,l)}}function X(t,i,n,e,r){for(n=i+n;i<n;){var s=t[i++];e[r++]=s>>16&255,e[r++]=s>>8&255,e[r++]=s>>0&255}}function $(t,i,n,e,r){for(n=i+n;i<n;){var s=t[i++];e[r++]=s>>16&255,e[r++]=s>>8&255,e[r++]=s>>0&255,e[r++]=s>>24&255}}function Q(t,i,n,e,r){for(n=i+n;i<n;){var s=(o=t[i++])>>16&240|o>>12&15,o=o>>0&240|o>>28&15;e[r++]=s,e[r++]=o}}function Z(t,i,n,e,r){for(n=i+n;i<n;){var s=(o=t[i++])>>16&248|o>>13&7,o=o>>5&224|o>>3&31;e[r++]=s,e[r++]=o}}function tt(t,i,n,e,r){for(n=i+n;i<n;){var s=t[i++];e[r++]=s>>0&255,e[r++]=s>>8&255,e[r++]=s>>16&255}}function it(t,i,n,r,s,o){if(0==o)for(n=i+n;i<n;)j(r,((o=t[i++])[0]>>24|o[1]>>8&65280|o[2]<<8&16711680|o[3]<<24)>>>0),s+=32;else e(r,s,t,i,n)}function nt(i,n){t[n][0]=t[i+"0"],t[n][1]=t[i+"1"],t[n][2]=t[i+"2"],t[n][3]=t[i+"3"],t[n][4]=t[i+"4"],t[n][5]=t[i+"5"],t[n][6]=t[i+"6"],t[n][7]=t[i+"7"],t[n][8]=t[i+"8"],t[n][9]=t[i+"9"],t[n][10]=t[i+"10"],t[n][11]=t[i+"11"],t[n][12]=t[i+"12"],t[n][13]=t[i+"13"],t[n][14]=t[i+"0"],t[n][15]=t[i+"0"]}function et(t){return t==Ve||t==We||t==He||t==Ge}function rt(){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 rt,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 ct(t){return alert("todo:WebPSamplerProcessPlane"),t.T}function ht(t,i){var n=t.T,r=i.ba.f.RGBA,s=r.eb,o=r.fb+t.ka*r.A,a=pr[i.ba.S],u=t.y,c=t.O,h=t.f,f=t.N,l=t.ea,d=t.W,v=i.cc,m=i.dc,w=i.Mc,p=i.Nc,b=t.ka,g=t.ka+t.T,N=t.U,L=N+1>>1;for(0==b?a(u,c,null,null,h,f,l,d,h,f,l,d,s,o,null,null,N):(a(i.ec,i.fc,u,c,v,m,w,p,h,f,l,d,s,o-r.A,s,o,N),++n);b+2<g;b+=2)a(u,(c+=2*t.fa)-t.fa,u,c,v=h,m=f,w=l,p=d,h,f+=t.Rc,l,d+=t.Rc,s,(o+=2*r.A)-r.A,s,o,N);return c+=t.fa,t.j+g<t.o?(e(i.ec,i.fc,u,c,N),e(i.cc,i.dc,h,f,L),e(i.Mc,i.Nc,l,d,L),n--):1&g||a(u,c,null,null,h,f,l,d,h,f,l,d,s,o+r.A,null,null,N),n}function ft(t,n,e){var r=t.F,s=[t.J];if(null!=r){var o=t.U,a=n.ba.S,u=a==ze||a==He;n=n.ba.f.RGBA;var c=[0],h=t.ka;c[0]=t.T,t.Kb&&(0==h?--c[0]:(--h,s[0]-=t.width),t.j+t.ka+t.T==t.o&&(c[0]=t.o-t.j-h));var f=n.eb;t=Se(r,s[0],t.width,o,c,f,(h=n.fb+h*n.A)+(u?0:3),n.A),i(e==c),t&&et(a)&&Ae(f,h,u,o,c,n.A)}return 0}function lt(t){var i=t.ma,n=i.ba.S,e=11>n,r=n==De||n==Te||n==ze||n==_e||12==n||et(n);if(i.memory=null,i.Ib=null,i.Jb=null,i.Nd=null,!Bn(i.Oa,t,r?11:12))return 0;if(r&&et(n)&&gn(),t.da)alert("todo:use_scaling");else{if(e){if(i.Ib=ct,t.Kb){if(i.memory=s(t.U+2*(n=t.U+1>>1)),null==i.memory)return 0;i.ec=i.memory,i.fc=0,i.cc=i.ec,i.dc=i.fc+t.U,i.Mc=i.cc,i.Nc=i.dc+n,i.Ib=ht,gn()}}else alert("todo:EmitYUV");r&&(i.Jb=ft,e&&pn())}if(e&&!Pr){for(t=0;256>t;++t)Ir[t]=89858*(t-128)+xr>>Sr,Or[t]=-22014*(t-128)+xr,Rr[t]=-45773*(t-128),Fr[t]=113618*(t-128)+xr>>Sr;for(t=qr;t<Mr;++t)Br[t-qr]=Ht(i=76283*(t-16)+xr>>Sr,255),Dr[t-qr]=Ht(i+8>>4,15);Pr=1}return 1}function dt(t){var n=t.ma,e=t.U,r=t.T;return i(!(1&t.ka)),0>=e||0>=r?0:(e=n.Ib(t,n),null!=n.Jb&&n.Jb(t,n,e),n.Dc+=e,1)}function vt(t){t.ma.memory=null}function mt(t,i,n,e){return 47!=g(t,8)?0:(i[0]=g(t,14)+1,n[0]=g(t,14)+1,e[0]=g(t,1),0!=g(t,3)?0:!t.h)}function wt(t,i){if(4>t)return t+1;var n=t-2>>1;return(2+(1&t)<<n)+g(i,n)+1}function pt(t,i){return 120<i?i-120:1<=(n=((n=Qe[i-1])>>4)*t+(8-(15&n)))?n:1;var n}function bt(t,i,n){var e=y(n),r=t[i+=255&e].g-8;return 0<r&&(k(n,n.u+8),e=y(n),i+=t[i].value,i+=e&(1<<r)-1),k(n,n.u+t[i].g),t[i].value}function gt(t,n,e){return e.g+=t.g,e.value+=t.value<<n>>>0,i(8>=e.g),t.g}function Nt(t,n,e){var r=t.xc;return i((n=0==r?0:t.vc[t.md*(e>>r)+(n>>r)])<t.Wb),t.Ya[n]}function Lt(t,n,r,s){var o=t.ab,a=t.c*n,u=t.C;n=u+n;var c=r,h=s;for(s=t.Ta,r=t.Ua;0<o--;){var f=t.gc[o],l=u,d=n,v=c,m=h,w=(h=s,c=r,f.Ea);switch(i(l<d),i(d<=f.nc),f.hc){case 2:Jn(v,m,(d-l)*w,h,c);break;case 0:var p=l,b=d,g=h,N=c,L=(x=f).Ea;0==p&&(Hn(v,m,null,null,1,g,N),H(v,m+1,0,0,L-1,g,N+1),m+=L,N+=L,++p);for(var y=1<<x.b,A=y-1,k=D(L,x.b),S=x.K,x=x.w+(p>>x.b)*k;p<b;){var q=S,M=x,j=1;for(Gn(v,m,g,N-L,1,g,N);j<L;){var E=(j&~A)+y;E>L&&(E=L),(0,Qn[q[M++]>>8&15])(v,m+ +j,g,N+j-L,E-j,g,N+j),j=E}m+=L,N+=L,++p&A||(x+=k)}d!=f.nc&&e(h,c-w,h,c+(d-l-1)*w,w);break;case 1:for(w=v,b=m,L=(v=f.Ea)-(N=v&~(g=(m=1<<f.b)-1)),p=D(v,f.b),y=f.K,f=f.w+(l>>f.b)*p;l<d;){for(A=y,k=f,S=new z,x=b+N,q=b+v;b<x;)J(A[k++],S),Zn(S,w,b,m,h,c),b+=m,c+=m;b<q&&(J(A[k++],S),Zn(S,w,b,L,h,c),b+=L,c+=L),++l&g||(f+=p)}break;case 3:if(v==h&&m==c&&0<f.b){for(b=h,v=w=c+(d-l)*w-(N=(d-l)*D(f.Ea,f.b)),m=h,g=c,p=[],N=(L=N)-1;0<=N;--N)p[N]=m[g+N];for(N=L-1;0<=N;--N)b[v+N]=p[N];Yn(f,l,d,h,w,h,c)}else Yn(f,l,d,v,m,h,c)}c=s,h=r}h!=r&&e(s,r,c,h,a)}function yt(t,n){var e=t.V,r=t.Ba+t.c*t.C,s=n-t.C;if(i(n<=t.l.o),i(16>=s),0<s){var o=t.l,a=t.Ta,u=t.Ua,c=o.width;if(Lt(t,s,e,r),s=u=[u],i((e=t.C)<(r=n)),i(o.v<o.va),r>o.o&&(r=o.o),e<o.j){var h=o.j-e;e=o.j,s[0]+=h*c}if(e>=r?e=0:(s[0]+=4*o.v,o.ka=e-o.j,o.U=o.va-o.v,o.T=r-e,e=1),e){if(u=u[0],11>(e=t.ca).S){var f=e.f.RGBA,l=(r=e.S,s=o.U,o=o.T,h=f.eb,f.A),d=o;for(f=f.fb+t.Ma*f.A;0<d--;){var v=a,m=u,w=s,p=h,b=f;switch(r){case Be:te(v,m,w,p,b);break;case De:ie(v,m,w,p,b);break;case Ve:ie(v,m,w,p,b),Ae(p,b,0,w,1,0);break;case Ce:re(v,m,w,p,b);break;case Te:it(v,m,w,p,b,1);break;case We:it(v,m,w,p,b,1),Ae(p,b,0,w,1,0);break;case ze:it(v,m,w,p,b,0);break;case He:it(v,m,w,p,b,0),Ae(p,b,1,w,1,0);break;case _e:ne(v,m,w,p,b);break;case Ge:ne(v,m,w,p,b),ke(p,b,w,1,0);break;case Ue:ee(v,m,w,p,b);break;default:i(0)}u+=c,f+=l}t.Ma+=o}else alert("todo:EmitRescaledRowsYUVA");i(t.Ma<=e.height)}}t.C=n,i(t.C<=t.i)}function At(t){var i;if(0<t.ua)return 0;for(i=0;i<t.Wb;++i){var n=t.Ya[i].G,e=t.Ya[i].H;if(0<n[1][e[1]+0].g||0<n[2][e[2]+0].g||0<n[3][e[3]+0].g)return 0}return 1}function kt(t,n,e,r,s,o){if(0!=t.Z){var a=t.qd,u=t.rd;for(i(null!=wr[t.Z]);n<e;++n)wr[t.Z](a,u,r,s,r,s,o),a=r,u=s,s+=o;t.qd=a,t.rd=u}}function St(t,n){var e=t.l.ma,r=0==e.Z||1==e.Z?t.l.j:t.C;if(r=t.C<r?r:t.C,i(n<=t.l.o),n>r){var s=t.l.width,o=e.ca,a=e.tb+s*r,u=t.V,c=t.Ba+t.c*r,h=t.gc;i(1==t.ab),i(3==h[0].hc),Xn(h[0],r,n,u,c,o,a),kt(e,r,n,o,a,s)}t.C=t.Ma=n}function xt(t,n,e,r,s,o,a){var u=t.$/r,c=t.$%r,h=t.m,f=t.s,l=e+t.$,d=l;s=e+r*s;var v=e+r*o,m=280+f.ua,w=t.Pb?u:16777216,p=0<f.ua?f.Wa:null,b=f.wc,g=l<v?Nt(f,c,u):null;i(t.C<o),i(v<=s);var N=!1;t:for(;;){for(;N||l<v;){var L=0;if(u>=w){var x=l-e;i((w=t).Pb),w.wd=w.m,w.xd=x,0<w.s.ua&&R(w.s.Wa,w.s.vb),w=u+tr}if(c&b||(g=Nt(f,c,u)),i(null!=g),g.Qb&&(n[l]=g.qb,N=!0),!N)if(S(h),g.jc){x=n;var q=l,M=g.pd[y(L=h)&Tn-1];i(g.jc),256>M.g?(k(L,L.u+M.g),x[q]=M.value,L=0):(k(L,L.u+M.g-256),i(256<=M.value),L=M.value),0==L&&(N=!0)}else L=bt(g.G[0],g.H[0],h);if(h.h)break;if(N||256>L){if(!N)if(g.nd)n[l]=(g.qb|L<<8)>>>0;else{if(S(h),N=bt(g.G[1],g.H[1],h),S(h),x=bt(g.G[2],g.H[2],h),q=bt(g.G[3],g.H[3],h),h.h)break;n[l]=(q<<24|N<<16|L<<8|x)>>>0}if(N=!1,++l,++c>=r&&(c=0,++u,null!=a&&u<=o&&!(u%16)&&a(t,u),null!=p))for(;d<l;)L=n[d++],p.X[(506832829*L&4294967295)>>>p.Mb]=L}else if(280>L){if(L=wt(L-256,h),x=bt(g.G[4],g.H[4],h),S(h),x=pt(r,x=wt(x,h)),h.h)break;if(l-e<x||s-l<L)break t;for(q=0;q<L;++q)n[l+q]=n[l+q-x];for(l+=L,c+=L;c>=r;)c-=r,++u,null!=a&&u<=o&&!(u%16)&&a(t,u);if(i(l<=s),c&b&&(g=Nt(f,c,u)),null!=p)for(;d<l;)L=n[d++],p.X[(506832829*L&4294967295)>>>p.Mb]=L}else{if(!(L<m))break t;for(N=L-280,i(null!=p);d<l;)L=n[d++],p.X[(506832829*L&4294967295)>>>p.Mb]=L;L=l,i(!(N>>>(x=p).Xa)),n[L]=x.X[N],N=!0}N||i(h.h==A(h))}if(t.Pb&&h.h&&l<s)i(t.m.h),t.a=5,t.m=t.wd,t.$=t.xd,0<t.s.ua&&R(t.s.vb,t.s.Wa);else{if(h.h)break t;null!=a&&a(t,u>o?o:u),t.a=0,t.$=l-e}return 1}return t.a=3,0}function qt(t){i(null!=t),t.vc=null,t.yc=null,t.Ya=null;var n=t.Wa;null!=n&&(n.X=null),t.vb=null,i(null!=t)}function Mt(){var i=new an;return null==i?null:(i.a=0,i.xb=mr,nt("Predictor","VP8LPredictors"),nt("Predictor","VP8LPredictors_C"),nt("PredictorAdd","VP8LPredictorsAdd"),nt("PredictorAdd","VP8LPredictorsAdd_C"),Jn=G,Zn=Y,te=X,ie=$,ne=Q,ee=Z,re=tt,t.VP8LMapColor32b=Kn,t.VP8LMapColor8b=$n,i)}function jt(t,n,e,a,u){var c=1,l=[t],v=[n],m=a.m,w=a.s,p=null,b=0;t:for(;;){if(e)for(;c&&g(m,1);){var N=l,L=v,A=a,x=1,q=A.m,M=A.gc[A.ab],j=g(q,2);if(A.Oc&1<<j)c=0;else{switch(A.Oc|=1<<j,M.hc=j,M.Ea=N[0],M.nc=L[0],M.K=[null],++A.ab,i(4>=A.ab),j){case 0:case 1:M.b=g(q,3)+2,x=jt(D(M.Ea,M.b),D(M.nc,M.b),0,A,M.K),M.K=M.K[0];break;case 3:var E,P=g(q,8)+1,I=16<P?0:4<P?1:2<P?2:3;if(N[0]=D(M.Ea,I),M.b=I,E=x=jt(P,1,0,A,M.K)){var R,O=P,B=M,T=1<<(8>>B.b),z=s(T);if(null==z)E=0;else{var _=B.K[0],U=B.w;for(z[0]=B.K[0][0],R=1;R<1*O;++R)z[R]=C(_[U+R],z[R-1]);for(;R<4*T;++R)z[R]=0;B.K[0]=null,B.K[0]=z,E=1}}x=E;break;case 2:break;default:i(0)}c=x}}if(l=l[0],v=v[0],c&&g(m,1)&&!(c=1<=(b=g(m,4))&&11>=b)){a.a=3;break t}var V;if(V=c)i:{var W,H,G,J=a,Y=l,K=v,X=b,$=e,Q=J.m,Z=J.s,tt=[null],it=1,nt=0,et=Ze[X];n:for(;;){if($&&g(Q,1)){var rt=g(Q,3)+2,st=D(Y,rt),ot=D(K,rt),at=st*ot;if(!jt(st,ot,0,J,tt))break n;for(tt=tt[0],Z.xc=rt,W=0;W<at;++W){var ut=tt[W]>>8&65535;tt[W]=ut,ut>=it&&(it=ut+1)}}if(Q.h)break n;for(H=0;5>H;++H){var ct=Ke[H];!H&&0<X&&(ct+=1<<X),nt<ct&&(nt=ct)}var ht=o(it*et,f),ft=it,lt=o(ft,d);if(null==lt)var dt=null;else i(65536>=ft),dt=lt;var vt=s(nt);if(null==dt||null==vt||null==ht){J.a=1;break n}var mt=ht;for(W=G=0;W<it;++W){var wt=dt[W],pt=wt.G,bt=wt.H,Nt=0,Lt=1,yt=0;for(H=0;5>H;++H){ct=Ke[H],pt[H]=mt,bt[H]=G,!H&&0<X&&(ct+=1<<X);e:{var At,kt=ct,St=J,Mt=vt,Et=mt,Pt=G,It=0,Ft=St.m,Rt=g(Ft,1);if(r(Mt,0,0,kt),Rt){var Ot=g(Ft,1)+1,Bt=g(Ft,1),Dt=g(Ft,0==Bt?1:8);Mt[Dt]=1,2==Ot&&(Mt[Dt=g(Ft,8)]=1);var Ct=1}else{var Tt=s(19),zt=g(Ft,4)+4;if(19<zt){St.a=3;var _t=0;break e}for(At=0;At<zt;++At)Tt[$e[At]]=g(Ft,3);var Ut=void 0,Vt=void 0,Wt=St,Ht=Tt,Gt=kt,Jt=Mt,Yt=0,Kt=Wt.m,Xt=8,$t=o(128,f);r:for(;h($t,0,7,Ht,19);){if(g(Kt,1)){var Qt=2+2*g(Kt,3);if((Ut=2+g(Kt,Qt))>Gt)break r}else Ut=Gt;for(Vt=0;Vt<Gt&&Ut--;){S(Kt);var Zt=$t[0+(127&y(Kt))];k(Kt,Kt.u+Zt.g);var ti=Zt.value;if(16>ti)Jt[Vt++]=ti,0!=ti&&(Xt=ti);else{var ii=16==ti,ni=ti-16,ei=Ye[ni],ri=g(Kt,Je[ni])+ei;if(Vt+ri>Gt)break r;for(var si=ii?Xt:0;0<ri--;)Jt[Vt++]=si}}Yt=1;break r}Yt||(Wt.a=3),Ct=Yt}(Ct=Ct&&!Ft.h)&&(It=h(Et,Pt,8,Mt,kt)),Ct&&0!=It?_t=It:(St.a=3,_t=0)}if(0==_t)break n;if(Lt&&1==Xe[H]&&(Lt=0==mt[G].g),Nt+=mt[G].g,G+=_t,3>=H){var oi,ai=vt[0];for(oi=1;oi<ct;++oi)vt[oi]>ai&&(ai=vt[oi]);yt+=ai}}if(wt.nd=Lt,wt.Qb=0,Lt&&(wt.qb=(pt[3][bt[3]+0].value<<24|pt[1][bt[1]+0].value<<16|pt[2][bt[2]+0].value)>>>0,0==Nt&&256>pt[0][bt[0]+0].value&&(wt.Qb=1,wt.qb+=pt[0][bt[0]+0].value<<8)),wt.jc=!wt.Qb&&6>yt,wt.jc){var ui,ci=wt;for(ui=0;ui<Tn;++ui){var hi=ui,fi=ci.pd[hi],li=ci.G[0][ci.H[0]+hi];256<=li.value?(fi.g=li.g+256,fi.value=li.value):(fi.g=0,fi.value=0,hi>>=gt(li,8,fi),hi>>=gt(ci.G[1][ci.H[1]+hi],16,fi),hi>>=gt(ci.G[2][ci.H[2]+hi],0,fi),gt(ci.G[3][ci.H[3]+hi],24,fi))}}}Z.vc=tt,Z.Wb=it,Z.Ya=dt,Z.yc=ht,V=1;break i}V=0}if(!(c=V)){a.a=3;break t}if(0<b){if(w.ua=1<<b,!F(w.Wa,b)){a.a=1,c=0;break t}}else w.ua=0;var di=a,vi=l,mi=v,wi=di.s,pi=wi.xc;if(di.c=vi,di.i=mi,wi.md=D(vi,pi),wi.wc=0==pi?-1:(1<<pi)-1,e){a.xb=vr;break t}if(null==(p=s(l*v))){a.a=1,c=0;break t}c=(c=xt(a,p,0,l,v,v,null))&&!m.h;break t}return c?(null!=u?u[0]=p:(i(null==p),i(e)),a.$=0,e||qt(w)):qt(w),c}function Et(t,n){var e=t.c*t.i,r=e+n+16*n;return i(t.c<=n),t.V=s(r),null==t.V?(t.Ta=null,t.Ua=0,t.a=1,0):(t.Ta=t.V,t.Ua=t.Ba+e+n,1)}function Pt(t,n){var e=t.C,r=n-e,s=t.V,o=t.Ba+t.c*e;for(i(n<=t.l.o);0<r;){var a=16<r?16:r,u=t.l.ma,c=t.l.width,h=c*a,f=u.ca,l=u.tb+c*e,d=t.Ta,v=t.Ua;Lt(t,a,s,o),xe(d,v,f,l,h),kt(u,e,e+a,f,l,c),r-=a,s+=a*t.c,e+=a}i(e==n),t.C=t.Ma=n}function It(){this.ub=this.yd=this.td=this.Rb=0}function Ft(){this.Kd=this.Ld=this.Ud=this.Td=this.i=this.c=0}function Rt(){this.Fb=this.Bb=this.Cb=0,this.Zb=s(4),this.Lb=s(4)}function Ot(){this.Yb=function(){var t=[];return function t(i,n,e){for(var r=e[n],s=0;s<r&&(i.push(e.length>n+1?[]:0),!(e.length<n+1));s++)t(i[s],n+1,e)}(t,0,[3,11]),t}()}function Bt(){this.jb=s(3),this.Wc=a([4,8],Ot),this.Xc=a([4,17],Ot)}function Dt(){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 Tt(){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 _t(){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 Ut(){this.uc=this.M=this.Nb=0,this.wa=Array(new Ct),this.Y=0,this.ya=Array(new _t),this.aa=0,this.l=new Gt}function Vt(){this.y=s(16),this.f=s(8),this.ea=s(8)}function Wt(){this.cb=this.a=0,this.sc="",this.m=new N,this.Od=new It,this.Kc=new Ft,this.ed=new Dt,this.Qa=new Rt,this.Ic=this.$c=this.Aa=0,this.D=new Ut,this.Xb=this.Va=this.Hb=this.zb=this.yb=this.Ub=this.za=0,this.Jc=o(8,N),this.ia=0,this.pb=o(4,zt),this.Pa=new Bt,this.Bd=this.kc=0,this.Ac=[],this.Bc=0,this.zc=[0,0,0,0],this.Gd=Array(new Vt),this.Hd=0,this.rb=Array(new Tt),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 _t),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,i){return 0>t?0:t>i?i: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 Wt;return null!=t&&(t.a=0,t.sc="OK",t.cb=0,t.Xb=0,er||(er=$t)),t}function Yt(t,i,n){return 0==t.a&&(t.a=i,t.sc=n,t.cb=0),0}function Kt(t,i,n){return 3<=n&&157==t[i+0]&&1==t[i+1]&&42==t[i+2]}function Xt(t,n){if(null==t)return 0;if(t.a=0,t.sc="OK",null==n)return Yt(t,2,"null VP8Io passed to VP8GetHeaders()");var e=n.data,s=n.w,o=n.ha;if(4>o)return Yt(t,7,"Truncated header.");var a=e[s+0]|e[s+1]<<8|e[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 c=t.Kc;if(u.Rb){if(7>o)return Yt(t,7,"cannot parse picture header");if(!Kt(e,s,o))return Yt(t,3,"Bad code word");c.c=16383&(e[s+4]<<8|e[s+3]),c.Td=e[s+4]>>6,c.i=16383&(e[s+6]<<8|e[s+5]),c.Ud=e[s+6]>>6,s+=7,o-=7,t.za=c.c+15>>4,t.Ub=c.i+15>>4,n.width=c.c,n.height=c.i,n.Da=0,n.j=0,n.v=0,n.va=n.width,n.o=n.height,n.da=0,n.ib=n.width,n.hb=n.height,n.U=n.width,n.T=n.height,r((a=t.Pa).jb,0,255,a.jb.length),i(null!=(a=t.Qa)),a.Cb=0,a.Bb=0,a.Fb=1,r(a.Zb,0,0,a.Zb.length),r(a.Lb,0,0,a.Lb)}if(u.ub>o)return Yt(t,7,"bad partition length");v(a=t.m,e,s,u.ub),s+=u.ub,o-=u.ub,u.Rb&&(c.Ld=q(a),c.Kd=q(a)),c=t.Qa;var h,f=t.Pa;if(i(null!=a),i(null!=c),c.Cb=q(a),c.Cb){if(c.Bb=q(a),q(a)){for(c.Fb=q(a),h=0;4>h;++h)c.Zb[h]=q(a)?w(a,7):0;for(h=0;4>h;++h)c.Lb[h]=q(a)?w(a,6):0}if(c.Bb)for(h=0;3>h;++h)f.jb[h]=q(a)?m(a,8):255}else c.Bb=0;if(a.Ka)return Yt(t,3,"cannot parse segment header");if((c=t.ed).zd=q(a),c.Tb=m(a,6),c.wb=m(a,3),c.Pc=q(a),c.Pc&&q(a)){for(f=0;4>f;++f)q(a)&&(c.vd[f]=w(a,6));for(f=0;4>f;++f)q(a)&&(c.od[f]=w(a,6))}if(t.L=0==c.Tb?0:c.zd?1:2,a.Ka)return Yt(t,3,"cannot parse filter header");var l=o;if(o=h=s,s=h+l,c=l,t.Xb=(1<<m(t.m,2))-1,l<3*(f=t.Xb))e=7;else{for(h+=3*f,c-=3*f,l=0;l<f;++l){var d=e[o+0]|e[o+1]<<8|e[o+2]<<16;d>c&&(d=c),v(t.Jc[+l],e,h,d),h+=d,c-=d,o+=3}v(t.Jc[+f],e,h,c),e=h<s?0:5}if(0!=e)return Yt(t,e,"cannot parse partitions");for(e=m(h=t.m,7),o=q(h)?w(h,4):0,s=q(h)?w(h,4):0,c=q(h)?w(h,4):0,f=q(h)?w(h,4):0,h=q(h)?w(h,4):0,l=t.Qa,d=0;4>d;++d){if(l.Cb){var p=l.Zb[d];l.Fb||(p+=e)}else{if(0<d){t.pb[d]=t.pb[0];continue}p=e}var b=t.pb[d];b.Sc[0]=ir[Ht(p+o,127)],b.Sc[1]=nr[Ht(p+0,127)],b.Eb[0]=2*ir[Ht(p+s,127)],b.Eb[1]=101581*nr[Ht(p+c,127)]>>16,8>b.Eb[1]&&(b.Eb[1]=8),b.Qc[0]=ir[Ht(p+f,117)],b.Qc[1]=nr[Ht(p+h,127)],b.lc=p+h}if(!u.Rb)return Yt(t,4,"Not a key frame.");for(q(a),u=t.Pa,e=0;4>e;++e){for(o=0;8>o;++o)for(s=0;3>s;++s)for(c=0;11>c;++c)f=M(a,cr[e][o][s][c])?m(a,8):ar[e][o][s][c],u.Wc[e][o].Yb[s][c]=f;for(o=0;17>o;++o)u.Xc[e][o]=u.Wc[e][hr[o]]}return t.kc=q(a),t.kc&&(t.Bd=m(a,8)),t.cb=1}function $t(t,i,n,e,r,s,o){var a=i[r].Yb[n];for(n=0;16>r;++r){if(!M(t,a[n+0]))return r;for(;!M(t,a[n+1]);)if(a=i[++r].Yb[0],n=0,16==r)return 16;var u=i[r+1].Yb;if(M(t,a[n+2])){var c=t,h=0;if(M(c,(l=a)[(f=n)+3]))if(M(c,l[f+6])){for(a=0,f=2*(h=M(c,l[f+8]))+(l=M(c,l[f+9+h])),h=0,l=rr[f];l[a];++a)h+=h+M(c,l[a]);h+=3+(8<<f)}else M(c,l[f+7])?(h=7+2*M(c,165),h+=M(c,145)):h=5+M(c,159);else h=M(c,l[f+4])?3+M(c,l[f+5]):2;a=u[2]}else h=1,a=u[1];u=o+sr[r],0>(c=t).b&&x(c);var f,l=c.b,d=(f=c.Ca>>1)-(c.I>>l)>>31;--c.b,c.Ca+=d,c.Ca|=1,c.I-=(f+1&d)<<l,s[u]=((h^d)-d)*e[(0<r)+0]}return 16}function Qt(t){var i=t.rb[t.sb-1];i.la=0,i.Na=0,r(t.zc,0,0,t.zc.length),t.ja=0}function Zt(t,n){if(null==t)return 0;if(null==n)return Yt(t,2,"NULL VP8Io parameter in VP8Decode().");if(!t.cb&&!Xt(t,n))return 0;if(i(t.cb),null==n.ac||n.ac(n)){n.ob&&(t.L=0);var a=Tr[t.L];if(2==t.L?(t.yb=0,t.zb=0):(t.yb=n.v-a>>4,t.zb=n.j-a>>4,0>t.yb&&(t.yb=0),0>t.zb&&(t.zb=0)),t.Va=n.o+15+a>>4,t.Hb=n.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 c;if(t.Qa.Cb){var h=t.Qa.Lb[a];t.Qa.Fb||(h+=u.Tb)}else h=u.Tb;for(c=0;1>=c;++c){var f=t.gd[a][c],l=h;if(u.Pc&&(l+=u.vd[0],c&&(l+=u.od[0])),0<(l=0>l?0:63<l?63:l)){var d=l;0<u.wb&&(d=4<u.wb?d>>2:d>>1)>9-u.wb&&(d=9-u.wb),1>d&&(d=1),f.dd=d,f.tc=2*l+d,f.ld=40<=l?2:15<=l?1:0}else f.tc=0;f.La=c}}}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=_r);t:{u=4*(d=t.za);var v=32*d,m=d+1,w=0<t.L?d*(0<t.Aa?2:1):0,p=(2==t.Aa?2:1)*d;if((f=u+832+(c=3*(16*(a=t.Ic)+Tr[t.L])/2*v)+(h=null!=t.Fa&&0<t.Fa.length?t.Kc.c*t.Kc.i:0))!=f)a=0;else{if(f>t.Vb){if(t.Vb=0,t.Ec=s(f),t.Fc=0,null==t.Ec){a=Yt(t,1,"no memory during frame initialization.");break t}t.Vb=f}l=t.Fc,t.Ac=f=t.Ec,t.Bc=l,l+=u,t.Gd=o(v,Vt),t.Hd=0,t.rb=o(m+1,Tt),t.sb=1,t.wa=w?o(w,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+=d),i(!0),t.oc=f,t.pc=l,l+=832,t.ya=o(p,_t),t.aa=0,t.D.ya=t.ya,t.D.aa=t.aa,2==t.Aa&&(t.D.aa+=d),t.R=16*d,t.B=8*d,d=(v=Tr[t.L])*t.R,v=v/2*t.B,t.sa=f,t.ta=l+d,t.qa=t.sa,t.ra=t.ta+16*a*t.R+v,t.Ha=t.qa,t.Ia=t.ra+8*a*t.B+v,t.$c=0,l+=c,t.mb=h?f:null,t.nb=h?l:null,i(l+h<=t.Fc+t.Vb),Qt(t),r(t.Ac,t.Bc,0,u),a=1}}if(a){if(n.ka=0,n.y=t.sa,n.O=t.ta,n.f=t.qa,n.N=t.ra,n.ea=t.Ha,n.Vd=t.Ia,n.fa=t.R,n.Rc=t.B,n.F=null,n.J=0,!Pe){for(a=-255;255>=a;++a)qe[255+a]=0>a?-a:a;for(a=-1020;1020>=a;++a)Me[1020+a]=-128>a?-128:127<a?127:a;for(a=-112;112>=a;++a)je[112+a]=-16>a?-16:15<a?15:a;for(a=-255;510>=a;++a)Ee[255+a]=0>a?0:255<a?255:a;Pe=1}se=ci,oe=si,ue=oi,ce=ai,he=ui,ae=ri,fe=Yi,le=Ki,de=Qi,ve=Zi,me=Xi,we=$i,pe=tn,be=nn,ge=Ui,Ne=Vi,Le=Wi,ye=Hi,lr[0]=ki,lr[1]=fi,lr[2]=yi,lr[3]=Ai,lr[4]=Si,lr[5]=qi,lr[6]=xi,lr[7]=Mi,lr[8]=Ei,lr[9]=ji,fr[0]=pi,fr[1]=di,fr[2]=vi,fr[3]=mi,fr[4]=bi,fr[5]=gi,fr[6]=Ni,dr[0]=Ri,dr[1]=li,dr[2]=Pi,dr[3]=Ii,dr[4]=Bi,dr[5]=Oi,dr[6]=Di,a=1}else a=0}a&&(a=function(t,n){for(t.M=0;t.M<t.Va;++t.M){var o,a=t.Jc[t.M&t.Xb],u=t.m,c=t;for(o=0;o<c.za;++o){var h=u,f=c,l=f.Ac,d=f.Bc+4*o,v=f.zc,m=f.ya[f.aa+o];if(m.$b=f.Qa.Bb?M(h,f.Pa.jb[0])?2+M(h,f.Pa.jb[2]):M(h,f.Pa.jb[1]):0,f.kc&&(m.Ad=M(h,f.Bd)),m.Za=!M(h,145)+0,m.Za){var w=m.Ob,p=0;for(f=0;4>f;++f){var b,g=v[0+f];for(b=0;4>b;++b){for(var N=or[M(h,(g=ur[l[d+b]][g])[0])];0<N;)N=or[2*N+M(h,g[N])];l[d+b]=g=-N}e(w,p,l,d,4),p+=4,v[0+f]=g}}else g=M(h,156)?M(h,128)?1:3:M(h,163)?2:0,m.Ob[0]=g,r(l,d,g,4),r(v,0,g,4);m.Dd=M(h,142)?M(h,114)?M(h,183)?1:3:2:0}if(c.m.Ka)return Yt(t,7,"Premature end-of-partition0 encountered.");for(;t.ja<t.za;++t.ja){if(c=a,h=(u=t).rb[u.sb-1],l=u.rb[u.sb+u.ja],o=u.ya[u.aa+u.ja],d=u.kc?o.Ad:0)h.la=l.la=0,o.Za||(h.Na=l.Na=0),o.Hc=0,o.Gc=0,o.ia=0;else{var L,y;if(h=l,l=c,d=u.Pa.Xc,m=u.pb[(v=u.ya[u.aa+u.ja]).$b],p=u.rb[u.sb-1],g=b=0,r(f=v.ad,w=0,0,384),v.Za)var A=0,k=d[3];else{N=s(16);var S=h.Na+p.Na;if(S=er(l,d[1],S,m.Eb,0,N,0),h.Na=p.Na=(0<S)+0,1<S)se(N,0,f,w);else{var x=N[0]+3>>3;for(N=0;256>N;N+=16)f[w+N]=x}A=1,k=d[0]}var q=15&h.la,j=15&p.la;for(N=0;4>N;++N){var E=1&j;for(x=y=0;4>x;++x)q=q>>1|(E=(S=er(l,k,S=E+(1&q),m.Sc,A,f,w))>A)<<7,y=y<<2|(3<S?3:1<S?2:0!=f[w+0]),w+=16;q>>=4,j=j>>1|E<<7,b=(b<<8|y)>>>0}for(k=q,A=j>>4,L=0;4>L;L+=2){for(y=0,q=h.la>>4+L,j=p.la>>4+L,N=0;2>N;++N){for(E=1&j,x=0;2>x;++x)q=q>>1|(E=0<(S=er(l,d[2],S=E+(1&q),m.Qc,0,f,w)))<<3,y=y<<2|(3<S?3:1<S?2:0!=f[w+0]),w+=16;q>>=2,j=j>>1|E<<5}g|=y<<4*L,k|=q<<4<<L,A|=(240&j)<<L}h.la=k,p.la=A,v.Hc=b,v.Gc=g,v.ia=43690&g?0:m.ia,d=!(b|g)}if(0<u.L&&(u.wa[u.Y+u.ja]=u.gd[o.$b][o.Za],u.wa[u.Y+u.ja].La|=!d),c.Ka)return Yt(t,7,"Premature end-of-file encountered.")}if(Qt(t),u=n,c=1,o=(a=t).D,h=0<a.L&&a.M>=a.zb&&a.M<=a.Va,0==a.Aa)t:{if(o.M=a.M,o.uc=h,Rn(a,o),c=1,o=(y=a.D).Nb,h=(g=Tr[a.L])*a.R,d=a.sa,v=a.ta-h+(N=16*o*a.R),m=a.qa,f=a.ra-(l=g/2*a.B)+(x=8*o*a.B),w=a.Ha,p=a.Ia-l+x,j=0==(q=y.M),b=q>=a.Va-1,2==a.Aa&&Rn(a,y),y.uc)for(E=(S=a).D.M,i(S.D.uc),y=S.yb;y<S.Hb;++y){k=E;var P=(I=(_=S).D).Nb,I=I.wa[I.Y+(A=y)],F=_.sa,R=_.ta+16*P*(L=_.R)+16*A,O=I.dd,B=I.tc;if(0!=B)if(i(3<=B),1==_.L)0<A&&Ne(F,R,L,B+4),I.La&&ye(F,R,L,B),0<k&&ge(F,R,L,B+4),I.La&&Le(F,R,L,B);else{var D=_.B,C=_.qa,T=_.ra+8*P*D+8*A,z=_.Ha,_=_.Ia+8*P*D+8*A;P=I.ld,0<A&&(le(F,R,L,B+4,O,P),ve(C,T,z,_,D,B+4,O,P)),I.La&&(we(F,R,L,B,O,P),be(C,T,z,_,D,B,O,P)),0<k&&(fe(F,R,L,B+4,O,P),de(C,T,z,_,D,B+4,O,P)),I.La&&(me(F,R,L,B,O,P),pe(C,T,z,_,D,B,O,P))}}if(a.ia&&alert("todo:DitherRow"),null!=u.put){if(y=16*q,q=16*(q+1),j?(u.y=a.sa,u.O=a.ta+N,u.f=a.qa,u.N=a.ra+x,u.ea=a.Ha,u.W=a.Ia+x):(y-=g,u.y=d,u.O=v,u.f=m,u.N=f,u.ea=w,u.W=p),b||(q-=g),q>u.o&&(q=u.o),u.F=null,u.J=null,null!=a.Fa&&0<a.Fa.length&&y<q&&(u.J=ln(a,u,y,q-y),u.F=a.mb,null==u.F&&0==u.F.length)){c=Yt(a,3,"Could not decode alpha data.");break t}y<u.j&&(g=u.j-y,y=u.j,i(!(1&g)),u.O+=a.R*g,u.N+=a.B*(g>>1),u.W+=a.B*(g>>1),null!=u.F&&(u.J+=u.width*g)),y<q&&(u.O+=u.v,u.N+=u.v>>1,u.W+=u.v>>1,null!=u.F&&(u.J+=u.v),u.ka=y-u.j,u.U=u.va-u.v,u.T=q-y,c=u.put(u))}o+1!=a.Ic||b||(e(a.sa,a.ta-h,d,v+16*a.R,h),e(a.qa,a.ra-l,m,f+8*a.B,l),e(a.Ha,a.Ia-l,w,p+8*a.B,l))}if(!c)return Yt(t,6,"Output aborted.")}return 1}(t,n)),null!=n.bc&&n.bc(n),a&=1}return a?(t.cb=0,a):0}function ti(t,i,n,e,r){t[i+n+32*e]=-256&(r=t[i+n+32*e]+(r>>3))?0>r?0:255:r}function ii(t,i,n,e,r,s){ti(t,i,0,n,e+r),ti(t,i,1,n,e+s),ti(t,i,2,n,e-s),ti(t,i,3,n,e-r)}function ni(t){return(20091*t>>16)+t}function ei(t,i,n,e){var r,o=0,a=s(16);for(r=0;4>r;++r){var u=t[i+0]+t[i+8],c=t[i+0]-t[i+8],h=(35468*t[i+4]>>16)-ni(t[i+12]),f=ni(t[i+4])+(35468*t[i+12]>>16);a[o+0]=u+f,a[o+1]=c+h,a[o+2]=c-h,a[o+3]=u-f,o+=4,i++}for(r=o=0;4>r;++r)u=(t=a[o+0]+4)+a[o+8],c=t-a[o+8],h=(35468*a[o+4]>>16)-ni(a[o+12]),ti(n,e,0,0,u+(f=ni(a[o+4])+(35468*a[o+12]>>16))),ti(n,e,1,0,c+h),ti(n,e,2,0,c-h),ti(n,e,3,0,u-f),o++,e+=32}function ri(t,i,n,e){var r=t[i+0]+4,s=35468*t[i+4]>>16,o=ni(t[i+4]),a=35468*t[i+1]>>16;ii(n,e,0,r+o,t=ni(t[i+1]),a),ii(n,e,1,r+s,t,a),ii(n,e,2,r-s,t,a),ii(n,e,3,r-o,t,a)}function si(t,i,n,e,r){ei(t,i,n,e),r&&ei(t,i+16,n,e+4)}function oi(t,i,n,e){oe(t,i+0,n,e,1),oe(t,i+32,n,e+128,1)}function ai(t,i,n,e){var r;for(t=t[i+0]+4,r=0;4>r;++r)for(i=0;4>i;++i)ti(n,e,i,r,t)}function ui(t,i,n,e){t[i+0]&&ce(t,i+0,n,e),t[i+16]&&ce(t,i+16,n,e+4),t[i+32]&&ce(t,i+32,n,e+128),t[i+48]&&ce(t,i+48,n,e+128+4)}function ci(t,i,n,e){var r,o=s(16);for(r=0;4>r;++r){var a=t[i+0+r]+t[i+12+r],u=t[i+4+r]+t[i+8+r],c=t[i+4+r]-t[i+8+r],h=t[i+0+r]-t[i+12+r];o[0+r]=a+u,o[8+r]=a-u,o[4+r]=h+c,o[12+r]=h-c}for(r=0;4>r;++r)a=(t=o[0+4*r]+3)+o[3+4*r],c=o[1+4*r]-o[2+4*r],h=t-o[3+4*r],n[e+0]=a+(u=o[1+4*r]+o[2+4*r])>>3,n[e+16]=h+c>>3,n[e+32]=a-u>>3,n[e+48]=h-c>>3,e+=64}function hi(t,i,n){var e,r=i-32,s=Re,o=255-t[r-1];for(e=0;e<n;++e){var a,u=s,c=o+t[i-1];for(a=0;a<n;++a)t[i+a]=u[c+t[r+a]];i+=32}}function fi(t,i){hi(t,i,4)}function li(t,i){hi(t,i,8)}function di(t,i){hi(t,i,16)}function vi(t,i){var n;for(n=0;16>n;++n)e(t,i+32*n,t,i-32,16)}function mi(t,i){var n;for(n=16;0<n;--n)r(t,i,t[i-1],16),i+=32}function wi(t,i,n){var e;for(e=0;16>e;++e)r(i,n+32*e,t,16)}function pi(t,i){var n,e=16;for(n=0;16>n;++n)e+=t[i-1+32*n]+t[i+n-32];wi(e>>5,t,i)}function bi(t,i){var n,e=8;for(n=0;16>n;++n)e+=t[i-1+32*n];wi(e>>4,t,i)}function gi(t,i){var n,e=8;for(n=0;16>n;++n)e+=t[i+n-32];wi(e>>4,t,i)}function Ni(t,i){wi(128,t,i)}function Li(t,i,n){return t+2*i+n+2>>2}function yi(t,i){var n,r=i-32;for(r=new Uint8Array([Li(t[r-1],t[r+0],t[r+1]),Li(t[r+0],t[r+1],t[r+2]),Li(t[r+1],t[r+2],t[r+3]),Li(t[r+2],t[r+3],t[r+4])]),n=0;4>n;++n)e(t,i+32*n,r,0,r.length)}function Ai(t,i){var n=t[i-1],e=t[i-1+32],r=t[i-1+64],s=t[i-1+96];j(t,i+0,16843009*Li(t[i-1-32],n,e)),j(t,i+32,16843009*Li(n,e,r)),j(t,i+64,16843009*Li(e,r,s)),j(t,i+96,16843009*Li(r,s,s))}function ki(t,i){var n,e=4;for(n=0;4>n;++n)e+=t[i+n-32]+t[i-1+32*n];for(e>>=3,n=0;4>n;++n)r(t,i+32*n,e,4)}function Si(t,i){var n=t[i-1+0],e=t[i-1+32],r=t[i-1+64],s=t[i-1-32],o=t[i+0-32],a=t[i+1-32],u=t[i+2-32],c=t[i+3-32];t[i+0+96]=Li(e,r,t[i-1+96]),t[i+1+96]=t[i+0+64]=Li(n,e,r),t[i+2+96]=t[i+1+64]=t[i+0+32]=Li(s,n,e),t[i+3+96]=t[i+2+64]=t[i+1+32]=t[i+0+0]=Li(o,s,n),t[i+3+64]=t[i+2+32]=t[i+1+0]=Li(a,o,s),t[i+3+32]=t[i+2+0]=Li(u,a,o),t[i+3+0]=Li(c,u,a)}function xi(t,i){var n=t[i+1-32],e=t[i+2-32],r=t[i+3-32],s=t[i+4-32],o=t[i+5-32],a=t[i+6-32],u=t[i+7-32];t[i+0+0]=Li(t[i+0-32],n,e),t[i+1+0]=t[i+0+32]=Li(n,e,r),t[i+2+0]=t[i+1+32]=t[i+0+64]=Li(e,r,s),t[i+3+0]=t[i+2+32]=t[i+1+64]=t[i+0+96]=Li(r,s,o),t[i+3+32]=t[i+2+64]=t[i+1+96]=Li(s,o,a),t[i+3+64]=t[i+2+96]=Li(o,a,u),t[i+3+96]=Li(a,u,u)}function qi(t,i){var n=t[i-1+0],e=t[i-1+32],r=t[i-1+64],s=t[i-1-32],o=t[i+0-32],a=t[i+1-32],u=t[i+2-32],c=t[i+3-32];t[i+0+0]=t[i+1+64]=s+o+1>>1,t[i+1+0]=t[i+2+64]=o+a+1>>1,t[i+2+0]=t[i+3+64]=a+u+1>>1,t[i+3+0]=u+c+1>>1,t[i+0+96]=Li(r,e,n),t[i+0+64]=Li(e,n,s),t[i+0+32]=t[i+1+96]=Li(n,s,o),t[i+1+32]=t[i+2+96]=Li(s,o,a),t[i+2+32]=t[i+3+96]=Li(o,a,u),t[i+3+32]=Li(a,u,c)}function Mi(t,i){var n=t[i+0-32],e=t[i+1-32],r=t[i+2-32],s=t[i+3-32],o=t[i+4-32],a=t[i+5-32],u=t[i+6-32],c=t[i+7-32];t[i+0+0]=n+e+1>>1,t[i+1+0]=t[i+0+64]=e+r+1>>1,t[i+2+0]=t[i+1+64]=r+s+1>>1,t[i+3+0]=t[i+2+64]=s+o+1>>1,t[i+0+32]=Li(n,e,r),t[i+1+32]=t[i+0+96]=Li(e,r,s),t[i+2+32]=t[i+1+96]=Li(r,s,o),t[i+3+32]=t[i+2+96]=Li(s,o,a),t[i+3+64]=Li(o,a,u),t[i+3+96]=Li(a,u,c)}function ji(t,i){var n=t[i-1+0],e=t[i-1+32],r=t[i-1+64],s=t[i-1+96];t[i+0+0]=n+e+1>>1,t[i+2+0]=t[i+0+32]=e+r+1>>1,t[i+2+32]=t[i+0+64]=r+s+1>>1,t[i+1+0]=Li(n,e,r),t[i+3+0]=t[i+1+32]=Li(e,r,s),t[i+3+32]=t[i+1+64]=Li(r,s,s),t[i+3+64]=t[i+2+64]=t[i+0+96]=t[i+1+96]=t[i+2+96]=t[i+3+96]=s}function Ei(t,i){var n=t[i-1+0],e=t[i-1+32],r=t[i-1+64],s=t[i-1+96],o=t[i-1-32],a=t[i+0-32],u=t[i+1-32],c=t[i+2-32];t[i+0+0]=t[i+2+32]=n+o+1>>1,t[i+0+32]=t[i+2+64]=e+n+1>>1,t[i+0+64]=t[i+2+96]=r+e+1>>1,t[i+0+96]=s+r+1>>1,t[i+3+0]=Li(a,u,c),t[i+2+0]=Li(o,a,u),t[i+1+0]=t[i+3+32]=Li(n,o,a),t[i+1+32]=t[i+3+64]=Li(e,n,o),t[i+1+64]=t[i+3+96]=Li(r,e,n),t[i+1+96]=Li(s,r,e)}function Pi(t,i){var n;for(n=0;8>n;++n)e(t,i+32*n,t,i-32,8)}function Ii(t,i){var n;for(n=0;8>n;++n)r(t,i,t[i-1],8),i+=32}function Fi(t,i,n){var e;for(e=0;8>e;++e)r(i,n+32*e,t,8)}function Ri(t,i){var n,e=8;for(n=0;8>n;++n)e+=t[i+n-32]+t[i-1+32*n];Fi(e>>4,t,i)}function Oi(t,i){var n,e=4;for(n=0;8>n;++n)e+=t[i+n-32];Fi(e>>3,t,i)}function Bi(t,i){var n,e=4;for(n=0;8>n;++n)e+=t[i-1+32*n];Fi(e>>3,t,i)}function Di(t,i){Fi(128,t,i)}function Ci(t,i,n){var e=t[i-n],r=t[i+0],s=3*(r-e)+Ie[1020+t[i-2*n]-t[i+n]],o=Fe[112+(s+4>>3)];t[i-n]=Re[255+e+Fe[112+(s+3>>3)]],t[i+0]=Re[255+r-o]}function Ti(t,i,n,e){return Oe[255+t[i-2*n]-t[i-n]]>e||Oe[255+t[i+n]-t[i+0]]>e}function zi(t,i,n,e){return 4*Oe[255+t[i-n]-t[i+0]]+Oe[255+t[i-2*n]-t[i+n]]<=e}function _i(t,i,n,e,r){var s=t[i-3*n],o=t[i-2*n],a=t[i-n],u=t[i+0],c=t[i+n],h=t[i+2*n];return 4*Oe[255+a-u]+Oe[255+o-c]>e?0:Oe[255+t[i-4*n]-s]<=r&&Oe[255+s-o]<=r&&Oe[255+o-a]<=r&&Oe[255+t[i+3*n]-h]<=r&&Oe[255+h-c]<=r&&Oe[255+c-u]<=r}function Ui(t,i,n,e){var r=2*e+1;for(e=0;16>e;++e)zi(t,i+e,n,r)&&Ci(t,i+e,n)}function Vi(t,i,n,e){var r=2*e+1;for(e=0;16>e;++e)zi(t,i+e*n,1,r)&&Ci(t,i+e*n,1)}function Wi(t,i,n,e){var r;for(r=3;0<r;--r)Ui(t,i+=4*n,n,e)}function Hi(t,i,n,e){var r;for(r=3;0<r;--r)Vi(t,i+=4,n,e)}function Gi(t,i,n,e,r,s,o,a){for(s=2*s+1;0<r--;){if(_i(t,i,n,s,o))if(Ti(t,i,n,a))Ci(t,i,n);else{var u=t,c=i,h=n,f=u[c-2*h],l=u[c-h],d=u[c+0],v=u[c+h],m=u[c+2*h],w=27*(b=Ie[1020+3*(d-l)+Ie[1020+f-v]])+63>>7,p=18*b+63>>7,b=9*b+63>>7;u[c-3*h]=Re[255+u[c-3*h]+b],u[c-2*h]=Re[255+f+p],u[c-h]=Re[255+l+w],u[c+0]=Re[255+d-w],u[c+h]=Re[255+v-p],u[c+2*h]=Re[255+m-b]}i+=e}}function Ji(t,i,n,e,r,s,o,a){for(s=2*s+1;0<r--;){if(_i(t,i,n,s,o))if(Ti(t,i,n,a))Ci(t,i,n);else{var u=t,c=i,h=n,f=u[c-h],l=u[c+0],d=u[c+h],v=Fe[112+(4+(m=3*(l-f))>>3)],m=Fe[112+(m+3>>3)],w=v+1>>1;u[c-2*h]=Re[255+u[c-2*h]+w],u[c-h]=Re[255+f+m],u[c+0]=Re[255+l-v],u[c+h]=Re[255+d-w]}i+=e}}function Yi(t,i,n,e,r,s){Gi(t,i,n,1,16,e,r,s)}function Ki(t,i,n,e,r,s){Gi(t,i,1,n,16,e,r,s)}function Xi(t,i,n,e,r,s){var o;for(o=3;0<o;--o)Ji(t,i+=4*n,n,1,16,e,r,s)}function $i(t,i,n,e,r,s){var o;for(o=3;0<o;--o)Ji(t,i+=4,1,n,16,e,r,s)}function Qi(t,i,n,e,r,s,o,a){Gi(t,i,r,1,8,s,o,a),Gi(n,e,r,1,8,s,o,a)}function Zi(t,i,n,e,r,s,o,a){Gi(t,i,1,r,8,s,o,a),Gi(n,e,1,r,8,s,o,a)}function tn(t,i,n,e,r,s,o,a){Ji(t,i+4*r,r,1,8,s,o,a),Ji(n,e+4*r,r,1,8,s,o,a)}function nn(t,i,n,e,r,s,o,a){Ji(t,i+4,1,r,8,s,o,a),Ji(n,e+4,1,r,8,s,o,a)}function en(){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 rn(){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 sn(){this.nc=this.Ea=this.b=this.hc=0,this.K=[],this.w=0}function on(){this.ua=0,this.Wa=new O,this.vb=new O,this.md=this.xc=this.wc=0,this.vc=[],this.Wb=0,this.Ya=new d,this.yc=new f}function an(){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 L,this.Pb=0,this.wd=new L,this.Ma=this.$=this.C=this.i=this.c=this.xd=0,this.s=new on,this.ab=0,this.gc=o(4,sn),this.Oc=0}function un(){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 cn(t,i,n,e,r,s,o){for(t=null==t?0:t[i+0],i=0;i<o;++i)r[s+i]=t+n[e+i]&255,t=r[s+i]}function hn(t,i,n,e,r,s,o){var a;if(null==t)cn(null,null,n,e,r,s,o);else for(a=0;a<o;++a)r[s+a]=t[i+a]+n[e+a]&255}function fn(t,i,n,e,r,s,o){if(null==t)cn(null,null,n,e,r,s,o);else{var a,u=t[i+0],c=u,h=u;for(a=0;a<o;++a)c=h+(u=t[i+a])-c,h=n[e+a]+(-256&c?0>c?0:255:c)&255,c=u,r[s+a]=h}}function ln(t,n,r,o){var a=n.width,u=n.o;if(i(null!=t&&null!=n),0>r||0>=o||r+o>u)return null;if(!t.Cc){if(null==t.ga){var c;if(t.ga=new un,(c=null==t.ga)||(c=n.width*n.o,i(0==t.Gb.length),t.Gb=s(c),t.Uc=0,null==t.Gb?c=0:(t.mb=t.Gb,t.nb=t.Uc,t.rc=null,c=1),c=!c),!c){var h=t.Fa,f=t.P,l=t.qc,d=t.mb,v=t.nb,m=f+1,w=l-1,b=(c=t.ga).l;if(i(null!=h&&null!=d&&null!=n),wr[0]=null,wr[1]=cn,wr[2]=hn,wr[3]=fn,c.ca=d,c.tb=v,c.c=n.width,c.i=n.height,i(0<c.c&&0<c.i),1>=l)n=0;else if(c.$a=h[f+0]>>0&3,c.Z=h[f+0]>>2&3,c.Lc=h[f+0]>>4&3,f=h[f+0]>>6&3,0>c.$a||1<c.$a||4<=c.Z||1<c.Lc||f)n=0;else if(b.put=dt,b.ac=lt,b.bc=vt,b.ma=c,b.width=n.width,b.height=n.height,b.Da=n.Da,b.v=n.v,b.va=n.va,b.j=n.j,b.o=n.o,c.$a)t:{i(1==c.$a),n=Mt();i:for(;;){if(null==n){n=0;break t}if(i(null!=c),c.mc=n,n.c=c.c,n.i=c.i,n.l=c.l,n.l.ma=c,n.l.width=c.c,n.l.height=c.i,n.a=0,p(n.m,h,m,w),!jt(c.c,c.i,1,n,null))break i;if(1==n.ab&&3==n.gc[0].hc&&At(n.s)?(c.ic=1,h=n.c*n.i,n.Ta=null,n.Ua=0,n.V=s(h),n.Ba=0,null==n.V?(n.a=1,n=0):n=1):(c.ic=0,n=Et(n,c.c)),!n)break i;n=1;break t}c.mc=null,n=0}else n=w>=c.c*c.i;c=!n}if(c)return null;1!=t.ga.Lc?t.Ga=0:o=u-r}i(null!=t.ga),i(r+o<=u);t:{if(n=(h=t.ga).c,u=h.l.o,0==h.$a){if(m=t.rc,w=t.Vc,b=t.Fa,l=t.mb,d=t.nb+r*n,i((f=t.P+1+r*n)<=t.P+t.qc),0!=h.Z)for(i(null!=wr[h.Z]),c=0;c<o;++c)wr[h.Z](m,w,b,f,l,d,n),m=l,w=d,d+=n,f+=n;else for(c=0;c<o;++c)e(l,d,b,f,n),m=l,w=d,d+=n,f+=n;t.rc=m,t.Vc=w}else{if(i(null!=h.mc),n=r+o,i(null!=(c=h.mc)),i(n<=c.i),c.C>=n)n=1;else if(h.ic||pn(),h.ic){h=c.V,m=c.Ba;var g=c.i,N=(b=1,f=c.$/(w=c.c),l=c.$%w,d=c.m,v=c.s,c.$),L=w*g,y=w*n,k=v.wc,x=N<y?Nt(v,l,f):null;i(N<=L),i(n<=g),i(At(v));i:for(;;){for(;!d.h&&N<y;){if(l&k||(x=Nt(v,l,f)),i(null!=x),S(d),256>(g=bt(x.G[0],x.H[0],d)))h[m+N]=g,++N,++l>=w&&(l=0,++f<=n&&!(f%16)&&St(c,f));else{if(!(280>g)){b=0;break i}g=wt(g-256,d);var q,M=bt(x.G[4],x.H[4],d);if(S(d),!(N>=(M=pt(w,M=wt(M,d)))&&L-N>=g)){b=0;break i}for(q=0;q<g;++q)h[m+N+q]=h[m+N+q-M];for(N+=g,l+=g;l>=w;)l-=w,++f<=n&&!(f%16)&&St(c,f);N<y&&l&k&&(x=Nt(v,l,f))}i(d.h==A(d))}St(c,f>n?n:f);break i}!b||d.h&&N<L?(b=0,c.a=d.h?5:3):c.$=N,n=b}else n=xt(c,c.V,c.Ba,c.c,c.i,n,Pt);if(!n){o=0;break t}}r+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+r*a}function dn(t,i,n,e,r,s){for(;0<r--;){var o,a=t,u=i+(n?1:0),c=t,h=i+(n?0:3);for(o=0;o<e;++o){var f=c[h+4*o];255!=f&&(a[u+4*o+0]=a[u+4*o+0]*(f*=32897)>>23,a[u+4*o+1]=a[u+4*o+1]*f>>23,a[u+4*o+2]=a[u+4*o+2]*f>>23)}i+=s}}function vn(t,i,n,e,r){for(;0<e--;){var s;for(s=0;s<n;++s){var o=t[i+2*s+0],a=15&(c=t[i+2*s+1]),u=4369*a,c=(240&c|c>>4)*u>>16;t[i+2*s+0]=(240&o|o>>4)*u>>16&240|(15&o|o<<4)*u>>16>>4&15,t[i+2*s+1]=240&c|a}i+=r}}function mn(t,i,n,e,r,s,o,a){var u,c,h=255;for(c=0;c<r;++c){for(u=0;u<e;++u){var f=t[i+u];s[o+4*u]=f,h&=f}i+=n,o+=a}return 255!=h}function wn(t,i,n,e,r){var s;for(s=0;s<r;++s)n[e+s]=t[i+s]>>8}function pn(){Ae=dn,ke=vn,Se=mn,xe=wn}function bn(n,e,r){t[n]=function(t,n,s,o,a,u,c,h,f,l,d,v,m,w,p,b,g){var N,L=g-1>>1,y=a[u+0]|c[h+0]<<16,A=f[l+0]|d[v+0]<<16;i(null!=t);var k=3*y+A+131074>>2;for(e(t[n+0],255&k,k>>16,m,w),null!=s&&e(s[o+0],255&(k=3*A+y+131074>>2),k>>16,p,b),N=1;N<=L;++N){var S=a[u+N]|c[h+N]<<16,x=f[l+N]|d[v+N]<<16,q=y+S+A+x+524296,M=q+2*(S+A)>>3;k=M+y>>1,y=(q=q+2*(y+x)>>3)+S>>1,e(t[n+2*N-1],255&k,k>>16,m,w+(2*N-1)*r),e(t[n+2*N-0],255&y,y>>16,m,w+(2*N-0)*r),null!=s&&(y=M+x>>1,e(s[o+2*N-1],255&(k=q+A>>1),k>>16,p,b+(2*N-1)*r),e(s[o+2*N+0],255&y,y>>16,p,b+(2*N+0)*r)),y=S,A=x}1&g||(e(t[n+g-1],255&(k=3*y+A+131074>>2),k>>16,m,w+(g-1)*r),null!=s&&e(s[o+g-1],255&(k=3*A+y+131074>>2),k>>16,p,b+(g-1)*r))}}function gn(){pr[Be]=br,pr[De]=Nr,pr[Ce]=gr,pr[Te]=Lr,pr[ze]=yr,pr[_e]=Ar,pr[Ue]=kr,pr[Ve]=Nr,pr[We]=Lr,pr[He]=yr,pr[Ge]=Ar}function Nn(t){return t&~Er?0>t?0:255:t>>jr}function Ln(t,i){return Nn((19077*t>>8)+(26149*i>>8)-14234)}function yn(t,i,n){return Nn((19077*t>>8)-(6419*i>>8)-(13320*n>>8)+8708)}function An(t,i){return Nn((19077*t>>8)+(33050*i>>8)-17685)}function kn(t,i,n,e,r){e[r+0]=Ln(t,n),e[r+1]=yn(t,i,n),e[r+2]=An(t,i)}function Sn(t,i,n,e,r){e[r+0]=An(t,i),e[r+1]=yn(t,i,n),e[r+2]=Ln(t,n)}function xn(t,i,n,e,r){var s=yn(t,i,n);i=s<<3&224|An(t,i)>>3,e[r+0]=248&Ln(t,n)|s>>5,e[r+1]=i}function qn(t,i,n,e,r){var s=240&An(t,i)|15;e[r+0]=240&Ln(t,n)|yn(t,i,n)>>4,e[r+1]=s}function Mn(t,i,n,e,r){e[r+0]=255,kn(t,i,n,e,r+1)}function jn(t,i,n,e,r){Sn(t,i,n,e,r),e[r+3]=255}function En(t,i,n,e,r){kn(t,i,n,e,r),e[r+3]=255}function Ht(t,i){return 0>t?0:t>i?i:t}function Pn(i,n,e){t[i]=function(t,i,r,s,o,a,u,c,h){for(var f=c+(-2&h)*e;c!=f;)n(t[i+0],r[s+0],o[a+0],u,c),n(t[i+1],r[s+0],o[a+0],u,c+e),i+=2,++s,++a,c+=2*e;1&h&&n(t[i+0],r[s+0],o[a+0],u,c)}}function In(t,i,n){return 0==n?0==t?0==i?6:5:0==i?4:0:n}function Fn(t,i,n,e,r){switch(t>>>30){case 3:oe(i,n,e,r,0);break;case 2:ae(i,n,e,r);break;case 1:ce(i,n,e,r)}}function Rn(t,i){var n,s,o=i.M,a=i.Nb,u=t.oc,c=t.pc+40,h=t.oc,f=t.pc+584,l=t.oc,d=t.pc+600;for(n=0;16>n;++n)u[c+32*n-1]=129;for(n=0;8>n;++n)h[f+32*n-1]=129,l[d+32*n-1]=129;for(0<o?u[c-1-32]=h[f-1-32]=l[d-1-32]=129:(r(u,c-32-1,127,21),r(h,f-32-1,127,9),r(l,d-32-1,127,9)),s=0;s<t.za;++s){var v=i.ya[i.aa+s];if(0<s){for(n=-1;16>n;++n)e(u,c+32*n-4,u,c+32*n+12,4);for(n=-1;8>n;++n)e(h,f+32*n-4,h,f+32*n+4,4),e(l,d+32*n-4,l,d+32*n+4,4)}var m=t.Gd,w=t.Hd+s,p=v.ad,b=v.Hc;if(0<o&&(e(u,c-32,m[w].y,0,16),e(h,f-32,m[w].f,0,8),e(l,d-32,m[w].ea,0,8)),v.Za){var g=u,N=c-32+16;for(0<o&&(s>=t.za-1?r(g,N,m[w].y[15],4):e(g,N,m[w+1].y,0,4)),n=0;4>n;n++)g[N+128+n]=g[N+256+n]=g[N+384+n]=g[N+0+n];for(n=0;16>n;++n,b<<=2)lr[v.Ob[n]](g=u,N=c+Cr[n]),Fn(b,p,16*+n,g,N)}else if(g=In(s,o,v.Ob[0]),fr[g](u,c),0!=b)for(n=0;16>n;++n,b<<=2)Fn(b,p,16*+n,u,c+Cr[n]);for(n=v.Gc,g=In(s,o,v.Dd),dr[g](h,f),dr[g](l,d),b=p,g=h,N=f,255&(v=n>>0)&&(170&v?ue(b,256,g,N):he(b,256,g,N)),v=l,b=d,255&(n>>=8)&&(170&n?ue(p,320,v,b):he(p,320,v,b)),o<t.Ub-1&&(e(m[w].y,0,u,c+480,16),e(m[w].f,0,h,f+224,8),e(m[w].ea,0,l,d+224,8)),m=t.sa,w=t.ta+16*s+16*a*t.R,p=t.qa,v=t.ra+8*s+(n=8*a*t.B),b=t.Ha,g=t.Ia+8*s+n,n=0;16>n;++n)e(m,w+n*t.R,u,c+32*n,16);for(n=0;8>n;++n)e(p,v+n*t.B,h,f+32*n,8),e(b,g+n*t.B,l,d+32*n,8)}}function On(t,e,r,s,o,a,u,c,h){var f=[0],l=[0],d=0,v=null!=h?h.kd:0,m=null!=h?h:new rn;if(null==t||12>r)return 7;m.data=t,m.w=e,m.ha=r,e=[e],r=[r],m.gb=[m.gb];t:{var w=e,b=r,g=m.gb;if(i(null!=t),i(null!=b),i(null!=g),g[0]=0,12<=b[0]&&!n(t,w[0],"RIFF")){if(n(t,w[0]+8,"WEBP")){g=3;break t}var N=I(t,w[0]+4);if(12>N||4294967286<N){g=3;break t}if(v&&N>b[0]-8){g=7;break t}g[0]=N,w[0]+=12,b[0]-=12}g=0}if(0!=g)return g;for(N=0<m.gb[0],r=r[0];;){t:{var y=t;b=e,g=r;var A=f,k=l,S=w=[0];if((M=d=[d])[0]=0,8>g[0])g=7;else{if(!n(y,b[0],"VP8X")){if(10!=I(y,b[0]+4)){g=3;break t}if(18>g[0]){g=7;break t}var x=I(y,b[0]+8),q=1+P(y,b[0]+12);if(2147483648<=q*(y=1+P(y,b[0]+15))){g=3;break t}null!=S&&(S[0]=x),null!=A&&(A[0]=q),null!=k&&(k[0]=y),b[0]+=18,g[0]-=18,M[0]=1}g=0}}if(d=d[0],0!=g)return g;if(b=!!(2&(w=w[0])),!N&&d)return 3;if(null!=a&&(a[0]=!!(16&w)),null!=u&&(u[0]=b),null!=c&&(c[0]=0),u=f[0],w=l[0],d&&b&&null==h){g=0;break}if(4>r){g=7;break}if(N&&d||!N&&!d&&!n(t,e[0],"ALPH")){r=[r],m.na=[m.na],m.P=[m.P],m.Sa=[m.Sa];t:{g=e,N=r;var M=m.gb;A=m.na,k=m.P,S=m.Sa,q=22,i(null!=(x=t)),i(null!=N),y=g[0];var j=N[0];for(i(null!=A),i(null!=S),A[0]=null,k[0]=null,S[0]=0;;){if(g[0]=y,N[0]=j,8>j){g=7;break t}var E=I(x,y+4);if(4294967286<E){g=3;break t}var F=8+E+1&-2;if(q+=F,0<M&&q>M){g=3;break t}if(!n(x,y,"VP8 ")||!n(x,y,"VP8L")){g=0;break t}if(j[0]<F){g=7;break t}n(x,y,"ALPH")||(A[0]=x,k[0]=y+8,S[0]=E),y+=F,j-=F}}if(r=r[0],m.na=m.na[0],m.P=m.P[0],m.Sa=m.Sa[0],0!=g)break}r=[r],m.Ja=[m.Ja],m.xa=[m.xa];t:if(M=t,g=e,N=r,A=m.gb[0],k=m.Ja,S=m.xa,x=g[0],y=!n(M,x,"VP8 "),q=!n(M,x,"VP8L"),i(null!=M),i(null!=N),i(null!=k),i(null!=S),8>N[0])g=7;else{if(y||q){if(M=I(M,x+4),12<=A&&M>A-12){g=3;break t}if(v&&M>N[0]-8){g=7;break t}k[0]=M,g[0]+=8,N[0]-=8,S[0]=q}else S[0]=5<=N[0]&&47==M[x+0]&&!(M[x+4]>>5),k[0]=N[0];g=0}if(r=r[0],m.Ja=m.Ja[0],m.xa=m.xa[0],e=e[0],0!=g)break;if(4294967286<m.Ja)return 3;if(null==c||b||(c[0]=m.xa?2:1),u=[u],w=[w],m.xa){if(5>r){g=7;break}c=u,v=w,b=a,null==t||5>r?t=0:5<=r&&47==t[e+0]&&!(t[e+4]>>5)?(N=[0],M=[0],A=[0],p(k=new L,t,e,r),mt(k,N,M,A)?(null!=c&&(c[0]=N[0]),null!=v&&(v[0]=M[0]),null!=b&&(b[0]=A[0]),t=1):t=0):t=0}else{if(10>r){g=7;break}c=w,null==t||10>r||!Kt(t,e+3,r-3)?t=0:(v=t[e+0]|t[e+1]<<8|t[e+2]<<16,b=16383&(t[e+7]<<8|t[e+6]),t=16383&(t[e+9]<<8|t[e+8]),1&v||3<(v>>1&7)||!(v>>4&1)||v>>5>=m.Ja||!b||!t?t=0:(u&&(u[0]=b),c&&(c[0]=t),t=1))}if(!t)return 3;if(u=u[0],w=w[0],d&&(f[0]!=u||l[0]!=w))return 3;null!=h&&(h[0]=m,h.offset=e-h.w,i(4294967286>e-h.w),i(h.offset==h.ha-r));break}return 0==g||7==g&&d&&null==h?(null!=a&&(a[0]|=null!=m.na&&0<m.na.length),null!=s&&(s[0]=u),null!=o&&(o[0]=w),0):g}function Bn(t,i,n){var e=i.width,r=i.height,s=0,o=0,a=e,u=r;if(i.Da=null!=t&&0<t.Da,i.Da&&(a=t.cd,u=t.bd,s=t.v,o=t.j,11>n||(s&=-2,o&=-2),0>s||0>o||0>=a||0>=u||s+a>e||o+u>r))return 0;if(i.v=s,i.j=o,i.va=s+a,i.o=o+u,i.U=a,i.T=u,i.da=null!=t&&0<t.da,i.da){if(!B(a,u,n=[t.ib],s=[t.hb]))return 0;i.ib=n[0],i.hb=s[0]}return i.ob=null!=t&&t.ob,i.Kb=null==t||!t.Sd,i.da&&(i.ob=i.ib<3*e/4&&i.hb<3*r/4,i.Kb=0),1}function Dn(t){if(null==t)return 2;if(11>t.S){var i=t.f.RGBA;i.fb+=(t.height-1)*i.A,i.A=-i.A}else(i=t.f.kb).O+=((t=t.height)-1)*i.fa,i.fa=-i.fa,i.N+=(t-1>>1)*i.Ab,i.Ab=-i.Ab,i.W+=(t-1>>1)*i.Db,i.Db=-i.Db,null!=i.F&&(i.J+=(t-1)*i.lb,i.lb=-i.lb);return 0}function Cn(t,i,n,e){if(null==e||0>=t||0>=i)return 2;if(null!=n){if(n.Da){var r=n.cd,o=n.bd,a=-2&n.v,u=-2&n.j;if(0>a||0>u||0>=r||0>=o||a+r>t||u+o>i)return 2;t=r,i=o}if(n.da){if(!B(t,i,r=[n.ib],o=[n.hb]))return 2;t=r[0],i=o[0]}}e.width=t,e.height=i;t:{var c=e.width,h=e.height;if(t=e.S,0>=c||0>=h||!(t>=Be&&13>t))t=2;else{if(0>=e.Rd&&null==e.sd){a=o=r=i=0;var f=(u=c*Ur[t])*h;if(11>t||(o=(h+1)/2*(i=(c+1)/2),12==t&&(a=(r=c)*h)),null==(h=s(f+2*o+a))){t=1;break t}e.sd=h,11>t?((c=e.f.RGBA).eb=h,c.fb=0,c.A=u,c.size=f):((c=e.f.kb).y=h,c.O=0,c.fa=u,c.Fd=f,c.f=h,c.N=0+f,c.Ab=i,c.Cd=o,c.ea=h,c.W=0+f+o,c.Db=i,c.Ed=o,12==t&&(c.F=h,c.J=0+f+2*o),c.Tc=a,c.lb=r)}if(i=1,o=e.width,a=e.height,(r=e.S)>=Be&&13>r)if(11>r)t=e.f.RGBA,i&=(u=Math.abs(t.A))*(a-1)+o<=t.size,i&=u>=o*Ur[r],i&=null!=t.eb;else{t=e.f.kb,u=(o+1)/2,f=(a+1)/2,c=Math.abs(t.fa),h=Math.abs(t.Ab);var l=Math.abs(t.Db),d=Math.abs(t.lb);i&=c*(a-1)+o<=t.Fd,i&=h*(f-1)+u<=t.Cd,i=(i&=l*(f-1)+u<=t.Ed)&c>=o&h>=u&l>=u,i&=null!=t.y,i&=null!=t.f,i&=null!=t.ea,12==r&&(i&=d>=o,i&=d*(a-1)+o<=t.Tc,i&=null!=t.F)}else i=0;t=i?0:2}}return 0!=t||null!=n&&n.fd&&(t=Dn(e)),t}var Tn=64,zn=[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],_n=24,Un=32,Vn=8,Wn=[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];T("Predictor0","PredictorAdd0"),t.Predictor0=function(){return 4278190080},t.Predictor1=function(t){return t},t.Predictor2=function(t,i,n){return i[n+0]},t.Predictor3=function(t,i,n){return i[n+1]},t.Predictor4=function(t,i,n){return i[n-1]},t.Predictor5=function(t,i,n){return _(_(t,i[n+1]),i[n+0])},t.Predictor6=function(t,i,n){return _(t,i[n-1])},t.Predictor7=function(t,i,n){return _(t,i[n+0])},t.Predictor8=function(t,i,n){return _(i[n-1],i[n+0])},t.Predictor9=function(t,i,n){return _(i[n+0],i[n+1])},t.Predictor10=function(t,i,n){return _(_(t,i[n-1]),_(i[n+0],i[n+1]))},t.Predictor11=function(t,i,n){var e=i[n+0];return 0>=W(e>>24&255,t>>24&255,(i=i[n-1])>>24&255)+W(e>>16&255,t>>16&255,i>>16&255)+W(e>>8&255,t>>8&255,i>>8&255)+W(255&e,255&t,255&i)?e:t},t.Predictor12=function(t,i,n){var e=i[n+0];return(U((t>>24&255)+(e>>24&255)-((i=i[n-1])>>24&255))<<24|U((t>>16&255)+(e>>16&255)-(i>>16&255))<<16|U((t>>8&255)+(e>>8&255)-(i>>8&255))<<8|U((255&t)+(255&e)-(255&i)))>>>0},t.Predictor13=function(t,i,n){var e=i[n-1];return(V((t=_(t,i[n+0]))>>24&255,e>>24&255)<<24|V(t>>16&255,e>>16&255)<<16|V(t>>8&255,e>>8&255)<<8|V(t>>0&255,e>>0&255))>>>0};var Hn=t.PredictorAdd0;t.PredictorAdd1=H,T("Predictor2","PredictorAdd2"),T("Predictor3","PredictorAdd3"),T("Predictor4","PredictorAdd4"),T("Predictor5","PredictorAdd5"),T("Predictor6","PredictorAdd6"),T("Predictor7","PredictorAdd7"),T("Predictor8","PredictorAdd8"),T("Predictor9","PredictorAdd9"),T("Predictor10","PredictorAdd10"),T("Predictor11","PredictorAdd11"),T("Predictor12","PredictorAdd12"),T("Predictor13","PredictorAdd13");var Gn=t.PredictorAdd2;K("ColorIndexInverseTransform","MapARGB","32b",(function(t){return t>>8&255}),(function(t){return t})),K("VP8LColorIndexInverseTransformAlpha","MapAlpha","8b",(function(t){return t}),(function(t){return t>>8&255}));var Jn,Yn=t.ColorIndexInverseTransform,Kn=t.MapARGB,Xn=t.VP8LColorIndexInverseTransformAlpha,$n=t.MapAlpha,Qn=t.VP8LPredictorsAdd=[];Qn.length=16,(t.VP8LPredictors=[]).length=16,(t.VP8LPredictorsAdd_C=[]).length=16,(t.VP8LPredictors_C=[]).length=16;var Zn,te,ie,ne,ee,re,se,oe,ae,ue,ce,he,fe,le,de,ve,me,we,pe,be,ge,Ne,Le,ye,Ae,ke,Se,xe,qe=s(511),Me=s(2041),je=s(225),Ee=s(767),Pe=0,Ie=Me,Fe=je,Re=Ee,Oe=qe,Be=0,De=1,Ce=2,Te=3,ze=4,_e=5,Ue=6,Ve=7,We=8,He=9,Ge=10,Je=[2,3,7],Ye=[3,3,11],Ke=[280,256,256,256,40],Xe=[0,1,1,1,0],$e=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],Qe=[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],Ze=[2954,2956,2958,2962,2970,2986,3018,3082,3212,3468,3980,5004],tr=8,ir=[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],nr=[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],er=null,rr=[[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]],sr=[0,1,4,8,5,2,3,6,9,12,13,10,7,11,14,15],or=[-0,1,-1,2,-2,3,4,6,-3,5,-4,-5,-6,7,-7,8,-8,-9],ar=[[[[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]]]],ur=[[[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]]],cr=[[[[255,255,255,255,255,255,255,255,255,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]]]],hr=[0,1,2,3,6,4,5,6,6,6,6,6,6,6,6,7,0],fr=[],lr=[],dr=[],vr=1,mr=2,wr=[],pr=[];bn("UpsampleRgbLinePair",kn,3),bn("UpsampleBgrLinePair",Sn,3),bn("UpsampleRgbaLinePair",En,4),bn("UpsampleBgraLinePair",jn,4),bn("UpsampleArgbLinePair",Mn,4),bn("UpsampleRgba4444LinePair",qn,2),bn("UpsampleRgb565LinePair",xn,2);var br=t.UpsampleRgbLinePair,gr=t.UpsampleBgrLinePair,Nr=t.UpsampleRgbaLinePair,Lr=t.UpsampleBgraLinePair,yr=t.UpsampleArgbLinePair,Ar=t.UpsampleRgba4444LinePair,kr=t.UpsampleRgb565LinePair,Sr=16,xr=1<<Sr-1,qr=-227,Mr=482,jr=6,Er=(256<<jr)-1,Pr=0,Ir=s(256),Fr=s(256),Rr=s(256),Or=s(256),Br=s(Mr-qr),Dr=s(Mr-qr);Pn("YuvToRgbRow",kn,3),Pn("YuvToBgrRow",Sn,3),Pn("YuvToRgbaRow",En,4),Pn("YuvToBgraRow",jn,4),Pn("YuvToArgbRow",Mn,4),Pn("YuvToRgba4444Row",qn,2),Pn("YuvToRgb565Row",xn,2);var Cr=[0,4,8,12,128,132,136,140,256,260,264,268,384,388,392,396],Tr=[0,2,8],zr=[8,7,6,4,4,2,2,2,1,1,1,1],_r=1;this.WebPDecodeRGBA=function(t,n,e,r,s){var o=De,a=new en,u=new ot;a.ba=u,u.S=o,u.width=[u.width],u.height=[u.height];var c=u.width,h=u.height,f=new at;if(null==f||null==t)var l=2;else i(null!=f),l=On(t,n,e,f.width,f.height,f.Pd,f.Qd,f.format,null);if(0!=l?c=0:(null!=c&&(c[0]=f.width[0]),null!=h&&(h[0]=f.height[0]),c=1),c){u.width=u.width[0],u.height=u.height[0],null!=r&&(r[0]=u.width),null!=s&&(s[0]=u.height);t:{if(r=new Gt,(s=new rn).data=t,s.w=n,s.ha=e,s.kd=1,n=[0],i(null!=s),(0==(t=On(s.data,s.w,s.ha,null,null,null,n,null,s))||7==t)&&n[0]&&(t=4),0==(n=t)){if(i(null!=a),r.data=s.data,r.w=s.w+s.offset,r.ha=s.ha-s.offset,r.put=dt,r.ac=lt,r.bc=vt,r.ma=a,s.xa){if(null==(t=Mt())){a=1;break t}if(function(t,n){var e=[0],r=[0],s=[0];i:for(;;){if(null==t)return 0;if(null==n)return t.a=2,0;if(t.l=n,t.a=0,p(t.m,n.data,n.w,n.ha),!mt(t.m,e,r,s)){t.a=3;break i}if(t.xb=mr,n.width=e[0],n.height=r[0],!jt(e[0],r[0],1,t,null))break i;return 1}return i(0!=t.a),0}(t,r)){if(r=0==(n=Cn(r.width,r.height,a.Oa,a.ba))){i:{r=t;n:for(;;){if(null==r){r=0;break i}if(i(null!=r.s.yc),i(null!=r.s.Ya),i(0<r.s.Wb),i(null!=(e=r.l)),i(null!=(s=e.ma)),0!=r.xb){if(r.ca=s.ba,r.tb=s.tb,i(null!=r.ca),!Bn(s.Oa,e,Te)){r.a=2;break n}if(!Et(r,e.width))break n;if(e.da)break n;if((e.da||et(r.ca.S))&&pn(),11>r.ca.S||(alert("todo:WebPInitConvertARGBToYUV"),null!=r.ca.f.kb.F&&pn()),r.Pb&&0<r.s.ua&&null==r.s.vb.X&&!F(r.s.vb,r.s.Wa.Xa)){r.a=1;break n}r.xb=0}if(!xt(r,r.V,r.Ba,r.c,r.i,e.o,yt))break n;s.Dc=r.Ma,r=1;break i}i(0!=r.a),r=0}r=!r}r&&(n=t.a)}else n=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,Xt(t,r)){if(0==(n=Cn(r.width,r.height,a.Oa,a.ba))){if(t.Aa=0,e=a.Oa,i(null!=(s=t)),null!=e){if(0<(c=0>(c=e.Md)?0:100<c?255:255*c/100)){for(h=f=0;4>h;++h)12>(l=s.pb[h]).lc&&(l.ia=c*zr[0>l.lc?0:l.lc]>>3),f|=l.ia;f&&(alert("todo:VP8InitRandom"),s.ia=1)}s.Ga=e.Id,100<s.Ga?s.Ga=100:0>s.Ga&&(s.Ga=0)}Zt(t,r)||(n=t.a)}}else n=t.a}0==n&&null!=a.Oa&&a.Oa.fd&&(n=Dn(a.ba))}a=n}o=0!=a?null:11>o?u.f.RGBA.eb:u.f.kb.y}else o=null;return o};var Ur=[3,4,3,4,4,2,2,4,4,4,2,1,1]};function c(t,i){for(var n="",e=0;e<4;e++)n+=String.fromCharCode(t[i++]);return n}function h(t,i){return(t[i+0]<<0|t[i+1]<<8|t[i+2]<<16)>>>0}function f(t,i){return(t[i+0]<<0|t[i+1]<<8|t[i+2]<<16|t[i+3]<<24)>>>0}new u;var l=[0],d=[0],v=[],m=new u,w=t,p=function(t,i){var n={},e=0,r=!1,s=0,o=0;if(n.frames=[],!
249
+ */function bn(t,i){if(this.pos=0,this.buffer=t,this.datav=new DataView(t.buffer),this.is_with_alpha=!!i,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 gn(t){function i(t){if(!t)throw Error("assert :P")}function n(t,i,n){for(var e=0;4>e;e++)if(t[i+e]!=n.charCodeAt(e))return!0;return!1}function e(t,i,n,e,r){for(var s=0;s<r;s++)t[i+s]=n[e+s]}function r(t,i,n,e){for(var r=0;r<e;r++)t[i+r]=n}function s(t){return new Int32Array(t)}function o(t,i){for(var n=[],e=0;e<t;e++)n.push(new i);return n}function a(t,i){var n=[];return function t(n,e,r){for(var s=r[e],o=0;o<s&&(n.push(r.length>e+1?[]:new i),!(r.length<e+1));o++)t(n[o],e+1,r)}(n,0,t),n}var u=function(){var t=this;function u(t,i){for(var n=1<<i-1>>>0;t&n;)n>>>=1;return n?(t&n-1)+n:t}function c(t,n,e,r,s){i(!(r%e));do{t[n+(r-=e)]=s}while(0<r)}function h(t,n,e,r,o){if(i(2328>=o),512>=o)var a=s(512);else if(null==(a=s(o)))return 0;return function(t,n,e,r,o,a){var h,l,d=n,v=1<<e,m=s(16),w=s(16);for(i(0!=o),i(null!=r),i(null!=t),i(0<e),l=0;l<o;++l){if(15<r[l])return 0;++m[r[l]]}if(m[0]==o)return 0;for(w[1]=0,h=1;15>h;++h){if(m[h]>1<<h)return 0;w[h+1]=w[h]+m[h]}for(l=0;l<o;++l)h=r[l],0<r[l]&&(a[w[h]++]=l);if(1==w[15])return(r=new f).g=0,r.value=a[0],c(t,d,1,v,r),v;var p,b=-1,g=v-1,N=0,L=1,y=1,A=1<<e;for(l=0,h=1,o=2;h<=e;++h,o<<=1){if(L+=y<<=1,0>(y-=m[h]))return 0;for(;0<m[h];--m[h])(r=new f).g=h,r.value=a[l++],c(t,d+N,o,A,r),N=u(N,h)}for(h=e+1,o=2;15>=h;++h,o<<=1){if(L+=y<<=1,0>(y-=m[h]))return 0;for(;0<m[h];--m[h]){if(r=new f,(N&g)!=b){for(d+=A,p=1<<(b=h)-e;15>b&&!(0>=(p-=m[b]));)++b,p<<=1;v+=A=1<<(p=b-e),t[n+(b=N&g)].g=p+e,t[n+b].value=d-n-b}r.g=h-e,r.value=a[l++],c(t,d+(N>>e),o,A,r),N=u(N,h)}}return L!=2*w[15]-1?0:v}(t,n,e,r,o,a)}function f(){this.value=this.g=0}function l(){this.value=this.g=0}function d(){this.G=o(5,f),this.H=s(5),this.jc=this.Qb=this.qb=this.nd=0,this.pd=o(Tn,l)}function v(t,n,e,r){i(null!=t),i(null!=n),i(2147483648>r),t.Ca=254,t.I=0,t.b=-8,t.Ka=0,t.oa=n,t.pa=e,t.Jd=n,t.Yc=e+r,t.Zc=4<=r?e+r-4+1:e,x(t)}function m(t,i){for(var n=0;0<i--;)n|=M(t,128)<<i;return n}function w(t,i){var n=m(t,i);return q(t)?-n:n}function p(t,n,e,r){var s,o=0;for(i(null!=t),i(null!=n),i(4294967288>r),t.Sb=r,t.Ra=0,t.u=0,t.h=0,4<r&&(r=4),s=0;s<r;++s)o+=n[e+s]<<8*s;t.Ra=o,t.bb=r,t.oa=n,t.pa=e}function b(t){for(;8<=t.u&&t.bb<t.Sb;)t.Ra>>>=8,t.Ra+=t.oa[t.pa+t.bb]<<Un-8>>>0,++t.bb,t.u-=8;A(t)&&(t.h=1,t.u=0)}function g(t,n){if(i(0<=n),!t.h&&n<=_n){var e=y(t)&zn[n];return t.u+=n,b(t),e}return t.h=1,t.u=0}function N(){this.b=this.Ca=this.I=0,this.oa=[],this.pa=0,this.Jd=[],this.Yc=0,this.Zc=[],this.Ka=0}function L(){this.Ra=0,this.oa=[],this.h=this.u=this.bb=this.Sb=this.pa=0}function y(t){return t.Ra>>>(t.u&Un-1)>>>0}function A(t){return i(t.bb<=t.Sb),t.h||t.bb==t.Sb&&t.u>Un}function k(t,i){t.u=i,t.h=A(t)}function S(t){t.u>=Vn&&(i(t.u>=Vn),b(t))}function x(t){i(null!=t&&null!=t.oa),t.pa<t.Zc?(t.I=(t.oa[t.pa++]|t.I<<8)>>>0,t.b+=8):(i(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 m(t,1)}function M(t,i){var n=t.Ca;0>t.b&&x(t);var e=t.b,r=n*i>>>8,s=(t.I>>>e>r)+0;for(s?(n-=r,t.I-=r+1<<e>>>0):n=r+1,e=n,r=0;256<=e;)r+=8,e>>=8;return t.b-=e=7^r+Wn[e],t.Ca=(n<<e)-1,s}function j(t,i,n){t[i+0]=n>>24&255,t[i+1]=n>>16&255,t[i+2]=n>>8&255,t[i+3]=n>>0&255}function E(t,i){return t[i+0]<<0|t[i+1]<<8}function P(t,i){return E(t,i)|t[i+2]<<16}function I(t,i){return E(t,i)|E(t,i+2)<<16}function O(t,n){var e=1<<n;return i(null!=t),i(0<n),t.X=s(e),null==t.X?0:(t.Mb=32-n,t.Xa=n,1)}function F(t,n){i(null!=t),i(null!=n),i(t.Xa==n.Xa),e(n.X,0,t.X,0,1<<n.Xa)}function R(){this.X=[],this.Xa=this.Mb=0}function B(t,n,e,r){i(null!=e),i(null!=r);var s=e[0],o=r[0];return 0==s&&(s=(t*o+n/2)/n),0==o&&(o=(n*s+t/2)/t),0>=s||0>=o?0:(e[0]=s,r[0]=o,1)}function C(t,i){return t+(1<<i)-1>>>i}function D(t,i){return((4278255360&t)+(4278255360&i)>>>0&4278255360)+((16711935&t)+(16711935&i)>>>0&16711935)>>>0}function T(i,n){t[n]=function(n,e,r,s,o,a,u){var c;for(c=0;c<o;++c){var h=t[i](a[u+c-1],r,s+c);a[u+c]=D(n[e+c],h)}}}function z(){this.ud=this.hd=this.jd=0}function _(t,i){return((4278124286&(t^i))>>>1)+(t&i)>>>0}function U(t){return 0<=t&&256>t?t:0>t?0:255<t?255:void 0}function V(t,i){return U(t+(t-i+.5>>1))}function W(t,i,n){return Math.abs(i-n)-Math.abs(t-n)}function H(t,i,n,e,r,s,o){for(e=s[o-1],n=0;n<r;++n)s[o+n]=e=D(t[i+n],e)}function G(t,i,n,e,r){var s;for(s=0;s<n;++s){var o=t[i+s],a=o>>8&255,u=16711935&(u=(u=16711935&o)+((a<<16)+a));e[r+s]=(4278255360&o)+u>>>0}}function J(t,i){i.jd=t>>0&255,i.hd=t>>8&255,i.ud=t>>16&255}function Y(t,i,n,e,r,s){var o;for(o=0;o<e;++o){var a=i[n+o],u=a>>>8,c=a,h=255&(h=(h=a>>>16)+((t.jd<<24>>24)*(u<<24>>24)>>>5));c=255&(c=(c+=(t.hd<<24>>24)*(u<<24>>24)>>>5)+((t.ud<<24>>24)*(h<<24>>24)>>>5)),r[s+o]=(4278255360&a)+(h<<16)+c}}function K(i,n,e,r,s){t[n]=function(t,i,n,e,o,a,u,c,h){for(e=u;e<c;++e)for(u=0;u<h;++u)o[a++]=s(n[r(t[i++])])},t[i]=function(i,n,o,a,u,c,h){var f=8>>i.b,l=i.Ea,d=i.K[0],v=i.w;if(8>f)for(i=(1<<i.b)-1,v=(1<<f)-1;n<o;++n){var m,w=0;for(m=0;m<l;++m)m&i||(w=r(a[u++])),c[h++]=s(d[w&v]),w>>=f}else t["VP8LMapColor"+e](a,u,d,v,c,h,n,o,l)}}function X(t,i,n,e,r){for(n=i+n;i<n;){var s=t[i++];e[r++]=s>>16&255,e[r++]=s>>8&255,e[r++]=s>>0&255}}function $(t,i,n,e,r){for(n=i+n;i<n;){var s=t[i++];e[r++]=s>>16&255,e[r++]=s>>8&255,e[r++]=s>>0&255,e[r++]=s>>24&255}}function Q(t,i,n,e,r){for(n=i+n;i<n;){var s=(o=t[i++])>>16&240|o>>12&15,o=o>>0&240|o>>28&15;e[r++]=s,e[r++]=o}}function Z(t,i,n,e,r){for(n=i+n;i<n;){var s=(o=t[i++])>>16&248|o>>13&7,o=o>>5&224|o>>3&31;e[r++]=s,e[r++]=o}}function tt(t,i,n,e,r){for(n=i+n;i<n;){var s=t[i++];e[r++]=s>>0&255,e[r++]=s>>8&255,e[r++]=s>>16&255}}function it(t,i,n,r,s,o){if(0==o)for(n=i+n;i<n;)j(r,((o=t[i++])[0]>>24|o[1]>>8&65280|o[2]<<8&16711680|o[3]<<24)>>>0),s+=32;else e(r,s,t,i,n)}function nt(i,n){t[n][0]=t[i+"0"],t[n][1]=t[i+"1"],t[n][2]=t[i+"2"],t[n][3]=t[i+"3"],t[n][4]=t[i+"4"],t[n][5]=t[i+"5"],t[n][6]=t[i+"6"],t[n][7]=t[i+"7"],t[n][8]=t[i+"8"],t[n][9]=t[i+"9"],t[n][10]=t[i+"10"],t[n][11]=t[i+"11"],t[n][12]=t[i+"12"],t[n][13]=t[i+"13"],t[n][14]=t[i+"0"],t[n][15]=t[i+"0"]}function et(t){return t==Ve||t==We||t==He||t==Ge}function rt(){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 rt,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 ct(t){return alert("todo:WebPSamplerProcessPlane"),t.T}function ht(t,i){var n=t.T,r=i.ba.f.RGBA,s=r.eb,o=r.fb+t.ka*r.A,a=pr[i.ba.S],u=t.y,c=t.O,h=t.f,f=t.N,l=t.ea,d=t.W,v=i.cc,m=i.dc,w=i.Mc,p=i.Nc,b=t.ka,g=t.ka+t.T,N=t.U,L=N+1>>1;for(0==b?a(u,c,null,null,h,f,l,d,h,f,l,d,s,o,null,null,N):(a(i.ec,i.fc,u,c,v,m,w,p,h,f,l,d,s,o-r.A,s,o,N),++n);b+2<g;b+=2)a(u,(c+=2*t.fa)-t.fa,u,c,v=h,m=f,w=l,p=d,h,f+=t.Rc,l,d+=t.Rc,s,(o+=2*r.A)-r.A,s,o,N);return c+=t.fa,t.j+g<t.o?(e(i.ec,i.fc,u,c,N),e(i.cc,i.dc,h,f,L),e(i.Mc,i.Nc,l,d,L),n--):1&g||a(u,c,null,null,h,f,l,d,h,f,l,d,s,o+r.A,null,null,N),n}function ft(t,n,e){var r=t.F,s=[t.J];if(null!=r){var o=t.U,a=n.ba.S,u=a==ze||a==He;n=n.ba.f.RGBA;var c=[0],h=t.ka;c[0]=t.T,t.Kb&&(0==h?--c[0]:(--h,s[0]-=t.width),t.j+t.ka+t.T==t.o&&(c[0]=t.o-t.j-h));var f=n.eb;t=Se(r,s[0],t.width,o,c,f,(h=n.fb+h*n.A)+(u?0:3),n.A),i(e==c),t&&et(a)&&Ae(f,h,u,o,c,n.A)}return 0}function lt(t){var i=t.ma,n=i.ba.S,e=11>n,r=n==Ce||n==Te||n==ze||n==_e||12==n||et(n);if(i.memory=null,i.Ib=null,i.Jb=null,i.Nd=null,!Bn(i.Oa,t,r?11:12))return 0;if(r&&et(n)&&gn(),t.da)alert("todo:use_scaling");else{if(e){if(i.Ib=ct,t.Kb){if(i.memory=s(t.U+2*(n=t.U+1>>1)),null==i.memory)return 0;i.ec=i.memory,i.fc=0,i.cc=i.ec,i.dc=i.fc+t.U,i.Mc=i.cc,i.Nc=i.dc+n,i.Ib=ht,gn()}}else alert("todo:EmitYUV");r&&(i.Jb=ft,e&&pn())}if(e&&!Pr){for(t=0;256>t;++t)Ir[t]=89858*(t-128)+xr>>Sr,Rr[t]=-22014*(t-128)+xr,Fr[t]=-45773*(t-128),Or[t]=113618*(t-128)+xr>>Sr;for(t=qr;t<Mr;++t)Br[t-qr]=Ht(i=76283*(t-16)+xr>>Sr,255),Cr[t-qr]=Ht(i+8>>4,15);Pr=1}return 1}function dt(t){var n=t.ma,e=t.U,r=t.T;return i(!(1&t.ka)),0>=e||0>=r?0:(e=n.Ib(t,n),null!=n.Jb&&n.Jb(t,n,e),n.Dc+=e,1)}function vt(t){t.ma.memory=null}function mt(t,i,n,e){return 47!=g(t,8)?0:(i[0]=g(t,14)+1,n[0]=g(t,14)+1,e[0]=g(t,1),0!=g(t,3)?0:!t.h)}function wt(t,i){if(4>t)return t+1;var n=t-2>>1;return(2+(1&t)<<n)+g(i,n)+1}function pt(t,i){return 120<i?i-120:1<=(n=((n=Qe[i-1])>>4)*t+(8-(15&n)))?n:1;var n}function bt(t,i,n){var e=y(n),r=t[i+=255&e].g-8;return 0<r&&(k(n,n.u+8),e=y(n),i+=t[i].value,i+=e&(1<<r)-1),k(n,n.u+t[i].g),t[i].value}function gt(t,n,e){return e.g+=t.g,e.value+=t.value<<n>>>0,i(8>=e.g),t.g}function Nt(t,n,e){var r=t.xc;return i((n=0==r?0:t.vc[t.md*(e>>r)+(n>>r)])<t.Wb),t.Ya[n]}function Lt(t,n,r,s){var o=t.ab,a=t.c*n,u=t.C;n=u+n;var c=r,h=s;for(s=t.Ta,r=t.Ua;0<o--;){var f=t.gc[o],l=u,d=n,v=c,m=h,w=(h=s,c=r,f.Ea);switch(i(l<d),i(d<=f.nc),f.hc){case 2:Jn(v,m,(d-l)*w,h,c);break;case 0:var p=l,b=d,g=h,N=c,L=(x=f).Ea;0==p&&(Hn(v,m,null,null,1,g,N),H(v,m+1,0,0,L-1,g,N+1),m+=L,N+=L,++p);for(var y=1<<x.b,A=y-1,k=C(L,x.b),S=x.K,x=x.w+(p>>x.b)*k;p<b;){var q=S,M=x,j=1;for(Gn(v,m,g,N-L,1,g,N);j<L;){var E=(j&~A)+y;E>L&&(E=L),(0,Qn[q[M++]>>8&15])(v,m+ +j,g,N+j-L,E-j,g,N+j),j=E}m+=L,N+=L,++p&A||(x+=k)}d!=f.nc&&e(h,c-w,h,c+(d-l-1)*w,w);break;case 1:for(w=v,b=m,L=(v=f.Ea)-(N=v&~(g=(m=1<<f.b)-1)),p=C(v,f.b),y=f.K,f=f.w+(l>>f.b)*p;l<d;){for(A=y,k=f,S=new z,x=b+N,q=b+v;b<x;)J(A[k++],S),Zn(S,w,b,m,h,c),b+=m,c+=m;b<q&&(J(A[k++],S),Zn(S,w,b,L,h,c),b+=L,c+=L),++l&g||(f+=p)}break;case 3:if(v==h&&m==c&&0<f.b){for(b=h,v=w=c+(d-l)*w-(N=(d-l)*C(f.Ea,f.b)),m=h,g=c,p=[],N=(L=N)-1;0<=N;--N)p[N]=m[g+N];for(N=L-1;0<=N;--N)b[v+N]=p[N];Yn(f,l,d,h,w,h,c)}else Yn(f,l,d,v,m,h,c)}c=s,h=r}h!=r&&e(s,r,c,h,a)}function yt(t,n){var e=t.V,r=t.Ba+t.c*t.C,s=n-t.C;if(i(n<=t.l.o),i(16>=s),0<s){var o=t.l,a=t.Ta,u=t.Ua,c=o.width;if(Lt(t,s,e,r),s=u=[u],i((e=t.C)<(r=n)),i(o.v<o.va),r>o.o&&(r=o.o),e<o.j){var h=o.j-e;e=o.j,s[0]+=h*c}if(e>=r?e=0:(s[0]+=4*o.v,o.ka=e-o.j,o.U=o.va-o.v,o.T=r-e,e=1),e){if(u=u[0],11>(e=t.ca).S){var f=e.f.RGBA,l=(r=e.S,s=o.U,o=o.T,h=f.eb,f.A),d=o;for(f=f.fb+t.Ma*f.A;0<d--;){var v=a,m=u,w=s,p=h,b=f;switch(r){case Be:te(v,m,w,p,b);break;case Ce:ie(v,m,w,p,b);break;case Ve:ie(v,m,w,p,b),Ae(p,b,0,w,1,0);break;case De:re(v,m,w,p,b);break;case Te:it(v,m,w,p,b,1);break;case We:it(v,m,w,p,b,1),Ae(p,b,0,w,1,0);break;case ze:it(v,m,w,p,b,0);break;case He:it(v,m,w,p,b,0),Ae(p,b,1,w,1,0);break;case _e:ne(v,m,w,p,b);break;case Ge:ne(v,m,w,p,b),ke(p,b,w,1,0);break;case Ue:ee(v,m,w,p,b);break;default:i(0)}u+=c,f+=l}t.Ma+=o}else alert("todo:EmitRescaledRowsYUVA");i(t.Ma<=e.height)}}t.C=n,i(t.C<=t.i)}function At(t){var i;if(0<t.ua)return 0;for(i=0;i<t.Wb;++i){var n=t.Ya[i].G,e=t.Ya[i].H;if(0<n[1][e[1]+0].g||0<n[2][e[2]+0].g||0<n[3][e[3]+0].g)return 0}return 1}function kt(t,n,e,r,s,o){if(0!=t.Z){var a=t.qd,u=t.rd;for(i(null!=wr[t.Z]);n<e;++n)wr[t.Z](a,u,r,s,r,s,o),a=r,u=s,s+=o;t.qd=a,t.rd=u}}function St(t,n){var e=t.l.ma,r=0==e.Z||1==e.Z?t.l.j:t.C;if(r=t.C<r?r:t.C,i(n<=t.l.o),n>r){var s=t.l.width,o=e.ca,a=e.tb+s*r,u=t.V,c=t.Ba+t.c*r,h=t.gc;i(1==t.ab),i(3==h[0].hc),Xn(h[0],r,n,u,c,o,a),kt(e,r,n,o,a,s)}t.C=t.Ma=n}function xt(t,n,e,r,s,o,a){var u=t.$/r,c=t.$%r,h=t.m,f=t.s,l=e+t.$,d=l;s=e+r*s;var v=e+r*o,m=280+f.ua,w=t.Pb?u:16777216,p=0<f.ua?f.Wa:null,b=f.wc,g=l<v?Nt(f,c,u):null;i(t.C<o),i(v<=s);var N=!1;t:for(;;){for(;N||l<v;){var L=0;if(u>=w){var x=l-e;i((w=t).Pb),w.wd=w.m,w.xd=x,0<w.s.ua&&F(w.s.Wa,w.s.vb),w=u+tr}if(c&b||(g=Nt(f,c,u)),i(null!=g),g.Qb&&(n[l]=g.qb,N=!0),!N)if(S(h),g.jc){x=n;var q=l,M=g.pd[y(L=h)&Tn-1];i(g.jc),256>M.g?(k(L,L.u+M.g),x[q]=M.value,L=0):(k(L,L.u+M.g-256),i(256<=M.value),L=M.value),0==L&&(N=!0)}else L=bt(g.G[0],g.H[0],h);if(h.h)break;if(N||256>L){if(!N)if(g.nd)n[l]=(g.qb|L<<8)>>>0;else{if(S(h),N=bt(g.G[1],g.H[1],h),S(h),x=bt(g.G[2],g.H[2],h),q=bt(g.G[3],g.H[3],h),h.h)break;n[l]=(q<<24|N<<16|L<<8|x)>>>0}if(N=!1,++l,++c>=r&&(c=0,++u,null!=a&&u<=o&&!(u%16)&&a(t,u),null!=p))for(;d<l;)L=n[d++],p.X[(506832829*L&4294967295)>>>p.Mb]=L}else if(280>L){if(L=wt(L-256,h),x=bt(g.G[4],g.H[4],h),S(h),x=pt(r,x=wt(x,h)),h.h)break;if(l-e<x||s-l<L)break t;for(q=0;q<L;++q)n[l+q]=n[l+q-x];for(l+=L,c+=L;c>=r;)c-=r,++u,null!=a&&u<=o&&!(u%16)&&a(t,u);if(i(l<=s),c&b&&(g=Nt(f,c,u)),null!=p)for(;d<l;)L=n[d++],p.X[(506832829*L&4294967295)>>>p.Mb]=L}else{if(!(L<m))break t;for(N=L-280,i(null!=p);d<l;)L=n[d++],p.X[(506832829*L&4294967295)>>>p.Mb]=L;L=l,i(!(N>>>(x=p).Xa)),n[L]=x.X[N],N=!0}N||i(h.h==A(h))}if(t.Pb&&h.h&&l<s)i(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(h.h)break t;null!=a&&a(t,u>o?o:u),t.a=0,t.$=l-e}return 1}return t.a=3,0}function qt(t){i(null!=t),t.vc=null,t.yc=null,t.Ya=null;var n=t.Wa;null!=n&&(n.X=null),t.vb=null,i(null!=t)}function Mt(){var i=new an;return null==i?null:(i.a=0,i.xb=mr,nt("Predictor","VP8LPredictors"),nt("Predictor","VP8LPredictors_C"),nt("PredictorAdd","VP8LPredictorsAdd"),nt("PredictorAdd","VP8LPredictorsAdd_C"),Jn=G,Zn=Y,te=X,ie=$,ne=Q,ee=Z,re=tt,t.VP8LMapColor32b=Kn,t.VP8LMapColor8b=$n,i)}function jt(t,n,e,a,u){var c=1,l=[t],v=[n],m=a.m,w=a.s,p=null,b=0;t:for(;;){if(e)for(;c&&g(m,1);){var N=l,L=v,A=a,x=1,q=A.m,M=A.gc[A.ab],j=g(q,2);if(A.Oc&1<<j)c=0;else{switch(A.Oc|=1<<j,M.hc=j,M.Ea=N[0],M.nc=L[0],M.K=[null],++A.ab,i(4>=A.ab),j){case 0:case 1:M.b=g(q,3)+2,x=jt(C(M.Ea,M.b),C(M.nc,M.b),0,A,M.K),M.K=M.K[0];break;case 3:var E,P=g(q,8)+1,I=16<P?0:4<P?1:2<P?2:3;if(N[0]=C(M.Ea,I),M.b=I,E=x=jt(P,1,0,A,M.K)){var F,R=P,B=M,T=1<<(8>>B.b),z=s(T);if(null==z)E=0;else{var _=B.K[0],U=B.w;for(z[0]=B.K[0][0],F=1;F<1*R;++F)z[F]=D(_[U+F],z[F-1]);for(;F<4*T;++F)z[F]=0;B.K[0]=null,B.K[0]=z,E=1}}x=E;break;case 2:break;default:i(0)}c=x}}if(l=l[0],v=v[0],c&&g(m,1)&&!(c=1<=(b=g(m,4))&&11>=b)){a.a=3;break t}var V;if(V=c)i:{var W,H,G,J=a,Y=l,K=v,X=b,$=e,Q=J.m,Z=J.s,tt=[null],it=1,nt=0,et=Ze[X];n:for(;;){if($&&g(Q,1)){var rt=g(Q,3)+2,st=C(Y,rt),ot=C(K,rt),at=st*ot;if(!jt(st,ot,0,J,tt))break n;for(tt=tt[0],Z.xc=rt,W=0;W<at;++W){var ut=tt[W]>>8&65535;tt[W]=ut,ut>=it&&(it=ut+1)}}if(Q.h)break n;for(H=0;5>H;++H){var ct=Ke[H];!H&&0<X&&(ct+=1<<X),nt<ct&&(nt=ct)}var ht=o(it*et,f),ft=it,lt=o(ft,d);if(null==lt)var dt=null;else i(65536>=ft),dt=lt;var vt=s(nt);if(null==dt||null==vt||null==ht){J.a=1;break n}var mt=ht;for(W=G=0;W<it;++W){var wt=dt[W],pt=wt.G,bt=wt.H,Nt=0,Lt=1,yt=0;for(H=0;5>H;++H){ct=Ke[H],pt[H]=mt,bt[H]=G,!H&&0<X&&(ct+=1<<X);e:{var At,kt=ct,St=J,Mt=vt,Et=mt,Pt=G,It=0,Ot=St.m,Ft=g(Ot,1);if(r(Mt,0,0,kt),Ft){var Rt=g(Ot,1)+1,Bt=g(Ot,1),Ct=g(Ot,0==Bt?1:8);Mt[Ct]=1,2==Rt&&(Mt[Ct=g(Ot,8)]=1);var Dt=1}else{var Tt=s(19),zt=g(Ot,4)+4;if(19<zt){St.a=3;var _t=0;break e}for(At=0;At<zt;++At)Tt[$e[At]]=g(Ot,3);var Ut=void 0,Vt=void 0,Wt=St,Ht=Tt,Gt=kt,Jt=Mt,Yt=0,Kt=Wt.m,Xt=8,$t=o(128,f);r:for(;h($t,0,7,Ht,19);){if(g(Kt,1)){var Qt=2+2*g(Kt,3);if((Ut=2+g(Kt,Qt))>Gt)break r}else Ut=Gt;for(Vt=0;Vt<Gt&&Ut--;){S(Kt);var Zt=$t[0+(127&y(Kt))];k(Kt,Kt.u+Zt.g);var ti=Zt.value;if(16>ti)Jt[Vt++]=ti,0!=ti&&(Xt=ti);else{var ii=16==ti,ni=ti-16,ei=Ye[ni],ri=g(Kt,Je[ni])+ei;if(Vt+ri>Gt)break r;for(var si=ii?Xt:0;0<ri--;)Jt[Vt++]=si}}Yt=1;break r}Yt||(Wt.a=3),Dt=Yt}(Dt=Dt&&!Ot.h)&&(It=h(Et,Pt,8,Mt,kt)),Dt&&0!=It?_t=It:(St.a=3,_t=0)}if(0==_t)break n;if(Lt&&1==Xe[H]&&(Lt=0==mt[G].g),Nt+=mt[G].g,G+=_t,3>=H){var oi,ai=vt[0];for(oi=1;oi<ct;++oi)vt[oi]>ai&&(ai=vt[oi]);yt+=ai}}if(wt.nd=Lt,wt.Qb=0,Lt&&(wt.qb=(pt[3][bt[3]+0].value<<24|pt[1][bt[1]+0].value<<16|pt[2][bt[2]+0].value)>>>0,0==Nt&&256>pt[0][bt[0]+0].value&&(wt.Qb=1,wt.qb+=pt[0][bt[0]+0].value<<8)),wt.jc=!wt.Qb&&6>yt,wt.jc){var ui,ci=wt;for(ui=0;ui<Tn;++ui){var hi=ui,fi=ci.pd[hi],li=ci.G[0][ci.H[0]+hi];256<=li.value?(fi.g=li.g+256,fi.value=li.value):(fi.g=0,fi.value=0,hi>>=gt(li,8,fi),hi>>=gt(ci.G[1][ci.H[1]+hi],16,fi),hi>>=gt(ci.G[2][ci.H[2]+hi],0,fi),gt(ci.G[3][ci.H[3]+hi],24,fi))}}}Z.vc=tt,Z.Wb=it,Z.Ya=dt,Z.yc=ht,V=1;break i}V=0}if(!(c=V)){a.a=3;break t}if(0<b){if(w.ua=1<<b,!O(w.Wa,b)){a.a=1,c=0;break t}}else w.ua=0;var di=a,vi=l,mi=v,wi=di.s,pi=wi.xc;if(di.c=vi,di.i=mi,wi.md=C(vi,pi),wi.wc=0==pi?-1:(1<<pi)-1,e){a.xb=vr;break t}if(null==(p=s(l*v))){a.a=1,c=0;break t}c=(c=xt(a,p,0,l,v,v,null))&&!m.h;break t}return c?(null!=u?u[0]=p:(i(null==p),i(e)),a.$=0,e||qt(w)):qt(w),c}function Et(t,n){var e=t.c*t.i,r=e+n+16*n;return i(t.c<=n),t.V=s(r),null==t.V?(t.Ta=null,t.Ua=0,t.a=1,0):(t.Ta=t.V,t.Ua=t.Ba+e+n,1)}function Pt(t,n){var e=t.C,r=n-e,s=t.V,o=t.Ba+t.c*e;for(i(n<=t.l.o);0<r;){var a=16<r?16:r,u=t.l.ma,c=t.l.width,h=c*a,f=u.ca,l=u.tb+c*e,d=t.Ta,v=t.Ua;Lt(t,a,s,o),xe(d,v,f,l,h),kt(u,e,e+a,f,l,c),r-=a,s+=a*t.c,e+=a}i(e==n),t.C=t.Ma=n}function It(){this.ub=this.yd=this.td=this.Rb=0}function Ot(){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 Rt(){this.Yb=function(){var t=[];return function t(i,n,e){for(var r=e[n],s=0;s<r&&(i.push(e.length>n+1?[]:0),!(e.length<n+1));s++)t(i[s],n+1,e)}(t,0,[3,11]),t}()}function Bt(){this.jb=s(3),this.Wc=a([4,8],Rt),this.Xc=a([4,17],Rt)}function Ct(){this.Pc=this.wb=this.Tb=this.zd=0,this.vd=new s(4),this.od=new s(4)}function Dt(){this.ld=this.La=this.dd=this.tc=0}function Tt(){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 _t(){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 Ut(){this.uc=this.M=this.Nb=0,this.wa=Array(new Dt),this.Y=0,this.ya=Array(new _t),this.aa=0,this.l=new Gt}function Vt(){this.y=s(16),this.f=s(8),this.ea=s(8)}function Wt(){this.cb=this.a=0,this.sc="",this.m=new N,this.Od=new It,this.Kc=new Ot,this.ed=new Ct,this.Qa=new Ft,this.Ic=this.$c=this.Aa=0,this.D=new Ut,this.Xb=this.Va=this.Hb=this.zb=this.yb=this.Ub=this.za=0,this.Jc=o(8,N),this.ia=0,this.pb=o(4,zt),this.Pa=new Bt,this.Bd=this.kc=0,this.Ac=[],this.Bc=0,this.zc=[0,0,0,0],this.Gd=Array(new Vt),this.Hd=0,this.rb=Array(new Tt),this.sb=0,this.wa=Array(new Dt),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 _t),this.L=this.aa=0,this.gd=a([4,2],Dt),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,i){return 0>t?0:t>i?i: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 Wt;return null!=t&&(t.a=0,t.sc="OK",t.cb=0,t.Xb=0,er||(er=$t)),t}function Yt(t,i,n){return 0==t.a&&(t.a=i,t.sc=n,t.cb=0),0}function Kt(t,i,n){return 3<=n&&157==t[i+0]&&1==t[i+1]&&42==t[i+2]}function Xt(t,n){if(null==t)return 0;if(t.a=0,t.sc="OK",null==n)return Yt(t,2,"null VP8Io passed to VP8GetHeaders()");var e=n.data,s=n.w,o=n.ha;if(4>o)return Yt(t,7,"Truncated header.");var a=e[s+0]|e[s+1]<<8|e[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 c=t.Kc;if(u.Rb){if(7>o)return Yt(t,7,"cannot parse picture header");if(!Kt(e,s,o))return Yt(t,3,"Bad code word");c.c=16383&(e[s+4]<<8|e[s+3]),c.Td=e[s+4]>>6,c.i=16383&(e[s+6]<<8|e[s+5]),c.Ud=e[s+6]>>6,s+=7,o-=7,t.za=c.c+15>>4,t.Ub=c.i+15>>4,n.width=c.c,n.height=c.i,n.Da=0,n.j=0,n.v=0,n.va=n.width,n.o=n.height,n.da=0,n.ib=n.width,n.hb=n.height,n.U=n.width,n.T=n.height,r((a=t.Pa).jb,0,255,a.jb.length),i(null!=(a=t.Qa)),a.Cb=0,a.Bb=0,a.Fb=1,r(a.Zb,0,0,a.Zb.length),r(a.Lb,0,0,a.Lb)}if(u.ub>o)return Yt(t,7,"bad partition length");v(a=t.m,e,s,u.ub),s+=u.ub,o-=u.ub,u.Rb&&(c.Ld=q(a),c.Kd=q(a)),c=t.Qa;var h,f=t.Pa;if(i(null!=a),i(null!=c),c.Cb=q(a),c.Cb){if(c.Bb=q(a),q(a)){for(c.Fb=q(a),h=0;4>h;++h)c.Zb[h]=q(a)?w(a,7):0;for(h=0;4>h;++h)c.Lb[h]=q(a)?w(a,6):0}if(c.Bb)for(h=0;3>h;++h)f.jb[h]=q(a)?m(a,8):255}else c.Bb=0;if(a.Ka)return Yt(t,3,"cannot parse segment header");if((c=t.ed).zd=q(a),c.Tb=m(a,6),c.wb=m(a,3),c.Pc=q(a),c.Pc&&q(a)){for(f=0;4>f;++f)q(a)&&(c.vd[f]=w(a,6));for(f=0;4>f;++f)q(a)&&(c.od[f]=w(a,6))}if(t.L=0==c.Tb?0:c.zd?1:2,a.Ka)return Yt(t,3,"cannot parse filter header");var l=o;if(o=h=s,s=h+l,c=l,t.Xb=(1<<m(t.m,2))-1,l<3*(f=t.Xb))e=7;else{for(h+=3*f,c-=3*f,l=0;l<f;++l){var d=e[o+0]|e[o+1]<<8|e[o+2]<<16;d>c&&(d=c),v(t.Jc[+l],e,h,d),h+=d,c-=d,o+=3}v(t.Jc[+f],e,h,c),e=h<s?0:5}if(0!=e)return Yt(t,e,"cannot parse partitions");for(e=m(h=t.m,7),o=q(h)?w(h,4):0,s=q(h)?w(h,4):0,c=q(h)?w(h,4):0,f=q(h)?w(h,4):0,h=q(h)?w(h,4):0,l=t.Qa,d=0;4>d;++d){if(l.Cb){var p=l.Zb[d];l.Fb||(p+=e)}else{if(0<d){t.pb[d]=t.pb[0];continue}p=e}var b=t.pb[d];b.Sc[0]=ir[Ht(p+o,127)],b.Sc[1]=nr[Ht(p+0,127)],b.Eb[0]=2*ir[Ht(p+s,127)],b.Eb[1]=101581*nr[Ht(p+c,127)]>>16,8>b.Eb[1]&&(b.Eb[1]=8),b.Qc[0]=ir[Ht(p+f,117)],b.Qc[1]=nr[Ht(p+h,127)],b.lc=p+h}if(!u.Rb)return Yt(t,4,"Not a key frame.");for(q(a),u=t.Pa,e=0;4>e;++e){for(o=0;8>o;++o)for(s=0;3>s;++s)for(c=0;11>c;++c)f=M(a,cr[e][o][s][c])?m(a,8):ar[e][o][s][c],u.Wc[e][o].Yb[s][c]=f;for(o=0;17>o;++o)u.Xc[e][o]=u.Wc[e][hr[o]]}return t.kc=q(a),t.kc&&(t.Bd=m(a,8)),t.cb=1}function $t(t,i,n,e,r,s,o){var a=i[r].Yb[n];for(n=0;16>r;++r){if(!M(t,a[n+0]))return r;for(;!M(t,a[n+1]);)if(a=i[++r].Yb[0],n=0,16==r)return 16;var u=i[r+1].Yb;if(M(t,a[n+2])){var c=t,h=0;if(M(c,(l=a)[(f=n)+3]))if(M(c,l[f+6])){for(a=0,f=2*(h=M(c,l[f+8]))+(l=M(c,l[f+9+h])),h=0,l=rr[f];l[a];++a)h+=h+M(c,l[a]);h+=3+(8<<f)}else M(c,l[f+7])?(h=7+2*M(c,165),h+=M(c,145)):h=5+M(c,159);else h=M(c,l[f+4])?3+M(c,l[f+5]):2;a=u[2]}else h=1,a=u[1];u=o+sr[r],0>(c=t).b&&x(c);var f,l=c.b,d=(f=c.Ca>>1)-(c.I>>l)>>31;--c.b,c.Ca+=d,c.Ca|=1,c.I-=(f+1&d)<<l,s[u]=((h^d)-d)*e[(0<r)+0]}return 16}function Qt(t){var i=t.rb[t.sb-1];i.la=0,i.Na=0,r(t.zc,0,0,t.zc.length),t.ja=0}function Zt(t,n){if(null==t)return 0;if(null==n)return Yt(t,2,"NULL VP8Io parameter in VP8Decode().");if(!t.cb&&!Xt(t,n))return 0;if(i(t.cb),null==n.ac||n.ac(n)){n.ob&&(t.L=0);var a=Tr[t.L];if(2==t.L?(t.yb=0,t.zb=0):(t.yb=n.v-a>>4,t.zb=n.j-a>>4,0>t.yb&&(t.yb=0),0>t.zb&&(t.zb=0)),t.Va=n.o+15+a>>4,t.Hb=n.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 c;if(t.Qa.Cb){var h=t.Qa.Lb[a];t.Qa.Fb||(h+=u.Tb)}else h=u.Tb;for(c=0;1>=c;++c){var f=t.gd[a][c],l=h;if(u.Pc&&(l+=u.vd[0],c&&(l+=u.od[0])),0<(l=0>l?0:63<l?63:l)){var d=l;0<u.wb&&(d=4<u.wb?d>>2:d>>1)>9-u.wb&&(d=9-u.wb),1>d&&(d=1),f.dd=d,f.tc=2*l+d,f.ld=40<=l?2:15<=l?1:0}else f.tc=0;f.La=c}}}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=_r);t:{u=4*(d=t.za);var v=32*d,m=d+1,w=0<t.L?d*(0<t.Aa?2:1):0,p=(2==t.Aa?2:1)*d;if((f=u+832+(c=3*(16*(a=t.Ic)+Tr[t.L])/2*v)+(h=null!=t.Fa&&0<t.Fa.length?t.Kc.c*t.Kc.i:0))!=f)a=0;else{if(f>t.Vb){if(t.Vb=0,t.Ec=s(f),t.Fc=0,null==t.Ec){a=Yt(t,1,"no memory during frame initialization.");break t}t.Vb=f}l=t.Fc,t.Ac=f=t.Ec,t.Bc=l,l+=u,t.Gd=o(v,Vt),t.Hd=0,t.rb=o(m+1,Tt),t.sb=1,t.wa=w?o(w,Dt):null,t.Y=0,t.D.Nb=0,t.D.wa=t.wa,t.D.Y=t.Y,0<t.Aa&&(t.D.Y+=d),i(!0),t.oc=f,t.pc=l,l+=832,t.ya=o(p,_t),t.aa=0,t.D.ya=t.ya,t.D.aa=t.aa,2==t.Aa&&(t.D.aa+=d),t.R=16*d,t.B=8*d,d=(v=Tr[t.L])*t.R,v=v/2*t.B,t.sa=f,t.ta=l+d,t.qa=t.sa,t.ra=t.ta+16*a*t.R+v,t.Ha=t.qa,t.Ia=t.ra+8*a*t.B+v,t.$c=0,l+=c,t.mb=h?f:null,t.nb=h?l:null,i(l+h<=t.Fc+t.Vb),Qt(t),r(t.Ac,t.Bc,0,u),a=1}}if(a){if(n.ka=0,n.y=t.sa,n.O=t.ta,n.f=t.qa,n.N=t.ra,n.ea=t.Ha,n.Vd=t.Ia,n.fa=t.R,n.Rc=t.B,n.F=null,n.J=0,!Pe){for(a=-255;255>=a;++a)qe[255+a]=0>a?-a:a;for(a=-1020;1020>=a;++a)Me[1020+a]=-128>a?-128:127<a?127:a;for(a=-112;112>=a;++a)je[112+a]=-16>a?-16:15<a?15:a;for(a=-255;510>=a;++a)Ee[255+a]=0>a?0:255<a?255:a;Pe=1}se=ci,oe=si,ue=oi,ce=ai,he=ui,ae=ri,fe=Yi,le=Ki,de=Qi,ve=Zi,me=Xi,we=$i,pe=tn,be=nn,ge=Ui,Ne=Vi,Le=Wi,ye=Hi,lr[0]=ki,lr[1]=fi,lr[2]=yi,lr[3]=Ai,lr[4]=Si,lr[5]=qi,lr[6]=xi,lr[7]=Mi,lr[8]=Ei,lr[9]=ji,fr[0]=pi,fr[1]=di,fr[2]=vi,fr[3]=mi,fr[4]=bi,fr[5]=gi,fr[6]=Ni,dr[0]=Fi,dr[1]=li,dr[2]=Pi,dr[3]=Ii,dr[4]=Bi,dr[5]=Ri,dr[6]=Ci,a=1}else a=0}a&&(a=function(t,n){for(t.M=0;t.M<t.Va;++t.M){var o,a=t.Jc[t.M&t.Xb],u=t.m,c=t;for(o=0;o<c.za;++o){var h=u,f=c,l=f.Ac,d=f.Bc+4*o,v=f.zc,m=f.ya[f.aa+o];if(m.$b=f.Qa.Bb?M(h,f.Pa.jb[0])?2+M(h,f.Pa.jb[2]):M(h,f.Pa.jb[1]):0,f.kc&&(m.Ad=M(h,f.Bd)),m.Za=!M(h,145)+0,m.Za){var w=m.Ob,p=0;for(f=0;4>f;++f){var b,g=v[0+f];for(b=0;4>b;++b){for(var N=or[M(h,(g=ur[l[d+b]][g])[0])];0<N;)N=or[2*N+M(h,g[N])];l[d+b]=g=-N}e(w,p,l,d,4),p+=4,v[0+f]=g}}else g=M(h,156)?M(h,128)?1:3:M(h,163)?2:0,m.Ob[0]=g,r(l,d,g,4),r(v,0,g,4);m.Dd=M(h,142)?M(h,114)?M(h,183)?1:3:2:0}if(c.m.Ka)return Yt(t,7,"Premature end-of-partition0 encountered.");for(;t.ja<t.za;++t.ja){if(c=a,h=(u=t).rb[u.sb-1],l=u.rb[u.sb+u.ja],o=u.ya[u.aa+u.ja],d=u.kc?o.Ad:0)h.la=l.la=0,o.Za||(h.Na=l.Na=0),o.Hc=0,o.Gc=0,o.ia=0;else{var L,y;if(h=l,l=c,d=u.Pa.Xc,m=u.pb[(v=u.ya[u.aa+u.ja]).$b],p=u.rb[u.sb-1],g=b=0,r(f=v.ad,w=0,0,384),v.Za)var A=0,k=d[3];else{N=s(16);var S=h.Na+p.Na;if(S=er(l,d[1],S,m.Eb,0,N,0),h.Na=p.Na=(0<S)+0,1<S)se(N,0,f,w);else{var x=N[0]+3>>3;for(N=0;256>N;N+=16)f[w+N]=x}A=1,k=d[0]}var q=15&h.la,j=15&p.la;for(N=0;4>N;++N){var E=1&j;for(x=y=0;4>x;++x)q=q>>1|(E=(S=er(l,k,S=E+(1&q),m.Sc,A,f,w))>A)<<7,y=y<<2|(3<S?3:1<S?2:0!=f[w+0]),w+=16;q>>=4,j=j>>1|E<<7,b=(b<<8|y)>>>0}for(k=q,A=j>>4,L=0;4>L;L+=2){for(y=0,q=h.la>>4+L,j=p.la>>4+L,N=0;2>N;++N){for(E=1&j,x=0;2>x;++x)q=q>>1|(E=0<(S=er(l,d[2],S=E+(1&q),m.Qc,0,f,w)))<<3,y=y<<2|(3<S?3:1<S?2:0!=f[w+0]),w+=16;q>>=2,j=j>>1|E<<5}g|=y<<4*L,k|=q<<4<<L,A|=(240&j)<<L}h.la=k,p.la=A,v.Hc=b,v.Gc=g,v.ia=43690&g?0:m.ia,d=!(b|g)}if(0<u.L&&(u.wa[u.Y+u.ja]=u.gd[o.$b][o.Za],u.wa[u.Y+u.ja].La|=!d),c.Ka)return Yt(t,7,"Premature end-of-file encountered.")}if(Qt(t),u=n,c=1,o=(a=t).D,h=0<a.L&&a.M>=a.zb&&a.M<=a.Va,0==a.Aa)t:{if(o.M=a.M,o.uc=h,Fn(a,o),c=1,o=(y=a.D).Nb,h=(g=Tr[a.L])*a.R,d=a.sa,v=a.ta-h+(N=16*o*a.R),m=a.qa,f=a.ra-(l=g/2*a.B)+(x=8*o*a.B),w=a.Ha,p=a.Ia-l+x,j=0==(q=y.M),b=q>=a.Va-1,2==a.Aa&&Fn(a,y),y.uc)for(E=(S=a).D.M,i(S.D.uc),y=S.yb;y<S.Hb;++y){k=E;var P=(I=(_=S).D).Nb,I=I.wa[I.Y+(A=y)],O=_.sa,F=_.ta+16*P*(L=_.R)+16*A,R=I.dd,B=I.tc;if(0!=B)if(i(3<=B),1==_.L)0<A&&Ne(O,F,L,B+4),I.La&&ye(O,F,L,B),0<k&&ge(O,F,L,B+4),I.La&&Le(O,F,L,B);else{var C=_.B,D=_.qa,T=_.ra+8*P*C+8*A,z=_.Ha,_=_.Ia+8*P*C+8*A;P=I.ld,0<A&&(le(O,F,L,B+4,R,P),ve(D,T,z,_,C,B+4,R,P)),I.La&&(we(O,F,L,B,R,P),be(D,T,z,_,C,B,R,P)),0<k&&(fe(O,F,L,B+4,R,P),de(D,T,z,_,C,B+4,R,P)),I.La&&(me(O,F,L,B,R,P),pe(D,T,z,_,C,B,R,P))}}if(a.ia&&alert("todo:DitherRow"),null!=u.put){if(y=16*q,q=16*(q+1),j?(u.y=a.sa,u.O=a.ta+N,u.f=a.qa,u.N=a.ra+x,u.ea=a.Ha,u.W=a.Ia+x):(y-=g,u.y=d,u.O=v,u.f=m,u.N=f,u.ea=w,u.W=p),b||(q-=g),q>u.o&&(q=u.o),u.F=null,u.J=null,null!=a.Fa&&0<a.Fa.length&&y<q&&(u.J=ln(a,u,y,q-y),u.F=a.mb,null==u.F&&0==u.F.length)){c=Yt(a,3,"Could not decode alpha data.");break t}y<u.j&&(g=u.j-y,y=u.j,i(!(1&g)),u.O+=a.R*g,u.N+=a.B*(g>>1),u.W+=a.B*(g>>1),null!=u.F&&(u.J+=u.width*g)),y<q&&(u.O+=u.v,u.N+=u.v>>1,u.W+=u.v>>1,null!=u.F&&(u.J+=u.v),u.ka=y-u.j,u.U=u.va-u.v,u.T=q-y,c=u.put(u))}o+1!=a.Ic||b||(e(a.sa,a.ta-h,d,v+16*a.R,h),e(a.qa,a.ra-l,m,f+8*a.B,l),e(a.Ha,a.Ia-l,w,p+8*a.B,l))}if(!c)return Yt(t,6,"Output aborted.")}return 1}(t,n)),null!=n.bc&&n.bc(n),a&=1}return a?(t.cb=0,a):0}function ti(t,i,n,e,r){t[i+n+32*e]=-256&(r=t[i+n+32*e]+(r>>3))?0>r?0:255:r}function ii(t,i,n,e,r,s){ti(t,i,0,n,e+r),ti(t,i,1,n,e+s),ti(t,i,2,n,e-s),ti(t,i,3,n,e-r)}function ni(t){return(20091*t>>16)+t}function ei(t,i,n,e){var r,o=0,a=s(16);for(r=0;4>r;++r){var u=t[i+0]+t[i+8],c=t[i+0]-t[i+8],h=(35468*t[i+4]>>16)-ni(t[i+12]),f=ni(t[i+4])+(35468*t[i+12]>>16);a[o+0]=u+f,a[o+1]=c+h,a[o+2]=c-h,a[o+3]=u-f,o+=4,i++}for(r=o=0;4>r;++r)u=(t=a[o+0]+4)+a[o+8],c=t-a[o+8],h=(35468*a[o+4]>>16)-ni(a[o+12]),ti(n,e,0,0,u+(f=ni(a[o+4])+(35468*a[o+12]>>16))),ti(n,e,1,0,c+h),ti(n,e,2,0,c-h),ti(n,e,3,0,u-f),o++,e+=32}function ri(t,i,n,e){var r=t[i+0]+4,s=35468*t[i+4]>>16,o=ni(t[i+4]),a=35468*t[i+1]>>16;ii(n,e,0,r+o,t=ni(t[i+1]),a),ii(n,e,1,r+s,t,a),ii(n,e,2,r-s,t,a),ii(n,e,3,r-o,t,a)}function si(t,i,n,e,r){ei(t,i,n,e),r&&ei(t,i+16,n,e+4)}function oi(t,i,n,e){oe(t,i+0,n,e,1),oe(t,i+32,n,e+128,1)}function ai(t,i,n,e){var r;for(t=t[i+0]+4,r=0;4>r;++r)for(i=0;4>i;++i)ti(n,e,i,r,t)}function ui(t,i,n,e){t[i+0]&&ce(t,i+0,n,e),t[i+16]&&ce(t,i+16,n,e+4),t[i+32]&&ce(t,i+32,n,e+128),t[i+48]&&ce(t,i+48,n,e+128+4)}function ci(t,i,n,e){var r,o=s(16);for(r=0;4>r;++r){var a=t[i+0+r]+t[i+12+r],u=t[i+4+r]+t[i+8+r],c=t[i+4+r]-t[i+8+r],h=t[i+0+r]-t[i+12+r];o[0+r]=a+u,o[8+r]=a-u,o[4+r]=h+c,o[12+r]=h-c}for(r=0;4>r;++r)a=(t=o[0+4*r]+3)+o[3+4*r],c=o[1+4*r]-o[2+4*r],h=t-o[3+4*r],n[e+0]=a+(u=o[1+4*r]+o[2+4*r])>>3,n[e+16]=h+c>>3,n[e+32]=a-u>>3,n[e+48]=h-c>>3,e+=64}function hi(t,i,n){var e,r=i-32,s=Fe,o=255-t[r-1];for(e=0;e<n;++e){var a,u=s,c=o+t[i-1];for(a=0;a<n;++a)t[i+a]=u[c+t[r+a]];i+=32}}function fi(t,i){hi(t,i,4)}function li(t,i){hi(t,i,8)}function di(t,i){hi(t,i,16)}function vi(t,i){var n;for(n=0;16>n;++n)e(t,i+32*n,t,i-32,16)}function mi(t,i){var n;for(n=16;0<n;--n)r(t,i,t[i-1],16),i+=32}function wi(t,i,n){var e;for(e=0;16>e;++e)r(i,n+32*e,t,16)}function pi(t,i){var n,e=16;for(n=0;16>n;++n)e+=t[i-1+32*n]+t[i+n-32];wi(e>>5,t,i)}function bi(t,i){var n,e=8;for(n=0;16>n;++n)e+=t[i-1+32*n];wi(e>>4,t,i)}function gi(t,i){var n,e=8;for(n=0;16>n;++n)e+=t[i+n-32];wi(e>>4,t,i)}function Ni(t,i){wi(128,t,i)}function Li(t,i,n){return t+2*i+n+2>>2}function yi(t,i){var n,r=i-32;for(r=new Uint8Array([Li(t[r-1],t[r+0],t[r+1]),Li(t[r+0],t[r+1],t[r+2]),Li(t[r+1],t[r+2],t[r+3]),Li(t[r+2],t[r+3],t[r+4])]),n=0;4>n;++n)e(t,i+32*n,r,0,r.length)}function Ai(t,i){var n=t[i-1],e=t[i-1+32],r=t[i-1+64],s=t[i-1+96];j(t,i+0,16843009*Li(t[i-1-32],n,e)),j(t,i+32,16843009*Li(n,e,r)),j(t,i+64,16843009*Li(e,r,s)),j(t,i+96,16843009*Li(r,s,s))}function ki(t,i){var n,e=4;for(n=0;4>n;++n)e+=t[i+n-32]+t[i-1+32*n];for(e>>=3,n=0;4>n;++n)r(t,i+32*n,e,4)}function Si(t,i){var n=t[i-1+0],e=t[i-1+32],r=t[i-1+64],s=t[i-1-32],o=t[i+0-32],a=t[i+1-32],u=t[i+2-32],c=t[i+3-32];t[i+0+96]=Li(e,r,t[i-1+96]),t[i+1+96]=t[i+0+64]=Li(n,e,r),t[i+2+96]=t[i+1+64]=t[i+0+32]=Li(s,n,e),t[i+3+96]=t[i+2+64]=t[i+1+32]=t[i+0+0]=Li(o,s,n),t[i+3+64]=t[i+2+32]=t[i+1+0]=Li(a,o,s),t[i+3+32]=t[i+2+0]=Li(u,a,o),t[i+3+0]=Li(c,u,a)}function xi(t,i){var n=t[i+1-32],e=t[i+2-32],r=t[i+3-32],s=t[i+4-32],o=t[i+5-32],a=t[i+6-32],u=t[i+7-32];t[i+0+0]=Li(t[i+0-32],n,e),t[i+1+0]=t[i+0+32]=Li(n,e,r),t[i+2+0]=t[i+1+32]=t[i+0+64]=Li(e,r,s),t[i+3+0]=t[i+2+32]=t[i+1+64]=t[i+0+96]=Li(r,s,o),t[i+3+32]=t[i+2+64]=t[i+1+96]=Li(s,o,a),t[i+3+64]=t[i+2+96]=Li(o,a,u),t[i+3+96]=Li(a,u,u)}function qi(t,i){var n=t[i-1+0],e=t[i-1+32],r=t[i-1+64],s=t[i-1-32],o=t[i+0-32],a=t[i+1-32],u=t[i+2-32],c=t[i+3-32];t[i+0+0]=t[i+1+64]=s+o+1>>1,t[i+1+0]=t[i+2+64]=o+a+1>>1,t[i+2+0]=t[i+3+64]=a+u+1>>1,t[i+3+0]=u+c+1>>1,t[i+0+96]=Li(r,e,n),t[i+0+64]=Li(e,n,s),t[i+0+32]=t[i+1+96]=Li(n,s,o),t[i+1+32]=t[i+2+96]=Li(s,o,a),t[i+2+32]=t[i+3+96]=Li(o,a,u),t[i+3+32]=Li(a,u,c)}function Mi(t,i){var n=t[i+0-32],e=t[i+1-32],r=t[i+2-32],s=t[i+3-32],o=t[i+4-32],a=t[i+5-32],u=t[i+6-32],c=t[i+7-32];t[i+0+0]=n+e+1>>1,t[i+1+0]=t[i+0+64]=e+r+1>>1,t[i+2+0]=t[i+1+64]=r+s+1>>1,t[i+3+0]=t[i+2+64]=s+o+1>>1,t[i+0+32]=Li(n,e,r),t[i+1+32]=t[i+0+96]=Li(e,r,s),t[i+2+32]=t[i+1+96]=Li(r,s,o),t[i+3+32]=t[i+2+96]=Li(s,o,a),t[i+3+64]=Li(o,a,u),t[i+3+96]=Li(a,u,c)}function ji(t,i){var n=t[i-1+0],e=t[i-1+32],r=t[i-1+64],s=t[i-1+96];t[i+0+0]=n+e+1>>1,t[i+2+0]=t[i+0+32]=e+r+1>>1,t[i+2+32]=t[i+0+64]=r+s+1>>1,t[i+1+0]=Li(n,e,r),t[i+3+0]=t[i+1+32]=Li(e,r,s),t[i+3+32]=t[i+1+64]=Li(r,s,s),t[i+3+64]=t[i+2+64]=t[i+0+96]=t[i+1+96]=t[i+2+96]=t[i+3+96]=s}function Ei(t,i){var n=t[i-1+0],e=t[i-1+32],r=t[i-1+64],s=t[i-1+96],o=t[i-1-32],a=t[i+0-32],u=t[i+1-32],c=t[i+2-32];t[i+0+0]=t[i+2+32]=n+o+1>>1,t[i+0+32]=t[i+2+64]=e+n+1>>1,t[i+0+64]=t[i+2+96]=r+e+1>>1,t[i+0+96]=s+r+1>>1,t[i+3+0]=Li(a,u,c),t[i+2+0]=Li(o,a,u),t[i+1+0]=t[i+3+32]=Li(n,o,a),t[i+1+32]=t[i+3+64]=Li(e,n,o),t[i+1+64]=t[i+3+96]=Li(r,e,n),t[i+1+96]=Li(s,r,e)}function Pi(t,i){var n;for(n=0;8>n;++n)e(t,i+32*n,t,i-32,8)}function Ii(t,i){var n;for(n=0;8>n;++n)r(t,i,t[i-1],8),i+=32}function Oi(t,i,n){var e;for(e=0;8>e;++e)r(i,n+32*e,t,8)}function Fi(t,i){var n,e=8;for(n=0;8>n;++n)e+=t[i+n-32]+t[i-1+32*n];Oi(e>>4,t,i)}function Ri(t,i){var n,e=4;for(n=0;8>n;++n)e+=t[i+n-32];Oi(e>>3,t,i)}function Bi(t,i){var n,e=4;for(n=0;8>n;++n)e+=t[i-1+32*n];Oi(e>>3,t,i)}function Ci(t,i){Oi(128,t,i)}function Di(t,i,n){var e=t[i-n],r=t[i+0],s=3*(r-e)+Ie[1020+t[i-2*n]-t[i+n]],o=Oe[112+(s+4>>3)];t[i-n]=Fe[255+e+Oe[112+(s+3>>3)]],t[i+0]=Fe[255+r-o]}function Ti(t,i,n,e){return Re[255+t[i-2*n]-t[i-n]]>e||Re[255+t[i+n]-t[i+0]]>e}function zi(t,i,n,e){return 4*Re[255+t[i-n]-t[i+0]]+Re[255+t[i-2*n]-t[i+n]]<=e}function _i(t,i,n,e,r){var s=t[i-3*n],o=t[i-2*n],a=t[i-n],u=t[i+0],c=t[i+n],h=t[i+2*n];return 4*Re[255+a-u]+Re[255+o-c]>e?0:Re[255+t[i-4*n]-s]<=r&&Re[255+s-o]<=r&&Re[255+o-a]<=r&&Re[255+t[i+3*n]-h]<=r&&Re[255+h-c]<=r&&Re[255+c-u]<=r}function Ui(t,i,n,e){var r=2*e+1;for(e=0;16>e;++e)zi(t,i+e,n,r)&&Di(t,i+e,n)}function Vi(t,i,n,e){var r=2*e+1;for(e=0;16>e;++e)zi(t,i+e*n,1,r)&&Di(t,i+e*n,1)}function Wi(t,i,n,e){var r;for(r=3;0<r;--r)Ui(t,i+=4*n,n,e)}function Hi(t,i,n,e){var r;for(r=3;0<r;--r)Vi(t,i+=4,n,e)}function Gi(t,i,n,e,r,s,o,a){for(s=2*s+1;0<r--;){if(_i(t,i,n,s,o))if(Ti(t,i,n,a))Di(t,i,n);else{var u=t,c=i,h=n,f=u[c-2*h],l=u[c-h],d=u[c+0],v=u[c+h],m=u[c+2*h],w=27*(b=Ie[1020+3*(d-l)+Ie[1020+f-v]])+63>>7,p=18*b+63>>7,b=9*b+63>>7;u[c-3*h]=Fe[255+u[c-3*h]+b],u[c-2*h]=Fe[255+f+p],u[c-h]=Fe[255+l+w],u[c+0]=Fe[255+d-w],u[c+h]=Fe[255+v-p],u[c+2*h]=Fe[255+m-b]}i+=e}}function Ji(t,i,n,e,r,s,o,a){for(s=2*s+1;0<r--;){if(_i(t,i,n,s,o))if(Ti(t,i,n,a))Di(t,i,n);else{var u=t,c=i,h=n,f=u[c-h],l=u[c+0],d=u[c+h],v=Oe[112+(4+(m=3*(l-f))>>3)],m=Oe[112+(m+3>>3)],w=v+1>>1;u[c-2*h]=Fe[255+u[c-2*h]+w],u[c-h]=Fe[255+f+m],u[c+0]=Fe[255+l-v],u[c+h]=Fe[255+d-w]}i+=e}}function Yi(t,i,n,e,r,s){Gi(t,i,n,1,16,e,r,s)}function Ki(t,i,n,e,r,s){Gi(t,i,1,n,16,e,r,s)}function Xi(t,i,n,e,r,s){var o;for(o=3;0<o;--o)Ji(t,i+=4*n,n,1,16,e,r,s)}function $i(t,i,n,e,r,s){var o;for(o=3;0<o;--o)Ji(t,i+=4,1,n,16,e,r,s)}function Qi(t,i,n,e,r,s,o,a){Gi(t,i,r,1,8,s,o,a),Gi(n,e,r,1,8,s,o,a)}function Zi(t,i,n,e,r,s,o,a){Gi(t,i,1,r,8,s,o,a),Gi(n,e,1,r,8,s,o,a)}function tn(t,i,n,e,r,s,o,a){Ji(t,i+4*r,r,1,8,s,o,a),Ji(n,e+4*r,r,1,8,s,o,a)}function nn(t,i,n,e,r,s,o,a){Ji(t,i+4,1,r,8,s,o,a),Ji(n,e+4,1,r,8,s,o,a)}function en(){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 rn(){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 sn(){this.nc=this.Ea=this.b=this.hc=0,this.K=[],this.w=0}function on(){this.ua=0,this.Wa=new R,this.vb=new R,this.md=this.xc=this.wc=0,this.vc=[],this.Wb=0,this.Ya=new d,this.yc=new f}function an(){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 L,this.Pb=0,this.wd=new L,this.Ma=this.$=this.C=this.i=this.c=this.xd=0,this.s=new on,this.ab=0,this.gc=o(4,sn),this.Oc=0}function un(){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 cn(t,i,n,e,r,s,o){for(t=null==t?0:t[i+0],i=0;i<o;++i)r[s+i]=t+n[e+i]&255,t=r[s+i]}function hn(t,i,n,e,r,s,o){var a;if(null==t)cn(null,null,n,e,r,s,o);else for(a=0;a<o;++a)r[s+a]=t[i+a]+n[e+a]&255}function fn(t,i,n,e,r,s,o){if(null==t)cn(null,null,n,e,r,s,o);else{var a,u=t[i+0],c=u,h=u;for(a=0;a<o;++a)c=h+(u=t[i+a])-c,h=n[e+a]+(-256&c?0>c?0:255:c)&255,c=u,r[s+a]=h}}function ln(t,n,r,o){var a=n.width,u=n.o;if(i(null!=t&&null!=n),0>r||0>=o||r+o>u)return null;if(!t.Cc){if(null==t.ga){var c;if(t.ga=new un,(c=null==t.ga)||(c=n.width*n.o,i(0==t.Gb.length),t.Gb=s(c),t.Uc=0,null==t.Gb?c=0:(t.mb=t.Gb,t.nb=t.Uc,t.rc=null,c=1),c=!c),!c){var h=t.Fa,f=t.P,l=t.qc,d=t.mb,v=t.nb,m=f+1,w=l-1,b=(c=t.ga).l;if(i(null!=h&&null!=d&&null!=n),wr[0]=null,wr[1]=cn,wr[2]=hn,wr[3]=fn,c.ca=d,c.tb=v,c.c=n.width,c.i=n.height,i(0<c.c&&0<c.i),1>=l)n=0;else if(c.$a=h[f+0]>>0&3,c.Z=h[f+0]>>2&3,c.Lc=h[f+0]>>4&3,f=h[f+0]>>6&3,0>c.$a||1<c.$a||4<=c.Z||1<c.Lc||f)n=0;else if(b.put=dt,b.ac=lt,b.bc=vt,b.ma=c,b.width=n.width,b.height=n.height,b.Da=n.Da,b.v=n.v,b.va=n.va,b.j=n.j,b.o=n.o,c.$a)t:{i(1==c.$a),n=Mt();i:for(;;){if(null==n){n=0;break t}if(i(null!=c),c.mc=n,n.c=c.c,n.i=c.i,n.l=c.l,n.l.ma=c,n.l.width=c.c,n.l.height=c.i,n.a=0,p(n.m,h,m,w),!jt(c.c,c.i,1,n,null))break i;if(1==n.ab&&3==n.gc[0].hc&&At(n.s)?(c.ic=1,h=n.c*n.i,n.Ta=null,n.Ua=0,n.V=s(h),n.Ba=0,null==n.V?(n.a=1,n=0):n=1):(c.ic=0,n=Et(n,c.c)),!n)break i;n=1;break t}c.mc=null,n=0}else n=w>=c.c*c.i;c=!n}if(c)return null;1!=t.ga.Lc?t.Ga=0:o=u-r}i(null!=t.ga),i(r+o<=u);t:{if(n=(h=t.ga).c,u=h.l.o,0==h.$a){if(m=t.rc,w=t.Vc,b=t.Fa,l=t.mb,d=t.nb+r*n,i((f=t.P+1+r*n)<=t.P+t.qc),0!=h.Z)for(i(null!=wr[h.Z]),c=0;c<o;++c)wr[h.Z](m,w,b,f,l,d,n),m=l,w=d,d+=n,f+=n;else for(c=0;c<o;++c)e(l,d,b,f,n),m=l,w=d,d+=n,f+=n;t.rc=m,t.Vc=w}else{if(i(null!=h.mc),n=r+o,i(null!=(c=h.mc)),i(n<=c.i),c.C>=n)n=1;else if(h.ic||pn(),h.ic){h=c.V,m=c.Ba;var g=c.i,N=(b=1,f=c.$/(w=c.c),l=c.$%w,d=c.m,v=c.s,c.$),L=w*g,y=w*n,k=v.wc,x=N<y?Nt(v,l,f):null;i(N<=L),i(n<=g),i(At(v));i:for(;;){for(;!d.h&&N<y;){if(l&k||(x=Nt(v,l,f)),i(null!=x),S(d),256>(g=bt(x.G[0],x.H[0],d)))h[m+N]=g,++N,++l>=w&&(l=0,++f<=n&&!(f%16)&&St(c,f));else{if(!(280>g)){b=0;break i}g=wt(g-256,d);var q,M=bt(x.G[4],x.H[4],d);if(S(d),!(N>=(M=pt(w,M=wt(M,d)))&&L-N>=g)){b=0;break i}for(q=0;q<g;++q)h[m+N+q]=h[m+N+q-M];for(N+=g,l+=g;l>=w;)l-=w,++f<=n&&!(f%16)&&St(c,f);N<y&&l&k&&(x=Nt(v,l,f))}i(d.h==A(d))}St(c,f>n?n:f);break i}!b||d.h&&N<L?(b=0,c.a=d.h?5:3):c.$=N,n=b}else n=xt(c,c.V,c.Ba,c.c,c.i,n,Pt);if(!n){o=0;break t}}r+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+r*a}function dn(t,i,n,e,r,s){for(;0<r--;){var o,a=t,u=i+(n?1:0),c=t,h=i+(n?0:3);for(o=0;o<e;++o){var f=c[h+4*o];255!=f&&(a[u+4*o+0]=a[u+4*o+0]*(f*=32897)>>23,a[u+4*o+1]=a[u+4*o+1]*f>>23,a[u+4*o+2]=a[u+4*o+2]*f>>23)}i+=s}}function vn(t,i,n,e,r){for(;0<e--;){var s;for(s=0;s<n;++s){var o=t[i+2*s+0],a=15&(c=t[i+2*s+1]),u=4369*a,c=(240&c|c>>4)*u>>16;t[i+2*s+0]=(240&o|o>>4)*u>>16&240|(15&o|o<<4)*u>>16>>4&15,t[i+2*s+1]=240&c|a}i+=r}}function mn(t,i,n,e,r,s,o,a){var u,c,h=255;for(c=0;c<r;++c){for(u=0;u<e;++u){var f=t[i+u];s[o+4*u]=f,h&=f}i+=n,o+=a}return 255!=h}function wn(t,i,n,e,r){var s;for(s=0;s<r;++s)n[e+s]=t[i+s]>>8}function pn(){Ae=dn,ke=vn,Se=mn,xe=wn}function bn(n,e,r){t[n]=function(t,n,s,o,a,u,c,h,f,l,d,v,m,w,p,b,g){var N,L=g-1>>1,y=a[u+0]|c[h+0]<<16,A=f[l+0]|d[v+0]<<16;i(null!=t);var k=3*y+A+131074>>2;for(e(t[n+0],255&k,k>>16,m,w),null!=s&&e(s[o+0],255&(k=3*A+y+131074>>2),k>>16,p,b),N=1;N<=L;++N){var S=a[u+N]|c[h+N]<<16,x=f[l+N]|d[v+N]<<16,q=y+S+A+x+524296,M=q+2*(S+A)>>3;k=M+y>>1,y=(q=q+2*(y+x)>>3)+S>>1,e(t[n+2*N-1],255&k,k>>16,m,w+(2*N-1)*r),e(t[n+2*N-0],255&y,y>>16,m,w+(2*N-0)*r),null!=s&&(y=M+x>>1,e(s[o+2*N-1],255&(k=q+A>>1),k>>16,p,b+(2*N-1)*r),e(s[o+2*N+0],255&y,y>>16,p,b+(2*N+0)*r)),y=S,A=x}1&g||(e(t[n+g-1],255&(k=3*y+A+131074>>2),k>>16,m,w+(g-1)*r),null!=s&&e(s[o+g-1],255&(k=3*A+y+131074>>2),k>>16,p,b+(g-1)*r))}}function gn(){pr[Be]=br,pr[Ce]=Nr,pr[De]=gr,pr[Te]=Lr,pr[ze]=yr,pr[_e]=Ar,pr[Ue]=kr,pr[Ve]=Nr,pr[We]=Lr,pr[He]=yr,pr[Ge]=Ar}function Nn(t){return t&~Er?0>t?0:255:t>>jr}function Ln(t,i){return Nn((19077*t>>8)+(26149*i>>8)-14234)}function yn(t,i,n){return Nn((19077*t>>8)-(6419*i>>8)-(13320*n>>8)+8708)}function An(t,i){return Nn((19077*t>>8)+(33050*i>>8)-17685)}function kn(t,i,n,e,r){e[r+0]=Ln(t,n),e[r+1]=yn(t,i,n),e[r+2]=An(t,i)}function Sn(t,i,n,e,r){e[r+0]=An(t,i),e[r+1]=yn(t,i,n),e[r+2]=Ln(t,n)}function xn(t,i,n,e,r){var s=yn(t,i,n);i=s<<3&224|An(t,i)>>3,e[r+0]=248&Ln(t,n)|s>>5,e[r+1]=i}function qn(t,i,n,e,r){var s=240&An(t,i)|15;e[r+0]=240&Ln(t,n)|yn(t,i,n)>>4,e[r+1]=s}function Mn(t,i,n,e,r){e[r+0]=255,kn(t,i,n,e,r+1)}function jn(t,i,n,e,r){Sn(t,i,n,e,r),e[r+3]=255}function En(t,i,n,e,r){kn(t,i,n,e,r),e[r+3]=255}function Ht(t,i){return 0>t?0:t>i?i:t}function Pn(i,n,e){t[i]=function(t,i,r,s,o,a,u,c,h){for(var f=c+(-2&h)*e;c!=f;)n(t[i+0],r[s+0],o[a+0],u,c),n(t[i+1],r[s+0],o[a+0],u,c+e),i+=2,++s,++a,c+=2*e;1&h&&n(t[i+0],r[s+0],o[a+0],u,c)}}function In(t,i,n){return 0==n?0==t?0==i?6:5:0==i?4:0:n}function On(t,i,n,e,r){switch(t>>>30){case 3:oe(i,n,e,r,0);break;case 2:ae(i,n,e,r);break;case 1:ce(i,n,e,r)}}function Fn(t,i){var n,s,o=i.M,a=i.Nb,u=t.oc,c=t.pc+40,h=t.oc,f=t.pc+584,l=t.oc,d=t.pc+600;for(n=0;16>n;++n)u[c+32*n-1]=129;for(n=0;8>n;++n)h[f+32*n-1]=129,l[d+32*n-1]=129;for(0<o?u[c-1-32]=h[f-1-32]=l[d-1-32]=129:(r(u,c-32-1,127,21),r(h,f-32-1,127,9),r(l,d-32-1,127,9)),s=0;s<t.za;++s){var v=i.ya[i.aa+s];if(0<s){for(n=-1;16>n;++n)e(u,c+32*n-4,u,c+32*n+12,4);for(n=-1;8>n;++n)e(h,f+32*n-4,h,f+32*n+4,4),e(l,d+32*n-4,l,d+32*n+4,4)}var m=t.Gd,w=t.Hd+s,p=v.ad,b=v.Hc;if(0<o&&(e(u,c-32,m[w].y,0,16),e(h,f-32,m[w].f,0,8),e(l,d-32,m[w].ea,0,8)),v.Za){var g=u,N=c-32+16;for(0<o&&(s>=t.za-1?r(g,N,m[w].y[15],4):e(g,N,m[w+1].y,0,4)),n=0;4>n;n++)g[N+128+n]=g[N+256+n]=g[N+384+n]=g[N+0+n];for(n=0;16>n;++n,b<<=2)lr[v.Ob[n]](g=u,N=c+Dr[n]),On(b,p,16*+n,g,N)}else if(g=In(s,o,v.Ob[0]),fr[g](u,c),0!=b)for(n=0;16>n;++n,b<<=2)On(b,p,16*+n,u,c+Dr[n]);for(n=v.Gc,g=In(s,o,v.Dd),dr[g](h,f),dr[g](l,d),b=p,g=h,N=f,255&(v=n>>0)&&(170&v?ue(b,256,g,N):he(b,256,g,N)),v=l,b=d,255&(n>>=8)&&(170&n?ue(p,320,v,b):he(p,320,v,b)),o<t.Ub-1&&(e(m[w].y,0,u,c+480,16),e(m[w].f,0,h,f+224,8),e(m[w].ea,0,l,d+224,8)),m=t.sa,w=t.ta+16*s+16*a*t.R,p=t.qa,v=t.ra+8*s+(n=8*a*t.B),b=t.Ha,g=t.Ia+8*s+n,n=0;16>n;++n)e(m,w+n*t.R,u,c+32*n,16);for(n=0;8>n;++n)e(p,v+n*t.B,h,f+32*n,8),e(b,g+n*t.B,l,d+32*n,8)}}function Rn(t,e,r,s,o,a,u,c,h){var f=[0],l=[0],d=0,v=null!=h?h.kd:0,m=null!=h?h:new rn;if(null==t||12>r)return 7;m.data=t,m.w=e,m.ha=r,e=[e],r=[r],m.gb=[m.gb];t:{var w=e,b=r,g=m.gb;if(i(null!=t),i(null!=b),i(null!=g),g[0]=0,12<=b[0]&&!n(t,w[0],"RIFF")){if(n(t,w[0]+8,"WEBP")){g=3;break t}var N=I(t,w[0]+4);if(12>N||4294967286<N){g=3;break t}if(v&&N>b[0]-8){g=7;break t}g[0]=N,w[0]+=12,b[0]-=12}g=0}if(0!=g)return g;for(N=0<m.gb[0],r=r[0];;){t:{var y=t;b=e,g=r;var A=f,k=l,S=w=[0];if((M=d=[d])[0]=0,8>g[0])g=7;else{if(!n(y,b[0],"VP8X")){if(10!=I(y,b[0]+4)){g=3;break t}if(18>g[0]){g=7;break t}var x=I(y,b[0]+8),q=1+P(y,b[0]+12);if(2147483648<=q*(y=1+P(y,b[0]+15))){g=3;break t}null!=S&&(S[0]=x),null!=A&&(A[0]=q),null!=k&&(k[0]=y),b[0]+=18,g[0]-=18,M[0]=1}g=0}}if(d=d[0],0!=g)return g;if(b=!!(2&(w=w[0])),!N&&d)return 3;if(null!=a&&(a[0]=!!(16&w)),null!=u&&(u[0]=b),null!=c&&(c[0]=0),u=f[0],w=l[0],d&&b&&null==h){g=0;break}if(4>r){g=7;break}if(N&&d||!N&&!d&&!n(t,e[0],"ALPH")){r=[r],m.na=[m.na],m.P=[m.P],m.Sa=[m.Sa];t:{g=e,N=r;var M=m.gb;A=m.na,k=m.P,S=m.Sa,q=22,i(null!=(x=t)),i(null!=N),y=g[0];var j=N[0];for(i(null!=A),i(null!=S),A[0]=null,k[0]=null,S[0]=0;;){if(g[0]=y,N[0]=j,8>j){g=7;break t}var E=I(x,y+4);if(4294967286<E){g=3;break t}var O=8+E+1&-2;if(q+=O,0<M&&q>M){g=3;break t}if(!n(x,y,"VP8 ")||!n(x,y,"VP8L")){g=0;break t}if(j[0]<O){g=7;break t}n(x,y,"ALPH")||(A[0]=x,k[0]=y+8,S[0]=E),y+=O,j-=O}}if(r=r[0],m.na=m.na[0],m.P=m.P[0],m.Sa=m.Sa[0],0!=g)break}r=[r],m.Ja=[m.Ja],m.xa=[m.xa];t:if(M=t,g=e,N=r,A=m.gb[0],k=m.Ja,S=m.xa,x=g[0],y=!n(M,x,"VP8 "),q=!n(M,x,"VP8L"),i(null!=M),i(null!=N),i(null!=k),i(null!=S),8>N[0])g=7;else{if(y||q){if(M=I(M,x+4),12<=A&&M>A-12){g=3;break t}if(v&&M>N[0]-8){g=7;break t}k[0]=M,g[0]+=8,N[0]-=8,S[0]=q}else S[0]=5<=N[0]&&47==M[x+0]&&!(M[x+4]>>5),k[0]=N[0];g=0}if(r=r[0],m.Ja=m.Ja[0],m.xa=m.xa[0],e=e[0],0!=g)break;if(4294967286<m.Ja)return 3;if(null==c||b||(c[0]=m.xa?2:1),u=[u],w=[w],m.xa){if(5>r){g=7;break}c=u,v=w,b=a,null==t||5>r?t=0:5<=r&&47==t[e+0]&&!(t[e+4]>>5)?(N=[0],M=[0],A=[0],p(k=new L,t,e,r),mt(k,N,M,A)?(null!=c&&(c[0]=N[0]),null!=v&&(v[0]=M[0]),null!=b&&(b[0]=A[0]),t=1):t=0):t=0}else{if(10>r){g=7;break}c=w,null==t||10>r||!Kt(t,e+3,r-3)?t=0:(v=t[e+0]|t[e+1]<<8|t[e+2]<<16,b=16383&(t[e+7]<<8|t[e+6]),t=16383&(t[e+9]<<8|t[e+8]),1&v||3<(v>>1&7)||!(v>>4&1)||v>>5>=m.Ja||!b||!t?t=0:(u&&(u[0]=b),c&&(c[0]=t),t=1))}if(!t)return 3;if(u=u[0],w=w[0],d&&(f[0]!=u||l[0]!=w))return 3;null!=h&&(h[0]=m,h.offset=e-h.w,i(4294967286>e-h.w),i(h.offset==h.ha-r));break}return 0==g||7==g&&d&&null==h?(null!=a&&(a[0]|=null!=m.na&&0<m.na.length),null!=s&&(s[0]=u),null!=o&&(o[0]=w),0):g}function Bn(t,i,n){var e=i.width,r=i.height,s=0,o=0,a=e,u=r;if(i.Da=null!=t&&0<t.Da,i.Da&&(a=t.cd,u=t.bd,s=t.v,o=t.j,11>n||(s&=-2,o&=-2),0>s||0>o||0>=a||0>=u||s+a>e||o+u>r))return 0;if(i.v=s,i.j=o,i.va=s+a,i.o=o+u,i.U=a,i.T=u,i.da=null!=t&&0<t.da,i.da){if(!B(a,u,n=[t.ib],s=[t.hb]))return 0;i.ib=n[0],i.hb=s[0]}return i.ob=null!=t&&t.ob,i.Kb=null==t||!t.Sd,i.da&&(i.ob=i.ib<3*e/4&&i.hb<3*r/4,i.Kb=0),1}function Cn(t){if(null==t)return 2;if(11>t.S){var i=t.f.RGBA;i.fb+=(t.height-1)*i.A,i.A=-i.A}else(i=t.f.kb).O+=((t=t.height)-1)*i.fa,i.fa=-i.fa,i.N+=(t-1>>1)*i.Ab,i.Ab=-i.Ab,i.W+=(t-1>>1)*i.Db,i.Db=-i.Db,null!=i.F&&(i.J+=(t-1)*i.lb,i.lb=-i.lb);return 0}function Dn(t,i,n,e){if(null==e||0>=t||0>=i)return 2;if(null!=n){if(n.Da){var r=n.cd,o=n.bd,a=-2&n.v,u=-2&n.j;if(0>a||0>u||0>=r||0>=o||a+r>t||u+o>i)return 2;t=r,i=o}if(n.da){if(!B(t,i,r=[n.ib],o=[n.hb]))return 2;t=r[0],i=o[0]}}e.width=t,e.height=i;t:{var c=e.width,h=e.height;if(t=e.S,0>=c||0>=h||!(t>=Be&&13>t))t=2;else{if(0>=e.Rd&&null==e.sd){a=o=r=i=0;var f=(u=c*Ur[t])*h;if(11>t||(o=(h+1)/2*(i=(c+1)/2),12==t&&(a=(r=c)*h)),null==(h=s(f+2*o+a))){t=1;break t}e.sd=h,11>t?((c=e.f.RGBA).eb=h,c.fb=0,c.A=u,c.size=f):((c=e.f.kb).y=h,c.O=0,c.fa=u,c.Fd=f,c.f=h,c.N=0+f,c.Ab=i,c.Cd=o,c.ea=h,c.W=0+f+o,c.Db=i,c.Ed=o,12==t&&(c.F=h,c.J=0+f+2*o),c.Tc=a,c.lb=r)}if(i=1,o=e.width,a=e.height,(r=e.S)>=Be&&13>r)if(11>r)t=e.f.RGBA,i&=(u=Math.abs(t.A))*(a-1)+o<=t.size,i&=u>=o*Ur[r],i&=null!=t.eb;else{t=e.f.kb,u=(o+1)/2,f=(a+1)/2,c=Math.abs(t.fa),h=Math.abs(t.Ab);var l=Math.abs(t.Db),d=Math.abs(t.lb);i&=c*(a-1)+o<=t.Fd,i&=h*(f-1)+u<=t.Cd,i=(i&=l*(f-1)+u<=t.Ed)&c>=o&h>=u&l>=u,i&=null!=t.y,i&=null!=t.f,i&=null!=t.ea,12==r&&(i&=d>=o,i&=d*(a-1)+o<=t.Tc,i&=null!=t.F)}else i=0;t=i?0:2}}return 0!=t||null!=n&&n.fd&&(t=Cn(e)),t}var Tn=64,zn=[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],_n=24,Un=32,Vn=8,Wn=[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];T("Predictor0","PredictorAdd0"),t.Predictor0=function(){return 4278190080},t.Predictor1=function(t){return t},t.Predictor2=function(t,i,n){return i[n+0]},t.Predictor3=function(t,i,n){return i[n+1]},t.Predictor4=function(t,i,n){return i[n-1]},t.Predictor5=function(t,i,n){return _(_(t,i[n+1]),i[n+0])},t.Predictor6=function(t,i,n){return _(t,i[n-1])},t.Predictor7=function(t,i,n){return _(t,i[n+0])},t.Predictor8=function(t,i,n){return _(i[n-1],i[n+0])},t.Predictor9=function(t,i,n){return _(i[n+0],i[n+1])},t.Predictor10=function(t,i,n){return _(_(t,i[n-1]),_(i[n+0],i[n+1]))},t.Predictor11=function(t,i,n){var e=i[n+0];return 0>=W(e>>24&255,t>>24&255,(i=i[n-1])>>24&255)+W(e>>16&255,t>>16&255,i>>16&255)+W(e>>8&255,t>>8&255,i>>8&255)+W(255&e,255&t,255&i)?e:t},t.Predictor12=function(t,i,n){var e=i[n+0];return(U((t>>24&255)+(e>>24&255)-((i=i[n-1])>>24&255))<<24|U((t>>16&255)+(e>>16&255)-(i>>16&255))<<16|U((t>>8&255)+(e>>8&255)-(i>>8&255))<<8|U((255&t)+(255&e)-(255&i)))>>>0},t.Predictor13=function(t,i,n){var e=i[n-1];return(V((t=_(t,i[n+0]))>>24&255,e>>24&255)<<24|V(t>>16&255,e>>16&255)<<16|V(t>>8&255,e>>8&255)<<8|V(t>>0&255,e>>0&255))>>>0};var Hn=t.PredictorAdd0;t.PredictorAdd1=H,T("Predictor2","PredictorAdd2"),T("Predictor3","PredictorAdd3"),T("Predictor4","PredictorAdd4"),T("Predictor5","PredictorAdd5"),T("Predictor6","PredictorAdd6"),T("Predictor7","PredictorAdd7"),T("Predictor8","PredictorAdd8"),T("Predictor9","PredictorAdd9"),T("Predictor10","PredictorAdd10"),T("Predictor11","PredictorAdd11"),T("Predictor12","PredictorAdd12"),T("Predictor13","PredictorAdd13");var Gn=t.PredictorAdd2;K("ColorIndexInverseTransform","MapARGB","32b",(function(t){return t>>8&255}),(function(t){return t})),K("VP8LColorIndexInverseTransformAlpha","MapAlpha","8b",(function(t){return t}),(function(t){return t>>8&255}));var Jn,Yn=t.ColorIndexInverseTransform,Kn=t.MapARGB,Xn=t.VP8LColorIndexInverseTransformAlpha,$n=t.MapAlpha,Qn=t.VP8LPredictorsAdd=[];Qn.length=16,(t.VP8LPredictors=[]).length=16,(t.VP8LPredictorsAdd_C=[]).length=16,(t.VP8LPredictors_C=[]).length=16;var Zn,te,ie,ne,ee,re,se,oe,ae,ue,ce,he,fe,le,de,ve,me,we,pe,be,ge,Ne,Le,ye,Ae,ke,Se,xe,qe=s(511),Me=s(2041),je=s(225),Ee=s(767),Pe=0,Ie=Me,Oe=je,Fe=Ee,Re=qe,Be=0,Ce=1,De=2,Te=3,ze=4,_e=5,Ue=6,Ve=7,We=8,He=9,Ge=10,Je=[2,3,7],Ye=[3,3,11],Ke=[280,256,256,256,40],Xe=[0,1,1,1,0],$e=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],Qe=[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],Ze=[2954,2956,2958,2962,2970,2986,3018,3082,3212,3468,3980,5004],tr=8,ir=[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],nr=[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],er=null,rr=[[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]],sr=[0,1,4,8,5,2,3,6,9,12,13,10,7,11,14,15],or=[-0,1,-1,2,-2,3,4,6,-3,5,-4,-5,-6,7,-7,8,-8,-9],ar=[[[[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]]]],ur=[[[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]]],cr=[[[[255,255,255,255,255,255,255,255,255,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]]]],hr=[0,1,2,3,6,4,5,6,6,6,6,6,6,6,6,7,0],fr=[],lr=[],dr=[],vr=1,mr=2,wr=[],pr=[];bn("UpsampleRgbLinePair",kn,3),bn("UpsampleBgrLinePair",Sn,3),bn("UpsampleRgbaLinePair",En,4),bn("UpsampleBgraLinePair",jn,4),bn("UpsampleArgbLinePair",Mn,4),bn("UpsampleRgba4444LinePair",qn,2),bn("UpsampleRgb565LinePair",xn,2);var br=t.UpsampleRgbLinePair,gr=t.UpsampleBgrLinePair,Nr=t.UpsampleRgbaLinePair,Lr=t.UpsampleBgraLinePair,yr=t.UpsampleArgbLinePair,Ar=t.UpsampleRgba4444LinePair,kr=t.UpsampleRgb565LinePair,Sr=16,xr=1<<Sr-1,qr=-227,Mr=482,jr=6,Er=(256<<jr)-1,Pr=0,Ir=s(256),Or=s(256),Fr=s(256),Rr=s(256),Br=s(Mr-qr),Cr=s(Mr-qr);Pn("YuvToRgbRow",kn,3),Pn("YuvToBgrRow",Sn,3),Pn("YuvToRgbaRow",En,4),Pn("YuvToBgraRow",jn,4),Pn("YuvToArgbRow",Mn,4),Pn("YuvToRgba4444Row",qn,2),Pn("YuvToRgb565Row",xn,2);var Dr=[0,4,8,12,128,132,136,140,256,260,264,268,384,388,392,396],Tr=[0,2,8],zr=[8,7,6,4,4,2,2,2,1,1,1,1],_r=1;this.WebPDecodeRGBA=function(t,n,e,r,s){var o=Ce,a=new en,u=new ot;a.ba=u,u.S=o,u.width=[u.width],u.height=[u.height];var c=u.width,h=u.height,f=new at;if(null==f||null==t)var l=2;else i(null!=f),l=Rn(t,n,e,f.width,f.height,f.Pd,f.Qd,f.format,null);if(0!=l?c=0:(null!=c&&(c[0]=f.width[0]),null!=h&&(h[0]=f.height[0]),c=1),c){u.width=u.width[0],u.height=u.height[0],null!=r&&(r[0]=u.width),null!=s&&(s[0]=u.height);t:{if(r=new Gt,(s=new rn).data=t,s.w=n,s.ha=e,s.kd=1,n=[0],i(null!=s),(0==(t=Rn(s.data,s.w,s.ha,null,null,null,n,null,s))||7==t)&&n[0]&&(t=4),0==(n=t)){if(i(null!=a),r.data=s.data,r.w=s.w+s.offset,r.ha=s.ha-s.offset,r.put=dt,r.ac=lt,r.bc=vt,r.ma=a,s.xa){if(null==(t=Mt())){a=1;break t}if(function(t,n){var e=[0],r=[0],s=[0];i:for(;;){if(null==t)return 0;if(null==n)return t.a=2,0;if(t.l=n,t.a=0,p(t.m,n.data,n.w,n.ha),!mt(t.m,e,r,s)){t.a=3;break i}if(t.xb=mr,n.width=e[0],n.height=r[0],!jt(e[0],r[0],1,t,null))break i;return 1}return i(0!=t.a),0}(t,r)){if(r=0==(n=Dn(r.width,r.height,a.Oa,a.ba))){i:{r=t;n:for(;;){if(null==r){r=0;break i}if(i(null!=r.s.yc),i(null!=r.s.Ya),i(0<r.s.Wb),i(null!=(e=r.l)),i(null!=(s=e.ma)),0!=r.xb){if(r.ca=s.ba,r.tb=s.tb,i(null!=r.ca),!Bn(s.Oa,e,Te)){r.a=2;break n}if(!Et(r,e.width))break n;if(e.da)break n;if((e.da||et(r.ca.S))&&pn(),11>r.ca.S||(alert("todo:WebPInitConvertARGBToYUV"),null!=r.ca.f.kb.F&&pn()),r.Pb&&0<r.s.ua&&null==r.s.vb.X&&!O(r.s.vb,r.s.Wa.Xa)){r.a=1;break n}r.xb=0}if(!xt(r,r.V,r.Ba,r.c,r.i,e.o,yt))break n;s.Dc=r.Ma,r=1;break i}i(0!=r.a),r=0}r=!r}r&&(n=t.a)}else n=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,Xt(t,r)){if(0==(n=Dn(r.width,r.height,a.Oa,a.ba))){if(t.Aa=0,e=a.Oa,i(null!=(s=t)),null!=e){if(0<(c=0>(c=e.Md)?0:100<c?255:255*c/100)){for(h=f=0;4>h;++h)12>(l=s.pb[h]).lc&&(l.ia=c*zr[0>l.lc?0:l.lc]>>3),f|=l.ia;f&&(alert("todo:VP8InitRandom"),s.ia=1)}s.Ga=e.Id,100<s.Ga?s.Ga=100:0>s.Ga&&(s.Ga=0)}Zt(t,r)||(n=t.a)}}else n=t.a}0==n&&null!=a.Oa&&a.Oa.fd&&(n=Cn(a.ba))}a=n}o=0!=a?null:11>o?u.f.RGBA.eb:u.f.kb.y}else o=null;return o};var Ur=[3,4,3,4,4,2,2,4,4,4,2,1,1]};function c(t,i){for(var n="",e=0;e<4;e++)n+=String.fromCharCode(t[i++]);return n}function h(t,i){return(t[i+0]<<0|t[i+1]<<8|t[i+2]<<16)>>>0}function f(t,i){return(t[i+0]<<0|t[i+1]<<8|t[i+2]<<16|t[i+3]<<24)>>>0}new u;var l=[0],d=[0],v=[],m=new u,w=t,p=function(t,i){var n={},e=0,r=!1,s=0,o=0;if(n.frames=[],!
250
250
  /** @license
251
251
  * Copyright (c) 2017 Dominik Homberger
252
252
  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:
@@ -301,7 +301,7 @@ function(t){var i=function(t){for(var i=t.length,n=new Uint8Array(i),e=0;e<i;e++
301
301
  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
302
302
  * ====================================================================
303
303
  */
304
- function(){function t(){return(yt.canvg?Promise.resolve(yt.canvg):import("./p-1b7c13f8.js")).catch((function(t){return Promise.reject(new Error("Could not load canvg: "+t))})).then((function(t){return t.default?t.default:t}))}ii.API.addSvgAsImage=function(i,n,e,r,s,o,a,u){if(isNaN(n)||isNaN(e))throw kt.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(r)||isNaN(s))throw kt.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var c=document.createElement("canvas");c.width=r,c.height=s;var h=c.getContext("2d");h.fillStyle="#fff",h.fillRect(0,0,c.width,c.height);var f={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},l=this;return t().then((function(t){return t.fromString(h,i,f)}),(function(){return Promise.reject(new Error("Could not load canvg."))})).then((function(t){return t.render(f)})).then((function(){l.addImage(c.toDataURL("image/jpeg",1),n,e,r,s,a,u)}))}}(),ii.API.putTotalPages=function(t){var i,n=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(i=new RegExp(t,"g"),n=this.internal.getNumberOfPages()):(i=new RegExp(this.pdfEscape16(t,this.internal.getFont()),"g"),n=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var e=1;e<=this.internal.getNumberOfPages();e++)for(var r=0;r<this.internal.pages[e].length;r++)this.internal.pages[e][r]=this.internal.pages[e][r].replace(i,n);return this},ii.API.viewerPreferences=function(t,i){var n;t=t||{},i=i||!1;var e,r,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=[],c=0,h=0,f=0;function l(t,i){var n,e=!1;for(n=0;n<t.length;n+=1)t[n]===i&&(e=!0);return e}if(void 0===this.internal.viewerpreferences&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(o)),this.internal.viewerpreferences.isSubscribed=!1),n=this.internal.viewerpreferences.configuration,"reset"===t||!0===i){var d=a.length;for(f=0;f<d;f+=1)n[a[f]].value=n[a[f]].defaultValue,n[a[f]].explicitSet=!1}if("object"===B(t))for(r in t)if(s=t[r],l(a,r)&&void 0!==s){if("boolean"===n[r].type&&"boolean"==typeof s)n[r].value=s;else if("name"===n[r].type&&l(n[r].valueSet,s))n[r].value=s;else if("integer"===n[r].type&&Number.isInteger(s))n[r].value=s;else if("array"===n[r].type){for(c=0;c<s.length;c+=1)if(e=!0,1===s[c].length&&"number"==typeof s[c][0])u.push(String(s[c]-1));else if(s[c].length>1){for(h=0;h<s[c].length;h+=1)"number"!=typeof s[c][h]&&(e=!1);!0===e&&u.push([s[c][0]-1,s[c][1]-1].join(" "))}n[r].value="["+u.join(" ")+"]"}else n[r].value=n[r].defaultValue;n[r].explicitSet=!0}return!1===this.internal.viewerpreferences.isSubscribed&&(this.internal.events.subscribe("putCatalog",(function(){var t,i=[];for(t in n)!0===n[t].explicitSet&&i.push("name"===n[t].type?"/"+t+" /"+n[t].value:"/"+t+" "+n[t].value);0!==i.length&&this.internal.write("/ViewerPreferences\n<<\n"+i.join("\n")+"\n>>")})),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=n,this
304
+ function(){function t(){return(yt.canvg?Promise.resolve(yt.canvg):import("./p-98884f44.js")).catch((function(t){return Promise.reject(new Error("Could not load canvg: "+t))})).then((function(t){return t.default?t.default:t}))}ii.API.addSvgAsImage=function(i,n,e,r,s,o,a,u){if(isNaN(n)||isNaN(e))throw kt.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(r)||isNaN(s))throw kt.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var c=document.createElement("canvas");c.width=r,c.height=s;var h=c.getContext("2d");h.fillStyle="#fff",h.fillRect(0,0,c.width,c.height);var f={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},l=this;return t().then((function(t){return t.fromString(h,i,f)}),(function(){return Promise.reject(new Error("Could not load canvg."))})).then((function(t){return t.render(f)})).then((function(){l.addImage(c.toDataURL("image/jpeg",1),n,e,r,s,a,u)}))}}(),ii.API.putTotalPages=function(t){var i,n=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(i=new RegExp(t,"g"),n=this.internal.getNumberOfPages()):(i=new RegExp(this.pdfEscape16(t,this.internal.getFont()),"g"),n=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var e=1;e<=this.internal.getNumberOfPages();e++)for(var r=0;r<this.internal.pages[e].length;r++)this.internal.pages[e][r]=this.internal.pages[e][r].replace(i,n);return this},ii.API.viewerPreferences=function(t,i){var n;t=t||{},i=i||!1;var e,r,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=[],c=0,h=0,f=0;function l(t,i){var n,e=!1;for(n=0;n<t.length;n+=1)t[n]===i&&(e=!0);return e}if(void 0===this.internal.viewerpreferences&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(o)),this.internal.viewerpreferences.isSubscribed=!1),n=this.internal.viewerpreferences.configuration,"reset"===t||!0===i){var d=a.length;for(f=0;f<d;f+=1)n[a[f]].value=n[a[f]].defaultValue,n[a[f]].explicitSet=!1}if("object"===B(t))for(r in t)if(s=t[r],l(a,r)&&void 0!==s){if("boolean"===n[r].type&&"boolean"==typeof s)n[r].value=s;else if("name"===n[r].type&&l(n[r].valueSet,s))n[r].value=s;else if("integer"===n[r].type&&Number.isInteger(s))n[r].value=s;else if("array"===n[r].type){for(c=0;c<s.length;c+=1)if(e=!0,1===s[c].length&&"number"==typeof s[c][0])u.push(String(s[c]-1));else if(s[c].length>1){for(h=0;h<s[c].length;h+=1)"number"!=typeof s[c][h]&&(e=!1);!0===e&&u.push([s[c][0]-1,s[c][1]-1].join(" "))}n[r].value="["+u.join(" ")+"]"}else n[r].value=n[r].defaultValue;n[r].explicitSet=!0}return!1===this.internal.viewerpreferences.isSubscribed&&(this.internal.events.subscribe("putCatalog",(function(){var t,i=[];for(t in n)!0===n[t].explicitSet&&i.push("name"===n[t].type?"/"+t+" /"+n[t].value:"/"+t+" "+n[t].value);0!==i.length&&this.internal.write("/ViewerPreferences\n<<\n"+i.join("\n")+"\n>>")})),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=n,this
305
305
  /** ====================================================================
306
306
  * @license
307
307
  * jsPDF XMP metadata plugin
@@ -340,7 +340,7 @@ function(t){var i=function(){return void 0===this.internal.vFS&&(this.internal.v
340
340
  * Unicode Bidi Engine based on the work of Alex Shensis (@asthensis)
341
341
  * MIT License
342
342
  */
343
- function(t){t.__bidiEngine__=t.prototype.__bidiEngine__=function(t){var n,e,r,s,o,a,u,c=i,h=[[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]],f=[[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},d={0:0,5:1,6:2,7:3,32:4,251:5,254:6,255:7},v=["(",")","(","<",">","<","[","]","[","{","}","{","«","»","«","‹","›","‹","⁅","⁆","⁅","⁽","⁾","⁽","₍","₎","₍","≤","≥","≤","〈","〉","〈","﹙","﹚","﹙","﹛","﹜","﹛","﹝","﹞","﹝","﹤","﹥","﹤"],m=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)$/),w=!1,p=0;this.__bidiEngine__={};var b=function(t){var i=t.charCodeAt(),n=i>>8,e=d[n];return void 0!==e?c[256*e+(255&i)]:252===n||253===n?"AL":m.test(n)?"L":8===n?"R":"N"},g=function(t){for(var i,n=0;n<t.length;n++){if("L"===(i=b(t.charAt(n))))return!1;if("R"===i)return!0}return!1},N=function(t,i,o,a){var u,c,h,f,l=i[a];switch(l){case"L":case"R":case"LRE":case"RLE":case"LRO":case"RLO":case"PDF":w=!1;break;case"N":case"AN":break;case"EN":w&&(l="AN");break;case"AL":w=!0,l="R";break;case"WS":case"BN":l="N";break;case"CS":a<1||a+1>=i.length||"EN"!==(u=o[a-1])&&"AN"!==u||"EN"!==(c=i[a+1])&&"AN"!==c?l="N":w&&(c="AN"),l=c===u?c:"N";break;case"ES":l="EN"===(u=a>0?o[a-1]:"B")&&a+1<i.length&&"EN"===i[a+1]?"EN":"N";break;case"ET":if(a>0&&"EN"===o[a-1]){l="EN";break}if(w){l="N";break}for(h=a+1,f=i.length;h<f&&"ET"===i[h];)h++;l=h<f&&"EN"===i[h]?"EN":"N";break;case"NSM":if(r&&!s){for(f=i.length,h=a+1;h<f&&"NSM"===i[h];)h++;if(h<f){var d=t[a];if(u=i[h],(d>=1425&&d<=2303||64286===d)&&("R"===u||"AL"===u)){l="R";break}}}l=a<1||"B"===(u=i[a-1])?"N":o[a-1];break;case"B":w=!1,n=!0,l=p;break;case"S":e=!0,l="N"}return l},L=function(t,i,n){var e=t.split("");return n&&y(e,n,{hiLevel:p}),e.reverse(),i&&i.reverse(),e.join("")},y=function(t,i,r){var s,o,a,u,c,d=-1,v=t.length,m=0,g=[],L=p?f:h,y=[];for(w=!1,n=!1,e=!1,o=0;o<v;o++)y[o]=b(t[o]);for(a=0;a<v;a++){if(c=m,g[a]=N(t,y,g,a),s=240&(m=L[c][l[g[a]]]),i[a]=u=L[m&=15][5],s>0)if(16===s){for(o=d;o<a;o++)i[o]=1;d=-1}else d=-1;if(L[m][6])-1===d&&(d=a);else if(d>-1){for(o=d;o<a;o++)i[o]=u;d=-1}"B"===y[a]&&(i[a]=0),r.hiLevel|=u}e&&function(t,i,n){for(var e=0;e<n;e++)if("S"===t[e]){i[e]=p;for(var r=e-1;r>=0&&"WS"===t[r];r--)i[r]=p}}(y,i,v)},A=function(t,i,e,r,s){if(!(s.hiLevel<t)){if(1===t&&1===p&&!n)return i.reverse(),void(e&&e.reverse());for(var o,a,u,c,h=i.length,f=0;f<h;){if(r[f]>=t){for(u=f+1;u<h&&r[u]>=t;)u++;for(c=f,a=u-1;c<a;c++,a--)o=i[c],i[c]=i[a],i[a]=o,e&&(o=e[c],e[c]=e[a],e[a]=o);f=u}f++}}},k=function(t,i,n){var e=t.split(""),r={hiLevel:p};return n||(n=[]),y(e,n,r),function(t,i,n){if(0!==n.hiLevel&&u)for(var e,r=0;r<t.length;r++)1===i[r]&&(e=v.indexOf(t[r]))>=0&&(t[r]=v[e+1])}(e,n,r),A(2,e,i,n,r),A(1,e,i,n,r),e.join("")};return this.__bidiEngine__.doBidiReorder=function(t,i,n){if(function(t,i){if(i)for(var n=0;n<t.length;n++)i[n]=n;void 0===s&&(s=g(t)),void 0===a&&(a=g(t))}(t,i),r||!o||a)if(r&&o&&s^a)p=s?1:0,t=L(t,i,n);else if(!r&&o&&a)p=s?1:0,t=k(t,i,n),t=L(t,i);else if(!r||s||o||a){if(r&&!o&&s^a)t=L(t,i),s?(p=0,t=k(t,i,n)):(p=1,t=k(t,i,n),t=L(t,i));else if(r&&s&&!o&&a)p=1,t=k(t,i,n),t=L(t,i);else if(!r&&!o&&s^a){var e=u;s?(p=1,t=k(t,i,n),p=0,u=!1,t=k(t,i,n),u=e):(p=0,t=k(t,i,n),t=L(t,i),p=1,u=!1,t=k(t,i,n),u=e,t=L(t,i))}}else p=0,t=k(t,i,n);else p=s?1:0,t=k(t,i,n);return t},this.__bidiEngine__.setOptions=function(t){t&&(r=t.isInputVisual,o=t.isOutputVisual,s=t.isInputRtl,a=t.isOutputRtl,u=t.isSymmetricSwapping)},this.__bidiEngine__.setOptions(t),this.__bidiEngine__};var i=["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"],n=new t.__bidiEngine__({isInputVisual:!0});t.API.events.push(["postProcessText",function(t){var i=t.text,e=t.options||{},r=[];if(e.isInputVisual="boolean"!=typeof e.isInputVisual||e.isInputVisual,n.setOptions(e),"[object Array]"===Object.prototype.toString.call(i)){var s=0;for(r=[],s=0;s<i.length;s+=1)"[object Array]"===Object.prototype.toString.call(i[s])?r.push([n.doBidiReorder(i[s][0]),i[s][1],i[s][2]]):r.push([n.doBidiReorder(i[s])]);t.text=r}else t.text=n.doBidiReorder(i);n.setOptions({isInputVisual:!0})}])}(ii),ii.API.TTFFont=function(){function t(t){var i;if(this.rawData=t,i=this.contents=new Ln(t),this.contents.pos=4,"ttcf"===i.readString(4))throw new Error("TTCF not supported.");i.pos=0,this.parse(),this.subset=new _n(this),this.registerTTF()}return t.open=function(i){return new t(i)},t.prototype.parse=function(){return this.directory=new yn(this.contents),this.head=new xn(this),this.name=new Fn(this),this.cmap=new Mn(this),this.toUnicode={},this.hhea=new jn(this),this.maxp=new Rn(this),this.hmtx=new On(this),this.post=new Pn(this),this.os2=new En(this),this.loca=new zn(this),this.glyf=new Dn(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,i,n,e;if(this.scaleFactor=1e3/this.head.unitsPerEm,this.bbox=function(){var t,i,n,e;for(e=[],t=0,i=(n=this.bbox).length;t<i;t++)e.push(Math.round(n[t]*this.scaleFactor));return e}.call(this),this.stemV=0,this.post.exists?(i=255&(n=this.post.italic_angle),0!=(32768&(t=n>>16))&&(t=-(1+(65535^t))),this.italicAngle=+(t+"."+i)):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===(e=this.familyClass)||2===e||3===e||4===e||5===e||7===e,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 i;return(null!=(i=this.cmap.unicode)?i.codeMap[t]:void 0)||0},t.prototype.widthOfGlyph=function(t){var i;return i=1e3/this.head.unitsPerEm,this.hmtx.forGlyph(t).advance*i},t.prototype.widthOfString=function(t,i,n){var e,r,s,o;for(s=0,r=0,o=(t=""+t).length;0<=o?r<o:r>o;r=0<=o?++r:--r)e=t.charCodeAt(r),s+=this.widthOfGlyph(this.characterToGlyph(e))+n*(1e3/i)||0;return s*(i/1e3)},t.prototype.lineHeight=function(t,i){return null==i&&(i=!1),(this.ascender+(i?this.lineGap:0)-this.decender)/1e3*t},t}();var Nn,Ln=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 i,n;for(n=[],i=0;0<=t?i<t:i>t;i=0<=t?++i:--i)n[i]=String.fromCharCode(this.readByte());return n.join("")},t.prototype.writeString=function(t){var i,n,e;for(e=[],i=0,n=t.length;0<=n?i<n:i>n;i=0<=n?++i:--i)e.push(this.writeByte(t.charCodeAt(i)));return e},t.prototype.readShort=function(){return this.readInt16()},t.prototype.writeShort=function(t){return this.writeInt16(t)},t.prototype.readLongLong=function(){var t,i,n,e,r,s,o,a;return t=this.readByte(),i=this.readByte(),n=this.readByte(),e=this.readByte(),r=this.readByte(),s=this.readByte(),o=this.readByte(),a=this.readByte(),128&t?-1*(72057594037927940*(255^t)+281474976710656*(255^i)+1099511627776*(255^n)+4294967296*(255^e)+16777216*(255^r)+65536*(255^s)+256*(255^o)+(255^a)+1):72057594037927940*t+281474976710656*i+1099511627776*n+4294967296*e+16777216*r+65536*s+256*o+a},t.prototype.writeLongLong=function(t){var i,n;return i=Math.floor(t/4294967296),n=4294967295&t,this.writeByte(i>>24&255),this.writeByte(i>>16&255),this.writeByte(i>>8&255),this.writeByte(255&i),this.writeByte(n>>24&255),this.writeByte(n>>16&255),this.writeByte(n>>8&255),this.writeByte(255&n)},t.prototype.readInt=function(){return this.readInt32()},t.prototype.writeInt=function(t){return this.writeInt32(t)},t.prototype.read=function(t){var i,n;for(i=[],n=0;0<=t?n<t:n>t;n=0<=t?++n:--n)i.push(this.readByte());return i},t.prototype.write=function(t){var i,n,e;for(e=[],i=0,n=t.length;i<n;i++)e.push(this.writeByte(t[i]));return e},t}(),yn=function(){var t;function i(t){var i,n,e;for(this.scalarType=t.readInt(),this.tableCount=t.readShort(),this.searchRange=t.readShort(),this.entrySelector=t.readShort(),this.rangeShift=t.readShort(),this.tables={},n=0,e=this.tableCount;0<=e?n<e:n>e;n=0<=e?++n:--n)i={tag:t.readString(4),checksum:t.readInt(),offset:t.readInt(),length:t.readInt()},this.tables[i.tag]=i}return i.prototype.encode=function(i){var n,e,r,s,o,a,u,c,h,f,l,d;for(d in f=Object.keys(i).length,o=Math.log(2),c=16*Math.floor(Math.log(f)/o),r=Math.floor(c/o),u=16*f-c,(e=new Ln).writeInt(this.scalarType),e.writeShort(f),e.writeShort(c),e.writeShort(r),e.writeShort(u),a=e.pos+16*f,s=null,l=[],i)for(h=i[d],e.writeString(d),e.writeInt(t(h)),e.writeInt(a),e.writeInt(h.length),l=l.concat(h),"head"===d&&(s=a),a+=h.length;a%4;)l.push(0),a++;return e.write(l),n=2981146554-t(e.data),e.pos=s+8,e.writeUInt32(n),e.data},t=function(t){var i,n,e,r;for(t=Bn.call(t);t.length%4;)t.push(0);for(e=new Ln(t),n=0,i=0,r=t.length;i<r;i=i+=4)n+=e.readUInt32();return 4294967295&n},i}(),An={}.hasOwnProperty,kn=function(t,i){for(var n in i)An.call(i,n)&&(t[n]=i[n]);function e(){this.constructor=t}return e.prototype=i.prototype,t.prototype=new e,t.__super__=i.prototype,t};Nn=function(){function t(t){var i;this.file=t,this.exists=!!(i=this.file.directory.tables[this.tag]),i&&(this.offset=i.offset,this.length=i.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 Sn,xn=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return kn(t,Nn),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 i;return(i=new Ln).writeInt(this.version),i.writeInt(this.revision),i.writeInt(this.checkSumAdjustment),i.writeInt(this.magicNumber),i.writeShort(this.flags),i.writeShort(this.unitsPerEm),i.writeLongLong(this.created),i.writeLongLong(this.modified),i.writeShort(this.xMin),i.writeShort(this.yMin),i.writeShort(this.xMax),i.writeShort(this.yMax),i.writeShort(this.macStyle),i.writeShort(this.lowestRecPPEM),i.writeShort(this.fontDirectionHint),i.writeShort(t),i.writeShort(this.glyphDataFormat),i.data},t}(),qn=function(){function t(t,i){var n,e,r,s,o,a,u,c,h,f,l,d,v,m,w,p,b;switch(this.platformID=t.readUInt16(),this.encodingID=t.readShort(),this.offset=i+t.readInt(),h=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(),f=l/2,t.pos+=6,r=function(){var i,n;for(n=[],a=i=0;0<=f?i<f:i>f;a=0<=f?++i:--i)n.push(t.readUInt16());return n}(),t.pos+=2,v=function(){var i,n;for(n=[],a=i=0;0<=f?i<f:i>f;a=0<=f?++i:--i)n.push(t.readUInt16());return n}(),u=function(){var i,n;for(n=[],a=i=0;0<=f?i<f:i>f;a=0<=f?++i:--i)n.push(t.readUInt16());return n}(),c=function(){var i,n;for(n=[],a=i=0;0<=f?i<f:i>f;a=0<=f?++i:--i)n.push(t.readUInt16());return n}(),e=(this.length-t.pos+this.offset)/2,o=function(){var i,n;for(n=[],a=i=0;0<=e?i<e:i>e;a=0<=e?++i:--i)n.push(t.readUInt16());return n}(),a=w=0,b=r.length;w<b;a=++w)for(m=r[a],n=p=d=v[a];d<=m?p<=m:p>=m;n=d<=m?++p:--p)0===c[a]?s=n+u[a]:0!==(s=o[c[a]/2+(n-d)-(f-a)]||0)&&(s+=u[a]),this.codeMap[n]=65535&s}t.pos=h}return t.encode=function(t,i){var n,e,r,s,o,a,u,c,h,f,l,d,v,m,w,p,b,g,N,L,y,A,k,S,x,q,M,j,E,P,I,F,R,O,B,D,C,T,z,_,U,V,W,H,G;switch(M=new Ln,s=Object.keys(t).sort((function(t,i){return t-i})),i){case"macroman":for(v=0,m=function(){var t=[];for(d=0;d<256;++d)t.push(0);return t}(),p={0:0},r={},j=0,F=s.length;j<F;j++)null==p[V=t[e=s[j]]]&&(p[V]=++v),r[e]={old:t[e],new:p[t[e]]},m[e]=p[t[e]];return M.writeUInt16(1),M.writeUInt16(0),M.writeUInt32(12),M.writeUInt16(0),M.writeUInt16(262),M.writeUInt16(0),M.write(m),{charMap:r,subtable:M.data,maxGlyphID:v+1};case"unicode":for(x=[],h=[],b=0,p={},n={},w=u=null,E=0,R=s.length;E<R;E++)null==p[g=t[e=s[E]]]&&(p[g]=++b),n[e]={old:g,new:p[g]},o=p[g]-e,null!=w&&o===u||(w&&h.push(w),x.push(e),u=o),w=e;for(w&&h.push(w),h.push(65535),x.push(65535),k=2*(A=x.length),y=2*Math.pow(Math.log(A)/Math.LN2,2),f=Math.log(y/2)/Math.LN2,L=2*A-y,a=[],N=[],l=[],d=P=0,O=x.length;P<O;d=++P){if(c=h[d],65535===(S=x[d])){a.push(0),N.push(0);break}if(S-(q=n[S].new)>=32768)for(a.push(0),N.push(2*(l.length+A-d)),e=I=S;S<=c?I<=c:I>=c;e=S<=c?++I:--I)l.push(n[e].new);else a.push(q-S),N.push(0)}for(M.writeUInt16(3),M.writeUInt16(1),M.writeUInt32(12),M.writeUInt16(4),M.writeUInt16(16+8*A+2*l.length),M.writeUInt16(0),M.writeUInt16(k),M.writeUInt16(y),M.writeUInt16(f),M.writeUInt16(L),_=0,B=h.length;_<B;_++)M.writeUInt16(e=h[_]);for(M.writeUInt16(0),U=0,D=x.length;U<D;U++)M.writeUInt16(e=x[U]);for(W=0,C=a.length;W<C;W++)M.writeUInt16(o=a[W]);for(H=0,T=N.length;H<T;H++)M.writeUInt16(N[H]);for(G=0,z=l.length;G<z;G++)M.writeUInt16(v=l[G]);return{charMap:n,subtable:M.data,maxGlyphID:b+1}}},t}(),Mn=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return kn(t,Nn),t.prototype.tag="cmap",t.prototype.parse=function(t){var i,n,e;for(t.pos=this.offset,this.version=t.readUInt16(),e=t.readUInt16(),this.tables=[],this.unicode=null,n=0;0<=e?n<e:n>e;n=0<=e?++n:--n)i=new qn(t,this.offset),this.tables.push(i),i.isUnicode&&null==this.unicode&&(this.unicode=i);return!0},t.encode=function(t,i){var n,e;return null==i&&(i="macroman"),n=qn.encode(t,i),(e=new Ln).writeUInt16(0),e.writeUInt16(1),n.table=e.data.concat(n.subtable),n},t}(),jn=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return kn(t,Nn),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}(),En=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return kn(t,Nn),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 i,n;for(n=[],i=0;i<10;++i)n.push(t.readByte());return n}(),this.charRange=function(){var i,n;for(n=[],i=0;i<4;++i)n.push(t.readInt());return n}(),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 i,n;for(n=[],i=0;i<2;i=++i)n.push(t.readInt());return n}(),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}(),Pn=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return kn(t,Nn),t.prototype.tag="post",t.prototype.parse=function(t){var i,n,e;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 r;for(n=t.readUInt16(),this.glyphNameIndex=[],r=0;0<=n?r<n:r>n;r=0<=n?++r:--r)this.glyphNameIndex.push(t.readUInt16());for(this.names=[],e=[];t.pos<this.offset+this.length;)i=t.readByte(),e.push(this.names.push(t.readString(i)));return e;case 151552:return n=t.readUInt16(),this.offsets=t.read(n);case 262144:return this.map=function(){var i,n,e;for(e=[],r=i=0,n=this.file.maxp.numGlyphs;0<=n?i<n:i>n;r=0<=n?++i:--i)e.push(t.readUInt32());return e}.call(this)}},t}(),In=function(t,i){this.raw=t,this.length=t.length,this.platformID=i.platformID,this.encodingID=i.encodingID,this.languageID=i.languageID},Fn=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return kn(t,Nn),t.prototype.tag="name",t.prototype.parse=function(t){var i,n,e,r,s,o,a,u,c,h,f;for(t.pos=this.offset,t.readShort(),i=t.readShort(),o=t.readShort(),n=[],r=0;0<=i?r<i:r>i;r=0<=i?++r:--r)n.push({platformID:t.readShort(),encodingID:t.readShort(),languageID:t.readShort(),nameID:t.readShort(),length:t.readShort(),offset:this.offset+o+t.readShort()});for(a={},r=c=0,h=n.length;c<h;r=++c)t.pos=(e=n[r]).offset,u=t.readString(e.length),s=new In(u,e),null==a[f=e.nameID]&&(a[f]=[]),a[e.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}(),Rn=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return kn(t,Nn),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}(),On=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return kn(t,Nn),t.prototype.tag="hmtx",t.prototype.parse=function(t){var i,n,e,r,s,o;for(t.pos=this.offset,this.metrics=[],i=0,s=this.file.hhea.numberOfMetrics;0<=s?i<s:i>s;i=0<=s?++i:--i)this.metrics.push({advance:t.readUInt16(),lsb:t.readInt16()});for(e=this.file.maxp.numGlyphs-this.file.hhea.numberOfMetrics,this.leftSideBearings=function(){var n,r;for(r=[],i=n=0;0<=e?n<e:n>e;i=0<=e?++n:--n)r.push(t.readInt16());return r}(),this.widths=function(){var t,i,n,e;for(e=[],t=0,i=(n=this.metrics).length;t<i;t++)e.push(n[t].advance);return e}.call(this),n=this.widths[this.widths.length-1],o=[],i=r=0;0<=e?r<e:r>e;i=0<=e?++r:--r)o.push(this.widths.push(n));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}(),Bn=[].slice,Dn=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return kn(t,Nn),t.prototype.tag="glyf",t.prototype.parse=function(){return this.cache={}},t.prototype.glyphFor=function(t){var i,n,e,r,s,o,a,u,c,h;return t in this.cache?this.cache[t]:(i=this.file.contents,n=(r=this.file.loca).indexOf(t),0===(e=r.lengthOf(t))?this.cache[t]=null:(i.pos=this.offset+n,s=(o=new Ln(i.read(e))).readShort(),u=o.readShort(),h=o.readShort(),a=o.readShort(),c=o.readShort(),this.cache[t]=-1===s?new Tn(o,u,h,a,c):new Cn(o,s,u,h,a,c),this.cache[t]))},t.prototype.encode=function(t,i,n){var e,r,s,o,a;for(s=[],r=[],o=0,a=i.length;o<a;o++)e=t[i[o]],r.push(s.length),e&&(s=s.concat(e.encode(n)));return r.push(s.length),{table:s,offsets:r}},t}(),Cn=function(){function t(t,i,n,e,r,s){this.raw=t,this.numberOfContours=i,this.xMin=n,this.yMin=e,this.xMax=r,this.yMax=s,this.compound=!1}return t.prototype.encode=function(){return this.raw.data},t}(),Tn=function(){function t(t,i,n,e,r){var s,o;for(this.raw=t,this.xMin=i,this.yMin=n,this.xMax=e,this.yMax=r,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,i,n;for(i=new Ln(Bn.call(this.raw.data)),t=0,n=this.glyphIDs.length;t<n;++t)i.pos=this.glyphOffsets[t];return i.data},t}(),zn=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return kn(t,Nn),t.prototype.tag="loca",t.prototype.parse=function(t){var i;return t.pos=this.offset,this.offsets=0===this.file.head.indexToLocFormat?function(){var n,e;for(e=[],i=0,n=this.length;i<n;i+=2)e.push(2*t.readUInt16());return e}.call(this):function(){var n,e;for(e=[],i=0,n=this.length;i<n;i+=4)e.push(t.readUInt32());return e}.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,i){for(var n=new Uint32Array(this.offsets.length),e=0,r=0,s=0;s<n.length;++s)if(n[s]=e,r<i.length&&i[r]==s){++r,n[s]=e;var o=this.offsets[s+1]-this.offsets[s];o>0&&(e+=o)}for(var a=new Array(4*n.length),u=0;u<n.length;++u)a[4*u+3]=255&n[u],a[4*u+2]=(65280&n[u])>>8,a[4*u+1]=(16711680&n[u])>>16,a[4*u]=(4278190080&n[u])>>24;return a},t}(),_n=function(){function t(t){this.font=t,this.subset={},this.unicodes={},this.next=33}return t.prototype.generateCmap=function(){var t,i,n,e;for(i in n=this.font.cmap.tables[0].codeMap,t={},e=this.subset)t[i]=n[e[i]];return t},t.prototype.glyphsFor=function(t){var i,n,e,r,s,o,a;for(e={},s=0,o=t.length;s<o;s++)e[r=t[s]]=this.font.glyf.glyphFor(r);for(r in i=[],e)(null!=(n=e[r])?n.compound:void 0)&&i.push.apply(i,n.glyphIDs);if(i.length>0)for(r in a=this.glyphsFor(i))e[r]=n=a[r];return e},t.prototype.encode=function(t,i){var n,e,r,s,o,a,u,c,h,f,l,d,v,m;for(e in n=Mn.encode(this.generateCmap(),"unicode"),s=this.glyphsFor(t),f={0:0},m=n.charMap)f[(o=m[e]).old]=o.new;for(l in h=n.maxGlyphID,s)l in f||(f[l]=h++);return u=function(t){var i,n;for(i in n={},t)n[t[i]]=i;return n}(f),c=Object.keys(u).sort((function(t,i){return t-i})),d=function(){var t,i,n;for(n=[],t=0,i=c.length;t<i;t++)n.push(u[c[t]]);return n}(),r=this.font.glyf.encode(s,d,f),a=this.font.loca.encode(r.offsets,d),v={cmap:this.font.cmap.raw(),glyf:r.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(i)},this.font.os2.exists&&(v["OS/2"]=this.font.os2.raw()),this.font.directory.encode(v)},t}();ii.API.PDFObject=function(){var t;function i(){}return t=function(t,i){return(Array(i+1).join("0")+t).slice(-i)},i.convert=function(n){var e,r;if(Array.isArray(n))return"["+function(){var t,e,r;for(r=[],t=0,e=n.length;t<e;t++)r.push(i.convert(n[t]));return r}().join(" ")+"]";if("string"==typeof n)return"/"+n;if(null!=n?n.isString:void 0)return"("+n+")";if(n instanceof Date)return"(D:"+t(n.getUTCFullYear(),4)+t(n.getUTCMonth(),2)+t(n.getUTCDate(),2)+t(n.getUTCHours(),2)+t(n.getUTCMinutes(),2)+t(n.getUTCSeconds(),2)+"Z)";if("[object Object]"==={}.toString.call(n)){for(e in r=["<<"],n)r.push("/"+e+" "+i.convert(n[e]));return r.push(">>"),r.join("\n")}return""+n},i}(),function(t){t.A4="A4",t.ANSI_A="ANSI A"}(Sn||(Sn={}));class Un{constructor(){this.dataPath="",this.lang="en",this.title="",this.fontProps={fontResolutionInchesPerPoint:1/72,fontFullHeightRatio:1.28},this.lineOptions={x1:0,y1:0,x2:0,y2:0,lineProperties:{thickness:.1,color:"000000",opacity:1}},this.pageOptions={pageType:Sn.ANSI_A,width:8.5,height:11,leftMargin:.25,rightMargin:.25,topMargin:.25,bottomMargin:.25,drawNeatline:!1},this.rectangleOptions={left:0,top:0,width:8.5,height:11,lineProperties:{thickness:.1,color:"000000",opacity:1},fillColor:"",fillOpacity:1},this.tableOptions={lineProperties:{thickness:.1,color:"",opacity:1},textProperties:{left:0,top:0,fontPoints:1,fontColor:"000000"}},this.textOptions={left:0,top:0,fontPoints:1,fontColor:"000000"}}static getPageSize(t){switch("string"==typeof t&&(t=t===Sn.A4?Sn.A4:Sn.ANSI_A),t){case Sn.A4:return{width:8.25,height:11.708333};case Sn.ANSI_A:return{width:8.5,height:11}}}addPage(){}applyOpacity(t,i){return t*i+1*(1-i)}drawLine(t){const i={...this.lineOptions,...t};i.lineProperties={...this.lineOptions.lineProperties,...t.lineProperties},this.updateLineProperties(i.lineProperties),this.lineOptions=i}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 i={...this.rectangleOptions,...t};i.lineProperties={...this.lineOptions.lineProperties,...t.lineProperties},this.updateLineProperties(i.lineProperties),this.rectangleOptions.fillColor===i.fillColor&&this.rectangleOptions.fillOpacity===i.fillOpacity||this.setFillColor(i.fillColor,i.fillOpacity),this.rectangleOptions=i}drawTable(t,i){const n={};n.lineProperties={...this.tableOptions.lineProperties,...i.lineProperties},n.textProperties={...this.tableOptions.textProperties,...i.textProperties},this.tableOptions.textProperties.fontPoints!==n.textProperties.fontPoints&&this.setFontSize(n.textProperties.fontPoints),this.tableOptions.textProperties.fontColor!==n.textProperties.fontColor&&this.setFontColor(n.textProperties.fontColor),this.updateLineProperties(n.lineProperties),this.tableOptions=n}drawText(t,i){const n={...this.textOptions,...i};this.textOptions.fontPoints!==n.fontPoints&&this.setFontSize(n.fontPoints),this.textOptions.fontColor!==n.fontColor&&this.setFontColor(n.fontColor),this.textOptions=n}fontAscenderBaselineHeight(t){return t*this.fontProps.fontResolutionInchesPerPoint}fontAscenderDescenderHeight(t){return this.fontProps.fontFullHeightRatio*this.fontAscenderBaselineHeight(t)}getFontFileName(t){let i="0b7681dc140844ee9f409bdac249fbf0-general";return"ja"===t?i="0b7681dc140844ee9f409bdac249fbf0-japanese":"ko"===t?i="0b7681dc140844ee9f409bdac249fbf0-korean":"zh-cn"===t?i="0b7681dc140844ee9f409bdac249fbf0-simplified-chinese":"zh-hk"!==t&&"zh-tw"!==t||(i="0b7681dc140844ee9f409bdac249fbf0-traditional-chinese"),i}getTextWidth(t,i){return t.length*i}hexToRGB(t,i=1){const n=/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return n?{r:this.applyOpacity(parseInt(n[1],16)/255,i),g:this.applyOpacity(parseInt(n[2],16)/255,i),b:this.applyOpacity(parseInt(n[3],16)/255,i)}:{r:0,g:0,b:0}}async initialize(t={},i="",n="en",e="",r=!1){if("{}"!==JSON.stringify(t)){this.pageOptions.pageType=t.pageType===Sn.A4?Sn.A4:Sn.ANSI_A;const i=Un.getPageSize(this.pageOptions.pageType);this.pageOptions.width=i.width,this.pageOptions.height=i.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=i,this.lang=n,this.title=e||"PDF Document",this.pageOptions.drawNeatline=r,Promise.resolve()}save(){}setDrawColor(t,i=1){}setFillColor(t,i=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}}
343
+ function(t){t.__bidiEngine__=t.prototype.__bidiEngine__=function(t){var n,e,r,s,o,a,u,c=i,h=[[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]],f=[[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},d={0:0,5:1,6:2,7:3,32:4,251:5,254:6,255:7},v=["(",")","(","<",">","<","[","]","[","{","}","{","«","»","«","‹","›","‹","⁅","⁆","⁅","⁽","⁾","⁽","₍","₎","₍","≤","≥","≤","〈","〉","〈","﹙","﹚","﹙","﹛","﹜","﹛","﹝","﹞","﹝","﹤","﹥","﹤"],m=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)$/),w=!1,p=0;this.__bidiEngine__={};var b=function(t){var i=t.charCodeAt(),n=i>>8,e=d[n];return void 0!==e?c[256*e+(255&i)]:252===n||253===n?"AL":m.test(n)?"L":8===n?"R":"N"},g=function(t){for(var i,n=0;n<t.length;n++){if("L"===(i=b(t.charAt(n))))return!1;if("R"===i)return!0}return!1},N=function(t,i,o,a){var u,c,h,f,l=i[a];switch(l){case"L":case"R":case"LRE":case"RLE":case"LRO":case"RLO":case"PDF":w=!1;break;case"N":case"AN":break;case"EN":w&&(l="AN");break;case"AL":w=!0,l="R";break;case"WS":case"BN":l="N";break;case"CS":a<1||a+1>=i.length||"EN"!==(u=o[a-1])&&"AN"!==u||"EN"!==(c=i[a+1])&&"AN"!==c?l="N":w&&(c="AN"),l=c===u?c:"N";break;case"ES":l="EN"===(u=a>0?o[a-1]:"B")&&a+1<i.length&&"EN"===i[a+1]?"EN":"N";break;case"ET":if(a>0&&"EN"===o[a-1]){l="EN";break}if(w){l="N";break}for(h=a+1,f=i.length;h<f&&"ET"===i[h];)h++;l=h<f&&"EN"===i[h]?"EN":"N";break;case"NSM":if(r&&!s){for(f=i.length,h=a+1;h<f&&"NSM"===i[h];)h++;if(h<f){var d=t[a];if(u=i[h],(d>=1425&&d<=2303||64286===d)&&("R"===u||"AL"===u)){l="R";break}}}l=a<1||"B"===(u=i[a-1])?"N":o[a-1];break;case"B":w=!1,n=!0,l=p;break;case"S":e=!0,l="N"}return l},L=function(t,i,n){var e=t.split("");return n&&y(e,n,{hiLevel:p}),e.reverse(),i&&i.reverse(),e.join("")},y=function(t,i,r){var s,o,a,u,c,d=-1,v=t.length,m=0,g=[],L=p?f:h,y=[];for(w=!1,n=!1,e=!1,o=0;o<v;o++)y[o]=b(t[o]);for(a=0;a<v;a++){if(c=m,g[a]=N(t,y,g,a),s=240&(m=L[c][l[g[a]]]),i[a]=u=L[m&=15][5],s>0)if(16===s){for(o=d;o<a;o++)i[o]=1;d=-1}else d=-1;if(L[m][6])-1===d&&(d=a);else if(d>-1){for(o=d;o<a;o++)i[o]=u;d=-1}"B"===y[a]&&(i[a]=0),r.hiLevel|=u}e&&function(t,i,n){for(var e=0;e<n;e++)if("S"===t[e]){i[e]=p;for(var r=e-1;r>=0&&"WS"===t[r];r--)i[r]=p}}(y,i,v)},A=function(t,i,e,r,s){if(!(s.hiLevel<t)){if(1===t&&1===p&&!n)return i.reverse(),void(e&&e.reverse());for(var o,a,u,c,h=i.length,f=0;f<h;){if(r[f]>=t){for(u=f+1;u<h&&r[u]>=t;)u++;for(c=f,a=u-1;c<a;c++,a--)o=i[c],i[c]=i[a],i[a]=o,e&&(o=e[c],e[c]=e[a],e[a]=o);f=u}f++}}},k=function(t,i,n){var e=t.split(""),r={hiLevel:p};return n||(n=[]),y(e,n,r),function(t,i,n){if(0!==n.hiLevel&&u)for(var e,r=0;r<t.length;r++)1===i[r]&&(e=v.indexOf(t[r]))>=0&&(t[r]=v[e+1])}(e,n,r),A(2,e,i,n,r),A(1,e,i,n,r),e.join("")};return this.__bidiEngine__.doBidiReorder=function(t,i,n){if(function(t,i){if(i)for(var n=0;n<t.length;n++)i[n]=n;void 0===s&&(s=g(t)),void 0===a&&(a=g(t))}(t,i),r||!o||a)if(r&&o&&s^a)p=s?1:0,t=L(t,i,n);else if(!r&&o&&a)p=s?1:0,t=k(t,i,n),t=L(t,i);else if(!r||s||o||a){if(r&&!o&&s^a)t=L(t,i),s?(p=0,t=k(t,i,n)):(p=1,t=k(t,i,n),t=L(t,i));else if(r&&s&&!o&&a)p=1,t=k(t,i,n),t=L(t,i);else if(!r&&!o&&s^a){var e=u;s?(p=1,t=k(t,i,n),p=0,u=!1,t=k(t,i,n),u=e):(p=0,t=k(t,i,n),t=L(t,i),p=1,u=!1,t=k(t,i,n),u=e,t=L(t,i))}}else p=0,t=k(t,i,n);else p=s?1:0,t=k(t,i,n);return t},this.__bidiEngine__.setOptions=function(t){t&&(r=t.isInputVisual,o=t.isOutputVisual,s=t.isInputRtl,a=t.isOutputRtl,u=t.isSymmetricSwapping)},this.__bidiEngine__.setOptions(t),this.__bidiEngine__};var i=["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"],n=new t.__bidiEngine__({isInputVisual:!0});t.API.events.push(["postProcessText",function(t){var i=t.text,e=t.options||{},r=[];if(e.isInputVisual="boolean"!=typeof e.isInputVisual||e.isInputVisual,n.setOptions(e),"[object Array]"===Object.prototype.toString.call(i)){var s=0;for(r=[],s=0;s<i.length;s+=1)"[object Array]"===Object.prototype.toString.call(i[s])?r.push([n.doBidiReorder(i[s][0]),i[s][1],i[s][2]]):r.push([n.doBidiReorder(i[s])]);t.text=r}else t.text=n.doBidiReorder(i);n.setOptions({isInputVisual:!0})}])}(ii),ii.API.TTFFont=function(){function t(t){var i;if(this.rawData=t,i=this.contents=new Ln(t),this.contents.pos=4,"ttcf"===i.readString(4))throw new Error("TTCF not supported.");i.pos=0,this.parse(),this.subset=new _n(this),this.registerTTF()}return t.open=function(i){return new t(i)},t.prototype.parse=function(){return this.directory=new yn(this.contents),this.head=new xn(this),this.name=new On(this),this.cmap=new Mn(this),this.toUnicode={},this.hhea=new jn(this),this.maxp=new Fn(this),this.hmtx=new Rn(this),this.post=new Pn(this),this.os2=new En(this),this.loca=new zn(this),this.glyf=new Cn(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,i,n,e;if(this.scaleFactor=1e3/this.head.unitsPerEm,this.bbox=function(){var t,i,n,e;for(e=[],t=0,i=(n=this.bbox).length;t<i;t++)e.push(Math.round(n[t]*this.scaleFactor));return e}.call(this),this.stemV=0,this.post.exists?(i=255&(n=this.post.italic_angle),0!=(32768&(t=n>>16))&&(t=-(1+(65535^t))),this.italicAngle=+(t+"."+i)):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===(e=this.familyClass)||2===e||3===e||4===e||5===e||7===e,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 i;return(null!=(i=this.cmap.unicode)?i.codeMap[t]:void 0)||0},t.prototype.widthOfGlyph=function(t){var i;return i=1e3/this.head.unitsPerEm,this.hmtx.forGlyph(t).advance*i},t.prototype.widthOfString=function(t,i,n){var e,r,s,o;for(s=0,r=0,o=(t=""+t).length;0<=o?r<o:r>o;r=0<=o?++r:--r)e=t.charCodeAt(r),s+=this.widthOfGlyph(this.characterToGlyph(e))+n*(1e3/i)||0;return s*(i/1e3)},t.prototype.lineHeight=function(t,i){return null==i&&(i=!1),(this.ascender+(i?this.lineGap:0)-this.decender)/1e3*t},t}();var Nn,Ln=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 i,n;for(n=[],i=0;0<=t?i<t:i>t;i=0<=t?++i:--i)n[i]=String.fromCharCode(this.readByte());return n.join("")},t.prototype.writeString=function(t){var i,n,e;for(e=[],i=0,n=t.length;0<=n?i<n:i>n;i=0<=n?++i:--i)e.push(this.writeByte(t.charCodeAt(i)));return e},t.prototype.readShort=function(){return this.readInt16()},t.prototype.writeShort=function(t){return this.writeInt16(t)},t.prototype.readLongLong=function(){var t,i,n,e,r,s,o,a;return t=this.readByte(),i=this.readByte(),n=this.readByte(),e=this.readByte(),r=this.readByte(),s=this.readByte(),o=this.readByte(),a=this.readByte(),128&t?-1*(72057594037927940*(255^t)+281474976710656*(255^i)+1099511627776*(255^n)+4294967296*(255^e)+16777216*(255^r)+65536*(255^s)+256*(255^o)+(255^a)+1):72057594037927940*t+281474976710656*i+1099511627776*n+4294967296*e+16777216*r+65536*s+256*o+a},t.prototype.writeLongLong=function(t){var i,n;return i=Math.floor(t/4294967296),n=4294967295&t,this.writeByte(i>>24&255),this.writeByte(i>>16&255),this.writeByte(i>>8&255),this.writeByte(255&i),this.writeByte(n>>24&255),this.writeByte(n>>16&255),this.writeByte(n>>8&255),this.writeByte(255&n)},t.prototype.readInt=function(){return this.readInt32()},t.prototype.writeInt=function(t){return this.writeInt32(t)},t.prototype.read=function(t){var i,n;for(i=[],n=0;0<=t?n<t:n>t;n=0<=t?++n:--n)i.push(this.readByte());return i},t.prototype.write=function(t){var i,n,e;for(e=[],i=0,n=t.length;i<n;i++)e.push(this.writeByte(t[i]));return e},t}(),yn=function(){var t;function i(t){var i,n,e;for(this.scalarType=t.readInt(),this.tableCount=t.readShort(),this.searchRange=t.readShort(),this.entrySelector=t.readShort(),this.rangeShift=t.readShort(),this.tables={},n=0,e=this.tableCount;0<=e?n<e:n>e;n=0<=e?++n:--n)i={tag:t.readString(4),checksum:t.readInt(),offset:t.readInt(),length:t.readInt()},this.tables[i.tag]=i}return i.prototype.encode=function(i){var n,e,r,s,o,a,u,c,h,f,l,d;for(d in f=Object.keys(i).length,o=Math.log(2),c=16*Math.floor(Math.log(f)/o),r=Math.floor(c/o),u=16*f-c,(e=new Ln).writeInt(this.scalarType),e.writeShort(f),e.writeShort(c),e.writeShort(r),e.writeShort(u),a=e.pos+16*f,s=null,l=[],i)for(h=i[d],e.writeString(d),e.writeInt(t(h)),e.writeInt(a),e.writeInt(h.length),l=l.concat(h),"head"===d&&(s=a),a+=h.length;a%4;)l.push(0),a++;return e.write(l),n=2981146554-t(e.data),e.pos=s+8,e.writeUInt32(n),e.data},t=function(t){var i,n,e,r;for(t=Bn.call(t);t.length%4;)t.push(0);for(e=new Ln(t),n=0,i=0,r=t.length;i<r;i=i+=4)n+=e.readUInt32();return 4294967295&n},i}(),An={}.hasOwnProperty,kn=function(t,i){for(var n in i)An.call(i,n)&&(t[n]=i[n]);function e(){this.constructor=t}return e.prototype=i.prototype,t.prototype=new e,t.__super__=i.prototype,t};Nn=function(){function t(t){var i;this.file=t,this.exists=!!(i=this.file.directory.tables[this.tag]),i&&(this.offset=i.offset,this.length=i.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 Sn,xn=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return kn(t,Nn),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 i;return(i=new Ln).writeInt(this.version),i.writeInt(this.revision),i.writeInt(this.checkSumAdjustment),i.writeInt(this.magicNumber),i.writeShort(this.flags),i.writeShort(this.unitsPerEm),i.writeLongLong(this.created),i.writeLongLong(this.modified),i.writeShort(this.xMin),i.writeShort(this.yMin),i.writeShort(this.xMax),i.writeShort(this.yMax),i.writeShort(this.macStyle),i.writeShort(this.lowestRecPPEM),i.writeShort(this.fontDirectionHint),i.writeShort(t),i.writeShort(this.glyphDataFormat),i.data},t}(),qn=function(){function t(t,i){var n,e,r,s,o,a,u,c,h,f,l,d,v,m,w,p,b;switch(this.platformID=t.readUInt16(),this.encodingID=t.readShort(),this.offset=i+t.readInt(),h=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(),f=l/2,t.pos+=6,r=function(){var i,n;for(n=[],a=i=0;0<=f?i<f:i>f;a=0<=f?++i:--i)n.push(t.readUInt16());return n}(),t.pos+=2,v=function(){var i,n;for(n=[],a=i=0;0<=f?i<f:i>f;a=0<=f?++i:--i)n.push(t.readUInt16());return n}(),u=function(){var i,n;for(n=[],a=i=0;0<=f?i<f:i>f;a=0<=f?++i:--i)n.push(t.readUInt16());return n}(),c=function(){var i,n;for(n=[],a=i=0;0<=f?i<f:i>f;a=0<=f?++i:--i)n.push(t.readUInt16());return n}(),e=(this.length-t.pos+this.offset)/2,o=function(){var i,n;for(n=[],a=i=0;0<=e?i<e:i>e;a=0<=e?++i:--i)n.push(t.readUInt16());return n}(),a=w=0,b=r.length;w<b;a=++w)for(m=r[a],n=p=d=v[a];d<=m?p<=m:p>=m;n=d<=m?++p:--p)0===c[a]?s=n+u[a]:0!==(s=o[c[a]/2+(n-d)-(f-a)]||0)&&(s+=u[a]),this.codeMap[n]=65535&s}t.pos=h}return t.encode=function(t,i){var n,e,r,s,o,a,u,c,h,f,l,d,v,m,w,p,b,g,N,L,y,A,k,S,x,q,M,j,E,P,I,O,F,R,B,C,D,T,z,_,U,V,W,H,G;switch(M=new Ln,s=Object.keys(t).sort((function(t,i){return t-i})),i){case"macroman":for(v=0,m=function(){var t=[];for(d=0;d<256;++d)t.push(0);return t}(),p={0:0},r={},j=0,O=s.length;j<O;j++)null==p[V=t[e=s[j]]]&&(p[V]=++v),r[e]={old:t[e],new:p[t[e]]},m[e]=p[t[e]];return M.writeUInt16(1),M.writeUInt16(0),M.writeUInt32(12),M.writeUInt16(0),M.writeUInt16(262),M.writeUInt16(0),M.write(m),{charMap:r,subtable:M.data,maxGlyphID:v+1};case"unicode":for(x=[],h=[],b=0,p={},n={},w=u=null,E=0,F=s.length;E<F;E++)null==p[g=t[e=s[E]]]&&(p[g]=++b),n[e]={old:g,new:p[g]},o=p[g]-e,null!=w&&o===u||(w&&h.push(w),x.push(e),u=o),w=e;for(w&&h.push(w),h.push(65535),x.push(65535),k=2*(A=x.length),y=2*Math.pow(Math.log(A)/Math.LN2,2),f=Math.log(y/2)/Math.LN2,L=2*A-y,a=[],N=[],l=[],d=P=0,R=x.length;P<R;d=++P){if(c=h[d],65535===(S=x[d])){a.push(0),N.push(0);break}if(S-(q=n[S].new)>=32768)for(a.push(0),N.push(2*(l.length+A-d)),e=I=S;S<=c?I<=c:I>=c;e=S<=c?++I:--I)l.push(n[e].new);else a.push(q-S),N.push(0)}for(M.writeUInt16(3),M.writeUInt16(1),M.writeUInt32(12),M.writeUInt16(4),M.writeUInt16(16+8*A+2*l.length),M.writeUInt16(0),M.writeUInt16(k),M.writeUInt16(y),M.writeUInt16(f),M.writeUInt16(L),_=0,B=h.length;_<B;_++)M.writeUInt16(e=h[_]);for(M.writeUInt16(0),U=0,C=x.length;U<C;U++)M.writeUInt16(e=x[U]);for(W=0,D=a.length;W<D;W++)M.writeUInt16(o=a[W]);for(H=0,T=N.length;H<T;H++)M.writeUInt16(N[H]);for(G=0,z=l.length;G<z;G++)M.writeUInt16(v=l[G]);return{charMap:n,subtable:M.data,maxGlyphID:b+1}}},t}(),Mn=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return kn(t,Nn),t.prototype.tag="cmap",t.prototype.parse=function(t){var i,n,e;for(t.pos=this.offset,this.version=t.readUInt16(),e=t.readUInt16(),this.tables=[],this.unicode=null,n=0;0<=e?n<e:n>e;n=0<=e?++n:--n)i=new qn(t,this.offset),this.tables.push(i),i.isUnicode&&null==this.unicode&&(this.unicode=i);return!0},t.encode=function(t,i){var n,e;return null==i&&(i="macroman"),n=qn.encode(t,i),(e=new Ln).writeUInt16(0),e.writeUInt16(1),n.table=e.data.concat(n.subtable),n},t}(),jn=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return kn(t,Nn),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}(),En=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return kn(t,Nn),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 i,n;for(n=[],i=0;i<10;++i)n.push(t.readByte());return n}(),this.charRange=function(){var i,n;for(n=[],i=0;i<4;++i)n.push(t.readInt());return n}(),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 i,n;for(n=[],i=0;i<2;i=++i)n.push(t.readInt());return n}(),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}(),Pn=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return kn(t,Nn),t.prototype.tag="post",t.prototype.parse=function(t){var i,n,e;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 r;for(n=t.readUInt16(),this.glyphNameIndex=[],r=0;0<=n?r<n:r>n;r=0<=n?++r:--r)this.glyphNameIndex.push(t.readUInt16());for(this.names=[],e=[];t.pos<this.offset+this.length;)i=t.readByte(),e.push(this.names.push(t.readString(i)));return e;case 151552:return n=t.readUInt16(),this.offsets=t.read(n);case 262144:return this.map=function(){var i,n,e;for(e=[],r=i=0,n=this.file.maxp.numGlyphs;0<=n?i<n:i>n;r=0<=n?++i:--i)e.push(t.readUInt32());return e}.call(this)}},t}(),In=function(t,i){this.raw=t,this.length=t.length,this.platformID=i.platformID,this.encodingID=i.encodingID,this.languageID=i.languageID},On=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return kn(t,Nn),t.prototype.tag="name",t.prototype.parse=function(t){var i,n,e,r,s,o,a,u,c,h,f;for(t.pos=this.offset,t.readShort(),i=t.readShort(),o=t.readShort(),n=[],r=0;0<=i?r<i:r>i;r=0<=i?++r:--r)n.push({platformID:t.readShort(),encodingID:t.readShort(),languageID:t.readShort(),nameID:t.readShort(),length:t.readShort(),offset:this.offset+o+t.readShort()});for(a={},r=c=0,h=n.length;c<h;r=++c)t.pos=(e=n[r]).offset,u=t.readString(e.length),s=new In(u,e),null==a[f=e.nameID]&&(a[f]=[]),a[e.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}(),Fn=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return kn(t,Nn),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}(),Rn=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return kn(t,Nn),t.prototype.tag="hmtx",t.prototype.parse=function(t){var i,n,e,r,s,o;for(t.pos=this.offset,this.metrics=[],i=0,s=this.file.hhea.numberOfMetrics;0<=s?i<s:i>s;i=0<=s?++i:--i)this.metrics.push({advance:t.readUInt16(),lsb:t.readInt16()});for(e=this.file.maxp.numGlyphs-this.file.hhea.numberOfMetrics,this.leftSideBearings=function(){var n,r;for(r=[],i=n=0;0<=e?n<e:n>e;i=0<=e?++n:--n)r.push(t.readInt16());return r}(),this.widths=function(){var t,i,n,e;for(e=[],t=0,i=(n=this.metrics).length;t<i;t++)e.push(n[t].advance);return e}.call(this),n=this.widths[this.widths.length-1],o=[],i=r=0;0<=e?r<e:r>e;i=0<=e?++r:--r)o.push(this.widths.push(n));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}(),Bn=[].slice,Cn=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return kn(t,Nn),t.prototype.tag="glyf",t.prototype.parse=function(){return this.cache={}},t.prototype.glyphFor=function(t){var i,n,e,r,s,o,a,u,c,h;return t in this.cache?this.cache[t]:(i=this.file.contents,n=(r=this.file.loca).indexOf(t),0===(e=r.lengthOf(t))?this.cache[t]=null:(i.pos=this.offset+n,s=(o=new Ln(i.read(e))).readShort(),u=o.readShort(),h=o.readShort(),a=o.readShort(),c=o.readShort(),this.cache[t]=-1===s?new Tn(o,u,h,a,c):new Dn(o,s,u,h,a,c),this.cache[t]))},t.prototype.encode=function(t,i,n){var e,r,s,o,a;for(s=[],r=[],o=0,a=i.length;o<a;o++)e=t[i[o]],r.push(s.length),e&&(s=s.concat(e.encode(n)));return r.push(s.length),{table:s,offsets:r}},t}(),Dn=function(){function t(t,i,n,e,r,s){this.raw=t,this.numberOfContours=i,this.xMin=n,this.yMin=e,this.xMax=r,this.yMax=s,this.compound=!1}return t.prototype.encode=function(){return this.raw.data},t}(),Tn=function(){function t(t,i,n,e,r){var s,o;for(this.raw=t,this.xMin=i,this.yMin=n,this.xMax=e,this.yMax=r,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,i,n;for(i=new Ln(Bn.call(this.raw.data)),t=0,n=this.glyphIDs.length;t<n;++t)i.pos=this.glyphOffsets[t];return i.data},t}(),zn=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return kn(t,Nn),t.prototype.tag="loca",t.prototype.parse=function(t){var i;return t.pos=this.offset,this.offsets=0===this.file.head.indexToLocFormat?function(){var n,e;for(e=[],i=0,n=this.length;i<n;i+=2)e.push(2*t.readUInt16());return e}.call(this):function(){var n,e;for(e=[],i=0,n=this.length;i<n;i+=4)e.push(t.readUInt32());return e}.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,i){for(var n=new Uint32Array(this.offsets.length),e=0,r=0,s=0;s<n.length;++s)if(n[s]=e,r<i.length&&i[r]==s){++r,n[s]=e;var o=this.offsets[s+1]-this.offsets[s];o>0&&(e+=o)}for(var a=new Array(4*n.length),u=0;u<n.length;++u)a[4*u+3]=255&n[u],a[4*u+2]=(65280&n[u])>>8,a[4*u+1]=(16711680&n[u])>>16,a[4*u]=(4278190080&n[u])>>24;return a},t}(),_n=function(){function t(t){this.font=t,this.subset={},this.unicodes={},this.next=33}return t.prototype.generateCmap=function(){var t,i,n,e;for(i in n=this.font.cmap.tables[0].codeMap,t={},e=this.subset)t[i]=n[e[i]];return t},t.prototype.glyphsFor=function(t){var i,n,e,r,s,o,a;for(e={},s=0,o=t.length;s<o;s++)e[r=t[s]]=this.font.glyf.glyphFor(r);for(r in i=[],e)(null!=(n=e[r])?n.compound:void 0)&&i.push.apply(i,n.glyphIDs);if(i.length>0)for(r in a=this.glyphsFor(i))e[r]=n=a[r];return e},t.prototype.encode=function(t,i){var n,e,r,s,o,a,u,c,h,f,l,d,v,m;for(e in n=Mn.encode(this.generateCmap(),"unicode"),s=this.glyphsFor(t),f={0:0},m=n.charMap)f[(o=m[e]).old]=o.new;for(l in h=n.maxGlyphID,s)l in f||(f[l]=h++);return u=function(t){var i,n;for(i in n={},t)n[t[i]]=i;return n}(f),c=Object.keys(u).sort((function(t,i){return t-i})),d=function(){var t,i,n;for(n=[],t=0,i=c.length;t<i;t++)n.push(u[c[t]]);return n}(),r=this.font.glyf.encode(s,d,f),a=this.font.loca.encode(r.offsets,d),v={cmap:this.font.cmap.raw(),glyf:r.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(i)},this.font.os2.exists&&(v["OS/2"]=this.font.os2.raw()),this.font.directory.encode(v)},t}();ii.API.PDFObject=function(){var t;function i(){}return t=function(t,i){return(Array(i+1).join("0")+t).slice(-i)},i.convert=function(n){var e,r;if(Array.isArray(n))return"["+function(){var t,e,r;for(r=[],t=0,e=n.length;t<e;t++)r.push(i.convert(n[t]));return r}().join(" ")+"]";if("string"==typeof n)return"/"+n;if(null!=n?n.isString:void 0)return"("+n+")";if(n instanceof Date)return"(D:"+t(n.getUTCFullYear(),4)+t(n.getUTCMonth(),2)+t(n.getUTCDate(),2)+t(n.getUTCHours(),2)+t(n.getUTCMinutes(),2)+t(n.getUTCSeconds(),2)+"Z)";if("[object Object]"==={}.toString.call(n)){for(e in r=["<<"],n)r.push("/"+e+" "+i.convert(n[e]));return r.push(">>"),r.join("\n")}return""+n},i}(),function(t){t.A4="A4",t.ANSI_A="ANSI A"}(Sn||(Sn={}));class Un{constructor(){this.dataPath="",this.lang="en",this.title="",this.fontProps={fontResolutionInchesPerPoint:1/72,fontFullHeightRatio:1.28},this.lineOptions={x1:0,y1:0,x2:0,y2:0,lineProperties:{thickness:.1,color:"000000",opacity:1}},this.pageOptions={pageType:Sn.ANSI_A,width:8.5,height:11,leftMargin:.25,rightMargin:.25,topMargin:.25,bottomMargin:.25,drawNeatline:!1},this.rectangleOptions={left:0,top:0,width:8.5,height:11,lineProperties:{thickness:.1,color:"000000",opacity:1},fillColor:"",fillOpacity:1},this.tableOptions={lineProperties:{thickness:.1,color:"",opacity:1},textProperties:{left:0,top:0,fontPoints:1,fontColor:"000000"}},this.textOptions={left:0,top:0,fontPoints:1,fontColor:"000000"}}static getPageSize(t){switch("string"==typeof t&&(t=t===Sn.A4?Sn.A4:Sn.ANSI_A),t){case Sn.A4:return{width:8.25,height:11.708333};case Sn.ANSI_A:return{width:8.5,height:11}}}addPage(){}applyOpacity(t,i){return t*i+1*(1-i)}drawLine(t){const i={...this.lineOptions,...t};i.lineProperties={...this.lineOptions.lineProperties,...t.lineProperties},this.updateLineProperties(i.lineProperties),this.lineOptions=i}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 i={...this.rectangleOptions,...t};i.lineProperties={...this.lineOptions.lineProperties,...t.lineProperties},this.updateLineProperties(i.lineProperties),this.rectangleOptions.fillColor===i.fillColor&&this.rectangleOptions.fillOpacity===i.fillOpacity||this.setFillColor(i.fillColor,i.fillOpacity),this.rectangleOptions=i}drawTable(t,i){const n={};n.lineProperties={...this.tableOptions.lineProperties,...i.lineProperties},n.textProperties={...this.tableOptions.textProperties,...i.textProperties},this.tableOptions.textProperties.fontPoints!==n.textProperties.fontPoints&&this.setFontSize(n.textProperties.fontPoints),this.tableOptions.textProperties.fontColor!==n.textProperties.fontColor&&this.setFontColor(n.textProperties.fontColor),this.updateLineProperties(n.lineProperties),this.tableOptions=n}drawText(t,i){const n={...this.textOptions,...i};this.textOptions.fontPoints!==n.fontPoints&&this.setFontSize(n.fontPoints),this.textOptions.fontColor!==n.fontColor&&this.setFontColor(n.fontColor),this.textOptions=n}fontAscenderBaselineHeight(t){return t*this.fontProps.fontResolutionInchesPerPoint}fontAscenderDescenderHeight(t){return this.fontProps.fontFullHeightRatio*this.fontAscenderBaselineHeight(t)}getFontFileName(t){let i="0b7681dc140844ee9f409bdac249fbf0-general";return"ja"===t?i="0b7681dc140844ee9f409bdac249fbf0-japanese":"ko"===t?i="0b7681dc140844ee9f409bdac249fbf0-korean":"zh-cn"===t?i="0b7681dc140844ee9f409bdac249fbf0-simplified-chinese":"zh-hk"!==t&&"zh-tw"!==t||(i="0b7681dc140844ee9f409bdac249fbf0-traditional-chinese"),i}getTextWidth(t,i){return t.length*i}hexToRGB(t,i=1){const n=/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return n?{r:this.applyOpacity(parseInt(n[1],16)/255,i),g:this.applyOpacity(parseInt(n[2],16)/255,i),b:this.applyOpacity(parseInt(n[3],16)/255,i)}:{r:0,g:0,b:0}}async initialize(t={},i="",n="en",e="",r=!1){if("{}"!==JSON.stringify(t)){this.pageOptions.pageType=t.pageType===Sn.A4?Sn.A4:Sn.ANSI_A;const i=Un.getPageSize(this.pageOptions.pageType);this.pageOptions.width=i.width,this.pageOptions.height=i.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=i,this.lang=n,this.title=e||"PDF Document",this.pageOptions.drawNeatline=r,Promise.resolve()}save(){}setDrawColor(t,i=1){}setFillColor(t,i=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}}
344
344
  /* @preserve
345
345
  * arcgis-pdf-creator v0.0.1
346
346
  * Fri Feb 03 2023 09:47:02 GMT-0800 (Pacific Standard Time)
@@ -413,4 +413,4 @@ class Wn{addLabelsToDoc(t,i,n,e){return new Promise((r=>{const s=i.numLabelsAcro
413
413
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
414
414
  * See the License for the specific language governing permissions and
415
415
  * limitations under the License.
416
- */const Hn=class{constructor(i){t(this,i),this.disabled=!1,this.enabledSizeValues=[],this.layerView=void 0,this._translations=void 0}async downloadCSV(t,i,n=!0){const e=await this._prepareLabels(t,i,n);return k(e)}async downloadPDF(t,i){!function(t,i,n){const e=new Vn;e.initialize({pageType:"ANSI_A"},s("../assets/arcgis-pdf-creator/"),"en",n,!1).then((()=>{const n=new Wn;n.initialize(e).then((async()=>{await n.addLabelsToDoc(t,i.labelSpec,1),e.save()}))}))}(await this._prepareLabels(t,i),this._labelInfoElement.selectedOption.value,`notify-${Date.now().toString()}`)}async componentWillLoad(){await this._getTranslations(),await this._initModules()}render(){return i(n,null,i("calcite-select",{disabled:this.disabled,label:"",ref:t=>{this._labelInfoElement=t}},this._renderItems()))}async _initModules(){const[t]=await l(["esri/intl"]);this._intl=t}_convertPopupToLabelSpec(t){let i=(t=t.replace(/<br\s*\/?>/gi,"|")).replace(/<[\s.]*[^<>]*\/?>/gi,"").replace(/\xA0/gi," ").split("|");return i=i.map((t=>t.trim())).filter((t=>t.length>0)),i}_getLabelSizeText(t){const i=`${t.descriptionPDF.labelWidthDisplay} x ${t.descriptionPDF.labelHeightDisplay}`;return this._translations.pdfLabel.replace("{{n}}",t.descriptionPDF.labelsPerPageDisplay).replace("{{labelSize}}",i)}async _getTranslations(){const t=await A(this.el);this._translations=t[0]}async _prepareLabels(t,i,n=!1){const e=(await p(t,this.layerView.layer)).features.map((t=>t.attributes)),r=this._convertPopupToLabelSpec(this.layerView.layer.popupTemplate.content[0].text);let s=e.map((t=>{const i=[];return r.forEach((n=>{const e=this._intl.substitute(n,t).trim();e.length>0&&i.push(e)})),i})).filter((t=>t.length>0));if(i){const t=s.map((t=>JSON.stringify(t))),i=new Set(t);s=Array.from(i,(t=>JSON.parse(t)))}if(n){const t=r.map((t=>t.replace(/\{/g,"").replace(/\}/g,"")));s.unshift(t)}return Promise.resolve(s)}_renderItems(){const t=(R.default||R).sort(((t,i)=>{const n=parseInt(t.descriptionPDF.labelsPerPageDisplay,10),e=parseInt(i.descriptionPDF.labelsPerPageDisplay,10);return n<e?-1:n>e?1:0}));return t.map((t=>i("calcite-option",{value:t},this._getLabelSizeText(t))))}get el(){return e(this)}};Hn.style=":host{display:block}";const Gn=class{constructor(i){t(this,i),this.selectionSetsChanged=r(this,"selectionSetsChanged",7),this._addEnabled=!0,this.addresseeLayer=void 0,this.enabledLayerIds=[],this.mapView=void 0,this.selectionSets=[],this.GraphicsLayer=void 0,this.SketchViewModel=void 0,this._translations=void 0}refineSelectionIdsChange(t){var i,n;const e=(null===(i=t.detail)||void 0===i?void 0:i.addIds)||[],r=(null===(n=t.detail)||void 0===n?void 0:n.removeIds)||[];this._updateSelectionSets(r),this._updateRefineSelectionSet(e,r)}async componentWillLoad(){await this._getTranslations()}render(){return i(n,null,i("div",{class:"padding-1"},i("div",null,i("calcite-radio-group",{class:"w-100",onCalciteRadioGroupChange:t=>this._modeChanged(t)},i("calcite-radio-group-item",{checked:this._addEnabled,class:"w-50",onClick:()=>this._setSelectionMode(g.ADD),value:g.ADD},this._translations.add),i("calcite-radio-group-item",{checked:!this._addEnabled,class:"w-50",onClick:()=>this._setSelectionMode(g.REMOVE),value:g.REMOVE},this._translations.remove)),i("refine-selection-tools",{border:!0,enabledLayerIds:this.enabledLayerIds,ids:q(this.selectionSets),layerViews:[this.addresseeLayer],mapView:this.mapView,mode:this._addEnabled?g.ADD:g.REMOVE,ref:t=>{this._refineTools=t},refineMode:N.ALL,useLayerPicker:!1})),i("br",null),i("calcite-list",{class:"list-border"},this._getRefineSelectionSetList())))}_modeChanged(t){this._addEnabled=t.detail===g.ADD}_setSelectionMode(t){this._refineTools.mode=t}_getRefineSelectionSetList(){const t=M(this.selectionSets),n=this._getRefineSelectionSet(this.selectionSets),e=(null==n?void 0:n.refineIds.removeIds.length)||0;return[i("calcite-list-item",{label:this._translations.featuresAdded.replace("{{n}}",((null==n?void 0:n.refineIds.addIds.length)||0).toString())}),i("calcite-list-item",{label:this._translations.featuresRemoved.replace("{{n}}",e.toString())}),i("calcite-list-item",{label:this._translations.totalSelected.replace("{{n}}",t.toString())})]}_getRefineSelectionSet(t){let i;return t.some((t=>{if(t.workflowType===b.REFINE)return i=t,!0})),i}_updateSelectionSets(t){t.length>0&&(this.selectionSets=this.selectionSets.reduce(((i,n)=>(n.selectedIds=n.selectedIds.filter((i=>t.indexOf(i)<0)),n.selectedIds.length>0&&i.push(n),i)),[]),this.selectionSetsChanged.emit(this.selectionSets))}_updateRefineSelectionSet(t,i){const n=this._getRefineSelectionSet(this.selectionSets);this.selectionSets=n?this._updateRefineIds(n,t,i):this._addRefineSelectionSet(t,i),this.selectionSetsChanged.emit(this.selectionSets)}_updateRefineIds(t,i,n){t.refineIds.addIds=t.refineIds.addIds.filter((t=>n.indexOf(t)<0)),t.refineIds.removeIds=t.refineIds.removeIds.filter((t=>i.indexOf(t)<0));const e=[...new Set(t.refineIds.addIds.concat(i))],r=[...new Set(t.refineIds.removeIds.concat(n))];return t.refineIds={addIds:e.filter((t=>r.indexOf(t)<0)),removeIds:r.filter((t=>e.indexOf(t)<0))},t.selectedIds=t.refineIds.addIds.length>0?[...new Set(t.selectedIds.concat(t.refineIds.addIds))]:t.selectedIds.filter((i=>t.refineIds.removeIds.indexOf(i)<0)),this.selectionSets.map((i=>i.workflowType===b.REFINE?t:i))}_addRefineSelectionSet(t,i){return[...this.selectionSets,{buffer:void 0,distance:0,download:!0,geometries:[],id:Date.now(),label:"Refine",layerView:this.addresseeLayer,refineSelectLayers:[],searchResult:void 0,selectedIds:t,unit:"feet",workflowType:b.REFINE,refineIds:{addIds:t,removeIds:i}}]}async _getTranslations(){const t=await A(this.el);this._translations=t[0]}_testAccess(t,i){switch(t){case"_modeChanged":return this._modeChanged(i);case"_setSelectionMode":return this._setSelectionMode(i)}return null}get el(){return e(this)}};Gn.style=":host{display:block}";export{E as I,F as M,I as N,Hn as P,Gn as R,O as _}
416
+ */const Hn=class{constructor(i){t(this,i),this.disabled=!1,this.layerView=void 0,this._translations=void 0}async downloadCSV(t,i,n=!0){const e=await this._prepareLabels(t,i,n);return k(e)}async downloadPDF(t,i){!function(t,i,n){const e=new Vn;e.initialize({pageType:"ANSI_A"},s("../assets/arcgis-pdf-creator/"),"en",n,!1).then((()=>{const n=new Wn;n.initialize(e).then((async()=>{await n.addLabelsToDoc(t,i.labelSpec,1),e.save()}))}))}(await this._prepareLabels(t,i),this._labelInfoElement.selectedOption.value,`notify-${Date.now().toString()}`)}async componentWillLoad(){await this._getTranslations(),await this._initModules()}render(){return i(n,null,i("calcite-select",{disabled:this.disabled,label:"",ref:t=>{this._labelInfoElement=t}},this._renderItems()))}async _initModules(){const[t]=await l(["esri/intl"]);this._intl=t}_convertPopupToLabelSpec(t){let i=(t=t.replace(/<br\s*\/?>/gi,"|")).replace(/<[\s.]*[^<>]*\/?>/gi,"").replace(/\xA0/gi," ").replace(/&lt;/gi,"<").replace(/&gt;/gi,">").replace(/&nbsp;/gi," ").split("|");return i=i.map((t=>t.trim())).filter((t=>t.length>0)),i}_getLabelSizeText(t){const i=`${t.descriptionPDF.labelWidthDisplay} x ${t.descriptionPDF.labelHeightDisplay}`;return this._translations.pdfLabel.replace("{{n}}",t.descriptionPDF.labelsPerPageDisplay).replace("{{labelSize}}",i)}async _getTranslations(){const t=await A(this.el);this._translations=t[0]}async _prepareLabels(t,i,n=!1){const e=(await p(t,this.layerView.layer)).features.map((t=>t.attributes)),r=this._convertPopupToLabelSpec(this.layerView.layer.popupTemplate.content[0].text);let s=e.map((t=>{const i=[];return r.forEach((n=>{const e=this._intl.substitute(n,t).trim();e.length>0&&i.push(e)})),i})).filter((t=>t.length>0));if(i){const t=s.map((t=>JSON.stringify(t))),i=new Set(t);s=Array.from(i,(t=>JSON.parse(t)))}if(n){const t=r.map((t=>t.replace(/\{/g,"").replace(/\}/g,"")));s.unshift(t)}return Promise.resolve(s)}_renderItems(){const t=(F.default||F).sort(((t,i)=>{const n=parseInt(t.descriptionPDF.labelsPerPageDisplay,10),e=parseInt(i.descriptionPDF.labelsPerPageDisplay,10);return n<e?-1:n>e?1:0}));return t.map((t=>i("calcite-option",{value:t},this._getLabelSizeText(t))))}get el(){return e(this)}};Hn.style=":host{display:block}";const Gn=class{constructor(i){t(this,i),this.selectionSetsChanged=r(this,"selectionSetsChanged",7),this._addEnabled=!0,this.addresseeLayer=void 0,this.enabledLayerIds=[],this.mapView=void 0,this.selectionSets=[],this.GraphicsLayer=void 0,this.SketchViewModel=void 0,this._translations=void 0}addresseeLayerWatchHandler(){const t=this.selectionSets.filter((t=>t.workflowType!==b.REFINE));this.selectionSets=this._initRefineSelectionSet(t)}refineSelectionIdsChange(t){var i,n;const e=(null===(i=t.detail)||void 0===i?void 0:i.addIds)||[],r=(null===(n=t.detail)||void 0===n?void 0:n.removeIds)||[];this._updateSelectionSets(r),this._updateRefineSelectionSet(e,r)}async componentWillLoad(){await this._getTranslations(),this._getRefineSelectionSet(this.selectionSets)||(this.selectionSets=this._initRefineSelectionSet(this.selectionSets))}render(){return i(n,null,i("div",{class:"padding-1"},i("div",null,i("calcite-radio-group",{class:"w-100",onCalciteRadioGroupChange:t=>this._modeChanged(t)},i("calcite-radio-group-item",{checked:this._addEnabled,class:"w-50",onClick:()=>this._setSelectionMode(g.ADD),value:g.ADD},this._translations.add),i("calcite-radio-group-item",{checked:!this._addEnabled,class:"w-50",onClick:()=>this._setSelectionMode(g.REMOVE),value:g.REMOVE},this._translations.remove)),i("refine-selection-tools",{border:!0,enabledLayerIds:this.enabledLayerIds,ids:q(this.selectionSets),layerViews:[this.addresseeLayer],mapView:this.mapView,mode:this._addEnabled?g.ADD:g.REMOVE,ref:t=>{this._refineTools=t},refineMode:N.ALL,refineSelectionSet:this._getRefineSelectionSet(this.selectionSets),useLayerPicker:!1})),i("br",null),i("calcite-list",{class:"list-border"},this._getRefineSelectionSetList())))}_modeChanged(t){this._addEnabled=t.detail===g.ADD}_setSelectionMode(t){this._refineTools.mode=t}_getRefineSelectionSetList(){const t=M(this.selectionSets),n=this._getRefineSelectionSet(this.selectionSets),e=(null==n?void 0:n.refineIds.removeIds.length)||0;return[i("calcite-list-item",{label:this._translations.featuresAdded.replace("{{n}}",((null==n?void 0:n.refineIds.addIds.length)||0).toString())}),i("calcite-list-item",{label:this._translations.featuresRemoved.replace("{{n}}",e.toString())}),i("calcite-list-item",{label:this._translations.totalSelected.replace("{{n}}",t.toString())})]}_getRefineSelectionSet(t){let i;return t.some((t=>{if(t.workflowType===b.REFINE)return i=t,!0})),i}_updateSelectionSets(t){t.length>0&&(this.selectionSets=this.selectionSets.reduce(((i,n)=>(n.selectedIds=n.selectedIds.filter((i=>t.indexOf(i)<0)),(n.selectedIds.length>0||n.workflowType===b.REFINE)&&i.push(n),i)),[]),this.selectionSetsChanged.emit(this.selectionSets))}_updateRefineSelectionSet(t,i){const n=this._getRefineSelectionSet(this.selectionSets);this._updateRefineIds(n,t,i),this.selectionSetsChanged.emit(this.selectionSets)}_updateRefineIds(t,i,n){t.refineIds.addIds=t.refineIds.addIds.filter((t=>n.indexOf(t)<0)),t.refineIds.removeIds=t.refineIds.removeIds.filter((t=>i.indexOf(t)<0));const e=[...new Set(t.refineIds.addIds.concat(i))],r=[...new Set(t.refineIds.removeIds.concat(n))];return t.refineIds={addIds:e.filter((t=>r.indexOf(t)<0)),removeIds:r.filter((t=>e.indexOf(t)<0))},t.selectedIds=t.refineIds.addIds.length>0?[...new Set(t.selectedIds.concat(t.refineIds.addIds))]:t.selectedIds.filter((i=>t.refineIds.removeIds.indexOf(i)<0)),this.selectionSets.map((i=>i.workflowType===b.REFINE?t:i))}_initRefineSelectionSet(t){return[...t,{buffer:void 0,distance:0,download:!0,geometries:[],id:Date.now(),label:"Refine",layerView:this.addresseeLayer,refineSelectLayers:[],searchResult:void 0,selectedIds:[],unit:"feet",workflowType:b.REFINE,refineIds:{addIds:[],removeIds:[]},redoStack:[],undoStack:[]}]}async _getTranslations(){const t=await A(this.el);this._translations=t[0]}_testAccess(t,i){switch(t){case"_modeChanged":return this._modeChanged(i);case"_setSelectionMode":return this._setSelectionMode(i)}return null}get el(){return e(this)}static get watchers(){return{addresseeLayer:["addresseeLayerWatchHandler"]}}};Gn.style=":host{display:block}";export{E as I,O as M,I as N,Hn as P,Gn as R,R as _}