@syncfusion/ej2-pdf-export 25.2.3 → 26.1.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +3 -2
- package/dist/ej2-pdf-export.umd.min.js +2 -2
- package/dist/ej2-pdf-export.umd.min.js.map +1 -1
- package/dist/es6/ej2-pdf-export.es2015.js +79 -72
- package/dist/es6/ej2-pdf-export.es2015.js.map +1 -1
- package/dist/es6/ej2-pdf-export.es5.js +169 -232
- package/dist/es6/ej2-pdf-export.es5.js.map +1 -1
- package/dist/global/ej2-pdf-export.min.js +2 -2
- package/dist/global/ej2-pdf-export.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/dist/ts/implementation/actions/action.d.ts +50 -0
- package/dist/ts/implementation/actions/action.ts +76 -0
- package/dist/ts/implementation/actions/index.d.ts +6 -0
- package/dist/ts/implementation/actions/index.ts +6 -0
- package/dist/ts/implementation/actions/uri-action.d.ts +33 -0
- package/dist/ts/implementation/actions/uri-action.ts +52 -0
- package/dist/ts/implementation/annotations/action-link-annotation.d.ts +30 -0
- package/dist/ts/implementation/annotations/action-link-annotation.ts +43 -0
- package/dist/ts/implementation/annotations/annotation-collection.d.ts +77 -0
- package/dist/ts/implementation/annotations/annotation-collection.ts +159 -0
- package/dist/ts/implementation/annotations/annotation.d.ts +152 -0
- package/dist/ts/implementation/annotations/annotation.ts +241 -0
- package/dist/ts/implementation/annotations/document-link-annotation.d.ts +89 -0
- package/dist/ts/implementation/annotations/document-link-annotation.ts +118 -0
- package/dist/ts/implementation/annotations/index.d.ts +11 -0
- package/dist/ts/implementation/annotations/index.ts +11 -0
- package/dist/ts/implementation/annotations/link-annotation.d.ts +23 -0
- package/dist/ts/implementation/annotations/link-annotation.ts +32 -0
- package/dist/ts/implementation/annotations/pdf-text-web-link.d.ts +118 -0
- package/dist/ts/implementation/annotations/pdf-text-web-link.ts +265 -0
- package/dist/ts/implementation/annotations/uri-annotation.d.ts +48 -0
- package/dist/ts/implementation/annotations/uri-annotation.ts +86 -0
- package/dist/ts/implementation/collections/dictionary.d.ts +76 -0
- package/dist/ts/implementation/collections/dictionary.ts +150 -0
- package/dist/ts/implementation/collections/index.d.ts +7 -0
- package/dist/ts/implementation/collections/index.ts +7 -0
- package/dist/ts/implementation/collections/object-object-pair/dictionary.d.ts +62 -0
- package/dist/ts/implementation/collections/object-object-pair/dictionary.ts +125 -0
- package/dist/ts/implementation/collections/object-object-pair/index.d.ts +5 -0
- package/dist/ts/implementation/collections/object-object-pair/index.ts +5 -0
- package/dist/ts/implementation/collections/utils.d.ts +27 -0
- package/dist/ts/implementation/collections/utils.ts +38 -0
- package/dist/ts/implementation/document/automatic-fields/automatic-field-info-collection.d.ts +31 -0
- package/dist/ts/implementation/document/automatic-fields/automatic-field-info-collection.ts +39 -0
- package/dist/ts/implementation/document/automatic-fields/automatic-field-info.d.ts +67 -0
- package/dist/ts/implementation/document/automatic-fields/automatic-field-info.ts +108 -0
- package/dist/ts/implementation/document/automatic-fields/automatic-field.d.ts +41 -0
- package/dist/ts/implementation/document/automatic-fields/automatic-field.ts +127 -0
- package/dist/ts/implementation/document/automatic-fields/composite-field.d.ts +46 -0
- package/dist/ts/implementation/document/automatic-fields/composite-field.ts +76 -0
- package/dist/ts/implementation/document/automatic-fields/index.d.ts +11 -0
- package/dist/ts/implementation/document/automatic-fields/index.ts +11 -0
- package/dist/ts/implementation/document/automatic-fields/multiple-value-field.d.ts +18 -0
- package/dist/ts/implementation/document/automatic-fields/multiple-value-field.ts +37 -0
- package/dist/ts/implementation/document/automatic-fields/page-count-field.d.ts +44 -0
- package/dist/ts/implementation/document/automatic-fields/page-count-field.ts +75 -0
- package/dist/ts/implementation/document/automatic-fields/pdf-numbers-convertor.d.ts +53 -0
- package/dist/ts/implementation/document/automatic-fields/pdf-numbers-convertor.ts +157 -0
- package/dist/ts/implementation/document/automatic-fields/pdf-page-number-field.d.ts +51 -0
- package/dist/ts/implementation/document/automatic-fields/pdf-page-number-field.ts +82 -0
- package/dist/ts/implementation/document/automatic-fields/pdf-template-value-pair.d.ts +38 -0
- package/dist/ts/implementation/document/automatic-fields/pdf-template-value-pair.ts +60 -0
- package/dist/ts/implementation/document/automatic-fields/single-value-field.d.ts +15 -0
- package/dist/ts/implementation/document/automatic-fields/single-value-field.ts +48 -0
- package/dist/ts/implementation/document/index.d.ts +16 -0
- package/dist/ts/implementation/document/index.ts +16 -0
- package/dist/ts/implementation/document/pdf-catalog.d.ts +39 -0
- package/dist/ts/implementation/document/pdf-catalog.ts +65 -0
- package/dist/ts/implementation/document/pdf-document-base.d.ts +132 -0
- package/dist/ts/implementation/document/pdf-document-base.ts +180 -0
- package/dist/ts/implementation/document/pdf-document-template.d.ts +166 -0
- package/dist/ts/implementation/document/pdf-document-template.ts +310 -0
- package/dist/ts/implementation/document/pdf-document.d.ts +221 -0
- package/dist/ts/implementation/document/pdf-document.ts +342 -0
- package/dist/ts/implementation/document/pdf-viewer-preferences.d.ts +467 -0
- package/dist/ts/implementation/document/pdf-viewer-preferences.ts +578 -0
- package/dist/ts/implementation/drawing/index.d.ts +5 -0
- package/dist/ts/implementation/drawing/index.ts +5 -0
- package/dist/ts/implementation/drawing/pdf-drawing.d.ts +141 -0
- package/dist/ts/implementation/drawing/pdf-drawing.ts +218 -0
- package/dist/ts/implementation/general/enum.d.ts +21 -0
- package/dist/ts/implementation/general/enum.ts +21 -0
- package/dist/ts/implementation/general/functions/index.d.ts +6 -0
- package/dist/ts/implementation/general/functions/index.ts +6 -0
- package/dist/ts/implementation/general/functions/pdf-function.d.ts +44 -0
- package/dist/ts/implementation/general/functions/pdf-function.ts +66 -0
- package/dist/ts/implementation/general/functions/pdf-sampled-function.d.ts +25 -0
- package/dist/ts/implementation/general/functions/pdf-sampled-function.ts +63 -0
- package/dist/ts/implementation/general/index.d.ts +9 -0
- package/dist/ts/implementation/general/index.ts +9 -0
- package/dist/ts/implementation/general/pdf-cache-collection.d.ts +42 -0
- package/dist/ts/implementation/general/pdf-cache-collection.ts +97 -0
- package/dist/ts/implementation/general/pdf-collection.d.ts +26 -0
- package/dist/ts/implementation/general/pdf-collection.ts +41 -0
- package/dist/ts/implementation/general/pdf-destination.d.ts +103 -0
- package/dist/ts/implementation/general/pdf-destination.ts +170 -0
- package/dist/ts/implementation/graphics/brushes/enum.d.ts +236 -0
- package/dist/ts/implementation/graphics/brushes/enum.ts +237 -0
- package/dist/ts/implementation/graphics/brushes/index.d.ts +13 -0
- package/dist/ts/implementation/graphics/brushes/index.ts +13 -0
- package/dist/ts/implementation/graphics/brushes/pdf-blend.d.ts +105 -0
- package/dist/ts/implementation/graphics/brushes/pdf-blend.ts +294 -0
- package/dist/ts/implementation/graphics/brushes/pdf-brush.d.ts +57 -0
- package/dist/ts/implementation/graphics/brushes/pdf-brush.ts +68 -0
- package/dist/ts/implementation/graphics/brushes/pdf-brushes.d.ts +726 -0
- package/dist/ts/implementation/graphics/brushes/pdf-brushes.ts +2438 -0
- package/dist/ts/implementation/graphics/brushes/pdf-color-blend.d.ts +113 -0
- package/dist/ts/implementation/graphics/brushes/pdf-color-blend.ts +295 -0
- package/dist/ts/implementation/graphics/brushes/pdf-gradient-brush.d.ts +155 -0
- package/dist/ts/implementation/graphics/brushes/pdf-gradient-brush.ts +311 -0
- package/dist/ts/implementation/graphics/brushes/pdf-linear-gradient-brush.d.ts +147 -0
- package/dist/ts/implementation/graphics/brushes/pdf-linear-gradient-brush.ts +406 -0
- package/dist/ts/implementation/graphics/brushes/pdf-radial-gradient-brush.d.ts +122 -0
- package/dist/ts/implementation/graphics/brushes/pdf-radial-gradient-brush.ts +290 -0
- package/dist/ts/implementation/graphics/brushes/pdf-solid-brush.d.ts +77 -0
- package/dist/ts/implementation/graphics/brushes/pdf-solid-brush.ts +107 -0
- package/dist/ts/implementation/graphics/brushes/pdf-tiling-brush.d.ts +161 -0
- package/dist/ts/implementation/graphics/brushes/pdf-tiling-brush.ts +304 -0
- package/dist/ts/implementation/graphics/constants.d.ts +31 -0
- package/dist/ts/implementation/graphics/constants.ts +31 -0
- package/dist/ts/implementation/graphics/enum.d.ts +413 -0
- package/dist/ts/implementation/graphics/enum.ts +413 -0
- package/dist/ts/implementation/graphics/figures/arc.d.ts +87 -0
- package/dist/ts/implementation/graphics/figures/arc.ts +133 -0
- package/dist/ts/implementation/graphics/figures/base/draw-element.d.ts +30 -0
- package/dist/ts/implementation/graphics/figures/base/draw-element.ts +59 -0
- package/dist/ts/implementation/graphics/figures/base/element-layouter.d.ts +161 -0
- package/dist/ts/implementation/graphics/figures/base/element-layouter.ts +260 -0
- package/dist/ts/implementation/graphics/figures/base/fill-element.d.ts +46 -0
- package/dist/ts/implementation/graphics/figures/base/fill-element.ts +72 -0
- package/dist/ts/implementation/graphics/figures/base/graphics-element.d.ts +16 -0
- package/dist/ts/implementation/graphics/figures/base/graphics-element.ts +34 -0
- package/dist/ts/implementation/graphics/figures/base/index.d.ts +9 -0
- package/dist/ts/implementation/graphics/figures/base/index.ts +9 -0
- package/dist/ts/implementation/graphics/figures/base/pdf-shape-element.d.ts +40 -0
- package/dist/ts/implementation/graphics/figures/base/pdf-shape-element.ts +69 -0
- package/dist/ts/implementation/graphics/figures/base/shape-layouter.d.ts +131 -0
- package/dist/ts/implementation/graphics/figures/base/shape-layouter.ts +276 -0
- package/dist/ts/implementation/graphics/figures/base/text-layouter.d.ts +107 -0
- package/dist/ts/implementation/graphics/figures/base/text-layouter.ts +205 -0
- package/dist/ts/implementation/graphics/figures/ellipse-part.d.ts +48 -0
- package/dist/ts/implementation/graphics/figures/ellipse-part.ts +76 -0
- package/dist/ts/implementation/graphics/figures/enum.d.ts +79 -0
- package/dist/ts/implementation/graphics/figures/enum.ts +80 -0
- package/dist/ts/implementation/graphics/figures/index.d.ts +13 -0
- package/dist/ts/implementation/graphics/figures/index.ts +13 -0
- package/dist/ts/implementation/graphics/figures/layout-element.d.ts +73 -0
- package/dist/ts/implementation/graphics/figures/layout-element.ts +132 -0
- package/dist/ts/implementation/graphics/figures/path.d.ts +319 -0
- package/dist/ts/implementation/graphics/figures/path.ts +646 -0
- package/dist/ts/implementation/graphics/figures/pdf-template.d.ts +113 -0
- package/dist/ts/implementation/graphics/figures/pdf-template.ts +205 -0
- package/dist/ts/implementation/graphics/figures/rectangle-area.d.ts +64 -0
- package/dist/ts/implementation/graphics/figures/rectangle-area.ts +108 -0
- package/dist/ts/implementation/graphics/figures/text-element.d.ts +213 -0
- package/dist/ts/implementation/graphics/figures/text-element.ts +445 -0
- package/dist/ts/implementation/graphics/fonts/enum.d.ts +385 -0
- package/dist/ts/implementation/graphics/fonts/enum.ts +385 -0
- package/dist/ts/implementation/graphics/fonts/index.d.ts +16 -0
- package/dist/ts/implementation/graphics/fonts/index.ts +16 -0
- package/dist/ts/implementation/graphics/fonts/pdf-font-metrics.d.ts +164 -0
- package/dist/ts/implementation/graphics/fonts/pdf-font-metrics.ts +248 -0
- package/dist/ts/implementation/graphics/fonts/pdf-font.d.ts +187 -0
- package/dist/ts/implementation/graphics/fonts/pdf-font.ts +316 -0
- package/dist/ts/implementation/graphics/fonts/pdf-standard-font-metrics-factory.d.ts +301 -0
- package/dist/ts/implementation/graphics/fonts/pdf-standard-font-metrics-factory.ts +606 -0
- package/dist/ts/implementation/graphics/fonts/pdf-standard-font.d.ts +143 -0
- package/dist/ts/implementation/graphics/fonts/pdf-standard-font.ts +243 -0
- package/dist/ts/implementation/graphics/fonts/pdf-string-format.d.ts +321 -0
- package/dist/ts/implementation/graphics/fonts/pdf-string-format.ts +474 -0
- package/dist/ts/implementation/graphics/fonts/pdf-true-type-font.d.ts +49 -0
- package/dist/ts/implementation/graphics/fonts/pdf-true-type-font.ts +165 -0
- package/dist/ts/implementation/graphics/fonts/rtl/index.d.ts +6 -0
- package/dist/ts/implementation/graphics/fonts/rtl/index.ts +6 -0
- package/dist/ts/implementation/graphics/fonts/rtl/rtl-bidirectional.d.ts +62 -0
- package/dist/ts/implementation/graphics/fonts/rtl/rtl-bidirectional.ts +958 -0
- package/dist/ts/implementation/graphics/fonts/rtl/rtl-text-shape.d.ts +68 -0
- package/dist/ts/implementation/graphics/fonts/rtl/rtl-text-shape.ts +374 -0
- package/dist/ts/implementation/graphics/fonts/rtl-renderer.d.ts +23 -0
- package/dist/ts/implementation/graphics/fonts/rtl-renderer.ts +255 -0
- package/dist/ts/implementation/graphics/fonts/string-layouter.d.ts +254 -0
- package/dist/ts/implementation/graphics/fonts/string-layouter.ts +617 -0
- package/dist/ts/implementation/graphics/fonts/string-tokenizer.d.ts +109 -0
- package/dist/ts/implementation/graphics/fonts/string-tokenizer.ts +275 -0
- package/dist/ts/implementation/graphics/fonts/ttf-OS2-Table.d.ts +204 -0
- package/dist/ts/implementation/graphics/fonts/ttf-OS2-Table.ts +206 -0
- package/dist/ts/implementation/graphics/fonts/ttf-apple-cmap-sub-table.d.ts +17 -0
- package/dist/ts/implementation/graphics/fonts/ttf-apple-cmap-sub-table.ts +18 -0
- package/dist/ts/implementation/graphics/fonts/ttf-cmap-sub-table.d.ts +17 -0
- package/dist/ts/implementation/graphics/fonts/ttf-cmap-sub-table.ts +18 -0
- package/dist/ts/implementation/graphics/fonts/ttf-cmap-table.d.ts +13 -0
- package/dist/ts/implementation/graphics/fonts/ttf-cmap-table.ts +14 -0
- package/dist/ts/implementation/graphics/fonts/ttf-glyph-header.d.ts +25 -0
- package/dist/ts/implementation/graphics/fonts/ttf-glyph-header.ts +26 -0
- package/dist/ts/implementation/graphics/fonts/ttf-glyph-info.d.ts +25 -0
- package/dist/ts/implementation/graphics/fonts/ttf-glyph-info.ts +35 -0
- package/dist/ts/implementation/graphics/fonts/ttf-head-table.d.ts +94 -0
- package/dist/ts/implementation/graphics/fonts/ttf-head-table.ts +94 -0
- package/dist/ts/implementation/graphics/fonts/ttf-horizontal-header-table.d.ts +55 -0
- package/dist/ts/implementation/graphics/fonts/ttf-horizontal-header-table.ts +56 -0
- package/dist/ts/implementation/graphics/fonts/ttf-loca-table.d.ts +9 -0
- package/dist/ts/implementation/graphics/fonts/ttf-loca-table.ts +10 -0
- package/dist/ts/implementation/graphics/fonts/ttf-long-hor-metric.d.ts +13 -0
- package/dist/ts/implementation/graphics/fonts/ttf-long-hor-metric.ts +14 -0
- package/dist/ts/implementation/graphics/fonts/ttf-metrics.d.ts +101 -0
- package/dist/ts/implementation/graphics/fonts/ttf-metrics.ts +106 -0
- package/dist/ts/implementation/graphics/fonts/ttf-microsoft-cmap-sub-table.d.ts +57 -0
- package/dist/ts/implementation/graphics/fonts/ttf-microsoft-cmap-sub-table.ts +58 -0
- package/dist/ts/implementation/graphics/fonts/ttf-name-record.d.ts +33 -0
- package/dist/ts/implementation/graphics/fonts/ttf-name-record.ts +33 -0
- package/dist/ts/implementation/graphics/fonts/ttf-name-table.d.ts +22 -0
- package/dist/ts/implementation/graphics/fonts/ttf-name-table.ts +22 -0
- package/dist/ts/implementation/graphics/fonts/ttf-post-table.d.ts +41 -0
- package/dist/ts/implementation/graphics/fonts/ttf-post-table.ts +42 -0
- package/dist/ts/implementation/graphics/fonts/ttf-reader.d.ts +225 -0
- package/dist/ts/implementation/graphics/fonts/ttf-reader.ts +1254 -0
- package/dist/ts/implementation/graphics/fonts/ttf-table-info.d.ts +22 -0
- package/dist/ts/implementation/graphics/fonts/ttf-table-info.ts +26 -0
- package/dist/ts/implementation/graphics/fonts/ttf-trimmed-cmap-sub-table.d.ts +25 -0
- package/dist/ts/implementation/graphics/fonts/ttf-trimmed-cmap-sub-table.ts +26 -0
- package/dist/ts/implementation/graphics/fonts/unicode-true-type-font.d.ts +213 -0
- package/dist/ts/implementation/graphics/fonts/unicode-true-type-font.ts +577 -0
- package/dist/ts/implementation/graphics/images/byte-array.d.ts +74 -0
- package/dist/ts/implementation/graphics/images/byte-array.ts +137 -0
- package/dist/ts/implementation/graphics/images/image-decoder.d.ts +274 -0
- package/dist/ts/implementation/graphics/images/image-decoder.ts +439 -0
- package/dist/ts/implementation/graphics/images/index.d.ts +8 -0
- package/dist/ts/implementation/graphics/images/index.ts +8 -0
- package/dist/ts/implementation/graphics/images/pdf-bitmap.d.ts +90 -0
- package/dist/ts/implementation/graphics/images/pdf-bitmap.ts +110 -0
- package/dist/ts/implementation/graphics/images/pdf-image.d.ts +88 -0
- package/dist/ts/implementation/graphics/images/pdf-image.ts +132 -0
- package/dist/ts/implementation/graphics/index.d.ts +35 -0
- package/dist/ts/implementation/graphics/index.ts +46 -0
- package/dist/ts/implementation/graphics/pdf-color.d.ts +206 -0
- package/dist/ts/implementation/graphics/pdf-color.ts +478 -0
- package/dist/ts/implementation/graphics/pdf-graphics.d.ts +1210 -0
- package/dist/ts/implementation/graphics/pdf-graphics.ts +2554 -0
- package/dist/ts/implementation/graphics/pdf-margins.d.ts +82 -0
- package/dist/ts/implementation/graphics/pdf-margins.ts +124 -0
- package/dist/ts/implementation/graphics/pdf-pen.d.ts +237 -0
- package/dist/ts/implementation/graphics/pdf-pen.ts +370 -0
- package/dist/ts/implementation/graphics/pdf-resources.d.ts +122 -0
- package/dist/ts/implementation/graphics/pdf-resources.ts +300 -0
- package/dist/ts/implementation/graphics/pdf-transformation-matrix.d.ts +143 -0
- package/dist/ts/implementation/graphics/pdf-transformation-matrix.ts +246 -0
- package/dist/ts/implementation/graphics/pdf-transparency.d.ts +34 -0
- package/dist/ts/implementation/graphics/pdf-transparency.ts +93 -0
- package/dist/ts/implementation/graphics/unit-convertor.d.ts +72 -0
- package/dist/ts/implementation/graphics/unit-convertor.ts +96 -0
- package/dist/ts/implementation/index.d.ts +103 -0
- package/dist/ts/implementation/index.ts +103 -0
- package/dist/ts/implementation/input-output/big-endian-writer.d.ts +59 -0
- package/dist/ts/implementation/input-output/big-endian-writer.ts +121 -0
- package/dist/ts/implementation/input-output/cross-table.d.ts +21 -0
- package/dist/ts/implementation/input-output/cross-table.ts +21 -0
- package/dist/ts/implementation/input-output/enum.d.ts +16 -0
- package/dist/ts/implementation/input-output/enum.ts +16 -0
- package/dist/ts/implementation/input-output/index.d.ts +12 -0
- package/dist/ts/implementation/input-output/index.ts +12 -0
- package/dist/ts/implementation/input-output/pdf-cross-table.d.ts +249 -0
- package/dist/ts/implementation/input-output/pdf-cross-table.ts +524 -0
- package/dist/ts/implementation/input-output/pdf-dictionary-properties.d.ts +568 -0
- package/dist/ts/implementation/input-output/pdf-dictionary-properties.ts +571 -0
- package/dist/ts/implementation/input-output/pdf-main-object-collection.d.ts +120 -0
- package/dist/ts/implementation/input-output/pdf-main-object-collection.ts +194 -0
- package/dist/ts/implementation/input-output/pdf-operators.d.ts +361 -0
- package/dist/ts/implementation/input-output/pdf-operators.ts +363 -0
- package/dist/ts/implementation/input-output/pdf-stream-writer.d.ts +311 -0
- package/dist/ts/implementation/input-output/pdf-stream-writer.ts +681 -0
- package/dist/ts/implementation/input-output/pdf-writer.d.ts +68 -0
- package/dist/ts/implementation/input-output/pdf-writer.ts +88 -0
- package/dist/ts/implementation/pages/enum.d.ts +201 -0
- package/dist/ts/implementation/pages/enum.ts +201 -0
- package/dist/ts/implementation/pages/index.d.ts +17 -0
- package/dist/ts/implementation/pages/index.ts +17 -0
- package/dist/ts/implementation/pages/page-added-event-arguments.d.ts +30 -0
- package/dist/ts/implementation/pages/page-added-event-arguments.ts +39 -0
- package/dist/ts/implementation/pages/pdf-document-page-collection.d.ts +86 -0
- package/dist/ts/implementation/pages/pdf-document-page-collection.ts +180 -0
- package/dist/ts/implementation/pages/pdf-page-base.d.ts +121 -0
- package/dist/ts/implementation/pages/pdf-page-base.ts +181 -0
- package/dist/ts/implementation/pages/pdf-page-layer-collection.d.ts +99 -0
- package/dist/ts/implementation/pages/pdf-page-layer-collection.ts +348 -0
- package/dist/ts/implementation/pages/pdf-page-layer.d.ts +160 -0
- package/dist/ts/implementation/pages/pdf-page-layer.ts +271 -0
- package/dist/ts/implementation/pages/pdf-page-settings.d.ts +111 -0
- package/dist/ts/implementation/pages/pdf-page-settings.ts +192 -0
- package/dist/ts/implementation/pages/pdf-page-size.d.ts +159 -0
- package/dist/ts/implementation/pages/pdf-page-size.ts +162 -0
- package/dist/ts/implementation/pages/pdf-page-template-element.d.ts +240 -0
- package/dist/ts/implementation/pages/pdf-page-template-element.ts +663 -0
- package/dist/ts/implementation/pages/pdf-page.d.ts +153 -0
- package/dist/ts/implementation/pages/pdf-page.ts +235 -0
- package/dist/ts/implementation/pages/pdf-section-collection.d.ts +109 -0
- package/dist/ts/implementation/pages/pdf-section-collection.ts +187 -0
- package/dist/ts/implementation/pages/pdf-section-page-collection.d.ts +41 -0
- package/dist/ts/implementation/pages/pdf-section-page-collection.ts +61 -0
- package/dist/ts/implementation/pages/pdf-section-templates.d.ts +64 -0
- package/dist/ts/implementation/pages/pdf-section-templates.ts +96 -0
- package/dist/ts/implementation/pages/pdf-section.d.ts +327 -0
- package/dist/ts/implementation/pages/pdf-section.ts +644 -0
- package/dist/ts/implementation/primitives/index.d.ts +12 -0
- package/dist/ts/implementation/primitives/index.ts +12 -0
- package/dist/ts/implementation/primitives/pdf-array.d.ts +192 -0
- package/dist/ts/implementation/primitives/pdf-array.ts +386 -0
- package/dist/ts/implementation/primitives/pdf-boolean.d.ts +84 -0
- package/dist/ts/implementation/primitives/pdf-boolean.ts +119 -0
- package/dist/ts/implementation/primitives/pdf-dictionary.d.ts +362 -0
- package/dist/ts/implementation/primitives/pdf-dictionary.ts +513 -0
- package/dist/ts/implementation/primitives/pdf-name.d.ts +121 -0
- package/dist/ts/implementation/primitives/pdf-name.ts +218 -0
- package/dist/ts/implementation/primitives/pdf-number.d.ts +104 -0
- package/dist/ts/implementation/primitives/pdf-number.ts +165 -0
- package/dist/ts/implementation/primitives/pdf-reference.d.ts +223 -0
- package/dist/ts/implementation/primitives/pdf-reference.ts +430 -0
- package/dist/ts/implementation/primitives/pdf-stream.d.ts +161 -0
- package/dist/ts/implementation/primitives/pdf-stream.ts +306 -0
- package/dist/ts/implementation/primitives/pdf-string.d.ts +235 -0
- package/dist/ts/implementation/primitives/pdf-string.ts +397 -0
- package/dist/ts/implementation/structured-elements/grid/index.d.ts +4 -0
- package/dist/ts/implementation/structured-elements/grid/index.ts +10 -0
- package/dist/ts/implementation/structured-elements/grid/layout/grid-layouter.d.ts +597 -0
- package/dist/ts/implementation/structured-elements/grid/layout/grid-layouter.ts +2029 -0
- package/dist/ts/implementation/structured-elements/grid/pdf-grid-cell.d.ts +288 -0
- package/dist/ts/implementation/structured-elements/grid/pdf-grid-cell.ts +1194 -0
- package/dist/ts/implementation/structured-elements/grid/pdf-grid-column.d.ts +108 -0
- package/dist/ts/implementation/structured-elements/grid/pdf-grid-column.ts +206 -0
- package/dist/ts/implementation/structured-elements/grid/pdf-grid-row.d.ts +261 -0
- package/dist/ts/implementation/structured-elements/grid/pdf-grid-row.ts +470 -0
- package/dist/ts/implementation/structured-elements/grid/pdf-grid.d.ts +292 -0
- package/dist/ts/implementation/structured-elements/grid/pdf-grid.ts +853 -0
- package/dist/ts/implementation/structured-elements/grid/styles/index.d.ts +5 -0
- package/dist/ts/implementation/structured-elements/grid/styles/index.ts +5 -0
- package/dist/ts/implementation/structured-elements/grid/styles/pdf-borders.d.ts +146 -0
- package/dist/ts/implementation/structured-elements/grid/styles/pdf-borders.ts +240 -0
- package/dist/ts/implementation/structured-elements/grid/styles/style.d.ts +272 -0
- package/dist/ts/implementation/structured-elements/grid/styles/style.ts +424 -0
- package/dist/ts/implementation/structured-elements/index.d.ts +4 -0
- package/dist/ts/implementation/structured-elements/index.ts +10 -0
- package/dist/ts/implementation/structured-elements/tables/light-tables/enum.d.ts +16 -0
- package/dist/ts/implementation/structured-elements/tables/light-tables/enum.ts +16 -0
- package/dist/ts/index.d.ts +116 -0
- package/dist/ts/index.ts +116 -0
- package/dist/ts/interfaces/i-pdf-cache.d.ts +23 -0
- package/dist/ts/interfaces/i-pdf-cache.ts +23 -0
- package/dist/ts/interfaces/i-pdf-changable.d.ts +17 -0
- package/dist/ts/interfaces/i-pdf-changable.ts +17 -0
- package/dist/ts/interfaces/i-pdf-clonable.d.ts +12 -0
- package/dist/ts/interfaces/i-pdf-clonable.ts +12 -0
- package/dist/ts/interfaces/i-pdf-primitives.d.ts +45 -0
- package/dist/ts/interfaces/i-pdf-primitives.ts +45 -0
- package/dist/ts/interfaces/i-pdf-true-type-font.d.ts +18 -0
- package/dist/ts/interfaces/i-pdf-true-type-font.ts +48 -0
- package/dist/ts/interfaces/i-pdf-wrapper.d.ts +13 -0
- package/dist/ts/interfaces/i-pdf-wrapper.ts +13 -0
- package/dist/ts/interfaces/i-pdf-writer.d.ts +29 -0
- package/dist/ts/interfaces/i-pdf-writer.ts +29 -0
- package/dist/ts/interfaces/index.d.ts +10 -0
- package/dist/ts/interfaces/index.ts +10 -0
- package/interfaces.js +0 -1
- package/package.json +7 -7
- package/src/interfaces/i-pdf-cache.js +0 -1
- package/src/interfaces/i-pdf-changable.js +0 -1
- package/src/interfaces/i-pdf-clonable.js +0 -1
- package/src/interfaces/i-pdf-primitives.js +0 -1
- package/src/interfaces/i-pdf-true-type-font.js +0 -1
- package/src/interfaces/i-pdf-wrapper.js +0 -1
- package/src/interfaces/i-pdf-writer.js +0 -1
- package/src/interfaces/index.js +0 -1
- package/CHANGELOG.md +0 -57
- package/dist/ej2-pdf-export.min.js +0 -10
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: ej2-pdf-export.umd.min.js
|
|
3
|
-
* version :
|
|
3
|
+
* version : 26.1.35
|
|
4
4
|
* Copyright Syncfusion Inc. 2001 - 2023. All rights reserved.
|
|
5
5
|
* Use of this code is subject to the terms of our license.
|
|
6
6
|
* A copy of the current license can be obtained at any time by e-mailing
|
|
7
7
|
* licensing@syncfusion.com. Any infringement will be prosecuted under
|
|
8
8
|
* applicable laws.
|
|
9
9
|
*/
|
|
10
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@syncfusion/ej2-compression"),require("@syncfusion/ej2-file-utils")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-compression","@syncfusion/ej2-file-utils"],e):e(t.ej={},t.ej2Compression,t.ej2FileUtils)}(this,function(t,e,i){"use strict";function r(t){return"[object String]"===Object.prototype.toString.call(t)?"$s"+t:"$o"+t.toString()}var n=function(){function t(t){this.table={},this.nElements=0,this.toStr=t||r}return t.prototype.getValue=function(t){var e=this.table["$"+this.toStr(t)];if(void 0!==e)return e.value},t.prototype.setValue=function(t,e){var i="$"+this.toStr(t);this.table[i];this.nElements++,this.table[i]={key:t,value:e}},t.prototype.remove=function(t){var e="$"+this.toStr(t),i=this.table[e];return delete this.table[e],this.nElements--,i.value},t.prototype.keys=function(){for(var t=[],e=Object.keys(this.table),i=0;i<e.length;i++){var r=this.table[e[i]];t.push(r.key)}return t},t.prototype.values=function(){for(var t=[],e=Object.keys(this.table),i=0;i<e.length;i++){var r=this.table[e[i]];t.push(r.value)}return t},t.prototype.containsKey=function(t){return!(void 0===this.getValue(t))},t.prototype.clear=function(){this.table={},this.nElements=0},t.prototype.size=function(){return this.nElements},t}(),o=function(){function t(t){this.stringStartMark="/",this.internalValue="",this.isSaving6=!1,this.position6=-1,this.internalValue=this.normalizeValue(t)}return Object.defineProperty(t.prototype,"status",{get:function(){return this.status6},set:function(t){this.status6=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isSaving",{get:function(){return this.isSaving6},set:function(t){this.isSaving6=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"objectCollectionIndex",{get:function(){return this.index6},set:function(t){this.index6=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this.position6},set:function(t){this.position6=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"clonedObject",{get:function(){return null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this.internalValue},set:function(t){var e=t;null!==t&&t.length>0?(e=t,this.internalValue=this.normalizeValue(e)):this.internalValue=e},enumerable:!0,configurable:!0}),t.prototype.save=function(t){t.write(this.toString())},t.prototype.toString=function(){return this.stringStartMark+this.escapeString(this.value)},t.prototype.clone=function(e){var i=new t;return i.value=this.internalValue,i},t.prototype.escapeString=function(e){for(var i="",r=0,n=e.length;r<n;r++){var o=e[r];t.delimiters.indexOf(o);i+=o}return i},t.prototype.normalizeValue=function(t,e){return t},t.delimiters="()<>[]{}/%}",t.replacements=[" ","\t","\n","\r"],t}(),s=function(){function t(){this.forTest="test",this.forTest=t.obj}return t.obj="obj",t.endObj="endobj",t.r="R",t.whiteSpace=" ",t.slash="/",t.newLine="\r\n",t.stream="stream",t.endStream="endstream",t.xref="xref",t.f="f",t.n="n",t.trailer="trailer",t.startxref="startxref",t.eof="%%EOF",t.header="%PDF-1.5",t.beginText="BT",t.endText="ET",t.beginPath="m",t.appendLineSegment="l",t.stroke="S",t.fill="f",t.fillEvenOdd="f*",t.fillStroke="B",t.fillStrokeEvenOdd="B*",t.appendbeziercurve="c",t.appendRectangle="re",t.saveState="q",t.restoreState="Q",t.paintXObject="Do",t.modifyCtm="cm",t.modifyTM="Tm",t.setLineWidth="w",t.setLineCapStyle="J",t.setLineJoinStyle="j",t.setDashPattern="d",t.setFlatnessTolerance="i",t.closePath="h",t.closeStrokePath="s",t.closeFillStrokePath="b",t.setCharacterSpace="Tc",t.setWordSpace="Tw",t.setHorizontalScaling="Tz",t.setTextLeading="TL",t.setFont="Tf",t.setRenderingMode="Tr",t.setTextRise="Ts",t.setTextScaling="Tz",t.setCoords="Td",t.goToNextLine="T*",t.setText="Tj",t.setTextWithFormatting="TJ",t.setTextOnNewLine="'",t.selectcolorspaceforstroking="CS",t.selectcolorspacefornonstroking="cs",t.setrbgcolorforstroking="RG",t.setrbgcolorfornonstroking="rg",t.setcmykcolorforstroking="K",t.setcmykcolorfornonstroking="k",t.setgraycolorforstroking="G",t.setgraycolorfornonstroking="g",t.clipPath="W",t.clipPathEvenOdd="W*",t.endPath="n",t.setGraphicsState="gs",t.comment="%",t.evenOdd="*",t.setMiterLimit="M",t.setColorAndPattern="scn",t.setColorAndPatternStroking="SCN",t}(),a=function(){return function(){this.pages="Pages",this.kids="Kids",this.count="Count",this.resources="Resources",this.type="Type",this.size="Size",this.mediaBox="MediaBox",this.parent="Parent",this.root="Root",this.decodeParms="DecodeParms",this.filter="Filter",this.font="Font",this.type1="Type1",this.baseFont="BaseFont",this.encoding="Encoding",this.subtype="Subtype",this.contents="Contents",this.procset="ProcSet",this.colorSpace="ColorSpace",this.extGState="ExtGState",this.pattern="Pattern",this.xObject="XObject",this.length="Length",this.width="Width",this.height="Height",this.bitsPerComponent="BitsPerComponent",this.image="Image",this.dctdecode="DCTDecode",this.columns="Columns",this.blackIs1="BlackIs1",this.k="K",this.s="S",this.predictor="Predictor",this.deviceRgb="DeviceRGB",this.next="Next",this.action="Action",this.link="Link",this.a="A",this.annot="Annot",this.p="P",this.c="C",this.rect="Rect",this.uri="URI",this.annots="Annots",this.ca="ca",this.CA="CA",this.xyz="XYZ",this.fit="Fit",this.dest="Dest",this.BM="BM",this.flatedecode="FlateDecode",this.rotate="Rotate",this.bBox="BBox",this.form="Form",this.w="W",this.cIDFontType2="CIDFontType2",this.cIDToGIDMap="CIDToGIDMap",this.identity="Identity",this.dw="DW",this.fontDescriptor="FontDescriptor",this.cIDSystemInfo="CIDSystemInfo",this.fontName="FontName",this.flags="Flags",this.fontBBox="FontBBox",this.missingWidth="MissingWidth",this.stemV="StemV",this.italicAngle="ItalicAngle",this.capHeight="CapHeight",this.ascent="Ascent",this.descent="Descent",this.leading="Leading",this.avgWidth="AvgWidth",this.fontFile2="FontFile2",this.maxWidth="MaxWidth",this.xHeight="XHeight",this.stemH="StemH",this.registry="Registry",this.ordering="Ordering",this.supplement="Supplement",this.type0="Type0",this.identityH="Identity-H",this.toUnicode="ToUnicode",this.descendantFonts="DescendantFonts",this.background="Background",this.shading="Shading",this.matrix="Matrix",this.antiAlias="AntiAlias",this.function="Function",this.extend="Extend",this.shadingType="ShadingType",this.coords="Coords",this.domain="Domain",this.range="Range",this.functionType="FunctionType",this.bitsPerSample="BitsPerSample",this.patternType="PatternType",this.paintType="PaintType",this.tilingType="TilingType",this.xStep="XStep",this.yStep="YStep",this.viewerPreferences="ViewerPreferences",this.centerWindow="CenterWindow",this.displayTitle="DisplayTitle",this.fitWindow="FitWindow",this.hideMenuBar="HideMenubar",this.hideToolBar="HideToolbar",this.hideWindowUI="HideWindowUI",this.pageMode="PageMode",this.pageLayout="PageLayout",this.duplex="Duplex",this.printScaling="PrintScaling"}}(),h=function(){function t(t){if(this.position7=-1,this.primitiveItems=new n,this.prefix="<<",this.suffix=">>",this.resources=[],this.object=null,this.archive=!0,this.isResource=!1,void 0===t)this.primitiveItems=new n,this.encrypt=!0,this.dictionaryProperties=new a;else{this.primitiveItems=new n;for(var e=t.items.keys(),i=t.items.values(),r=0;r<t.items.size();r++)this.primitiveItems.setValue(e[r],i[r]);this.status=t.status,this.freezeChanges(this),this.encrypt=!0,this.dictionaryProperties=new a}}return Object.defineProperty(t.prototype,"items",{get:function(){return this.primitiveItems},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"status",{get:function(){return this.status7},set:function(t){this.status7=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isSaving",{get:function(){return this.isSaving7},set:function(t){this.isSaving7=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"objectCollectionIndex",{get:function(){return this.index7},set:function(t){this.index7=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"clonedObject",{get:function(){return this.object},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this.position7},set:function(t){this.position7=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Count",{get:function(){return this.primitiveItems.size()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Dictionary",{get:function(){return this},enumerable:!0,configurable:!0}),t.prototype.getArchive=function(){return this.archive},t.prototype.setArchive=function(t){this.archive=t},t.prototype.setEncrypt=function(t){this.encrypt=t,this.modify()},t.prototype.getEncrypt=function(){return this.encrypt},t.prototype.freezeChanges=function(t){this.bChanged=!1},t.prototype.clone=function(e){return new t},t.prototype.modify=function(){this.bChanged=!0},t.prototype.remove=function(t){"string"!=typeof t?(this.primitiveItems.remove(t.value),this.modify()):this.remove(new o(t))},t.prototype.containsKey=function(t){return this.primitiveItems.containsKey(t.toString())},t.prototype.onBeginSave=function(){this.beginSave.sender.beginSave()},t.prototype.onFontDictionaryBeginSave=function(){this.fontDictionaryBeginSave.sender.fontDictionaryBeginSave()},t.prototype.onDescendantFontBeginSave=function(){this.descendantFontBeginSave.sender.descendantFontBeginSave()},t.prototype.onTemplateBeginSave=function(){this.pageBeginDrawTemplate.sender.pageBeginSave()},t.prototype.onBeginAnnotationSave=function(){this.annotationBeginSave.sender.beginSave()},t.prototype.onSectionBeginSave=function(t){var e=this.sectionBeginSave;e.sender.beginSave(e.state,t)},t.prototype.save=function(t,e){void 0===e?this.save(t,!0):(t.write(this.prefix),void 0!==this.beginSave&&this.onBeginSave(),void 0!==this.descendantFontBeginSave&&this.onDescendantFontBeginSave(),void 0!==this.fontDictionaryBeginSave&&this.onFontDictionaryBeginSave(),void 0!==this.annotationBeginSave&&this.onBeginAnnotationSave(),void 0!==this.sectionBeginSave&&this.onSectionBeginSave(t),void 0!==this.pageBeginDrawTemplate&&this.onTemplateBeginSave(),this.Count>0&&this.saveItems(t),t.write(this.suffix),t.write(s.newLine))},t.prototype.saveItems=function(t){t.write(s.newLine);for(var e=this.primitiveItems.keys(),i=this.primitiveItems.values(),r=0;r<e.length;r++){var n=e[r];new o(n).save(t),t.write(s.whiteSpace);i[r].save(t),t.write(s.newLine)}},t}(),l=function(){return function(t){this.sender=t}}(),u=function(){return function(t){this.sender=t}}(),c=function(){return function(t){this.sender=t}}(),p=function(){return function(t){this.sender=t}}(),d=function(){return function(t,e){this.sender=t,this.state=e}}(),f=function(){return function(t){this.sender=t}}(),g=function(){function t(t){this.position5=-1,this.value=t}return Object.defineProperty(t.prototype,"intValue",{get:function(){return this.value},set:function(t){this.value=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isInteger",{get:function(){return this.integer},set:function(t){this.integer=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"status",{get:function(){return this.status5},set:function(t){this.status5=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isSaving",{get:function(){return this.isSaving5},set:function(t){this.isSaving5=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"objectCollectionIndex",{get:function(){return this.index5},set:function(t){this.index5=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this.position5},set:function(t){this.position5=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"clonedObject",{get:function(){return null},enumerable:!0,configurable:!0}),t.prototype.save=function(t){t.write(this.intValue.toString())},t.prototype.clone=function(e){return new t(this.value)},t.floatToString=function(t){var e=t.toFixed(2);return"0.00"===e&&(e=".00"),e},t.min=function(t,e,i){var r=Math.min(t,e);return Math.min(i,r)},t}(),m=function(){function t(e){if(this.startMark="[",this.endMark="]",this.position9=-1,this.clonedObject9=null,this.isFont=!1,void 0===e)this.internalElements=[];else if(void 0===e||e instanceof t){var i=e;this.internalElements=[];for(n=0;n<i.elements.length;n++)this.internalElements.push(i.elements[n])}else for(var r=e,n=0;n<r.length;n++){var o=new g(r[n]);this.add(o)}}return t.prototype.items=function(t){return this.internalElements[t]},Object.defineProperty(t.prototype,"count",{get:function(){return this.internalElements.length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"status",{get:function(){return this.status9},set:function(t){this.status9=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isSaving",{get:function(){return this.isSaving9},set:function(t){this.isSaving9=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"clonedObject",{get:function(){return this.clonedObject9},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this.position9},set:function(t){this.position9=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"objectCollectionIndex",{get:function(){return this.index9},set:function(t){this.index9=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"CrossTable",{get:function(){return this.pdfCrossTable},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"elements",{get:function(){return this.internalElements},enumerable:!0,configurable:!0}),t.prototype.add=function(t){void 0===this.internalElements&&(this.internalElements=[]),this.internalElements.push(t),this.markedChange()},t.prototype.markedChange=function(){this.bChanged=!0},t.prototype.contains=function(t){for(var e=0;e<this.internalElements.length;e++){var i=this.internalElements[e],r=t;if(null!=i&&void 0!==i&&null!=r&&void 0!==r&&i.value===r.value)return!0}return!1},t.prototype.getItems=function(t){return this.internalElements[t]},t.prototype.save=function(t){t.write(this.startMark);for(var e=0,i=this.count;e<i;e++)this.getItems(e).save(t),e+1!==i&&t.write(s.whiteSpace);t.write(this.endMark)},t.prototype.clone=function(e){this.clonedObject9=null;for(var i=new t,r=0;r<this.internalElements.length;r++){var n=this.internalElements[r];i.add(n.clone(e))}return i.pdfCrossTable=e,this.clonedObject9=i,i},t.fromRectangle=function(e){return new t([e.x,e.y,e.width,e.height])},t.prototype.insert=function(t,e){if(t<this.internalElements.length&&t>0){for(var i=[],r=0;r<t;r++)i.push(this.internalElements[r]);i.push(e);for(r=t;r<this.internalElements.length;r++)i.push(this.internalElements[r]);this.internalElements=i}else this.internalElements.push(e);this.markChanged()},t.prototype.indexOf=function(t){return this.internalElements.indexOf(t)},t.prototype.remove=function(t){var e=this.internalElements.indexOf(t);this.internalElements[e]=null,this.markChanged()},t.prototype.removeAt=function(t){if(this.internalElements.length>t){for(var e=[],i=0;i<t;i++)e.push(this.internalElements[i]);for(i=t+1;i<this.internalElements.length;i++)e.push(this.internalElements[i]);this.internalElements=e}this.markChanged()},t.prototype.clear=function(){this.internalElements=[],this.markChanged()},t.prototype.markChanged=function(){this.bChanged=!0},t}(),y=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),b=function(t){function i(e,i){var r=t.call(this,e)||this;return r.dicPrefix="stream",r.dicSuffix="endstream",r.clonedObject2=null,r.bCompress=!0,void 0!==e||void 0!==i?(r.dataStream2=[],r.dataStream2=i,r.bCompress2=!1):(r.dataStream2=[],r.bCompress2=!0),r}return y(i,t),Object.defineProperty(i.prototype,"internalStream",{get:function(){return this.dataStream2},set:function(t){this.dataStream2=[],this.dataStream2=t,this.modify()},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"compress",{get:function(){return this.bCompress},set:function(t){this.bCompress=t,this.modify()},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"data",{get:function(){return this.dataStream2},set:function(t){this.dataStream2=[],this.dataStream2=t,this.modify()},enumerable:!0,configurable:!0}),i.prototype.clearStream=function(){this.internalStream=[],this.items.containsKey(this.dictionaryProperties.filter)&&this.remove(this.dictionaryProperties.filter),this.bCompress=!0,this.modify()},i.prototype.write=function(t){if(null==t)throw new Error("ArgumentNullException:text");if(t.length<=0)throw new Error("ArgumentException: Can not write an empty string, text");this.dataStream2.push(t),this.modify()},i.prototype.writeBytes=function(t){if(null===t)throw new Error("ArgumentNullException:data");if(t.length<=0)throw new Error("ArgumentException: Can not write an empty bytes, data");for(var e="",i=0;i<t.length;i++)e+=String.fromCharCode(t[i]);this.dataStream2.push(e),this.modify()},i.prototype.onCmapBeginSave=function(){this.cmapBeginSave.sender.cmapBeginSave()},i.prototype.onFontProgramBeginSave=function(){this.fontProgramBeginSave.sender.fontProgramBeginSave()},i.prototype.compressContent=function(t,i){if(this.bCompress){for(var r=[],n=0;n<t.length;n++)r.push(t.charCodeAt(n));var o=new Uint8Array(r),s=new e.CompressedStreamWriter;s.write(o,0,o.length),s.close(),t=s.getCompressedString,this.addFilter(this.dictionaryProperties.flatedecode)}return t},i.prototype.addFilter=function(t){var e=this.items.getValue(this.dictionaryProperties.filter);if(e instanceof C){e=e.object}var i=e,r=e;null!=r&&((i=new m).insert(0,r),this.items.setValue(this.dictionaryProperties.filter,i)),r=new o(t),null==i?this.items.setValue(this.dictionaryProperties.filter,r):i.insert(0,r)},i.prototype.save=function(e){void 0!==this.cmapBeginSave&&this.onCmapBeginSave(),void 0!==this.fontProgramBeginSave&&this.onFontProgramBeginSave();for(var i="",r=0;r<this.data.length;r++)i+=this.data[r];i.length>1&&!this.isResource&&(i="q\r\n"+i+"Q\r\n");var n=(i=this.compressContent(i,e)).length;this.items.setValue(this.dictionaryProperties.length,new g(n)),t.prototype.save.call(this,e,!1),e.write(this.dicPrefix),e.write(s.newLine),i.length>0&&e.write(i),e.write(s.newLine),e.write(this.dicSuffix),e.write(s.newLine)},i.bytesToString=function(t){for(var e="",i=0;i<t.length;i++)e+=String.fromCharCode(t[i]);return e},i}(h),w=function(){return function(t){this.sender=t}}(),P=function(){return function(t){this.sender=t}}();!function(t){!function(t){t[t.None=0]="None",t[t.Ascii=1]="Ascii",t[t.Unicode=2]="Unicode"}(t.ForceEncoding||(t.ForceEncoding={}));var e;!function(t){t[t.StringValue=0]="StringValue",t[t.ByteBuffer=1]="ByteBuffer"}(e||(e={}))}(t.InternalEnum||(t.InternalEnum={}));var S=function(){function e(t){if(this.bHex=!1,this.position1=-1,this.clonedObject1=null,this.bDecrypted=!1,this.isParentDecrypted=!1,this.isPacked=!1,this.isFormField=!1,this.isColorSpace=!1,this.isHexString=!0,void 0===t)this.bHex=!1;else if(!(t.length>0&&"0xfeff"===t[0])){this.stringValue=t,this.data=[];for(var e=0;e<t.length;++e)this.data.push(t.charCodeAt(e))}}return Object.defineProperty(e.prototype,"hex",{get:function(){return this.bHex},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.stringValue},set:function(t){this.stringValue=t,this.data=null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this.status1},set:function(t){this.status1=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isSaving",{get:function(){return this.isSaving1},set:function(t){this.isSaving1=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"objectCollectionIndex",{get:function(){return this.index1},set:function(t){this.index1=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"clonedObject",{get:function(){return this.clonedObject1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"position",{get:function(){return this.position1},set:function(t){this.position1=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"CrossTable",{get:function(){return this.crossTable},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"converted",{get:function(){return this.bConverted},set:function(t){this.bConverted=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"encode",{get:function(){return this.bForceEncoding},set:function(t){this.bForceEncoding=t},enumerable:!0,configurable:!0}),e.bytesToHex=function(t){if(null==t)return"";return""},e.prototype.save=function(i){if(null===i)throw new Error("ArgumentNullException : writer");void 0!==this.encode&&this.encode===t.InternalEnum.ForceEncoding.Ascii?i.write(this.pdfEncode()):i.write(e.stringMark[0]+this.value+e.stringMark[1])},e.prototype.pdfEncode=function(){var i="";if(void 0!==this.encode&&this.encode===t.InternalEnum.ForceEncoding.Ascii){for(var r=this.escapeSymbols(this.value),n=0;n<r.length;n++)i+=String.fromCharCode(r[n]);i=e.stringMark[0]+i+e.stringMark[1]}else i=this.value;return i},e.prototype.escapeSymbols=function(t){for(var e=[],i=0;i<t.length;i++){var r=t.charCodeAt(i);switch(r){case 40:case 41:e.push(92),e.push(r);break;case 13:e.push(92),e.push(114);break;case 92:e.push(92),e.push(r);break;default:e.push(r)}}return e},e.prototype.clone=function(t){if(null!==this.clonedObject1&&this.clonedObject1.CrossTable===t)return this.clonedObject1;this.clonedObject1=null;var i=new e(this.stringValue);return i.bHex=this.bHex,i.crossTable=t,i.isColorSpace=this.isColorSpace,this.clonedObject1=i,i},e.toUnicodeArray=function(t,e){if(null==t)throw new Error("Argument Null Exception : value");for(var i=[],r=0;r<t.length;r++){var n=t.charCodeAt(r);i.push(n/256>>>0),i.push(255&n)}return i},e.byteToString=function(t){if(null==t)throw new Error("Argument Null Exception : stream");for(var e="",i=0;i<t.length;++i)e+=String.fromCharCode(t[i]);return e},e.stringMark="()",e.hexStringMark="<>",e.hexFormatPattern="{0:X2}",e}(),v=function(){function t(t,e){this.index3=-1,this.position3=-1,this.objNumber=0,this.genNumber=0,"number"==typeof t&&"number"==typeof e?(this.objNumber=t,this.genNumber=e):(this.objNumber=Number(t),this.genNumber=Number(e))}return Object.defineProperty(t.prototype,"status",{get:function(){return this.status3},set:function(t){this.status3=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isSaving",{get:function(){return this.isSaving3},set:function(t){this.isSaving3=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"objectCollectionIndex",{get:function(){return this.index3},set:function(t){this.index3=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this.position3},set:function(t){this.position3=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"clonedObject",{get:function(){return null},enumerable:!0,configurable:!0}),t.prototype.save=function(t){t.write(this.toString())},t.prototype.toString=function(){return this.objNumber.toString()+" "+this.genNumber.toString()+" R"},t.prototype.clone=function(t){return null},t}(),C=function(){function t(t,e){this.index4=-1,this.position4=-1,this.objectIndex=-1,this.dictionaryProperties=new a,this.initialize(t)}return Object.defineProperty(t.prototype,"status",{get:function(){return this.status4},set:function(t){this.status4=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isSaving",{get:function(){return this.isSaving4},set:function(t){this.isSaving4=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"objectCollectionIndex",{get:function(){return this.index4},set:function(t){this.index4=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this.position4},set:function(t){this.position4=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"clonedObject",{get:function(){return null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"object",{get:function(){return this.primitiveObject},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"reference",{get:function(){return this.pdfReference},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"index",{get:function(){return this.objectIndex},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"element",{get:function(){return this.primitiveObject},enumerable:!0,configurable:!0}),t.prototype.initialize=function(t){if(t instanceof m||t instanceof h||t instanceof o||t instanceof g||t instanceof b||t instanceof v||t instanceof S)this.primitiveObject=t;else{var e=t;this.initialize(e.element)}},t.prototype.save=function(t){t.position;var e=t.document.crossTable;this.object.isSaving=!0;e.getReference(this.object).save(t)},t.prototype.clone=function(t){return null},t}(),B=function(){function t(){this.action=null,this.dictionaryProperties=new a,this.initialize()}return Object.defineProperty(t.prototype,"next",{get:function(){return this.action},set:function(t){this.action=t,this.dictionary.items.setValue(this.dictionaryProperties.next,new C(this.action))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dictionary",{get:function(){return void 0===this.pdfDictionary&&(this.pdfDictionary=new h),this.pdfDictionary},enumerable:!0,configurable:!0}),t.prototype.initialize=function(){this.dictionary.items.setValue(this.dictionaryProperties.type,new o(this.dictionaryProperties.action))},Object.defineProperty(t.prototype,"element",{get:function(){return this.dictionary},enumerable:!0,configurable:!0}),t}(),O=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),x=function(t){function e(e){var i=t.call(this)||this;return i.uniformResourceIdentifier="",i}return O(e,t),Object.defineProperty(e.prototype,"uri",{get:function(){return this.uniformResourceIdentifier},set:function(t){this.uniformResourceIdentifier=t,this.dictionary.items.setValue(this.dictionaryProperties.uri,new S(this.uniformResourceIdentifier))},enumerable:!0,configurable:!0}),e.prototype.initialize=function(){t.prototype.initialize.call(this),this.dictionary.items.setValue(this.dictionaryProperties.s,new o(this.dictionaryProperties.uri))},e}(B);!function(t){t[t.Left=0]="Left",t[t.Center=1]="Center",t[t.Right=2]="Right"}(t.PdfHorizontalAlignment||(t.PdfHorizontalAlignment={})),function(t){t[t.Top=0]="Top",t[t.Middle=1]="Middle",t[t.Bottom=2]="Bottom"}(t.PdfVerticalAlignment||(t.PdfVerticalAlignment={})),function(t){t[t.Left=0]="Left",t[t.Center=1]="Center",t[t.Right=2]="Right",t[t.Justify=3]="Justify"}(t.PdfTextAlignment||(t.PdfTextAlignment={})),function(t){t[t.Fill=0]="Fill",t[t.Stroke=1]="Stroke",t[t.FillStroke=2]="FillStroke",t[t.None=3]="None",t[t.ClipFlag=4]="ClipFlag",t[t.ClipFill=4]="ClipFill",t[t.ClipStroke=5]="ClipStroke",t[t.ClipFillStroke=6]="ClipFillStroke",t[t.Clip=7]="Clip"}(t.TextRenderingMode||(t.TextRenderingMode={})),function(t){t[t.Miter=0]="Miter",t[t.Round=1]="Round",t[t.Bevel=2]="Bevel"}(t.PdfLineJoin||(t.PdfLineJoin={})),function(t){t[t.Flat=0]="Flat",t[t.Round=1]="Round",t[t.Square=2]="Square"}(t.PdfLineCap||(t.PdfLineCap={})),function(t){t[t.Solid=0]="Solid",t[t.Dash=1]="Dash",t[t.Dot=2]="Dot",t[t.DashDot=3]="DashDot",t[t.DashDotDot=4]="DashDotDot",t[t.Custom=5]="Custom"}(t.PdfDashStyle||(t.PdfDashStyle={})),function(t){t[t.Winding=0]="Winding",t[t.Alternate=1]="Alternate"}(t.PdfFillMode||(t.PdfFillMode={})),function(t){t[t.Rgb=0]="Rgb",t[t.Cmyk=1]="Cmyk",t[t.GrayScale=2]="GrayScale",t[t.Indexed=3]="Indexed"}(t.PdfColorSpace||(t.PdfColorSpace={})),function(t){t[t.Normal=0]="Normal",t[t.Multiply=1]="Multiply",t[t.Screen=2]="Screen",t[t.Overlay=3]="Overlay",t[t.Darken=4]="Darken",t[t.Lighten=5]="Lighten",t[t.ColorDodge=6]="ColorDodge",t[t.ColorBurn=7]="ColorBurn",t[t.HardLight=8]="HardLight",t[t.SoftLight=9]="SoftLight",t[t.Difference=10]="Difference",t[t.Exclusion=11]="Exclusion",t[t.Hue=12]="Hue",t[t.Saturation=13]="Saturation",t[t.Color=14]="Color",t[t.Luminosity=15]="Luminosity"}(t.PdfBlendMode||(t.PdfBlendMode={})),function(t){t[t.Centimeter=0]="Centimeter",t[t.Pica=1]="Pica",t[t.Pixel=2]="Pixel",t[t.Point=3]="Point",t[t.Inch=4]="Inch",t[t.Document=5]="Document",t[t.Millimeter=6]="Millimeter"}(t.PdfGraphicsUnit||(t.PdfGraphicsUnit={})),function(t){t[t.Fit=0]="Fit",t[t.Center=1]="Center",t[t.Stretch=2]="Stretch",t[t.Tile=3]="Tile"}(t.PdfGridImagePosition||(t.PdfGridImagePosition={})),function(t){t[t.None=0]="None",t[t.LeftToRight=1]="LeftToRight",t[t.RightToLeft=2]="RightToLeft"}(t.PdfTextDirection||(t.PdfTextDirection={}));var L=function(){function e(t,i,r,n){void 0===t?void 0!==i&&void 0!==r&&void 0!==n?this.assignRGB(i,r,n):this.filled=!1:t instanceof e?(this.redColor=t.r,this.greenColor=t.g,this.blueColor=t.b,this.grayColor=t.gray,this.alpha=t.alpha,this.filled=0!==this.alpha):"number"==typeof t&&void 0===i&&void 0===r&&void 0===n?(t<0&&(t=0),t>1&&(t=1),this.redColor=t*e.maxColourChannelValue,this.greenColor=t*e.maxColourChannelValue,this.blueColor=t*e.maxColourChannelValue,this.cyanColor=t,this.magentaColor=t,this.yellowColor=t,this.blackColor=t,this.grayColor=t,this.alpha=e.maxColourChannelValue,this.filled=!0):void 0===n?this.assignRGB(t,i,r):this.assignRGB(i,r,n,t)}return e.prototype.assignRGB=function(t,i,r,n){void 0===t||void 0===i||void 0===r?this.filled=!1:(this.cyanColor=0,this.magentaColor=0,this.yellowColor=0,this.blackColor=0,this.grayColor=0,this.redColor=t,this.greenColor=i,this.blueColor=r,this.alpha=void 0===n?e.maxColourChannelValue:n,this.filled=!0,this.assignCMYK(t,i,r))},e.prototype.assignCMYK=function(t,i,r){var n=t/e.maxColourChannelValue,o=i/e.maxColourChannelValue,s=r/e.maxColourChannelValue,a=g.min(1-n,1-o,1-s),h=1===a?0:(1-n-a)/(1-a),l=1===a?0:(1-o-a)/(1-a),u=1===a?0:(1-s-a)/(1-a);this.blackColor=a,this.cyanColor=h,this.magentaColor=l,this.yellowColor=u},Object.defineProperty(e.prototype,"r",{get:function(){return this.redColor},set:function(t){this.redColor=t,this.assignCMYK(this.redColor,this.greenColor,this.blueColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"red",{get:function(){return this.r/e.maxColourChannelValue},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"b",{get:function(){return this.blueColor},set:function(t){this.blueColor=t,this.assignCMYK(this.redColor,this.greenColor,this.blueColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"blue",{get:function(){return this.b/e.maxColourChannelValue},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"c",{get:function(){return this.cyanColor},set:function(t){this.cyanColor=t<0?0:t>1?1:t,this.assignRGB(this.cyanColor,this.magentaColor,this.yellowColor,this.blackColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"k",{get:function(){return this.blackColor},set:function(t){this.blackColor=t<0?0:t>1?1:t,this.assignRGB(this.cyanColor,this.magentaColor,this.yellowColor,this.blackColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"m",{get:function(){return this.magentaColor},set:function(t){this.magentaColor=t<0?0:t>1?1:t,this.assignRGB(this.cyanColor,this.magentaColor,this.yellowColor,this.blackColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"y",{get:function(){return this.yellowColor},set:function(t){this.yellowColor=t<0?0:t>1?1:t,this.assignRGB(this.cyanColor,this.magentaColor,this.yellowColor,this.blackColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"g",{get:function(){return this.greenColor},set:function(t){this.greenColor=t,this.assignCMYK(this.redColor,this.greenColor,this.blueColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"green",{get:function(){return this.g/e.maxColourChannelValue},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"gray",{get:function(){return(this.redColor+this.greenColor+this.blueColor)/(3*e.maxColourChannelValue)},set:function(t){this.grayColor=t<0?0:t>1?1:t,this.r=this.grayColor*e.maxColourChannelValue,this.g=this.grayColor*e.maxColourChannelValue,this.b=this.grayColor*e.maxColourChannelValue,this.assignCMYK(this.redColor,this.greenColor,this.blueColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isEmpty",{get:function(){return!this.filled},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"a",{get:function(){return this.alpha},set:function(t){this.alpha=t<0?0:t,this.filled=!0},enumerable:!0,configurable:!0}),e.prototype.toString=function(e,i){if(this.isEmpty)return"";var r="";switch(e){case t.PdfColorSpace.Rgb:r=this.rgbToString(i);break;case t.PdfColorSpace.GrayScale:r=this.grayScaleToString(i);break;case t.PdfColorSpace.Cmyk:r=this.cmykToString(i)}return r},e.prototype.grayScaleToString=function(t){var i=this.gray,r="",n=null;return null==(n=t?e.grayStringsSroke.containsKey(i)?e.grayStringsSroke.getValue(i):null:e.grayStringsFill.containsKey(i)?e.grayStringsFill.getValue(i):null)?t&&(r=i.toString()+" G",e.grayStringsSroke.setValue(i,r)):r=n.toString(),r+s.newLine},e.prototype.rgbToString=function(t){var i=this.r,r=this.g,n=this.b,o=(i<<16)+(r<<8)+n;t&&(o+=1<<24);var a="",h=null;if(e.rgbStrings.containsKey(o)&&(h=e.rgbStrings.getValue(o)),null==h){var l=i/e.maxColourChannelValue,u=r/e.maxColourChannelValue,c=n/e.maxColourChannelValue;a=t?l.toString()+" "+u.toString()+" "+c.toString()+" RG":l.toString()+" "+u.toString()+" "+c.toString()+" rg",e.rgbStrings.setValue(o,a)}else a=h.toString();return a+s.newLine},e.prototype.cmykToString=function(t){var e=this.c,i=this.m,r=this.y,n=this.b;return e.toString()+" "+i.toString()+" "+r.toString()+" "+n.toString()+" K"+s.newLine},e.prototype.toArray=function(e){var i=new m;switch(e){case t.PdfColorSpace.Rgb:i.add(new g(this.red)),i.add(new g(this.green)),i.add(new g(this.blue))}return i},e.rgbStrings=new n,e.grayStringsSroke=new n,e.grayStringsFill=new n,e.maxColourChannelValue=255,e}(),T=function(){return function(t,e){void 0===t?(this.x=0,this.y=0):(this.x=null!==t?t:0,this.y=null!==e?e:0)}}(),j=function(){return function(t,e){void 0===e?(this.height=0,this.width=0):(this.height=null!==e?e:0,this.width=null!==t?t:0)}}(),k=function(){return function(t,e,i,r){if(typeof t==typeof t&&void 0===t)this.x=0,this.y=0,this.height=0,this.width=0;else if(t instanceof T&&e instanceof j&&void 0===i){var n=t;this.x=n.x,this.y=n.y;var o=e;this.height=o.height,this.width=o.width}else{var s=t,a=e,h=i,l=r;this.x=s,this.y=a,this.height=l,this.width=h}}}(),V=function(){function t(t,e,i,r){this.left=t,this.top=e,this.right=i,this.bottom=r}return Object.defineProperty(t.prototype,"width",{get:function(){return this.right-this.left},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.bottom-this.top},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"topLeft",{get:function(){return new T(this.left,this.top)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return new j(this.width,this.height)},enumerable:!0,configurable:!0}),t.prototype.toString=function(){return this.topLeft+"x"+this.size},t}(),R=function(){function t(){}return t.prototype.clone=function(){return this},t}(),M=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),D=function(e){function i(t){var i=e.call(this)||this;return i.pdfColor=t,i}return M(i,e),Object.defineProperty(i.prototype,"color",{get:function(){return this.pdfColor},set:function(t){this.pdfColor=t},enumerable:!0,configurable:!0}),i.prototype.monitorChanges=function(t,e,i,r,n){if(null==e)throw new Error("ArgumentNullException:streamWriter");var o=!1;return o=!0,e.setColorAndSpace(this.pdfColor,n,!1),o},i.prototype.resetChanges=function(e){e.setColorAndSpace(new L(0,0,0),t.PdfColorSpace.Rgb,!1)},i}(R);!function(t){t[t.Regular=0]="Regular",t[t.Bold=1]="Bold",t[t.Italic=2]="Italic",t[t.Underline=4]="Underline",t[t.Strikeout=8]="Strikeout"}(t.PdfFontStyle||(t.PdfFontStyle={})),function(t){t[t.Helvetica=0]="Helvetica",t[t.Courier=1]="Courier",t[t.TimesRoman=2]="TimesRoman",t[t.Symbol=3]="Symbol",t[t.ZapfDingbats=4]="ZapfDingbats"}(t.PdfFontFamily||(t.PdfFontFamily={})),function(t){t[t.Standard=0]="Standard",t[t.TrueType=1]="TrueType",t[t.TrueTypeEmbedded=2]="TrueTypeEmbedded"}(t.PdfFontType||(t.PdfFontType={})),function(t){t[t.None=0]="None",t[t.Word=1]="Word",t[t.WordOnly=2]="WordOnly",t[t.Character=3]="Character"}(t.PdfWordWrapType||(t.PdfWordWrapType={})),function(t){t[t.None=0]="None",t[t.SuperScript=1]="SuperScript",t[t.SubScript=2]="SubScript"}(t.PdfSubSuperScript||(t.PdfSubSuperScript={})),function(t){t[t.Unknown=0]="Unknown",t[t.StandardEncoding=1]="StandardEncoding",t[t.MacRomanEncoding=2]="MacRomanEncoding",t[t.MacExpertEncoding=3]="MacExpertEncoding",t[t.WinAnsiEncoding=4]="WinAnsiEncoding",t[t.PdfDocEncoding=5]="PdfDocEncoding",t[t.IdentityH=6]="IdentityH"}(t.FontEncoding||(t.FontEncoding={})),function(t){t[t.Apple=0]="Apple",t[t.Microsoft=4]="Microsoft",t[t.Trimmed=6]="Trimmed"}(t.TtfCmapFormat||(t.TtfCmapFormat={})),function(t){t[t.Unknown=0]="Unknown",t[t.Symbol=1]="Symbol",t[t.Unicode=2]="Unicode",t[t.Macintosh=3]="Macintosh"}(t.TtfCmapEncoding||(t.TtfCmapEncoding={})),function(t){t[t.AppleUnicode=0]="AppleUnicode",t[t.Macintosh=1]="Macintosh",t[t.Iso=2]="Iso",t[t.Microsoft=3]="Microsoft"}(t.TtfPlatformID||(t.TtfPlatformID={})),function(t){t[t.Undefined=0]="Undefined",t[t.Unicode=1]="Unicode"}(t.TtfMicrosoftEncodingID||(t.TtfMicrosoftEncodingID={})),function(t){t[t.Roman=0]="Roman",t[t.Japanese=1]="Japanese",t[t.Chinese=2]="Chinese"}(t.TtfMacintoshEncodingID||(t.TtfMacintoshEncodingID={})),function(t){t[t.FixedPitch=1]="FixedPitch",t[t.Serif=2]="Serif",t[t.Symbolic=4]="Symbolic",t[t.Script=8]="Script",t[t.Nonsymbolic=32]="Nonsymbolic",t[t.Italic=64]="Italic",t[t.ForceBold=262144]="ForceBold"}(t.FontDescriptorFlags||(t.FontDescriptorFlags={})),function(t){t[t.Arg1And2AreWords=1]="Arg1And2AreWords",t[t.ArgsAreXyValues=2]="ArgsAreXyValues",t[t.RoundXyToGrid=4]="RoundXyToGrid",t[t.WeHaveScale=8]="WeHaveScale",t[t.Reserved=16]="Reserved",t[t.MoreComponents=32]="MoreComponents",t[t.WeHaveAnXyScale=64]="WeHaveAnXyScale",t[t.WeHaveTwoByTwo=128]="WeHaveTwoByTwo",t[t.WeHaveInstructions=256]="WeHaveInstructions",t[t.UseMyMetrics=512]="UseMyMetrics"}(t.TtfCompositeGlyphFlags||(t.TtfCompositeGlyphFlags={}));var N=function(){function e(e,i){this.scalingFactor=100,this.wordWrapType=t.PdfWordWrapType.Word,this.internalLineLimit=!0,this.wordWrapType=t.PdfWordWrapType.Word,void 0!==e&&"string"!=typeof e&&(this.textAlignment=e),void 0!==i&&(this.verticalAlignment=i)}return Object.defineProperty(e.prototype,"alignment",{get:function(){return this.textAlignment},set:function(t){this.textAlignment=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"textDirection",{get:function(){return this.direction},set:function(t){this.direction=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lineAlignment",{get:function(){return void 0===this.verticalAlignment||null==this.verticalAlignment?t.PdfVerticalAlignment.Top:this.verticalAlignment},set:function(t){this.verticalAlignment=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rightToLeft",{get:function(){return void 0!==this.isRightToLeft&&null!=this.isRightToLeft&&this.isRightToLeft},set:function(t){this.isRightToLeft=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"characterSpacing",{get:function(){return void 0===this.internalCharacterSpacing||null==this.internalCharacterSpacing?0:this.internalCharacterSpacing},set:function(t){this.internalCharacterSpacing=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"wordSpacing",{get:function(){return void 0===this.internalWordSpacing||null==this.internalWordSpacing?0:this.internalWordSpacing},set:function(t){this.internalWordSpacing=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lineSpacing",{get:function(){return void 0===this.leading||null==this.leading?0:this.leading},set:function(t){this.leading=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"clipPath",{get:function(){return void 0!==this.clip&&null!=this.clip&&this.clip},set:function(t){this.clip=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"subSuperScript",{get:function(){return void 0===this.pdfSubSuperScript||null==this.pdfSubSuperScript?t.PdfSubSuperScript.None:this.pdfSubSuperScript},set:function(t){this.pdfSubSuperScript=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"paragraphIndent",{get:function(){return void 0===this.internalParagraphIndent||null==this.internalParagraphIndent?0:this.internalParagraphIndent},set:function(t){this.internalParagraphIndent=t,this.firstLineIndent=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lineLimit",{get:function(){return this.internalLineLimit},set:function(t){this.internalLineLimit=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"measureTrailingSpaces",{get:function(){return void 0!==this.trailingSpaces&&null!=this.trailingSpaces&&this.trailingSpaces},set:function(t){this.trailingSpaces=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"noClip",{get:function(){return void 0!==this.isNoClip&&null!=this.isNoClip&&this.isNoClip},set:function(t){this.isNoClip=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"wordWrap",{get:function(){return this.wordWrapType},set:function(t){this.wordWrapType=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"horizontalScalingFactor",{get:function(){return this.scalingFactor},set:function(t){if(t<=0)throw new Error("ArgumentOutOfRangeException:The scaling factor cant be less of equal to zero, ScalingFactor");this.scalingFactor=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"firstLineIndent",{get:function(){return void 0===this.initialLineIndent||null==this.initialLineIndent?0:this.initialLineIndent},set:function(t){this.initialLineIndent=t},enumerable:!0,configurable:!0}),e.prototype.clone=function(){return this},e}(),A=function(){function t(t){if(this.currentPosition=0,null==t)throw new Error("ArgumentNullException:text");this.text=t}return Object.defineProperty(t.prototype,"length",{get:function(){return this.text.length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"end",{get:function(){return this.currentPosition===this.text.length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this.currentPosition},set:function(t){this.currentPosition=t},enumerable:!0,configurable:!0}),t.getCharsCount=function(t,e){if("string"==typeof e){if(null==t)throw new Error("ArgumentNullException:wholeText");for(var i=0,r=0;-1!==(r=t.indexOf(e,r));)i++,r++;return i}if(null==t)throw new Error("ArgumentNullException:text");if(null==e)throw new Error("ArgumentNullException:symbols");for(var n=0,o=0,s=t.length;o<s;o++){var a=t[o];this.contains(e,a)&&n++}return n},t.prototype.readLine=function(){for(var t=this.currentPosition;t<this.length;){var e=this.text[t];switch(e){case"\r":case"\n":var i=this.text.substr(this.currentPosition,t-this.currentPosition);return this.currentPosition=t+1,"\r"===e&&this.currentPosition<this.length&&"\n"===this.text[this.currentPosition]&&this.currentPosition++,i}t++}if(t>this.currentPosition){var r=this.text.substr(this.currentPosition,t-this.currentPosition);return this.currentPosition=t,r}return null},t.prototype.peekLine=function(){var t=this.currentPosition,e=this.readLine();return this.currentPosition=t,e},t.prototype.readWord=function(){for(var t=this.currentPosition;t<this.length;){var e=this.text[t];switch(e){case"\r":case"\n":var i=this.text.substr(this.currentPosition,t-this.currentPosition);return this.currentPosition=t+1,"\r"===e&&this.currentPosition<this.length&&"\n"===this.text[this.currentPosition]&&this.currentPosition++,i;case" ":case"\t":t===this.currentPosition&&t++;var r=this.text.substr(this.currentPosition,t-this.currentPosition);return this.currentPosition=t,r}t++}if(t>this.currentPosition){var n=this.text.substr(this.currentPosition,t-this.currentPosition);return this.currentPosition=t,n}return null},t.prototype.peekWord=function(){var t=this.currentPosition,e=this.readWord();return this.currentPosition=t,e},t.prototype.read=function(t){if(void 0===t){var e="0";return this.end||(e=this.text[this.currentPosition],this.currentPosition++),e}for(var i=0,r="";!this.end&&i<t;){r+=e=this.read(),i++}return r},t.prototype.peek=function(){var t="0";return this.end||(t=this.text[this.currentPosition]),t},t.prototype.close=function(){this.text=null},t.prototype.readToEnd=function(){var t;return t=0===this.currentPosition?this.text:this.text.substr(this.currentPosition,this.length-this.currentPosition),this.currentPosition=this.length,t},t.contains=function(t,e){for(var i=!1,r=0;r<t.length;r++)if(t[r]===e){i=!0;break}return i},t.whiteSpace=" ",t.tab="\t",t.spaces=[t.whiteSpace,t.tab],t.whiteSpacePattern="^[ \t]+$",t}(),I=function(){function e(){this.isOverloadWithPosition=!1}return e.prototype.layout=function(t,e,i,r,n,o,s){if(r instanceof k){this.initialize(t,e,i,r,n),this.isOverloadWithPosition=o,this.clientSize=s;var a=this.doLayout();return this.clear(),a}this.initialize(t,e,i,r),this.isOverloadWithPosition=n,this.clientSize=o;a=this.doLayout();return this.clear(),a},e.prototype.initialize=function(t,e,i,r,n){if("number"==typeof n){if(null==t)throw new Error("ArgumentNullException:text");if(null==e)throw new Error("ArgumentNullException:font");this.text=t,this.font=e,this.format=i,this.size=new j(r.width,r.height),this.rectangle=r,this.pageHeight=n,this.reader=new A(t)}else this.initialize(t,e,i,new k(new T(0,0),r),0)},e.prototype.clear=function(){this.font=null,this.format=null,this.reader.close(),this.reader=null,this.text=null},e.prototype.doLayout=function(){for(var t=new F,e=new F,i=[],r=this.reader.peekLine(),n=this.getLineIndent(!0);null!=r;){if(null!==(e=this.layoutLine(r,n))||void 0!==e){var o=0,s=this.copyToResult(t,e,i,o),a=s.success;if(o=s.numInserted,!a){this.reader.read(o);break}}this.reader.readLine(),r=this.reader.peekLine(),n=this.getLineIndent(!1)}return this.finalizeResult(t,i),t},e.prototype.getLineIndent=function(t){var e=0;return null!=this.format&&(e=t?this.format.firstLineIndent:this.format.paragraphIndent,e=this.size.width>0?Math.min(this.size.width,e):e),e},e.prototype.getLineHeight=function(){var t=this.font.height;return null!=this.format&&0!==this.format.lineSpacing&&(t=this.format.lineSpacing+this.font.height),t},e.prototype.getLineWidth=function(t){return this.font.getLineWidth(t,this.format)},e.prototype.layoutLine=function(e,i){var r=new F;r.layoutLineHeight=this.getLineHeight();var n=[],o=this.size.width,s=this.getLineWidth(e)+i,a=t.LineType.FirstParagraphLine,h=!0;if(o<=0||Math.round(s)<=Math.round(o))this.addToLineResult(r,n,e,s,t.LineType.NewLineBreak|a);else{var l="",u="";s=i;var c=i,p=new A(e),d=p.peekWord();for(d.length!==p.length&&" "===d&&(u+=d,l+=d,p.position+=1,d=p.peekWord());null!=d;){u+=d;var f=this.getLineWidth(u.toString())+c;if(" "===u.toString()&&(u="",f=0),f>o){if(this.getWrapType()===t.PdfWordWrapType.None)break;if(u.length===d.length){if(this.getWrapType()===t.PdfWordWrapType.WordOnly){r.textRemainder=e.substring(p.position);break}if(1===u.length){l+=d;break}h=!1,u="",d=p.peek().toString();continue}if(this.getLineWidth(d.toString())>o?this.format.wordWrap=t.PdfWordWrapType.Character:void 0!==this.format&&null!==this.format&&(this.format.wordWrap=t.PdfWordWrapType.Word),this.getWrapType()===t.PdfWordWrapType.Character&&h)h=!1,u="",u+=l.toString(),d=p.peek().toString();else{" "!==(g=l.toString())&&this.addToLineResult(r,n,g,s,t.LineType.LayoutBreak|a),this.isOverloadWithPosition&&(o=this.clientSize.width),u="",l="",s=0,c=0,f=0,a=t.LineType.None,d=h?d:p.peekWord(),h=!0}}else l+=d,s=f,h?(p.readWord(),d=p.peekWord()):(p.read(),d=p.peek().toString())}if(l.length>0){var g=l.toString();this.addToLineResult(r,n,g,s,t.LineType.NewLineBreak|t.LineType.LastParagraphLine)}p.close()}r.layoutLines=[];for(var m=0;m<n.length;m++)r.layoutLines.push(n[m]);return n=[],r},e.prototype.addToLineResult=function(t,e,i,r,n){var o=new E;o.text=i,o.width=r,o.lineType=n,e.push(o);var s=t.actualSize;s.height+=this.getLineHeight(),s.width=Math.max(s.width,r),t.size=s},e.prototype.copyToResult=function(t,e,i,r){var n=!0,o=null!=this.format&&!this.format.lineLimit,s=t.actualSize.height,a=this.size.height;if(this.pageHeight>0&&a+this.rectangle.y>this.pageHeight&&(a=this.rectangle.y-this.pageHeight,a=Math.max(a,-a)),r=0,null!=e.lines)for(var h=0,l=e.lines.length;h<l;h++){var u=s+e.lineHeight;if(!(u<=a||a<=0||o)){n=!1;break}var c=e.lines[h];r+=c.text.length,c=this.trimLine(c,0===i.length),i.push(c);var p=t.actualSize;p.width=Math.max(p.width,c.width),t.size=p,s=u}if(s!=t.size.height){var d=t.actualSize;d.height=s,t.size=d}return{success:n,numInserted:r}},e.prototype.finalizeResult=function(t,e){t.layoutLines=[];for(var i=0;i<e.length;i++)t.layoutLines.push(e[i]);t.layoutLineHeight=this.getLineHeight(),this.reader.end||(t.textRemainder=this.reader.readToEnd()),e=[]},e.prototype.trimLine=function(e,i){var r=e.text,n=e.width;e.lineType,t.LineType.FirstParagraphLine,null==this.format||this.format.rightToLeft;return(r=r.trim()).length!==e.text.length&&(n=this.getLineWidth(r),(e.lineType&t.LineType.FirstParagraphLine)>0&&(n+=this.getLineIndent(i))),e.text=r,e.width=n,e},e.prototype.getWrapType=function(){return null!=this.format?this.format.wordWrap:t.PdfWordWrapType.Word},e}(),F=function(){function t(){}return Object.defineProperty(t.prototype,"remainder",{get:function(){return this.textRemainder},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"actualSize",{get:function(){return void 0===this.size&&(this.size=new j(0,0)),this.size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"lines",{get:function(){return this.layoutLines},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"lineHeight",{get:function(){return this.layoutLineHeight},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"empty",{get:function(){return null==this.layoutLines||0===this.layoutLines.length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"lineCount",{get:function(){return this.empty?0:this.layoutLines.length},enumerable:!0,configurable:!0}),t}(),E=function(){function t(){}return Object.defineProperty(t.prototype,"lineType",{get:function(){return this.type},set:function(t){this.type=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){return this.content},set:function(t){this.content=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.lineWidth},set:function(t){this.lineWidth=t},enumerable:!0,configurable:!0}),t}();!function(t){t[t.None=0]="None",t[t.NewLineBreak=1]="NewLineBreak",t[t.LayoutBreak=2]="LayoutBreak",t[t.FirstParagraphLine=4]="FirstParagraphLine",t[t.LastParagraphLine=8]="LastParagraphLine"}(t.LineType||(t.LineType={}));var G=function(){function e(e,i){this.fontStyle=t.PdfFontStyle.Regular,"number"==typeof e&&void 0===i?this.fontSize=e:(this.fontSize=e,this.setStyle(i))}return Object.defineProperty(e.prototype,"name",{get:function(){return this.metrics.name},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this.fontSize},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.metrics.getHeight(null)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"style",{get:function(){return this.fontStyle},set:function(t){this.fontStyle=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bold",{get:function(){return(this.style&t.PdfFontStyle.Bold)>0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"italic",{get:function(){return(this.style&t.PdfFontStyle.Italic)>0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"strikeout",{get:function(){return(this.style&t.PdfFontStyle.Strikeout)>0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"underline",{get:function(){return(this.style&t.PdfFontStyle.Underline)>0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"metrics",{get:function(){return this.fontMetrics},set:function(t){this.fontMetrics=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"element",{get:function(){return this.pdfFontInternals},enumerable:!0,configurable:!0}),e.prototype.measureString=function(t,e,i,r,n){if("string"==typeof t&&void 0===e)return this.measureString(t,null);if("string"==typeof t&&(e instanceof N||null==e)&&void 0===i&&void 0===r){var o=e;return this.measureString(t,o,0,0)}if("string"==typeof t&&(e instanceof N||null==e)&&"number"==typeof i&&"number"==typeof r){o=e;return this.measureString(t,0,o,i,r)}if("string"==typeof t&&"number"==typeof e&&(i instanceof N||null==i)&&"number"==typeof r&&"number"==typeof n){var s=new j(e,0),a=i;return this.measureString(t,s,a,r,n)}if(null==t)throw Error('ArgumentNullException("text")');o=e,a=i;var h=(new I).layout(t,this,a,o,!1,new j(0,0));return r=t.length,n=h.empty?0:h.lines.length,h.actualSize},e.prototype.equalsTo=function(t){return this.equalsToFont(t)},e.prototype.getInternals=function(){return this.pdfFontInternals},e.prototype.setInternals=function(t){if(null==t)throw new Error("ArgumentNullException:internals");this.pdfFontInternals=t},e.prototype.setStyle=function(t){this.fontStyle=t},e.prototype.applyFormatSettings=function(t,e,i){var r=i;if(null!=e&&i>0&&(0!==e.characterSpacing&&(r+=(t.length-1)*e.characterSpacing),0!==e.wordSpacing)){var n=A.spaces;r+=A.getCharsCount(t,n)*e.wordSpacing}return r},e.charSizeMultiplier=.001,e.syncObject=new Object,e}(),z=function(){function t(t){this.streamWriter=t}return Object.defineProperty(t.prototype,"document",{get:function(){return this.pdfDocument},set:function(t){this.pdfDocument=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this.streamWriter.buffer.size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"length",{get:function(){return this.streamWriter.buffer.size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"stream",{get:function(){return this.streamWriter},enumerable:!0,configurable:!0}),t.prototype.write=function(t){var e=t;this.streamWriter.write(e)},t}();!function(t){t[t.None=0]="None",t[t.Registered=1]="Registered"}(t.ObjectStatus||(t.ObjectStatus={}));var W=function(){function e(){this.objectCollections=[],this.mainObjectCollection=new n,this.primitiveObjectCollection=new n}return Object.defineProperty(e.prototype,"count",{get:function(){return this.objectCollections.length},enumerable:!0,configurable:!0}),e.prototype.items=function(t){return this.objectCollections[t]},Object.defineProperty(e.prototype,"outIsNew",{get:function(){return this.isNew},enumerable:!0,configurable:!0}),e.prototype.add=function(e){var i=new _(e);this.objectCollections.push(i),this.primitiveObjectCollection.containsKey(e)||this.primitiveObjectCollection.setValue(e,this.objectCollections.length-1),e.position=this.index=this.objectCollections.length-1,e.status=t.ObjectStatus.Registered},e.prototype.lookFor=function(t){var e=-1;if(-1!==t.position)return t.position;if(this.primitiveObjectCollection.containsKey(t)&&this.count===this.primitiveObjectCollection.size())e=this.primitiveObjectCollection.getValue(t);else for(var i=this.count-1;i>=0;i--){if(this.objectCollections[i].object===t){e=i;break}}return e},e.prototype.getReference=function(t,e){this.index=this.lookFor(t);this.isNew=!1;return{reference:this.objectCollections[this.index].reference,wasNew:e}},e.prototype.trySetReference=function(t,e,i){this.index=this.lookFor(t);return this.objectCollections[this.index].setReference(e),!0},e.prototype.destroy=function(){for(var t=0,e=this.objectCollections;t<e.length;t++){var i=e[t];void 0!==i&&(i.pdfObject.position=-1,i.pdfObject.isSaving=void 0,i.pdfObject.objectCollectionIndex=void 0,i.pdfObject.position=void 0)}this.objectCollections=[],this.mainObjectCollection=new n,this.primitiveObjectCollection=new n},e}(),_=function(){function t(t,e){this.pdfObject=t,this.pdfReference=e}return Object.defineProperty(t.prototype,"object",{get:function(){return this.pdfObject},set:function(t){this.pdfObject=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"reference",{get:function(){return this.pdfReference},enumerable:!0,configurable:!0}),t.prototype.setReference=function(t){this.pdfReference=t},t}(),H=function(){function t(t){this.isStreamCopied=!1,t instanceof Be&&(this.document=t)}return Object.defineProperty(t.prototype,"pdfObjects",{get:function(){return this.objects},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"crossTable",{get:function(){return this.pdfCrossTable},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"currentSavingObj",{get:function(){return this.currentSavingObject},set:function(t){this.currentSavingObject=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"catalog",{get:function(){return this.pdfCatalog},set:function(t){this.pdfCatalog=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"viewerPreferences",{get:function(){return this.pdfCatalog.viewerPreferences},enumerable:!0,configurable:!0}),t.prototype.setMainObjectCollection=function(t){this.objects=t},t.prototype.setCrossTable=function(t){this.pdfCrossTable=t},t.prototype.setCatalog=function(t){this.pdfCatalog=t},t.prototype.save=function(t){var e=this,r=new i.Encoding(!0),n=new i.StreamWriter(r);if(void 0===t){var o=new i.Encoding(!0),s=new i.StreamWriter(o);return new Promise(function(t,i){var r={};r.blobData=new Blob([e.document.docSave(s,!0)],{type:"application/pdf"}),t(r)})}this.document.docSave(n,t,!0)},t.prototype.clone=function(){return this.document},t}();!function(t){t[t.Free=0]="Free",t[t.Normal=1]="Normal",t[t.Packed=2]="Packed"}(t.ObjectType||(t.ObjectType={}));var U=function(){function t(t){this.currentPosition=-1,this.value=t}return Object.defineProperty(t.prototype,"status",{get:function(){return this.objectStatus},set:function(t){this.objectStatus=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isSaving",{get:function(){return this.saving},set:function(t){this.saving=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"objectCollectionIndex",{get:function(){return this.index},set:function(t){this.index=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this.currentPosition},set:function(t){this.currentPosition=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"clonedObject",{get:function(){return null},enumerable:!0,configurable:!0}),t.prototype.save=function(t){t.write(this.boolToStr(this.value))},t.prototype.clone=function(e){return new t(this.value)},t.prototype.boolToStr=function(t){return t?"true":"false"},t}(),K=function(){function e(e){this._dictionaryProperties=new a,this._centerWindow=!1,this._fitWindow=!1,this._displayTitle=!1,this._splitWindow=!1,this._hideMenuBar=!1,this._hideToolBar=!1,this._hideWindowUI=!1,this._pageMode=t.PdfPageMode.UseNone,this._pageLayout=t.PdfPageLayout.SinglePage,this._dictionary=new h,this._duplex=t.DuplexMode.None,this._catalog=e}return Object.defineProperty(e.prototype,"centerWindow",{get:function(){return this._centerWindow},set:function(t){this._centerWindow=t,this._dictionary.items.setValue(this._dictionaryProperties.centerWindow,new U(this._centerWindow))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"displayTitle",{get:function(){return this._displayTitle},set:function(t){this._displayTitle=t,this._dictionary.items.setValue(this._dictionaryProperties.displayTitle,new U(this._displayTitle))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fitWindow",{get:function(){return this._fitWindow},set:function(t){this._fitWindow=t,this._dictionary.items.setValue(this._dictionaryProperties.fitWindow,new U(this._fitWindow))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hideMenuBar",{get:function(){return this._hideMenuBar},set:function(t){this._hideMenuBar=t,this._dictionary.items.setValue(this._dictionaryProperties.hideMenuBar,new U(this._hideMenuBar))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hideToolBar",{get:function(){return this._hideToolBar},set:function(t){this._hideToolBar=t,this._dictionary.items.setValue(this._dictionaryProperties.hideToolBar,new U(this._hideToolBar))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hideWindowUI",{get:function(){return this._hideWindowUI},set:function(t){this._hideWindowUI=t,this._dictionary.items.setValue(this._dictionaryProperties.hideWindowUI,new U(this._hideWindowUI))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pageMode",{get:function(){return this._pageMode},set:function(t){this._pageMode=t,this._catalog.items.setValue(this._dictionaryProperties.pageMode,new o(this._mapPageMode(this._pageMode)))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"duplex",{get:function(){return this._duplex},set:function(t){this._duplex=t,this._catalog.items.setValue(this._dictionaryProperties.duplex,new o(this._mapDuplexMode(this._duplex)))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pageLayout",{get:function(){return this._pageLayout},set:function(t){this._pageLayout=t,this._catalog.items.setValue(this._dictionaryProperties.pageLayout,new o(this._mapPageLayout(this._pageLayout)))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pageScaling",{get:function(){return this._pageScaling},set:function(e){this._pageScaling=e,this._pageScaling===t.PageScalingMode.AppDefault&&this._dictionary.items.containsKey(this._dictionaryProperties.printScaling)?this._dictionary.items.remove(this._dictionaryProperties.printScaling):this._pageScaling===t.PageScalingMode.None&&this._dictionary.items.setValue(this._dictionaryProperties.printScaling,new o("None"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"element",{get:function(){return this._dictionary},enumerable:!0,configurable:!0}),e.prototype._mapDuplexMode=function(e){switch(e){case t.DuplexMode.Simplex:return"Simplex";case t.DuplexMode.DuplexFlipShortEdge:return"DuplexFlipShortEdge";case t.DuplexMode.DuplexFlipLongEdge:return"DuplexFlipLongEdge";case t.DuplexMode.None:return"None"}},e.prototype._mapPageMode=function(e){switch(e){case t.PdfPageMode.UseNone:return"UseNone";case t.PdfPageMode.UseOutlines:return"UseOutlines";case t.PdfPageMode.UseThumbs:return"UseThumbs";case t.PdfPageMode.FullScreen:return"FullScreen";case t.PdfPageMode.UseOC:return"UseOC";case t.PdfPageMode.UseAttachments:return"UseAttachments"}},e.prototype._mapPageLayout=function(e){switch(e){case t.PdfPageLayout.SinglePage:return"SinglePage";case t.PdfPageLayout.OneColumn:return"OneColumn";case t.PdfPageLayout.TwoColumnLeft:return"TwoColumnLeft";case t.PdfPageLayout.TwoColumnRight:return"TwoColumnRight";case t.PdfPageLayout.TwoPageLeft:return"TwoPageLeft";case t.PdfPageLayout.TwoPageRight:return"TwoPageRight"}},e}();!function(t){t[t.UseNone=0]="UseNone",t[t.UseOutlines=1]="UseOutlines",t[t.UseThumbs=2]="UseThumbs",t[t.FullScreen=3]="FullScreen",t[t.UseOC=4]="UseOC",t[t.UseAttachments=5]="UseAttachments"}(t.PdfPageMode||(t.PdfPageMode={})),function(t){t[t.SinglePage=0]="SinglePage",t[t.OneColumn=1]="OneColumn",t[t.TwoColumnLeft=2]="TwoColumnLeft",t[t.TwoColumnRight=3]="TwoColumnRight",t[t.TwoPageLeft=4]="TwoPageLeft",t[t.TwoPageRight=5]="TwoPageRight"}(t.PdfPageLayout||(t.PdfPageLayout={})),function(t){t[t.Simplex=0]="Simplex",t[t.DuplexFlipShortEdge=1]="DuplexFlipShortEdge",t[t.DuplexFlipLongEdge=2]="DuplexFlipLongEdge",t[t.None=3]="None"}(t.DuplexMode||(t.DuplexMode={})),function(t){t[t.AppDefault=0]="AppDefault",t[t.None=1]="None"}(t.PageScalingMode||(t.PageScalingMode={}));var q=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Y=function(t){function e(){var e=t.call(this)||this;return e.sections=null,e.tempDictionaryProperties=new a,e.items.setValue((new a).type,new o("Catalog")),e}return q(e,t),Object.defineProperty(e.prototype,"pages",{get:function(){return this.sections},set:function(t){t.element;this.sections=t,this.items.setValue(this.tempDictionaryProperties.pages,new C(t))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"viewerPreferences",{get:function(){return null!==this._viewerPreferences&&void 0!==this._viewerPreferences||(this._viewerPreferences=new K(this),this.items.setValue(this.tempDictionaryProperties.viewerPreferences,new C(this._viewerPreferences.element))),this._viewerPreferences},enumerable:!0,configurable:!0}),e}(h),X=function(){function e(){this.objects=new n,this.maxGenNumIndex=0,this.objectCount=0,this.dictionaryProperties=new a}return Object.defineProperty(e.prototype,"isMerging",{get:function(){return this.merging},set:function(t){this.merging=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"trailer",{get:function(){return null==this.internalTrailer&&(this.internalTrailer=new b),this.internalTrailer},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"document",{get:function(){return this.pdfDocument},set:function(t){this.pdfDocument=t,this.items=this.pdfDocument.pdfObjects},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pdfObjects",{get:function(){return this.items},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"objectCollection",{get:function(){return this.pdfDocument.pdfObjects},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"count",{get:function(){return this.objectCount},set:function(t){this.objectCount=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"nextObjNumber",{get:function(){return this.count=this.count+1,this.count},enumerable:!0,configurable:!0}),e.prototype.save=function(t,e){this.saveHead(t),this.mappedReferences=null,this.objects.clear(),this.markTrailerReferences(),this.saveObjects(t);var i=this.count,r=t.position;this.registerObject(0,new v(0,-1),!0);t.write(s.xref),t.write(s.newLine),this.saveSections(t),this.saveTrailer(t,this.count,0),this.saveTheEndess(t,r),this.count=i;for(var n=0;n<this.objectCollection.count;++n){this.objectCollection.items(n).object.isSaving=!1}if(void 0===e)return t.stream.buffer;t.stream.save(e)},e.prototype.saveTheEndess=function(t,e){t.write(s.newLine+s.startxref+s.newLine),t.write(e.toString()+s.newLine),t.write(s.eof+s.newLine)},e.prototype.saveTrailer=function(t,e,i){t.write(s.trailer+s.newLine);var r=this.trailer;r.items.setValue(this.dictionaryProperties.size,new g(this.objectCount+1)),(r=new h(r)).setEncrypt(!1),r.save(t)},e.prototype.saveSections=function(t){var e=0,i=0;do{i=this.prepareSubsection(e),this.saveSubsection(t,e,i),e+=i}while(0!==i)},e.prototype.saveSubsection=function(e,i,r){if(!(r<=0||i>=this.count)){e.write(i+" "+(r+1)+s.newLine);for(var n=i;n<=i+r;++n){var o=this.objects.getValue(n),a="";a=o.type===t.ObjectType.Free?this.getItem(o.offset,65535,!0):this.getItem(o.offset,o.generation,!1),e.write(a)}}},e.prototype.getItem=function(t,e,i){var r="",n=10-t.toString().length;e<=0&&(e=0);for(var o=5-e.toString().length<=0?0:5-e.toString().length,a=0;a<n;a++)r+="0";r=r+t.toString()+" ";for(a=0;a<o;a++)r+="0";return r=r+e.toString()+" ",r=r+(i?s.f:s.n)+s.newLine},e.prototype.prepareSubsection=function(t){for(var e,i=0,r=this.count,n=0;n<this.document.pdfObjects.count;n++)this.document.pdfObjects.items(n).reference.toString().split(" ");if(t>=r)return i;for(e=t;e<r;++e)break;for(t=e;e<r;++e)++i;return i},e.prototype.markTrailerReferences=function(){this.trailer.items.keys(),this.trailer.items.values()},e.prototype.saveHead=function(t){var e=this.generateFileVersion(t.document);t.write("%PDF-"+e),t.write(s.newLine)},e.prototype.generateFileVersion=function(t){return"1."+4..toString()},e.prototype.getReference=function(t,e){if(void 0===e){return this.getReference(t,!1)}return this.getSubReference(t,e)},e.prototype.getSubReference=function(e,i){var r,n=!1,o=null;if(this.items.count>0&&e.objectCollectionIndex>0&&this.items.count>e.objectCollectionIndex-1){var s=this.document.pdfObjects.getReference(e,r);o=s.reference,r=s.wasNew}if(r=null==o&&e.status!==t.ObjectStatus.Registered,null==o){var a=this.nextObjNumber;o=new v(a,0);if(r){this.document.pdfObjects.add(e),this.document.pdfObjects.trySetReference(e,o,void 0);var h=this.document.pdfObjects.count-1,l=this.document.pdfObjects.objectCollections[h].reference.objNumber,u=this.document.pdfObjects.objectCollections[this.document.pdfObjects.count-1];this.document.pdfObjects.mainObjectCollection.setValue(l,u),e.position=-1}else this.document.pdfObjects.trySetReference(e,o,void 0);e.objectCollectionIndex=o.objNumber,e.status=t.ObjectStatus.None,n=!0}return n||this.bForceNew,o},e.prototype.saveObjects=function(t){for(var e=this.objectCollection,i=0;i<e.count;++i){var r=e.items(i).object;r.isSaving=!0,this.saveIndirectObject(r,t)}},e.prototype.saveIndirectObject=function(t,e){var i=this.getReference(t);t instanceof Y&&this.trailer.items.setValue(this.dictionaryProperties.root,i),this.pdfDocument.currentSavingObj=i;t.getArchive(),this.registerObject(e.position,i),this.doSaveObject(t,i,e)},e.prototype.doSaveObject=function(t,e,i){i.length;i.write(e.objNumber.toString()),i.write(s.whiteSpace),i.write(e.genNumber.toString()),i.write(s.whiteSpace),i.write(s.obj),i.write(s.newLine),t.save(i);i.stream;i.write(s.endObj),i.write(s.newLine)},e.prototype.registerObject=function(t,e,i){"boolean"==typeof i?(this.objects.setValue(e.objNumber,new J(t,e,i)),this.maxGenNumIndex=Math.max(this.maxGenNumIndex,e.genNumber)):void 0===i&&(this.objects.setValue(e.objNumber,new J(t,e)),this.maxGenNumIndex=Math.max(this.maxGenNumIndex,e.genNumber))},e.dereference=function(t){return null!=t&&(t=t.object),t},e}(),J=function(){function e(e,i,r){var n=e;this.offsetNumber=n;var o=i;this.generation=o.genNumber,this.object=o.objNumber,this.type=void 0===r?t.ObjectType.Normal:t.ObjectType.Free}return Object.defineProperty(e.prototype,"objectNumber",{get:function(){return this.object},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"offset",{get:function(){return this.offsetNumber},enumerable:!0,configurable:!0}),e}(),Z=function(){function t(){}return t.letter=new j(612,792),t.note=new j(540,720),t.legal=new j(612,1008),t.a0=new j(2380,3368),t.a1=new j(1684,2380),t.a2=new j(1190,1684),t.a3=new j(842,1190),t.a4=new j(595,842),t.a5=new j(421,595),t.a6=new j(297,421),t.a7=new j(210,297),t.a8=new j(148,210),t.a9=new j(105,148),t.a10=new j(74,105),t.b0=new j(2836,4008),t.b1=new j(2004,2836),t.b2=new j(1418,2004),t.b3=new j(1002,1418),t.b4=new j(709,1002),t.b5=new j(501,709),t.archE=new j(2592,3456),t.archD=new j(1728,2592),t.archC=new j(1296,1728),t.archB=new j(864,1296),t.archA=new j(648,864),t.flsa=new j(612,936),t.halfLetter=new j(396,612),t.letter11x17=new j(792,1224),t.ledger=new j(1224,792),t}();!function(t){t[t.Portrait=0]="Portrait",t[t.Landscape=1]="Landscape"}(t.PdfPageOrientation||(t.PdfPageOrientation={})),function(t){t[t.RotateAngle0=0]="RotateAngle0",t[t.RotateAngle90=1]="RotateAngle90",t[t.RotateAngle180=2]="RotateAngle180",t[t.RotateAngle270=3]="RotateAngle270"}(t.PdfPageRotateAngle||(t.PdfPageRotateAngle={})),function(t){t[t.None=0]="None",t[t.Numeric=1]="Numeric",t[t.LowerLatin=2]="LowerLatin",t[t.LowerRoman=3]="LowerRoman",t[t.UpperLatin=4]="UpperLatin",t[t.UpperRoman=5]="UpperRoman"}(t.PdfNumberStyle||(t.PdfNumberStyle={})),function(t){t[t.None=0]="None",t[t.Bottom=1]="Bottom",t[t.Top=2]="Top",t[t.Left=3]="Left",t[t.Right=4]="Right",t[t.Fill=5]="Fill"}(t.PdfDockStyle||(t.PdfDockStyle={})),function(t){t[t.None=0]="None",t[t.TopLeft=1]="TopLeft",t[t.TopCenter=2]="TopCenter",t[t.TopRight=3]="TopRight",t[t.MiddleLeft=4]="MiddleLeft",t[t.MiddleCenter=5]="MiddleCenter",t[t.MiddleRight=6]="MiddleRight",t[t.BottomLeft=7]="BottomLeft",t[t.BottomCenter=8]="BottomCenter",t[t.BottomRight=9]="BottomRight"}(t.PdfAlignmentStyle||(t.PdfAlignmentStyle={})),function(t){t[t.None=0]="None",t[t.Top=1]="Top",t[t.Bottom=2]="Bottom",t[t.Left=3]="Left",t[t.Right=4]="Right"}(t.TemplateType||(t.TemplateType={}));var $=function(){function t(){this.pdfMargin=40,this.setMargins(this.pdfMargin)}return Object.defineProperty(t.prototype,"left",{get:function(){return this.leftMargin},set:function(t){this.leftMargin=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.topMargin},set:function(t){this.topMargin=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.rightMargin},set:function(t){this.rightMargin=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"bottom",{get:function(){return this.bottomMargin},set:function(t){this.bottomMargin=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"all",{set:function(t){this.setMargins(t)},enumerable:!0,configurable:!0}),t.prototype.setMargins=function(t,e,i,r){void 0===e?this.leftMargin=this.topMargin=this.rightMargin=this.bottomMargin=t:void 0===i?(this.leftMargin=this.rightMargin=t,this.bottomMargin=this.topMargin=e):(this.leftMargin=t,this.topMargin=e,this.rightMargin=i,this.bottomMargin=r)},t.prototype.clone=function(){return this},t}(),Q=function(){function e(e){this.pageMargins=new $,this.pageSize=Z.a4,this.rotateAngle=t.PdfPageRotateAngle.RotateAngle0,this.pageOrientation=t.PdfPageOrientation.Portrait,this.pageOrigin=new T(0,0),this.isRotation=!1,"number"==typeof e&&this.pageMargins.setMargins(e)}return Object.defineProperty(e.prototype,"size",{get:function(){return this.pageSize},set:function(t){this.setSize(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"orientation",{get:function(){return this.pageOrientation},set:function(t){this.pageOrientation!==t&&(this.pageOrientation=t,this.updateSize(t))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"margins",{get:function(){return this.pageMargins},set:function(t){this.pageMargins=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.pageSize.width},set:function(t){this.pageSize.width=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.pageSize.height},set:function(t){this.pageSize.height=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"origin",{get:function(){return this.pageOrigin},set:function(t){this.pageOrigin=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rotate",{get:function(){return this.rotateAngle},set:function(t){this.rotateAngle=t,this.isRotation=!0},enumerable:!0,configurable:!0}),e.prototype.updateSize=function(e){var i=Math.min(this.pageSize.width,this.pageSize.height),r=Math.max(this.pageSize.width,this.pageSize.height);switch(e){case t.PdfPageOrientation.Portrait:this.pageSize=new j(i,r);break;case t.PdfPageOrientation.Landscape:this.pageSize=new j(r,i)}},e.prototype.clone=function(){return this.pageMargins=this.pageMargins.clone(),this},e.prototype.getActualSize=function(){var t=this.width-(this.margins.left+this.margins.right),e=this.height-(this.margins.top+this.margins.bottom);return new j(t,e)},e.prototype.setSize=function(e){var i=Math.min(e.width,e.height),r=Math.max(e.width,e.height);this.orientation===t.PdfPageOrientation.Portrait?this.pageSize=new j(i,r):this.pageSize=new j(r,i)},e}(),tt=function(){function t(t){if(null==t)throw new Error("ArgumentNullException:stream");this.stream=t}return t.prototype.clear=function(){this.stream.clearStream()},t.prototype.setGraphicsState=function(t){t instanceof o?(this.stream.write(t.toString()),this.stream.write(s.whiteSpace),this.writeOperator(s.setGraphicsState)):(this.stream.write(s.slash),this.stream.write(t),this.stream.write(s.whiteSpace),this.writeOperator(s.setGraphicsState))},t.prototype.executeObject=function(t){this.stream.write(t.toString()),this.stream.write(s.whiteSpace),this.writeOperator(s.paintXObject),this.stream.write(s.newLine)},t.prototype.closePath=function(){this.writeOperator(s.closePath)},t.prototype.clipPath=function(t){this.stream.write(s.clipPath),t&&this.stream.write(s.evenOdd),this.stream.write(s.whiteSpace),this.stream.write(s.endPath),this.stream.write(s.newLine)},t.prototype.closeFillStrokePath=function(t){this.stream.write(s.closeFillStrokePath),t?(this.stream.write(s.evenOdd),this.stream.write(s.newLine)):this.stream.write(s.newLine)},t.prototype.fillStrokePath=function(t){this.stream.write(s.fillStroke),t?(this.stream.write(s.evenOdd),this.stream.write(s.newLine)):this.stream.write(s.newLine)},t.prototype.fillPath=function(t){this.stream.write(s.fill),t?(this.stream.write(s.evenOdd),this.stream.write(s.newLine)):this.stream.write(s.newLine)},t.prototype.endPath=function(){this.writeOperator(s.n)},t.prototype.closeFillPath=function(t){this.writeOperator(s.closePath),this.stream.write(s.fill),t?(this.stream.write(s.evenOdd),this.stream.write(s.newLine)):this.stream.write(s.newLine)},t.prototype.closeStrokePath=function(){this.writeOperator(s.closeStrokePath)},t.prototype.setTextScaling=function(t){this.stream.write(g.floatToString(t)),this.stream.write(s.whiteSpace),this.writeOperator(s.setTextScaling)},t.prototype.strokePath=function(){this.writeOperator(s.stroke)},t.prototype.restoreGraphicsState=function(){this.writeOperator(s.restoreState)},t.prototype.saveGraphicsState=function(){this.writeOperator(s.saveState)},t.prototype.startNextLine=function(t,e){void 0===t?this.writeOperator(s.goToNextLine):t instanceof T?(this.writePoint(t),this.writeOperator(s.setCoords)):(this.writePoint(t,e),this.writeOperator(s.setCoords))},t.prototype.showText=function(t){this.checkTextParam(t),this.writeText(t),this.writeOperator(s.setText)},t.prototype.setLeading=function(t){this.stream.write(g.floatToString(t)),this.stream.write(s.whiteSpace),this.writeOperator(s.setTextLeading)},t.prototype.beginPath=function(t,e){this.writePoint(t,e),this.writeOperator(s.beginPath)},t.prototype.beginText=function(){this.writeOperator(s.beginText)},t.prototype.endText=function(){this.writeOperator(s.endText)},t.prototype.appendRectangle=function(t,e,i,r){t instanceof k?this.appendRectangle(t.x,t.y,t.width,t.height):(this.writePoint(t,e),this.writePoint(i,r),this.writeOperator(s.appendRectangle))},t.prototype.appendLineSegment=function(t,e){t instanceof T?this.appendLineSegment(t.x,t.y):(this.writePoint(t,e),this.writeOperator(s.appendLineSegment))},t.prototype.setTextRenderingMode=function(t){this.stream.write(t.toString()),this.stream.write(s.whiteSpace),this.writeOperator(s.setRenderingMode)},t.prototype.setCharacterSpacing=function(t){this.stream.write(g.floatToString(t)),this.stream.write(s.whiteSpace),this.stream.write(s.setCharacterSpace),this.stream.write(s.newLine)},t.prototype.setWordSpacing=function(t){this.stream.write(g.floatToString(t)),this.stream.write(s.whiteSpace),this.writeOperator(s.setWordSpace)},t.prototype.showNextLineText=function(t,e){t instanceof S?(this.checkTextParam(t),this.writeText(t),this.writeOperator(s.setTextOnNewLine)):(this.checkTextParam(t),this.writeText(t,e),this.writeOperator(s.setTextOnNewLine))},t.prototype.setColorSpace=function(t,e){if(t instanceof o&&"boolean"==typeof e){var i=t,r=(n=e)?s.selectcolorspaceforstroking:s.selectcolorspacefornonstroking;this.stream.write(i.toString()),this.stream.write(s.whiteSpace),this.stream.write(r),this.stream.write(s.newLine)}else{i=t;var n=e;this.setColorSpace(new o(i),n)}},t.prototype.modifyCtm=function(t){if(null==t)throw new Error("ArgumentNullException:matrix");this.stream.write(t.toString()),this.stream.write(s.whiteSpace),this.writeOperator(s.modifyCtm)},t.prototype.setFont=function(t,e,i){if("string"==typeof e)this.setFont(t,new o(e),i);else{if(null==t)throw new Error("ArgumentNullException:font");this.stream.write(e.toString()),this.stream.write(s.whiteSpace),this.stream.write(g.floatToString(i)),this.stream.write(s.whiteSpace),this.writeOperator(s.setFont)}},t.prototype.writeOperator=function(t){this.stream.write(t),this.stream.write(s.newLine)},t.prototype.checkTextParam=function(t){if(null==t)throw new Error("ArgumentNullException:text");if("string"==typeof t&&""===t)throw new Error("ArgumentException:The text can not be an empty string, text")},t.prototype.writeText=function(t,e){if(t instanceof S&&void 0===e)this.stream.write(t.pdfEncode());else{var i=void 0,r=void 0;e?(i=S.hexStringMark[0],r=S.hexStringMark[1]):(i=S.stringMark[0],r=S.stringMark[1]),this.stream.write(i),this.stream.write(t),this.stream.write(r)}},t.prototype.writePoint=function(t,e){if(t instanceof T&&void 0===e)this.writePoint(t.x,t.y);else{var i=t;this.stream.write(g.floatToString(i)),this.stream.write(s.whiteSpace),e=this.updateY(e),this.stream.write(g.floatToString(e)),this.stream.write(s.whiteSpace)}},t.prototype.updateY=function(t){return-t},t.prototype.write=function(t){var e="";e+=t,e+=s.newLine,this.writeOperator(e)},t.prototype.writeComment=function(t){if(!(null!=t&&t.length>0))throw new Error("Invalid comment");var e="";e+=s.comment,e+=s.whiteSpace,e+=t,this.writeOperator(e)},t.prototype.setColorAndSpace=function(t,e,i){t.isEmpty||(this.stream.write(t.toString(e,i)),this.stream.write(s.newLine))},t.prototype.setLineDashPattern=function(t,e){this.setLineDashPatternHelper(t,e)},t.prototype.setLineDashPatternHelper=function(t,e){var i="[";if(t.length>1)for(var r=0;r<t.length;r++)r===t.length-1?i+=t[r].toString():i+=t[r].toString()+" ";i+="] ",i+=e.toString(),i+=" "+s.setDashPattern,this.stream.write(i),this.stream.write(s.newLine)},t.prototype.setMiterLimit=function(t){this.stream.write(g.floatToString(t)),this.stream.write(s.whiteSpace),this.writeOperator(s.setMiterLimit)},t.prototype.setLineWidth=function(t){this.stream.write(g.floatToString(t)),this.stream.write(s.whiteSpace),this.writeOperator(s.setLineWidth)},t.prototype.setLineCap=function(t){this.stream.write(t.toString()),this.stream.write(s.whiteSpace),this.writeOperator(s.setLineCapStyle)},t.prototype.setLineJoin=function(t){this.stream.write(t.toString()),this.stream.write(s.whiteSpace),this.writeOperator(s.setLineJoinStyle)},Object.defineProperty(t.prototype,"position",{get:function(){return this.stream.position},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"length",{get:function(){var t=0;if(0!==this.stream.data.length&&-1!==this.stream.data.length)for(var e=0;e<this.stream.data.length;e++)t+=this.stream.data[e].length;return t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"document",{get:function(){return null},enumerable:!0,configurable:!0}),t.prototype.appendBezierSegment=function(t,e,i,r,n,o){t instanceof T&&e instanceof T&&i instanceof T?(this.writePoint(t.x,t.y),this.writePoint(e.x,e.y),this.writePoint(i.x,i.y)):(this.writePoint(t,e),this.writePoint(i,r),this.writePoint(n,o)),this.writeOperator(s.appendbeziercurve)},t.prototype.setColourWithPattern=function(t,e,i){if(null!=t){var r=t.length,n=0;for(n=0;n<r;++n)this.stream.write(t[n].toString()),this.stream.write(s.whiteSpace)}null!=e&&(this.stream.write(e.toString()),this.stream.write(s.whiteSpace)),i?this.writeOperator(s.setColorAndPatternStroking):this.writeOperator(s.setColorAndPattern)},t}(),et=function(){function e(e,i){this.pdfColor=new L(0,0,0),this.dashOffsetValue=0,this.penDashPattern=[0],this.pdfDashStyle=t.PdfDashStyle.Solid,this.pdfLineCap=0,this.pdfLineJoin=0,this.penWidth=1,this.internalMiterLimit=0,this.colorSpace=t.PdfColorSpace.Rgb,e instanceof R?this.setBrush(e):e instanceof L&&(this.color=e),"number"==typeof i&&(this.width=i)}return Object.defineProperty(e.prototype,"color",{get:function(){return this.pdfColor},set:function(t){this.pdfColor=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dashOffset",{get:function(){return void 0===this.dashOffsetValue||null==this.dashOffsetValue?0:this.dashOffsetValue},set:function(t){this.dashOffsetValue=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dashPattern",{get:function(){return this.penDashPattern},set:function(t){this.penDashPattern=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dashStyle",{get:function(){return this.pdfDashStyle},set:function(e){if(this.pdfDashStyle!==e)switch(this.pdfDashStyle=e,this.pdfDashStyle){case t.PdfDashStyle.Custom:break;case t.PdfDashStyle.Dash:this.penDashPattern=[3,1];break;case t.PdfDashStyle.Dot:this.penDashPattern=[1,1];break;case t.PdfDashStyle.DashDot:this.penDashPattern=[3,1,1,1];break;case t.PdfDashStyle.DashDotDot:this.penDashPattern=[3,1,1,1,1,1];break;case t.PdfDashStyle.Solid:break;default:this.pdfDashStyle=t.PdfDashStyle.Solid,this.penDashPattern=[0]}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lineCap",{get:function(){return this.pdfLineCap},set:function(t){this.pdfLineCap=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lineJoin",{get:function(){return this.pdfLineJoin},set:function(t){this.pdfLineJoin=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"miterLimit",{get:function(){return this.internalMiterLimit},set:function(t){this.internalMiterLimit=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.penWidth},set:function(t){this.penWidth=t},enumerable:!0,configurable:!0}),e.prototype.clone=function(){return this},e.prototype.setBrush=function(t){var e=t;null!=e&&e instanceof D&&(this.color=e.color,this.pdfBrush=e),this.color=e.color,this.pdfBrush=e},e.prototype.monitorChanges=function(t,e,i,r,n,o){r=!0,this.dashControl(t,r,e),e.setLineWidth(this.width),e.setLineJoin(this.lineJoin),e.setLineCap(this.lineCap);var s=this.miterLimit;s>0&&e.setMiterLimit(s);this.pdfBrush;return e.setColorAndSpace(this.color,n,!0),!0},e.prototype.dashControl=function(t,e,i){e=!0;var r=this.width,n=this.getPattern();return i.setLineDashPattern(n,this.dashOffset*r),e},e.prototype.getPattern=function(){for(var t=this.dashPattern,e=0;e<t.length;++e)t[e]*=this.width;return t},e}(),it=function(){function t(t){this.radDegFactor=180/Math.PI,this.transformationMatrix=new rt(1,0,0,void 0===t?1:-1,0,0)}return Object.defineProperty(t.prototype,"matrix",{get:function(){return this.transformationMatrix},set:function(t){this.transformationMatrix=t},enumerable:!0,configurable:!0}),t.prototype.translate=function(t,e){this.transformationMatrix.translate(t,e)},t.prototype.scale=function(t,e){this.transformationMatrix.elements[0]=t,this.transformationMatrix.elements[3]=e},t.prototype.rotate=function(t){t=t*Math.PI/180,this.transformationMatrix.elements[0]=Math.cos(t),this.transformationMatrix.elements[1]=Math.sin(t),this.transformationMatrix.elements[2]=-Math.sin(t),this.transformationMatrix.elements[3]=Math.cos(t)},t.prototype.toString=function(){for(var t="",e=0,i=this.transformationMatrix.elements.length;e<i;e++){this.matrix.elements[e];t+=g.floatToString(this.transformationMatrix.elements[e]),t+=" "}return t},t.prototype.multiply=function(t){this.transformationMatrix.multiply(t.matrix)},t.degreesToRadians=function(t){return this.degRadFactor*t},t.prototype.radiansToDegrees=function(t){return this.radDegFactor*t},t.prototype.clone=function(){return this},t.degRadFactor=Math.PI/180,t}(),rt=function(){function t(t,e,i,r,n,o){void 0===t?this.metrixElements=[]:"number"==typeof t?(this.metrixElements=[],this.metrixElements.push(t),this.metrixElements.push(e),this.metrixElements.push(i),this.metrixElements.push(r),this.metrixElements.push(n),this.metrixElements.push(o)):this.metrixElements=t}return Object.defineProperty(t.prototype,"elements",{get:function(){return this.metrixElements},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"offsetX",{get:function(){return this.metrixElements[4]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"offsetY",{get:function(){return this.metrixElements[5]},enumerable:!0,configurable:!0}),t.prototype.translate=function(t,e){this.metrixElements[4]=t,this.metrixElements[5]=e},t.prototype.transform=function(t){var e=t.x,i=t.y,r=e*this.elements[0]+i*this.elements[2]+this.offsetX,n=e*this.elements[1]+i*this.elements[3]+this.offsetY;return new T(r,n)},t.prototype.multiply=function(t){var e=[];e.push(this.elements[0]*t.elements[0]+this.elements[1]*t.elements[2]),e[1]=this.elements[0]*t.elements[1]+this.elements[1]*t.elements[3],e[2]=this.elements[2]*t.elements[0]+this.elements[3]*t.elements[2],e[3]=this.elements[2]*t.elements[1]+this.elements[3]*t.elements[3],e[4]=this.offsetX*t.elements[0]+this.offsetY*t.elements[2]+t.offsetX,e[5]=this.offsetX*t.elements[1]+this.offsetY*t.elements[3]+t.offsetY;for(var i=0;i<e.length;i++)this.elements[i]=e[i]},t.prototype.dispose=function(){this.metrixElements=null},t.prototype.clone=function(){return new t(this.metrixElements)},t}(),nt=function(){return function(){this.pdf="PDF",this.text="Text",this.imageB="ImageB",this.imageC="ImageC",this.imageI="ImageI"}}(),ot=function(){function t(){this.mKeys=[],this.mValues=[]}return t.prototype.size=function(){return this.mKeys.length},t.prototype.add=function(t,e){if(void 0===t||null===t||void 0===e||null===e)throw new ReferenceError("Provided key or value is not valid.");if(this.mKeys.indexOf(t)<0)return this.mKeys.push(t),this.mValues.push(e),1;throw new RangeError("An item with the same key has already been added.")},t.prototype.keys=function(){return this.mKeys},t.prototype.values=function(){return this.mValues},t.prototype.getValue=function(t){if(void 0===t||null===t)throw new ReferenceError("Provided key is not valid.");var e=this.mKeys.indexOf(t);if(e<0)throw new RangeError("No item with the specified key has been added.");return this.mValues[e]},t.prototype.setValue=function(t,e){if(void 0===t||null===t)throw new ReferenceError("Provided key is not valid.");var i=this.mKeys.indexOf(t);i<0?(this.mKeys.push(t),this.mValues.push(e)):this.mValues[i]=e},t.prototype.remove=function(t){if(void 0===t||null===t)throw new ReferenceError("Provided key is not valid.");var e=this.mKeys.indexOf(t);if(e<0)throw new RangeError("No item with the specified key has been added.");return this.mKeys.splice(e,1),this.mValues.splice(e,1),!0},t.prototype.containsKey=function(t){if(void 0===t||null===t)throw new ReferenceError("Provided key is not valid.");return!(this.mKeys.indexOf(t)<0)},t.prototype.clear=function(){this.mKeys=[],this.mValues=[]},t}(),st=function(){function t(t,e,i){this.dictionary=new h,this.dictionaryProperties=new a,this.dictionary.items.setValue(this.dictionaryProperties.CA,new g(t)),this.dictionary.items.setValue(this.dictionaryProperties.ca,new g(e)),this.dictionary.items.setValue(this.dictionaryProperties.BM,new o(i.toString()))}return Object.defineProperty(t.prototype,"element",{get:function(){return this.dictionary},enumerable:!0,configurable:!0}),t}(),at=function(){function t(){this.automaticFieldsInformation=[]}return Object.defineProperty(t.prototype,"automaticFields",{get:function(){return this.automaticFieldsInformation},enumerable:!0,configurable:!0}),t.prototype.add=function(t){return this.automaticFields.push(t)},t}(),ht=function(){function t(){}return t.prototype.drawHelper=function(t,e,i){var r=0!==e||0!==i,n=null;r&&(n=t.save(),t.translateTransform(e,i)),this.drawInternal(t),r&&t.restore(n)},t}(),lt=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ut=function(t){function e(){var e=t.call(this)||this;return e.internalBounds=new k(0,0,0,0),e.internalTemplateSize=new j(0,0),e}return lt(e,t),Object.defineProperty(e.prototype,"bounds",{get:function(){return this.internalBounds},set:function(t){this.internalBounds=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return new j(this.bounds.width,this.bounds.height)},set:function(t){this.bounds.width=t.width,this.bounds.height=t.height},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"location",{get:function(){return new T(this.bounds.x,this.bounds.y)},set:function(t){this.bounds.x=t.x,this.bounds.y=t.y},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"font",{get:function(){return this.internalFont},set:function(t){this.internalFont=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"brush",{get:function(){return this.internalBrush},set:function(t){this.internalBrush=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pen",{get:function(){return this.internalPen},set:function(t){this.internalPen=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"stringFormat",{get:function(){return this.internalStringFormat},set:function(t){this.internalStringFormat=t},enumerable:!0,configurable:!0}),e.prototype.performDrawHelper=function(t,e,i,r){if(0===this.bounds.height||0===this.bounds.width){var n=this.getValue(t);this.internalTemplateSize=this.getFont().measureString(n,this.size,this.stringFormat)}},e.prototype.draw=function(t,e,i){if(void 0===e){var r=new T(0,0);this.draw(t,r)}else if(e instanceof T)this.draw(t,e.x,e.y);else{this.drawHelper(t,e,i);var n=new ct(this,new T(e,i));t.automaticFields.add(n)}},e.prototype.getSize=function(){return 0===this.bounds.height||0===this.bounds.width?this.internalTemplateSize:this.size},e.prototype.drawInternal=function(t){},e.prototype.getBrush=function(){return void 0===this.internalBrush||null==this.internalBrush?new D(new L(0,0,0)):this.internalBrush},e.prototype.getFont=function(){return void 0===this.internalFont||null==this.internalFont?Be.defaultFont:this.internalFont},e.prototype.getPageFromGraphics=function(t){if(void 0!==t.page&&null!==t.page){return t.page}return t.currentPage},e}(ht),ct=function(){function t(e,i,r,n){this.pageNumberFieldLocation=new T,this.pageNumberField=null,this.scaleX=1,this.scaleY=1,void 0===i&&e instanceof t?(this.pageNumberField=e.field,this.pageNumberFieldLocation=e.location,this.scaleX=e.scalingX,this.scaleY=e.scalingY):void 0===r&&i instanceof T&&e instanceof ut?(this.pageNumberField=e,this.pageNumberFieldLocation=i):(this.pageNumberField=e,this.pageNumberFieldLocation=i,this.scaleX=r,this.scaleY=n)}return Object.defineProperty(t.prototype,"location",{get:function(){return this.pageNumberFieldLocation},set:function(t){this.pageNumberFieldLocation=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"field",{get:function(){return this.pageNumberField},set:function(t){this.pageNumberField=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"scalingX",{get:function(){return this.scaleX},set:function(t){this.scaleX=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"scalingY",{get:function(){return this.scaleY},set:function(t){this.scaleY=t},enumerable:!0,configurable:!0}),t}(),pt=function(){function t(t){this.mPosition=0,this.buffer=new Uint8Array(t),this.dataView=new DataView(this.buffer.buffer)}return Object.defineProperty(t.prototype,"position",{get:function(){return this.mPosition},set:function(t){this.mPosition=t},enumerable:!0,configurable:!0}),t.prototype.read=function(t,e,i){for(var r=e;r<i;r++){var n=this.position;t.buffer[r]=this.readByte(n),this.position++}},t.prototype.getBuffer=function(t){return this.buffer[t]},t.prototype.writeFromBase64String=function(t){var e=this.encodedString(t);this.buffer=e},t.prototype.encodedString=function(t){var e,i,r,n,o,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,h=0,l=3*(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length/4;t.charAt(t.length-1)===s.charAt(64)&&l--;for(var u=new Uint8Array(0|l);a<t.length;)e=s.indexOf(t.charAt(a++))<<2|(n=s.indexOf(t.charAt(a++)))>>4,i=(15&n)<<4|(o=s.indexOf(t.charAt(a++)))>>2,r=(3&o)<<6|s.indexOf(t.charAt(a++)),u[h++]=e,u[h++]=i,u[h++]=r;return u},t.prototype.readByte=function(t){return this.buffer[t]},Object.defineProperty(t.prototype,"internalBuffer",{get:function(){return this.buffer},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"count",{get:function(){return this.buffer.byteLength},enumerable:!0,configurable:!0}),t.prototype.readNextTwoBytes=function(t){var e=t.readByte(this.position);return this.position++,e<<=8,e|=t.readByte(this.position),this.position++,e},t}();!function(t){t[t.Unknown=0]="Unknown",t[t.Bmp=1]="Bmp",t[t.Emf=2]="Emf",t[t.Gif=3]="Gif",t[t.Jpeg=4]="Jpeg",t[t.Png=5]="Png",t[t.Wmf=6]="Wmf",t[t.Icon=7]="Icon"}(t.ImageFormat||(t.ImageFormat={}));var dt=function(){function e(e){this.sof1Marker=193,this.sof2Marker=194,this.sof3Marker=195,this.sof5Marker=197,this.sof6Marker=198,this.sof7Marker=199,this.sof9Marker=201,this.sof10Marker=202,this.sof11Marker=203,this.sof13Marker=205,this.sof14Marker=206,this.sof15Marker=207,this.mFormat=t.ImageFormat.Unknown,this.mbitsPerComponent=8,this.dictionaryProperties=new a,this.mStream=e,this.initialize()}return Object.defineProperty(e.prototype,"height",{get:function(){return this.mHeight},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.mWidth},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bitsPerComponent",{get:function(){return this.mbitsPerComponent},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this.mImageData.count},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"imageData",{get:function(){return this.mImageData},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"imageDataAsNumberArray",{get:function(){return this.mImageData.internalBuffer.buffer},enumerable:!0,configurable:!0}),e.prototype.initialize=function(){if(this.mFormat!==t.ImageFormat.Unknown||!this.checkIfJpeg())throw new TypeError("Only the JPEG format is supported");this.mFormat=t.ImageFormat.Jpeg,this.parseJpegImage(),this.reset(),this.mImageData=new pt(this.mStream.count),this.mStream.read(this.mImageData,0,this.mImageData.count)},e.prototype.reset=function(){this.mStream.position=0},e.prototype.parseJpegImage=function(){this.reset();var t=new pt(this.mStream.count);this.mStream.read(t,0,t.count);for(var e=4,i=!1,r=256*t.getBuffer(e)+t.getBuffer(e+1);e<t.count;){if(!((e+=r)<t.count)){i=!0;break}if(192===t.getBuffer(e+1))return this.mHeight=256*t.getBuffer(e+5)+t.getBuffer(e+6),void(this.mWidth=256*t.getBuffer(e+7)+t.getBuffer(e+8));e+=2,r=256*t.getBuffer(e)+t.getBuffer(e+1)}i&&(this.mStream.position=0,this.skip(this.mStream,2),this.readExceededJPGImage(this.mStream))},Object.defineProperty(e.prototype,"format",{get:function(){return this.mFormat},enumerable:!0,configurable:!0}),e.prototype.checkIfJpeg=function(){this.reset();for(var t=0;t<e.mJpegHeader.length;t++){if(e.mJpegHeader[t]!==this.mStream.readByte(t))return!1;this.mStream.position++}return!0},e.prototype.getImageDictionary=function(){if(this.mFormat===t.ImageFormat.Jpeg){this.imageData.internalBuffer.length;this.imageStream=new b,this.imageStream.isResource=!0;for(var e="",i="",r=0;r<this.imageDataAsNumberArray.byteLength;r++)e+=String.fromCharCode(null,this.mStream.readByte(r));for(r=0;r<e.length;r++)r%2!=0&&(i+=e[r]);return this.imageStream.data=[i],this.imageStream.compress=!1,this.imageStream.items.setValue(this.dictionaryProperties.type,new o(this.dictionaryProperties.xObject)),this.imageStream.items.setValue(this.dictionaryProperties.subtype,new o(this.dictionaryProperties.image)),this.imageStream.items.setValue(this.dictionaryProperties.width,new g(this.width)),this.imageStream.items.setValue(this.dictionaryProperties.height,new g(this.height)),this.imageStream.items.setValue(this.dictionaryProperties.bitsPerComponent,new g(this.bitsPerComponent)),this.imageStream.items.setValue(this.dictionaryProperties.filter,new o(this.dictionaryProperties.dctdecode)),this.imageStream.items.setValue(this.dictionaryProperties.colorSpace,new o(this.getColorSpace())),this.imageStream.items.setValue(this.dictionaryProperties.decodeParms,this.getDecodeParams()),this.imageStream}return this.imageStream},e.prototype.getColorSpace=function(){return this.dictionaryProperties.deviceRgb},e.prototype.getDecodeParams=function(){var t=new h;return t.items.setValue(this.dictionaryProperties.columns,new g(this.width)),t.items.setValue(this.dictionaryProperties.blackIs1,new U(!0)),t.items.setValue(this.dictionaryProperties.k,new g(-1)),t.items.setValue(this.dictionaryProperties.predictor,new g(15)),t.items.setValue(this.dictionaryProperties.bitsPerComponent,new g(this.bitsPerComponent)),t},e.prototype.readExceededJPGImage=function(t){this.mStream=t;for(var e=!0;e;){switch(this.getMarker(t)){case this.sof1Marker:case this.sof2Marker:case this.sof3Marker:case this.sof5Marker:case this.sof6Marker:case this.sof7Marker:case this.sof9Marker:case this.sof10Marker:case this.sof11Marker:case this.sof13Marker:case this.sof14Marker:case this.sof15Marker:t.position+=3,this.mHeight=this.mStream.readNextTwoBytes(t),this.mWidth=this.mStream.readNextTwoBytes(t),e=!1;break;default:this.skipStream(t)}}},e.prototype.skip=function(t,e){this.mStream=t;var i=new pt(e);this.mStream.read(i,0,i.count)},e.prototype.getMarker=function(t){var e=32;for(e=t.readByte(this.mStream.position),t.position++;255!==e;)e=t.readByte(this.mStream.position),t.position++;do{e=t.readByte(this.mStream.position),t.position++}while(255===e);return e},e.prototype.skipStream=function(t){var e=this.mStream.readNextTwoBytes(t)-2;e>0&&(t.position+=e)},e.mPngHeader=[137,80,78,71,13,10,26,10],e.mJpegHeader=[255,216],e.GIF_HEADER="G,I,F,8",e.BMP_HEADER="B,M",e}(),ft=function(){function t(t){this.updateProportionsHelper(t)}return t.prototype.convertUnits=function(t,e,i){return this.convertFromPixels(this.convertToPixels(t,e),i)},t.prototype.convertToPixels=function(t,e){var i=e;return t*this.proportions[i]},t.prototype.convertFromPixels=function(t,e){var i=e;return t/this.proportions[i]},t.prototype.updateProportionsHelper=function(t){this.proportions=[t/2.54,t/6,1,t/72,t,t/300,t/25.4]},t.horizontalResolution=96,t.verticalResolution=96,t}(),gt=function(){function e(){}return Object.defineProperty(e.prototype,"width",{get:function(){return this.imageWidth},set:function(t){this.imageWidth=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.imageHeight},set:function(t){this.imageHeight=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{set:function(t){this.width=t.width,this.height=t.height},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"physicalDimension",{get:function(){return this.imagePhysicalDimension=this.getPointSize(this.width,this.height,this.horizontalResolution,this.verticalResolution),new j(this.width,this.height)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"element",{get:function(){return this.imageStream},enumerable:!0,configurable:!0}),e.prototype.getPointSize=function(e,i,r,n){if(void 0===r){var o=ft.horizontalResolution,s=ft.verticalResolution;return this.getPointSize(e,i,o,s)}var a=new ft(r),h=new ft(n),l=a.convertUnits(e,t.PdfGraphicsUnit.Pixel,t.PdfGraphicsUnit.Point),u=h.convertUnits(i,t.PdfGraphicsUnit.Pixel,t.PdfGraphicsUnit.Point);return new j(l,u)},e}(),mt=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),yt=function(t){function e(e){var i=t.call(this)||this;return i.imageStatus=!0,i.dictionaryProperties=new a,i.loadImage(e),i}return mt(e,t),e.prototype.loadImage=function(t){this.initializeAsync(t)},e.prototype.initializeAsync=function(t){var e=new pt(t.length);e.writeFromBase64String(t),this.decoder=new dt(e),this.height=this.decoder.height,this.width=this.decoder.width,this.bitsPerComponent=this.decoder.bitsPerComponent},e.prototype.save=function(){this.imageStatus=!0,this.imageStream=this.decoder.getImageDictionary()},e}(gt),bt=function(){function t(){}return Object.defineProperty(t.prototype,"empty",{get:function(){return this.offset===this.length&&this.length===this.checksum&&0===this.checksum},enumerable:!0,configurable:!0}),t}(),wt=function(){return function(){}}(),Pt=function(){return function(){}}(),St=function(){return function(){}}(),vt=function(){function t(){}return Object.defineProperty(t.prototype,"isItalic",{get:function(){return 0!=(2&this.macStyle)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isBold",{get:function(){return 0!=(1&this.macStyle)},enumerable:!0,configurable:!0}),t}(),Ct=function(){return function(){}}(),Bt=function(){return function(){}}(),Ot=function(){return function(){}}(),xt=function(){return function(){}}(),Lt=function(){return function(){}}(),Tt=function(){return function(){}}(),jt=function(){function t(){}return Object.defineProperty(t.prototype,"empty",{get:function(){return this.index===this.width&&this.width===this.charCode&&0===this.charCode},enumerable:!0,configurable:!0}),t.prototype.compareTo=function(t){var e=t;return this.index-e.index},t}(),kt=function(){return function(){}}(),Vt=function(){return function(){}}(),Rt=function(){return function(){}}(),Mt=function(){return function(){}}(),Dt=function(){return function(){}}(),Nt=function(){function t(t){this.int32Size=4,this.int16Size=2,this.int64Size=8,this.bufferLength=t,this.buffer=[]}return Object.defineProperty(t.prototype,"data",{get:function(){if(this.buffer.length<this.bufferLength)for(var t=this.bufferLength-this.buffer.length,e=0;e<t;e++)this.buffer.push(0);return this.buffer},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return void 0!==this.internalPosition&&null!==this.internalPosition||(this.internalPosition=0),this.internalPosition},enumerable:!0,configurable:!0}),t.prototype.writeShort=function(t){var e=[(65280&t)>>8,255&t];this.flush(e)},t.prototype.writeInt=function(t){var e=[(4278190080&t)>>24,(16711680&t)>>16,(65280&t)>>8,255&t];this.flush(e)},t.prototype.writeUInt=function(t){var e=[(4278190080&t)>>24,(16711680&t)>>16,(65280&t)>>8,255&t];this.flush(e)},t.prototype.writeString=function(t){if(null==t)throw new Error("Argument Null Exception : value");for(var e=[],i=0;i<t.length;i++)e.push(t.charCodeAt(i));this.flush(e)},t.prototype.writeBytes=function(t){this.flush(t)},t.prototype.flush=function(t){if(null===t)throw new Error("Argument Null Exception : buff");for(var e=this.position,i=0;i<t.length;i++)this.buffer[e]=t[i],e++;this.internalPosition+=t.length},t}(),At=function(){function e(t){this.int32Size=4,this.isTtcFont=!1,this.isMacTtf=!1,this.metricsName="",this.isMacTTF=!1,this.missedGlyphs=0,this.tableNames=["cvt ","fpgm","glyf","head","hhea","hmtx","loca","maxp","prep"],this.entrySelectors=[0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4],this.fontData=t,this.initialize()}return Object.defineProperty(e.prototype,"macintosh",{get:function(){return null!==this.macintoshDictionary&&void 0!==this.macintoshDictionary||(this.macintoshDictionary=new n),this.macintoshDictionary},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"microsoft",{get:function(){return null!==this.microsoftDictionary&&void 0!==this.microsoftDictionary||(this.microsoftDictionary=new n),this.microsoftDictionary},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"macintoshGlyphs",{get:function(){return null!==this.internalMacintoshGlyphs&&void 0!==this.internalMacintoshGlyphs||(this.internalMacintoshGlyphs=new n),this.internalMacintoshGlyphs},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"microsoftGlyphs",{get:function(){return null!==this.internalMicrosoftGlyphs&&void 0!==this.internalMicrosoftGlyphs||(this.internalMicrosoftGlyphs=new n),this.internalMicrosoftGlyphs},enumerable:!0,configurable:!0}),e.prototype.initialize=function(){void 0===this.metrics&&(this.metrics=new vt),this.readFontDictionary();var t=this.readNameTable(),e=this.readHeadTable();this.initializeFontName(t),this.metrics.macStyle=e.macStyle},e.prototype.readFontDictionary=function(){this.offset=0;this.checkPreambula();var t=this.readInt16(this.offset);this.readInt16(this.offset),this.readInt16(this.offset),this.readInt16(this.offset);void 0===this.tableDirectory&&(this.tableDirectory=new n);for(var e=0;e<t;++e){var i=new bt,r=this.readString(this.int32Size);i.checksum=this.readInt32(this.offset),i.offset=this.readInt32(this.offset),i.length=this.readInt32(this.offset),this.tableDirectory.setValue(r,i)}this.lowestPosition=this.offset,this.isTtcFont||this.fixOffsets()},e.prototype.fixOffsets=function(){for(var t=Number.MAX_VALUE,e=this.tableDirectory.keys(),i=0;i<e.length;i++){var r=(a=this.tableDirectory.getValue(e[i])).offset;if(t>r&&(t=r)<=this.lowestPosition)break}var o=t-this.lowestPosition;if(0!==o){var s=new n;for(i=0;i<e.length;i++){var a;(a=this.tableDirectory.getValue(e[i])).offset-=o,s.setValue(e[i],a)}this.tableDirectory=s}},e.prototype.checkPreambula=function(){var t=this.readInt32(this.offset);if(this.isMacTtf=1953658213===t,65536!==t&&1953658213!==t&&1330926671!==t){this.isTtcFont=!0,this.offset=0;if("ttcf"!==this.readString(4))throw new Error("Can not read TTF font data");this.offset+=4;if(this.readInt32(this.offset)<0)throw new Error("Can not read TTF font data");this.offset=this.readInt32(this.offset),t=this.readInt32(this.offset)}return t},e.prototype.readNameTable=function(){var t=this.getTable("name");this.offset=t.offset;var e=new wt;e.formatSelector=this.readUInt16(this.offset),e.recordsCount=this.readUInt16(this.offset),e.offset=this.readUInt16(this.offset),e.nameRecords=[];for(var i=this.offset,r=0;r<e.recordsCount;r++){this.offset=i;var n=new Pt;n.platformID=this.readUInt16(this.offset),n.encodingID=this.readUInt16(this.offset),n.languageID=this.readUInt16(this.offset),n.nameID=this.readUInt16(this.offset),n.length=this.readUInt16(this.offset),n.offset=this.readUInt16(this.offset),this.offset=t.offset+e.offset+n.offset;var o=0===n.platformID||3===n.platformID;n.name=this.readString(n.length,o),e.nameRecords[r]=n,i+=12}return e},e.prototype.readHeadTable=function(){var t=this.getTable("head");this.offset=t.offset;var e=new St;return e.version=this.readFixed(this.offset),e.fontRevision=this.readFixed(this.offset),e.checkSumAdjustment=this.readUInt32(this.offset),e.magicNumber=this.readUInt32(this.offset),e.flags=this.readUInt16(this.offset),e.unitsPerEm=this.readUInt16(this.offset),e.created=this.readInt64(this.offset),e.modified=this.readInt64(this.offset),e.xMin=this.readInt16(this.offset),e.yMin=this.readInt16(this.offset),e.xMax=this.readInt16(this.offset),e.yMax=this.readInt16(this.offset),e.macStyle=this.readUInt16(this.offset),e.lowestReadableSize=this.readUInt16(this.offset),e.fontDirectionHint=this.readInt16(this.offset),e.indexToLocalFormat=this.readInt16(this.offset),e.glyphDataFormat=this.readInt16(this.offset),e},e.prototype.readHorizontalHeaderTable=function(){var t=this.getTable("hhea");this.offset=t.offset;var e=new Ct;return e.version=this.readFixed(this.offset),e.ascender=this.readInt16(this.offset),e.descender=this.readInt16(this.offset),e.lineGap=this.readInt16(this.offset),e.advanceWidthMax=this.readUInt16(this.offset),e.minLeftSideBearing=this.readInt16(this.offset),e.minRightSideBearing=this.readInt16(this.offset),e.xMaxExtent=this.readInt16(this.offset),e.caretSlopeRise=this.readInt16(this.offset),e.caretSlopeRun=this.readInt16(this.offset),this.offset+=10,e.metricDataFormat=this.readInt16(this.offset),e.numberOfHMetrics=this.readUInt16(this.offset),e},e.prototype.readOS2Table=function(){var t=this.getTable("OS/2");this.offset=t.offset;var e=new Bt;return e.version=this.readUInt16(this.offset),e.xAvgCharWidth=this.readInt16(this.offset),e.usWeightClass=this.readUInt16(this.offset),e.usWidthClass=this.readUInt16(this.offset),e.fsType=this.readInt16(this.offset),e.ySubscriptXSize=this.readInt16(this.offset),e.ySubscriptYSize=this.readInt16(this.offset),e.ySubscriptXOffset=this.readInt16(this.offset),e.ySubscriptYOffset=this.readInt16(this.offset),e.ySuperscriptXSize=this.readInt16(this.offset),e.ySuperscriptYSize=this.readInt16(this.offset),e.ySuperscriptXOffset=this.readInt16(this.offset),e.ySuperscriptYOffset=this.readInt16(this.offset),e.yStrikeoutSize=this.readInt16(this.offset),e.yStrikeoutPosition=this.readInt16(this.offset),e.sFamilyClass=this.readInt16(this.offset),e.panose=this.readBytes(10),e.ulUnicodeRange1=this.readUInt32(this.offset),e.ulUnicodeRange2=this.readUInt32(this.offset),e.ulUnicodeRange3=this.readUInt32(this.offset),e.ulUnicodeRange4=this.readUInt32(this.offset),e.vendorIdentifier=this.readBytes(4),e.fsSelection=this.readUInt16(this.offset),e.usFirstCharIndex=this.readUInt16(this.offset),e.usLastCharIndex=this.readUInt16(this.offset),e.sTypoAscender=this.readInt16(this.offset),e.sTypoDescender=this.readInt16(this.offset),e.sTypoLineGap=this.readInt16(this.offset),e.usWinAscent=this.readUInt16(this.offset),e.usWinDescent=this.readUInt16(this.offset),e.ulCodePageRange1=this.readUInt32(this.offset),e.ulCodePageRange2=this.readUInt32(this.offset),e.version>1?(e.sxHeight=this.readInt16(this.offset),e.sCapHeight=this.readInt16(this.offset),e.usDefaultChar=this.readUInt16(this.offset),e.usBreakChar=this.readUInt16(this.offset),e.usMaxContext=this.readUInt16(this.offset)):(e.sxHeight=0,e.sCapHeight=0,e.usDefaultChar=0,e.usBreakChar=0,e.usMaxContext=0),e},e.prototype.readPostTable=function(){var t=this.getTable("post");this.offset=t.offset;var e=new Ot;return e.formatType=this.readFixed(this.offset),e.italicAngle=this.readFixed(this.offset),e.underlinePosition=this.readInt16(this.offset),e.underlineThickness=this.readInt16(this.offset),e.isFixedPitch=this.readUInt32(this.offset),e.minType42=this.readUInt32(this.offset),e.maxType42=this.readUInt32(this.offset),e.minType1=this.readUInt32(this.offset),e.maxType1=this.readUInt32(this.offset),e},e.prototype.readWidthTable=function(t,e){var i=this.getTable("hmtx");this.offset=i.offset;for(var r=[],n=0;n<t;n++){var o=new xt;o.advanceWidth=this.readUInt16(this.offset),o.lsb=this.readInt16(this.offset);var s=1e3*o.advanceWidth/e;r.push(Math.floor(s))}return r},e.prototype.readCmapTable=function(){var t=this.getTable("cmap");this.offset=t.offset;var e=new Tt;e.version=this.readUInt16(this.offset),e.tablesCount=this.readUInt16(this.offset);for(var i=this.offset,r=[],n=0;n<e.tablesCount;n++){this.offset=i;var o=new Lt;o.platformID=this.readUInt16(this.offset),o.encodingID=this.readUInt16(this.offset),o.offset=this.readUInt32(this.offset),i=this.offset,this.readCmapSubTable(o),r[n]=o}return r},e.prototype.readCmapSubTable=function(e){var i=this.getTable("cmap");this.offset=i.offset+e.offset;var r=this.readUInt16(this.offset),n=this.getCmapEncoding(e.platformID,e.encodingID);n===t.TtfCmapEncoding.Macintosh?t.TtfPlatformID.Macintosh:t.TtfPlatformID.Microsoft;if(n!==t.TtfCmapEncoding.Unknown)switch(r){case t.TtfCmapFormat.Apple:this.readAppleCmapTable(e,n);break;case t.TtfCmapFormat.Microsoft:this.readMicrosoftCmapTable(e,n);break;case t.TtfCmapFormat.Trimmed:this.readTrimmedCmapTable(e,n)}},e.prototype.readAppleCmapTable=function(t,e){var i=this.getTable("cmap");this.offset=i.offset+t.offset;var r=new Vt;r.format=this.readUInt16(this.offset),r.length=this.readUInt16(this.offset),r.version=this.readUInt16(this.offset),null!==this.maxMacIndex&&void 0!==this.maxMacIndex||(this.maxMacIndex=0);for(var n=0;n<256;++n){var o=new jt;o.index=this.readByte(this.offset),o.width=this.getWidth(o.index),o.charCode=n,this.macintosh.setValue(n,o),this.addGlyph(o,e),this.maxMacIndex=Math.max(n,this.maxMacIndex)}},e.prototype.readMicrosoftCmapTable=function(e,i){var r=this.getTable("cmap");this.offset=r.offset+e.offset;var n=i===t.TtfCmapEncoding.Unicode?this.microsoft:this.macintosh,o=new Rt;o.format=this.readUInt16(this.offset),o.length=this.readUInt16(this.offset),o.version=this.readUInt16(this.offset),o.segCountX2=this.readUInt16(this.offset),o.searchRange=this.readUInt16(this.offset),o.entrySelector=this.readUInt16(this.offset),o.rangeShift=this.readUInt16(this.offset);var s=o.segCountX2/2;o.endCount=this.readUshortArray(s),o.reservedPad=this.readUInt16(this.offset),o.startCount=this.readUshortArray(s),o.idDelta=this.readUshortArray(s),o.idRangeOffset=this.readUshortArray(s);var a=o.length/2-8-4*s;o.glyphID=this.readUshortArray(a);for(var h=0,l=0,u=0;u<s;u++)for(var c=o.startCount[u];c<=o.endCount[u]&&65535!==c;c++){if(0===o.idRangeOffset[u])h=c+o.idDelta[u]&65535;else{if((l=u+o.idRangeOffset[u]/2-s+c-o.startCount[u])>=o.glyphID.length)continue;h=o.glyphID[l]+o.idDelta[u]&65535}var p=new jt;p.index=h,p.width=this.getWidth(p.index);var d=i===t.TtfCmapEncoding.Symbol&&61440==(65280&c)?255&c:c;p.charCode=d,n.setValue(d,p),this.addGlyph(p,i)}},e.prototype.readTrimmedCmapTable=function(t,e){var i=this.getTable("cmap");this.offset=i.offset+t.offset;var r=new Mt;r.format=this.readUInt16(this.offset),r.length=this.readUInt16(this.offset),r.version=this.readUInt16(this.offset),r.firstCode=this.readUInt16(this.offset),r.entryCount=this.readUInt16(this.offset);for(var n=0;n<r.entryCount;++n){var o=new jt;o.index=this.readUInt16(this.offset),o.width=this.getWidth(o.index),o.charCode=n+r.firstCode,this.macintosh.setValue(n,o),this.addGlyph(o,e),this.maxMacIndex=Math.max(n,this.maxMacIndex)}},e.prototype.initializeFontName=function(t){for(var e=0;e<t.recordsCount;e++){var i=t.nameRecords[e];if(1===i.nameID?this.metrics.fontFamily=i.name:6===i.nameID&&(this.metrics.postScriptName=i.name),null!==this.metrics.fontFamily&&void 0!==this.metrics.fontFamily&&null!==this.metrics.postScriptName&&void 0!==this.metrics.postScriptName)break}},e.prototype.getTable=function(t){var e,i=new bt;return this.tableDirectory.containsKey(t)&&(e=this.tableDirectory.getValue(t)),null!==e&&void 0!==e&&(i=e),i},e.prototype.getWidth=function(t){return t=t<this.width.length?t:this.width.length-1,this.width[t]},e.prototype.getCmapEncoding=function(e,i){var r=t.TtfCmapEncoding.Unknown;return e==t.TtfPlatformID.Microsoft&&i==t.TtfMicrosoftEncodingID.Undefined?r=t.TtfCmapEncoding.Symbol:e==t.TtfPlatformID.Microsoft&&i==t.TtfMicrosoftEncodingID.Unicode?r=t.TtfCmapEncoding.Unicode:e==t.TtfPlatformID.Macintosh&&i==t.TtfMacintoshEncodingID.Roman&&(r=t.TtfCmapEncoding.Macintosh),r},e.prototype.addGlyph=function(e,i){var r=null;switch(i){case t.TtfCmapEncoding.Unicode:r=this.microsoftGlyphs;break;case t.TtfCmapEncoding.Macintosh:case t.TtfCmapEncoding.Symbol:r=this.macintoshGlyphs}r.setValue(e.index,e)},e.prototype.initializeMetrics=function(e,i,r,n,o,s){this.initializeFontName(e);for(var a=!1,h=0;h<s.length;h++){var l=s[h];if(this.getCmapEncoding(l.platformID,l.encodingID)===t.TtfCmapEncoding.Symbol){a=!0;break}}this.metrics.isSymbol=a,this.metrics.macStyle=i.macStyle,this.metrics.isFixedPitch=0!==o.isFixedPitch,this.metrics.italicAngle=o.italicAngle;var u=1e3/i.unitsPerEm;this.metrics.winAscent=n.sTypoAscender*u,this.metrics.macAscent=r.ascender*u,this.metrics.capHeight=0!==n.sCapHeight?n.sCapHeight:.7*i.unitsPerEm*u,this.metrics.winDescent=n.sTypoDescender*u,this.metrics.macDescent=r.descender*u,this.metrics.leading=(n.sTypoAscender-n.sTypoDescender+n.sTypoLineGap)*u,this.metrics.lineGap=Math.ceil(r.lineGap*u);var c=i.xMin*u,p=Math.ceil(this.metrics.macAscent+this.metrics.lineGap),d=i.xMax*u,f=this.metrics.macDescent;this.metrics.fontBox=new V(c,p,d,f),this.metrics.stemV=80,this.metrics.widthTable=this.updateWidth(),this.metrics.contains=this.tableDirectory.containsKey("CFF"),this.metrics.subScriptSizeFactor=i.unitsPerEm/n.ySubscriptYSize,this.metrics.superscriptSizeFactor=i.unitsPerEm/n.ySuperscriptYSize},e.prototype.updateWidth=function(){var t=[];if(this.metrics.isSymbol)for(var e=0;e<256;e++){var i=this.getGlyph(String.fromCharCode(e));t[e]=i.empty?0:i.width}else{var r=[],n=String.fromCharCode(32);for(e=0;e<256;e++){r[0]=e;var o=this.getString(r,0,r.length),s=o.length>0?o[0]:"?";(i=this.getGlyph(s)).empty?(i=this.getGlyph(n),t[e]=i.empty?0:i.width):t[e]=i.width}}return t},e.prototype.getDefaultGlyph=function(){return this.getGlyph(A.whiteSpace)},e.prototype.getString=function(t,e,i){for(var r="",n=0;n<i;n++)r+=String.fromCharCode(t[n+e]);return r},e.prototype.readLocaTable=function(t){var e=this.getTable("loca");this.offset=e.offset;var i=new kt,r=null;if(t){var n=e.length/2;r=[];for(var o=0;o<n;o++)r[o]=2*this.readUInt16(this.offset)}else{n=e.length/4;r=[];for(o=0;o<n;o++)r[o]=this.readUInt32(this.offset)}return i.offsets=r,i},e.prototype.updateGlyphChars=function(t,e){t.containsKey(0)||t.setValue(0,0);for(var i=new n,r=t.keys(),o=0;o<r.length;o++)i.setValue(r[o],t.getValue(r[o]));for(o=0;o<r.length;o++){var s=r[o];this.processCompositeGlyph(t,s,e)}},e.prototype.processCompositeGlyph=function(e,i,r){if(i<r.offsets.length-1){var n=r.offsets[i];if(n!==r.offsets[i+1]){var o=this.getTable("glyf");this.offset=o.offset+n;var s=new Dt;if(s.numberOfContours=this.readInt16(this.offset),s.xMin=this.readInt16(this.offset),s.yMin=this.readInt16(this.offset),s.xMax=this.readInt16(this.offset),s.yMax=this.readInt16(this.offset),s.numberOfContours<0)for(var a=0;;){var h=this.readUInt16(this.offset),l=this.readUInt16(this.offset);if(e.containsKey(l)||e.setValue(l,0),0==(h&t.TtfCompositeGlyphFlags.MoreComponents))break;a=0!=(h&t.TtfCompositeGlyphFlags.Arg1And2AreWords)?4:2,0!=(h&t.TtfCompositeGlyphFlags.WeHaveScale)?a+=2:0!=(h&t.TtfCompositeGlyphFlags.WeHaveAnXyScale)?a+=4:0!=(h&t.TtfCompositeGlyphFlags.WeHaveTwoByTwo)&&(a+=8),this.offset+=a}}}},e.prototype.generateGlyphTable=function(t,e,i,r){i=[];var n=t.keys();n.sort(function(t,e){return t-e});for(var o=0,s=0;s<n.length;s++){var a=n[s];e.offsets.length>0&&(o+=e.offsets[a+1]-e.offsets[a])}var h=this.align(o);r=[];for(s=0;s<h;s++)r.push(0);var l=0,u=0,c=this.getTable("glyf");for(s=0;s<e.offsets.length;s++)if(i.push(l),u<n.length&&n[u]===s){++u,i[s]=l;var p=e.offsets[s],d=e.offsets[s+1]-p;if(d>0){this.offset=c.offset+p;r=this.read(r,l,d).buffer,l+=d}}return{glyphTableSize:o,newLocaTable:i,newGlyphTable:r}},e.prototype.updateLocaTable=function(t,e,i){if(null===t)throw new Error("Argument Null Exception : newLocaTable");for(var r=e?2*t.length:4*t.length,n=this.align(r),o=new Nt(n),s=0;s<t.length;s++){var a=t[s];e?(a/=2,o.writeShort(a)):o.writeInt(a)}return{newLocaUpdated:o.data,newLocaSize:r}},e.prototype.align=function(t){return t+3&-4},e.prototype.getFontProgram=function(t,e,i,r){if(null===t)throw new Error("Argument Null Exception : newLocaTableOut");if(null===e)throw new Error("Argument Null Exception : newGlyphTable");this.tableNames;var n=this.getFontProgramLength(t,e,0),o=n.fontProgramLength,s=n.numTables,a=new Nt(o);a.writeInt(65536),a.writeShort(s);var h=this.entrySelectors[s];return a.writeShort(16*(1<<(31&h))),a.writeShort(h),a.writeShort(16*(s-(1<<(31&h)))),this.writeCheckSums(a,s,t,e,i,r),this.writeGlyphs(a,t,e),a.data},e.prototype.getFontProgramLength=function(t,e,i){if(null===t)throw new Error("Argument Null Exception : newLocaTableOut");if(null===e)throw new Error("Argument Null Exception : newGlyphTable");i=2;for(var r=this.tableNames,n=0,o=0;o<r.length;o++){var s=r[o];if("glyf"!==s&&"loca"!==s){var a=this.getTable(s);a.empty||(++i,n+=this.align(a.length))}}n+=t.length,n+=e.length;return n+=16*i+12,{fontProgramLength:n,numTables:i}},e.prototype.writeCheckSums=function(t,e,i,r,n,o){if(null===t)throw new Error("Argument Null Exception : writer");if(null===i)throw new Error("Argument Null Exception : newLocaTableOut");if(null===r)throw new Error("Argument Null Exception : newGlyphTable");for(var s=this.tableNames,a=16*e+12,h=0,l=0;l<s.length;l++){var u=s[l],c=this.getTable(u);if(!c.empty){if(t.writeString(u),"glyf"===u){var p=this.calculateCheckSum(r);t.writeInt(p),h=n}else if("loca"===u){p=this.calculateCheckSum(i);t.writeInt(p),h=o}else t.writeInt(c.checksum),h=c.length;t.writeUInt(a),t.writeUInt(h),a+=this.align(h)}}},e.prototype.calculateCheckSum=function(t){if(null===t)throw new Error("Argument Null Exception : bytes");for(var e=0,i=0,r=0,n=0,o=0,s=0;s<(t.length+1)/4;s++)o+=255&t[e++],n+=255&t[e++],r+=255&t[e++],i+=255&t[e++];var a=i;return a+=r<<8,a+=n<<16,a+=o<<24},e.prototype.writeGlyphs=function(t,e,i){if(null===t)throw new Error("Argument Null Exception : writer");if(null===e)throw new Error("Argument Null Exception : newLocaTableOut");if(null===i)throw new Error("Argument Null Exception : newGlyphTable");for(var r=this.tableNames,n=0;n<r.length;n++){var o=r[n],s=this.getTable(o);if(!s.empty)if("glyf"===o)t.writeBytes(i);else if("loca"===o)t.writeBytes(e);else{for(var a=this.align(s.length),h=[],l=0;l<a;l++)h.push(0);this.offset=s.offset;var u=this.read(h,0,s.length);t.writeBytes(u.buffer)}}},e.prototype.setOffset=function(t){this.offset=t},e.prototype.createInternals=function(){this.metrics=new vt;var t=this.readNameTable(),e=this.readHeadTable();this.bIsLocaShort=0===e.indexToLocalFormat;var i=this.readHorizontalHeaderTable(),r=this.readOS2Table(),n=this.readPostTable();this.width=this.readWidthTable(i.numberOfHMetrics,e.unitsPerEm);var o=this.readCmapTable();this.initializeMetrics(t,e,i,r,n,o)},e.prototype.getGlyph=function(t){if("number"==typeof t){var e=null;this.metrics.isSymbol||null==this.microsoftGlyphs?this.metrics.isSymbol&&null!=this.macintoshGlyphs&&this.macintoshGlyphs.containsKey(t)&&(e=this.macintoshGlyphs.getValue(t)):this.microsoftGlyphs.containsKey(t)&&(e=this.microsoftGlyphs.getValue(t));return null!=e?e:this.getDefaultGlyph()}var i=null,r=t.charCodeAt(0);this.metrics.isSymbol||null===this.microsoft?(this.metrics.isSymbol&&null!==this.macintosh||this.isMacTTF)&&(0!==this.maxMacIndex?r%=this.maxMacIndex+1:r=61440==(65280&r)?255&r:r,this.macintosh.containsKey(r)&&(i=this.macintosh.getValue(r),this.isFontPresent=!0)):this.microsoft.containsKey(r)?(i=this.microsoft.getValue(r),r!==A.whiteSpace.charCodeAt(0)&&(this.isFontPresent=!0)):r!==A.whiteSpace.charCodeAt(0)&&(this.isFontPresent=!1),t===A.whiteSpace&&null===i&&(i=new jt);return null!==i?i:this.getDefaultGlyph()},e.prototype.getGlyphChars=function(t){if(null===t||void 0===t)throw new Error("Argument Null Exception : chars");for(var e=new n,i=t.keys(),r=0;r<i.length;r++){var o=i[r],s=this.getGlyph(o);s.empty||e.setValue(s.index,o.charCodeAt(0))}return e},e.prototype.getAllGlyphs=function(){for(var t=[],e=new jt,i=0,r=0;r<this.width.length;r++){var n=this.width[r];e.index=i,e.width=n,t.push(e),i++}return t},e.prototype.readFontProgram=function(t){var e=this.getGlyphChars(t),i=this.readLocaTable(this.bIsLocaShort);e.size()<t.size()&&(this.missedGlyphs=t.size()-e.size()),this.updateGlyphChars(e,i);var r=this.generateGlyphTable(e,i,null,null),n=r.glyphTableSize,o=r.newLocaTable,s=r.newGlyphTable,a=this.updateLocaTable(o,this.bIsLocaShort,null),h=a.newLocaSize,l=a.newLocaUpdated;return this.getFontProgram(l,s,n,h)},e.prototype.convertString=function(t){if(null===t)throw new Error("Argument Null Exception : text");for(var e="",i=0;i<t.length;i++){var r=t[i],n=this.getGlyph(r);n.empty||(e+=String.fromCharCode(n.index))}return e},e.prototype.getCharWidth=function(t){var e=this.getGlyph(t);return(e=e.empty?this.getDefaultGlyph():e).empty?0:e.width},e.prototype.readString=function(t,e){if(void 0===e)return this.readString(t,!1);var i="";if(e)for(var r=0;r<t;r++)r%2!=0&&(i+=String.fromCharCode(this.fontData[this.offset])),this.offset+=1;else for(r=0;r<t;r++)i+=String.fromCharCode(this.fontData[this.offset]),this.offset+=1;return i},e.prototype.readFixed=function(t){return this.readInt16(t)+this.readInt16(t+2)/16384},e.prototype.readInt32=function(t){var e=this.fontData[t+3],i=this.fontData[t+2],r=this.fontData[t+1],n=this.fontData[t];return this.offset+=4,e+(i<<8)+(r<<16)+(n<<24)},e.prototype.readUInt32=function(t){var e=this.fontData[t+3],i=this.fontData[t+2],r=this.fontData[t+1],n=this.fontData[t];return this.offset+=4,e|i<<8|r<<16|n<<24},e.prototype.readInt16=function(t){var e=(this.fontData[t]<<8)+this.fontData[t+1];return e=32768&e?e-65536:e,this.offset+=2,e},e.prototype.readInt64=function(t){var e=this.readInt32(t+4),i=4294967296*this.readInt32(t)+e;return e<0&&(i+=4294967296),i},e.prototype.readUInt16=function(t){var e=this.fontData[t]<<8|this.fontData[t+1];return this.offset+=2,e},e.prototype.readUshortArray=function(t){for(var e=[],i=0;i<t;i++)e[i]=this.readUInt16(this.offset);return e},e.prototype.readBytes=function(t){for(var e=[],i=0;i<t;i++)e.push(this.fontData[this.offset]),this.offset+=1;return e},e.prototype.readByte=function(t){var e=this.fontData[t];return this.offset+=1,e},e.prototype.read=function(t,e,i){if(null===t)throw new Error("Argument Null Exception : buffer");var r=0,n=0;do{for(var o=0;o<i-r&&this.offset+o<this.fontData.length;o++)t[e+o]=this.fontData[this.offset+o];n=i-r,this.offset+=n,r+=n}while(r<i);return{buffer:t,written:r}},e}(),It=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ft=function(){function e(){this.lineGap=0}return e.prototype.getAscent=function(t){return this.ascent*G.charSizeMultiplier*this.getSize(t)},e.prototype.getDescent=function(t){return this.descent*G.charSizeMultiplier*this.getSize(t)},e.prototype.getLineGap=function(t){return this.lineGap*G.charSizeMultiplier*this.getSize(t)},e.prototype.getHeight=function(t){for(var e=["cambria","candara","constantia","corbel","cariadings"],i=[],r=0;r<e.length;r++){var n=e[r];i.push(n)}return this.getDescent(t)<0?this.getAscent(t)-this.getDescent(t)+this.getLineGap(t):this.getAscent(t)+this.getDescent(t)+this.getLineGap(t)},e.prototype.getSize=function(e){var i=this.size;if(null!=e)switch(e.subSuperScript){case t.PdfSubSuperScript.SubScript:i/=this.subScriptSizeFactor;break;case t.PdfSubSuperScript.SuperScript:i/=this.superscriptSizeFactor}return i},e.prototype.clone=function(){return this.widthTable=Et.clone(),this},Object.defineProperty(e.prototype,"widthTable",{get:function(){return this.internalWidthTable},set:function(t){this.internalWidthTable=t},enumerable:!0,configurable:!0}),e}(),Et=function(){function t(){}return t.clone=function(){return null},t}(),Gt=function(t){function e(e){var i=t.call(this)||this;if(null==e)throw new Error("ArgumentNullException:widths");return i.widths=e,i}return It(e,t),e.prototype.items=function(t){if(t<0||t>=this.widths.length)throw new Error("ArgumentOutOfRangeException:index, The character is not supported by the font.");return this.widths[t]},Object.defineProperty(e.prototype,"length",{get:function(){return this.widths.length},enumerable:!0,configurable:!0}),e.prototype.clone=function(){return this.widths=this.widths,this},e.prototype.toArray=function(){return new m(this.widths)},e}(Et),zt=function(){function e(t,e){if(this.nameString="ABCDEFGHIJKLMNOPQRSTUVWXYZ",this.dictionaryProperties=new a,this.isCompress=!1,this.isEmbedFont=!1,this.cmapPrefix="/CIDInit /ProcSet findresource begin\n12 dict begin\nbegincmap"+s.newLine+"/CIDSystemInfo << /Registry (Adobe)/Ordering (UCS)/Supplement 0>> def\n/CMapName /Adobe-Identity-UCS def\n/CMapType 2 def\n1 begincodespacerange"+s.newLine,this.cmapEndCodespaceRange="endcodespacerange"+s.newLine,this.cmapBeginRange="beginbfrange"+s.newLine,this.cmapEndRange="endbfrange"+s.newLine,this.cmapSuffix="endbfrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend end"+s.newLine,null===t||void 0===t)throw new Error("ArgumentNullException:base64String");this.fontSize=e,this.fontString=t,this.Initialize()}return e.prototype.getCharWidth=function(t){return this.ttfReader.getCharWidth(t)},e.prototype.getLineWidth=function(t){for(var e=0,i=0,r=t.length;i<r;i++){var n=t[i];e+=this.getCharWidth(n)}return e},e.prototype.Initialize=function(){var t=new pt(this.fontString.length);t.writeFromBase64String(this.fontString),this.fontData=t.internalBuffer,this.ttfReader=new At(this.fontData),this.ttfMetrics=this.ttfReader.metrics},e.prototype.createInternals=function(){this.fontDictionary=new h,this.fontProgram=new b,this.cmap=new b,this.descendantFont=new h,this.metrics=new Ft,this.ttfReader.createInternals(),this.ttfMetrics=this.ttfReader.metrics,this.initializeMetrics(),this.subsetName=this.getFontName(),this.createDescendantFont(),this.createCmap(),this.createFontDictionary(),this.createFontProgram()},e.prototype.getInternals=function(){return this.fontDictionary},e.prototype.initializeMetrics=function(){var t=this.ttfReader.metrics;this.metrics.ascent=t.macAscent,this.metrics.descent=t.macDescent,this.metrics.height=t.macAscent-t.macDescent+t.lineGap,this.metrics.name=t.fontFamily,this.metrics.postScriptName=t.postScriptName,this.metrics.size=this.fontSize,this.metrics.widthTable=new Gt(t.widthTable),this.metrics.lineGap=t.lineGap,this.metrics.subScriptSizeFactor=t.subScriptSizeFactor,this.metrics.superscriptSizeFactor=t.superscriptSizeFactor,this.metrics.isBold=t.isBold},e.prototype.getFontName=function(){for(var t,e="",i=0;i<6;i++){var r=Math.floor(26*Math.random())+0;e+=this.nameString[r]}return e+="+",e+=this.ttfReader.metrics.postScriptName,t=e.toString(),t=this.formatName(t)},e.prototype.formatName=function(t){var e=t.replace("(","#28");return e=e.replace(")","#29"),e=e.replace("[","#5B"),e=e.replace("]","#5D"),e=e.replace("<","#3C"),e=e.replace(">","#3E"),e=e.replace("{","#7B"),e=e.replace("}","#7D"),e=e.replace("/","#2F"),(e=e.replace("%","#25")).replace(" ","#20")},e.prototype.createDescendantFont=function(){this.descendantFont.isResource=!0,this.descendantFont.descendantFontBeginSave=new u(this),this.descendantFont.items.setValue(this.dictionaryProperties.type,new o(this.dictionaryProperties.font)),this.descendantFont.items.setValue(this.dictionaryProperties.subtype,new o(this.dictionaryProperties.cIDFontType2)),this.descendantFont.items.setValue(this.dictionaryProperties.baseFont,new o(this.subsetName)),this.descendantFont.items.setValue(this.dictionaryProperties.cIDToGIDMap,new o(this.dictionaryProperties.identity)),this.descendantFont.items.setValue(this.dictionaryProperties.dw,new g(1e3)),this.fontDescriptor=this.createFontDescriptor(),this.descendantFont.items.setValue(this.dictionaryProperties.fontDescriptor,new C(this.fontDescriptor));var t=this.createSystemInfo();this.descendantFont.items.setValue(this.dictionaryProperties.cIDSystemInfo,t)},e.prototype.createFontDescriptor=function(){var t=new h,e=this.ttfReader.metrics;return t.isResource=!0,t.items.setValue(this.dictionaryProperties.type,new o(this.dictionaryProperties.fontDescriptor)),t.items.setValue(this.dictionaryProperties.fontName,new o(this.subsetName)),t.items.setValue(this.dictionaryProperties.flags,new g(this.getDescriptorFlags())),t.items.setValue(this.dictionaryProperties.fontBBox,m.fromRectangle(this.getBoundBox())),t.items.setValue(this.dictionaryProperties.missingWidth,new g(e.widthTable[32])),t.items.setValue(this.dictionaryProperties.stemV,new g(e.stemV)),t.items.setValue(this.dictionaryProperties.italicAngle,new g(e.italicAngle)),t.items.setValue(this.dictionaryProperties.capHeight,new g(e.capHeight)),t.items.setValue(this.dictionaryProperties.ascent,new g(e.winAscent)),t.items.setValue(this.dictionaryProperties.descent,new g(e.winDescent)),t.items.setValue(this.dictionaryProperties.leading,new g(e.leading)),t.items.setValue(this.dictionaryProperties.avgWidth,new g(e.widthTable[32])),t.items.setValue(this.dictionaryProperties.fontFile2,new C(this.fontProgram)),t.items.setValue(this.dictionaryProperties.maxWidth,new g(e.widthTable[32])),t.items.setValue(this.dictionaryProperties.xHeight,new g(0)),t.items.setValue(this.dictionaryProperties.stemH,new g(0)),t},e.prototype.createCmap=function(){this.cmap.cmapBeginSave=new w(this)},e.prototype.createFontDictionary=function(){this.fontDictionary.isResource=!0,this.fontDictionary.fontDictionaryBeginSave=new c(this),this.fontDictionary.items.setValue(this.dictionaryProperties.type,new o(this.dictionaryProperties.font)),this.fontDictionary.items.setValue(this.dictionaryProperties.baseFont,new o(this.subsetName)),this.fontDictionary.items.setValue(this.dictionaryProperties.subtype,new o(this.dictionaryProperties.type0)),this.fontDictionary.items.setValue(this.dictionaryProperties.encoding,new o(this.dictionaryProperties.identityH));var t=new m,e=new C(this.descendantFont);t.isFont=!0,t.add(e),this.fontDictionary.items.setValue(this.dictionaryProperties.descendantFonts,t)},e.prototype.createFontProgram=function(){this.fontProgram.fontProgramBeginSave=new P(this)},e.prototype.createSystemInfo=function(){var t=new h;return t.items.setValue(this.dictionaryProperties.registry,new S("Adobe")),t.items.setValue(this.dictionaryProperties.ordering,new S(this.dictionaryProperties.identity)),t.items.setValue(this.dictionaryProperties.supplement,new g(0)),t},e.prototype.descendantFontBeginSave=function(){if(null!==this.usedChars&&void 0!==this.usedChars&&this.usedChars.size()>0){var t=this.getDescendantWidth();null!==t&&this.descendantFont.items.setValue(this.dictionaryProperties.w,t)}},e.prototype.cmapBeginSave=function(){this.generateCmap()},e.prototype.fontDictionaryBeginSave=function(){null!==this.usedChars&&void 0!==this.usedChars&&this.usedChars.size()>0&&!this.fontDictionary.containsKey(this.dictionaryProperties.toUnicode)&&this.fontDictionary.items.setValue(this.dictionaryProperties.toUnicode,new C(this.cmap))},e.prototype.fontProgramBeginSave=function(){this.isCompress=!0,this.generateFontProgram()},e.prototype.getDescendantWidth=function(){var t=new m;if(null!==this.usedChars&&void 0!==this.usedChars&&this.usedChars.size()>0){for(var e=[],i=this.usedChars.keys(),r=0;r<i.length;r++){var n=i[r];(l=this.ttfReader.getGlyph(n)).empty||e.push(l)}e.sort(function(t,e){return t.index-e.index});var o=0,s=0,a=!1,h=new m;for(r=0;r<e.length;r++){var l=e[r];a||(a=!0,o=l.index,s=l.index-1),(s+1!==l.index||r+1===e.length)&&e.length>1&&(t.add(new g(o)),0!==r&&t.add(h),o=l.index,h=new m),h.add(new g(l.width)),r+1===e.length&&(t.add(new g(o)),t.add(h)),s=l.index}}return t},e.prototype.generateCmap=function(){if(null!==this.usedChars&&void 0!==this.usedChars&&this.usedChars.size()>0){var t=this.ttfReader.getGlyphChars(this.usedChars);if(t.size()>0){var e=t.keys().sort(),i=e[0],r=e[e.length-1],n=this.toHexString(i,!1)+this.toHexString(r,!1)+s.newLine,o="";o+=this.cmapPrefix,o+=n,o+=this.cmapEndCodespaceRange;for(var a=0,h=0;h<e.length;h++){0===a&&(0!==h&&(o+=this.cmapEndRange),o+=a=Math.min(100,e.length-h),o+=s.whiteSpace,o+=this.cmapBeginRange),a-=1;var l=e[h];o+=this.toHexString(l,!0)+this.toHexString(l,!0)+this.toHexString(t.getValue(l),!0)+"\n"}o+=this.cmapSuffix,this.cmap.clearStream(),this.cmap.isResource=!0,this.cmap.write(o)}}},e.prototype.generateFontProgram=function(){var t=null;this.usedChars=null===this.usedChars||void 0===this.usedChars?new n:this.usedChars,this.ttfReader.setOffset(0),t=this.ttfReader.readFontProgram(this.usedChars),this.fontProgram.clearStream(),this.fontProgram.isResource=!0,this.fontProgram.writeBytes(t)},e.prototype.getDescriptorFlags=function(){var e=0,i=this.ttfReader.metrics;return i.isFixedPitch&&(e|=t.FontDescriptorFlags.FixedPitch),i.isSymbol?e|=t.FontDescriptorFlags.Symbolic:e|=t.FontDescriptorFlags.Nonsymbolic,i.isItalic&&(e|=t.FontDescriptorFlags.Italic),i.isBold&&(e|=t.FontDescriptorFlags.ForceBold),e},e.prototype.getBoundBox=function(){var t=this.ttfReader.metrics.fontBox,e=Math.abs(t.right-t.left),i=Math.abs(t.top-t.bottom);return new k(t.left,t.bottom,e,i)},e.prototype.toHexString=function(t,e){var i=t.toString(16);return e&&(i=i.toUpperCase()),"<0000".substring(0,5-i.length)+i+">"},e.prototype.setSymbols=function(t){if(null===t)throw new Error("Argument Null Exception : text");null!==this.usedChars&&void 0!==this.usedChars||(this.usedChars=new n);for(var e=0;e<t.length;e++){var i=t[e];this.usedChars.setValue(i,String.fromCharCode(0))}!1===this.isEmbedFont&&this.getDescendantWidth()},e}(),Wt=function(){function t(){this.arabicCharTable=[["ء","ﺀ"],["آ","ﺁ","ﺂ"],["أ","ﺃ","ﺄ"],["ؤ","ﺅ","ﺆ"],["إ","ﺇ","ﺈ"],["ئ","ﺉ","ﺊ","ﺋ","ﺌ"],["ا","ﺍ","ﺎ"],["ب","ﺏ","ﺐ","ﺑ","ﺒ"],["ة","ﺓ","ﺔ"],["ت","ﺕ","ﺖ","ﺗ","ﺘ"],["ث","ﺙ","ﺚ","ﺛ","ﺜ"],["ج","ﺝ","ﺞ","ﺟ","ﺠ"],["ح","ﺡ","ﺢ","ﺣ","ﺤ"],["خ","ﺥ","ﺦ","ﺧ","ﺨ"],["د","ﺩ","ﺪ"],["ذ","ﺫ","ﺬ"],["ر","ﺭ","ﺮ"],["ز","ﺯ","ﺰ"],["س","ﺱ","ﺲ","ﺳ","ﺴ"],["ش","ﺵ","ﺶ","ﺷ","ﺸ"],["ص","ﺹ","ﺺ","ﺻ","ﺼ"],["ض","ﺽ","ﺾ","ﺿ","ﻀ"],["ط","ﻁ","ﻂ","ﻃ","ﻄ"],["ظ","ﻅ","ﻆ","ﻇ","ﻈ"],["ع","ﻉ","ﻊ","ﻋ","ﻌ"],["غ","ﻍ","ﻎ","ﻏ","ﻐ"],["ـ","ـ","ـ","ـ","ـ"],["ف","ﻑ","ﻒ","ﻓ","ﻔ"],["ق","ﻕ","ﻖ","ﻗ","ﻘ"],["ك","ﻙ","ﻚ","ﻛ","ﻜ"],["ل","ﻝ","ﻞ","ﻟ","ﻠ"],["م","ﻡ","ﻢ","ﻣ","ﻤ"],["ن","ﻥ","ﻦ","ﻧ","ﻨ"],["ه","ﻩ","ﻪ","ﻫ","ﻬ"],["و","ﻭ","ﻮ"],["ى","ﻯ","ﻰ","ﯨ","ﯩ"],["ي","ﻱ","ﻲ","ﻳ","ﻴ"],["ٱ","ﭐ","ﭑ"],["ٹ","ﭦ","ﭧ","ﭨ","ﭩ"],["ٺ","ﭞ","ﭟ","ﭠ","ﭡ"],["ٻ","ﭒ","ﭓ","ﭔ","ﭕ"],["پ","ﭖ","ﭗ","ﭘ","ﭙ"],["ٿ","ﭢ","ﭣ","ﭤ","ﭥ"],["ڀ","ﭚ","ﭛ","ﭜ","ﭝ"],["ڃ","ﭶ","ﭷ","ﭸ","ﭹ"],["ڄ","ﭲ","ﭳ","ﭴ","ﭵ"],["چ","ﭺ","ﭻ","ﭼ","ﭽ"],["ڇ","ﭾ","ﭿ","ﮀ","ﮁ"],["ڈ","ﮈ","ﮉ"],["ڌ","ﮄ","ﮅ"],["ڍ","ﮂ","ﮃ"],["ڎ","ﮆ","ﮇ"],["ڑ","ﮌ","ﮍ"],["ژ","ﮊ","ﮋ"],["ڤ","ﭪ","ﭫ","ﭬ","ﭭ"],["ڦ","ﭮ","ﭯ","ﭰ","ﭱ"],["ک","ﮎ","ﮏ","ﮐ","ﮑ"],["ڭ","ﯓ","ﯔ","ﯕ","ﯖ"],["گ","ﮒ","ﮓ","ﮔ","ﮕ"],["ڱ","ﮚ","ﮛ","ﮜ","ﮝ"],["ڳ","ﮖ","ﮗ","ﮘ","ﮙ"],["ں","ﮞ","ﮟ"],["ڻ","ﮠ","ﮡ","ﮢ","ﮣ"],["ھ","ﮪ","ﮫ","ﮬ","ﮭ"],["ۀ","ﮤ","ﮥ"],["ہ","ﮦ","ﮧ","ﮨ","ﮩ"],["ۅ","ﯠ","ﯡ"],["ۆ","ﯙ","ﯚ"],["ۇ","ﯗ","ﯘ"],["ۈ","ﯛ","ﯜ"],["ۉ","ﯢ","ﯣ"],["ۋ","ﯞ","ﯟ"],["ی","ﯼ","ﯽ","ﯾ","ﯿ"],["ې","ﯤ","ﯥ","ﯦ","ﯧ"],["ے","ﮮ","ﮯ"],["ۓ","ﮰ","ﮱ"]],this.alef="ا",this.alefHamza="أ",this.alefHamzaBelow="إ",this.alefMadda="آ",this.lam="ل",this.hamza="ء",this.zeroWidthJoiner="",this.hamzaAbove="ٔ",this.hamzaBelow="ٕ",this.wawHamza="ؤ",this.yehHamza="ئ",this.waw="و",this.alefMaksura="ى",this.yeh="ي",this.farsiYeh="ی",this.shadda="ّ",this.madda="ٓ",this.lwa="ﻻ",this.lwawh="ﻷ",this.lwawhb="ﻹ",this.lwawm="ﻵ",this.bwhb="ۓ",this.fathatan="ً",this.superScriptalef="ٰ",this.vowel=1,this.arabicMapTable=new n;for(var t=0;t<this.arabicCharTable.length;t++)this.arabicMapTable.setValue(this.arabicCharTable[t][0],this.arabicCharTable[t])}return t.prototype.getCharacterShape=function(t,e){if(t>=this.hamza&&t<=this.bwhb){if(this.arabicMapTable.getValue(t))return this.arabicMapTable.getValue(t)[e+1]}else if(t>=this.lwawm&&t<=this.lwa)return t;return t},t.prototype.shape=function(t,e){for(var i="",r="",n=0;n<t.length;n++){var o=t[n];if(o>=""&&o<="ۿ")r+=o;else{if(r.length>0){i+=this.doShape(r.toString(),0),r=""}i+=o}}if(r.length>0){i+=this.doShape(r.toString(),0)}return i.toString()},t.prototype.doShape=function(t,e){for(var i="",r=0,n=0,o="",s=new _t,a=new _t;n<t.length;)if(o=t[n++],0===this.ligature(o,a)){var h=this.getShapeCount(o);r=1===h?0:2,s.Shapes>2&&(r+=1),r%=a.Shapes,a.Value=this.getCharacterShape(a.Value,r),i=this.append(i,s,e),s=a,(a=new _t).Value=o,a.Shapes=h,a.Ligature++}return r=s.Shapes>2?1:0,r%=a.Shapes,a.Value=this.getCharacterShape(a.Value,r),i=this.append(i,s,e),(i=this.append(i,a,e)).toString()},t.prototype.append=function(t,e,i){return""!==e.Value&&(t+=e.Value,e.Ligature-=1,""!==e.Type&&(0==(i&this.vowel)?(t+=e.Type,e.Ligature-=1):e.Ligature-=1),""!==e.vowel&&(0==(i&this.vowel)?(t+=e.vowel,e.Ligature-=1):e.Ligature-=1)),t},t.prototype.ligature=function(t,e){if(""!==e.Value){var i=0;if(t>=this.fathatan&&t<=this.hamzaBelow||t===this.superScriptalef){if(i=1,""!==e.vowel&&t!==this.shadda&&(i=2),t===this.shadda){if(null!=e.Type)return 0;e.Type=this.shadda}else t===this.hamzaBelow?e.Value===this.alef?(e.Value=this.alefHamzaBelow,i=2):t===this.lwa?(e.Value=this.lwawhb,i=2):e.Type=this.hamzaBelow:t===this.hamzaAbove?e.Value===this.alef?(e.Value=this.alefHamza,i=2):e.Value===this.lwa?(e.Value=this.lwawh,i=2):e.Value===this.waw?(e.Value=this.wawHamza,i=2):e.Value===this.yeh||e.Value===this.alefMaksura||e.Value===this.farsiYeh?(e.Value=this.yehHamza,i=2):e.Type=this.hamzaAbove:t===this.madda?e.Value===this.alef&&(e.Value=this.alefMadda,i=2):e.vowel=t;return 1===i&&e.Ligature++,i}return""!==e.vowel?0:(e.Value===this.lam&&(t===this.alef?(e.Value=this.lwa,e.Shapes=2,i=3):t===this.alefHamza?(e.Value=this.lwawh,e.Shapes=2,i=3):t===this.alefHamzaBelow?(e.Value=this.lwawhb,e.Shapes=2,i=3):t===this.alefMadda&&(e.Value=this.lwawm,e.Shapes=2,i=3)),i)}return 0},t.prototype.getShapeCount=function(t){if(t>=this.hamza&&t<=this.bwhb&&!(t>=this.fathatan&&t<=this.hamzaBelow||t===this.superScriptalef)){if(this.arabicMapTable.getValue(t))return this.arabicMapTable.getValue(t).length-1}else if(t===this.zeroWidthJoiner)return 4;return 1},t}(),_t=function(){function t(){this.shapeValue="",this.shapeType="",this.shapeVowel="",this.shapeLigature=0,this.shapeShapes=1}return Object.defineProperty(t.prototype,"Value",{get:function(){return this.shapeValue},set:function(t){this.shapeValue=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Type",{get:function(){return this.shapeType},set:function(t){this.shapeType=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"vowel",{get:function(){return this.shapeVowel},set:function(t){this.shapeVowel=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Ligature",{get:function(){return this.shapeLigature},set:function(t){this.shapeLigature=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Shapes",{get:function(){return this.shapeShapes},set:function(t){this.shapeShapes=t},enumerable:!0,configurable:!0}),t}(),Ht=function(){function t(){this.indexes=[],this.indexLevels=[],this.mirroringShapeCharacters=new n,this.update()}return t.prototype.doMirrorShaping=function(t){for(var e=[],i=0;i<t.length;i++)1==(1&this.indexLevels[i])&&this.mirroringShapeCharacters.containsKey(t[i].charCodeAt(0))?e[i]=String.fromCharCode(this.mirroringShapeCharacters.getValue(t[i].charCodeAt(0))):e[i]=t[i].toString();for(var r="",n=0;n<e.length;n++)r+=e[n];return r},t.prototype.getLogicalToVisualString=function(t,e){var i=new Ut;this.indexLevels=i.getVisualOrder(t,e),this.setDefaultIndexLevel(),this.doOrder(0,this.indexLevels.length-1);for(var r=this.doMirrorShaping(t),n="",o=0;o<this.indexes.length;o++){n+=r[this.indexes[o]]}return n.toString()},t.prototype.setDefaultIndexLevel=function(){for(var t=0;t<this.indexLevels.length;t++)this.indexes[t]=t},t.prototype.doOrder=function(t,e){for(var i=this.indexLevels[t],r=i,n=i,o=i,s=t+1;s<=e;++s){var a=this.indexLevels[s];a>i?i=a:a<r&&(r=a),n&=a,o|=a}if(0!=(1&o))if(1!=(1&n))for(r|=1;i>=r;){for(var h=t;;){for(;h<=e&&!(this.indexLevels[h]>=i);)h+=1;if(h>e)break;for(var l=h+1;l<=e&&!(this.indexLevels[l]<i);)l+=1;this.reArrange(h,l),h=l+1}i-=1}else this.reArrange(t,e+1)},t.prototype.reArrange=function(t,e){var i=(t+e)/2;for(--e;t<i;++t,--e){var r=this.indexes[t];this.indexes[t]=this.indexes[e],this.indexes[e]=r}},t.prototype.update=function(){this.mirroringShapeCharacters.setValue(40,41),this.mirroringShapeCharacters.setValue(41,40),this.mirroringShapeCharacters.setValue(60,62),this.mirroringShapeCharacters.setValue(62,60),this.mirroringShapeCharacters.setValue(91,93),this.mirroringShapeCharacters.setValue(93,91),this.mirroringShapeCharacters.setValue(123,125),this.mirroringShapeCharacters.setValue(125,123),this.mirroringShapeCharacters.setValue(171,187),this.mirroringShapeCharacters.setValue(187,171),this.mirroringShapeCharacters.setValue(8249,8250),this.mirroringShapeCharacters.setValue(8250,8249),this.mirroringShapeCharacters.setValue(8261,8262),this.mirroringShapeCharacters.setValue(8262,8261),this.mirroringShapeCharacters.setValue(8317,8318),this.mirroringShapeCharacters.setValue(8318,8317),this.mirroringShapeCharacters.setValue(8333,8334),this.mirroringShapeCharacters.setValue(8334,8333),this.mirroringShapeCharacters.setValue(8712,8715),this.mirroringShapeCharacters.setValue(8713,8716),this.mirroringShapeCharacters.setValue(8714,8717),this.mirroringShapeCharacters.setValue(8715,8712),this.mirroringShapeCharacters.setValue(8716,8713),this.mirroringShapeCharacters.setValue(8717,8714),this.mirroringShapeCharacters.setValue(8725,10741),this.mirroringShapeCharacters.setValue(8764,8765),this.mirroringShapeCharacters.setValue(8765,8764),this.mirroringShapeCharacters.setValue(8771,8909),this.mirroringShapeCharacters.setValue(8786,8787),this.mirroringShapeCharacters.setValue(8787,8786),this.mirroringShapeCharacters.setValue(8788,8789),this.mirroringShapeCharacters.setValue(8789,8788),this.mirroringShapeCharacters.setValue(8804,8805),this.mirroringShapeCharacters.setValue(8805,8804),this.mirroringShapeCharacters.setValue(8806,8807),this.mirroringShapeCharacters.setValue(8807,8806),this.mirroringShapeCharacters.setValue(8808,8809),this.mirroringShapeCharacters.setValue(8809,8808),this.mirroringShapeCharacters.setValue(8810,8811),this.mirroringShapeCharacters.setValue(8811,8810),this.mirroringShapeCharacters.setValue(8814,8815),this.mirroringShapeCharacters.setValue(8815,8814),this.mirroringShapeCharacters.setValue(8816,8817),this.mirroringShapeCharacters.setValue(8817,8816),this.mirroringShapeCharacters.setValue(8818,8819),this.mirroringShapeCharacters.setValue(8819,8818),this.mirroringShapeCharacters.setValue(8820,8821),this.mirroringShapeCharacters.setValue(8821,8820),this.mirroringShapeCharacters.setValue(8822,8823),this.mirroringShapeCharacters.setValue(8823,8822),this.mirroringShapeCharacters.setValue(8824,8825),this.mirroringShapeCharacters.setValue(8825,8824),this.mirroringShapeCharacters.setValue(8826,8827),this.mirroringShapeCharacters.setValue(8827,8826),this.mirroringShapeCharacters.setValue(8828,8829),this.mirroringShapeCharacters.setValue(8829,8828),this.mirroringShapeCharacters.setValue(8830,8831),this.mirroringShapeCharacters.setValue(8831,8830),this.mirroringShapeCharacters.setValue(8832,8833),this.mirroringShapeCharacters.setValue(8833,8832),this.mirroringShapeCharacters.setValue(8834,8835),this.mirroringShapeCharacters.setValue(8835,8834),this.mirroringShapeCharacters.setValue(8836,8837),this.mirroringShapeCharacters.setValue(8837,8836),this.mirroringShapeCharacters.setValue(8838,8839),this.mirroringShapeCharacters.setValue(8839,8838),this.mirroringShapeCharacters.setValue(8840,8841),this.mirroringShapeCharacters.setValue(8841,8840),this.mirroringShapeCharacters.setValue(8842,8843),this.mirroringShapeCharacters.setValue(8843,8842),this.mirroringShapeCharacters.setValue(8847,8848),this.mirroringShapeCharacters.setValue(8848,8847),this.mirroringShapeCharacters.setValue(8849,8850),this.mirroringShapeCharacters.setValue(8850,8849),this.mirroringShapeCharacters.setValue(8856,10680),this.mirroringShapeCharacters.setValue(8866,8867),this.mirroringShapeCharacters.setValue(8867,8866),this.mirroringShapeCharacters.setValue(8870,10974),this.mirroringShapeCharacters.setValue(8872,10980),this.mirroringShapeCharacters.setValue(8873,10979),this.mirroringShapeCharacters.setValue(8875,10981),this.mirroringShapeCharacters.setValue(8880,8881),this.mirroringShapeCharacters.setValue(8881,8880),this.mirroringShapeCharacters.setValue(8882,8883),this.mirroringShapeCharacters.setValue(8883,8882),this.mirroringShapeCharacters.setValue(8884,8885),this.mirroringShapeCharacters.setValue(8885,8884),this.mirroringShapeCharacters.setValue(8886,8887),this.mirroringShapeCharacters.setValue(8887,8886),this.mirroringShapeCharacters.setValue(8905,8906),this.mirroringShapeCharacters.setValue(8906,8905),this.mirroringShapeCharacters.setValue(8907,8908),this.mirroringShapeCharacters.setValue(8908,8907),this.mirroringShapeCharacters.setValue(8909,8771),this.mirroringShapeCharacters.setValue(8912,8913),this.mirroringShapeCharacters.setValue(8913,8912),this.mirroringShapeCharacters.setValue(8918,8919),this.mirroringShapeCharacters.setValue(8919,8918),this.mirroringShapeCharacters.setValue(8920,8921),this.mirroringShapeCharacters.setValue(8921,8920),this.mirroringShapeCharacters.setValue(8922,8923),this.mirroringShapeCharacters.setValue(8923,8922),this.mirroringShapeCharacters.setValue(8924,8925),this.mirroringShapeCharacters.setValue(8925,8924),this.mirroringShapeCharacters.setValue(8926,8927),this.mirroringShapeCharacters.setValue(8927,8926),this.mirroringShapeCharacters.setValue(8928,8929),this.mirroringShapeCharacters.setValue(8929,8928),this.mirroringShapeCharacters.setValue(8930,8931),this.mirroringShapeCharacters.setValue(8931,8930),this.mirroringShapeCharacters.setValue(8932,8933),this.mirroringShapeCharacters.setValue(8933,8932),this.mirroringShapeCharacters.setValue(8934,8935),this.mirroringShapeCharacters.setValue(8935,8934),this.mirroringShapeCharacters.setValue(8936,8937),this.mirroringShapeCharacters.setValue(8937,8936),this.mirroringShapeCharacters.setValue(8938,8939),this.mirroringShapeCharacters.setValue(8939,8938),this.mirroringShapeCharacters.setValue(8940,8941),this.mirroringShapeCharacters.setValue(8941,8940),this.mirroringShapeCharacters.setValue(8944,8945),this.mirroringShapeCharacters.setValue(8945,8944),this.mirroringShapeCharacters.setValue(8946,8954),this.mirroringShapeCharacters.setValue(8947,8955),this.mirroringShapeCharacters.setValue(8948,8956),this.mirroringShapeCharacters.setValue(8950,8957),this.mirroringShapeCharacters.setValue(8951,8958),this.mirroringShapeCharacters.setValue(8954,8946),this.mirroringShapeCharacters.setValue(8955,8947),this.mirroringShapeCharacters.setValue(8956,8948),this.mirroringShapeCharacters.setValue(8957,8950),this.mirroringShapeCharacters.setValue(8958,8951),this.mirroringShapeCharacters.setValue(8968,8969),this.mirroringShapeCharacters.setValue(8969,8968),this.mirroringShapeCharacters.setValue(8970,8971),this.mirroringShapeCharacters.setValue(8971,8970),this.mirroringShapeCharacters.setValue(9001,9002),this.mirroringShapeCharacters.setValue(9002,9001),this.mirroringShapeCharacters.setValue(10088,10089),this.mirroringShapeCharacters.setValue(10089,10088),this.mirroringShapeCharacters.setValue(10090,10091),this.mirroringShapeCharacters.setValue(10091,10090),this.mirroringShapeCharacters.setValue(10092,10093),this.mirroringShapeCharacters.setValue(10093,10092),this.mirroringShapeCharacters.setValue(10094,10095),this.mirroringShapeCharacters.setValue(10095,10094),this.mirroringShapeCharacters.setValue(10096,10097),this.mirroringShapeCharacters.setValue(10097,10096),this.mirroringShapeCharacters.setValue(10098,10099),this.mirroringShapeCharacters.setValue(10099,10098),this.mirroringShapeCharacters.setValue(10100,10101),this.mirroringShapeCharacters.setValue(10101,10100),this.mirroringShapeCharacters.setValue(10197,10198),this.mirroringShapeCharacters.setValue(10198,10197),this.mirroringShapeCharacters.setValue(10205,10206),this.mirroringShapeCharacters.setValue(10206,10205),this.mirroringShapeCharacters.setValue(10210,10211),this.mirroringShapeCharacters.setValue(10211,10210),this.mirroringShapeCharacters.setValue(10212,10213),this.mirroringShapeCharacters.setValue(10213,10212),this.mirroringShapeCharacters.setValue(10214,10215),this.mirroringShapeCharacters.setValue(10215,10214),this.mirroringShapeCharacters.setValue(10216,10217),this.mirroringShapeCharacters.setValue(10217,10216),this.mirroringShapeCharacters.setValue(10218,10219),this.mirroringShapeCharacters.setValue(10219,10218),this.mirroringShapeCharacters.setValue(10627,10628),this.mirroringShapeCharacters.setValue(10628,10627),this.mirroringShapeCharacters.setValue(10629,10630),this.mirroringShapeCharacters.setValue(10630,10629),this.mirroringShapeCharacters.setValue(10631,10632),this.mirroringShapeCharacters.setValue(10632,10631),this.mirroringShapeCharacters.setValue(10633,10634),this.mirroringShapeCharacters.setValue(10634,10633),this.mirroringShapeCharacters.setValue(10635,10636),this.mirroringShapeCharacters.setValue(10636,10635),this.mirroringShapeCharacters.setValue(10637,10640),this.mirroringShapeCharacters.setValue(10638,10639),this.mirroringShapeCharacters.setValue(10639,10638),this.mirroringShapeCharacters.setValue(10640,10637),this.mirroringShapeCharacters.setValue(10641,10642),this.mirroringShapeCharacters.setValue(10642,10641),this.mirroringShapeCharacters.setValue(10643,10644),this.mirroringShapeCharacters.setValue(10644,10643),this.mirroringShapeCharacters.setValue(10645,10646),this.mirroringShapeCharacters.setValue(10646,10645),this.mirroringShapeCharacters.setValue(10647,10648),this.mirroringShapeCharacters.setValue(10648,10647),this.mirroringShapeCharacters.setValue(10680,8856),this.mirroringShapeCharacters.setValue(10688,10689),this.mirroringShapeCharacters.setValue(10689,10688),this.mirroringShapeCharacters.setValue(10692,10693),this.mirroringShapeCharacters.setValue(10693,10692),this.mirroringShapeCharacters.setValue(10703,10704),this.mirroringShapeCharacters.setValue(10704,10703),this.mirroringShapeCharacters.setValue(10705,10706),this.mirroringShapeCharacters.setValue(10706,10705),this.mirroringShapeCharacters.setValue(10708,10709),this.mirroringShapeCharacters.setValue(10709,10708),this.mirroringShapeCharacters.setValue(10712,10713),this.mirroringShapeCharacters.setValue(10713,10712),this.mirroringShapeCharacters.setValue(10714,10715),this.mirroringShapeCharacters.setValue(10715,10714),this.mirroringShapeCharacters.setValue(10741,8725),this.mirroringShapeCharacters.setValue(10744,10745),this.mirroringShapeCharacters.setValue(10745,10744),this.mirroringShapeCharacters.setValue(10748,10749),this.mirroringShapeCharacters.setValue(10749,10748),this.mirroringShapeCharacters.setValue(10795,10796),this.mirroringShapeCharacters.setValue(10796,10795),this.mirroringShapeCharacters.setValue(10797,10796),this.mirroringShapeCharacters.setValue(10798,10797),this.mirroringShapeCharacters.setValue(10804,10805),this.mirroringShapeCharacters.setValue(10805,10804),this.mirroringShapeCharacters.setValue(10812,10813),this.mirroringShapeCharacters.setValue(10813,10812),this.mirroringShapeCharacters.setValue(10852,10853),this.mirroringShapeCharacters.setValue(10853,10852),this.mirroringShapeCharacters.setValue(10873,10874),this.mirroringShapeCharacters.setValue(10874,10873),this.mirroringShapeCharacters.setValue(10877,10878),this.mirroringShapeCharacters.setValue(10878,10877),this.mirroringShapeCharacters.setValue(10879,10880),this.mirroringShapeCharacters.setValue(10880,10879),this.mirroringShapeCharacters.setValue(10881,10882),this.mirroringShapeCharacters.setValue(10882,10881),this.mirroringShapeCharacters.setValue(10883,10884),this.mirroringShapeCharacters.setValue(10884,10883),this.mirroringShapeCharacters.setValue(10891,10892),this.mirroringShapeCharacters.setValue(10892,10891),this.mirroringShapeCharacters.setValue(10897,10898),this.mirroringShapeCharacters.setValue(10898,10897),this.mirroringShapeCharacters.setValue(10899,10900),this.mirroringShapeCharacters.setValue(10900,10899),this.mirroringShapeCharacters.setValue(10901,10902),this.mirroringShapeCharacters.setValue(10902,10901),this.mirroringShapeCharacters.setValue(10903,10904),this.mirroringShapeCharacters.setValue(10904,10903),this.mirroringShapeCharacters.setValue(10905,10906),this.mirroringShapeCharacters.setValue(10906,10905),this.mirroringShapeCharacters.setValue(10907,10908),this.mirroringShapeCharacters.setValue(10908,10907),this.mirroringShapeCharacters.setValue(10913,10914),this.mirroringShapeCharacters.setValue(10914,10913),this.mirroringShapeCharacters.setValue(10918,10919),this.mirroringShapeCharacters.setValue(10919,10918),this.mirroringShapeCharacters.setValue(10920,10921),this.mirroringShapeCharacters.setValue(10921,10920),this.mirroringShapeCharacters.setValue(10922,10923),this.mirroringShapeCharacters.setValue(10923,10922),this.mirroringShapeCharacters.setValue(10924,10925),this.mirroringShapeCharacters.setValue(10925,10924),this.mirroringShapeCharacters.setValue(10927,10928),this.mirroringShapeCharacters.setValue(10928,10927),this.mirroringShapeCharacters.setValue(10931,10932),this.mirroringShapeCharacters.setValue(10932,10931),this.mirroringShapeCharacters.setValue(10939,10940),this.mirroringShapeCharacters.setValue(10940,10939),this.mirroringShapeCharacters.setValue(10941,10942),this.mirroringShapeCharacters.setValue(10942,10941),this.mirroringShapeCharacters.setValue(10943,10944),this.mirroringShapeCharacters.setValue(10944,10943),this.mirroringShapeCharacters.setValue(10945,10946),this.mirroringShapeCharacters.setValue(10946,10945),this.mirroringShapeCharacters.setValue(10947,10948),this.mirroringShapeCharacters.setValue(10948,10947),this.mirroringShapeCharacters.setValue(10949,10950),this.mirroringShapeCharacters.setValue(10950,10949),this.mirroringShapeCharacters.setValue(10957,10958),this.mirroringShapeCharacters.setValue(10958,10957),this.mirroringShapeCharacters.setValue(10959,10960),this.mirroringShapeCharacters.setValue(10960,10959),this.mirroringShapeCharacters.setValue(10961,10962),this.mirroringShapeCharacters.setValue(10962,10961),this.mirroringShapeCharacters.setValue(10963,10964),this.mirroringShapeCharacters.setValue(10964,10963),this.mirroringShapeCharacters.setValue(10965,10966),this.mirroringShapeCharacters.setValue(10966,10965),this.mirroringShapeCharacters.setValue(10974,8870),this.mirroringShapeCharacters.setValue(10979,8873),this.mirroringShapeCharacters.setValue(10980,8872),this.mirroringShapeCharacters.setValue(10981,8875),this.mirroringShapeCharacters.setValue(10988,10989),this.mirroringShapeCharacters.setValue(10989,10988),this.mirroringShapeCharacters.setValue(10999,11e3),this.mirroringShapeCharacters.setValue(11e3,10999),this.mirroringShapeCharacters.setValue(11001,11002),this.mirroringShapeCharacters.setValue(11002,11001),this.mirroringShapeCharacters.setValue(12296,12297),this.mirroringShapeCharacters.setValue(12297,12296),this.mirroringShapeCharacters.setValue(12298,12299),this.mirroringShapeCharacters.setValue(12299,12298),this.mirroringShapeCharacters.setValue(12300,12301),this.mirroringShapeCharacters.setValue(12301,12300),this.mirroringShapeCharacters.setValue(12302,12303),this.mirroringShapeCharacters.setValue(12303,12302),this.mirroringShapeCharacters.setValue(12304,12305),this.mirroringShapeCharacters.setValue(12305,12304),this.mirroringShapeCharacters.setValue(12308,12309),this.mirroringShapeCharacters.setValue(12309,12308),this.mirroringShapeCharacters.setValue(12310,12311),this.mirroringShapeCharacters.setValue(12311,12310),this.mirroringShapeCharacters.setValue(12312,12313),this.mirroringShapeCharacters.setValue(12313,12312),this.mirroringShapeCharacters.setValue(12314,12315),this.mirroringShapeCharacters.setValue(12315,12314),this.mirroringShapeCharacters.setValue(65288,65289),this.mirroringShapeCharacters.setValue(65289,65288),this.mirroringShapeCharacters.setValue(65308,65310),this.mirroringShapeCharacters.setValue(65310,65308),this.mirroringShapeCharacters.setValue(65339,65341),this.mirroringShapeCharacters.setValue(65341,65339),this.mirroringShapeCharacters.setValue(65371,65373),this.mirroringShapeCharacters.setValue(65373,65371),this.mirroringShapeCharacters.setValue(65375,65376),this.mirroringShapeCharacters.setValue(65376,65375),this.mirroringShapeCharacters.setValue(65378,65379),this.mirroringShapeCharacters.setValue(65379,65378)},t}(),Ut=function(){function t(){this.types=[],this.textOrder=-1,this.rtlCharacterTypes=new Array(65536),this.L=0,this.LRE=1,this.LRO=2,this.R=3,this.AL=4,this.RLE=5,this.RLO=6,this.PDF=7,this.EN=8,this.ES=9,this.ET=10,this.AN=11,this.CS=12,this.NSM=13,this.BN=14,this.B=15,this.S=16,this.WS=17,this.ON=18,this.charTypes=[this.L,this.EN,this.BN,this.ES,this.ES,this.S,this.ET,this.ET,this.B,this.AN,this.AN,this.S,this.CS,this.CS,this.WS,this.NSM,this.NSM,this.B,this.BN,27,this.BN,28,30,this.B,31,31,this.S,32,32,this.WS,33,34,this.ON,35,37,this.ET,38,42,this.ON,43,43,this.ET,44,44,this.CS,45,45,this.ET,46,46,this.CS,47,47,this.CS,48,57,this.EN,58,58,this.CS,59,64,this.ON,65,90,this.L,91,96,this.ON,97,122,this.L,123,126,this.ON,127,132,this.BN,133,133,this.B,134,159,this.BN,160,160,this.CS,161,161,this.ON,162,165,this.ET,166,169,this.ON,170,170,this.L,171,175,this.ON,176,177,this.ET,178,179,this.EN,180,180,this.ON,181,181,this.L,182,184,this.ON,185,185,this.EN,186,186,this.L,187,191,this.ON,192,214,this.L,215,215,this.ON,216,246,this.L,247,247,this.ON,248,696,this.L,697,698,this.ON,699,705,this.L,706,719,this.ON,720,721,this.L,722,735,this.ON,736,740,this.L,741,749,this.ON,750,750,this.L,751,767,this.ON,768,855,this.NSM,856,860,this.L,861,879,this.NSM,880,883,this.L,884,885,this.ON,886,893,this.L,894,894,this.ON,895,899,this.L,900,901,this.ON,902,902,this.L,903,903,this.ON,904,1013,this.L,1014,1014,this.ON,1015,1154,this.L,1155,1158,this.NSM,1159,1159,this.L,1160,1161,this.NSM,1162,1417,this.L,1418,1418,this.ON,1419,1424,this.L,1425,1441,this.NSM,1442,1442,this.L,1443,1465,this.NSM,1466,1466,this.L,1467,1469,this.NSM,1470,1470,this.R,1471,1471,this.NSM,1472,1472,this.R,1473,1474,this.NSM,1475,1475,this.R,1476,1476,this.NSM,1477,1487,this.L,1488,1514,this.R,1515,1519,this.L,1520,1524,this.R,1525,1535,this.L,1536,1539,this.AL,1540,1547,this.L,1548,1548,this.CS,1549,1549,this.AL,1550,1551,this.ON,1552,1557,this.NSM,1558,1562,this.L,1563,1563,this.AL,1564,1566,this.L,1567,1567,this.AL,1568,1568,this.L,1569,1594,this.AL,1595,1599,this.L,1600,1610,this.AL,1611,1624,this.NSM,1625,1631,this.L,1632,1641,this.AN,1642,1642,this.ET,1643,1644,this.AN,1645,1647,this.AL,1648,1648,this.NSM,1649,1749,this.AL,1750,1756,this.NSM,1757,1757,this.AL,1758,1764,this.NSM,1765,1766,this.AL,1767,1768,this.NSM,1769,1769,this.ON,1770,1773,this.NSM,1774,1775,this.AL,1776,1785,this.EN,1786,1805,this.AL,1806,1806,this.L,1807,1807,this.BN,1808,1808,this.AL,1809,1809,this.NSM,1810,1839,this.AL,1840,1866,this.NSM,1867,1868,this.L,1869,1871,this.AL,1872,1919,this.L,1920,1957,this.AL,1958,1968,this.NSM,1969,1969,this.AL,1970,2304,this.L,2305,2306,this.NSM,2307,2363,this.L,2364,2364,this.NSM,2365,2368,this.L,2369,2376,this.NSM,2377,2380,this.L,2381,2381,this.NSM,2382,2384,this.L,2385,2388,this.NSM,2389,2401,this.L,2402,2403,this.NSM,2404,2432,this.L,2433,2433,this.NSM,2434,2491,this.L,2492,2492,this.NSM,2493,2496,this.L,2497,2500,this.NSM,2501,2508,this.L,2509,2509,this.NSM,2510,2529,this.L,2530,2531,this.NSM,2532,2545,this.L,2546,2547,this.ET,2548,2560,this.L,2561,2562,this.NSM,2563,2619,this.L,2620,2620,this.NSM,2621,2624,this.L,2625,2626,this.NSM,2627,2630,this.L,2631,2632,this.NSM,2633,2634,this.L,2635,2637,this.NSM,2638,2671,this.L,2672,2673,this.NSM,2674,2688,this.L,2689,2690,this.NSM,2691,2747,this.L,2748,2748,this.NSM,2749,2752,this.L,2753,2757,this.NSM,2758,2758,this.L,2759,2760,this.NSM,2761,2764,this.L,2765,2765,this.NSM,2766,2785,this.L,2786,2787,this.NSM,2788,2800,this.L,2801,2801,this.ET,2802,2816,this.L,2817,2817,this.NSM,2818,2875,this.L,2876,2876,this.NSM,2877,2878,this.L,2879,2879,this.NSM,2880,2880,this.L,2881,2883,this.NSM,2884,2892,this.L,2893,2893,this.NSM,2894,2901,this.L,2902,2902,this.NSM,2903,2945,this.L,2946,2946,this.NSM,2947,3007,this.L,3008,3008,this.NSM,3009,3020,this.L,3021,3021,this.NSM,3022,3058,this.L,3059,3064,this.ON,3065,3065,this.ET,3066,3066,this.ON,3067,3133,this.L,3134,3136,this.NSM,3137,3141,this.L,3142,3144,this.NSM,3145,3145,this.L,3146,3149,this.NSM,3150,3156,this.L,3157,3158,this.NSM,3159,3259,this.L,3260,3260,this.NSM,3261,3275,this.L,3276,3277,this.NSM,3278,3392,this.L,3393,3395,this.NSM,3396,3404,this.L,3405,3405,this.NSM,3406,3529,this.L,3530,3530,this.NSM,3531,3537,this.L,3538,3540,this.NSM,3541,3541,this.L,3542,3542,this.NSM,3543,3632,this.L,3633,3633,this.NSM,3634,3635,this.L,3636,3642,this.NSM,3643,3646,this.L,3647,3647,this.ET,3648,3654,this.L,3655,3662,this.NSM,3663,3760,this.L,3761,3761,this.NSM,3762,3763,this.L,3764,3769,this.NSM,3770,3770,this.L,3771,3772,this.NSM,3773,3783,this.L,3784,3789,this.NSM,3790,3863,this.L,3864,3865,this.NSM,3866,3892,this.L,3893,3893,this.NSM,3894,3894,this.L,3895,3895,this.NSM,3896,3896,this.L,3897,3897,this.NSM,3898,3901,this.ON,3902,3952,this.L,3953,3966,this.NSM,3967,3967,this.L,3968,3972,this.NSM,3973,3973,this.L,3974,3975,this.NSM,3976,3983,this.L,3984,3991,this.NSM,3992,3992,this.L,3993,4028,this.NSM,4029,4037,this.L,4038,4038,this.NSM,4039,4140,this.L,4141,4144,this.NSM,4145,4145,this.L,4146,4146,this.NSM,4147,4149,this.L,4150,4151,this.NSM,4152,4152,this.L,4153,4153,this.NSM,4154,4183,this.L,4184,4185,this.NSM,4186,5759,this.L,5760,5760,this.WS,5761,5786,this.L,5787,5788,this.ON,5789,5905,this.L,5906,5908,this.NSM,5909,5937,this.L,5938,5940,this.NSM,5941,5969,this.L,5970,5971,this.NSM,5972,6001,this.L,6002,6003,this.NSM,6004,6070,this.L,6071,6077,this.NSM,6078,6085,this.L,6086,6086,this.NSM,6087,6088,this.L,6089,6099,this.NSM,6100,6106,this.L,6107,6107,this.ET,6108,6108,this.L,6109,6109,this.NSM,6110,6127,this.L,6128,6137,this.ON,6138,6143,this.L,6144,6154,this.ON,6155,6157,this.NSM,6158,6158,this.WS,6159,6312,this.L,6313,6313,this.NSM,6314,6431,this.L,6432,6434,this.NSM,6435,6438,this.L,6439,6443,this.NSM,6444,6449,this.L,6450,6450,this.NSM,6451,6456,this.L,6457,6459,this.NSM,6460,6463,this.L,6464,6464,this.ON,6465,6467,this.L,6468,6469,this.ON,6470,6623,this.L,6624,6655,this.ON,6656,8124,this.L,8125,8125,this.ON,8126,8126,this.L,8127,8129,this.ON,8130,8140,this.L,8141,8143,this.ON,8144,8156,this.L,8157,8159,this.ON,8160,8172,this.L,8173,8175,this.ON,8176,8188,this.L,8189,8190,this.ON,8191,8191,this.L,8192,8202,this.WS,8203,8205,this.BN,8206,8206,this.L,8207,8207,this.R,8208,8231,this.ON,8232,8232,this.WS,8233,8233,this.B,8234,8234,this.LRE,8235,8235,this.RLE,8236,8236,this.PDF,8237,8237,this.LRO,8238,8238,this.RLO,8239,8239,this.WS,8240,8244,this.ET,8245,8276,this.ON,8277,8278,this.L,8279,8279,this.ON,8280,8286,this.L,8287,8287,this.WS,8288,8291,this.BN,8292,8297,this.L,8298,8303,this.BN,8304,8304,this.EN,8305,8307,this.L,8308,8313,this.EN,8314,8315,this.ET,8316,8318,this.ON,8319,8319,this.L,8320,8329,this.EN,8330,8331,this.ET,8332,8334,this.ON,8335,8351,this.L,8352,8369,this.ET,8370,8399,this.L,8400,8426,this.NSM,8427,8447,this.L,8448,8449,this.ON,8450,8450,this.L,8451,8454,this.ON,8455,8455,this.L,8456,8457,this.ON,8458,8467,this.L,8468,8468,this.ON,8469,8469,this.L,8470,8472,this.ON,8473,8477,this.L,8478,8483,this.ON,8484,8484,this.L,8485,8485,this.ON,8486,8486,this.L,8487,8487,this.ON,8488,8488,this.L,8489,8489,this.ON,8490,8493,this.L,8494,8494,this.ET,8495,8497,this.L,8498,8498,this.ON,8499,8505,this.L,8506,8507,this.ON,8508,8511,this.L,8512,8516,this.ON,8517,8521,this.L,8522,8523,this.ON,8524,8530,this.L,8531,8543,this.ON,8544,8591,this.L,8592,8721,this.ON,8722,8723,this.ET,8724,9013,this.ON,9014,9082,this.L,9083,9108,this.ON,9109,9109,this.L,9110,9168,this.ON,9169,9215,this.L,9216,9254,this.ON,9255,9279,this.L,9280,9290,this.ON,9291,9311,this.L,9312,9371,this.EN,9372,9449,this.L,9450,9450,this.EN,9451,9751,this.ON,9752,9752,this.L,9753,9853,this.ON,9854,9855,this.L,9856,9873,this.ON,9874,9887,this.L,9888,9889,this.ON,9890,9984,this.L,9985,9988,this.ON,9989,9989,this.L,9990,9993,this.ON,9994,9995,this.L,9996,10023,this.ON,10024,10024,this.L,10025,10059,this.ON,10060,10060,this.L,10061,10061,this.ON,10062,10062,this.L,10063,10066,this.ON,10067,10069,this.L,10070,10070,this.ON,10071,10071,this.L,10072,10078,this.ON,10079,10080,this.L,10081,10132,this.ON,10133,10135,this.L,10136,10159,this.ON,10160,10160,this.L,10161,10174,this.ON,10175,10191,this.L,10192,10219,this.ON,10220,10223,this.L,10224,11021,this.ON,11022,11903,this.L,11904,11929,this.ON,11930,11930,this.L,11931,12019,this.ON,12020,12031,this.L,12032,12245,this.ON,12246,12271,this.L,12272,12283,this.ON,12284,12287,this.L,12288,12288,this.WS,12289,12292,this.ON,12293,12295,this.L,12296,12320,this.ON,12321,12329,this.L,12330,12335,this.NSM,12336,12336,this.ON,12337,12341,this.L,12342,12343,this.ON,12344,12348,this.L,12349,12351,this.ON,12352,12440,this.L,12441,12442,this.NSM,12443,12444,this.ON,12445,12447,this.L,12448,12448,this.ON,12449,12538,this.L,12539,12539,this.ON,12540,12828,this.L,12829,12830,this.ON,12831,12879,this.L,12880,12895,this.ON,12896,12923,this.L,12924,12925,this.ON,12926,12976,this.L,12977,12991,this.ON,12992,13003,this.L,13004,13007,this.ON,13008,13174,this.L,13175,13178,this.ON,13179,13277,this.L,13278,13279,this.ON,13280,13310,this.L,13311,13311,this.ON,13312,19903,this.L,19904,19967,this.ON,19968,42127,this.L,42128,42182,this.ON,42183,64284,this.L,64285,64285,this.R,64286,64286,this.NSM,64287,64296,this.R,64297,64297,this.ET,64298,64310,this.R,64311,64311,this.L,64312,64316,this.R,64317,64317,this.L,64318,64318,this.R,64319,64319,this.L,64320,64321,this.R,64322,64322,this.L,64323,64324,this.R,64325,64325,this.L,64326,64335,this.R,64336,64433,this.AL,64434,64466,this.L,64467,64829,this.AL,64830,64831,this.ON,64832,64847,this.L,64848,64911,this.AL,64912,64913,this.L,64914,64967,this.AL,64968,65007,this.L,65008,65020,this.AL,65021,65021,this.ON,65022,65023,this.L,65024,65039,this.NSM,65040,65055,this.L,65056,65059,this.NSM,65060,65071,this.L,65072,65103,this.ON,65104,65104,this.CS,65105,65105,this.ON,65106,65106,this.CS,65107,65107,this.L,65108,65108,this.ON,65109,65109,this.CS,65110,65118,this.ON,65119,65119,this.ET,65120,65121,this.ON,65122,65123,this.ET,65124,65126,this.ON,65127,65127,this.L,65128,65128,this.ON,65129,65130,this.ET,65131,65131,this.ON,65132,65135,this.L,65136,65140,this.AL,65141,65141,this.L,65142,65276,this.AL,65277,65278,this.L,65279,65279,this.BN,65280,65280,this.L,65281,65282,this.ON,65283,65285,this.ET,65286,65290,this.ON,65291,65291,this.ET,65292,65292,this.CS,65293,65293,this.ET,65294,65294,this.CS,65295,65295,this.ES,65296,65305,this.EN,65306,65306,this.CS,65307,65312,this.ON,65313,65338,this.L,65339,65344,this.ON,65345,65370,this.L,65371,65381,this.ON,65382,65503,this.L,65504,65505,this.ET,65506,65508,this.ON,65509,65510,this.ET,65511,65511,this.L,65512,65518,this.ON,65519,65528,this.L,65529,65531,this.BN,65532,65533,this.ON,65534,65535,this.L];for(var t=0;t<this.charTypes.length;++t)for(var e=this.charTypes[t],i=this.charTypes[++t],r=this.charTypes[++t];e<=i;)this.rtlCharacterTypes[e++]=r}return t.prototype.getVisualOrder=function(t,e){this.types=this.getCharacterCode(t),this.textOrder=e?this.LRE:this.L,this.doVisualOrder();for(var i=[],r=0;r<this.levels.length;r++)i[r]=this.levels[r];return i},t.prototype.getCharacterCode=function(t){for(var e=[],i=0;i<t.length;i++)e[i]=this.rtlCharacterTypes[t[i].charCodeAt(0)];return e},t.prototype.setDefaultLevels=function(){for(var t=0;t<this.length;t++)this.levels[t]=this.textOrder},t.prototype.setLevels=function(){this.setDefaultLevels();for(var t=0;t<this.length;++t){var e=this.levels[t];0!=(128&e)&&(e&=127,this.result[t]=0==(1&e)?this.L:this.R),this.levels[t]=e}},t.prototype.updateLevels=function(t,e,i){if(0==(1&e))for(var r=t;r<i;++r)this.result[r]===this.R?this.levels[r]+=1:this.result[r]!==this.L&&(this.levels[r]+=2);else for(r=t;r<i;++r)this.result[r]!==this.R&&(this.levels[r]+=1)},t.prototype.doVisualOrder=function(){this.length=this.types.length,this.result=this.types,this.levels=[],this.setLevels(),this.length=this.getEmbeddedCharactersLength();for(var t=this.textOrder,e=0;e<this.length;){for(var i=this.levels[e],r=0==(1&Math.max(t,i))?this.L:this.R,n=e+1;n<this.length&&this.levels[n]===i;)++n;var o=n<this.length?this.levels[n]:this.textOrder,s=0==(1&Math.max(o,i))?this.L:this.R;this.checkNSM(e,n,i,r,s),this.updateLevels(e,i,n),t=i,e=n}this.checkEmbeddedCharacters(this.length)},t.prototype.getEmbeddedCharactersLength=function(){for(var t=0,e=0;e<this.length;++e)this.types[e]!==this.LRE&&this.types[e]!==this.RLE&&this.types[e]!==this.LRO&&this.types[e]!==this.RLO&&this.types[e]!==this.PDF&&this.types[e]!==this.BN&&(this.result[t]=this.result[e],this.levels[t]=this.levels[e],t++);return t},t.prototype.checkEmbeddedCharacters=function(t){for(var e=this.types.length-1;e>=0;--e)this.types[e]===this.LRE||this.types[e]===this.RLE||this.types[e]===this.LRO||this.types[e]===this.RLO||this.types[e]===this.PDF||this.types[e]===this.BN?(this.result[e]=this.types[e],this.levels[e]=-1):(t-=1,this.result[e]=this.result[t],this.levels[e]=this.levels[t]);for(e=0;e<this.types.length;e++)-1===this.levels[e]&&(this.levels[e]=0===e?this.textOrder:this.levels[e-1])},t.prototype.checkNSM=function(t,e,i,r,n){for(var o=r,s=t;s<e;++s)this.result[s]===this.NSM?this.result[s]=o:o=this.result[s];this.checkEuropeanDigits(t,e,i,r,n)},t.prototype.checkEuropeanDigits=function(t,e,i,r,n){for(var o=t;o<e;++o)if(this.result[o]===this.EN)for(var s=o-1;s>=t;--s)if(this.result[s]===this.L||this.result[s]===this.R||this.result[s]===this.AL){this.result[s]===this.AL&&(this.result[o]=this.AN);break}this.checkArabicCharacters(t,e,i,r,n)},t.prototype.checkArabicCharacters=function(t,e,i,r,n){for(var o=t;o<e;++o)this.result[o]===this.AL&&(this.result[o]=this.R);this.checkEuropeanNumberSeparator(t,e,i,r,n)},t.prototype.checkEuropeanNumberSeparator=function(t,e,i,r,n){for(var o=t+1;o<e-1;++o)if(this.result[o]===this.ES||this.result[o]===this.CS){var s=this.result[o-1],a=this.result[o+1];s===this.EN&&a===this.EN?this.result[o]=this.EN:this.result[o]===this.CS&&s===this.AN&&a===this.AN&&(this.result[o]=this.AN)}this.checkEuropeanNumberTerminator(t,e,i,r,n)},t.prototype.checkEuropeanNumberTerminator=function(t,e,i,r,n){for(var o=t;o<e;++o)if(this.result[o]===this.ET){var s=o,a=[];a.push(this.ET);var h=this.getLength(s,e,a),l=s===t?r:this.result[s-1];if(l!==this.EN&&(l=h===e?n:this.result[h]),l===this.EN)for(var u=s;u<h;++u)this.result[u]=this.EN;o=h}this.checkOtherNeutrals(t,e,i,r,n)},t.prototype.checkOtherNeutrals=function(t,e,i,r,n){for(var o=t;o<e;++o)this.result[o]!==this.ES&&this.result[o]!==this.ET&&this.result[o]!==this.CS||(this.result[o]=this.ON);this.checkOtherCharacters(t,e,i,r,n)},t.prototype.checkOtherCharacters=function(t,e,i,r,n){for(var o=t;o<e;++o)if(this.result[o]===this.EN){for(var s=r,a=o-1;a>=t;--a)if(this.result[a]===this.L||this.result[a]===this.R){s=this.result[a];break}s===this.L&&(this.result[o]=this.L)}this.checkCommanCharacters(t,e,i,r,n)},t.prototype.getLength=function(t,e,i){for(--t;++t<e;){for(var r=this.result[t],n=0;n<i.length;++n)r===i[n]&&(t=this.getLength(++t,e,i));return t}return e},t.prototype.checkCommanCharacters=function(t,e,i,r,n){for(var o=t;o<e;++o)if(this.result[o]===this.WS||this.result[o]===this.ON||this.result[o]===this.B||this.result[o]===this.S){var s=o,a=[this.B,this.S,this.WS,this.ON],h=this.getLength(s,e,a),l=0,u=0,c=0;s===t?l=r:(l=this.result[s-1])===this.AN?l=this.R:l===this.EN&&(l=this.R),h===e?u=n:(u=this.result[h])===this.AN?u=this.R:u===this.EN&&(u=this.R),c=l===u?l:0==(1&i)?this.L:this.R;for(var p=s;p<h;++p)this.result[p]=c;o=h}},t}(),Kt=function(){function e(){this.openBracket="(",this.closeBracket=")"}return e.prototype.layout=function(t,e,i,r,n){if(null==t)throw new Error("ArgumentNullException : line");if(null==e)throw new Error("ArgumentNullException : font");var o=[];return e.Unicode?o=this.customLayout(t,i,n,e,r):(o=[])[0]=t,o},e.prototype.splitLayout=function(t,e,i,r,n){if(null==t)throw new Error("ArgumentNullException : line");if(null==e)throw new Error("ArgumentNullException : font");return this.customSplitLayout(t,e,i,r,n)},e.prototype.getGlyphIndex=function(t,e,i,r,n){if(null==t)throw new Error("ArgumentNullException : line");if(null==e)throw new Error("ArgumentNullException : font");if(r=null,0===t.length)return{success:!1,glyphs:r};var o=(new Wt).shape(t,0),s=e.fontInternal.ttfReader;r=new Uint16Array(o.length);for(var a=0,h=0,l=o.length;h<l;h++){var u=o[h],c=s.getGlyph(u);null!==c&&void 0!==c&&(r[a++]=c.index)}return{success:!0,glyphs:r}},e.prototype.customLayout=function(e,i,r,n,o){if(null===o||void 0===o){if(null==e)throw new Error("ArgumentNullException : line");var s=null;if(null!==r&&void 0!==r&&r.textDirection!==t.PdfTextDirection.None){s=(new Ht).getLogicalToVisualString(e,i)}return s}if(null==e)throw new Error("ArgumentNullException : line");if(null==n)throw new Error("ArgumentNullException : font");var a=null;if(null!==r&&void 0!==r&&r.textDirection!==t.PdfTextDirection.None){var h=(new Wt).shape(e,0);a=this.customLayout(h,i,r)}s=[];if(o){for(var l=a.split(""),u=l.length,c=0;c<u;c++)l[c]=this.addChars(n,l[c]);s=l}else(s=[])[0]=this.addChars(n,a);return s},e.prototype.addChars=function(t,e){var i=e;if(null==t)throw new Error("ArgumentNullException : font");if(null==i)throw new Error("ArgumentNullException : line");var r=i,n=t.fontInternal.ttfReader;t.setSymbols(r),r=n.convertString(r);var o=S.toUnicodeArray(r,!1);return r=S.byteToString(o)},e.prototype.customSplitLayout=function(t,e,i,r,n){if(null==t)throw new Error("ArgumentNullException : line");if(null==e)throw new Error("ArgumentNullException : font");return this.customLayout(t,i,n).split("")},e}();!function(t){t[t.Paginate=0]="Paginate",t[t.OnePage=1]="OnePage"}(t.PdfLayoutType||(t.PdfLayoutType={})),function(t){t[t.FitPage=0]="FitPage",t[t.FitElement=1]="FitElement",t[t.FitColumnsToPage=2]="FitColumnsToPage"}(t.PdfLayoutBreakType||(t.PdfLayoutBreakType={})),function(t){t[t.Start=0]="Start",t[t.Line=1]="Line",t[t.Bezier3=3]="Bezier3",t[t.Bezier=3]="Bezier",t[t.PathTypeMask=7]="PathTypeMask",t[t.DashMode=16]="DashMode",t[t.PathMarker=32]="PathMarker",t[t.CloseSubpath=128]="CloseSubpath"}(t.PathPointType||(t.PathPointType={}));var qt=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Yt=function(e){function i(i){var r=e.call(this)||this;return r.mbackground=new L(255,255,255),r.mbStroking=!1,r.mfunction=null,r.dictionaryProperties=new a,r.mpatternDictionary=new h,r.mpatternDictionary.items.setValue(r.dictionaryProperties.type,new o(r.dictionaryProperties.pattern)),r.mpatternDictionary.items.setValue(r.dictionaryProperties.patternType,new g(2)),r.shading=i,r.colorSpace=t.PdfColorSpace.Rgb,r}return qt(i,e),Object.defineProperty(i.prototype,"background",{get:function(){return this.mbackground},set:function(t){this.mbackground=t;var e=this.shading;t.isEmpty?e.remove(this.dictionaryProperties.background):e.items.setValue(this.dictionaryProperties.background,t.toArray(this.colorSpace))},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"antiAlias",{get:function(){return this.shading.items.getValue(this.dictionaryProperties.antiAlias).value},set:function(t){var e=this.shading,i=e.items.getValue(this.dictionaryProperties.antiAlias);null==i&&void 0===i?(i=new U(t),e.items.setValue(this.dictionaryProperties.antiAlias,i)):i.value=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"function",{get:function(){return this.mfunction},set:function(t){this.mfunction=t,null!=t&&void 0!==t?this.shading.items.setValue(this.dictionaryProperties.function,new C(this.mfunction)):this.shading.remove(this.dictionaryProperties.function)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"bBox",{get:function(){return this.shading.items.getValue(this.dictionaryProperties.bBox)},set:function(t){var e=this.shading;null==t&&void 0===t?e.remove(this.dictionaryProperties.bBox):e.items.setValue(this.dictionaryProperties.bBox,t)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"colorSpace",{get:function(){return this.mcolorSpace},set:function(t){var e=this.shading.items.getValue(this.dictionaryProperties.colorSpace);if(t!==this.mcolorSpace||null==e){this.mcolorSpace=t;var i=this.colorSpaceToDeviceName(t);this.shading.items.setValue(this.dictionaryProperties.colorSpace,new o(i))}},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"stroking",{get:function(){return this.mbStroking},set:function(t){this.mbStroking=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"patternDictionary",{get:function(){return null==this.mpatternDictionary&&(this.mpatternDictionary=new h),this.mpatternDictionary},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"shading",{get:function(){return this.mshading},set:function(t){if(null==t)throw new Error("ArgumentNullException : Shading");t!==this.mshading&&(this.mshading=t,this.patternDictionary.items.setValue(this.dictionaryProperties.shading,new C(this.mshading)))},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"matrix",{get:function(){return this.mmatrix},set:function(t){if(null==t)throw new Error("ArgumentNullException : Matrix");if(t!==this.mmatrix){this.mmatrix=t.clone();var e=new m(this.mmatrix.matrix.elements);this.mpatternDictionary.items.setValue(this.dictionaryProperties.matrix,e)}},enumerable:!0,configurable:!0}),i.prototype.monitorChanges=function(t,e,r,n,o){var s=!1;if(t instanceof i){this.colorSpace!==o&&(this.colorSpace=o,this.resetFunction()),e.setColorSpace("Pattern",this.mbStroking);var a=r.getResources().getName(this);e.setColourWithPattern(null,a,this.mbStroking),s=!0}return s},i.prototype.resetChanges=function(t){},i.prototype.colorSpaceToDeviceName=function(e){var i;switch(e){case t.PdfColorSpace.Rgb:i="DeviceRGB"}return i},i.prototype.resetPatternDictionary=function(t){this.mpatternDictionary=t},i.prototype.cloneAntiAliasingValue=function(t){if(null==t)throw new Error("ArgumentNullException : brush");var e=this.shading.items.getValue(this.dictionaryProperties.antiAlias);null!=e&&t.shading.items.setValue(this.dictionaryProperties.antiAlias,new U(e.value))},i.prototype.cloneBackgroundValue=function(t){var e=this.background;e.isEmpty||(t.background=e)},Object.defineProperty(i.prototype,"element",{get:function(){return this.patternDictionary},enumerable:!0,configurable:!0}),i}(R),Xt=function(){function t(t,e){if(this.dictionaryProperties=new a,this.writeTransformation=!0,void 0===t);else if(t instanceof j&&void 0===e){this.content=new b;var i=new j(t.width,t.height);this.setSize(i),this.initialize()}else this.content=new b,this.setSize(new j(t,e)),this.initialize()}return Object.defineProperty(t.prototype,"size",{get:function(){return this.templateSize},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.size.width},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.size.height},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"graphics",{get:function(){if(null==this.pdfGraphics||void 0===this.pdfGraphics){var t=new ie(this),e=new ee(this.size,t,this.content);this.pdfGraphics=e,this.pdfGraphics.initializeCoordinates()}return this.pdfGraphics},enumerable:!0,configurable:!0}),t.prototype.getResources=function(){return null==this.resources&&(this.resources=new Zt,this.content.items.setValue(this.dictionaryProperties.resources,this.resources)),this.resources},t.prototype.initialize=function(){this.addType(),this.addSubType()},t.prototype.addType=function(){var t=new o(this.dictionaryProperties.xObject);this.content.items.setValue(this.dictionaryProperties.type,t)},t.prototype.addSubType=function(){var t=new o(this.dictionaryProperties.form);this.content.items.setValue(this.dictionaryProperties.subtype,t)},t.prototype.reset=function(t){void 0===t?(null!=this.resources&&(this.resources=null,this.content.remove(this.dictionaryProperties.resources)),null!=this.graphics&&this.graphics.reset(this.size)):(this.setSize(t),this.reset())},t.prototype.setSize=function(t){var e=new k(new T(0,0),t),i=m.fromRectangle(e);this.content.items.setValue(this.dictionaryProperties.bBox,i),this.templateSize=t},Object.defineProperty(t.prototype,"element",{get:function(){return this.content},enumerable:!0,configurable:!0}),t}(),Jt=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Zt=function(t){function e(e){var i=t.call(this,e)||this;return i.properties=new h,i}return Jt(e,t),Object.defineProperty(e.prototype,"names",{get:function(){return this.getNames()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"document",{get:function(){return this.pdfDocument},set:function(t){this.pdfDocument=t},enumerable:!0,configurable:!0}),e.prototype.getName=function(t){var e=t.element,i=null;if(this.names.containsKey(e)&&(i=this.names.getValue(e)),null==i){var r=this.generateName();i=new o(r),this.names.setValue(e,i),t instanceof G?this.add(t,i):t instanceof Xt?this.add(t,i):t instanceof Yt||t instanceof te?this.add(t,i):t instanceof st?this.add(t,i):(t instanceof gt||t instanceof yt)&&this.add(t,i)}return i},e.prototype.getNames=function(){null==this.pdfNames&&(this.pdfNames=new ot);var t=this.items.getValue(this.dictionaryProperties.font);if(null!=t){X.dereference(t)}return this.pdfNames},e.prototype.requireProcedureSet=function(t){if(null==t)throw new Error("ArgumentNullException:procedureSetName");var e=this.items.getValue(this.dictionaryProperties.procset);null==e&&(e=new m,this.items.setValue(this.dictionaryProperties.procset,e));var i=new o(t);e.contains(i)||e.add(i)},e.prototype.removeFont=function(t){for(var e=null,i=this.pdfNames.keys(),r=0;r<this.pdfNames.size();r++)if(this.pdfNames.getValue(i[r])===new o(t)){e=i[r];break}null!=e&&this.pdfNames.remove(e)},e.prototype.generateName=function(){return $t.getNewGuidString()},e.prototype.add=function(t,e){if(t instanceof G){var i=null,r=this.items.getValue(this.dictionaryProperties.font);if(null!=r){var n=r;i=r,i=r}else i=new h,this.items.setValue(this.dictionaryProperties.font,i);i.items.setValue(e.value,new C(t.element))}else if(t instanceof Xt){var o=void 0;null==(o=this.items.getValue(this.dictionaryProperties.xObject))&&(o=new h,this.items.setValue(this.dictionaryProperties.xObject,o)),o.items.setValue(e.value,new C(t.element))}else if(t instanceof R){if(t instanceof Yt||t instanceof te){if(null!=(a=t.element)){var s=this.items.getValue(this.dictionaryProperties.pattern);null==s&&(s=new h,this.items.setValue(this.dictionaryProperties.pattern,s)),s.items.setValue(e.value,new C(a))}}}else if(t instanceof st){var a=t.element,l=null;null==(l=this.items.getValue(this.dictionaryProperties.extGState))&&(l=new h,this.items.setValue(this.dictionaryProperties.extGState,l)),l.items.setValue(e.value,new C(a))}else{o=this.Dictionary.items.getValue(this.dictionaryProperties.xObject);var u=void 0;void 0!==this.pdfDocument&&(u=this.pdfDocument.sections.element.items.getValue(this.dictionaryProperties.resources).items.getValue(this.dictionaryProperties.xObject));this.Dictionary.items.values();var c=!1,p=void 0;if(void 0===this.pdfDocument||void 0!==typeof u&&null!=u){if(void 0!==this.pdfDocument)for(var d=u.items.values(),f=0;f<d.length;f++)void 0!==d[f]&&void 0!==d[f].element&&d[f].element.data[0]===t.element.data[0]&&(p=d[f],c=!0)}else u=new h,this.pdfDocument.sections.element.items.getValue(this.dictionaryProperties.resources).items.setValue(this.dictionaryProperties.xObject,u);if(null==o&&(o=new h,this.Dictionary.items.setValue(this.dictionaryProperties.xObject,o)),c&&void 0!==p)o.items.setValue(e.value,p);else{n=new C(t.element);o.items.setValue(e.value,n),void 0!==this.pdfDocument&&u.items.setValue(e.value,n)}}},e}(h),$t=function(){function t(){}return t.getNewGuidString=function(){return"aaaaaaaa-aaaa-4aaa-baaa-aaaaaaaaaaaa".replace(/[ab]/g,function(t){var e=16*Math.random()|0;return("a"===t?e:3&e|8).toString(16)})},t}(),Qt=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),te=function(t){function e(e,i){var r=t.call(this)||this;r.mStroking=!1,r.mLocation=new T(0,0),r.mDictionaryProperties=new a;var n=null;return e instanceof V?n=e:e instanceof j&&(n=new V(0,0,e.width,e.height)),null!==i&&i instanceof pe&&(r.mPage=i),r.brushStream=new b,r.mResources=new Zt,r.brushStream.items.setValue(r.mDictionaryProperties.resources,r.mResources),r.setBox(n),r.setObligatoryFields(),null!==i&&i instanceof pe&&(r.mPage=i,r.graphics.colorSpace=i.document.colorSpace),r}return Qt(e,t),e.prototype.initialize=function(t,e,i,r){this.mPage=e,this.mLocation=i,this.mTransformationMatrix=r,this.tempBrushStream=this.brushStream,this.brushStream=new b;var n=new Zt;return this.brushStream.items.setValue(this.mDictionaryProperties.resources,n),this.setBox(t),this.setObligatoryFields(),this},Object.defineProperty(e.prototype,"location",{get:function(){return this.mLocation},set:function(t){this.mLocation=t},enumerable:!0,configurable:!0}),e.prototype.setObligatoryFields=function(){if(this.brushStream.items.setValue(this.mDictionaryProperties.patternType,new g(1)),this.brushStream.items.setValue(this.mDictionaryProperties.paintType,new g(1)),this.brushStream.items.setValue(this.mDictionaryProperties.tilingType,new g(1)),this.brushStream.items.setValue(this.mDictionaryProperties.xStep,new g(this.mBox.right-this.mBox.left)),this.brushStream.items.setValue(this.mDictionaryProperties.yStep,new g(this.mBox.bottom-this.mBox.top)),null!=this.mPage&&null!=this.mLocation)if(null==this.mTransformationMatrix&&void 0===this.mTransformationMatrix){var t=this.mPage.size.height%this.rectangle.size.height-this.mLocation.y;this.brushStream.items.setValue(this.mDictionaryProperties.matrix,new m([1,0,0,1,this.mLocation.x,t]))}else{t=0;var e=this.mTransformationMatrix.matrix.elements;t=this.mPage.size.height>this.rectangle.size.height?this.mTransformationMatrix.matrix.offsetY-this.mPage.size.height%this.rectangle.size.height:this.mPage.size.height%this.rectangle.size.height+this.mTransformationMatrix.matrix.offsetY,this.brushStream.items.setValue(this.mDictionaryProperties.matrix,new m([e[0],e[1],e[2],e[3],e[4],t]))}},e.prototype.setBox=function(t){this.mBox=t;var e=new k(this.mBox.left,this.mBox.top,this.mBox.right,this.mBox.bottom);this.brushStream.items.setValue(this.mDictionaryProperties.bBox,m.fromRectangle(e))},Object.defineProperty(e.prototype,"rectangle",{get:function(){return this.mBox},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this.mBox.size},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"graphics",{get:function(){if(null==this.mGraphics&&void 0===this.mGraphics){var t=new ie(this),e=new ee(this.size,t,this.brushStream);this.mGraphics=e,this.mResources=this.getResources(),this.mGraphics.initializeCoordinates()}return this.mGraphics},enumerable:!0,configurable:!0}),e.prototype.getResources=function(){return this.mResources},Object.defineProperty(e.prototype,"stroking",{get:function(){return this.mStroking},set:function(t){this.mStroking=t},enumerable:!0,configurable:!0}),e.prototype.clone=function(){var t=this.initialize(this.rectangle,this.mPage,this.location,this.mTransformationMatrix);return null!=this.mTransformationMatrix&&null!=this.mTransformationMatrix.matrix&&t.brushStream.items.setValue(this.mDictionaryProperties.matrix,new m(this.mTransformationMatrix.matrix.elements)),t.brushStream.data=this.tempBrushStream.data,t.mResources=new Zt(this.mResources),t.brushStream.items.setValue(this.mDictionaryProperties.resources,t.mResources),t},e.prototype.monitorChanges=function(t,i,r,n,o){var s=!1;if(t!==this){i.setColorSpace("Pattern",this.mStroking);var a=r.getResources().getName(this);i.setColourWithPattern(null,a,this.mStroking),s=!0}else if(t instanceof e){i.setColorSpace("Pattern",this.mStroking);var h=r.getResources().getName(this);i.setColourWithPattern(null,h,this.mStroking),s=!0}return s},e.prototype.resetChanges=function(t){},Object.defineProperty(e.prototype,"element",{get:function(){return this.brushStream},enumerable:!0,configurable:!0}),e}(R),ee=function(){function e(e,i,r){this.currentColorSpace=t.PdfColorSpace.Rgb,this.previousTextRenderingMode=t.TextRenderingMode.Fill,this.previousCharacterSpacing=0,this.previousWordSpacing=0,this.previousTextScaling=100,this.procedureSets=new nt,this.isNormalRender=!0,this.isUseFontSize=!1,this.isItalic=!1,this.isEmfTextScaled=!1,this.isEmf=!1,this.isEmfPlus=!1,this.isBaselineFormat=!0,this.emfScalingFactor=new j(0,0),this.colorSpaceChanged=!1,this.dictionaryProperties=new a,this.isOverloadWithPosition=!1,this.isPointOverload=!1,this.currentColorSpaces=["RGB","CMYK","GrayScale","Indexed"],this.isImageOptimized=!1,this.graphicsState=[],this.istransparencySet=!1,this.internalAutomaticFields=null,this.startCutIndex=-1,this.getResources=i,this.canvasSize=e,this.pdfStreamWriter=r instanceof tt?r:new tt(r),this.initialize()}return Object.defineProperty(e.prototype,"stringLayoutResult",{get:function(){return this.pdfStringLayoutResult},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this.canvasSize},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"mediaBoxUpperRightBound",{get:function(){return void 0===this.internalMediaBoxUpperRightBound&&(this.internalMediaBoxUpperRightBound=0),this.internalMediaBoxUpperRightBound},set:function(t){this.internalMediaBoxUpperRightBound=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"clientSize",{get:function(){return new j(this.clipBounds.width,this.clipBounds.height)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"colorSpace",{get:function(){return this.currentColorSpace},set:function(t){this.currentColorSpace=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"streamWriter",{get:function(){return this.pdfStreamWriter},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"matrix",{get:function(){return null==this.transformationMatrix&&(this.transformationMatrix=new it),this.transformationMatrix},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"layer",{get:function(){return this.pageLayer},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"page",{get:function(){return this.pageLayer.page},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"automaticFields",{get:function(){return null!=this.internalAutomaticFields&&void 0!==this.internalAutomaticFields||(this.internalAutomaticFields=new at),this.internalAutomaticFields},enumerable:!0,configurable:!0}),e.prototype.initialize=function(){this.bStateSaved=!1,this.currentPen=null,this.currentBrush=null,this.currentFont=null,this.currentColorSpace=t.PdfColorSpace.Rgb,this.bCSInitialized=!1,this.transformationMatrix=null,this.previousTextRenderingMode=-1,this.previousCharacterSpacing=-1,this.previousWordSpacing=-1,this.previousTextScaling=-100,this.currentStringFormat=null,this.clipBounds=new k(new T(0,0),this.size),this.getResources.getResources().requireProcedureSet(this.procedureSets.pdf)},e.prototype.drawPdfTemplate=function(t,e,i){if(void 0===i){if(null==t)throw Error("ArgumentNullException-template");this.drawPdfTemplate(t,e,t.size)}else{if(null==t)throw Error("ArgumentNullException-template");var r=t.width>0?i.width/t.width:1,n=t.height>0?i.height/t.height:1,o=!(1===r&&1===n),s=this.save(),a=new it;null!=this.pageLayer&&this.getTranslateTransform(e.x,e.y+i.height,a),o&&this.getScaleTransform(r,n,a),this.pdfStreamWriter.modifyCtm(a);var h=this.getResources.getResources().getName(t);this.pdfStreamWriter.executeObject(h),this.restore(s);var l=t.graphics;if(null!=l)for(var u=0;u<l.automaticFields.automaticFields.length;u++){var c=l.automaticFields.automaticFields[u],p=new T(c.location.x+e.x,c.location.y+e.y),d=0==t.size.width?0:i.width/t.size.width,f=0==t.size.height?0:i.height/t.size.height;this.automaticFields.add(new ct(c.field,p,d,f)),this.page.dictionary.modify()}this.getResources.getResources().requireProcedureSet(this.procedureSets.imageB),this.getResources.getResources().requireProcedureSet(this.procedureSets.imageC),this.getResources.getResources().requireProcedureSet(this.procedureSets.imageI),this.getResources.getResources().requireProcedureSet(this.procedureSets.text)}},e.prototype.drawString=function(t,e,i,r,n,o,s,a,h){if("string"==typeof t&&e instanceof G&&(i instanceof et||null===i)&&(r instanceof R||null===r)&&"number"==typeof n&&"number"==typeof o&&(s instanceof N||null===s)&&void 0===a)this.isOverloadWithPosition=!0,this.drawString(t,e,i,r,n,o,this.clientSize.width-n,0,s);else{var l=i,u=r,c=n,p=o,d=s,f=a,g=h,m=(new I).layout(t,e,g,new j(d,f),this.isOverloadWithPosition,this.clientSize);if(!m.empty){var y=this.checkCorrectLayoutRectangle(m.actualSize,c,p,g);d<=0&&(c=y.x,d=y.width),f<=0&&(p=y.y,f=y.height),this.drawStringLayoutResult(m,e,l,u,new k(c,p,d,f),g),this.isEmfTextScaled=!1,this.emfScalingFactor=new j(0,0)}this.getResources.getResources().requireProcedureSet(this.procedureSets.text),this.isNormalRender=!0,this.pdfStringLayoutResult=m,this.isUseFontSize=!1}},e.prototype.drawLine=function(t,e,i,r,n){if(e instanceof T){var o=e,s=i;this.drawLine(t,o.x,o.y,s.x,s.y)}else{o=e,s=i;var a=r,h=n;this.stateControl(t,null,null);var l=this.streamWriter;l.beginPath(o,s),l.appendLineSegment(a,h),l.strokePath(),this.getResources.getResources().requireProcedureSet(this.procedureSets.pdf)}},e.prototype.drawRectangle=function(t,e,i,r,n,o){if(t instanceof et&&"number"==typeof e){var s=i;this.drawRectangle(t,null,e,s,r,n)}else if(t instanceof R&&"number"==typeof e){s=i;this.drawRectangle(null,t,e,s,r,n)}else{s=i;var a=r,h=n,l=o;if(e instanceof te){this.bCSInitialized=!1;var u=this.matrix.matrix.offsetX+s,c=void 0;c=null!=this.layer&&null!=this.layer.page?this.layer.page.size.height-this.matrix.matrix.offsetY+a:this.clientSize.height-this.matrix.matrix.offsetY+a,e.location=new T(u,c),e.graphics.colorSpace=this.colorSpace}else e instanceof Yt&&(e.colorSpace=this.colorSpace);e instanceof D&&e.color.isEmpty&&(e=null);var p=t,d=e;this.stateControl(p,d,null),this.streamWriter.appendRectangle(s,a,h,l),this.drawPathHelper(p,d,!1)}},e.prototype.drawRoundedRectangle=function(e,i,r,n,o,s,a){if(null===e)throw new Error("pen");if(null===i)throw new Error("brush");if(0===a)this.drawRectangle(e,i,r,n,o,s);else{var h=[r,n,o,s],l=2*a,u=[l,l],c=[h[0],h[1],u[0],u[1]];this._pathPoints=[],this._pathTypes=[];var p=!0;p=this._addArc(c[0],c[1],c[2],c[3],180,90,p),c[0]=h[0]+h[2]-l,p=this._addArc(c[0],c[1],c[2],c[3],270,90,p),c[1]=h[1]+h[3]-l,p=this._addArc(c[0],c[1],c[2],c[3],0,90,p),c[0]=h[0],p=this._addArc(c[0],c[1],c[2],c[3],90,90,p);var d=this._pathPoints.length-1,f=this._pathTypes[d];f|=t.PathPointType.CloseSubpath,this._pathTypes[d]=f,this._drawPath(e,i,this._pathPoints,this._pathTypes,t.PdfFillMode.Alternate),this._pathPoints=[],this._pathTypes=[]}},e.prototype._addArc=function(e,i,r,n,o,s,a){for(var h=this._getBezierArcPoints(e,i,e+r,i+n,o,s),l=0;l<h.length;l+=8){var u=[h[l],h[l+1],h[l+2],h[l+3],h[l+4],h[l+5],h[l+6],h[l+7]];a=this._addArcPoints(u,t.PathPointType.Bezier3,a)}return a},e.prototype._addArcPoints=function(e,i,r){for(var n=0;n<e.length;n++){var o=new T(e[n],e[n+1]);0===n?0===this._pathPoints.length||r?(this._addPoint(o,t.PathPointType.Start),r=!1):o.x===this._getLastPoint().x&&o.y===this._getLastPoint().y||this._addPoint(o,t.PathPointType.Line):this._addPoint(o,i),n++}return r},e.prototype._getLastPoint=function(){var t=new T(0,0),e=this._pathPoints.length;return e>0&&(t.x=this._pathPoints[e-1].x,t.y=this._pathPoints[e-1].y),t},e.prototype._addPoint=function(t,e){this._pathPoints.push(t),this._pathTypes.push(e)},e.prototype._getBezierArcPoints=function(t,e,i,r,n,o){if(t>i){var s=void 0;s=t,t=i,i=s}if(r>e){s=void 0;s=e,e=r,r=s}var a,h;Math.abs(o)<=90?(a=o,h=1):a=o/(h=Math.ceil(Math.abs(o)/90));for(var l=(t+i)/2,u=(e+r)/2,c=(i-t)/2,p=(r-e)/2,d=a*(Math.PI/360),f=Math.abs(4/3*(1-Math.cos(d))/Math.sin(d)),g=[],m=0;m<h;m++){var y=(n+m*a)*(Math.PI/180),b=(n+(m+1)*a)*(Math.PI/180),w=Math.cos(y),P=Math.cos(b),S=Math.sin(y),v=Math.sin(b);a>0?g.push(l+c*w,u-p*S,l+c*(w-f*S),u-p*(S+f*w),l+c*(P+f*v),u-p*(v-f*P),l+c*P,u-p*v):g.push(l+c*w,u-p*S,l+c*(w+f*S),u-p*(S-f*w),l+c*(P-f*v),u-p*(v+f*P),l+c*P,u-p*v)}return g},e.prototype.drawPathHelper=function(e,i,r,n){if("boolean"==typeof r){var o=r;this.drawPathHelper(e,i,t.PdfFillMode.Winding,o)}else{var s=null!=e,a=null!=i,h=(o=r)===t.PdfFillMode.Alternate;s&&a?this.streamWriter.fillStrokePath(h):s||a?s?this.streamWriter.strokePath():this.streamWriter.fillPath(h):this.streamWriter.endPath()}},e.prototype.drawImage=function(t,e,i,r,n){if("number"==typeof e&&"number"==typeof i&&void 0===r){var o=t.physicalDimension;this.drawImage(t,e,i,o.width,o.height)}else{var a=e,h=i,l=n;t.save();var u=new it;this.getTranslateTransform(a,h+l,u),this.getScaleTransform(r,n,u),this.pdfStreamWriter.write("q"),this.pdfStreamWriter.modifyCtm(u);var c=this.getResources.getResources();void 0!==this.pageLayer&&null!=this.page&&(c.document=this.page.document);var p=c.getName(t);void 0!==this.pageLayer&&this.page.setResources(c),this.pdfStreamWriter.executeObject(p),this.pdfStreamWriter.write(s.restoreState),this.pdfStreamWriter.write(s.newLine);var d=this.getResources.getResources();d.requireProcedureSet(this.procedureSets.imageB),d.requireProcedureSet(this.procedureSets.imageC),d.requireProcedureSet(this.procedureSets.imageI),d.requireProcedureSet(this.procedureSets.text)}},e.prototype.getLineBounds=function(t,e,i,r,n){var o;if(!e.empty&&t<e.lineCount&&t>=0){var s=e.lines[t],a=this.getTextVerticalAlignShift(e.actualSize.height,r.height,n)+r.y+e.lineHeight*t,h=s.width,l=this.getHorizontalAlignShift(h,r.width,n),u=this.getLineIndent(s,n,r,0===t);l+=this.rightToLeft(n)?0:u;var c=r.x+l,p=this.shouldJustify(s,r.width,n)?r.width-u:h-u,d=e.lineHeight;o=new k(c,a,p,d)}else o=new k(0,0,0,0);return o},e.prototype.checkCorrectLayoutRectangle=function(e,i,r,n){var o=new k(i,r,e.width,e.width);if(null!=n){switch(n.alignment){case t.PdfTextAlignment.Center:o.x-=o.width/2;break;case t.PdfTextAlignment.Right:o.x-=o.width}switch(n.lineAlignment){case t.PdfVerticalAlignment.Middle:o.y-=o.height/2;break;case t.PdfVerticalAlignment.Bottom:o.y-=o.height}}return o},e.prototype.setLayer=function(t){this.pageLayer=t;var e=t.page;null!=e&&void 0!==e&&(e.beginSave=this.pageSave)},e.prototype.pageSave=function(t){if(null!=t.graphics.automaticFields)for(var e=0;e<t.graphics.automaticFields.automaticFields.length;e++){var i=t.graphics.automaticFields.automaticFields[e];i.field.performDraw(t.graphics,i.location,i.scalingX,i.scalingY)}},e.prototype.drawStringLayoutResult=function(e,i,r,n,o,s){if(e.empty)throw new Error("ArgumentNullException:result");this.applyStringSettings(i,r,n,s,o);var a=null!=s?s.horizontalScalingFactor:100;a===this.previousTextScaling||this.isEmfTextScaled||(this.pdfStreamWriter.setTextScaling(a),this.previousTextScaling=a);var h=null==s||0===s.lineSpacing?i.height:s.lineSpacing+i.height,l=0;l=null!=s&&s.subSuperScript===t.PdfSubSuperScript.SubScript?h-(i.height+i.metrics.getDescent(s)):h-i.metrics.getAscent(s),this.shift=l,this.pdfStreamWriter.startNextLine(o.x,o.y-l),this.pdfStreamWriter.setLeading(+h);for(var u=0,c="",p=0;p<e.lines.length;p++)if(u+=e.lineHeight,o.y+u>this.clientSize.height){this.startCutIndex=p;break}for(var d=this.startCutIndex;d<e.lines.length&&d>=0;d++)c+=e.lines[d].text;var f=new k(o.x,o.y,o.width,o.height);if(this.drawLayoutResult(e,i,s,o),this.underlineStrikeoutText(r,n,e,i,f,s),this.isEmfPlus=!1,this.isUseFontSize=!1,-1!==this.startCutIndex){this.getNextPage().graphics.drawString(c,i,r,n,o.x,0,o.width,0,s)}},e.prototype.getNextPage=function(){var t=this.currentPage.section,e=t.indexOf(this.currentPage);return e===t.count-1?t.add():t.getPages()[e+1]},e.prototype.setClip=function(e,i){void 0===i?this.setClip(e,t.PdfFillMode.Winding):(this.pdfStreamWriter.appendRectangle(e),this.pdfStreamWriter.clipPath(i===t.PdfFillMode.Alternate))},e.prototype.applyStringSettings=function(t,e,i,r,n){i instanceof te?(this.bCSInitialized=!1,i.graphics.colorSpace=this.colorSpace):i instanceof Yt&&(this.bCSInitialized=!1,i.colorSpace=this.colorSpace);var o=this.getTextRenderingMode(e,i,r);this.stateControl(e,i,t,r),this.pdfStreamWriter.beginText(),o!==this.previousTextRenderingMode&&(this.pdfStreamWriter.setTextRenderingMode(o),this.previousTextRenderingMode=o);var s=null!=r?r.characterSpacing:0;s===this.previousCharacterSpacing||this.isEmfTextScaled||(this.pdfStreamWriter.setCharacterSpacing(s),this.previousCharacterSpacing=s);var a=null!=r?r.wordSpacing:0;a!==this.previousWordSpacing&&(this.pdfStreamWriter.setWordSpacing(a),this.previousWordSpacing=a)},e.prototype.getTextVerticalAlignShift=function(e,i,r){var n=0;if(i>=0&&null!=r&&r.lineAlignment!==t.PdfVerticalAlignment.Top)switch(r.lineAlignment){case t.PdfVerticalAlignment.Middle:n=(i-e)/2;break;case t.PdfVerticalAlignment.Bottom:n=i-e}return n},e.prototype.drawLayoutResult=function(t,e,i,r){var n=this.getTextVerticalAlignShift(t.actualSize.height,r.height,i);0!==n&&this.pdfStreamWriter.startNextLine(0,n);for(var o=e,s=null!=o&&o.isUnicode,a=(null!=o&&o.isEmbedFont,t.lines),h=0,l=a.length;h<l&&h!==this.startCutIndex;h++){var u=a[h],c=(u.text,u.width),p=this.getHorizontalAlignShift(c,r.width,i),d=this.getLineIndent(u,i,r,0===h);0===(p+=this.rightToLeft(i)?0:d)||this.isEmfTextScaled||this.pdfStreamWriter.startNextLine(p,0),s?this.drawUnicodeLine(u,r,e,i):this.drawAsciiLine(u,r,e,i),0===p||this.isEmfTextScaled||this.pdfStreamWriter.startNextLine(-p,0),this.isOverloadWithPosition&&a.length>1&&(this.pdfStreamWriter.startNextLine(-r.x,0),r.x=0,r.width=this.clientSize.width,this.isOverloadWithPosition=!1,this.isPointOverload=!0)}this.getResources.getResources().requireProcedureSet(this.procedureSets.text),0!==n&&this.pdfStreamWriter.startNextLine(0,-(n-t.lineHeight)),this.pdfStreamWriter.endText()},e.prototype.drawAsciiLine=function(t,e,i,r){this.justifyLine(t,e.width,r);var n="";if(-1!==t.text.indexOf("(")||-1!==t.text.indexOf(")"))for(var o=0;o<t.text.length;o++)"("===t.text[o]?n+="\\(":")"===t.text[o]?n+="\\)":n+=t.text[o];""===n&&(n=t.text);var s="("+n+")";this.pdfStreamWriter.showNextLineText(new S(s))},e.prototype.drawUnicodeLine=function(e,i,r,n){var o=e.text,s=(e.width,null!==n&&void 0!==n&&n.rightToLeft),a=null!==n&&void 0!==n&&(0!==n.wordSpacing||n.alignment===t.PdfTextAlignment.Justify),h=r,l=this.justifyLine(e,i.width,n),u=new Kt;if(s||null!==n&&void 0!==n&&n.textDirection!==t.PdfTextDirection.None){var c=null,p=null!==n&&void 0!==n&&n.alignment===t.PdfTextAlignment.Right,d=null;d=(c=null!==n&&void 0!==n&&n.textDirection!==t.PdfTextDirection.None?u.layout(o,h,n.textDirection===t.PdfTextDirection.RightToLeft,a,n):u.layout(o,h,p,a,n)).length>1?null!==n&&void 0!==n&&n.textDirection!==t.PdfTextDirection.None?u.splitLayout(o,h,n.textDirection===t.PdfTextDirection.RightToLeft,a,n):u.splitLayout(o,h,p,a,n):[o],this.drawUnicodeBlocks(c,d,h,n,l)}else if(a){var f=this.breakUnicodeLine(o,h,null);c=f.tokens,d=f.words;this.drawUnicodeBlocks(c,d,h,n,l)}else{var g=this.convertToUnicode(o,h),m=this.getUnicodeString(g);this.streamWriter.showNextLineText(m)}},e.prototype.drawUnicodeBlocks=function(t,e,i,r,n){if(null==t)throw new Error("Argument Null Exception : blocks");if(null==e)throw new Error("Argument Null Exception : words");if(null==i)throw new Error("Argument Null Exception : font");this.streamWriter.startNextLine();var o=0,s=0,a=0,h=0;try{null!==r&&void 0!==r&&(a=r.firstLineIndent,h=r.paragraphIndent,r.firstLineIndent=0,r.paragraphIndent=0);var l=i.getCharWidth(A.whiteSpace,r)+n,u=null!=r?r.characterSpacing:0;l+=u+(null!==r&&void 0!==r&&0===n?r.wordSpacing:0);for(var c=0;c<t.length;c++){var p=t[c],d=e[c],f=0;if(0!==o&&this.streamWriter.startNextLine(o,0),d.length>0){f+=i.measureString(d,r).width,f+=u;var g=this.getUnicodeString(p);this.streamWriter.showText(g)}c!==t.length-1&&(s+=o=f+l)}s>0&&this.streamWriter.startNextLine(-s,0)}finally{null!==r&&void 0!==r&&(r.firstLineIndent=a,r.paragraphIndent=h)}},e.prototype.breakUnicodeLine=function(t,e,i){if(null===t)throw new Error("Argument Null Exception : line");i=t.split(null);for(var r=[],n=0;n<i.length;n++){var o=i[n],s=this.convertToUnicode(o,e);r[n]=s}return{tokens:r,words:i}},e.prototype.getUnicodeString=function(e){if(null===e)throw new Error("Argument Null Exception : token");var i=new S(e);return i.converted=!0,i.encode=t.InternalEnum.ForceEncoding.Ascii,i},e.prototype.convertToUnicode=function(t,e){var i=null;if(null==t)throw new Error("Argument Null Exception : text");if(null==e)throw new Error("Argument Null Exception : ttfFont");if(e.fontInternal instanceof zt){var r=e.fontInternal.ttfReader;e.setSymbols(t),i=r.convertString(t);var n=S.toUnicodeArray(i,!1);i=S.byteToString(n)}return i},e.prototype.justifyLine=function(t,e,i){var r=t.text,n=t.width,o=this.shouldJustify(t,e,i),s=null!=i&&0!==i.wordSpacing,a=A.spaces,h=A.getCharsCount(r,a),l=0;if(o){s&&(n-=h*i.wordSpacing);l=(e-n)/h,this.pdfStreamWriter.setWordSpacing(l)}else s?this.pdfStreamWriter.setWordSpacing(i.wordSpacing):this.pdfStreamWriter.setWordSpacing(0);return l},e.prototype.reset=function(t){this.canvasSize=t,this.streamWriter.clear(),this.initialize(),this.initializeCoordinates()},e.prototype.shouldJustify=function(e,i,r){var n=e.text,o=e.width,s=null!=r&&r.alignment===t.PdfTextAlignment.Justify,a=i>=0&&o<i,h=A.spaces,l=A.getCharsCount(n,h)>0&&n[0]!==A.whiteSpace,u=(e.lineType&t.LineType.LayoutBreak)>0;return s&&a&&l&&(u||r.alignment===t.PdfTextAlignment.Justify)},e.prototype.underlineStrikeoutText=function(t,e,i,r,n,o){if(r.underline||r.strikeout){var s=this.createUnderlineStikeoutPen(t,e,r,o);if(null!=s){var a=this.getTextVerticalAlignShift(i.actualSize.height,n.height,o),h=0;h=n.y+a+r.metrics.getAscent(o)+1.5*s.width;for(var l=n.y+a+r.metrics.getHeight(o)/2+1.5*s.width,u=i.lines,c=0,p=i.lineCount;c<p;c++){var d=u[c],f=(d.text,d.width),g=this.getHorizontalAlignShift(f,n.width,o),m=this.getLineIndent(d,o,n,0===c);g+=this.rightToLeft(o)?0:m;var y=n.x+g,b=this.shouldJustify(d,n.width,o)?y+n.width-m:y+f-m;if(r.underline){var w=h;this.drawLine(s,y,w,b,w),h+=i.lineHeight}if(r.strikeout){w=l;this.drawLine(s,y,w,b,w),l+=i.lineHeight}this.isPointOverload&&u.length>1&&(n.x=0,n.width=this.clientSize.width)}this.isPointOverload=!1}}},e.prototype.createUnderlineStikeoutPen=function(t,e,i,r){var n=i.metrics.getSize(r)/20,o=null;return null!=t?o=new et(t.color,n):null!=e&&(o=new et(e,n)),o},e.prototype.getTextRenderingMode=function(e,i,r){var n=t.TextRenderingMode.None;return n=null!=e&&null!=i?t.TextRenderingMode.FillStroke:null!=e?t.TextRenderingMode.Stroke:t.TextRenderingMode.Fill,null!=r&&r.clipPath&&(n|=t.TextRenderingMode.ClipFlag),n},e.prototype.getLineIndent=function(e,i,r,n){var o=0,s=(e.lineType&t.LineType.FirstParagraphLine)>0;return null!=i&&s&&(o=n?i.firstLineIndent:i.paragraphIndent,o=r.width>0?Math.min(r.width,o):o),o},e.prototype.getHorizontalAlignShift=function(e,i,r){var n=0;if(i>=0&&null!=r&&r.alignment!==t.PdfTextAlignment.Left)switch(r.alignment){case t.PdfTextAlignment.Center:n=(i-e)/2;break;case t.PdfTextAlignment.Right:n=i-e}return n},e.prototype.rightToLeft=function(e){var i=null!==e&&void 0!==e&&e.rightToLeft;return null!==e&&void 0!==e&&e.textDirection!==t.PdfTextDirection.None&&void 0!==e.textDirection&&(i=!0),i},e.prototype.stateControl=function(t,e,i,r){if(void 0===r)this.stateControl(t,e,i,null);else{e instanceof Yt&&(this.bCSInitialized=!1,e.colorSpace=this.colorSpace),e instanceof te&&(this.bCSInitialized=!1,e.graphics.colorSpace=this.colorSpace);null!==e?(void 0!==this.pageLayer&&null!=this.pageLayer&&!1===this.colorSpaceChanged&&(this.lastDocumentCS=this.pageLayer.page.document.colorSpace,this.lastGraphicsCS=this.pageLayer.page.graphics.colorSpace,this.colorSpace=this.pageLayer.page.document.colorSpace,this.currentColorSpace=this.pageLayer.page.document.colorSpace,this.colorSpaceChanged=!0),this.initCurrentColorSpace(this.currentColorSpace)):null!=t&&(void 0!==this.pageLayer&&null!=this.pageLayer&&(this.colorSpace=this.pageLayer.page.document.colorSpace,this.currentColorSpace=this.pageLayer.page.document.colorSpace),this.initCurrentColorSpace(this.currentColorSpace)),this.penControl(t,!1),this.brushControl(e,!1),this.fontControl(i,r,!1)}},e.prototype.initCurrentColorSpace=function(e){this.getResources.getResources();this.bCSInitialized||(this.currentColorSpace!=t.PdfColorSpace.GrayScale?(this.pdfStreamWriter.setColorSpace("Device"+this.currentColorSpaces[this.currentColorSpace],!0),this.pdfStreamWriter.setColorSpace("Device"+this.currentColorSpaces[this.currentColorSpace],!1),this.bCSInitialized=!0):(this.pdfStreamWriter.setColorSpace("DeviceGray",!0),this.pdfStreamWriter.setColorSpace("DeviceGray",!1),this.bCSInitialized=!0))},e.prototype.penControl=function(t,e){null!=t&&(this.currentPen=t,t.monitorChanges(this.currentPen,this.pdfStreamWriter,this.getResources,e,this.colorSpace,this.matrix.clone()),this.currentPen=t.clone())},e.prototype.brushControl=function(t,e){if(null!=t&&void 0!==t){var i=t.clone(),r=i;if(!(null===r||void 0===r||t instanceof D||t instanceof te)){var n=r.matrix,o=this.matrix.clone();null!=n&&(n.multiply(o),o=n),r.matrix=o}this.currentBrush=r,i.monitorChanges(this.currentBrush,this.pdfStreamWriter,this.getResources,e,this.colorSpace),this.currentBrush=t,t=null}},e.prototype.fontControl=function(e,i,r){if(null!=e){var n=null!=i?i.subSuperScript:t.PdfSubSuperScript.None,o=null!=this.currentStringFormat?this.currentStringFormat.subSuperScript:t.PdfSubSuperScript.None;if(r||e!==this.currentFont||n!==o){var s=this.getResources.getResources();this.currentFont=e,this.currentStringFormat=i;var a=e.metrics.getSize(i);this.isEmfTextScaled=!1;var h=s.getName(e);this.pdfStreamWriter.setFont(e,h,a)}}},e.prototype.setTransparency=function(e,i,r){if(void 0===i)this.istransparencySet=!0,this.setTransparency(e,e,t.PdfBlendMode.Normal);else if("number"==typeof i&&void 0===r)this.setTransparency(e,i,t.PdfBlendMode.Normal);else{null==this.trasparencies&&(this.trasparencies=new ot);var n=null,o=new ne(e,i,r);this.trasparencies.containsKey(o)&&(n=this.trasparencies.getValue(o)),null==n&&(n=new st(e,i,r),this.trasparencies.setValue(o,n));var s=this.getResources.getResources().getName(n);this.streamWriter.setGraphicsState(s)}},e.prototype.clipTranslateMargins=function(t,e,i,r,n,o){if(t instanceof k&&void 0===e)this.clipBounds=t,this.pdfStreamWriter.writeComment("Clip margins."),this.pdfStreamWriter.appendRectangle(t),this.pdfStreamWriter.closePath(),this.pdfStreamWriter.clipPath(!1),this.pdfStreamWriter.writeComment("Translate co-ordinate system."),this.translateTransform(t.x,t.y);else if("number"==typeof t){var s=new k(i,r,this.size.width-i-n,this.size.height-r-o);this.clipBounds=s,this.pdfStreamWriter.writeComment("Clip margins."),this.pdfStreamWriter.appendRectangle(s),this.pdfStreamWriter.closePath(),this.pdfStreamWriter.clipPath(!1),this.pdfStreamWriter.writeComment("Translate co-ordinate system."),this.translateTransform(t,e)}},e.prototype.updateY=function(t){return-t},e.prototype.translateTransform=function(t,e){var i=new it;this.getTranslateTransform(t,e,i),this.pdfStreamWriter.modifyCtm(i),this.matrix.multiply(i)},e.prototype.getTranslateTransform=function(t,e,i){return i.translate(t,this.updateY(e)),i},e.prototype.scaleTransform=function(t,e){var i=new it;this.getScaleTransform(t,e,i),this.pdfStreamWriter.modifyCtm(i),this.matrix.multiply(i)},e.prototype.getScaleTransform=function(t,e,i){return null==i&&(i=new it),i.scale(t,e),i},e.prototype.rotateTransform=function(t){var e=new it;this.getRotateTransform(t,e),this.pdfStreamWriter.modifyCtm(e),this.matrix.multiply(e)},e.prototype.initializeCoordinates=function(){this.pdfStreamWriter.writeComment("Change co-ordinate system to left/top."),this.mediaBoxUpperRightBound!==-this.size.height&&null==this.cropBox&&(this.mediaBoxUpperRightBound===this.size.height||0===this.mediaBoxUpperRightBound?this.translateTransform(0,this.updateY(this.size.height)):this.translateTransform(0,this.updateY(this.mediaBoxUpperRightBound)))},e.prototype.getRotateTransform=function(t,e){return null!=e&&void 0!==e||(e=new it),e.rotate(this.updateY(t)),e},e.prototype.save=function(){var t=new re(this,this.matrix.clone());return t.brush=this.currentBrush,t.pen=this.currentPen,t.font=this.currentFont,t.colorSpace=this.currentColorSpace,t.characterSpacing=this.previousCharacterSpacing,t.wordSpacing=this.previousWordSpacing,t.textScaling=this.previousTextScaling,t.textRenderingMode=this.previousTextRenderingMode,this.graphicsState.push(t),this.pdfStreamWriter.saveGraphicsState(),t},e.prototype.restore=function(t){if(void 0===t)this.graphicsState.length>0&&this.doRestoreState();else if(-1!==this.graphicsState.indexOf(t))for(;0!==this.graphicsState.length;){if(this.doRestoreState()===t)break}},e.prototype.doRestoreState=function(){var t=this.graphicsState.pop();return this.transformationMatrix=t.matrix,this.currentBrush=t.brush,this.currentPen=t.pen,this.currentFont=t.font,this.currentColorSpace=t.colorSpace,this.previousCharacterSpacing=t.characterSpacing,this.previousWordSpacing=t.wordSpacing,this.previousTextScaling=t.textScaling,this.previousTextRenderingMode=t.textRenderingMode,this.pdfStreamWriter.restoreGraphicsState(),t},e.prototype.drawPath=function(t,e,i){this._drawPath(t,e,i.pathPoints,i.pathTypes,i.fillMode)},e.prototype._drawPath=function(t,e,i,r,n){e instanceof te?(this.bCSInitialized=!1,e.graphics.colorSpace=this.colorSpace):e instanceof Yt&&(this.bCSInitialized=!1,e.colorSpace=this.colorSpace),this.stateControl(t,e,null),this.buildUpPath(i,r),this.drawPathHelper(t,e,n,!1)},e.prototype.drawArc=function(t,e,i,r,n,o,s){e instanceof k?this.drawArc(t,e.x,e.y,e.width,e.height,i,r):0!==s&&(this.stateControl(t,null,null),this.constructArcPath(e,i,e+r,i+n,o,s),this.drawPathHelper(t,null,!1))},e.prototype.buildUpPath=function(i,r){for(var n=i.length,o=0;o<n;++o){var s=0,a=i[o];switch(r[o]&e.pathTypesValuesMask){case t.PathPointType.Start:this.pdfStreamWriter.beginPath(a.x,a.y);break;case t.PathPointType.Bezier3:var h=new T(0,0),l=new T(0,0),u=this.getBezierPoints(i,r,o,h,l);this.pdfStreamWriter.appendBezierSegment(a,u.p2,u.p3),o=u.i;break;case t.PathPointType.Line:this.pdfStreamWriter.appendLineSegment(a);break;default:throw new Error("ArithmeticException - Incorrect path formation.")}s=r[o],this.checkFlags(s)}},e.prototype.getBezierPoints=function(i,r,n,o,s){if(++n,(r[n]&e.pathTypesValuesMask)!==t.PathPointType.Bezier3)throw new Error("ArgumentException : errorMsg");if(o=i[n],++n,(r[n]&e.pathTypesValuesMask)!==t.PathPointType.Bezier3)throw new Error("ArgumentException : errorMsg");return s=i[n],{i:n,p2:o,p3:s}},e.prototype.checkFlags=function(e){(e&t.PathPointType.CloseSubpath)===t.PathPointType.CloseSubpath&&this.pdfStreamWriter.closePath()},e.prototype.constructArcPath=function(t,e,i,r,n,o){var s=this.getBezierArc(t,e,i,r,n,o);if(0!==s.length){var a=[s[0],s[1],s[2],s[3],s[4],s[5],s[6],s[7]];this.pdfStreamWriter.beginPath(a[0],a[1]);var h=0;for(h=0;h<s.length;h+=8)a=[s[h],s[h+1],s[h+2],s[h+3],s[h+4],s[h+5],s[h+6],s[h+7]],this.pdfStreamWriter.appendBezierSegment(a[2],a[3],a[4],a[5],a[6],a[7])}},e.prototype.getBezierArc=function(t,e,i,r,n,o){if(t>i){var s=void 0;s=t,t=i,i=s}if(r>e){s=void 0;s=e,e=r,r=s}var a,h;Math.abs(o)<=90?(a=o,h=1):a=o/(h=Math.ceil(Math.abs(o)/90));for(var l=(t+i)/2,u=(e+r)/2,c=(i-t)/2,p=(r-e)/2,d=a*(Math.PI/360),f=Math.abs(4/3*(1-Math.cos(d))/Math.sin(d)),g=[],m=0;m<h;m++){var y=(n+m*a)*(Math.PI/180),b=(n+(m+1)*a)*(Math.PI/180),w=Math.cos(y),P=Math.cos(b),S=Math.sin(y),v=Math.sin(b);a>0?g.push(l+c*w,u-p*S,l+c*(w-f*S),u-p*(S+f*w),l+c*(P+f*v),u-p*(v-f*P),l+c*P,u-p*v):g.push(l+c*w,u-p*S,l+c*(w+f*S),u-p*(S-f*w),l+c*(P-f*v),u-p*(v+f*P),l+c*P,u-p*v)}return g},e.pathTypesValuesMask=15,e.transparencyObject=!1,e}(),ie=function(){function t(t){this.sender=t}return t.prototype.getResources=function(){return this.sender.getResources()},t}(),re=function(){function e(e,i){if(this.internalTextRenderingMode=t.TextRenderingMode.Fill,this.internalCharacterSpacing=0,this.internalWordSpacing=0,this.internalTextScaling=100,this.pdfColorSpace=t.PdfColorSpace.Rgb,void 0!==e){this.pdfGraphics=e;var r=[];e.matrix.matrix.elements.forEach(function(t){r.push(t)}),this.transformationMatrix=new it,this.transformationMatrix.matrix=new rt(r)}}return Object.defineProperty(e.prototype,"graphics",{get:function(){return this.pdfGraphics},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"matrix",{get:function(){return this.transformationMatrix},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"characterSpacing",{get:function(){return this.internalCharacterSpacing},set:function(t){this.internalCharacterSpacing=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"wordSpacing",{get:function(){return this.internalWordSpacing},set:function(t){this.internalWordSpacing=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"textScaling",{get:function(){return this.internalTextScaling},set:function(t){this.internalTextScaling=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pen",{get:function(){return this.pdfPen},set:function(t){this.pdfPen=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"brush",{get:function(){return this.pdfBrush},set:function(t){this.pdfBrush=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"font",{get:function(){return this.pdfFont},set:function(t){this.pdfFont=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"colorSpace",{get:function(){return this.pdfColorSpace},set:function(t){this.pdfColorSpace=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"textRenderingMode",{get:function(){return this.internalTextRenderingMode},set:function(t){this.internalTextRenderingMode=t},enumerable:!0,configurable:!0}),e}(),ne=function(){return function(t,e,i){this.alphaPen=t,this.alphaBrush=e,this.blendMode=i}}(),oe=function(){function e(e,i){if(this.pdfColorSpace=t.PdfColorSpace.Rgb,this.isVisible=!0,this.sublayer=!1,this.contentLength=0,this.dictionaryProperties=new a,null===e)throw new Error("ArgumentNullException:page");if(this.pdfPage=e,this.clipPageTemplates=!0,void 0===i)this.content=new b;else if(i instanceof b||null===i){if(null===i)throw new Error("ArgumentNullException:stream");this.content=i}else this.content=new b,this.clipPageTemplates=i}return Object.defineProperty(e.prototype,"colorSpace",{get:function(){return this.pdfColorSpace},set:function(t){this.pdfColorSpace=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"page",{get:function(){return this.pdfPage},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"layerId",{get:function(){return this.layerid},set:function(t){this.layerid=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"name",{get:function(){return this.layerName},set:function(t){this.layerName=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"visible",{get:function(){return this.isVisible},set:function(t){this.isVisible=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"graphics",{get:function(){return null==this.pdfGraphics&&this.initializeGraphics(this.page),this.pdfGraphics},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"layers",{get:function(){return null==this.layer?(this.layer=new he(this.page),this.layer.sublayer=!0,this.layer):this.layer},enumerable:!0,configurable:!0}),e.prototype.add=function(){var t=new e(this.pdfPage);return t.name="",t},e.prototype.sign=function(t){return 0===t?0:t>0?1:-1},e.prototype.initializeGraphics=function(t){var e=t,i=new ie(this.page);if(this.pdfGraphics=new ee(t.size,i,this.content),this.pdfGraphics.mediaBoxUpperRightBound=0,null!=e){var r=e.section.parent;null!=r&&(this.pdfGraphics.colorSpace=r.document.colorSpace,this.colorSpace=r.document.colorSpace)}var n=this.sign(t.origin.y)===this.sign(t.origin.x);(t.origin.x>=0&&t.origin.y>=0||!n)&&this.pdfGraphics.initializeCoordinates();var o=e.section.getActualBounds(e,!0),s=e.section.pageSettings.margins;this.clipPageTemplates?t.origin.x>=0&&t.origin.y>=0&&this.pdfGraphics.clipTranslateMargins(o):this.graphics.clipTranslateMargins(o.x,o.y,s.left,s.top,s.right,s.bottom),this.pdfGraphics.setLayer(this)},Object.defineProperty(e.prototype,"element",{get:function(){return this.content},enumerable:!0,configurable:!0}),e}(),se=function(){function t(){}return Object.defineProperty(t.prototype,"count",{get:function(){return void 0===this.collection&&(this.collection=[]),this.collection.length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"list",{get:function(){return void 0===this.collection&&(this.collection=[]),this.collection},enumerable:!0,configurable:!0}),t}(),ae=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),he=function(t){function e(e){var i=t.call(this)||this;if(i.parentLayerCount=0,i.sublayer=!1,i.optionalContent=new h,e instanceof le){i.page=e;var r=e;i.parseLayers(r)}return i}return ae(e,t),e.prototype.items=function(t,e){if("number"==typeof t&&void 0===e){return this.list[t]}if(null==e)throw new Error("ArgumentNullException: layer");if(e.page!==this.page)throw new Error("ArgumentException: The layer belongs to another page")},e.prototype.add=function(t,e){if(void 0===t){var i=new oe(this.page);return i.name="",this.add(i),i}if(t instanceof oe){var r=this.list.push(t);return this.addLayer(r,t),r}return 0},e.prototype.addLayer=function(t,e){var i=new C(e);this.page.contents.add(i)},e.prototype.insert=function(t,e){for(var i=[],r=this.list.length,n=t;n<r;n++)i.push(this.list.pop());this.list.push(e);for(n=0;n<i.length;n++)this.list.push(i[n]);this.insertLayer(t,e)},e.prototype.insertLayer=function(t,e){if(null==e)throw new Error("ArgumentNullException:layer");var i=new C(e);this.page.contents.insert(t,i)},e.prototype.parseLayers=function(t){var e=this.page.contents;this.page.getResources();t.crossTable;var i=new b,r=new b,n=[];n.push("q"),i.data=n,e.insert(0,new C(i)),(n=[]).push("Q"),r.data=n,e.insert(e.count,new C(r))},e.prototype.indexOf=function(t){if(null==t)throw new Error("ArgumentNullException: layer");return this.list.indexOf(t)},e}(se),le=function(){function t(t){this.defLayerIndex=-1,this.modified=!1,this.dictionaryProperties=new a,this.pageDictionary=t}return Object.defineProperty(t.prototype,"section",{get:function(){return this.pdfSection},set:function(t){this.pdfSection=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dictionary",{get:function(){return this.pageDictionary},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"element",{get:function(){return this.pageDictionary},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"defaultLayer",{get:function(){var t=this.layers,e=this.defaultLayerIndex;return t.items(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"defaultLayerIndex",{get:function(){if(0===this.layerCollection.count||-1===this.defLayerIndex){var t=this.layerCollection.add();this.defLayerIndex=this.layerCollection.indexOf(t)}return this.defLayerIndex},set:function(t){if(t<0||t>this.layers.count-1)throw new Error("ArgumentOutOfRangeException : value, Index can not be less 0 and greater Layers.Count - 1");this.defLayerIndex=t,this.modified=!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"layers",{get:function(){return null!=this.layerCollection&&void 0!==this.layerCollection||(this.layerCollection=new he(this)),this.layerCollection},enumerable:!0,configurable:!0}),t.prototype.getResources=function(){return null==this.resources&&(this.resources=new Zt,this.dictionary.items.setValue(this.dictionaryProperties.resources,this.resources)),this.resources},Object.defineProperty(t.prototype,"contents",{get:function(){var t=this.pageDictionary.items.getValue(this.dictionaryProperties.contents);return null==t&&(t=new m,this.pageDictionary.items.setValue(this.dictionaryProperties.contents,t)),t},enumerable:!0,configurable:!0}),t.prototype.setResources=function(t){this.resources=t,this.dictionary.items.setValue(this.dictionaryProperties.resources,this.resources),this.modified=!0},t}(),ue=function(){function e(t){this.alreadyExistsAnnotationError="This annotatation had been already added to page",this.missingAnnotationException="Annotation is not contained in collection.",this.dictionaryProperties=new a,this.internalAnnotations=new m,this.lists=[],void 0!==t&&(this.page=t)}return Object.defineProperty(e.prototype,"annotations",{get:function(){return this.internalAnnotations},set:function(t){this.internalAnnotations=t},enumerable:!0,configurable:!0}),e.prototype.add=function(t){this.doAdd(t)},e.prototype.doAdd=function(t){if(void 0===t.destination)return t.setPage(this.page),this.internalAnnotations.add(new C(t)),this.lists.push(t);var e=(new I).layout(t.text,t.font,t.stringFormat,new j(t.bounds.width,0),!1,new j(0,0)),i=t.bounds.y;if(1===e.lines.length){var r=t.font.measureString(e.lines[0].text);t.bounds=new k(new T(t.bounds.x,i),r),t.text=e.lines[0].text,this.page.graphics.drawString(t.text,t.font,null,t.brush,t.bounds.x,t.bounds.y,t.bounds.width,t.bounds.height,null),t.setPage(this.page),this.setColor(t),this.internalAnnotations.add(new C(t)),this.lists.push(t)}else for(var n=0;n<e.lines.length;n++){r=t.font.measureString(e.lines[n].text);if(0===n)t.bounds=new k(t.bounds.x,i,r.width,r.height),t.text=e.lines[n].text,this.page.graphics.drawString(t.text,t.font,null,t.brush,t.bounds.x,i,r.width,r.height,null),t.setPage(this.page),this.setColor(t),this.internalAnnotations.add(new C(t)),this.lists.push(t),i+=t.bounds.height;else{var o=t.clone();o.bounds=new k(new T(t.bounds.x,i),r),o.text=e.lines[n].text,this.page.graphics.drawString(o.text,o.font,null,o.brush,o.bounds.x,o.bounds.y,o.bounds.width,o.bounds.height,null),o.setPage(this.page),this.setColor(o),this.internalAnnotations.add(new C(o)),this.lists.push(o),i+=o.bounds.height}}},e.prototype.setColor=function(e){var i=t.PdfColorSpace.Rgb,r=e.color.toArray(i);e.dictionary.items.setValue(this.dictionaryProperties.c,r)},Object.defineProperty(e.prototype,"element",{get:function(){return this.internalAnnotations},enumerable:!0,configurable:!0}),e}(),ce=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),pe=function(t){function e(){var e=t.call(this,new h)||this;return e.annotationCollection=null,e.beginSave=null,e.initialize(),e}return ce(e,t),Object.defineProperty(e.prototype,"document",{get:function(){return null!==this.section&&null!==this.section.parent?this.section.parent.document:null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"graphics",{get:function(){var t=this.defaultLayer.graphics;return t.currentPage=this,t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"crossTable",{get:function(){if(null===this.section)throw new Error("PdfDocumentException : Page is not created");return null===this.section.parent?this.section.parentDocument.crossTable:this.section.parent.document.crossTable},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this.section.pageSettings.size},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"origin",{get:function(){return this.section.pageSettings.origin},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"annotations",{get:function(){return null==this.annotationCollection&&(this.annotationCollection=new ue(this),this.dictionary.items.setValue(this.dictionaryProperties.annots,this.annotationCollection.element),this.annotationCollection.annotations=this.dictionary.items.getValue(this.dictionaryProperties.annots)),this.annotationCollection},enumerable:!0,configurable:!0}),e.prototype.initialize=function(){this.dictionary.items.setValue(this.dictionaryProperties.type,new o("Page")),this.dictionary.pageBeginDrawTemplate=new f(this)},e.prototype.setSection=function(t){this.section=t,this.dictionary.items.setValue(this.dictionaryProperties.parent,new C(t))},e.prototype.resetProgress=function(){this.isProgressOn=!1},e.prototype.getClientSize=function(){var t=this.section.getActualBounds(this,!0);return new j(t.width,t.height)},e.prototype.pageBeginSave=function(){var t=this.document;void 0!==typeof t&&null!=t&&this.drawPageTemplates(t),null!=this.beginSave&&void 0!==this.beginSave&&this.beginSave(this)},e.prototype.drawPageTemplates=function(t){if(this.section.containsTemplates(t,this,!1)){var e=new oe(this,!1);if(this.layers.insert(0,e),this.section.drawTemplates(this,e,t,!1),null!==e.graphics&&void 0!==e.graphics)for(var i=0;i<e.graphics.automaticFields.automaticFields.length;i++){var r=e.graphics.automaticFields.automaticFields[i];r.field.performDraw(e.graphics,r.location,r.scalingX,r.scalingY)}}if(this.section.containsTemplates(t,this,!0)){var n=new oe(this,!1);this.layers.add(n),this.section.drawTemplates(this,n,t,!0)}},e}(le),de=function(){function t(t){this.pdfPage=void 0!==t?t:null}return Object.defineProperty(t.prototype,"page",{get:function(){return this.pdfPage},enumerable:!0,configurable:!0}),t}(),fe=function(){function t(t){if(this.pdfSection=null,null==t)throw Error('ArgumentNullException("section")');this.section=t}return Object.defineProperty(t.prototype,"section",{get:function(){return this.pdfSection},set:function(t){this.pdfSection=t},enumerable:!0,configurable:!0}),t.prototype.contains=function(t){return this.section.contains(t)},t.prototype.remove=function(t){this.section.remove(t)},t.prototype.add=function(){return this.section.add()},t}(),ge=function(){function e(){}return Object.defineProperty(e.prototype,"left",{get:function(){return this.leftTemplate},set:function(e){this.leftTemplate=this.checkElement(e,t.TemplateType.Left)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"top",{get:function(){return this.topTemplate},set:function(e){this.topTemplate=this.checkElement(e,t.TemplateType.Top)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"right",{get:function(){return this.rightTemplate},set:function(e){this.rightTemplate=this.checkElement(e,t.TemplateType.Right)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bottom",{get:function(){return this.bottomTemplate},set:function(e){this.bottomTemplate=this.checkElement(e,t.TemplateType.Bottom)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"EvenLeft",{get:function(){return this.evenLeft},set:function(e){this.evenLeft=this.checkElement(e,t.TemplateType.Left)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"EvenTop",{get:function(){return this.evenTop},set:function(e){this.evenTop=this.checkElement(e,t.TemplateType.Top)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"EvenRight",{get:function(){return this.evenRight},set:function(e){this.evenRight=this.checkElement(e,t.TemplateType.Right)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"EvenBottom",{get:function(){return this.evenBottom},set:function(e){this.evenBottom=this.checkElement(e,t.TemplateType.Bottom)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"OddLeft",{get:function(){return this.oddLeft},set:function(e){this.oddLeft=this.checkElement(e,t.TemplateType.Left)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"OddTop",{get:function(){return this.oddTop},set:function(e){this.oddTop=this.checkElement(e,t.TemplateType.Top)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"OddRight",{get:function(){return this.oddRight},set:function(e){this.oddRight=this.checkElement(e,t.TemplateType.Right)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"OddBottom",{get:function(){return this.oddBottom},set:function(e){this.oddBottom=this.checkElement(e,t.TemplateType.Bottom)},enumerable:!0,configurable:!0}),e.prototype.getLeft=function(t){if(null==t)throw new Error("ArgumentNullException:page");return this.isEven(t)?null!=this.EvenLeft?this.EvenLeft:this.left:null!=this.OddLeft?this.OddLeft:this.left},e.prototype.getTop=function(t){if(null==t)throw new Error("ArgumentNullException:page");return this.isEven(t)?null!=this.EvenTop?this.EvenTop:this.top:null!=this.OddTop?this.OddTop:this.top},e.prototype.getRight=function(t){if(null==t)throw new Error("ArgumentNullException:page");return this.isEven(t)?null!=this.EvenRight?this.EvenRight:this.right:null!=this.OddRight?this.OddRight:this.right},e.prototype.getBottom=function(t){if(null==t)throw new Error("ArgumentNullException:page");return this.isEven(t)?null!=this.EvenBottom?this.EvenBottom:this.bottom:null!=this.OddBottom?this.OddBottom:this.bottom},e.prototype.isEven=function(t){var e=t.section.document.pages;return(e.pageCollectionIndex.containsKey(t)?e.pageCollectionIndex.getValue(t)+1:e.indexOf(t)+1)%2==0},e.prototype.checkElement=function(e,i){if(null!=e){if(void 0!==e.type&&e.type!==t.TemplateType.None)throw new Error("NotSupportedException:Can not reassign the template element. Please, create new one.");e.type=i}return e},e}(),me=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ye=function(t){function e(){var e=t.call(this)||this;return e.leftValue=e.topValue=e.rightValue=e.bottomValue=e.stampValue=!0,e}return me(e,t),Object.defineProperty(e.prototype,"applyDocumentLeftTemplate",{get:function(){return this.leftValue},set:function(t){this.leftValue=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"applyDocumentTopTemplate",{get:function(){return this.topValue},set:function(t){this.topValue=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"applyDocumentRightTemplate",{get:function(){return this.rightValue},set:function(t){this.rightValue=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"applyDocumentBottomTemplate",{get:function(){return this.bottomValue},set:function(t){this.bottomValue=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"applyDocumentStamps",{get:function(){return this.stampValue},set:function(t){this.stampValue=t},enumerable:!0,configurable:!0}),e}(ge),be=function(){function t(t,e){this.pageAdded=new de,this.pdfPages=[],this.dictionaryProperties=new a,this.pdfDocument=t,void 0===e?(this.settings=t.pageSettings.clone(),this.initialSettings=this.settings.clone()):(this.settings=e.clone(),this.initialSettings=this.settings.clone()),this.initialize()}return Object.defineProperty(t.prototype,"parent",{get:function(){return this.sectionCollection},set:function(t){this.sectionCollection=t,this.section.items.setValue(this.dictionaryProperties.parent,new C(t))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parentDocument",{get:function(){return this.pdfDocument},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pageSettings",{get:function(){return this.settings},set:function(t){if(null==t)throw Error("Value can not be null.");this.settings=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"element",{get:function(){return this.section},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"count",{get:function(){return this.pagesReferences.count},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"template",{get:function(){return null==this.pageTemplate&&(this.pageTemplate=new ye),this.pageTemplate},set:function(t){this.pageTemplate=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"document",{get:function(){return this.sectionCollection.document},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pages",{get:function(){return null!=this.pagesCollection&&void 0!==this.pagesCollection||(this.pagesCollection=new fe(this)),this.pagesCollection},enumerable:!0,configurable:!0}),t.prototype.getPages=function(){return this.pdfPages},t.prototype.pointToNativePdf=function(t,e){var i=this.getActualBounds(t,!0);return e.x+=i.x,e.y=this.pageSettings.height-e.y,e},t.prototype.setPageSettings=function(t){this.settings=t,this.state.orientation=t.orientation,this.state.rotate=t.rotate,this.state.size=t.size,this.state.origin=t.origin},t.prototype.initialize=function(){this.pagesReferences=new m,this.section=new h,this.state=new we(this.pdfDocument),this.section.sectionBeginSave=new d(this,this.state),this.pageCount=new g(0),this.section.items.setValue(this.dictionaryProperties.count,this.pageCount),this.section.items.setValue(this.dictionaryProperties.type,new o(this.dictionaryProperties.pages)),this.section.items.setValue(this.dictionaryProperties.kids,this.pagesReferences)},t.prototype.containsTemplates=function(t,e,i){var r=this.getDocumentTemplates(t,e,i),n=this.getSectionTemplates(e,i);return r.length>0||n.length>0},t.prototype.getDocumentTemplates=function(t,e,i){var r=[];return this.template.applyDocumentTopTemplate&&null!=t.template.getTop(e)&&(!t.template.getTop(e).foreground&&!i||t.template.getTop(e).foreground&&i)&&r.push(t.template.getTop(e)),this.template.applyDocumentBottomTemplate&&null!=t.template.getBottom(e)&&(!t.template.getBottom(e).foreground&&!i||t.template.getBottom(e).foreground&&i)&&r.push(t.template.getBottom(e)),this.template.applyDocumentLeftTemplate&&null!=t.template.getLeft(e)&&(!t.template.getLeft(e).foreground&&!i||t.template.getLeft(e).foreground&&i)&&r.push(t.template.getLeft(e)),this.template.applyDocumentRightTemplate&&null!=t.template.getRight(e)&&(!t.template.getRight(e).foreground&&!i||t.template.getRight(e).foreground&&i)&&r.push(t.template.getRight(e)),r},t.prototype.getSectionTemplates=function(t,e){var i=[];if(null!=this.template.getTop(t)){(!(r=this.template.getTop(t)).foreground&&!e||r.foreground&&e)&&i.push(r)}if(null!=this.template.getBottom(t)){(!(r=this.template.getBottom(t)).foreground&&!e||r.foreground&&e)&&i.push(r)}if(null!=this.template.getLeft(t)){(!(r=this.template.getLeft(t)).foreground&&!e||r.foreground&&e)&&i.push(r)}if(null!=this.template.getRight(t)){var r;(!(r=this.template.getRight(t)).foreground&&!e||r.foreground&&e)&&i.push(r)}return i},t.prototype.add=function(t){if(void 0===t){var e=new pe;return this.add(e),e}var i=this.checkPresence(t);this.pdfPages.push(t),this.pagesReferences.add(i),t.setSection(this),t.resetProgress(),this.pageAddedMethod(t)},t.prototype.checkPresence=function(t){for(var e=new C(t),i=!1,r=this.parent,n=0;n<r.section.length;n++){var o=r.section[n];i=i||o.contains(t)}return e},t.prototype.contains=function(t){return 0<=this.indexOf(t)},t.prototype.indexOf=function(t){for(var e=0;e<this.pdfPages.length;e++)if(this.pdfPages[e]===t)return this.pdfPages.indexOf(t);var i=new C(t);return this.pagesReferences.indexOf(i)},t.prototype.pageAddedMethod=function(t){var e=new de(t);this.onPageAdded(e);this.parent.document.pages.onPageAdded(e),this.pageCount.intValue=this.count},t.prototype.onPageAdded=function(t){},t.prototype.getActualBounds=function(t,e,i){if(t instanceof pe&&"boolean"==typeof e){var r=this.parent.document;return this.getActualBounds(r,t,e)}t=t,e=e,i=i;var n=new k(0,0,0,0);n.height=i?this.pageSettings.size.height:this.pageSettings.getActualSize().height,n.width=i?this.pageSettings.size.width:this.pageSettings.getActualSize().width;var o=this.getLeftIndentWidth(t,e,i),s=this.getTopIndentHeight(t,e,i),a=this.getRightIndentWidth(t,e,i),h=this.getBottomIndentHeight(t,e,i);return n.x+=o,n.y+=s,n.width-=o+a,n.height-=s+h,n},t.prototype.getLeftIndentWidth=function(t,e,i){if(null==t)throw new Error("ArgumentNullException:document");if(null==e)throw new Error("ArgumentNullException:page");var r=i?this.pageSettings.margins.left:0,n=null!=this.template.getLeft(e)?this.template.getLeft(e).width:0,o=null!=t.template.getLeft(e)?t.template.getLeft(e).width:0;return r+=this.template.applyDocumentLeftTemplate?Math.max(n,o):n},t.prototype.getTopIndentHeight=function(t,e,i){if(null==t)throw new Error("ArgumentNullException:document");if(null==e)throw new Error("ArgumentNullException:page");var r=i?this.pageSettings.margins.top:0,n=null!=this.template.getTop(e)?this.template.getTop(e).height:0,o=null!=t.template.getTop(e)?t.template.getTop(e).height:0;return r+=this.template.applyDocumentTopTemplate?Math.max(n,o):n},t.prototype.getRightIndentWidth=function(t,e,i){if(null==t)throw new Error("ArgumentNullException:document");if(null==e)throw new Error("ArgumentNullException:page");var r=i?this.pageSettings.margins.right:0,n=null!=this.template.getRight(e)?this.template.getRight(e).width:0,o=null!=t.template.getRight(e)?t.template.getRight(e).width:0;return r+=this.template.applyDocumentRightTemplate?Math.max(n,o):n},t.prototype.getBottomIndentHeight=function(t,e,i){if(null==t)throw new Error("ArgumentNullException:document");if(null==e)throw new Error("ArgumentNullException:page");var r=i?this.pageSettings.margins.bottom:0,n=null!=this.template.getBottom(e)?this.template.getBottom(e).height:0,o=null!=t.template.getBottom(e)?t.template.getBottom(e).height:0;return r+=this.template.applyDocumentBottomTemplate?Math.max(n,o):n},t.prototype.remove=function(t){if(null==t)throw Error('ArgumentNullException("page")');var e=this.pdfPages.indexOf(t);this.pagesReferences.removeAt(e);for(var i=[],r=0;r<e;r++)i.push(this.pdfPages[r]);for(r=e+1;r<this.pdfPages.length;r++)i.push(this.pdfPages[r]);this.pdfPages=i},t.prototype.applyPageSettings=function(t,e,i){var r=new k(i.origin,i.size);t.items.setValue(this.dictionaryProperties.mediaBox,m.fromRectangle(r));var n=0;n=Pe.rotateFactor*i.rotate;var o=new g(n);t.items.setValue(this.dictionaryProperties.rotate,o)},t.prototype.beginSave=function(t,e){var i=e.document;this.applyPageSettings(this.section,i.pageSettings,t)},t.prototype.drawTemplates=function(t,e,i,r){var n=this.getDocumentTemplates(i,t,r),o=this.getSectionTemplates(t,r);this.drawTemplatesHelper(e,i,n),this.drawTemplatesHelper(e,i,o)},t.prototype.drawTemplatesHelper=function(t,e,i){if(null!=i&&i.length>0)for(var r=i.length,n=0;n<r;n++){i[n].draw(t,e)}},t}(),we=function(){function t(t){this.pageOrientation=t.pageSettings.orientation,this.pageRotate=t.pageSettings.rotate,this.pageSize=t.pageSettings.size,this.pageOrigin=t.pageSettings.origin}return Object.defineProperty(t.prototype,"orientation",{get:function(){return this.pageOrientation},set:function(t){this.pageOrientation=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rotate",{get:function(){return this.pageRotate},set:function(t){this.pageRotate=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this.pageSize},set:function(t){this.pageSize=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"origin",{get:function(){return this.pageOrigin},set:function(t){this.pageOrigin=t},enumerable:!0,configurable:!0}),t}(),Pe=function(){function t(t){this.sections=[],this.dictionaryProperties=new a,this.pdfDocument=t.clone(),this.initialize()}return Object.defineProperty(t.prototype,"section",{get:function(){return this.sections},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"document",{get:function(){return this.pdfDocument},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"count",{get:function(){return this.sections.length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"element",{get:function(){return this.pages},enumerable:!0,configurable:!0}),t.prototype.initialize=function(){this.sectionCount=new g(0),this.sectionCollection=new m,this.pages=new h,this.pages.beginSave=new l(this),this.pages.items.setValue(this.dictionaryProperties.type,new o("Pages")),this.pages.items.setValue(this.dictionaryProperties.kids,this.sectionCollection),this.pages.items.setValue(this.dictionaryProperties.count,this.sectionCount),this.pages.items.setValue(this.dictionaryProperties.resources,new h),this.setPageSettings(this.pages,this.pdfDocument.pageSettings)},t.prototype.pdfSectionCollection=function(t){if(t<0||t>=this.count)throw new Error("IndexOutOfRangeException()");return this.sections[t]},t.prototype.setPageSettings=function(t,e){var i=new k(new T,e.size);t.items.setValue(this.dictionaryProperties.mediaBox,m.fromRectangle(i))},t.prototype.add=function(t){if(void 0===t){var e=new be(this.pdfDocument);return this.add(e),e}var i=this.checkSection(t);return this.sections.push(t),t.parent=this,this.sectionCollection.add(i),this.sections.indexOf(t)},t.prototype.checkSection=function(t){var e=new C(t);this.sectionCollection.contains(e);return e},t.prototype.countPages=function(){var t=0;return this.sections.forEach(function(e){return t+=e.count}),t},t.prototype.beginSave=function(){this.sectionCount.intValue=this.countPages()},t.rotateFactor=90,t}(),Se=function(){function t(t){this.pdfPageCollectionIndex=new n,this.document=t}return Object.defineProperty(t.prototype,"count",{get:function(){return this.countPages()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pageCollectionIndex",{get:function(){return this.pdfPageCollectionIndex},enumerable:!0,configurable:!0}),t.prototype.add=function(t){if(void 0===t){var e=new pe;return this.add(e),e}this.getLastSection().add(t)},t.prototype.getLastSection=function(){var t=this.document.sections;0===t.section.length&&t.add();return t.section[t.section.length-1]},t.prototype.onPageAdded=function(t){},t.prototype.countPages=function(){for(var t=this.document.sections,e=0,i=0;i<t.section.length;i++)e+=t.section[i].count;return e},t.prototype.getPageByIndex=function(t){return this.getPage(t)},t.prototype.getPage=function(t){if(t<0||t>=this.count)throw Error('ArgumentOutOfRangeException("index", "Value can not be less 0")');for(var e=null,i=0,r=0,n=0,o=this.document.sections.count,s=0;s<o;s++){var a=this.document.sections.section[s];if(r=a.count,n=t-i,t>=i&&n<r){e=a.getPages()[n];break}i+=r}return e},t.prototype.indexOf=function(t){var e=-1;if(null==t)throw new Error("ArgumentNullException: page");for(var i=0,r=0,n=this.document.sections.count;r<n;r++){var o=this.document.sections.pdfSectionCollection(r);if((e=o.indexOf(t))>=0){e+=i;break}e=-1,i+=o.count}return e},t.prototype.remove=function(t){if(null==t)throw Error('ArgumentNullException("page")');for(var e=null,i=0,r=this.document.sections.count;i<r;i++)if((e=this.document.sections.pdfSectionCollection(i)).pages.contains(t)){e.pages.remove(t);break}return e},t}(),ve=function(){function t(){this.referenceObjects=[],this.pdfFontCollection=new n}return t.prototype.search=function(t){var e=null,i=this.getGroup(t);return null==i?i=this.createNewGroup():i.length>0&&(e=i[0]),i.push(t),e},t.prototype.createNewGroup=function(){var t=[];return this.referenceObjects.push(t),t},t.prototype.getGroup=function(t){var e=null;if(null!==t)for(var i=this.referenceObjects.length,r=0;r<i;r++){if(this.referenceObjects.length>0){var n=this.referenceObjects[r];if(n.length>0){var o=n[0];if(t.equalsTo(o)){e=n;break}}else this.removeGroup(n)}i=this.referenceObjects.length}return e},t.prototype.removeGroup=function(t){if(null!==t){var e=this.referenceObjects.indexOf(t);this.referenceObjects.slice(e,e+1)}},t.prototype.destroy=function(){this.pdfFontCollection=void 0,this.referenceObjects=void 0},t}(),Ce=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Be=function(e){function i(t){var r=e.call(this)||this;r.defaultMargin=40,r.streamWriter=null,r.document=r;var n=!1;void 0===t?(i.cacheCollection=new ve,n=!1):n=t;var o=new W;r.setMainObjectCollection(o);var s=new X;s.isMerging=n,s.document=r,r.setCrossTable(s);var a=new Y;return r.setCatalog(a),o.add(a),a.position=-1,r.sectionCollection=new Pe(r),r.documentPageCollection=new Se(r),a.pages=r.sectionCollection,r}return Ce(i,e),Object.defineProperty(i,"defaultFont",{get:function(){return null==this.defaultStandardFont&&(this.defaultStandardFont=new Le(t.PdfFontFamily.Helvetica,8)),this.defaultStandardFont},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"sections",{get:function(){return this.sectionCollection},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"pageSettings",{get:function(){return null==this.settings&&(this.settings=new Q(this.defaultMargin)),this.settings},set:function(t){this.settings=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"pages",{get:function(){return this.documentPageCollection},enumerable:!0,configurable:!0}),Object.defineProperty(i,"cache",{get:function(){return void 0===i.cacheCollection||null==i.cacheCollection?new ve:i.cacheCollection},set:function(t){this.cacheCollection=t},enumerable:!0,configurable:!0}),Object.defineProperty(i,"enableCache",{get:function(){return this.isCacheEnabled},set:function(t){this.isCacheEnabled=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"colorSpace",{get:function(){return this.pdfColorSpace===t.PdfColorSpace.Rgb||this.pdfColorSpace===t.PdfColorSpace.Cmyk||this.pdfColorSpace===t.PdfColorSpace.GrayScale?this.pdfColorSpace:t.PdfColorSpace.Rgb},set:function(e){e===t.PdfColorSpace.Rgb||e===t.PdfColorSpace.Cmyk||e===t.PdfColorSpace.GrayScale?this.pdfColorSpace=e:this.pdfColorSpace=t.PdfColorSpace.Rgb},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"template",{get:function(){return null==this.pageTemplate&&(this.pageTemplate=new ge),this.pageTemplate},set:function(t){this.pageTemplate=t},enumerable:!0,configurable:!0}),i.prototype.docSave=function(t,e,i){if(this.checkPagesPresence(),null===t)throw new Error("ArgumentNullException : stream");this.streamWriter=t;var r=new z(t);if(r.document=this,"boolean"==typeof e&&void 0===i)return this.crossTable.save(r);this.crossTable.save(r,e)},i.prototype.checkPagesPresence=function(){0===this.pages.count&&this.pages.add()},i.prototype.destroy=function(){this.catalog=void 0,this.colorSpace=void 0,this.currentSavingObj=void 0,this.documentPageCollection=void 0,this.isStreamCopied=void 0,this.pageSettings=void 0,this.pageTemplate=void 0,this.pdfColorSpace=void 0,this.sectionCollection=void 0,i.cache.destroy(),this.crossTable.pdfObjects.destroy(),i.cache=void 0,this.streamWriter.destroy()},i.defaultStandardFont=null,i.isCacheEnabled=!0,i}(H),Oe=function(){function e(){}return e.getMetrics=function(e,i,r){var n=null;switch(e){case t.PdfFontFamily.Helvetica:n=this.getHelveticaMetrics(e,i,r);break;case t.PdfFontFamily.Courier:n=this.getCourierMetrics(e,i,r);break;case t.PdfFontFamily.TimesRoman:n=this.getTimesMetrics(e,i,r);break;case t.PdfFontFamily.Symbol:n=this.getSymbolMetrics(e,i,r);break;case t.PdfFontFamily.ZapfDingbats:n=this.getZapfDingbatsMetrics(e,i,r);break;default:n=this.getHelveticaMetrics(t.PdfFontFamily.Helvetica,i,r)}return n.name=e.toString(),n.subScriptSizeFactor=this.subSuperScriptFactor,n.superscriptSizeFactor=this.subSuperScriptFactor,n},e.getHelveticaMetrics=function(e,i,r){var n=new Ft;return(i&t.PdfFontStyle.Bold)>0&&(i&t.PdfFontStyle.Italic)>0?(n.ascent=this.helveticaBoldItalicAscent,n.descent=this.helveticaBoldItalicDescent,n.postScriptName=this.helveticaBoldItalicName,n.size=r,n.widthTable=new Gt(this.arialBoldWidth),n.height=n.ascent-n.descent):(i&t.PdfFontStyle.Bold)>0?(n.ascent=this.helveticaBoldAscent,n.descent=this.helveticaBoldDescent,n.postScriptName=this.helveticaBoldName,n.size=r,n.widthTable=new Gt(this.arialBoldWidth),n.height=n.ascent-n.descent):(i&t.PdfFontStyle.Italic)>0?(n.ascent=this.helveticaItalicAscent,n.descent=this.helveticaItalicDescent,n.postScriptName=this.helveticaItalicName,n.size=r,n.widthTable=new Gt(this.arialWidth),n.height=n.ascent-n.descent):(n.ascent=this.helveticaAscent,n.descent=this.helveticaDescent,n.postScriptName=this.helveticaName,n.size=r,n.widthTable=new Gt(this.arialWidth),n.height=n.ascent-n.descent),n},e.getCourierMetrics=function(e,i,r){var n=new Ft;return(i&t.PdfFontStyle.Bold)>0&&(i&t.PdfFontStyle.Italic)>0?(n.ascent=this.courierBoldItalicAscent,n.descent=this.courierBoldItalicDescent,n.postScriptName=this.courierBoldItalicName,n.size=r,n.widthTable=new Gt(this.fixedWidth),n.height=n.ascent-n.descent):(i&t.PdfFontStyle.Bold)>0?(n.ascent=this.courierBoldAscent,n.descent=this.courierBoldDescent,n.postScriptName=this.courierBoldName,n.size=r,n.widthTable=new Gt(this.fixedWidth),n.height=n.ascent-n.descent):(i&t.PdfFontStyle.Italic)>0?(n.ascent=this.courierItalicAscent,n.descent=this.courierItalicDescent,n.postScriptName=this.courierItalicName,n.size=r,n.widthTable=new Gt(this.fixedWidth),n.height=n.ascent-n.descent):(n.ascent=this.courierAscent,n.descent=this.courierDescent,n.postScriptName=this.courierName,n.size=r,n.widthTable=new Gt(this.fixedWidth),n.height=n.ascent-n.descent),n},e.getTimesMetrics=function(e,i,r){var n=new Ft;return(i&t.PdfFontStyle.Bold)>0&&(i&t.PdfFontStyle.Italic)>0?(n.ascent=this.timesBoldItalicAscent,n.descent=this.timesBoldItalicDescent,n.postScriptName=this.timesBoldItalicName,n.size=r,n.widthTable=new Gt(this.timesRomanBoldItalicWidths),n.height=n.ascent-n.descent):(i&t.PdfFontStyle.Bold)>0?(n.ascent=this.timesBoldAscent,n.descent=this.timesBoldDescent,n.postScriptName=this.timesBoldName,n.size=r,n.widthTable=new Gt(this.timesRomanBoldWidth),n.height=n.ascent-n.descent):(i&t.PdfFontStyle.Italic)>0?(n.ascent=this.timesItalicAscent,n.descent=this.timesItalicDescent,n.postScriptName=this.timesItalicName,n.size=r,n.widthTable=new Gt(this.timesRomanItalicWidth),n.height=n.ascent-n.descent):(n.ascent=this.timesAscent,n.descent=this.timesDescent,n.postScriptName=this.timesName,n.size=r,n.widthTable=new Gt(this.timesRomanWidth),n.height=n.ascent-n.descent),n},e.getSymbolMetrics=function(t,e,i){var r=new Ft;return r.ascent=this.symbolAscent,r.descent=this.symbolDescent,r.postScriptName=this.symbolName,r.size=i,r.widthTable=new Gt(this.symbolWidth),r.height=r.ascent-r.descent,r},e.getZapfDingbatsMetrics=function(t,e,i){var r=new Ft;return r.ascent=this.zapfDingbatsAscent,r.descent=this.zapfDingbatsDescent,r.postScriptName=this.zapfDingbatsName,r.size=i,r.widthTable=new Gt(this.zapfDingbatsWidth),r.height=r.ascent-r.descent,r},e.subSuperScriptFactor=1.52,e.helveticaAscent=931,e.helveticaDescent=-225,e.helveticaName="Helvetica",e.helveticaBoldAscent=962,e.helveticaBoldDescent=-228,e.helveticaBoldName="Helvetica-Bold",e.helveticaItalicAscent=931,e.helveticaItalicDescent=-225,e.helveticaItalicName="Helvetica-Oblique",e.helveticaBoldItalicAscent=962,e.helveticaBoldItalicDescent=-228,e.helveticaBoldItalicName="Helvetica-BoldOblique",e.courierAscent=805,e.courierDescent=-250,e.courierName="Courier",e.courierBoldAscent=801,e.courierBoldDescent=-250,e.courierBoldName="Courier-Bold",e.courierItalicAscent=805,e.courierItalicDescent=-250,e.courierItalicName="Courier-Oblique",e.courierBoldItalicAscent=801,e.courierBoldItalicDescent=-250,e.courierBoldItalicName="Courier-BoldOblique",e.timesAscent=898,e.timesDescent=-218,e.timesName="Times-Roman",e.timesBoldAscent=935,e.timesBoldDescent=-218,e.timesBoldName="Times-Bold",e.timesItalicAscent=883,e.timesItalicDescent=-217,e.timesItalicName="Times-Italic",e.timesBoldItalicAscent=921,e.timesBoldItalicDescent=-218,e.timesBoldItalicName="Times-BoldItalic",e.symbolAscent=1010,e.symbolDescent=-293,e.symbolName="Symbol",e.zapfDingbatsAscent=820,e.zapfDingbatsDescent=-143,e.zapfDingbatsName="ZapfDingbats",e.arialWidth=[278,278,355,556,556,889,667,191,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,278,278,584,584,584,556,1015,667,667,722,722,667,611,778,722,278,500,667,556,833,722,778,667,778,722,667,611,722,667,944,667,667,611,278,278,278,469,556,333,556,556,500,556,556,278,556,556,222,222,500,222,833,556,556,556,556,333,500,278,556,500,722,500,500,500,334,260,334,584,0,556,0,222,556,333,1e3,556,556,333,1e3,667,333,1e3,0,611,0,0,222,222,333,333,350,556,1e3,333,1e3,500,333,944,0,500,667,0,333,556,556,556,556,260,556,333,737,370,556,584,0,737,333,400,584,333,333,333,556,537,278,333,333,365,556,834,834,834,611,667,667,667,667,667,667,1e3,722,667,667,667,667,278,278,278,278,722,722,778,778,778,778,778,584,778,722,722,722,722,667,667,611,556,556,556,556,556,556,889,500,556,556,556,556,278,278,278,278,556,556,556,556,556,556,556,584,611,556,556,556,556,500,556,500],e.arialBoldWidth=[278,333,474,556,556,889,722,238,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,333,333,584,584,584,611,975,722,722,722,722,667,611,778,722,278,556,722,611,833,722,778,667,778,722,667,611,722,667,944,667,667,611,333,278,333,584,556,333,556,611,556,611,556,333,611,611,278,278,556,278,889,611,611,611,611,389,556,333,611,556,778,556,556,500,389,280,389,584,0,556,0,278,556,500,1e3,556,556,333,1e3,667,333,1e3,0,611,0,0,278,278,500,500,350,556,1e3,333,1e3,556,333,944,0,500,667,0,333,556,556,556,556,280,556,333,737,370,556,584,0,737,333,400,584,333,333,333,611,556,278,333,333,365,556,834,834,834,611,722,722,722,722,722,722,1e3,722,667,667,667,667,278,278,278,278,722,722,778,778,778,778,778,584,778,722,722,722,722,667,667,611,556,556,556,556,556,556,889,556,556,556,556,556,278,278,278,278,611,611,611,611,611,611,611,584,611,611,611,611,611,556,611,556],e.fixedWidth=[600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600],e.timesRomanWidth=[250,333,408,500,500,833,778,180,333,333,500,564,250,333,250,278,500,500,500,500,500,500,500,500,500,500,278,278,564,564,564,444,921,722,667,667,722,611,556,722,722,333,389,722,611,889,722,722,556,722,667,556,611,722,722,944,722,722,611,333,278,333,469,500,333,444,500,444,500,444,333,500,500,278,278,500,278,778,500,500,500,500,333,389,278,500,500,722,500,500,444,480,200,480,541,0,500,0,333,500,444,1e3,500,500,333,1e3,556,333,889,0,611,0,0,333,333,444,444,350,500,1e3,333,980,389,333,722,0,444,722,0,333,500,500,500,500,200,500,333,760,276,500,564,0,760,333,400,564,300,300,333,500,453,250,333,300,310,500,750,750,750,444,722,722,722,722,722,722,889,667,611,611,611,611,333,333,333,333,722,722,722,722,722,722,722,564,722,722,722,722,722,722,556,500,444,444,444,444,444,444,667,444,444,444,444,444,278,278,278,278,500,500,500,500,500,500,500,564,500,500,500,500,500,500,500,500],e.timesRomanBoldWidth=[250,333,555,500,500,1e3,833,278,333,333,500,570,250,333,250,278,500,500,500,500,500,500,500,500,500,500,333,333,570,570,570,500,930,722,667,722,722,667,611,778,778,389,500,778,667,944,722,778,611,778,722,556,667,722,722,1e3,722,722,667,333,278,333,581,500,333,500,556,444,556,444,333,500,556,278,333,556,278,833,556,500,556,556,444,389,333,556,500,722,500,500,444,394,220,394,520,0,500,0,333,500,500,1e3,500,500,333,1e3,556,333,1e3,0,667,0,0,333,333,500,500,350,500,1e3,333,1e3,389,333,722,0,444,722,0,333,500,500,500,500,220,500,333,747,300,500,570,0,747,333,400,570,300,300,333,556,540,250,333,300,330,500,750,750,750,500,722,722,722,722,722,722,1e3,722,667,667,667,667,389,389,389,389,722,722,778,778,778,778,778,570,778,722,722,722,722,722,611,556,500,500,500,500,500,500,722,444,444,444,444,444,278,278,278,278,500,556,500,500,500,500,500,570,500,556,556,556,556,500,556,500],e.timesRomanItalicWidth=[250,333,420,500,500,833,778,214,333,333,500,675,250,333,250,278,500,500,500,500,500,500,500,500,500,500,333,333,675,675,675,500,920,611,611,667,722,611,611,722,722,333,444,667,556,833,667,722,611,722,611,500,556,722,611,833,611,556,556,389,278,389,422,500,333,500,500,444,500,444,278,500,500,278,278,444,278,722,500,500,500,500,389,389,278,500,444,667,444,444,389,400,275,400,541,0,500,0,333,500,556,889,500,500,333,1e3,500,333,944,0,556,0,0,333,333,556,556,350,500,889,333,980,389,333,667,0,389,556,0,389,500,500,500,500,275,500,333,760,276,500,675,0,760,333,400,675,300,300,333,500,523,250,333,300,310,500,750,750,750,500,611,611,611,611,611,611,889,667,611,611,611,611,333,333,333,333,722,667,722,722,722,722,722,675,722,722,722,722,722,556,611,500,500,500,500,500,500,500,667,444,444,444,444,444,278,278,278,278,500,500,500,500,500,500,500,675,500,500,500,500,500,444,500,444],e.timesRomanBoldItalicWidths=[250,389,555,500,500,833,778,278,333,333,500,570,250,333,250,278,500,500,500,500,500,500,500,500,500,500,333,333,570,570,570,500,832,667,667,667,722,667,667,722,778,389,500,667,611,889,722,722,611,722,667,556,611,722,667,889,667,611,611,333,278,333,570,500,333,500,500,444,500,444,333,500,556,278,278,500,278,778,556,500,500,500,389,389,278,556,444,667,500,444,389,348,220,348,570,0,500,0,333,500,500,1e3,500,500,333,1e3,556,333,944,0,611,0,0,333,333,500,500,350,500,1e3,333,1e3,389,333,722,0,389,611,0,389,500,500,500,500,220,500,333,747,266,500,606,0,747,333,400,570,300,300,333,576,500,250,333,300,300,500,750,750,750,500,667,667,667,667,667,667,944,667,667,667,667,667,389,389,389,389,722,722,722,722,722,722,722,570,722,722,722,722,722,611,611,500,500,500,500,500,500,500,722,444,444,444,444,444,278,278,278,278,500,556,500,500,500,500,500,570,500,556,556,556,556,444,500,444],e.symbolWidth=[250,333,713,500,549,833,778,439,333,333,500,549,250,549,250,278,500,500,500,500,500,500,500,500,500,500,278,278,549,549,549,444,549,722,667,722,612,611,763,603,722,333,631,722,686,889,722,722,768,741,556,592,611,690,439,768,645,795,611,333,863,333,658,500,500,631,549,549,494,439,521,411,603,329,603,549,549,576,521,549,549,521,549,603,439,576,713,686,493,686,494,480,200,480,549,750,620,247,549,167,713,500,753,753,753,753,1042,987,603,987,603,400,549,411,549,549,713,494,460,549,549,549,549,1e3,603,1e3,658,823,686,795,987,768,768,823,768,768,713,713,713,713,713,713,713,768,713,790,790,890,823,549,250,713,603,603,1042,987,603,987,603,494,329,790,790,786,713,384,384,384,384,384,384,494,494,494,494,329,274,686,686,686,384,384,384,384,384,384,494,494,494,-1],e.zapfDingbatsWidth=[278,974,961,974,980,719,789,790,791,690,960,939,549,855,911,933,911,945,974,755,846,762,761,571,677,763,760,759,754,494,552,537,577,692,786,788,788,790,793,794,816,823,789,841,823,833,816,831,923,744,723,749,790,792,695,776,768,792,759,707,708,682,701,826,815,789,789,707,687,696,689,786,787,713,791,785,791,873,761,762,762,759,759,892,892,788,784,438,138,277,415,392,392,668,668,390,390,317,317,276,276,509,509,410,410,234,234,334,334,732,544,544,910,667,760,760,776,595,694,626,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,894,838,1016,458,748,924,748,918,927,928,928,834,873,828,924,924,917,930,931,463,883,836,836,867,867,696,696,874,874,760,946,771,865,771,888,967,888,831,873,927,970,918],e}(),xe=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Le=function(e){function i(r,n,o){var s=e.call(this,n,void 0===o?r instanceof i?r.style:t.PdfFontStyle.Regular:o)||this;return s.dictionaryProperties=new a,s.encodings=["Unknown","StandardEncoding","MacRomanEncoding","MacExpertEncoding","WinAnsiEncoding","PDFDocEncoding","IdentityH"],s.pdfFontFamily=void 0===r?t.PdfFontFamily.Helvetica:r instanceof i?r.fontFamily:r,s.checkStyle(),s.initializeInternals(),s}return xe(i,e),Object.defineProperty(i.prototype,"fontFamily",{get:function(){return this.pdfFontFamily},enumerable:!0,configurable:!0}),i.prototype.checkStyle=function(){if(this.fontFamily===t.PdfFontFamily.Symbol||this.fontFamily===t.PdfFontFamily.ZapfDingbats){var e=this.style;e&=~(t.PdfFontStyle.Bold|t.PdfFontStyle.Italic),this.setStyle(e)}},i.prototype.getLineWidth=function(t,e){if(null==t)throw new Error("ArgumentNullException:line");for(var r=0,n=(this.name,0),o=(t=i.convert(t)).length;n<o;n++){var s=t[n];r+=this.getCharWidthInternal(s,e)}var a=this.metrics.getSize(e);return r*=G.charSizeMultiplier*a,r=this.applyFormatSettings(t,e,r)},i.prototype.equalsToFont=function(e){var i=!1,r=e;if(null!=r){var n=this.fontFamily===r.fontFamily,o=~(t.PdfFontStyle.Underline|t.PdfFontStyle.Strikeout),s=(this.style&o)==(r.style&o);i=n&&s}return i},i.prototype.initializeInternals=function(){Be.cache.search(this);var t=null,e=Oe.getMetrics(this.pdfFontFamily,this.style,this.size);this.metrics=e,t=this.createInternals(),this.setInternals(t)},i.prototype.createInternals=function(){var e=new h;if(e.items.setValue(this.dictionaryProperties.type,new o(this.dictionaryProperties.font)),e.items.setValue(this.dictionaryProperties.subtype,new o(this.dictionaryProperties.type1)),e.items.setValue(this.dictionaryProperties.baseFont,new o(this.metrics.postScriptName)),this.fontFamily!==t.PdfFontFamily.Symbol&&this.fontFamily!==t.PdfFontFamily.ZapfDingbats){var i=this.encodings[t.FontEncoding.WinAnsiEncoding];e.items.setValue(this.dictionaryProperties.encoding,new o(i))}return e},i.prototype.getCharWidthInternal=function(t,e){var r=0;r=t.charCodeAt(0),"0"!==this.name&&"1"!==this.name&&"2"!==this.name&&"3"!==this.name&&"4"!==this.name||(r-=i.charOffset),r=r>=0&&128!==r?r:0;return this.metrics.widthTable.items(r)},i.convert=function(t){return t},i.charOffset=32,i}(G),Te=function(){function e(e){this.dictionaryProperties=new a,this.pdfColor=new L(255,255,255),this.rectangle=new k(0,0,0,0),this.pdfPage=null,this.textBrush=new D(new L(0,0,0)),this.textFont=new Le(t.PdfFontFamily.TimesRoman,10),this.format=new N(t.PdfTextAlignment.Left),this.content="",this.pdfDictionary=new h,this.internalColor=new L,this.darkness=1,void 0===e?this.initialize():(this.initialize(),this.bounds=e)}return Object.defineProperty(e.prototype,"color",{get:function(){return this.pdfColor},set:function(t){this.pdfColor=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"innerColor",{get:function(){return this.internalColor},set:function(t){this.internalColor=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bounds",{get:function(){return this.rectangle},set:function(t){this.rectangle=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"page",{get:function(){return this.pdfPage},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"font",{get:function(){return this.textFont},set:function(t){this.textFont=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"stringFormat",{get:function(){return this.format},set:function(t){this.format=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"brush",{get:function(){return this.textBrush},set:function(t){this.textBrush=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"text",{get:function(){return this.content},set:function(t){this.content=t,this.dictionary.items.setValue(this.dictionaryProperties.contents,new S(this.content))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dictionary",{get:function(){return this.pdfDictionary},set:function(t){this.pdfDictionary=t},enumerable:!0,configurable:!0}),e.prototype.initialize=function(){this.pdfDictionary.annotationBeginSave=new p(this),this.pdfDictionary.items.setValue(this.dictionaryProperties.type,new o(this.dictionaryProperties.annot))},e.prototype.setPage=function(t){this.pdfPage=t,this.pdfDictionary.items.setValue(this.dictionaryProperties.p,new C(this.pdfPage))},e.prototype.beginSave=function(){this.save()},e.prototype.save=function(){var t=new k(this.rectangle.x,this.rectangle.y,this.rectangle.width,this.rectangle.height),e=this.pdfPage.section,i=t.height,r=e.pointToNativePdf(this.page,new T(t.x,t.y));t.x=r.x,t.width=r.x+t.width,t.y=r.y-this.page.document.pageSettings.margins.top,t.height=t.y-i,this.pdfDictionary.items.setValue(this.dictionaryProperties.rect,m.fromRectangle(t)),this.dictionary.items.setValue(this.dictionaryProperties.ca,new g(this.darkness))},Object.defineProperty(e.prototype,"element",{get:function(){return this.pdfDictionary},enumerable:!0,configurable:!0}),e}(),je=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ke=function(t){function e(e){return t.call(this,e)||this}return je(e,t),e.prototype.initialize=function(){t.prototype.initialize.call(this),this.dictionary.items.setValue(this.dictionaryProperties.subtype,new o(this.dictionaryProperties.link))},e}(Te),Ve=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Re=function(t){function e(e){var i=t.call(this,e)||this;return i.pdfAction=null,i}return Ve(e,t),e.prototype.getSetAction=function(t){if(void 0===t)return this.pdfAction;this.pdfAction=t},e}(ke),Me=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),De=function(t){function e(e,i){var r=t.call(this,e)||this;return r.pdfDestination=null,void 0!==i&&(r.destination=i),r}return Me(e,t),Object.defineProperty(e.prototype,"destination",{get:function(){return this.pdfDestination},set:function(t){this.pdfDestination=t},enumerable:!0,configurable:!0}),e.prototype.save=function(){t.prototype.save.call(this),null!=this.pdfDestination&&this.dictionary.items.setValue(this.dictionaryProperties.dest,this.pdfDestination.element)},e.prototype.clone=function(){var t=new e(this.bounds,this.destination);return t.color=this.color,t.brush=this.brush,t.destination=this.destination,t.font=this.font,t},e}(ke),Ne=function(){function t(t){this.layoutElement=t}return Object.defineProperty(t.prototype,"elements",{get:function(){return this.layoutElement},enumerable:!0,configurable:!0}),t.prototype.getElement=function(){return this.layoutElement},t.prototype.layout=function(t){return this.layoutInternal(t)},t.prototype.Layouter=function(t){return this.layoutInternal(t)},t.prototype.getNextPage=function(t){return t.section.add()},t.prototype.getPaginateBounds=function(t){if(null==t)throw new Error("ArgumentNullException : param");return t.format.usePaginateBounds?t.format.paginateBounds:new k(t.bounds.x,0,t.bounds.width,t.bounds.height)},t}(),Ae=function(){function t(t){void 0===t||(this.break=t.break,this.layout=t.layout,this.paginateBounds=t.paginateBounds,this.boundsSet=t.usePaginateBounds)}return Object.defineProperty(t.prototype,"layout",{get:function(){return this.layoutType},set:function(t){this.layoutType=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"break",{get:function(){return this.breakType},set:function(t){this.breakType=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"paginateBounds",{get:function(){return void 0===this.layoutPaginateBounds&&null==this.layoutPaginateBounds&&(this.layoutPaginateBounds=new k(0,0,0,0)),this.layoutPaginateBounds},set:function(t){this.layoutPaginateBounds=t,this.boundsSet=!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"usePaginateBounds",{get:function(){return this.boundsSet},enumerable:!0,configurable:!0}),t}(),Ie=function(){function t(){}return Object.defineProperty(t.prototype,"page",{get:function(){return this.pdfPage},set:function(t){this.pdfPage=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"bounds",{get:function(){return new k(this.layoutBounds.x,this.layoutBounds.y,this.layoutBounds.width,this.layoutBounds.height)},set:function(t){this.layoutBounds=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"format",{get:function(){return this.layoutFormat},set:function(t){this.layoutFormat=t},enumerable:!0,configurable:!0}),t}(),Fe=function(){function t(t,e){this.pdfPage=t,this.layoutBounds=e}return Object.defineProperty(t.prototype,"page",{get:function(){return this.pdfPage},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"bounds",{get:function(){return this.layoutBounds},enumerable:!0,configurable:!0}),t}(),Ee=function(){function e(){var e=new et(new L(0,0,0));e.dashStyle=t.PdfDashStyle.Solid;var i=new et(new L(0,0,0));i.dashStyle=t.PdfDashStyle.Solid;var r=new et(new L(0,0,0));r.dashStyle=t.PdfDashStyle.Solid;var n=new et(new L(0,0,0));n.dashStyle=t.PdfDashStyle.Solid,this.leftPen=e,this.rightPen=i,this.topPen=r,this.bottomPen=n}return Object.defineProperty(e.prototype,"left",{get:function(){return this.leftPen},set:function(t){this.leftPen=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"right",{get:function(){return this.rightPen},set:function(t){this.rightPen=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"top",{get:function(){return this.topPen},set:function(t){this.topPen=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bottom",{get:function(){return this.bottomPen},set:function(t){this.bottomPen=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"all",{set:function(t){this.leftPen=this.rightPen=this.topPen=this.bottomPen=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isAll",{get:function(){return this.leftPen===this.rightPen&&this.leftPen===this.topPen&&this.leftPen===this.bottomPen},enumerable:!0,configurable:!0}),Object.defineProperty(e,"default",{get:function(){return new e},enumerable:!0,configurable:!0}),e}(),Ge=function(){function t(t,e,i,r){this.hasLeftPad=!1,this.hasRightPad=!1,this.hasTopPad=!1,this.hasBottomPad=!1,void 0===t?(this.leftPad=this.rightPad=5.76,this.bottomPad=this.topPad=.5):(this.leftPad=t,this.rightPad=e,this.topPad=i,this.bottomPad=r,this.hasLeftPad=!0,this.hasRightPad=!0,this.hasTopPad=!0,this.hasBottomPad=!0)}return Object.defineProperty(t.prototype,"left",{get:function(){return this.leftPad},set:function(t){this.leftPad=t,this.hasLeftPad=!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.rightPad},set:function(t){this.rightPad=t,this.hasRightPad=!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.topPad},set:function(t){this.topPad=t,this.hasTopPad=!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"bottom",{get:function(){return this.bottomPad},set:function(t){this.bottomPad=t,this.hasBottomPad=!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"all",{set:function(t){this.leftPad=this.rightPad=this.topPad=this.bottomPad=t,this.hasLeftPad=!0,this.hasRightPad=!0,this.hasTopPad=!0,this.hasBottomPad=!0},enumerable:!0,configurable:!0}),t}(),ze=function(){function t(){}return Object.defineProperty(t.prototype,"raiseBeginPageLayout",{get:function(){return void 0!==this.beginPageLayout},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"raiseEndPageLayout",{get:function(){return void 0!==this.endPageLayout},enumerable:!0,configurable:!0}),t.prototype.onBeginPageLayout=function(t){this.beginPageLayout&&this.beginPageLayout(this,t)},t.prototype.onEndPageLayout=function(t){this.endPageLayout&&this.endPageLayout(this,t)},t.prototype.drawHelper=function(t,e,i,r){if(e instanceof T&&void 0===e.width&&void 0===i)return this.drawHelper(t,e.x,e.y);if("number"==typeof e&&"number"==typeof i&&void 0===r)return this.drawHelper(t,e,i,null);if(e instanceof k&&void 0!==e.width&&void 0===i)return this.drawHelper(t,e,null);if(e instanceof T&&void 0===e.width&&i instanceof Ae)return this.drawHelper(t,e.x,e.y,i);if("number"==typeof e&&"number"==typeof i&&(r instanceof Ae||null==r)){var n=t.graphics.clientSize.width-e,o=new k(e,i,n,0);return this.drawHelper(t,o,r)}if(e instanceof k&&void 0!==e.width&&"boolean"==typeof i)return this.bEmbedFonts=i,this.drawHelper(t,e,null);var s=new Ie,a=e,h=i;if(s.page=t,s.bounds=a,null!=s){var l=s.bounds.x,u=s.bounds.y;0===s.bounds.x&&(l=Ee.default.right.width/2),0===s.bounds.y&&(u=Ee.default.top.width/2);var c=new k(l,u,s.bounds.width,s.bounds.height);s.bounds=c}s.format=null!=h?h:new Ae;return this.layout(s)},t}(),We=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),_e=function(e){function i(t){return e.call(this,t)||this}return We(i,e),Object.defineProperty(i.prototype,"element",{get:function(){return e.prototype.getElement.call(this)},enumerable:!0,configurable:!0}),i.prototype.layoutInternal=function(t){this.format=null!==this.element.stringFormat&&void 0!==this.element.stringFormat?this.element.stringFormat:null;var e=t.page,i=t.bounds,r=this.element.value,n=null,o=new He;for(o.page=e,o.remainder=r;;){o=this.layoutOnPage(r,e,i,t),n=this.getLayoutResult(o);break}return n},i.prototype.getLayoutResult=function(t){return new Ue(t.page,t.bounds,t.remainder,t.lastLineBounds)},i.prototype.layoutOnPage=function(e,i,r,n){var o=new He;o.remainder=e,o.page=i,r=this.checkCorrectBounds(i,r);var s=(new I).layout(e,this.element.font,this.format,r,i.getClientSize().height,!1,new j(0,0)),a=null==s.remainder,h=(n.format.break===t.PdfLayoutBreakType.FitElement||s.empty,i.graphics),l=this.element.getBrush();this.element instanceof Ze&&(l.color=new L(0,0,255)),h.drawStringLayoutResult(s,this.element.font,this.element.pen,l,r,this.format);s.lines[s.lineCount-1];return o.lastLineBounds=h.getLineBounds(s.lineCount-1,s,this.element.font,r,this.format),o.bounds=this.getTextPageBounds(i,r,s),o.remainder=s.remainder,o.end=a,o},i.prototype.checkCorrectBounds=function(t,e){var i=t.graphics.clientSize;return e.height=e.height>0?e.height:i.height-e.y,e},i.prototype.getTextPageBounds=function(t,e,i){var r=i.actualSize,n=e.x,o=e.y,s=e.width>0?e.width:r.width,a=r.height;n=t.graphics.checkCorrectLayoutRectangle(r,e.x,e.y,this.format).x;var h=t.graphics.getTextVerticalAlignShift(r.height,e.height,this.format);return new k(n,o+=h,s,a)},i}(Ne),He=function(){return function(){}}(),Ue=function(t){function e(e,i,r,n){var o=t.call(this,e,i)||this;return o.remainderText=r,o.lastLineTextBounds=n,o}return We(e,t),Object.defineProperty(e.prototype,"remainder",{get:function(){return this.remainderText},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lastLineBounds",{get:function(){return this.lastLineTextBounds},enumerable:!0,configurable:!0}),e}(Fe),Ke=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),qe=function(e){function i(t,i,r,n,o){var s=e.call(this)||this;return s.content="",s.elementValue="",s.hasPointOverload=!1,s.isPdfTextElement=!1,void 0===t||("string"==typeof t&&void 0===i?(s.content=t,s.elementValue=t):"string"==typeof t&&i instanceof G&&void 0===r?(s.content=t,s.elementValue=t,s.pdfFont=i):"string"==typeof t&&i instanceof G&&r instanceof et&&void 0===n?(s.content=t,s.elementValue=t,s.pdfFont=i,s.pdfPen=r):"string"==typeof t&&i instanceof G&&r instanceof R&&void 0===n?(s.content=t,s.elementValue=t,s.pdfFont=i,s.pdfBrush=r):(s.content=t,s.elementValue=t,s.pdfFont=i,s.pdfPen=r,s.pdfBrush=n,s.format=o)),s}return Ke(i,e),Object.defineProperty(i.prototype,"text",{get:function(){return this.content},set:function(t){this.elementValue=t,this.content=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"value",{get:function(){return this.elementValue},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"pen",{get:function(){return this.pdfPen},set:function(t){this.pdfPen=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"brush",{get:function(){return this.pdfBrush},set:function(t){this.pdfBrush=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"font",{get:function(){return this.pdfFont},set:function(t){this.pdfFont=t,this.pdfFont instanceof Le&&null!=this.content?this.elementValue=Le.convert(this.content):this.elementValue=this.content},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"stringFormat",{get:function(){return this.format},set:function(t){this.format=t},enumerable:!0,configurable:!0}),i.prototype.getBrush=function(){return null==this.pdfBrush||void 0===this.pdfBrush?new D(new L(0,0,0)):this.pdfBrush},i.prototype.layout=function(t){return new _e(this).layout(t)},i.prototype.drawText=function(t,e,i,r){if(e instanceof T&&void 0===e.width&&void 0===i)return this.hasPointOverload=!0,this.drawText(t,e.x,e.y);if("number"==typeof e&&"number"==typeof i&&void 0===r)return this.hasPointOverload=!0,this.drawText(t,e,i,null);if(e instanceof k&&void 0!==e.width&&void 0===i)return this.drawText(t,e,null);if(e instanceof T&&void 0===e.width&&i instanceof Ae)return this.hasPointOverload=!0,this.drawText(t,e.x,e.y,i);if("number"==typeof e&&"number"==typeof i&&(r instanceof Ae||null==r)){this.hasPointOverload=!0;var n=t.graphics.clientSize.width-e,o=new k(e,i,n,0);return this.drawText(t,o,r)}if(e instanceof k&&void 0!==e.width&&"boolean"==typeof i)return this.drawText(t,e,null);var s=new I;if(this.hasPointOverload){var a=s.layout(this.value,this.font,this.stringFormat,new j(t.graphics.clientSize.width-e.x,0),!0,t.graphics.clientSize),h=void 0,l=e,u=i;if((m=new Ie).page=t,m.bounds=l,m.format=null!=u?u:new Ae,a.lines.length>1){if(this.text=a.layoutLines[0].text,m.bounds.y<=m.page.graphics.clientSize.height){var c=new T(m.bounds.x,m.bounds.y);h=this.layout(m);for(var p=new k(0,h.bounds.y+a.lineHeight,t.graphics.clientSize.width,a.lineHeight),d=1;d<a.lines.length;d++)if(m.page=h.page,m.bounds=new k(new T(p.x,p.y),new j(p.width,p.height)),this.text=a.layoutLines[d].text,p.y+a.lineHeight>h.page.graphics.clientSize.height&&(m.page=m.page.graphics.getNextPage(),p=c.y>h.page.graphics.clientSize.height-h.bounds.height?new k(0,h.bounds.height,h.page.graphics.clientSize.width,a.lineHeight):new k(0,0,h.page.graphics.clientSize.width,a.lineHeight),m.bounds=p),h=this.layout(m),d!==a.lines.length-1)p=new k(0,h.bounds.y+a.lineHeight,h.page.graphics.clientSize.width,a.lineHeight);else{var f=this.font.measureString(this.text,this.format).width;h=this.calculateResultBounds(h,f,h.page.graphics.clientSize.width,0)}}return h}var g=this.font.measureString(this.text,this.format);return m.bounds.y<=m.page.graphics.clientSize.height&&(h=this.layout(m),h=this.calculateResultBounds(h,g.width,h.page.graphics.clientSize.width,0)),h}h=s.layout(this.value,this.font,this.stringFormat,new j(e.width,0),!1,t.graphics.clientSize);var m,y=void 0;l=e,u=i;if((m=new Ie).page=t,m.bounds=l,m.format=null!=u?u:new Ae,h.lines.length>1){if(this.text=h.layoutLines[0].text,m.bounds.y<=m.page.graphics.clientSize.height){c=new T(m.bounds.x,m.bounds.y);y=this.layout(m);for(p=new k(l.x,y.bounds.y+h.lineHeight,l.width,h.lineHeight),d=1;d<h.lines.length;d++)if(m.page=y.page,m.bounds=new k(p.x,p.y,p.width,p.height),this.text=h.layoutLines[d].text,p.y+h.lineHeight>y.page.graphics.clientSize.height&&(m.page=m.page.graphics.getNextPage(),p=c.y>y.page.graphics.clientSize.height-y.bounds.height?new k(l.x,h.lineHeight,l.width,h.lineHeight):new k(l.x,0,l.width,h.lineHeight),m.bounds=p),y=this.layout(m),d!==h.lines.length-1)p=new k(l.x,y.bounds.y+h.lineHeight,l.width,h.lineHeight);else{f=this.font.measureString(this.text,this.format).width;y=this.calculateResultBounds(y,f,l.width,l.x)}}return y}g=this.font.measureString(this.text,this.format);return m.bounds.y<=m.page.graphics.clientSize.height&&(y=this.layout(m),y=this.calculateResultBounds(y,g.width,l.width,l.x)),y},i.prototype.calculateResultBounds=function(e,i,r,n){return null!=this.stringFormat&&void 0!==this.stringFormat&&this.stringFormat.alignment===t.PdfTextAlignment.Center?(e.bounds.x=n+(r-i)/2,e.bounds.width=i):null!=this.stringFormat&&void 0!==this.stringFormat&&this.stringFormat.alignment===t.PdfTextAlignment.Right?(e.bounds.x=n+(r-i),e.bounds.width=i):null!=this.stringFormat&&void 0!==this.stringFormat&&this.stringFormat.alignment===t.PdfTextAlignment.Justify?(e.bounds.x=n,e.bounds.width=r):(e.bounds.width=n,e.bounds.width=i),e},i}(ze),Ye=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Xe=function(t){function e(e,i){var r=t.call(this,e)||this;return void 0!==i&&(r.uri=i),r}return Ye(e,t),Object.defineProperty(e.prototype,"uriAction",{get:function(){return void 0===this.pdfUriAction&&(this.pdfUriAction=new x),this.pdfUriAction},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"uri",{get:function(){return this.uriAction.uri},set:function(t){this.uriAction.uri!==t&&(this.uriAction.uri=t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"action",{get:function(){return this.getSetAction()},set:function(t){this.getSetAction(t),this.uriAction.next=t},enumerable:!0,configurable:!0}),e.prototype.initialize=function(){t.prototype.initialize.call(this),this.dictionary.items.setValue(this.dictionaryProperties.subtype,new o(this.dictionaryProperties.link));this.uriAction.element;this.dictionary.items.setValue(this.dictionaryProperties.a,this.uriAction.element)},e}(Re),Je=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ze=function(e){function i(){var t=e.call(this)||this;t.uniformResourceLocator="",t.uriAnnotation=null,t.recalculateBounds=!1,t.defaultBorder=new m;for(var i=0;i<3;i++)t.defaultBorder.add(new g(0));return t}return Je(i,e),Object.defineProperty(i.prototype,"url",{get:function(){return this.uniformResourceLocator},set:function(t){if(0===t.length)throw new Error("ArgumentException : Url - string can not be empty");this.uniformResourceLocator=t},enumerable:!0,configurable:!0}),i.prototype.draw=function(e,i){if(e instanceof pe){var r=new I,n=this.font.style;if(i instanceof T){this.recalculateBounds=!0,this.font.style=t.PdfFontStyle.Underline;if(1===(h=r.layout(this.value,this.font,this.stringFormat,new j(e.graphics.clientSize.width-i.x,0),!0,e.graphics.clientSize)).lines.length){var o=this.font.measureString(this.value),s=new k(i,o);s=this.calculateBounds(s,o.width,e.graphics.clientSize.width,i.x),this.uriAnnotation=new Xe(s,this.url),this.uriAnnotation.dictionary.items.setValue("Border",this.defaultBorder),e.annotations.add(this.uriAnnotation);var a=this.drawText(e,i);return this.font.style=n,a}a=this.drawMultipleLineWithPoint(h,e,i);return this.font.style=n,a}var h=r.layout(this.value,this.font,this.stringFormat,new j(i.width,0),!1,new j(0,0));if(this.font.style=t.PdfFontStyle.Underline,1===h.lines.length){o=this.font.measureString(this.value),s=new k(new T(i.x,i.y),o);s=this.calculateBounds(s,o.width,i.width,i.x),this.uriAnnotation=new Xe(s,this.url),this.uriAnnotation.dictionary.items.setValue("Border",this.defaultBorder),e.annotations.add(this.uriAnnotation);var l=this.drawText(e,i);return this.font.style=n,l}l=this.drawMultipleLineWithBounds(h,e,i);return this.font.style=n,l}var u=new pe;return u=e.page,this.draw(u,i)},i.prototype.drawMultipleLineWithPoint=function(t,e,i){for(var r,n=0;n<t.layoutLines.length;n++){var o=this.font.measureString(t.lines[n].text),s=new k(i,o);if(0!==n&&(s.x=0),this.text=t.lines[n].text,s.y+o.height>e.graphics.clientSize.height){if(0===n)break;e=e.graphics.getNextPage(),s=new k(0,0,e.graphics.clientSize.width,o.height),i.y=0}s=this.calculateBounds(s,o.width,e.graphics.clientSize.width,s.x),this.uriAnnotation=new Xe(s,this.url),this.uriAnnotation.dictionary.items.setValue("Border",this.defaultBorder),e.annotations.add(this.uriAnnotation),r=0!==n?this.drawText(e,new T(0,s.y)):this.drawText(e,s.x,s.y),i.y+=o.height}return r},i.prototype.drawMultipleLineWithBounds=function(t,e,i){for(var r,n=0;n<t.layoutLines.length;n++){var o=this.font.measureString(t.lines[n].text),s=new k(new T(i.x,i.y),o);if(s=this.calculateBounds(s,o.width,i.width,i.x),this.text=t.lines[n].text,i.y+o.height>e.graphics.clientSize.height){if(0===n)break;e=e.graphics.getNextPage(),i=new k(i.x,0,i.width,o.height),s.y=0}this.uriAnnotation=new Xe(s,this.url),this.uriAnnotation.dictionary.items.setValue("Border",this.defaultBorder),e.annotations.add(this.uriAnnotation),r=this.drawText(e,i),i.y+=o.height}return r},i.prototype.calculateBounds=function(e,i,r,n){return null!=this.stringFormat&&void 0!==this.stringFormat&&this.stringFormat.alignment===t.PdfTextAlignment.Center?(e.x=n+(r-i)/2,e.width=i):null!=this.stringFormat&&void 0!==this.stringFormat&&this.stringFormat.alignment===t.PdfTextAlignment.Right?(e.x=n+(r-i),e.width=i):null!=this.stringFormat&&void 0!==this.stringFormat&&this.stringFormat.alignment===t.PdfTextAlignment.Justify?(e.x=n,e.width=r):(e.width=n,e.width=i),e},i}(qe),$e=function(){function e(){}return e.convert=function(e,i){var r="";switch(i){case t.PdfNumberStyle.None:r="";break;case t.PdfNumberStyle.Numeric:r=e.toString();break;case t.PdfNumberStyle.LowerLatin:r=this.arabicToLetter(e).toLowerCase();break;case t.PdfNumberStyle.LowerRoman:r=this.arabicToRoman(e).toLowerCase();break;case t.PdfNumberStyle.UpperLatin:r=this.arabicToLetter(e);break;case t.PdfNumberStyle.UpperRoman:r=this.arabicToRoman(e)}return r},e.arabicToRoman=function(t){var e="",i=this.generateNumber(t,1e3,"M");e+=i.returnValue,t=i.intArabic;var r=this.generateNumber(t,900,"CM");e+=r.returnValue,t=r.intArabic;var n=this.generateNumber(t,500,"D");e+=n.returnValue,t=n.intArabic;var o=this.generateNumber(t,400,"CD");e+=o.returnValue,t=o.intArabic;var s=this.generateNumber(t,100,"C");e+=s.returnValue,t=s.intArabic;var a=this.generateNumber(t,90,"XC");e+=a.returnValue,t=a.intArabic;var h=this.generateNumber(t,50,"L");e+=h.returnValue,t=h.intArabic;var l=this.generateNumber(t,40,"XL");e+=l.returnValue,t=l.intArabic;var u=this.generateNumber(t,10,"X");e+=u.returnValue,t=u.intArabic;var c=this.generateNumber(t,9,"IX");e+=c.returnValue,t=c.intArabic;var p=this.generateNumber(t,5,"V");e+=p.returnValue,t=p.intArabic;var d=this.generateNumber(t,4,"IV");e+=d.returnValue,t=d.intArabic;var f=this.generateNumber(t,1,"I");return e+=f.returnValue,t=f.intArabic,e.toString()},e.arabicToLetter=function(t){for(var e=this.convertToLetter(t),i="";e.length>0;){var r=e.pop();i=this.appendChar(i,r)}return i.toString()},e.generateNumber=function(t,e,i){for(var r="";t>=e;)t-=e,r+=i;return{returnValue:r.toString(),intArabic:t}},e.convertToLetter=function(t){if(t<=0)throw Error("ArgumentOutOfRangeException-arabic, Value can not be less 0");for(var e=[];t>this.letterLimit;){var i=t%this.letterLimit;0===i?(t=t/this.letterLimit-1,i=this.letterLimit):t/=this.letterLimit,e.push(i)}return e.push(t),e},e.appendChar=function(t,i){return t+=String.fromCharCode(e.acsiiStartIndex+i)},e.letterLimit=26,e.acsiiStartIndex=64,e}(),Qe=function(){function t(t,e){this.pdfTemplate=null,this.content="",void 0===t||(this.template=t,this.value=e)}return Object.defineProperty(t.prototype,"template",{get:function(){return this.pdfTemplate},set:function(t){this.pdfTemplate=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this.content},set:function(t){this.content=t},enumerable:!0,configurable:!0}),t}(),ti=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ei=function(t){function e(){var e=t.call(this)||this;return e.list=new ot,e}return ti(e,t),e.prototype.performDraw=function(e,i,r,n){t.prototype.performDrawHelper.call(this,e,i,r,n);var o=this.getValue(e),s=new Xt(this.getSize());this.list.setValue(e,new Qe(s,o));var a=this.getSize();s.graphics.drawString(o,this.getFont(),this.pen,this.getBrush(),0,0,a.width,a.height,this.stringFormat);var h=new T(i.x+this.location.x,i.y+this.location.y);e.drawPdfTemplate(s,h,new j(s.width*r,s.height*n))},e}(ut),ii=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ri=function(e){function i(i,r){var n=e.call(this)||this;return n.internalNumberStyle=t.PdfNumberStyle.Numeric,void 0===r?n.font=i:r instanceof R?(n.font=i,n.brush=r):(n.font=i,n.bounds=r),n}return ii(i,e),Object.defineProperty(i.prototype,"numberStyle",{get:function(){return this.internalNumberStyle},set:function(t){this.internalNumberStyle=t},enumerable:!0,configurable:!0}),i.prototype.getValue=function(t){var e=this.getPageFromGraphics(t);return this.internalGetValue(e)},i.prototype.internalGetValue=function(t){var e=t.document.pages.indexOf(t)+1;return $e.convert(e,this.numberStyle)},i}(ei),ni=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),oi=function(t){function e(e,i,r){for(var n=[],o=3;o<arguments.length;o++)n[o-3]=arguments[o];var s=t.call(this)||this;return s.internalAutomaticFields=null,s.internalText="",s.font=e,s.brush=i,s.text=r,s.automaticFields=n,s}return ni(e,t),Object.defineProperty(e.prototype,"text",{get:function(){return this.internalText},set:function(t){this.internalText=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"automaticFields",{get:function(){return this.internalAutomaticFields},set:function(t){this.internalAutomaticFields=t},enumerable:!0,configurable:!0}),e.prototype.getValue=function(t){var e=this.text.toString();if(void 0!==this.automaticFields&&null!=this.automaticFields&&this.automaticFields.length>0)for(var i=0;i<this.automaticFields.length;i++){var r=this.automaticFields[i];e=e.replace("{"+i+"}",r.getValue(t))}return e},e}(ei),si=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ai=function(t){function e(){var e=t.call(this)||this;return e.list=new ot,e.painterGraphics=[],e}return si(e,t),e.prototype.performDraw=function(e,i,r,n){t.prototype.performDrawHelper.call(this,e,i,r,n);var o=this.getPageFromGraphics(e).document,s=this.getValue(e);if(this.list.containsKey(o)){var a=this.list.getValue(o),h=new T(i.x+this.location.x,i.y+this.location.y);e.drawPdfTemplate(a.template,h,new j(a.template.width*r,a.template.height*n)),this.painterGraphics.push(e)}else{var l=this.getSize(),u=new Xt(l);this.list.setValue(o,new Qe(u,s)),u.graphics.drawString(s,this.getFont(),this.pen,this.getBrush(),0,0,l.width,l.height,this.stringFormat);h=new T(i.x+this.location.x,i.y+this.location.y);e.drawPdfTemplate(u,h,new j(u.width*r,u.height*n)),this.painterGraphics.push(e)}},e}(ut),hi=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),li=function(e){function i(i,r){var n=e.call(this)||this;return n.internalNumberStyle=t.PdfNumberStyle.Numeric,void 0===r?n.font=i:r instanceof R?(n.font=i,n.brush=r):(n.font=i,n.bounds=r),n}return hi(i,e),Object.defineProperty(i.prototype,"numberStyle",{get:function(){return this.internalNumberStyle},set:function(t){this.internalNumberStyle=t},enumerable:!0,configurable:!0}),i.prototype.getValue=function(t){var e=this.getPageFromGraphics(t).section.parent.document.pages.count;return $e.convert(e,this.numberStyle)},i}(ai);!function(t){t[t.Location=0]="Location",t[t.FitToPage=1]="FitToPage",t[t.FitR=2]="FitR"}(t.PdfDestinationMode||(t.PdfDestinationMode={}));var ui,ci=function(){function e(e,i){this.dictionaryProperties=new a,this.destinationMode=t.PdfDestinationMode.Location,this.zoomFactor=0,this.destinationLocation=new T(0,0),this.bounds=new k,this.array=new m;t.PdfPageRotateAngle.RotateAngle0;this.destinationLocation=new T(0,this.destinationLocation.y),this.pdfPage=e,i instanceof T?this.destinationLocation=i:this.bounds=i}return Object.defineProperty(e.prototype,"zoom",{get:function(){return this.zoomFactor},set:function(t){this.zoomFactor=t,this.initializePrimitive()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"page",{get:function(){return this.pdfPage},set:function(t){this.pdfPage=t,this.initializePrimitive()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"mode",{get:function(){return this.destinationMode},set:function(t){this.destinationMode=t,this.initializePrimitive()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"location",{get:function(){return this.destinationLocation},set:function(t){this.destinationLocation=t,this.initializePrimitive()},enumerable:!0,configurable:!0}),e.prototype.pointToNativePdf=function(t,e){return t.section.pointToNativePdf(t,e)},e.prototype.initializePrimitive=function(){switch(this.array.clear(),this.array.add(new C(this.pdfPage)),this.destinationMode){case t.PdfDestinationMode.Location:var e=this.pdfPage,i=new T;i=this.pointToNativePdf(e,this.destinationLocation),this.array.add(new o(this.dictionaryProperties.xyz)),this.array.add(new g(i.x)),this.array.add(new g(i.y)),this.array.add(new g(this.zoomFactor));break;case t.PdfDestinationMode.FitToPage:this.array.add(new o(this.dictionaryProperties.fit))}},Object.defineProperty(e.prototype,"element",{get:function(){return this.initializePrimitive(),this.array},enumerable:!0,configurable:!0}),e}(),pi=function(){function t(t){this.mDictionary=null,this.mDictionaryProperties=new a,this.mDictionary=t}return Object.defineProperty(t.prototype,"domain",{get:function(){return this.mDictionary.items.getValue(this.mDictionaryProperties.domain)},set:function(t){this.mDictionary.items.setValue(this.mDictionaryProperties.domain,t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"range",{get:function(){return this.mDictionary.items.getValue(this.mDictionaryProperties.range)},set:function(t){this.mDictionary.items.setValue(this.mDictionaryProperties.range,t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dictionary",{get:function(){return this.mDictionary},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"element",{get:function(){return this.mDictionary},enumerable:!0,configurable:!0}),t}(),di=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),fi=function(t){function e(e,i,r,n){var o=t.call(this,new b)||this;return void 0===e?o.dictionary.items.setValue(o.mDictionaryProperties.functionType,new g(0)):(o.dictionary.items.setValue(o.mDictionaryProperties.functionType,new g(0)),o.checkParams(e,i,r,n),o.setDomainAndRange(e,i),o.setSizeAndValues(r,n)),o}return di(e,t),e.prototype.checkParams=function(t,e,i,r){e.length,t.length,r.length},e.prototype.setDomainAndRange=function(t,e){this.domain=new m(t),this.range=new m(e)},e.prototype.setSizeAndValues=function(t,e){var i=this.dictionary;i.isResource=!0,this.dictionary.items.setValue(this.mDictionaryProperties.size,new m(t)),this.dictionary.items.setValue(this.mDictionaryProperties.bitsPerSample,new g(8)),i.writeBytes(e)},e}(pi);!function(t){t[t.None=0]="None",t[t.Start=1]="Start",t[t.End=2]="End",t[t.Both=3]="Both"}(ui||(ui={}));var gi;!function(t){t[t.BackwardDiagonal=0]="BackwardDiagonal",t[t.ForwardDiagonal=1]="ForwardDiagonal",t[t.Horizontal=2]="Horizontal",t[t.Vertical=3]="Vertical"}(gi||(gi={}));var mi;!function(t){t[t.Function=1]="Function",t[t.Axial=2]="Axial",t[t.Radial=3]="Radial"}(mi||(mi={}));var yi;!function(t){t[t.ActiveBorder=1]="ActiveBorder",t[t.ActiveCaption=2]="ActiveCaption",t[t.ActiveCaptionText=3]="ActiveCaptionText",t[t.AppWorkspace=4]="AppWorkspace",t[t.Control=5]="Control",t[t.ControlDark=6]="ControlDark",t[t.ControlDarkDark=7]="ControlDarkDark",t[t.ControlLight=8]="ControlLight",t[t.ControlLightLight=9]="ControlLightLight",t[t.ControlText=10]="ControlText",t[t.Desktop=11]="Desktop",t[t.GrayText=12]="GrayText",t[t.Highlight=13]="Highlight",t[t.HighlightText=14]="HighlightText",t[t.HotTrack=15]="HotTrack",t[t.InactiveBorder=16]="InactiveBorder",t[t.InactiveCaption=17]="InactiveCaption",t[t.InactiveCaptionText=18]="InactiveCaptionText",t[t.Info=19]="Info",t[t.InfoText=20]="InfoText",t[t.Menu=21]="Menu",t[t.MenuText=22]="MenuText",t[t.ScrollBar=23]="ScrollBar",t[t.Window=24]="Window",t[t.WindowFrame=25]="WindowFrame",t[t.WindowText=26]="WindowText",t[t.Transparent=27]="Transparent",t[t.AliceBlue=28]="AliceBlue",t[t.AntiqueWhite=29]="AntiqueWhite",t[t.Aqua=30]="Aqua",t[t.Aquamarine=31]="Aquamarine",t[t.Azure=32]="Azure",t[t.Beige=33]="Beige",t[t.Bisque=34]="Bisque",t[t.Black=35]="Black",t[t.BlanchedAlmond=36]="BlanchedAlmond",t[t.Blue=37]="Blue",t[t.BlueViolet=38]="BlueViolet",t[t.Brown=39]="Brown",t[t.BurlyWood=40]="BurlyWood",t[t.CadetBlue=41]="CadetBlue",t[t.Chartreuse=42]="Chartreuse",t[t.Chocolate=43]="Chocolate",t[t.Coral=44]="Coral",t[t.CornflowerBlue=45]="CornflowerBlue",t[t.Cornsilk=46]="Cornsilk",t[t.Crimson=47]="Crimson",t[t.Cyan=48]="Cyan",t[t.DarkBlue=49]="DarkBlue",t[t.DarkCyan=50]="DarkCyan",t[t.DarkGoldenrod=51]="DarkGoldenrod",t[t.DarkGray=52]="DarkGray",t[t.DarkGreen=53]="DarkGreen",t[t.DarkKhaki=54]="DarkKhaki",t[t.DarkMagenta=55]="DarkMagenta",t[t.DarkOliveGreen=56]="DarkOliveGreen",t[t.DarkOrange=57]="DarkOrange",t[t.DarkOrchid=58]="DarkOrchid",t[t.DarkRed=59]="DarkRed",t[t.DarkSalmon=60]="DarkSalmon",t[t.DarkSeaGreen=61]="DarkSeaGreen",t[t.DarkSlateBlue=62]="DarkSlateBlue",t[t.DarkSlateGray=63]="DarkSlateGray",t[t.DarkTurquoise=64]="DarkTurquoise",t[t.DarkViolet=65]="DarkViolet",t[t.DeepPink=66]="DeepPink",t[t.DeepSkyBlue=67]="DeepSkyBlue",t[t.DimGray=68]="DimGray",t[t.DodgerBlue=69]="DodgerBlue",t[t.Firebrick=70]="Firebrick",t[t.FloralWhite=71]="FloralWhite",t[t.ForestGreen=72]="ForestGreen",t[t.Fuchsia=73]="Fuchsia",t[t.Gainsboro=74]="Gainsboro",t[t.GhostWhite=75]="GhostWhite",t[t.Gold=76]="Gold",t[t.Goldenrod=77]="Goldenrod",t[t.Gray=78]="Gray",t[t.Green=79]="Green",t[t.GreenYellow=80]="GreenYellow",t[t.Honeydew=81]="Honeydew",t[t.HotPink=82]="HotPink",t[t.IndianRed=83]="IndianRed",t[t.Indigo=84]="Indigo",t[t.Ivory=85]="Ivory",t[t.Khaki=86]="Khaki",t[t.Lavender=87]="Lavender",t[t.LavenderBlush=88]="LavenderBlush",t[t.LawnGreen=89]="LawnGreen",t[t.LemonChiffon=90]="LemonChiffon",t[t.LightBlue=91]="LightBlue",t[t.LightCoral=92]="LightCoral",t[t.LightCyan=93]="LightCyan",t[t.LightGoldenrodYellow=94]="LightGoldenrodYellow",t[t.LightGray=95]="LightGray",t[t.LightGreen=96]="LightGreen",t[t.LightPink=97]="LightPink",t[t.LightSalmon=98]="LightSalmon",t[t.LightSeaGreen=99]="LightSeaGreen",t[t.LightSkyBlue=100]="LightSkyBlue",t[t.LightSlateGray=101]="LightSlateGray",t[t.LightSteelBlue=102]="LightSteelBlue",t[t.LightYellow=103]="LightYellow",t[t.Lime=104]="Lime",t[t.LimeGreen=105]="LimeGreen",t[t.Linen=106]="Linen",t[t.Magenta=107]="Magenta",t[t.Maroon=108]="Maroon",t[t.MediumAquamarine=109]="MediumAquamarine",t[t.MediumBlue=110]="MediumBlue",t[t.MediumOrchid=111]="MediumOrchid",t[t.MediumPurple=112]="MediumPurple",t[t.MediumSeaGreen=113]="MediumSeaGreen",t[t.MediumSlateBlue=114]="MediumSlateBlue",t[t.MediumSpringGreen=115]="MediumSpringGreen",t[t.MediumTurquoise=116]="MediumTurquoise",t[t.MediumVioletRed=117]="MediumVioletRed",t[t.MidnightBlue=118]="MidnightBlue",t[t.MintCream=119]="MintCream",t[t.MistyRose=120]="MistyRose",t[t.Moccasin=121]="Moccasin",t[t.NavajoWhite=122]="NavajoWhite",t[t.Navy=123]="Navy",t[t.OldLace=124]="OldLace",t[t.Olive=125]="Olive",t[t.OliveDrab=126]="OliveDrab",t[t.Orange=127]="Orange",t[t.OrangeRed=128]="OrangeRed",t[t.Orchid=129]="Orchid",t[t.PaleGoldenrod=130]="PaleGoldenrod",t[t.PaleGreen=131]="PaleGreen",t[t.PaleTurquoise=132]="PaleTurquoise",t[t.PaleVioletRed=133]="PaleVioletRed",t[t.PapayaWhip=134]="PapayaWhip",t[t.PeachPuff=135]="PeachPuff",t[t.Peru=136]="Peru",t[t.Pink=137]="Pink",t[t.Plum=138]="Plum",t[t.PowderBlue=139]="PowderBlue",t[t.Purple=140]="Purple",t[t.Red=141]="Red",t[t.RosyBrown=142]="RosyBrown",t[t.RoyalBlue=143]="RoyalBlue",t[t.SaddleBrown=144]="SaddleBrown",t[t.Salmon=145]="Salmon",t[t.SandyBrown=146]="SandyBrown",t[t.SeaGreen=147]="SeaGreen",t[t.SeaShell=148]="SeaShell",t[t.Sienna=149]="Sienna",t[t.Silver=150]="Silver",t[t.SkyBlue=151]="SkyBlue",t[t.SlateBlue=152]="SlateBlue",t[t.SlateGray=153]="SlateGray",t[t.Snow=154]="Snow",t[t.SpringGreen=155]="SpringGreen",t[t.SteelBlue=156]="SteelBlue",t[t.Tan=157]="Tan",t[t.Teal=158]="Teal",t[t.Thistle=159]="Thistle",t[t.Tomato=160]="Tomato",t[t.Turquoise=161]="Turquoise",t[t.Violet=162]="Violet",t[t.Wheat=163]="Wheat",t[t.White=164]="White",t[t.WhiteSmoke=165]="WhiteSmoke",t[t.Yellow=166]="Yellow",t[t.YellowGreen=167]="YellowGreen",t[t.ButtonFace=168]="ButtonFace",t[t.ButtonHighlight=169]="ButtonHighlight",t[t.ButtonShadow=170]="ButtonShadow",t[t.GradientActiveCaption=171]="GradientActiveCaption",t[t.GradientInactiveCaption=172]="GradientInactiveCaption",t[t.MenuBar=173]="MenuBar",t[t.MenuHighlight=174]="MenuHighlight"}(yi||(yi={}));var bi=function(){function t(){}return Object.defineProperty(t,"AliceBlue",{get:function(){var t=null;return this.sBrushes.containsKey(yi.AliceBlue)&&(t=this.sBrushes.getValue(yi.AliceBlue)),null==t&&(t=this.getBrush(yi.AliceBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"AntiqueWhite",{get:function(){var t=null;return this.sBrushes.containsKey(yi.AntiqueWhite)&&(t=this.sBrushes.getValue(yi.AntiqueWhite)),null==t&&(t=this.getBrush(yi.AntiqueWhite)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Aqua",{get:function(){var t=null;return this.sBrushes.containsKey(yi.Aqua)&&(t=this.sBrushes.getValue(yi.Aqua)),null==t&&(t=this.getBrush(yi.Aqua)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Aquamarine",{get:function(){var t=null;return this.sBrushes.containsKey(yi.Aquamarine)&&(t=this.sBrushes.getValue(yi.Aquamarine)),null==t&&(t=this.getBrush(yi.Aquamarine)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Azure",{get:function(){var t=null;return this.sBrushes.containsKey(yi.Azure)&&(t=this.sBrushes.getValue(yi.Azure)),null==t&&(t=this.getBrush(yi.Azure)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Beige",{get:function(){var t=null;return this.sBrushes.containsKey(yi.Beige)&&(t=this.sBrushes.getValue(yi.Beige)),null==t&&(t=this.getBrush(yi.Beige)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Bisque",{get:function(){var t=null;return this.sBrushes.containsKey(yi.Bisque)&&(t=this.sBrushes.getValue(yi.Bisque)),null==t&&(t=this.getBrush(yi.Bisque)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Black",{get:function(){var t=null;return this.sBrushes.containsKey(yi.Black)&&(t=this.sBrushes.getValue(yi.Black)),null==t&&(t=this.getBrush(yi.Black)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"BlanchedAlmond",{get:function(){var t=null;return this.sBrushes.containsKey(yi.BlanchedAlmond)&&(t=this.sBrushes.getValue(yi.BlanchedAlmond)),null==t&&(t=this.getBrush(yi.BlanchedAlmond)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Blue",{get:function(){var t=null;return this.sBrushes.containsKey(yi.Blue)&&(t=this.sBrushes.getValue(yi.Blue)),null==t&&(t=this.getBrush(yi.Blue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"BlueViolet",{get:function(){var t=null;return this.sBrushes.containsKey(yi.BlueViolet)&&(t=this.sBrushes.getValue(yi.BlueViolet)),null==t&&(t=this.getBrush(yi.BlueViolet)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Brown",{get:function(){var t=null;return this.sBrushes.containsKey(yi.Brown)&&(t=this.sBrushes.getValue(yi.Brown)),null==t&&(t=this.getBrush(yi.Brown)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"BurlyWood",{get:function(){var t=null;return this.sBrushes.containsKey(yi.BurlyWood)&&(t=this.sBrushes.getValue(yi.BurlyWood)),null==t&&(t=this.getBrush(yi.BurlyWood)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"CadetBlue",{get:function(){var t=null;return this.sBrushes.containsKey(yi.CadetBlue)&&(t=this.sBrushes.getValue(yi.CadetBlue)),null==t&&(t=this.getBrush(yi.CadetBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Chartreuse",{get:function(){var t=null;return this.sBrushes.containsKey(yi.Chartreuse)&&(t=this.sBrushes.getValue(yi.Chartreuse)),null==t&&(t=this.getBrush(yi.Chartreuse)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Chocolate",{get:function(){var t=null;return this.sBrushes.containsKey(yi.Chocolate)&&(t=this.sBrushes.getValue(yi.Chocolate)),null==t&&(t=this.getBrush(yi.Chocolate)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Coral",{get:function(){var t=null;return this.sBrushes.containsKey(yi.Coral)&&(t=this.sBrushes.getValue(yi.Coral)),null==t&&(t=this.getBrush(yi.Coral)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"CornflowerBlue",{get:function(){var t=null;return this.sBrushes.containsKey(yi.CornflowerBlue)&&(t=this.sBrushes.getValue(yi.CornflowerBlue)),null==t&&(t=this.getBrush(yi.CornflowerBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Cornsilk",{get:function(){var t=null;return this.sBrushes.containsKey(yi.Cornsilk)&&(t=this.sBrushes.getValue(yi.Cornsilk)),null==t&&(t=this.getBrush(yi.Cornsilk)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Crimson",{get:function(){var t=null;return this.sBrushes.containsKey(yi.Crimson)&&(t=this.sBrushes.getValue(yi.Crimson)),null==t&&(t=this.getBrush(yi.Crimson)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Cyan",{get:function(){var t=null;return this.sBrushes.containsKey(yi.Cyan)&&(t=this.sBrushes.getValue(yi.Cyan)),null==t&&(t=this.getBrush(yi.Cyan)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkBlue",{get:function(){var t=null;return this.sBrushes.containsKey(yi.DarkBlue)&&(t=this.sBrushes.getValue(yi.DarkBlue)),null==t&&(t=this.getBrush(yi.DarkBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkCyan",{get:function(){var t=null;return this.sBrushes.containsKey(yi.DarkCyan)&&(t=this.sBrushes.getValue(yi.DarkCyan)),null==t&&(t=this.getBrush(yi.DarkCyan)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkGoldenrod",{get:function(){var t=null;return this.sBrushes.containsKey(yi.DarkGoldenrod)&&(t=this.sBrushes.getValue(yi.DarkGoldenrod)),null==t&&(t=this.getBrush(yi.DarkGoldenrod)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkGray",{get:function(){var t=null;return this.sBrushes.containsKey(yi.DarkGray)&&(t=this.sBrushes.getValue(yi.DarkGray)),null==t&&(t=this.getBrush(yi.DarkGray)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkGreen",{get:function(){var t=null;return this.sBrushes.containsKey(yi.DarkGreen)&&(t=this.sBrushes.getValue(yi.DarkGreen)),null==t&&(t=this.getBrush(yi.DarkGreen)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkKhaki",{get:function(){var t=null;return this.sBrushes.containsKey(yi.DarkKhaki)&&(t=this.sBrushes.getValue(yi.DarkKhaki)),null==t&&(t=this.getBrush(yi.DarkKhaki)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkMagenta",{get:function(){var t=null;return this.sBrushes.containsKey(yi.DarkMagenta)&&(t=this.sBrushes.getValue(yi.DarkMagenta)),null==t&&(t=this.getBrush(yi.DarkMagenta)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkOliveGreen",{get:function(){var t=null;return this.sBrushes.containsKey(yi.DarkOliveGreen)&&(t=this.sBrushes.getValue(yi.DarkOliveGreen)),null==t&&(t=this.getBrush(yi.DarkOliveGreen)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkOrange",{get:function(){var t=null;return this.sBrushes.containsKey(yi.DarkOrange)&&(t=this.sBrushes.getValue(yi.DarkOrange)),null==t&&(t=this.getBrush(yi.DarkOrange)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkOrchid",{get:function(){var t=null;return this.sBrushes.containsKey(yi.DarkOrchid)&&(t=this.sBrushes.getValue(yi.DarkOrchid)),null==t&&(t=this.getBrush(yi.DarkOrchid)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkRed",{get:function(){var t=null;return this.sBrushes.containsKey(yi.DarkRed)&&(t=this.sBrushes.getValue(yi.DarkRed)),null==t&&(t=this.getBrush(yi.DarkRed)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkSalmon",{get:function(){var t=null;return this.sBrushes.containsKey(yi.DarkSalmon)&&(t=this.sBrushes.getValue(yi.DarkSalmon)),null==t&&(t=this.getBrush(yi.DarkSalmon)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkSeaGreen",{get:function(){var t=null;return this.sBrushes.containsKey(yi.DarkSeaGreen)&&(t=this.sBrushes.getValue(yi.DarkSeaGreen)),null==t&&(t=this.getBrush(yi.DarkSeaGreen)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkSlateBlue",{get:function(){var t=null;return this.sBrushes.containsKey(yi.DarkSlateBlue)&&(t=this.sBrushes.getValue(yi.DarkSlateBlue)),null==t&&(t=this.getBrush(yi.DarkSlateBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkSlateGray",{get:function(){var t=null;return this.sBrushes.containsKey(yi.DarkSlateGray)&&(t=this.sBrushes.getValue(yi.DarkSlateGray)),null==t&&(t=this.getBrush(yi.DarkSlateGray)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkTurquoise",{get:function(){var t=null;return this.sBrushes.containsKey(yi.DarkTurquoise)&&(t=this.sBrushes.getValue(yi.DarkTurquoise)),null==t&&(t=this.getBrush(yi.DarkTurquoise)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkViolet",{get:function(){var t=null;return this.sBrushes.containsKey(yi.DarkViolet)&&(t=this.sBrushes.getValue(yi.DarkViolet)),null==t&&(t=this.getBrush(yi.DarkViolet)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DeepPink",{get:function(){var t=null;return this.sBrushes.containsKey(yi.DeepPink)&&(t=this.sBrushes.getValue(yi.DeepPink)),null==t&&(t=this.getBrush(yi.DeepPink)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DeepSkyBlue",{get:function(){var t=null;return this.sBrushes.containsKey(yi.DeepSkyBlue)&&(t=this.sBrushes.getValue(yi.DeepSkyBlue)),null==t&&(t=this.getBrush(yi.DeepSkyBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DimGray",{get:function(){var t=null;return this.sBrushes.containsKey(yi.DimGray)&&(t=this.sBrushes.getValue(yi.DimGray)),null==t&&(t=this.getBrush(yi.DimGray)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DodgerBlue",{get:function(){var t=null;return this.sBrushes.containsKey(yi.DodgerBlue)&&(t=this.sBrushes.getValue(yi.DodgerBlue)),null==t&&(t=this.getBrush(yi.DodgerBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Firebrick",{get:function(){var t=null;return this.sBrushes.containsKey(yi.Firebrick)&&(t=this.sBrushes.getValue(yi.Firebrick)),null==t&&(t=this.getBrush(yi.Firebrick)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"FloralWhite",{get:function(){var t=null;return this.sBrushes.containsKey(yi.FloralWhite)&&(t=this.sBrushes.getValue(yi.FloralWhite)),null==t&&(t=this.getBrush(yi.FloralWhite)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"ForestGreen",{get:function(){var t=null;return this.sBrushes.containsKey(yi.ForestGreen)&&(t=this.sBrushes.getValue(yi.ForestGreen)),null==t&&(t=this.getBrush(yi.ForestGreen)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Fuchsia",{get:function(){var t=null;return this.sBrushes.containsKey(yi.Fuchsia)&&(t=this.sBrushes.getValue(yi.Fuchsia)),null==t&&(t=this.getBrush(yi.Fuchsia)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Gainsboro",{get:function(){var t=null;return this.sBrushes.containsKey(yi.Gainsboro)&&(t=this.sBrushes.getValue(yi.Gainsboro)),null==t&&(t=this.getBrush(yi.Gainsboro)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"GhostWhite",{get:function(){var t=null;return this.sBrushes.containsKey(yi.GhostWhite)&&(t=this.sBrushes.getValue(yi.GhostWhite)),null==t&&(t=this.getBrush(yi.GhostWhite)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Gold",{get:function(){var t=null;return this.sBrushes.containsKey(yi.Gold)&&(t=this.sBrushes.getValue(yi.Gold)),null==t&&(t=this.getBrush(yi.Gold)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Goldenrod",{get:function(){var t=null;return this.sBrushes.containsKey(yi.Goldenrod)&&(t=this.sBrushes.getValue(yi.Goldenrod)),null==t&&(t=this.getBrush(yi.Goldenrod)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Gray",{get:function(){var t=null;return this.sBrushes.containsKey(yi.Gray)&&(t=this.sBrushes.getValue(yi.Gray)),null==t&&(t=this.getBrush(yi.Gray)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Green",{get:function(){var t=null;return this.sBrushes.containsKey(yi.Green)&&(t=this.sBrushes.getValue(yi.Green)),null==t&&(t=this.getBrush(yi.Green)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"GreenYellow",{get:function(){var t=null;return this.sBrushes.containsKey(yi.GreenYellow)&&(t=this.sBrushes.getValue(yi.GreenYellow)),null==t&&(t=this.getBrush(yi.GreenYellow)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Honeydew",{get:function(){var t=null;return this.sBrushes.containsKey(yi.Honeydew)&&(t=this.sBrushes.getValue(yi.Honeydew)),null==t&&(t=this.getBrush(yi.Honeydew)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"HotPink",{get:function(){var t=null;return this.sBrushes.containsKey(yi.HotPink)&&(t=this.sBrushes.getValue(yi.HotPink)),null==t&&(t=this.getBrush(yi.HotPink)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"IndianRed",{get:function(){var t=null;return this.sBrushes.containsKey(yi.IndianRed)&&(t=this.sBrushes.getValue(yi.IndianRed)),null==t&&(t=this.getBrush(yi.IndianRed)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Indigo",{get:function(){var t=null;return this.sBrushes.containsKey(yi.Indigo)&&(t=this.sBrushes.getValue(yi.Indigo)),null==t&&(t=this.getBrush(yi.Indigo)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Ivory",{get:function(){var t=null;return this.sBrushes.containsKey(yi.Ivory)&&(t=this.sBrushes.getValue(yi.Ivory)),null==t&&(t=this.getBrush(yi.Ivory)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Khaki",{get:function(){var t=null;return this.sBrushes.containsKey(yi.Khaki)&&(t=this.sBrushes.getValue(yi.Khaki)),null==t&&(t=this.getBrush(yi.Khaki)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Lavender",{get:function(){var t=null;return this.sBrushes.containsKey(yi.Lavender)&&(t=this.sBrushes.getValue(yi.Lavender)),null==t&&(t=this.getBrush(yi.Lavender)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LavenderBlush",{get:function(){var t=null;return this.sBrushes.containsKey(yi.LavenderBlush)&&(t=this.sBrushes.getValue(yi.LavenderBlush)),null==t&&(t=this.getBrush(yi.LavenderBlush)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LawnGreen",{get:function(){var t=null;return this.sBrushes.containsKey(yi.LawnGreen)&&(t=this.sBrushes.getValue(yi.LawnGreen)),null==t&&(t=this.getBrush(yi.LawnGreen)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LemonChiffon",{get:function(){var t=null;return this.sBrushes.containsKey(yi.LemonChiffon)&&(t=this.sBrushes.getValue(yi.LemonChiffon)),null==t&&(t=this.getBrush(yi.LemonChiffon)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LightBlue",{get:function(){var t=null;return this.sBrushes.containsKey(yi.LightBlue)&&(t=this.sBrushes.getValue(yi.LightBlue)),null==t&&(t=this.getBrush(yi.LightBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LightCoral",{get:function(){var t=null;return this.sBrushes.containsKey(yi.LightCoral)&&(t=this.sBrushes.getValue(yi.LightCoral)),null==t&&(t=this.getBrush(yi.LightCoral)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LightCyan",{get:function(){var t=null;return this.sBrushes.containsKey(yi.LightCyan)&&(t=this.sBrushes.getValue(yi.LightCyan)),null==t&&(t=this.getBrush(yi.LightCyan)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LightGoldenrodYellow",{get:function(){var t=null;return this.sBrushes.containsKey(yi.LightGoldenrodYellow)&&(t=this.sBrushes.getValue(yi.LightGoldenrodYellow)),null==t&&(t=this.getBrush(yi.LightGoldenrodYellow)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LightGray",{get:function(){var t=null;return this.sBrushes.containsKey(yi.LightGray)&&(t=this.sBrushes.getValue(yi.LightGray)),null==t&&(t=this.getBrush(yi.LightGray)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LightGreen",{get:function(){var t=null;return this.sBrushes.containsKey(yi.LightGreen)&&(t=this.sBrushes.getValue(yi.LightGreen)),null==t&&(t=this.getBrush(yi.LightGreen)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LightPink",{get:function(){var t=null;return this.sBrushes.containsKey(yi.LightPink)&&(t=this.sBrushes.getValue(yi.LightPink)),null==t&&(t=this.getBrush(yi.LightPink)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LightSalmon",{get:function(){var t=null;return this.sBrushes.containsKey(yi.LightSalmon)&&(t=this.sBrushes.getValue(yi.LightSalmon)),null==t&&(t=this.getBrush(yi.LightSalmon)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LightSeaGreen",{get:function(){var t=null;return this.sBrushes.containsKey(yi.LightSeaGreen)&&(t=this.sBrushes.getValue(yi.LightSeaGreen)),null==t&&(t=this.getBrush(yi.LightSeaGreen)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LightSkyBlue",{get:function(){var t=null;return this.sBrushes.containsKey(yi.LightSkyBlue)&&(t=this.sBrushes.getValue(yi.LightSkyBlue)),null==t&&(t=this.getBrush(yi.LightSkyBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LightSlateGray",{get:function(){var t=null;return this.sBrushes.containsKey(yi.LightSlateGray)&&(t=this.sBrushes.getValue(yi.LightSlateGray)),null==t&&(t=this.getBrush(yi.LightSlateGray)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LightSteelBlue",{get:function(){var t=null;return this.sBrushes.containsKey(yi.LightSteelBlue)&&(t=this.sBrushes.getValue(yi.LightSteelBlue)),null==t&&(t=this.getBrush(yi.LightSteelBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LightYellow",{get:function(){var t=null;return this.sBrushes.containsKey(yi.LightYellow)&&(t=this.sBrushes.getValue(yi.LightYellow)),null==t&&(t=this.getBrush(yi.LightYellow)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Lime",{get:function(){var t=null;return this.sBrushes.containsKey(yi.Lime)&&(t=this.sBrushes.getValue(yi.Lime)),null==t&&(t=this.getBrush(yi.Lime)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LimeGreen",{get:function(){var t=null;return this.sBrushes.containsKey(yi.LimeGreen)&&(t=this.sBrushes.getValue(yi.LimeGreen)),null==t&&(t=this.getBrush(yi.LimeGreen)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Linen",{get:function(){var t=null;return this.sBrushes.containsKey(yi.Linen)&&(t=this.sBrushes.getValue(yi.Linen)),null==t&&(t=this.getBrush(yi.Linen)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Magenta",{get:function(){var t=null;return this.sBrushes.containsKey(yi.Magenta)&&(t=this.sBrushes.getValue(yi.Magenta)),null==t&&(t=this.getBrush(yi.Magenta)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Maroon",{get:function(){var t=null;return this.sBrushes.containsKey(yi.Maroon)&&(t=this.sBrushes.getValue(yi.Maroon)),null==t&&(t=this.getBrush(yi.Maroon)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"MediumAquamarine",{get:function(){var t=null;return this.sBrushes.containsKey(yi.MediumAquamarine)&&(t=this.sBrushes.getValue(yi.MediumAquamarine)),null==t&&(t=this.getBrush(yi.MediumAquamarine)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"MediumBlue",{get:function(){var t=null;return this.sBrushes.containsKey(yi.MediumBlue)&&(t=this.sBrushes.getValue(yi.MediumBlue)),null==t&&(t=this.getBrush(yi.MediumBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"MediumOrchid",{get:function(){var t=null;return this.sBrushes.containsKey(yi.MediumOrchid)&&(t=this.sBrushes.getValue(yi.MediumOrchid)),null==t&&(t=this.getBrush(yi.MediumOrchid)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"MediumPurple",{get:function(){var t=null;return this.sBrushes.containsKey(yi.MediumPurple)&&(t=this.sBrushes.getValue(yi.MediumPurple)),null==t&&(t=this.getBrush(yi.MediumPurple)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"MediumSeaGreen",{get:function(){var t=null;return this.sBrushes.containsKey(yi.MediumSeaGreen)&&(t=this.sBrushes.getValue(yi.MediumSeaGreen)),null==t&&(t=this.getBrush(yi.MediumSeaGreen)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"MediumSlateBlue",{get:function(){var t=null;return this.sBrushes.containsKey(yi.MediumSlateBlue)&&(t=this.sBrushes.getValue(yi.MediumSlateBlue)),null==t&&(t=this.getBrush(yi.MediumSlateBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"MediumSpringGreen",{get:function(){var t=null;return this.sBrushes.containsKey(yi.MediumSpringGreen)&&(t=this.sBrushes.getValue(yi.MediumSpringGreen)),null==t&&(t=this.getBrush(yi.MediumSpringGreen)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"MediumTurquoise",{get:function(){var t=null;return this.sBrushes.containsKey(yi.MediumTurquoise)&&(t=this.sBrushes.getValue(yi.MediumTurquoise)),null==t&&(t=this.getBrush(yi.MediumTurquoise)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"MediumVioletRed",{get:function(){var t=null;return this.sBrushes.containsKey(yi.MediumVioletRed)&&(t=this.sBrushes.getValue(yi.MediumVioletRed)),null==t&&(t=this.getBrush(yi.MediumVioletRed)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"MidnightBlue",{get:function(){var t=null;return this.sBrushes.containsKey(yi.MidnightBlue)&&(t=this.sBrushes.getValue(yi.MidnightBlue)),null==t&&(t=this.getBrush(yi.MidnightBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"MintCream",{get:function(){var t=null;return this.sBrushes.containsKey(yi.MintCream)&&(t=this.sBrushes.getValue(yi.MintCream)),null==t&&(t=this.getBrush(yi.MintCream)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"MistyRose",{get:function(){var t=null;return this.sBrushes.containsKey(yi.MistyRose)&&(t=this.sBrushes.getValue(yi.MistyRose)),null==t&&(t=this.getBrush(yi.MistyRose)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Moccasin",{get:function(){var t=null;return this.sBrushes.containsKey(yi.Moccasin)&&(t=this.sBrushes.getValue(yi.Moccasin)),null==t&&(t=this.getBrush(yi.Moccasin)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"NavajoWhite",{get:function(){var t=null;return this.sBrushes.containsKey(yi.NavajoWhite)&&(t=this.sBrushes.getValue(yi.NavajoWhite)),null==t&&(t=this.getBrush(yi.NavajoWhite)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Navy",{get:function(){var t=null;return this.sBrushes.containsKey(yi.Navy)&&(t=this.sBrushes.getValue(yi.Navy)),null==t&&(t=this.getBrush(yi.Navy)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"OldLace",{get:function(){var t=null;return this.sBrushes.containsKey(yi.OldLace)&&(t=this.sBrushes.getValue(yi.OldLace)),null==t&&(t=this.getBrush(yi.OldLace)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Olive",{get:function(){var t=null;return this.sBrushes.containsKey(yi.Olive)&&(t=this.sBrushes.getValue(yi.Olive)),null==t&&(t=this.getBrush(yi.Olive)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"OliveDrab",{get:function(){var t=null;return this.sBrushes.containsKey(yi.OliveDrab)&&(t=this.sBrushes.getValue(yi.OliveDrab)),null==t&&(t=this.getBrush(yi.OliveDrab)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Orange",{get:function(){var t=null;return this.sBrushes.containsKey(yi.Orange)&&(t=this.sBrushes.getValue(yi.Orange)),null==t&&(t=this.getBrush(yi.Orange)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"OrangeRed",{get:function(){var t=null;return this.sBrushes.containsKey(yi.OrangeRed)&&(t=this.sBrushes.getValue(yi.OrangeRed)),null==t&&(t=this.getBrush(yi.OrangeRed)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Orchid",{get:function(){var t=null;return this.sBrushes.containsKey(yi.Orchid)&&(t=this.sBrushes.getValue(yi.Orchid)),null==t&&(t=this.getBrush(yi.Orchid)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"PaleGoldenrod",{get:function(){var t=null;return this.sBrushes.containsKey(yi.PaleGoldenrod)&&(t=this.sBrushes.getValue(yi.PaleGoldenrod)),null==t&&(t=this.getBrush(yi.PaleGoldenrod)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"PaleGreen",{get:function(){var t=null;return this.sBrushes.containsKey(yi.PaleGreen)&&(t=this.sBrushes.getValue(yi.PaleGreen)),null==t&&(t=this.getBrush(yi.PaleGreen)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"PaleTurquoise",{get:function(){var t=null;return this.sBrushes.containsKey(yi.PaleTurquoise)&&(t=this.sBrushes.getValue(yi.PaleTurquoise)),null==t&&(t=this.getBrush(yi.PaleTurquoise)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"PaleVioletRed",{get:function(){var t=null;return this.sBrushes.containsKey(yi.PaleVioletRed)&&(t=this.sBrushes.getValue(yi.PaleVioletRed)),null==t&&(t=this.getBrush(yi.PaleVioletRed)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"PapayaWhip",{get:function(){var t=null;return this.sBrushes.containsKey(yi.PapayaWhip)&&(t=this.sBrushes.getValue(yi.PapayaWhip)),null==t&&(t=this.getBrush(yi.PapayaWhip)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"PeachPuff",{get:function(){var t=null;return this.sBrushes.containsKey(yi.PeachPuff)&&(t=this.sBrushes.getValue(yi.PeachPuff)),null==t&&(t=this.getBrush(yi.PeachPuff)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Peru",{get:function(){var t=null;return this.sBrushes.containsKey(yi.Peru)&&(t=this.sBrushes.getValue(yi.Peru)),null==t&&(t=this.getBrush(yi.Peru)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Pink",{get:function(){var t=null;return this.sBrushes.containsKey(yi.Pink)&&(t=this.sBrushes.getValue(yi.Pink)),null==t&&(t=this.getBrush(yi.Pink)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Plum",{get:function(){var t=null;return this.sBrushes.containsKey(yi.Plum)&&(t=this.sBrushes.getValue(yi.Plum)),null==t&&(t=this.getBrush(yi.Plum)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"PowderBlue",{get:function(){var t=null;return this.sBrushes.containsKey(yi.PowderBlue)&&(t=this.sBrushes.getValue(yi.PowderBlue)),null==t&&(t=this.getBrush(yi.PowderBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Purple",{get:function(){var t=null;return this.sBrushes.containsKey(yi.Purple)&&(t=this.sBrushes.getValue(yi.Purple)),null==t&&(t=this.getBrush(yi.Purple)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Red",{get:function(){var t=null;return this.sBrushes.containsKey(yi.Red)&&(t=this.sBrushes.getValue(yi.Red)),null==t&&(t=this.getBrush(yi.Red)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"RosyBrown",{get:function(){var t=null;return this.sBrushes.containsKey(yi.RosyBrown)&&(t=this.sBrushes.getValue(yi.RosyBrown)),null==t&&(t=this.getBrush(yi.RosyBrown)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"RoyalBlue",{get:function(){var t=null;return this.sBrushes.containsKey(yi.RoyalBlue)&&(t=this.sBrushes.getValue(yi.RoyalBlue)),null==t&&(t=this.getBrush(yi.RoyalBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"SaddleBrown",{get:function(){var t=null;return this.sBrushes.containsKey(yi.SaddleBrown)&&(t=this.sBrushes.getValue(yi.SaddleBrown)),null==t&&(t=this.getBrush(yi.SaddleBrown)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Salmon",{get:function(){var t=null;return this.sBrushes.containsKey(yi.Salmon)&&(t=this.sBrushes.getValue(yi.Salmon)),null==t&&(t=this.getBrush(yi.Salmon)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"SandyBrown",{get:function(){var t=null;return this.sBrushes.containsKey(yi.SandyBrown)&&(t=this.sBrushes.getValue(yi.SandyBrown)),null==t&&(t=this.getBrush(yi.SandyBrown)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"SeaGreen",{get:function(){var t=null;return this.sBrushes.containsKey(yi.SeaGreen)&&(t=this.sBrushes.getValue(yi.SeaGreen)),null==t&&(t=this.getBrush(yi.SeaGreen)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"SeaShell",{get:function(){var t=null;return this.sBrushes.containsKey(yi.SeaShell)&&(t=this.sBrushes.getValue(yi.SeaShell)),null==t&&(t=this.getBrush(yi.SeaShell)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Sienna",{get:function(){var t=null;return this.sBrushes.containsKey(yi.Sienna)&&(t=this.sBrushes.getValue(yi.Sienna)),null==t&&(t=this.getBrush(yi.Sienna)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Silver",{get:function(){var t=null;return this.sBrushes.containsKey(yi.Silver)&&(t=this.sBrushes.getValue(yi.Silver)),null==t&&(t=this.getBrush(yi.Silver)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"SkyBlue",{get:function(){var t=null;return this.sBrushes.containsKey(yi.SkyBlue)&&(t=this.sBrushes.getValue(yi.SkyBlue)),null==t&&(t=this.getBrush(yi.SkyBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"SlateBlue",{get:function(){var t=null;return this.sBrushes.containsKey(yi.SlateBlue)&&(t=this.sBrushes.getValue(yi.SlateBlue)),null==t&&(t=this.getBrush(yi.SlateBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"SlateGray",{get:function(){var t=null;return this.sBrushes.containsKey(yi.SlateGray)&&(t=this.sBrushes.getValue(yi.SlateGray)),null==t&&(t=this.getBrush(yi.SlateGray)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Snow",{get:function(){var t=null;return this.sBrushes.containsKey(yi.Snow)&&(t=this.sBrushes.getValue(yi.Snow)),null==t&&(t=this.getBrush(yi.Snow)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"SpringGreen",{get:function(){var t=null;return this.sBrushes.containsKey(yi.SpringGreen)&&(t=this.sBrushes.getValue(yi.SpringGreen)),null==t&&(t=this.getBrush(yi.SpringGreen)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"SteelBlue",{get:function(){var t=null;return this.sBrushes.containsKey(yi.SteelBlue)&&(t=this.sBrushes.getValue(yi.SteelBlue)),null==t&&(t=this.getBrush(yi.SteelBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Tan",{get:function(){var t=null;return this.sBrushes.containsKey(yi.Tan)&&(t=this.sBrushes.getValue(yi.Tan)),null==t&&(t=this.getBrush(yi.Tan)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Teal",{get:function(){var t=null;return this.sBrushes.containsKey(yi.Teal)&&(t=this.sBrushes.getValue(yi.Teal)),null==t&&(t=this.getBrush(yi.Teal)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Thistle",{get:function(){var t=null;return this.sBrushes.containsKey(yi.Thistle)&&(t=this.sBrushes.getValue(yi.Thistle)),null==t&&(t=this.getBrush(yi.Thistle)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Tomato",{get:function(){var t=null;return this.sBrushes.containsKey(yi.Tomato)&&(t=this.sBrushes.getValue(yi.Tomato)),null==t&&(t=this.getBrush(yi.Tomato)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Transparent",{get:function(){var t=null;return this.sBrushes.containsKey(yi.Transparent)&&(t=this.sBrushes.getValue(yi.Transparent)),null==t&&(t=this.getBrush(yi.Transparent)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Turquoise",{get:function(){var t=null;return this.sBrushes.containsKey(yi.Turquoise)&&(t=this.sBrushes.getValue(yi.Turquoise)),null==t&&(t=this.getBrush(yi.Turquoise)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Violet",{get:function(){var t=null;return this.sBrushes.containsKey(yi.Violet)&&(t=this.sBrushes.getValue(yi.Violet)),null==t&&(t=this.getBrush(yi.Violet)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Wheat",{get:function(){var t=null;return this.sBrushes.containsKey(yi.Wheat)&&(t=this.sBrushes.getValue(yi.Wheat)),null==t&&(t=this.getBrush(yi.Wheat)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"White",{get:function(){var t=null;return this.sBrushes.containsKey(yi.White)&&(t=this.sBrushes.getValue(yi.White)),null==t&&(t=this.getBrush(yi.White)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WhiteSmoke",{get:function(){var t=null;return this.sBrushes.containsKey(yi.WhiteSmoke)&&(t=this.sBrushes.getValue(yi.WhiteSmoke)),null==t&&(t=this.getBrush(yi.WhiteSmoke)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Yellow",{get:function(){var t=null;return this.sBrushes.containsKey(yi.Yellow)&&(t=this.sBrushes.getValue(yi.Yellow)),null==t&&(t=this.getBrush(yi.Yellow)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"YellowGreen",{get:function(){var t=null;return this.sBrushes.containsKey(yi.YellowGreen)&&(t=this.sBrushes.getValue(yi.YellowGreen)),null==t&&(t=this.getBrush(yi.YellowGreen)),t},enumerable:!0,configurable:!0}),t.getBrush=function(t){var e=this.getColorValue(t),i=new D(e);return this.sBrushes.setValue(t,i),i},t.getColorValue=function(t){var e=new L;switch(t){case yi.Transparent:e=new L(0,255,255,255);break;case yi.AliceBlue:e=new L(255,240,248,255);break;case yi.AntiqueWhite:e=new L(255,250,235,215);break;case yi.Aqua:e=new L(255,0,255,255);break;case yi.Aquamarine:e=new L(255,127,255,212);break;case yi.Azure:e=new L(255,240,255,255);break;case yi.Beige:e=new L(255,245,245,220);break;case yi.Bisque:e=new L(255,255,228,196);break;case yi.Black:e=new L(255,0,0,0);break;case yi.BlanchedAlmond:e=new L(255,255,235,205);break;case yi.Blue:e=new L(255,0,0,255);break;case yi.BlueViolet:e=new L(255,138,43,226);break;case yi.Brown:e=new L(255,165,42,42);break;case yi.BurlyWood:e=new L(255,222,184,135);break;case yi.CadetBlue:e=new L(255,95,158,160);break;case yi.Chartreuse:e=new L(255,127,255,0);break;case yi.Chocolate:e=new L(255,210,105,30);break;case yi.Coral:e=new L(255,255,127,80);break;case yi.CornflowerBlue:e=new L(255,100,149,237);break;case yi.Cornsilk:e=new L(255,255,248,220);break;case yi.Crimson:e=new L(255,220,20,60);break;case yi.Cyan:e=new L(255,0,255,255);break;case yi.DarkBlue:e=new L(255,0,0,139);break;case yi.DarkCyan:e=new L(255,0,139,139);break;case yi.DarkGoldenrod:e=new L(255,184,134,11);break;case yi.DarkGray:e=new L(255,169,169,169);break;case yi.DarkGreen:e=new L(255,0,100,0);break;case yi.DarkKhaki:e=new L(255,189,183,107);break;case yi.DarkMagenta:e=new L(255,139,0,139);break;case yi.DarkOliveGreen:e=new L(255,85,107,47);break;case yi.DarkOrange:e=new L(255,255,140,0);break;case yi.DarkOrchid:e=new L(255,153,50,204);break;case yi.DarkRed:e=new L(255,139,0,0);break;case yi.DarkSalmon:e=new L(255,233,150,122);break;case yi.DarkSeaGreen:e=new L(255,143,188,139);break;case yi.DarkSlateBlue:e=new L(255,72,61,139);break;case yi.DarkSlateGray:e=new L(255,47,79,79);break;case yi.DarkTurquoise:e=new L(255,0,206,209);break;case yi.DarkViolet:e=new L(255,148,0,211);break;case yi.DeepPink:e=new L(255,255,20,147);break;case yi.DeepSkyBlue:e=new L(255,0,191,255);break;case yi.DimGray:e=new L(255,105,105,105);break;case yi.DodgerBlue:e=new L(255,30,144,255);break;case yi.Firebrick:e=new L(255,178,34,34);break;case yi.FloralWhite:e=new L(255,255,250,240);break;case yi.ForestGreen:e=new L(255,34,139,34);break;case yi.Fuchsia:e=new L(255,255,0,255);break;case yi.Gainsboro:e=new L(255,220,220,220);break;case yi.GhostWhite:e=new L(255,248,248,255);break;case yi.Gold:e=new L(255,255,215,0);break;case yi.Goldenrod:e=new L(255,218,165,32);break;case yi.Gray:e=new L(255,128,128,128);break;case yi.Green:e=new L(255,0,128,0);break;case yi.GreenYellow:e=new L(255,173,255,47);break;case yi.Honeydew:e=new L(255,240,255,240);break;case yi.HotPink:e=new L(255,255,105,180);break;case yi.IndianRed:e=new L(255,205,92,92);break;case yi.Indigo:e=new L(255,75,0,130);break;case yi.Ivory:e=new L(255,255,255,240);break;case yi.Khaki:e=new L(255,240,230,140);break;case yi.Lavender:e=new L(255,230,230,250);break;case yi.LavenderBlush:e=new L(255,255,240,245);break;case yi.LawnGreen:e=new L(255,124,252,0);break;case yi.LemonChiffon:e=new L(255,255,250,205);break;case yi.LightBlue:e=new L(255,173,216,230);break;case yi.LightCoral:e=new L(255,240,128,128);break;case yi.LightCyan:e=new L(255,224,255,255);break;case yi.LightGoldenrodYellow:e=new L(255,250,250,210);break;case yi.LightGreen:e=new L(255,144,238,144);break;case yi.LightGray:e=new L(255,211,211,211);break;case yi.LightPink:e=new L(255,255,182,193);break;case yi.LightSalmon:e=new L(255,255,160,122);break;case yi.LightSeaGreen:e=new L(255,32,178,170);break;case yi.LightSkyBlue:e=new L(255,135,206,250);break;case yi.LightSlateGray:e=new L(255,119,136,153);break;case yi.LightSteelBlue:e=new L(255,176,196,222);break;case yi.LightYellow:e=new L(255,255,255,224);break;case yi.Lime:e=new L(255,0,255,0);break;case yi.LimeGreen:e=new L(255,50,205,50);break;case yi.Linen:e=new L(255,250,240,230);break;case yi.Magenta:e=new L(255,255,0,255);break;case yi.Maroon:e=new L(255,128,0,0);break;case yi.MediumAquamarine:e=new L(255,102,205,170);break;case yi.MediumBlue:e=new L(255,0,0,205);break;case yi.MediumOrchid:e=new L(255,186,85,211);break;case yi.MediumPurple:e=new L(255,147,112,219);break;case yi.MediumSeaGreen:e=new L(255,60,179,113);break;case yi.MediumSlateBlue:e=new L(255,123,104,238);break;case yi.MediumSpringGreen:e=new L(255,0,250,154);break;case yi.MediumTurquoise:e=new L(255,72,209,204);break;case yi.MediumVioletRed:e=new L(255,199,21,133);break;case yi.MidnightBlue:e=new L(255,25,25,112);break;case yi.MintCream:e=new L(255,245,255,250);break;case yi.MistyRose:e=new L(255,255,228,225);break;case yi.Moccasin:e=new L(255,255,228,181);break;case yi.NavajoWhite:e=new L(255,255,222,173);break;case yi.Navy:e=new L(255,0,0,128);break;case yi.OldLace:e=new L(255,253,245,230);break;case yi.Olive:e=new L(255,128,128,0);break;case yi.OliveDrab:e=new L(255,107,142,35);break;case yi.Orange:e=new L(255,255,165,0);break;case yi.OrangeRed:e=new L(255,255,69,0);break;case yi.Orchid:e=new L(255,218,112,214);break;case yi.PaleGoldenrod:e=new L(255,238,232,170);break;case yi.PaleGreen:e=new L(255,152,251,152);break;case yi.PaleTurquoise:e=new L(255,175,238,238);break;case yi.PaleVioletRed:e=new L(255,219,112,147);break;case yi.PapayaWhip:e=new L(255,255,239,213);break;case yi.PeachPuff:e=new L(255,255,218,185);break;case yi.Peru:e=new L(255,205,133,63);break;case yi.Pink:e=new L(255,255,192,203);break;case yi.Plum:e=new L(255,221,160,221);break;case yi.PowderBlue:e=new L(255,176,224,230);break;case yi.Purple:e=new L(255,128,0,128);break;case yi.Red:e=new L(255,255,0,0);break;case yi.RosyBrown:e=new L(255,188,143,143);break;case yi.RoyalBlue:e=new L(255,65,105,225);break;case yi.SaddleBrown:e=new L(255,139,69,19);break;case yi.Salmon:e=new L(255,250,128,114);break;case yi.SandyBrown:e=new L(255,244,164,96);break;case yi.SeaGreen:e=new L(255,46,139,87);break;case yi.SeaShell:e=new L(255,255,245,238);break;case yi.Sienna:e=new L(255,160,82,45);break;case yi.Silver:e=new L(255,192,192,192);break;case yi.SkyBlue:e=new L(255,135,206,235);break;case yi.SlateBlue:e=new L(255,106,90,205);break;case yi.SlateGray:e=new L(255,112,128,144);break;case yi.Snow:e=new L(255,255,250,250);break;case yi.SpringGreen:e=new L(255,0,255,127);break;case yi.SteelBlue:e=new L(255,70,130,180);break;case yi.Tan:e=new L(255,210,180,140);break;case yi.Teal:e=new L(255,0,128,128);break;case yi.Thistle:e=new L(255,216,191,216);break;case yi.Tomato:e=new L(255,255,99,71);break;case yi.Turquoise:e=new L(255,64,224,208);break;case yi.Violet:e=new L(255,238,130,238);break;case yi.Wheat:e=new L(255,245,222,179);break;case yi.White:e=new L(255,255,255,255);break;case yi.WhiteSmoke:e=new L(255,245,245,245);break;case yi.Yellow:e=new L(255,255,255,0);break;case yi.YellowGreen:e=new L(255,154,205,50)}return e},t.sBrushes=new n,t}(),wi=function(){function e(t){this.precision=1e3}return Object.defineProperty(e.prototype,"factors",{get:function(){return this.mFactors},set:function(t){if(null==t)throw new Error("ArgumentNullException : Factors");this.mFactors=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"positions",{get:function(){return this.mPositions},set:function(t){for(var e=t,i=0;i<e.length;i++)(e[i]<0||e[i]>1)&&(e[i]=0);this.mPositions=e,this.mPositions=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"count",{get:function(){return this.mCount},enumerable:!0,configurable:!0}),e.prototype.generateColorBlend=function(t,e){if(null==t)throw new Error("ArgumentNullException : colours");null==this.positions&&(this.positions=[0]);var i=new Si(this.count),r=this.positions,n=null;if(1===r.length)(r=[3])[0]=0,r[1]=this.positions[0],r[2]=1,(n=new Array(3))[0]=t[0],n[1]=t[0],n[2]=t[1];else{var o=t[0],s=t[1];n=new Array(this.count);var a=0,h=this.count;for(a=0;a<h;++a)n[a]=this.interpolate(this.mFactors[a],o,s,e)}return i.positions=r,i.colors=n,i},e.prototype.clonePdfBlend=function(){return null!=this.mFactors&&(this.factors=this.mFactors),null!=this.positions&&(this.positions=this.positions),this},e.prototype.gcd=function(t,e){if("number"==typeof t&&"number"==typeof e&&void 0!==e){if(t<0||t>1)throw new Error("ArgumentOutOfRangeException : u");if(e<0||e>1)throw new Error("ArgumentOutOfRangeException : v");var i=Math.max(1,t*this.precision),r=Math.max(1,e*this.precision);return this.gcdInt(i,r)/this.precision}var n=t;if(null==n)throw new Error("ArgumentNullException : values");if(n.length<1)throw new Error("ArgumentException : Not enough values in the array. - values");var o=n[0];if(n.length>1)for(var s=n.length,a=1;a<s&&(o=this.gcd(n[a],o))!==1/this.precision;++a);return o},e.prototype.gcdInt=function(t,e){if(t<=0)throw new Error("ArgumentOutOfRangeException"+t+"The arguments cannot be less or equal to zero.");if(e<=0)throw new Error("ArgumentOutOfRangeException"+e+"The arguments cannot be less or equal to zero.");if(1===t||1===e)return 1;for(var i=0;this.isEven(t,e);)++i,t>>=1,e>>=1;for(;(1&t)<=0;)t>>=1;do{for(;(1&e)<=0;)e>>=1;if(t>e){var r=e;e=t,t=r}e-=t}while(0!==e);return t<<i},e.prototype.isEven=function(t,e){if("number"==typeof e&&void 0!==e){var i=!0;return i=i&&(1&t)<=0,i=i&&(1&e)<=0}return(1&t)<=0},e.prototype.interpolate=function(e,i,r,n){if(i instanceof L){var o=new L;switch(n){case t.PdfColorSpace.Rgb:var s=this.interpolate(e,i.red,r.red),a=this.interpolate(e,i.green,r.green),h=this.interpolate(e,i.blue,r.blue);o=new L(s,a,h);break;case t.PdfColorSpace.GrayScale:var l=this.interpolate(e,i.gray,r.gray);o=new L(l);break;case t.PdfColorSpace.Cmyk:var u=this.interpolate(e,i.c,r.c),c=this.interpolate(e,i.m,r.m),p=this.interpolate(e,i.y,r.y),d=this.interpolate(e,i.k,r.k);o=new L(u,c,p,d)}return o}return 0===e?i:1===e?r:i+(r-i)/1*(e-0)},e}(),Pi=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Si=function(e){function i(t){var i=e.call(this)||this;return"number"==typeof t&&(i=e.call(this,t)||this),i}return Pi(i,e),Object.defineProperty(i.prototype,"colors",{get:function(){return this.mcolors},set:function(t){if(null==t)throw new Error("ArgumentNullException : Colors");this.mcolors=t},enumerable:!0,configurable:!0}),i.prototype.getFunction=function(t){var e=this.getColorComponentsCount(t),i=this.getMaxComponentValue(t),r=this.setRange(e,i),n=null;if(null==this.mbrush&&void 0===this.mbrush){var o=[1],s=void 0,a=1;if(2===this.positions.length)s=2;else{var h=this.positions,l=this.getIntervals(h),u=this.gcd(l);a=u,s=1/u+1}o[0]=s;var c=this.getSamplesValues(t,s,i,a);return n=new fi([0,1],r,o,c)}return n},i.prototype.cloneColorBlend=function(){return null!=this.mcolors&&void 0!==this.mcolors&&(this.colors=this.mcolors),null!=this.positions&&void 0!==this.positions&&(this.positions=this.positions),this},i.prototype.setRange=function(t,e){for(var i=[2*t],r=0;r<t;++r)i[2*r]=0,i[2*r+1]=1;return i},i.prototype.getColorComponentsCount=function(e){var i=0;switch(e){case t.PdfColorSpace.Rgb:i=3;break;case t.PdfColorSpace.Cmyk:i=4;break;case t.PdfColorSpace.GrayScale:i=1;break;default:throw new Error("ArgumentException - Unsupported color space: "+e+" colorSpace")}return i},i.prototype.getSamplesValues=function(e,i,r,n){var o;switch(e){case t.PdfColorSpace.GrayScale:o=this.getGrayscaleSamples(i,r,n);break;case t.PdfColorSpace.Cmyk:o=this.getCmykSamples(i,r,n);break;case t.PdfColorSpace.Rgb:o=this.getRgbSamples(i,r,n);break;default:throw new Error("ArgumentException - Unsupported color space: "+e+" colorSpace")}return o},i.prototype.getGrayscaleSamples=function(e,i,r){for(var n=[2*e],o=0;o<e;++o)this.getNextColor(o,r,t.PdfColorSpace.GrayScale);return n},i.prototype.getRgbSamples=function(e,i,r){for(var n=[3*e],o=0;o<e;++o){var s=this.getNextColor(o,r,t.PdfColorSpace.Rgb),a=3*o;n[a]=s.r,n[a+1]=s.g,n[a+2]=s.b}return n},i.prototype.getCmykSamples=function(e,i,r){for(var n=[4*e],o=0;o<e;o++){var s=this.getNextColor(o,r,t.PdfColorSpace.Cmyk),a=4*o;n[a]=s.c*i,n[a+1]=s.m*i,n[a+2]=s.y*i,n[a+3]=s.k*i}return n},i.prototype.getNextColor=function(t,e,i){var r,n,o,s=e*t,a=this.getIndices(s,n,r);if((n=a.indexLow)===(r=a.indexHi))o=this.mcolors[n];else{var h=this.positions[n],l=this.positions[r],u=this.mcolors[n],c=this.mcolors[r],p=(s-h)/(l-h);o=this.interpolate(p,u,c,i)}return o},i.prototype.getIndices=function(t,e,i){var r=this.positions;e=0,i=0;for(var n=0;n<this.mcolors.length;++n){var o=r[n];if(o===t){i=n,e=n;break}if(o>t){i=n;break}e=n,i=n}return{indexLow:e,indexHi:i}},i.prototype.getMaxComponentValue=function(e){var i=0;switch(e){case t.PdfColorSpace.Cmyk:case t.PdfColorSpace.Rgb:i=255;break;case t.PdfColorSpace.GrayScale:i=65535;break;default:throw new Error("ArgumentException - Unsupported color space: "+e+"colorSpace")}return i},i.prototype.getIntervals=function(t){for(var e=t.length,i=[e-1],r=t[0],n=1;n<e;++n){var o=t[n];i[n-1]=o-r,r=o}return i},i}(wi),vi=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ci=function(e){function i(t,i,r,n){var o=e.call(this,new h)||this;if(o.mDictionaryProperties=new a,t instanceof T&&i instanceof T&&r instanceof L&&n instanceof L)o.initialize(r,n),o.mPointStart=t,o.mPointEnd=i,o.setPoints(o.mPointStart,o.mPointEnd);else if(t instanceof V)if(o.initialize(i,r),n===gi.BackwardDiagonal||n===gi.ForwardDiagonal||n===gi.Horizontal||n===gi.Vertical){switch(o.mBoundaries=t,n){case gi.BackwardDiagonal:o.mPointStart=new T(t.right,t.top),o.mPointEnd=new T(t.left,t.bottom);break;case gi.ForwardDiagonal:o.mPointStart=new T(t.left,t.top),o.mPointEnd=new T(t.right,t.bottom);break;case gi.Horizontal:o.mPointStart=new T(t.left,t.top),o.mPointEnd=new T(t.right,t.top);break;case gi.Vertical:o.mPointStart=new T(t.left,t.top),o.mPointEnd=new T(t.left,t.bottom);break;default:throw new Error("ArgumentException -- Unsupported linear gradient mode: "+n+" mode")}o.setPoints(o.mPointStart,o.mPointEnd)}else if("number"==typeof n&&void 0!==n){if(o.mBoundaries=t,0===(n%=360))o.mPointStart=new T(t.left,t.top),o.mPointEnd=new T(t.right,t.top);else if(90===n)o.mPointStart=new T(t.left,t.top),o.mPointEnd=new T(t.left,t.bottom);else if(180===n)o.mPointEnd=new T(t.left,t.top),o.mPointStart=new T(t.right,t.top);else if(270===n)o.mPointEnd=new T(t.left,t.top),o.mPointStart=new T(t.left,t.bottom);else{var s=n*(Math.PI/180),l=Math.tan(s),u=o.mBoundaries.left+(o.mBoundaries.right-o.mBoundaries.left)/2,c=o.mBoundaries.top+(o.mBoundaries.bottom-o.mBoundaries.top)/2,p=new T(u,c);c=l*(u=o.mBoundaries.width/(2*Math.cos(s))),u+=p.x,c+=p.y;var d=new T(u,c),f=o.subPoints(d,p),g=o.choosePoint(n),m=o.mulPoints(o.subPoints(g,p),f)/o.mulPoints(f,f);o.mPointEnd=o.addPoints(p,o.mulPoint(f,m)),o.mPointStart=o.addPoints(p,o.mulPoint(f,-1*m))}o.setPoints(o.mPointEnd,o.mPointStart)}return o}return vi(i,e),i.prototype.initialize=function(t,e){this.mColours=[t,e],this.mColourBlend=new Si(2),this.mColourBlend.positions=[0,1],this.mColourBlend.colors=this.mColours,this.initShading()},Object.defineProperty(i.prototype,"blend",{get:function(){return this.mBlend},set:function(t){if(null==t)throw new Error("ArgumentNullException : Blend");if(null==this.mColours)throw new Error("NotSupportedException : There is no starting and ending colours specified.");this.mBlend=t,this.mColourBlend=this.mBlend.generateColorBlend(this.mColours,this.colorSpace),this.resetFunction()},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"interpolationColors",{get:function(){return this.mColourBlend},set:function(t){if(null==t)throw new Error("ArgumentNullException : InterpolationColors");this.mBlend=null,this.mColours=null,this.mColourBlend=t,this.resetFunction()},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"linearColors",{get:function(){return this.mColours},set:function(t){if(null==t)throw new Error("ArgumentNullException : LinearColors");if(t.length<2)throw new Error("ArgumentException : The array is too small - LinearColors");null==this.mColours&&void 0===this.mColours?this.mColours=[t[0],t[1]]:(this.mColours[0]=t[0],this.mColours[1]=t[1]),null==this.mBlend&&void 0===this.mBlend?(this.mColourBlend=new Si(2),this.mColourBlend.colors=this.mColours,this.mColourBlend.positions=[0,1]):this.mColourBlend=this.mBlend.generateColorBlend(this.mColours,this.colorSpace),this.resetFunction()},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"rectangle",{get:function(){return this.mBoundaries},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"extend",{get:function(){var t=ui.None,e=this.shading.items.getValue(this.mDictionaryProperties.extend);if(null!=e){var i=e.items(0),r=e.items(1);i.value&&(t|=ui.Start),r.value&&(t|=ui.End)}return t},set:function(t){var e,i,r=this.shading.items.getValue(this.mDictionaryProperties.extend);null==r?(e=new U(!1),i=new U(!1),(r=new m).add(e),r.add(i),this.shading.items.setValue(this.mDictionaryProperties.extend,r)):(e=r.items(0),i=r.items(1))},enumerable:!0,configurable:!0}),i.prototype.addPoints=function(t,e){var i=t.x+e.x,r=t.y+e.y;return new T(i,r)},i.prototype.subPoints=function(t,e){var i=t.x-e.x,r=t.y-e.y;return new T(i,r)},i.prototype.mulPoints=function(t,e){return t.x*e.x+t.y*e.y},i.prototype.mulPoint=function(t,e){return t.x=t.x*e,t.y=t.y*e,t},i.prototype.choosePoint=function(t){var e=new T(0,0);if(t<90&&t>0)e=new T(this.mBoundaries.right,this.mBoundaries.bottom);else if(t<180&&t>90)e=new T(this.mBoundaries.left,this.mBoundaries.bottom);else if(t<270&&t>180)e=new T(this.mBoundaries.left,this.mBoundaries.top);else{if(!(t>270))throw new Error("PdfException - Internal error.");e=new T(this.mBoundaries.right,this.mBoundaries.top)}return e},i.prototype.setPoints=function(t,e){var i=new m;i.add(new g(t.x)),i.add(new g(this.updateY(t.y))),i.add(new g(e.x)),i.add(new g(this.updateY(e.y))),this.shading.items.setValue(this.mDictionaryProperties.coords,i)},i.prototype.updateY=function(t){return 0!==t?-t:t},i.prototype.initShading=function(){this.colorSpace=t.PdfColorSpace.Rgb,this.function=this.mColourBlend.getFunction(this.colorSpace),this.shading.items.setValue(this.mDictionaryProperties.shadingType,new g(mi.Axial))},i.prototype.clone=function(){return this.resetPatternDictionary(new h(this.patternDictionary)),this.shading=new h,this.initShading(),this.setPoints(this.mPointStart,this.mPointEnd),null!==this&&this instanceof i&&null!=this.matrix&&void 0!==this.matrix&&(this.matrix=this.matrix.clone()),null!=this.mColours&&void 0!==this.mColours&&(this.mColours=this.mColours),null!=this.blend&&void 0!==this.blend?this.blend=this.blend.clonePdfBlend():null!=this.interpolationColors&&void 0!==this.interpolationColors&&(this.interpolationColors=this.interpolationColors.cloneColorBlend()),this.extend=this.extend,this.cloneBackgroundValue(this),this.cloneAntiAliasingValue(this),this},i.prototype.resetFunction=function(){this.function=this.mColourBlend.getFunction(this.colorSpace)},i}(Yt),Bi=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Oi=function(e){function i(t,i,r,n,o,s){var l=e.call(this,new h)||this;if(l.mDictionaryProperties=new a,l.initialize(o,s),i<0)throw new Error("ArgumentOutOfRangeException : radiusStart - The radius cannot be less then zero.");if(n<0)throw new Error("ArgumentOutOfRangeException : radiusEnd - The radius cannpt be less then zero.");return l.mPointEnd=r,l.mPointStart=t,l.mRadiusStart=i,l.mRadiusEnd=n,l.setPoints(l.mPointStart,l.mPointEnd,l.mRadiusStart,l.mRadiusEnd),l}return Bi(i,e),i.prototype.initialize=function(t,e){this.mColour=[t,e],this.mColourBlends=new Si(2),this.mColourBlends.positions=[0,1],this.mColourBlends.colors=this.mColour,this.initShading()},Object.defineProperty(i.prototype,"blend",{get:function(){return this.mBlend},set:function(t){if(null==t)throw new Error("ArgumentNullException : Blend");if(null==this.mColour&&void 0===this.mColour)throw new Error("NotSupportedException : There is no starting and ending colours specified.");this.mBlend=t,this.mColourBlends=this.mBlend.generateColorBlend(this.mColour,this.colorSpace),this.resetFunction()},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"interpolationColors",{get:function(){return this.mColourBlends},set:function(t){if(null==t)throw new Error("ArgumentNullException : InterpolationColors");this.mBlend=null,this.mColour=null,this.mColourBlends=t,this.resetFunction()},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"linearColors",{get:function(){return this.mColour},set:function(t){if(null==t)throw new Error("ArgumentNullException : radial LinearColors");if(t.length<2)throw new Error("ArgumentException : The array is too small LinearColors");null==this.mColour&&void 0===this.mColour?this.mColour=[t[0],t[1]]:(this.mColour[0]=t[0],this.mColour[1]=t[1]),null==this.mBlend&&void 0===this.mBlend?(this.mColourBlends=new Si(2),this.mColourBlends.colors=this.mColour,this.mColourBlends.positions=[0,1]):this.mColourBlends=this.mBlend.generateColorBlend(this.mColour,this.colorSpace),this.resetFunction()},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"rectangle",{get:function(){return this.mBoundaries},set:function(t){this.mBoundaries=t,this.bBox=m.fromRectangle(t)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"extend",{get:function(){var t=ui.None,e=this.shading.items.getValue(this.mDictionaryProperties.extend);if(null!==e&&void 0!==e){var i=e.items(0),r=e.items(1);i.value&&(t|=ui.Start),r.value&&(t|=ui.End)}return t},set:function(t){var e,i,r=this.shading.items.getValue(this.mDictionaryProperties.extend);null==r&&void 0===r?(e=new U(!1),i=new U(!1),(r=new m).add(e),r.add(i),this.shading.items.setValue(this.mDictionaryProperties.extend,r)):(e=r.items(0),i=r.items(1))},enumerable:!0,configurable:!0}),i.prototype.setPoints=function(t,e,i,r){var n=new m;n.add(new g(t.x)),n.add(new g(this.updateY(t.y))),n.add(new g(i)),n.add(new g(e.x)),n.add(new g(this.updateY(e.y))),i!==r?n.add(new g(r)):n.add(new g(0)),this.shading.items.setValue(this.mDictionaryProperties.coords,n)},i.prototype.updateY=function(t){return 0!==t?-t:t},i.prototype.initShading=function(){this.colorSpace=t.PdfColorSpace.Rgb,this.function=this.mColourBlends.getFunction(this.colorSpace),this.shading.items.setValue(this.mDictionaryProperties.shadingType,new g(mi.Radial))},i.prototype.clone=function(){return this.resetPatternDictionary(new h(this.patternDictionary)),this.shading=new h,this.initShading(),this.setPoints(this.mPointStart,this.mPointEnd,this.mRadiusStart,this.mRadiusEnd),this instanceof i&&null!==this.matrix&&void 0!==this.matrix&&(this.matrix=this.matrix.clone()),null!==this.mColour&&void 0!==this.mColour&&(this.mColour=this.mColour),null!==this.blend&&void 0!==this.blend?this.blend=this.blend.clonePdfBlend():null!==this.interpolationColors&&void 0!==this.interpolationColors&&(this.interpolationColors=this.interpolationColors.cloneColorBlend()),this.extend=this.extend,this.cloneBackgroundValue(this),this.cloneAntiAliasingValue(this),this},i.prototype.resetFunction=function(){this.function=this.mColourBlends.getFunction(this.colorSpace)},i}(Yt);!function(t){t[t.Overlap=0]="Overlap",t[t.Inside=1]="Inside"}(t.PdfBorderOverlapStyle||(t.PdfBorderOverlapStyle={}));var xi=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Li=function(){function t(){}return Object.defineProperty(t.prototype,"backgroundBrush",{get:function(){return this.gridBackgroundBrush},set:function(t){this.gridBackgroundBrush=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"textBrush",{get:function(){return this.gridTextBrush},set:function(t){this.gridTextBrush=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"textPen",{get:function(){return this.gridTextPen},set:function(t){this.gridTextPen=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"font",{get:function(){return this.gridFont},set:function(t){this.gridFont=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"backgroundImage",{get:function(){return this.gridBackgroundImage},set:function(t){this.gridBackgroundImage=t},enumerable:!0,configurable:!0}),t}(),Ti=function(e){function i(){var i=e.call(this)||this;return i.gridBorderOverlapStyle=t.PdfBorderOverlapStyle.Overlap,i.bAllowHorizontalOverflow=!1,i.gridHorizontalOverflowType=t.PdfHorizontalOverflowType.LastPage,i}return xi(i,e),Object.defineProperty(i.prototype,"cellSpacing",{get:function(){return void 0===this.gridCellSpacing&&(this.gridCellSpacing=0),this.gridCellSpacing},set:function(t){this.gridCellSpacing=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"horizontalOverflowType",{get:function(){return this.gridHorizontalOverflowType},set:function(t){this.gridHorizontalOverflowType=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"allowHorizontalOverflow",{get:function(){return this.bAllowHorizontalOverflow},set:function(t){this.bAllowHorizontalOverflow=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"cellPadding",{get:function(){return void 0===this.gridCellPadding&&(this.gridCellPadding=new Ge),this.gridCellPadding},set:function(t){void 0===this.gridCellPadding?(this.gridCellPadding=new Ge,this.gridCellPadding=t):this.gridCellPadding=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"borderOverlapStyle",{get:function(){return this.gridBorderOverlapStyle},set:function(t){this.gridBorderOverlapStyle=t},enumerable:!0,configurable:!0}),i}(Li),ji=function(t){function e(){var e=t.call(this)||this;return e.gridCellBorders=Ee.default,e}return xi(e,t),Object.defineProperty(e.prototype,"stringFormat",{get:function(){return this.format},set:function(t){this.format=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"borders",{get:function(){return this.gridCellBorders},set:function(t){this.gridCellBorders=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"cellPadding",{get:function(){return this.gridCellPadding},set:function(t){null!=this.gridCellPadding&&void 0!==this.gridCellPadding||(this.gridCellPadding=new Ge),this.gridCellPadding=t},enumerable:!0,configurable:!0}),e}(Li),ki=function(){function t(){}return Object.defineProperty(t.prototype,"backgroundBrush",{get:function(){return this.gridRowBackgroundBrush},enumerable:!0,configurable:!0}),t.prototype.setBackgroundBrush=function(t){if(this.gridRowBackgroundBrush=t,void 0!==this.parent)for(var e=0;e<this.parent.cells.count;e++)this.parent.cells.getCell(e).style.backgroundBrush=t},Object.defineProperty(t.prototype,"textBrush",{get:function(){return this.gridRowTextBrush},enumerable:!0,configurable:!0}),t.prototype.setTextBrush=function(t){if(this.gridRowTextBrush=t,void 0!==this.parent)for(var e=0;e<this.parent.cells.count;e++)this.parent.cells.getCell(e).style.textBrush=t},Object.defineProperty(t.prototype,"textPen",{get:function(){return this.gridRowTextPen},enumerable:!0,configurable:!0}),t.prototype.setTextPen=function(t){if(this.gridRowTextPen=t,void 0!==this.parent)for(var e=0;e<this.parent.cells.count;e++)this.parent.cells.getCell(e).style.textPen=t},Object.defineProperty(t.prototype,"font",{get:function(){return this.gridRowFont},enumerable:!0,configurable:!0}),t.prototype.setFont=function(t){if(this.gridRowFont=t,void 0!==this.parent)for(var e=0;e<this.parent.cells.count;e++)this.parent.cells.getCell(e).style.font=t},Object.defineProperty(t.prototype,"border",{get:function(){return void 0===this.gridRowBorder&&this.setBorder(new Ee),this.gridRowBorder},enumerable:!0,configurable:!0}),t.prototype.setBorder=function(t){if(this.gridRowBorder=t,void 0!==this.parent)for(var e=0;e<this.parent.cells.count;e++)this.parent.cells.getCell(e).style.borders=t},t.prototype.setParent=function(t){this.parent=t},Object.defineProperty(t.prototype,"backgroundImage",{get:function(){return this.gridRowBackgroundImage},enumerable:!0,configurable:!0}),t.prototype.setBackgroundImage=function(t){this.gridRowBackgroundImage=t},t}();!function(t){t[t.NextPage=0]="NextPage",t[t.LastPage=1]="LastPage"}(t.PdfHorizontalOverflowType||(t.PdfHorizontalOverflowType={}));var Vi=function(){function e(t){this.cellWidth=0,this.cellHeight=0,this.tempval=0,this.fontSpilt=!1,this.finsh=!0,this.rowSpanRemainingHeight=0,this.hasRowSpan=!1,this.hasColSpan=!1,this.isFinish=!0,this.present=!1,this.gridRowSpan=1,this.colSpan=1,void 0!==t&&(this.gridRow=t)}return Object.defineProperty(e.prototype,"isCellMergeContinue",{get:function(){return this.internalIsCellMergeContinue},set:function(t){this.internalIsCellMergeContinue=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isRowMergeContinue",{get:function(){return this.internalIsRowMergeContinue},set:function(t){this.internalIsRowMergeContinue=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isCellMergeStart",{get:function(){return this.internalIsCellMergeStart},set:function(t){this.internalIsCellMergeStart=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isRowMergeStart",{get:function(){return this.internalIsRowMergeStart},set:function(t){this.internalIsRowMergeStart=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"remainingString",{get:function(){return this.remaining},set:function(t){this.remaining=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"FinishedDrawingCell",{get:function(){return this.isFinish},set:function(t){this.isFinish=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"stringFormat",{get:function(){return null==this.format&&(this.format=new N),this.format},set:function(t){this.format=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"row",{get:function(){return this.gridRow},set:function(t){this.gridRow=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.objectValue},set:function(t){if(this.objectValue=t,this.objectValue instanceof Ei){this.row.grid.isSingleGrid=!1;this.objectValue.ParentCell=this,this.objectValue.isChildGrid=!0;for(var e=this.row.grid.rows.count,i=0;i<e;i++)for(var r=this.row.grid.rows.getRow(i),n=r.cells.count,o=0;o<n;o++){r.cells.getCell(o).parent=this}}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rowSpan",{get:function(){return this.gridRowSpan},set:function(t){if(t<1)throw new Error("ArgumentException : Invalid span specified, must be greater than or equal to 1");this.gridRowSpan=t,this.row.rowSpanExists=!0,this.row.grid.hasRowSpanSpan=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"style",{get:function(){return null==this.cellStyle&&(this.cellStyle=new ji),this.cellStyle},set:function(t){this.cellStyle=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return 0===this.cellHeight&&(this.cellHeight=this.measureHeight()),this.cellHeight},set:function(t){this.cellHeight=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"columnSpan",{get:function(){return this.colSpan},set:function(t){if(t<1)throw Error("Invalid span specified, must be greater than or equal to 1");this.colSpan=t,this.row.columnSpanExists=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return(0===this.cellWidth||this.row.grid.isComplete)&&(this.cellWidth=this.measureWidth()),Math.round(this.cellWidth)},set:function(t){this.cellWidth=t},enumerable:!0,configurable:!0}),e.prototype.measureWidth=function(){var t=0,e=new I;if("string"==typeof this.objectValue){t+=e.layout(this.objectValue,this.getTextFont(),this.stringFormat,new j(Number.MAX_VALUE,Number.MAX_VALUE),!1,new j(0,0)).actualSize.width,t+=2*(this.style.borders.left.width+this.style.borders.right.width)}else if(this.objectValue instanceof Ei)t=this.objectValue.size.width;else if(this.objectValue instanceof gt||this.objectValue instanceof yt)t+=this.objectValue.width;else if(this.objectValue instanceof Ze){var i=this.objectValue;t+=e.layout(i.text,i.font,i.stringFormat,new j(0,0),!1,new j(0,0)).actualSize.width,t+=2*(this.style.borders.left.width+this.style.borders.right.width)}return this.objectValue instanceof Ei?null!=this.style.cellPadding||void 0!==this.style.cellPadding?(void 0!==this.style.cellPadding.left&&this.style.cellPadding.hasLeftPad&&(t+=this.style.cellPadding.left),void 0!==this.style.cellPadding.right&&this.style.cellPadding.hasRightPad&&(t+=this.style.cellPadding.right)):(void 0!==this.row.grid.style.cellPadding.left&&this.row.grid.style.cellPadding.hasLeftPad&&(t+=this.row.grid.style.cellPadding.left),void 0!==this.row.grid.style.cellPadding.right&&this.row.grid.style.cellPadding.hasRightPad&&(t+=this.row.grid.style.cellPadding.right)):null!=this.style.cellPadding?t+=this.style.cellPadding.left+this.style.cellPadding.right:t+=this.row.grid.style.cellPadding.left+this.row.grid.style.cellPadding.right,t+=this.row.grid.style.cellSpacing},e.prototype.drawCellBackground=function(t,e){var i=this.getBackgroundBrush();if(null!=i&&(t.save(),t.drawRectangle(i,e.x,e.y,e.width,e.height),t.restore()),null!=this.style.backgroundImage){this.getBackgroundImage();t.drawImage(this.style.backgroundImage,e.x,e.y,e.width,e.height)}},e.prototype.adjustContentLayoutArea=function(t){var e=new k(t.x,t.y,t.width,t.height);return this.objectValue instanceof Ei?(null==this.style.cellPadding||void 0===this.style.cellPadding?(void 0!==this.gridRow.grid.style.cellPadding.left&&this.gridRow.grid.style.cellPadding.hasLeftPad&&(e.x+=this.gridRow.grid.style.cellPadding.left+this.cellStyle.borders.left.width,e.width-=this.gridRow.grid.style.cellPadding.left),void 0!==this.gridRow.grid.style.cellPadding.top&&this.gridRow.grid.style.cellPadding.hasTopPad&&(e.y+=this.gridRow.grid.style.cellPadding.top+this.cellStyle.borders.top.width,e.height-=this.gridRow.grid.style.cellPadding.top),void 0!==this.gridRow.grid.style.cellPadding.right&&this.gridRow.grid.style.cellPadding.hasRightPad&&(e.width-=this.gridRow.grid.style.cellPadding.right),void 0!==this.gridRow.grid.style.cellPadding.bottom&&this.gridRow.grid.style.cellPadding.hasBottomPad&&(e.height-=this.gridRow.grid.style.cellPadding.bottom)):(void 0!==this.style.cellPadding.left&&this.style.cellPadding.hasLeftPad&&(e.x+=this.style.cellPadding.left+this.cellStyle.borders.left.width,e.width-=this.style.cellPadding.left),void 0!==this.style.cellPadding.top&&this.style.cellPadding.hasTopPad&&(e.y+=this.style.cellPadding.top+this.cellStyle.borders.top.width,e.height-=this.style.cellPadding.top),void 0!==this.style.cellPadding.right&&this.style.cellPadding.hasRightPad&&(e.width-=this.style.cellPadding.right),void 0!==this.style.cellPadding.bottom&&this.style.cellPadding.hasBottomPad&&(e.height-=this.style.cellPadding.bottom)),e.width-=this.cellStyle.borders.left.width+this.cellStyle.borders.right.width,e.height-=this.cellStyle.borders.top.width+this.cellStyle.borders.bottom.width):void 0===this.style.cellPadding||null==this.style.cellPadding?(e.x+=this.gridRow.grid.style.cellPadding.left+this.cellStyle.borders.left.width,e.y+=this.gridRow.grid.style.cellPadding.top+this.cellStyle.borders.top.width,e.width-=this.gridRow.grid.style.cellPadding.right+this.gridRow.grid.style.cellPadding.left,e.height-=this.gridRow.grid.style.cellPadding.bottom+this.gridRow.grid.style.cellPadding.top,e.height-=this.cellStyle.borders.top.width+this.cellStyle.borders.bottom.width):(e.x+=this.style.cellPadding.left+this.cellStyle.borders.left.width,e.y+=this.style.cellPadding.top+this.cellStyle.borders.top.width,e.width-=this.style.cellPadding.right+this.style.cellPadding.left,e.width-=this.cellStyle.borders.left.width+this.cellStyle.borders.right.width,e.height-=this.style.cellPadding.bottom+this.style.cellPadding.top,e.height-=this.cellStyle.borders.top.width+this.cellStyle.borders.bottom.width,1===this.rowSpan&&(e.width-=this.style.borders.left.width)),e},e.prototype.draw=function(e,i,r){var n=null;if(this.internalIsCellMergeContinue||this.internalIsRowMergeContinue){if(!this.internalIsCellMergeContinue||!this.row.grid.style.allowHorizontalOverflow)return n;if(this.row.rowOverflowIndex>0&&this.row.cells.indexOf(this)!=this.row.rowOverflowIndex+1||0==this.row.rowOverflowIndex&&this.internalIsCellMergeContinue)return n}i=this.adjustOuterLayoutArea(i,e),this.drawCellBackground(e,i);var o=this.getTextPen(),s=this.getTextBrush();void 0===o&&void 0===s&&(s=new D(new L(0,0,0)));var a=this.getTextFont(),h=this.getStringFormat(),l=i;if(l.height>=e.clientSize.height&&this.row.grid.allowRowBreakAcrossPages&&(l.height-=l.y,void 0!==this._rowHeight&&null!==this._rowHeight&&l.height>this._rowHeight&&(l.height=this._rowHeight)),l=this.adjustContentLayoutArea(l),"string"==typeof this.objectValue||"string"==typeof this.remaining){var u=void 0,c=void 0;if(c=l.height<a.height?new k(l.x,l.y,l.width,a.height):l,l.height<a.height&&this.row.grid.isChildGrid&&null!=this.row.grid.ParentCell){var p=c.height-this.row.grid.ParentCell.row.grid.style.cellPadding.bottom-this.row.grid.style.cellPadding.bottom;-1!=this.row.grid.splitChildRowIndex&&(this.fontSpilt=!0,this.row.rowFontSplit=!0),p>0&&p<a.height&&(c.height=p)}0!=this.gridRow.grid.style.cellSpacing&&(c.width-=this.gridRow.grid.style.cellSpacing,i.width-=this.gridRow.grid.style.cellSpacing),this.isFinish?(u=""===this.remaining?this.remaining:this.objectValue,e.drawString(u,a,o,s,c.x,c.y,c.width,c.height,h),-1==this.row.grid.splitChildRowIndex||this.row.grid.isChildGrid||void 0!==this.remaining||(this.remaining="")):(void 0!==this.remaining&&null!==this.remaining||(this.remaining=""),this.row.repeatFlag&&e.drawString(this.remaining,a,o,s,c.x,c.y,c.width,c.height,h),this.isFinish=!0),n=e.stringLayoutResult}else if(this.objectValue instanceof Ei){var d=this.objectValue;d.isChildGrid=!0,d.ParentCell=this;var f=void 0;f=l,0!=this.gridRow.grid.style.cellSpacing&&(i.width-=this.gridRow.grid.style.cellSpacing);var g=new zi(d),m=new _i;null!=this.row.grid.LayoutFormat?m=this.row.grid.LayoutFormat:m.layout=t.PdfLayoutType.Paginate;var y=new Ie;if(null!=e.layer){y.page=e.page,y.bounds=f,y.format=m,d.setSpan(),d.checkSpan();var b=g.Layouter(y);this.value=d,-1!==this.row.grid.splitChildRowIndex&&(this.height=this.row.rowBreakHeightValue),y.page!=b.page&&(null!==this.row.rowBreakHeightValue&&void 0!==this.row.rowBreakHeightValue&&(b.bounds.height=this.row.rowBreakHeightValue),0==this.row.rowBreakHeight?this.row.NestedGridLayoutResult=b:this.row.rowBreakHeight=this.row.rowBreakHeightValue)}}else if(this.objectValue instanceof gt||this.objectValue instanceof yt){var w=void 0;w=this.objectValue.width<=l.width?new k(l.x,l.y,this.objectValue.width,l.height):l,e.drawImage(this.objectValue,w.x,w.y,w.width,w.height)}else this.objectValue instanceof Ze?this.objectValue.draw(e.currentPage,l):void 0===this.objectValue&&(this.objectValue="",e.drawString(this.objectValue,a,o,s,l.x,l.y,l.width,l.height,h),null!=this.style.cellPadding&&0==this.style.cellPadding.bottom&&0==this.style.cellPadding.left&&0==this.style.cellPadding.right&&0==this.style.cellPadding.top&&(i.width-=this.style.borders.left.width+this.style.borders.right.width),0!=this.gridRow.grid.style.cellSpacing&&(i.width-=this.gridRow.grid.style.cellSpacing));return null!=this.style.borders&&(this.fontSpilt?-1!=this.row.grid.ParentCell.row.grid.splitChildRowIndex&&(this.row.rowFontSplit=!1,this.drawCellBorders(e,i)):this.drawCellBorders(e,i)),n},e.prototype.drawCellBorders=function(e,i){this.row.grid.style.borderOverlapStyle===t.PdfBorderOverlapStyle.Inside&&(i.x+=this.style.borders.left.width,i.y+=this.style.borders.top.width,i.width-=this.style.borders.right.width,i.height-=this.style.borders.bottom.width);var r=new T(i.x,i.y+i.height),n=new T(i.x,i.y),o=this.cellStyle.borders.left;this.cellStyle.borders.left.dashStyle===t.PdfDashStyle.Solid&&(o.lineCap=t.PdfLineCap.Square),0!==o.width&&e.drawLine(o,r,n),r=new T(i.x+i.width,i.y),n=new T(i.x+i.width,i.y+i.height),o=this.cellStyle.borders.right,i.x+i.width>e.clientSize.width-o.width/2&&(r=new T(e.clientSize.width-o.width/2,i.y),n=new T(e.clientSize.width-o.width/2,i.y+i.height)),this.cellStyle.borders.right.dashStyle===t.PdfDashStyle.Solid&&(o.lineCap=t.PdfLineCap.Square),0!==o.width&&e.drawLine(o,r,n),r=new T(i.x,i.y),n=new T(i.x+i.width,i.y),o=this.cellStyle.borders.top,this.cellStyle.borders.top.dashStyle===t.PdfDashStyle.Solid&&(o.lineCap=t.PdfLineCap.Square),0!==o.width&&e.drawLine(o,r,n),r=new T(i.x+i.width,i.y+i.height),n=new T(i.x,i.y+i.height),o=this.cellStyle.borders.bottom,i.y+i.height>e.clientSize.height-o.width/2&&(r=new T(i.x+i.width,e.clientSize.height-o.width/2),n=new T(i.x,e.clientSize.height-o.width/2)),this.cellStyle.borders.bottom.dashStyle===t.PdfDashStyle.Solid&&(o.lineCap=t.PdfLineCap.Square),0!==o.width&&e.drawLine(o,r,n)},e.prototype.adjustOuterLayoutArea=function(t,e){var i=!1,r=this.row.grid.style.cellSpacing;r>0&&(t=new k(t.x+r,t.y+r,t.width-r,t.height-r));var n=this.row.cells.indexOf(this);if(this.columnSpan>1||this.row.rowOverflowIndex>0&&n==this.row.rowOverflowIndex+1&&this.isCellMergeContinue){if(1==(l=this.columnSpan)&&this.isCellMergeContinue)for(var o=n+1;o<this.row.grid.columns.count&&this.row.cells.getCell(o).isCellMergeContinue;o++)l++;for(var s=0,a=n;a<n+l;a++){if(this.row.grid.style.allowHorizontalOverflow){var h=this.row.grid.size.width<e.clientSize.width?this.row.grid.size.width:e.clientSize.width;if((this.row.grid.size.width>e.clientSize.width?t.x+s+this.row.grid.columns.getColumn(a).width:s+this.row.grid.columns.getColumn(a).width)>h)break}s+=this.row.grid.columns.getColumn(a).width}s-=this.row.grid.style.cellSpacing,t.width=s}if(this.rowSpan>1||this.row.rowSpanExists){var l=this.rowSpan,u=this.row.grid.rows.rowCollection.indexOf(this.row);-1==u&&-1!=(u=this.row.grid.headers.indexOf(this.row))&&(i=!0);var c=0;for(a=u;a<u+l;a++){c+=i?this.row.grid.headers.getHeader(a).height:this.row.grid.rows.getRow(a).height;var p=this.row.grid.rows.getRow(a);this.row.grid.rows.rowCollection.indexOf(p)}this.row.cells.indexOf(this);c-=this.row.grid.style.cellSpacing,t.height=c,this.row.rowMergeComplete||(t.height=c)}return t},e.prototype.getTextFont=function(){return void 0!==this.style.font&&null!=this.style.font?this.style.font:void 0!==this.row.style.font&&null!=this.row.style.font?this.row.style.font:void 0!==this.row.grid.style.font&&null!=this.row.grid.style.font?this.row.grid.style.font:Be.defaultFont},e.prototype.getTextBrush=function(){return void 0!==this.style.textBrush&&null!=this.style.textBrush?this.style.textBrush:void 0!==this.row.style.textBrush&&null!=this.row.style.textBrush?this.row.style.textBrush:this.row.grid.style.textBrush},e.prototype.getTextPen=function(){return void 0!==this.style.textPen&&null!=this.style.textPen?this.style.textPen:void 0!==this.row.style.textPen&&null!=this.row.style.textPen?this.row.style.textPen:this.row.grid.style.textPen},e.prototype.getBackgroundBrush=function(){return void 0!==this.style.backgroundBrush&&null!=this.style.backgroundBrush?this.style.backgroundBrush:void 0!==this.row.style.backgroundBrush&&null!=this.row.style.backgroundBrush?this.row.style.backgroundBrush:this.row.grid.style.backgroundBrush},e.prototype.getBackgroundImage=function(){return void 0!==this.style.backgroundImage&&null!=this.style.backgroundImage?this.style.backgroundImage:void 0!==this.row.style.backgroundImage&&null!=this.row.style.backgroundImage?this.row.style.backgroundImage:this.row.grid.style.backgroundImage},e.prototype.getStringFormat=function(){return void 0!==this.style.stringFormat&&null!=this.style.stringFormat?this.style.stringFormat:this.stringFormat},e.prototype.measureHeight=function(){var t=this.calculateWidth();null==this.style.cellPadding||void 0===this.style.cellPadding?t-=this.gridRow.grid.style.cellPadding.right+this.gridRow.grid.style.cellPadding.left:(t-=this.style.cellPadding.right+this.style.cellPadding.left,t-=this.style.borders.left.width+this.style.borders.right.width);var e=0,i=new I;if("string"==typeof this.objectValue||"string"==typeof this.remaining){var r=this.objectValue;this.isFinish||(r=null!==this.remaining&&""!==this.remaining&&void 0!==this.remaining?this.remaining:this.objectValue);var n=this.row.cells.indexOf(this);0!=this.gridRow.grid.style.cellSpacing&&(t-=2*this.gridRow.grid.style.cellSpacing),this.row.cells.getCell(n).hasColSpan||this.row.cells.getCell(n).hasRowSpan||(this.gridRow.grid.isChildGrid?(t<0?(this.tempval=t,null==this.style.cellPadding||void 0===this.style.cellPadding?this.tempval+=this.gridRow.grid.style.cellPadding.right+this.gridRow.grid.style.cellPadding.left:(this.tempval+=this.style.cellPadding.right+this.style.cellPadding.left,this.tempval+=this.style.borders.left.width+this.style.borders.right.width)):this.tempval=t,e+=i.layout(r,this.getTextFont(),this.stringFormat,new j(this.tempval,0),!1,new j(0,0)).actualSize.height):e+=i.layout(r,this.getTextFont(),this.stringFormat,new j(t,0),!1,new j(0,0)).actualSize.height),e+=2*(this.style.borders.top.width+this.style.borders.bottom.width)}else if(this.objectValue instanceof Ei){n=this.row.cells.indexOf(this);var o=0;null!=this.style.cellPadding||void 0!==this.style.cellPadding?(o=this.calculateWidth(),void 0!==this.style.cellPadding.left&&this.style.cellPadding.hasLeftPad&&(o-=this.style.cellPadding.left),void 0!==this.style.cellPadding.right&&this.style.cellPadding.hasRightPad&&(o-=this.style.cellPadding.right)):null!=this.row.grid.style.cellPadding||void 0!==this.row.grid.style.cellPadding?(o=this.calculateWidth(),void 0!==this.row.grid.style.cellPadding.left&&this.row.grid.style.cellPadding.hasLeftPad&&(o-=this.row.grid.style.cellPadding.left),void 0!==this.row.grid.style.cellPadding.right&&this.row.grid.style.cellPadding.hasRightPad&&(o-=this.row.grid.style.cellPadding.right)):o=this.calculateWidth(),this.objectValue.tempWidth=o,this.row.cells.getCell(n).hasColSpan||this.row.cells.getCell(n).hasRowSpan?e+=2*(this.style.borders.top.width+this.style.borders.bottom.width):e=this.objectValue.size.height,0!==this.gridRow.grid.style.cellSpacing&&(t-=2*this.gridRow.grid.style.cellSpacing),null==this.style.cellPadding&&void 0===this.style.cellPadding||(void 0!==this.row.grid.style.cellPadding.top&&this.row.grid.style.cellPadding.hasTopPad&&(e+=this.row.grid.style.cellPadding.top),this.row.grid.style.cellPadding.hasBottomPad&&void 0!==this.row.grid.style.cellPadding.bottom&&(e+=this.row.grid.style.cellPadding.bottom)),e+=this.objectValue.style.cellSpacing}else if(this.objectValue instanceof gt||this.objectValue instanceof yt)e+=this.objectValue.height;else if(this.objectValue instanceof Ze){var s=this.objectValue;e+=i.layout(s.text,s.font,s.stringFormat,new j(t,0),!1,new j(0,0)).actualSize.height,e+=2*(this.style.borders.top.width+this.style.borders.bottom.width)}else void 0===this.objectValue&&(null==this.style.cellPadding||void 0===this.style.cellPadding?t-=this.gridRow.grid.style.cellPadding.right+this.gridRow.grid.style.cellPadding.left:(t-=this.style.cellPadding.right+this.style.cellPadding.left,t-=this.style.borders.left.width+this.style.borders.right.width),e+=2*(this.style.borders.top.width+this.style.borders.bottom.width));return this.objectValue instanceof Ei?null==this.style.cellPadding||void 0===this.style.cellPadding?(void 0!==this.row.grid.style.cellPadding.top&&this.row.grid.style.cellPadding.hasTopPad&&(e+=this.row.grid.style.cellPadding.top),void 0!==this.row.grid.style.cellPadding.bottom&&this.row.grid.style.cellPadding.hasBottomPad&&(e+=this.row.grid.style.cellPadding.bottom)):(void 0!==this.style.cellPadding.top&&this.style.cellPadding.hasTopPad&&(e+=this.style.cellPadding.top),void 0!==this.style.cellPadding.bottom&&this.style.cellPadding.hasBottomPad&&(e+=this.style.cellPadding.bottom)):null==this.style.cellPadding||void 0===this.style.cellPadding?e+=this.row.grid.style.cellPadding.top+this.row.grid.style.cellPadding.bottom:e+=this.style.cellPadding.top+this.style.cellPadding.bottom,e+=this.row.grid.style.cellSpacing},e.prototype.calculateWidth=function(){var t=this.row.cells.indexOf(this),e=(this.row.grid.rows.rowCollection.indexOf(this.row),this.columnSpan),i=0;if(1===e)for(var r=0;r<e;r++)i+=this.row.grid.columns.getColumn(t+r).width;else if(e>1)for(r=0;r<e;r++)i+=this.row.grid.columns.getColumn(t+r).width,r+1<e&&(this.row.cells.getCell(t+r+1).hasColSpan=!0);if(null!=this.parent&&this.parent.row.width>0&&this.row.grid.isChildGrid&&null!=this.parent&&this.row.width>this.parent.row.width){i=0;for(var n=0;n<this.parent.columnSpan;n++)i+=this.parent.row.grid.columns.getColumn(n).width;i/=this.row.cells.count}return i},e}(),Ri=function(){function t(t){this.cells=[],this.gridRow=t}return t.prototype.getCell=function(t){if(t<0||t>=this.count)throw new Error("IndexOutOfRangeException");return this.cells[t]},Object.defineProperty(t.prototype,"count",{get:function(){return this.cells.length},enumerable:!0,configurable:!0}),t.prototype.add=function(t){if(void 0===t){var e=new Vi;return this.add(e),t}t.row=this.gridRow,this.cells.push(t)},t.prototype.indexOf=function(t){return this.cells.indexOf(t)},t}(),Mi=function(){function t(t){this.columnWidth=0,this.grid=t}return Object.defineProperty(t.prototype,"width",{get:function(){return this.columnWidth},set:function(t){this.isCustomWidth=!0,this.columnWidth=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"format",{get:function(){return null==this.stringFormat&&(this.stringFormat=new N),this.stringFormat},set:function(t){this.stringFormat=t},enumerable:!0,configurable:!0}),t}(),Di=function(){function t(t){this.internalColumns=[],this.columnWidth=0,this.grid=t,this.internalColumns=[]}return t.prototype.add=function(t){for(var e=0;e<t;e++){this.internalColumns.push(new Mi(this.grid));for(var i=0;i<this.grid.rows.count;i++){var r=this.grid.rows.getRow(i),n=new Vi;n.value="",r.cells.add(n)}}},Object.defineProperty(t.prototype,"count",{get:function(){return this.internalColumns.length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return 0===this.columnWidth&&(this.columnWidth=this.measureColumnsWidth()),0===this.grid.initialWidth||this.columnWidth===this.grid.initialWidth||this.grid.style.allowHorizontalOverflow||(this.columnWidth=this.grid.initialWidth,this.grid.isPageWidth=!0),this.columnWidth},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"columns",{get:function(){return this.internalColumns},enumerable:!0,configurable:!0}),t.prototype.getColumn=function(t){if(t>=0&&t<=this.columns.length)return this.columns[t];throw Error("can not get the column from the index: "+t)},t.prototype.measureColumnsWidth=function(){var t=0;this.grid.measureColumnsWidth();for(var e=0,i=this.internalColumns.length;e<i;e++)t+=this.internalColumns[e].width;return t},t.prototype.getDefaultWidths=function(t){for(var e=[],i=this.count,r=0;r<this.count;r++)this.grid.isPageWidth&&t>=0&&!this.internalColumns[r].isCustomWidth?this.internalColumns[r].width=0:(e[r]=this.internalColumns[r].width,this.internalColumns[r].width>0&&this.internalColumns[r].isCustomWidth?(t-=this.internalColumns[r].width,i--):e[r]=0);for(r=0;r<this.count;r++){var n=t/i;e[r]<=0&&(e[r]=n)}return e},t}(),Ni=function(){function t(t){this.gridRowOverflowIndex=0,this.rowHeight=0,this.rowWidth=0,this.isrowFinish=!1,this.isRowSpanRowHeightSet=!1,this.noOfPageCount=0,this.isRowHeightSet=!1,this.isPageBreakRowSpanApplied=!1,this.isRowMergeComplete=!0,this.repeatFlag=!1,this.rowFontSplit=!1,this.isHeaderRow=!1,this.pdfGrid=t}return Object.defineProperty(t.prototype,"rowSpanExists",{get:function(){return this.bRowSpanExists},set:function(t){this.bRowSpanExists=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"cells",{get:function(){return null==this.gridCells&&(this.gridCells=new Ri(this)),this.gridCells},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"grid",{get:function(){return this.pdfGrid},set:function(t){this.pdfGrid=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"style",{get:function(){return void 0===this.rowStyle&&(this.rowStyle=new ki,this.rowStyle.setParent(this)),this.rowStyle},set:function(t){this.rowStyle=t;for(var e=0;e<this.cells.count;e++)this.cells.getCell(e).style.borders=t.border,void 0!==t.font&&(this.cells.getCell(e).style.font=t.font),void 0!==t.backgroundBrush&&(this.cells.getCell(e).style.backgroundBrush=t.backgroundBrush),void 0!==t.backgroundImage&&(this.cells.getCell(e).style.backgroundImage=t.backgroundImage),void 0!==t.textBrush&&(this.cells.getCell(e).style.textBrush=t.textBrush),void 0!==t.textPen&&(this.cells.getCell(e).style.textPen=t.textPen)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rowBreakHeight",{get:function(){return void 0===this.gridRowBreakHeight&&(this.gridRowBreakHeight=0),this.gridRowBreakHeight},set:function(t){this.gridRowBreakHeight=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rowOverflowIndex",{get:function(){return this.gridRowOverflowIndex},set:function(t){this.gridRowOverflowIndex=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.isRowHeightSet||(this.rowHeight=this.measureHeight()),this.rowHeight},set:function(t){this.rowHeight=t,this.isRowHeightSet=!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return 0!==this.rowWidth&&void 0!==this.rowWidth||(this.rowWidth=this.measureWidth()),this.rowWidth},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"NestedGridLayoutResult",{get:function(){return this.gridResult},set:function(t){this.gridResult=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"columnSpanExists",{get:function(){return this.bColumnSpanExists},set:function(t){this.bColumnSpanExists=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rowMergeComplete",{get:function(){return this.isRowMergeComplete},set:function(t){this.isRowMergeComplete=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rowIndex",{get:function(){return this.grid.rows.rowCollection.indexOf(this)},enumerable:!0,configurable:!0}),t.prototype.measureHeight=function(){var t,e=0,i=0;t=this.cells.getCell(0).rowSpan>1?0:this.cells.getCell(0).height;for(var r=0;r<this.cells.count;r++){var n=this.cells.getCell(r);if(n.rowSpanRemainingHeight>e&&(e=n.rowSpanRemainingHeight),this.rowMergeComplete=!1,n.rowSpan>1){for(var o=r,s=this.isHeaderRow?this.grid.headers.indexOf(this):this.grid.rows.rowCollection.indexOf(this),a=0;a<n.rowSpan;a++)a+1<n.rowSpan&&((this.isHeaderRow?this.grid.headers.getHeader(s+a+1):this.grid.rows.getRow(s+a+1)).cells.getCell(o).hasRowSpan=!0);i<n.height&&(i=n.height)}else t=Math.max(t,n.height)}return i>t&&(t=i),0===t?t=i:e>0&&(t+=e),t},t.prototype.measureWidth=function(){for(var t=0,e=0;e<this.grid.columns.count;e++){t+=this.grid.columns.getColumn(e).width}return t},t}(),Ai=function(){function t(t){this.rows=[],this.grid=t}return Object.defineProperty(t.prototype,"count",{get:function(){return this.rows.length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rowCollection",{get:function(){return this.rows},enumerable:!0,configurable:!0}),t.prototype.addRow=function(t){if(void 0===t){var e=new Ni(this.grid);return this.addRow(e),e}if(t.style.setBackgroundBrush(this.grid.style.backgroundBrush),t.style.setFont(this.grid.style.font),t.style.setTextBrush(this.grid.style.textBrush),t.style.setTextPen(this.grid.style.textPen),0===t.cells.count)for(var i=0;i<this.grid.columns.count;i++)t.cells.add(new Vi);this.rows.push(t)},t.prototype.getRow=function(t){return this.rows[t]},t}(),Ii=function(){function t(t){this.rows=[],this.grid=t,this.rows=[]}return t.prototype.getHeader=function(t){return this.rows[t]},Object.defineProperty(t.prototype,"count",{get:function(){return this.rows.length},enumerable:!0,configurable:!0}),t.prototype.add=function(t){if("number"==typeof t){for(var e=void 0,i=0;i<t;i++){(e=new Ni(this.grid)).isHeaderRow=!0;for(var r=0;r<this.grid.columns.count;r++)e.cells.add(new Vi);this.rows.push(e)}return this.rows}this.rows.push(t)},t.prototype.indexOf=function(t){return this.rows.indexOf(t)},t}(),Fi=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ei=function(t){function e(){var e=t.call(this)||this;return e.gridSize=new j(0,0),e.isGridSplit=!1,e.isRearranged=!1,e.pageBounds=new k,e.listOfNavigatePages=[],e.parentCellIndex=0,e.tempWidth=0,e.breakRow=!0,e.splitChildRowIndex=-1,e.hasRowSpanSpan=!1,e.hasColumnSpan=!1,e.isSingleGrid=!0,e}return Fi(e,t),Object.defineProperty(e.prototype,"raiseBeginCellDraw",{get:function(){return void 0!==this.beginCellDraw&&null!==typeof this.beginCellDraw},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"raiseEndCellDraw",{get:function(){return void 0!==this.endCellDraw&&null!==typeof this.endCellDraw},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"repeatHeader",{get:function(){return null!=this.bRepeatHeader&&void 0!==this.bRepeatHeader||(this.bRepeatHeader=!1),this.bRepeatHeader},set:function(t){this.bRepeatHeader=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"allowRowBreakAcrossPages",{get:function(){return this.breakRow},set:function(t){this.breakRow=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"columns",{get:function(){return null!=this.gridColumns&&void 0!==this.gridColumns||(this.gridColumns=new Di(this)),this.gridColumns},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rows",{get:function(){return null==this.gridRows&&(this.gridRows=new Ai(this)),this.gridRows},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"headers",{get:function(){return null!=this.gridHeaders&&void 0!==this.gridHeaders||(this.gridHeaders=new Ii(this)),this.gridHeaders},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"initialWidth",{get:function(){return this.gridInitialWidth},set:function(t){this.gridInitialWidth=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"style",{get:function(){return null==this.gridStyle&&(this.gridStyle=new Ti),this.gridStyle},set:function(t){null==this.gridStyle&&(this.gridStyle=t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isPageWidth",{get:function(){return this.ispageWidth},set:function(t){this.ispageWidth=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isChildGrid",{get:function(){return this.ischildGrid},set:function(t){this.ischildGrid=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return 0!==this.gridSize.width&&void 0!==this.gridSize.width||0!==this.gridSize.height||(this.gridSize=this.measure()),this.gridSize},set:function(t){this.gridSize=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ParentCell",{get:function(){return this.parentCell},set:function(t){this.parentCell=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"LayoutFormat",{get:function(){return this.layoutFormat},enumerable:!0,configurable:!0}),e.prototype.draw=function(t,e,i,r){if(e instanceof T&&void 0===e.width&&void 0===i)return this.drawHelper(t,e.x,e.y);if("number"==typeof e&&"number"==typeof i&&void 0===r)return this.drawHelper(t,e,i,null);if(e instanceof k&&void 0!==e.width&&void 0===i)return this.drawHelper(t,e,null);if(e instanceof T&&void 0===e.width&&i instanceof Ae)return this.drawHelper(t,e.x,e.y,i);if("number"==typeof e&&"number"==typeof i&&(r instanceof Ae||null==r)){var n=t.graphics.clientSize.width-e,o=new k(e,i,n,0);return this.drawHelper(t,o,r)}return e instanceof k&&void 0!==e.width&&"boolean"==typeof i?this.drawHelper(t,e,null):this.drawHelper(t,e,i)},e.prototype.measure=function(){for(var t=0,e=this.columns.width,i=0;i<this.headers.count;i++){t+=this.headers.getHeader(i).height}for(i=0;i<this.rows.count;i++){t+=this.rows.getRow(i).height}return new j(e,t)},e.prototype.onBeginCellDraw=function(t){this.raiseBeginCellDraw&&this.beginCellDraw(this,t)},e.prototype.onEndCellDraw=function(t){this.raiseEndCellDraw&&this.endCellDraw(this,t)},e.prototype.layout=function(t){var e=t.bounds.width,i=t.bounds.height,r=!1;if(void 0!==t.bounds.width&&0!==t.bounds.width||(e=t.page.getClientSize().width-t.bounds.x,r=!0),void 0!==t.bounds.height&&0!==t.bounds.height||(i=t.page.getClientSize().height-t.bounds.y,r=!0),r&&(t.bounds=new k(t.bounds.x,t.bounds.y,e,i)),0!==this.rows.count){var n=this.rows.getRow(0).cells.getCell(0).style;if(null!=n.borders&&(null!=n.borders.left&&1!==n.borders.left.width||null!=n.borders.top&&1!==n.borders.top.width)){var o=n.borders.left.width/2,s=n.borders.top.width/2;if(t.bounds.x===Ee.default.right.width/2&&t.bounds.y===Ee.default.right.width/2){var a=new k(o,s,this.gridSize.width,this.gridSize.height);t.bounds=a}}}this.setSpan(),this.checkSpan(),this.layoutFormat=t.format,this.gridLocation=t.bounds;return new zi(this).Layouter(t)},e.prototype.setSpan=function(){for(var t=1,e=1,i=0,r=0,n=0,o=this.headers.count,s=0;s<o;s++){var a=this.headers.getHeader(s);n=0;for(var h=a.cells.count,l=0;l<h;l++){var u=a.cells.getCell(l);if(n=Math.max(n,u.rowSpan),!u.isCellMergeContinue&&!u.isRowMergeContinue&&(u.columnSpan>1||u.rowSpan>1)){if(u.columnSpan+l>a.cells.count)throw new Error("Invalid span specified at row "+l.toString()+" column "+s.toString());if(u.rowSpan+s>this.headers.count)throw new Error("Invalid span specified at Header "+l.toString()+" column "+s.toString());if(u.columnSpan>1&&u.rowSpan>1){for(t=u.columnSpan,e=u.rowSpan,i=l,r=s,u.isCellMergeStart=!0,u.isRowMergeStart=!0;t>1;)i++,a.cells.getCell(i).isCellMergeContinue=!0,a.cells.getCell(i).isRowMergeContinue=!0,a.cells.getCell(i).rowSpan=e,t--;for(i=l,t=u.columnSpan;e>1;){for(r++,this.headers.getHeader(r).cells.getCell(l).isRowMergeContinue=!0,this.headers.getHeader(r).cells.getCell(i).isRowMergeContinue=!0,e--;t>1;)i++,this.headers.getHeader(r).cells.getCell(i).isCellMergeContinue=!0,this.headers.getHeader(r).cells.getCell(i).isRowMergeContinue=!0,t--;t=u.columnSpan,i=l}}else if(u.columnSpan>1&&1===u.rowSpan)for(t=u.columnSpan,i=l,u.isCellMergeStart=!0;t>1;)i++,a.cells.getCell(i).isCellMergeContinue=!0,t--;else if(1===u.columnSpan&&u.rowSpan>1)for(e=u.rowSpan,r=s;e>1;)r++,this.headers.getHeader(r).cells.getCell(l).isRowMergeContinue=!0,e--}}a.maximumRowSpan=n}},e.prototype.checkSpan=function(){var t,e,i=1,r=0,n=0;if(t=i=1,e=n=0,this.hasRowSpanSpan||this.hasColumnSpan)for(var o=this.rows.count,s=0;s<o;s++){var a=this.rows.getRow(s);r=0;for(var h=a.cells.count,l=0;l<h;l++){var u=a.cells.getCell(l);if(r=Math.max(r,u.rowSpan),!u.isCellMergeContinue&&!u.isRowMergeContinue&&(u.columnSpan>1||u.rowSpan>1)){if(u.columnSpan+l>a.cells.count)throw new Error("Invalid span specified at row "+l.toString()+" column "+s.toString());if(u.rowSpan+s>this.rows.count)throw new Error("Invalid span specified at row "+l.toString()+" column "+s.toString());if(u.columnSpan>1&&u.rowSpan>1){for(t=u.columnSpan,i=u.rowSpan,e=l,n=s,u.isCellMergeStart=!0,u.isRowMergeStart=!0;t>1;)e++,a.cells.getCell(e).isCellMergeContinue=!0,a.cells.getCell(e).isRowMergeContinue=!0,t--;for(e=l,t=u.columnSpan;i>1;){for(n++,this.rows.getRow(n).cells.getCell(l).isRowMergeContinue=!0,this.rows.getRow(n).cells.getCell(e).isRowMergeContinue=!0,i--;t>1;)e++,this.rows.getRow(n).cells.getCell(e).isCellMergeContinue=!0,this.rows.getRow(n).cells.getCell(e).isRowMergeContinue=!0,t--;t=u.columnSpan,e=l}}else if(u.columnSpan>1&&1===u.rowSpan)for(t=u.columnSpan,e=l,u.isCellMergeStart=!0;t>1;)e++,a.cells.getCell(e).isCellMergeContinue=!0,t--;else if(1===u.columnSpan&&u.rowSpan>1)for(i=u.rowSpan,n=s;i>1;)n++,this.rows.getRow(n).cells.getCell(l).isRowMergeContinue=!0,i--}}a.maximumRowSpan=r}},e.prototype.measureColumnsWidth=function(t){if(void 0!==t){this.isPageWidth=!1;for(var e=this.columns.getDefaultWidths(t.width-t.x),i=0,r=this.columns.count;i<r;i++)this.columns.getColumn(i).columnWidth=e[i],this.tempWidth=e[i];if(null!=this.ParentCell&&0==this.style.allowHorizontalOverflow&&0==this.ParentCell.row.grid.style.allowHorizontalOverflow){var n=0,o=0,s=this.columns.count,a=0;null==this.ParentCell.style.cellPadding&&void 0===this.ParentCell.style.cellPadding||(void 0!==this.ParentCell.style.cellPadding.left&&this.ParentCell.style.cellPadding.hasLeftPad&&(n+=this.ParentCell.style.cellPadding.left),void 0!==this.ParentCell.style.cellPadding.right&&this.ParentCell.style.cellPadding.hasRightPad&&(n+=this.ParentCell.style.cellPadding.right));for(i=0;i<this.ParentCell.columnSpan;i++)o+=this.ParentCell.row.grid.columns.getColumn(this.parentCellIndex+i).width;for(var h=0;h<this.columns.count;h++)this.gridColumns.getColumn(h).width>0&&this.gridColumns.getColumn(h).isCustomWidth&&(o-=this.gridColumns.getColumn(h).width,s--);if(null==this.ParentCell.row.grid.style.cellPadding&&void 0===this.ParentCell.row.grid.style.cellPadding||(void 0!==this.ParentCell.row.grid.style.cellPadding.top&&this.ParentCell.row.grid.style.cellPadding.hasTopPad&&(n+=this.ParentCell.row.grid.style.cellPadding.top),void 0!==this.ParentCell.row.grid.style.cellPadding.bottom&&this.ParentCell.row.grid.style.cellPadding.hasBottomPad&&(n+=this.ParentCell.row.grid.style.cellPadding.bottom)),0!=this.ParentCell.row.grid.style.cellSpacing&&(o-=2*this.ParentCell.row.grid.style.cellSpacing),o>n&&(a=(o-n)/s,this.tempWidth=a,null!=this.ParentCell))for(h=0;h<this.columns.count;h++)this.columns.getColumn(h).isCustomWidth||(this.columns.getColumn(h).columnWidth=a)}}else{e=[this.columns.count];for(var l=0;l<this.columns.count;l++)e[l]=0;var u=0;if((void 0===this.isChildGrid&&void 0!==this.gridLocation||null===this.isChildGrid&&void 0!==this.gridLocation)&&(this.initialWidth=this.gridLocation.width),this.headers.count>0){var c=this.headers.getHeader(0).cells.count,p=this.headers.count;for(i=0;i<c;i++){u=0;for(h=0;h<p;h++){var d=Math.min(this.initialWidth,this.headers.getHeader(h).cells.getCell(i).width);u=Math.max(u,d)}e[i]=u}}u=0;i=0;for(var f=this.columns.count;i<f;i++){for(h=0,p=this.rows.count;h<p;h++)if(1==this.rows.getRow(h).cells.getCell(i).columnSpan&&!this.rows.getRow(h).cells.getCell(i).isCellMergeContinue||null!=this.rows.getRow(h).cells.getCell(i).value){if(null!=this.rows.getRow(h).cells.getCell(i).value&&!this.rows.getRow(h).grid.style.allowHorizontalOverflow)this.rows.getRow(h).grid.style.cellPadding.right,this.rows.getRow(h).grid.style.cellPadding.left,this.rows.getRow(h).cells.getCell(i).style.borders.left.width;d=0;d=this.initialWidth>0?Math.min(this.initialWidth,this.rows.getRow(h).cells.getCell(i).width):this.rows.getRow(h).cells.getCell(i).width,u=Math.max(e[i],Math.max(u,d)),u=Math.max(this.columns.getColumn(i).width,u)}0!=this.rows.count&&(e[i]=u),u=0}i=0;for(var g=this.rows.count;i<g;i++){h=0;for(var m=this.columns.count;h<m;h++)if(this.rows.getRow(i).cells.getCell(h).columnSpan>1){e[h];for(var y=1;y<this.rows.getRow(i).cells.getCell(h).columnSpan;y++)e[h+y]}}for(i=0,r=this.columns.count;i<r;i++)this.columns.getColumn(i).width<=0?this.columns.getColumn(i).columnWidth=e[i]:this.columns.getColumn(i).width>0&&!this.columns.getColumn(i).isCustomWidth&&(this.columns.getColumn(i).columnWidth=e[i]);n=0;var b=0,w=this.columns.count,P=0;b=this.tempWidth;for(h=0;h<this.columns.count;h++)this.gridColumns.getColumn(h).width>0&&this.gridColumns.getColumn(h).isCustomWidth&&(b-=this.gridColumns.getColumn(h).width,w--);if(b>0&&0!=this.ParentCell.row.grid.style.cellSpacing&&(b-=2*this.ParentCell.row.grid.style.cellSpacing),b>n&&(P=b/w,null!=this.ParentCell))for(h=0;h<this.columns.count;h++)this.columns.getColumn(h).isCustomWidth||(this.columns.getColumn(h).columnWidth=P)}},e}(ze),Gi=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),zi=function(e){function i(t){var i=e.call(this,t)||this;return i.gridInitialWidth=0,i.gridSize=new j(0,0),i.parentCellIndex=0,i.tempWidth=0,i.childheight=0,i.isChildGrid=!1,i.hasRowSpanSpan=!1,i.isRearranged=!1,i.pageBounds=new k,i.listOfNavigatePages=[],i.flag=!0,i.columnRanges=[],i.currentLocation=new T(0,0),i.breakRow=!0,i.slr=null,i.remainderText=null,i.isPaginate=!1,i.isOverloadWithPosition=!1,i}return Gi(i,e),Object.defineProperty(i.prototype,"Grid",{get:function(){return this.elements},enumerable:!0,configurable:!0}),i.prototype.getFormat=function(t){return t},i.prototype.layoutInternal=function(e){var i=this.getFormat(e.format);if(this.gridLayoutFormat=this.getFormat(e.format),this.currentPage=e.page,null===this.currentPage)throw Error("Can not set page as null");this.currentPage.getClientSize().height,this.currentPage.getClientSize().width;this.currentPageBounds=this.currentPage.getClientSize(),this.currentGraphics=this.currentPage.graphics;var r=0;if(r=this.currentGraphics.page.section.indexOf(this.currentGraphics.page),this.listOfNavigatePages.push(r),null!=i&&i.break===t.PdfLayoutBreakType.FitColumnsToPage?this.currentBounds=new k(new T(e.bounds.x,e.bounds.y),new j(this.Grid.columns.width,this.currentGraphics.clientSize.height)):this.currentBounds=new k(new T(e.bounds.x,e.bounds.y),this.currentGraphics.clientSize),0!==this.Grid.rows.count)this.currentBounds.width=e.bounds.width>0?e.bounds.width:this.currentBounds.width-this.Grid.rows.getRow(0).cells.getCell(0).style.borders.left.width/2;else{if(0===this.Grid.headers.count)throw Error("Please add row or header into grid");this.currentBounds.width=e.bounds.width}if(this.startLocation=new T(e.bounds.x,e.bounds.y),e.bounds.height>0&&!this.Grid.isChildGrid&&(this.currentBounds.height=e.bounds.height),this.Grid.isChildGrid||(this.hType=this.Grid.style.horizontalOverflowType),this.Grid.style.allowHorizontalOverflow?(this.Grid.measureColumnsWidth(),this.determineColumnDrawRanges()):(this.columnRanges=[],void 0!==this.Grid.isChildGrid&&(this.Grid.isChildGrid,1)?this.Grid.measureColumnsWidth(this.currentBounds):this.Grid.measureColumnsWidth(new k(this.currentBounds.x,this.currentBounds.y,this.currentBounds.x+this.currentBounds.width,this.currentBounds.height)),this.columnRanges.push([0,this.Grid.columns.count-1])),this.Grid.hasRowSpanSpan)for(var n=0;n<this.Grid.rows.count;n++)-1===this.Grid.rows.getRow(n).height||this.Grid.rows.getRow(n).isRowHeightSet||(this.Grid.rows.getRow(n).isRowHeightSet=!0);return this.layoutOnPage(e)},i.prototype.determineColumnDrawRanges=function(){for(var t=0,e=0,i=0,r=this.currentGraphics.clientSize.width-this.currentBounds.x,n=0;n<this.Grid.columns.count;n++)if((i+=this.Grid.columns.getColumn(n).width)>=r){for(var o=0,s=t;s<=n&&!((o+=this.Grid.columns.getColumn(s).width)>r);s++)e=s;this.columnRanges.push([t,e]),i=(e=t=e+1)<=n?this.Grid.columns.getColumn(n).width:0}this.columnRanges.push([t,this.Grid.columns.count-1])},i.prototype.layoutOnPage=function(e){this.pageBounds.x=e.bounds.x,this.pageBounds.y=e.bounds.y,this.pageBounds.height=e.bounds.height;for(var r=this.getFormat(e.format),n=null,o=new ot,s=e.page,a=[],h=0;h<this.columnRanges.length;h++){var l=this.columnRanges[h];this.cellStartIndex=l[0],this.cellEndIndex=l[1];var u=this.raiseBeforePageLayout(this.currentPage,this.currentBounds,this.currentRowIndex);this.currentBounds=u.currentBounds,this.currentRowIndex=u.currentRowIndex;for(var c=void 0,p=0;p<this.Grid.headers.count;p++){var d=this.Grid.headers.getHeader(p),f=this.currentBounds.y;if(this.isHeader=!0,s!=this.currentPage)for(var g=this.cellStartIndex;g<=this.cellEndIndex;g++)d.cells.getCell(g).isCellMergeContinue&&(d.cells.getCell(g).isCellMergeContinue=!1,d.cells.getCell(g).value="");var m=this.drawRow(d);f===this.currentBounds.y?(c=!0,-1===i.repeatRowIndex&&(i.repeatRowIndex=p)):c=!1,!m.isFinish&&null!==s&&r.layout!==t.PdfLayoutType.OnePage&&c&&(this.startLocation.x=this.currentBounds.x,this.currentPage=this.getNextPageformat(r),this.startLocation.y=this.currentBounds.y,void 0!==r.paginateBounds&&0===r.paginateBounds.x&&0===r.paginateBounds.y&&0===r.paginateBounds.width&&0===r.paginateBounds.height&&(this.currentBounds.x+=this.startLocation.x),this.drawRow(d)),this.isHeader=!1}var y=0,b=(this.Grid.rows.count,void 0),w=!0;a=[];for(var P=0;P<this.Grid.rows.count;P++){d=this.Grid.rows.getRow(P);y++,this.currentRowIndex=y-1;var S=this.currentBounds.y;s=this.currentPage,i.repeatRowIndex=-1,w&&d.grid.isChildGrid&&(w=!1);var v=null;if(-1==this.Grid.splitChildRowIndex)v=this.drawRow(d),d.isrowFinish=!0;else{if(!(d.grid.ParentCell.row.grid.isGridSplit&&this.Grid.splitChildRowIndex<=d.rowIndex)){if(d.isrowFinish)continue;break}v=this.drawRow(d),d.isrowFinish=!0}for(a.push(v.bounds.width),S===this.currentBounds.y?(b=!0,i.repeatRowIndex=this.Grid.rows.rowCollection.indexOf(d)):(b=!1,i.repeatRowIndex=-1);!v.isFinish&&null!=s;){var C=this.getLayoutResult();if(this.raisePageLayouted(C).cancel||b)break;if(this.Grid.allowRowBreakAcrossPages){this.currentPage=this.getNextPageformat(r),S=this.currentBounds.y;var B=new T(Ee.default.right.width/2,Ee.default.top.width/2);if(0===r.paginateBounds.x&&0===r.paginateBounds.y&&0===r.paginateBounds.width&&0===r.paginateBounds.height&&this.startLocation.x===B.x&&this.startLocation.y===B.y&&(this.currentBounds.x+=this.startLocation.x,this.currentBounds.y+=this.startLocation.y),this.isPaginate&&(this.startLocation.y=this.currentBounds.y,this.isPaginate=!1),this.Grid.isChildGrid&&null!=d.grid.ParentCell&&null!=this.Grid.ParentCell.row.grid.style.cellPadding&&d.rowBreakHeight+this.Grid.ParentCell.row.grid.style.cellPadding.top<this.currentBounds.height&&(this.currentBounds.y=this.Grid.ParentCell.row.grid.style.cellPadding.top),null!=d.grid.ParentCell){d.grid.ParentCell.row.isRowBreaksNextPage=!0,d.grid.ParentCell.row.rowBreakHeightValue=d.rowBreakHeight+this.Grid.ParentCell.row.grid.style.cellPadding.top+this.Grid.ParentCell.row.grid.style.cellPadding.bottom;for(var O=d.rowIndex+1;O<d.grid.rows.count;O++)d.grid.ParentCell.row.rowBreakHeightValue+=d.grid.rows.getRow(O).height}if(d.grid.isChildGrid){d.isrowFinish=!1,d.grid.splitChildRowIndex=d.rowIndex,d.grid.ParentCell.row.grid.splitChildRowIndex=d.grid.ParentCell.row.rowIndex,d.grid.ParentCell.row.grid.isGridSplit&&(d.grid.ParentCell.row.noOfPageCount+=1,d.grid.ParentCell.row.grid.isGridSplit=!1);break}if(d.noOfPageCount<1){if(-1!=d.grid.splitChildRowIndex&&(d.grid.isGridSplit=!0),null!=d.style.border&&(null!=d.style.border.left&&1!==d.style.border.left.width||null!=d.style.border.top&&1!==d.style.border.top.width)){var x=d.style.border.left.width/2,L=d.style.border.top.width/2;if(this.currentBounds.x===Ee.default.right.width/2&&this.currentBounds.y===Ee.default.right.width/2){var V=new k(x,L,this.currentBounds.width,this.currentBounds.height);this.currentBounds=V}}if(this.Grid.repeatHeader)for(var R=0;R<this.Grid.headers.count;R++){var M=this.Grid.headers.getHeader(R);this.drawRow(M)}if(v=this.drawRow(d),d.noOfPageCount>=1){d.rowBreakHeightValue;for(var D=0;D<d.noOfPageCount;D++){var N=this.getLayoutResult();if(this.raisePageLayouted(N),this.currentPage=this.getNextPageformat(r),S=this.currentBounds.y,-1!=d.grid.splitChildRowIndex&&(d.grid.isGridSplit=!0),this.currentBounds.y=.5,this.Grid.repeatHeader)for(var A=0;A<this.Grid.headers.count;A++){var I=this.Grid.headers.getHeader(A);this.drawRow(I)}this.drawRow(d)}}d.grid.splitChildRowIndex=-1,d.grid.isGridSplit=!1,v.isFinish=this.checkIsFisished(d);for(var F=0;F<d.cells.count;F++)d.cells.getCell(F).value instanceof Ei&&(d.cells.getCell(F).value.splitChildRowIndex=-1)}}}if(!v.isFinish&&null!==s&&r.layout!==t.PdfLayoutType.OnePage&&b){if(this.startLocation.x=this.currentBounds.x,this.currentPage=this.getNextPageformat(r),this.raiseBeforePageLayout(this.currentPage,this.currentBounds,this.currentRowIndex).returnValue)break;if(null!==e.format&&!e.format.usePaginateBounds&&null!==e.bounds&&e.bounds.height>0&&!this.Grid.isChildGrid&&(this.currentBounds.height=e.bounds.height),void 0===e.format||null==e.format||void 0===e.format.usePaginateBounds||e.format.usePaginateBounds||0===e.format.paginateBounds.x&&0===e.format.paginateBounds.y&&0===e.format.paginateBounds.width&&0===e.format.paginateBounds.height||0!==e.format.paginateBounds.y?(this.currentBounds.y=null==r?0:r.paginateBounds.y,null==r||0===r.paginateBounds.x&&0===r.paginateBounds.y&&0===r.paginateBounds.height&&0===r.paginateBounds.width||(this.currentBounds.x=r.paginateBounds.x,this.currentBounds.width=r.paginateBounds.width,this.currentBounds.height=r.paginateBounds.height)):this.currentBounds.y=Ee.default.top.width/2,void 0!==e.format&&null!==e.format&&void 0!==e.format.usePaginateBounds&&!e.format.usePaginateBounds&&null!==e.bounds&&e.bounds.y>0&&!this.Grid.isChildGrid&&(this.currentBounds.y=e.bounds.y),this.startLocation.y=this.currentBounds.y,r.paginateBounds.x===r.paginateBounds.y&&r.paginateBounds.y===r.paginateBounds.height&&r.paginateBounds.height===r.paginateBounds.width&&0===r.paginateBounds.width&&(this.currentBounds.x+=this.startLocation.x),this.currentBounds.x===Ee.default.left.width/2&&(this.currentBounds.y+=this.startLocation.x),this.Grid.repeatHeader)for(var E=0;E<this.Grid.headers.count;E++){I=this.Grid.headers.getHeader(E);this.drawRow(I)}this.drawRow(d),null===this.currentPage||o.containsKey(this.currentPage)||o.add(this.currentPage,l)}if(null!=d.NestedGridLayoutResult){this.currentPage=d.NestedGridLayoutResult.page,this.currentGraphics=this.currentPage.graphics,this.startLocation=new T(d.NestedGridLayoutResult.bounds.x,d.NestedGridLayoutResult.bounds.y);var G=this.ReCalculateHeight(d,d.NestedGridLayoutResult.bounds.height);if(this.currentBounds.y=G,s!=this.currentPage){for(var z=(it=this.currentPage.section).indexOf(s)+1,W=it.indexOf(this.currentPage),_=z;_<W+1;_++){var H=it.getPages()[_].graphics,U=new T(r.paginateBounds.x,r.paginateBounds.y),K=_==W?d.NestedGridLayoutResult.bounds.height-e.bounds.y:this.currentBounds.height-U.y;K<=H.clientSize.height&&(K+=e.bounds.y),U.y=null==r?.5:r.paginateBounds.y;for(var q=0;q<d.cells.count;q++){var Y=d.cells.getCell(q),X=0,J=0;if(Y.value instanceof Ei)for(var Z=0;Z<Y.value.columns.count;Z++)J+=Y.value.columns.getColumn(Z).columnWidth;else J=Y.width;if(Y.columnSpan>1)for(;q<Y.columnSpan;q++)X+=d.grid.columns.getColumn(q).width;else X=Math.max(J,d.grid.columns.getColumn(q).width);Y.drawCellBorders(H,new k(U,new j(X,K))),Y.drawCellBorders(H,new k(U,new j(this.Grid.rows.getRow(this.Grid.rows.count-1).width,K))),U.x+=X,q+=Y.columnSpan-1}}s=this.currentPage}}}var $=!1,Q=0;a.length>0&&(Q=a[0]);var tt=[[1,2]];for(q=0;q<this.Grid.rows.count;q++)if(-1!=this.cellEndIndex&&this.Grid.rows.getRow(q).cells.getCell(this.cellEndIndex).value instanceof Ei){var et=this.Grid.rows.getRow(q).cells.getCell(this.cellEndIndex).value;this.rowLayoutBoundsWidth=et.rowLayoutBoundsWidth,$=!0}if(!$&&a.length>0){for(q=0;q<y-1;q++)Q<a[q]&&(Q=a[q]);this.rowLayoutBoundsWidth=Q}else this.rowLayoutBoundsWidth=tt[0][1];if(this.columnRanges.indexOf(l)<this.columnRanges.length-1&&null!=s&&r.layout!=t.PdfLayoutType.OnePage)if(this.Grid.isChildGrid,0!=tt[0][0]){var it;(it=this.currentPage.section).indexOf(this.currentPage);this.currentGraphics=this.currentPage.graphics,this.currentBounds=new k(new T(0,0),this.currentPage.getClientSize());this.currentGraphics.page.section.indexOf(this.currentGraphics.page)}else this.currentPage=this.getNextPageformat(r);this.columnRanges.length-1!==h&&this.columnRanges.length>1&&r.layout!==t.PdfLayoutType.OnePage&&(this.currentPage=this.getNextPageformat(r),r.paginateBounds.x===r.paginateBounds.y&&r.paginateBounds.y===r.paginateBounds.height&&r.paginateBounds.height===r.paginateBounds.width&&0===r.paginateBounds.width&&(this.currentBounds.x+=this.startLocation.x,this.currentBounds.y+=this.startLocation.y))}return n=this.getLayoutResult(),this.Grid.style.allowHorizontalOverflow&&this.Grid.style.horizontalOverflowType==t.PdfHorizontalOverflowType.NextPage&&this.reArrangePages(o),this.raisePageLayouted(n),n},i.prototype.checkIsFisished=function(t){for(var e=!0,i=0;i<t.cells.count;i++)t.cells.getCell(i).FinishedDrawingCell||(e=!1);return e},i.prototype.getNextPageformat=function(t){var e=this.currentPage.section,i=null,r=e.indexOf(this.currentPage);this.flag=!1,i=r===e.count-1?e.add():e.getPages()[r+1],this.currentGraphics=i.graphics;var n=this.currentGraphics.page.section.indexOf(this.currentGraphics.page);return-1===this.listOfNavigatePages.indexOf(n)&&this.listOfNavigatePages.push(n),this.currentBounds=new k(new T(0,0),i.getClientSize()),void 0!==t&&null!=t&&t.usePaginateBounds&&void 0!==t.paginateBounds&&null!=t.paginateBounds&&t.paginateBounds.x!==t.paginateBounds.y&&t.paginateBounds.y!==t.paginateBounds.height&&t.paginateBounds.height!==t.paginateBounds.width&&0!==t.paginateBounds.width&&(this.currentBounds.x=t.paginateBounds.x,this.currentBounds.y=t.paginateBounds.y,this.currentBounds.height=t.paginateBounds.height),i},i.prototype.CheckIfDefaultFormat=function(t){var e=new N;return t.alignment===e.alignment&&t.characterSpacing===e.characterSpacing&&t.clipPath===e.clipPath&&t.firstLineIndent===e.firstLineIndent&&t.horizontalScalingFactor===e.horizontalScalingFactor&&t.lineAlignment===e.lineAlignment&&t.lineLimit===e.lineLimit&&t.lineSpacing===e.lineSpacing&&t.measureTrailingSpaces===e.measureTrailingSpaces&&t.noClip===e.noClip&&t.paragraphIndent===e.paragraphIndent&&t.rightToLeft===e.rightToLeft&&t.subSuperScript===e.subSuperScript&&t.wordSpacing===e.wordSpacing&&t.wordWrap===e.wordWrap},i.prototype.RaiseBeforeCellDraw=function(t,e,i,r,n,o){var s=null;return this.Grid.raiseBeginCellDraw&&(s=new Ui(t,e,i,r,n,o),this.Grid.onBeginCellDraw(s),o=s.style),o},i.prototype.raiseAfterCellDraw=function(t,e,i,r,n,o){var s=null;this.Grid.raiseEndCellDraw&&(s=new Ki(t,e,i,r,n,o),this.Grid.onEndCellDraw(s))},i.prototype.reArrangePages=function(t){for(var e=this.currentPage.document,i=[],r=t.keys(),n=(t.values(),0);n<r.length;n++){(a=r[n]).section=null,i.push(a),e.pages.remove(a)}for(n=0;n<t.size();n++)for(var o=n,s=t.size()/this.columnRanges.length;o<t.size();o+=s){var a;void 0!==(a=i[o])&&-1===e.pages.indexOf(a)&&e.pages.add(a)}},i.prototype.getLayoutResult=function(){if(this.Grid.isChildGrid&&this.Grid.allowRowBreakAcrossPages)for(var t=0;t<this.Grid.rows.count;t++){var e=this.Grid.rows.getRow(t);e.rowBreakHeight>0&&e.repeatFlag&&(this.startLocation.y=this.currentPage.origin.y)}var i;return this.isChanged||(i=new k(this.startLocation,new j(this.currentBounds.width,this.currentBounds.y-this.startLocation.y))),new Wi(this.currentPage,i)},i.prototype.ReCalculateHeight=function(t,e){for(var i=0,r=this.cellStartIndex;r<=this.cellEndIndex;r++)null!==t.cells.getCell(r).remainingString&&""!==t.cells.getCell(r).remainingString&&void 0!==t.cells.getCell(r).remainingString&&(i=Math.max(i,t.cells.getCell(r).measureHeight()));return Math.max(e,i)},i.prototype.raiseBeforePageLayout=function(t,e,i){var r=!1;if(this.Grid.raiseBeginPageLayout){var n=new Ji(e,t,i);this.Grid.onBeginPageLayout(n),r=void 0!==n.cancel&&n.cancel,e=n.bounds,i=n.startRowIndex}return{returnValue:r,currentBounds:e,currentRowIndex:i}},i.prototype.raisePageLayouted=function(t){var e=new Zi(t);return this.Grid.raiseEndPageLayout&&this.Grid.onEndPageLayout(e),e},i.prototype.drawRow=function(e,r,n){if(void 0===r){var o=new $i,s=0,a=new j(0,0),h=!1;if(e.rowSpanExists){var l=0,u=this.Grid.rows.rowCollection.indexOf(e);-1===u&&-1!==(u=this.Grid.headers.indexOf(e))&&(h=!0);for(var c=0;c<e.cells.count;c++){var p=e.cells.getCell(c);l=Math.max(l,p.rowSpan)}for(c=u;c<u+l;c++)s+=h?this.Grid.headers.getHeader(c).height:this.Grid.rows.getRow(c).height}var d=e.rowBreakHeight>0?e.rowBreakHeight:e.height;if(void 0!==this.Grid.isChildGrid&&this.Grid.isChildGrid&&void 0!==this.Grid.ParentCell&&null!=this.Grid.ParentCell)this.currentBounds.y+this.Grid.ParentCell.row.grid.style.cellPadding.bottom+d>this.currentPageBounds.height||this.currentBounds.y+this.Grid.ParentCell.row.grid.style.cellPadding.bottom+d>this.currentBounds.height||this.currentBounds.y+this.Grid.ParentCell.row.grid.style.cellPadding.bottom+s>this.currentPageBounds.height?(void 0!==this.Grid.ParentCell.row.grid.LayoutFormat&&this.Grid.ParentCell.row.grid.LayoutFormat.break===t.PdfLayoutBreakType.FitPage&&(i.repeatRowIndex=this.Grid.rows.rowCollection.indexOf(e),this.Grid.splitChildRowIndex=this.Grid.rows.rowCollection.indexOf(e)),i.repeatRowIndex>-1&&i.repeatRowIndex===e.rowIndex&&this.Grid.allowRowBreakAcrossPages&&(o.isFinish=!0,o.bounds=this.currentBounds,this.drawRowWithBreak(o,e,d),e.repeatFlag=!0,e.repeatRowNumber=i.repeatRowIndex)):(o.isFinish=!0,e.grid.ParentCell.row.rowBreakHeightValue>0?e.repeatFlag=!0:(e.repeatFlag=!1,d=e.height),this.Grid.isChildGrid&&e.rowBreakHeight>0&&null!=this.Grid.ParentCell.row.grid.style.cellPadding&&(d+=this.Grid.ParentCell.row.grid.style.cellPadding.bottom),this.drawRow(e,o,d));else if(d>this.currentPageBounds.height)this.Grid.allowRowBreakAcrossPages&&(o.isFinish=!0,this.drawRowWithBreak(o,e,d),e.isrowFinish=!0,e.repeatFlag=!0,-1!==e.grid.splitChildRowIndex&&(o.isFinish=!1));else if(this.currentBounds.y+d>this.currentPageBounds.height||this.currentBounds.y+d>this.currentBounds.height+this.startLocation.y||this.currentBounds.y+s>this.currentPageBounds.height){var f=!1;!this.Grid.allowRowBreakAcrossPages||this.Grid.repeatHeader||e.isRowHeightSet||e.rowMergeComplete?this.Grid.allowRowBreakAcrossPages&&null!=this.Grid.LayoutFormat&&this.Grid.LayoutFormat.layout==t.PdfLayoutType.Paginate&&this.Grid.LayoutFormat.break!=t.PdfLayoutBreakType.FitElement&&e.isRowHeightSet&&this.currentBounds.y+n>this.currentPageBounds.height&&((f=this.isFitToCell(this.currentPageBounds.height-this.currentBounds.y,this.Grid,e))||(f=!(null!==this.slr&&0==this.slr.actualSize.height&&null!=this.slr.remainder&&this.slr.remainder.length>0&&this.remainderText==this.slr.remainder)),f&&null!=this.slr&&this.slr.lineCount>1&&(f=!1),this.remainderText=null):(f=null!==this.Grid.LayoutFormat&&this.Grid.LayoutFormat.paginateBounds.height>0?this.isFitToCell(this.currentBounds.height+this.startLocation.y-this.currentBounds.y,this.Grid,e):this.isFitToCell(this.currentPageBounds.height-this.currentBounds.y,this.Grid,e))&&(this.isPaginate=!0),i.repeatRowIndex>-1&&i.repeatRowIndex===e.rowIndex||f?this.Grid.allowRowBreakAcrossPages?(o.isFinish=!0,this.drawRowWithBreak(o,e,d),e.repeatFlag=!0,e.repeatRowNumber=i.repeatRowIndex,-1!==e.grid.splitChildRowIndex&&(o.isFinish=!1)):(o.isFinish=!1,this.drawRow(e,o,d)):o.isFinish=!1}else o.isFinish=!0,this.drawRow(e,o,d),e.repeatFlag=!1;return o}var g=new T(this.currentBounds.x,this.currentBounds.y);r.bounds=new k(g,new j(0,0)),n=this.ReCalculateHeight(e,n);for(c=this.cellStartIndex;c<=this.cellEndIndex;c++){var m=c>this.cellEndIndex+1&&e.cells.getCell(c).columnSpan>1;if(!m)for(var y=1;y<e.cells.getCell(c).columnSpan;y++)e.cells.getCell(c+y).isCellMergeContinue=!0;a=new j(this.Grid.columns.getColumn(c).width,n);!this.CheckIfDefaultFormat(this.Grid.columns.getColumn(c).format)&&this.CheckIfDefaultFormat(e.cells.getCell(c).stringFormat)&&(e.cells.getCell(c).stringFormat=this.Grid.columns.getColumn(c).format);var b=e.cells.getCell(c).style,w="string"==typeof e.cells.getCell(c).value&&null!==e.cells.getCell(c).value?e.cells.getCell(c).value:"";if(e.cells.getCell(c).style=this.RaiseBeforeCellDraw(this.currentGraphics,this.currentRowIndex,c,new k(g,a),w,b),e.cells.getCell(c).value instanceof Ei){(S=e.cells.getCell(c).value).parentCellIndex=c}var P=e.cells.getCell(c).draw(this.currentGraphics,new k(g,a),m);if(e.grid.style.allowHorizontalOverflow&&(e.cells.getCell(c).columnSpan>this.cellEndIndex||c+e.cells.getCell(c).columnSpan>this.cellEndIndex+1)&&this.cellEndIndex<e.cells.count-1&&(e.rowOverflowIndex=this.cellEndIndex),e.grid.style.allowHorizontalOverflow&&e.rowOverflowIndex>0&&(e.cells.getCell(c).columnSpan>this.cellEndIndex||c+e.cells.getCell(c).columnSpan>this.cellEndIndex+1)&&e.cells.getCell(c).columnSpan-this.cellEndIndex+c-1>0&&(e.cells.getCell(e.rowOverflowIndex+1).value=null!==P&&void 0!==P.remainder?P.remainder:"",e.cells.getCell(e.rowOverflowIndex+1).stringFormat=e.cells.getCell(c).stringFormat,e.cells.getCell(e.rowOverflowIndex+1).style=e.cells.getCell(c).style,e.cells.getCell(e.rowOverflowIndex+1).columnSpan=e.cells.getCell(c).columnSpan-this.cellEndIndex+c-1),w="string"==typeof e.cells.getCell(c).value&&null!==e.cells.getCell(c).value?e.cells.getCell(c).value:"",m||this.raiseAfterCellDraw(this.currentGraphics,this.currentRowIndex,c,new k(g,a),w,e.cells.getCell(c).style),e.cells.getCell(c).value instanceof Ei){var S=e.cells.getCell(c).value;this.Grid.columns.getColumn(c).width>=this.currentGraphics.clientSize.width?(g.x=S.rowLayoutBoundsWidth,g.x+=S.style.cellSpacing):g.x+=this.Grid.columns.getColumn(c).width}else g.x+=this.Grid.columns.getColumn(c).width}e.rowMergeComplete&&!e.isRowHeightSet||(this.currentBounds.y+=n),r.bounds=new k(new T(r.bounds.x,r.bounds.y),new j(g.x,g.y))},i.prototype.isFitToCell=function(t,e,i){for(var r=!1,n=new I,o=0;o<i.cells.count;o++){var s=i.cells.getCell(o);if(void 0!==s.value&&null!==s.value&&"string"==typeof s.value){var a=null;a=void 0!==s.style.font&&null!=s.style.font?s.style.font:void 0!==s.row.style.font&&null!=s.row.style.font?s.row.style.font:void 0!==s.row.grid.style.font&&null!=s.row.grid.style.font?s.row.grid.style.font:Be.defaultFont,this.remainderText=s.value;var h=s.width,l=e.columns.getColumn(o);l.isCustomWidth&&s.width>l.width&&(h=l.width),this.slr=n.layout(s.value,a,s.stringFormat,new j(h,t),!1,this.currentPageBounds);var u=this.slr.actualSize.height;if(""!==s.value&&0===u){r=!1;break}if(null!==s.style&&null!==s.style.borders&&null!==s.style.borders.top&&null!==s.style.borders.bottom&&(u+=2*(s.style.borders.top.width+s.style.borders.bottom.width)),this.slr.lineCount>1&&null!=s.stringFormat&&0!=s.stringFormat.lineSpacing&&(u+=(this.slr.lineCount-1)*s.style.stringFormat.lineSpacing),s.style.cellPadding,u+=e.style.cellPadding.top+e.style.cellPadding.bottom,u+=e.style.cellSpacing,t>u||void 0!==this.slr.remainder&&null!==this.slr.remainder){r=!0;break}}}return r},i.prototype.drawRowWithBreak=function(t,e,i){var r=new T(this.currentBounds.x,this.currentBounds.y);e.grid.isChildGrid&&e.grid.allowRowBreakAcrossPages&&this.startLocation.x!==this.currentBounds.x&&(r.x=this.startLocation.x),t.bounds=new k(r,new j(0,0)),this.gridHeight=e.rowBreakHeight>0?this.currentPageBounds.height:0,e.grid.style.cellPadding.top+this.currentBounds.y+e.grid.style.cellPadding.bottom<this.currentPageBounds.height&&(e.rowBreakHeight=this.currentBounds.y+i-this.currentPageBounds.height);for(var n=0;n<e.cells.count;n++){var o=e.cells.getCell(n);o.measureHeight()===i&&o.value instanceof Ei&&(e.rowBreakHeight=0)}for(n=this.cellStartIndex;n<=this.cellEndIndex;n++){var s=this.Grid.columns.getColumn(n).width,a=e.cells.getCell(n).columnSpan+n>this.cellEndIndex+1&&e.cells.getCell(n).columnSpan>1;if(!a)for(var h=1;h<e.cells.getCell(n).columnSpan;h++)e.cells.getCell(n+h).isCellMergeContinue=!0,s+=this.Grid.columns.getColumn(n+h).width;var l=new j(s,this.gridHeight>0?this.gridHeight:this.currentPageBounds.height),u=e.cells.getCell(n).style;e.cells.getCell(n).style=u;var c=null;if(e.cells.getCell(n)._rowHeight=e.height,c=e.cells.getCell(n).draw(this.currentGraphics,new k(r,l),a),e.rowBreakHeight>0&&null!=c&&void 0!==c.remainder&&(e.cells.getCell(n).FinishedDrawingCell=!1,e.cells.getCell(n).remainingString=null==c.remainder?" ":c.remainder,e.rowBreakHeight=i-c.actualSize.height),t.isFinish=t.isFinish?e.cells.getCell(n).FinishedDrawingCell:t.isFinish,e.cells.getCell(n).value instanceof Ei){var p=e.cells.getCell(n).value;this.rowBreakPageHeightCellIndex=n,this.Grid.columns.getColumn(n).width>=this.currentGraphics.clientSize.width?(r.x=this.rowLayoutBoundsWidth,r.x+=p.style.cellSpacing):r.x+=this.Grid.columns.getColumn(n).width}else r.x+=this.Grid.columns.getColumn(n).width}this.currentBounds.y+=this.gridHeight>0?this.gridHeight:i,t.bounds=new k(new T(t.bounds.x,t.bounds.y),new j(r.x,r.y))},i.repeatRowIndex=-1,i}(Ne),Wi=function(t){function e(e,i){return t.call(this,e,i)||this}return Gi(e,t),e}(Fe),_i=function(t){function e(e){return t.call(this,e)||this}return Gi(e,t),e}(Ae),Hi=function(){function t(t,e,i,r,n){this.gridRowIndex=e,this.gridCellIndex=i,this.internalValue=n,this.gridBounds=r,this.pdfGraphics=t}return Object.defineProperty(t.prototype,"rowIndex",{get:function(){return this.gridRowIndex},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"cellIndex",{get:function(){return this.gridCellIndex},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this.internalValue},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"bounds",{get:function(){return this.gridBounds},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"graphics",{get:function(){return this.pdfGraphics},enumerable:!0,configurable:!0}),t}(),Ui=function(t){function e(e,i,r,n,o,s){var a=t.call(this,e,i,r,n,o)||this;return a.style=s,a}return Gi(e,t),Object.defineProperty(e.prototype,"skip",{get:function(){return this.bSkip},set:function(t){this.bSkip=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"style",{get:function(){return this.cellStyle},set:function(t){this.cellStyle=t},enumerable:!0,configurable:!0}),e}(Hi),Ki=function(t){function e(e,i,r,n,o,s){var a=t.call(this,e,i,r,n,o)||this;return a.cellStyle=s,a}return Gi(e,t),Object.defineProperty(e.prototype,"style",{get:function(){return this.cellStyle},enumerable:!0,configurable:!0}),e}(Hi),qi=function(){function t(){}return Object.defineProperty(t.prototype,"cancel",{get:function(){return this.isCancel},set:function(t){this.isCancel=t},enumerable:!0,configurable:!0}),t}(),Yi=function(t){function e(e,i){var r=t.call(this)||this;return r.bounds=e,r.pdfPage=i,r}return Gi(e,t),Object.defineProperty(e.prototype,"bounds",{get:function(){return this.cellBounds},set:function(t){this.cellBounds=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"page",{get:function(){return this.pdfPage},enumerable:!0,configurable:!0}),e}(qi),Xi=function(t){function e(e){var i=t.call(this)||this;return i.layoutResult=e,i}return Gi(e,t),Object.defineProperty(e.prototype,"result",{get:function(){return this.layoutResult},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"nextPage",{get:function(){return this.nextPdfPage},set:function(t){this.nextPdfPage=t},enumerable:!0,configurable:!0}),e}(qi),Ji=function(t){function e(e,i,r){var n=t.call(this,e,i)||this;return n.startRow=r,n}return Gi(e,t),Object.defineProperty(e.prototype,"startRowIndex",{get:function(){return this.startRow},enumerable:!0,configurable:!0}),e}(Yi),Zi=function(t){function e(e){return t.call(this,e)||this}return Gi(e,t),e}(Xi),$i=function(){function t(){this.layoutedBounds=new k(0,0,0,0)}return Object.defineProperty(t.prototype,"isFinish",{get:function(){return this.bIsFinished},set:function(t){this.bIsFinished=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"bounds",{get:function(){return this.layoutedBounds},set:function(t){this.layoutedBounds=t},enumerable:!0,configurable:!0}),t}(),Qi=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),tr=function(e){function i(t){var i=e.call(this,t)||this;return i.olderPdfForm=0,i.shapeBounds=new k,i.totalPageSize=0,i}return Qi(i,e),Object.defineProperty(i.prototype,"element",{get:function(){return this.elements},enumerable:!0,configurable:!0}),i.prototype.layoutInternal=function(t){var e=t.page,i=t.bounds,r=this.element.getBounds();r.x=0,r.y=0;var n=this.shapeBounds.x===this.shapeBounds.y&&this.shapeBounds.y===this.shapeBounds.width&&this.shapeBounds.width===this.shapeBounds.height&&0===this.shapeBounds.height;this.isPdfGrid&&!n&&(r=this.shapeBounds);var o=null,s=new er;for(s.page=e;;){var a=this.raiseBeforePageLayout(e,i);i=a.currentBounds;var h=null;if(a.cancel||(s=this.layoutOnPage(e,i,r,t),h=this.raiseEndPageLayout(s),a.cancel=null!==h&&h.cancel),s.end||a.cancel){o=this.getLayoutResult(s);break}if(i=this.getPaginateBounds(t),r=this.getNextShapeBounds(r,s),e=null===h||null===h.nextPage?this.getNextPage(e):h.nextPage,this.isPdfGrid){o=this.getLayoutResult(s);break}}return o},i.prototype.raiseBeforePageLayout=function(t,e){var i=!1;if(this.element.raiseBeginPageLayout){var r=new Yi(e,t);this.element.onBeginPageLayout(r),i=r.cancel,e=r.bounds}return{currentBounds:e,cancel:i}},i.prototype.raiseEndPageLayout=function(t){var e=null;if(this.element.raiseEndPageLayout){var i=this.getLayoutResult(t);e=new Xi(i),this.element.onEndPageLayout(e)}return e},i.prototype.getLayoutResult=function(t){return new Fe(t.page,t.bounds)},i.prototype.getNextShapeBounds=function(t,e){var i=e.bounds;return t.y=t.y+i.height,t.height=t.height-i.height,t},i.prototype.layoutOnPage=function(e,i,r,n){var o=new er;i=this.checkCorrectCurrentBounds(e,i,n);var s=this.fitsToBounds(i,r),a=!1;if(!(n.format.break===t.PdfLayoutBreakType.FitElement&&!s&&e===n.page)){var h=this.getDrawBounds(i,r);this.drawShape(e.graphics,i,h),o.bounds=this.getPageResultBounds(i,r),a=i.height>=r.height}return o.end=a||n.format.layout===t.PdfLayoutType.OnePage,o.page=e,o},i.prototype.getDrawBounds=function(t,e){var i=t;return i.y=i.y-e.y,i.height=i.height+e.y,i},i.prototype.drawShape=function(t,e,i){var r=t.save();try{t.setClip(e),this.element.drawGraphicsHelper(t,new T(i.x,i.y))}finally{t.restore(r)}},i.prototype.checkCorrectCurrentBounds=function(t,e,i){var r=t.graphics.clientSize;return e.width=e.width>0?e.width:r.width-e.x,e.height=e.height>0?e.height:r.height-e.y,this.isPdfGrid&&(e.height=e.height-this.bottomCellPadding),e},i.prototype.getPageResultBounds=function(t,e){var i=t;return i.height=Math.min(i.height,e.height),i},i.prototype.fitsToBounds=function(t,e){return e.height<=t.height},i.index=0,i.splitDiff=0,i.last=!1,i.borderWidth=0,i}(Ne),er=function(){return function(){}}(),ir=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),rr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ir(e,t),e.prototype.getBounds=function(){return this.getBoundsInternal()},e.prototype.drawGraphicsHelper=function(t,e){if(null==t)throw new Error("ArgumentNullException :graphics");this.drawShapeHelper(t,e.x,e.y)},e.prototype.drawShapeHelper=function(t,e,i){var r=.5!==e||.5!==i,n=null;r&&(n=t.save(),t.translateTransform(e,i)),this.drawInternal(t),r&&t.restore(n)},e.prototype.layout=function(t){return new tr(this).layout(t)},e}(ze),nr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),or=function(t){function e(e){var i=t.call(this)||this;return void 0!==e&&(i.mpen=e),i}return nr(e,t),Object.defineProperty(e.prototype,"pen",{get:function(){return this.mpen},set:function(t){this.mpen=t},enumerable:!0,configurable:!0}),e}(rr),sr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ar=function(t){function e(e,i){var r=t.call(this)||this;return r.mbrush=null,void 0===e||(e instanceof et?r=t.call(this,e)||this:r.mbrush=i),r}return sr(e,t),Object.defineProperty(e.prototype,"brush",{get:function(){return this.mbrush},set:function(t){this.mbrush=t},enumerable:!0,configurable:!0}),e.prototype.obtainPen=function(){return null==this.mbrush&&null==this.pen?new et(new L(0,0,0)):this.pen},e}(or),hr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),lr=function(e){function i(i,r,n,o){var s=e.call(this)||this;return s.mpoints=null,s.mpathTypes=null,s.mStartFigure=!0,s.mfillMode=t.PdfFillMode.Alternate,s.isBeziers3=!1,s.isXps=!1,void 0===i||(i instanceof et?(s=e.call(this,i)||this,r instanceof R?(s=e.call(this,i,r)||this).fillMode=n:null!==r&&void 0!==r&&null!==n&&void 0!==n&&s.addPath(r,n)):i instanceof R?(s=e.call(this,i)||this,null!==r&&void 0!==r&&(s.fillMode=r),null!==n&&void 0!==n&&null!==o&&void 0!==o&&s.addPath(n,o)):s.addPath(i,r)),s}return hr(i,e),Object.defineProperty(i.prototype,"fillMode",{get:function(){return this.mfillMode},set:function(t){this.mfillMode=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"pathPoints",{get:function(){return this.points},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"pathTypes",{get:function(){return this.types},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"pointCount",{get:function(){var t=0;return null!=this.mpoints&&(t=this.mpoints.length),t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"lastPoint",{get:function(){return this.getLastPoint()},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"points",{get:function(){return null==this.mpoints&&(this.mpoints=[]),this.mpoints},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"types",{get:function(){return null==this.mpathTypes&&(this.mpathTypes=[]),this.mpathTypes},enumerable:!0,configurable:!0}),i.prototype.draw=function(t,e,i,r){if(e instanceof T&&void 0===e.width&&void 0===i)return this.drawHelper(t,e.x,e.y);if(e instanceof k&&void 0!==e.width&&void 0===i)return this.drawHelper(t,e,null);if("number"==typeof e&&"number"==typeof i&&void 0===r)return this.drawHelper(t,e,i,null);if(e instanceof T&&i instanceof Ae)return this.drawHelper(t,e.x,e.y,i);if("number"==typeof e&&(r instanceof Ae||null==r)&&"number"==typeof i){var n=t.graphics.clientSize.width-e,o=new k(e,i,n,0);return this.drawHelper(t,o,r)}return this.drawHelper(t,e,i)},i.prototype.addArc=function(e,i,r,n,o,s){if(e instanceof k)this.addArc(e.x,e.y,e.width,e.height,i,r);else for(var a=this.getBezierArcPoints(e,i,i+r,i+n,o,s),h=0;h<a.length;h+=8){var l=[a[h],a[h+1],a[h+2],a[h+3],a[h+4],a[h+5],a[h+6],a[h+7]];this.addPoints(l,t.PathPointType.Bezier3)}},i.prototype.addBezier=function(e,i,r,n,o,s,a,h){if(e instanceof T&&i instanceof T&&r instanceof T&&n instanceof T)this.addBezier(e.x,e.y,i.x,i.y,r.x,r.y,n.x,n.y);else{var l=[];l.push(e),l.push(i),l.push(r),l.push(n),l.push(o),l.push(s),l.push(a),l.push(h),this.addPoints(l,t.PathPointType.Bezier3)}},i.prototype.addEllipse=function(t,e,i,r){t instanceof k?this.addEllipse(t.x,t.y,t.width,t.height):(this.startFigure(),this.addArc(t,e,i,r,0,360),this.closeFigure())},i.prototype.addLine=function(e,i,r,n){if(e instanceof T&&i instanceof T)this.addLine(e.x,e.y,i.x,i.y);else{var o=[];o.push(e),o.push(i),o.push(r),o.push(n),this.addPoints(o,t.PathPointType.Line)}},i.prototype.addPath=function(t,e){if(t instanceof i)this.addPath(t.pathPoints,t.pathTypes);else{if(null==t)throw new Error("ArgumentNullException:pathPoints");if(null==e)throw new Error("ArgumentNullException:pathTypes");if(t.length!==e.length)throw new Error("The argument arrays should be of equal length.")}},i.prototype.addPie=function(e,i,r,n,o,s){e instanceof k?this.addPie(e.x,e.y,e.width,e.height,i,r):(this.startFigure(),this.addArc(e,i,r,n,o,s),this.addPoint(new T(e+r/2,i+n/2),t.PathPointType.Line),this.closeFigure())},i.prototype.addPolygon=function(e){e.length;var i=[];this.startFigure();for(var r=0;r<e.length;r++)i.push(e[r].x),i.push(e[r].y);this.addPoints(i,t.PathPointType.Line),this.closeFigure()},i.prototype.addRectangle=function(e,i,r,n){if(e instanceof k)this.addRectangle(e.x,e.y,e.width,e.height);else{var o=[];this.startFigure(),o.push(e),o.push(i),o.push(e+r),o.push(i),o.push(e+r),o.push(i+n),o.push(e),o.push(i+n),this.addPoints(o,t.PathPointType.Line),this.closeFigure()}},i.prototype.startFigure=function(){this.mStartFigure=!0},i.prototype.closeAllFigures=function(){for(var e=this.pathPoints[0],i=0;i<this.mpathTypes.length;i++){var r=this.types[i],n=!1;0!==i&&r===t.PathPointType.Start?(this.closeFigure(i-1),n=!0):i===this.mpathTypes.length-1&&!n&&this.isXps&&e.x===this.pathPoints[i].y&&this.closeFigure(i)}},i.prototype.getLastPoint=function(){var t=new T(0,0),e=this.pointCount;return e>0&&null!=this.mpoints&&(t.x=this.mpoints[e-1].x,t.y=this.mpoints[e-1].y),t},i.prototype.getBezierArcPoints=function(t,e,i,r,n,o){if(t>i){var s=void 0;s=t,t=i,i=s}if(r>e){s=void 0;s=e,e=r,r=s}var a,h;Math.abs(o)<=90?(a=o,h=1):a=o/(h=Math.ceil(Math.abs(o)/90));for(var l=(t+i)/2,u=(e+r)/2,c=(i-t)/2,p=(r-e)/2,d=a*(Math.PI/360),f=Math.abs(4/3*(1-Math.cos(d))/Math.sin(d)),g=[],m=0;m<h;m++){var y=(n+m*a)*(Math.PI/180),b=(n+(m+1)*a)*(Math.PI/180),w=Math.cos(y),P=Math.cos(b),S=Math.sin(y),v=Math.sin(b);a>0?g.push(l+c*w,u-p*S,l+c*(w-f*S),u-p*(S+f*w),l+c*(P+f*v),u-p*(v-f*P),l+c*P,u-p*v):g.push(l+c*w,u-p*S,l+c*(w+f*S),u-p*(S-f*w),l+c*(P-f*v),u-p*(v+f*P),l+c*P,u-p*v)}return g},i.prototype.getBoundsInternal=function(){var t=this.pathPoints,e=new k(0,0,0,0);if(t.length>0){for(var i=t[0].x,r=t[0].x,n=t[0].y,o=t[0].y,s=1;s<t.length;s++){var a=t[s];i=Math.min(a.x,i),r=Math.max(a.x,r),n=Math.min(a.y,n),o=Math.max(a.y,o)}e=new k(i,n,r-i,o-n)}return e},i.prototype.drawInternal=function(t){if(null==t)throw new Error("ArgumentNullException :graphics");t.drawPath(this.obtainPen(),this.brush,this)},i.prototype.addPoints=function(e,i,r,n){if(void 0===r&&void 0===n)this.addPoints(e,i,0,e.length);else for(var o=r;o<n;o++){var s=new T(e[o],e[o+1]);o===r?this.pointCount<=0||this.mStartFigure?(this.addPoint(s,t.PathPointType.Start),this.mStartFigure=!1):s.x===this.lastPoint.x||s.y===this.lastPoint.y||this.isBeziers3?s.x!==this.lastPoint.x&&s.y!==this.lastPoint.y&&this.addPoint(s,t.PathPointType.Bezier3):this.addPoint(s,t.PathPointType.Line):this.addPoint(s,i),o++}},i.prototype.addPoint=function(t,e){this.points.push(t),this.types.push(e)},i.prototype.closeFigure=function(e){if(void 0===e)this.pointCount>0&&this.closeFigure(this.pointCount-1),this.startFigure();else{if(e<0)throw new Error("IndexOutOfRangeException()");var i=this.types[e];i|=t.PathPointType.CloseSubpath,this.types[e]=i}},i}(ar),ur=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),cr=function(t){function e(e,i,r,n,o,s){var a=t.call(this)||this;return a.bounds=new k(0,0,0,0),void 0===e||(e instanceof et?(a=t.call(this,e,i)||this).bounds=r instanceof k?r:new k(r,n,o,s):a.bounds=e instanceof k?e:new k(e,i,r,n)),a}return ur(e,t),Object.defineProperty(e.prototype,"x",{get:function(){return this.bounds.x},set:function(t){this.bounds.x=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"y",{get:function(){return this.bounds.y},set:function(t){this.bounds.y=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.bounds.width},set:function(t){this.bounds.width=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.bounds.height},set:function(t){this.bounds.height=t},enumerable:!0,configurable:!0}),e.prototype.getBoundsInternal=function(){return this.bounds},e}(ar),pr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),dr=function(t){function e(e,i,r,n,o,s,a,h){var l=t.call(this)||this;return l.startAngle=0,l.sweepAngle=0,void 0===e||(e instanceof k&&void 0!==i&&void 0!==r?((l=t.call(this,e)||this).startAngle=i,l.sweepAngle=r):e instanceof et?r instanceof k?((l=t.call(this,e,i,r)||this).startAngle=n,l.sweepAngle=o):((l=t.call(this,e,i,r,n,o,s)||this).startAngle=a,l.sweepAngle=h):((l=t.call(this,e,i,r,n)||this).startAngle=o,l.sweepAngle=s)),l}return pr(e,t),e}(cr),fr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),gr=function(t){function e(e,i,r,n,o,s,a){var h=this;return void 0===e?h=t.call(this)||this:e instanceof k?h=t.call(this,e,i,r)||this:e instanceof et?i instanceof k?h=t.call(this,e,null,i,r,n)||this:void 0===s&&void 0===a?h=t.call(this,e,null,0,0,i,r,n,o)||this:void 0!==s&&void 0!==a&&(h=t.call(this,e,null,i,r,n,o,s,a)||this):void 0!==e&&void 0===o&&void 0===s?h=t.call(this,0,0,e,i,r,n)||this:void 0!==e&&void 0!==o&&void 0!==s&&(h=t.call(this,e,i,r,n,o,s)||this),h}return fr(e,t),e.prototype.draw=function(t,e,i,r){if(e instanceof T&&void 0===e.width&&void 0===i)return this.drawHelper(t,e.x,e.y);if(e instanceof k&&void 0!==e.width&&void 0===i)return this.drawHelper(t,e,null);if("number"==typeof e&&"number"==typeof i&&void 0===r)return this.drawHelper(t,e,i,null);if(e instanceof T&&i instanceof Ae)return this.drawHelper(t,e.x,e.y,i);if("number"==typeof e&&(r instanceof Ae||null==r)&&"number"==typeof i){var n=t.graphics.clientSize.width-e,o=new k(e,i,n,0);return this.drawHelper(t,o,r)}return this.drawHelper(t,e,i)},e.prototype.drawInternal=function(t){if(null==t)throw new Error("ArgumentNullException : graphics");t.drawArc(this.obtainPen(),this.bounds,this.startAngle,this.sweepAngle)},e}(dr),mr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),yr=function(e){function i(i,r,n){var o=e.call(this,r)||this;return o.isEmbedFont=!1,o.isUnicode=!0,void 0!==n?o.createFontInternal(i,n):o.createFontInternal(i,t.PdfFontStyle.Regular),o}return mr(i,e),i.prototype.equalsToFont=function(t){return!1},i.prototype.getLineWidth=function(e,i){var r=0;if(null!==i&&void 0!==i&&i.textDirection!==t.PdfTextDirection.None){r=this.getUnicodeLineWidth(e,r,i).width}else r=this.fontInternal.getLineWidth(e);var n=this.metrics.getSize(i);return r*=G.charSizeMultiplier*n,r=this.applyFormatSettings(e,i,r)},i.prototype.getCharWidth=function(t,e){var i=this.fontInternal.getCharWidth(t);return i*=.001*this.metrics.getSize(e)},i.prototype.createFontInternal=function(t,e){this.fontInternal=new zt(t,this.size),this.calculateStyle(e),this.initializeInternals()},i.prototype.calculateStyle=function(e){var i=this.fontInternal.ttfMetrics.macStyle;0!=(e&t.PdfFontStyle.Underline)&&(i|=t.PdfFontStyle.Underline),0!=(e&t.PdfFontStyle.Strikeout)&&(i|=t.PdfFontStyle.Strikeout),this.setStyle(i)},i.prototype.initializeInternals=function(){var t=null;Be.enableCache&&(t=Be.cache.search(this));var e=null;if(null!==t&&void 0!==t){e=t.getInternals();var i=t.metrics;(i=i.clone()).size=this.size,this.metrics=i,this.fontInternal=t.fontInternal}else null==t&&(this.fontInternal instanceof zt&&(this.fontInternal.isEmbed=this.isEmbedFont),this.fontInternal.createInternals(),e=this.fontInternal.getInternals(),this.metrics=this.fontInternal.metrics);this.metrics.isUnicodeFont=!0,this.setInternals(e)},i.prototype.setSymbols=function(t){var e=this.fontInternal;null!=e&&e.setSymbols(t)},Object.defineProperty(i.prototype,"Unicode",{get:function(){return this.isUnicode},enumerable:!0,configurable:!0}),i.prototype.getUnicodeLineWidth=function(e,i,r){i=0;var n=null,o=(new Kt).getGlyphIndex(e,this,r.textDirection===t.PdfTextDirection.RightToLeft,n,!0),s=o.success;if(n=o.glyphs,s&&null!==n)for(var a=this.fontInternal.ttfReader,h=0,l=n.length;h<l;h++){var u=n[h],c=a.getGlyph(u);null!==c&&void 0!==c&&(i+=c.width)}return{success:s,width:i}},i}(G),br=function(){function e(t,e,i,r,n){t instanceof k&&void 0===e?this.InitiateBounds(t.x,t.y,t.width,t.height,null):t instanceof k&&e instanceof pe&&void 0===i?this.InitiateBounds(t.x,t.y,t.width,t.height,e):t instanceof T&&e instanceof j&&void 0===i?this.InitiateBounds(t.x,t.y,e.width,e.height,null):t instanceof T&&e instanceof j&&i instanceof pe&&void 0===r?this.InitiateBounds(t.x,t.y,e.width,e.height,i):t instanceof j&&void 0===e?this.InitiateBounds(0,0,t.width,t.height,null):"number"==typeof t&&"number"==typeof e&&void 0===i?this.InitiateBounds(0,0,t,e,null):"number"==typeof t&&"number"==typeof e&&i instanceof pe&&void 0===r?this.InitiateBounds(0,0,t,e,i):this.InitiateBounds(t,e,i,r,null)}return Object.defineProperty(e.prototype,"dock",{get:function(){return this.dockStyle},set:function(t){this.dockStyle=t,this.resetAlignment()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"alignment",{get:function(){return this.alignmentStyle},set:function(t){this.setAlignment(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"foreground",{get:function(){return this.isForeground},set:function(t){this.isForeground=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"background",{get:function(){return!this.isForeground},set:function(t){this.isForeground=!t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"location",{get:function(){return this.currentLocation},set:function(e){this.type===t.TemplateType.None&&(this.currentLocation=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"x",{get:function(){return void 0!==this.currentLocation?this.currentLocation.x:0},set:function(e){this.type===t.TemplateType.None&&(this.currentLocation.x=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"y",{get:function(){return void 0!==this.currentLocation?this.currentLocation.y:0},set:function(e){this.type===t.TemplateType.None&&(this.currentLocation.y=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this.template.size},set:function(e){this.type===t.TemplateType.None&&this.template.reset(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.template.width},set:function(e){if(this.template.width!==e&&this.type===t.TemplateType.None){var i=this.template.size;i.width=e,this.template.reset(i)}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.template.height},set:function(e){if(this.template.height!==e&&this.type===t.TemplateType.None){var i=this.template.size;i.height=e,this.template.reset(i)}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"graphics",{get:function(){return this.template.graphics},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"template",{get:function(){return this.pdfTemplate},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"type",{get:function(){return this.templateType},set:function(t){this.updateDocking(t),this.templateType=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bounds",{get:function(){return new k(new T(this.x,this.y),this.size)},set:function(e){this.type===t.TemplateType.None&&(this.location=new T(e.x,e.y),this.size=new j(e.width,e.height))},enumerable:!0,configurable:!0}),e.prototype.InitiateBounds=function(t,e,i,r,n){this.x=t,this.y=e,this.pdfTemplate=new Xt(i,r)},e.prototype.updateDocking=function(e){if(e!==t.TemplateType.None){switch(e){case t.TemplateType.Top:this.dock=t.PdfDockStyle.Top;break;case t.TemplateType.Bottom:this.dock=t.PdfDockStyle.Bottom;break;case t.TemplateType.Left:this.dock=t.PdfDockStyle.Left;break;case t.TemplateType.Right:this.dock=t.PdfDockStyle.Right}this.resetAlignment()}},e.prototype.resetAlignment=function(){this.alignment=t.PdfAlignmentStyle.None},e.prototype.setAlignment=function(e){if(this.dock===t.PdfDockStyle.None)this.alignmentStyle=e;else{var i=!1;switch(this.dock){case t.PdfDockStyle.Left:i=e===t.PdfAlignmentStyle.TopLeft||e===t.PdfAlignmentStyle.MiddleLeft||e===t.PdfAlignmentStyle.BottomLeft||e===t.PdfAlignmentStyle.None;break;case t.PdfDockStyle.Top:i=e===t.PdfAlignmentStyle.TopLeft||e===t.PdfAlignmentStyle.TopCenter||e===t.PdfAlignmentStyle.TopRight||e===t.PdfAlignmentStyle.None;break;case t.PdfDockStyle.Right:i=e===t.PdfAlignmentStyle.TopRight||e===t.PdfAlignmentStyle.MiddleRight||e===t.PdfAlignmentStyle.BottomRight||e===t.PdfAlignmentStyle.None;break;case t.PdfDockStyle.Bottom:i=e===t.PdfAlignmentStyle.BottomLeft||e===t.PdfAlignmentStyle.BottomCenter||e===t.PdfAlignmentStyle.BottomRight||e===t.PdfAlignmentStyle.None;break;case t.PdfDockStyle.Fill:i=e===t.PdfAlignmentStyle.MiddleCenter||e===t.PdfAlignmentStyle.None}i&&(this.alignmentStyle=e)}},e.prototype.draw=function(t,e){var i=t.page,r=this.calculateBounds(i,e);t.graphics.drawPdfTemplate(this.template,new T(r.x,r.y),new j(r.width,r.height))},e.prototype.calculateBounds=function(e,i){var r=this.bounds;return this.alignmentStyle!==t.PdfAlignmentStyle.None?r=this.getAlignmentBounds(e,i):this.dockStyle!==t.PdfDockStyle.None&&(r=this.getDockBounds(e,i)),r},e.prototype.getAlignmentBounds=function(e,i){this.bounds;return this.type===t.TemplateType.None?this.getSimpleAlignmentBounds(e,i):this.getTemplateAlignmentBounds(e,i)},e.prototype.getSimpleAlignmentBounds=function(e,i){var r=this.bounds,n=e.section.getActualBounds(i,e,!1),o=this.x,s=this.y;switch(this.alignmentStyle){case t.PdfAlignmentStyle.TopLeft:o=0,s=0;break;case t.PdfAlignmentStyle.TopCenter:o=(n.width-this.width)/2,s=0;break;case t.PdfAlignmentStyle.TopRight:o=n.width-this.width,s=0;break;case t.PdfAlignmentStyle.MiddleLeft:o=0,s=(n.height-this.height)/2;break;case t.PdfAlignmentStyle.MiddleCenter:o=(n.width-this.width)/2,s=(n.height-this.height)/2;break;case t.PdfAlignmentStyle.MiddleRight:o=n.width-this.width,s=(n.height-this.height)/2;break;case t.PdfAlignmentStyle.BottomLeft:o=0,s=n.height-this.height;break;case t.PdfAlignmentStyle.BottomCenter:o=(n.width-this.width)/2,s=n.height-this.height;break;case t.PdfAlignmentStyle.BottomRight:o=n.width-this.width,s=n.height-this.height}return r.x=o,r.y=s,r},e.prototype.getTemplateAlignmentBounds=function(e,i){var r=this.bounds,n=e.section,o=n.getActualBounds(i,e,!1),s=this.x,a=this.y;switch(this.alignmentStyle){case t.PdfAlignmentStyle.TopLeft:this.type===t.TemplateType.Left?(s=this.convertSign(o.x),a=0):this.type===t.TemplateType.Top&&(s=this.convertSign(o.x),a=this.convertSign(o.y));break;case t.PdfAlignmentStyle.TopCenter:s=(o.width-this.width)/2,a=this.convertSign(o.y);break;case t.PdfAlignmentStyle.TopRight:this.type===t.TemplateType.Right?(s=o.width+n.getRightIndentWidth(i,e,!1)-this.width,a=0):this.type===t.TemplateType.Top&&(s=o.width+n.getRightIndentWidth(i,e,!1)-this.width,a=this.convertSign(o.y));break;case t.PdfAlignmentStyle.MiddleLeft:s=this.convertSign(o.x),a=(o.height-this.height)/2;break;case t.PdfAlignmentStyle.MiddleCenter:s=(o.width-this.width)/2,a=(o.height-this.height)/2;break;case t.PdfAlignmentStyle.MiddleRight:s=o.width+n.getRightIndentWidth(i,e,!1)-this.width,a=(o.height-this.height)/2;break;case t.PdfAlignmentStyle.BottomLeft:this.type===t.TemplateType.Left?(s=this.convertSign(o.x),a=o.height-this.height):this.type===t.TemplateType.Bottom&&(s=this.convertSign(o.x),a=o.height+n.getBottomIndentHeight(i,e,!1)-this.height);break;case t.PdfAlignmentStyle.BottomCenter:s=(o.width-this.width)/2,a=o.height+n.getBottomIndentHeight(i,e,!1)-this.height;break;case t.PdfAlignmentStyle.BottomRight:this.type===t.TemplateType.Right?(s=o.width+n.getRightIndentWidth(i,e,!1)-this.width,a=o.height-this.height):this.type===t.TemplateType.Bottom&&(s=o.width+n.getRightIndentWidth(i,e,!1)-this.width,a=o.height+n.getBottomIndentHeight(i,e,!1)-this.height)}return r.x=s,r.y=a,r},e.prototype.getDockBounds=function(e,i){this.bounds;return this.type===t.TemplateType.None?this.getSimpleDockBounds(e,i):this.getTemplateDockBounds(e,i)},e.prototype.getSimpleDockBounds=function(e,i){this.bounds;var r=e.section.getActualBounds(i,e,!1),n=this.x,o=this.y,s=this.width,a=this.height;switch(this.dockStyle){case t.PdfDockStyle.Left:n=0,o=0,s=this.width,a=r.height;break;case t.PdfDockStyle.Top:n=0,o=0,s=r.width,a=this.height;break;case t.PdfDockStyle.Right:n=r.width-this.width,o=0,s=this.width,a=r.height;break;case t.PdfDockStyle.Bottom:n=0,o=r.height-this.height,s=r.width,a=this.height;break;case t.PdfDockStyle.Fill:n=0,n=0,s=r.width,a=r.height}return new k(n,o,s,a)},e.prototype.getTemplateDockBounds=function(e,i){this.bounds;var r=e.section,n=r.getActualBounds(i,e,!1),o=r.pageSettings.getActualSize(),s=this.x,a=this.y,h=this.width,l=this.height;switch(this.dockStyle){case t.PdfDockStyle.Left:s=this.convertSign(n.x),a=0,h=this.width,l=n.height;break;case t.PdfDockStyle.Top:s=this.convertSign(n.x),a=this.convertSign(n.y),h=o.width,l=this.height,n.height<0&&(a=o.height-n.y);break;case t.PdfDockStyle.Right:s=n.width+r.getRightIndentWidth(i,e,!1)-this.width,a=0,h=this.width,l=n.height;break;case t.PdfDockStyle.Bottom:s=this.convertSign(n.x),a=n.height+r.getBottomIndentHeight(i,e,!1)-this.height,h=o.width,l=this.height,n.height<0&&(a-=o.height);break;case t.PdfDockStyle.Fill:s=0,s=0,h=n.width,l=n.height}return new k(s,a,h,l)},e.prototype.convertSign=function(t){return 0!==t||0===t&&1/t==-1/0?-t:t},e}();t.PdfAction=B,t.PdfUriAction=x,t.PdfActionLinkAnnotation=Re,t.PdfAnnotation=Te,t.PdfAnnotationCollection=ue,t.PdfDocumentLinkAnnotation=De,t.PdfLinkAnnotation=ke,t.PdfTextWebLink=Ze,t.PdfUriAnnotation=Xe,t.Dictionary=n,t.defaultToString=r,t.PdfCatalog=Y,t.PdfDocument=Be,t.PdfDocumentBase=H,t.PdfDocumentTemplate=ge,t.PdfViewerPreferences=K,t.PdfPageNumberField=ri,t.PdfCompositeField=oi,t.PdfPageCountField=li,t.PointF=T,t.SizeF=j,t.RectangleF=k,t.Rectangle=V,t.PdfCacheCollection=ve,t.PdfCollection=se,t.PdfDestination=ci,t.PdfFunction=pi,t.PdfSampledFunction=fi,t.ProcedureSets=nt,t.PdfColor=L,t.PdfGraphics=ee,t.GetResourceEventHandler=ie,t.PdfGraphicsState=re,t.PdfMargins=$,t.PdfPen=et,t.PdfResources=Zt,t.Guid=$t,t.PdfTransformationMatrix=it,t.Matrix=rt,t.PdfBrush=R,t.PdfBrushes=bi,t.PdfSolidBrush=D,t.PdfLinearGradientBrush=Ci,t.PdfRadialGradientBrush=Oi,t.PdfTilingBrush=te,t.PdfGradientBrush=Yt,t.PdfColorBlend=Si,t.PdfBlend=wi,t.PdfTemplate=Xt,t.PdfLayoutElement=ze,t.PdfPath=lr,t.PdfArc=gr,t.PdfTextElement=qe,t.ElementLayouter=Ne,t.PdfLayoutFormat=Ae,t.PdfLayoutParams=Ie,t.PdfLayoutResult=Fe,t.TextLayouter=_e,t.TextPageLayoutResult=He,t.PdfTextLayoutResult=Ue,t.PdfFont=G,t.PdfFontMetrics=Ft,t.WidthTable=Et,t.StandardWidthTable=Gt,t.PdfStandardFont=Le,t.PdfStandardFontMetricsFactory=Oe,t.PdfStringFormat=N,t.PdfStringLayouter=I,t.PdfStringLayoutResult=F,t.LineInfo=E,t.StringTokenizer=A,t.PdfTrueTypeFont=yr,t.RtlRenderer=Kt,t.ArabicShapeRenderer=Wt,t.ArabicShape=_t,t.Bidi=Ht,t.RtlCharacters=Ut,t.ByteArray=pt,t.ImageDecoder=dt,t.PdfBitmap=yt,t.PdfImage=gt,t.PdfTransparency=st,t.PdfCrossTable=X,t.RegisteredObject=J,t.DictionaryProperties=a,t.PdfMainObjectCollection=W,t.ObjectInfo=_,t.Operators=s,t.PdfStreamWriter=tt,t.PdfWriter=z,t.PageAddedEventArgs=de,t.PdfDocumentPageCollection=Se,t.PdfPage=pe,t.PdfPageBase=le,t.PdfPageLayer=oe,t.PdfPageLayerCollection=he,t.PdfPageSettings=Q,t.PdfPageSize=Z,t.PdfPageTemplateElement=br,t.PdfSection=be,t.PageSettingsState=we,t.PdfSectionCollection=Pe,t.PdfSectionPageCollection=fe,t.PdfSectionTemplate=ye,t.PdfArray=m,t.PdfDictionary=h,t.SaveSectionCollectionEventHandler=l,t.SaveDescendantFontEventHandler=u,t.SaveFontDictionaryEventHandler=c,t.SaveAnnotationEventHandler=p,t.SaveSectionEventHandler=d,t.SaveTemplateEventHandler=f,t.PdfName=o,t.PdfNumber=g,t.PdfReference=v,t.PdfReferenceHolder=C,t.PdfStream=b,t.SaveCmapEventHandler=w,t.SaveFontProgramEventHandler=P,t.PdfString=S,t.PdfGridStyleBase=Li,t.PdfGridStyle=Ti,t.PdfGridCellStyle=ji,t.PdfGridRowStyle=ki,t.PdfBorders=Ee,t.PdfPaddings=Ge,t.PdfGridLayouter=zi,t.PdfGridLayoutResult=Wi,t.PdfGridLayoutFormat=_i,t.GridCellEventArgs=Hi,t.PdfGridBeginCellDrawEventArgs=Ui,t.PdfGridEndCellDrawEventArgs=Ki,t.PdfCancelEventArgs=qi,t.BeginPageLayoutEventArgs=Yi,t.EndPageLayoutEventArgs=Xi,t.PdfGridBeginPageLayoutEventArgs=Ji,t.PdfGridEndPageLayoutEventArgs=Zi,t.RowLayoutResult=$i,t.PdfGrid=Ei,t.PdfGridColumn=Mi,t.PdfGridColumnCollection=Di,t.PdfGridRow=Ni,t.PdfGridRowCollection=Ai,t.PdfGridHeaderCollection=Ii,t.PdfGridCell=Vi,t.PdfGridCellCollection=Ri,Object.defineProperty(t,"__esModule",{value:!0})});
|
|
10
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@syncfusion/ej2-compression"),require("@syncfusion/ej2-file-utils")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-compression","@syncfusion/ej2-file-utils"],e):e((t=t||self).ej={},t.ej2Compression,t.ej2FileUtils)}(this,function(K,V,R){"use strict";function M(t){return"[object String]"===Object.prototype.toString.call(t)?"$s"+t:"$o"+t.toString()}D.prototype.getValue=function(t){t=this.table["$"+this.toStr(t)];if(void 0!==t)return t.value},D.prototype.setValue=function(t,e){var i="$"+this.toStr(t);this.table[i];this.nElements++,this.table[i]={key:t,value:e}},D.prototype.remove=function(t){var t="$"+this.toStr(t),e=this.table[t];return delete this.table[t],this.nElements--,e.value},D.prototype.keys=function(){for(var t=[],e=Object.keys(this.table),i=0;i<e.length;i++){var r=this.table[e[i]];t.push(r.key)}return t},D.prototype.values=function(){for(var t=[],e=Object.keys(this.table),i=0;i<e.length;i++){var r=this.table[e[i]];t.push(r.value)}return t},D.prototype.containsKey=function(t){return!(void 0===this.getValue(t))},D.prototype.clear=function(){this.table={},this.nElements=0},D.prototype.size=function(){return this.nElements};var a=D;function D(t){this.table={},this.nElements=0,this.toStr=t||M}Object.defineProperty(N.prototype,"status",{get:function(){return this.status6},set:function(t){this.status6=t},enumerable:!0,configurable:!0}),Object.defineProperty(N.prototype,"isSaving",{get:function(){return this.isSaving6},set:function(t){this.isSaving6=t},enumerable:!0,configurable:!0}),Object.defineProperty(N.prototype,"objectCollectionIndex",{get:function(){return this.index6},set:function(t){this.index6=t},enumerable:!0,configurable:!0}),Object.defineProperty(N.prototype,"position",{get:function(){return this.position6},set:function(t){this.position6=t},enumerable:!0,configurable:!0}),Object.defineProperty(N.prototype,"clonedObject",{get:function(){return null},enumerable:!0,configurable:!0}),Object.defineProperty(N.prototype,"value",{get:function(){return this.internalValue},set:function(t){var e=t;null!==t&&0<t.length?this.internalValue=this.normalizeValue(e=t):this.internalValue=e},enumerable:!0,configurable:!0}),N.prototype.save=function(t){t.write(this.toString())},N.prototype.toString=function(){return this.stringStartMark+this.escapeString(this.value)},N.prototype.clone=function(t){var e=new N;return e.value=this.internalValue,e},N.prototype.escapeString=function(t){for(var e="",i=0,r=t.length;i<r;i++){var n=t[i];N.delimiters.indexOf(n);e+=n}return e},N.prototype.normalizeValue=function(t,e){return t},N.delimiters="()<>[]{}/%}",N.replacements=[" ","\t","\n","\r"];var o=N;function N(t){this.stringStartMark="/",this.internalValue="",this.isSaving6=!1,this.position6=-1,this.internalValue=this.normalizeValue(t)}t.obj="obj",t.endObj="endobj",t.r="R",t.whiteSpace=" ",t.slash="/",t.newLine="\r\n",t.stream="stream",t.endStream="endstream",t.xref="xref",t.f="f",t.n="n",t.trailer="trailer",t.startxref="startxref",t.eof="%%EOF",t.header="%PDF-1.5",t.beginText="BT",t.endText="ET",t.beginPath="m",t.appendLineSegment="l",t.stroke="S",t.fill="f",t.fillEvenOdd="f*",t.fillStroke="B",t.fillStrokeEvenOdd="B*",t.appendbeziercurve="c",t.appendRectangle="re",t.saveState="q",t.restoreState="Q",t.paintXObject="Do",t.modifyCtm="cm",t.modifyTM="Tm",t.setLineWidth="w",t.setLineCapStyle="J",t.setLineJoinStyle="j",t.setDashPattern="d",t.setFlatnessTolerance="i",t.closePath="h",t.closeStrokePath="s",t.closeFillStrokePath="b",t.setCharacterSpace="Tc",t.setWordSpace="Tw",t.setHorizontalScaling="Tz",t.setTextLeading="TL",t.setFont="Tf",t.setRenderingMode="Tr",t.setTextRise="Ts",t.setTextScaling="Tz",t.setCoords="Td",t.goToNextLine="T*",t.setText="Tj",t.setTextWithFormatting="TJ",t.setTextOnNewLine="'",t.selectcolorspaceforstroking="CS",t.selectcolorspacefornonstroking="cs",t.setrbgcolorforstroking="RG",t.setrbgcolorfornonstroking="rg",t.setcmykcolorforstroking="K",t.setcmykcolorfornonstroking="k",t.setgraycolorforstroking="G",t.setgraycolorfornonstroking="g",t.clipPath="W",t.clipPathEvenOdd="W*",t.endPath="n",t.setGraphicsState="gs",t.comment="%",t.evenOdd="*",t.setMiterLimit="M",t.setColorAndPattern="scn",t.setColorAndPatternStroking="SCN";var h=t;function t(){this.forTest="test",this.forTest=t.obj}var l=function(){this.pages="Pages",this.kids="Kids",this.count="Count",this.resources="Resources",this.type="Type",this.size="Size",this.mediaBox="MediaBox",this.parent="Parent",this.root="Root",this.decodeParms="DecodeParms",this.filter="Filter",this.font="Font",this.type1="Type1",this.baseFont="BaseFont",this.encoding="Encoding",this.subtype="Subtype",this.contents="Contents",this.procset="ProcSet",this.colorSpace="ColorSpace",this.extGState="ExtGState",this.pattern="Pattern",this.xObject="XObject",this.length="Length",this.width="Width",this.height="Height",this.bitsPerComponent="BitsPerComponent",this.image="Image",this.dctdecode="DCTDecode",this.columns="Columns",this.blackIs1="BlackIs1",this.k="K",this.s="S",this.predictor="Predictor",this.deviceRgb="DeviceRGB",this.next="Next",this.action="Action",this.link="Link",this.a="A",this.annot="Annot",this.p="P",this.c="C",this.rect="Rect",this.uri="URI",this.annots="Annots",this.ca="ca",this.CA="CA",this.xyz="XYZ",this.fit="Fit",this.dest="Dest",this.BM="BM",this.flatedecode="FlateDecode",this.rotate="Rotate",this.bBox="BBox",this.form="Form",this.w="W",this.cIDFontType2="CIDFontType2",this.cIDToGIDMap="CIDToGIDMap",this.identity="Identity",this.dw="DW",this.fontDescriptor="FontDescriptor",this.cIDSystemInfo="CIDSystemInfo",this.fontName="FontName",this.flags="Flags",this.fontBBox="FontBBox",this.missingWidth="MissingWidth",this.stemV="StemV",this.italicAngle="ItalicAngle",this.capHeight="CapHeight",this.ascent="Ascent",this.descent="Descent",this.leading="Leading",this.avgWidth="AvgWidth",this.fontFile2="FontFile2",this.maxWidth="MaxWidth",this.xHeight="XHeight",this.stemH="StemH",this.registry="Registry",this.ordering="Ordering",this.supplement="Supplement",this.type0="Type0",this.identityH="Identity-H",this.toUnicode="ToUnicode",this.descendantFonts="DescendantFonts",this.background="Background",this.shading="Shading",this.matrix="Matrix",this.antiAlias="AntiAlias",this.function="Function",this.extend="Extend",this.shadingType="ShadingType",this.coords="Coords",this.domain="Domain",this.range="Range",this.functionType="FunctionType",this.bitsPerSample="BitsPerSample",this.patternType="PatternType",this.paintType="PaintType",this.tilingType="TilingType",this.xStep="XStep",this.yStep="YStep",this.viewerPreferences="ViewerPreferences",this.centerWindow="CenterWindow",this.displayTitle="DisplayTitle",this.fitWindow="FitWindow",this.hideMenuBar="HideMenubar",this.hideToolBar="HideToolbar",this.hideWindowUI="HideWindowUI",this.pageMode="PageMode",this.pageLayout="PageLayout",this.duplex="Duplex",this.printScaling="PrintScaling"},c=(Object.defineProperty(e.prototype,"items",{get:function(){return this.primitiveItems},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this.status7},set:function(t){this.status7=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isSaving",{get:function(){return this.isSaving7},set:function(t){this.isSaving7=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"objectCollectionIndex",{get:function(){return this.index7},set:function(t){this.index7=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"clonedObject",{get:function(){return this.object},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"position",{get:function(){return this.position7},set:function(t){this.position7=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"Count",{get:function(){return this.primitiveItems.size()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"Dictionary",{get:function(){return this},enumerable:!0,configurable:!0}),e.prototype.getArchive=function(){return this.archive},e.prototype.setArchive=function(t){this.archive=t},e.prototype.setEncrypt=function(t){this.encrypt=t,this.modify()},e.prototype.getEncrypt=function(){return this.encrypt},e.prototype.freezeChanges=function(t){this.bChanged=!1},e.prototype.clone=function(t){return new e},e.prototype.modify=function(){this.bChanged=!0},e.prototype.remove=function(t){"string"!=typeof t?(this.primitiveItems.remove(t.value),this.modify()):this.remove(new o(t))},e.prototype.containsKey=function(t){return this.primitiveItems.containsKey(t.toString())},e.prototype.onBeginSave=function(){this.beginSave.sender.beginSave()},e.prototype.onFontDictionaryBeginSave=function(){this.fontDictionaryBeginSave.sender.fontDictionaryBeginSave()},e.prototype.onDescendantFontBeginSave=function(){this.descendantFontBeginSave.sender.descendantFontBeginSave()},e.prototype.onTemplateBeginSave=function(){this.pageBeginDrawTemplate.sender.pageBeginSave()},e.prototype.onBeginAnnotationSave=function(){this.annotationBeginSave.sender.beginSave()},e.prototype.onSectionBeginSave=function(t){var e=this.sectionBeginSave;e.sender.beginSave(e.state,t)},e.prototype.save=function(t,e){void 0===e?this.save(t,!0):(t.write(this.prefix),void 0!==this.beginSave&&this.onBeginSave(),void 0!==this.descendantFontBeginSave&&this.onDescendantFontBeginSave(),void 0!==this.fontDictionaryBeginSave&&this.onFontDictionaryBeginSave(),void 0!==this.annotationBeginSave&&this.onBeginAnnotationSave(),void 0!==this.sectionBeginSave&&this.onSectionBeginSave(t),void 0!==this.pageBeginDrawTemplate&&this.onTemplateBeginSave(),0<this.Count&&this.saveItems(t),t.write(this.suffix),t.write(h.newLine))},e.prototype.saveItems=function(t){t.write(h.newLine);for(var e=this.primitiveItems.keys(),i=this.primitiveItems.values(),r=0;r<e.length;r++){var n=e[r];new o(n).save(t),t.write(h.whiteSpace),i[r].save(t),t.write(h.newLine)}},e);function e(t){if(this.position7=-1,this.primitiveItems=new a,this.prefix="<<",this.suffix=">>",this.resources=[],this.object=null,this.archive=!0,this.isResource=!1,void 0===t)this.primitiveItems=new a;else{this.primitiveItems=new a;for(var e=t.items.keys(),i=t.items.values(),r=0;r<t.items.size();r++)this.primitiveItems.setValue(e[r],i[r]);this.status=t.status,this.freezeChanges(this)}this.encrypt=!0,this.dictionaryProperties=new l}var A=function(t){this.sender=t},I=function(t){this.sender=t},F=function(t){this.sender=t},E=function(t){this.sender=t},G=function(t,e){this.sender=t,this.state=e},z=function(t){this.sender=t},u=(Object.defineProperty(W.prototype,"intValue",{get:function(){return this.value},set:function(t){this.value=t},enumerable:!0,configurable:!0}),Object.defineProperty(W.prototype,"isInteger",{get:function(){return this.integer},set:function(t){this.integer=t},enumerable:!0,configurable:!0}),Object.defineProperty(W.prototype,"status",{get:function(){return this.status5},set:function(t){this.status5=t},enumerable:!0,configurable:!0}),Object.defineProperty(W.prototype,"isSaving",{get:function(){return this.isSaving5},set:function(t){this.isSaving5=t},enumerable:!0,configurable:!0}),Object.defineProperty(W.prototype,"objectCollectionIndex",{get:function(){return this.index5},set:function(t){this.index5=t},enumerable:!0,configurable:!0}),Object.defineProperty(W.prototype,"position",{get:function(){return this.position5},set:function(t){this.position5=t},enumerable:!0,configurable:!0}),Object.defineProperty(W.prototype,"clonedObject",{get:function(){return null},enumerable:!0,configurable:!0}),W.prototype.save=function(t){t.write(this.intValue.toString())},W.prototype.clone=function(t){return new W(this.value)},W.floatToString=function(t){t=t.toFixed(2);return t="0.00"===t?".00":t},W.min=function(t,e,i){t=Math.min(t,e);return Math.min(i,t)},W);function W(t){this.position5=-1,this.value=t}s.prototype.items=function(t){return this.internalElements[t]},Object.defineProperty(s.prototype,"count",{get:function(){return this.internalElements.length},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"status",{get:function(){return this.status9},set:function(t){this.status9=t},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"isSaving",{get:function(){return this.isSaving9},set:function(t){this.isSaving9=t},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"clonedObject",{get:function(){return this.clonedObject9},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"position",{get:function(){return this.position9},set:function(t){this.position9=t},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"objectCollectionIndex",{get:function(){return this.index9},set:function(t){this.index9=t},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"CrossTable",{get:function(){return this.pdfCrossTable},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"elements",{get:function(){return this.internalElements},enumerable:!0,configurable:!0}),s.prototype.add=function(t){void 0===this.internalElements&&(this.internalElements=[]),this.internalElements.push(t),this.markedChange()},s.prototype.markedChange=function(){this.bChanged=!0},s.prototype.contains=function(t){for(var e=0;e<this.internalElements.length;e++){var i=this.internalElements[e],r=t;if(null!=i&&void 0!==i&&null!=r&&void 0!==r&&i.value===r.value)return!0}return!1},s.prototype.getItems=function(t){return this.internalElements[t]},s.prototype.save=function(t){t.write(this.startMark);for(var e=0,i=this.count;e<i;e++)this.getItems(e).save(t),e+1!==i&&t.write(h.whiteSpace);t.write(this.endMark)},s.prototype.clone=function(t){this.clonedObject9=null;for(var e=new s,i=0;i<this.internalElements.length;i++){var r=this.internalElements[i];e.add(r.clone(t))}return e.pdfCrossTable=t,this.clonedObject9=e},s.fromRectangle=function(t){return new s([t.x,t.y,t.width,t.height])},s.prototype.insert=function(t,e){if(t<this.internalElements.length&&0<t){for(var i=[],r=0;r<t;r++)i.push(this.internalElements[r]);i.push(e);for(r=t;r<this.internalElements.length;r++)i.push(this.internalElements[r]);this.internalElements=i}else this.internalElements.push(e);this.markChanged()},s.prototype.indexOf=function(t){return this.internalElements.indexOf(t)},s.prototype.remove=function(t){t=this.internalElements.indexOf(t);this.internalElements[t]=null,this.markChanged()},s.prototype.removeAt=function(t){if(this.internalElements.length>t){for(var e=[],i=0;i<t;i++)e.push(this.internalElements[i]);for(i=t+1;i<this.internalElements.length;i++)e.push(this.internalElements[i]);this.internalElements=e}this.markChanged()},s.prototype.clear=function(){this.internalElements=[],this.markChanged()},s.prototype.markChanged=function(){this.bChanged=!0};var p=s;function s(t){if(this.startMark="[",this.endMark="]",this.position9=-1,this.clonedObject9=null,this.isFont=!1,void 0===t)this.internalElements=[];else if(void 0===t||t instanceof s){var e=t;this.internalElements=[];for(r=0;r<e.elements.length;r++)this.internalElements.push(e.elements[r])}else for(var i=t,r=0;r<i.length;r++){var n=new u(i[r]);this.add(n)}}_=function(t,e){return(_=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}_(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(Z,H=c),Object.defineProperty(Z.prototype,"internalStream",{get:function(){return this.dataStream2},set:function(t){this.dataStream2=[],this.dataStream2=t,this.modify()},enumerable:!0,configurable:!0}),Object.defineProperty(Z.prototype,"compress",{get:function(){return this.bCompress},set:function(t){this.bCompress=t,this.modify()},enumerable:!0,configurable:!0}),Object.defineProperty(Z.prototype,"data",{get:function(){return this.dataStream2},set:function(t){this.dataStream2=[],this.dataStream2=t,this.modify()},enumerable:!0,configurable:!0}),Z.prototype.clearStream=function(){this.internalStream=[],this.items.containsKey(this.dictionaryProperties.filter)&&this.remove(this.dictionaryProperties.filter),this.bCompress=!0,this.modify()},Z.prototype.write=function(t){if(null==t)throw new Error("ArgumentNullException:text");if(t.length<=0)throw new Error("ArgumentException: Can not write an empty string, text");this.dataStream2.push(t),this.modify()},Z.prototype.writeBytes=function(t){if(null===t)throw new Error("ArgumentNullException:data");if(t.length<=0)throw new Error("ArgumentException: Can not write an empty bytes, data");for(var e="",i=0;i<t.length;i++)e+=String.fromCharCode(t[i]);this.dataStream2.push(e),this.modify()},Z.prototype.onCmapBeginSave=function(){this.cmapBeginSave.sender.cmapBeginSave()},Z.prototype.onFontProgramBeginSave=function(){this.fontProgramBeginSave.sender.fontProgramBeginSave()},Z.prototype.compressContent=function(t,e){if(this.bCompress){for(var i=[],r=0;r<t.length;r++)i.push(t.charCodeAt(r));var n=new Uint8Array(i),o=new V.CompressedStreamWriter;o.write(n,0,n.length),o.close(),t=o.getCompressedString,this.addFilter(this.dictionaryProperties.flatedecode)}return t},Z.prototype.addFilter=function(t){var e=this.items.getValue(this.dictionaryProperties.filter),i=e=e instanceof d?e.object:e;null!=e&&((i=new p).insert(0,e),this.items.setValue(this.dictionaryProperties.filter,i)),e=new o(t),null==i?this.items.setValue(this.dictionaryProperties.filter,e):i.insert(0,e)},Z.prototype.save=function(t){void 0!==this.cmapBeginSave&&this.onCmapBeginSave(),void 0!==this.fontProgramBeginSave&&this.onFontProgramBeginSave();for(var e="",i=0;i<this.data.length;i++)e+=this.data[i];1<e.length&&!this.isResource&&(e="q\r\n"+e+"Q\r\n");var r=(e=this.compressContent(e,t)).length;this.items.setValue(this.dictionaryProperties.length,new u(r)),H.prototype.save.call(this,t,!1),t.write(this.dicPrefix),t.write(h.newLine),0<e.length&&t.write(e),t.write(h.newLine),t.write(this.dicSuffix),t.write(h.newLine)},Z.bytesToString=function(t){for(var e="",i=0;i<t.length;i++)e+=String.fromCharCode(t[i]);return e};var _,H,U=Z;function Z(t,e){var i=H.call(this,t)||this;return i.dicPrefix="stream",i.dicSuffix="endstream",i.clonedObject2=null,i.bCompress=!0,void 0!==t||void 0!==e?(i.dataStream2=[],i.dataStream2=e,i.bCompress2=!1):(i.dataStream2=[],i.bCompress2=!0),i}var $=function(t){this.sender=t},Q=function(t){this.sender=t},tt=((nt=(nt=K.InternalEnum||(K.InternalEnum={})).ForceEncoding||(nt.ForceEncoding={}))[nt.None=0]="None",nt[nt.Ascii=1]="Ascii",nt[nt.Unicode=2]="Unicode",Object.defineProperty(r.prototype,"hex",{get:function(){return this.bHex},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"value",{get:function(){return this.stringValue},set:function(t){this.stringValue=t,this.data=null},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"status",{get:function(){return this.status1},set:function(t){this.status1=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"isSaving",{get:function(){return this.isSaving1},set:function(t){this.isSaving1=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"objectCollectionIndex",{get:function(){return this.index1},set:function(t){this.index1=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"clonedObject",{get:function(){return this.clonedObject1},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"position",{get:function(){return this.position1},set:function(t){this.position1=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"CrossTable",{get:function(){return this.crossTable},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"converted",{get:function(){return this.bConverted},set:function(t){this.bConverted=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"encode",{get:function(){return this.bForceEncoding},set:function(t){this.bForceEncoding=t},enumerable:!0,configurable:!0}),r.bytesToHex=function(t){return null!=t&&0,""},r.prototype.save=function(t){if(null===t)throw new Error("ArgumentNullException : writer");void 0!==this.encode&&this.encode===K.InternalEnum.ForceEncoding.Ascii?t.write(this.pdfEncode()):t.write(r.stringMark[0]+this.value+r.stringMark[1])},r.prototype.pdfEncode=function(){var t="";if(void 0!==this.encode&&this.encode===K.InternalEnum.ForceEncoding.Ascii){for(var e=this.escapeSymbols(this.value),i=0;i<e.length;i++)t+=String.fromCharCode(e[i]);t=r.stringMark[0]+t+r.stringMark[1]}else t=this.value;return t},r.prototype.escapeSymbols=function(t){for(var e=[],i=0;i<t.length;i++){var r=t.charCodeAt(i);switch(r){case 40:case 41:e.push(92),e.push(r);break;case 13:e.push(92),e.push(114);break;case 92:e.push(92),e.push(r);break;default:e.push(r)}}return e},r.prototype.clone=function(t){if(null!==this.clonedObject1&&this.clonedObject1.CrossTable===t)return this.clonedObject1;this.clonedObject1=null;var e=new r(this.stringValue);return e.bHex=this.bHex,e.crossTable=t,e.isColorSpace=this.isColorSpace,this.clonedObject1=e},r.toUnicodeArray=function(t,e){if(null==t)throw new Error("Argument Null Exception : value");for(var i=[],r=0;r<t.length;r++){var n=t.charCodeAt(r);i.push(n/256>>>0),i.push(255&n)}return i},r.byteToString=function(t){if(null==t)throw new Error("Argument Null Exception : stream");for(var e="",i=0;i<t.length;++i)e+=String.fromCharCode(t[i]);return e},r.stringMark="()",r.hexStringMark="<>",r.hexFormatPattern="{0:X2}",r);function r(t){if(this.bHex=!1,this.position1=-1,this.clonedObject1=null,this.bDecrypted=!1,this.isParentDecrypted=!1,this.isPacked=!1,this.isFormField=!1,this.isColorSpace=!1,this.isHexString=!0,void 0===t)this.bHex=!1;else if(!(0<t.length&&"0xfeff"===t[0])){this.stringValue=t,this.data=[];for(var e=0;e<t.length;++e)this.data.push(t.charCodeAt(e))}}Object.defineProperty(it.prototype,"status",{get:function(){return this.status3},set:function(t){this.status3=t},enumerable:!0,configurable:!0}),Object.defineProperty(it.prototype,"isSaving",{get:function(){return this.isSaving3},set:function(t){this.isSaving3=t},enumerable:!0,configurable:!0}),Object.defineProperty(it.prototype,"objectCollectionIndex",{get:function(){return this.index3},set:function(t){this.index3=t},enumerable:!0,configurable:!0}),Object.defineProperty(it.prototype,"position",{get:function(){return this.position3},set:function(t){this.position3=t},enumerable:!0,configurable:!0}),Object.defineProperty(it.prototype,"clonedObject",{get:function(){return null},enumerable:!0,configurable:!0}),it.prototype.save=function(t){t.write(this.toString())},it.prototype.toString=function(){return this.objNumber.toString()+" "+this.genNumber.toString()+" R"},it.prototype.clone=function(t){return null};var et=it;function it(t,e){this.index3=-1,this.position3=-1,this.objNumber=0,this.genNumber=0,"number"==typeof t&&"number"==typeof e?(this.objNumber=t,this.genNumber=e):(this.objNumber=Number(t),this.genNumber=Number(e))}Object.defineProperty(rt.prototype,"status",{get:function(){return this.status4},set:function(t){this.status4=t},enumerable:!0,configurable:!0}),Object.defineProperty(rt.prototype,"isSaving",{get:function(){return this.isSaving4},set:function(t){this.isSaving4=t},enumerable:!0,configurable:!0}),Object.defineProperty(rt.prototype,"objectCollectionIndex",{get:function(){return this.index4},set:function(t){this.index4=t},enumerable:!0,configurable:!0}),Object.defineProperty(rt.prototype,"position",{get:function(){return this.position4},set:function(t){this.position4=t},enumerable:!0,configurable:!0}),Object.defineProperty(rt.prototype,"clonedObject",{get:function(){return null},enumerable:!0,configurable:!0}),Object.defineProperty(rt.prototype,"object",{get:function(){return this.primitiveObject},enumerable:!0,configurable:!0}),Object.defineProperty(rt.prototype,"reference",{get:function(){return this.pdfReference},enumerable:!0,configurable:!0}),Object.defineProperty(rt.prototype,"index",{get:function(){return this.objectIndex},enumerable:!0,configurable:!0}),Object.defineProperty(rt.prototype,"element",{get:function(){return this.primitiveObject},enumerable:!0,configurable:!0}),rt.prototype.initialize=function(t){t instanceof p||t instanceof c||t instanceof o||t instanceof u||t instanceof U||t instanceof et||t instanceof tt?this.primitiveObject=t:this.initialize(t.element)},rt.prototype.save=function(t){t.position;var e=t.document.crossTable;this.object.isSaving=!0;e.getReference(this.object).save(t)},rt.prototype.clone=function(t){return null};var d=rt;function rt(t,e){this.index4=-1,this.position4=-1,this.objectIndex=-1,this.dictionaryProperties=new l,this.initialize(t)}Object.defineProperty(ot.prototype,"next",{get:function(){return this.action},set:function(t){this.action=t,this.dictionary.items.setValue(this.dictionaryProperties.next,new d(this.action))},enumerable:!0,configurable:!0}),Object.defineProperty(ot.prototype,"dictionary",{get:function(){return void 0===this.pdfDictionary&&(this.pdfDictionary=new c),this.pdfDictionary},enumerable:!0,configurable:!0}),ot.prototype.initialize=function(){this.dictionary.items.setValue(this.dictionaryProperties.type,new o(this.dictionaryProperties.action))},Object.defineProperty(ot.prototype,"element",{get:function(){return this.dictionary},enumerable:!0,configurable:!0});var nt=ot;function ot(){this.action=null,this.dictionaryProperties=new l,this.initialize()}st=function(t,e){return(st=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}st(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(lt,at=nt),Object.defineProperty(lt.prototype,"uri",{get:function(){return this.uniformResourceIdentifier},set:function(t){this.uniformResourceIdentifier=t,this.dictionary.items.setValue(this.dictionaryProperties.uri,new tt(this.uniformResourceIdentifier))},enumerable:!0,configurable:!0}),lt.prototype.initialize=function(){at.prototype.initialize.call(this),this.dictionary.items.setValue(this.dictionaryProperties.s,new o(this.dictionaryProperties.uri))};var st,at,ht=lt;function lt(t){var e=at.call(this)||this;return e.uniformResourceIdentifier="",e}(i=K.PdfHorizontalAlignment||(K.PdfHorizontalAlignment={}))[i.Left=0]="Left",i[i.Center=1]="Center",i[i.Right=2]="Right",(i=K.PdfVerticalAlignment||(K.PdfVerticalAlignment={}))[i.Top=0]="Top",i[i.Middle=1]="Middle",i[i.Bottom=2]="Bottom",(i=K.PdfTextAlignment||(K.PdfTextAlignment={}))[i.Left=0]="Left",i[i.Center=1]="Center",i[i.Right=2]="Right",i[i.Justify=3]="Justify",(i=K.TextRenderingMode||(K.TextRenderingMode={}))[i.Fill=0]="Fill",i[i.Stroke=1]="Stroke",i[i.FillStroke=2]="FillStroke",i[i.None=3]="None",i[i.ClipFlag=4]="ClipFlag",i[i.ClipFill=4]="ClipFill",i[i.ClipStroke=5]="ClipStroke",i[i.ClipFillStroke=6]="ClipFillStroke",i[i.Clip=7]="Clip",(i=K.PdfLineJoin||(K.PdfLineJoin={}))[i.Miter=0]="Miter",i[i.Round=1]="Round",i[i.Bevel=2]="Bevel",(i=K.PdfLineCap||(K.PdfLineCap={}))[i.Flat=0]="Flat",i[i.Round=1]="Round",i[i.Square=2]="Square",(i=K.PdfDashStyle||(K.PdfDashStyle={}))[i.Solid=0]="Solid",i[i.Dash=1]="Dash",i[i.Dot=2]="Dot",i[i.DashDot=3]="DashDot",i[i.DashDotDot=4]="DashDotDot",i[i.Custom=5]="Custom",(i=K.PdfFillMode||(K.PdfFillMode={}))[i.Winding=0]="Winding",i[i.Alternate=1]="Alternate",(i=K.PdfColorSpace||(K.PdfColorSpace={}))[i.Rgb=0]="Rgb",i[i.Cmyk=1]="Cmyk",i[i.GrayScale=2]="GrayScale",i[i.Indexed=3]="Indexed",(i=K.PdfBlendMode||(K.PdfBlendMode={}))[i.Normal=0]="Normal",i[i.Multiply=1]="Multiply",i[i.Screen=2]="Screen",i[i.Overlay=3]="Overlay",i[i.Darken=4]="Darken",i[i.Lighten=5]="Lighten",i[i.ColorDodge=6]="ColorDodge",i[i.ColorBurn=7]="ColorBurn",i[i.HardLight=8]="HardLight",i[i.SoftLight=9]="SoftLight",i[i.Difference=10]="Difference",i[i.Exclusion=11]="Exclusion",i[i.Hue=12]="Hue",i[i.Saturation=13]="Saturation",i[i.Color=14]="Color",i[i.Luminosity=15]="Luminosity",(i=K.PdfGraphicsUnit||(K.PdfGraphicsUnit={}))[i.Centimeter=0]="Centimeter",i[i.Pica=1]="Pica",i[i.Pixel=2]="Pixel",i[i.Point=3]="Point",i[i.Inch=4]="Inch",i[i.Document=5]="Document",i[i.Millimeter=6]="Millimeter",(i=K.PdfGridImagePosition||(K.PdfGridImagePosition={}))[i.Fit=0]="Fit",i[i.Center=1]="Center",i[i.Stretch=2]="Stretch",i[i.Tile=3]="Tile",(i=K.PdfTextDirection||(K.PdfTextDirection={}))[i.None=0]="None",i[i.LeftToRight=1]="LeftToRight",i[i.RightToLeft=2]="RightToLeft";g.prototype.assignRGB=function(t,e,i,r){void 0===t||void 0===e||void 0===i?this.filled=!1:(this.cyanColor=0,this.magentaColor=0,this.yellowColor=0,this.blackColor=0,this.grayColor=0,this.redColor=t,this.greenColor=e,this.blueColor=i,this.alpha=void 0===r?g.maxColourChannelValue:r,this.filled=!0,this.assignCMYK(t,e,i))},g.prototype.assignCMYK=function(t,e,i){var t=t/g.maxColourChannelValue,e=e/g.maxColourChannelValue,i=i/g.maxColourChannelValue,r=u.min(1-t,1-e,1-i),t=1===r?0:(1-t-r)/(1-r),e=1===r?0:(1-e-r)/(1-r),i=1===r?0:(1-i-r)/(1-r);this.blackColor=r,this.cyanColor=t,this.magentaColor=e,this.yellowColor=i},Object.defineProperty(g.prototype,"r",{get:function(){return this.redColor},set:function(t){this.redColor=t,this.assignCMYK(this.redColor,this.greenColor,this.blueColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty(g.prototype,"red",{get:function(){return this.r/g.maxColourChannelValue},enumerable:!0,configurable:!0}),Object.defineProperty(g.prototype,"b",{get:function(){return this.blueColor},set:function(t){this.blueColor=t,this.assignCMYK(this.redColor,this.greenColor,this.blueColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty(g.prototype,"blue",{get:function(){return this.b/g.maxColourChannelValue},enumerable:!0,configurable:!0}),Object.defineProperty(g.prototype,"c",{get:function(){return this.cyanColor},set:function(t){this.cyanColor=t<0?0:1<t?1:t,this.assignRGB(this.cyanColor,this.magentaColor,this.yellowColor,this.blackColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty(g.prototype,"k",{get:function(){return this.blackColor},set:function(t){this.blackColor=t<0?0:1<t?1:t,this.assignRGB(this.cyanColor,this.magentaColor,this.yellowColor,this.blackColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty(g.prototype,"m",{get:function(){return this.magentaColor},set:function(t){this.magentaColor=t<0?0:1<t?1:t,this.assignRGB(this.cyanColor,this.magentaColor,this.yellowColor,this.blackColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty(g.prototype,"y",{get:function(){return this.yellowColor},set:function(t){this.yellowColor=t<0?0:1<t?1:t,this.assignRGB(this.cyanColor,this.magentaColor,this.yellowColor,this.blackColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty(g.prototype,"g",{get:function(){return this.greenColor},set:function(t){this.greenColor=t,this.assignCMYK(this.redColor,this.greenColor,this.blueColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty(g.prototype,"green",{get:function(){return this.g/g.maxColourChannelValue},enumerable:!0,configurable:!0}),Object.defineProperty(g.prototype,"gray",{get:function(){return(this.redColor+this.greenColor+this.blueColor)/(3*g.maxColourChannelValue)},set:function(t){this.grayColor=t<0?0:1<t?1:t,this.r=this.grayColor*g.maxColourChannelValue,this.g=this.grayColor*g.maxColourChannelValue,this.b=this.grayColor*g.maxColourChannelValue,this.assignCMYK(this.redColor,this.greenColor,this.blueColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty(g.prototype,"isEmpty",{get:function(){return!this.filled},enumerable:!0,configurable:!0}),Object.defineProperty(g.prototype,"a",{get:function(){return this.alpha},set:function(t){this.alpha=t<0?0:t,this.filled=!0},enumerable:!0,configurable:!0}),g.prototype.toString=function(t,e){if(this.isEmpty)return"";var i="";switch(t){case K.PdfColorSpace.Rgb:i=this.rgbToString(e);break;case K.PdfColorSpace.GrayScale:i=this.grayScaleToString(e);break;case K.PdfColorSpace.Cmyk:i=this.cmykToString(e)}return i},g.prototype.grayScaleToString=function(t){var e=this.gray,i="",r=null;return null==(r=t?g.grayStringsSroke.containsKey(e)?g.grayStringsSroke.getValue(e):null:g.grayStringsFill.containsKey(e)?g.grayStringsFill.getValue(e):null)?t&&(i=e.toString()+" G",g.grayStringsSroke.setValue(e,i)):i=r.toString(),i+h.newLine},g.prototype.rgbToString=function(t){var e=this.r,i=this.g,r=this.b,n=(e<<16)+(i<<8)+r,o=(t&&(n+=1<<24),""),s=null;return null==(s=g.rgbStrings.containsKey(n)?g.rgbStrings.getValue(n):s)?(e=e/g.maxColourChannelValue,i=i/g.maxColourChannelValue,r=r/g.maxColourChannelValue,o=t?e.toString()+" "+i.toString()+" "+r.toString()+" RG":e.toString()+" "+i.toString()+" "+r.toString()+" rg",g.rgbStrings.setValue(n,o)):o=s.toString(),o+h.newLine},g.prototype.cmykToString=function(t){var e=this.c,i=this.m,r=this.y,n=this.b;return e.toString()+" "+i.toString()+" "+r.toString()+" "+n.toString()+" K"+h.newLine},g.prototype.toArray=function(t){var e=new p;return t===K.PdfColorSpace.Rgb&&(e.add(new u(this.red)),e.add(new u(this.green)),e.add(new u(this.blue))),e},g.rgbStrings=new a,g.grayStringsSroke=new a,g.grayStringsFill=new a,g.maxColourChannelValue=255;var f=g;function g(t,e,i,r){void 0===t?void 0!==e&&void 0!==i&&void 0!==r?this.assignRGB(e,i,r):this.filled=!1:t instanceof g?(this.redColor=t.r,this.greenColor=t.g,this.blueColor=t.b,this.grayColor=t.gray,this.alpha=t.alpha,this.filled=0!==this.alpha):"number"==typeof t&&void 0===e&&void 0===i&&void 0===r?(this.redColor=(t=1<(t=t<0?0:t)?1:t)*g.maxColourChannelValue,this.greenColor=t*g.maxColourChannelValue,this.blueColor=t*g.maxColourChannelValue,this.cyanColor=t,this.magentaColor=t,this.yellowColor=t,this.blackColor=t,this.grayColor=t,this.alpha=g.maxColourChannelValue,this.filled=!0):void 0===r?this.assignRGB(t,e,i):this.assignRGB(e,i,r,t)}var q=function(t,e){void 0===t?(this.x=0,this.y=0):(this.x=null!==t?t:0,this.y=null!==e?e:0)},Y=function(t,e){void 0===e?(this.height=0,this.width=0):(this.height=null!==e?e:0,this.width=null!==t?t:0)},X=function(t,e,i,r){var n;typeof t==typeof t&&void 0===t?(this.x=0,this.y=0,this.height=0,this.width=0):t instanceof q&&e instanceof Y&&void 0===i?(this.x=(n=t).x,this.y=n.y,this.height=(n=e).height,this.width=n.width):(n=e,e=i,i=r,this.x=t,this.y=n,this.height=i,this.width=e)},ut=(Object.defineProperty(ct.prototype,"width",{get:function(){return this.right-this.left},enumerable:!0,configurable:!0}),Object.defineProperty(ct.prototype,"height",{get:function(){return this.bottom-this.top},enumerable:!0,configurable:!0}),Object.defineProperty(ct.prototype,"topLeft",{get:function(){return new q(this.left,this.top)},enumerable:!0,configurable:!0}),Object.defineProperty(ct.prototype,"size",{get:function(){return new Y(this.width,this.height)},enumerable:!0,configurable:!0}),ct.prototype.toString=function(){return this.topLeft+"x"+this.size},ct);function ct(t,e,i,r){this.left=t,this.top=e,this.right=i,this.bottom=r}dt.prototype.clone=function(){return this};var pt=dt;function dt(){}ft=function(t,e){return(ft=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}ft(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(yt,gt=pt),Object.defineProperty(yt.prototype,"color",{get:function(){return this.pdfColor},set:function(t){this.pdfColor=t},enumerable:!0,configurable:!0}),yt.prototype.monitorChanges=function(t,e,i,r,n){if(null==e)throw new Error("ArgumentNullException:streamWriter");var o=!1;return e.setColorAndSpace(this.pdfColor,n,!(o=!0)),o},yt.prototype.resetChanges=function(t){t.setColorAndSpace(new f(0,0,0),K.PdfColorSpace.Rgb,!1)};var ft,gt,mt=yt;function yt(t){var e=gt.call(this)||this;return e.pdfColor=t,e}(i=K.PdfFontStyle||(K.PdfFontStyle={}))[i.Regular=0]="Regular",i[i.Bold=1]="Bold",i[i.Italic=2]="Italic",i[i.Underline=4]="Underline",i[i.Strikeout=8]="Strikeout",(i=K.PdfFontFamily||(K.PdfFontFamily={}))[i.Helvetica=0]="Helvetica",i[i.Courier=1]="Courier",i[i.TimesRoman=2]="TimesRoman",i[i.Symbol=3]="Symbol",i[i.ZapfDingbats=4]="ZapfDingbats",(i=K.PdfFontType||(K.PdfFontType={}))[i.Standard=0]="Standard",i[i.TrueType=1]="TrueType",i[i.TrueTypeEmbedded=2]="TrueTypeEmbedded",(i=K.PdfWordWrapType||(K.PdfWordWrapType={}))[i.None=0]="None",i[i.Word=1]="Word",i[i.WordOnly=2]="WordOnly",i[i.Character=3]="Character",(i=K.PdfSubSuperScript||(K.PdfSubSuperScript={}))[i.None=0]="None",i[i.SuperScript=1]="SuperScript",i[i.SubScript=2]="SubScript",(i=K.FontEncoding||(K.FontEncoding={}))[i.Unknown=0]="Unknown",i[i.StandardEncoding=1]="StandardEncoding",i[i.MacRomanEncoding=2]="MacRomanEncoding",i[i.MacExpertEncoding=3]="MacExpertEncoding",i[i.WinAnsiEncoding=4]="WinAnsiEncoding",i[i.PdfDocEncoding=5]="PdfDocEncoding",i[i.IdentityH=6]="IdentityH",(i=K.TtfCmapFormat||(K.TtfCmapFormat={}))[i.Apple=0]="Apple",i[i.Microsoft=4]="Microsoft",i[i.Trimmed=6]="Trimmed",(i=K.TtfCmapEncoding||(K.TtfCmapEncoding={}))[i.Unknown=0]="Unknown",i[i.Symbol=1]="Symbol",i[i.Unicode=2]="Unicode",i[i.Macintosh=3]="Macintosh",(i=K.TtfPlatformID||(K.TtfPlatformID={}))[i.AppleUnicode=0]="AppleUnicode",i[i.Macintosh=1]="Macintosh",i[i.Iso=2]="Iso",i[i.Microsoft=3]="Microsoft",(i=K.TtfMicrosoftEncodingID||(K.TtfMicrosoftEncodingID={}))[i.Undefined=0]="Undefined",i[i.Unicode=1]="Unicode",(i=K.TtfMacintoshEncodingID||(K.TtfMacintoshEncodingID={}))[i.Roman=0]="Roman",i[i.Japanese=1]="Japanese",i[i.Chinese=2]="Chinese",(i=K.FontDescriptorFlags||(K.FontDescriptorFlags={}))[i.FixedPitch=1]="FixedPitch",i[i.Serif=2]="Serif",i[i.Symbolic=4]="Symbolic",i[i.Script=8]="Script",i[i.Nonsymbolic=32]="Nonsymbolic",i[i.Italic=64]="Italic",i[i.ForceBold=262144]="ForceBold",(i=K.TtfCompositeGlyphFlags||(K.TtfCompositeGlyphFlags={}))[i.Arg1And2AreWords=1]="Arg1And2AreWords",i[i.ArgsAreXyValues=2]="ArgsAreXyValues",i[i.RoundXyToGrid=4]="RoundXyToGrid",i[i.WeHaveScale=8]="WeHaveScale",i[i.Reserved=16]="Reserved",i[i.MoreComponents=32]="MoreComponents",i[i.WeHaveAnXyScale=64]="WeHaveAnXyScale",i[i.WeHaveTwoByTwo=128]="WeHaveTwoByTwo",i[i.WeHaveInstructions=256]="WeHaveInstructions",i[i.UseMyMetrics=512]="UseMyMetrics";Object.defineProperty(wt.prototype,"alignment",{get:function(){return this.textAlignment},set:function(t){this.textAlignment=t},enumerable:!0,configurable:!0}),Object.defineProperty(wt.prototype,"textDirection",{get:function(){return this.direction},set:function(t){this.direction=t},enumerable:!0,configurable:!0}),Object.defineProperty(wt.prototype,"lineAlignment",{get:function(){return void 0===this.verticalAlignment||null==this.verticalAlignment?K.PdfVerticalAlignment.Top:this.verticalAlignment},set:function(t){this.verticalAlignment=t},enumerable:!0,configurable:!0}),Object.defineProperty(wt.prototype,"rightToLeft",{get:function(){return void 0!==this.isRightToLeft&&null!=this.isRightToLeft&&this.isRightToLeft},set:function(t){this.isRightToLeft=t},enumerable:!0,configurable:!0}),Object.defineProperty(wt.prototype,"characterSpacing",{get:function(){return void 0===this.internalCharacterSpacing||null==this.internalCharacterSpacing?0:this.internalCharacterSpacing},set:function(t){this.internalCharacterSpacing=t},enumerable:!0,configurable:!0}),Object.defineProperty(wt.prototype,"wordSpacing",{get:function(){return void 0===this.internalWordSpacing||null==this.internalWordSpacing?0:this.internalWordSpacing},set:function(t){this.internalWordSpacing=t},enumerable:!0,configurable:!0}),Object.defineProperty(wt.prototype,"lineSpacing",{get:function(){return void 0===this.leading||null==this.leading?0:this.leading},set:function(t){this.leading=t},enumerable:!0,configurable:!0}),Object.defineProperty(wt.prototype,"clipPath",{get:function(){return void 0!==this.clip&&null!=this.clip&&this.clip},set:function(t){this.clip=t},enumerable:!0,configurable:!0}),Object.defineProperty(wt.prototype,"subSuperScript",{get:function(){return void 0===this.pdfSubSuperScript||null==this.pdfSubSuperScript?K.PdfSubSuperScript.None:this.pdfSubSuperScript},set:function(t){this.pdfSubSuperScript=t},enumerable:!0,configurable:!0}),Object.defineProperty(wt.prototype,"paragraphIndent",{get:function(){return void 0===this.internalParagraphIndent||null==this.internalParagraphIndent?0:this.internalParagraphIndent},set:function(t){this.internalParagraphIndent=t,this.firstLineIndent=t},enumerable:!0,configurable:!0}),Object.defineProperty(wt.prototype,"lineLimit",{get:function(){return this.internalLineLimit},set:function(t){this.internalLineLimit=t},enumerable:!0,configurable:!0}),Object.defineProperty(wt.prototype,"measureTrailingSpaces",{get:function(){return void 0!==this.trailingSpaces&&null!=this.trailingSpaces&&this.trailingSpaces},set:function(t){this.trailingSpaces=t},enumerable:!0,configurable:!0}),Object.defineProperty(wt.prototype,"noClip",{get:function(){return void 0!==this.isNoClip&&null!=this.isNoClip&&this.isNoClip},set:function(t){this.isNoClip=t},enumerable:!0,configurable:!0}),Object.defineProperty(wt.prototype,"wordWrap",{get:function(){return this.wordWrapType},set:function(t){this.wordWrapType=t},enumerable:!0,configurable:!0}),Object.defineProperty(wt.prototype,"horizontalScalingFactor",{get:function(){return this.scalingFactor},set:function(t){if(t<=0)throw new Error("ArgumentOutOfRangeException:The scaling factor cant be less of equal to zero, ScalingFactor");this.scalingFactor=t},enumerable:!0,configurable:!0}),Object.defineProperty(wt.prototype,"firstLineIndent",{get:function(){return void 0===this.initialLineIndent||null==this.initialLineIndent?0:this.initialLineIndent},set:function(t){this.initialLineIndent=t},enumerable:!0,configurable:!0}),wt.prototype.clone=function(){return this};var bt=wt;function wt(t,e){this.scalingFactor=100,this.wordWrapType=K.PdfWordWrapType.Word,this.internalLineLimit=!0,this.wordWrapType=K.PdfWordWrapType.Word,void 0!==t&&"string"!=typeof t&&(this.textAlignment=t),void 0!==e&&(this.verticalAlignment=e)}Object.defineProperty(St.prototype,"length",{get:function(){return this.text.length},enumerable:!0,configurable:!0}),Object.defineProperty(St.prototype,"end",{get:function(){return this.currentPosition===this.text.length},enumerable:!0,configurable:!0}),Object.defineProperty(St.prototype,"position",{get:function(){return this.currentPosition},set:function(t){this.currentPosition=t},enumerable:!0,configurable:!0}),St.getCharsCount=function(t,e){if("string"==typeof e){if(null==t)throw new Error("ArgumentNullException:wholeText");for(var i=0,r=0;-1!==(r=t.indexOf(e,r));)i++,r++;return i}if(null==t)throw new Error("ArgumentNullException:text");if(null==e)throw new Error("ArgumentNullException:symbols");for(var n=0,o=0,s=t.length;o<s;o++){var a=t[o];this.contains(e,a)&&n++}return n},St.prototype.readLine=function(){for(var t,e=this.currentPosition;e<this.length;){var i=this.text[e];switch(i){case"\r":case"\n":var r=this.text.substr(this.currentPosition,e-this.currentPosition);return this.currentPosition=e+1,"\r"===i&&this.currentPosition<this.length&&"\n"===this.text[this.currentPosition]&&this.currentPosition++,r}e++}return e>this.currentPosition?(t=this.text.substr(this.currentPosition,e-this.currentPosition),this.currentPosition=e,t):null},St.prototype.peekLine=function(){var t=this.currentPosition,e=this.readLine();return this.currentPosition=t,e},St.prototype.readWord=function(){for(var t,e=this.currentPosition;e<this.length;){var i=this.text[e];switch(i){case"\r":case"\n":var r=this.text.substr(this.currentPosition,e-this.currentPosition);return this.currentPosition=e+1,"\r"===i&&this.currentPosition<this.length&&"\n"===this.text[this.currentPosition]&&this.currentPosition++,r;case" ":case"\t":e===this.currentPosition&&e++;r=this.text.substr(this.currentPosition,e-this.currentPosition);return this.currentPosition=e,r}e++}return e>this.currentPosition?(t=this.text.substr(this.currentPosition,e-this.currentPosition),this.currentPosition=e,t):null},St.prototype.peekWord=function(){var t=this.currentPosition,e=this.readWord();return this.currentPosition=t,e},St.prototype.read=function(t){if(void 0===t)return e="0",this.end||(e=this.text[this.currentPosition],this.currentPosition++),e;for(var e,i=0,r="";!this.end&&i<t;)r+=e=this.read(),i++;return r},St.prototype.peek=function(){var t="0";return t=this.end?t:this.text[this.currentPosition]},St.prototype.close=function(){this.text=null},St.prototype.readToEnd=function(){var t=0===this.currentPosition?this.text:this.text.substr(this.currentPosition,this.length-this.currentPosition);return this.currentPosition=this.length,t},St.contains=function(t,e){for(var i=!1,r=0;r<t.length;r++)if(t[r]===e){i=!0;break}return i},St.spaces=[St.whiteSpace=" ",St.tab="\t"],St.whiteSpacePattern="^[ \t]+$";var Pt=St;function St(t){if(this.currentPosition=0,null==t)throw new Error("ArgumentNullException:text");this.text=t}Ct.prototype.layout=function(t,e,i,r,n,o,s){return s=(r instanceof X?(this.initialize(t,e,i,r,n),this.isOverloadWithPosition=o,this.clientSize=s):(this.initialize(t,e,i,r),this.isOverloadWithPosition=n,this.clientSize=o),this.doLayout()),this.clear(),s},Ct.prototype.initialize=function(t,e,i,r,n){if("number"==typeof n){if(null==t)throw new Error("ArgumentNullException:text");if(null==e)throw new Error("ArgumentNullException:font");this.text=t,this.font=e,this.format=i,this.size=new Y(r.width,r.height),this.rectangle=r,this.pageHeight=n,this.reader=new Pt(t)}else this.initialize(t,e,i,new X(new q(0,0),r),0)},Ct.prototype.clear=function(){this.font=null,this.format=null,this.reader.close(),this.reader=null,this.text=null},Ct.prototype.doLayout=function(){for(var t=new Bt,e=(new Bt,[]),i=this.reader.peekLine(),r=this.getLineIndent(!0);null!=i;){if(null!==(n=this.layoutLine(i,r))||void 0!==n){var n=this.copyToResult(t,n,e,0),o=n.success,n=n.numInserted;if(!o){this.reader.read(n);break}}this.reader.readLine(),i=this.reader.peekLine(),r=this.getLineIndent(!1)}return this.finalizeResult(t,e),t},Ct.prototype.getLineIndent=function(t){var e=0;return null!=this.format&&(e=t?this.format.firstLineIndent:this.format.paragraphIndent,e=0<this.size.width?Math.min(this.size.width,e):e),e},Ct.prototype.getLineHeight=function(){var t=this.font.height;return t=null!=this.format&&0!==this.format.lineSpacing?this.format.lineSpacing+this.font.height:t},Ct.prototype.getLineWidth=function(t){return this.font.getLineWidth(t,this.format)},Ct.prototype.layoutLine=function(t,e){var i=new Bt,r=(i.layoutLineHeight=this.getLineHeight(),[]),n=this.size.width,o=this.getLineWidth(t)+e,s=K.LineType.FirstParagraphLine,a=!0;if(n<=0||Math.round(o)<=Math.round(n))this.addToLineResult(i,r,t,o,K.LineType.NewLineBreak|s);else{var h="",l="",o=e,u=e,c=new Pt(t),p=c.peekWord();for(p.length!==c.length&&" "===p&&(l+=p,h+=p,c.position+=1,p=c.peekWord());null!=p;){l+=p;var d,f=this.getLineWidth(l.toString())+u;if(" "===l.toString()&&(l="",f=0),n<f){if(this.getWrapType()===K.PdfWordWrapType.None)break;if(l.length===p.length){if(this.getWrapType()===K.PdfWordWrapType.WordOnly){i.textRemainder=t.substring(c.position);break}if(1===l.length){h+=p;break}a=!1,l="",p=c.peek().toString()}else this.getLineWidth(p.toString())>n?this.format.wordWrap=K.PdfWordWrapType.Character:void 0!==this.format&&null!==this.format&&(this.format.wordWrap=K.PdfWordWrapType.Word),this.getWrapType()===K.PdfWordWrapType.Character&&a?(a=!1,l="",l+=h.toString(),p=c.peek().toString()):(" "!==(d=h.toString())&&this.addToLineResult(i,r,d,o,K.LineType.LayoutBreak|s),this.isOverloadWithPosition&&(n=this.clientSize.width),h=l="",f=u=o=0,s=K.LineType.None,p=a?p:c.peekWord(),a=!0)}else h+=p,o=f,p=a?(c.readWord(),c.peekWord()):(c.read(),c.peek().toString())}0<h.length&&(d=h.toString(),this.addToLineResult(i,r,d,o,K.LineType.NewLineBreak|K.LineType.LastParagraphLine)),c.close()}i.layoutLines=[];for(var g=0;g<r.length;g++)i.layoutLines.push(r[g]);return r=[],i},Ct.prototype.addToLineResult=function(t,e,i,r,n){var o=new xt,i=(o.text=i,o.width=r,o.lineType=n,e.push(o),t.actualSize);i.height+=this.getLineHeight(),i.width=Math.max(i.width,r),t.size=i},Ct.prototype.copyToResult=function(t,e,i,r){var n,o=!0,s=null!=this.format&&!this.format.lineLimit,a=t.actualSize.height,h=this.size.height;if(0<this.pageHeight&&h+this.rectangle.y>this.pageHeight&&(h=this.rectangle.y-this.pageHeight,h=Math.max(h,-h)),r=0,null!=e.lines)for(var l=0,u=e.lines.length;l<u;l++){var c=a+e.lineHeight;if(!(c<=h||h<=0||s)){o=!1;break}var p=e.lines[l],d=(r+=p.text.length,p=this.trimLine(p,0===i.length),i.push(p),t.actualSize);d.width=Math.max(d.width,p.width),t.size=d,a=c}return a!=t.size.height&&((n=t.actualSize).height=a,t.size=n),{success:o,numInserted:r}},Ct.prototype.finalizeResult=function(t,e){t.layoutLines=[];for(var i=0;i<e.length;i++)t.layoutLines.push(e[i]);t.layoutLineHeight=this.getLineHeight(),this.reader.end||(t.textRemainder=this.reader.readToEnd())},Ct.prototype.trimLine=function(t,e){var i=t.text,r=t.width;t.lineType,K.LineType.FirstParagraphLine,null!=this.format&&this.format.rightToLeft;return(i=i.trim()).length!==t.text.length&&(r=this.getLineWidth(i),0<(t.lineType&K.LineType.FirstParagraphLine))&&(r+=this.getLineIndent(e)),t.text=i,t.width=r,t},Ct.prototype.getWrapType=function(){return null!=this.format?this.format.wordWrap:K.PdfWordWrapType.Word};var vt=Ct;function Ct(){this.isOverloadWithPosition=!1}Object.defineProperty(Ot.prototype,"remainder",{get:function(){return this.textRemainder},enumerable:!0,configurable:!0}),Object.defineProperty(Ot.prototype,"actualSize",{get:function(){return void 0===this.size&&(this.size=new Y(0,0)),this.size},enumerable:!0,configurable:!0}),Object.defineProperty(Ot.prototype,"lines",{get:function(){return this.layoutLines},enumerable:!0,configurable:!0}),Object.defineProperty(Ot.prototype,"lineHeight",{get:function(){return this.layoutLineHeight},enumerable:!0,configurable:!0}),Object.defineProperty(Ot.prototype,"empty",{get:function(){return null==this.layoutLines||0===this.layoutLines.length},enumerable:!0,configurable:!0}),Object.defineProperty(Ot.prototype,"lineCount",{get:function(){return this.empty?0:this.layoutLines.length},enumerable:!0,configurable:!0});var Bt=Ot;function Ot(){}Object.defineProperty(Lt.prototype,"lineType",{get:function(){return this.type},set:function(t){this.type=t},enumerable:!0,configurable:!0}),Object.defineProperty(Lt.prototype,"text",{get:function(){return this.content},set:function(t){this.content=t},enumerable:!0,configurable:!0}),Object.defineProperty(Lt.prototype,"width",{get:function(){return this.lineWidth},set:function(t){this.lineWidth=t},enumerable:!0,configurable:!0});var xt=Lt;function Lt(){}(i=K.LineType||(K.LineType={}))[i.None=0]="None",i[i.NewLineBreak=1]="NewLineBreak",i[i.LayoutBreak=2]="LayoutBreak",i[i.FirstParagraphLine=4]="FirstParagraphLine",i[i.LastParagraphLine=8]="LastParagraphLine";Object.defineProperty(jt.prototype,"name",{get:function(){return this.metrics.name},enumerable:!0,configurable:!0}),Object.defineProperty(jt.prototype,"size",{get:function(){return this.fontSize},enumerable:!0,configurable:!0}),Object.defineProperty(jt.prototype,"height",{get:function(){return this.metrics.getHeight(null)},enumerable:!0,configurable:!0}),Object.defineProperty(jt.prototype,"style",{get:function(){return this.fontStyle},set:function(t){this.fontStyle=t},enumerable:!0,configurable:!0}),Object.defineProperty(jt.prototype,"bold",{get:function(){return 0<(this.style&K.PdfFontStyle.Bold)},enumerable:!0,configurable:!0}),Object.defineProperty(jt.prototype,"italic",{get:function(){return 0<(this.style&K.PdfFontStyle.Italic)},enumerable:!0,configurable:!0}),Object.defineProperty(jt.prototype,"strikeout",{get:function(){return 0<(this.style&K.PdfFontStyle.Strikeout)},enumerable:!0,configurable:!0}),Object.defineProperty(jt.prototype,"underline",{get:function(){return 0<(this.style&K.PdfFontStyle.Underline)},enumerable:!0,configurable:!0}),Object.defineProperty(jt.prototype,"metrics",{get:function(){return this.fontMetrics},set:function(t){this.fontMetrics=t},enumerable:!0,configurable:!0}),Object.defineProperty(jt.prototype,"element",{get:function(){return this.pdfFontInternals},enumerable:!0,configurable:!0}),jt.prototype.measureString=function(t,e,i,r,n){if("string"==typeof t&&void 0===e)return this.measureString(t,null);if("string"==typeof t&&(e instanceof bt||null==e)&&void 0===i&&void 0===r)return this.measureString(t,o=e,0,0);if("string"==typeof t&&(e instanceof bt||null==e)&&"number"==typeof i&&"number"==typeof r)return this.measureString(t,0,o=e,i,r);if("string"==typeof t&&"number"==typeof e&&(i instanceof bt||null==i)&&"number"==typeof r&&"number"==typeof n)return s=new Y(e,0),this.measureString(t,s,s=i,r,n);if(null==t)throw Error('ArgumentNullException("text")');var o=e,s=i,e=(new vt).layout(t,this,s,o,!1,new Y(0,0));return r=t.length,n=e.empty?0:e.lines.length,e.actualSize},jt.prototype.equalsTo=function(t){return this.equalsToFont(t)},jt.prototype.getInternals=function(){return this.pdfFontInternals},jt.prototype.setInternals=function(t){if(null==t)throw new Error("ArgumentNullException:internals");this.pdfFontInternals=t},jt.prototype.setStyle=function(t){this.fontStyle=t},jt.prototype.applyFormatSettings=function(t,e,i){var r=i;return null!=e&&0<i&&(0!==e.characterSpacing&&(r+=(t.length-1)*e.characterSpacing),0!==e.wordSpacing)&&(i=Pt.spaces,r+=Pt.getCharsCount(t,i)*e.wordSpacing),r},jt.charSizeMultiplier=.001,jt.syncObject=new Object;var Tt=jt;function jt(t,e){this.fontStyle=K.PdfFontStyle.Regular,"number"==typeof t&&void 0===e?this.fontSize=t:(this.fontSize=t,this.setStyle(e))}Object.defineProperty(Vt.prototype,"document",{get:function(){return this.pdfDocument},set:function(t){this.pdfDocument=t},enumerable:!0,configurable:!0}),Object.defineProperty(Vt.prototype,"position",{get:function(){return this.streamWriter.buffer.size},enumerable:!0,configurable:!0}),Object.defineProperty(Vt.prototype,"length",{get:function(){return this.streamWriter.buffer.size},enumerable:!0,configurable:!0}),Object.defineProperty(Vt.prototype,"stream",{get:function(){return this.streamWriter},enumerable:!0,configurable:!0}),Vt.prototype.write=function(t){this.streamWriter.write(t)};var kt=Vt;function Vt(t){this.streamWriter=t}(i=K.ObjectStatus||(K.ObjectStatus={}))[i.None=0]="None",i[i.Registered=1]="Registered";Object.defineProperty(Mt.prototype,"count",{get:function(){return this.objectCollections.length},enumerable:!0,configurable:!0}),Mt.prototype.items=function(t){return this.objectCollections[t]},Object.defineProperty(Mt.prototype,"outIsNew",{get:function(){return this.isNew},enumerable:!0,configurable:!0}),Mt.prototype.add=function(t){var e=new Dt(t);this.objectCollections.push(e),this.primitiveObjectCollection.containsKey(t)||this.primitiveObjectCollection.setValue(t,this.objectCollections.length-1),t.position=this.index=this.objectCollections.length-1,t.status=K.ObjectStatus.Registered},Mt.prototype.lookFor=function(t){var e=-1;if(-1!==t.position)return t.position;if(this.primitiveObjectCollection.containsKey(t)&&this.count===this.primitiveObjectCollection.size())e=this.primitiveObjectCollection.getValue(t);else for(var i=this.count-1;0<=i;i--)if(this.objectCollections[i].object===t){e=i;break}return e},Mt.prototype.getReference=function(t,e){return this.index=this.lookFor(t),this.isNew=!1,{reference:this.objectCollections[this.index].reference,wasNew:e}},Mt.prototype.trySetReference=function(t,e,i){return this.index=this.lookFor(t),this.objectCollections[this.index].setReference(e),!0},Mt.prototype.destroy=function(){for(var t=0,e=this.objectCollections;t<e.length;t++){var i=e[t];void 0!==i&&(i.pdfObject.position=-1,i.pdfObject.isSaving=void 0,i.pdfObject.objectCollectionIndex=void 0,i.pdfObject.position=void 0)}this.objectCollections=[],this.mainObjectCollection=new a,this.primitiveObjectCollection=new a};var Rt=Mt;function Mt(){this.objectCollections=[],this.mainObjectCollection=new a,this.primitiveObjectCollection=new a}Object.defineProperty(Nt.prototype,"object",{get:function(){return this.pdfObject},set:function(t){this.pdfObject=t},enumerable:!0,configurable:!0}),Object.defineProperty(Nt.prototype,"reference",{get:function(){return this.pdfReference},enumerable:!0,configurable:!0}),Nt.prototype.setReference=function(t){this.pdfReference=t};var Dt=Nt;function Nt(t,e){this.pdfObject=t,this.pdfReference=e}Object.defineProperty(At.prototype,"pdfObjects",{get:function(){return this.objects},enumerable:!0,configurable:!0}),Object.defineProperty(At.prototype,"crossTable",{get:function(){return this.pdfCrossTable},enumerable:!0,configurable:!0}),Object.defineProperty(At.prototype,"currentSavingObj",{get:function(){return this.currentSavingObject},set:function(t){this.currentSavingObject=t},enumerable:!0,configurable:!0}),Object.defineProperty(At.prototype,"catalog",{get:function(){return this.pdfCatalog},set:function(t){this.pdfCatalog=t},enumerable:!0,configurable:!0}),Object.defineProperty(At.prototype,"viewerPreferences",{get:function(){return this.pdfCatalog.viewerPreferences},enumerable:!0,configurable:!0}),At.prototype.setMainObjectCollection=function(t){this.objects=t},At.prototype.setCrossTable=function(t){this.pdfCrossTable=t},At.prototype.setCatalog=function(t){this.pdfCatalog=t},At.prototype.save=function(t){var e,r,n=this,i=new R.Encoding(!0),i=new R.StreamWriter(i);if(void 0===t)return e=new R.Encoding(!0),r=new R.StreamWriter(e),new Promise(function(t,e){var i={};i.blobData=new Blob([n.document.docSave(r,!0)],{type:"application/pdf"}),t(i)});this.document.docSave(i,t,!0)},At.prototype.clone=function(){return this.document};var i=At;function At(t){this.isStreamCopied=!1,t instanceof Br&&(this.document=t)}(w=K.ObjectType||(K.ObjectType={}))[w.Free=0]="Free",w[w.Normal=1]="Normal",w[w.Packed=2]="Packed";Object.defineProperty(Ft.prototype,"status",{get:function(){return this.objectStatus},set:function(t){this.objectStatus=t},enumerable:!0,configurable:!0}),Object.defineProperty(Ft.prototype,"isSaving",{get:function(){return this.saving},set:function(t){this.saving=t},enumerable:!0,configurable:!0}),Object.defineProperty(Ft.prototype,"objectCollectionIndex",{get:function(){return this.index},set:function(t){this.index=t},enumerable:!0,configurable:!0}),Object.defineProperty(Ft.prototype,"position",{get:function(){return this.currentPosition},set:function(t){this.currentPosition=t},enumerable:!0,configurable:!0}),Object.defineProperty(Ft.prototype,"clonedObject",{get:function(){return null},enumerable:!0,configurable:!0}),Ft.prototype.save=function(t){t.write(this.boolToStr(this.value))},Ft.prototype.clone=function(t){return new Ft(this.value)},Ft.prototype.boolToStr=function(t){return t?"true":"false"};var It=Ft;function Ft(t){this.currentPosition=-1,this.value=t}Object.defineProperty(Gt.prototype,"centerWindow",{get:function(){return this._centerWindow},set:function(t){this._centerWindow=t,this._dictionary.items.setValue(this._dictionaryProperties.centerWindow,new It(this._centerWindow))},enumerable:!0,configurable:!0}),Object.defineProperty(Gt.prototype,"displayTitle",{get:function(){return this._displayTitle},set:function(t){this._displayTitle=t,this._dictionary.items.setValue(this._dictionaryProperties.displayTitle,new It(this._displayTitle))},enumerable:!0,configurable:!0}),Object.defineProperty(Gt.prototype,"fitWindow",{get:function(){return this._fitWindow},set:function(t){this._fitWindow=t,this._dictionary.items.setValue(this._dictionaryProperties.fitWindow,new It(this._fitWindow))},enumerable:!0,configurable:!0}),Object.defineProperty(Gt.prototype,"hideMenuBar",{get:function(){return this._hideMenuBar},set:function(t){this._hideMenuBar=t,this._dictionary.items.setValue(this._dictionaryProperties.hideMenuBar,new It(this._hideMenuBar))},enumerable:!0,configurable:!0}),Object.defineProperty(Gt.prototype,"hideToolBar",{get:function(){return this._hideToolBar},set:function(t){this._hideToolBar=t,this._dictionary.items.setValue(this._dictionaryProperties.hideToolBar,new It(this._hideToolBar))},enumerable:!0,configurable:!0}),Object.defineProperty(Gt.prototype,"hideWindowUI",{get:function(){return this._hideWindowUI},set:function(t){this._hideWindowUI=t,this._dictionary.items.setValue(this._dictionaryProperties.hideWindowUI,new It(this._hideWindowUI))},enumerable:!0,configurable:!0}),Object.defineProperty(Gt.prototype,"pageMode",{get:function(){return this._pageMode},set:function(t){this._pageMode=t,this._catalog.items.setValue(this._dictionaryProperties.pageMode,new o(this._mapPageMode(this._pageMode)))},enumerable:!0,configurable:!0}),Object.defineProperty(Gt.prototype,"duplex",{get:function(){return this._duplex},set:function(t){this._duplex=t,this._catalog.items.setValue(this._dictionaryProperties.duplex,new o(this._mapDuplexMode(this._duplex)))},enumerable:!0,configurable:!0}),Object.defineProperty(Gt.prototype,"pageLayout",{get:function(){return this._pageLayout},set:function(t){this._pageLayout=t,this._catalog.items.setValue(this._dictionaryProperties.pageLayout,new o(this._mapPageLayout(this._pageLayout)))},enumerable:!0,configurable:!0}),Object.defineProperty(Gt.prototype,"pageScaling",{get:function(){return this._pageScaling},set:function(t){this._pageScaling=t,this._pageScaling===K.PageScalingMode.AppDefault&&this._dictionary.items.containsKey(this._dictionaryProperties.printScaling)?this._dictionary.items.remove(this._dictionaryProperties.printScaling):this._pageScaling===K.PageScalingMode.None&&this._dictionary.items.setValue(this._dictionaryProperties.printScaling,new o("None"))},enumerable:!0,configurable:!0}),Object.defineProperty(Gt.prototype,"element",{get:function(){return this._dictionary},enumerable:!0,configurable:!0}),Gt.prototype._mapDuplexMode=function(t){switch(t){case K.DuplexMode.Simplex:return"Simplex";case K.DuplexMode.DuplexFlipShortEdge:return"DuplexFlipShortEdge";case K.DuplexMode.DuplexFlipLongEdge:return"DuplexFlipLongEdge";case K.DuplexMode.None:return"None"}},Gt.prototype._mapPageMode=function(t){switch(t){case K.PdfPageMode.UseNone:return"UseNone";case K.PdfPageMode.UseOutlines:return"UseOutlines";case K.PdfPageMode.UseThumbs:return"UseThumbs";case K.PdfPageMode.FullScreen:return"FullScreen";case K.PdfPageMode.UseOC:return"UseOC";case K.PdfPageMode.UseAttachments:return"UseAttachments"}},Gt.prototype._mapPageLayout=function(t){switch(t){case K.PdfPageLayout.SinglePage:return"SinglePage";case K.PdfPageLayout.OneColumn:return"OneColumn";case K.PdfPageLayout.TwoColumnLeft:return"TwoColumnLeft";case K.PdfPageLayout.TwoColumnRight:return"TwoColumnRight";case K.PdfPageLayout.TwoPageLeft:return"TwoPageLeft";case K.PdfPageLayout.TwoPageRight:return"TwoPageRight"}};var Et=Gt;function Gt(t){this._dictionaryProperties=new l,this._centerWindow=!1,this._fitWindow=!1,this._displayTitle=!1,this._splitWindow=!1,this._hideMenuBar=!1,this._hideToolBar=!1,this._hideWindowUI=!1,this._pageMode=K.PdfPageMode.UseNone,this._pageLayout=K.PdfPageLayout.SinglePage,this._dictionary=new c,this._duplex=K.DuplexMode.None,this._catalog=t}(w=K.PdfPageMode||(K.PdfPageMode={}))[w.UseNone=0]="UseNone",w[w.UseOutlines=1]="UseOutlines",w[w.UseThumbs=2]="UseThumbs",w[w.FullScreen=3]="FullScreen",w[w.UseOC=4]="UseOC",w[w.UseAttachments=5]="UseAttachments",(w=K.PdfPageLayout||(K.PdfPageLayout={}))[w.SinglePage=0]="SinglePage",w[w.OneColumn=1]="OneColumn",w[w.TwoColumnLeft=2]="TwoColumnLeft",w[w.TwoColumnRight=3]="TwoColumnRight",w[w.TwoPageLeft=4]="TwoPageLeft",w[w.TwoPageRight=5]="TwoPageRight",(w=K.DuplexMode||(K.DuplexMode={}))[w.Simplex=0]="Simplex",w[w.DuplexFlipShortEdge=1]="DuplexFlipShortEdge",w[w.DuplexFlipLongEdge=2]="DuplexFlipLongEdge",w[w.None=3]="None",(w=K.PageScalingMode||(K.PageScalingMode={}))[w.AppDefault=0]="AppDefault",w[w.None=1]="None",zt=function(t,e){return(zt=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}zt(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(Ht,Wt=c),Object.defineProperty(Ht.prototype,"pages",{get:function(){return this.sections},set:function(t){t.element;this.sections=t,this.items.setValue(this.tempDictionaryProperties.pages,new d(t))},enumerable:!0,configurable:!0}),Object.defineProperty(Ht.prototype,"viewerPreferences",{get:function(){return null!==this._viewerPreferences&&void 0!==this._viewerPreferences||(this._viewerPreferences=new Et(this),this.items.setValue(this.tempDictionaryProperties.viewerPreferences,new d(this._viewerPreferences.element))),this._viewerPreferences},enumerable:!0,configurable:!0});var zt,Wt,_t=Ht;function Ht(){var t=Wt.call(this)||this;return t.sections=null,t.tempDictionaryProperties=new l,t.items.setValue((new l).type,new o("Catalog")),t}Object.defineProperty(n.prototype,"isMerging",{get:function(){return this.merging},set:function(t){this.merging=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"trailer",{get:function(){return null==this.internalTrailer&&(this.internalTrailer=new U),this.internalTrailer},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"document",{get:function(){return this.pdfDocument},set:function(t){this.pdfDocument=t,this.items=this.pdfDocument.pdfObjects},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"pdfObjects",{get:function(){return this.items},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"objectCollection",{get:function(){return this.pdfDocument.pdfObjects},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"count",{get:function(){return this.objectCount},set:function(t){this.objectCount=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"nextObjNumber",{get:function(){return this.count=this.count+1,this.count},enumerable:!0,configurable:!0}),n.prototype.save=function(t,e){this.saveHead(t),this.mappedReferences=null,this.objects.clear(),this.markTrailerReferences(),this.saveObjects(t);var i=this.count,r=t.position;this.registerObject(0,new et(0,-1),!0);t.write(h.xref),t.write(h.newLine),this.saveSections(t),this.saveTrailer(t,this.count,0),this.saveTheEndess(t,r),this.count=i;for(var n=0;n<this.objectCollection.count;++n)this.objectCollection.items(n).object.isSaving=!1;if(void 0===e)return t.stream.buffer;t.stream.save(e)},n.prototype.saveTheEndess=function(t,e){t.write(h.newLine+h.startxref+h.newLine),t.write(e.toString()+h.newLine),t.write(h.eof+h.newLine)},n.prototype.saveTrailer=function(t,e,i){t.write(h.trailer+h.newLine);var r=this.trailer;r.items.setValue(this.dictionaryProperties.size,new u(this.objectCount+1)),(r=new c(r)).setEncrypt(!1),r.save(t)},n.prototype.saveSections=function(t){for(var e,i=0;e=this.prepareSubsection(i),this.saveSubsection(t,i,e),i+=e,0!==e;);},n.prototype.saveSubsection=function(t,e,i){if(!(i<=0||e>=this.count)){t.write(e+" "+(i+1)+h.newLine);for(var r=e;r<=e+i;++r){var n=this.objects.getValue(r),o="",o=n.type===K.ObjectType.Free?this.getItem(n.offset,65535,!0):this.getItem(n.offset,n.generation,!1);t.write(o)}}},n.prototype.getItem=function(t,e,i){for(var r="",n=10-t.toString().length,o=5-(e=e<=0?0:e).toString().length<=0?0:5-e.toString().length,s=0;s<n;s++)r+="0";for(r=r+t.toString()+" ",s=0;s<o;s++)r+="0";return r=(r=r+e.toString()+" ")+(i?h.f:h.n)+h.newLine},n.prototype.prepareSubsection=function(t){for(var e,i=0,r=this.count,n=0;n<this.document.pdfObjects.count;n++)this.document.pdfObjects.items(n).reference.toString().split(" ");if(!(r<=t))for(t=e=t;e<r;++e)++i;return i},n.prototype.markTrailerReferences=function(){this.trailer.items.keys(),this.trailer.items.values()},n.prototype.saveHead=function(t){var e=this.generateFileVersion(t.document);t.write("%PDF-"+e),t.write(h.newLine)},n.prototype.generateFileVersion=function(t){return"1."+4..toString()},n.prototype.getReference=function(t,e){return void 0===e?this.getReference(t,!1):this.getSubReference(t,e)},n.prototype.getSubReference=function(t,e){var i,r,n=!1,o=null;return 0<this.items.count&&0<t.objectCollectionIndex&&this.items.count>t.objectCollectionIndex-1&&(o=(r=this.document.pdfObjects.getReference(t,i)).reference,i=r.wasNew),i=null==o&&t.status!==K.ObjectStatus.Registered,null==o&&(r=this.nextObjNumber,o=new et(r,0),i?(this.document.pdfObjects.add(t),this.document.pdfObjects.trySetReference(t,o,void 0),r=this.document.pdfObjects.count-1,i=this.document.pdfObjects.objectCollections[r].reference.objNumber,r=this.document.pdfObjects.objectCollections[this.document.pdfObjects.count-1],this.document.pdfObjects.mainObjectCollection.setValue(i,r),t.position=-1):this.document.pdfObjects.trySetReference(t,o,void 0),t.objectCollectionIndex=o.objNumber,t.status=K.ObjectStatus.None,n=!0),n||this.bForceNew,o},n.prototype.saveObjects=function(t){for(var e=this.objectCollection,i=0;i<e.count;++i){var r=e.items(i).object;r.isSaving=!0,this.saveIndirectObject(r,t)}},n.prototype.saveIndirectObject=function(t,e){var i=this.getReference(t);t instanceof _t&&this.trailer.items.setValue(this.dictionaryProperties.root,i),this.pdfDocument.currentSavingObj=i,t.getArchive();this.registerObject(e.position,i),this.doSaveObject(t,i,e)},n.prototype.doSaveObject=function(t,e,i){i.length,i.write(e.objNumber.toString()),i.write(h.whiteSpace),i.write(e.genNumber.toString()),i.write(h.whiteSpace),i.write(h.obj),i.write(h.newLine),t.save(i),i.stream;i.write(h.endObj),i.write(h.newLine)},n.prototype.registerObject=function(t,e,i){"boolean"==typeof i?(this.objects.setValue(e.objNumber,new Kt(t,e,i)),this.maxGenNumIndex=Math.max(this.maxGenNumIndex,e.genNumber)):void 0===i&&(this.objects.setValue(e.objNumber,new Kt(t,e)),this.maxGenNumIndex=Math.max(this.maxGenNumIndex,e.genNumber))},n.dereference=function(t){return t=null!=t?t.object:t};var Ut=n;function n(){this.objects=new a,this.maxGenNumIndex=0,this.objectCount=0,this.dictionaryProperties=new l}Object.defineProperty(qt.prototype,"objectNumber",{get:function(){return this.object},enumerable:!0,configurable:!0}),Object.defineProperty(qt.prototype,"offset",{get:function(){return this.offsetNumber},enumerable:!0,configurable:!0});var Kt=qt;function qt(t,e,i){this.offsetNumber=t;t=e;this.generation=t.genNumber,this.object=t.objNumber,this.type=void 0===i?K.ObjectType.Normal:K.ObjectType.Free}m.letter=new Y(612,792),m.note=new Y(540,720),m.legal=new Y(612,1008),m.a0=new Y(2380,3368),m.a1=new Y(1684,2380),m.a2=new Y(1190,1684),m.a3=new Y(842,1190),m.a4=new Y(595,842),m.a5=new Y(421,595),m.a6=new Y(297,421),m.a7=new Y(210,297),m.a8=new Y(148,210),m.a9=new Y(105,148),m.a10=new Y(74,105),m.b0=new Y(2836,4008),m.b1=new Y(2004,2836),m.b2=new Y(1418,2004),m.b3=new Y(1002,1418),m.b4=new Y(709,1002),m.b5=new Y(501,709),m.archE=new Y(2592,3456),m.archD=new Y(1728,2592),m.archC=new Y(1296,1728),m.archB=new Y(864,1296),m.archA=new Y(648,864),m.flsa=new Y(612,936),m.halfLetter=new Y(396,612),m.letter11x17=new Y(792,1224),m.ledger=new Y(1224,792);var Yt=m;function m(){}(w=K.PdfPageOrientation||(K.PdfPageOrientation={}))[w.Portrait=0]="Portrait",w[w.Landscape=1]="Landscape",(w=K.PdfPageRotateAngle||(K.PdfPageRotateAngle={}))[w.RotateAngle0=0]="RotateAngle0",w[w.RotateAngle90=1]="RotateAngle90",w[w.RotateAngle180=2]="RotateAngle180",w[w.RotateAngle270=3]="RotateAngle270",(w=K.PdfNumberStyle||(K.PdfNumberStyle={}))[w.None=0]="None",w[w.Numeric=1]="Numeric",w[w.LowerLatin=2]="LowerLatin",w[w.LowerRoman=3]="LowerRoman",w[w.UpperLatin=4]="UpperLatin",w[w.UpperRoman=5]="UpperRoman",(w=K.PdfDockStyle||(K.PdfDockStyle={}))[w.None=0]="None",w[w.Bottom=1]="Bottom",w[w.Top=2]="Top",w[w.Left=3]="Left",w[w.Right=4]="Right",w[w.Fill=5]="Fill",(w=K.PdfAlignmentStyle||(K.PdfAlignmentStyle={}))[w.None=0]="None",w[w.TopLeft=1]="TopLeft",w[w.TopCenter=2]="TopCenter",w[w.TopRight=3]="TopRight",w[w.MiddleLeft=4]="MiddleLeft",w[w.MiddleCenter=5]="MiddleCenter",w[w.MiddleRight=6]="MiddleRight",w[w.BottomLeft=7]="BottomLeft",w[w.BottomCenter=8]="BottomCenter",w[w.BottomRight=9]="BottomRight",(w=K.TemplateType||(K.TemplateType={}))[w.None=0]="None",w[w.Top=1]="Top",w[w.Bottom=2]="Bottom",w[w.Left=3]="Left",w[w.Right=4]="Right";Object.defineProperty(Jt.prototype,"left",{get:function(){return this.leftMargin},set:function(t){this.leftMargin=t},enumerable:!0,configurable:!0}),Object.defineProperty(Jt.prototype,"top",{get:function(){return this.topMargin},set:function(t){this.topMargin=t},enumerable:!0,configurable:!0}),Object.defineProperty(Jt.prototype,"right",{get:function(){return this.rightMargin},set:function(t){this.rightMargin=t},enumerable:!0,configurable:!0}),Object.defineProperty(Jt.prototype,"bottom",{get:function(){return this.bottomMargin},set:function(t){this.bottomMargin=t},enumerable:!0,configurable:!0}),Object.defineProperty(Jt.prototype,"all",{set:function(t){this.setMargins(t)},enumerable:!0,configurable:!0}),Jt.prototype.setMargins=function(t,e,i,r){void 0===e?this.leftMargin=this.topMargin=this.rightMargin=this.bottomMargin=t:void 0===i?(this.leftMargin=this.rightMargin=t,this.bottomMargin=this.topMargin=e):(this.leftMargin=t,this.topMargin=e,this.rightMargin=i,this.bottomMargin=r)},Jt.prototype.clone=function(){return this};var Xt=Jt;function Jt(){this.pdfMargin=40,this.setMargins(this.pdfMargin)}Object.defineProperty($t.prototype,"size",{get:function(){return this.pageSize},set:function(t){this.setSize(t)},enumerable:!0,configurable:!0}),Object.defineProperty($t.prototype,"orientation",{get:function(){return this.pageOrientation},set:function(t){this.pageOrientation!==t&&(this.pageOrientation=t,this.updateSize(t))},enumerable:!0,configurable:!0}),Object.defineProperty($t.prototype,"margins",{get:function(){return this.pageMargins},set:function(t){this.pageMargins=t},enumerable:!0,configurable:!0}),Object.defineProperty($t.prototype,"width",{get:function(){return this.pageSize.width},set:function(t){this.pageSize.width=t},enumerable:!0,configurable:!0}),Object.defineProperty($t.prototype,"height",{get:function(){return this.pageSize.height},set:function(t){this.pageSize.height=t},enumerable:!0,configurable:!0}),Object.defineProperty($t.prototype,"origin",{get:function(){return this.pageOrigin},set:function(t){this.pageOrigin=t},enumerable:!0,configurable:!0}),Object.defineProperty($t.prototype,"rotate",{get:function(){return this.rotateAngle},set:function(t){this.rotateAngle=t,this.isRotation=!0},enumerable:!0,configurable:!0}),$t.prototype.updateSize=function(t){var e=Math.min(this.pageSize.width,this.pageSize.height),i=Math.max(this.pageSize.width,this.pageSize.height);switch(t){case K.PdfPageOrientation.Portrait:this.pageSize=new Y(e,i);break;case K.PdfPageOrientation.Landscape:this.pageSize=new Y(i,e)}},$t.prototype.clone=function(){return this.pageMargins=this.pageMargins.clone(),this},$t.prototype.getActualSize=function(){var t=this.width-(this.margins.left+this.margins.right),e=this.height-(this.margins.top+this.margins.bottom);return new Y(t,e)},$t.prototype.setSize=function(t){var e=Math.min(t.width,t.height),t=Math.max(t.width,t.height);this.orientation===K.PdfPageOrientation.Portrait?this.pageSize=new Y(e,t):this.pageSize=new Y(t,e)};var Zt=$t;function $t(t){this.pageMargins=new Xt,this.pageSize=Yt.a4,this.rotateAngle=K.PdfPageRotateAngle.RotateAngle0,this.pageOrientation=K.PdfPageOrientation.Portrait,this.pageOrigin=new q(0,0),this.isRotation=!1,"number"==typeof t&&this.pageMargins.setMargins(t)}y.prototype.clear=function(){this.stream.clearStream()},y.prototype.setGraphicsState=function(t){t instanceof o?this.stream.write(t.toString()):(this.stream.write(h.slash),this.stream.write(t)),this.stream.write(h.whiteSpace),this.writeOperator(h.setGraphicsState)},y.prototype.executeObject=function(t){this.stream.write(t.toString()),this.stream.write(h.whiteSpace),this.writeOperator(h.paintXObject),this.stream.write(h.newLine)},y.prototype.closePath=function(){this.writeOperator(h.closePath)},y.prototype.clipPath=function(t){this.stream.write(h.clipPath),t&&this.stream.write(h.evenOdd),this.stream.write(h.whiteSpace),this.stream.write(h.endPath),this.stream.write(h.newLine)},y.prototype.closeFillStrokePath=function(t){this.stream.write(h.closeFillStrokePath),t&&this.stream.write(h.evenOdd),this.stream.write(h.newLine)},y.prototype.fillStrokePath=function(t){this.stream.write(h.fillStroke),t&&this.stream.write(h.evenOdd),this.stream.write(h.newLine)},y.prototype.fillPath=function(t){this.stream.write(h.fill),t&&this.stream.write(h.evenOdd),this.stream.write(h.newLine)},y.prototype.endPath=function(){this.writeOperator(h.n)},y.prototype.closeFillPath=function(t){this.writeOperator(h.closePath),this.stream.write(h.fill),t&&this.stream.write(h.evenOdd),this.stream.write(h.newLine)},y.prototype.closeStrokePath=function(){this.writeOperator(h.closeStrokePath)},y.prototype.setTextScaling=function(t){this.stream.write(u.floatToString(t)),this.stream.write(h.whiteSpace),this.writeOperator(h.setTextScaling)},y.prototype.strokePath=function(){this.writeOperator(h.stroke)},y.prototype.restoreGraphicsState=function(){this.writeOperator(h.restoreState)},y.prototype.saveGraphicsState=function(){this.writeOperator(h.saveState)},y.prototype.startNextLine=function(t,e){void 0===t?this.writeOperator(h.goToNextLine):(t instanceof q?this.writePoint(t):this.writePoint(t,e),this.writeOperator(h.setCoords))},y.prototype.showText=function(t){this.checkTextParam(t),this.writeText(t),this.writeOperator(h.setText)},y.prototype.setLeading=function(t){this.stream.write(u.floatToString(t)),this.stream.write(h.whiteSpace),this.writeOperator(h.setTextLeading)},y.prototype.beginPath=function(t,e){this.writePoint(t,e),this.writeOperator(h.beginPath)},y.prototype.beginText=function(){this.writeOperator(h.beginText)},y.prototype.endText=function(){this.writeOperator(h.endText)},y.prototype.appendRectangle=function(t,e,i,r){t instanceof X?this.appendRectangle(t.x,t.y,t.width,t.height):(this.writePoint(t,e),this.writePoint(i,r),this.writeOperator(h.appendRectangle))},y.prototype.appendLineSegment=function(t,e){t instanceof q?this.appendLineSegment(t.x,t.y):(this.writePoint(t,e),this.writeOperator(h.appendLineSegment))},y.prototype.setTextRenderingMode=function(t){this.stream.write(t.toString()),this.stream.write(h.whiteSpace),this.writeOperator(h.setRenderingMode)},y.prototype.setCharacterSpacing=function(t){this.stream.write(u.floatToString(t)),this.stream.write(h.whiteSpace),this.stream.write(h.setCharacterSpace),this.stream.write(h.newLine)},y.prototype.setWordSpacing=function(t){this.stream.write(u.floatToString(t)),this.stream.write(h.whiteSpace),this.writeOperator(h.setWordSpace)},y.prototype.showNextLineText=function(t,e){t instanceof tt?(this.checkTextParam(t),this.writeText(t)):(this.checkTextParam(t),this.writeText(t,e)),this.writeOperator(h.setTextOnNewLine)},y.prototype.setColorSpace=function(t,e){var i,r;t instanceof o&&"boolean"==typeof e?(i=(r=e)?h.selectcolorspaceforstroking:h.selectcolorspacefornonstroking,this.stream.write(t.toString()),this.stream.write(h.whiteSpace),this.stream.write(i),this.stream.write(h.newLine)):(r=e,this.setColorSpace(new o(t),r))},y.prototype.modifyCtm=function(t){if(null==t)throw new Error("ArgumentNullException:matrix");this.stream.write(t.toString()),this.stream.write(h.whiteSpace),this.writeOperator(h.modifyCtm)},y.prototype.setFont=function(t,e,i){if("string"==typeof e)this.setFont(t,new o(e),i);else{if(null==t)throw new Error("ArgumentNullException:font");this.stream.write(e.toString()),this.stream.write(h.whiteSpace),this.stream.write(u.floatToString(i)),this.stream.write(h.whiteSpace),this.writeOperator(h.setFont)}},y.prototype.writeOperator=function(t){this.stream.write(t),this.stream.write(h.newLine)},y.prototype.checkTextParam=function(t){if(null==t)throw new Error("ArgumentNullException:text");if("string"==typeof t&&""===t)throw new Error("ArgumentException:The text can not be an empty string, text")},y.prototype.writeText=function(t,e){var i,r;t instanceof tt&&void 0===e?this.stream.write(t.pdfEncode()):(r=i=void 0,r=(e?(i=tt.hexStringMark[0],tt.hexStringMark):(i=tt.stringMark[0],tt.stringMark))[1],this.stream.write(i),this.stream.write(t),this.stream.write(r))},y.prototype.writePoint=function(t,e){t instanceof q&&void 0===e?this.writePoint(t.x,t.y):(this.stream.write(u.floatToString(t)),this.stream.write(h.whiteSpace),e=this.updateY(e),this.stream.write(u.floatToString(e)),this.stream.write(h.whiteSpace))},y.prototype.updateY=function(t){return-t},y.prototype.write=function(t){var e="";this.writeOperator(e+t+h.newLine)},y.prototype.writeComment=function(t){if(!(null!=t&&0<t.length))throw new Error("Invalid comment");var e="";this.writeOperator((e+=h.comment)+h.whiteSpace+t)},y.prototype.setColorAndSpace=function(t,e,i){t.isEmpty||(this.stream.write(t.toString(e,i)),this.stream.write(h.newLine))},y.prototype.setLineDashPattern=function(t,e){this.setLineDashPatternHelper(t,e)},y.prototype.setLineDashPatternHelper=function(t,e){var i="[";if(1<t.length)for(var r=0;r<t.length;r++)r===t.length-1?i+=t[r].toString():i+=t[r].toString()+" ";i=(i+="] ")+e.toString(),this.stream.write(i+=" "+h.setDashPattern),this.stream.write(h.newLine)},y.prototype.setMiterLimit=function(t){this.stream.write(u.floatToString(t)),this.stream.write(h.whiteSpace),this.writeOperator(h.setMiterLimit)},y.prototype.setLineWidth=function(t){this.stream.write(u.floatToString(t)),this.stream.write(h.whiteSpace),this.writeOperator(h.setLineWidth)},y.prototype.setLineCap=function(t){this.stream.write(t.toString()),this.stream.write(h.whiteSpace),this.writeOperator(h.setLineCapStyle)},y.prototype.setLineJoin=function(t){this.stream.write(t.toString()),this.stream.write(h.whiteSpace),this.writeOperator(h.setLineJoinStyle)},Object.defineProperty(y.prototype,"position",{get:function(){return this.stream.position},enumerable:!0,configurable:!0}),Object.defineProperty(y.prototype,"length",{get:function(){var t=0;if(0!==this.stream.data.length&&-1!==this.stream.data.length)for(var e=0;e<this.stream.data.length;e++)t+=this.stream.data[e].length;return t},enumerable:!0,configurable:!0}),Object.defineProperty(y.prototype,"document",{get:function(){return null},enumerable:!0,configurable:!0}),y.prototype.appendBezierSegment=function(t,e,i,r,n,o){t instanceof q&&e instanceof q&&i instanceof q?(this.writePoint(t.x,t.y),this.writePoint(e.x,e.y),this.writePoint(i.x,i.y)):(this.writePoint(t,e),this.writePoint(i,r),this.writePoint(n,o)),this.writeOperator(h.appendbeziercurve)},y.prototype.setColourWithPattern=function(t,e,i){if(null!=t)for(var r=t.length,n=0,n=0;n<r;++n)this.stream.write(t[n].toString()),this.stream.write(h.whiteSpace);null!=e&&(this.stream.write(e.toString()),this.stream.write(h.whiteSpace)),i?this.writeOperator(h.setColorAndPatternStroking):this.writeOperator(h.setColorAndPattern)};var Qt=y;function y(t){if(null==t)throw new Error("ArgumentNullException:stream");this.stream=t}Object.defineProperty(ee.prototype,"color",{get:function(){return this.pdfColor},set:function(t){this.pdfColor=t},enumerable:!0,configurable:!0}),Object.defineProperty(ee.prototype,"dashOffset",{get:function(){return void 0===this.dashOffsetValue||null==this.dashOffsetValue?0:this.dashOffsetValue},set:function(t){this.dashOffsetValue=t},enumerable:!0,configurable:!0}),Object.defineProperty(ee.prototype,"dashPattern",{get:function(){return this.penDashPattern},set:function(t){this.penDashPattern=t},enumerable:!0,configurable:!0}),Object.defineProperty(ee.prototype,"dashStyle",{get:function(){return this.pdfDashStyle},set:function(t){if(this.pdfDashStyle!==t)switch(this.pdfDashStyle=t,this.pdfDashStyle){case K.PdfDashStyle.Custom:break;case K.PdfDashStyle.Dash:this.penDashPattern=[3,1];break;case K.PdfDashStyle.Dot:this.penDashPattern=[1,1];break;case K.PdfDashStyle.DashDot:this.penDashPattern=[3,1,1,1];break;case K.PdfDashStyle.DashDotDot:this.penDashPattern=[3,1,1,1,1,1];break;case K.PdfDashStyle.Solid:break;default:this.pdfDashStyle=K.PdfDashStyle.Solid,this.penDashPattern=[0]}},enumerable:!0,configurable:!0}),Object.defineProperty(ee.prototype,"lineCap",{get:function(){return this.pdfLineCap},set:function(t){this.pdfLineCap=t},enumerable:!0,configurable:!0}),Object.defineProperty(ee.prototype,"lineJoin",{get:function(){return this.pdfLineJoin},set:function(t){this.pdfLineJoin=t},enumerable:!0,configurable:!0}),Object.defineProperty(ee.prototype,"miterLimit",{get:function(){return this.internalMiterLimit},set:function(t){this.internalMiterLimit=t},enumerable:!0,configurable:!0}),Object.defineProperty(ee.prototype,"width",{get:function(){return this.penWidth},set:function(t){this.penWidth=t},enumerable:!0,configurable:!0}),ee.prototype.clone=function(){return this},ee.prototype.setBrush=function(t){null!=t&&t instanceof mt&&(this.color=t.color,this.pdfBrush=t),this.color=t.color,this.pdfBrush=t},ee.prototype.monitorChanges=function(t,e,i,r,n,o){this.dashControl(t,!0,e),e.setLineWidth(this.width),e.setLineJoin(this.lineJoin),e.setLineCap(this.lineCap);t=this.miterLimit;0<t&&e.setMiterLimit(t),this.pdfBrush;return e.setColorAndSpace(this.color,n,!0),!0},ee.prototype.dashControl=function(t,e,i){var r=this.width,n=this.getPattern();return i.setLineDashPattern(n,this.dashOffset*r),!0},ee.prototype.getPattern=function(){for(var t=this.dashPattern,e=0;e<t.length;++e)t[e]*=this.width;return t};var te=ee;function ee(t,e){this.pdfColor=new f(0,0,0),this.dashOffsetValue=0,this.penDashPattern=[0],this.pdfDashStyle=K.PdfDashStyle.Solid,this.pdfLineCap=0,this.pdfLineJoin=0,this.penWidth=1,this.internalMiterLimit=0,this.colorSpace=K.PdfColorSpace.Rgb,t instanceof pt?this.setBrush(t):t instanceof f&&(this.color=t),"number"==typeof e&&(this.width=e)}Object.defineProperty(re.prototype,"matrix",{get:function(){return this.transformationMatrix},set:function(t){this.transformationMatrix=t},enumerable:!0,configurable:!0}),re.prototype.translate=function(t,e){this.transformationMatrix.translate(t,e)},re.prototype.scale=function(t,e){this.transformationMatrix.elements[0]=t,this.transformationMatrix.elements[3]=e},re.prototype.rotate=function(t){t=t*Math.PI/180,this.transformationMatrix.elements[0]=Math.cos(t),this.transformationMatrix.elements[1]=Math.sin(t),this.transformationMatrix.elements[2]=-Math.sin(t),this.transformationMatrix.elements[3]=Math.cos(t)},re.prototype.toString=function(){for(var t="",e=0,i=this.transformationMatrix.elements.length;e<i;e++)this.matrix.elements[e],t=t+u.floatToString(this.transformationMatrix.elements[e])+" ";return t},re.prototype.multiply=function(t){this.transformationMatrix.multiply(t.matrix)},re.degreesToRadians=function(t){return this.degRadFactor*t},re.prototype.radiansToDegrees=function(t){return this.radDegFactor*t},re.prototype.clone=function(){return this},re.degRadFactor=Math.PI/180;var ie=re;function re(t){this.radDegFactor=180/Math.PI,this.transformationMatrix=new ne(1,0,0,void 0===t?1:-1,0,0)}Object.defineProperty(oe.prototype,"elements",{get:function(){return this.metrixElements},enumerable:!0,configurable:!0}),Object.defineProperty(oe.prototype,"offsetX",{get:function(){return this.metrixElements[4]},enumerable:!0,configurable:!0}),Object.defineProperty(oe.prototype,"offsetY",{get:function(){return this.metrixElements[5]},enumerable:!0,configurable:!0}),oe.prototype.translate=function(t,e){this.metrixElements[4]=t,this.metrixElements[5]=e},oe.prototype.transform=function(t){var e=t.x,t=t.y,i=e*this.elements[0]+t*this.elements[2]+this.offsetX,e=e*this.elements[1]+t*this.elements[3]+this.offsetY;return new q(i,e)},oe.prototype.multiply=function(t){var e=[];e.push(this.elements[0]*t.elements[0]+this.elements[1]*t.elements[2]),e[1]=this.elements[0]*t.elements[1]+this.elements[1]*t.elements[3],e[2]=this.elements[2]*t.elements[0]+this.elements[3]*t.elements[2],e[3]=this.elements[2]*t.elements[1]+this.elements[3]*t.elements[3],e[4]=this.offsetX*t.elements[0]+this.offsetY*t.elements[2]+t.offsetX,e[5]=this.offsetX*t.elements[1]+this.offsetY*t.elements[3]+t.offsetY;for(var i=0;i<e.length;i++)this.elements[i]=e[i]},oe.prototype.dispose=function(){this.metrixElements=null},oe.prototype.clone=function(){return new oe(this.metrixElements)};var ne=oe;function oe(t,e,i,r,n,o){void 0===t?this.metrixElements=[]:"number"==typeof t?(this.metrixElements=[],this.metrixElements.push(t),this.metrixElements.push(e),this.metrixElements.push(i),this.metrixElements.push(r),this.metrixElements.push(n),this.metrixElements.push(o)):this.metrixElements=t}var se=function(){this.pdf="PDF",this.text="Text",this.imageB="ImageB",this.imageC="ImageC",this.imageI="ImageI"},ae=(he.prototype.size=function(){return this.mKeys.length},he.prototype.add=function(t,e){if(null==t||null==e)throw new ReferenceError("Provided key or value is not valid.");if(this.mKeys.indexOf(t)<0)return this.mKeys.push(t),this.mValues.push(e),1;throw new RangeError("An item with the same key has already been added.")},he.prototype.keys=function(){return this.mKeys},he.prototype.values=function(){return this.mValues},he.prototype.getValue=function(t){if(null==t)throw new ReferenceError("Provided key is not valid.");t=this.mKeys.indexOf(t);if(t<0)throw new RangeError("No item with the specified key has been added.");return this.mValues[t]},he.prototype.setValue=function(t,e){if(null==t)throw new ReferenceError("Provided key is not valid.");var i=this.mKeys.indexOf(t);i<0?(this.mKeys.push(t),this.mValues.push(e)):this.mValues[i]=e},he.prototype.remove=function(t){if(null==t)throw new ReferenceError("Provided key is not valid.");t=this.mKeys.indexOf(t);if(t<0)throw new RangeError("No item with the specified key has been added.");return this.mKeys.splice(t,1),this.mValues.splice(t,1),!0},he.prototype.containsKey=function(t){if(null==t)throw new ReferenceError("Provided key is not valid.");return!(this.mKeys.indexOf(t)<0)},he.prototype.clear=function(){this.mKeys=[],this.mValues=[]},he);function he(){this.mKeys=[],this.mValues=[]}Object.defineProperty(ue.prototype,"element",{get:function(){return this.dictionary},enumerable:!0,configurable:!0});var le=ue;function ue(t,e,i){this.dictionary=new c,this.dictionaryProperties=new l,this.dictionary.items.setValue(this.dictionaryProperties.CA,new u(t)),this.dictionary.items.setValue(this.dictionaryProperties.ca,new u(e)),this.dictionary.items.setValue(this.dictionaryProperties.BM,new o(i.toString()))}Object.defineProperty(pe.prototype,"automaticFields",{get:function(){return this.automaticFieldsInformation},enumerable:!0,configurable:!0}),pe.prototype.add=function(t){return this.automaticFields.push(t)};var ce=pe;function pe(){this.automaticFieldsInformation=[]}function de(){}de.prototype.drawHelper=function(t,e,i){var r=0!==e||0!==i,n=null;r&&(n=t.save(),t.translateTransform(e,i)),this.drawInternal(t),r&&t.restore(n)},fe=function(t,e){return(fe=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}fe(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(ye,ge=de),Object.defineProperty(ye.prototype,"bounds",{get:function(){return this.internalBounds},set:function(t){this.internalBounds=t},enumerable:!0,configurable:!0}),Object.defineProperty(ye.prototype,"size",{get:function(){return new Y(this.bounds.width,this.bounds.height)},set:function(t){this.bounds.width=t.width,this.bounds.height=t.height},enumerable:!0,configurable:!0}),Object.defineProperty(ye.prototype,"location",{get:function(){return new q(this.bounds.x,this.bounds.y)},set:function(t){this.bounds.x=t.x,this.bounds.y=t.y},enumerable:!0,configurable:!0}),Object.defineProperty(ye.prototype,"font",{get:function(){return this.internalFont},set:function(t){this.internalFont=t},enumerable:!0,configurable:!0}),Object.defineProperty(ye.prototype,"brush",{get:function(){return this.internalBrush},set:function(t){this.internalBrush=t},enumerable:!0,configurable:!0}),Object.defineProperty(ye.prototype,"pen",{get:function(){return this.internalPen},set:function(t){this.internalPen=t},enumerable:!0,configurable:!0}),Object.defineProperty(ye.prototype,"stringFormat",{get:function(){return this.internalStringFormat},set:function(t){this.internalStringFormat=t},enumerable:!0,configurable:!0}),ye.prototype.performDrawHelper=function(t,e,i,r){0!==this.bounds.height&&0!==this.bounds.width||(t=this.getValue(t),this.internalTemplateSize=this.getFont().measureString(t,this.size,this.stringFormat))},ye.prototype.draw=function(t,e,i){var r;void 0===e?(r=new q(0,0),this.draw(t,r)):e instanceof q?this.draw(t,e.x,e.y):(this.drawHelper(t,e,i),r=new be(this,new q(e,i)),t.automaticFields.add(r))},ye.prototype.getSize=function(){return 0===this.bounds.height||0===this.bounds.width?this.internalTemplateSize:this.size},ye.prototype.drawInternal=function(t){},ye.prototype.getBrush=function(){return void 0===this.internalBrush||null==this.internalBrush?new mt(new f(0,0,0)):this.internalBrush},ye.prototype.getFont=function(){return void 0===this.internalFont||null==this.internalFont?Br.defaultFont:this.internalFont},ye.prototype.getPageFromGraphics=function(t){return void 0!==t.page&&null!==t.page?t.page:t.currentPage};var fe,ge,me=ye;function ye(){var t=ge.call(this)||this;return t.internalBounds=new X(0,0,0,0),t.internalTemplateSize=new Y(0,0),t}Object.defineProperty(we.prototype,"location",{get:function(){return this.pageNumberFieldLocation},set:function(t){this.pageNumberFieldLocation=t},enumerable:!0,configurable:!0}),Object.defineProperty(we.prototype,"field",{get:function(){return this.pageNumberField},set:function(t){this.pageNumberField=t},enumerable:!0,configurable:!0}),Object.defineProperty(we.prototype,"scalingX",{get:function(){return this.scaleX},set:function(t){this.scaleX=t},enumerable:!0,configurable:!0}),Object.defineProperty(we.prototype,"scalingY",{get:function(){return this.scaleY},set:function(t){this.scaleY=t},enumerable:!0,configurable:!0});var be=we;function we(t,e,i,r){this.pageNumberFieldLocation=new q,this.pageNumberField=null,this.scaleX=1,this.scaleY=1,void 0===e&&t instanceof we?(this.pageNumberField=t.field,this.pageNumberFieldLocation=t.location,this.scaleX=t.scalingX,this.scaleY=t.scalingY):void 0===i&&e instanceof q&&t instanceof me?(this.pageNumberField=t,this.pageNumberFieldLocation=e):(this.pageNumberField=t,this.pageNumberFieldLocation=e,this.scaleX=i,this.scaleY=r)}Object.defineProperty(Se.prototype,"position",{get:function(){return this.mPosition},set:function(t){this.mPosition=t},enumerable:!0,configurable:!0}),Se.prototype.read=function(t,e,i){for(var r=e;r<i;r++){var n=this.position;t.buffer[r]=this.readByte(n),this.position++}},Se.prototype.getBuffer=function(t){return this.buffer[t]},Se.prototype.writeFromBase64String=function(t){t=this.encodedString(t);this.buffer=t},Se.prototype.encodedString=function(t){for(var e,i,r,n,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",s=0,a=0,h=3*(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length/4,l=(t.charAt(t.length-1)===o.charAt(64)&&h--,new Uint8Array(0|h));s<t.length;)i=o.indexOf(t.charAt(s++)),e=(15&(r=o.indexOf(t.charAt(s++))))<<4|(n=o.indexOf(t.charAt(s++)))>>2,n=(3&n)<<6|o.indexOf(t.charAt(s++)),l[a++]=i<<2|r>>4,l[a++]=e,l[a++]=n;return l},Se.prototype.readByte=function(t){return this.buffer[t]},Object.defineProperty(Se.prototype,"internalBuffer",{get:function(){return this.buffer},enumerable:!0,configurable:!0}),Object.defineProperty(Se.prototype,"count",{get:function(){return this.buffer.byteLength},enumerable:!0,configurable:!0}),Se.prototype.readNextTwoBytes=function(t){var e=t.readByte(this.position);return this.position++,e=(e<<=8)|t.readByte(this.position),this.position++,e};var Pe=Se;function Se(t){this.mPosition=0,this.buffer=new Uint8Array(t),this.dataView=new DataView(this.buffer.buffer)}(w=K.ImageFormat||(K.ImageFormat={}))[w.Unknown=0]="Unknown",w[w.Bmp=1]="Bmp",w[w.Emf=2]="Emf",w[w.Gif=3]="Gif",w[w.Jpeg=4]="Jpeg",w[w.Png=5]="Png",w[w.Wmf=6]="Wmf",w[w.Icon=7]="Icon";Object.defineProperty(Ce.prototype,"height",{get:function(){return this.mHeight},enumerable:!0,configurable:!0}),Object.defineProperty(Ce.prototype,"width",{get:function(){return this.mWidth},enumerable:!0,configurable:!0}),Object.defineProperty(Ce.prototype,"bitsPerComponent",{get:function(){return this.mbitsPerComponent},enumerable:!0,configurable:!0}),Object.defineProperty(Ce.prototype,"size",{get:function(){return this.mImageData.count},enumerable:!0,configurable:!0}),Object.defineProperty(Ce.prototype,"imageData",{get:function(){return this.mImageData},enumerable:!0,configurable:!0}),Object.defineProperty(Ce.prototype,"imageDataAsNumberArray",{get:function(){return this.mImageData.internalBuffer.buffer},enumerable:!0,configurable:!0}),Ce.prototype.initialize=function(){if(this.mFormat!==K.ImageFormat.Unknown||!this.checkIfJpeg())throw new TypeError("Only the JPEG format is supported");this.mFormat=K.ImageFormat.Jpeg,this.parseJpegImage(),this.reset(),this.mImageData=new Pe(this.mStream.count),this.mStream.read(this.mImageData,0,this.mImageData.count)},Ce.prototype.reset=function(){this.mStream.position=0},Ce.prototype.parseJpegImage=function(){this.reset();for(var t=new Pe(this.mStream.count),e=(this.mStream.read(t,0,t.count),4),i=!1,r=256*t.getBuffer(e)+t.getBuffer(e+1);e<t.count;){if(!((e+=r)<t.count)){i=!0;break}if(192===t.getBuffer(e+1))return this.mHeight=256*t.getBuffer(e+5)+t.getBuffer(e+6),void(this.mWidth=256*t.getBuffer(e+7)+t.getBuffer(e+8));e+=2,r=256*t.getBuffer(e)+t.getBuffer(e+1)}i&&(this.mStream.position=0,this.skip(this.mStream,2),this.readExceededJPGImage(this.mStream))},Object.defineProperty(Ce.prototype,"format",{get:function(){return this.mFormat},enumerable:!0,configurable:!0}),Ce.prototype.checkIfJpeg=function(){this.reset();for(var t=0;t<Ce.mJpegHeader.length;t++){if(Ce.mJpegHeader[t]!==this.mStream.readByte(t))return!1;this.mStream.position++}return!0},Ce.prototype.getImageDictionary=function(){if(this.mFormat===K.ImageFormat.Jpeg){this.imageData.internalBuffer.length;this.imageStream=new U,this.imageStream.isResource=!0;for(var t="",e="",i=0;i<this.imageDataAsNumberArray.byteLength;i++)t+=String.fromCharCode(null,this.mStream.readByte(i));for(i=0;i<t.length;i++)i%2!=0&&(e+=t[i]);this.imageStream.data=[e],this.imageStream.compress=!1,this.imageStream.items.setValue(this.dictionaryProperties.type,new o(this.dictionaryProperties.xObject)),this.imageStream.items.setValue(this.dictionaryProperties.subtype,new o(this.dictionaryProperties.image)),this.imageStream.items.setValue(this.dictionaryProperties.width,new u(this.width)),this.imageStream.items.setValue(this.dictionaryProperties.height,new u(this.height)),this.imageStream.items.setValue(this.dictionaryProperties.bitsPerComponent,new u(this.bitsPerComponent)),this.imageStream.items.setValue(this.dictionaryProperties.filter,new o(this.dictionaryProperties.dctdecode)),this.imageStream.items.setValue(this.dictionaryProperties.colorSpace,new o(this.getColorSpace())),this.imageStream.items.setValue(this.dictionaryProperties.decodeParms,this.getDecodeParams())}return this.imageStream},Ce.prototype.getColorSpace=function(){return this.dictionaryProperties.deviceRgb},Ce.prototype.getDecodeParams=function(){var t=new c;return t.items.setValue(this.dictionaryProperties.columns,new u(this.width)),t.items.setValue(this.dictionaryProperties.blackIs1,new It(!0)),t.items.setValue(this.dictionaryProperties.k,new u(-1)),t.items.setValue(this.dictionaryProperties.predictor,new u(15)),t.items.setValue(this.dictionaryProperties.bitsPerComponent,new u(this.bitsPerComponent)),t},Ce.prototype.readExceededJPGImage=function(t){this.mStream=t;for(var e=!0;e;)switch(this.getMarker(t)){case this.sof1Marker:case this.sof2Marker:case this.sof3Marker:case this.sof5Marker:case this.sof6Marker:case this.sof7Marker:case this.sof9Marker:case this.sof10Marker:case this.sof11Marker:case this.sof13Marker:case this.sof14Marker:case this.sof15Marker:t.position+=3,this.mHeight=this.mStream.readNextTwoBytes(t),this.mWidth=this.mStream.readNextTwoBytes(t),e=!1;break;default:this.skipStream(t)}},Ce.prototype.skip=function(t,e){this.mStream=t;t=new Pe(e);this.mStream.read(t,0,t.count)},Ce.prototype.getMarker=function(t){var e=32,e=t.readByte(this.mStream.position);for(t.position++;255!==e;)e=t.readByte(this.mStream.position),t.position++;for(;e=t.readByte(this.mStream.position),t.position++,255===e;);return e},Ce.prototype.skipStream=function(t){var e=this.mStream.readNextTwoBytes(t)-2;0<e&&(t.position+=e)},Ce.mPngHeader=[137,80,78,71,13,10,26,10],Ce.mJpegHeader=[255,216],Ce.GIF_HEADER="G,I,F,8",Ce.BMP_HEADER="B,M";var ve=Ce;function Ce(t){this.sof1Marker=193,this.sof2Marker=194,this.sof3Marker=195,this.sof5Marker=197,this.sof6Marker=198,this.sof7Marker=199,this.sof9Marker=201,this.sof10Marker=202,this.sof11Marker=203,this.sof13Marker=205,this.sof14Marker=206,this.sof15Marker=207,this.mFormat=K.ImageFormat.Unknown,this.mbitsPerComponent=8,this.dictionaryProperties=new l,this.mStream=t,this.initialize()}Oe.prototype.convertUnits=function(t,e,i){return this.convertFromPixels(this.convertToPixels(t,e),i)},Oe.prototype.convertToPixels=function(t,e){return t*this.proportions[e]},Oe.prototype.convertFromPixels=function(t,e){return t/this.proportions[e]},Oe.prototype.updateProportionsHelper=function(t){this.proportions=[t/2.54,t/6,1,t/72,t,t/300,t/25.4]},Oe.horizontalResolution=96,Oe.verticalResolution=96;var Be=Oe;function Oe(t){this.updateProportionsHelper(t)}Object.defineProperty(Le.prototype,"width",{get:function(){return this.imageWidth},set:function(t){this.imageWidth=t},enumerable:!0,configurable:!0}),Object.defineProperty(Le.prototype,"height",{get:function(){return this.imageHeight},set:function(t){this.imageHeight=t},enumerable:!0,configurable:!0}),Object.defineProperty(Le.prototype,"size",{set:function(t){this.width=t.width,this.height=t.height},enumerable:!0,configurable:!0}),Object.defineProperty(Le.prototype,"physicalDimension",{get:function(){return this.imagePhysicalDimension=this.getPointSize(this.width,this.height,this.horizontalResolution,this.verticalResolution),new Y(this.width,this.height)},enumerable:!0,configurable:!0}),Object.defineProperty(Le.prototype,"element",{get:function(){return this.imageStream},enumerable:!0,configurable:!0}),Le.prototype.getPointSize=function(t,e,i,r){var n,o;return void 0===i?(n=Be.horizontalResolution,o=Be.verticalResolution,this.getPointSize(t,e,n,o)):(n=new Be(i),o=new Be(r),i=n.convertUnits(t,K.PdfGraphicsUnit.Pixel,K.PdfGraphicsUnit.Point),r=o.convertUnits(e,K.PdfGraphicsUnit.Pixel,K.PdfGraphicsUnit.Point),new Y(i,r))};var xe=Le;function Le(){}Te=function(t,e){return(Te=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}Te(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(Ve,je=xe),Ve.prototype.loadImage=function(t){this.initializeAsync(t)},Ve.prototype.initializeAsync=function(t){var e=new Pe(t.length);e.writeFromBase64String(t),this.decoder=new ve(e),this.height=this.decoder.height,this.width=this.decoder.width,this.bitsPerComponent=this.decoder.bitsPerComponent},Ve.prototype.save=function(){this.imageStatus=!0,this.imageStream=this.decoder.getImageDictionary()};var Te,je,ke=Ve;function Ve(t){var e=je.call(this)||this;return e.imageStatus=!0,e.dictionaryProperties=new l,e.loadImage(t),e}Object.defineProperty(Me.prototype,"empty",{get:function(){return this.offset===this.length&&this.length===this.checksum&&0===this.checksum},enumerable:!0,configurable:!0});var Re=Me;function Me(){}var De=function(){},Ne=function(){},Ae=function(){},Ie=(Object.defineProperty(Fe.prototype,"isItalic",{get:function(){return 0!=(2&this.macStyle)},enumerable:!0,configurable:!0}),Object.defineProperty(Fe.prototype,"isBold",{get:function(){return 0!=(1&this.macStyle)},enumerable:!0,configurable:!0}),Fe);function Fe(){}var Ee=function(){},Ge=function(){},ze=function(){},We=function(){},_e=function(){},He=function(){},Ue=(Object.defineProperty(Ke.prototype,"empty",{get:function(){return this.index===this.width&&this.width===this.charCode&&0===this.charCode},enumerable:!0,configurable:!0}),Ke.prototype.compareTo=function(t){return this.index-t.index},Ke);function Ke(){}var qe=function(){},Ye=function(){},Xe=function(){},Je=function(){},Ze=function(){},$e=(Object.defineProperty(Qe.prototype,"data",{get:function(){if(this.buffer.length<this.bufferLength)for(var t=this.bufferLength-this.buffer.length,e=0;e<t;e++)this.buffer.push(0);return this.buffer},enumerable:!0,configurable:!0}),Object.defineProperty(Qe.prototype,"position",{get:function(){return void 0!==this.internalPosition&&null!==this.internalPosition||(this.internalPosition=0),this.internalPosition},enumerable:!0,configurable:!0}),Qe.prototype.writeShort=function(t){this.flush([(65280&t)>>8,255&t])},Qe.prototype.writeInt=function(t){this.flush([(4278190080&t)>>24,(16711680&t)>>16,(65280&t)>>8,255&t])},Qe.prototype.writeUInt=function(t){this.flush([(4278190080&t)>>24,(16711680&t)>>16,(65280&t)>>8,255&t])},Qe.prototype.writeString=function(t){if(null==t)throw new Error("Argument Null Exception : value");for(var e=[],i=0;i<t.length;i++)e.push(t.charCodeAt(i));this.flush(e)},Qe.prototype.writeBytes=function(t){this.flush(t)},Qe.prototype.flush=function(t){if(null===t)throw new Error("Argument Null Exception : buff");for(var e=this.position,i=0;i<t.length;i++)this.buffer[e]=t[i],e++;this.internalPosition+=t.length},Qe);function Qe(t){this.int32Size=4,this.int16Size=2,this.int64Size=8,this.bufferLength=t,this.buffer=[]}Object.defineProperty(b.prototype,"macintosh",{get:function(){return null!==this.macintoshDictionary&&void 0!==this.macintoshDictionary||(this.macintoshDictionary=new a),this.macintoshDictionary},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"microsoft",{get:function(){return null!==this.microsoftDictionary&&void 0!==this.microsoftDictionary||(this.microsoftDictionary=new a),this.microsoftDictionary},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"macintoshGlyphs",{get:function(){return null!==this.internalMacintoshGlyphs&&void 0!==this.internalMacintoshGlyphs||(this.internalMacintoshGlyphs=new a),this.internalMacintoshGlyphs},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"microsoftGlyphs",{get:function(){return null!==this.internalMicrosoftGlyphs&&void 0!==this.internalMicrosoftGlyphs||(this.internalMicrosoftGlyphs=new a),this.internalMicrosoftGlyphs},enumerable:!0,configurable:!0}),b.prototype.initialize=function(){void 0===this.metrics&&(this.metrics=new Ie),this.readFontDictionary();var t=this.readNameTable(),e=this.readHeadTable();this.initializeFontName(t),this.metrics.macStyle=e.macStyle},b.prototype.readFontDictionary=function(){this.offset=0;this.checkPreambula();var t=this.readInt16(this.offset);this.readInt16(this.offset),this.readInt16(this.offset),this.readInt16(this.offset);void 0===this.tableDirectory&&(this.tableDirectory=new a);for(var e=0;e<t;++e){var i=new Re,r=this.readString(this.int32Size);i.checksum=this.readInt32(this.offset),i.offset=this.readInt32(this.offset),i.length=this.readInt32(this.offset),this.tableDirectory.setValue(r,i)}this.lowestPosition=this.offset,this.isTtcFont||this.fixOffsets()},b.prototype.fixOffsets=function(){for(var t=Number.MAX_VALUE,e=this.tableDirectory.keys(),i=0;i<e.length;i++){var r=(o=this.tableDirectory.getValue(e[i])).offset;if(r<t&&(t=r)<=this.lowestPosition)break}var n=t-this.lowestPosition;if(0!=n){for(var o,s=new a,i=0;i<e.length;i++)(o=this.tableDirectory.getValue(e[i])).offset-=n,s.setValue(e[i],o);this.tableDirectory=s}},b.prototype.checkPreambula=function(){var t=this.readInt32(this.offset);if(this.isMacTtf=1953658213===t,65536!==t&&1953658213!==t&&1330926671!==t){if(this.isTtcFont=!0,this.offset=0,"ttcf"!==this.readString(4))throw new Error("Can not read TTF font data");if(this.offset+=4,this.readInt32(this.offset)<0)throw new Error("Can not read TTF font data");this.offset=this.readInt32(this.offset),t=this.readInt32(this.offset)}return t},b.prototype.readNameTable=function(){for(var t=this.getTable("name"),e=(this.offset=t.offset,new De),i=(e.formatSelector=this.readUInt16(this.offset),e.recordsCount=this.readUInt16(this.offset),e.offset=this.readUInt16(this.offset),e.nameRecords=[],this.offset),r=0;r<e.recordsCount;r++){this.offset=i;var n=new Ne,o=(n.platformID=this.readUInt16(this.offset),n.encodingID=this.readUInt16(this.offset),n.languageID=this.readUInt16(this.offset),n.nameID=this.readUInt16(this.offset),n.length=this.readUInt16(this.offset),n.offset=this.readUInt16(this.offset),this.offset=t.offset+e.offset+n.offset,0===n.platformID||3===n.platformID);n.name=this.readString(n.length,o),e.nameRecords[r]=n,i+=12}return e},b.prototype.readHeadTable=function(){var t=this.getTable("head"),t=(this.offset=t.offset,new Ae);return t.version=this.readFixed(this.offset),t.fontRevision=this.readFixed(this.offset),t.checkSumAdjustment=this.readUInt32(this.offset),t.magicNumber=this.readUInt32(this.offset),t.flags=this.readUInt16(this.offset),t.unitsPerEm=this.readUInt16(this.offset),t.created=this.readInt64(this.offset),t.modified=this.readInt64(this.offset),t.xMin=this.readInt16(this.offset),t.yMin=this.readInt16(this.offset),t.xMax=this.readInt16(this.offset),t.yMax=this.readInt16(this.offset),t.macStyle=this.readUInt16(this.offset),t.lowestReadableSize=this.readUInt16(this.offset),t.fontDirectionHint=this.readInt16(this.offset),t.indexToLocalFormat=this.readInt16(this.offset),t.glyphDataFormat=this.readInt16(this.offset),t},b.prototype.readHorizontalHeaderTable=function(){var t=this.getTable("hhea"),t=(this.offset=t.offset,new Ee);return t.version=this.readFixed(this.offset),t.ascender=this.readInt16(this.offset),t.descender=this.readInt16(this.offset),t.lineGap=this.readInt16(this.offset),t.advanceWidthMax=this.readUInt16(this.offset),t.minLeftSideBearing=this.readInt16(this.offset),t.minRightSideBearing=this.readInt16(this.offset),t.xMaxExtent=this.readInt16(this.offset),t.caretSlopeRise=this.readInt16(this.offset),t.caretSlopeRun=this.readInt16(this.offset),this.offset+=10,t.metricDataFormat=this.readInt16(this.offset),t.numberOfHMetrics=this.readUInt16(this.offset),t},b.prototype.readOS2Table=function(){var t=this.getTable("OS/2"),t=(this.offset=t.offset,new Ge);return t.version=this.readUInt16(this.offset),t.xAvgCharWidth=this.readInt16(this.offset),t.usWeightClass=this.readUInt16(this.offset),t.usWidthClass=this.readUInt16(this.offset),t.fsType=this.readInt16(this.offset),t.ySubscriptXSize=this.readInt16(this.offset),t.ySubscriptYSize=this.readInt16(this.offset),t.ySubscriptXOffset=this.readInt16(this.offset),t.ySubscriptYOffset=this.readInt16(this.offset),t.ySuperscriptXSize=this.readInt16(this.offset),t.ySuperscriptYSize=this.readInt16(this.offset),t.ySuperscriptXOffset=this.readInt16(this.offset),t.ySuperscriptYOffset=this.readInt16(this.offset),t.yStrikeoutSize=this.readInt16(this.offset),t.yStrikeoutPosition=this.readInt16(this.offset),t.sFamilyClass=this.readInt16(this.offset),t.panose=this.readBytes(10),t.ulUnicodeRange1=this.readUInt32(this.offset),t.ulUnicodeRange2=this.readUInt32(this.offset),t.ulUnicodeRange3=this.readUInt32(this.offset),t.ulUnicodeRange4=this.readUInt32(this.offset),t.vendorIdentifier=this.readBytes(4),t.fsSelection=this.readUInt16(this.offset),t.usFirstCharIndex=this.readUInt16(this.offset),t.usLastCharIndex=this.readUInt16(this.offset),t.sTypoAscender=this.readInt16(this.offset),t.sTypoDescender=this.readInt16(this.offset),t.sTypoLineGap=this.readInt16(this.offset),t.usWinAscent=this.readUInt16(this.offset),t.usWinDescent=this.readUInt16(this.offset),t.ulCodePageRange1=this.readUInt32(this.offset),t.ulCodePageRange2=this.readUInt32(this.offset),1<t.version?(t.sxHeight=this.readInt16(this.offset),t.sCapHeight=this.readInt16(this.offset),t.usDefaultChar=this.readUInt16(this.offset),t.usBreakChar=this.readUInt16(this.offset),t.usMaxContext=this.readUInt16(this.offset)):(t.sxHeight=0,t.sCapHeight=0,t.usDefaultChar=0,t.usBreakChar=0,t.usMaxContext=0),t},b.prototype.readPostTable=function(){var t=this.getTable("post"),t=(this.offset=t.offset,new ze);return t.formatType=this.readFixed(this.offset),t.italicAngle=this.readFixed(this.offset),t.underlinePosition=this.readInt16(this.offset),t.underlineThickness=this.readInt16(this.offset),t.isFixedPitch=this.readUInt32(this.offset),t.minType42=this.readUInt32(this.offset),t.maxType42=this.readUInt32(this.offset),t.minType1=this.readUInt32(this.offset),t.maxType1=this.readUInt32(this.offset),t},b.prototype.readWidthTable=function(t,e){for(var i=this.getTable("hmtx"),r=(this.offset=i.offset,[]),n=0;n<t;n++){var o=new We,o=(o.advanceWidth=this.readUInt16(this.offset),o.lsb=this.readInt16(this.offset),1e3*o.advanceWidth/e);r.push(Math.floor(o))}return r},b.prototype.readCmapTable=function(){for(var t=this.getTable("cmap"),e=(this.offset=t.offset,new He),i=(e.version=this.readUInt16(this.offset),e.tablesCount=this.readUInt16(this.offset),this.offset),r=[],n=0;n<e.tablesCount;n++){this.offset=i;var o=new _e;o.platformID=this.readUInt16(this.offset),o.encodingID=this.readUInt16(this.offset),o.offset=this.readUInt32(this.offset),i=this.offset,this.readCmapSubTable(o),r[n]=o}return r},b.prototype.readCmapSubTable=function(t){var e=this.getTable("cmap"),e=(this.offset=e.offset+t.offset,this.readUInt16(this.offset)),i=this.getCmapEncoding(t.platformID,t.encodingID);i===K.TtfCmapEncoding.Macintosh?K.TtfPlatformID.Macintosh:K.TtfPlatformID.Microsoft;if(i!==K.TtfCmapEncoding.Unknown)switch(e){case K.TtfCmapFormat.Apple:this.readAppleCmapTable(t,i);break;case K.TtfCmapFormat.Microsoft:this.readMicrosoftCmapTable(t,i);break;case K.TtfCmapFormat.Trimmed:this.readTrimmedCmapTable(t,i)}},b.prototype.readAppleCmapTable=function(t,e){var i=this.getTable("cmap"),i=(this.offset=i.offset+t.offset,new Ye);i.format=this.readUInt16(this.offset),i.length=this.readUInt16(this.offset),i.version=this.readUInt16(this.offset),null!==this.maxMacIndex&&void 0!==this.maxMacIndex||(this.maxMacIndex=0);for(var r=0;r<256;++r){var n=new Ue;n.index=this.readByte(this.offset),n.width=this.getWidth(n.index),n.charCode=r,this.macintosh.setValue(r,n),this.addGlyph(n,e),this.maxMacIndex=Math.max(r,this.maxMacIndex)}},b.prototype.readMicrosoftCmapTable=function(t,e){for(var i=this.getTable("cmap"),r=(this.offset=i.offset+t.offset,e===K.TtfCmapEncoding.Unicode?this.microsoft:this.macintosh),n=new Xe,o=(n.format=this.readUInt16(this.offset),n.length=this.readUInt16(this.offset),n.version=this.readUInt16(this.offset),n.segCountX2=this.readUInt16(this.offset),n.searchRange=this.readUInt16(this.offset),n.entrySelector=this.readUInt16(this.offset),n.rangeShift=this.readUInt16(this.offset),n.segCountX2/2),i=(n.endCount=this.readUshortArray(o),n.reservedPad=this.readUInt16(this.offset),n.startCount=this.readUshortArray(o),n.idDelta=this.readUshortArray(o),n.idRangeOffset=this.readUshortArray(o),n.length/2-8-4*o),s=(n.glyphID=this.readUshortArray(i),0),a=0;a<o;a++)for(var h=n.startCount[a];h<=n.endCount[a]&&65535!==h;h++){if(0===n.idRangeOffset[a])s=h+n.idDelta[a]&65535;else{if((l=a+n.idRangeOffset[a]/2-o+h-n.startCount[a])>=n.glyphID.length)continue;s=n.glyphID[l]+n.idDelta[a]&65535}var l=new Ue,u=(l.index=s,l.width=this.getWidth(l.index),e===K.TtfCmapEncoding.Symbol&&61440==(65280&h)?255&h:h);l.charCode=u,r.setValue(u,l),this.addGlyph(l,e)}},b.prototype.readTrimmedCmapTable=function(t,e){var i=this.getTable("cmap"),r=(this.offset=i.offset+t.offset,new Je);r.format=this.readUInt16(this.offset),r.length=this.readUInt16(this.offset),r.version=this.readUInt16(this.offset),r.firstCode=this.readUInt16(this.offset),r.entryCount=this.readUInt16(this.offset);for(var n=0;n<r.entryCount;++n){var o=new Ue;o.index=this.readUInt16(this.offset),o.width=this.getWidth(o.index),o.charCode=n+r.firstCode,this.macintosh.setValue(n,o),this.addGlyph(o,e),this.maxMacIndex=Math.max(n,this.maxMacIndex)}},b.prototype.initializeFontName=function(t){for(var e=0;e<t.recordsCount;e++){var i=t.nameRecords[e];if(1===i.nameID?this.metrics.fontFamily=i.name:6===i.nameID&&(this.metrics.postScriptName=i.name),null!==this.metrics.fontFamily&&void 0!==this.metrics.fontFamily&&null!==this.metrics.postScriptName&&void 0!==this.metrics.postScriptName)break}},b.prototype.getTable=function(t){var e,i=new Re;return i=null!=(e=this.tableDirectory.containsKey(t)?this.tableDirectory.getValue(t):e)?e:i},b.prototype.getWidth=function(t){return t=t<this.width.length?t:this.width.length-1,this.width[t]},b.prototype.getCmapEncoding=function(t,e){var i=K.TtfCmapEncoding.Unknown;return t==K.TtfPlatformID.Microsoft&&e==K.TtfMicrosoftEncodingID.Undefined?i=K.TtfCmapEncoding.Symbol:t==K.TtfPlatformID.Microsoft&&e==K.TtfMicrosoftEncodingID.Unicode?i=K.TtfCmapEncoding.Unicode:t==K.TtfPlatformID.Macintosh&&e==K.TtfMacintoshEncodingID.Roman&&(i=K.TtfCmapEncoding.Macintosh),i},b.prototype.addGlyph=function(t,e){var i=null;switch(e){case K.TtfCmapEncoding.Unicode:i=this.microsoftGlyphs;break;case K.TtfCmapEncoding.Macintosh:case K.TtfCmapEncoding.Symbol:i=this.macintoshGlyphs}i.setValue(t.index,t)},b.prototype.initializeMetrics=function(t,e,i,r,n,o){this.initializeFontName(t);for(var s=!1,a=0;a<o.length;a++){var h=o[a];if(this.getCmapEncoding(h.platformID,h.encodingID)===K.TtfCmapEncoding.Symbol){s=!0;break}}this.metrics.isSymbol=s,this.metrics.macStyle=e.macStyle,this.metrics.isFixedPitch=0!==n.isFixedPitch,this.metrics.italicAngle=n.italicAngle;var t=1e3/e.unitsPerEm,n=(this.metrics.winAscent=r.sTypoAscender*t,this.metrics.macAscent=i.ascender*t,this.metrics.capHeight=0!==r.sCapHeight?r.sCapHeight:.7*e.unitsPerEm*t,this.metrics.winDescent=r.sTypoDescender*t,this.metrics.macDescent=i.descender*t,this.metrics.leading=(r.sTypoAscender-r.sTypoDescender+r.sTypoLineGap)*t,this.metrics.lineGap=Math.ceil(i.lineGap*t),e.xMin*t),i=Math.ceil(this.metrics.macAscent+this.metrics.lineGap),t=e.xMax*t,l=this.metrics.macDescent;this.metrics.fontBox=new ut(n,i,t,l),this.metrics.stemV=80,this.metrics.widthTable=this.updateWidth(),this.metrics.contains=this.tableDirectory.containsKey("CFF"),this.metrics.subScriptSizeFactor=e.unitsPerEm/r.ySubscriptYSize,this.metrics.superscriptSizeFactor=e.unitsPerEm/r.ySuperscriptYSize},b.prototype.updateWidth=function(){var t=[];if(this.metrics.isSymbol)for(var e=0;e<256;e++){var i=this.getGlyph(String.fromCharCode(e));t[e]=i.empty?0:i.width}else for(var r=[],n=String.fromCharCode(32),e=0;e<256;e++){r[0]=e;var o=this.getString(r,0,r.length),o=0<o.length?o[0]:"?";(i=this.getGlyph(o)).empty?(i=this.getGlyph(n),t[e]=i.empty?0:i.width):t[e]=i.width}return t},b.prototype.getDefaultGlyph=function(){return this.getGlyph(Pt.whiteSpace)},b.prototype.getString=function(t,e,i){for(var r="",n=0;n<i;n++)r+=String.fromCharCode(t[n+e]);return r},b.prototype.readLocaTable=function(t){var e=this.getTable("loca"),i=(this.offset=e.offset,new qe),r=null;if(t)for(var n=e.length/2,r=[],o=0;o<n;o++)r[o]=2*this.readUInt16(this.offset);else{n=e.length/4;r=[];for(o=0;o<n;o++)r[o]=this.readUInt32(this.offset)}return i.offsets=r,i},b.prototype.updateGlyphChars=function(t,e){t.containsKey(0)||t.setValue(0,0);for(var i=new a,r=t.keys(),n=0;n<r.length;n++)i.setValue(r[n],t.getValue(r[n]));for(n=0;n<r.length;n++){var o=r[n];this.processCompositeGlyph(t,o,e)}},b.prototype.processCompositeGlyph=function(t,e,i){if(e<i.offsets.length-1){var r=i.offsets[e];if(r!==i.offsets[e+1]){i=this.getTable("glyf"),e=(this.offset=i.offset+r,new Ze);if(e.numberOfContours=this.readInt16(this.offset),e.xMin=this.readInt16(this.offset),e.yMin=this.readInt16(this.offset),e.xMax=this.readInt16(this.offset),e.yMax=this.readInt16(this.offset),e.numberOfContours<0)for(var n=0;;){var o=this.readUInt16(this.offset),s=this.readUInt16(this.offset);if(t.containsKey(s)||t.setValue(s,0),0==(o&K.TtfCompositeGlyphFlags.MoreComponents))break;n=0!=(o&K.TtfCompositeGlyphFlags.Arg1And2AreWords)?4:2,0!=(o&K.TtfCompositeGlyphFlags.WeHaveScale)?n+=2:0!=(o&K.TtfCompositeGlyphFlags.WeHaveAnXyScale)?n+=4:0!=(o&K.TtfCompositeGlyphFlags.WeHaveTwoByTwo)&&(n+=8),this.offset+=n}}}},b.prototype.generateGlyphTable=function(t,e,i,r){i=[];for(var n=t.keys(),o=(n.sort(function(t,e){return t-e}),0),s=0;s<n.length;s++){var a=n[s];0<e.offsets.length&&(o+=e.offsets[a+1]-e.offsets[a])}var h=this.align(o);r=[];for(s=0;s<h;s++)r.push(0);for(var l,u,c=0,p=0,d=this.getTable("glyf"),s=0;s<e.offsets.length;s++)i.push(c),p<n.length&&n[p]===s&&(++p,i[s]=c,l=e.offsets[s],0<(u=e.offsets[s+1]-l))&&(this.offset=d.offset+l,r=this.read(r,c,u).buffer,c+=u);return{glyphTableSize:o,newLocaTable:i,newGlyphTable:r}},b.prototype.updateLocaTable=function(t,e,i){if(null===t)throw new Error("Argument Null Exception : newLocaTable");for(var r=e?2*t.length:4*t.length,n=this.align(r),o=new $e(n),s=0;s<t.length;s++){var a=t[s];e?(a/=2,o.writeShort(a)):o.writeInt(a)}return{newLocaUpdated:o.data,newLocaSize:r}},b.prototype.align=function(t){return t+3&-4},b.prototype.getFontProgram=function(t,e,i,r){if(null===t)throw new Error("Argument Null Exception : newLocaTableOut");if(null===e)throw new Error("Argument Null Exception : newGlyphTable");this.tableNames;var n=this.getFontProgramLength(t,e,0),o=n.fontProgramLength,n=n.numTables,o=new $e(o),s=(o.writeInt(65536),o.writeShort(n),this.entrySelectors[n]);return o.writeShort(16*(1<<(31&s))),o.writeShort(s),o.writeShort(16*(n-(1<<(31&s)))),this.writeCheckSums(o,n,t,e,i,r),this.writeGlyphs(o,t,e),o.data},b.prototype.getFontProgramLength=function(t,e,i){if(null===t)throw new Error("Argument Null Exception : newLocaTableOut");if(null===e)throw new Error("Argument Null Exception : newGlyphTable");i=2;for(var r=this.tableNames,n=0,o=0;o<r.length;o++){var s=r[o];"glyf"===s||"loca"===s||(s=this.getTable(s)).empty||(++i,n+=this.align(s.length))}return{fontProgramLength:n=(n+=t.length)+e.length+(16*i+12),numTables:i}},b.prototype.writeCheckSums=function(t,e,i,r,n,o){if(null===t)throw new Error("Argument Null Exception : writer");if(null===i)throw new Error("Argument Null Exception : newLocaTableOut");if(null===r)throw new Error("Argument Null Exception : newGlyphTable");for(var s=this.tableNames,a=16*e+12,h=0,l=0;l<s.length;l++){var u,c=s[l],p=this.getTable(c);p.empty||(t.writeString(c),h="glyf"===c?(u=this.calculateCheckSum(r),t.writeInt(u),n):"loca"===c?(u=this.calculateCheckSum(i),t.writeInt(u),o):(t.writeInt(p.checksum),p.length),t.writeUInt(a),t.writeUInt(h),a+=this.align(h))}},b.prototype.calculateCheckSum=function(t){if(null===t)throw new Error("Argument Null Exception : bytes");for(var e=0,i=0,r=0,n=0,o=0,s=0;s<(t.length+1)/4;s++)o+=255&t[e++],n+=255&t[e++],r+=255&t[e++],i+=255&t[e++];var a=i;return(a+=r<<8)+(n<<16)+(o<<24)},b.prototype.writeGlyphs=function(t,e,i){if(null===t)throw new Error("Argument Null Exception : writer");if(null===e)throw new Error("Argument Null Exception : newLocaTableOut");if(null===i)throw new Error("Argument Null Exception : newGlyphTable");for(var r=this.tableNames,n=0;n<r.length;n++){var o=r[n],s=this.getTable(o);if(!s.empty)if("glyf"===o)t.writeBytes(i);else if("loca"===o)t.writeBytes(e);else{for(var a=this.align(s.length),h=[],l=0;l<a;l++)h.push(0);this.offset=s.offset;o=this.read(h,0,s.length);t.writeBytes(o.buffer)}}},b.prototype.setOffset=function(t){this.offset=t},b.prototype.createInternals=function(){this.metrics=new Ie;var t=this.readNameTable(),e=this.readHeadTable(),i=(this.bIsLocaShort=0===e.indexToLocalFormat,this.readHorizontalHeaderTable()),r=this.readOS2Table(),n=this.readPostTable(),o=(this.width=this.readWidthTable(i.numberOfHMetrics,e.unitsPerEm),this.readCmapTable());this.initializeMetrics(t,e,i,r,n,o)},b.prototype.getGlyph=function(t){var e,i;return"number"==typeof t?(e=null,this.metrics.isSymbol||null==this.microsoftGlyphs?this.metrics.isSymbol&&null!=this.macintoshGlyphs&&this.macintoshGlyphs.containsKey(t)&&(e=this.macintoshGlyphs.getValue(t)):this.microsoftGlyphs.containsKey(t)&&(e=this.microsoftGlyphs.getValue(t)),null!=e?e:this.getDefaultGlyph()):(e=null,i=t.charCodeAt(0),this.metrics.isSymbol||null===this.microsoft?(this.metrics.isSymbol&&null!==this.macintosh||this.isMacTTF)&&(0!==this.maxMacIndex?i%=this.maxMacIndex+1:i=61440==(65280&i)?255&i:i,this.macintosh.containsKey(i))&&(e=this.macintosh.getValue(i),this.isFontPresent=!0):this.microsoft.containsKey(i)?(e=this.microsoft.getValue(i),i!==Pt.whiteSpace.charCodeAt(0)&&(this.isFontPresent=!0)):i!==Pt.whiteSpace.charCodeAt(0)&&(this.isFontPresent=!1),null!==(e=t===Pt.whiteSpace&&null===e?new Ue:e)?e:this.getDefaultGlyph())},b.prototype.getGlyphChars=function(t){if(null==t)throw new Error("Argument Null Exception : chars");for(var e=new a,i=t.keys(),r=0;r<i.length;r++){var n=i[r],o=this.getGlyph(n);o.empty||e.setValue(o.index,n.charCodeAt(0))}return e},b.prototype.getAllGlyphs=function(){for(var t=[],e=new Ue,i=0,r=0;r<this.width.length;r++){var n=this.width[r];e.index=i,e.width=n,t.push(e),i++}return t},b.prototype.readFontProgram=function(t){var e=this.getGlyphChars(t),i=this.readLocaTable(this.bIsLocaShort),t=(e.size()<t.size()&&(this.missedGlyphs=t.size()-e.size()),this.updateGlyphChars(e,i),this.generateGlyphTable(e,i,null,null)),e=t.glyphTableSize,i=t.newLocaTable,t=t.newGlyphTable,i=this.updateLocaTable(i,this.bIsLocaShort,null),r=i.newLocaSize,i=i.newLocaUpdated;return this.getFontProgram(i,t,e,r)},b.prototype.convertString=function(t){if(null===t)throw new Error("Argument Null Exception : text");for(var e="",i=0;i<t.length;i++){var r=t[i],r=this.getGlyph(r);r.empty||(e+=String.fromCharCode(r.index))}return e},b.prototype.getCharWidth=function(t){t=this.getGlyph(t);return(t=t.empty?this.getDefaultGlyph():t).empty?0:t.width},b.prototype.readString=function(t,e){if(void 0===e)return this.readString(t,!1);var i="";if(e)for(var r=0;r<t;r++)r%2!=0&&(i+=String.fromCharCode(this.fontData[this.offset])),this.offset+=1;else for(r=0;r<t;r++)i+=String.fromCharCode(this.fontData[this.offset]),this.offset+=1;return i},b.prototype.readFixed=function(t){return this.readInt16(t)+this.readInt16(t+2)/16384},b.prototype.readInt32=function(t){var e=this.fontData[t+3],i=this.fontData[t+2],r=this.fontData[t+1],t=this.fontData[t];return this.offset+=4,e+(i<<8)+(r<<16)+(t<<24)},b.prototype.readUInt32=function(t){var e=this.fontData[t+3],i=this.fontData[t+2],r=this.fontData[t+1],t=this.fontData[t];return this.offset+=4,e|i<<8|r<<16|t<<24},b.prototype.readInt16=function(t){t=32768&(t=(this.fontData[t]<<8)+this.fontData[t+1])?t-65536:t;return this.offset+=2,t},b.prototype.readInt64=function(t){var e=this.readInt32(t+4),t=4294967296*this.readInt32(t)+e;return e<0&&(t+=4294967296),t},b.prototype.readUInt16=function(t){t=this.fontData[t]<<8|this.fontData[t+1];return this.offset+=2,t},b.prototype.readUshortArray=function(t){for(var e=[],i=0;i<t;i++)e[i]=this.readUInt16(this.offset);return e},b.prototype.readBytes=function(t){for(var e=[],i=0;i<t;i++)e.push(this.fontData[this.offset]),this.offset+=1;return e},b.prototype.readByte=function(t){t=this.fontData[t];return this.offset+=1,t},b.prototype.read=function(t,e,i){if(null===t)throw new Error("Argument Null Exception : buffer");var r,n=0;do{for(var o=0;o<i-n&&this.offset+o<this.fontData.length;o++)t[e+o]=this.fontData[this.offset+o]}while(this.offset+=r=i-n,(n+=r)<i);return{buffer:t,written:n}};var ti=b;function b(t){this.int32Size=4,this.isTtcFont=!1,this.isMacTtf=!1,this.metricsName="",this.isMacTTF=!1,this.missedGlyphs=0,this.tableNames=["cvt ","fpgm","glyf","head","hhea","hmtx","loca","maxp","prep"],this.entrySelectors=[0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4],this.fontData=t,this.initialize()}ei=function(t,e){return(ei=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var ei,w=function(t,e){function i(){this.constructor=t}ei(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},ii=(ri.prototype.getAscent=function(t){return this.ascent*Tt.charSizeMultiplier*this.getSize(t)},ri.prototype.getDescent=function(t){return this.descent*Tt.charSizeMultiplier*this.getSize(t)},ri.prototype.getLineGap=function(t){return this.lineGap*Tt.charSizeMultiplier*this.getSize(t)},ri.prototype.getHeight=function(t){t=this.getDescent(t)<0?this.getAscent(t)-this.getDescent(t)+this.getLineGap(t):this.getAscent(t)+this.getDescent(t)+this.getLineGap(t);return t},ri.prototype.getSize=function(t){var e=this.size;if(null!=t)switch(t.subSuperScript){case K.PdfSubSuperScript.SubScript:e/=this.subScriptSizeFactor;break;case K.PdfSubSuperScript.SuperScript:e/=this.superscriptSizeFactor}return e},ri.prototype.clone=function(){return this.widthTable=ni.clone(),this},Object.defineProperty(ri.prototype,"widthTable",{get:function(){return this.internalWidthTable},set:function(t){this.internalWidthTable=t},enumerable:!0,configurable:!0}),ri);function ri(){this.lineGap=0}oi.clone=function(){return null};var ni=oi;function oi(){}w(hi,si=ni),hi.prototype.items=function(t){if(t<0||t>=this.widths.length)throw new Error("ArgumentOutOfRangeException:index, The character is not supported by the font.");return this.widths[t]},Object.defineProperty(hi.prototype,"length",{get:function(){return this.widths.length},enumerable:!0,configurable:!0}),hi.prototype.clone=function(){return this.widths=this.widths,this},hi.prototype.toArray=function(){return new p(this.widths)};var si,ai=hi;function hi(t){var e=si.call(this)||this;if(null==t)throw new Error("ArgumentNullException:widths");return e.widths=t,e}P.prototype.getCharWidth=function(t){return this.ttfReader.getCharWidth(t)},P.prototype.getLineWidth=function(t){for(var e=0,i=0,r=t.length;i<r;i++){var n=t[i];e+=this.getCharWidth(n)}return e},P.prototype.Initialize=function(){var t=new Pe(this.fontString.length);t.writeFromBase64String(this.fontString),this.fontData=t.internalBuffer,this.ttfReader=new ti(this.fontData),this.ttfMetrics=this.ttfReader.metrics},P.prototype.createInternals=function(){this.fontDictionary=new c,this.fontProgram=new U,this.cmap=new U,this.descendantFont=new c,this.metrics=new ii,this.ttfReader.createInternals(),this.ttfMetrics=this.ttfReader.metrics,this.initializeMetrics(),this.subsetName=this.getFontName(),this.createDescendantFont(),this.createCmap(),this.createFontDictionary(),this.createFontProgram()},P.prototype.getInternals=function(){return this.fontDictionary},P.prototype.initializeMetrics=function(){var t=this.ttfReader.metrics;this.metrics.ascent=t.macAscent,this.metrics.descent=t.macDescent,this.metrics.height=t.macAscent-t.macDescent+t.lineGap,this.metrics.name=t.fontFamily,this.metrics.postScriptName=t.postScriptName,this.metrics.size=this.fontSize,this.metrics.widthTable=new ai(t.widthTable),this.metrics.lineGap=t.lineGap,this.metrics.subScriptSizeFactor=t.subScriptSizeFactor,this.metrics.superscriptSizeFactor=t.superscriptSizeFactor,this.metrics.isBold=t.isBold},P.prototype.getFontName=function(){for(var t,e="",i=0;i<6;i++){var r=Math.floor(26*Math.random())+0;e+=this.nameString[r]}return t=(e=e+"+"+this.ttfReader.metrics.postScriptName).toString(),this.formatName(t)},P.prototype.formatName=function(t){t=t.replace("(","#28");return(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace(")","#29")).replace("[","#5B")).replace("]","#5D")).replace("<","#3C")).replace(">","#3E")).replace("{","#7B")).replace("}","#7D")).replace("/","#2F")).replace("%","#25")).replace(" ","#20")},P.prototype.createDescendantFont=function(){this.descendantFont.isResource=!0,this.descendantFont.descendantFontBeginSave=new I(this),this.descendantFont.items.setValue(this.dictionaryProperties.type,new o(this.dictionaryProperties.font)),this.descendantFont.items.setValue(this.dictionaryProperties.subtype,new o(this.dictionaryProperties.cIDFontType2)),this.descendantFont.items.setValue(this.dictionaryProperties.baseFont,new o(this.subsetName)),this.descendantFont.items.setValue(this.dictionaryProperties.cIDToGIDMap,new o(this.dictionaryProperties.identity)),this.descendantFont.items.setValue(this.dictionaryProperties.dw,new u(1e3)),this.fontDescriptor=this.createFontDescriptor(),this.descendantFont.items.setValue(this.dictionaryProperties.fontDescriptor,new d(this.fontDescriptor));var t=this.createSystemInfo();this.descendantFont.items.setValue(this.dictionaryProperties.cIDSystemInfo,t)},P.prototype.createFontDescriptor=function(){var t=new c,e=this.ttfReader.metrics;return t.isResource=!0,t.items.setValue(this.dictionaryProperties.type,new o(this.dictionaryProperties.fontDescriptor)),t.items.setValue(this.dictionaryProperties.fontName,new o(this.subsetName)),t.items.setValue(this.dictionaryProperties.flags,new u(this.getDescriptorFlags())),t.items.setValue(this.dictionaryProperties.fontBBox,p.fromRectangle(this.getBoundBox())),t.items.setValue(this.dictionaryProperties.missingWidth,new u(e.widthTable[32])),t.items.setValue(this.dictionaryProperties.stemV,new u(e.stemV)),t.items.setValue(this.dictionaryProperties.italicAngle,new u(e.italicAngle)),t.items.setValue(this.dictionaryProperties.capHeight,new u(e.capHeight)),t.items.setValue(this.dictionaryProperties.ascent,new u(e.winAscent)),t.items.setValue(this.dictionaryProperties.descent,new u(e.winDescent)),t.items.setValue(this.dictionaryProperties.leading,new u(e.leading)),t.items.setValue(this.dictionaryProperties.avgWidth,new u(e.widthTable[32])),t.items.setValue(this.dictionaryProperties.fontFile2,new d(this.fontProgram)),t.items.setValue(this.dictionaryProperties.maxWidth,new u(e.widthTable[32])),t.items.setValue(this.dictionaryProperties.xHeight,new u(0)),t.items.setValue(this.dictionaryProperties.stemH,new u(0)),t},P.prototype.createCmap=function(){this.cmap.cmapBeginSave=new $(this)},P.prototype.createFontDictionary=function(){this.fontDictionary.isResource=!0,this.fontDictionary.fontDictionaryBeginSave=new F(this),this.fontDictionary.items.setValue(this.dictionaryProperties.type,new o(this.dictionaryProperties.font)),this.fontDictionary.items.setValue(this.dictionaryProperties.baseFont,new o(this.subsetName)),this.fontDictionary.items.setValue(this.dictionaryProperties.subtype,new o(this.dictionaryProperties.type0)),this.fontDictionary.items.setValue(this.dictionaryProperties.encoding,new o(this.dictionaryProperties.identityH));var t=new p,e=new d(this.descendantFont);t.isFont=!0,t.add(e),this.fontDictionary.items.setValue(this.dictionaryProperties.descendantFonts,t)},P.prototype.createFontProgram=function(){this.fontProgram.fontProgramBeginSave=new Q(this)},P.prototype.createSystemInfo=function(){var t=new c;return t.items.setValue(this.dictionaryProperties.registry,new tt("Adobe")),t.items.setValue(this.dictionaryProperties.ordering,new tt(this.dictionaryProperties.identity)),t.items.setValue(this.dictionaryProperties.supplement,new u(0)),t},P.prototype.descendantFontBeginSave=function(){var t;null!==this.usedChars&&void 0!==this.usedChars&&0<this.usedChars.size()&&null!==(t=this.getDescendantWidth())&&this.descendantFont.items.setValue(this.dictionaryProperties.w,t)},P.prototype.cmapBeginSave=function(){this.generateCmap()},P.prototype.fontDictionaryBeginSave=function(){null!==this.usedChars&&void 0!==this.usedChars&&0<this.usedChars.size()&&!this.fontDictionary.containsKey(this.dictionaryProperties.toUnicode)&&this.fontDictionary.items.setValue(this.dictionaryProperties.toUnicode,new d(this.cmap))},P.prototype.fontProgramBeginSave=function(){this.isCompress=!0,this.generateFontProgram()},P.prototype.getDescendantWidth=function(){var t=new p;if(null!==this.usedChars&&void 0!==this.usedChars&&0<this.usedChars.size()){for(var e=[],i=this.usedChars.keys(),r=0;r<i.length;r++){var n=i[r];(l=this.ttfReader.getGlyph(n)).empty||e.push(l)}e.sort(function(t,e){return t.index-e.index});for(var o=0,s=0,a=!1,h=new p,r=0;r<e.length;r++){var l=e[r];a||(a=!0,o=l.index,s=l.index-1),(s+1!==l.index||r+1===e.length)&&1<e.length&&(t.add(new u(o)),0!==r&&t.add(h),o=l.index,h=new p),h.add(new u(l.width)),r+1===e.length&&(t.add(new u(o)),t.add(h)),s=l.index}}return t},P.prototype.generateCmap=function(){if(null!==this.usedChars&&void 0!==this.usedChars&&0<this.usedChars.size()){var t=this.ttfReader.getGlyphChars(this.usedChars);if(0<t.size()){for(var e=t.keys().sort(),i=e[0],r=e[e.length-1],i=this.toHexString(i,!1)+this.toHexString(r,!1)+h.newLine,n="",o=(n=(n+=this.cmapPrefix)+i+this.cmapEndCodespaceRange,0),s=0;s<e.length;s++){0===o&&(0!==s&&(n+=this.cmapEndRange),n=(n=n+(o=Math.min(100,e.length-s))+h.whiteSpace)+this.cmapBeginRange),--o;var a=e[s];n+=this.toHexString(a,!0)+this.toHexString(a,!0)+this.toHexString(t.getValue(a),!0)+"\n"}n+=this.cmapSuffix,this.cmap.clearStream(),this.cmap.isResource=!0,this.cmap.write(n)}}},P.prototype.generateFontProgram=function(){var t;this.usedChars=null===this.usedChars||void 0===this.usedChars?new a:this.usedChars,this.ttfReader.setOffset(0),t=this.ttfReader.readFontProgram(this.usedChars),this.fontProgram.clearStream(),this.fontProgram.isResource=!0,this.fontProgram.writeBytes(t)},P.prototype.getDescriptorFlags=function(){var t=0,e=this.ttfReader.metrics;return e.isFixedPitch&&(t|=K.FontDescriptorFlags.FixedPitch),e.isSymbol?t|=K.FontDescriptorFlags.Symbolic:t|=K.FontDescriptorFlags.Nonsymbolic,e.isItalic&&(t|=K.FontDescriptorFlags.Italic),e.isBold&&(t|=K.FontDescriptorFlags.ForceBold),t},P.prototype.getBoundBox=function(){var t=this.ttfReader.metrics.fontBox,e=Math.abs(t.right-t.left),i=Math.abs(t.top-t.bottom);return new X(t.left,t.bottom,e,i)},P.prototype.toHexString=function(t,e){t=t.toString(16);return e&&(t=t.toUpperCase()),"<0000".substring(0,5-t.length)+t+">"},P.prototype.setSymbols=function(t){if(null===t)throw new Error("Argument Null Exception : text");null!==this.usedChars&&void 0!==this.usedChars||(this.usedChars=new a);for(var e=0;e<t.length;e++){var i=t[e];this.usedChars.setValue(i,String.fromCharCode(0))}!1===this.isEmbedFont&&this.getDescendantWidth()};var li=P;function P(t,e){if(this.nameString="ABCDEFGHIJKLMNOPQRSTUVWXYZ",this.dictionaryProperties=new l,this.isCompress=!1,this.isEmbedFont=!1,this.cmapPrefix="/CIDInit /ProcSet findresource begin\n12 dict begin\nbegincmap"+h.newLine+"/CIDSystemInfo << /Registry (Adobe)/Ordering (UCS)/Supplement 0>> def\n/CMapName /Adobe-Identity-UCS def\n/CMapType 2 def\n1 begincodespacerange"+h.newLine,this.cmapEndCodespaceRange="endcodespacerange"+h.newLine,this.cmapBeginRange="beginbfrange"+h.newLine,this.cmapEndRange="endbfrange"+h.newLine,this.cmapSuffix="endbfrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend end"+h.newLine,null==t)throw new Error("ArgumentNullException:base64String");this.fontSize=e,this.fontString=t,this.Initialize()}ci.prototype.getCharacterShape=function(t,e){if(t>=this.hamza&&t<=this.bwhb){if(this.arabicMapTable.getValue(t))return this.arabicMapTable.getValue(t)[e+1]}else if(t>=this.lwawm&&t<=this.lwa);return t},ci.prototype.shape=function(t,e){for(var i="",r="",n=0;n<t.length;n++){var o=t[n];""<=o&&o<="ۿ"?r+=o:(0<r.length&&(i+=this.doShape(r.toString(),0),r=""),i+=o)}return 0<r.length&&(i+=this.doShape(r.toString(),0)),i.toString()},ci.prototype.doShape=function(t,e){for(var i="",r=0,n=0,o=new pi,s=new pi;n<t.length;){var a,h=t[n++];0===this.ligature(h,s)&&(r=1===(a=this.getShapeCount(h))?0:2,2<o.Shapes&&(r+=1),r%=s.Shapes,s.Value=this.getCharacterShape(s.Value,r),i=this.append(i,o,e),o=s,(s=new pi).Value=h,s.Shapes=a,s.Ligature++)}return r=2<o.Shapes?1:0,r%=s.Shapes,s.Value=this.getCharacterShape(s.Value,r),i=this.append(i,o,e),(i=this.append(i,s,e)).toString()},ci.prototype.append=function(t,e,i){return""!==e.Value&&(t+=e.Value,--e.Ligature,""!==e.Type&&(0==(i&this.vowel)&&(t+=e.Type),--e.Ligature),""!==e.vowel)&&(0==(i&this.vowel)&&(t+=e.vowel),--e.Ligature),t},ci.prototype.ligature=function(t,e){if(""===e.Value)return 0;var i=0;if(t>=this.fathatan&&t<=this.hamzaBelow||t===this.superScriptalef){if(i=1,""!==e.vowel&&t!==this.shadda&&(i=2),t===this.shadda){if(null!=e.Type)return 0;e.Type=this.shadda}else t===this.hamzaBelow?e.Value===this.alef?(e.Value=this.alefHamzaBelow,i=2):t===this.lwa?(e.Value=this.lwawhb,i=2):e.Type=this.hamzaBelow:t===this.hamzaAbove?e.Value===this.alef?(e.Value=this.alefHamza,i=2):e.Value===this.lwa?(e.Value=this.lwawh,i=2):e.Value===this.waw?(e.Value=this.wawHamza,i=2):e.Value===this.yeh||e.Value===this.alefMaksura||e.Value===this.farsiYeh?(e.Value=this.yehHamza,i=2):e.Type=this.hamzaAbove:t===this.madda?e.Value===this.alef&&(e.Value=this.alefMadda,i=2):e.vowel=t;1===i&&e.Ligature++}else{if(""!==e.vowel)return 0;e.Value===this.lam&&(t===this.alef?(e.Value=this.lwa,e.Shapes=2,i=3):t===this.alefHamza?(e.Value=this.lwawh,e.Shapes=2,i=3):t===this.alefHamzaBelow?(e.Value=this.lwawhb,e.Shapes=2,i=3):t===this.alefMadda&&(e.Value=this.lwawm,e.Shapes=2,i=3))}return i},ci.prototype.getShapeCount=function(t){if(t>=this.hamza&&t<=this.bwhb&&!(t>=this.fathatan&&t<=this.hamzaBelow||t===this.superScriptalef)){if(this.arabicMapTable.getValue(t))return this.arabicMapTable.getValue(t).length-1}else if(t===this.zeroWidthJoiner)return 4;return 1};var ui=ci;function ci(){this.arabicCharTable=[["ء","ﺀ"],["آ","ﺁ","ﺂ"],["أ","ﺃ","ﺄ"],["ؤ","ﺅ","ﺆ"],["إ","ﺇ","ﺈ"],["ئ","ﺉ","ﺊ","ﺋ","ﺌ"],["ا","ﺍ","ﺎ"],["ب","ﺏ","ﺐ","ﺑ","ﺒ"],["ة","ﺓ","ﺔ"],["ت","ﺕ","ﺖ","ﺗ","ﺘ"],["ث","ﺙ","ﺚ","ﺛ","ﺜ"],["ج","ﺝ","ﺞ","ﺟ","ﺠ"],["ح","ﺡ","ﺢ","ﺣ","ﺤ"],["خ","ﺥ","ﺦ","ﺧ","ﺨ"],["د","ﺩ","ﺪ"],["ذ","ﺫ","ﺬ"],["ر","ﺭ","ﺮ"],["ز","ﺯ","ﺰ"],["س","ﺱ","ﺲ","ﺳ","ﺴ"],["ش","ﺵ","ﺶ","ﺷ","ﺸ"],["ص","ﺹ","ﺺ","ﺻ","ﺼ"],["ض","ﺽ","ﺾ","ﺿ","ﻀ"],["ط","ﻁ","ﻂ","ﻃ","ﻄ"],["ظ","ﻅ","ﻆ","ﻇ","ﻈ"],["ع","ﻉ","ﻊ","ﻋ","ﻌ"],["غ","ﻍ","ﻎ","ﻏ","ﻐ"],["ـ","ـ","ـ","ـ","ـ"],["ف","ﻑ","ﻒ","ﻓ","ﻔ"],["ق","ﻕ","ﻖ","ﻗ","ﻘ"],["ك","ﻙ","ﻚ","ﻛ","ﻜ"],["ل","ﻝ","ﻞ","ﻟ","ﻠ"],["م","ﻡ","ﻢ","ﻣ","ﻤ"],["ن","ﻥ","ﻦ","ﻧ","ﻨ"],["ه","ﻩ","ﻪ","ﻫ","ﻬ"],["و","ﻭ","ﻮ"],["ى","ﻯ","ﻰ","ﯨ","ﯩ"],["ي","ﻱ","ﻲ","ﻳ","ﻴ"],["ٱ","ﭐ","ﭑ"],["ٹ","ﭦ","ﭧ","ﭨ","ﭩ"],["ٺ","ﭞ","ﭟ","ﭠ","ﭡ"],["ٻ","ﭒ","ﭓ","ﭔ","ﭕ"],["پ","ﭖ","ﭗ","ﭘ","ﭙ"],["ٿ","ﭢ","ﭣ","ﭤ","ﭥ"],["ڀ","ﭚ","ﭛ","ﭜ","ﭝ"],["ڃ","ﭶ","ﭷ","ﭸ","ﭹ"],["ڄ","ﭲ","ﭳ","ﭴ","ﭵ"],["چ","ﭺ","ﭻ","ﭼ","ﭽ"],["ڇ","ﭾ","ﭿ","ﮀ","ﮁ"],["ڈ","ﮈ","ﮉ"],["ڌ","ﮄ","ﮅ"],["ڍ","ﮂ","ﮃ"],["ڎ","ﮆ","ﮇ"],["ڑ","ﮌ","ﮍ"],["ژ","ﮊ","ﮋ"],["ڤ","ﭪ","ﭫ","ﭬ","ﭭ"],["ڦ","ﭮ","ﭯ","ﭰ","ﭱ"],["ک","ﮎ","ﮏ","ﮐ","ﮑ"],["ڭ","ﯓ","ﯔ","ﯕ","ﯖ"],["گ","ﮒ","ﮓ","ﮔ","ﮕ"],["ڱ","ﮚ","ﮛ","ﮜ","ﮝ"],["ڳ","ﮖ","ﮗ","ﮘ","ﮙ"],["ں","ﮞ","ﮟ"],["ڻ","ﮠ","ﮡ","ﮢ","ﮣ"],["ھ","ﮪ","ﮫ","ﮬ","ﮭ"],["ۀ","ﮤ","ﮥ"],["ہ","ﮦ","ﮧ","ﮨ","ﮩ"],["ۅ","ﯠ","ﯡ"],["ۆ","ﯙ","ﯚ"],["ۇ","ﯗ","ﯘ"],["ۈ","ﯛ","ﯜ"],["ۉ","ﯢ","ﯣ"],["ۋ","ﯞ","ﯟ"],["ی","ﯼ","ﯽ","ﯾ","ﯿ"],["ې","ﯤ","ﯥ","ﯦ","ﯧ"],["ے","ﮮ","ﮯ"],["ۓ","ﮰ","ﮱ"]],this.alef="ا",this.alefHamza="أ",this.alefHamzaBelow="إ",this.alefMadda="آ",this.lam="ل",this.hamza="ء",this.zeroWidthJoiner="",this.hamzaAbove="ٔ",this.hamzaBelow="ٕ",this.wawHamza="ؤ",this.yehHamza="ئ",this.waw="و",this.alefMaksura="ى",this.yeh="ي",this.farsiYeh="ی",this.shadda="ّ",this.madda="ٓ",this.lwa="ﻻ",this.lwawh="ﻷ",this.lwawhb="ﻹ",this.lwawm="ﻵ",this.bwhb="ۓ",this.fathatan="ً",this.superScriptalef="ٰ",this.vowel=1,this.arabicMapTable=new a;for(var t=0;t<this.arabicCharTable.length;t++)this.arabicMapTable.setValue(this.arabicCharTable[t][0],this.arabicCharTable[t])}Object.defineProperty(di.prototype,"Value",{get:function(){return this.shapeValue},set:function(t){this.shapeValue=t},enumerable:!0,configurable:!0}),Object.defineProperty(di.prototype,"Type",{get:function(){return this.shapeType},set:function(t){this.shapeType=t},enumerable:!0,configurable:!0}),Object.defineProperty(di.prototype,"vowel",{get:function(){return this.shapeVowel},set:function(t){this.shapeVowel=t},enumerable:!0,configurable:!0}),Object.defineProperty(di.prototype,"Ligature",{get:function(){return this.shapeLigature},set:function(t){this.shapeLigature=t},enumerable:!0,configurable:!0}),Object.defineProperty(di.prototype,"Shapes",{get:function(){return this.shapeShapes},set:function(t){this.shapeShapes=t},enumerable:!0,configurable:!0});var pi=di;function di(){this.shapeValue="",this.shapeType="",this.shapeVowel="",this.shapeLigature=0,this.shapeShapes=1}gi.prototype.doMirrorShaping=function(t){for(var e=[],i=0;i<t.length;i++)1==(1&this.indexLevels[i])&&this.mirroringShapeCharacters.containsKey(t[i].charCodeAt(0))?e[i]=String.fromCharCode(this.mirroringShapeCharacters.getValue(t[i].charCodeAt(0))):e[i]=t[i].toString();for(var r="",n=0;n<e.length;n++)r+=e[n];return r},gi.prototype.getLogicalToVisualString=function(t,e){for(var i=new mi,r=(this.indexLevels=i.getVisualOrder(t,e),this.setDefaultIndexLevel(),this.doOrder(0,this.indexLevels.length-1),this.doMirrorShaping(t)),n="",o=0;o<this.indexes.length;o++)n+=r[this.indexes[o]];return n.toString()},gi.prototype.setDefaultIndexLevel=function(){for(var t=0;t<this.indexLevels.length;t++)this.indexes[t]=t},gi.prototype.doOrder=function(t,e){for(var i=this.indexLevels[t],r=i,n=i,o=i,s=t+1;s<=e;++s){var a=this.indexLevels[s];i<a?i=a:a<r&&(r=a),n&=a,o|=a}if(0!=(1&o))if(1==(1&n))this.reArrange(t,e+1);else for(r|=1;r<=i;){for(var h=t;;){for(;h<=e&&!(this.indexLevels[h]>=i);)h+=1;if(e<h)break;for(var l=h+1;l<=e&&!(this.indexLevels[l]<i);)l+=1;this.reArrange(h,l),h=l+1}--i}},gi.prototype.reArrange=function(t,e){var i=(t+e)/2;for(--e;t<i;++t,--e){var r=this.indexes[t];this.indexes[t]=this.indexes[e],this.indexes[e]=r}},gi.prototype.update=function(){this.mirroringShapeCharacters.setValue(40,41),this.mirroringShapeCharacters.setValue(41,40),this.mirroringShapeCharacters.setValue(60,62),this.mirroringShapeCharacters.setValue(62,60),this.mirroringShapeCharacters.setValue(91,93),this.mirroringShapeCharacters.setValue(93,91),this.mirroringShapeCharacters.setValue(123,125),this.mirroringShapeCharacters.setValue(125,123),this.mirroringShapeCharacters.setValue(171,187),this.mirroringShapeCharacters.setValue(187,171),this.mirroringShapeCharacters.setValue(8249,8250),this.mirroringShapeCharacters.setValue(8250,8249),this.mirroringShapeCharacters.setValue(8261,8262),this.mirroringShapeCharacters.setValue(8262,8261),this.mirroringShapeCharacters.setValue(8317,8318),this.mirroringShapeCharacters.setValue(8318,8317),this.mirroringShapeCharacters.setValue(8333,8334),this.mirroringShapeCharacters.setValue(8334,8333),this.mirroringShapeCharacters.setValue(8712,8715),this.mirroringShapeCharacters.setValue(8713,8716),this.mirroringShapeCharacters.setValue(8714,8717),this.mirroringShapeCharacters.setValue(8715,8712),this.mirroringShapeCharacters.setValue(8716,8713),this.mirroringShapeCharacters.setValue(8717,8714),this.mirroringShapeCharacters.setValue(8725,10741),this.mirroringShapeCharacters.setValue(8764,8765),this.mirroringShapeCharacters.setValue(8765,8764),this.mirroringShapeCharacters.setValue(8771,8909),this.mirroringShapeCharacters.setValue(8786,8787),this.mirroringShapeCharacters.setValue(8787,8786),this.mirroringShapeCharacters.setValue(8788,8789),this.mirroringShapeCharacters.setValue(8789,8788),this.mirroringShapeCharacters.setValue(8804,8805),this.mirroringShapeCharacters.setValue(8805,8804),this.mirroringShapeCharacters.setValue(8806,8807),this.mirroringShapeCharacters.setValue(8807,8806),this.mirroringShapeCharacters.setValue(8808,8809),this.mirroringShapeCharacters.setValue(8809,8808),this.mirroringShapeCharacters.setValue(8810,8811),this.mirroringShapeCharacters.setValue(8811,8810),this.mirroringShapeCharacters.setValue(8814,8815),this.mirroringShapeCharacters.setValue(8815,8814),this.mirroringShapeCharacters.setValue(8816,8817),this.mirroringShapeCharacters.setValue(8817,8816),this.mirroringShapeCharacters.setValue(8818,8819),this.mirroringShapeCharacters.setValue(8819,8818),this.mirroringShapeCharacters.setValue(8820,8821),this.mirroringShapeCharacters.setValue(8821,8820),this.mirroringShapeCharacters.setValue(8822,8823),this.mirroringShapeCharacters.setValue(8823,8822),this.mirroringShapeCharacters.setValue(8824,8825),this.mirroringShapeCharacters.setValue(8825,8824),this.mirroringShapeCharacters.setValue(8826,8827),this.mirroringShapeCharacters.setValue(8827,8826),this.mirroringShapeCharacters.setValue(8828,8829),this.mirroringShapeCharacters.setValue(8829,8828),this.mirroringShapeCharacters.setValue(8830,8831),this.mirroringShapeCharacters.setValue(8831,8830),this.mirroringShapeCharacters.setValue(8832,8833),this.mirroringShapeCharacters.setValue(8833,8832),this.mirroringShapeCharacters.setValue(8834,8835),this.mirroringShapeCharacters.setValue(8835,8834),this.mirroringShapeCharacters.setValue(8836,8837),this.mirroringShapeCharacters.setValue(8837,8836),this.mirroringShapeCharacters.setValue(8838,8839),this.mirroringShapeCharacters.setValue(8839,8838),this.mirroringShapeCharacters.setValue(8840,8841),this.mirroringShapeCharacters.setValue(8841,8840),this.mirroringShapeCharacters.setValue(8842,8843),this.mirroringShapeCharacters.setValue(8843,8842),this.mirroringShapeCharacters.setValue(8847,8848),this.mirroringShapeCharacters.setValue(8848,8847),this.mirroringShapeCharacters.setValue(8849,8850),this.mirroringShapeCharacters.setValue(8850,8849),this.mirroringShapeCharacters.setValue(8856,10680),this.mirroringShapeCharacters.setValue(8866,8867),this.mirroringShapeCharacters.setValue(8867,8866),this.mirroringShapeCharacters.setValue(8870,10974),this.mirroringShapeCharacters.setValue(8872,10980),this.mirroringShapeCharacters.setValue(8873,10979),this.mirroringShapeCharacters.setValue(8875,10981),this.mirroringShapeCharacters.setValue(8880,8881),this.mirroringShapeCharacters.setValue(8881,8880),this.mirroringShapeCharacters.setValue(8882,8883),this.mirroringShapeCharacters.setValue(8883,8882),this.mirroringShapeCharacters.setValue(8884,8885),this.mirroringShapeCharacters.setValue(8885,8884),this.mirroringShapeCharacters.setValue(8886,8887),this.mirroringShapeCharacters.setValue(8887,8886),this.mirroringShapeCharacters.setValue(8905,8906),this.mirroringShapeCharacters.setValue(8906,8905),this.mirroringShapeCharacters.setValue(8907,8908),this.mirroringShapeCharacters.setValue(8908,8907),this.mirroringShapeCharacters.setValue(8909,8771),this.mirroringShapeCharacters.setValue(8912,8913),this.mirroringShapeCharacters.setValue(8913,8912),this.mirroringShapeCharacters.setValue(8918,8919),this.mirroringShapeCharacters.setValue(8919,8918),this.mirroringShapeCharacters.setValue(8920,8921),this.mirroringShapeCharacters.setValue(8921,8920),this.mirroringShapeCharacters.setValue(8922,8923),this.mirroringShapeCharacters.setValue(8923,8922),this.mirroringShapeCharacters.setValue(8924,8925),this.mirroringShapeCharacters.setValue(8925,8924),this.mirroringShapeCharacters.setValue(8926,8927),this.mirroringShapeCharacters.setValue(8927,8926),this.mirroringShapeCharacters.setValue(8928,8929),this.mirroringShapeCharacters.setValue(8929,8928),this.mirroringShapeCharacters.setValue(8930,8931),this.mirroringShapeCharacters.setValue(8931,8930),this.mirroringShapeCharacters.setValue(8932,8933),this.mirroringShapeCharacters.setValue(8933,8932),this.mirroringShapeCharacters.setValue(8934,8935),this.mirroringShapeCharacters.setValue(8935,8934),this.mirroringShapeCharacters.setValue(8936,8937),this.mirroringShapeCharacters.setValue(8937,8936),this.mirroringShapeCharacters.setValue(8938,8939),this.mirroringShapeCharacters.setValue(8939,8938),this.mirroringShapeCharacters.setValue(8940,8941),this.mirroringShapeCharacters.setValue(8941,8940),this.mirroringShapeCharacters.setValue(8944,8945),this.mirroringShapeCharacters.setValue(8945,8944),this.mirroringShapeCharacters.setValue(8946,8954),this.mirroringShapeCharacters.setValue(8947,8955),this.mirroringShapeCharacters.setValue(8948,8956),this.mirroringShapeCharacters.setValue(8950,8957),this.mirroringShapeCharacters.setValue(8951,8958),this.mirroringShapeCharacters.setValue(8954,8946),this.mirroringShapeCharacters.setValue(8955,8947),this.mirroringShapeCharacters.setValue(8956,8948),this.mirroringShapeCharacters.setValue(8957,8950),this.mirroringShapeCharacters.setValue(8958,8951),this.mirroringShapeCharacters.setValue(8968,8969),this.mirroringShapeCharacters.setValue(8969,8968),this.mirroringShapeCharacters.setValue(8970,8971),this.mirroringShapeCharacters.setValue(8971,8970),this.mirroringShapeCharacters.setValue(9001,9002),this.mirroringShapeCharacters.setValue(9002,9001),this.mirroringShapeCharacters.setValue(10088,10089),this.mirroringShapeCharacters.setValue(10089,10088),this.mirroringShapeCharacters.setValue(10090,10091),this.mirroringShapeCharacters.setValue(10091,10090),this.mirroringShapeCharacters.setValue(10092,10093),this.mirroringShapeCharacters.setValue(10093,10092),this.mirroringShapeCharacters.setValue(10094,10095),this.mirroringShapeCharacters.setValue(10095,10094),this.mirroringShapeCharacters.setValue(10096,10097),this.mirroringShapeCharacters.setValue(10097,10096),this.mirroringShapeCharacters.setValue(10098,10099),this.mirroringShapeCharacters.setValue(10099,10098),this.mirroringShapeCharacters.setValue(10100,10101),this.mirroringShapeCharacters.setValue(10101,10100),this.mirroringShapeCharacters.setValue(10197,10198),this.mirroringShapeCharacters.setValue(10198,10197),this.mirroringShapeCharacters.setValue(10205,10206),this.mirroringShapeCharacters.setValue(10206,10205),this.mirroringShapeCharacters.setValue(10210,10211),this.mirroringShapeCharacters.setValue(10211,10210),this.mirroringShapeCharacters.setValue(10212,10213),this.mirroringShapeCharacters.setValue(10213,10212),this.mirroringShapeCharacters.setValue(10214,10215),this.mirroringShapeCharacters.setValue(10215,10214),this.mirroringShapeCharacters.setValue(10216,10217),this.mirroringShapeCharacters.setValue(10217,10216),this.mirroringShapeCharacters.setValue(10218,10219),this.mirroringShapeCharacters.setValue(10219,10218),this.mirroringShapeCharacters.setValue(10627,10628),this.mirroringShapeCharacters.setValue(10628,10627),this.mirroringShapeCharacters.setValue(10629,10630),this.mirroringShapeCharacters.setValue(10630,10629),this.mirroringShapeCharacters.setValue(10631,10632),this.mirroringShapeCharacters.setValue(10632,10631),this.mirroringShapeCharacters.setValue(10633,10634),this.mirroringShapeCharacters.setValue(10634,10633),this.mirroringShapeCharacters.setValue(10635,10636),this.mirroringShapeCharacters.setValue(10636,10635),this.mirroringShapeCharacters.setValue(10637,10640),this.mirroringShapeCharacters.setValue(10638,10639),this.mirroringShapeCharacters.setValue(10639,10638),this.mirroringShapeCharacters.setValue(10640,10637),this.mirroringShapeCharacters.setValue(10641,10642),this.mirroringShapeCharacters.setValue(10642,10641),this.mirroringShapeCharacters.setValue(10643,10644),this.mirroringShapeCharacters.setValue(10644,10643),this.mirroringShapeCharacters.setValue(10645,10646),this.mirroringShapeCharacters.setValue(10646,10645),this.mirroringShapeCharacters.setValue(10647,10648),this.mirroringShapeCharacters.setValue(10648,10647),this.mirroringShapeCharacters.setValue(10680,8856),this.mirroringShapeCharacters.setValue(10688,10689),this.mirroringShapeCharacters.setValue(10689,10688),this.mirroringShapeCharacters.setValue(10692,10693),this.mirroringShapeCharacters.setValue(10693,10692),this.mirroringShapeCharacters.setValue(10703,10704),this.mirroringShapeCharacters.setValue(10704,10703),this.mirroringShapeCharacters.setValue(10705,10706),this.mirroringShapeCharacters.setValue(10706,10705),this.mirroringShapeCharacters.setValue(10708,10709),this.mirroringShapeCharacters.setValue(10709,10708),this.mirroringShapeCharacters.setValue(10712,10713),this.mirroringShapeCharacters.setValue(10713,10712),this.mirroringShapeCharacters.setValue(10714,10715),this.mirroringShapeCharacters.setValue(10715,10714),this.mirroringShapeCharacters.setValue(10741,8725),this.mirroringShapeCharacters.setValue(10744,10745),this.mirroringShapeCharacters.setValue(10745,10744),this.mirroringShapeCharacters.setValue(10748,10749),this.mirroringShapeCharacters.setValue(10749,10748),this.mirroringShapeCharacters.setValue(10795,10796),this.mirroringShapeCharacters.setValue(10796,10795),this.mirroringShapeCharacters.setValue(10797,10796),this.mirroringShapeCharacters.setValue(10798,10797),this.mirroringShapeCharacters.setValue(10804,10805),this.mirroringShapeCharacters.setValue(10805,10804),this.mirroringShapeCharacters.setValue(10812,10813),this.mirroringShapeCharacters.setValue(10813,10812),this.mirroringShapeCharacters.setValue(10852,10853),this.mirroringShapeCharacters.setValue(10853,10852),this.mirroringShapeCharacters.setValue(10873,10874),this.mirroringShapeCharacters.setValue(10874,10873),this.mirroringShapeCharacters.setValue(10877,10878),this.mirroringShapeCharacters.setValue(10878,10877),this.mirroringShapeCharacters.setValue(10879,10880),this.mirroringShapeCharacters.setValue(10880,10879),this.mirroringShapeCharacters.setValue(10881,10882),this.mirroringShapeCharacters.setValue(10882,10881),this.mirroringShapeCharacters.setValue(10883,10884),this.mirroringShapeCharacters.setValue(10884,10883),this.mirroringShapeCharacters.setValue(10891,10892),this.mirroringShapeCharacters.setValue(10892,10891),this.mirroringShapeCharacters.setValue(10897,10898),this.mirroringShapeCharacters.setValue(10898,10897),this.mirroringShapeCharacters.setValue(10899,10900),this.mirroringShapeCharacters.setValue(10900,10899),this.mirroringShapeCharacters.setValue(10901,10902),this.mirroringShapeCharacters.setValue(10902,10901),this.mirroringShapeCharacters.setValue(10903,10904),this.mirroringShapeCharacters.setValue(10904,10903),this.mirroringShapeCharacters.setValue(10905,10906),this.mirroringShapeCharacters.setValue(10906,10905),this.mirroringShapeCharacters.setValue(10907,10908),this.mirroringShapeCharacters.setValue(10908,10907),this.mirroringShapeCharacters.setValue(10913,10914),this.mirroringShapeCharacters.setValue(10914,10913),this.mirroringShapeCharacters.setValue(10918,10919),this.mirroringShapeCharacters.setValue(10919,10918),this.mirroringShapeCharacters.setValue(10920,10921),this.mirroringShapeCharacters.setValue(10921,10920),this.mirroringShapeCharacters.setValue(10922,10923),this.mirroringShapeCharacters.setValue(10923,10922),this.mirroringShapeCharacters.setValue(10924,10925),this.mirroringShapeCharacters.setValue(10925,10924),this.mirroringShapeCharacters.setValue(10927,10928),this.mirroringShapeCharacters.setValue(10928,10927),this.mirroringShapeCharacters.setValue(10931,10932),this.mirroringShapeCharacters.setValue(10932,10931),this.mirroringShapeCharacters.setValue(10939,10940),this.mirroringShapeCharacters.setValue(10940,10939),this.mirroringShapeCharacters.setValue(10941,10942),this.mirroringShapeCharacters.setValue(10942,10941),this.mirroringShapeCharacters.setValue(10943,10944),this.mirroringShapeCharacters.setValue(10944,10943),this.mirroringShapeCharacters.setValue(10945,10946),this.mirroringShapeCharacters.setValue(10946,10945),this.mirroringShapeCharacters.setValue(10947,10948),this.mirroringShapeCharacters.setValue(10948,10947),this.mirroringShapeCharacters.setValue(10949,10950),this.mirroringShapeCharacters.setValue(10950,10949),this.mirroringShapeCharacters.setValue(10957,10958),this.mirroringShapeCharacters.setValue(10958,10957),this.mirroringShapeCharacters.setValue(10959,10960),this.mirroringShapeCharacters.setValue(10960,10959),this.mirroringShapeCharacters.setValue(10961,10962),this.mirroringShapeCharacters.setValue(10962,10961),this.mirroringShapeCharacters.setValue(10963,10964),this.mirroringShapeCharacters.setValue(10964,10963),this.mirroringShapeCharacters.setValue(10965,10966),this.mirroringShapeCharacters.setValue(10966,10965),this.mirroringShapeCharacters.setValue(10974,8870),this.mirroringShapeCharacters.setValue(10979,8873),this.mirroringShapeCharacters.setValue(10980,8872),this.mirroringShapeCharacters.setValue(10981,8875),this.mirroringShapeCharacters.setValue(10988,10989),this.mirroringShapeCharacters.setValue(10989,10988),this.mirroringShapeCharacters.setValue(10999,11e3),this.mirroringShapeCharacters.setValue(11e3,10999),this.mirroringShapeCharacters.setValue(11001,11002),this.mirroringShapeCharacters.setValue(11002,11001),this.mirroringShapeCharacters.setValue(12296,12297),this.mirroringShapeCharacters.setValue(12297,12296),this.mirroringShapeCharacters.setValue(12298,12299),this.mirroringShapeCharacters.setValue(12299,12298),this.mirroringShapeCharacters.setValue(12300,12301),this.mirroringShapeCharacters.setValue(12301,12300),this.mirroringShapeCharacters.setValue(12302,12303),this.mirroringShapeCharacters.setValue(12303,12302),this.mirroringShapeCharacters.setValue(12304,12305),this.mirroringShapeCharacters.setValue(12305,12304),this.mirroringShapeCharacters.setValue(12308,12309),this.mirroringShapeCharacters.setValue(12309,12308),this.mirroringShapeCharacters.setValue(12310,12311),this.mirroringShapeCharacters.setValue(12311,12310),this.mirroringShapeCharacters.setValue(12312,12313),this.mirroringShapeCharacters.setValue(12313,12312),this.mirroringShapeCharacters.setValue(12314,12315),this.mirroringShapeCharacters.setValue(12315,12314),this.mirroringShapeCharacters.setValue(65288,65289),this.mirroringShapeCharacters.setValue(65289,65288),this.mirroringShapeCharacters.setValue(65308,65310),this.mirroringShapeCharacters.setValue(65310,65308),this.mirroringShapeCharacters.setValue(65339,65341),this.mirroringShapeCharacters.setValue(65341,65339),this.mirroringShapeCharacters.setValue(65371,65373),this.mirroringShapeCharacters.setValue(65373,65371),this.mirroringShapeCharacters.setValue(65375,65376),this.mirroringShapeCharacters.setValue(65376,65375),this.mirroringShapeCharacters.setValue(65378,65379),this.mirroringShapeCharacters.setValue(65379,65378)};var fi=gi;function gi(){this.indexes=[],this.indexLevels=[],this.mirroringShapeCharacters=new a,this.update()}yi.prototype.getVisualOrder=function(t,e){this.types=this.getCharacterCode(t),this.textOrder=e?this.LRE:this.L,this.doVisualOrder();for(var i=[],r=0;r<this.levels.length;r++)i[r]=this.levels[r];return i},yi.prototype.getCharacterCode=function(t){for(var e=[],i=0;i<t.length;i++)e[i]=this.rtlCharacterTypes[t[i].charCodeAt(0)];return e},yi.prototype.setDefaultLevels=function(){for(var t=0;t<this.length;t++)this.levels[t]=this.textOrder},yi.prototype.setLevels=function(){this.setDefaultLevels();for(var t=0;t<this.length;++t){var e=this.levels[t];0!=(128&e)&&(e&=127,this.result[t]=0==(1&e)?this.L:this.R),this.levels[t]=e}},yi.prototype.updateLevels=function(t,e,i){if(0==(1&e))for(var r=t;r<i;++r)this.result[r]===this.R?this.levels[r]+=1:this.result[r]!==this.L&&(this.levels[r]+=2);else for(r=t;r<i;++r)this.result[r]!==this.R&&(this.levels[r]+=1)},yi.prototype.doVisualOrder=function(){this.length=this.types.length,this.result=this.types,this.levels=[],this.setLevels(),this.length=this.getEmbeddedCharactersLength();for(var t=this.textOrder,e=0;e<this.length;){for(var i=this.levels[e],r=0==(1&Math.max(t,i))?this.L:this.R,n=e+1;n<this.length&&this.levels[n]===i;)++n;var o=n<this.length?this.levels[n]:this.textOrder,o=0==(1&Math.max(o,i))?this.L:this.R;this.checkNSM(e,n,i,r,o),this.updateLevels(e,i,n),t=i,e=n}this.checkEmbeddedCharacters(this.length)},yi.prototype.getEmbeddedCharactersLength=function(){for(var t=0,e=0;e<this.length;++e)this.types[e]!==this.LRE&&this.types[e]!==this.RLE&&this.types[e]!==this.LRO&&this.types[e]!==this.RLO&&this.types[e]!==this.PDF&&this.types[e]!==this.BN&&(this.result[t]=this.result[e],this.levels[t]=this.levels[e],t++);return t},yi.prototype.checkEmbeddedCharacters=function(t){for(var e=this.types.length-1;0<=e;--e)this.types[e]===this.LRE||this.types[e]===this.RLE||this.types[e]===this.LRO||this.types[e]===this.RLO||this.types[e]===this.PDF||this.types[e]===this.BN?(this.result[e]=this.types[e],this.levels[e]=-1):(this.result[e]=this.result[--t],this.levels[e]=this.levels[t]);for(e=0;e<this.types.length;e++)-1===this.levels[e]&&(this.levels[e]=0===e?this.textOrder:this.levels[e-1])},yi.prototype.checkNSM=function(t,e,i,r,n){for(var o=r,s=t;s<e;++s)this.result[s]===this.NSM?this.result[s]=o:o=this.result[s];this.checkEuropeanDigits(t,e,i,r,n)},yi.prototype.checkEuropeanDigits=function(t,e,i,r,n){for(var o=t;o<e;++o)if(this.result[o]===this.EN)for(var s=o-1;t<=s;--s)if(this.result[s]===this.L||this.result[s]===this.R||this.result[s]===this.AL){this.result[s]===this.AL&&(this.result[o]=this.AN);break}this.checkArabicCharacters(t,e,i,r,n)},yi.prototype.checkArabicCharacters=function(t,e,i,r,n){for(var o=t;o<e;++o)this.result[o]===this.AL&&(this.result[o]=this.R);this.checkEuropeanNumberSeparator(t,e,i,r,n)},yi.prototype.checkEuropeanNumberSeparator=function(t,e,i,r,n){for(var o,s,a=t+1;a<e-1;++a)this.result[a]!==this.ES&&this.result[a]!==this.CS||(o=this.result[a-1],s=this.result[a+1],o===this.EN&&s===this.EN?this.result[a]=this.EN:this.result[a]===this.CS&&o===this.AN&&s===this.AN&&(this.result[a]=this.AN));this.checkEuropeanNumberTerminator(t,e,i,r,n)},yi.prototype.checkEuropeanNumberTerminator=function(t,e,i,r,n){for(var o=t;o<e;++o)if(this.result[o]===this.ET){var s=o,a=[],h=(a.push(this.ET),this.getLength(s,e,a)),a=s===t?r:this.result[s-1];if((a=a!==this.EN?h===e?n:this.result[h]:a)===this.EN)for(var l=s;l<h;++l)this.result[l]=this.EN;o=h}this.checkOtherNeutrals(t,e,i,r,n)},yi.prototype.checkOtherNeutrals=function(t,e,i,r,n){for(var o=t;o<e;++o)this.result[o]!==this.ES&&this.result[o]!==this.ET&&this.result[o]!==this.CS||(this.result[o]=this.ON);this.checkOtherCharacters(t,e,i,r,n)},yi.prototype.checkOtherCharacters=function(t,e,i,r,n){for(var o=t;o<e;++o)if(this.result[o]===this.EN){for(var s=r,a=o-1;t<=a;--a)if(this.result[a]===this.L||this.result[a]===this.R){s=this.result[a];break}s===this.L&&(this.result[o]=this.L)}this.checkCommanCharacters(t,e,i,r,n)},yi.prototype.getLength=function(t,e,i){for(--t;++t<e;){for(var r=this.result[t],n=0;n<i.length;++n)r===i[n]&&(t=this.getLength(++t,e,i));return t}return e},yi.prototype.checkCommanCharacters=function(t,e,i,r,n){for(var o=t;o<e;++o)if(this.result[o]===this.WS||this.result[o]===this.ON||this.result[o]===this.B||this.result[o]===this.S){var s=o,a=[this.B,this.S,this.WS,this.ON],h=this.getLength(s,e,a),a=0,l=0,u=0;s===t?a=r:(a=this.result[s-1])!==this.AN&&a!==this.EN||(a=this.R),h===e?l=n:(l=this.result[h])!==this.AN&&l!==this.EN||(l=this.R);for(var u=a===l?a:0==(1&i)?this.L:this.R,c=s;c<h;++c)this.result[c]=u;o=h}};var mi=yi;function yi(){this.types=[],this.textOrder=-1,this.rtlCharacterTypes=new Array(65536),this.L=0,this.LRE=1,this.LRO=2,this.R=3,this.AL=4,this.RLE=5,this.RLO=6,this.PDF=7,this.EN=8,this.ES=9,this.ET=10,this.AN=11,this.CS=12,this.NSM=13,this.BN=14,this.B=15,this.S=16,this.WS=17,this.ON=18,this.charTypes=[this.L,this.EN,this.BN,this.ES,this.ES,this.S,this.ET,this.ET,this.B,this.AN,this.AN,this.S,this.CS,this.CS,this.WS,this.NSM,this.NSM,this.B,this.BN,27,this.BN,28,30,this.B,31,31,this.S,32,32,this.WS,33,34,this.ON,35,37,this.ET,38,42,this.ON,43,43,this.ET,44,44,this.CS,45,45,this.ET,46,46,this.CS,47,47,this.CS,48,57,this.EN,58,58,this.CS,59,64,this.ON,65,90,this.L,91,96,this.ON,97,122,this.L,123,126,this.ON,127,132,this.BN,133,133,this.B,134,159,this.BN,160,160,this.CS,161,161,this.ON,162,165,this.ET,166,169,this.ON,170,170,this.L,171,175,this.ON,176,177,this.ET,178,179,this.EN,180,180,this.ON,181,181,this.L,182,184,this.ON,185,185,this.EN,186,186,this.L,187,191,this.ON,192,214,this.L,215,215,this.ON,216,246,this.L,247,247,this.ON,248,696,this.L,697,698,this.ON,699,705,this.L,706,719,this.ON,720,721,this.L,722,735,this.ON,736,740,this.L,741,749,this.ON,750,750,this.L,751,767,this.ON,768,855,this.NSM,856,860,this.L,861,879,this.NSM,880,883,this.L,884,885,this.ON,886,893,this.L,894,894,this.ON,895,899,this.L,900,901,this.ON,902,902,this.L,903,903,this.ON,904,1013,this.L,1014,1014,this.ON,1015,1154,this.L,1155,1158,this.NSM,1159,1159,this.L,1160,1161,this.NSM,1162,1417,this.L,1418,1418,this.ON,1419,1424,this.L,1425,1441,this.NSM,1442,1442,this.L,1443,1465,this.NSM,1466,1466,this.L,1467,1469,this.NSM,1470,1470,this.R,1471,1471,this.NSM,1472,1472,this.R,1473,1474,this.NSM,1475,1475,this.R,1476,1476,this.NSM,1477,1487,this.L,1488,1514,this.R,1515,1519,this.L,1520,1524,this.R,1525,1535,this.L,1536,1539,this.AL,1540,1547,this.L,1548,1548,this.CS,1549,1549,this.AL,1550,1551,this.ON,1552,1557,this.NSM,1558,1562,this.L,1563,1563,this.AL,1564,1566,this.L,1567,1567,this.AL,1568,1568,this.L,1569,1594,this.AL,1595,1599,this.L,1600,1610,this.AL,1611,1624,this.NSM,1625,1631,this.L,1632,1641,this.AN,1642,1642,this.ET,1643,1644,this.AN,1645,1647,this.AL,1648,1648,this.NSM,1649,1749,this.AL,1750,1756,this.NSM,1757,1757,this.AL,1758,1764,this.NSM,1765,1766,this.AL,1767,1768,this.NSM,1769,1769,this.ON,1770,1773,this.NSM,1774,1775,this.AL,1776,1785,this.EN,1786,1805,this.AL,1806,1806,this.L,1807,1807,this.BN,1808,1808,this.AL,1809,1809,this.NSM,1810,1839,this.AL,1840,1866,this.NSM,1867,1868,this.L,1869,1871,this.AL,1872,1919,this.L,1920,1957,this.AL,1958,1968,this.NSM,1969,1969,this.AL,1970,2304,this.L,2305,2306,this.NSM,2307,2363,this.L,2364,2364,this.NSM,2365,2368,this.L,2369,2376,this.NSM,2377,2380,this.L,2381,2381,this.NSM,2382,2384,this.L,2385,2388,this.NSM,2389,2401,this.L,2402,2403,this.NSM,2404,2432,this.L,2433,2433,this.NSM,2434,2491,this.L,2492,2492,this.NSM,2493,2496,this.L,2497,2500,this.NSM,2501,2508,this.L,2509,2509,this.NSM,2510,2529,this.L,2530,2531,this.NSM,2532,2545,this.L,2546,2547,this.ET,2548,2560,this.L,2561,2562,this.NSM,2563,2619,this.L,2620,2620,this.NSM,2621,2624,this.L,2625,2626,this.NSM,2627,2630,this.L,2631,2632,this.NSM,2633,2634,this.L,2635,2637,this.NSM,2638,2671,this.L,2672,2673,this.NSM,2674,2688,this.L,2689,2690,this.NSM,2691,2747,this.L,2748,2748,this.NSM,2749,2752,this.L,2753,2757,this.NSM,2758,2758,this.L,2759,2760,this.NSM,2761,2764,this.L,2765,2765,this.NSM,2766,2785,this.L,2786,2787,this.NSM,2788,2800,this.L,2801,2801,this.ET,2802,2816,this.L,2817,2817,this.NSM,2818,2875,this.L,2876,2876,this.NSM,2877,2878,this.L,2879,2879,this.NSM,2880,2880,this.L,2881,2883,this.NSM,2884,2892,this.L,2893,2893,this.NSM,2894,2901,this.L,2902,2902,this.NSM,2903,2945,this.L,2946,2946,this.NSM,2947,3007,this.L,3008,3008,this.NSM,3009,3020,this.L,3021,3021,this.NSM,3022,3058,this.L,3059,3064,this.ON,3065,3065,this.ET,3066,3066,this.ON,3067,3133,this.L,3134,3136,this.NSM,3137,3141,this.L,3142,3144,this.NSM,3145,3145,this.L,3146,3149,this.NSM,3150,3156,this.L,3157,3158,this.NSM,3159,3259,this.L,3260,3260,this.NSM,3261,3275,this.L,3276,3277,this.NSM,3278,3392,this.L,3393,3395,this.NSM,3396,3404,this.L,3405,3405,this.NSM,3406,3529,this.L,3530,3530,this.NSM,3531,3537,this.L,3538,3540,this.NSM,3541,3541,this.L,3542,3542,this.NSM,3543,3632,this.L,3633,3633,this.NSM,3634,3635,this.L,3636,3642,this.NSM,3643,3646,this.L,3647,3647,this.ET,3648,3654,this.L,3655,3662,this.NSM,3663,3760,this.L,3761,3761,this.NSM,3762,3763,this.L,3764,3769,this.NSM,3770,3770,this.L,3771,3772,this.NSM,3773,3783,this.L,3784,3789,this.NSM,3790,3863,this.L,3864,3865,this.NSM,3866,3892,this.L,3893,3893,this.NSM,3894,3894,this.L,3895,3895,this.NSM,3896,3896,this.L,3897,3897,this.NSM,3898,3901,this.ON,3902,3952,this.L,3953,3966,this.NSM,3967,3967,this.L,3968,3972,this.NSM,3973,3973,this.L,3974,3975,this.NSM,3976,3983,this.L,3984,3991,this.NSM,3992,3992,this.L,3993,4028,this.NSM,4029,4037,this.L,4038,4038,this.NSM,4039,4140,this.L,4141,4144,this.NSM,4145,4145,this.L,4146,4146,this.NSM,4147,4149,this.L,4150,4151,this.NSM,4152,4152,this.L,4153,4153,this.NSM,4154,4183,this.L,4184,4185,this.NSM,4186,5759,this.L,5760,5760,this.WS,5761,5786,this.L,5787,5788,this.ON,5789,5905,this.L,5906,5908,this.NSM,5909,5937,this.L,5938,5940,this.NSM,5941,5969,this.L,5970,5971,this.NSM,5972,6001,this.L,6002,6003,this.NSM,6004,6070,this.L,6071,6077,this.NSM,6078,6085,this.L,6086,6086,this.NSM,6087,6088,this.L,6089,6099,this.NSM,6100,6106,this.L,6107,6107,this.ET,6108,6108,this.L,6109,6109,this.NSM,6110,6127,this.L,6128,6137,this.ON,6138,6143,this.L,6144,6154,this.ON,6155,6157,this.NSM,6158,6158,this.WS,6159,6312,this.L,6313,6313,this.NSM,6314,6431,this.L,6432,6434,this.NSM,6435,6438,this.L,6439,6443,this.NSM,6444,6449,this.L,6450,6450,this.NSM,6451,6456,this.L,6457,6459,this.NSM,6460,6463,this.L,6464,6464,this.ON,6465,6467,this.L,6468,6469,this.ON,6470,6623,this.L,6624,6655,this.ON,6656,8124,this.L,8125,8125,this.ON,8126,8126,this.L,8127,8129,this.ON,8130,8140,this.L,8141,8143,this.ON,8144,8156,this.L,8157,8159,this.ON,8160,8172,this.L,8173,8175,this.ON,8176,8188,this.L,8189,8190,this.ON,8191,8191,this.L,8192,8202,this.WS,8203,8205,this.BN,8206,8206,this.L,8207,8207,this.R,8208,8231,this.ON,8232,8232,this.WS,8233,8233,this.B,8234,8234,this.LRE,8235,8235,this.RLE,8236,8236,this.PDF,8237,8237,this.LRO,8238,8238,this.RLO,8239,8239,this.WS,8240,8244,this.ET,8245,8276,this.ON,8277,8278,this.L,8279,8279,this.ON,8280,8286,this.L,8287,8287,this.WS,8288,8291,this.BN,8292,8297,this.L,8298,8303,this.BN,8304,8304,this.EN,8305,8307,this.L,8308,8313,this.EN,8314,8315,this.ET,8316,8318,this.ON,8319,8319,this.L,8320,8329,this.EN,8330,8331,this.ET,8332,8334,this.ON,8335,8351,this.L,8352,8369,this.ET,8370,8399,this.L,8400,8426,this.NSM,8427,8447,this.L,8448,8449,this.ON,8450,8450,this.L,8451,8454,this.ON,8455,8455,this.L,8456,8457,this.ON,8458,8467,this.L,8468,8468,this.ON,8469,8469,this.L,8470,8472,this.ON,8473,8477,this.L,8478,8483,this.ON,8484,8484,this.L,8485,8485,this.ON,8486,8486,this.L,8487,8487,this.ON,8488,8488,this.L,8489,8489,this.ON,8490,8493,this.L,8494,8494,this.ET,8495,8497,this.L,8498,8498,this.ON,8499,8505,this.L,8506,8507,this.ON,8508,8511,this.L,8512,8516,this.ON,8517,8521,this.L,8522,8523,this.ON,8524,8530,this.L,8531,8543,this.ON,8544,8591,this.L,8592,8721,this.ON,8722,8723,this.ET,8724,9013,this.ON,9014,9082,this.L,9083,9108,this.ON,9109,9109,this.L,9110,9168,this.ON,9169,9215,this.L,9216,9254,this.ON,9255,9279,this.L,9280,9290,this.ON,9291,9311,this.L,9312,9371,this.EN,9372,9449,this.L,9450,9450,this.EN,9451,9751,this.ON,9752,9752,this.L,9753,9853,this.ON,9854,9855,this.L,9856,9873,this.ON,9874,9887,this.L,9888,9889,this.ON,9890,9984,this.L,9985,9988,this.ON,9989,9989,this.L,9990,9993,this.ON,9994,9995,this.L,9996,10023,this.ON,10024,10024,this.L,10025,10059,this.ON,10060,10060,this.L,10061,10061,this.ON,10062,10062,this.L,10063,10066,this.ON,10067,10069,this.L,10070,10070,this.ON,10071,10071,this.L,10072,10078,this.ON,10079,10080,this.L,10081,10132,this.ON,10133,10135,this.L,10136,10159,this.ON,10160,10160,this.L,10161,10174,this.ON,10175,10191,this.L,10192,10219,this.ON,10220,10223,this.L,10224,11021,this.ON,11022,11903,this.L,11904,11929,this.ON,11930,11930,this.L,11931,12019,this.ON,12020,12031,this.L,12032,12245,this.ON,12246,12271,this.L,12272,12283,this.ON,12284,12287,this.L,12288,12288,this.WS,12289,12292,this.ON,12293,12295,this.L,12296,12320,this.ON,12321,12329,this.L,12330,12335,this.NSM,12336,12336,this.ON,12337,12341,this.L,12342,12343,this.ON,12344,12348,this.L,12349,12351,this.ON,12352,12440,this.L,12441,12442,this.NSM,12443,12444,this.ON,12445,12447,this.L,12448,12448,this.ON,12449,12538,this.L,12539,12539,this.ON,12540,12828,this.L,12829,12830,this.ON,12831,12879,this.L,12880,12895,this.ON,12896,12923,this.L,12924,12925,this.ON,12926,12976,this.L,12977,12991,this.ON,12992,13003,this.L,13004,13007,this.ON,13008,13174,this.L,13175,13178,this.ON,13179,13277,this.L,13278,13279,this.ON,13280,13310,this.L,13311,13311,this.ON,13312,19903,this.L,19904,19967,this.ON,19968,42127,this.L,42128,42182,this.ON,42183,64284,this.L,64285,64285,this.R,64286,64286,this.NSM,64287,64296,this.R,64297,64297,this.ET,64298,64310,this.R,64311,64311,this.L,64312,64316,this.R,64317,64317,this.L,64318,64318,this.R,64319,64319,this.L,64320,64321,this.R,64322,64322,this.L,64323,64324,this.R,64325,64325,this.L,64326,64335,this.R,64336,64433,this.AL,64434,64466,this.L,64467,64829,this.AL,64830,64831,this.ON,64832,64847,this.L,64848,64911,this.AL,64912,64913,this.L,64914,64967,this.AL,64968,65007,this.L,65008,65020,this.AL,65021,65021,this.ON,65022,65023,this.L,65024,65039,this.NSM,65040,65055,this.L,65056,65059,this.NSM,65060,65071,this.L,65072,65103,this.ON,65104,65104,this.CS,65105,65105,this.ON,65106,65106,this.CS,65107,65107,this.L,65108,65108,this.ON,65109,65109,this.CS,65110,65118,this.ON,65119,65119,this.ET,65120,65121,this.ON,65122,65123,this.ET,65124,65126,this.ON,65127,65127,this.L,65128,65128,this.ON,65129,65130,this.ET,65131,65131,this.ON,65132,65135,this.L,65136,65140,this.AL,65141,65141,this.L,65142,65276,this.AL,65277,65278,this.L,65279,65279,this.BN,65280,65280,this.L,65281,65282,this.ON,65283,65285,this.ET,65286,65290,this.ON,65291,65291,this.ET,65292,65292,this.CS,65293,65293,this.ET,65294,65294,this.CS,65295,65295,this.ES,65296,65305,this.EN,65306,65306,this.CS,65307,65312,this.ON,65313,65338,this.L,65339,65344,this.ON,65345,65370,this.L,65371,65381,this.ON,65382,65503,this.L,65504,65505,this.ET,65506,65508,this.ON,65509,65510,this.ET,65511,65511,this.L,65512,65518,this.ON,65519,65528,this.L,65529,65531,this.BN,65532,65533,this.ON,65534,65535,this.L];for(var t=0;t<this.charTypes.length;++t)for(var e=this.charTypes[t],i=this.charTypes[++t],r=this.charTypes[++t];e<=i;)this.rtlCharacterTypes[e++]=r}wi.prototype.layout=function(t,e,i,r,n){if(null==t)throw new Error("ArgumentNullException : line");if(null==e)throw new Error("ArgumentNullException : font");var o=[];return e.Unicode?o=this.customLayout(t,i,n,e,r):(o=[])[0]=t,o},wi.prototype.splitLayout=function(t,e,i,r,n){if(null==t)throw new Error("ArgumentNullException : line");if(null==e)throw new Error("ArgumentNullException : font");return this.customSplitLayout(t,e,i,r,n)},wi.prototype.getGlyphIndex=function(t,e,i,r,n){if(null==t)throw new Error("ArgumentNullException : line");if(null==e)throw new Error("ArgumentNullException : font");if(r=null,0===t.length)return{success:!1,glyphs:null};for(var o=(new ui).shape(t,0),s=e.fontInternal.ttfReader,a=(r=new Uint16Array(o.length),0),h=0,l=o.length;h<l;h++){var u=o[h],u=s.getGlyph(u);null!=u&&(r[a++]=u.index)}return{success:!0,glyphs:r}},wi.prototype.customLayout=function(t,e,i,r,n){if(null==n){if(null==t)throw new Error("ArgumentNullException : line");var o=null;return o=null!=i&&i.textDirection!==K.PdfTextDirection.None?(new fi).getLogicalToVisualString(t,e):o}if(null==t)throw new Error("ArgumentNullException : line");if(null==r)throw new Error("ArgumentNullException : font");var s=null,o=(null!=i&&i.textDirection!==K.PdfTextDirection.None&&(t=(new ui).shape(t,0),s=this.customLayout(t,e,i)),[]);if(n){for(var a=s.split(""),h=a.length,l=0;l<h;l++)a[l]=this.addChars(r,a[l]);o=a}else(o=[])[0]=this.addChars(r,s);return o},wi.prototype.addChars=function(t,e){if(null==t)throw new Error("ArgumentNullException : font");if(null==e)throw new Error("ArgumentNullException : line");var i=t.fontInternal.ttfReader,t=(t.setSymbols(e),e=i.convertString(e),tt.toUnicodeArray(e,!1));return tt.byteToString(t)},wi.prototype.customSplitLayout=function(t,e,i,r,n){if(null==t)throw new Error("ArgumentNullException : line");if(null==e)throw new Error("ArgumentNullException : font");return this.customLayout(t,i,n).split("")};var bi=wi;function wi(){this.openBracket="(",this.closeBracket=")"}(w=K.PdfLayoutType||(K.PdfLayoutType={}))[w.Paginate=0]="Paginate",w[w.OnePage=1]="OnePage",(w=K.PdfLayoutBreakType||(K.PdfLayoutBreakType={}))[w.FitPage=0]="FitPage",w[w.FitElement=1]="FitElement",w[w.FitColumnsToPage=2]="FitColumnsToPage",(w=K.PathPointType||(K.PathPointType={}))[w.Start=0]="Start",w[w.Line=1]="Line",w[w.Bezier3=3]="Bezier3",w[w.Bezier=3]="Bezier",w[w.PathTypeMask=7]="PathTypeMask",w[w.DashMode=16]="DashMode",w[w.PathMarker=32]="PathMarker",w[w.CloseSubpath=128]="CloseSubpath",Pi=function(t,e){return(Pi=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}Pi(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(Ci,Si=pt),Object.defineProperty(Ci.prototype,"background",{get:function(){return this.mbackground},set:function(t){this.mbackground=t;var e=this.shading;t.isEmpty?e.remove(this.dictionaryProperties.background):e.items.setValue(this.dictionaryProperties.background,t.toArray(this.colorSpace))},enumerable:!0,configurable:!0}),Object.defineProperty(Ci.prototype,"antiAlias",{get:function(){return this.shading.items.getValue(this.dictionaryProperties.antiAlias).value},set:function(t){var e=this.shading,i=e.items.getValue(this.dictionaryProperties.antiAlias);null==i&&void 0===i?(i=new It(t),e.items.setValue(this.dictionaryProperties.antiAlias,i)):i.value=t},enumerable:!0,configurable:!0}),Object.defineProperty(Ci.prototype,"function",{get:function(){return this.mfunction},set:function(t){null!=(this.mfunction=t)&&void 0!==t?this.shading.items.setValue(this.dictionaryProperties.function,new d(this.mfunction)):this.shading.remove(this.dictionaryProperties.function)},enumerable:!0,configurable:!0}),Object.defineProperty(Ci.prototype,"bBox",{get:function(){return this.shading.items.getValue(this.dictionaryProperties.bBox)},set:function(t){var e=this.shading;null==t&&void 0===t?e.remove(this.dictionaryProperties.bBox):e.items.setValue(this.dictionaryProperties.bBox,t)},enumerable:!0,configurable:!0}),Object.defineProperty(Ci.prototype,"colorSpace",{get:function(){return this.mcolorSpace},set:function(t){var e=this.shading.items.getValue(this.dictionaryProperties.colorSpace);t===this.mcolorSpace&&null!=e||(this.mcolorSpace=t,e=this.colorSpaceToDeviceName(t),this.shading.items.setValue(this.dictionaryProperties.colorSpace,new o(e)))},enumerable:!0,configurable:!0}),Object.defineProperty(Ci.prototype,"stroking",{get:function(){return this.mbStroking},set:function(t){this.mbStroking=t},enumerable:!0,configurable:!0}),Object.defineProperty(Ci.prototype,"patternDictionary",{get:function(){return null==this.mpatternDictionary&&(this.mpatternDictionary=new c),this.mpatternDictionary},enumerable:!0,configurable:!0}),Object.defineProperty(Ci.prototype,"shading",{get:function(){return this.mshading},set:function(t){if(null==t)throw new Error("ArgumentNullException : Shading");t!==this.mshading&&(this.mshading=t,this.patternDictionary.items.setValue(this.dictionaryProperties.shading,new d(this.mshading)))},enumerable:!0,configurable:!0}),Object.defineProperty(Ci.prototype,"matrix",{get:function(){return this.mmatrix},set:function(t){if(null==t)throw new Error("ArgumentNullException : Matrix");t!==this.mmatrix&&(this.mmatrix=t.clone(),t=new p(this.mmatrix.matrix.elements),this.mpatternDictionary.items.setValue(this.dictionaryProperties.matrix,t))},enumerable:!0,configurable:!0}),Ci.prototype.monitorChanges=function(t,e,i,r,n){var o=!1;return t instanceof Ci&&(this.colorSpace!==n&&(this.colorSpace=n,this.resetFunction()),e.setColorSpace("Pattern",this.mbStroking),t=i.getResources().getName(this),e.setColourWithPattern(null,t,this.mbStroking),o=!0),o},Ci.prototype.resetChanges=function(t){},Ci.prototype.colorSpaceToDeviceName=function(t){var e;return e=t===K.PdfColorSpace.Rgb?"DeviceRGB":e},Ci.prototype.resetPatternDictionary=function(t){this.mpatternDictionary=t},Ci.prototype.cloneAntiAliasingValue=function(t){if(null==t)throw new Error("ArgumentNullException : brush");var e=this.shading.items.getValue(this.dictionaryProperties.antiAlias);null!=e&&t.shading.items.setValue(this.dictionaryProperties.antiAlias,new It(e.value))},Ci.prototype.cloneBackgroundValue=function(t){var e=this.background;e.isEmpty||(t.background=e)},Object.defineProperty(Ci.prototype,"element",{get:function(){return this.patternDictionary},enumerable:!0,configurable:!0});var Pi,Si,vi=Ci;function Ci(t){var e=Si.call(this)||this;return e.mbackground=new f(255,255,255),e.mbStroking=!1,e.mfunction=null,e.dictionaryProperties=new l,e.mpatternDictionary=new c,e.mpatternDictionary.items.setValue(e.dictionaryProperties.type,new o(e.dictionaryProperties.pattern)),e.mpatternDictionary.items.setValue(e.dictionaryProperties.patternType,new u(2)),e.shading=t,e.colorSpace=K.PdfColorSpace.Rgb,e}Object.defineProperty(Oi.prototype,"size",{get:function(){return this.templateSize},enumerable:!0,configurable:!0}),Object.defineProperty(Oi.prototype,"width",{get:function(){return this.size.width},enumerable:!0,configurable:!0}),Object.defineProperty(Oi.prototype,"height",{get:function(){return this.size.height},enumerable:!0,configurable:!0}),Object.defineProperty(Oi.prototype,"graphics",{get:function(){var t;return null!=this.pdfGraphics&&void 0!==this.pdfGraphics||(t=new Ii(this),t=new Ai(this.size,t,this.content),this.pdfGraphics=t,this.pdfGraphics.initializeCoordinates()),this.pdfGraphics},enumerable:!0,configurable:!0}),Oi.prototype.getResources=function(){return null==this.resources&&(this.resources=new Ti,this.content.items.setValue(this.dictionaryProperties.resources,this.resources)),this.resources},Oi.prototype.initialize=function(){this.addType(),this.addSubType()},Oi.prototype.addType=function(){var t=new o(this.dictionaryProperties.xObject);this.content.items.setValue(this.dictionaryProperties.type,t)},Oi.prototype.addSubType=function(){var t=new o(this.dictionaryProperties.form);this.content.items.setValue(this.dictionaryProperties.subtype,t)},Oi.prototype.reset=function(t){void 0===t?(null!=this.resources&&(this.resources=null,this.content.remove(this.dictionaryProperties.resources)),null!=this.graphics&&this.graphics.reset(this.size)):(this.setSize(t),this.reset())},Oi.prototype.setSize=function(t){var e=new X(new q(0,0),t),e=p.fromRectangle(e);this.content.items.setValue(this.dictionaryProperties.bBox,e),this.templateSize=t},Object.defineProperty(Oi.prototype,"element",{get:function(){return this.content},enumerable:!0,configurable:!0});var Bi=Oi;function Oi(t,e){var i;this.dictionaryProperties=new l,this.writeTransformation=!0,void 0!==t&&(t instanceof Y&&void 0===e?(this.content=new U,i=new Y(t.width,t.height),this.setSize(i)):(this.content=new U,this.setSize(new Y(t,e))),this.initialize())}xi=function(t,e){return(xi=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}xi(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(ji,Li=c),Object.defineProperty(ji.prototype,"names",{get:function(){return this.getNames()},enumerable:!0,configurable:!0}),Object.defineProperty(ji.prototype,"document",{get:function(){return this.pdfDocument},set:function(t){this.pdfDocument=t},enumerable:!0,configurable:!0}),ji.prototype.getName=function(t){var e,i=t.element,r=null;return null==(r=this.names.containsKey(i)?this.names.getValue(i):r)&&(e=this.generateName(),r=new o(e),this.names.setValue(i,r),t instanceof Tt||t instanceof Bi||t instanceof vi||t instanceof Di||t instanceof le||t instanceof xe||t instanceof ke)&&this.add(t,r),r},ji.prototype.getNames=function(){null==this.pdfNames&&(this.pdfNames=new ae);var t=this.items.getValue(this.dictionaryProperties.font);return null!=t&&Ut.dereference(t),this.pdfNames},ji.prototype.requireProcedureSet=function(t){if(null==t)throw new Error("ArgumentNullException:procedureSetName");var e=this.items.getValue(this.dictionaryProperties.procset),t=(null==e&&(e=new p,this.items.setValue(this.dictionaryProperties.procset,e)),new o(t));e.contains(t)||e.add(t)},ji.prototype.removeFont=function(t){for(var e=null,i=this.pdfNames.keys(),r=0;r<this.pdfNames.size();r++)if(this.pdfNames.getValue(i[r])===new o(t)){e=i[r];break}null!=e&&this.pdfNames.remove(e)},ji.prototype.generateName=function(){return ki.getNewGuidString()},ji.prototype.add=function(t,e){if(t instanceof Tt){var i=null,r=this.items.getValue(this.dictionaryProperties.font);null!=r?i=i=s=r:(i=new c,this.items.setValue(this.dictionaryProperties.font,i)),i.items.setValue(e.value,new d(t.element))}else if(t instanceof Bi){var n=void 0;null==(n=this.items.getValue(this.dictionaryProperties.xObject))&&(n=new c,this.items.setValue(this.dictionaryProperties.xObject,n)),n.items.setValue(e.value,new d(t.element))}else if(t instanceof pt)(t instanceof vi||t instanceof Di)&&null!=(o=t.element)&&(null==(r=this.items.getValue(this.dictionaryProperties.pattern))&&(r=new c,this.items.setValue(this.dictionaryProperties.pattern,r)),r.items.setValue(e.value,new d(o)));else if(t instanceof le){var o=t.element,i=null;null==(i=this.items.getValue(this.dictionaryProperties.extGState))&&(i=new c,this.items.setValue(this.dictionaryProperties.extGState,i)),i.items.setValue(e.value,new d(o))}else{var s,n=this.Dictionary.items.getValue(this.dictionaryProperties.xObject),r=void 0,a=(void 0!==this.pdfDocument&&(r=this.pdfDocument.sections.element.items.getValue(this.dictionaryProperties.resources).items.getValue(this.dictionaryProperties.xObject)),this.Dictionary.items.values(),!1),h=void 0;if(void 0!==this.pdfDocument&&null==r)r=new c,this.pdfDocument.sections.element.items.getValue(this.dictionaryProperties.resources).items.setValue(this.dictionaryProperties.xObject,r);else if(void 0!==this.pdfDocument)for(var l=r.items.values(),u=0;u<l.length;u++)void 0!==l[u]&&void 0!==l[u].element&&l[u].element.data[0]===t.element.data[0]&&(h=l[u],a=!0);null==n&&(n=new c,this.Dictionary.items.setValue(this.dictionaryProperties.xObject,n)),a&&void 0!==h?n.items.setValue(e.value,h):(s=new d(t.element),n.items.setValue(e.value,s),void 0!==this.pdfDocument&&r.items.setValue(e.value,s))}};var xi,Li,Ti=ji;function ji(t){t=Li.call(this,t)||this;return t.properties=new c,t}Vi.getNewGuidString=function(){return"aaaaaaaa-aaaa-4aaa-baaa-aaaaaaaaaaaa".replace(/[ab]/g,function(t){var e=16*Math.random()|0;return("a"===t?e:3&e|8).toString(16)})};var ki=Vi;function Vi(){}Ri=function(t,e){return(Ri=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}Ri(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(Ni,Mi=pt),Ni.prototype.initialize=function(t,e,i,r){this.mPage=e,this.mLocation=i,this.mTransformationMatrix=r,this.tempBrushStream=this.brushStream,this.brushStream=new U;e=new Ti;return this.brushStream.items.setValue(this.mDictionaryProperties.resources,e),this.setBox(t),this.setObligatoryFields(),this},Object.defineProperty(Ni.prototype,"location",{get:function(){return this.mLocation},set:function(t){this.mLocation=t},enumerable:!0,configurable:!0}),Ni.prototype.setObligatoryFields=function(){var t,e;this.brushStream.items.setValue(this.mDictionaryProperties.patternType,new u(1)),this.brushStream.items.setValue(this.mDictionaryProperties.paintType,new u(1)),this.brushStream.items.setValue(this.mDictionaryProperties.tilingType,new u(1)),this.brushStream.items.setValue(this.mDictionaryProperties.xStep,new u(this.mBox.right-this.mBox.left)),this.brushStream.items.setValue(this.mDictionaryProperties.yStep,new u(this.mBox.bottom-this.mBox.top)),null!=this.mPage&&null!=this.mLocation&&(null==this.mTransformationMatrix&&void 0===this.mTransformationMatrix?(t=this.mPage.size.height%this.rectangle.size.height-this.mLocation.y,this.brushStream.items.setValue(this.mDictionaryProperties.matrix,new p([1,0,0,1,this.mLocation.x,t]))):(t=0,e=this.mTransformationMatrix.matrix.elements,t=this.mPage.size.height>this.rectangle.size.height?this.mTransformationMatrix.matrix.offsetY-this.mPage.size.height%this.rectangle.size.height:this.mPage.size.height%this.rectangle.size.height+this.mTransformationMatrix.matrix.offsetY,this.brushStream.items.setValue(this.mDictionaryProperties.matrix,new p([e[0],e[1],e[2],e[3],e[4],t]))))},Ni.prototype.setBox=function(t){this.mBox=t;t=new X(this.mBox.left,this.mBox.top,this.mBox.right,this.mBox.bottom);this.brushStream.items.setValue(this.mDictionaryProperties.bBox,p.fromRectangle(t))},Object.defineProperty(Ni.prototype,"rectangle",{get:function(){return this.mBox},enumerable:!0,configurable:!0}),Object.defineProperty(Ni.prototype,"size",{get:function(){return this.mBox.size},enumerable:!0,configurable:!0}),Object.defineProperty(Ni.prototype,"graphics",{get:function(){var t;return null==this.mGraphics&&void 0===this.mGraphics&&(t=new Ii(this),t=new Ai(this.size,t,this.brushStream),this.mGraphics=t,this.mResources=this.getResources(),this.mGraphics.initializeCoordinates()),this.mGraphics},enumerable:!0,configurable:!0}),Ni.prototype.getResources=function(){return this.mResources},Object.defineProperty(Ni.prototype,"stroking",{get:function(){return this.mStroking},set:function(t){this.mStroking=t},enumerable:!0,configurable:!0}),Ni.prototype.clone=function(){var t=this.initialize(this.rectangle,this.mPage,this.location,this.mTransformationMatrix);return null!=this.mTransformationMatrix&&null!=this.mTransformationMatrix.matrix&&t.brushStream.items.setValue(this.mDictionaryProperties.matrix,new p(this.mTransformationMatrix.matrix.elements)),t.brushStream.data=this.tempBrushStream.data,t.mResources=new Ti(this.mResources),t.brushStream.items.setValue(this.mDictionaryProperties.resources,t.mResources),t},Ni.prototype.monitorChanges=function(t,e,i,r,n){var o,s=!1;return t!==this?(e.setColorSpace("Pattern",this.mStroking),o=i.getResources().getName(this),e.setColourWithPattern(null,o,this.mStroking),s=!0):t instanceof Ni&&(e.setColorSpace("Pattern",this.mStroking),o=i.getResources().getName(this),e.setColourWithPattern(null,o,this.mStroking),s=!0),s},Ni.prototype.resetChanges=function(t){},Object.defineProperty(Ni.prototype,"element",{get:function(){return this.brushStream},enumerable:!0,configurable:!0});var Ri,Mi,Di=Ni;function Ni(t,e){var i=Mi.call(this)||this,r=(i.mStroking=!1,i.mLocation=new q(0,0),i.mDictionaryProperties=new l,null);return t instanceof ut?r=t:t instanceof Y&&(r=new ut(0,0,t.width,t.height)),null!==e&&e instanceof er&&(i.mPage=e),i.brushStream=new U,i.mResources=new Ti,i.brushStream.items.setValue(i.mDictionaryProperties.resources,i.mResources),i.setBox(r),i.setObligatoryFields(),null!==e&&e instanceof er&&(i.mPage=e,i.graphics.colorSpace=e.document.colorSpace),i}Object.defineProperty(S.prototype,"stringLayoutResult",{get:function(){return this.pdfStringLayoutResult},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"size",{get:function(){return this.canvasSize},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"mediaBoxUpperRightBound",{get:function(){return void 0===this.internalMediaBoxUpperRightBound&&(this.internalMediaBoxUpperRightBound=0),this.internalMediaBoxUpperRightBound},set:function(t){this.internalMediaBoxUpperRightBound=t},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"clientSize",{get:function(){return new Y(this.clipBounds.width,this.clipBounds.height)},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"colorSpace",{get:function(){return this.currentColorSpace},set:function(t){this.currentColorSpace=t},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"streamWriter",{get:function(){return this.pdfStreamWriter},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"matrix",{get:function(){return null==this.transformationMatrix&&(this.transformationMatrix=new ie),this.transformationMatrix},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"layer",{get:function(){return this.pageLayer},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"page",{get:function(){return this.pageLayer.page},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"automaticFields",{get:function(){return null!=this.internalAutomaticFields&&void 0!==this.internalAutomaticFields||(this.internalAutomaticFields=new ce),this.internalAutomaticFields},enumerable:!0,configurable:!0}),S.prototype.initialize=function(){this.bStateSaved=!1,this.currentPen=null,this.currentBrush=null,this.currentFont=null,this.currentColorSpace=K.PdfColorSpace.Rgb,this.bCSInitialized=!1,this.transformationMatrix=null,this.previousTextRenderingMode=-1,this.previousCharacterSpacing=-1,this.previousWordSpacing=-1,this.previousTextScaling=-100,this.currentStringFormat=null,this.clipBounds=new X(new q(0,0),this.size),this.getResources.getResources().requireProcedureSet(this.procedureSets.pdf)},S.prototype.drawPdfTemplate=function(t,e,i){if(void 0===i){if(null==t)throw Error("ArgumentNullException-template");this.drawPdfTemplate(t,e,t.size)}else{if(null==t)throw Error("ArgumentNullException-template");var r=0<t.width?i.width/t.width:1,n=0<t.height?i.height/t.height:1,o=!(1==r&&1==n),s=this.save(),a=new ie;null!=this.pageLayer&&this.getTranslateTransform(e.x,e.y+i.height,a),o&&this.getScaleTransform(r,n,a),this.pdfStreamWriter.modifyCtm(a);var o=this.getResources.getResources().getName(t),h=(this.pdfStreamWriter.executeObject(o),this.restore(s),t.graphics);if(null!=h)for(var l=0;l<h.automaticFields.automaticFields.length;l++){var u=h.automaticFields.automaticFields[l],c=new q(u.location.x+e.x,u.location.y+e.y),p=0==t.size.width?0:i.width/t.size.width,d=0==t.size.height?0:i.height/t.size.height;this.automaticFields.add(new be(u.field,c,p,d)),this.page.dictionary.modify()}this.getResources.getResources().requireProcedureSet(this.procedureSets.imageB),this.getResources.getResources().requireProcedureSet(this.procedureSets.imageC),this.getResources.getResources().requireProcedureSet(this.procedureSets.imageI),this.getResources.getResources().requireProcedureSet(this.procedureSets.text)}},S.prototype.drawString=function(t,e,i,r,n,o,s,a,h){var l;"string"==typeof t&&e instanceof Tt&&(i instanceof te||null===i)&&(r instanceof pt||null===r)&&"number"==typeof n&&"number"==typeof o&&(s instanceof bt||null===s)&&void 0===a?(this.isOverloadWithPosition=!0,this.drawString(t,e,i,r,n,o,this.clientSize.width-n,0,s)):(i=i,r=r,n=n,o=o,s=s,a=a,h=h,(t=(new vt).layout(t,e,h,new Y(s,a),this.isOverloadWithPosition,this.clientSize)).empty||(l=this.checkCorrectLayoutRectangle(t.actualSize,n,o,h),s<=0&&(n=l.x,s=l.width),a<=0&&(o=l.y,a=l.height),this.drawStringLayoutResult(t,e,i,r,new X(n,o,s,a),h),this.isEmfTextScaled=!1,this.emfScalingFactor=new Y(0,0)),this.getResources.getResources().requireProcedureSet(this.procedureSets.text),this.isNormalRender=!0,this.pdfStringLayoutResult=t,this.isUseFontSize=!1)},S.prototype.drawLine=function(t,e,i,r,n){var o,s;e instanceof q?this.drawLine(t,(o=e).x,o.y,(s=i).x,s.y):(o=e,s=i,e=r,i=n,this.stateControl(t,null,null),(r=this.streamWriter).beginPath(o,s),r.appendLineSegment(e,i),r.strokePath(),this.getResources.getResources().requireProcedureSet(this.procedureSets.pdf))},S.prototype.drawRectangle=function(t,e,i,r,n,o){var s,a;t instanceof te&&"number"==typeof e?this.drawRectangle(t,null,e,s=i,r,n):t instanceof pt&&"number"==typeof e?this.drawRectangle(null,t,e,s=i,r,n):(s=i,i=r,r=n,n=o,e instanceof Di?(this.bCSInitialized=!1,o=this.matrix.matrix.offsetX+s,a=void 0,a=null!=this.layer&&null!=this.layer.page?this.layer.page.size.height-this.matrix.matrix.offsetY+i:this.clientSize.height-this.matrix.matrix.offsetY+i,e.location=new q(o,a),e.graphics.colorSpace=this.colorSpace):e instanceof vi&&(e.colorSpace=this.colorSpace),o=t,a=e=e instanceof mt&&e.color.isEmpty?null:e,this.stateControl(o,a,null),this.streamWriter.appendRectangle(s,i,r,n),this.drawPathHelper(o,a,!1))},S.prototype.drawRoundedRectangle=function(t,e,i,r,n,o,s){if(null===t)throw new Error("pen");if(null===e)throw new Error("brush");0===s?this.drawRectangle(t,e,i,r,n,o):(o=[(i=[i,r,n,o])[0],i[1],(n=[r=2*s,r])[0],n[1]],this._pathPoints=[],this._pathTypes=[],s=this._addArc(o[0],o[1],o[2],o[3],180,90,s=!0),o[0]=i[0]+i[2]-r,s=this._addArc(o[0],o[1],o[2],o[3],270,90,s),o[1]=i[1]+i[3]-r,s=this._addArc(o[0],o[1],o[2],o[3],0,90,s),o[0]=i[0],s=this._addArc(o[0],o[1],o[2],o[3],90,90,s),n=this._pathPoints.length-1,r=this._pathTypes[n],r|=K.PathPointType.CloseSubpath,this._pathTypes[n]=r,this._drawPath(t,e,this._pathPoints,this._pathTypes,K.PdfFillMode.Alternate),this._pathPoints=[],this._pathTypes=[])},S.prototype._addArc=function(t,e,i,r,n,o,s){for(var a=this._getBezierArcPoints(t,e,t+i,e+r,n,o),h=0;h<a.length;h+=8){var l=[a[h],a[h+1],a[h+2],a[h+3],a[h+4],a[h+5],a[h+6],a[h+7]];s=this._addArcPoints(l,K.PathPointType.Bezier3,s)}return s},S.prototype._addArcPoints=function(t,e,i){for(var r=0;r<t.length;r++){var n=new q(t[r],t[r+1]);0===r?0===this._pathPoints.length||i?(this._addPoint(n,K.PathPointType.Start),i=!1):n.x===this._getLastPoint().x&&n.y===this._getLastPoint().y||this._addPoint(n,K.PathPointType.Line):this._addPoint(n,e),r++}return i},S.prototype._getLastPoint=function(){var t=new q(0,0),e=this._pathPoints.length;return 0<e&&(t.x=this._pathPoints[e-1].x,t.y=this._pathPoints[e-1].y),t},S.prototype._addPoint=function(t,e){this._pathPoints.push(t),this._pathTypes.push(e)},S.prototype._getBezierArcPoints=function(t,e,i,r,n,o){i<t&&(p=void 0,p=t,t=i,i=p),e<r&&(p=void 0,p=e,e=r,r=p),Math.abs(o)<=90?(s=o,a=1):s=o/(a=Math.ceil(Math.abs(o)/90));for(var s,a,h=(t+i)/2,l=(e+r)/2,u=(i-t)/2,c=(r-e)/2,p=s*(Math.PI/360),d=Math.abs(4/3*(1-Math.cos(p))/Math.sin(p)),f=[],g=0;g<a;g++){var m=(n+g*s)*(Math.PI/180),y=(n+(g+1)*s)*(Math.PI/180),b=Math.cos(m),w=Math.cos(y),m=Math.sin(m),y=Math.sin(y);0<s?f.push(h+u*b,l-c*m,h+u*(b-d*m),l-c*(m+d*b),h+u*(w+d*y),l-c*(y-d*w),h+u*w,l-c*y):f.push(h+u*b,l-c*m,h+u*(b+d*m),l-c*(m-d*b),h+u*(w-d*y),l-c*(y+d*w),h+u*w,l-c*y)}return f},S.prototype.drawPathHelper=function(t,e,i,r){"boolean"==typeof i?this.drawPathHelper(t,e,K.PdfFillMode.Winding,i):(e=null!=e,i=i===K.PdfFillMode.Alternate,(t=null!=t)&&e?this.streamWriter.fillStrokePath(i):t||e?t?this.streamWriter.strokePath():this.streamWriter.fillPath(i):this.streamWriter.endPath())},S.prototype.drawImage=function(t,e,i,r,n){var o,s;"number"==typeof e&&"number"==typeof i&&void 0===r?(s=t.physicalDimension,this.drawImage(t,e,i,s.width,s.height)):(s=e,e=i,i=n,t.save(),o=new ie,this.getTranslateTransform(s,e+i,o),this.getScaleTransform(r,n,o),this.pdfStreamWriter.write("q"),this.pdfStreamWriter.modifyCtm(o),s=this.getResources.getResources(),void 0!==this.pageLayer&&null!=this.page&&(s.document=this.page.document),e=s.getName(t),void 0!==this.pageLayer&&this.page.setResources(s),this.pdfStreamWriter.executeObject(e),this.pdfStreamWriter.write(h.restoreState),this.pdfStreamWriter.write(h.newLine),(i=this.getResources.getResources()).requireProcedureSet(this.procedureSets.imageB),i.requireProcedureSet(this.procedureSets.imageC),i.requireProcedureSet(this.procedureSets.imageI),i.requireProcedureSet(this.procedureSets.text))},S.prototype.getLineBounds=function(t,e,i,r,n){var o,s,a,h;return!e.empty&&t<e.lineCount&&0<=t?(h=e.lines[t],o=this.getTextVerticalAlignShift(e.actualSize.height,r.height,n)+r.y+e.lineHeight*t,s=h.width,a=this.getHorizontalAlignShift(s,r.width,n),t=this.getLineIndent(h,n,r,0===t),a+=this.rightToLeft(n)?0:t,a=r.x+a,h=this.shouldJustify(h,r.width,n)?r.width-t:s-t,n=e.lineHeight,new X(a,o,h,n)):new X(0,0,0,0)},S.prototype.checkCorrectLayoutRectangle=function(t,e,i,r){var n=new X(e,i,t.width,t.width);if(null!=r){switch(r.alignment){case K.PdfTextAlignment.Center:n.x-=n.width/2;break;case K.PdfTextAlignment.Right:n.x-=n.width}switch(r.lineAlignment){case K.PdfVerticalAlignment.Middle:n.y-=n.height/2;break;case K.PdfVerticalAlignment.Bottom:n.y-=n.height}}return n},S.prototype.setLayer=function(t){t=(this.pageLayer=t).page;null!=t&&void 0!==t&&(t.beginSave=this.pageSave)},S.prototype.pageSave=function(t){if(null!=t.graphics.automaticFields)for(var e=0;e<t.graphics.automaticFields.automaticFields.length;e++){var i=t.graphics.automaticFields.automaticFields[e];i.field.performDraw(t.graphics,i.location,i.scalingX,i.scalingY)}},S.prototype.drawStringLayoutResult=function(t,e,i,r,n,o){if(t.empty)throw new Error("ArgumentNullException:result");this.applyStringSettings(e,i,r,o,n);var s=null!=o?o.horizontalScalingFactor:100,s=(s===this.previousTextScaling||this.isEmfTextScaled||(this.pdfStreamWriter.setTextScaling(s),this.previousTextScaling=s),null==o||0===o.lineSpacing?e.height:o.lineSpacing+e.height),a=null!=o&&o.subSuperScript===K.PdfSubSuperScript.SubScript?s-(e.height+e.metrics.getDescent(o)):s-e.metrics.getAscent(o);this.shift=a,this.pdfStreamWriter.startNextLine(n.x,n.y-a),this.pdfStreamWriter.setLeading(+s);for(var h=0,l="",u=0;u<t.lines.length;u++)if(h+=t.lineHeight,n.y+h>this.clientSize.height){this.startCutIndex=u;break}for(var c=this.startCutIndex;c<t.lines.length&&0<=c;c++)l+=t.lines[c].text;a=new X(n.x,n.y,n.width,n.height);this.drawLayoutResult(t,e,o,n),this.underlineStrikeoutText(i,r,t,e,a,o),this.isEmfPlus=!1,this.isUseFontSize=!1,-1!==this.startCutIndex&&this.getNextPage().graphics.drawString(l,e,i,r,n.x,0,n.width,0,o)},S.prototype.getNextPage=function(){var t=this.currentPage.section,e=t.indexOf(this.currentPage);return e===t.count-1?t.add():t.getPages()[e+1]},S.prototype.setClip=function(t,e){void 0===e?this.setClip(t,K.PdfFillMode.Winding):(this.pdfStreamWriter.appendRectangle(t),this.pdfStreamWriter.clipPath(e===K.PdfFillMode.Alternate))},S.prototype.applyStringSettings=function(t,e,i,r,n){i instanceof Di?(this.bCSInitialized=!1,i.graphics.colorSpace=this.colorSpace):i instanceof vi&&(this.bCSInitialized=!1,i.colorSpace=this.colorSpace);var o=this.getTextRenderingMode(e,i,r),e=(this.stateControl(e,i,t,r),this.pdfStreamWriter.beginText(),o!==this.previousTextRenderingMode&&(this.pdfStreamWriter.setTextRenderingMode(o),this.previousTextRenderingMode=o),null!=r?r.characterSpacing:0),i=(e===this.previousCharacterSpacing||this.isEmfTextScaled||(this.pdfStreamWriter.setCharacterSpacing(e),this.previousCharacterSpacing=e),null!=r?r.wordSpacing:0);i!==this.previousWordSpacing&&(this.pdfStreamWriter.setWordSpacing(i),this.previousWordSpacing=i)},S.prototype.getTextVerticalAlignShift=function(t,e,i){var r=0;if(0<=e&&null!=i&&i.lineAlignment!==K.PdfVerticalAlignment.Top)switch(i.lineAlignment){case K.PdfVerticalAlignment.Middle:r=(e-t)/2;break;case K.PdfVerticalAlignment.Bottom:r=e-t}return r},S.prototype.drawLayoutResult=function(t,e,i,r){var n=this.getTextVerticalAlignShift(t.actualSize.height,r.height,i);0!==n&&this.pdfStreamWriter.startNextLine(0,n);for(var o=null!=e&&e.isUnicode,s=(null!=e&&e.isEmbedFont,t.lines),a=0,h=s.length;a<h&&a!==this.startCutIndex;a++){var l=s[a],u=(l.text,l.width),u=this.getHorizontalAlignShift(u,r.width,i),c=this.getLineIndent(l,i,r,0===a);0===(u+=this.rightToLeft(i)?0:c)||this.isEmfTextScaled||this.pdfStreamWriter.startNextLine(u,0),o?this.drawUnicodeLine(l,r,e,i):this.drawAsciiLine(l,r,e,i),0===u||this.isEmfTextScaled||this.pdfStreamWriter.startNextLine(-u,0),this.isOverloadWithPosition&&1<s.length&&(this.pdfStreamWriter.startNextLine(-r.x,0),r.x=0,r.width=this.clientSize.width,this.isOverloadWithPosition=!1,this.isPointOverload=!0)}this.getResources.getResources().requireProcedureSet(this.procedureSets.text),0!==n&&this.pdfStreamWriter.startNextLine(0,-(n-t.lineHeight)),this.pdfStreamWriter.endText()},S.prototype.drawAsciiLine=function(t,e,i,r){this.justifyLine(t,e.width,r);var n="";if(-1!==t.text.indexOf("(")||-1!==t.text.indexOf(")"))for(var o=0;o<t.text.length;o++)"("===t.text[o]?n+="\\(":")"===t.text[o]?n+="\\)":n+=t.text[o];""===n&&(n=t.text),this.pdfStreamWriter.showNextLineText(new tt("("+n+")"))},S.prototype.drawUnicodeLine=function(t,e,i,r){var n,o,s=t.text,a=(t.width,null!=r&&r.rightToLeft),h=null!=r&&(0!==r.wordSpacing||r.alignment===K.PdfTextAlignment.Justify),t=this.justifyLine(t,e.width,r),e=new bi;a||null!=r&&r.textDirection!==K.PdfTextDirection.None?(a=(n=null)!=r&&r.alignment===K.PdfTextAlignment.Right,o=1<(n=(o=null)!=r&&r.textDirection!==K.PdfTextDirection.None?e.layout(s,i,r.textDirection===K.PdfTextDirection.RightToLeft,h,r):e.layout(s,i,a,h,r)).length?null!=r&&r.textDirection!==K.PdfTextDirection.None?e.splitLayout(s,i,r.textDirection===K.PdfTextDirection.RightToLeft,h,r):e.splitLayout(s,i,a,h,r):[s],this.drawUnicodeBlocks(n,o,i,r,t)):h?(n=(e=this.breakUnicodeLine(s,i,null)).tokens,o=e.words,this.drawUnicodeBlocks(n,o,i,r,t)):(a=this.convertToUnicode(s,i),h=this.getUnicodeString(a),this.streamWriter.showNextLineText(h))},S.prototype.drawUnicodeBlocks=function(t,e,i,r,n){if(null==t)throw new Error("Argument Null Exception : blocks");if(null==e)throw new Error("Argument Null Exception : words");if(null==i)throw new Error("Argument Null Exception : font");this.streamWriter.startNextLine();var o=0,s=0,a=0,h=0;try{null!=r&&(a=r.firstLineIndent,h=r.paragraphIndent,r.firstLineIndent=0,r.paragraphIndent=0);var l=i.getCharWidth(Pt.whiteSpace,r)+n,u=null!=r?r.characterSpacing:0;l+=u+(null!=r&&0===n?r.wordSpacing:0);for(var c=0;c<t.length;c++){var p,d=t[c],f=e[c],g=0;0!==o&&this.streamWriter.startNextLine(o,0),0<f.length&&(g=g+i.measureString(f,r).width+u,p=this.getUnicodeString(d),this.streamWriter.showText(p)),c!==t.length-1&&(s+=o=g+l)}0<s&&this.streamWriter.startNextLine(-s,0)}finally{null!=r&&(r.firstLineIndent=a,r.paragraphIndent=h)}},S.prototype.breakUnicodeLine=function(t,e,i){if(null===t)throw new Error("Argument Null Exception : line");i=t.split(null);for(var r=[],n=0;n<i.length;n++){var o=i[n],o=this.convertToUnicode(o,e);r[n]=o}return{tokens:r,words:i}},S.prototype.getUnicodeString=function(t){if(null===t)throw new Error("Argument Null Exception : token");t=new tt(t);return t.converted=!0,t.encode=K.InternalEnum.ForceEncoding.Ascii,t},S.prototype.convertToUnicode=function(t,e){var i,r=null;if(null==t)throw new Error("Argument Null Exception : text");if(null==e)throw new Error("Argument Null Exception : ttfFont");return e.fontInternal instanceof li&&(i=e.fontInternal.ttfReader,e.setSymbols(t),r=i.convertString(t),e=tt.toUnicodeArray(r,!1),r=tt.byteToString(e)),r},S.prototype.justifyLine=function(t,e,i){var r=t.text,n=t.width,t=this.shouldJustify(t,e,i),o=null!=i&&0!==i.wordSpacing,s=Pt.spaces,r=Pt.getCharsCount(r,s),s=0;return t?(o&&(n-=r*i.wordSpacing),this.pdfStreamWriter.setWordSpacing(s=(e-n)/r)):o?this.pdfStreamWriter.setWordSpacing(i.wordSpacing):this.pdfStreamWriter.setWordSpacing(0),s},S.prototype.reset=function(t){this.canvasSize=t,this.streamWriter.clear(),this.initialize(),this.initializeCoordinates()},S.prototype.shouldJustify=function(t,e,i){var r=t.text,n=t.width,o=null!=i&&i.alignment===K.PdfTextAlignment.Justify,n=0<=e&&n<e,e=Pt.spaces,e=0<Pt.getCharsCount(r,e)&&r[0]!==Pt.whiteSpace,r=0<(t.lineType&K.LineType.LayoutBreak);return o&&n&&e&&(r||i.alignment===K.PdfTextAlignment.Justify)},S.prototype.underlineStrikeoutText=function(t,e,i,r,n,o){if(r.underline||r.strikeout){var s=this.createUnderlineStikeoutPen(t,e,r,o);if(null!=s){for(var t=this.getTextVerticalAlignShift(i.actualSize.height,n.height,o),a=0,a=n.y+t+r.metrics.getAscent(o)+1.5*s.width,h=n.y+t+r.metrics.getHeight(o)/2+1.5*s.width,l=i.lines,u=0,c=i.lineCount;u<c;u++){var p,d=l[u],f=(d.text,d.width),g=this.getHorizontalAlignShift(f,n.width,o),m=this.getLineIndent(d,o,n,0===u),g=(g+=this.rightToLeft(o)?0:m,n.x+g),d=this.shouldJustify(d,n.width,o)?g+n.width-m:g+f-m;r.underline&&(p=a,this.drawLine(s,g,p,d,p),a+=i.lineHeight),r.strikeout&&(p=h,this.drawLine(s,g,p,d,p),h+=i.lineHeight),this.isPointOverload&&1<l.length&&(n.x=0,n.width=this.clientSize.width)}this.isPointOverload=!1}}},S.prototype.createUnderlineStikeoutPen=function(t,e,i,r){i=i.metrics.getSize(r)/20,r=null;return null!=t?r=new te(t.color,i):null!=e&&(r=new te(e,i)),r},S.prototype.getTextRenderingMode=function(t,e,i){var r=K.TextRenderingMode.None,r=null!=t&&null!=e?K.TextRenderingMode.FillStroke:null!=t?K.TextRenderingMode.Stroke:K.TextRenderingMode.Fill;return null!=i&&i.clipPath&&(r|=K.TextRenderingMode.ClipFlag),r},S.prototype.getLineIndent=function(t,e,i,r){var n=0,t=0<(t.lineType&K.LineType.FirstParagraphLine);return null!=e&&t&&(n=r?e.firstLineIndent:e.paragraphIndent,n=0<i.width?Math.min(i.width,n):n),n},S.prototype.getHorizontalAlignShift=function(t,e,i){var r=0;if(0<=e&&null!=i&&i.alignment!==K.PdfTextAlignment.Left)switch(i.alignment){case K.PdfTextAlignment.Center:r=(e-t)/2;break;case K.PdfTextAlignment.Right:r=e-t}return r},S.prototype.rightToLeft=function(t){var e=null!=t&&t.rightToLeft;return e=null!=t&&t.textDirection!==K.PdfTextDirection.None&&void 0!==t.textDirection?!0:e},S.prototype.stateControl=function(t,e,i,r){void 0===r?this.stateControl(t,e,i,null):(e instanceof vi&&(this.bCSInitialized=!1,e.colorSpace=this.colorSpace),e instanceof Di&&(this.bCSInitialized=!1,e.graphics.colorSpace=this.colorSpace),null!==e?(void 0!==this.pageLayer&&null!=this.pageLayer&&!1===this.colorSpaceChanged&&(this.lastDocumentCS=this.pageLayer.page.document.colorSpace,this.lastGraphicsCS=this.pageLayer.page.graphics.colorSpace,this.colorSpace=this.pageLayer.page.document.colorSpace,this.currentColorSpace=this.pageLayer.page.document.colorSpace,this.colorSpaceChanged=!0),this.initCurrentColorSpace(this.currentColorSpace)):null!=t&&(void 0!==this.pageLayer&&null!=this.pageLayer&&(this.colorSpace=this.pageLayer.page.document.colorSpace,this.currentColorSpace=this.pageLayer.page.document.colorSpace),this.initCurrentColorSpace(this.currentColorSpace)),this.penControl(t,!1),this.brushControl(e,!1),this.fontControl(i,r,!1))},S.prototype.initCurrentColorSpace=function(t){this.getResources.getResources();this.bCSInitialized||(this.currentColorSpace!=K.PdfColorSpace.GrayScale?(this.pdfStreamWriter.setColorSpace("Device"+this.currentColorSpaces[this.currentColorSpace],!0),this.pdfStreamWriter.setColorSpace("Device"+this.currentColorSpaces[this.currentColorSpace],!1)):(this.pdfStreamWriter.setColorSpace("DeviceGray",!0),this.pdfStreamWriter.setColorSpace("DeviceGray",!1)),this.bCSInitialized=!0)},S.prototype.penControl=function(t,e){null!=t&&((this.currentPen=t).monitorChanges(this.currentPen,this.pdfStreamWriter,this.getResources,e,this.colorSpace,this.matrix.clone()),this.currentPen=t.clone())},S.prototype.brushControl=function(t,e){var i,r,n,o;null!=t&&void 0!==t&&(null==(r=i=t.clone())||t instanceof mt||t instanceof Di||(n=r.matrix,o=this.matrix.clone(),null!=n&&(n.multiply(o),o=n),r.matrix=o),this.currentBrush=r,i.monitorChanges(this.currentBrush,this.pdfStreamWriter,this.getResources,e,this.colorSpace),this.currentBrush=t)},S.prototype.fontControl=function(t,e,i){var r,n;null!=t&&(r=null!=e?e.subSuperScript:K.PdfSubSuperScript.None,n=null!=this.currentStringFormat?this.currentStringFormat.subSuperScript:K.PdfSubSuperScript.None,!i&&t===this.currentFont&&r===n||(i=this.getResources.getResources(),this.currentFont=t,this.currentStringFormat=e,r=t.metrics.getSize(e),this.isEmfTextScaled=!1,n=i.getName(t),this.pdfStreamWriter.setFont(t,n,r)))},S.prototype.setTransparency=function(t,e,i){var r,n;void 0===e?(this.istransparencySet=!0,this.setTransparency(t,t,K.PdfBlendMode.Normal)):"number"==typeof e&&void 0===i?this.setTransparency(t,e,K.PdfBlendMode.Normal):(null==this.trasparencies&&(this.trasparencies=new ae),r=null,n=new zi(t,e,i),null==(r=this.trasparencies.containsKey(n)?this.trasparencies.getValue(n):r)&&(r=new le(t,e,i),this.trasparencies.setValue(n,r)),t=this.getResources.getResources().getName(r),this.streamWriter.setGraphicsState(t))},S.prototype.clipTranslateMargins=function(t,e,i,r,n,o){t instanceof X&&void 0===e?(this.clipBounds=t,this.pdfStreamWriter.writeComment("Clip margins."),this.pdfStreamWriter.appendRectangle(t),this.pdfStreamWriter.closePath(),this.pdfStreamWriter.clipPath(!1),this.pdfStreamWriter.writeComment("Translate co-ordinate system."),this.translateTransform(t.x,t.y)):"number"==typeof t&&(i=new X(i,r,this.size.width-i-n,this.size.height-r-o),this.clipBounds=i,this.pdfStreamWriter.writeComment("Clip margins."),this.pdfStreamWriter.appendRectangle(i),this.pdfStreamWriter.closePath(),this.pdfStreamWriter.clipPath(!1),this.pdfStreamWriter.writeComment("Translate co-ordinate system."),this.translateTransform(t,e))},S.prototype.updateY=function(t){return-t},S.prototype.translateTransform=function(t,e){var i=new ie;this.getTranslateTransform(t,e,i),this.pdfStreamWriter.modifyCtm(i),this.matrix.multiply(i)},S.prototype.getTranslateTransform=function(t,e,i){return i.translate(t,this.updateY(e)),i},S.prototype.scaleTransform=function(t,e){var i=new ie;this.getScaleTransform(t,e,i),this.pdfStreamWriter.modifyCtm(i),this.matrix.multiply(i)},S.prototype.getScaleTransform=function(t,e,i){return(i=null==i?new ie:i).scale(t,e),i},S.prototype.rotateTransform=function(t){var e=new ie;this.getRotateTransform(t,e),this.pdfStreamWriter.modifyCtm(e),this.matrix.multiply(e)},S.prototype.initializeCoordinates=function(){this.pdfStreamWriter.writeComment("Change co-ordinate system to left/top."),this.mediaBoxUpperRightBound!==-this.size.height&&null==this.cropBox&&(this.mediaBoxUpperRightBound===this.size.height||0===this.mediaBoxUpperRightBound?this.translateTransform(0,this.updateY(this.size.height)):this.translateTransform(0,this.updateY(this.mediaBoxUpperRightBound)))},S.prototype.getRotateTransform=function(t,e){return(e=null!=e&&void 0!==e?e:new ie).rotate(this.updateY(t)),e},S.prototype.save=function(){var t=new Ei(this,this.matrix.clone());return t.brush=this.currentBrush,t.pen=this.currentPen,t.font=this.currentFont,t.colorSpace=this.currentColorSpace,t.characterSpacing=this.previousCharacterSpacing,t.wordSpacing=this.previousWordSpacing,t.textScaling=this.previousTextScaling,t.textRenderingMode=this.previousTextRenderingMode,this.graphicsState.push(t),this.pdfStreamWriter.saveGraphicsState(),t},S.prototype.restore=function(t){if(void 0===t)0<this.graphicsState.length&&this.doRestoreState();else if(-1!==this.graphicsState.indexOf(t))for(;0!==this.graphicsState.length;)if(this.doRestoreState()===t)break},S.prototype.doRestoreState=function(){var t=this.graphicsState.pop();return this.transformationMatrix=t.matrix,this.currentBrush=t.brush,this.currentPen=t.pen,this.currentFont=t.font,this.currentColorSpace=t.colorSpace,this.previousCharacterSpacing=t.characterSpacing,this.previousWordSpacing=t.wordSpacing,this.previousTextScaling=t.textScaling,this.previousTextRenderingMode=t.textRenderingMode,this.pdfStreamWriter.restoreGraphicsState(),t},S.prototype.drawPath=function(t,e,i){this._drawPath(t,e,i.pathPoints,i.pathTypes,i.fillMode)},S.prototype._drawPath=function(t,e,i,r,n){e instanceof Di?(this.bCSInitialized=!1,e.graphics.colorSpace=this.colorSpace):e instanceof vi&&(this.bCSInitialized=!1,e.colorSpace=this.colorSpace),this.stateControl(t,e,null),this.buildUpPath(i,r),this.drawPathHelper(t,e,n,!1)},S.prototype.drawArc=function(t,e,i,r,n,o,s){e instanceof X?this.drawArc(t,e.x,e.y,e.width,e.height,i,r):0!==s&&(this.stateControl(t,null,null),this.constructArcPath(e,i,e+r,i+n,o,s),this.drawPathHelper(t,null,!1))},S.prototype.buildUpPath=function(t,e){for(var i=t.length,r=0;r<i;++r){var n,o=t[r];switch(e[r]&S.pathTypesValuesMask){case K.PathPointType.Start:this.pdfStreamWriter.beginPath(o.x,o.y);break;case K.PathPointType.Bezier3:var s=new q(0,0),a=new q(0,0),s=this.getBezierPoints(t,e,r,s,a);this.pdfStreamWriter.appendBezierSegment(o,s.p2,s.p3),r=s.i;break;case K.PathPointType.Line:this.pdfStreamWriter.appendLineSegment(o);break;default:throw new Error("ArithmeticException - Incorrect path formation.")}n=e[r],this.checkFlags(n)}},S.prototype.getBezierPoints=function(t,e,i,r,n){if((e[++i]&S.pathTypesValuesMask)!==K.PathPointType.Bezier3)throw new Error("ArgumentException : errorMsg");if(r=t[i],(e[++i]&S.pathTypesValuesMask)!==K.PathPointType.Bezier3)throw new Error("ArgumentException : errorMsg");return{i:i,p2:r,p3:t[i]}},S.prototype.checkFlags=function(t){(t&K.PathPointType.CloseSubpath)===K.PathPointType.CloseSubpath&&this.pdfStreamWriter.closePath()},S.prototype.constructArcPath=function(t,e,i,r,n,o){var s=this.getBezierArc(t,e,i,r,n,o);if(0!==s.length)for(var a=[s[0],s[1],s[2],s[3],s[4],s[5],s[6],s[7]],h=(this.pdfStreamWriter.beginPath(a[0],a[1]),0),h=0;h<s.length;h+=8)a=[s[h],s[h+1],s[h+2],s[h+3],s[h+4],s[h+5],s[h+6],s[h+7]],this.pdfStreamWriter.appendBezierSegment(a[2],a[3],a[4],a[5],a[6],a[7])},S.prototype.getBezierArc=function(t,e,i,r,n,o){i<t&&(p=void 0,p=t,t=i,i=p),e<r&&(p=void 0,p=e,e=r,r=p),Math.abs(o)<=90?(s=o,a=1):s=o/(a=Math.ceil(Math.abs(o)/90));for(var s,a,h=(t+i)/2,l=(e+r)/2,u=(i-t)/2,c=(r-e)/2,p=s*(Math.PI/360),d=Math.abs(4/3*(1-Math.cos(p))/Math.sin(p)),f=[],g=0;g<a;g++){var m=(n+g*s)*(Math.PI/180),y=(n+(g+1)*s)*(Math.PI/180),b=Math.cos(m),w=Math.cos(y),m=Math.sin(m),y=Math.sin(y);0<s?f.push(h+u*b,l-c*m,h+u*(b-d*m),l-c*(m+d*b),h+u*(w+d*y),l-c*(y-d*w),h+u*w,l-c*y):f.push(h+u*b,l-c*m,h+u*(b+d*m),l-c*(m-d*b),h+u*(w-d*y),l-c*(y+d*w),h+u*w,l-c*y)}return f},S.pathTypesValuesMask=15,S.transparencyObject=!1;var Ai=S;function S(t,e,i){this.currentColorSpace=K.PdfColorSpace.Rgb,this.previousTextRenderingMode=K.TextRenderingMode.Fill,this.previousCharacterSpacing=0,this.previousWordSpacing=0,this.previousTextScaling=100,this.procedureSets=new se,this.isNormalRender=!0,this.isUseFontSize=!1,this.isItalic=!1,this.isEmfTextScaled=!1,this.isEmf=!1,this.isEmfPlus=!1,this.isBaselineFormat=!0,this.emfScalingFactor=new Y(0,0),this.colorSpaceChanged=!1,this.dictionaryProperties=new l,this.isOverloadWithPosition=!1,this.isPointOverload=!1,this.currentColorSpaces=["RGB","CMYK","GrayScale","Indexed"],this.isImageOptimized=!1,this.graphicsState=[],this.istransparencySet=!1,this.internalAutomaticFields=null,this.startCutIndex=-1,this.getResources=e,this.canvasSize=t,i instanceof Qt?this.pdfStreamWriter=i:this.pdfStreamWriter=new Qt(i),this.initialize()}Fi.prototype.getResources=function(){return this.sender.getResources()};var Ii=Fi;function Fi(t){this.sender=t}Object.defineProperty(Gi.prototype,"graphics",{get:function(){return this.pdfGraphics},enumerable:!0,configurable:!0}),Object.defineProperty(Gi.prototype,"matrix",{get:function(){return this.transformationMatrix},enumerable:!0,configurable:!0}),Object.defineProperty(Gi.prototype,"characterSpacing",{get:function(){return this.internalCharacterSpacing},set:function(t){this.internalCharacterSpacing=t},enumerable:!0,configurable:!0}),Object.defineProperty(Gi.prototype,"wordSpacing",{get:function(){return this.internalWordSpacing},set:function(t){this.internalWordSpacing=t},enumerable:!0,configurable:!0}),Object.defineProperty(Gi.prototype,"textScaling",{get:function(){return this.internalTextScaling},set:function(t){this.internalTextScaling=t},enumerable:!0,configurable:!0}),Object.defineProperty(Gi.prototype,"pen",{get:function(){return this.pdfPen},set:function(t){this.pdfPen=t},enumerable:!0,configurable:!0}),Object.defineProperty(Gi.prototype,"brush",{get:function(){return this.pdfBrush},set:function(t){this.pdfBrush=t},enumerable:!0,configurable:!0}),Object.defineProperty(Gi.prototype,"font",{get:function(){return this.pdfFont},set:function(t){this.pdfFont=t},enumerable:!0,configurable:!0}),Object.defineProperty(Gi.prototype,"colorSpace",{get:function(){return this.pdfColorSpace},set:function(t){this.pdfColorSpace=t},enumerable:!0,configurable:!0}),Object.defineProperty(Gi.prototype,"textRenderingMode",{get:function(){return this.internalTextRenderingMode},set:function(t){this.internalTextRenderingMode=t},enumerable:!0,configurable:!0});var Ei=Gi;function Gi(t,e){var i;this.internalTextRenderingMode=K.TextRenderingMode.Fill,this.internalCharacterSpacing=0,this.internalWordSpacing=0,this.internalTextScaling=100,this.pdfColorSpace=K.PdfColorSpace.Rgb,void 0!==t&&(this.pdfGraphics=t,i=[],t.matrix.matrix.elements.forEach(function(t){i.push(t)}),this.transformationMatrix=new ie,this.transformationMatrix.matrix=new ne(i))}var zi=function(t,e,i){this.alphaPen=t,this.alphaBrush=e,this.blendMode=i},Wi=(Object.defineProperty(_i.prototype,"colorSpace",{get:function(){return this.pdfColorSpace},set:function(t){this.pdfColorSpace=t},enumerable:!0,configurable:!0}),Object.defineProperty(_i.prototype,"page",{get:function(){return this.pdfPage},enumerable:!0,configurable:!0}),Object.defineProperty(_i.prototype,"layerId",{get:function(){return this.layerid},set:function(t){this.layerid=t},enumerable:!0,configurable:!0}),Object.defineProperty(_i.prototype,"name",{get:function(){return this.layerName},set:function(t){this.layerName=t},enumerable:!0,configurable:!0}),Object.defineProperty(_i.prototype,"visible",{get:function(){return this.isVisible},set:function(t){this.isVisible=t},enumerable:!0,configurable:!0}),Object.defineProperty(_i.prototype,"graphics",{get:function(){return null==this.pdfGraphics&&this.initializeGraphics(this.page),this.pdfGraphics},enumerable:!0,configurable:!0}),Object.defineProperty(_i.prototype,"layers",{get:function(){return null==this.layer&&(this.layer=new qi(this.page),this.layer.sublayer=!0),this.layer},enumerable:!0,configurable:!0}),_i.prototype.add=function(){var t=new _i(this.pdfPage);return t.name="",t},_i.prototype.sign=function(t){return 0===t?0:0<t?1:-1},_i.prototype.initializeGraphics=function(t){var e=t,i=new Ii(this.page),i=(this.pdfGraphics=new Ai(t.size,i,this.content),this.pdfGraphics.mediaBoxUpperRightBound=0,null!=e&&null!=(i=e.section.parent)&&(this.pdfGraphics.colorSpace=i.document.colorSpace,this.colorSpace=i.document.colorSpace),this.sign(t.origin.y)===this.sign(t.origin.x)),i=((0<=t.origin.x&&0<=t.origin.y||!i)&&this.pdfGraphics.initializeCoordinates(),e.section.getActualBounds(e,!0)),e=e.section.pageSettings.margins;this.clipPageTemplates?0<=t.origin.x&&0<=t.origin.y&&this.pdfGraphics.clipTranslateMargins(i):this.graphics.clipTranslateMargins(i.x,i.y,e.left,e.top,e.right,e.bottom),this.pdfGraphics.setLayer(this)},Object.defineProperty(_i.prototype,"element",{get:function(){return this.content},enumerable:!0,configurable:!0}),_i);function _i(t,e){if(this.pdfColorSpace=K.PdfColorSpace.Rgb,this.isVisible=!0,this.sublayer=!1,this.contentLength=0,this.dictionaryProperties=new l,null===t)throw new Error("ArgumentNullException:page");if(this.pdfPage=t,this.clipPageTemplates=!0,void 0===e)this.content=new U;else if(e instanceof U||null===e){if(null===e)throw new Error("ArgumentNullException:stream");this.content=e}else this.content=new U,this.clipPageTemplates=e}Object.defineProperty(Hi.prototype,"count",{get:function(){return void 0===this.collection&&(this.collection=[]),this.collection.length},enumerable:!0,configurable:!0}),Object.defineProperty(Hi.prototype,"list",{get:function(){return void 0===this.collection&&(this.collection=[]),this.collection},enumerable:!0,configurable:!0});w=Hi;function Hi(){}Ui=function(t,e){return(Ui=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}Ui(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(Yi,Ki=w),Yi.prototype.items=function(t,e){if("number"==typeof t&&void 0===e)return this.list[t];if(null==e)throw new Error("ArgumentNullException: layer");if(e.page!==this.page)throw new Error("ArgumentException: The layer belongs to another page")},Yi.prototype.add=function(t,e){var i;return void 0===t?((i=new Wi(this.page)).name="",this.add(i),i):t instanceof Wi?(i=this.list.push(t),this.addLayer(i,t),i):0},Yi.prototype.addLayer=function(t,e){e=new d(e);this.page.contents.add(e)},Yi.prototype.insert=function(t,e){for(var i=[],r=this.list.length,n=t;n<r;n++)i.push(this.list.pop());this.list.push(e);for(n=0;n<i.length;n++)this.list.push(i[n]);this.insertLayer(t,e)},Yi.prototype.insertLayer=function(t,e){if(null==e)throw new Error("ArgumentNullException:layer");e=new d(e);this.page.contents.insert(t,e)},Yi.prototype.parseLayers=function(t){var e=this.page.contents,t=(this.page.getResources(),t.crossTable,new U),i=new U,r=[];r.push("q"),t.data=r,e.insert(0,new d(t)),(r=[]).push("Q"),i.data=r,e.insert(e.count,new d(i))},Yi.prototype.indexOf=function(t){if(null==t)throw new Error("ArgumentNullException: layer");return this.list.indexOf(t)};var Ui,Ki,qi=Yi;function Yi(t){var e=Ki.call(this)||this;return e.parentLayerCount=0,e.sublayer=!1,e.optionalContent=new c,t instanceof Xi&&(e.page=t,e.parseLayers(t)),e}Object.defineProperty(Ji.prototype,"section",{get:function(){return this.pdfSection},set:function(t){this.pdfSection=t},enumerable:!0,configurable:!0}),Object.defineProperty(Ji.prototype,"dictionary",{get:function(){return this.pageDictionary},enumerable:!0,configurable:!0}),Object.defineProperty(Ji.prototype,"element",{get:function(){return this.pageDictionary},enumerable:!0,configurable:!0}),Object.defineProperty(Ji.prototype,"defaultLayer",{get:function(){var t=this.layers,e=this.defaultLayerIndex;return t.items(e)},enumerable:!0,configurable:!0}),Object.defineProperty(Ji.prototype,"defaultLayerIndex",{get:function(){var t;return 0!==this.layerCollection.count&&-1!==this.defLayerIndex||(t=this.layerCollection.add(),this.defLayerIndex=this.layerCollection.indexOf(t)),this.defLayerIndex},set:function(t){if(t<0||t>this.layers.count-1)throw new Error("ArgumentOutOfRangeException : value, Index can not be less 0 and greater Layers.Count - 1");this.defLayerIndex=t,this.modified=!0},enumerable:!0,configurable:!0}),Object.defineProperty(Ji.prototype,"layers",{get:function(){return null!=this.layerCollection&&void 0!==this.layerCollection||(this.layerCollection=new qi(this)),this.layerCollection},enumerable:!0,configurable:!0}),Ji.prototype.getResources=function(){return null==this.resources&&(this.resources=new Ti,this.dictionary.items.setValue(this.dictionaryProperties.resources,this.resources)),this.resources},Object.defineProperty(Ji.prototype,"contents",{get:function(){var t=this.pageDictionary.items.getValue(this.dictionaryProperties.contents);return null==t&&(t=new p,this.pageDictionary.items.setValue(this.dictionaryProperties.contents,t)),t},enumerable:!0,configurable:!0}),Ji.prototype.setResources=function(t){this.resources=t,this.dictionary.items.setValue(this.dictionaryProperties.resources,this.resources),this.modified=!0};var Xi=Ji;function Ji(t){this.defLayerIndex=-1,this.modified=!1,this.dictionaryProperties=new l,this.pageDictionary=t}Object.defineProperty($i.prototype,"annotations",{get:function(){return this.internalAnnotations},set:function(t){this.internalAnnotations=t},enumerable:!0,configurable:!0}),$i.prototype.add=function(t){this.doAdd(t)},$i.prototype.doAdd=function(t){if(void 0===t.destination)return t.setPage(this.page),this.internalAnnotations.add(new d(t)),this.lists.push(t);var e=(new vt).layout(t.text,t.font,t.stringFormat,new Y(t.bounds.width,0),!1,new Y(0,0)),i=t.bounds.y;if(1===e.lines.length){var r=t.font.measureString(e.lines[0].text);t.bounds=new X(new q(t.bounds.x,i),r),t.text=e.lines[0].text,this.page.graphics.drawString(t.text,t.font,null,t.brush,t.bounds.x,t.bounds.y,t.bounds.width,t.bounds.height,null),t.setPage(this.page),this.setColor(t),this.internalAnnotations.add(new d(t)),this.lists.push(t)}else for(var n=0;n<e.lines.length;n++){var o,r=t.font.measureString(e.lines[n].text);0===n?(t.bounds=new X(t.bounds.x,i,r.width,r.height),t.text=e.lines[n].text,this.page.graphics.drawString(t.text,t.font,null,t.brush,t.bounds.x,i,r.width,r.height,null),t.setPage(this.page),this.setColor(t),this.internalAnnotations.add(new d(t)),this.lists.push(t),i+=t.bounds.height):((o=t.clone()).bounds=new X(new q(t.bounds.x,i),r),o.text=e.lines[n].text,this.page.graphics.drawString(o.text,o.font,null,o.brush,o.bounds.x,o.bounds.y,o.bounds.width,o.bounds.height,null),o.setPage(this.page),this.setColor(o),this.internalAnnotations.add(new d(o)),this.lists.push(o),i+=o.bounds.height)}},$i.prototype.setColor=function(t){var e=K.PdfColorSpace.Rgb,e=t.color.toArray(e);t.dictionary.items.setValue(this.dictionaryProperties.c,e)},Object.defineProperty($i.prototype,"element",{get:function(){return this.internalAnnotations},enumerable:!0,configurable:!0});var Zi=$i;function $i(t){this.alreadyExistsAnnotationError="This annotatation had been already added to page",this.missingAnnotationException="Annotation is not contained in collection.",this.dictionaryProperties=new l,this.internalAnnotations=new p,this.lists=[],void 0!==t&&(this.page=t)}Qi=function(t,e){return(Qi=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}Qi(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(ir,tr=Xi),Object.defineProperty(ir.prototype,"document",{get:function(){return null!==this.section&&null!==this.section.parent?this.section.parent.document:null},enumerable:!0,configurable:!0}),Object.defineProperty(ir.prototype,"graphics",{get:function(){var t=this.defaultLayer.graphics;return t.currentPage=this,t},enumerable:!0,configurable:!0}),Object.defineProperty(ir.prototype,"crossTable",{get:function(){if(null===this.section)throw new Error("PdfDocumentException : Page is not created");return(null===this.section.parent?this.section.parentDocument:this.section.parent.document).crossTable},enumerable:!0,configurable:!0}),Object.defineProperty(ir.prototype,"size",{get:function(){return this.section.pageSettings.size},enumerable:!0,configurable:!0}),Object.defineProperty(ir.prototype,"origin",{get:function(){return this.section.pageSettings.origin},enumerable:!0,configurable:!0}),Object.defineProperty(ir.prototype,"annotations",{get:function(){return null==this.annotationCollection&&(this.annotationCollection=new Zi(this),this.dictionary.items.setValue(this.dictionaryProperties.annots,this.annotationCollection.element),this.annotationCollection.annotations=this.dictionary.items.getValue(this.dictionaryProperties.annots)),this.annotationCollection},enumerable:!0,configurable:!0}),ir.prototype.initialize=function(){this.dictionary.items.setValue(this.dictionaryProperties.type,new o("Page")),this.dictionary.pageBeginDrawTemplate=new z(this)},ir.prototype.setSection=function(t){this.section=t,this.dictionary.items.setValue(this.dictionaryProperties.parent,new d(t))},ir.prototype.resetProgress=function(){this.isProgressOn=!1},ir.prototype.getClientSize=function(){var t=this.section.getActualBounds(this,!0);return new Y(t.width,t.height)},ir.prototype.pageBeginSave=function(){var t=this.document;null!=t&&this.drawPageTemplates(t),null!=this.beginSave&&void 0!==this.beginSave&&this.beginSave(this)},ir.prototype.drawPageTemplates=function(t){var e;if(this.section.containsTemplates(t,this,!1)){var i=new Wi(this,!1);if(this.layers.insert(0,i),this.section.drawTemplates(this,i,t,!1),null!==i.graphics&&void 0!==i.graphics)for(var r=0;r<i.graphics.automaticFields.automaticFields.length;r++){var n=i.graphics.automaticFields.automaticFields[r];n.field.performDraw(i.graphics,n.location,n.scalingX,n.scalingY)}}this.section.containsTemplates(t,this,!0)&&(e=new Wi(this,!1),this.layers.add(e),this.section.drawTemplates(this,e,t,!0))};var Qi,tr,er=ir;function ir(){var t=tr.call(this,new c)||this;return t.annotationCollection=null,t.beginSave=null,t.initialize(),t}Object.defineProperty(nr.prototype,"page",{get:function(){return this.pdfPage},enumerable:!0,configurable:!0});var rr=nr;function nr(t){this.pdfPage=void 0!==t?t:null}Object.defineProperty(sr.prototype,"section",{get:function(){return this.pdfSection},set:function(t){this.pdfSection=t},enumerable:!0,configurable:!0}),sr.prototype.contains=function(t){return this.section.contains(t)},sr.prototype.remove=function(t){this.section.remove(t)},sr.prototype.add=function(){return this.section.add()};var or=sr;function sr(t){if((this.pdfSection=null)==t)throw Error('ArgumentNullException("section")');this.section=t}Object.defineProperty(hr.prototype,"left",{get:function(){return this.leftTemplate},set:function(t){this.leftTemplate=this.checkElement(t,K.TemplateType.Left)},enumerable:!0,configurable:!0}),Object.defineProperty(hr.prototype,"top",{get:function(){return this.topTemplate},set:function(t){this.topTemplate=this.checkElement(t,K.TemplateType.Top)},enumerable:!0,configurable:!0}),Object.defineProperty(hr.prototype,"right",{get:function(){return this.rightTemplate},set:function(t){this.rightTemplate=this.checkElement(t,K.TemplateType.Right)},enumerable:!0,configurable:!0}),Object.defineProperty(hr.prototype,"bottom",{get:function(){return this.bottomTemplate},set:function(t){this.bottomTemplate=this.checkElement(t,K.TemplateType.Bottom)},enumerable:!0,configurable:!0}),Object.defineProperty(hr.prototype,"EvenLeft",{get:function(){return this.evenLeft},set:function(t){this.evenLeft=this.checkElement(t,K.TemplateType.Left)},enumerable:!0,configurable:!0}),Object.defineProperty(hr.prototype,"EvenTop",{get:function(){return this.evenTop},set:function(t){this.evenTop=this.checkElement(t,K.TemplateType.Top)},enumerable:!0,configurable:!0}),Object.defineProperty(hr.prototype,"EvenRight",{get:function(){return this.evenRight},set:function(t){this.evenRight=this.checkElement(t,K.TemplateType.Right)},enumerable:!0,configurable:!0}),Object.defineProperty(hr.prototype,"EvenBottom",{get:function(){return this.evenBottom},set:function(t){this.evenBottom=this.checkElement(t,K.TemplateType.Bottom)},enumerable:!0,configurable:!0}),Object.defineProperty(hr.prototype,"OddLeft",{get:function(){return this.oddLeft},set:function(t){this.oddLeft=this.checkElement(t,K.TemplateType.Left)},enumerable:!0,configurable:!0}),Object.defineProperty(hr.prototype,"OddTop",{get:function(){return this.oddTop},set:function(t){this.oddTop=this.checkElement(t,K.TemplateType.Top)},enumerable:!0,configurable:!0}),Object.defineProperty(hr.prototype,"OddRight",{get:function(){return this.oddRight},set:function(t){this.oddRight=this.checkElement(t,K.TemplateType.Right)},enumerable:!0,configurable:!0}),Object.defineProperty(hr.prototype,"OddBottom",{get:function(){return this.oddBottom},set:function(t){this.oddBottom=this.checkElement(t,K.TemplateType.Bottom)},enumerable:!0,configurable:!0}),hr.prototype.getLeft=function(t){if(null==t)throw new Error("ArgumentNullException:page");return this.isEven(t)?null!=this.EvenLeft?this.EvenLeft:this.left:null!=this.OddLeft?this.OddLeft:this.left},hr.prototype.getTop=function(t){if(null==t)throw new Error("ArgumentNullException:page");return this.isEven(t)?null!=this.EvenTop?this.EvenTop:this.top:null!=this.OddTop?this.OddTop:this.top},hr.prototype.getRight=function(t){if(null==t)throw new Error("ArgumentNullException:page");return this.isEven(t)?null!=this.EvenRight?this.EvenRight:this.right:null!=this.OddRight?this.OddRight:this.right},hr.prototype.getBottom=function(t){if(null==t)throw new Error("ArgumentNullException:page");return this.isEven(t)?null!=this.EvenBottom?this.EvenBottom:this.bottom:null!=this.OddBottom?this.OddBottom:this.bottom},hr.prototype.isEven=function(t){var e=t.section.document.pages;return(e.pageCollectionIndex.containsKey(t)?e.pageCollectionIndex.getValue(t)+1:e.indexOf(t)+1)%2==0},hr.prototype.checkElement=function(t,e){if(null!=t){if(void 0!==t.type&&t.type!==K.TemplateType.None)throw new Error("NotSupportedException:Can not reassign the template element. Please, create new one.");t.type=e}return t};var ar=hr;function hr(){}lr=function(t,e){return(lr=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}lr(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(pr,ur=ar),Object.defineProperty(pr.prototype,"applyDocumentLeftTemplate",{get:function(){return this.leftValue},set:function(t){this.leftValue=t},enumerable:!0,configurable:!0}),Object.defineProperty(pr.prototype,"applyDocumentTopTemplate",{get:function(){return this.topValue},set:function(t){this.topValue=t},enumerable:!0,configurable:!0}),Object.defineProperty(pr.prototype,"applyDocumentRightTemplate",{get:function(){return this.rightValue},set:function(t){this.rightValue=t},enumerable:!0,configurable:!0}),Object.defineProperty(pr.prototype,"applyDocumentBottomTemplate",{get:function(){return this.bottomValue},set:function(t){this.bottomValue=t},enumerable:!0,configurable:!0}),Object.defineProperty(pr.prototype,"applyDocumentStamps",{get:function(){return this.stampValue},set:function(t){this.stampValue=t},enumerable:!0,configurable:!0});var lr,ur,cr=pr;function pr(){var t=ur.call(this)||this;return t.leftValue=t.topValue=t.rightValue=t.bottomValue=t.stampValue=!0,t}Object.defineProperty(v.prototype,"parent",{get:function(){return this.sectionCollection},set:function(t){this.sectionCollection=t,this.section.items.setValue(this.dictionaryProperties.parent,new d(t))},enumerable:!0,configurable:!0}),Object.defineProperty(v.prototype,"parentDocument",{get:function(){return this.pdfDocument},enumerable:!0,configurable:!0}),Object.defineProperty(v.prototype,"pageSettings",{get:function(){return this.settings},set:function(t){if(null==t)throw Error("Value can not be null.");this.settings=t},enumerable:!0,configurable:!0}),Object.defineProperty(v.prototype,"element",{get:function(){return this.section},enumerable:!0,configurable:!0}),Object.defineProperty(v.prototype,"count",{get:function(){return this.pagesReferences.count},enumerable:!0,configurable:!0}),Object.defineProperty(v.prototype,"template",{get:function(){return null==this.pageTemplate&&(this.pageTemplate=new cr),this.pageTemplate},set:function(t){this.pageTemplate=t},enumerable:!0,configurable:!0}),Object.defineProperty(v.prototype,"document",{get:function(){return this.sectionCollection.document},enumerable:!0,configurable:!0}),Object.defineProperty(v.prototype,"pages",{get:function(){return null!=this.pagesCollection&&void 0!==this.pagesCollection||(this.pagesCollection=new or(this)),this.pagesCollection},enumerable:!0,configurable:!0}),v.prototype.getPages=function(){return this.pdfPages},v.prototype.pointToNativePdf=function(t,e){t=this.getActualBounds(t,!0);return e.x+=t.x,e.y=this.pageSettings.height-e.y,e},v.prototype.setPageSettings=function(t){this.settings=t,this.state.orientation=t.orientation,this.state.rotate=t.rotate,this.state.size=t.size,this.state.origin=t.origin},v.prototype.initialize=function(){this.pagesReferences=new p,this.section=new c,this.state=new fr(this.pdfDocument),this.section.sectionBeginSave=new G(this,this.state),this.pageCount=new u(0),this.section.items.setValue(this.dictionaryProperties.count,this.pageCount),this.section.items.setValue(this.dictionaryProperties.type,new o(this.dictionaryProperties.pages)),this.section.items.setValue(this.dictionaryProperties.kids,this.pagesReferences)},v.prototype.containsTemplates=function(t,e,i){t=this.getDocumentTemplates(t,e,i),e=this.getSectionTemplates(e,i);return 0<t.length||0<e.length},v.prototype.getDocumentTemplates=function(t,e,i){var r=[];return this.template.applyDocumentTopTemplate&&null!=t.template.getTop(e)&&(!t.template.getTop(e).foreground&&!i||t.template.getTop(e).foreground&&i)&&r.push(t.template.getTop(e)),this.template.applyDocumentBottomTemplate&&null!=t.template.getBottom(e)&&(!t.template.getBottom(e).foreground&&!i||t.template.getBottom(e).foreground&&i)&&r.push(t.template.getBottom(e)),this.template.applyDocumentLeftTemplate&&null!=t.template.getLeft(e)&&(!t.template.getLeft(e).foreground&&!i||t.template.getLeft(e).foreground&&i)&&r.push(t.template.getLeft(e)),this.template.applyDocumentRightTemplate&&null!=t.template.getRight(e)&&(!t.template.getRight(e).foreground&&!i||t.template.getRight(e).foreground&&i)&&r.push(t.template.getRight(e)),r},v.prototype.getSectionTemplates=function(t,e){var i,r=[];return null!=this.template.getTop(t)&&(!(i=this.template.getTop(t)).foreground&&!e||i.foreground&&e)&&r.push(i),null!=this.template.getBottom(t)&&(!(i=this.template.getBottom(t)).foreground&&!e||i.foreground&&e)&&r.push(i),null!=this.template.getLeft(t)&&(!(i=this.template.getLeft(t)).foreground&&!e||i.foreground&&e)&&r.push(i),null!=this.template.getRight(t)&&(!(i=this.template.getRight(t)).foreground&&!e||i.foreground&&e)&&r.push(i),r},v.prototype.add=function(t){var e;if(void 0===t)return e=new er,this.add(e),e;e=this.checkPresence(t),this.pdfPages.push(t),this.pagesReferences.add(e),t.setSection(this),t.resetProgress(),this.pageAddedMethod(t)},v.prototype.checkPresence=function(t){for(var e=new d(t),i=!1,r=this.parent,n=0;n<r.section.length;n++)var o=r.section[n],i=i||o.contains(t);return e},v.prototype.contains=function(t){return 0<=this.indexOf(t)},v.prototype.indexOf=function(t){for(var e=0;e<this.pdfPages.length;e++)if(this.pdfPages[e]===t)return this.pdfPages.indexOf(t);var i=new d(t);return this.pagesReferences.indexOf(i)},v.prototype.pageAddedMethod=function(t){t=new rr(t);this.onPageAdded(t),this.parent.document.pages.onPageAdded(t),this.pageCount.intValue=this.count},v.prototype.onPageAdded=function(t){},v.prototype.getActualBounds=function(t,e,i){var r,n,o,s;return t instanceof er&&"boolean"==typeof e?(r=this.parent.document,this.getActualBounds(r,t,e)):((r=new X(0,0,0,0)).height=(i?this.pageSettings.size:this.pageSettings.getActualSize()).height,r.width=(i?this.pageSettings.size:this.pageSettings.getActualSize()).width,n=this.getLeftIndentWidth(t,e,i),o=this.getTopIndentHeight(t,e,i),s=this.getRightIndentWidth(t,e,i),t=this.getBottomIndentHeight(t,e,i),r.x+=n,r.y+=o,r.width-=n+s,r.height-=o+t,r)},v.prototype.getLeftIndentWidth=function(t,e,i){if(null==t)throw new Error("ArgumentNullException:document");if(null==e)throw new Error("ArgumentNullException:page");var i=i?this.pageSettings.margins.left:0,r=null!=this.template.getLeft(e)?this.template.getLeft(e).width:0,t=null!=t.template.getLeft(e)?t.template.getLeft(e).width:0;return i+=this.template.applyDocumentLeftTemplate?Math.max(r,t):r},v.prototype.getTopIndentHeight=function(t,e,i){if(null==t)throw new Error("ArgumentNullException:document");if(null==e)throw new Error("ArgumentNullException:page");var i=i?this.pageSettings.margins.top:0,r=null!=this.template.getTop(e)?this.template.getTop(e).height:0,t=null!=t.template.getTop(e)?t.template.getTop(e).height:0;return i+=this.template.applyDocumentTopTemplate?Math.max(r,t):r},v.prototype.getRightIndentWidth=function(t,e,i){if(null==t)throw new Error("ArgumentNullException:document");if(null==e)throw new Error("ArgumentNullException:page");var i=i?this.pageSettings.margins.right:0,r=null!=this.template.getRight(e)?this.template.getRight(e).width:0,t=null!=t.template.getRight(e)?t.template.getRight(e).width:0;return i+=this.template.applyDocumentRightTemplate?Math.max(r,t):r},v.prototype.getBottomIndentHeight=function(t,e,i){if(null==t)throw new Error("ArgumentNullException:document");if(null==e)throw new Error("ArgumentNullException:page");var i=i?this.pageSettings.margins.bottom:0,r=null!=this.template.getBottom(e)?this.template.getBottom(e).height:0,t=null!=t.template.getBottom(e)?t.template.getBottom(e).height:0;return i+=this.template.applyDocumentBottomTemplate?Math.max(r,t):r},v.prototype.remove=function(t){if(null==t)throw Error('ArgumentNullException("page")');for(var e=this.pdfPages.indexOf(t),i=(this.pagesReferences.removeAt(e),[]),r=0;r<e;r++)i.push(this.pdfPages[r]);for(r=e+1;r<this.pdfPages.length;r++)i.push(this.pdfPages[r]);this.pdfPages=i},v.prototype.applyPageSettings=function(t,e,i){var r=new X(i.origin,i.size),r=(t.items.setValue(this.dictionaryProperties.mediaBox,p.fromRectangle(r)),mr.rotateFactor*i.rotate),i=new u(r);t.items.setValue(this.dictionaryProperties.rotate,i)},v.prototype.beginSave=function(t,e){e=e.document;this.applyPageSettings(this.section,e.pageSettings,t)},v.prototype.drawTemplates=function(t,e,i,r){var n=this.getDocumentTemplates(i,t,r),t=this.getSectionTemplates(t,r);this.drawTemplatesHelper(e,i,n),this.drawTemplatesHelper(e,i,t)},v.prototype.drawTemplatesHelper=function(t,e,i){if(null!=i&&0<i.length)for(var r=i.length,n=0;n<r;n++)i[n].draw(t,e)};var dr=v;function v(t,e){this.pageAdded=new rr,this.pdfPages=[],this.dictionaryProperties=new l,this.pdfDocument=t,this.settings=(void 0===e?t.pageSettings:e).clone(),this.initialSettings=this.settings.clone(),this.initialize()}Object.defineProperty(gr.prototype,"orientation",{get:function(){return this.pageOrientation},set:function(t){this.pageOrientation=t},enumerable:!0,configurable:!0}),Object.defineProperty(gr.prototype,"rotate",{get:function(){return this.pageRotate},set:function(t){this.pageRotate=t},enumerable:!0,configurable:!0}),Object.defineProperty(gr.prototype,"size",{get:function(){return this.pageSize},set:function(t){this.pageSize=t},enumerable:!0,configurable:!0}),Object.defineProperty(gr.prototype,"origin",{get:function(){return this.pageOrigin},set:function(t){this.pageOrigin=t},enumerable:!0,configurable:!0});var fr=gr;function gr(t){this.pageOrientation=t.pageSettings.orientation,this.pageRotate=t.pageSettings.rotate,this.pageSize=t.pageSettings.size,this.pageOrigin=t.pageSettings.origin}Object.defineProperty(yr.prototype,"section",{get:function(){return this.sections},enumerable:!0,configurable:!0}),Object.defineProperty(yr.prototype,"document",{get:function(){return this.pdfDocument},enumerable:!0,configurable:!0}),Object.defineProperty(yr.prototype,"count",{get:function(){return this.sections.length},enumerable:!0,configurable:!0}),Object.defineProperty(yr.prototype,"element",{get:function(){return this.pages},enumerable:!0,configurable:!0}),yr.prototype.initialize=function(){this.sectionCount=new u(0),this.sectionCollection=new p,this.pages=new c,this.pages.beginSave=new A(this),this.pages.items.setValue(this.dictionaryProperties.type,new o("Pages")),this.pages.items.setValue(this.dictionaryProperties.kids,this.sectionCollection),this.pages.items.setValue(this.dictionaryProperties.count,this.sectionCount),this.pages.items.setValue(this.dictionaryProperties.resources,new c),this.setPageSettings(this.pages,this.pdfDocument.pageSettings)},yr.prototype.pdfSectionCollection=function(t){if(t<0||t>=this.count)throw new Error("IndexOutOfRangeException()");return this.sections[t]},yr.prototype.setPageSettings=function(t,e){e=new X(new q,e.size);t.items.setValue(this.dictionaryProperties.mediaBox,p.fromRectangle(e))},yr.prototype.add=function(t){var e;return void 0===t?(e=new dr(this.pdfDocument),this.add(e),e):(e=this.checkSection(t),this.sections.push(t),(t.parent=this).sectionCollection.add(e),this.sections.indexOf(t))},yr.prototype.checkSection=function(t){t=new d(t);this.sectionCollection.contains(t);return t},yr.prototype.countPages=function(){var e=0;return this.sections.forEach(function(t){return e+=t.count}),e},yr.prototype.beginSave=function(){this.sectionCount.intValue=this.countPages()},yr.rotateFactor=90;var mr=yr;function yr(t){this.sections=[],this.dictionaryProperties=new l,this.pdfDocument=t.clone(),this.initialize()}Object.defineProperty(wr.prototype,"count",{get:function(){return this.countPages()},enumerable:!0,configurable:!0}),Object.defineProperty(wr.prototype,"pageCollectionIndex",{get:function(){return this.pdfPageCollectionIndex},enumerable:!0,configurable:!0}),wr.prototype.add=function(t){var e;if(void 0===t)return e=new er,this.add(e),e;this.getLastSection().add(t)},wr.prototype.getLastSection=function(){var t=this.document.sections;return 0===t.section.length&&t.add(),t.section[t.section.length-1]},wr.prototype.onPageAdded=function(t){},wr.prototype.countPages=function(){for(var t=this.document.sections,e=0,i=0;i<t.section.length;i++)e+=t.section[i].count;return e},wr.prototype.getPageByIndex=function(t){return this.getPage(t)},wr.prototype.getPage=function(t){if(t<0||t>=this.count)throw Error('ArgumentOutOfRangeException("index", "Value can not be less 0")');for(var e=null,i=0,r=this.document.sections.count,n=0;n<r;n++){var o=this.document.sections.section[n],s=o.count,a=t-i;if(i<=t&&a<s){e=o.getPages()[a];break}i+=s}return e},wr.prototype.indexOf=function(t){var e=-1;if(null==t)throw new Error("ArgumentNullException: page");for(var i=0,r=0,n=this.document.sections.count;r<n;r++){var o=this.document.sections.pdfSectionCollection(r);if(0<=(e=o.indexOf(t))){e+=i;break}e=-1,i+=o.count}return e},wr.prototype.remove=function(t){if(null==t)throw Error('ArgumentNullException("page")');for(var e=null,i=0,r=this.document.sections.count;i<r;i++)if((e=this.document.sections.pdfSectionCollection(i)).pages.contains(t)){e.pages.remove(t);break}return e};var br=wr;function wr(t){this.pdfPageCollectionIndex=new a,this.document=t}Sr.prototype.search=function(t){var e=null,i=this.getGroup(t);return null==i?i=this.createNewGroup():0<i.length&&(e=i[0]),i.push(t),e},Sr.prototype.createNewGroup=function(){var t=[];return this.referenceObjects.push(t),t},Sr.prototype.getGroup=function(t){var e=null;if(null!==t)for(var i=this.referenceObjects.length,r=0;r<i;r++){if(0<this.referenceObjects.length){var n=this.referenceObjects[r];if(0<n.length){var o=n[0];if(t.equalsTo(o)){e=n;break}}else this.removeGroup(n)}i=this.referenceObjects.length}return e},Sr.prototype.removeGroup=function(t){null!==t&&(t=this.referenceObjects.indexOf(t),this.referenceObjects.slice(t,t+1))},Sr.prototype.destroy=function(){this.pdfFontCollection=void 0,this.referenceObjects=void 0};var Pr=Sr;function Sr(){this.referenceObjects=[],this.pdfFontCollection=new a}vr=function(t,e){return(vr=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}vr(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(Or,Cr=i),Object.defineProperty(Or,"defaultFont",{get:function(){return null==this.defaultStandardFont&&(this.defaultStandardFont=new jr(K.PdfFontFamily.Helvetica,8)),this.defaultStandardFont},enumerable:!0,configurable:!0}),Object.defineProperty(Or.prototype,"sections",{get:function(){return this.sectionCollection},enumerable:!0,configurable:!0}),Object.defineProperty(Or.prototype,"pageSettings",{get:function(){return null==this.settings&&(this.settings=new Zt(this.defaultMargin)),this.settings},set:function(t){this.settings=t},enumerable:!0,configurable:!0}),Object.defineProperty(Or.prototype,"pages",{get:function(){return this.documentPageCollection},enumerable:!0,configurable:!0}),Object.defineProperty(Or,"cache",{get:function(){return void 0===Or.cacheCollection||null==Or.cacheCollection?new Pr:Or.cacheCollection},set:function(t){this.cacheCollection=t},enumerable:!0,configurable:!0}),Object.defineProperty(Or,"enableCache",{get:function(){return this.isCacheEnabled},set:function(t){this.isCacheEnabled=t},enumerable:!0,configurable:!0}),Object.defineProperty(Or.prototype,"colorSpace",{get:function(){return this.pdfColorSpace===K.PdfColorSpace.Rgb||this.pdfColorSpace===K.PdfColorSpace.Cmyk||this.pdfColorSpace===K.PdfColorSpace.GrayScale?this.pdfColorSpace:K.PdfColorSpace.Rgb},set:function(t){t===K.PdfColorSpace.Rgb||t===K.PdfColorSpace.Cmyk||t===K.PdfColorSpace.GrayScale?this.pdfColorSpace=t:this.pdfColorSpace=K.PdfColorSpace.Rgb},enumerable:!0,configurable:!0}),Object.defineProperty(Or.prototype,"template",{get:function(){return null==this.pageTemplate&&(this.pageTemplate=new ar),this.pageTemplate},set:function(t){this.pageTemplate=t},enumerable:!0,configurable:!0}),Or.prototype.docSave=function(t,e,i){if(this.checkPagesPresence(),null===t)throw new Error("ArgumentNullException : stream");this.streamWriter=t;t=new kt(t);if(t.document=this,"boolean"==typeof e&&void 0===i)return this.crossTable.save(t);this.crossTable.save(t,e)},Or.prototype.checkPagesPresence=function(){0===this.pages.count&&this.pages.add()},Or.prototype.destroy=function(){this.catalog=void 0,this.colorSpace=void 0,this.currentSavingObj=void 0,this.documentPageCollection=void 0,this.isStreamCopied=void 0,this.pageSettings=void 0,this.pageTemplate=void 0,this.pdfColorSpace=void 0,this.sectionCollection=void 0,Or.cache.destroy(),this.crossTable.pdfObjects.destroy(),Or.cache=void 0,this.streamWriter.destroy()},Or.defaultStandardFont=null,Or.isCacheEnabled=!0;var vr,Cr,Br=Or;function Or(t){var e=Cr.call(this)||this,i=(e.defaultMargin=40,e.streamWriter=null,e.document=e,!1),i=void 0===t?(Or.cacheCollection=new Pr,!1):t,t=new Rt,r=(e.setMainObjectCollection(t),new Ut),i=(r.isMerging=i,(r.document=e).setCrossTable(r),new _t);return e.setCatalog(i),t.add(i),i.position=-1,e.sectionCollection=new mr(e),e.documentPageCollection=new br(e),i.pages=e.sectionCollection,e}C.getMetrics=function(t,e,i){var r=null;switch(t){case K.PdfFontFamily.Helvetica:r=this.getHelveticaMetrics(t,e,i);break;case K.PdfFontFamily.Courier:r=this.getCourierMetrics(t,e,i);break;case K.PdfFontFamily.TimesRoman:r=this.getTimesMetrics(t,e,i);break;case K.PdfFontFamily.Symbol:r=this.getSymbolMetrics(t,e,i);break;case K.PdfFontFamily.ZapfDingbats:r=this.getZapfDingbatsMetrics(t,e,i);break;default:r=this.getHelveticaMetrics(K.PdfFontFamily.Helvetica,e,i)}return r.name=t.toString(),r.subScriptSizeFactor=this.subSuperScriptFactor,r.superscriptSizeFactor=this.subSuperScriptFactor,r},C.getHelveticaMetrics=function(t,e,i){var r=new ii;return 0<(e&K.PdfFontStyle.Bold)&&0<(e&K.PdfFontStyle.Italic)?(r.ascent=this.helveticaBoldItalicAscent,r.descent=this.helveticaBoldItalicDescent,r.postScriptName=this.helveticaBoldItalicName,r.size=i,r.widthTable=new ai(this.arialBoldWidth)):0<(e&K.PdfFontStyle.Bold)?(r.ascent=this.helveticaBoldAscent,r.descent=this.helveticaBoldDescent,r.postScriptName=this.helveticaBoldName,r.size=i,r.widthTable=new ai(this.arialBoldWidth)):(0<(e&K.PdfFontStyle.Italic)?(r.ascent=this.helveticaItalicAscent,r.descent=this.helveticaItalicDescent,r.postScriptName=this.helveticaItalicName):(r.ascent=this.helveticaAscent,r.descent=this.helveticaDescent,r.postScriptName=this.helveticaName),r.size=i,r.widthTable=new ai(this.arialWidth)),r.height=r.ascent-r.descent,r},C.getCourierMetrics=function(t,e,i){var r=new ii;return 0<(e&K.PdfFontStyle.Bold)&&0<(e&K.PdfFontStyle.Italic)?(r.ascent=this.courierBoldItalicAscent,r.descent=this.courierBoldItalicDescent,r.postScriptName=this.courierBoldItalicName):0<(e&K.PdfFontStyle.Bold)?(r.ascent=this.courierBoldAscent,r.descent=this.courierBoldDescent,r.postScriptName=this.courierBoldName):0<(e&K.PdfFontStyle.Italic)?(r.ascent=this.courierItalicAscent,r.descent=this.courierItalicDescent,r.postScriptName=this.courierItalicName):(r.ascent=this.courierAscent,r.descent=this.courierDescent,r.postScriptName=this.courierName),r.size=i,r.widthTable=new ai(this.fixedWidth),r.height=r.ascent-r.descent,r},C.getTimesMetrics=function(t,e,i){var r=new ii;return 0<(e&K.PdfFontStyle.Bold)&&0<(e&K.PdfFontStyle.Italic)?(r.ascent=this.timesBoldItalicAscent,r.descent=this.timesBoldItalicDescent,r.postScriptName=this.timesBoldItalicName,r.size=i,r.widthTable=new ai(this.timesRomanBoldItalicWidths)):0<(e&K.PdfFontStyle.Bold)?(r.ascent=this.timesBoldAscent,r.descent=this.timesBoldDescent,r.postScriptName=this.timesBoldName,r.size=i,r.widthTable=new ai(this.timesRomanBoldWidth)):0<(e&K.PdfFontStyle.Italic)?(r.ascent=this.timesItalicAscent,r.descent=this.timesItalicDescent,r.postScriptName=this.timesItalicName,r.size=i,r.widthTable=new ai(this.timesRomanItalicWidth)):(r.ascent=this.timesAscent,r.descent=this.timesDescent,r.postScriptName=this.timesName,r.size=i,r.widthTable=new ai(this.timesRomanWidth)),r.height=r.ascent-r.descent,r},C.getSymbolMetrics=function(t,e,i){var r=new ii;return r.ascent=this.symbolAscent,r.descent=this.symbolDescent,r.postScriptName=this.symbolName,r.size=i,r.widthTable=new ai(this.symbolWidth),r.height=r.ascent-r.descent,r},C.getZapfDingbatsMetrics=function(t,e,i){var r=new ii;return r.ascent=this.zapfDingbatsAscent,r.descent=this.zapfDingbatsDescent,r.postScriptName=this.zapfDingbatsName,r.size=i,r.widthTable=new ai(this.zapfDingbatsWidth),r.height=r.ascent-r.descent,r},C.subSuperScriptFactor=1.52,C.helveticaAscent=931,C.helveticaDescent=-225,C.helveticaName="Helvetica",C.helveticaBoldAscent=962,C.helveticaBoldDescent=-228,C.helveticaBoldName="Helvetica-Bold",C.helveticaItalicAscent=931,C.helveticaItalicDescent=-225,C.helveticaItalicName="Helvetica-Oblique",C.helveticaBoldItalicAscent=962,C.helveticaBoldItalicDescent=-228,C.helveticaBoldItalicName="Helvetica-BoldOblique",C.courierAscent=805,C.courierDescent=-250,C.courierName="Courier",C.courierBoldAscent=801,C.courierBoldDescent=-250,C.courierBoldName="Courier-Bold",C.courierItalicAscent=805,C.courierItalicDescent=-250,C.courierItalicName="Courier-Oblique",C.courierBoldItalicAscent=801,C.courierBoldItalicDescent=-250,C.courierBoldItalicName="Courier-BoldOblique",C.timesAscent=898,C.timesDescent=-218,C.timesName="Times-Roman",C.timesBoldAscent=935,C.timesBoldDescent=-218,C.timesBoldName="Times-Bold",C.timesItalicAscent=883,C.timesItalicDescent=-217,C.timesItalicName="Times-Italic",C.timesBoldItalicAscent=921,C.timesBoldItalicDescent=-218,C.timesBoldItalicName="Times-BoldItalic",C.symbolAscent=1010,C.symbolDescent=-293,C.symbolName="Symbol",C.zapfDingbatsAscent=820,C.zapfDingbatsDescent=-143,C.zapfDingbatsName="ZapfDingbats",C.arialWidth=[278,278,355,556,556,889,667,191,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,278,278,584,584,584,556,1015,667,667,722,722,667,611,778,722,278,500,667,556,833,722,778,667,778,722,667,611,722,667,944,667,667,611,278,278,278,469,556,333,556,556,500,556,556,278,556,556,222,222,500,222,833,556,556,556,556,333,500,278,556,500,722,500,500,500,334,260,334,584,0,556,0,222,556,333,1e3,556,556,333,1e3,667,333,1e3,0,611,0,0,222,222,333,333,350,556,1e3,333,1e3,500,333,944,0,500,667,0,333,556,556,556,556,260,556,333,737,370,556,584,0,737,333,400,584,333,333,333,556,537,278,333,333,365,556,834,834,834,611,667,667,667,667,667,667,1e3,722,667,667,667,667,278,278,278,278,722,722,778,778,778,778,778,584,778,722,722,722,722,667,667,611,556,556,556,556,556,556,889,500,556,556,556,556,278,278,278,278,556,556,556,556,556,556,556,584,611,556,556,556,556,500,556,500],C.arialBoldWidth=[278,333,474,556,556,889,722,238,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,333,333,584,584,584,611,975,722,722,722,722,667,611,778,722,278,556,722,611,833,722,778,667,778,722,667,611,722,667,944,667,667,611,333,278,333,584,556,333,556,611,556,611,556,333,611,611,278,278,556,278,889,611,611,611,611,389,556,333,611,556,778,556,556,500,389,280,389,584,0,556,0,278,556,500,1e3,556,556,333,1e3,667,333,1e3,0,611,0,0,278,278,500,500,350,556,1e3,333,1e3,556,333,944,0,500,667,0,333,556,556,556,556,280,556,333,737,370,556,584,0,737,333,400,584,333,333,333,611,556,278,333,333,365,556,834,834,834,611,722,722,722,722,722,722,1e3,722,667,667,667,667,278,278,278,278,722,722,778,778,778,778,778,584,778,722,722,722,722,667,667,611,556,556,556,556,556,556,889,556,556,556,556,556,278,278,278,278,611,611,611,611,611,611,611,584,611,611,611,611,611,556,611,556],C.fixedWidth=[600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600],C.timesRomanWidth=[250,333,408,500,500,833,778,180,333,333,500,564,250,333,250,278,500,500,500,500,500,500,500,500,500,500,278,278,564,564,564,444,921,722,667,667,722,611,556,722,722,333,389,722,611,889,722,722,556,722,667,556,611,722,722,944,722,722,611,333,278,333,469,500,333,444,500,444,500,444,333,500,500,278,278,500,278,778,500,500,500,500,333,389,278,500,500,722,500,500,444,480,200,480,541,0,500,0,333,500,444,1e3,500,500,333,1e3,556,333,889,0,611,0,0,333,333,444,444,350,500,1e3,333,980,389,333,722,0,444,722,0,333,500,500,500,500,200,500,333,760,276,500,564,0,760,333,400,564,300,300,333,500,453,250,333,300,310,500,750,750,750,444,722,722,722,722,722,722,889,667,611,611,611,611,333,333,333,333,722,722,722,722,722,722,722,564,722,722,722,722,722,722,556,500,444,444,444,444,444,444,667,444,444,444,444,444,278,278,278,278,500,500,500,500,500,500,500,564,500,500,500,500,500,500,500,500],C.timesRomanBoldWidth=[250,333,555,500,500,1e3,833,278,333,333,500,570,250,333,250,278,500,500,500,500,500,500,500,500,500,500,333,333,570,570,570,500,930,722,667,722,722,667,611,778,778,389,500,778,667,944,722,778,611,778,722,556,667,722,722,1e3,722,722,667,333,278,333,581,500,333,500,556,444,556,444,333,500,556,278,333,556,278,833,556,500,556,556,444,389,333,556,500,722,500,500,444,394,220,394,520,0,500,0,333,500,500,1e3,500,500,333,1e3,556,333,1e3,0,667,0,0,333,333,500,500,350,500,1e3,333,1e3,389,333,722,0,444,722,0,333,500,500,500,500,220,500,333,747,300,500,570,0,747,333,400,570,300,300,333,556,540,250,333,300,330,500,750,750,750,500,722,722,722,722,722,722,1e3,722,667,667,667,667,389,389,389,389,722,722,778,778,778,778,778,570,778,722,722,722,722,722,611,556,500,500,500,500,500,500,722,444,444,444,444,444,278,278,278,278,500,556,500,500,500,500,500,570,500,556,556,556,556,500,556,500],C.timesRomanItalicWidth=[250,333,420,500,500,833,778,214,333,333,500,675,250,333,250,278,500,500,500,500,500,500,500,500,500,500,333,333,675,675,675,500,920,611,611,667,722,611,611,722,722,333,444,667,556,833,667,722,611,722,611,500,556,722,611,833,611,556,556,389,278,389,422,500,333,500,500,444,500,444,278,500,500,278,278,444,278,722,500,500,500,500,389,389,278,500,444,667,444,444,389,400,275,400,541,0,500,0,333,500,556,889,500,500,333,1e3,500,333,944,0,556,0,0,333,333,556,556,350,500,889,333,980,389,333,667,0,389,556,0,389,500,500,500,500,275,500,333,760,276,500,675,0,760,333,400,675,300,300,333,500,523,250,333,300,310,500,750,750,750,500,611,611,611,611,611,611,889,667,611,611,611,611,333,333,333,333,722,667,722,722,722,722,722,675,722,722,722,722,722,556,611,500,500,500,500,500,500,500,667,444,444,444,444,444,278,278,278,278,500,500,500,500,500,500,500,675,500,500,500,500,500,444,500,444],C.timesRomanBoldItalicWidths=[250,389,555,500,500,833,778,278,333,333,500,570,250,333,250,278,500,500,500,500,500,500,500,500,500,500,333,333,570,570,570,500,832,667,667,667,722,667,667,722,778,389,500,667,611,889,722,722,611,722,667,556,611,722,667,889,667,611,611,333,278,333,570,500,333,500,500,444,500,444,333,500,556,278,278,500,278,778,556,500,500,500,389,389,278,556,444,667,500,444,389,348,220,348,570,0,500,0,333,500,500,1e3,500,500,333,1e3,556,333,944,0,611,0,0,333,333,500,500,350,500,1e3,333,1e3,389,333,722,0,389,611,0,389,500,500,500,500,220,500,333,747,266,500,606,0,747,333,400,570,300,300,333,576,500,250,333,300,300,500,750,750,750,500,667,667,667,667,667,667,944,667,667,667,667,667,389,389,389,389,722,722,722,722,722,722,722,570,722,722,722,722,722,611,611,500,500,500,500,500,500,500,722,444,444,444,444,444,278,278,278,278,500,556,500,500,500,500,500,570,500,556,556,556,556,444,500,444],C.symbolWidth=[250,333,713,500,549,833,778,439,333,333,500,549,250,549,250,278,500,500,500,500,500,500,500,500,500,500,278,278,549,549,549,444,549,722,667,722,612,611,763,603,722,333,631,722,686,889,722,722,768,741,556,592,611,690,439,768,645,795,611,333,863,333,658,500,500,631,549,549,494,439,521,411,603,329,603,549,549,576,521,549,549,521,549,603,439,576,713,686,493,686,494,480,200,480,549,750,620,247,549,167,713,500,753,753,753,753,1042,987,603,987,603,400,549,411,549,549,713,494,460,549,549,549,549,1e3,603,1e3,658,823,686,795,987,768,768,823,768,768,713,713,713,713,713,713,713,768,713,790,790,890,823,549,250,713,603,603,1042,987,603,987,603,494,329,790,790,786,713,384,384,384,384,384,384,494,494,494,494,329,274,686,686,686,384,384,384,384,384,384,494,494,494,-1],C.zapfDingbatsWidth=[278,974,961,974,980,719,789,790,791,690,960,939,549,855,911,933,911,945,974,755,846,762,761,571,677,763,760,759,754,494,552,537,577,692,786,788,788,790,793,794,816,823,789,841,823,833,816,831,923,744,723,749,790,792,695,776,768,792,759,707,708,682,701,826,815,789,789,707,687,696,689,786,787,713,791,785,791,873,761,762,762,759,759,892,892,788,784,438,138,277,415,392,392,668,668,390,390,317,317,276,276,509,509,410,410,234,234,334,334,732,544,544,910,667,760,760,776,595,694,626,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,894,838,1016,458,748,924,748,918,927,928,928,834,873,828,924,924,917,930,931,463,883,836,836,867,867,696,696,874,874,760,946,771,865,771,888,967,888,831,873,927,970,918];var xr=C;function C(){}Lr=function(t,e){return(Lr=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}Lr(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(kr,Tr=Tt),Object.defineProperty(kr.prototype,"fontFamily",{get:function(){return this.pdfFontFamily},enumerable:!0,configurable:!0}),kr.prototype.checkStyle=function(){var t;this.fontFamily!==K.PdfFontFamily.Symbol&&this.fontFamily!==K.PdfFontFamily.ZapfDingbats||(t=this.style,t&=~(K.PdfFontStyle.Bold|K.PdfFontStyle.Italic),this.setStyle(t))},kr.prototype.getLineWidth=function(t,e){if(null==t)throw new Error("ArgumentNullException:line");for(var i=0,r=(this.name,0),n=(t=kr.convert(t)).length;r<n;r++){var o=t[r];i+=this.getCharWidthInternal(o,e)}var s=this.metrics.getSize(e);return i=this.applyFormatSettings(t,e,i*=Tt.charSizeMultiplier*s)},kr.prototype.equalsToFont=function(t){var e,i,r=!1;return null!=t&&(e=this.fontFamily===t.fontFamily,i=~(K.PdfFontStyle.Underline|K.PdfFontStyle.Strikeout),t=(this.style&i)==(t.style&i),r=e&&t),r},kr.prototype.initializeInternals=function(){Br.cache.search(this);var t=xr.getMetrics(this.pdfFontFamily,this.style,this.size);this.metrics=t,t=this.createInternals(),this.setInternals(t)},kr.prototype.createInternals=function(){var t,e=new c;return e.items.setValue(this.dictionaryProperties.type,new o(this.dictionaryProperties.font)),e.items.setValue(this.dictionaryProperties.subtype,new o(this.dictionaryProperties.type1)),e.items.setValue(this.dictionaryProperties.baseFont,new o(this.metrics.postScriptName)),this.fontFamily!==K.PdfFontFamily.Symbol&&this.fontFamily!==K.PdfFontFamily.ZapfDingbats&&(t=this.encodings[K.FontEncoding.WinAnsiEncoding],e.items.setValue(this.dictionaryProperties.encoding,new o(t))),e},kr.prototype.getCharWidthInternal=function(t,e){var i=0,i=t.charCodeAt(0);return"0"!==this.name&&"1"!==this.name&&"2"!==this.name&&"3"!==this.name&&"4"!==this.name||(i-=kr.charOffset),this.metrics.widthTable.items(i=0<=i&&128!==i?i:0)},kr.convert=function(t){return t},kr.charOffset=32;var Lr,Tr,jr=kr;function kr(t,e,i){e=Tr.call(this,e,void 0===i?t instanceof kr?t.style:K.PdfFontStyle.Regular:i)||this;return e.dictionaryProperties=new l,e.encodings=["Unknown","StandardEncoding","MacRomanEncoding","MacExpertEncoding","WinAnsiEncoding","PDFDocEncoding","IdentityH"],e.pdfFontFamily=void 0===t?K.PdfFontFamily.Helvetica:t instanceof kr?t.fontFamily:t,e.checkStyle(),e.initializeInternals(),e}Object.defineProperty(Rr.prototype,"color",{get:function(){return this.pdfColor},set:function(t){this.pdfColor=t},enumerable:!0,configurable:!0}),Object.defineProperty(Rr.prototype,"innerColor",{get:function(){return this.internalColor},set:function(t){this.internalColor=t},enumerable:!0,configurable:!0}),Object.defineProperty(Rr.prototype,"bounds",{get:function(){return this.rectangle},set:function(t){this.rectangle=t},enumerable:!0,configurable:!0}),Object.defineProperty(Rr.prototype,"page",{get:function(){return this.pdfPage},enumerable:!0,configurable:!0}),Object.defineProperty(Rr.prototype,"font",{get:function(){return this.textFont},set:function(t){this.textFont=t},enumerable:!0,configurable:!0}),Object.defineProperty(Rr.prototype,"stringFormat",{get:function(){return this.format},set:function(t){this.format=t},enumerable:!0,configurable:!0}),Object.defineProperty(Rr.prototype,"brush",{get:function(){return this.textBrush},set:function(t){this.textBrush=t},enumerable:!0,configurable:!0}),Object.defineProperty(Rr.prototype,"text",{get:function(){return this.content},set:function(t){this.content=t,this.dictionary.items.setValue(this.dictionaryProperties.contents,new tt(this.content))},enumerable:!0,configurable:!0}),Object.defineProperty(Rr.prototype,"dictionary",{get:function(){return this.pdfDictionary},set:function(t){this.pdfDictionary=t},enumerable:!0,configurable:!0}),Rr.prototype.initialize=function(){this.pdfDictionary.annotationBeginSave=new E(this),this.pdfDictionary.items.setValue(this.dictionaryProperties.type,new o(this.dictionaryProperties.annot))},Rr.prototype.setPage=function(t){this.pdfPage=t,this.pdfDictionary.items.setValue(this.dictionaryProperties.p,new d(this.pdfPage))},Rr.prototype.beginSave=function(){this.save()},Rr.prototype.save=function(){var t=new X(this.rectangle.x,this.rectangle.y,this.rectangle.width,this.rectangle.height),e=this.pdfPage.section,i=t.height,e=e.pointToNativePdf(this.page,new q(t.x,t.y));t.x=e.x,t.width=e.x+t.width,t.y=e.y-this.page.document.pageSettings.margins.top,t.height=t.y-i,this.pdfDictionary.items.setValue(this.dictionaryProperties.rect,p.fromRectangle(t)),this.dictionary.items.setValue(this.dictionaryProperties.ca,new u(this.darkness))},Object.defineProperty(Rr.prototype,"element",{get:function(){return this.pdfDictionary},enumerable:!0,configurable:!0});var Vr=Rr;function Rr(t){this.dictionaryProperties=new l,this.pdfColor=new f(255,255,255),this.rectangle=new X(0,0,0,0),this.pdfPage=null,this.textBrush=new mt(new f(0,0,0)),this.textFont=new jr(K.PdfFontFamily.TimesRoman,10),this.format=new bt(K.PdfTextAlignment.Left),this.content="",this.pdfDictionary=new c,this.internalColor=new f,this.darkness=1,void 0===t?this.initialize():(this.initialize(),this.bounds=t)}Mr=function(t,e){return(Mr=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}Mr(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(Ar,Dr=Vr),Ar.prototype.initialize=function(){Dr.prototype.initialize.call(this),this.dictionary.items.setValue(this.dictionaryProperties.subtype,new o(this.dictionaryProperties.link))};var Mr,Dr,Nr=Ar;function Ar(t){return Dr.call(this,t)||this}Ir=function(t,e){return(Ir=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}Ir(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(Gr,Fr=Nr),Gr.prototype.getSetAction=function(t){if(void 0===t)return this.pdfAction;this.pdfAction=t};var Ir,Fr,Er=Gr;function Gr(t){t=Fr.call(this,t)||this;return t.pdfAction=null,t}zr=function(t,e){return(zr=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}zr(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(Hr,Wr=Nr),Object.defineProperty(Hr.prototype,"destination",{get:function(){return this.pdfDestination},set:function(t){this.pdfDestination=t},enumerable:!0,configurable:!0}),Hr.prototype.save=function(){Wr.prototype.save.call(this),null!=this.pdfDestination&&this.dictionary.items.setValue(this.dictionaryProperties.dest,this.pdfDestination.element)},Hr.prototype.clone=function(){var t=new Hr(this.bounds,this.destination);return t.color=this.color,t.brush=this.brush,t.destination=this.destination,t.font=this.font,t};var zr,Wr,_r=Hr;function Hr(t,e){t=Wr.call(this,t)||this;return t.pdfDestination=null,void 0!==e&&(t.destination=e),t}Object.defineProperty(Kr.prototype,"elements",{get:function(){return this.layoutElement},enumerable:!0,configurable:!0}),Kr.prototype.getElement=function(){return this.layoutElement},Kr.prototype.layout=function(t){return this.layoutInternal(t)},Kr.prototype.Layouter=function(t){return this.layoutInternal(t)},Kr.prototype.getNextPage=function(t){return t.section.add()},Kr.prototype.getPaginateBounds=function(t){if(null==t)throw new Error("ArgumentNullException : param");return t.format.usePaginateBounds?t.format.paginateBounds:new X(t.bounds.x,0,t.bounds.width,t.bounds.height)};var Ur=Kr;function Kr(t){this.layoutElement=t}Object.defineProperty(Yr.prototype,"layout",{get:function(){return this.layoutType},set:function(t){this.layoutType=t},enumerable:!0,configurable:!0}),Object.defineProperty(Yr.prototype,"break",{get:function(){return this.breakType},set:function(t){this.breakType=t},enumerable:!0,configurable:!0}),Object.defineProperty(Yr.prototype,"paginateBounds",{get:function(){return void 0===this.layoutPaginateBounds&&null==this.layoutPaginateBounds&&(this.layoutPaginateBounds=new X(0,0,0,0)),this.layoutPaginateBounds},set:function(t){this.layoutPaginateBounds=t,this.boundsSet=!0},enumerable:!0,configurable:!0}),Object.defineProperty(Yr.prototype,"usePaginateBounds",{get:function(){return this.boundsSet},enumerable:!0,configurable:!0});var qr=Yr;function Yr(t){void 0!==t&&(this.break=t.break,this.layout=t.layout,this.paginateBounds=t.paginateBounds,this.boundsSet=t.usePaginateBounds)}Object.defineProperty(Jr.prototype,"page",{get:function(){return this.pdfPage},set:function(t){this.pdfPage=t},enumerable:!0,configurable:!0}),Object.defineProperty(Jr.prototype,"bounds",{get:function(){return new X(this.layoutBounds.x,this.layoutBounds.y,this.layoutBounds.width,this.layoutBounds.height)},set:function(t){this.layoutBounds=t},enumerable:!0,configurable:!0}),Object.defineProperty(Jr.prototype,"format",{get:function(){return this.layoutFormat},set:function(t){this.layoutFormat=t},enumerable:!0,configurable:!0});var Xr=Jr;function Jr(){}Object.defineProperty($r.prototype,"page",{get:function(){return this.pdfPage},enumerable:!0,configurable:!0}),Object.defineProperty($r.prototype,"bounds",{get:function(){return this.layoutBounds},enumerable:!0,configurable:!0});var Zr=$r;function $r(t,e){this.pdfPage=t,this.layoutBounds=e}Object.defineProperty(tn.prototype,"left",{get:function(){return this.leftPen},set:function(t){this.leftPen=t},enumerable:!0,configurable:!0}),Object.defineProperty(tn.prototype,"right",{get:function(){return this.rightPen},set:function(t){this.rightPen=t},enumerable:!0,configurable:!0}),Object.defineProperty(tn.prototype,"top",{get:function(){return this.topPen},set:function(t){this.topPen=t},enumerable:!0,configurable:!0}),Object.defineProperty(tn.prototype,"bottom",{get:function(){return this.bottomPen},set:function(t){this.bottomPen=t},enumerable:!0,configurable:!0}),Object.defineProperty(tn.prototype,"all",{set:function(t){this.leftPen=this.rightPen=this.topPen=this.bottomPen=t},enumerable:!0,configurable:!0}),Object.defineProperty(tn.prototype,"isAll",{get:function(){return this.leftPen===this.rightPen&&this.leftPen===this.topPen&&this.leftPen===this.bottomPen},enumerable:!0,configurable:!0}),Object.defineProperty(tn,"default",{get:function(){return new tn},enumerable:!0,configurable:!0});var Qr=tn;function tn(){var t=new te(new f(0,0,0)),e=(t.dashStyle=K.PdfDashStyle.Solid,new te(new f(0,0,0))),i=(e.dashStyle=K.PdfDashStyle.Solid,new te(new f(0,0,0))),r=(i.dashStyle=K.PdfDashStyle.Solid,new te(new f(0,0,0)));r.dashStyle=K.PdfDashStyle.Solid,this.leftPen=t,this.rightPen=e,this.topPen=i,this.bottomPen=r}Object.defineProperty(rn.prototype,"left",{get:function(){return this.leftPad},set:function(t){this.leftPad=t,this.hasLeftPad=!0},enumerable:!0,configurable:!0}),Object.defineProperty(rn.prototype,"right",{get:function(){return this.rightPad},set:function(t){this.rightPad=t,this.hasRightPad=!0},enumerable:!0,configurable:!0}),Object.defineProperty(rn.prototype,"top",{get:function(){return this.topPad},set:function(t){this.topPad=t,this.hasTopPad=!0},enumerable:!0,configurable:!0}),Object.defineProperty(rn.prototype,"bottom",{get:function(){return this.bottomPad},set:function(t){this.bottomPad=t,this.hasBottomPad=!0},enumerable:!0,configurable:!0}),Object.defineProperty(rn.prototype,"all",{set:function(t){this.leftPad=this.rightPad=this.topPad=this.bottomPad=t,this.hasLeftPad=!0,this.hasRightPad=!0,this.hasTopPad=!0,this.hasBottomPad=!0},enumerable:!0,configurable:!0});var en=rn;function rn(t,e,i,r){this.hasLeftPad=!1,this.hasRightPad=!1,this.hasTopPad=!1,this.hasBottomPad=!1,void 0===t?(this.leftPad=this.rightPad=5.76,this.bottomPad=this.topPad=.5):(this.leftPad=t,this.rightPad=e,this.topPad=i,this.bottomPad=r,this.hasLeftPad=!0,this.hasRightPad=!0,this.hasTopPad=!0,this.hasBottomPad=!0)}Object.defineProperty(on.prototype,"raiseBeginPageLayout",{get:function(){return void 0!==this.beginPageLayout},enumerable:!0,configurable:!0}),Object.defineProperty(on.prototype,"raiseEndPageLayout",{get:function(){return void 0!==this.endPageLayout},enumerable:!0,configurable:!0}),on.prototype.onBeginPageLayout=function(t){this.beginPageLayout&&this.beginPageLayout(this,t)},on.prototype.onEndPageLayout=function(t){this.endPageLayout&&this.endPageLayout(this,t)},on.prototype.drawHelper=function(t,e,i,r){var n;return e instanceof q&&void 0===e.width&&void 0===i?this.drawHelper(t,e.x,e.y):"number"==typeof e&&"number"==typeof i&&void 0===r?this.drawHelper(t,e,i,null):e instanceof X&&void 0!==e.width&&void 0===i?this.drawHelper(t,e,null):e instanceof q&&void 0===e.width&&i instanceof qr?this.drawHelper(t,e.x,e.y,i):"number"==typeof e&&"number"==typeof i&&(r instanceof qr||null==r)?(n=t.graphics.clientSize.width-e,n=new X(e,i,n,0),this.drawHelper(t,n,r)):e instanceof X&&void 0!==e.width&&"boolean"==typeof i?(this.bEmbedFonts=i,this.drawHelper(t,e,null)):(n=e,r=i,(e=new Xr).page=t,e.bounds=n,null!=e&&(i=e.bounds.x,t=e.bounds.y,0===e.bounds.x&&(i=Qr.default.right.width/2),0===e.bounds.y&&(t=Qr.default.top.width/2),n=new X(i,t,e.bounds.width,e.bounds.height),e.bounds=n),e.format=null!=r?r:new qr,this.layout(e))};var nn=on;function on(){}sn=function(t,e){return(sn=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var sn,an,hn=function(t,e){function i(){this.constructor=t}sn(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},ln=(hn(un,an=Ur),Object.defineProperty(un.prototype,"element",{get:function(){return an.prototype.getElement.call(this)},enumerable:!0,configurable:!0}),un.prototype.layoutInternal=function(t){this.format=null!==this.element.stringFormat&&void 0!==this.element.stringFormat?this.element.stringFormat:null;var e=t.page,i=t.bounds,r=this.element.value,n=null,o=new pn;for(o.page=e,o.remainder=r;;){o=this.layoutOnPage(r,e,i,t),n=this.getLayoutResult(o);break}return n},un.prototype.getLayoutResult=function(t){return new dn(t.page,t.bounds,t.remainder,t.lastLineBounds)},un.prototype.layoutOnPage=function(t,e,i,r){var n=new pn;n.remainder=t,n.page=e,i=this.checkCorrectBounds(e,i);var t=(new vt).layout(t,this.element.font,this.format,i,e.getClientSize().height,!1,new Y(0,0)),o=null==t.remainder,r=(r.format.break!==K.PdfLayoutBreakType.FitElement&&t.empty,e.graphics),s=this.element.getBrush();this.element instanceof Bn&&(s.color=new f(0,0,255)),r.drawStringLayoutResult(t,this.element.font,this.element.pen,s,i,this.format),t.lines[t.lineCount-1];return n.lastLineBounds=r.getLineBounds(t.lineCount-1,t,this.element.font,i,this.format),n.bounds=this.getTextPageBounds(e,i,t),n.remainder=t.remainder,n.end=o,n},un.prototype.checkCorrectBounds=function(t,e){t=t.graphics.clientSize;return e.height=0<e.height?e.height:t.height-e.y,e},un.prototype.getTextPageBounds=function(t,e,i){var i=i.actualSize,r=(e.x,e.y),n=(0<e.width?e:i).width,o=i.height,s=t.graphics.checkCorrectLayoutRectangle(i,e.x,e.y,this.format).x,t=t.graphics.getTextVerticalAlignShift(i.height,e.height,this.format);return new X(s,r+=t,n,o)},un);function un(t){return an.call(this,t)||this}var cn,pn=function(){},dn=(hn(fn,cn=Zr),Object.defineProperty(fn.prototype,"remainder",{get:function(){return this.remainderText},enumerable:!0,configurable:!0}),Object.defineProperty(fn.prototype,"lastLineBounds",{get:function(){return this.lastLineTextBounds},enumerable:!0,configurable:!0}),fn);function fn(t,e,i,r){t=cn.call(this,t,e)||this;return t.remainderText=i,t.lastLineTextBounds=r,t}gn=function(t,e){return(gn=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}gn(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(yn,mn=nn),Object.defineProperty(yn.prototype,"text",{get:function(){return this.content},set:function(t){this.elementValue=t,this.content=t},enumerable:!0,configurable:!0}),Object.defineProperty(yn.prototype,"value",{get:function(){return this.elementValue},enumerable:!0,configurable:!0}),Object.defineProperty(yn.prototype,"pen",{get:function(){return this.pdfPen},set:function(t){this.pdfPen=t},enumerable:!0,configurable:!0}),Object.defineProperty(yn.prototype,"brush",{get:function(){return this.pdfBrush},set:function(t){this.pdfBrush=t},enumerable:!0,configurable:!0}),Object.defineProperty(yn.prototype,"font",{get:function(){return this.pdfFont},set:function(t){this.pdfFont=t,this.pdfFont instanceof jr&&null!=this.content?this.elementValue=jr.convert(this.content):this.elementValue=this.content},enumerable:!0,configurable:!0}),Object.defineProperty(yn.prototype,"stringFormat",{get:function(){return this.format},set:function(t){this.format=t},enumerable:!0,configurable:!0}),yn.prototype.getBrush=function(){return null==this.pdfBrush||void 0===this.pdfBrush?new mt(new f(0,0,0)):this.pdfBrush},yn.prototype.layout=function(t){return new ln(this).layout(t)},yn.prototype.drawText=function(t,e,i,r){if(e instanceof q&&void 0===e.width&&void 0===i)return this.hasPointOverload=!0,this.drawText(t,e.x,e.y);if("number"==typeof e&&"number"==typeof i&&void 0===r)return this.hasPointOverload=!0,this.drawText(t,e,i,null);if(e instanceof X&&void 0!==e.width&&void 0===i)return this.drawText(t,e,null);if(e instanceof q&&void 0===e.width&&i instanceof qr)return this.hasPointOverload=!0,this.drawText(t,e.x,e.y,i);if("number"==typeof e&&"number"==typeof i&&(r instanceof qr||null==r))return this.hasPointOverload=!0,n=t.graphics.clientSize.width-e,n=new X(e,i,n,0),this.drawText(t,n,r);if(e instanceof X&&void 0!==e.width&&"boolean"==typeof i)return this.drawText(t,e,null);var n=new vt;if(this.hasPointOverload){var o=n.layout(this.value,this.font,this.stringFormat,new Y(t.graphics.clientSize.width-e.x,0),!0,t.graphics.clientSize),s=void 0,a=e,h=i;if((p=new Xr).page=t,p.bounds=a,p.format=null!=h?h:new qr,1<o.lines.length){if(this.text=o.layoutLines[0].text,p.bounds.y<=p.page.graphics.clientSize.height)for(var l=new q(p.bounds.x,p.bounds.y),u=(s=this.layout(p),new X(0,s.bounds.y+o.lineHeight,t.graphics.clientSize.width,o.lineHeight)),c=1;c<o.lines.length;c++)p.page=s.page,p.bounds=new X(new q(u.x,u.y),new Y(u.width,u.height)),this.text=o.layoutLines[c].text,u.y+o.lineHeight>s.page.graphics.clientSize.height&&(p.page=p.page.graphics.getNextPage(),u=l.y>s.page.graphics.clientSize.height-s.bounds.height?new X(0,s.bounds.height,s.page.graphics.clientSize.width,o.lineHeight):new X(0,0,s.page.graphics.clientSize.width,o.lineHeight),p.bounds=u),s=this.layout(p),c!==o.lines.length-1?u=new X(0,s.bounds.y+o.lineHeight,s.page.graphics.clientSize.width,o.lineHeight):(g=this.font.measureString(this.text,this.format).width,s=this.calculateResultBounds(s,g,s.page.graphics.clientSize.width,0))}else d=this.font.measureString(this.text,this.format),p.bounds.y<=p.page.graphics.clientSize.height&&(s=this.layout(p),s=this.calculateResultBounds(s,d.width,s.page.graphics.clientSize.width,0));return s}var p,d,s=n.layout(this.value,this.font,this.stringFormat,new Y(e.width,0),!1,t.graphics.clientSize),f=void 0,a=e,h=i;if((p=new Xr).page=t,p.bounds=a,p.format=null!=h?h:new qr,1<s.lines.length){if(this.text=s.layoutLines[0].text,p.bounds.y<=p.page.graphics.clientSize.height)for(var g,l=new q(p.bounds.x,p.bounds.y),u=(f=this.layout(p),new X(a.x,f.bounds.y+s.lineHeight,a.width,s.lineHeight)),c=1;c<s.lines.length;c++)p.page=f.page,p.bounds=new X(u.x,u.y,u.width,u.height),this.text=s.layoutLines[c].text,u.y+s.lineHeight>f.page.graphics.clientSize.height&&(p.page=p.page.graphics.getNextPage(),u=l.y>f.page.graphics.clientSize.height-f.bounds.height?new X(a.x,s.lineHeight,a.width,s.lineHeight):new X(a.x,0,a.width,s.lineHeight),p.bounds=u),f=this.layout(p),c!==s.lines.length-1?u=new X(a.x,f.bounds.y+s.lineHeight,a.width,s.lineHeight):(g=this.font.measureString(this.text,this.format).width,f=this.calculateResultBounds(f,g,a.width,a.x))}else d=this.font.measureString(this.text,this.format),p.bounds.y<=p.page.graphics.clientSize.height&&(f=this.layout(p),f=this.calculateResultBounds(f,d.width,a.width,a.x));return f},yn.prototype.calculateResultBounds=function(t,e,i,r){return null!=this.stringFormat&&void 0!==this.stringFormat&&this.stringFormat.alignment===K.PdfTextAlignment.Center?(t.bounds.x=r+(i-e)/2,t.bounds.width=e):null!=this.stringFormat&&void 0!==this.stringFormat&&this.stringFormat.alignment===K.PdfTextAlignment.Right?(t.bounds.x=r+(i-e),t.bounds.width=e):null!=this.stringFormat&&void 0!==this.stringFormat&&this.stringFormat.alignment===K.PdfTextAlignment.Justify?(t.bounds.x=r,t.bounds.width=i):(t.bounds.width=r,t.bounds.width=e),t};var gn,mn,hn=yn;function yn(t,e,i,r,n){var o=mn.call(this)||this;return o.content="",o.elementValue="",o.hasPointOverload=!1,o.isPdfTextElement=!1,void 0!==t&&("string"==typeof t&&void 0===e?(o.content=t,o.elementValue=t):"string"==typeof t&&e instanceof Tt&&void 0===i?(o.content=t,o.elementValue=t,o.pdfFont=e):"string"==typeof t&&e instanceof Tt&&i instanceof te&&void 0===r?(o.content=t,o.elementValue=t,o.pdfFont=e,o.pdfPen=i):"string"==typeof t&&e instanceof Tt&&i instanceof pt&&void 0===r?(o.content=t,o.elementValue=t,o.pdfFont=e,o.pdfBrush=i):(o.content=t,o.elementValue=t,o.pdfFont=e,o.pdfPen=i,o.pdfBrush=r,o.format=n)),o}bn=function(t,e){return(bn=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}bn(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(Sn,wn=Er),Object.defineProperty(Sn.prototype,"uriAction",{get:function(){return void 0===this.pdfUriAction&&(this.pdfUriAction=new ht),this.pdfUriAction},enumerable:!0,configurable:!0}),Object.defineProperty(Sn.prototype,"uri",{get:function(){return this.uriAction.uri},set:function(t){this.uriAction.uri!==t&&(this.uriAction.uri=t)},enumerable:!0,configurable:!0}),Object.defineProperty(Sn.prototype,"action",{get:function(){return this.getSetAction()},set:function(t){this.getSetAction(t),this.uriAction.next=t},enumerable:!0,configurable:!0}),Sn.prototype.initialize=function(){wn.prototype.initialize.call(this),this.dictionary.items.setValue(this.dictionaryProperties.subtype,new o(this.dictionaryProperties.link));this.uriAction.element;this.dictionary.items.setValue(this.dictionaryProperties.a,this.uriAction.element)};var bn,wn,Pn=Sn;function Sn(t,e){t=wn.call(this,t)||this;return void 0!==e&&(t.uri=e),t}vn=function(t,e){return(vn=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}vn(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(On,Cn=hn),Object.defineProperty(On.prototype,"url",{get:function(){return this.uniformResourceLocator},set:function(t){if(0===t.length)throw new Error("ArgumentException : Url - string can not be empty");this.uniformResourceLocator=t},enumerable:!0,configurable:!0}),On.prototype.draw=function(t,e){var i,r,n,o,s,a;return t instanceof er?(a=new vt,i=this.font.style,e instanceof q?(this.recalculateBounds=!0,this.font.style=K.PdfFontStyle.Underline,s=1===(r=a.layout(this.value,this.font,this.stringFormat,new Y(t.graphics.clientSize.width-e.x,0),!0,t.graphics.clientSize)).lines.length?(n=this.font.measureString(this.value),o=new X(e,n),o=this.calculateBounds(o,n.width,t.graphics.clientSize.width,e.x),this.uriAnnotation=new Pn(o,this.url),this.uriAnnotation.dictionary.items.setValue("Border",this.defaultBorder),t.annotations.add(this.uriAnnotation),this.drawText(t,e)):this.drawMultipleLineWithPoint(r,t,e),this.font.style=i,s):(r=a.layout(this.value,this.font,this.stringFormat,new Y(e.width,0),!1,new Y(0,0)),this.font.style=K.PdfFontStyle.Underline,s=1===r.lines.length?(n=this.font.measureString(this.value),o=new X(new q(e.x,e.y),n),o=this.calculateBounds(o,n.width,e.width,e.x),this.uriAnnotation=new Pn(o,this.url),this.uriAnnotation.dictionary.items.setValue("Border",this.defaultBorder),t.annotations.add(this.uriAnnotation),this.drawText(t,e)):this.drawMultipleLineWithBounds(r,t,e),this.font.style=i,s)):(a=new er,a=t.page,this.draw(a,e))},On.prototype.drawMultipleLineWithPoint=function(t,e,i){for(var r,n=0;n<t.layoutLines.length;n++){var o=this.font.measureString(t.lines[n].text),s=new X(i,o);if(0!==n&&(s.x=0),this.text=t.lines[n].text,s.y+o.height>e.graphics.clientSize.height){if(0===n)break;e=e.graphics.getNextPage(),s=new X(0,0,e.graphics.clientSize.width,o.height),i.y=0}s=this.calculateBounds(s,o.width,e.graphics.clientSize.width,s.x),this.uriAnnotation=new Pn(s,this.url),this.uriAnnotation.dictionary.items.setValue("Border",this.defaultBorder),e.annotations.add(this.uriAnnotation),r=0!==n?this.drawText(e,new q(0,s.y)):this.drawText(e,s.x,s.y),i.y+=o.height}return r},On.prototype.drawMultipleLineWithBounds=function(t,e,i){for(var r,n=0;n<t.layoutLines.length;n++){var o=this.font.measureString(t.lines[n].text),s=new X(new q(i.x,i.y),o),s=this.calculateBounds(s,o.width,i.width,i.x);if(this.text=t.lines[n].text,i.y+o.height>e.graphics.clientSize.height){if(0===n)break;e=e.graphics.getNextPage(),i=new X(i.x,0,i.width,o.height),s.y=0}this.uriAnnotation=new Pn(s,this.url),this.uriAnnotation.dictionary.items.setValue("Border",this.defaultBorder),e.annotations.add(this.uriAnnotation),r=this.drawText(e,i),i.y+=o.height}return r},On.prototype.calculateBounds=function(t,e,i,r){return null!=this.stringFormat&&void 0!==this.stringFormat&&this.stringFormat.alignment===K.PdfTextAlignment.Center?(t.x=r+(i-e)/2,t.width=e):null!=this.stringFormat&&void 0!==this.stringFormat&&this.stringFormat.alignment===K.PdfTextAlignment.Right?(t.x=r+(i-e),t.width=e):null!=this.stringFormat&&void 0!==this.stringFormat&&this.stringFormat.alignment===K.PdfTextAlignment.Justify?(t.x=r,t.width=i):(t.width=r,t.width=e),t};var vn,Cn,Bn=On;function On(){var t=Cn.call(this)||this;t.uniformResourceLocator="",t.uriAnnotation=null,t.recalculateBounds=!1,t.defaultBorder=new p;for(var e=0;e<3;e++)t.defaultBorder.add(new u(0));return t}Ln.convert=function(t,e){var i="";switch(e){case K.PdfNumberStyle.None:i="";break;case K.PdfNumberStyle.Numeric:i=t.toString();break;case K.PdfNumberStyle.LowerLatin:i=this.arabicToLetter(t).toLowerCase();break;case K.PdfNumberStyle.LowerRoman:i=this.arabicToRoman(t).toLowerCase();break;case K.PdfNumberStyle.UpperLatin:i=this.arabicToLetter(t);break;case K.PdfNumberStyle.UpperRoman:i=this.arabicToRoman(t)}return i},Ln.arabicToRoman=function(t){var e="",i=this.generateNumber(t,1e3,"M"),i=(e+=i.returnValue,t=i.intArabic,this.generateNumber(t,900,"CM")),i=(e+=i.returnValue,t=i.intArabic,this.generateNumber(t,500,"D")),i=(e+=i.returnValue,t=i.intArabic,this.generateNumber(t,400,"CD")),i=(e+=i.returnValue,t=i.intArabic,this.generateNumber(t,100,"C")),i=(e+=i.returnValue,t=i.intArabic,this.generateNumber(t,90,"XC")),i=(e+=i.returnValue,t=i.intArabic,this.generateNumber(t,50,"L")),i=(e+=i.returnValue,t=i.intArabic,this.generateNumber(t,40,"XL")),i=(e+=i.returnValue,t=i.intArabic,this.generateNumber(t,10,"X")),i=(e+=i.returnValue,t=i.intArabic,this.generateNumber(t,9,"IX")),i=(e+=i.returnValue,t=i.intArabic,this.generateNumber(t,5,"V")),i=(e+=i.returnValue,t=i.intArabic,this.generateNumber(t,4,"IV")),i=(e+=i.returnValue,t=i.intArabic,this.generateNumber(t,1,"I"));return e+=i.returnValue,t=i.intArabic,e.toString()},Ln.arabicToLetter=function(t){for(var e=this.convertToLetter(t),i="";0<e.length;)var r=e.pop(),i=this.appendChar(i,r);return i.toString()},Ln.generateNumber=function(t,e,i){for(var r="";e<=t;)t-=e,r+=i;return{returnValue:r.toString(),intArabic:t}},Ln.convertToLetter=function(t){if(t<=0)throw Error("ArgumentOutOfRangeException-arabic, Value can not be less 0");for(var e=[];t>this.letterLimit;){var i=t%this.letterLimit;0===i?(t=t/this.letterLimit-1,i=this.letterLimit):t/=this.letterLimit,e.push(i)}return e.push(t),e},Ln.appendChar=function(t,e){return t+=String.fromCharCode(Ln.acsiiStartIndex+e)},Ln.letterLimit=26,Ln.acsiiStartIndex=64;var xn=Ln;function Ln(){}Object.defineProperty(jn.prototype,"template",{get:function(){return this.pdfTemplate},set:function(t){this.pdfTemplate=t},enumerable:!0,configurable:!0}),Object.defineProperty(jn.prototype,"value",{get:function(){return this.content},set:function(t){this.content=t},enumerable:!0,configurable:!0});var Tn=jn;function jn(t,e){this.pdfTemplate=null,this.content="",void 0!==t&&(this.template=t,this.value=e)}kn=function(t,e){return(kn=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}kn(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(Mn,Vn=me),Mn.prototype.performDraw=function(t,e,i,r){Vn.prototype.performDrawHelper.call(this,t,e,i,r);var n=this.getValue(t),o=new Bi(this.getSize()),s=(this.list.setValue(t,new Tn(o,n)),this.getSize()),n=(o.graphics.drawString(n,this.getFont(),this.pen,this.getBrush(),0,0,s.width,s.height,this.stringFormat),new q(e.x+this.location.x,e.y+this.location.y));t.drawPdfTemplate(o,n,new Y(o.width*i,o.height*r))};var kn,Vn,Rn=Mn;function Mn(){var t=Vn.call(this)||this;return t.list=new ae,t}Dn=function(t,e){return(Dn=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}Dn(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(In,Nn=Rn),Object.defineProperty(In.prototype,"numberStyle",{get:function(){return this.internalNumberStyle},set:function(t){this.internalNumberStyle=t},enumerable:!0,configurable:!0}),In.prototype.getValue=function(t){t=this.getPageFromGraphics(t);return this.internalGetValue(t)},In.prototype.internalGetValue=function(t){t=t.document.pages.indexOf(t)+1;return xn.convert(t,this.numberStyle)};var Dn,Nn,An=In;function In(t,e){var i=Nn.call(this)||this;return i.internalNumberStyle=K.PdfNumberStyle.Numeric,void 0===e?i.font=t:e instanceof pt?(i.font=t,i.brush=e):(i.font=t,i.bounds=e),i}Fn=function(t,e){return(Fn=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}Fn(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(Gn,En=Rn),Object.defineProperty(Gn.prototype,"text",{get:function(){return this.internalText},set:function(t){this.internalText=t},enumerable:!0,configurable:!0}),Object.defineProperty(Gn.prototype,"automaticFields",{get:function(){return this.internalAutomaticFields},set:function(t){this.internalAutomaticFields=t},enumerable:!0,configurable:!0}),Gn.prototype.getValue=function(t){var e=this.text.toString();if(void 0!==this.automaticFields&&null!=this.automaticFields&&0<this.automaticFields.length)for(var i=0;i<this.automaticFields.length;i++)var r=this.automaticFields[i],e=e.replace("{"+i+"}",r.getValue(t));return e};var Fn,En,Rn=Gn;function Gn(t,e,i){for(var r=[],n=3;n<arguments.length;n++)r[n-3]=arguments[n];var o=En.call(this)||this;return o.internalAutomaticFields=null,o.internalText="",o.font=t,o.brush=e,o.text=i,o.automaticFields=r,o}zn=function(t,e){return(zn=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}zn(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(Hn,Wn=me),Hn.prototype.performDraw=function(t,e,i,r){Wn.prototype.performDrawHelper.call(this,t,e,i,r);var n,o,s,a=this.getPageFromGraphics(t).document,h=this.getValue(t);this.list.containsKey(a)?(n=this.list.getValue(a),s=new q(e.x+this.location.x,e.y+this.location.y),t.drawPdfTemplate(n.template,s,new Y(n.template.width*i,n.template.height*r))):(n=this.getSize(),o=new Bi(n),this.list.setValue(a,new Tn(o,h)),o.graphics.drawString(h,this.getFont(),this.pen,this.getBrush(),0,0,n.width,n.height,this.stringFormat),s=new q(e.x+this.location.x,e.y+this.location.y),t.drawPdfTemplate(o,s,new Y(o.width*i,o.height*r))),this.painterGraphics.push(t)};var zn,Wn,_n=Hn;function Hn(){var t=Wn.call(this)||this;return t.list=new ae,t.painterGraphics=[],t}Un=function(t,e){return(Un=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}Un(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(qn,Kn=_n),Object.defineProperty(qn.prototype,"numberStyle",{get:function(){return this.internalNumberStyle},set:function(t){this.internalNumberStyle=t},enumerable:!0,configurable:!0}),qn.prototype.getValue=function(t){t=this.getPageFromGraphics(t).section.parent.document.pages.count;return xn.convert(t,this.numberStyle)};var Un,Kn,_n=qn;function qn(t,e){var i=Kn.call(this)||this;return i.internalNumberStyle=K.PdfNumberStyle.Numeric,void 0===e?i.font=t:e instanceof pt?(i.font=t,i.brush=e):(i.font=t,i.bounds=e),i}(Yn=K.PdfDestinationMode||(K.PdfDestinationMode={}))[Yn.Location=0]="Location",Yn[Yn.FitToPage=1]="FitToPage",Yn[Yn.FitR=2]="FitR";Object.defineProperty(Xn.prototype,"zoom",{get:function(){return this.zoomFactor},set:function(t){this.zoomFactor=t,this.initializePrimitive()},enumerable:!0,configurable:!0}),Object.defineProperty(Xn.prototype,"page",{get:function(){return this.pdfPage},set:function(t){this.pdfPage=t,this.initializePrimitive()},enumerable:!0,configurable:!0}),Object.defineProperty(Xn.prototype,"mode",{get:function(){return this.destinationMode},set:function(t){this.destinationMode=t,this.initializePrimitive()},enumerable:!0,configurable:!0}),Object.defineProperty(Xn.prototype,"location",{get:function(){return this.destinationLocation},set:function(t){this.destinationLocation=t,this.initializePrimitive()},enumerable:!0,configurable:!0}),Xn.prototype.pointToNativePdf=function(t,e){return t.section.pointToNativePdf(t,e)},Xn.prototype.initializePrimitive=function(){switch(this.array.clear(),this.array.add(new d(this.pdfPage)),this.destinationMode){case K.PdfDestinationMode.Location:var t=this.pdfPage,t=(new q,this.pointToNativePdf(t,this.destinationLocation));this.array.add(new o(this.dictionaryProperties.xyz)),this.array.add(new u(t.x)),this.array.add(new u(t.y)),this.array.add(new u(this.zoomFactor));break;case K.PdfDestinationMode.FitToPage:this.array.add(new o(this.dictionaryProperties.fit))}},Object.defineProperty(Xn.prototype,"element",{get:function(){return this.initializePrimitive(),this.array},enumerable:!0,configurable:!0});var Yn=Xn;function Xn(t,e){this.dictionaryProperties=new l,this.destinationMode=K.PdfDestinationMode.Location,this.zoomFactor=0,this.destinationLocation=new q(0,0),this.bounds=new X,this.array=new p;K.PdfPageRotateAngle.RotateAngle0;this.destinationLocation=new q(0,this.destinationLocation.y),this.pdfPage=t,e instanceof q?this.destinationLocation=e:this.bounds=e}Object.defineProperty(Zn.prototype,"domain",{get:function(){return this.mDictionary.items.getValue(this.mDictionaryProperties.domain)},set:function(t){this.mDictionary.items.setValue(this.mDictionaryProperties.domain,t)},enumerable:!0,configurable:!0}),Object.defineProperty(Zn.prototype,"range",{get:function(){return this.mDictionary.items.getValue(this.mDictionaryProperties.range)},set:function(t){this.mDictionary.items.setValue(this.mDictionaryProperties.range,t)},enumerable:!0,configurable:!0}),Object.defineProperty(Zn.prototype,"dictionary",{get:function(){return this.mDictionary},enumerable:!0,configurable:!0}),Object.defineProperty(Zn.prototype,"element",{get:function(){return this.mDictionary},enumerable:!0,configurable:!0});var Jn=Zn;function Zn(t){this.mDictionary=null,this.mDictionaryProperties=new l,this.mDictionary=t}$n=function(t,e){return($n=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}$n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(no,Qn=Jn),no.prototype.checkParams=function(t,e,i,r){e.length,t.length,r.length},no.prototype.setDomainAndRange=function(t,e){this.domain=new p(t),this.range=new p(e)},no.prototype.setSizeAndValues=function(t,e){var i=this.dictionary;i.isResource=!0,this.dictionary.items.setValue(this.mDictionaryProperties.size,new p(t)),this.dictionary.items.setValue(this.mDictionaryProperties.bitsPerSample,new u(8)),i.writeBytes(e)};var $n,Qn,to,eo,io,B,ro=no;function no(t,e,i,r){var n=Qn.call(this,new U)||this;return void 0===t?n.dictionary.items.setValue(n.mDictionaryProperties.functionType,new u(0)):(n.dictionary.items.setValue(n.mDictionaryProperties.functionType,new u(0)),n.checkParams(t,e,i,r),n.setDomainAndRange(t,e),n.setSizeAndValues(i,r)),n}(O=to=to||{})[O.None=0]="None",O[O.Start=1]="Start",O[O.End=2]="End",O[O.Both=3]="Both",(O=eo=eo||{})[O.BackwardDiagonal=0]="BackwardDiagonal",O[O.ForwardDiagonal=1]="ForwardDiagonal",O[O.Horizontal=2]="Horizontal",O[O.Vertical=3]="Vertical",(O=io=io||{})[O.Function=1]="Function",O[O.Axial=2]="Axial",O[O.Radial=3]="Radial",(O=B=B||{})[O.ActiveBorder=1]="ActiveBorder",O[O.ActiveCaption=2]="ActiveCaption",O[O.ActiveCaptionText=3]="ActiveCaptionText",O[O.AppWorkspace=4]="AppWorkspace",O[O.Control=5]="Control",O[O.ControlDark=6]="ControlDark",O[O.ControlDarkDark=7]="ControlDarkDark",O[O.ControlLight=8]="ControlLight",O[O.ControlLightLight=9]="ControlLightLight",O[O.ControlText=10]="ControlText",O[O.Desktop=11]="Desktop",O[O.GrayText=12]="GrayText",O[O.Highlight=13]="Highlight",O[O.HighlightText=14]="HighlightText",O[O.HotTrack=15]="HotTrack",O[O.InactiveBorder=16]="InactiveBorder",O[O.InactiveCaption=17]="InactiveCaption",O[O.InactiveCaptionText=18]="InactiveCaptionText",O[O.Info=19]="Info",O[O.InfoText=20]="InfoText",O[O.Menu=21]="Menu",O[O.MenuText=22]="MenuText",O[O.ScrollBar=23]="ScrollBar",O[O.Window=24]="Window",O[O.WindowFrame=25]="WindowFrame",O[O.WindowText=26]="WindowText",O[O.Transparent=27]="Transparent",O[O.AliceBlue=28]="AliceBlue",O[O.AntiqueWhite=29]="AntiqueWhite",O[O.Aqua=30]="Aqua",O[O.Aquamarine=31]="Aquamarine",O[O.Azure=32]="Azure",O[O.Beige=33]="Beige",O[O.Bisque=34]="Bisque",O[O.Black=35]="Black",O[O.BlanchedAlmond=36]="BlanchedAlmond",O[O.Blue=37]="Blue",O[O.BlueViolet=38]="BlueViolet",O[O.Brown=39]="Brown",O[O.BurlyWood=40]="BurlyWood",O[O.CadetBlue=41]="CadetBlue",O[O.Chartreuse=42]="Chartreuse",O[O.Chocolate=43]="Chocolate",O[O.Coral=44]="Coral",O[O.CornflowerBlue=45]="CornflowerBlue",O[O.Cornsilk=46]="Cornsilk",O[O.Crimson=47]="Crimson",O[O.Cyan=48]="Cyan",O[O.DarkBlue=49]="DarkBlue",O[O.DarkCyan=50]="DarkCyan",O[O.DarkGoldenrod=51]="DarkGoldenrod",O[O.DarkGray=52]="DarkGray",O[O.DarkGreen=53]="DarkGreen",O[O.DarkKhaki=54]="DarkKhaki",O[O.DarkMagenta=55]="DarkMagenta",O[O.DarkOliveGreen=56]="DarkOliveGreen",O[O.DarkOrange=57]="DarkOrange",O[O.DarkOrchid=58]="DarkOrchid",O[O.DarkRed=59]="DarkRed",O[O.DarkSalmon=60]="DarkSalmon",O[O.DarkSeaGreen=61]="DarkSeaGreen",O[O.DarkSlateBlue=62]="DarkSlateBlue",O[O.DarkSlateGray=63]="DarkSlateGray",O[O.DarkTurquoise=64]="DarkTurquoise",O[O.DarkViolet=65]="DarkViolet",O[O.DeepPink=66]="DeepPink",O[O.DeepSkyBlue=67]="DeepSkyBlue",O[O.DimGray=68]="DimGray",O[O.DodgerBlue=69]="DodgerBlue",O[O.Firebrick=70]="Firebrick",O[O.FloralWhite=71]="FloralWhite",O[O.ForestGreen=72]="ForestGreen",O[O.Fuchsia=73]="Fuchsia",O[O.Gainsboro=74]="Gainsboro",O[O.GhostWhite=75]="GhostWhite",O[O.Gold=76]="Gold",O[O.Goldenrod=77]="Goldenrod",O[O.Gray=78]="Gray",O[O.Green=79]="Green",O[O.GreenYellow=80]="GreenYellow",O[O.Honeydew=81]="Honeydew",O[O.HotPink=82]="HotPink",O[O.IndianRed=83]="IndianRed",O[O.Indigo=84]="Indigo",O[O.Ivory=85]="Ivory",O[O.Khaki=86]="Khaki",O[O.Lavender=87]="Lavender",O[O.LavenderBlush=88]="LavenderBlush",O[O.LawnGreen=89]="LawnGreen",O[O.LemonChiffon=90]="LemonChiffon",O[O.LightBlue=91]="LightBlue",O[O.LightCoral=92]="LightCoral",O[O.LightCyan=93]="LightCyan",O[O.LightGoldenrodYellow=94]="LightGoldenrodYellow",O[O.LightGray=95]="LightGray",O[O.LightGreen=96]="LightGreen",O[O.LightPink=97]="LightPink",O[O.LightSalmon=98]="LightSalmon",O[O.LightSeaGreen=99]="LightSeaGreen",O[O.LightSkyBlue=100]="LightSkyBlue",O[O.LightSlateGray=101]="LightSlateGray",O[O.LightSteelBlue=102]="LightSteelBlue",O[O.LightYellow=103]="LightYellow",O[O.Lime=104]="Lime",O[O.LimeGreen=105]="LimeGreen",O[O.Linen=106]="Linen",O[O.Magenta=107]="Magenta",O[O.Maroon=108]="Maroon",O[O.MediumAquamarine=109]="MediumAquamarine",O[O.MediumBlue=110]="MediumBlue",O[O.MediumOrchid=111]="MediumOrchid",O[O.MediumPurple=112]="MediumPurple",O[O.MediumSeaGreen=113]="MediumSeaGreen",O[O.MediumSlateBlue=114]="MediumSlateBlue",O[O.MediumSpringGreen=115]="MediumSpringGreen",O[O.MediumTurquoise=116]="MediumTurquoise",O[O.MediumVioletRed=117]="MediumVioletRed",O[O.MidnightBlue=118]="MidnightBlue",O[O.MintCream=119]="MintCream",O[O.MistyRose=120]="MistyRose",O[O.Moccasin=121]="Moccasin",O[O.NavajoWhite=122]="NavajoWhite",O[O.Navy=123]="Navy",O[O.OldLace=124]="OldLace",O[O.Olive=125]="Olive",O[O.OliveDrab=126]="OliveDrab",O[O.Orange=127]="Orange",O[O.OrangeRed=128]="OrangeRed",O[O.Orchid=129]="Orchid",O[O.PaleGoldenrod=130]="PaleGoldenrod",O[O.PaleGreen=131]="PaleGreen",O[O.PaleTurquoise=132]="PaleTurquoise",O[O.PaleVioletRed=133]="PaleVioletRed",O[O.PapayaWhip=134]="PapayaWhip",O[O.PeachPuff=135]="PeachPuff",O[O.Peru=136]="Peru",O[O.Pink=137]="Pink",O[O.Plum=138]="Plum",O[O.PowderBlue=139]="PowderBlue",O[O.Purple=140]="Purple",O[O.Red=141]="Red",O[O.RosyBrown=142]="RosyBrown",O[O.RoyalBlue=143]="RoyalBlue",O[O.SaddleBrown=144]="SaddleBrown",O[O.Salmon=145]="Salmon",O[O.SandyBrown=146]="SandyBrown",O[O.SeaGreen=147]="SeaGreen",O[O.SeaShell=148]="SeaShell",O[O.Sienna=149]="Sienna",O[O.Silver=150]="Silver",O[O.SkyBlue=151]="SkyBlue",O[O.SlateBlue=152]="SlateBlue",O[O.SlateGray=153]="SlateGray",O[O.Snow=154]="Snow",O[O.SpringGreen=155]="SpringGreen",O[O.SteelBlue=156]="SteelBlue",O[O.Tan=157]="Tan",O[O.Teal=158]="Teal",O[O.Thistle=159]="Thistle",O[O.Tomato=160]="Tomato",O[O.Turquoise=161]="Turquoise",O[O.Violet=162]="Violet",O[O.Wheat=163]="Wheat",O[O.White=164]="White",O[O.WhiteSmoke=165]="WhiteSmoke",O[O.Yellow=166]="Yellow",O[O.YellowGreen=167]="YellowGreen",O[O.ButtonFace=168]="ButtonFace",O[O.ButtonHighlight=169]="ButtonHighlight",O[O.ButtonShadow=170]="ButtonShadow",O[O.GradientActiveCaption=171]="GradientActiveCaption",O[O.GradientInactiveCaption=172]="GradientInactiveCaption",O[O.MenuBar=173]="MenuBar",O[O.MenuHighlight=174]="MenuHighlight";Object.defineProperty(x,"AliceBlue",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.AliceBlue)?this.sBrushes.getValue(B.AliceBlue):t)?this.getBrush(B.AliceBlue):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"AntiqueWhite",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.AntiqueWhite)?this.sBrushes.getValue(B.AntiqueWhite):t)?this.getBrush(B.AntiqueWhite):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Aqua",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Aqua)?this.sBrushes.getValue(B.Aqua):t)?this.getBrush(B.Aqua):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Aquamarine",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Aquamarine)?this.sBrushes.getValue(B.Aquamarine):t)?this.getBrush(B.Aquamarine):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Azure",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Azure)?this.sBrushes.getValue(B.Azure):t)?this.getBrush(B.Azure):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Beige",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Beige)?this.sBrushes.getValue(B.Beige):t)?this.getBrush(B.Beige):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Bisque",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Bisque)?this.sBrushes.getValue(B.Bisque):t)?this.getBrush(B.Bisque):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Black",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Black)?this.sBrushes.getValue(B.Black):t)?this.getBrush(B.Black):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"BlanchedAlmond",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.BlanchedAlmond)?this.sBrushes.getValue(B.BlanchedAlmond):t)?this.getBrush(B.BlanchedAlmond):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Blue",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Blue)?this.sBrushes.getValue(B.Blue):t)?this.getBrush(B.Blue):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"BlueViolet",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.BlueViolet)?this.sBrushes.getValue(B.BlueViolet):t)?this.getBrush(B.BlueViolet):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Brown",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Brown)?this.sBrushes.getValue(B.Brown):t)?this.getBrush(B.Brown):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"BurlyWood",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.BurlyWood)?this.sBrushes.getValue(B.BurlyWood):t)?this.getBrush(B.BurlyWood):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"CadetBlue",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.CadetBlue)?this.sBrushes.getValue(B.CadetBlue):t)?this.getBrush(B.CadetBlue):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Chartreuse",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Chartreuse)?this.sBrushes.getValue(B.Chartreuse):t)?this.getBrush(B.Chartreuse):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Chocolate",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Chocolate)?this.sBrushes.getValue(B.Chocolate):t)?this.getBrush(B.Chocolate):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Coral",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Coral)?this.sBrushes.getValue(B.Coral):t)?this.getBrush(B.Coral):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"CornflowerBlue",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.CornflowerBlue)?this.sBrushes.getValue(B.CornflowerBlue):t)?this.getBrush(B.CornflowerBlue):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Cornsilk",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Cornsilk)?this.sBrushes.getValue(B.Cornsilk):t)?this.getBrush(B.Cornsilk):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Crimson",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Crimson)?this.sBrushes.getValue(B.Crimson):t)?this.getBrush(B.Crimson):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Cyan",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Cyan)?this.sBrushes.getValue(B.Cyan):t)?this.getBrush(B.Cyan):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"DarkBlue",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.DarkBlue)?this.sBrushes.getValue(B.DarkBlue):t)?this.getBrush(B.DarkBlue):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"DarkCyan",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.DarkCyan)?this.sBrushes.getValue(B.DarkCyan):t)?this.getBrush(B.DarkCyan):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"DarkGoldenrod",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.DarkGoldenrod)?this.sBrushes.getValue(B.DarkGoldenrod):t)?this.getBrush(B.DarkGoldenrod):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"DarkGray",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.DarkGray)?this.sBrushes.getValue(B.DarkGray):t)?this.getBrush(B.DarkGray):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"DarkGreen",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.DarkGreen)?this.sBrushes.getValue(B.DarkGreen):t)?this.getBrush(B.DarkGreen):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"DarkKhaki",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.DarkKhaki)?this.sBrushes.getValue(B.DarkKhaki):t)?this.getBrush(B.DarkKhaki):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"DarkMagenta",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.DarkMagenta)?this.sBrushes.getValue(B.DarkMagenta):t)?this.getBrush(B.DarkMagenta):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"DarkOliveGreen",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.DarkOliveGreen)?this.sBrushes.getValue(B.DarkOliveGreen):t)?this.getBrush(B.DarkOliveGreen):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"DarkOrange",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.DarkOrange)?this.sBrushes.getValue(B.DarkOrange):t)?this.getBrush(B.DarkOrange):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"DarkOrchid",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.DarkOrchid)?this.sBrushes.getValue(B.DarkOrchid):t)?this.getBrush(B.DarkOrchid):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"DarkRed",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.DarkRed)?this.sBrushes.getValue(B.DarkRed):t)?this.getBrush(B.DarkRed):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"DarkSalmon",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.DarkSalmon)?this.sBrushes.getValue(B.DarkSalmon):t)?this.getBrush(B.DarkSalmon):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"DarkSeaGreen",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.DarkSeaGreen)?this.sBrushes.getValue(B.DarkSeaGreen):t)?this.getBrush(B.DarkSeaGreen):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"DarkSlateBlue",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.DarkSlateBlue)?this.sBrushes.getValue(B.DarkSlateBlue):t)?this.getBrush(B.DarkSlateBlue):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"DarkSlateGray",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.DarkSlateGray)?this.sBrushes.getValue(B.DarkSlateGray):t)?this.getBrush(B.DarkSlateGray):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"DarkTurquoise",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.DarkTurquoise)?this.sBrushes.getValue(B.DarkTurquoise):t)?this.getBrush(B.DarkTurquoise):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"DarkViolet",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.DarkViolet)?this.sBrushes.getValue(B.DarkViolet):t)?this.getBrush(B.DarkViolet):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"DeepPink",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.DeepPink)?this.sBrushes.getValue(B.DeepPink):t)?this.getBrush(B.DeepPink):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"DeepSkyBlue",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.DeepSkyBlue)?this.sBrushes.getValue(B.DeepSkyBlue):t)?this.getBrush(B.DeepSkyBlue):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"DimGray",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.DimGray)?this.sBrushes.getValue(B.DimGray):t)?this.getBrush(B.DimGray):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"DodgerBlue",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.DodgerBlue)?this.sBrushes.getValue(B.DodgerBlue):t)?this.getBrush(B.DodgerBlue):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Firebrick",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Firebrick)?this.sBrushes.getValue(B.Firebrick):t)?this.getBrush(B.Firebrick):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"FloralWhite",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.FloralWhite)?this.sBrushes.getValue(B.FloralWhite):t)?this.getBrush(B.FloralWhite):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"ForestGreen",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.ForestGreen)?this.sBrushes.getValue(B.ForestGreen):t)?this.getBrush(B.ForestGreen):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Fuchsia",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Fuchsia)?this.sBrushes.getValue(B.Fuchsia):t)?this.getBrush(B.Fuchsia):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Gainsboro",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Gainsboro)?this.sBrushes.getValue(B.Gainsboro):t)?this.getBrush(B.Gainsboro):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"GhostWhite",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.GhostWhite)?this.sBrushes.getValue(B.GhostWhite):t)?this.getBrush(B.GhostWhite):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Gold",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Gold)?this.sBrushes.getValue(B.Gold):t)?this.getBrush(B.Gold):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Goldenrod",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Goldenrod)?this.sBrushes.getValue(B.Goldenrod):t)?this.getBrush(B.Goldenrod):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Gray",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Gray)?this.sBrushes.getValue(B.Gray):t)?this.getBrush(B.Gray):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Green",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Green)?this.sBrushes.getValue(B.Green):t)?this.getBrush(B.Green):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"GreenYellow",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.GreenYellow)?this.sBrushes.getValue(B.GreenYellow):t)?this.getBrush(B.GreenYellow):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Honeydew",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Honeydew)?this.sBrushes.getValue(B.Honeydew):t)?this.getBrush(B.Honeydew):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"HotPink",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.HotPink)?this.sBrushes.getValue(B.HotPink):t)?this.getBrush(B.HotPink):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"IndianRed",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.IndianRed)?this.sBrushes.getValue(B.IndianRed):t)?this.getBrush(B.IndianRed):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Indigo",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Indigo)?this.sBrushes.getValue(B.Indigo):t)?this.getBrush(B.Indigo):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Ivory",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Ivory)?this.sBrushes.getValue(B.Ivory):t)?this.getBrush(B.Ivory):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Khaki",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Khaki)?this.sBrushes.getValue(B.Khaki):t)?this.getBrush(B.Khaki):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Lavender",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Lavender)?this.sBrushes.getValue(B.Lavender):t)?this.getBrush(B.Lavender):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"LavenderBlush",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.LavenderBlush)?this.sBrushes.getValue(B.LavenderBlush):t)?this.getBrush(B.LavenderBlush):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"LawnGreen",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.LawnGreen)?this.sBrushes.getValue(B.LawnGreen):t)?this.getBrush(B.LawnGreen):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"LemonChiffon",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.LemonChiffon)?this.sBrushes.getValue(B.LemonChiffon):t)?this.getBrush(B.LemonChiffon):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"LightBlue",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.LightBlue)?this.sBrushes.getValue(B.LightBlue):t)?this.getBrush(B.LightBlue):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"LightCoral",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.LightCoral)?this.sBrushes.getValue(B.LightCoral):t)?this.getBrush(B.LightCoral):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"LightCyan",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.LightCyan)?this.sBrushes.getValue(B.LightCyan):t)?this.getBrush(B.LightCyan):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"LightGoldenrodYellow",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.LightGoldenrodYellow)?this.sBrushes.getValue(B.LightGoldenrodYellow):t)?this.getBrush(B.LightGoldenrodYellow):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"LightGray",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.LightGray)?this.sBrushes.getValue(B.LightGray):t)?this.getBrush(B.LightGray):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"LightGreen",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.LightGreen)?this.sBrushes.getValue(B.LightGreen):t)?this.getBrush(B.LightGreen):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"LightPink",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.LightPink)?this.sBrushes.getValue(B.LightPink):t)?this.getBrush(B.LightPink):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"LightSalmon",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.LightSalmon)?this.sBrushes.getValue(B.LightSalmon):t)?this.getBrush(B.LightSalmon):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"LightSeaGreen",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.LightSeaGreen)?this.sBrushes.getValue(B.LightSeaGreen):t)?this.getBrush(B.LightSeaGreen):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"LightSkyBlue",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.LightSkyBlue)?this.sBrushes.getValue(B.LightSkyBlue):t)?this.getBrush(B.LightSkyBlue):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"LightSlateGray",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.LightSlateGray)?this.sBrushes.getValue(B.LightSlateGray):t)?this.getBrush(B.LightSlateGray):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"LightSteelBlue",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.LightSteelBlue)?this.sBrushes.getValue(B.LightSteelBlue):t)?this.getBrush(B.LightSteelBlue):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"LightYellow",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.LightYellow)?this.sBrushes.getValue(B.LightYellow):t)?this.getBrush(B.LightYellow):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Lime",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Lime)?this.sBrushes.getValue(B.Lime):t)?this.getBrush(B.Lime):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"LimeGreen",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.LimeGreen)?this.sBrushes.getValue(B.LimeGreen):t)?this.getBrush(B.LimeGreen):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Linen",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Linen)?this.sBrushes.getValue(B.Linen):t)?this.getBrush(B.Linen):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Magenta",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Magenta)?this.sBrushes.getValue(B.Magenta):t)?this.getBrush(B.Magenta):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Maroon",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Maroon)?this.sBrushes.getValue(B.Maroon):t)?this.getBrush(B.Maroon):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"MediumAquamarine",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.MediumAquamarine)?this.sBrushes.getValue(B.MediumAquamarine):t)?this.getBrush(B.MediumAquamarine):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"MediumBlue",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.MediumBlue)?this.sBrushes.getValue(B.MediumBlue):t)?this.getBrush(B.MediumBlue):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"MediumOrchid",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.MediumOrchid)?this.sBrushes.getValue(B.MediumOrchid):t)?this.getBrush(B.MediumOrchid):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"MediumPurple",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.MediumPurple)?this.sBrushes.getValue(B.MediumPurple):t)?this.getBrush(B.MediumPurple):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"MediumSeaGreen",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.MediumSeaGreen)?this.sBrushes.getValue(B.MediumSeaGreen):t)?this.getBrush(B.MediumSeaGreen):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"MediumSlateBlue",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.MediumSlateBlue)?this.sBrushes.getValue(B.MediumSlateBlue):t)?this.getBrush(B.MediumSlateBlue):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"MediumSpringGreen",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.MediumSpringGreen)?this.sBrushes.getValue(B.MediumSpringGreen):t)?this.getBrush(B.MediumSpringGreen):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"MediumTurquoise",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.MediumTurquoise)?this.sBrushes.getValue(B.MediumTurquoise):t)?this.getBrush(B.MediumTurquoise):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"MediumVioletRed",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.MediumVioletRed)?this.sBrushes.getValue(B.MediumVioletRed):t)?this.getBrush(B.MediumVioletRed):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"MidnightBlue",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.MidnightBlue)?this.sBrushes.getValue(B.MidnightBlue):t)?this.getBrush(B.MidnightBlue):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"MintCream",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.MintCream)?this.sBrushes.getValue(B.MintCream):t)?this.getBrush(B.MintCream):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"MistyRose",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.MistyRose)?this.sBrushes.getValue(B.MistyRose):t)?this.getBrush(B.MistyRose):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Moccasin",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Moccasin)?this.sBrushes.getValue(B.Moccasin):t)?this.getBrush(B.Moccasin):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"NavajoWhite",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.NavajoWhite)?this.sBrushes.getValue(B.NavajoWhite):t)?this.getBrush(B.NavajoWhite):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Navy",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Navy)?this.sBrushes.getValue(B.Navy):t)?this.getBrush(B.Navy):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"OldLace",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.OldLace)?this.sBrushes.getValue(B.OldLace):t)?this.getBrush(B.OldLace):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Olive",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Olive)?this.sBrushes.getValue(B.Olive):t)?this.getBrush(B.Olive):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"OliveDrab",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.OliveDrab)?this.sBrushes.getValue(B.OliveDrab):t)?this.getBrush(B.OliveDrab):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Orange",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Orange)?this.sBrushes.getValue(B.Orange):t)?this.getBrush(B.Orange):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"OrangeRed",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.OrangeRed)?this.sBrushes.getValue(B.OrangeRed):t)?this.getBrush(B.OrangeRed):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Orchid",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Orchid)?this.sBrushes.getValue(B.Orchid):t)?this.getBrush(B.Orchid):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"PaleGoldenrod",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.PaleGoldenrod)?this.sBrushes.getValue(B.PaleGoldenrod):t)?this.getBrush(B.PaleGoldenrod):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"PaleGreen",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.PaleGreen)?this.sBrushes.getValue(B.PaleGreen):t)?this.getBrush(B.PaleGreen):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"PaleTurquoise",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.PaleTurquoise)?this.sBrushes.getValue(B.PaleTurquoise):t)?this.getBrush(B.PaleTurquoise):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"PaleVioletRed",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.PaleVioletRed)?this.sBrushes.getValue(B.PaleVioletRed):t)?this.getBrush(B.PaleVioletRed):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"PapayaWhip",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.PapayaWhip)?this.sBrushes.getValue(B.PapayaWhip):t)?this.getBrush(B.PapayaWhip):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"PeachPuff",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.PeachPuff)?this.sBrushes.getValue(B.PeachPuff):t)?this.getBrush(B.PeachPuff):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Peru",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Peru)?this.sBrushes.getValue(B.Peru):t)?this.getBrush(B.Peru):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Pink",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Pink)?this.sBrushes.getValue(B.Pink):t)?this.getBrush(B.Pink):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Plum",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Plum)?this.sBrushes.getValue(B.Plum):t)?this.getBrush(B.Plum):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"PowderBlue",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.PowderBlue)?this.sBrushes.getValue(B.PowderBlue):t)?this.getBrush(B.PowderBlue):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Purple",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Purple)?this.sBrushes.getValue(B.Purple):t)?this.getBrush(B.Purple):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Red",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Red)?this.sBrushes.getValue(B.Red):t)?this.getBrush(B.Red):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"RosyBrown",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.RosyBrown)?this.sBrushes.getValue(B.RosyBrown):t)?this.getBrush(B.RosyBrown):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"RoyalBlue",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.RoyalBlue)?this.sBrushes.getValue(B.RoyalBlue):t)?this.getBrush(B.RoyalBlue):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"SaddleBrown",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.SaddleBrown)?this.sBrushes.getValue(B.SaddleBrown):t)?this.getBrush(B.SaddleBrown):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Salmon",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Salmon)?this.sBrushes.getValue(B.Salmon):t)?this.getBrush(B.Salmon):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"SandyBrown",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.SandyBrown)?this.sBrushes.getValue(B.SandyBrown):t)?this.getBrush(B.SandyBrown):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"SeaGreen",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.SeaGreen)?this.sBrushes.getValue(B.SeaGreen):t)?this.getBrush(B.SeaGreen):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"SeaShell",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.SeaShell)?this.sBrushes.getValue(B.SeaShell):t)?this.getBrush(B.SeaShell):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Sienna",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Sienna)?this.sBrushes.getValue(B.Sienna):t)?this.getBrush(B.Sienna):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Silver",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Silver)?this.sBrushes.getValue(B.Silver):t)?this.getBrush(B.Silver):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"SkyBlue",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.SkyBlue)?this.sBrushes.getValue(B.SkyBlue):t)?this.getBrush(B.SkyBlue):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"SlateBlue",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.SlateBlue)?this.sBrushes.getValue(B.SlateBlue):t)?this.getBrush(B.SlateBlue):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"SlateGray",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.SlateGray)?this.sBrushes.getValue(B.SlateGray):t)?this.getBrush(B.SlateGray):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Snow",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Snow)?this.sBrushes.getValue(B.Snow):t)?this.getBrush(B.Snow):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"SpringGreen",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.SpringGreen)?this.sBrushes.getValue(B.SpringGreen):t)?this.getBrush(B.SpringGreen):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"SteelBlue",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.SteelBlue)?this.sBrushes.getValue(B.SteelBlue):t)?this.getBrush(B.SteelBlue):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Tan",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Tan)?this.sBrushes.getValue(B.Tan):t)?this.getBrush(B.Tan):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Teal",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Teal)?this.sBrushes.getValue(B.Teal):t)?this.getBrush(B.Teal):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Thistle",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Thistle)?this.sBrushes.getValue(B.Thistle):t)?this.getBrush(B.Thistle):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Tomato",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Tomato)?this.sBrushes.getValue(B.Tomato):t)?this.getBrush(B.Tomato):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Transparent",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Transparent)?this.sBrushes.getValue(B.Transparent):t)?this.getBrush(B.Transparent):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Turquoise",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Turquoise)?this.sBrushes.getValue(B.Turquoise):t)?this.getBrush(B.Turquoise):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Violet",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Violet)?this.sBrushes.getValue(B.Violet):t)?this.getBrush(B.Violet):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Wheat",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Wheat)?this.sBrushes.getValue(B.Wheat):t)?this.getBrush(B.Wheat):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"White",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.White)?this.sBrushes.getValue(B.White):t)?this.getBrush(B.White):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"WhiteSmoke",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.WhiteSmoke)?this.sBrushes.getValue(B.WhiteSmoke):t)?this.getBrush(B.WhiteSmoke):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Yellow",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Yellow)?this.sBrushes.getValue(B.Yellow):t)?this.getBrush(B.Yellow):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"YellowGreen",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.YellowGreen)?this.sBrushes.getValue(B.YellowGreen):t)?this.getBrush(B.YellowGreen):t},enumerable:!0,configurable:!0}),x.getBrush=function(t){var e=this.getColorValue(t),e=new mt(e);return this.sBrushes.setValue(t,e),e},x.getColorValue=function(t){var e=new f;switch(t){case B.Transparent:e=new f(0,255,255,255);break;case B.AliceBlue:e=new f(255,240,248,255);break;case B.AntiqueWhite:e=new f(255,250,235,215);break;case B.Aqua:e=new f(255,0,255,255);break;case B.Aquamarine:e=new f(255,127,255,212);break;case B.Azure:e=new f(255,240,255,255);break;case B.Beige:e=new f(255,245,245,220);break;case B.Bisque:e=new f(255,255,228,196);break;case B.Black:e=new f(255,0,0,0);break;case B.BlanchedAlmond:e=new f(255,255,235,205);break;case B.Blue:e=new f(255,0,0,255);break;case B.BlueViolet:e=new f(255,138,43,226);break;case B.Brown:e=new f(255,165,42,42);break;case B.BurlyWood:e=new f(255,222,184,135);break;case B.CadetBlue:e=new f(255,95,158,160);break;case B.Chartreuse:e=new f(255,127,255,0);break;case B.Chocolate:e=new f(255,210,105,30);break;case B.Coral:e=new f(255,255,127,80);break;case B.CornflowerBlue:e=new f(255,100,149,237);break;case B.Cornsilk:e=new f(255,255,248,220);break;case B.Crimson:e=new f(255,220,20,60);break;case B.Cyan:e=new f(255,0,255,255);break;case B.DarkBlue:e=new f(255,0,0,139);break;case B.DarkCyan:e=new f(255,0,139,139);break;case B.DarkGoldenrod:e=new f(255,184,134,11);break;case B.DarkGray:e=new f(255,169,169,169);break;case B.DarkGreen:e=new f(255,0,100,0);break;case B.DarkKhaki:e=new f(255,189,183,107);break;case B.DarkMagenta:e=new f(255,139,0,139);break;case B.DarkOliveGreen:e=new f(255,85,107,47);break;case B.DarkOrange:e=new f(255,255,140,0);break;case B.DarkOrchid:e=new f(255,153,50,204);break;case B.DarkRed:e=new f(255,139,0,0);break;case B.DarkSalmon:e=new f(255,233,150,122);break;case B.DarkSeaGreen:e=new f(255,143,188,139);break;case B.DarkSlateBlue:e=new f(255,72,61,139);break;case B.DarkSlateGray:e=new f(255,47,79,79);break;case B.DarkTurquoise:e=new f(255,0,206,209);break;case B.DarkViolet:e=new f(255,148,0,211);break;case B.DeepPink:e=new f(255,255,20,147);break;case B.DeepSkyBlue:e=new f(255,0,191,255);break;case B.DimGray:e=new f(255,105,105,105);break;case B.DodgerBlue:e=new f(255,30,144,255);break;case B.Firebrick:e=new f(255,178,34,34);break;case B.FloralWhite:e=new f(255,255,250,240);break;case B.ForestGreen:e=new f(255,34,139,34);break;case B.Fuchsia:e=new f(255,255,0,255);break;case B.Gainsboro:e=new f(255,220,220,220);break;case B.GhostWhite:e=new f(255,248,248,255);break;case B.Gold:e=new f(255,255,215,0);break;case B.Goldenrod:e=new f(255,218,165,32);break;case B.Gray:e=new f(255,128,128,128);break;case B.Green:e=new f(255,0,128,0);break;case B.GreenYellow:e=new f(255,173,255,47);break;case B.Honeydew:e=new f(255,240,255,240);break;case B.HotPink:e=new f(255,255,105,180);break;case B.IndianRed:e=new f(255,205,92,92);break;case B.Indigo:e=new f(255,75,0,130);break;case B.Ivory:e=new f(255,255,255,240);break;case B.Khaki:e=new f(255,240,230,140);break;case B.Lavender:e=new f(255,230,230,250);break;case B.LavenderBlush:e=new f(255,255,240,245);break;case B.LawnGreen:e=new f(255,124,252,0);break;case B.LemonChiffon:e=new f(255,255,250,205);break;case B.LightBlue:e=new f(255,173,216,230);break;case B.LightCoral:e=new f(255,240,128,128);break;case B.LightCyan:e=new f(255,224,255,255);break;case B.LightGoldenrodYellow:e=new f(255,250,250,210);break;case B.LightGreen:e=new f(255,144,238,144);break;case B.LightGray:e=new f(255,211,211,211);break;case B.LightPink:e=new f(255,255,182,193);break;case B.LightSalmon:e=new f(255,255,160,122);break;case B.LightSeaGreen:e=new f(255,32,178,170);break;case B.LightSkyBlue:e=new f(255,135,206,250);break;case B.LightSlateGray:e=new f(255,119,136,153);break;case B.LightSteelBlue:e=new f(255,176,196,222);break;case B.LightYellow:e=new f(255,255,255,224);break;case B.Lime:e=new f(255,0,255,0);break;case B.LimeGreen:e=new f(255,50,205,50);break;case B.Linen:e=new f(255,250,240,230);break;case B.Magenta:e=new f(255,255,0,255);break;case B.Maroon:e=new f(255,128,0,0);break;case B.MediumAquamarine:e=new f(255,102,205,170);break;case B.MediumBlue:e=new f(255,0,0,205);break;case B.MediumOrchid:e=new f(255,186,85,211);break;case B.MediumPurple:e=new f(255,147,112,219);break;case B.MediumSeaGreen:e=new f(255,60,179,113);break;case B.MediumSlateBlue:e=new f(255,123,104,238);break;case B.MediumSpringGreen:e=new f(255,0,250,154);break;case B.MediumTurquoise:e=new f(255,72,209,204);break;case B.MediumVioletRed:e=new f(255,199,21,133);break;case B.MidnightBlue:e=new f(255,25,25,112);break;case B.MintCream:e=new f(255,245,255,250);break;case B.MistyRose:e=new f(255,255,228,225);break;case B.Moccasin:e=new f(255,255,228,181);break;case B.NavajoWhite:e=new f(255,255,222,173);break;case B.Navy:e=new f(255,0,0,128);break;case B.OldLace:e=new f(255,253,245,230);break;case B.Olive:e=new f(255,128,128,0);break;case B.OliveDrab:e=new f(255,107,142,35);break;case B.Orange:e=new f(255,255,165,0);break;case B.OrangeRed:e=new f(255,255,69,0);break;case B.Orchid:e=new f(255,218,112,214);break;case B.PaleGoldenrod:e=new f(255,238,232,170);break;case B.PaleGreen:e=new f(255,152,251,152);break;case B.PaleTurquoise:e=new f(255,175,238,238);break;case B.PaleVioletRed:e=new f(255,219,112,147);break;case B.PapayaWhip:e=new f(255,255,239,213);break;case B.PeachPuff:e=new f(255,255,218,185);break;case B.Peru:e=new f(255,205,133,63);break;case B.Pink:e=new f(255,255,192,203);break;case B.Plum:e=new f(255,221,160,221);break;case B.PowderBlue:e=new f(255,176,224,230);break;case B.Purple:e=new f(255,128,0,128);break;case B.Red:e=new f(255,255,0,0);break;case B.RosyBrown:e=new f(255,188,143,143);break;case B.RoyalBlue:e=new f(255,65,105,225);break;case B.SaddleBrown:e=new f(255,139,69,19);break;case B.Salmon:e=new f(255,250,128,114);break;case B.SandyBrown:e=new f(255,244,164,96);break;case B.SeaGreen:e=new f(255,46,139,87);break;case B.SeaShell:e=new f(255,255,245,238);break;case B.Sienna:e=new f(255,160,82,45);break;case B.Silver:e=new f(255,192,192,192);break;case B.SkyBlue:e=new f(255,135,206,235);break;case B.SlateBlue:e=new f(255,106,90,205);break;case B.SlateGray:e=new f(255,112,128,144);break;case B.Snow:e=new f(255,255,250,250);break;case B.SpringGreen:e=new f(255,0,255,127);break;case B.SteelBlue:e=new f(255,70,130,180);break;case B.Tan:e=new f(255,210,180,140);break;case B.Teal:e=new f(255,0,128,128);break;case B.Thistle:e=new f(255,216,191,216);break;case B.Tomato:e=new f(255,255,99,71);break;case B.Turquoise:e=new f(255,64,224,208);break;case B.Violet:e=new f(255,238,130,238);break;case B.Wheat:e=new f(255,245,222,179);break;case B.White:e=new f(255,255,255,255);break;case B.WhiteSmoke:e=new f(255,245,245,245);break;case B.Yellow:e=new f(255,255,255,0);break;case B.YellowGreen:e=new f(255,154,205,50)}return e},x.sBrushes=new a;var O=x;function x(){}Object.defineProperty(so.prototype,"factors",{get:function(){return this.mFactors},set:function(t){if(null==t)throw new Error("ArgumentNullException : Factors");this.mFactors=t},enumerable:!0,configurable:!0}),Object.defineProperty(so.prototype,"positions",{get:function(){return this.mPositions},set:function(t){for(var e=t,i=0;i<e.length;i++)(e[i]<0||1<e[i])&&(e[i]=0);this.mPositions=e,this.mPositions=t},enumerable:!0,configurable:!0}),Object.defineProperty(so.prototype,"count",{get:function(){return this.mCount},enumerable:!0,configurable:!0}),so.prototype.generateColorBlend=function(t,e){if(null==t)throw new Error("ArgumentNullException : colours");null==this.positions&&(this.positions=[0]);var i=new lo(this.count),r=this.positions,n=null;if(1===r.length)(r=[3])[0]=0,r[1]=this.positions[0],r[2]=1,(n=new Array(3))[0]=t[0],n[1]=t[0],n[2]=t[1];else for(var o=t[0],s=t[1],n=new Array(this.count),a=0,h=this.count,a=0;a<h;++a)n[a]=this.interpolate(this.mFactors[a],o,s,e);return i.positions=r,i.colors=n,i},so.prototype.clonePdfBlend=function(){return null!=this.mFactors&&(this.factors=this.mFactors),null!=this.positions&&(this.positions=this.positions),this},so.prototype.gcd=function(t,e){if("number"==typeof t&&"number"==typeof e&&void 0!==e){if(t<0||1<t)throw new Error("ArgumentOutOfRangeException : u");if(e<0||1<e)throw new Error("ArgumentOutOfRangeException : v");var i=Math.max(1,t*this.precision),e=Math.max(1,e*this.precision);return this.gcdInt(i,e)/this.precision}var r=t;if(null==r)throw new Error("ArgumentNullException : values");if(r.length<1)throw new Error("ArgumentException : Not enough values in the array. - values");var n=r[0];if(1<r.length)for(var o=r.length,s=1;s<o&&(n=this.gcd(r[s],n))!==1/this.precision;++s);return n},so.prototype.gcdInt=function(t,e){if(t<=0)throw new Error("ArgumentOutOfRangeException"+t+"The arguments cannot be less or equal to zero.");if(e<=0)throw new Error("ArgumentOutOfRangeException"+e+"The arguments cannot be less or equal to zero.");if(1===t||1===e)return 1;for(var i,r=0;this.isEven(t,e);)++r,t>>=1,e>>=1;for(;(1&t)<=0;)t>>=1;do{for(;(1&e)<=0;)e>>=1}while(e<t&&(i=e,e=t,t=i),0!==(e-=t));return t<<r},so.prototype.isEven=function(t,e){return"number"==typeof e&&void 0!==e?(1&t)<=0&&(1&e)<=0:(1&t)<=0},so.prototype.interpolate=function(t,e,i,r){if(e instanceof f){var n=new f;switch(r){case K.PdfColorSpace.Rgb:var o=this.interpolate(t,e.red,i.red),s=this.interpolate(t,e.green,i.green),a=this.interpolate(t,e.blue,i.blue),n=new f(o,s,a);break;case K.PdfColorSpace.GrayScale:o=this.interpolate(t,e.gray,i.gray);n=new f(o);break;case K.PdfColorSpace.Cmyk:var s=this.interpolate(t,e.c,i.c),a=this.interpolate(t,e.m,i.m),o=this.interpolate(t,e.y,i.y),h=this.interpolate(t,e.k,i.k);n=new f(s,a,o,h)}return n}return 0===t?e:1===t?i:e+ +t*(i-e)};var oo=so;function so(t){this.precision=1e3}ao=function(t,e){return(ao=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}ao(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(uo,ho=oo),Object.defineProperty(uo.prototype,"colors",{get:function(){return this.mcolors},set:function(t){if(null==t)throw new Error("ArgumentNullException : Colors");this.mcolors=t},enumerable:!0,configurable:!0}),uo.prototype.getFunction=function(t){var e,i,r,n,o=this.getColorComponentsCount(t),s=this.getMaxComponentValue(t),o=this.setRange(o,s),a=null;return null==this.mbrush&&void 0===this.mbrush?(e=[1],r=void 0,i=1,r=2===this.positions.length?2:(n=this.positions,n=this.getIntervals(n),1/(i=this.gcd(n))+1),e[0]=r,n=this.getSamplesValues(t,r,s,i),new ro([0,1],o,e,n)):a},uo.prototype.cloneColorBlend=function(){return null!=this.mcolors&&void 0!==this.mcolors&&(this.colors=this.mcolors),null!=this.positions&&void 0!==this.positions&&(this.positions=this.positions),this},uo.prototype.setRange=function(t,e){for(var i=[2*t],r=0;r<t;++r)i[2*r]=0,i[2*r+1]=1;return i},uo.prototype.getColorComponentsCount=function(t){var e=0;switch(t){case K.PdfColorSpace.Rgb:e=3;break;case K.PdfColorSpace.Cmyk:e=4;break;case K.PdfColorSpace.GrayScale:e=1;break;default:throw new Error("ArgumentException - Unsupported color space: "+t+" colorSpace")}return e},uo.prototype.getSamplesValues=function(t,e,i,r){var n;switch(t){case K.PdfColorSpace.GrayScale:n=this.getGrayscaleSamples(e,i,r);break;case K.PdfColorSpace.Cmyk:n=this.getCmykSamples(e,i,r);break;case K.PdfColorSpace.Rgb:n=this.getRgbSamples(e,i,r);break;default:throw new Error("ArgumentException - Unsupported color space: "+t+" colorSpace")}return n},uo.prototype.getGrayscaleSamples=function(t,e,i){for(var r=[2*t],n=0;n<t;++n)this.getNextColor(n,i,K.PdfColorSpace.GrayScale);return r},uo.prototype.getRgbSamples=function(t,e,i){for(var r=[3*t],n=0;n<t;++n){var o=this.getNextColor(n,i,K.PdfColorSpace.Rgb),s=3*n;r[s]=o.r,r[1+s]=o.g,r[2+s]=o.b}return r},uo.prototype.getCmykSamples=function(t,e,i){for(var r=[4*t],n=0;n<t;n++){var o=this.getNextColor(n,i,K.PdfColorSpace.Cmyk),s=4*n;r[s]=o.c*e,r[1+s]=o.m*e,r[2+s]=o.y*e,r[3+s]=o.k*e}return r},uo.prototype.getNextColor=function(t,e,i){var r,n,e=e*t,t=this.getIndices(e,void 0,void 0),o=t.indexLow,t=t.indexHi;return o===t?this.mcolors[o]:(r=this.positions[o],n=this.positions[t],o=this.mcolors[o],t=this.mcolors[t],this.interpolate((e-r)/(n-r),o,t,i))},uo.prototype.getIndices=function(t,e,i){for(var r=this.positions,n=i=e=0;n<this.mcolors.length;++n){var o=r[n];if(o===t){e=i=n;break}if(t<o){i=n;break}i=e=n}return{indexLow:e,indexHi:i}},uo.prototype.getMaxComponentValue=function(t){var e=0;switch(t){case K.PdfColorSpace.Cmyk:case K.PdfColorSpace.Rgb:e=255;break;case K.PdfColorSpace.GrayScale:e=65535;break;default:throw new Error("ArgumentException - Unsupported color space: "+t+"colorSpace")}return e},uo.prototype.getIntervals=function(t){for(var e=t.length,i=[e-1],r=t[0],n=1;n<e;++n){var o=t[n];i[n-1]=o-r,r=o}return i};var ao,ho,lo=uo;function uo(t){var e=ho.call(this)||this;return e="number"==typeof t?ho.call(this,t)||this:e}co=function(t,e){return(co=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}co(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(go,po=vi),go.prototype.initialize=function(t,e){this.mColours=[t,e],this.mColourBlend=new lo(2),this.mColourBlend.positions=[0,1],this.mColourBlend.colors=this.mColours,this.initShading()},Object.defineProperty(go.prototype,"blend",{get:function(){return this.mBlend},set:function(t){if(null==t)throw new Error("ArgumentNullException : Blend");if(null==this.mColours)throw new Error("NotSupportedException : There is no starting and ending colours specified.");this.mBlend=t,this.mColourBlend=this.mBlend.generateColorBlend(this.mColours,this.colorSpace),this.resetFunction()},enumerable:!0,configurable:!0}),Object.defineProperty(go.prototype,"interpolationColors",{get:function(){return this.mColourBlend},set:function(t){if(null==t)throw new Error("ArgumentNullException : InterpolationColors");this.mBlend=null,this.mColours=null,this.mColourBlend=t,this.resetFunction()},enumerable:!0,configurable:!0}),Object.defineProperty(go.prototype,"linearColors",{get:function(){return this.mColours},set:function(t){if(null==t)throw new Error("ArgumentNullException : LinearColors");if(t.length<2)throw new Error("ArgumentException : The array is too small - LinearColors");null==this.mColours&&void 0===this.mColours?this.mColours=[t[0],t[1]]:(this.mColours[0]=t[0],this.mColours[1]=t[1]),null==this.mBlend&&void 0===this.mBlend?(this.mColourBlend=new lo(2),this.mColourBlend.colors=this.mColours,this.mColourBlend.positions=[0,1]):this.mColourBlend=this.mBlend.generateColorBlend(this.mColours,this.colorSpace),this.resetFunction()},enumerable:!0,configurable:!0}),Object.defineProperty(go.prototype,"rectangle",{get:function(){return this.mBoundaries},enumerable:!0,configurable:!0}),Object.defineProperty(go.prototype,"extend",{get:function(){var t,e=to.None,i=this.shading.items.getValue(this.mDictionaryProperties.extend);return null!=i&&(t=i.items(0),i=i.items(1),t.value&&(e|=to.Start),i.value)&&(e|=to.End),e},set:function(t){var e,i,r=this.shading.items.getValue(this.mDictionaryProperties.extend);null==r?(e=new It(!1),i=new It(!1),(r=new p).add(e),r.add(i),this.shading.items.setValue(this.mDictionaryProperties.extend,r)):(e=r.items(0),r.items(1))},enumerable:!0,configurable:!0}),go.prototype.addPoints=function(t,e){var i=t.x+e.x,t=t.y+e.y;return new q(i,t)},go.prototype.subPoints=function(t,e){var i=t.x-e.x,t=t.y-e.y;return new q(i,t)},go.prototype.mulPoints=function(t,e){return t.x*e.x+t.y*e.y},go.prototype.mulPoint=function(t,e){return t.x=t.x*e,t.y=t.y*e,t},go.prototype.choosePoint=function(t){var e=new q(0,0);if(t<90&&0<t)e=new q(this.mBoundaries.right,this.mBoundaries.bottom);else if(t<180&&90<t)e=new q(this.mBoundaries.left,this.mBoundaries.bottom);else if(t<270&&180<t)e=new q(this.mBoundaries.left,this.mBoundaries.top);else{if(!(270<t))throw new Error("PdfException - Internal error.");e=new q(this.mBoundaries.right,this.mBoundaries.top)}return e},go.prototype.setPoints=function(t,e){var i=new p;i.add(new u(t.x)),i.add(new u(this.updateY(t.y))),i.add(new u(e.x)),i.add(new u(this.updateY(e.y))),this.shading.items.setValue(this.mDictionaryProperties.coords,i)},go.prototype.updateY=function(t){return 0!==t?-t:t},go.prototype.initShading=function(){this.colorSpace=K.PdfColorSpace.Rgb,this.function=this.mColourBlend.getFunction(this.colorSpace),this.shading.items.setValue(this.mDictionaryProperties.shadingType,new u(io.Axial))},go.prototype.clone=function(){var t=this;return t.resetPatternDictionary(new c(this.patternDictionary)),t.shading=new c,t.initShading(),t.setPoints(t.mPointStart,t.mPointEnd),null!==t&&t instanceof go&&null!=this.matrix&&void 0!==this.matrix&&(t.matrix=this.matrix.clone()),null!=this.mColours&&void 0!==this.mColours&&(t.mColours=this.mColours),null!=this.blend&&void 0!==this.blend?t.blend=this.blend.clonePdfBlend():null!=this.interpolationColors&&void 0!==this.interpolationColors&&(t.interpolationColors=this.interpolationColors.cloneColorBlend()),t.extend=this.extend,this.cloneBackgroundValue(t),this.cloneAntiAliasingValue(t),t},go.prototype.resetFunction=function(){this.function=this.mColourBlend.getFunction(this.colorSpace)};var co,po,fo=go;function go(t,e,i,r){var n,o,s,a=po.call(this,new c)||this;if(a.mDictionaryProperties=new l,t instanceof q&&e instanceof q&&i instanceof f&&r instanceof f)a.initialize(i,r),a.mPointStart=t,a.mPointEnd=e,a.setPoints(a.mPointStart,a.mPointEnd);else if(t instanceof ut)if(a.initialize(e,i),r===eo.BackwardDiagonal||r===eo.ForwardDiagonal||r===eo.Horizontal||r===eo.Vertical){switch(a.mBoundaries=t,r){case eo.BackwardDiagonal:a.mPointStart=new q(t.right,t.top),a.mPointEnd=new q(t.left,t.bottom);break;case eo.ForwardDiagonal:a.mPointStart=new q(t.left,t.top),a.mPointEnd=new q(t.right,t.bottom);break;case eo.Horizontal:a.mPointStart=new q(t.left,t.top),a.mPointEnd=new q(t.right,t.top);break;case eo.Vertical:a.mPointStart=new q(t.left,t.top),a.mPointEnd=new q(t.left,t.bottom);break;default:throw new Error("ArgumentException -- Unsupported linear gradient mode: "+r+" mode")}a.setPoints(a.mPointStart,a.mPointEnd)}else"number"==typeof r&&void 0!==r&&(a.mBoundaries=t,0===(r%=360)?(a.mPointStart=new q(t.left,t.top),a.mPointEnd=new q(t.right,t.top)):90===r?(a.mPointStart=new q(t.left,t.top),a.mPointEnd=new q(t.left,t.bottom)):180===r?(a.mPointEnd=new q(t.left,t.top),a.mPointStart=new q(t.right,t.top)):270===r?(a.mPointEnd=new q(t.left,t.top),a.mPointStart=new q(t.left,t.bottom)):(e=r*(Math.PI/180),i=Math.tan(e),o=a.mBoundaries.left+(a.mBoundaries.right-a.mBoundaries.left)/2,s=a.mBoundaries.top+(a.mBoundaries.bottom-a.mBoundaries.top)/2,n=new q(o,s),s=i*(o=a.mBoundaries.width/(2*Math.cos(e))),o+=n.x,s+=n.y,i=new q(o,s),e=a.subPoints(i,n),o=a.choosePoint(r),s=a.mulPoints(a.subPoints(o,n),e)/a.mulPoints(e,e),a.mPointEnd=a.addPoints(n,a.mulPoint(e,s)),a.mPointStart=a.addPoints(n,a.mulPoint(e,-1*s))),a.setPoints(a.mPointEnd,a.mPointStart));return a}mo=function(t,e){return(mo=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}mo(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(wo,yo=vi),wo.prototype.initialize=function(t,e){this.mColour=[t,e],this.mColourBlends=new lo(2),this.mColourBlends.positions=[0,1],this.mColourBlends.colors=this.mColour,this.initShading()},Object.defineProperty(wo.prototype,"blend",{get:function(){return this.mBlend},set:function(t){if(null==t)throw new Error("ArgumentNullException : Blend");if(null==this.mColour&&void 0===this.mColour)throw new Error("NotSupportedException : There is no starting and ending colours specified.");this.mBlend=t,this.mColourBlends=this.mBlend.generateColorBlend(this.mColour,this.colorSpace),this.resetFunction()},enumerable:!0,configurable:!0}),Object.defineProperty(wo.prototype,"interpolationColors",{get:function(){return this.mColourBlends},set:function(t){if(null==t)throw new Error("ArgumentNullException : InterpolationColors");this.mBlend=null,this.mColour=null,this.mColourBlends=t,this.resetFunction()},enumerable:!0,configurable:!0}),Object.defineProperty(wo.prototype,"linearColors",{get:function(){return this.mColour},set:function(t){if(null==t)throw new Error("ArgumentNullException : radial LinearColors");if(t.length<2)throw new Error("ArgumentException : The array is too small LinearColors");null==this.mColour&&void 0===this.mColour?this.mColour=[t[0],t[1]]:(this.mColour[0]=t[0],this.mColour[1]=t[1]),null==this.mBlend&&void 0===this.mBlend?(this.mColourBlends=new lo(2),this.mColourBlends.colors=this.mColour,this.mColourBlends.positions=[0,1]):this.mColourBlends=this.mBlend.generateColorBlend(this.mColour,this.colorSpace),this.resetFunction()},enumerable:!0,configurable:!0}),Object.defineProperty(wo.prototype,"rectangle",{get:function(){return this.mBoundaries},set:function(t){this.mBoundaries=t,this.bBox=p.fromRectangle(t)},enumerable:!0,configurable:!0}),Object.defineProperty(wo.prototype,"extend",{get:function(){var t,e=to.None,i=this.shading.items.getValue(this.mDictionaryProperties.extend);return null!=i&&(t=i.items(0),i=i.items(1),t.value&&(e|=to.Start),i.value)&&(e|=to.End),e},set:function(t){var e,i,r=this.shading.items.getValue(this.mDictionaryProperties.extend);null==r&&void 0===r?(e=new It(!1),i=new It(!1),(r=new p).add(e),r.add(i),this.shading.items.setValue(this.mDictionaryProperties.extend,r)):(e=r.items(0),r.items(1))},enumerable:!0,configurable:!0}),wo.prototype.setPoints=function(t,e,i,r){var n=new p;n.add(new u(t.x)),n.add(new u(this.updateY(t.y))),n.add(new u(i)),n.add(new u(e.x)),n.add(new u(this.updateY(e.y))),i!==r?n.add(new u(r)):n.add(new u(0)),this.shading.items.setValue(this.mDictionaryProperties.coords,n)},wo.prototype.updateY=function(t){return 0!==t?-t:t},wo.prototype.initShading=function(){this.colorSpace=K.PdfColorSpace.Rgb,this.function=this.mColourBlends.getFunction(this.colorSpace),this.shading.items.setValue(this.mDictionaryProperties.shadingType,new u(io.Radial))},wo.prototype.clone=function(){var t=this;return t.resetPatternDictionary(new c(this.patternDictionary)),t.shading=new c,t.initShading(),t.setPoints(this.mPointStart,this.mPointEnd,this.mRadiusStart,this.mRadiusEnd),t instanceof wo&&null!==this.matrix&&void 0!==this.matrix&&(t.matrix=this.matrix.clone()),null!==this.mColour&&void 0!==this.mColour&&(t.mColour=this.mColour),null!==this.blend&&void 0!==this.blend?t.blend=this.blend.clonePdfBlend():null!==this.interpolationColors&&void 0!==this.interpolationColors&&(t.interpolationColors=this.interpolationColors.cloneColorBlend()),t.extend=this.extend,this.cloneBackgroundValue(t),this.cloneAntiAliasingValue(t),t},wo.prototype.resetFunction=function(){this.function=this.mColourBlends.getFunction(this.colorSpace)};var mo,yo,bo=wo;function wo(t,e,i,r,n,o){var s=yo.call(this,new c)||this;if(s.mDictionaryProperties=new l,s.initialize(n,o),e<0)throw new Error("ArgumentOutOfRangeException : radiusStart - The radius cannot be less then zero.");if(r<0)throw new Error("ArgumentOutOfRangeException : radiusEnd - The radius cannpt be less then zero.");return s.mPointEnd=i,s.mPointStart=t,s.mRadiusStart=e,s.mRadiusEnd=r,s.setPoints(s.mPointStart,s.mPointEnd,s.mRadiusStart,s.mRadiusEnd),s}(L=K.PdfBorderOverlapStyle||(K.PdfBorderOverlapStyle={}))[L.Overlap=0]="Overlap",L[L.Inside=1]="Inside";Po=function(t,e){return(Po=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var Po,L=function(t,e){function i(){this.constructor=t}Po(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},So=(Object.defineProperty(vo.prototype,"backgroundBrush",{get:function(){return this.gridBackgroundBrush},set:function(t){this.gridBackgroundBrush=t},enumerable:!0,configurable:!0}),Object.defineProperty(vo.prototype,"textBrush",{get:function(){return this.gridTextBrush},set:function(t){this.gridTextBrush=t},enumerable:!0,configurable:!0}),Object.defineProperty(vo.prototype,"textPen",{get:function(){return this.gridTextPen},set:function(t){this.gridTextPen=t},enumerable:!0,configurable:!0}),Object.defineProperty(vo.prototype,"font",{get:function(){return this.gridFont},set:function(t){this.gridFont=t},enumerable:!0,configurable:!0}),Object.defineProperty(vo.prototype,"backgroundImage",{get:function(){return this.gridBackgroundImage},set:function(t){this.gridBackgroundImage=t},enumerable:!0,configurable:!0}),vo);function vo(){}L(Oo,Co=So),Object.defineProperty(Oo.prototype,"cellSpacing",{get:function(){return void 0===this.gridCellSpacing&&(this.gridCellSpacing=0),this.gridCellSpacing},set:function(t){this.gridCellSpacing=t},enumerable:!0,configurable:!0}),Object.defineProperty(Oo.prototype,"horizontalOverflowType",{get:function(){return this.gridHorizontalOverflowType},set:function(t){this.gridHorizontalOverflowType=t},enumerable:!0,configurable:!0}),Object.defineProperty(Oo.prototype,"allowHorizontalOverflow",{get:function(){return this.bAllowHorizontalOverflow},set:function(t){this.bAllowHorizontalOverflow=t},enumerable:!0,configurable:!0}),Object.defineProperty(Oo.prototype,"cellPadding",{get:function(){return void 0===this.gridCellPadding&&(this.gridCellPadding=new en),this.gridCellPadding},set:function(t){void 0===this.gridCellPadding&&(this.gridCellPadding=new en),this.gridCellPadding=t},enumerable:!0,configurable:!0}),Object.defineProperty(Oo.prototype,"borderOverlapStyle",{get:function(){return this.gridBorderOverlapStyle},set:function(t){this.gridBorderOverlapStyle=t},enumerable:!0,configurable:!0});var Co,Bo=Oo;function Oo(){var t=Co.call(this)||this;return t.gridBorderOverlapStyle=K.PdfBorderOverlapStyle.Overlap,t.bAllowHorizontalOverflow=!1,t.gridHorizontalOverflowType=K.PdfHorizontalOverflowType.LastPage,t}L(To,xo=So),Object.defineProperty(To.prototype,"stringFormat",{get:function(){return this.format},set:function(t){this.format=t},enumerable:!0,configurable:!0}),Object.defineProperty(To.prototype,"borders",{get:function(){return this.gridCellBorders},set:function(t){this.gridCellBorders=t},enumerable:!0,configurable:!0}),Object.defineProperty(To.prototype,"cellPadding",{get:function(){return this.gridCellPadding},set:function(t){null!=this.gridCellPadding&&void 0!==this.gridCellPadding||(this.gridCellPadding=new en),this.gridCellPadding=t},enumerable:!0,configurable:!0});var xo,Lo=To;function To(){var t=xo.call(this)||this;return t.gridCellBorders=Qr.default,t}Object.defineProperty(ko.prototype,"backgroundBrush",{get:function(){return this.gridRowBackgroundBrush},enumerable:!0,configurable:!0}),ko.prototype.setBackgroundBrush=function(t){if(this.gridRowBackgroundBrush=t,void 0!==this.parent)for(var e=0;e<this.parent.cells.count;e++)this.parent.cells.getCell(e).style.backgroundBrush=t},Object.defineProperty(ko.prototype,"textBrush",{get:function(){return this.gridRowTextBrush},enumerable:!0,configurable:!0}),ko.prototype.setTextBrush=function(t){if(this.gridRowTextBrush=t,void 0!==this.parent)for(var e=0;e<this.parent.cells.count;e++)this.parent.cells.getCell(e).style.textBrush=t},Object.defineProperty(ko.prototype,"textPen",{get:function(){return this.gridRowTextPen},enumerable:!0,configurable:!0}),ko.prototype.setTextPen=function(t){if(this.gridRowTextPen=t,void 0!==this.parent)for(var e=0;e<this.parent.cells.count;e++)this.parent.cells.getCell(e).style.textPen=t},Object.defineProperty(ko.prototype,"font",{get:function(){return this.gridRowFont},enumerable:!0,configurable:!0}),ko.prototype.setFont=function(t){if(this.gridRowFont=t,void 0!==this.parent)for(var e=0;e<this.parent.cells.count;e++)this.parent.cells.getCell(e).style.font=t},Object.defineProperty(ko.prototype,"border",{get:function(){return void 0===this.gridRowBorder&&this.setBorder(new Qr),this.gridRowBorder},enumerable:!0,configurable:!0}),ko.prototype.setBorder=function(t){if(this.gridRowBorder=t,void 0!==this.parent)for(var e=0;e<this.parent.cells.count;e++)this.parent.cells.getCell(e).style.borders=t},ko.prototype.setParent=function(t){this.parent=t},Object.defineProperty(ko.prototype,"backgroundImage",{get:function(){return this.gridRowBackgroundImage},enumerable:!0,configurable:!0}),ko.prototype.setBackgroundImage=function(t){this.gridRowBackgroundImage=t};var jo=ko;function ko(){}(L=K.PdfHorizontalOverflowType||(K.PdfHorizontalOverflowType={}))[L.NextPage=0]="NextPage",L[L.LastPage=1]="LastPage";Object.defineProperty(T.prototype,"isCellMergeContinue",{get:function(){return this.internalIsCellMergeContinue},set:function(t){this.internalIsCellMergeContinue=t},enumerable:!0,configurable:!0}),Object.defineProperty(T.prototype,"isRowMergeContinue",{get:function(){return this.internalIsRowMergeContinue},set:function(t){this.internalIsRowMergeContinue=t},enumerable:!0,configurable:!0}),Object.defineProperty(T.prototype,"isCellMergeStart",{get:function(){return this.internalIsCellMergeStart},set:function(t){this.internalIsCellMergeStart=t},enumerable:!0,configurable:!0}),Object.defineProperty(T.prototype,"isRowMergeStart",{get:function(){return this.internalIsRowMergeStart},set:function(t){this.internalIsRowMergeStart=t},enumerable:!0,configurable:!0}),Object.defineProperty(T.prototype,"remainingString",{get:function(){return this.remaining},set:function(t){this.remaining=t},enumerable:!0,configurable:!0}),Object.defineProperty(T.prototype,"FinishedDrawingCell",{get:function(){return this.isFinish},set:function(t){this.isFinish=t},enumerable:!0,configurable:!0}),Object.defineProperty(T.prototype,"stringFormat",{get:function(){return null==this.format&&(this.format=new bt),this.format},set:function(t){this.format=t},enumerable:!0,configurable:!0}),Object.defineProperty(T.prototype,"row",{get:function(){return this.gridRow},set:function(t){this.gridRow=t},enumerable:!0,configurable:!0}),Object.defineProperty(T.prototype,"value",{get:function(){return this.objectValue},set:function(t){if(this.objectValue=t,this.objectValue instanceof Ko){this.row.grid.isSingleGrid=!1;(this.objectValue.ParentCell=this).objectValue.isChildGrid=!0;for(var e=this.row.grid.rows.count,i=0;i<e;i++)for(var r=this.row.grid.rows.getRow(i),n=r.cells.count,o=0;o<n;o++)r.cells.getCell(o).parent=this}},enumerable:!0,configurable:!0}),Object.defineProperty(T.prototype,"rowSpan",{get:function(){return this.gridRowSpan},set:function(t){if(t<1)throw new Error("ArgumentException : Invalid span specified, must be greater than or equal to 1");this.gridRowSpan=t,this.row.rowSpanExists=!0,this.row.grid.hasRowSpanSpan=!0},enumerable:!0,configurable:!0}),Object.defineProperty(T.prototype,"style",{get:function(){return null==this.cellStyle&&(this.cellStyle=new Lo),this.cellStyle},set:function(t){this.cellStyle=t},enumerable:!0,configurable:!0}),Object.defineProperty(T.prototype,"height",{get:function(){return 0===this.cellHeight&&(this.cellHeight=this.measureHeight()),this.cellHeight},set:function(t){this.cellHeight=t},enumerable:!0,configurable:!0}),Object.defineProperty(T.prototype,"columnSpan",{get:function(){return this.colSpan},set:function(t){if(t<1)throw Error("Invalid span specified, must be greater than or equal to 1");this.colSpan=t,this.row.columnSpanExists=!0},enumerable:!0,configurable:!0}),Object.defineProperty(T.prototype,"width",{get:function(){return 0!==this.cellWidth&&!this.row.grid.isComplete||(this.cellWidth=this.measureWidth()),Math.round(this.cellWidth)},set:function(t){this.cellWidth=t},enumerable:!0,configurable:!0}),T.prototype.measureWidth=function(){var t,e=0,i=new vt;return"string"==typeof this.objectValue?e=(e+=i.layout(this.objectValue,this.getTextFont(),this.stringFormat,new Y(Number.MAX_VALUE,Number.MAX_VALUE),!1,new Y(0,0)).actualSize.width)+2*(this.style.borders.left.width+this.style.borders.right.width):this.objectValue instanceof Ko?e=this.objectValue.size.width:this.objectValue instanceof xe||this.objectValue instanceof ke?e+=this.objectValue.width:this.objectValue instanceof Bn&&(t=this.objectValue,e=(e+=i.layout(t.text,t.font,t.stringFormat,new Y(0,0),!1,new Y(0,0)).actualSize.width)+2*(this.style.borders.left.width+this.style.borders.right.width)),this.objectValue instanceof Ko?null!=this.style.cellPadding||void 0!==this.style.cellPadding?(void 0!==this.style.cellPadding.left&&this.style.cellPadding.hasLeftPad&&(e+=this.style.cellPadding.left),void 0!==this.style.cellPadding.right&&this.style.cellPadding.hasRightPad&&(e+=this.style.cellPadding.right)):(void 0!==this.row.grid.style.cellPadding.left&&this.row.grid.style.cellPadding.hasLeftPad&&(e+=this.row.grid.style.cellPadding.left),void 0!==this.row.grid.style.cellPadding.right&&this.row.grid.style.cellPadding.hasRightPad&&(e+=this.row.grid.style.cellPadding.right)):null!=this.style.cellPadding?e+=this.style.cellPadding.left+this.style.cellPadding.right:e+=this.row.grid.style.cellPadding.left+this.row.grid.style.cellPadding.right,e+=this.row.grid.style.cellSpacing},T.prototype.drawCellBackground=function(t,e){var i=this.getBackgroundBrush();null!=i&&(t.save(),t.drawRectangle(i,e.x,e.y,e.width,e.height),t.restore()),null!=this.style.backgroundImage&&(this.getBackgroundImage(),t.drawImage(this.style.backgroundImage,e.x,e.y,e.width,e.height))},T.prototype.adjustContentLayoutArea=function(t){t=new X(t.x,t.y,t.width,t.height);return this.objectValue instanceof Ko?(null==this.style.cellPadding||void 0===this.style.cellPadding?(void 0!==this.gridRow.grid.style.cellPadding.left&&this.gridRow.grid.style.cellPadding.hasLeftPad&&(t.x+=this.gridRow.grid.style.cellPadding.left+this.cellStyle.borders.left.width,t.width-=this.gridRow.grid.style.cellPadding.left),void 0!==this.gridRow.grid.style.cellPadding.top&&this.gridRow.grid.style.cellPadding.hasTopPad&&(t.y+=this.gridRow.grid.style.cellPadding.top+this.cellStyle.borders.top.width,t.height-=this.gridRow.grid.style.cellPadding.top),void 0!==this.gridRow.grid.style.cellPadding.right&&this.gridRow.grid.style.cellPadding.hasRightPad&&(t.width-=this.gridRow.grid.style.cellPadding.right),void 0!==this.gridRow.grid.style.cellPadding.bottom&&this.gridRow.grid.style.cellPadding.hasBottomPad&&(t.height-=this.gridRow.grid.style.cellPadding.bottom)):(void 0!==this.style.cellPadding.left&&this.style.cellPadding.hasLeftPad&&(t.x+=this.style.cellPadding.left+this.cellStyle.borders.left.width,t.width-=this.style.cellPadding.left),void 0!==this.style.cellPadding.top&&this.style.cellPadding.hasTopPad&&(t.y+=this.style.cellPadding.top+this.cellStyle.borders.top.width,t.height-=this.style.cellPadding.top),void 0!==this.style.cellPadding.right&&this.style.cellPadding.hasRightPad&&(t.width-=this.style.cellPadding.right),void 0!==this.style.cellPadding.bottom&&this.style.cellPadding.hasBottomPad&&(t.height-=this.style.cellPadding.bottom)),t.width-=this.cellStyle.borders.left.width+this.cellStyle.borders.right.width,t.height-=this.cellStyle.borders.top.width+this.cellStyle.borders.bottom.width):void 0===this.style.cellPadding||null==this.style.cellPadding?(t.x+=this.gridRow.grid.style.cellPadding.left+this.cellStyle.borders.left.width,t.y+=this.gridRow.grid.style.cellPadding.top+this.cellStyle.borders.top.width,t.width-=this.gridRow.grid.style.cellPadding.right+this.gridRow.grid.style.cellPadding.left,t.height-=this.gridRow.grid.style.cellPadding.bottom+this.gridRow.grid.style.cellPadding.top,t.height-=this.cellStyle.borders.top.width+this.cellStyle.borders.bottom.width):(t.x+=this.style.cellPadding.left+this.cellStyle.borders.left.width,t.y+=this.style.cellPadding.top+this.cellStyle.borders.top.width,t.width-=this.style.cellPadding.right+this.style.cellPadding.left,t.width-=this.cellStyle.borders.left.width+this.cellStyle.borders.right.width,t.height-=this.style.cellPadding.bottom+this.style.cellPadding.top,t.height-=this.cellStyle.borders.top.width+this.cellStyle.borders.bottom.width,1===this.rowSpan&&(t.width-=this.style.borders.left.width)),t},T.prototype.draw=function(t,e,i){var r=null;if(this.internalIsCellMergeContinue||this.internalIsRowMergeContinue){if(!this.internalIsCellMergeContinue||!this.row.grid.style.allowHorizontalOverflow)return r;if(0<this.row.rowOverflowIndex&&this.row.cells.indexOf(this)!=this.row.rowOverflowIndex+1||0==this.row.rowOverflowIndex&&this.internalIsCellMergeContinue)return r}e=this.adjustOuterLayoutArea(e,t),this.drawCellBackground(t,e);var n,o,s,a,h,l=this.getTextPen(),u=this.getTextBrush(),c=(void 0===l&&void 0===u&&(u=new mt(new f(0,0,0))),this.getTextFont()),p=this.getStringFormat(),d=e;return d.height>=t.clientSize.height&&this.row.grid.allowRowBreakAcrossPages&&(d.height-=d.y,void 0!==this._rowHeight)&&null!==this._rowHeight&&d.height>this._rowHeight&&(d.height=this._rowHeight),d=this.adjustContentLayoutArea(d),"string"==typeof this.objectValue||"string"==typeof this.remaining?(o=a=void 0,o=d.height<c.height?new X(d.x,d.y,d.width,c.height):d,d.height<c.height&&this.row.grid.isChildGrid&&null!=this.row.grid.ParentCell&&(n=o.height-this.row.grid.ParentCell.row.grid.style.cellPadding.bottom-this.row.grid.style.cellPadding.bottom,-1!=this.row.grid.splitChildRowIndex&&(this.fontSpilt=!0,this.row.rowFontSplit=!0),0<n)&&n<c.height&&(o.height=n),0!=this.gridRow.grid.style.cellSpacing&&(o.width-=this.gridRow.grid.style.cellSpacing,e.width-=this.gridRow.grid.style.cellSpacing),this.isFinish?(a=""===this.remaining?this.remaining:this.objectValue,t.drawString(a,c,l,u,o.x,o.y,o.width,o.height,p),-1==this.row.grid.splitChildRowIndex||this.row.grid.isChildGrid||void 0!==this.remaining||(this.remaining="")):(void 0!==this.remaining&&null!==this.remaining||(this.remaining=""),this.row.repeatFlag&&t.drawString(this.remaining,c,l,u,o.x,o.y,o.width,o.height,p),this.isFinish=!0),r=t.stringLayoutResult):this.objectValue instanceof Ko?(a=void((n=this.objectValue).isChildGrid=!0),a=d,0!=(n.ParentCell=this).gridRow.grid.style.cellSpacing&&(e.width-=this.gridRow.grid.style.cellSpacing),o=new Jo(n),h=new es,null!=this.row.grid.LayoutFormat?h=this.row.grid.LayoutFormat:h.layout=K.PdfLayoutType.Paginate,s=new Xr,null!=t.layer&&(s.page=t.page,s.bounds=a,s.format=h,n.setSpan(),n.checkSpan(),a=o.Layouter(s),this.value=n,-1!==this.row.grid.splitChildRowIndex&&(this.height=this.row.rowBreakHeightValue),s.page!=a.page)&&(null!==this.row.rowBreakHeightValue&&void 0!==this.row.rowBreakHeightValue&&(a.bounds.height=this.row.rowBreakHeightValue),0==this.row.rowBreakHeight?this.row.NestedGridLayoutResult=a:this.row.rowBreakHeight=this.row.rowBreakHeightValue)):this.objectValue instanceof xe||this.objectValue instanceof ke?(h=void 0,h=this.objectValue.width<=d.width?new X(d.x,d.y,this.objectValue.width,d.height):d,t.drawImage(this.objectValue,h.x,h.y,h.width,h.height)):this.objectValue instanceof Bn?this.objectValue.draw(t.currentPage,d):void 0===this.objectValue&&(this.objectValue="",t.drawString(this.objectValue,c,l,u,d.x,d.y,d.width,d.height,p),null!=this.style.cellPadding&&0==this.style.cellPadding.bottom&&0==this.style.cellPadding.left&&0==this.style.cellPadding.right&&0==this.style.cellPadding.top&&(e.width-=this.style.borders.left.width+this.style.borders.right.width),0!=this.gridRow.grid.style.cellSpacing)&&(e.width-=this.gridRow.grid.style.cellSpacing),null!=this.style.borders&&(this.fontSpilt?-1!=this.row.grid.ParentCell.row.grid.splitChildRowIndex&&(this.row.rowFontSplit=!1,this.drawCellBorders(t,e)):this.drawCellBorders(t,e)),r},T.prototype.drawCellBorders=function(t,e){this.row.grid.style.borderOverlapStyle===K.PdfBorderOverlapStyle.Inside&&(e.x+=this.style.borders.left.width,e.y+=this.style.borders.top.width,e.width-=this.style.borders.right.width,e.height-=this.style.borders.bottom.width);var i=new q(e.x,e.y+e.height),r=new q(e.x,e.y),n=this.cellStyle.borders.left;this.cellStyle.borders.left.dashStyle===K.PdfDashStyle.Solid&&(n.lineCap=K.PdfLineCap.Square),0!==n.width&&t.drawLine(n,i,r),i=new q(e.x+e.width,e.y),r=new q(e.x+e.width,e.y+e.height),n=this.cellStyle.borders.right,e.x+e.width>t.clientSize.width-n.width/2&&(i=new q(t.clientSize.width-n.width/2,e.y),r=new q(t.clientSize.width-n.width/2,e.y+e.height)),this.cellStyle.borders.right.dashStyle===K.PdfDashStyle.Solid&&(n.lineCap=K.PdfLineCap.Square),0!==n.width&&t.drawLine(n,i,r),i=new q(e.x,e.y),r=new q(e.x+e.width,e.y),n=this.cellStyle.borders.top,this.cellStyle.borders.top.dashStyle===K.PdfDashStyle.Solid&&(n.lineCap=K.PdfLineCap.Square),0!==n.width&&t.drawLine(n,i,r),i=new q(e.x+e.width,e.y+e.height),r=new q(e.x,e.y+e.height),n=this.cellStyle.borders.bottom,e.y+e.height>t.clientSize.height-n.width/2&&(i=new q(e.x+e.width,t.clientSize.height-n.width/2),r=new q(e.x,t.clientSize.height-n.width/2)),this.cellStyle.borders.bottom.dashStyle===K.PdfDashStyle.Solid&&(n.lineCap=K.PdfLineCap.Square),0!==n.width&&t.drawLine(n,i,r)},T.prototype.adjustOuterLayoutArea=function(t,e){var i=!1,r=this.row.grid.style.cellSpacing,n=(0<r&&(t=new X(t.x+r,t.y+r,t.width-r,t.height-r)),this.row.cells.indexOf(this));if(1<this.columnSpan||0<this.row.rowOverflowIndex&&n==this.row.rowOverflowIndex+1&&this.isCellMergeContinue){if(1==(h=this.columnSpan)&&this.isCellMergeContinue)for(var o=n+1;o<this.row.grid.columns.count&&this.row.cells.getCell(o).isCellMergeContinue;o++)h++;for(var s=0,a=n;a<n+h;a++){if(this.row.grid.style.allowHorizontalOverflow)if((this.row.grid.size.width<e.clientSize.width?this.row.grid.size:e.clientSize).width<(this.row.grid.size.width>e.clientSize.width?t.x+s+this.row.grid.columns.getColumn(a).width:s+this.row.grid.columns.getColumn(a).width))break;s+=this.row.grid.columns.getColumn(a).width}s-=this.row.grid.style.cellSpacing,t.width=s}if(1<this.rowSpan||this.row.rowSpanExists){for(var h=this.rowSpan,l=this.row.grid.rows.rowCollection.indexOf(this.row),u=(-1==l&&-1!=(l=this.row.grid.headers.indexOf(this.row))&&(i=!0),0),a=l;a<l+h;a++){u+=(i?this.row.grid.headers.getHeader(a):this.row.grid.rows.getRow(a)).height;var c=this.row.grid.rows.getRow(a);this.row.grid.rows.rowCollection.indexOf(c)}this.row.cells.indexOf(this);u-=this.row.grid.style.cellSpacing,t.height=u,this.row.rowMergeComplete||(t.height=u)}return t},T.prototype.getTextFont=function(){return void 0!==this.style.font&&null!=this.style.font?this.style.font:void 0!==this.row.style.font&&null!=this.row.style.font?this.row.style.font:void 0!==this.row.grid.style.font&&null!=this.row.grid.style.font?this.row.grid.style.font:Br.defaultFont},T.prototype.getTextBrush=function(){return(void 0!==this.style.textBrush&&null!=this.style.textBrush?this:void 0!==this.row.style.textBrush&&null!=this.row.style.textBrush?this.row:this.row.grid).style.textBrush},T.prototype.getTextPen=function(){return(void 0!==this.style.textPen&&null!=this.style.textPen?this:void 0!==this.row.style.textPen&&null!=this.row.style.textPen?this.row:this.row.grid).style.textPen},T.prototype.getBackgroundBrush=function(){return(void 0!==this.style.backgroundBrush&&null!=this.style.backgroundBrush?this:void 0!==this.row.style.backgroundBrush&&null!=this.row.style.backgroundBrush?this.row:this.row.grid).style.backgroundBrush},T.prototype.getBackgroundImage=function(){return(void 0!==this.style.backgroundImage&&null!=this.style.backgroundImage?this:void 0!==this.row.style.backgroundImage&&null!=this.row.style.backgroundImage?this.row:this.row.grid).style.backgroundImage},T.prototype.getStringFormat=function(){return(void 0!==this.style.stringFormat&&null!=this.style.stringFormat?this.style:this).stringFormat},T.prototype.measureHeight=function(){var t,e,i=this.calculateWidth(),r=(null==this.style.cellPadding||void 0===this.style.cellPadding?i-=this.gridRow.grid.style.cellPadding.right+this.gridRow.grid.style.cellPadding.left:i=(i-=this.style.cellPadding.right+this.style.cellPadding.left)-(this.style.borders.left.width+this.style.borders.right.width),0),n=new vt;return"string"==typeof this.objectValue||"string"==typeof this.remaining?(e=this.objectValue,this.isFinish||(e=null!==this.remaining&&""!==this.remaining&&void 0!==this.remaining?this.remaining:this.objectValue),t=this.row.cells.indexOf(this),0!=this.gridRow.grid.style.cellSpacing&&(i-=2*this.gridRow.grid.style.cellSpacing),this.row.cells.getCell(t).hasColSpan||this.row.cells.getCell(t).hasRowSpan||(this.gridRow.grid.isChildGrid?(i<0?(this.tempval=i,null==this.style.cellPadding||void 0===this.style.cellPadding?this.tempval+=this.gridRow.grid.style.cellPadding.right+this.gridRow.grid.style.cellPadding.left:(this.tempval+=this.style.cellPadding.right+this.style.cellPadding.left,this.tempval+=this.style.borders.left.width+this.style.borders.right.width)):this.tempval=i,r+=n.layout(e,this.getTextFont(),this.stringFormat,new Y(this.tempval,0),!1,new Y(0,0)).actualSize.height):r+=n.layout(e,this.getTextFont(),this.stringFormat,new Y(i,0),!1,new Y(0,0)).actualSize.height),r+=2*(this.style.borders.top.width+this.style.borders.bottom.width)):this.objectValue instanceof Ko?(t=this.row.cells.indexOf(this),e=0,null!=this.style.cellPadding||void 0!==this.style.cellPadding?(e=this.calculateWidth(),void 0!==this.style.cellPadding.left&&this.style.cellPadding.hasLeftPad&&(e-=this.style.cellPadding.left),void 0!==this.style.cellPadding.right&&this.style.cellPadding.hasRightPad&&(e-=this.style.cellPadding.right)):null!=this.row.grid.style.cellPadding||void 0!==this.row.grid.style.cellPadding?(e=this.calculateWidth(),void 0!==this.row.grid.style.cellPadding.left&&this.row.grid.style.cellPadding.hasLeftPad&&(e-=this.row.grid.style.cellPadding.left),void 0!==this.row.grid.style.cellPadding.right&&this.row.grid.style.cellPadding.hasRightPad&&(e-=this.row.grid.style.cellPadding.right)):e=this.calculateWidth(),this.objectValue.tempWidth=e,this.row.cells.getCell(t).hasColSpan||this.row.cells.getCell(t).hasRowSpan?r+=2*(this.style.borders.top.width+this.style.borders.bottom.width):r=this.objectValue.size.height,0!==this.gridRow.grid.style.cellSpacing&&(i-=2*this.gridRow.grid.style.cellSpacing),null==this.style.cellPadding&&void 0===this.style.cellPadding||(void 0!==this.row.grid.style.cellPadding.top&&this.row.grid.style.cellPadding.hasTopPad&&(r+=this.row.grid.style.cellPadding.top),this.row.grid.style.cellPadding.hasBottomPad&&void 0!==this.row.grid.style.cellPadding.bottom&&(r+=this.row.grid.style.cellPadding.bottom)),r+=this.objectValue.style.cellSpacing):this.objectValue instanceof xe||this.objectValue instanceof ke?r+=this.objectValue.height:this.objectValue instanceof Bn?(e=this.objectValue,r=(r+=n.layout(e.text,e.font,e.stringFormat,new Y(i,0),!1,new Y(0,0)).actualSize.height)+2*(this.style.borders.top.width+this.style.borders.bottom.width)):void 0===this.objectValue&&(null==this.style.cellPadding||void 0===this.style.cellPadding?i-=this.gridRow.grid.style.cellPadding.right+this.gridRow.grid.style.cellPadding.left:i=(i-=this.style.cellPadding.right+this.style.cellPadding.left)-(this.style.borders.left.width+this.style.borders.right.width),r+=2*(this.style.borders.top.width+this.style.borders.bottom.width)),this.objectValue instanceof Ko?null==this.style.cellPadding||void 0===this.style.cellPadding?(void 0!==this.row.grid.style.cellPadding.top&&this.row.grid.style.cellPadding.hasTopPad&&(r+=this.row.grid.style.cellPadding.top),void 0!==this.row.grid.style.cellPadding.bottom&&this.row.grid.style.cellPadding.hasBottomPad&&(r+=this.row.grid.style.cellPadding.bottom)):(void 0!==this.style.cellPadding.top&&this.style.cellPadding.hasTopPad&&(r+=this.style.cellPadding.top),void 0!==this.style.cellPadding.bottom&&this.style.cellPadding.hasBottomPad&&(r+=this.style.cellPadding.bottom)):null==this.style.cellPadding||void 0===this.style.cellPadding?r+=this.row.grid.style.cellPadding.top+this.row.grid.style.cellPadding.bottom:r+=this.style.cellPadding.top+this.style.cellPadding.bottom,r+=this.row.grid.style.cellSpacing},T.prototype.calculateWidth=function(){var t=this.row.cells.indexOf(this),e=(this.row.grid.rows.rowCollection.indexOf(this.row),this.columnSpan),i=0;if(1===e)for(var r=0;r<e;r++)i+=this.row.grid.columns.getColumn(t+r).width;else if(1<e)for(r=0;r<e;r++)i+=this.row.grid.columns.getColumn(t+r).width,r+1<e&&(this.row.cells.getCell(t+r+1).hasColSpan=!0);if(null!=this.parent&&0<this.parent.row.width&&this.row.grid.isChildGrid&&null!=this.parent&&this.row.width>this.parent.row.width){for(var i=0,n=0;n<this.parent.columnSpan;n++)i+=this.parent.row.grid.columns.getColumn(n).width;i/=this.row.cells.count}return i};var Vo=T;function T(t){this.cellWidth=0,this.cellHeight=0,this.tempval=0,this.fontSpilt=!1,this.finsh=!0,this.rowSpanRemainingHeight=0,this.hasRowSpan=!1,this.hasColSpan=!1,this.isFinish=!0,this.present=!1,this.gridRowSpan=1,this.colSpan=1,void 0!==t&&(this.gridRow=t)}Mo.prototype.getCell=function(t){if(t<0||t>=this.count)throw new Error("IndexOutOfRangeException");return this.cells[t]},Object.defineProperty(Mo.prototype,"count",{get:function(){return this.cells.length},enumerable:!0,configurable:!0}),Mo.prototype.add=function(t){var e;if(void 0===t)return e=new Vo,this.add(e),t;t.row=this.gridRow,this.cells.push(t)},Mo.prototype.indexOf=function(t){return this.cells.indexOf(t)};var Ro=Mo;function Mo(t){this.cells=[],this.gridRow=t}Object.defineProperty(No.prototype,"width",{get:function(){return this.columnWidth},set:function(t){this.isCustomWidth=!0,this.columnWidth=t},enumerable:!0,configurable:!0}),Object.defineProperty(No.prototype,"format",{get:function(){return null==this.stringFormat&&(this.stringFormat=new bt),this.stringFormat},set:function(t){this.stringFormat=t},enumerable:!0,configurable:!0});var Do=No;function No(t){this.columnWidth=0,this.grid=t}Io.prototype.add=function(t){for(var e=0;e<t;e++){this.internalColumns.push(new Do(this.grid));for(var i=0;i<this.grid.rows.count;i++){var r=this.grid.rows.getRow(i),n=new Vo;n.value="",r.cells.add(n)}}},Object.defineProperty(Io.prototype,"count",{get:function(){return this.internalColumns.length},enumerable:!0,configurable:!0}),Object.defineProperty(Io.prototype,"width",{get:function(){return 0===this.columnWidth&&(this.columnWidth=this.measureColumnsWidth()),0===this.grid.initialWidth||this.columnWidth===this.grid.initialWidth||this.grid.style.allowHorizontalOverflow||(this.columnWidth=this.grid.initialWidth,this.grid.isPageWidth=!0),this.columnWidth},enumerable:!0,configurable:!0}),Object.defineProperty(Io.prototype,"columns",{get:function(){return this.internalColumns},enumerable:!0,configurable:!0}),Io.prototype.getColumn=function(t){if(0<=t&&t<=this.columns.length)return this.columns[t];throw Error("can not get the column from the index: "+t)},Io.prototype.measureColumnsWidth=function(){var t=0;this.grid.measureColumnsWidth();for(var e=0,i=this.internalColumns.length;e<i;e++)t+=this.internalColumns[e].width;return t},Io.prototype.getDefaultWidths=function(t){for(var e=[],i=this.count,r=0;r<this.count;r++)this.grid.isPageWidth&&0<=t&&!this.internalColumns[r].isCustomWidth?this.internalColumns[r].width=0:(e[r]=this.internalColumns[r].width,0<this.internalColumns[r].width&&this.internalColumns[r].isCustomWidth?(t-=this.internalColumns[r].width,i--):e[r]=0);for(r=0;r<this.count;r++)e[r]<=0&&(e[r]=t/i);return e};var Ao=Io;function Io(t){this.internalColumns=[],this.columnWidth=0,this.grid=t,this.internalColumns=[]}Object.defineProperty(Eo.prototype,"rowSpanExists",{get:function(){return this.bRowSpanExists},set:function(t){this.bRowSpanExists=t},enumerable:!0,configurable:!0}),Object.defineProperty(Eo.prototype,"cells",{get:function(){return null==this.gridCells&&(this.gridCells=new Ro(this)),this.gridCells},enumerable:!0,configurable:!0}),Object.defineProperty(Eo.prototype,"grid",{get:function(){return this.pdfGrid},set:function(t){this.pdfGrid=t},enumerable:!0,configurable:!0}),Object.defineProperty(Eo.prototype,"style",{get:function(){return void 0===this.rowStyle&&(this.rowStyle=new jo,this.rowStyle.setParent(this)),this.rowStyle},set:function(t){this.rowStyle=t;for(var e=0;e<this.cells.count;e++)this.cells.getCell(e).style.borders=t.border,void 0!==t.font&&(this.cells.getCell(e).style.font=t.font),void 0!==t.backgroundBrush&&(this.cells.getCell(e).style.backgroundBrush=t.backgroundBrush),void 0!==t.backgroundImage&&(this.cells.getCell(e).style.backgroundImage=t.backgroundImage),void 0!==t.textBrush&&(this.cells.getCell(e).style.textBrush=t.textBrush),void 0!==t.textPen&&(this.cells.getCell(e).style.textPen=t.textPen)},enumerable:!0,configurable:!0}),Object.defineProperty(Eo.prototype,"rowBreakHeight",{get:function(){return void 0===this.gridRowBreakHeight&&(this.gridRowBreakHeight=0),this.gridRowBreakHeight},set:function(t){this.gridRowBreakHeight=t},enumerable:!0,configurable:!0}),Object.defineProperty(Eo.prototype,"rowOverflowIndex",{get:function(){return this.gridRowOverflowIndex},set:function(t){this.gridRowOverflowIndex=t},enumerable:!0,configurable:!0}),Object.defineProperty(Eo.prototype,"height",{get:function(){return this.isRowHeightSet||(this.rowHeight=this.measureHeight()),this.rowHeight},set:function(t){this.rowHeight=t,this.isRowHeightSet=!0},enumerable:!0,configurable:!0}),Object.defineProperty(Eo.prototype,"width",{get:function(){return 0!==this.rowWidth&&void 0!==this.rowWidth||(this.rowWidth=this.measureWidth()),this.rowWidth},enumerable:!0,configurable:!0}),Object.defineProperty(Eo.prototype,"NestedGridLayoutResult",{get:function(){return this.gridResult},set:function(t){this.gridResult=t},enumerable:!0,configurable:!0}),Object.defineProperty(Eo.prototype,"columnSpanExists",{get:function(){return this.bColumnSpanExists},set:function(t){this.bColumnSpanExists=t},enumerable:!0,configurable:!0}),Object.defineProperty(Eo.prototype,"rowMergeComplete",{get:function(){return this.isRowMergeComplete},set:function(t){this.isRowMergeComplete=t},enumerable:!0,configurable:!0}),Object.defineProperty(Eo.prototype,"rowIndex",{get:function(){return this.grid.rows.rowCollection.indexOf(this)},enumerable:!0,configurable:!0}),Eo.prototype.measureHeight=function(){for(var t=0,e=0,i=1<this.cells.getCell(0).rowSpan?0:this.cells.getCell(0).height,r=0;r<this.cells.count;r++){var n=this.cells.getCell(r);if(n.rowSpanRemainingHeight>t&&(t=n.rowSpanRemainingHeight),this.rowMergeComplete=!1,1<n.rowSpan){for(var o=r,s=(this.isHeaderRow?this.grid.headers:this.grid.rows.rowCollection).indexOf(this),a=0;a<n.rowSpan;a++)a+1<n.rowSpan&&((this.isHeaderRow?this.grid.headers.getHeader(s+a+1):this.grid.rows.getRow(s+a+1)).cells.getCell(o).hasRowSpan=!0);e<n.height&&(e=n.height)}else i=Math.max(i,n.height)}return 0===(i=i<e?e:i)?i=e:0<t&&(i+=t),i},Eo.prototype.measureWidth=function(){for(var t=0,e=0;e<this.grid.columns.count;e++)t+=this.grid.columns.getColumn(e).width;return t};var Fo=Eo;function Eo(t){this.gridRowOverflowIndex=0,this.rowHeight=0,this.rowWidth=0,this.isrowFinish=!1,this.isRowSpanRowHeightSet=!1,this.noOfPageCount=0,this.isRowHeightSet=!1,this.isPageBreakRowSpanApplied=!1,this.isRowMergeComplete=!0,this.repeatFlag=!1,this.rowFontSplit=!1,this.isHeaderRow=!1,this.pdfGrid=t}Object.defineProperty(zo.prototype,"count",{get:function(){return this.rows.length},enumerable:!0,configurable:!0}),Object.defineProperty(zo.prototype,"rowCollection",{get:function(){return this.rows},enumerable:!0,configurable:!0}),zo.prototype.addRow=function(t){var e;if(void 0===t)return e=new Fo(this.grid),this.addRow(e),e;if(t.style.setBackgroundBrush(this.grid.style.backgroundBrush),t.style.setFont(this.grid.style.font),t.style.setTextBrush(this.grid.style.textBrush),t.style.setTextPen(this.grid.style.textPen),0===t.cells.count)for(var i=0;i<this.grid.columns.count;i++)t.cells.add(new Vo);this.rows.push(t)},zo.prototype.getRow=function(t){return this.rows[t]};var Go=zo;function zo(t){this.rows=[],this.grid=t}_o.prototype.getHeader=function(t){return this.rows[t]},Object.defineProperty(_o.prototype,"count",{get:function(){return this.rows.length},enumerable:!0,configurable:!0}),_o.prototype.add=function(t){if("number"==typeof t){for(var e=void 0,i=0;i<t;i++){(e=new Fo(this.grid)).isHeaderRow=!0;for(var r=0;r<this.grid.columns.count;r++)e.cells.add(new Vo);this.rows.push(e)}return this.rows}this.rows.push(t)},_o.prototype.indexOf=function(t){return this.rows.indexOf(t)};var Wo=_o;function _o(t){this.rows=[],this.grid=t,this.rows=[]}Ho=function(t,e){return(Ho=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}Ho(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(qo,Uo=nn),Object.defineProperty(qo.prototype,"raiseBeginCellDraw",{get:function(){return void 0!==this.beginCellDraw&&null!==typeof this.beginCellDraw},enumerable:!0,configurable:!0}),Object.defineProperty(qo.prototype,"raiseEndCellDraw",{get:function(){return void 0!==this.endCellDraw&&null!==typeof this.endCellDraw},enumerable:!0,configurable:!0}),Object.defineProperty(qo.prototype,"repeatHeader",{get:function(){return null!=this.bRepeatHeader&&void 0!==this.bRepeatHeader||(this.bRepeatHeader=!1),this.bRepeatHeader},set:function(t){this.bRepeatHeader=t},enumerable:!0,configurable:!0}),Object.defineProperty(qo.prototype,"allowRowBreakAcrossPages",{get:function(){return this.breakRow},set:function(t){this.breakRow=t},enumerable:!0,configurable:!0}),Object.defineProperty(qo.prototype,"columns",{get:function(){return null!=this.gridColumns&&void 0!==this.gridColumns||(this.gridColumns=new Ao(this)),this.gridColumns},enumerable:!0,configurable:!0}),Object.defineProperty(qo.prototype,"rows",{get:function(){return null==this.gridRows&&(this.gridRows=new Go(this)),this.gridRows},enumerable:!0,configurable:!0}),Object.defineProperty(qo.prototype,"headers",{get:function(){return null!=this.gridHeaders&&void 0!==this.gridHeaders||(this.gridHeaders=new Wo(this)),this.gridHeaders},enumerable:!0,configurable:!0}),Object.defineProperty(qo.prototype,"initialWidth",{get:function(){return this.gridInitialWidth},set:function(t){this.gridInitialWidth=t},enumerable:!0,configurable:!0}),Object.defineProperty(qo.prototype,"style",{get:function(){return null==this.gridStyle&&(this.gridStyle=new Bo),this.gridStyle},set:function(t){null==this.gridStyle&&(this.gridStyle=t)},enumerable:!0,configurable:!0}),Object.defineProperty(qo.prototype,"isPageWidth",{get:function(){return this.ispageWidth},set:function(t){this.ispageWidth=t},enumerable:!0,configurable:!0}),Object.defineProperty(qo.prototype,"isChildGrid",{get:function(){return this.ischildGrid},set:function(t){this.ischildGrid=t},enumerable:!0,configurable:!0}),Object.defineProperty(qo.prototype,"size",{get:function(){return 0!==this.gridSize.width&&void 0!==this.gridSize.width||0!==this.gridSize.height||(this.gridSize=this.measure()),this.gridSize},set:function(t){this.gridSize=t},enumerable:!0,configurable:!0}),Object.defineProperty(qo.prototype,"ParentCell",{get:function(){return this.parentCell},set:function(t){this.parentCell=t},enumerable:!0,configurable:!0}),Object.defineProperty(qo.prototype,"LayoutFormat",{get:function(){return this.layoutFormat},enumerable:!0,configurable:!0}),qo.prototype.draw=function(t,e,i,r){var n;return e instanceof q&&void 0===e.width&&void 0===i?this.drawHelper(t,e.x,e.y):"number"==typeof e&&"number"==typeof i&&void 0===r?this.drawHelper(t,e,i,null):e instanceof X&&void 0!==e.width&&void 0===i?this.drawHelper(t,e,null):e instanceof q&&void 0===e.width&&i instanceof qr?this.drawHelper(t,e.x,e.y,i):"number"==typeof e&&"number"==typeof i&&(r instanceof qr||null==r)?(n=t.graphics.clientSize.width-e,n=new X(e,i,n,0),this.drawHelper(t,n,r)):e instanceof X&&void 0!==e.width&&"boolean"==typeof i?this.drawHelper(t,e,null):this.drawHelper(t,e,i)},qo.prototype.measure=function(){for(var t=0,e=this.columns.width,i=0;i<this.headers.count;i++)t+=this.headers.getHeader(i).height;for(i=0;i<this.rows.count;i++)t+=this.rows.getRow(i).height;return new Y(e,t)},qo.prototype.onBeginCellDraw=function(t){this.raiseBeginCellDraw&&this.beginCellDraw(this,t)},qo.prototype.onEndCellDraw=function(t){this.raiseEndCellDraw&&this.endCellDraw(this,t)},qo.prototype.layout=function(t){var e=t.bounds.width,i=t.bounds.height,r=!1;return void 0!==t.bounds.width&&0!==t.bounds.width||(e=t.page.getClientSize().width-t.bounds.x,r=!0),void 0!==t.bounds.height&&0!==t.bounds.height||(i=t.page.getClientSize().height-t.bounds.y,r=!0),r&&(t.bounds=new X(t.bounds.x,t.bounds.y,e,i)),0!==this.rows.count&&null!=(r=this.rows.getRow(0).cells.getCell(0).style).borders&&(null!=r.borders.left&&1!==r.borders.left.width||null!=r.borders.top&&1!==r.borders.top.width)&&(e=r.borders.left.width/2,i=r.borders.top.width/2,t.bounds.x===Qr.default.right.width/2)&&t.bounds.y===Qr.default.right.width/2&&(r=new X(e,i,this.gridSize.width,this.gridSize.height),t.bounds=r),this.setSpan(),this.checkSpan(),this.layoutFormat=t.format,this.gridLocation=t.bounds,new Jo(this).Layouter(t)},qo.prototype.setSpan=function(){for(var t=1,e=1,i=0,r=0,n=0,o=this.headers.count,s=0;s<o;s++){for(var a=this.headers.getHeader(s),h=a.cells.count,l=n=0;l<h;l++){var u=a.cells.getCell(l),n=Math.max(n,u.rowSpan);if(!u.isCellMergeContinue&&!u.isRowMergeContinue&&(1<u.columnSpan||1<u.rowSpan)){if(u.columnSpan+l>a.cells.count)throw new Error("Invalid span specified at row "+l.toString()+" column "+s.toString());if(u.rowSpan+s>this.headers.count)throw new Error("Invalid span specified at Header "+l.toString()+" column "+s.toString());if(1<u.columnSpan&&1<u.rowSpan){for(t=u.columnSpan,e=u.rowSpan,i=l,r=s,u.isCellMergeStart=!0,u.isRowMergeStart=!0;1<t;)i++,a.cells.getCell(i).isCellMergeContinue=!0,a.cells.getCell(i).isRowMergeContinue=!0,a.cells.getCell(i).rowSpan=e,t--;for(i=l,t=u.columnSpan;1<e;){for(r++,this.headers.getHeader(r).cells.getCell(l).isRowMergeContinue=!0,this.headers.getHeader(r).cells.getCell(i).isRowMergeContinue=!0,e--;1<t;)i++,this.headers.getHeader(r).cells.getCell(i).isCellMergeContinue=!0,this.headers.getHeader(r).cells.getCell(i).isRowMergeContinue=!0,t--;t=u.columnSpan,i=l}}else if(1<u.columnSpan&&1===u.rowSpan)for(t=u.columnSpan,i=l,u.isCellMergeStart=!0;1<t;)i++,a.cells.getCell(i).isCellMergeContinue=!0,t--;else if(1===u.columnSpan&&1<u.rowSpan)for(e=u.rowSpan,r=s;1<e;)r++,this.headers.getHeader(r).cells.getCell(l).isRowMergeContinue=!0,e--}}a.maximumRowSpan=n}},qo.prototype.checkSpan=function(){var t=1,e=0,i=0,r=t=1,n=i=0;if(this.hasRowSpanSpan||this.hasColumnSpan)for(var o=this.rows.count,s=0;s<o;s++){for(var a=this.rows.getRow(s),h=a.cells.count,l=e=0;l<h;l++){var u=a.cells.getCell(l),e=Math.max(e,u.rowSpan);if(!u.isCellMergeContinue&&!u.isRowMergeContinue&&(1<u.columnSpan||1<u.rowSpan)){if(u.columnSpan+l>a.cells.count)throw new Error("Invalid span specified at row "+l.toString()+" column "+s.toString());if(u.rowSpan+s>this.rows.count)throw new Error("Invalid span specified at row "+l.toString()+" column "+s.toString());if(1<u.columnSpan&&1<u.rowSpan){for(r=u.columnSpan,t=u.rowSpan,n=l,i=s,u.isCellMergeStart=!0,u.isRowMergeStart=!0;1<r;)n++,a.cells.getCell(n).isCellMergeContinue=!0,a.cells.getCell(n).isRowMergeContinue=!0,r--;for(n=l,r=u.columnSpan;1<t;){for(i++,this.rows.getRow(i).cells.getCell(l).isRowMergeContinue=!0,this.rows.getRow(i).cells.getCell(n).isRowMergeContinue=!0,t--;1<r;)n++,this.rows.getRow(i).cells.getCell(n).isCellMergeContinue=!0,this.rows.getRow(i).cells.getCell(n).isRowMergeContinue=!0,r--;r=u.columnSpan,n=l}}else if(1<u.columnSpan&&1===u.rowSpan)for(r=u.columnSpan,n=l,u.isCellMergeStart=!0;1<r;)n++,a.cells.getCell(n).isCellMergeContinue=!0,r--;else if(1===u.columnSpan&&1<u.rowSpan)for(t=u.rowSpan,i=s;1<t;)i++,this.rows.getRow(i).cells.getCell(l).isRowMergeContinue=!0,t--}}a.maximumRowSpan=e}},qo.prototype.measureColumnsWidth=function(t){if(void 0!==t){this.isPageWidth=!1;for(var e=this.columns.getDefaultWidths(t.width-t.x),i=0,r=this.columns.count;i<r;i++)this.columns.getColumn(i).columnWidth=e[i],this.tempWidth=e[i];if(null!=this.ParentCell&&0==this.style.allowHorizontalOverflow&&0==this.ParentCell.row.grid.style.allowHorizontalOverflow){var n,o=0,s=0,a=this.columns.count;null==this.ParentCell.style.cellPadding&&void 0===this.ParentCell.style.cellPadding||(void 0!==this.ParentCell.style.cellPadding.left&&this.ParentCell.style.cellPadding.hasLeftPad&&(o+=this.ParentCell.style.cellPadding.left),void 0!==this.ParentCell.style.cellPadding.right&&this.ParentCell.style.cellPadding.hasRightPad&&(o+=this.ParentCell.style.cellPadding.right));for(i=0;i<this.ParentCell.columnSpan;i++)s+=this.ParentCell.row.grid.columns.getColumn(this.parentCellIndex+i).width;for(var h=0;h<this.columns.count;h++)0<this.gridColumns.getColumn(h).width&&this.gridColumns.getColumn(h).isCustomWidth&&(s-=this.gridColumns.getColumn(h).width,a--);if(null==this.ParentCell.row.grid.style.cellPadding&&void 0===this.ParentCell.row.grid.style.cellPadding||(void 0!==this.ParentCell.row.grid.style.cellPadding.top&&this.ParentCell.row.grid.style.cellPadding.hasTopPad&&(o+=this.ParentCell.row.grid.style.cellPadding.top),void 0!==this.ParentCell.row.grid.style.cellPadding.bottom&&this.ParentCell.row.grid.style.cellPadding.hasBottomPad&&(o+=this.ParentCell.row.grid.style.cellPadding.bottom)),0!=this.ParentCell.row.grid.style.cellSpacing&&(s-=2*this.ParentCell.row.grid.style.cellSpacing),o<s&&(this.tempWidth=n=(s-o)/a,null!=this.ParentCell))for(h=0;h<this.columns.count;h++)this.columns.getColumn(h).isCustomWidth||(this.columns.getColumn(h).columnWidth=n)}}else{for(var e=[this.columns.count],l=0;l<this.columns.count;l++)e[l]=0;var u=0;if((void 0===this.isChildGrid&&void 0!==this.gridLocation||null===this.isChildGrid&&void 0!==this.gridLocation)&&(this.initialWidth=this.gridLocation.width),0<this.headers.count)for(var c=this.headers.getHeader(0).cells.count,p=this.headers.count,i=0;i<c;i++){for(h=u=0;h<p;h++)var d=Math.min(this.initialWidth,this.headers.getHeader(h).cells.getCell(i).width),u=Math.max(u,d);e[i]=u}for(var i=u=0,f=this.columns.count;i<f;i++){for(h=0,p=this.rows.count;h<p;h++)(1!=this.rows.getRow(h).cells.getCell(i).columnSpan||this.rows.getRow(h).cells.getCell(i).isCellMergeContinue)&&null==this.rows.getRow(h).cells.getCell(i).value||(null==this.rows.getRow(h).cells.getCell(i).value||this.rows.getRow(h).grid.style.allowHorizontalOverflow||(this.rows.getRow(h).grid.style.cellPadding.right,this.rows.getRow(h).grid.style.cellPadding.left,this.rows.getRow(h).cells.getCell(i).style.borders.left.width),d=(d=0)<this.initialWidth?Math.min(this.initialWidth,this.rows.getRow(h).cells.getCell(i).width):this.rows.getRow(h).cells.getCell(i).width,u=Math.max(e[i],Math.max(u,d)),u=Math.max(this.columns.getColumn(i).width,u));0!=this.rows.count&&(e[i]=u),u=0}for(var i=0,g=this.rows.count;i<g;i++)for(var h=0,m=this.columns.count;h<m;h++)if(1<this.rows.getRow(i).cells.getCell(h).columnSpan){e[h];for(var y=1;y<this.rows.getRow(i).cells.getCell(h).columnSpan;y++)e[h+y]}for(i=0,r=this.columns.count;i<r;i++)(this.columns.getColumn(i).width<=0||0<this.columns.getColumn(i).width&&!this.columns.getColumn(i).isCustomWidth)&&(this.columns.getColumn(i).columnWidth=e[i]);for(var b,o=0,w=0,P=this.columns.count,w=this.tempWidth,h=0;h<this.columns.count;h++)0<this.gridColumns.getColumn(h).width&&this.gridColumns.getColumn(h).isCustomWidth&&(w-=this.gridColumns.getColumn(h).width,P--);if(0<w&&0!=this.ParentCell.row.grid.style.cellSpacing&&(w-=2*this.ParentCell.row.grid.style.cellSpacing),o<w&&(b=w/P,null!=this.ParentCell))for(h=0;h<this.columns.count;h++)this.columns.getColumn(h).isCustomWidth||(this.columns.getColumn(h).columnWidth=b)}};var Ho,Uo,Ko=qo;function qo(){var t=Uo.call(this)||this;return t.gridSize=new Y(0,0),t.isGridSplit=!1,t.isRearranged=!1,t.pageBounds=new X,t.listOfNavigatePages=[],t.parentCellIndex=0,t.tempWidth=0,t.breakRow=!0,t.splitChildRowIndex=-1,t.hasRowSpanSpan=!1,t.hasColumnSpan=!1,t.isSingleGrid=!0,t}Yo=function(t,e){return(Yo=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var Yo,Xo,L=function(t,e){function i(){this.constructor=t}Yo(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},Jo=(L(J,Xo=Ur),Object.defineProperty(J.prototype,"Grid",{get:function(){return this.elements},enumerable:!0,configurable:!0}),J.prototype.getFormat=function(t){return t},J.prototype.layoutInternal=function(t){var e=this.getFormat(t.format);if(this.gridLayoutFormat=this.getFormat(t.format),this.currentPage=t.page,null===this.currentPage)throw Error("Can not set page as null");this.currentPage.getClientSize().height,this.currentPage.getClientSize().width,this.currentPageBounds=this.currentPage.getClientSize(),this.currentGraphics=this.currentPage.graphics;var i=this.currentGraphics.page.section.indexOf(this.currentGraphics.page);if(this.listOfNavigatePages.push(i),null!=e&&e.break===K.PdfLayoutBreakType.FitColumnsToPage?this.currentBounds=new X(new q(t.bounds.x,t.bounds.y),new Y(this.Grid.columns.width,this.currentGraphics.clientSize.height)):this.currentBounds=new X(new q(t.bounds.x,t.bounds.y),this.currentGraphics.clientSize),0!==this.Grid.rows.count)this.currentBounds.width=0<t.bounds.width?t.bounds.width:this.currentBounds.width-this.Grid.rows.getRow(0).cells.getCell(0).style.borders.left.width/2;else{if(0===this.Grid.headers.count)throw Error("Please add row or header into grid");this.currentBounds.width=t.bounds.width}if(this.startLocation=new q(t.bounds.x,t.bounds.y),0<t.bounds.height&&!this.Grid.isChildGrid&&(this.currentBounds.height=t.bounds.height),this.Grid.isChildGrid||(this.hType=this.Grid.style.horizontalOverflowType),this.Grid.style.allowHorizontalOverflow?(this.Grid.measureColumnsWidth(),this.determineColumnDrawRanges()):(this.columnRanges=[],void 0!==this.Grid.isChildGrid&&(this.Grid.isChildGrid,1)?this.Grid.measureColumnsWidth(this.currentBounds):this.Grid.measureColumnsWidth(new X(this.currentBounds.x,this.currentBounds.y,this.currentBounds.x+this.currentBounds.width,this.currentBounds.height)),this.columnRanges.push([0,this.Grid.columns.count-1])),this.Grid.hasRowSpanSpan)for(var r=0;r<this.Grid.rows.count;r++)-1===this.Grid.rows.getRow(r).height||this.Grid.rows.getRow(r).isRowHeightSet||(this.Grid.rows.getRow(r).isRowHeightSet=!0);return this.layoutOnPage(t)},J.prototype.determineColumnDrawRanges=function(){for(var t=0,e=0,i=0,r=this.currentGraphics.clientSize.width-this.currentBounds.x,n=0;n<this.Grid.columns.count;n++)if(r<=(i+=this.Grid.columns.getColumn(n).width)){for(var o=0,s=t;s<=n&&!(r<(o+=this.Grid.columns.getColumn(s).width));s++)e=s;this.columnRanges.push([t,e]),i=(e=t=e+1)<=n?this.Grid.columns.getColumn(n).width:0}this.columnRanges.push([t,this.Grid.columns.count-1])},J.prototype.layoutOnPage=function(t){this.pageBounds.x=t.bounds.x,this.pageBounds.y=t.bounds.y,this.pageBounds.height=t.bounds.height;for(var e,i=this.getFormat(t.format),r=new ae,n=t.page,o=[],s=0;s<this.columnRanges.length;s++){for(var a=this.columnRanges[s],h=(this.cellStartIndex=a[0],this.cellEndIndex=a[1],this.raiseBeforePageLayout(this.currentPage,this.currentBounds,this.currentRowIndex)),l=(this.currentBounds=h.currentBounds,this.currentRowIndex=h.currentRowIndex,void 0),u=0;u<this.Grid.headers.count;u++){var c=this.Grid.headers.getHeader(u),A=this.currentBounds.y;if(this.isHeader=!0,n!=this.currentPage)for(var p=this.cellStartIndex;p<=this.cellEndIndex;p++)c.cells.getCell(p).isCellMergeContinue&&(c.cells.getCell(p).isCellMergeContinue=!1,c.cells.getCell(p).value="");var I=this.drawRow(c);A===this.currentBounds.y?(l=!0,-1===J.repeatRowIndex&&(J.repeatRowIndex=u)):l=!1,!I.isFinish&&null!==n&&i.layout!==K.PdfLayoutType.OnePage&&l&&(this.startLocation.x=this.currentBounds.x,this.currentPage=this.getNextPageformat(i),this.startLocation.y=this.currentBounds.y,void 0!==i.paginateBounds&&0===i.paginateBounds.x&&0===i.paginateBounds.y&&0===i.paginateBounds.width&&0===i.paginateBounds.height&&(this.currentBounds.x+=this.startLocation.x),this.drawRow(c)),this.isHeader=!1}for(var d=0,f=(this.Grid.rows.count,void 0),F=!0,o=[],g=0;g<this.Grid.rows.count;g++){var c=this.Grid.rows.getRow(g),m=(d++,this.currentRowIndex=d-1,this.currentBounds.y),n=this.currentPage,y=(J.repeatRowIndex=-1,F&&c.grid.isChildGrid&&(F=!1),null);if(-1!=this.Grid.splitChildRowIndex&&!(c.grid.ParentCell.row.grid.isGridSplit&&this.Grid.splitChildRowIndex<=c.rowIndex)){if(c.isrowFinish)continue;break}for(y=this.drawRow(c),c.isrowFinish=!0,o.push(y.bounds.width),m===this.currentBounds.y?(f=!0,J.repeatRowIndex=this.Grid.rows.rowCollection.indexOf(c)):(f=!1,J.repeatRowIndex=-1);!y.isFinish&&null!=n;){var b=this.getLayoutResult();if(this.raisePageLayouted(b).cancel||f)break;if(this.Grid.allowRowBreakAcrossPages){this.currentPage=this.getNextPageformat(i);this.currentBounds.y;var E,b=new q(Qr.default.right.width/2,Qr.default.top.width/2);if(0===i.paginateBounds.x&&0===i.paginateBounds.y&&0===i.paginateBounds.width&&0===i.paginateBounds.height&&this.startLocation.x===b.x&&this.startLocation.y===b.y&&(this.currentBounds.x+=this.startLocation.x,this.currentBounds.y+=this.startLocation.y),this.isPaginate&&(this.startLocation.y=this.currentBounds.y,this.isPaginate=!1),this.Grid.isChildGrid&&null!=c.grid.ParentCell&&null!=this.Grid.ParentCell.row.grid.style.cellPadding&&c.rowBreakHeight+this.Grid.ParentCell.row.grid.style.cellPadding.top<this.currentBounds.height&&(this.currentBounds.y=this.Grid.ParentCell.row.grid.style.cellPadding.top),null!=c.grid.ParentCell){c.grid.ParentCell.row.isRowBreaksNextPage=!0,c.grid.ParentCell.row.rowBreakHeightValue=c.rowBreakHeight+this.Grid.ParentCell.row.grid.style.cellPadding.top+this.Grid.ParentCell.row.grid.style.cellPadding.bottom;for(var w=c.rowIndex+1;w<c.grid.rows.count;w++)c.grid.ParentCell.row.rowBreakHeightValue+=c.grid.rows.getRow(w).height}if(c.grid.isChildGrid){c.isrowFinish=!1,c.grid.splitChildRowIndex=c.rowIndex,c.grid.ParentCell.row.grid.splitChildRowIndex=c.grid.ParentCell.row.rowIndex,c.grid.ParentCell.row.grid.isGridSplit&&(c.grid.ParentCell.row.noOfPageCount+=1,c.grid.ParentCell.row.grid.isGridSplit=!1);break}if(c.noOfPageCount<1){if(-1!=c.grid.splitChildRowIndex&&(c.grid.isGridSplit=!0),null!=c.style.border&&(null!=c.style.border.left&&1!==c.style.border.left.width||null!=c.style.border.top&&1!==c.style.border.top.width)&&(b=c.style.border.left.width/2,E=c.style.border.top.width/2,this.currentBounds.x===Qr.default.right.width/2)&&this.currentBounds.y===Qr.default.right.width/2&&(b=new X(b,E,this.currentBounds.width,this.currentBounds.height),this.currentBounds=b),this.Grid.repeatHeader)for(var P=0;P<this.Grid.headers.count;P++){var G=this.Grid.headers.getHeader(P);this.drawRow(G)}if(y=this.drawRow(c),1<=c.noOfPageCount){c.rowBreakHeightValue;for(var z=0;z<c.noOfPageCount;z++){var W=this.getLayoutResult();this.raisePageLayouted(W);if(this.currentPage=this.getNextPageformat(i),this.currentBounds.y,-1!=c.grid.splitChildRowIndex&&(c.grid.isGridSplit=!0),this.currentBounds.y=.5,this.Grid.repeatHeader)for(var S=0;S<this.Grid.headers.count;S++){var v=this.Grid.headers.getHeader(S);this.drawRow(v)}this.drawRow(c)}}c.grid.splitChildRowIndex=-1,c.grid.isGridSplit=!1,y.isFinish=this.checkIsFisished(c);for(var C=0;C<c.cells.count;C++)c.cells.getCell(C).value instanceof Ko&&(c.cells.getCell(C).value.splitChildRowIndex=-1)}}}if(!y.isFinish&&null!==n&&i.layout!==K.PdfLayoutType.OnePage&&f){if(this.startLocation.x=this.currentBounds.x,this.currentPage=this.getNextPageformat(i),this.raiseBeforePageLayout(this.currentPage,this.currentBounds,this.currentRowIndex).returnValue)break;if(null!==t.format&&!t.format.usePaginateBounds&&null!==t.bounds&&0<t.bounds.height&&!this.Grid.isChildGrid&&(this.currentBounds.height=t.bounds.height),void 0===t.format||null==t.format||void 0===t.format.usePaginateBounds||t.format.usePaginateBounds||0===t.format.paginateBounds.x&&0===t.format.paginateBounds.y&&0===t.format.paginateBounds.width&&0===t.format.paginateBounds.height||0!==t.format.paginateBounds.y?(this.currentBounds.y=null==i?0:i.paginateBounds.y,null==i||0===i.paginateBounds.x&&0===i.paginateBounds.y&&0===i.paginateBounds.height&&0===i.paginateBounds.width||(this.currentBounds.x=i.paginateBounds.x,this.currentBounds.width=i.paginateBounds.width,this.currentBounds.height=i.paginateBounds.height)):this.currentBounds.y=Qr.default.top.width/2,void 0!==t.format&&null!==t.format&&void 0!==t.format.usePaginateBounds&&!t.format.usePaginateBounds&&null!==t.bounds&&0<t.bounds.y&&!this.Grid.isChildGrid&&(this.currentBounds.y=t.bounds.y),this.startLocation.y=this.currentBounds.y,i.paginateBounds.x===i.paginateBounds.y&&i.paginateBounds.y===i.paginateBounds.height&&i.paginateBounds.height===i.paginateBounds.width&&0===i.paginateBounds.width&&(this.currentBounds.x+=this.startLocation.x),this.currentBounds.x===Qr.default.left.width/2&&(this.currentBounds.y+=this.startLocation.x),this.Grid.repeatHeader)for(var B=0;B<this.Grid.headers.count;B++){v=this.Grid.headers.getHeader(B);this.drawRow(v)}this.drawRow(c),null===this.currentPage||r.containsKey(this.currentPage)||r.add(this.currentPage,a)}if(null!=c.NestedGridLayoutResult){this.currentPage=c.NestedGridLayoutResult.page,this.currentGraphics=this.currentPage.graphics,this.startLocation=new q(c.NestedGridLayoutResult.bounds.x,c.NestedGridLayoutResult.bounds.y);m=this.ReCalculateHeight(c,c.NestedGridLayoutResult.bounds.height);if(this.currentBounds.y=m,n!=this.currentPage){for(var m=(D=this.currentPage.section).indexOf(n)+1,_=D.indexOf(this.currentPage),O=m;O<_+1;O++){var x=D.getPages()[O].graphics,L=new q(i.paginateBounds.x,i.paginateBounds.y),T=O==_?c.NestedGridLayoutResult.bounds.height-t.bounds.y:this.currentBounds.height-L.y;T<=x.clientSize.height&&(T+=t.bounds.y),L.y=null==i?.5:i.paginateBounds.y;for(var j=0;j<c.cells.count;j++){var k=c.cells.getCell(j),V=0,R=0;if(k.value instanceof Ko)for(var M=0;M<k.value.columns.count;M++)R+=k.value.columns.getColumn(M).columnWidth;else R=k.width;if(1<k.columnSpan)for(;j<k.columnSpan;j++)V+=c.grid.columns.getColumn(j).width;else V=Math.max(R,c.grid.columns.getColumn(j).width);k.drawCellBorders(x,new X(L,new Y(V,T))),k.drawCellBorders(x,new X(L,new Y(this.Grid.rows.getRow(this.Grid.rows.count-1).width,T))),L.x+=V,j+=k.columnSpan-1}}n=this.currentPage}}}for(var H,D,U=!1,N=0,h=(0<o.length&&(N=o[0]),[[1,2]]),j=0;j<this.Grid.rows.count;j++)-1!=this.cellEndIndex&&this.Grid.rows.getRow(j).cells.getCell(this.cellEndIndex).value instanceof Ko&&(H=this.Grid.rows.getRow(j).cells.getCell(this.cellEndIndex).value,this.rowLayoutBoundsWidth=H.rowLayoutBoundsWidth,U=!0);if(!U&&0<o.length){for(j=0;j<d-1;j++)N<o[j]&&(N=o[j]);this.rowLayoutBoundsWidth=N}else this.rowLayoutBoundsWidth=h[0][1];this.columnRanges.indexOf(a)<this.columnRanges.length-1&&null!=n&&i.layout!=K.PdfLayoutType.OnePage&&(this.Grid.isChildGrid,0!=h[0][0]?((D=this.currentPage.section).indexOf(this.currentPage),this.currentGraphics=this.currentPage.graphics,this.currentBounds=new X(new q(0,0),this.currentPage.getClientSize()),this.currentGraphics.page.section.indexOf(this.currentGraphics.page)):this.currentPage=this.getNextPageformat(i)),this.columnRanges.length-1!==s&&1<this.columnRanges.length&&i.layout!==K.PdfLayoutType.OnePage&&(this.currentPage=this.getNextPageformat(i),i.paginateBounds.x===i.paginateBounds.y)&&i.paginateBounds.y===i.paginateBounds.height&&i.paginateBounds.height===i.paginateBounds.width&&0===i.paginateBounds.width&&(this.currentBounds.x+=this.startLocation.x,this.currentBounds.y+=this.startLocation.y)}return e=this.getLayoutResult(),this.Grid.style.allowHorizontalOverflow&&this.Grid.style.horizontalOverflowType==K.PdfHorizontalOverflowType.NextPage&&this.reArrangePages(r),this.raisePageLayouted(e),e},J.prototype.checkIsFisished=function(t){for(var e=!0,i=0;i<t.cells.count;i++)t.cells.getCell(i).FinishedDrawingCell||(e=!1);return e},J.prototype.getNextPageformat=function(t){var e=this.currentPage.section,i=null,r=e.indexOf(this.currentPage),e=(this.flag=!1,i=r===e.count-1?e.add():e.getPages()[r+1],this.currentGraphics=i.graphics,this.currentGraphics.page.section.indexOf(this.currentGraphics.page));return-1===this.listOfNavigatePages.indexOf(e)&&this.listOfNavigatePages.push(e),this.currentBounds=new X(new q(0,0),i.getClientSize()),void 0!==t&&null!=t&&t.usePaginateBounds&&void 0!==t.paginateBounds&&null!=t.paginateBounds&&t.paginateBounds.x!==t.paginateBounds.y&&t.paginateBounds.y!==t.paginateBounds.height&&t.paginateBounds.height!==t.paginateBounds.width&&0!==t.paginateBounds.width&&(this.currentBounds.x=t.paginateBounds.x,this.currentBounds.y=t.paginateBounds.y,this.currentBounds.height=t.paginateBounds.height),i},J.prototype.CheckIfDefaultFormat=function(t){var e=new bt;return t.alignment===e.alignment&&t.characterSpacing===e.characterSpacing&&t.clipPath===e.clipPath&&t.firstLineIndent===e.firstLineIndent&&t.horizontalScalingFactor===e.horizontalScalingFactor&&t.lineAlignment===e.lineAlignment&&t.lineLimit===e.lineLimit&&t.lineSpacing===e.lineSpacing&&t.measureTrailingSpaces===e.measureTrailingSpaces&&t.noClip===e.noClip&&t.paragraphIndent===e.paragraphIndent&&t.rightToLeft===e.rightToLeft&&t.subSuperScript===e.subSuperScript&&t.wordSpacing===e.wordSpacing&&t.wordWrap===e.wordWrap},J.prototype.RaiseBeforeCellDraw=function(t,e,i,r,n,o){return this.Grid.raiseBeginCellDraw&&(t=new ss(t,e,i,r,n,o),this.Grid.onBeginCellDraw(t),o=t.style),o},J.prototype.raiseAfterCellDraw=function(t,e,i,r,n,o){this.Grid.raiseEndCellDraw&&(t=new ls(t,e,i,r,n,o),this.Grid.onEndCellDraw(t))},J.prototype.reArrangePages=function(t){for(var e=this.currentPage.document,i=[],r=t.keys(),n=(t.values(),0);n<r.length;n++)(o=r[n]).section=null,i.push(o),e.pages.remove(o);for(n=0;n<t.size();n++)for(var o,s=n,a=t.size()/this.columnRanges.length;s<t.size();s+=a)void 0!==(o=i[s])&&-1===e.pages.indexOf(o)&&e.pages.add(o)},J.prototype.getLayoutResult=function(){if(this.Grid.isChildGrid&&this.Grid.allowRowBreakAcrossPages)for(var t=0;t<this.Grid.rows.count;t++){var e=this.Grid.rows.getRow(t);0<e.rowBreakHeight&&e.repeatFlag&&(this.startLocation.y=this.currentPage.origin.y)}var i;return this.isChanged||(i=new X(this.startLocation,new Y(this.currentBounds.width,this.currentBounds.y-this.startLocation.y))),new $o(this.currentPage,i)},J.prototype.ReCalculateHeight=function(t,e){for(var i=0,r=this.cellStartIndex;r<=this.cellEndIndex;r++)null!==t.cells.getCell(r).remainingString&&""!==t.cells.getCell(r).remainingString&&void 0!==t.cells.getCell(r).remainingString&&(i=Math.max(i,t.cells.getCell(r).measureHeight()));return Math.max(e,i)},J.prototype.raiseBeforePageLayout=function(t,e,i){var r=!1;return this.Grid.raiseBeginPageLayout&&(t=new Ps(e,t,i),this.Grid.onBeginPageLayout(t),r=void 0!==t.cancel&&t.cancel,e=t.bounds,i=t.startRowIndex),{returnValue:r,currentBounds:e,currentRowIndex:i}},J.prototype.raisePageLayouted=function(t){t=new Cs(t);return this.Grid.raiseEndPageLayout&&this.Grid.onEndPageLayout(t),t},J.prototype.drawRow=function(t,e,i){if(void 0===e){var r=new Os,n=0,o=new Y(0,0),s=!1;if(t.rowSpanExists){var a=0,h=this.Grid.rows.rowCollection.indexOf(t);-1===h&&-1!==(h=this.Grid.headers.indexOf(t))&&(s=!0);for(var l=0;l<t.cells.count;l++)var u=t.cells.getCell(l),a=Math.max(a,u.rowSpan);for(l=h;l<h+a;l++)n+=(s?this.Grid.headers.getHeader(l):this.Grid.rows.getRow(l)).height}var c,p=0<t.rowBreakHeight?t.rowBreakHeight:t.height;return void 0!==this.Grid.isChildGrid&&this.Grid.isChildGrid&&void 0!==this.Grid.ParentCell&&null!=this.Grid.ParentCell?this.currentBounds.y+this.Grid.ParentCell.row.grid.style.cellPadding.bottom+p>this.currentPageBounds.height||this.currentBounds.y+this.Grid.ParentCell.row.grid.style.cellPadding.bottom+p>this.currentBounds.height||this.currentBounds.y+this.Grid.ParentCell.row.grid.style.cellPadding.bottom+n>this.currentPageBounds.height?(void 0!==this.Grid.ParentCell.row.grid.LayoutFormat&&this.Grid.ParentCell.row.grid.LayoutFormat.break===K.PdfLayoutBreakType.FitPage&&(J.repeatRowIndex=this.Grid.rows.rowCollection.indexOf(t),this.Grid.splitChildRowIndex=this.Grid.rows.rowCollection.indexOf(t)),-1<J.repeatRowIndex&&J.repeatRowIndex===t.rowIndex&&this.Grid.allowRowBreakAcrossPages&&(r.isFinish=!0,r.bounds=this.currentBounds,this.drawRowWithBreak(r,t,p),t.repeatFlag=!0,t.repeatRowNumber=J.repeatRowIndex)):(r.isFinish=!0,0<t.grid.ParentCell.row.rowBreakHeightValue?t.repeatFlag=!0:(t.repeatFlag=!1,p=t.height),this.Grid.isChildGrid&&0<t.rowBreakHeight&&null!=this.Grid.ParentCell.row.grid.style.cellPadding&&(p+=this.Grid.ParentCell.row.grid.style.cellPadding.bottom),this.drawRow(t,r,p)):p>this.currentPageBounds.height?this.Grid.allowRowBreakAcrossPages&&(r.isFinish=!0,this.drawRowWithBreak(r,t,p),t.isrowFinish=!0,t.repeatFlag=!0,-1!==t.grid.splitChildRowIndex)&&(r.isFinish=!1):this.currentBounds.y+p>this.currentPageBounds.height||this.currentBounds.y+p>this.currentBounds.height+this.startLocation.y||this.currentBounds.y+n>this.currentPageBounds.height?(c=!1,!this.Grid.allowRowBreakAcrossPages||this.Grid.repeatHeader||t.isRowHeightSet||t.rowMergeComplete?this.Grid.allowRowBreakAcrossPages&&null!=this.Grid.LayoutFormat&&this.Grid.LayoutFormat.layout==K.PdfLayoutType.Paginate&&this.Grid.LayoutFormat.break!=K.PdfLayoutBreakType.FitElement&&t.isRowHeightSet&&this.currentBounds.y+i>this.currentPageBounds.height&&((c=(c=this.isFitToCell(this.currentPageBounds.height-this.currentBounds.y,this.Grid,t))||!(null!==this.slr&&0==this.slr.actualSize.height&&null!=this.slr.remainder&&0<this.slr.remainder.length&&this.remainderText==this.slr.remainder))&&null!=this.slr&&1<this.slr.lineCount&&(c=!1),this.remainderText=null):(c=null!==this.Grid.LayoutFormat&&0<this.Grid.LayoutFormat.paginateBounds.height?this.isFitToCell(this.currentBounds.height+this.startLocation.y-this.currentBounds.y,this.Grid,t):this.isFitToCell(this.currentPageBounds.height-this.currentBounds.y,this.Grid,t))&&(this.isPaginate=!0),-1<J.repeatRowIndex&&J.repeatRowIndex===t.rowIndex||c?this.Grid.allowRowBreakAcrossPages?(r.isFinish=!0,this.drawRowWithBreak(r,t,p),t.repeatFlag=!0,t.repeatRowNumber=J.repeatRowIndex,-1!==t.grid.splitChildRowIndex&&(r.isFinish=!1)):(r.isFinish=!1,this.drawRow(t,r,p)):r.isFinish=!1):(r.isFinish=!0,this.drawRow(t,r,p),t.repeatFlag=!1),r}var d=new q(this.currentBounds.x,this.currentBounds.y);e.bounds=new X(d,new Y(0,0)),i=this.ReCalculateHeight(t,i);for(l=this.cellStartIndex;l<=this.cellEndIndex;l++){var f=l>this.cellEndIndex+1&&1<t.cells.getCell(l).columnSpan;if(!f)for(var g=1;g<t.cells.getCell(l).columnSpan;g++)t.cells.getCell(l+g).isCellMergeContinue=!0;var o=new Y(this.Grid.columns.getColumn(l).width,i),m=(!this.CheckIfDefaultFormat(this.Grid.columns.getColumn(l).format)&&this.CheckIfDefaultFormat(t.cells.getCell(l).stringFormat)&&(t.cells.getCell(l).stringFormat=this.Grid.columns.getColumn(l).format),t.cells.getCell(l).style),y="string"==typeof t.cells.getCell(l).value&&null!==t.cells.getCell(l).value?t.cells.getCell(l).value:"";t.cells.getCell(l).style=this.RaiseBeforeCellDraw(this.currentGraphics,this.currentRowIndex,l,new X(d,o),y,m);t.cells.getCell(l).value instanceof Ko&&((b=t.cells.getCell(l).value).parentCellIndex=l);var b,m=t.cells.getCell(l).draw(this.currentGraphics,new X(d,o),f);t.grid.style.allowHorizontalOverflow&&(t.cells.getCell(l).columnSpan>this.cellEndIndex||l+t.cells.getCell(l).columnSpan>this.cellEndIndex+1)&&this.cellEndIndex<t.cells.count-1&&(t.rowOverflowIndex=this.cellEndIndex),t.grid.style.allowHorizontalOverflow&&0<t.rowOverflowIndex&&(t.cells.getCell(l).columnSpan>this.cellEndIndex||l+t.cells.getCell(l).columnSpan>this.cellEndIndex+1)&&0<t.cells.getCell(l).columnSpan-this.cellEndIndex+l-1&&(t.cells.getCell(t.rowOverflowIndex+1).value=null!==m&&void 0!==m.remainder?m.remainder:"",t.cells.getCell(t.rowOverflowIndex+1).stringFormat=t.cells.getCell(l).stringFormat,t.cells.getCell(t.rowOverflowIndex+1).style=t.cells.getCell(l).style,t.cells.getCell(t.rowOverflowIndex+1).columnSpan=t.cells.getCell(l).columnSpan-this.cellEndIndex+l-1),y="string"==typeof t.cells.getCell(l).value&&null!==t.cells.getCell(l).value?t.cells.getCell(l).value:"",f||this.raiseAfterCellDraw(this.currentGraphics,this.currentRowIndex,l,new X(d,o),y,t.cells.getCell(l).style),t.cells.getCell(l).value instanceof Ko&&(b=t.cells.getCell(l).value,this.Grid.columns.getColumn(l).width>=this.currentGraphics.clientSize.width)?(d.x=b.rowLayoutBoundsWidth,d.x+=b.style.cellSpacing):d.x+=this.Grid.columns.getColumn(l).width}t.rowMergeComplete&&!t.isRowHeightSet||(this.currentBounds.y+=i),e.bounds=new X(new q(e.bounds.x,e.bounds.y),new Y(d.x,d.y))},J.prototype.isFitToCell=function(t,e,i){for(var r=!1,n=new vt,o=0;o<i.cells.count;o++){var s=i.cells.getCell(o);if(void 0!==s.value&&null!==s.value&&"string"==typeof s.value){var a=null,a=void 0!==s.style.font&&null!=s.style.font?s.style.font:void 0!==s.row.style.font&&null!=s.row.style.font?s.row.style.font:void 0!==s.row.grid.style.font&&null!=s.row.grid.style.font?s.row.grid.style.font:Br.defaultFont,h=(this.remainderText=s.value,s.width),l=e.columns.getColumn(o),l=(l.isCustomWidth&&s.width>l.width&&(h=l.width),this.slr=n.layout(s.value,a,s.stringFormat,new Y(h,t),!1,this.currentPageBounds),this.slr.actualSize.height);if(""!==s.value&&0===l){r=!1;break}if(null!==s.style&&null!==s.style.borders&&null!==s.style.borders.top&&null!==s.style.borders.bottom&&(l+=2*(s.style.borders.top.width+s.style.borders.bottom.width)),1<this.slr.lineCount&&null!=s.stringFormat&&0!=s.stringFormat.lineSpacing&&(l+=(this.slr.lineCount-1)*s.style.stringFormat.lineSpacing),s.style.cellPadding,(l=(l+=e.style.cellPadding.top+e.style.cellPadding.bottom)+e.style.cellSpacing)<t||void 0!==this.slr.remainder&&null!==this.slr.remainder){r=!0;break}}}return r},J.prototype.drawRowWithBreak=function(t,e,i){var r=new q(this.currentBounds.x,this.currentBounds.y);e.grid.isChildGrid&&e.grid.allowRowBreakAcrossPages&&this.startLocation.x!==this.currentBounds.x&&(r.x=this.startLocation.x),t.bounds=new X(r,new Y(0,0)),this.gridHeight=0<e.rowBreakHeight?this.currentPageBounds.height:0,e.grid.style.cellPadding.top+this.currentBounds.y+e.grid.style.cellPadding.bottom<this.currentPageBounds.height&&(e.rowBreakHeight=this.currentBounds.y+i-this.currentPageBounds.height);for(var n=0;n<e.cells.count;n++){var o=e.cells.getCell(n);o.measureHeight()===i&&o.value instanceof Ko&&(e.rowBreakHeight=0)}for(n=this.cellStartIndex;n<=this.cellEndIndex;n++){var s=this.Grid.columns.getColumn(n).width,a=e.cells.getCell(n).columnSpan+n>this.cellEndIndex+1&&1<e.cells.getCell(n).columnSpan;if(!a)for(var h=1;h<e.cells.getCell(n).columnSpan;h++)e.cells.getCell(n+h).isCellMergeContinue=!0,s+=this.Grid.columns.getColumn(n+h).width;var l=new Y(s,0<this.gridHeight?this.gridHeight:this.currentPageBounds.height),u=e.cells.getCell(n).style,u=(e.cells.getCell(n).style=u,null);e.cells.getCell(n)._rowHeight=e.height,u=e.cells.getCell(n).draw(this.currentGraphics,new X(r,l),a),0<e.rowBreakHeight&&null!=u&&void 0!==u.remainder&&(e.cells.getCell(n).FinishedDrawingCell=!1,e.cells.getCell(n).remainingString=null==u.remainder?" ":u.remainder,e.rowBreakHeight=i-u.actualSize.height),t.isFinish=t.isFinish&&e.cells.getCell(n).FinishedDrawingCell,e.cells.getCell(n).value instanceof Ko&&(l=e.cells.getCell(n).value,this.rowBreakPageHeightCellIndex=n,this.Grid.columns.getColumn(n).width>=this.currentGraphics.clientSize.width)?(r.x=this.rowLayoutBoundsWidth,r.x+=l.style.cellSpacing):r.x+=this.Grid.columns.getColumn(n).width}this.currentBounds.y+=0<this.gridHeight?this.gridHeight:i,t.bounds=new X(new q(t.bounds.x,t.bounds.y),new Y(r.x,r.y))},J.repeatRowIndex=-1,J);function J(t){t=Xo.call(this,t)||this;return t.gridInitialWidth=0,t.gridSize=new Y(0,0),t.parentCellIndex=0,t.tempWidth=0,t.childheight=0,t.isChildGrid=!1,t.hasRowSpanSpan=!1,t.isRearranged=!1,t.pageBounds=new X,t.listOfNavigatePages=[],t.flag=!0,t.columnRanges=[],t.currentLocation=new q(0,0),t.breakRow=!0,t.slr=null,t.remainderText=null,t.isPaginate=!1,t.isOverloadWithPosition=!1,t}L(Qo,Zo=Zr);var Zo,$o=Qo;function Qo(t,e){return Zo.call(this,t,e)||this}L(is,ts=qr);var ts,es=is;function is(t){return ts.call(this,t)||this}Object.defineProperty(ns.prototype,"rowIndex",{get:function(){return this.gridRowIndex},enumerable:!0,configurable:!0}),Object.defineProperty(ns.prototype,"cellIndex",{get:function(){return this.gridCellIndex},enumerable:!0,configurable:!0}),Object.defineProperty(ns.prototype,"value",{get:function(){return this.internalValue},enumerable:!0,configurable:!0}),Object.defineProperty(ns.prototype,"bounds",{get:function(){return this.gridBounds},enumerable:!0,configurable:!0}),Object.defineProperty(ns.prototype,"graphics",{get:function(){return this.pdfGraphics},enumerable:!0,configurable:!0});var rs=ns;function ns(t,e,i,r,n){this.gridRowIndex=e,this.gridCellIndex=i,this.internalValue=n,this.gridBounds=r,this.pdfGraphics=t}L(as,os=rs),Object.defineProperty(as.prototype,"skip",{get:function(){return this.bSkip},set:function(t){this.bSkip=t},enumerable:!0,configurable:!0}),Object.defineProperty(as.prototype,"style",{get:function(){return this.cellStyle},set:function(t){this.cellStyle=t},enumerable:!0,configurable:!0});var os,ss=as;function as(t,e,i,r,n,o){t=os.call(this,t,e,i,r,n)||this;return t.style=o,t}L(us,hs=rs),Object.defineProperty(us.prototype,"style",{get:function(){return this.cellStyle},enumerable:!0,configurable:!0});var hs,ls=us;function us(t,e,i,r,n,o){t=hs.call(this,t,e,i,r,n)||this;return t.cellStyle=o,t}Object.defineProperty(ps.prototype,"cancel",{get:function(){return this.isCancel},set:function(t){this.isCancel=t},enumerable:!0,configurable:!0});var cs=ps;function ps(){}L(gs,ds=cs),Object.defineProperty(gs.prototype,"bounds",{get:function(){return this.cellBounds},set:function(t){this.cellBounds=t},enumerable:!0,configurable:!0}),Object.defineProperty(gs.prototype,"page",{get:function(){return this.pdfPage},enumerable:!0,configurable:!0});var ds,fs=gs;function gs(t,e){var i=ds.call(this)||this;return i.bounds=t,i.pdfPage=e,i}L(bs,ms=cs),Object.defineProperty(bs.prototype,"result",{get:function(){return this.layoutResult},enumerable:!0,configurable:!0}),Object.defineProperty(bs.prototype,"nextPage",{get:function(){return this.nextPdfPage},set:function(t){this.nextPdfPage=t},enumerable:!0,configurable:!0});var ms,ys=bs;function bs(t){var e=ms.call(this)||this;return e.layoutResult=t,e}L(Ss,ws=fs),Object.defineProperty(Ss.prototype,"startRowIndex",{get:function(){return this.startRow},enumerable:!0,configurable:!0});var ws,Ps=Ss;function Ss(t,e,i){t=ws.call(this,t,e)||this;return t.startRow=i,t}L(Bs,vs=ys);var vs,Cs=Bs;function Bs(t){return vs.call(this,t)||this}Object.defineProperty(xs.prototype,"isFinish",{get:function(){return this.bIsFinished},set:function(t){this.bIsFinished=t},enumerable:!0,configurable:!0}),Object.defineProperty(xs.prototype,"bounds",{get:function(){return this.layoutedBounds},set:function(t){this.layoutedBounds=t},enumerable:!0,configurable:!0});var Os=xs;function xs(){this.layoutedBounds=new X(0,0,0,0)}Ls=function(t,e){return(Ls=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}Ls(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(ks,Ts=Ur),Object.defineProperty(ks.prototype,"element",{get:function(){return this.elements},enumerable:!0,configurable:!0}),ks.prototype.layoutInternal=function(t){var e=t.page,i=t.bounds,r=this.element.getBounds(),n=(r.x=0,r.y=0,this.shapeBounds.x===this.shapeBounds.y&&this.shapeBounds.y===this.shapeBounds.width&&this.shapeBounds.width===this.shapeBounds.height&&0===this.shapeBounds.height),o=(this.isPdfGrid&&!n&&(r=this.shapeBounds),null),s=new Vs;for(s.page=e;;){var a=this.raiseBeforePageLayout(e,i),i=a.currentBounds,h=null;if(a.cancel||(s=this.layoutOnPage(e,i,r,t),h=this.raiseEndPageLayout(s),a.cancel=null!==h&&h.cancel),s.end||a.cancel){o=this.getLayoutResult(s);break}if(i=this.getPaginateBounds(t),r=this.getNextShapeBounds(r,s),e=null===h||null===h.nextPage?this.getNextPage(e):h.nextPage,this.isPdfGrid){o=this.getLayoutResult(s);break}}return o},ks.prototype.raiseBeforePageLayout=function(t,e){var i=!1;return this.element.raiseBeginPageLayout&&(t=new fs(e,t),this.element.onBeginPageLayout(t),i=t.cancel,e=t.bounds),{currentBounds:e,cancel:i}},ks.prototype.raiseEndPageLayout=function(t){var e=null;return this.element.raiseEndPageLayout&&(t=this.getLayoutResult(t),e=new ys(t),this.element.onEndPageLayout(e)),e},ks.prototype.getLayoutResult=function(t){return new Zr(t.page,t.bounds)},ks.prototype.getNextShapeBounds=function(t,e){e=e.bounds;return t.y=t.y+e.height,t.height=t.height-e.height,t},ks.prototype.layoutOnPage=function(t,e,i,r){var n=new Vs,o=(e=this.checkCorrectCurrentBounds(t,e,r),this.fitsToBounds(e,i)),s=!1;return!(r.format.break===K.PdfLayoutBreakType.FitElement&&!o&&t===r.page)&&(o=this.getDrawBounds(e,i),this.drawShape(t.graphics,e,o),n.bounds=this.getPageResultBounds(e,i),s=e.height>=i.height),n.end=s||r.format.layout===K.PdfLayoutType.OnePage,n.page=t,n},ks.prototype.getDrawBounds=function(t,e){return t.y=t.y-e.y,t.height=t.height+e.y,t},ks.prototype.drawShape=function(t,e,i){var r=t.save();try{t.setClip(e),this.element.drawGraphicsHelper(t,new q(i.x,i.y))}finally{t.restore(r)}},ks.prototype.checkCorrectCurrentBounds=function(t,e,i){t=t.graphics.clientSize;return e.width=0<e.width?e.width:t.width-e.x,e.height=0<e.height?e.height:t.height-e.y,this.isPdfGrid&&(e.height=e.height-this.bottomCellPadding),e},ks.prototype.getPageResultBounds=function(t,e){return t.height=Math.min(t.height,e.height),t},ks.prototype.fitsToBounds=function(t,e){return e.height<=t.height},ks.index=0,ks.splitDiff=0,ks.last=!1,ks.borderWidth=0;var Ls,Ts,js=ks;function ks(t){t=Ts.call(this,t)||this;return t.olderPdfForm=0,t.shapeBounds=new X,t.totalPageSize=0,t}var Vs=function(){};Rs=function(t,e){return(Rs=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}Rs(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(Ds,Ms=nn),Ds.prototype.getBounds=function(){return this.getBoundsInternal()},Ds.prototype.drawGraphicsHelper=function(t,e){if(null==t)throw new Error("ArgumentNullException :graphics");this.drawShapeHelper(t,e.x,e.y)},Ds.prototype.drawShapeHelper=function(t,e,i){var r=.5!==e||.5!==i,n=null;r&&(n=t.save(),t.translateTransform(e,i)),this.drawInternal(t),r&&t.restore(n)},Ds.prototype.layout=function(t){return new js(this).layout(t)};var Rs,Ms,L=Ds;function Ds(){return null!==Ms&&Ms.apply(this,arguments)||this}Ns=function(t,e){return(Ns=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}Ns(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(Is,As=L),Object.defineProperty(Is.prototype,"pen",{get:function(){return this.mpen},set:function(t){this.mpen=t},enumerable:!0,configurable:!0});var Ns,As,L=Is;function Is(t){var e=As.call(this)||this;return void 0!==t&&(e.mpen=t),e}Fs=function(t,e){return(Fs=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}Fs(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(Gs,Es=L),Object.defineProperty(Gs.prototype,"brush",{get:function(){return this.mbrush},set:function(t){this.mbrush=t},enumerable:!0,configurable:!0}),Gs.prototype.obtainPen=function(){return null==this.mbrush&&null==this.pen?new te(new f(0,0,0)):this.pen};var Fs,Es,L=Gs;function Gs(t,e){var i=Es.call(this)||this;return i.mbrush=null,void 0!==t&&(t instanceof te?i=Es.call(this,t)||this:i.mbrush=e),i}zs=function(t,e){return(zs=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}zs(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(j,Ws=L),Object.defineProperty(j.prototype,"fillMode",{get:function(){return this.mfillMode},set:function(t){this.mfillMode=t},enumerable:!0,configurable:!0}),Object.defineProperty(j.prototype,"pathPoints",{get:function(){return this.points},enumerable:!0,configurable:!0}),Object.defineProperty(j.prototype,"pathTypes",{get:function(){return this.types},enumerable:!0,configurable:!0}),Object.defineProperty(j.prototype,"pointCount",{get:function(){var t=0;return t=null!=this.mpoints?this.mpoints.length:t},enumerable:!0,configurable:!0}),Object.defineProperty(j.prototype,"lastPoint",{get:function(){return this.getLastPoint()},enumerable:!0,configurable:!0}),Object.defineProperty(j.prototype,"points",{get:function(){return null==this.mpoints&&(this.mpoints=[]),this.mpoints},enumerable:!0,configurable:!0}),Object.defineProperty(j.prototype,"types",{get:function(){return null==this.mpathTypes&&(this.mpathTypes=[]),this.mpathTypes},enumerable:!0,configurable:!0}),j.prototype.draw=function(t,e,i,r){var n;return e instanceof q&&void 0===e.width&&void 0===i?this.drawHelper(t,e.x,e.y):e instanceof X&&void 0!==e.width&&void 0===i?this.drawHelper(t,e,null):"number"==typeof e&&"number"==typeof i&&void 0===r?this.drawHelper(t,e,i,null):e instanceof q&&i instanceof qr?this.drawHelper(t,e.x,e.y,i):"number"==typeof e&&(r instanceof qr||null==r)&&"number"==typeof i?(n=t.graphics.clientSize.width-e,n=new X(e,i,n,0),this.drawHelper(t,n,r)):(e instanceof X&&0 instanceof qr,this.drawHelper(t,e,i))},j.prototype.addArc=function(t,e,i,r,n,o){if(t instanceof X)this.addArc(t.x,t.y,t.width,t.height,e,i);else for(var s=this.getBezierArcPoints(t,e,e+i,e+r,n,o),a=0;a<s.length;a+=8){var h=[s[a],s[a+1],s[a+2],s[a+3],s[a+4],s[a+5],s[a+6],s[a+7]];this.addPoints(h,K.PathPointType.Bezier3)}},j.prototype.addBezier=function(t,e,i,r,n,o,s,a){var h;t instanceof q&&e instanceof q&&i instanceof q&&r instanceof q?this.addBezier(t.x,t.y,e.x,e.y,i.x,i.y,r.x,r.y):((h=[]).push(t),h.push(e),h.push(i),h.push(r),h.push(n),h.push(o),h.push(s),h.push(a),this.addPoints(h,K.PathPointType.Bezier3))},j.prototype.addEllipse=function(t,e,i,r){t instanceof X?this.addEllipse(t.x,t.y,t.width,t.height):(this.startFigure(),this.addArc(t,e,i,r,0,360),this.closeFigure())},j.prototype.addLine=function(t,e,i,r){var n;t instanceof q&&e instanceof q?this.addLine(t.x,t.y,e.x,e.y):((n=[]).push(t),n.push(e),n.push(i),n.push(r),this.addPoints(n,K.PathPointType.Line))},j.prototype.addPath=function(t,e){if(t instanceof j)this.addPath(t.pathPoints,t.pathTypes);else{if(null==t)throw new Error("ArgumentNullException:pathPoints");if(null==e)throw new Error("ArgumentNullException:pathTypes");if(t.length!==e.length)throw new Error("The argument arrays should be of equal length.")}},j.prototype.addPie=function(t,e,i,r,n,o){t instanceof X?this.addPie(t.x,t.y,t.width,t.height,e,i):(this.startFigure(),this.addArc(t,e,i,r,n,o),this.addPoint(new q(t+i/2,e+r/2),K.PathPointType.Line),this.closeFigure())},j.prototype.addPolygon=function(t){t.length;var e=[];this.startFigure();for(var i=0;i<t.length;i++)e.push(t[i].x),e.push(t[i].y);this.addPoints(e,K.PathPointType.Line),this.closeFigure()},j.prototype.addRectangle=function(t,e,i,r){var n;t instanceof X?this.addRectangle(t.x,t.y,t.width,t.height):(n=[],this.startFigure(),n.push(t),n.push(e),n.push(t+i),n.push(e),n.push(t+i),n.push(e+r),n.push(t),n.push(e+r),this.addPoints(n,K.PathPointType.Line),this.closeFigure())},j.prototype.startFigure=function(){this.mStartFigure=!0},j.prototype.closeAllFigures=function(){for(var t=this.pathPoints[0],e=0;e<this.mpathTypes.length;e++){var i=this.types[e],r=!1;0!==e&&i===K.PathPointType.Start?(this.closeFigure(e-1),r=!0):e===this.mpathTypes.length-1&&!r&&this.isXps&&t.x===this.pathPoints[e].y&&this.closeFigure(e)}},j.prototype.getLastPoint=function(){var t=new q(0,0),e=this.pointCount;return 0<e&&null!=this.mpoints&&(t.x=this.mpoints[e-1].x,t.y=this.mpoints[e-1].y),t},j.prototype.getBezierArcPoints=function(t,e,i,r,n,o){i<t&&(p=void 0,p=t,t=i,i=p),e<r&&(p=void 0,p=e,e=r,r=p),Math.abs(o)<=90?(s=o,a=1):s=o/(a=Math.ceil(Math.abs(o)/90));for(var s,a,h=(t+i)/2,l=(e+r)/2,u=(i-t)/2,c=(r-e)/2,p=s*(Math.PI/360),d=Math.abs(4/3*(1-Math.cos(p))/Math.sin(p)),f=[],g=0;g<a;g++){var m=(n+g*s)*(Math.PI/180),y=(n+(g+1)*s)*(Math.PI/180),b=Math.cos(m),w=Math.cos(y),m=Math.sin(m),y=Math.sin(y);0<s?f.push(h+u*b,l-c*m,h+u*(b-d*m),l-c*(m+d*b),h+u*(w+d*y),l-c*(y-d*w),h+u*w,l-c*y):f.push(h+u*b,l-c*m,h+u*(b+d*m),l-c*(m-d*b),h+u*(w-d*y),l-c*(y+d*w),h+u*w,l-c*y)}return f},j.prototype.getBoundsInternal=function(){var t=this.pathPoints,e=new X(0,0,0,0);if(0<t.length){for(var i=t[0].x,r=t[0].x,n=t[0].y,o=t[0].y,s=1;s<t.length;s++)var a=t[s],i=Math.min(a.x,i),r=Math.max(a.x,r),n=Math.min(a.y,n),o=Math.max(a.y,o);e=new X(i,n,r-i,o-n)}return e},j.prototype.drawInternal=function(t){if(null==t)throw new Error("ArgumentNullException :graphics");t.drawPath(this.obtainPen(),this.brush,this)},j.prototype.addPoints=function(t,e,i,r){if(void 0===i&&void 0===r)this.addPoints(t,e,0,t.length);else for(var n=i;n<r;n++){var o=new q(t[n],t[n+1]);n===i?this.pointCount<=0||this.mStartFigure?(this.addPoint(o,K.PathPointType.Start),this.mStartFigure=!1):o.x===this.lastPoint.x||o.y===this.lastPoint.y||this.isBeziers3?o.x!==this.lastPoint.x&&o.y!==this.lastPoint.y&&this.addPoint(o,K.PathPointType.Bezier3):this.addPoint(o,K.PathPointType.Line):this.addPoint(o,e),n++}},j.prototype.addPoint=function(t,e){this.points.push(t),this.types.push(e)},j.prototype.closeFigure=function(t){if(void 0===t)0<this.pointCount&&this.closeFigure(this.pointCount-1),this.startFigure();else{if(t<0)throw new Error("IndexOutOfRangeException()");var e=this.types[t];e|=K.PathPointType.CloseSubpath,this.types[t]=e}};var zs,Ws,_s=j;function j(t,e,i,r){var n=Ws.call(this)||this;return n.mpoints=null,n.mpathTypes=null,n.mStartFigure=!0,n.mfillMode=K.PdfFillMode.Alternate,n.isBeziers3=!1,n.isXps=!1,void 0!==t&&(t instanceof te?(n=Ws.call(this,t)||this,e instanceof pt?(n=Ws.call(this,t,e)||this).fillMode=i:null!=e&&null!=i&&n.addPath(e,i)):t instanceof pt?(n=Ws.call(this,t)||this,null!=e&&(n.fillMode=e),null!=i&&null!=r&&n.addPath(i,r)):n.addPath(t,e)),n}Hs=function(t,e){return(Hs=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}Hs(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(Ks,Us=L),Object.defineProperty(Ks.prototype,"x",{get:function(){return this.bounds.x},set:function(t){this.bounds.x=t},enumerable:!0,configurable:!0}),Object.defineProperty(Ks.prototype,"y",{get:function(){return this.bounds.y},set:function(t){this.bounds.y=t},enumerable:!0,configurable:!0}),Object.defineProperty(Ks.prototype,"width",{get:function(){return this.bounds.width},set:function(t){this.bounds.width=t},enumerable:!0,configurable:!0}),Object.defineProperty(Ks.prototype,"height",{get:function(){return this.bounds.height},set:function(t){this.bounds.height=t},enumerable:!0,configurable:!0}),Ks.prototype.getBoundsInternal=function(){return this.bounds};var Hs,Us,L=Ks;function Ks(t,e,i,r,n,o){var s=Us.call(this)||this;return s.bounds=new X(0,0,0,0),void 0!==t&&(t instanceof te?(s=Us.call(this,t,e)||this,i instanceof X?s.bounds=i:s.bounds=new X(i,r,n,o)):t instanceof X?s.bounds=t:s.bounds=new X(t,e,i,r)),s}qs=function(t,e){return(qs=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}qs(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(Xs,Ys=L);var qs,Ys,L=Xs;function Xs(t,e,i,r,n,o,s,a){var h=Ys.call(this)||this;return h.startAngle=0,void(h.sweepAngle=0)!==t&&(t instanceof X&&void 0!==e&&void 0!==i?((h=Ys.call(this,t)||this).startAngle=e,h.sweepAngle=i):t instanceof te?i instanceof X?((h=Ys.call(this,t,e,i)||this).startAngle=r,h.sweepAngle=n):((h=Ys.call(this,t,e,i,r,n,o)||this).startAngle=s,h.sweepAngle=a):((h=Ys.call(this,t,e,i,r)||this).startAngle=n,h.sweepAngle=o)),h}Js=function(t,e){return(Js=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}Js(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})($s,Zs=L),$s.prototype.draw=function(t,e,i,r){var n;return e instanceof q&&void 0===e.width&&void 0===i?this.drawHelper(t,e.x,e.y):e instanceof X&&void 0!==e.width&&void 0===i?this.drawHelper(t,e,null):"number"==typeof e&&"number"==typeof i&&void 0===r?this.drawHelper(t,e,i,null):e instanceof q&&i instanceof qr?this.drawHelper(t,e.x,e.y,i):"number"==typeof e&&(r instanceof qr||null==r)&&"number"==typeof i?(n=t.graphics.clientSize.width-e,n=new X(e,i,n,0),this.drawHelper(t,n,r)):this.drawHelper(t,e,i)},$s.prototype.drawInternal=function(t){if(null==t)throw new Error("ArgumentNullException : graphics");t.drawArc(this.obtainPen(),this.bounds,this.startAngle,this.sweepAngle)};var Js,Zs,L=$s;function $s(t,e,i,r,n,o,s){var a=this;return void 0===t?a=Zs.call(this)||this:t instanceof X?a=Zs.call(this,t,e,i)||this:t instanceof te?e instanceof X?a=Zs.call(this,t,null,e,i,r)||this:void 0===o&&void 0===s?a=Zs.call(this,t,null,0,0,e,i,r,n)||this:void 0!==o&&void 0!==s&&(a=Zs.call(this,t,null,e,i,r,n,o,s)||this):void 0!==t&&void 0===n&&void 0===o?a=Zs.call(this,0,0,t,e,i,r)||this:void 0!==t&&void 0!==n&&void 0!==o&&(a=Zs.call(this,t,e,i,r,n,o)||this),a}Qs=function(t,e){return(Qs=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}Qs(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(ia,ta=Tt),ia.prototype.equalsToFont=function(t){return!1},ia.prototype.getLineWidth=function(t,e){var i=0,r=(i=null!=e&&e.textDirection!==K.PdfTextDirection.None?this.getUnicodeLineWidth(t,i,e).width:this.fontInternal.getLineWidth(t),this.metrics.getSize(e));return i=this.applyFormatSettings(t,e,i*=Tt.charSizeMultiplier*r)},ia.prototype.getCharWidth=function(t,e){t=this.fontInternal.getCharWidth(t);return t*=.001*this.metrics.getSize(e)},ia.prototype.createFontInternal=function(t,e){this.fontInternal=new li(t,this.size),this.calculateStyle(e),this.initializeInternals()},ia.prototype.calculateStyle=function(t){var e=this.fontInternal.ttfMetrics.macStyle;0!=(t&K.PdfFontStyle.Underline)&&(e|=K.PdfFontStyle.Underline),0!=(t&K.PdfFontStyle.Strikeout)&&(e|=K.PdfFontStyle.Strikeout),this.setStyle(e)},ia.prototype.initializeInternals=function(){var t,e=null,i=null;null!=(e=Br.enableCache?Br.cache.search(this):e)?(i=e.getInternals(),(t=(t=e.metrics).clone()).size=this.size,this.metrics=t,this.fontInternal=e.fontInternal):null==e&&(this.fontInternal instanceof li&&(this.fontInternal.isEmbed=this.isEmbedFont),this.fontInternal.createInternals(),i=this.fontInternal.getInternals(),this.metrics=this.fontInternal.metrics),this.metrics.isUnicodeFont=!0,this.setInternals(i)},ia.prototype.setSymbols=function(t){var e=this.fontInternal;null!=e&&e.setSymbols(t)},Object.defineProperty(ia.prototype,"Unicode",{get:function(){return this.isUnicode},enumerable:!0,configurable:!0}),ia.prototype.getUnicodeLineWidth=function(t,e,i){e=0;var t=(new bi).getGlyphIndex(t,this,i.textDirection===K.PdfTextDirection.RightToLeft,null,!0),i=t.success,r=t.glyphs;if(i&&null!==r)for(var n=this.fontInternal.ttfReader,o=0,s=r.length;o<s;o++){var a=r[o],a=n.getGlyph(a);null!=a&&(e+=a.width)}return{success:i,width:e}};var Qs,ta,ea=ia;function ia(t,e,i){e=ta.call(this,e)||this;return e.isEmbedFont=!1,e.isUnicode=!0,void 0!==i?e.createFontInternal(t,i):e.createFontInternal(t,K.PdfFontStyle.Regular),e}Object.defineProperty(k.prototype,"dock",{get:function(){return this.dockStyle},set:function(t){this.dockStyle=t,this.resetAlignment()},enumerable:!0,configurable:!0}),Object.defineProperty(k.prototype,"alignment",{get:function(){return this.alignmentStyle},set:function(t){this.setAlignment(t)},enumerable:!0,configurable:!0}),Object.defineProperty(k.prototype,"foreground",{get:function(){return this.isForeground},set:function(t){this.isForeground=t},enumerable:!0,configurable:!0}),Object.defineProperty(k.prototype,"background",{get:function(){return!this.isForeground},set:function(t){this.isForeground=!t},enumerable:!0,configurable:!0}),Object.defineProperty(k.prototype,"location",{get:function(){return this.currentLocation},set:function(t){this.type===K.TemplateType.None&&(this.currentLocation=t)},enumerable:!0,configurable:!0}),Object.defineProperty(k.prototype,"x",{get:function(){return void 0!==this.currentLocation?this.currentLocation.x:0},set:function(t){this.type===K.TemplateType.None&&(this.currentLocation.x=t)},enumerable:!0,configurable:!0}),Object.defineProperty(k.prototype,"y",{get:function(){return void 0!==this.currentLocation?this.currentLocation.y:0},set:function(t){this.type===K.TemplateType.None&&(this.currentLocation.y=t)},enumerable:!0,configurable:!0}),Object.defineProperty(k.prototype,"size",{get:function(){return this.template.size},set:function(t){this.type===K.TemplateType.None&&this.template.reset(t)},enumerable:!0,configurable:!0}),Object.defineProperty(k.prototype,"width",{get:function(){return this.template.width},set:function(t){var e;this.template.width!==t&&this.type===K.TemplateType.None&&((e=this.template.size).width=t,this.template.reset(e))},enumerable:!0,configurable:!0}),Object.defineProperty(k.prototype,"height",{get:function(){return this.template.height},set:function(t){var e;this.template.height!==t&&this.type===K.TemplateType.None&&((e=this.template.size).height=t,this.template.reset(e))},enumerable:!0,configurable:!0}),Object.defineProperty(k.prototype,"graphics",{get:function(){return this.template.graphics},enumerable:!0,configurable:!0}),Object.defineProperty(k.prototype,"template",{get:function(){return this.pdfTemplate},enumerable:!0,configurable:!0}),Object.defineProperty(k.prototype,"type",{get:function(){return this.templateType},set:function(t){this.updateDocking(t),this.templateType=t},enumerable:!0,configurable:!0}),Object.defineProperty(k.prototype,"bounds",{get:function(){return new X(new q(this.x,this.y),this.size)},set:function(t){this.type===K.TemplateType.None&&(this.location=new q(t.x,t.y),this.size=new Y(t.width,t.height))},enumerable:!0,configurable:!0}),k.prototype.InitiateBounds=function(t,e,i,r,n){this.x=t,this.y=e,this.pdfTemplate=new Bi(i,r)},k.prototype.updateDocking=function(t){if(t!==K.TemplateType.None){switch(t){case K.TemplateType.Top:this.dock=K.PdfDockStyle.Top;break;case K.TemplateType.Bottom:this.dock=K.PdfDockStyle.Bottom;break;case K.TemplateType.Left:this.dock=K.PdfDockStyle.Left;break;case K.TemplateType.Right:this.dock=K.PdfDockStyle.Right}this.resetAlignment()}},k.prototype.resetAlignment=function(){this.alignment=K.PdfAlignmentStyle.None},k.prototype.setAlignment=function(t){if(this.dock===K.PdfDockStyle.None)this.alignmentStyle=t;else{var e=!1;switch(this.dock){case K.PdfDockStyle.Left:e=t===K.PdfAlignmentStyle.TopLeft||t===K.PdfAlignmentStyle.MiddleLeft||t===K.PdfAlignmentStyle.BottomLeft||t===K.PdfAlignmentStyle.None;break;case K.PdfDockStyle.Top:e=t===K.PdfAlignmentStyle.TopLeft||t===K.PdfAlignmentStyle.TopCenter||t===K.PdfAlignmentStyle.TopRight||t===K.PdfAlignmentStyle.None;break;case K.PdfDockStyle.Right:e=t===K.PdfAlignmentStyle.TopRight||t===K.PdfAlignmentStyle.MiddleRight||t===K.PdfAlignmentStyle.BottomRight||t===K.PdfAlignmentStyle.None;break;case K.PdfDockStyle.Bottom:e=t===K.PdfAlignmentStyle.BottomLeft||t===K.PdfAlignmentStyle.BottomCenter||t===K.PdfAlignmentStyle.BottomRight||t===K.PdfAlignmentStyle.None;break;case K.PdfDockStyle.Fill:e=t===K.PdfAlignmentStyle.MiddleCenter||t===K.PdfAlignmentStyle.None}e&&(this.alignmentStyle=t)}},k.prototype.draw=function(t,e){var i=t.page,i=this.calculateBounds(i,e);t.graphics.drawPdfTemplate(this.template,new q(i.x,i.y),new Y(i.width,i.height))},k.prototype.calculateBounds=function(t,e){var i=this.bounds;return this.alignmentStyle!==K.PdfAlignmentStyle.None?i=this.getAlignmentBounds(t,e):this.dockStyle!==K.PdfDockStyle.None&&(i=this.getDockBounds(t,e)),i},k.prototype.getAlignmentBounds=function(t,e){this.bounds;return this.type===K.TemplateType.None?this.getSimpleAlignmentBounds(t,e):this.getTemplateAlignmentBounds(t,e)},k.prototype.getSimpleAlignmentBounds=function(t,e){var i=this.bounds,r=t.section.getActualBounds(e,t,!1),n=this.x,o=this.y;switch(this.alignmentStyle){case K.PdfAlignmentStyle.TopLeft:o=n=0;break;case K.PdfAlignmentStyle.TopCenter:n=(r.width-this.width)/2,o=0;break;case K.PdfAlignmentStyle.TopRight:n=r.width-this.width,o=0;break;case K.PdfAlignmentStyle.MiddleLeft:n=0,o=(r.height-this.height)/2;break;case K.PdfAlignmentStyle.MiddleCenter:n=(r.width-this.width)/2,o=(r.height-this.height)/2;break;case K.PdfAlignmentStyle.MiddleRight:n=r.width-this.width,o=(r.height-this.height)/2;break;case K.PdfAlignmentStyle.BottomLeft:n=0,o=r.height-this.height;break;case K.PdfAlignmentStyle.BottomCenter:n=(r.width-this.width)/2,o=r.height-this.height;break;case K.PdfAlignmentStyle.BottomRight:n=r.width-this.width,o=r.height-this.height}return i.x=n,i.y=o,i},k.prototype.getTemplateAlignmentBounds=function(t,e){var i=this.bounds,r=t.section,n=r.getActualBounds(e,t,!1),o=this.x,s=this.y;switch(this.alignmentStyle){case K.PdfAlignmentStyle.TopLeft:this.type===K.TemplateType.Left?(o=this.convertSign(n.x),s=0):this.type===K.TemplateType.Top&&(o=this.convertSign(n.x),s=this.convertSign(n.y));break;case K.PdfAlignmentStyle.TopCenter:o=(n.width-this.width)/2,s=this.convertSign(n.y);break;case K.PdfAlignmentStyle.TopRight:this.type===K.TemplateType.Right?(o=n.width+r.getRightIndentWidth(e,t,!1)-this.width,s=0):this.type===K.TemplateType.Top&&(o=n.width+r.getRightIndentWidth(e,t,!1)-this.width,s=this.convertSign(n.y));break;case K.PdfAlignmentStyle.MiddleLeft:o=this.convertSign(n.x),s=(n.height-this.height)/2;break;case K.PdfAlignmentStyle.MiddleCenter:o=(n.width-this.width)/2,s=(n.height-this.height)/2;break;case K.PdfAlignmentStyle.MiddleRight:o=n.width+r.getRightIndentWidth(e,t,!1)-this.width,s=(n.height-this.height)/2;break;case K.PdfAlignmentStyle.BottomLeft:this.type===K.TemplateType.Left?(o=this.convertSign(n.x),s=n.height-this.height):this.type===K.TemplateType.Bottom&&(o=this.convertSign(n.x),s=n.height+r.getBottomIndentHeight(e,t,!1)-this.height);break;case K.PdfAlignmentStyle.BottomCenter:o=(n.width-this.width)/2,s=n.height+r.getBottomIndentHeight(e,t,!1)-this.height;break;case K.PdfAlignmentStyle.BottomRight:this.type===K.TemplateType.Right?(o=n.width+r.getRightIndentWidth(e,t,!1)-this.width,s=n.height-this.height):this.type===K.TemplateType.Bottom&&(o=n.width+r.getRightIndentWidth(e,t,!1)-this.width,s=n.height+r.getBottomIndentHeight(e,t,!1)-this.height)}return i.x=o,i.y=s,i},k.prototype.getDockBounds=function(t,e){this.bounds;return this.type===K.TemplateType.None?this.getSimpleDockBounds(t,e):this.getTemplateDockBounds(t,e)},k.prototype.getSimpleDockBounds=function(t,e){this.bounds;var i=t.section.getActualBounds(e,t,!1),r=this.x,n=this.y,o=this.width,s=this.height;switch(this.dockStyle){case K.PdfDockStyle.Left:n=r=0,o=this.width,s=i.height;break;case K.PdfDockStyle.Top:n=r=0,o=i.width,s=this.height;break;case K.PdfDockStyle.Right:r=i.width-this.width,n=0,o=this.width,s=i.height;break;case K.PdfDockStyle.Bottom:r=0,n=i.height-this.height,o=i.width,s=this.height;break;case K.PdfDockStyle.Fill:r=r=0,o=i.width,s=i.height}return new X(r,n,o,s)},k.prototype.getTemplateDockBounds=function(t,e){this.bounds;var i=t.section,r=i.getActualBounds(e,t,!1),n=i.pageSettings.getActualSize(),o=this.x,s=this.y,a=this.width,h=this.height;switch(this.dockStyle){case K.PdfDockStyle.Left:o=this.convertSign(r.x),s=0,a=this.width,h=r.height;break;case K.PdfDockStyle.Top:o=this.convertSign(r.x),s=this.convertSign(r.y),a=n.width,h=this.height,r.height<0&&(s=n.height-r.y);break;case K.PdfDockStyle.Right:o=r.width+i.getRightIndentWidth(e,t,!1)-this.width,s=0,a=this.width,h=r.height;break;case K.PdfDockStyle.Bottom:o=this.convertSign(r.x),s=r.height+i.getBottomIndentHeight(e,t,!1)-this.height,a=n.width,h=this.height,r.height<0&&(s-=n.height);break;case K.PdfDockStyle.Fill:o=o=0,a=r.width,h=r.height}return new X(o,s,a,h)},k.prototype.convertSign=function(t){return 0!==t||0===t&&1/t==-1/0?-t:t};var ra=k;function k(t,e,i,r,n){t instanceof X&&void 0===e?this.InitiateBounds(t.x,t.y,t.width,t.height,null):t instanceof X&&e instanceof er&&void 0===i?this.InitiateBounds(t.x,t.y,t.width,t.height,e):t instanceof q&&e instanceof Y&&void 0===i?this.InitiateBounds(t.x,t.y,e.width,e.height,null):t instanceof q&&e instanceof Y&&i instanceof er&&void 0===r?this.InitiateBounds(t.x,t.y,e.width,e.height,i):t instanceof Y&&void 0===e?this.InitiateBounds(0,0,t.width,t.height,null):"number"==typeof t&&"number"==typeof e&&void 0===i?this.InitiateBounds(0,0,t,e,null):"number"==typeof t&&"number"==typeof e&&i instanceof er&&void 0===r?this.InitiateBounds(0,0,t,e,i):this.InitiateBounds(t,e,i,r,null)}K.ArabicShape=pi,K.ArabicShapeRenderer=ui,K.BeginPageLayoutEventArgs=fs,K.Bidi=fi,K.ByteArray=Pe,K.Dictionary=a,K.DictionaryProperties=l,K.ElementLayouter=Ur,K.EndPageLayoutEventArgs=ys,K.GetResourceEventHandler=Ii,K.GridCellEventArgs=rs,K.Guid=ki,K.ImageDecoder=ve,K.LineInfo=xt,K.Matrix=ne,K.ObjectInfo=Dt,K.Operators=h,K.PageAddedEventArgs=rr,K.PageSettingsState=fr,K.PdfAction=nt,K.PdfActionLinkAnnotation=Er,K.PdfAnnotation=Vr,K.PdfAnnotationCollection=Zi,K.PdfArc=L,K.PdfArray=p,K.PdfBitmap=ke,K.PdfBlend=oo,K.PdfBorders=Qr,K.PdfBrush=pt,K.PdfBrushes=O,K.PdfCacheCollection=Pr,K.PdfCancelEventArgs=cs,K.PdfCatalog=_t,K.PdfCollection=w,K.PdfColor=f,K.PdfColorBlend=lo,K.PdfCompositeField=Rn,K.PdfCrossTable=Ut,K.PdfDestination=Yn,K.PdfDictionary=c,K.PdfDocument=Br,K.PdfDocumentBase=i,K.PdfDocumentLinkAnnotation=_r,K.PdfDocumentPageCollection=br,K.PdfDocumentTemplate=ar,K.PdfFont=Tt,K.PdfFontMetrics=ii,K.PdfFunction=Jn,K.PdfGradientBrush=vi,K.PdfGraphics=Ai,K.PdfGraphicsState=Ei,K.PdfGrid=Ko,K.PdfGridBeginCellDrawEventArgs=ss,K.PdfGridBeginPageLayoutEventArgs=Ps,K.PdfGridCell=Vo,K.PdfGridCellCollection=Ro,K.PdfGridCellStyle=Lo,K.PdfGridColumn=Do,K.PdfGridColumnCollection=Ao,K.PdfGridEndCellDrawEventArgs=ls,K.PdfGridEndPageLayoutEventArgs=Cs,K.PdfGridHeaderCollection=Wo,K.PdfGridLayoutFormat=es,K.PdfGridLayoutResult=$o,K.PdfGridLayouter=Jo,K.PdfGridRow=Fo,K.PdfGridRowCollection=Go,K.PdfGridRowStyle=jo,K.PdfGridStyle=Bo,K.PdfGridStyleBase=So,K.PdfImage=xe,K.PdfLayoutElement=nn,K.PdfLayoutFormat=qr,K.PdfLayoutParams=Xr,K.PdfLayoutResult=Zr,K.PdfLinearGradientBrush=fo,K.PdfLinkAnnotation=Nr,K.PdfMainObjectCollection=Rt,K.PdfMargins=Xt,K.PdfName=o,K.PdfNumber=u,K.PdfPaddings=en,K.PdfPage=er,K.PdfPageBase=Xi,K.PdfPageCountField=_n,K.PdfPageLayer=Wi,K.PdfPageLayerCollection=qi,K.PdfPageNumberField=An,K.PdfPageSettings=Zt,K.PdfPageSize=Yt,K.PdfPageTemplateElement=ra,K.PdfPath=_s,K.PdfPen=te,K.PdfRadialGradientBrush=bo,K.PdfReference=et,K.PdfReferenceHolder=d,K.PdfResources=Ti,K.PdfSampledFunction=ro,K.PdfSection=dr,K.PdfSectionCollection=mr,K.PdfSectionPageCollection=or,K.PdfSectionTemplate=cr,K.PdfSolidBrush=mt,K.PdfStandardFont=jr,K.PdfStandardFontMetricsFactory=xr,K.PdfStream=U,K.PdfStreamWriter=Qt,K.PdfString=tt,K.PdfStringFormat=bt,K.PdfStringLayoutResult=Bt,K.PdfStringLayouter=vt,K.PdfTemplate=Bi,K.PdfTextElement=hn,K.PdfTextLayoutResult=dn,K.PdfTextWebLink=Bn,K.PdfTilingBrush=Di,K.PdfTransformationMatrix=ie,K.PdfTransparency=le,K.PdfTrueTypeFont=ea,K.PdfUriAction=ht,K.PdfUriAnnotation=Pn,K.PdfViewerPreferences=Et,K.PdfWriter=kt,K.PointF=q,K.ProcedureSets=se,K.Rectangle=ut,K.RectangleF=X,K.RegisteredObject=Kt,K.RowLayoutResult=Os,K.RtlCharacters=mi,K.RtlRenderer=bi,K.SaveAnnotationEventHandler=E,K.SaveCmapEventHandler=$,K.SaveDescendantFontEventHandler=I,K.SaveFontDictionaryEventHandler=F,K.SaveFontProgramEventHandler=Q,K.SaveSectionCollectionEventHandler=A,K.SaveSectionEventHandler=G,K.SaveTemplateEventHandler=z,K.SizeF=Y,K.StandardWidthTable=ai,K.StringTokenizer=Pt,K.TextLayouter=ln,K.TextPageLayoutResult=pn,K.WidthTable=ni,K.defaultToString=M,Object.defineProperty(K,"__esModule",{value:!0})});
|
|
11
11
|
//# sourceMappingURL=ej2-pdf-export.umd.min.js.map
|