commit 69ad5c7e2ec98b07b3948ca6e228c009ec737074 Author: Mevaser of Yehudah Date: Thu Dec 14 11:32:04 2023 -0600 Drupal 8 stable release diff --git a/css/font-awesome.min.css b/css/font-awesome.min.css new file mode 100644 index 0000000..5578ea5 --- /dev/null +++ b/css/font-awesome.min.css @@ -0,0 +1,4 @@ +/*! + * Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome + * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) + */@font-face{font-family:'FontAwesome';src:url('../fonts/fontawesome-webfont.eot?v=4.7.0');src:url('../fonts/fontawesome-webfont.eot?#iefix&v=4.7.0') format('embedded-opentype'),url('../fonts/fontawesome-webfont.woff2?v=4.7.0') format('woff2'),url('../fonts/fontawesome-webfont.woff?v=4.7.0') format('woff'),url('../fonts/fontawesome-webfont.ttf?v=4.7.0') format('truetype'),url('../fonts/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular') format('svg');font-weight:normal;font-style:normal}.fa{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.33333333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571429em;text-align:center}.fa-ul{padding-left:0;margin-left:2.14285714em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.14285714em;width:2.14285714em;top:.14285714em;text-align:center}.fa-li.fa-lg{left:-1.85714286em}.fa-border{padding:.2em .25em .15em;border:solid .08em #eee;border-radius:.1em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left{margin-right:.3em}.fa.fa-pull-right{margin-left:.3em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left{margin-right:.3em}.fa.pull-right{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}.fa-pulse{-webkit-animation:fa-spin 1s infinite steps(8);animation:fa-spin 1s infinite steps(8)}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";-webkit-transform:scale(-1, 1);-ms-transform:scale(-1, 1);transform:scale(-1, 1)}.fa-flip-vertical{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";-webkit-transform:scale(1, -1);-ms-transform:scale(1, -1);transform:scale(1, -1)}:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-flip-horizontal,:root .fa-flip-vertical{filter:none}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:"\f000"}.fa-music:before{content:"\f001"}.fa-search:before{content:"\f002"}.fa-envelope-o:before{content:"\f003"}.fa-heart:before{content:"\f004"}.fa-star:before{content:"\f005"}.fa-star-o:before{content:"\f006"}.fa-user:before{content:"\f007"}.fa-film:before{content:"\f008"}.fa-th-large:before{content:"\f009"}.fa-th:before{content:"\f00a"}.fa-th-list:before{content:"\f00b"}.fa-check:before{content:"\f00c"}.fa-remove:before,.fa-close:before,.fa-times:before{content:"\f00d"}.fa-search-plus:before{content:"\f00e"}.fa-search-minus:before{content:"\f010"}.fa-power-off:before{content:"\f011"}.fa-signal:before{content:"\f012"}.fa-gear:before,.fa-cog:before{content:"\f013"}.fa-trash-o:before{content:"\f014"}.fa-home:before{content:"\f015"}.fa-file-o:before{content:"\f016"}.fa-clock-o:before{content:"\f017"}.fa-road:before{content:"\f018"}.fa-download:before{content:"\f019"}.fa-arrow-circle-o-down:before{content:"\f01a"}.fa-arrow-circle-o-up:before{content:"\f01b"}.fa-inbox:before{content:"\f01c"}.fa-play-circle-o:before{content:"\f01d"}.fa-rotate-right:before,.fa-repeat:before{content:"\f01e"}.fa-refresh:before{content:"\f021"}.fa-list-alt:before{content:"\f022"}.fa-lock:before{content:"\f023"}.fa-flag:before{content:"\f024"}.fa-headphones:before{content:"\f025"}.fa-volume-off:before{content:"\f026"}.fa-volume-down:before{content:"\f027"}.fa-volume-up:before{content:"\f028"}.fa-qrcode:before{content:"\f029"}.fa-barcode:before{content:"\f02a"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-book:before{content:"\f02d"}.fa-bookmark:before{content:"\f02e"}.fa-print:before{content:"\f02f"}.fa-camera:before{content:"\f030"}.fa-font:before{content:"\f031"}.fa-bold:before{content:"\f032"}.fa-italic:before{content:"\f033"}.fa-text-height:before{content:"\f034"}.fa-text-width:before{content:"\f035"}.fa-align-left:before{content:"\f036"}.fa-align-center:before{content:"\f037"}.fa-align-right:before{content:"\f038"}.fa-align-justify:before{content:"\f039"}.fa-list:before{content:"\f03a"}.fa-dedent:before,.fa-outdent:before{content:"\f03b"}.fa-indent:before{content:"\f03c"}.fa-video-camera:before{content:"\f03d"}.fa-photo:before,.fa-image:before,.fa-picture-o:before{content:"\f03e"}.fa-pencil:before{content:"\f040"}.fa-map-marker:before{content:"\f041"}.fa-adjust:before{content:"\f042"}.fa-tint:before{content:"\f043"}.fa-edit:before,.fa-pencil-square-o:before{content:"\f044"}.fa-share-square-o:before{content:"\f045"}.fa-check-square-o:before{content:"\f046"}.fa-arrows:before{content:"\f047"}.fa-step-backward:before{content:"\f048"}.fa-fast-backward:before{content:"\f049"}.fa-backward:before{content:"\f04a"}.fa-play:before{content:"\f04b"}.fa-pause:before{content:"\f04c"}.fa-stop:before{content:"\f04d"}.fa-forward:before{content:"\f04e"}.fa-fast-forward:before{content:"\f050"}.fa-step-forward:before{content:"\f051"}.fa-eject:before{content:"\f052"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-plus-circle:before{content:"\f055"}.fa-minus-circle:before{content:"\f056"}.fa-times-circle:before{content:"\f057"}.fa-check-circle:before{content:"\f058"}.fa-question-circle:before{content:"\f059"}.fa-info-circle:before{content:"\f05a"}.fa-crosshairs:before{content:"\f05b"}.fa-times-circle-o:before{content:"\f05c"}.fa-check-circle-o:before{content:"\f05d"}.fa-ban:before{content:"\f05e"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrow-down:before{content:"\f063"}.fa-mail-forward:before,.fa-share:before{content:"\f064"}.fa-expand:before{content:"\f065"}.fa-compress:before{content:"\f066"}.fa-plus:before{content:"\f067"}.fa-minus:before{content:"\f068"}.fa-asterisk:before{content:"\f069"}.fa-exclamation-circle:before{content:"\f06a"}.fa-gift:before{content:"\f06b"}.fa-leaf:before{content:"\f06c"}.fa-fire:before{content:"\f06d"}.fa-eye:before{content:"\f06e"}.fa-eye-slash:before{content:"\f070"}.fa-warning:before,.fa-exclamation-triangle:before{content:"\f071"}.fa-plane:before{content:"\f072"}.fa-calendar:before{content:"\f073"}.fa-random:before{content:"\f074"}.fa-comment:before{content:"\f075"}.fa-magnet:before{content:"\f076"}.fa-chevron-up:before{content:"\f077"}.fa-chevron-down:before{content:"\f078"}.fa-retweet:before{content:"\f079"}.fa-shopping-cart:before{content:"\f07a"}.fa-folder:before{content:"\f07b"}.fa-folder-open:before{content:"\f07c"}.fa-arrows-v:before{content:"\f07d"}.fa-arrows-h:before{content:"\f07e"}.fa-bar-chart-o:before,.fa-bar-chart:before{content:"\f080"}.fa-twitter-square:before{content:"\f081"}.fa-facebook-square:before{content:"\f082"}.fa-camera-retro:before{content:"\f083"}.fa-key:before{content:"\f084"}.fa-gears:before,.fa-cogs:before{content:"\f085"}.fa-comments:before{content:"\f086"}.fa-thumbs-o-up:before{content:"\f087"}.fa-thumbs-o-down:before{content:"\f088"}.fa-star-half:before{content:"\f089"}.fa-heart-o:before{content:"\f08a"}.fa-sign-out:before{content:"\f08b"}.fa-linkedin-square:before{content:"\f08c"}.fa-thumb-tack:before{content:"\f08d"}.fa-external-link:before{content:"\f08e"}.fa-sign-in:before{content:"\f090"}.fa-trophy:before{content:"\f091"}.fa-github-square:before{content:"\f092"}.fa-upload:before{content:"\f093"}.fa-lemon-o:before{content:"\f094"}.fa-phone:before{content:"\f095"}.fa-square-o:before{content:"\f096"}.fa-bookmark-o:before{content:"\f097"}.fa-phone-square:before{content:"\f098"}.fa-twitter:before{content:"\f099"}.fa-facebook-f:before,.fa-facebook:before{content:"\f09a"}.fa-github:before{content:"\f09b"}.fa-unlock:before{content:"\f09c"}.fa-credit-card:before{content:"\f09d"}.fa-feed:before,.fa-rss:before{content:"\f09e"}.fa-hdd-o:before{content:"\f0a0"}.fa-bullhorn:before{content:"\f0a1"}.fa-bell:before{content:"\f0f3"}.fa-certificate:before{content:"\f0a3"}.fa-hand-o-right:before{content:"\f0a4"}.fa-hand-o-left:before{content:"\f0a5"}.fa-hand-o-up:before{content:"\f0a6"}.fa-hand-o-down:before{content:"\f0a7"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-globe:before{content:"\f0ac"}.fa-wrench:before{content:"\f0ad"}.fa-tasks:before{content:"\f0ae"}.fa-filter:before{content:"\f0b0"}.fa-briefcase:before{content:"\f0b1"}.fa-arrows-alt:before{content:"\f0b2"}.fa-group:before,.fa-users:before{content:"\f0c0"}.fa-chain:before,.fa-link:before{content:"\f0c1"}.fa-cloud:before{content:"\f0c2"}.fa-flask:before{content:"\f0c3"}.fa-cut:before,.fa-scissors:before{content:"\f0c4"}.fa-copy:before,.fa-files-o:before{content:"\f0c5"}.fa-paperclip:before{content:"\f0c6"}.fa-save:before,.fa-floppy-o:before{content:"\f0c7"}.fa-square:before{content:"\f0c8"}.fa-navicon:before,.fa-reorder:before,.fa-bars:before{content:"\f0c9"}.fa-list-ul:before{content:"\f0ca"}.fa-list-ol:before{content:"\f0cb"}.fa-strikethrough:before{content:"\f0cc"}.fa-underline:before{content:"\f0cd"}.fa-table:before{content:"\f0ce"}.fa-magic:before{content:"\f0d0"}.fa-truck:before{content:"\f0d1"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-square:before{content:"\f0d3"}.fa-google-plus-square:before{content:"\f0d4"}.fa-google-plus:before{content:"\f0d5"}.fa-money:before{content:"\f0d6"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-up:before{content:"\f0d8"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-columns:before{content:"\f0db"}.fa-unsorted:before,.fa-sort:before{content:"\f0dc"}.fa-sort-down:before,.fa-sort-desc:before{content:"\f0dd"}.fa-sort-up:before,.fa-sort-asc:before{content:"\f0de"}.fa-envelope:before{content:"\f0e0"}.fa-linkedin:before{content:"\f0e1"}.fa-rotate-left:before,.fa-undo:before{content:"\f0e2"}.fa-legal:before,.fa-gavel:before{content:"\f0e3"}.fa-dashboard:before,.fa-tachometer:before{content:"\f0e4"}.fa-comment-o:before{content:"\f0e5"}.fa-comments-o:before{content:"\f0e6"}.fa-flash:before,.fa-bolt:before{content:"\f0e7"}.fa-sitemap:before{content:"\f0e8"}.fa-umbrella:before{content:"\f0e9"}.fa-paste:before,.fa-clipboard:before{content:"\f0ea"}.fa-lightbulb-o:before{content:"\f0eb"}.fa-exchange:before{content:"\f0ec"}.fa-cloud-download:before{content:"\f0ed"}.fa-cloud-upload:before{content:"\f0ee"}.fa-user-md:before{content:"\f0f0"}.fa-stethoscope:before{content:"\f0f1"}.fa-suitcase:before{content:"\f0f2"}.fa-bell-o:before{content:"\f0a2"}.fa-coffee:before{content:"\f0f4"}.fa-cutlery:before{content:"\f0f5"}.fa-file-text-o:before{content:"\f0f6"}.fa-building-o:before{content:"\f0f7"}.fa-hospital-o:before{content:"\f0f8"}.fa-ambulance:before{content:"\f0f9"}.fa-medkit:before{content:"\f0fa"}.fa-fighter-jet:before{content:"\f0fb"}.fa-beer:before{content:"\f0fc"}.fa-h-square:before{content:"\f0fd"}.fa-plus-square:before{content:"\f0fe"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angle-down:before{content:"\f107"}.fa-desktop:before{content:"\f108"}.fa-laptop:before{content:"\f109"}.fa-tablet:before{content:"\f10a"}.fa-mobile-phone:before,.fa-mobile:before{content:"\f10b"}.fa-circle-o:before{content:"\f10c"}.fa-quote-left:before{content:"\f10d"}.fa-quote-right:before{content:"\f10e"}.fa-spinner:before{content:"\f110"}.fa-circle:before{content:"\f111"}.fa-mail-reply:before,.fa-reply:before{content:"\f112"}.fa-github-alt:before{content:"\f113"}.fa-folder-o:before{content:"\f114"}.fa-folder-open-o:before{content:"\f115"}.fa-smile-o:before{content:"\f118"}.fa-frown-o:before{content:"\f119"}.fa-meh-o:before{content:"\f11a"}.fa-gamepad:before{content:"\f11b"}.fa-keyboard-o:before{content:"\f11c"}.fa-flag-o:before{content:"\f11d"}.fa-flag-checkered:before{content:"\f11e"}.fa-terminal:before{content:"\f120"}.fa-code:before{content:"\f121"}.fa-mail-reply-all:before,.fa-reply-all:before{content:"\f122"}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:"\f123"}.fa-location-arrow:before{content:"\f124"}.fa-crop:before{content:"\f125"}.fa-code-fork:before{content:"\f126"}.fa-unlink:before,.fa-chain-broken:before{content:"\f127"}.fa-question:before{content:"\f128"}.fa-info:before{content:"\f129"}.fa-exclamation:before{content:"\f12a"}.fa-superscript:before{content:"\f12b"}.fa-subscript:before{content:"\f12c"}.fa-eraser:before{content:"\f12d"}.fa-puzzle-piece:before{content:"\f12e"}.fa-microphone:before{content:"\f130"}.fa-microphone-slash:before{content:"\f131"}.fa-shield:before{content:"\f132"}.fa-calendar-o:before{content:"\f133"}.fa-fire-extinguisher:before{content:"\f134"}.fa-rocket:before{content:"\f135"}.fa-maxcdn:before{content:"\f136"}.fa-chevron-circle-left:before{content:"\f137"}.fa-chevron-circle-right:before{content:"\f138"}.fa-chevron-circle-up:before{content:"\f139"}.fa-chevron-circle-down:before{content:"\f13a"}.fa-html5:before{content:"\f13b"}.fa-css3:before{content:"\f13c"}.fa-anchor:before{content:"\f13d"}.fa-unlock-alt:before{content:"\f13e"}.fa-bullseye:before{content:"\f140"}.fa-ellipsis-h:before{content:"\f141"}.fa-ellipsis-v:before{content:"\f142"}.fa-rss-square:before{content:"\f143"}.fa-play-circle:before{content:"\f144"}.fa-ticket:before{content:"\f145"}.fa-minus-square:before{content:"\f146"}.fa-minus-square-o:before{content:"\f147"}.fa-level-up:before{content:"\f148"}.fa-level-down:before{content:"\f149"}.fa-check-square:before{content:"\f14a"}.fa-pencil-square:before{content:"\f14b"}.fa-external-link-square:before{content:"\f14c"}.fa-share-square:before{content:"\f14d"}.fa-compass:before{content:"\f14e"}.fa-toggle-down:before,.fa-caret-square-o-down:before{content:"\f150"}.fa-toggle-up:before,.fa-caret-square-o-up:before{content:"\f151"}.fa-toggle-right:before,.fa-caret-square-o-right:before{content:"\f152"}.fa-euro:before,.fa-eur:before{content:"\f153"}.fa-gbp:before{content:"\f154"}.fa-dollar:before,.fa-usd:before{content:"\f155"}.fa-rupee:before,.fa-inr:before{content:"\f156"}.fa-cny:before,.fa-rmb:before,.fa-yen:before,.fa-jpy:before{content:"\f157"}.fa-ruble:before,.fa-rouble:before,.fa-rub:before{content:"\f158"}.fa-won:before,.fa-krw:before{content:"\f159"}.fa-bitcoin:before,.fa-btc:before{content:"\f15a"}.fa-file:before{content:"\f15b"}.fa-file-text:before{content:"\f15c"}.fa-sort-alpha-asc:before{content:"\f15d"}.fa-sort-alpha-desc:before{content:"\f15e"}.fa-sort-amount-asc:before{content:"\f160"}.fa-sort-amount-desc:before{content:"\f161"}.fa-sort-numeric-asc:before{content:"\f162"}.fa-sort-numeric-desc:before{content:"\f163"}.fa-thumbs-up:before{content:"\f164"}.fa-thumbs-down:before{content:"\f165"}.fa-youtube-square:before{content:"\f166"}.fa-youtube:before{content:"\f167"}.fa-xing:before{content:"\f168"}.fa-xing-square:before{content:"\f169"}.fa-youtube-play:before{content:"\f16a"}.fa-dropbox:before{content:"\f16b"}.fa-stack-overflow:before{content:"\f16c"}.fa-instagram:before{content:"\f16d"}.fa-flickr:before{content:"\f16e"}.fa-adn:before{content:"\f170"}.fa-bitbucket:before{content:"\f171"}.fa-bitbucket-square:before{content:"\f172"}.fa-tumblr:before{content:"\f173"}.fa-tumblr-square:before{content:"\f174"}.fa-long-arrow-down:before{content:"\f175"}.fa-long-arrow-up:before{content:"\f176"}.fa-long-arrow-left:before{content:"\f177"}.fa-long-arrow-right:before{content:"\f178"}.fa-apple:before{content:"\f179"}.fa-windows:before{content:"\f17a"}.fa-android:before{content:"\f17b"}.fa-linux:before{content:"\f17c"}.fa-dribbble:before{content:"\f17d"}.fa-skype:before{content:"\f17e"}.fa-foursquare:before{content:"\f180"}.fa-trello:before{content:"\f181"}.fa-female:before{content:"\f182"}.fa-male:before{content:"\f183"}.fa-gittip:before,.fa-gratipay:before{content:"\f184"}.fa-sun-o:before{content:"\f185"}.fa-moon-o:before{content:"\f186"}.fa-archive:before{content:"\f187"}.fa-bug:before{content:"\f188"}.fa-vk:before{content:"\f189"}.fa-weibo:before{content:"\f18a"}.fa-renren:before{content:"\f18b"}.fa-pagelines:before{content:"\f18c"}.fa-stack-exchange:before{content:"\f18d"}.fa-arrow-circle-o-right:before{content:"\f18e"}.fa-arrow-circle-o-left:before{content:"\f190"}.fa-toggle-left:before,.fa-caret-square-o-left:before{content:"\f191"}.fa-dot-circle-o:before{content:"\f192"}.fa-wheelchair:before{content:"\f193"}.fa-vimeo-square:before{content:"\f194"}.fa-turkish-lira:before,.fa-try:before{content:"\f195"}.fa-plus-square-o:before{content:"\f196"}.fa-space-shuttle:before{content:"\f197"}.fa-slack:before{content:"\f198"}.fa-envelope-square:before{content:"\f199"}.fa-wordpress:before{content:"\f19a"}.fa-openid:before{content:"\f19b"}.fa-institution:before,.fa-bank:before,.fa-university:before{content:"\f19c"}.fa-mortar-board:before,.fa-graduation-cap:before{content:"\f19d"}.fa-yahoo:before{content:"\f19e"}.fa-google:before{content:"\f1a0"}.fa-reddit:before{content:"\f1a1"}.fa-reddit-square:before{content:"\f1a2"}.fa-stumbleupon-circle:before{content:"\f1a3"}.fa-stumbleupon:before{content:"\f1a4"}.fa-delicious:before{content:"\f1a5"}.fa-digg:before{content:"\f1a6"}.fa-pied-piper-pp:before{content:"\f1a7"}.fa-pied-piper-alt:before{content:"\f1a8"}.fa-drupal:before{content:"\f1a9"}.fa-joomla:before{content:"\f1aa"}.fa-language:before{content:"\f1ab"}.fa-fax:before{content:"\f1ac"}.fa-building:before{content:"\f1ad"}.fa-child:before{content:"\f1ae"}.fa-paw:before{content:"\f1b0"}.fa-spoon:before{content:"\f1b1"}.fa-cube:before{content:"\f1b2"}.fa-cubes:before{content:"\f1b3"}.fa-behance:before{content:"\f1b4"}.fa-behance-square:before{content:"\f1b5"}.fa-steam:before{content:"\f1b6"}.fa-steam-square:before{content:"\f1b7"}.fa-recycle:before{content:"\f1b8"}.fa-automobile:before,.fa-car:before{content:"\f1b9"}.fa-cab:before,.fa-taxi:before{content:"\f1ba"}.fa-tree:before{content:"\f1bb"}.fa-spotify:before{content:"\f1bc"}.fa-deviantart:before{content:"\f1bd"}.fa-soundcloud:before{content:"\f1be"}.fa-database:before{content:"\f1c0"}.fa-file-pdf-o:before{content:"\f1c1"}.fa-file-word-o:before{content:"\f1c2"}.fa-file-excel-o:before{content:"\f1c3"}.fa-file-powerpoint-o:before{content:"\f1c4"}.fa-file-photo-o:before,.fa-file-picture-o:before,.fa-file-image-o:before{content:"\f1c5"}.fa-file-zip-o:before,.fa-file-archive-o:before{content:"\f1c6"}.fa-file-sound-o:before,.fa-file-audio-o:before{content:"\f1c7"}.fa-file-movie-o:before,.fa-file-video-o:before{content:"\f1c8"}.fa-file-code-o:before{content:"\f1c9"}.fa-vine:before{content:"\f1ca"}.fa-codepen:before{content:"\f1cb"}.fa-jsfiddle:before{content:"\f1cc"}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-saver:before,.fa-support:before,.fa-life-ring:before{content:"\f1cd"}.fa-circle-o-notch:before{content:"\f1ce"}.fa-ra:before,.fa-resistance:before,.fa-rebel:before{content:"\f1d0"}.fa-ge:before,.fa-empire:before{content:"\f1d1"}.fa-git-square:before{content:"\f1d2"}.fa-git:before{content:"\f1d3"}.fa-y-combinator-square:before,.fa-yc-square:before,.fa-hacker-news:before{content:"\f1d4"}.fa-tencent-weibo:before{content:"\f1d5"}.fa-qq:before{content:"\f1d6"}.fa-wechat:before,.fa-weixin:before{content:"\f1d7"}.fa-send:before,.fa-paper-plane:before{content:"\f1d8"}.fa-send-o:before,.fa-paper-plane-o:before{content:"\f1d9"}.fa-history:before{content:"\f1da"}.fa-circle-thin:before{content:"\f1db"}.fa-header:before{content:"\f1dc"}.fa-paragraph:before{content:"\f1dd"}.fa-sliders:before{content:"\f1de"}.fa-share-alt:before{content:"\f1e0"}.fa-share-alt-square:before{content:"\f1e1"}.fa-bomb:before{content:"\f1e2"}.fa-soccer-ball-o:before,.fa-futbol-o:before{content:"\f1e3"}.fa-tty:before{content:"\f1e4"}.fa-binoculars:before{content:"\f1e5"}.fa-plug:before{content:"\f1e6"}.fa-slideshare:before{content:"\f1e7"}.fa-twitch:before{content:"\f1e8"}.fa-yelp:before{content:"\f1e9"}.fa-newspaper-o:before{content:"\f1ea"}.fa-wifi:before{content:"\f1eb"}.fa-calculator:before{content:"\f1ec"}.fa-paypal:before{content:"\f1ed"}.fa-google-wallet:before{content:"\f1ee"}.fa-cc-visa:before{content:"\f1f0"}.fa-cc-mastercard:before{content:"\f1f1"}.fa-cc-discover:before{content:"\f1f2"}.fa-cc-amex:before{content:"\f1f3"}.fa-cc-paypal:before{content:"\f1f4"}.fa-cc-stripe:before{content:"\f1f5"}.fa-bell-slash:before{content:"\f1f6"}.fa-bell-slash-o:before{content:"\f1f7"}.fa-trash:before{content:"\f1f8"}.fa-copyright:before{content:"\f1f9"}.fa-at:before{content:"\f1fa"}.fa-eyedropper:before{content:"\f1fb"}.fa-paint-brush:before{content:"\f1fc"}.fa-birthday-cake:before{content:"\f1fd"}.fa-area-chart:before{content:"\f1fe"}.fa-pie-chart:before{content:"\f200"}.fa-line-chart:before{content:"\f201"}.fa-lastfm:before{content:"\f202"}.fa-lastfm-square:before{content:"\f203"}.fa-toggle-off:before{content:"\f204"}.fa-toggle-on:before{content:"\f205"}.fa-bicycle:before{content:"\f206"}.fa-bus:before{content:"\f207"}.fa-ioxhost:before{content:"\f208"}.fa-angellist:before{content:"\f209"}.fa-cc:before{content:"\f20a"}.fa-shekel:before,.fa-sheqel:before,.fa-ils:before{content:"\f20b"}.fa-meanpath:before{content:"\f20c"}.fa-buysellads:before{content:"\f20d"}.fa-connectdevelop:before{content:"\f20e"}.fa-dashcube:before{content:"\f210"}.fa-forumbee:before{content:"\f211"}.fa-leanpub:before{content:"\f212"}.fa-sellsy:before{content:"\f213"}.fa-shirtsinbulk:before{content:"\f214"}.fa-simplybuilt:before{content:"\f215"}.fa-skyatlas:before{content:"\f216"}.fa-cart-plus:before{content:"\f217"}.fa-cart-arrow-down:before{content:"\f218"}.fa-diamond:before{content:"\f219"}.fa-ship:before{content:"\f21a"}.fa-user-secret:before{content:"\f21b"}.fa-motorcycle:before{content:"\f21c"}.fa-street-view:before{content:"\f21d"}.fa-heartbeat:before{content:"\f21e"}.fa-venus:before{content:"\f221"}.fa-mars:before{content:"\f222"}.fa-mercury:before{content:"\f223"}.fa-intersex:before,.fa-transgender:before{content:"\f224"}.fa-transgender-alt:before{content:"\f225"}.fa-venus-double:before{content:"\f226"}.fa-mars-double:before{content:"\f227"}.fa-venus-mars:before{content:"\f228"}.fa-mars-stroke:before{content:"\f229"}.fa-mars-stroke-v:before{content:"\f22a"}.fa-mars-stroke-h:before{content:"\f22b"}.fa-neuter:before{content:"\f22c"}.fa-genderless:before{content:"\f22d"}.fa-facebook-official:before{content:"\f230"}.fa-pinterest-p:before{content:"\f231"}.fa-whatsapp:before{content:"\f232"}.fa-server:before{content:"\f233"}.fa-user-plus:before{content:"\f234"}.fa-user-times:before{content:"\f235"}.fa-hotel:before,.fa-bed:before{content:"\f236"}.fa-viacoin:before{content:"\f237"}.fa-train:before{content:"\f238"}.fa-subway:before{content:"\f239"}.fa-medium:before{content:"\f23a"}.fa-yc:before,.fa-y-combinator:before{content:"\f23b"}.fa-optin-monster:before{content:"\f23c"}.fa-opencart:before{content:"\f23d"}.fa-expeditedssl:before{content:"\f23e"}.fa-battery-4:before,.fa-battery:before,.fa-battery-full:before{content:"\f240"}.fa-battery-3:before,.fa-battery-three-quarters:before{content:"\f241"}.fa-battery-2:before,.fa-battery-half:before{content:"\f242"}.fa-battery-1:before,.fa-battery-quarter:before{content:"\f243"}.fa-battery-0:before,.fa-battery-empty:before{content:"\f244"}.fa-mouse-pointer:before{content:"\f245"}.fa-i-cursor:before{content:"\f246"}.fa-object-group:before{content:"\f247"}.fa-object-ungroup:before{content:"\f248"}.fa-sticky-note:before{content:"\f249"}.fa-sticky-note-o:before{content:"\f24a"}.fa-cc-jcb:before{content:"\f24b"}.fa-cc-diners-club:before{content:"\f24c"}.fa-clone:before{content:"\f24d"}.fa-balance-scale:before{content:"\f24e"}.fa-hourglass-o:before{content:"\f250"}.fa-hourglass-1:before,.fa-hourglass-start:before{content:"\f251"}.fa-hourglass-2:before,.fa-hourglass-half:before{content:"\f252"}.fa-hourglass-3:before,.fa-hourglass-end:before{content:"\f253"}.fa-hourglass:before{content:"\f254"}.fa-hand-grab-o:before,.fa-hand-rock-o:before{content:"\f255"}.fa-hand-stop-o:before,.fa-hand-paper-o:before{content:"\f256"}.fa-hand-scissors-o:before{content:"\f257"}.fa-hand-lizard-o:before{content:"\f258"}.fa-hand-spock-o:before{content:"\f259"}.fa-hand-pointer-o:before{content:"\f25a"}.fa-hand-peace-o:before{content:"\f25b"}.fa-trademark:before{content:"\f25c"}.fa-registered:before{content:"\f25d"}.fa-creative-commons:before{content:"\f25e"}.fa-gg:before{content:"\f260"}.fa-gg-circle:before{content:"\f261"}.fa-tripadvisor:before{content:"\f262"}.fa-odnoklassniki:before{content:"\f263"}.fa-odnoklassniki-square:before{content:"\f264"}.fa-get-pocket:before{content:"\f265"}.fa-wikipedia-w:before{content:"\f266"}.fa-safari:before{content:"\f267"}.fa-chrome:before{content:"\f268"}.fa-firefox:before{content:"\f269"}.fa-opera:before{content:"\f26a"}.fa-internet-explorer:before{content:"\f26b"}.fa-tv:before,.fa-television:before{content:"\f26c"}.fa-contao:before{content:"\f26d"}.fa-500px:before{content:"\f26e"}.fa-amazon:before{content:"\f270"}.fa-calendar-plus-o:before{content:"\f271"}.fa-calendar-minus-o:before{content:"\f272"}.fa-calendar-times-o:before{content:"\f273"}.fa-calendar-check-o:before{content:"\f274"}.fa-industry:before{content:"\f275"}.fa-map-pin:before{content:"\f276"}.fa-map-signs:before{content:"\f277"}.fa-map-o:before{content:"\f278"}.fa-map:before{content:"\f279"}.fa-commenting:before{content:"\f27a"}.fa-commenting-o:before{content:"\f27b"}.fa-houzz:before{content:"\f27c"}.fa-vimeo:before{content:"\f27d"}.fa-black-tie:before{content:"\f27e"}.fa-fonticons:before{content:"\f280"}.fa-reddit-alien:before{content:"\f281"}.fa-edge:before{content:"\f282"}.fa-credit-card-alt:before{content:"\f283"}.fa-codiepie:before{content:"\f284"}.fa-modx:before{content:"\f285"}.fa-fort-awesome:before{content:"\f286"}.fa-usb:before{content:"\f287"}.fa-product-hunt:before{content:"\f288"}.fa-mixcloud:before{content:"\f289"}.fa-scribd:before{content:"\f28a"}.fa-pause-circle:before{content:"\f28b"}.fa-pause-circle-o:before{content:"\f28c"}.fa-stop-circle:before{content:"\f28d"}.fa-stop-circle-o:before{content:"\f28e"}.fa-shopping-bag:before{content:"\f290"}.fa-shopping-basket:before{content:"\f291"}.fa-hashtag:before{content:"\f292"}.fa-bluetooth:before{content:"\f293"}.fa-bluetooth-b:before{content:"\f294"}.fa-percent:before{content:"\f295"}.fa-gitlab:before{content:"\f296"}.fa-wpbeginner:before{content:"\f297"}.fa-wpforms:before{content:"\f298"}.fa-envira:before{content:"\f299"}.fa-universal-access:before{content:"\f29a"}.fa-wheelchair-alt:before{content:"\f29b"}.fa-question-circle-o:before{content:"\f29c"}.fa-blind:before{content:"\f29d"}.fa-audio-description:before{content:"\f29e"}.fa-volume-control-phone:before{content:"\f2a0"}.fa-braille:before{content:"\f2a1"}.fa-assistive-listening-systems:before{content:"\f2a2"}.fa-asl-interpreting:before,.fa-american-sign-language-interpreting:before{content:"\f2a3"}.fa-deafness:before,.fa-hard-of-hearing:before,.fa-deaf:before{content:"\f2a4"}.fa-glide:before{content:"\f2a5"}.fa-glide-g:before{content:"\f2a6"}.fa-signing:before,.fa-sign-language:before{content:"\f2a7"}.fa-low-vision:before{content:"\f2a8"}.fa-viadeo:before{content:"\f2a9"}.fa-viadeo-square:before{content:"\f2aa"}.fa-snapchat:before{content:"\f2ab"}.fa-snapchat-ghost:before{content:"\f2ac"}.fa-snapchat-square:before{content:"\f2ad"}.fa-pied-piper:before{content:"\f2ae"}.fa-first-order:before{content:"\f2b0"}.fa-yoast:before{content:"\f2b1"}.fa-themeisle:before{content:"\f2b2"}.fa-google-plus-circle:before,.fa-google-plus-official:before{content:"\f2b3"}.fa-fa:before,.fa-font-awesome:before{content:"\f2b4"}.fa-handshake-o:before{content:"\f2b5"}.fa-envelope-open:before{content:"\f2b6"}.fa-envelope-open-o:before{content:"\f2b7"}.fa-linode:before{content:"\f2b8"}.fa-address-book:before{content:"\f2b9"}.fa-address-book-o:before{content:"\f2ba"}.fa-vcard:before,.fa-address-card:before{content:"\f2bb"}.fa-vcard-o:before,.fa-address-card-o:before{content:"\f2bc"}.fa-user-circle:before{content:"\f2bd"}.fa-user-circle-o:before{content:"\f2be"}.fa-user-o:before{content:"\f2c0"}.fa-id-badge:before{content:"\f2c1"}.fa-drivers-license:before,.fa-id-card:before{content:"\f2c2"}.fa-drivers-license-o:before,.fa-id-card-o:before{content:"\f2c3"}.fa-quora:before{content:"\f2c4"}.fa-free-code-camp:before{content:"\f2c5"}.fa-telegram:before{content:"\f2c6"}.fa-thermometer-4:before,.fa-thermometer:before,.fa-thermometer-full:before{content:"\f2c7"}.fa-thermometer-3:before,.fa-thermometer-three-quarters:before{content:"\f2c8"}.fa-thermometer-2:before,.fa-thermometer-half:before{content:"\f2c9"}.fa-thermometer-1:before,.fa-thermometer-quarter:before{content:"\f2ca"}.fa-thermometer-0:before,.fa-thermometer-empty:before{content:"\f2cb"}.fa-shower:before{content:"\f2cc"}.fa-bathtub:before,.fa-s15:before,.fa-bath:before{content:"\f2cd"}.fa-podcast:before{content:"\f2ce"}.fa-window-maximize:before{content:"\f2d0"}.fa-window-minimize:before{content:"\f2d1"}.fa-window-restore:before{content:"\f2d2"}.fa-times-rectangle:before,.fa-window-close:before{content:"\f2d3"}.fa-times-rectangle-o:before,.fa-window-close-o:before{content:"\f2d4"}.fa-bandcamp:before{content:"\f2d5"}.fa-grav:before{content:"\f2d6"}.fa-etsy:before{content:"\f2d7"}.fa-imdb:before{content:"\f2d8"}.fa-ravelry:before{content:"\f2d9"}.fa-eercast:before{content:"\f2da"}.fa-microchip:before{content:"\f2db"}.fa-snowflake-o:before{content:"\f2dc"}.fa-superpowers:before{content:"\f2dd"}.fa-wpexplorer:before{content:"\f2de"}.fa-meetup:before{content:"\f2e0"}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto} diff --git a/css/short-black-book-view.css b/css/short-black-book-view.css new file mode 100644 index 0000000..ccf9ee4 --- /dev/null +++ b/css/short-black-book-view.css @@ -0,0 +1,566 @@ +.flip-book { + position: relative; + height: 100%; +} + +.flip-book .view { + text-align: center; + height: 100%; +} + +.flip-book .view .fnav { +} + +.flip-book .view .prev, .flip-book .view .next { + position: absolute; + top: 50%; + transform: translate(0, -50%); + z-index: 1; +} + +.flip-book .view .prev { + left: 20px; +} + +.flip-book .view .next { + right: 20px; +} + + +.flip-book .view .fnav a { + font-size: 72pt; + color: #666; +} + +.flip-book .view .fnav a:hover { + cursor: pointer; + text-shadow: 0 0 7px #000; +} + +.flip-book .view .fnav a:active { + font-size: 70pt; +} + +.flip-book .view .fnav .hidden { + display: none; +} + +.flip-book .view .fnav .active { + color: #555; +} + +.flip-book .view .fnav .disabled { + color: #aaa; +} + +.flip-book .view .fnav .disabled:hover { + cursor: not-allowed; + text-shadow: none; +} + +.flip-book .view .loading-progress { + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); +} + +.flip-book .view .loading-progress.hidden { + display: none; +} + +.flip-book .loading-progress .progress { + background-color: #555; + background-image: none; + width: 50px; + height: 50px; + margin: 0 auto; + border-radius: 30px; + padding: 5px; + box-shadow: 0px 0px 3px #000; + margin-bottom: 10px; +} + +.flip-book .loading-progress .progress::after { + content: ' '; + display: block; + width: 100%; + height: 100%; + background-size: contain; + background-image: url('../images/light-loader.gif'); +} + +.flip-book .loading-progress .caption { + background-color: #555; + border: 1px solid #333; + padding: 7px 10px; + font-family: "Helvetica Neue",Helvetica,Arial,sans-serif; + font-size: 10pt; + border-radius: 5px; + font-style: italic; + color: #eee; +} + +.flip-book .controls { + position: relative; +} + +.flip-book .controls .fnavbar { + margin: 0 auto; + opacity: 0.3; + transition: opacity 2s ease-in-out 3s; +} + +.flip-book .controls .fnavbar:hover { + opacity: 1; + transition: opacity 1s ease; +} + +.flip-book .controls .ctrl { + font-family: "Helvetica Neue",Helvetica,Arial,sans-serif; + position: absolute; + bottom: 10px; +} +.ctrl ul { + margin: 0; + padding: 0; +} +.ctrl .fnavbar { + text-align: center; + background-image: linear-gradient(to bottom,#3c3c3c 0,#222 100%); + background-repeat: repeat-x; + padding: 3px; + overflow: visible; + background-color: #3c3c3c; + + border-radius: 4px; +} +.ctrl .fnavbar a { + text-decoration: none; + font-size: 14px; +} +.ctrl .fnavbar .fnav { + font-size: 0; + display: flex; + text-align: left; +} +.ctrl .fnavbar .fnav li{ + font-size: 12pt; + margin: 0; + width: auto; +} +.ctrl .fnavbar .fnav .fnav-item { + display: inline-block; +} +.ctrl .fnavbar .fnav .hidden { + display: none; +} +.ctrl .fnavbar .fnav .fnav-item>a { + padding: 10px; + display: inline-block; + color: #ccc; +} +.ctrl .fnavbar .fnav>.active>a { + color: #fff; +} +.ctrl .fnavbar .fnav .fnav-item>a:hover { + color: #fff; + cursor: pointer; +} +.ctrl .fnavbar .fnav .fnav-item>a:active { + text-shadow: 0 0 2px #fff; +} +.ctrl .fnavbar .fnav>.disabled>a { + color: #888; +} +.ctrl .fnavbar .fnav>.disabled>a:hover { + color: #888; + cursor: not-allowed; +} +.ctrl .fnavbar .fnav>.active { + background: #222; +} + +.ctrl .fnavbar .fnav .dropdown, .ctrl .fnavbar .fnav .dropup { + position: relative; +} +.ctrl .fnavbar .fnav .dropdown .menu { + top: 100%; + box-shadow: 3px 0 3px #222; +} +.ctrl .fnavbar .fnav .icon-caret { + width: 26px; + display: inline-block; +} +.ctrl .fnavbar .fnav .dropdown .caret { + display: inline-block; + border-left: 5px solid transparent; + border-right: 5px solid transparent; + border-top: 5px solid #ccc; +} +.ctrl .fnavbar .fnav .dropup .menu { + bottom: 100%; + box-shadow: 3px 0 3px #222; +} +.ctrl .fnavbar .fnav .dropup .caret { + display: inline-block; + border-left: 5px solid transparent; + border-right: 5px solid transparent; + border-bottom: 5px solid #ccc; +} +.ctrl .fnavbar .menu { + position: absolute; + border: 1px solid #444; + background-color: #222; + z-index: 10; + min-width: 160px; +} +.ctrl .fnavbar .menu li { + display: block; + padding: 5px 10px; +} +.ctrl .fnavbar .menu .divider { + height: 1px; + background-color: #444; + padding: 0; + margin: 5px 0; +} +.ctrl .fnavbar .menu .active { + background-color: #444; +} +.ctrl .fnavbar .menu .active:hover { + /*background-color: #444;*/ +} +.ctrl .fnavbar .menu li:hover { + background-color: #333; + cursor: pointer; +} +.ctrl .fnavbar .menu li a { + color: #fff; +} +.ctrl .fnavbar .menu .disabled a { + color: #aaa; + cursor: not-allowed; +} + +.ctrl .fnavbar .menu .icon { + display: inline-block; + width: 14px; + height: 14px; + text-align: center; +} + +.ctrl .pages { + padding: 8px 10px; + display: flex; + font-size: 0; +} + +.ctrl .pages .number, .ctrl .pages .amount { + width: 50px; + height: 20px; + text-align: center; + display: inline-block; + font-size: 11pt; + border: 0; + color: #000; + background-color: #ccc; + font-weight: bold; + border-radius: 0; + margin: 0; + padding: 2px; +} + +.ctrl .pages .number { + border-top-left-radius: 5px; + border-bottom-left-radius: 5px; + background-color: #ddd; +} + +.ctrl .pages .amount { + border-top-right-radius: 5px; + border-bottom-right-radius: 5px; +} + +/* floating window */ + +.flip-book .float-wnd { + position: absolute; + top: 10px; + left: 10px; + border-radius: 5px 5px 0 0; + background-color: #1a1a1a; + width: 300px; + z-index: 1; + box-shadow: 3px 0 3px #222; +} + +.flip-book .float-wnd.hidden { + display: none; +} + +.flip-book .float-wnd .header { + border-radius: 4px 4px 0 0; + background-color: #3c3c3c; + background-image: linear-gradient(to bottom,#3c3c3c 0,#222 100%); + background-repeat: repeat-x; + padding: 7px 10px; + border: 1px solid #444; + border-bottom: none; + color: #fff; + font-weight: bold; + cursor: move; +} + +.flip-book .float-wnd .header .close { + top: 5px; + right: 8px; + font-size: 14px; + position: absolute; + color: #ccc; +} + +.flip-book .float-wnd .header .close:hover { + color: #fff; +} +.flip-book .float-wnd .header .close:active { + font-size: 12px; + padding-top: 1px; + padding-right: 1px; +} + +.flip-book .float-wnd .body { + border: 1px solid #444; + border-top: none; +} + +/* toc */ + +.ctrl .toc { + font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; +} + +.ctrl .toc a { + text-decoration: none; +} + +.ctrl .toc .hidden { + display: none; +} + +.ctrl .toc .toc-menu { + padding: 5px 10px; +} + +.ctrl .toc .toc-menu ul { + list-style: none; + padding: 0; +} +.ctrl .toc .toc-menu li { + display: inline-block; + padding-right: 5px; +} +.ctrl .toc .toc-menu a { + color: #ccc; + font-size: 14px; +} +.ctrl .toc .toc-menu a:hover { + color: #fff; +} +.ctrl .toc .toc-menu a:active { + text-shadow: 0 0 2px #fff; +} +.ctrl .toc .toc-menu .active a { + color: #fff; +} + + +.ctrl .toc .toc-view { + padding: 10px 0; + max-height: 80vh; + overflow-y: auto; + overflow-x: hidden; +} +.ctrl .toc .toc-view::-webkit-scrollbar { + width: 7px; + height: 7px; +} +.ctrl .toc .toc-view::-webkit-scrollbar-button { + width: 0; + height: 0; +} +.ctrl .toc .toc-view::-webkit-scrollbar-thumb { + background: #4a4a4a; + border-radius: 2px; +} +.ctrl .toc .toc-view::-webkit-scrollbar-thumb:hover { + background: #3a3a3a; +} +.ctrl .toc .toc-view::-webkit-scrollbar-thumb:active { + background: #5a5a5a; +} +.ctrl .toc .toc-view::-webkit-scrollbar-track { + background: #2a2a2a; + border-left: 2px solid #1a1a1a; + border-right: 2px solid #1a1a1a; +} + +.ctrl .bookmarks .white-space, .ctrl .bookmarks .togle, .ctrl .bookmarks .togle i { + width: 18px; + height: 18px; +} + +.ctrl .bookmarks .white-space { + display: inline-block; +} + +.ctrl .bookmarks li { + width: 10000px; +} + +.ctrl .bookmarks .item .area { + padding: 2px 0; +} + +.ctrl .bookmarks .level-0 .area { + padding-left: 5px; +} +.ctrl .bookmarks .level-1 .area { + padding-left: 10px; +} +.ctrl .bookmarks .level-2 .area { + padding-left: 15px; +} +.ctrl .bookmarks .level-3 .area { + padding-left: 20px; +} +.ctrl .bookmarks .level-4 .area { + padding-left: 25px; +} + +.ctrl .bookmarks .item .area:hover { + background-color: #444; +} + +.ctrl .bookmarks .item .area:active { + background-color: #333; +} + +.ctrl .bookmarks .item a { + color: #fff; + font-size: 14px; +} + +.ctrl .bookmarks ul { + list-style: none; + padding: 0; +} + +.ctrl .bookmarks .togle { + display: inline-block; + text-align: center; + position: relative; +} + +.ctrl .bookmarks .togle::before { + content: ' '; + position: absolute; + left: 50%; + top: 50%; + transform: translate(-50%, -50%); + border-radius: 50%; + border: 0px solid #222; + transition: border 0.2s; +} + +.ctrl .bookmarks .togle:active::before { + border: 12px solid #222; + transition: border 0.05s; +} + +.ctrl .bookmarks .togle i { + transform: rotateZ(0deg); + transition: transform 0.2s; +} + +.ctrl .bookmarks .togle.minimized i { + transform: rotateZ(90deg); + transition: transform 0.2s; +} + + +.ctrl .thumbnails .item a { + color: #fff; + font-size: 14px; +} + +.ctrl .thumbnails { + padding: 10px 0; + text-align: center; +} +.ctrl .thumbnails .thumbnail { + height: 170px; + margin-bottom: 5px; + background-size: contain; + background-repeat: no-repeat; + background-position: center; +} +.ctrl .thumbnails .loading { + position: relative; +} +.ctrl .thumbnails .loading::after { + content: ' '; + position: absolute; + width: 40px; + height: 40px; + left: 50%; + top: 50%; + transform: translate(-50%, -50%); + background-size: contain; + background-image: url('../images/light-loader.gif'); +} +.ctrl .thumbnails .item { + display: inline-block; + width: 128px; + padding: 5px 5px; + border: 1px solid transparent; + border-radius: 3px; +} +.ctrl .thumbnails .item:hover { + border: 1px solid #555; + background-color: #444; +} +.ctrl .thumbnails .heading { + overflow: hidden; + height: 20px; +} + + +.ctrl .search .result { + padding: 7px 10px; + cursor: pointer; +} + +.ctrl .search .result:hover { + background-color: #444; +} + +.ctrl .search .results a { + color: #fff; + font-size: 14px; +} + +.ctrl .search .query { + padding: 0 10px; + padding-bottom: 10px; +} + +.ctrl .search .query input { + width: 100%; +} + +.ctrl .search .status { + text-align: center; + color: #ccc; + font-size: 12px; +} diff --git a/fonts/fontawesome-webfont.woff b/fonts/fontawesome-webfont.woff new file mode 100644 index 0000000..400014a Binary files /dev/null and b/fonts/fontawesome-webfont.woff differ diff --git a/fonts/fontawesome-webfont.woff2 b/fonts/fontawesome-webfont.woff2 new file mode 100644 index 0000000..4d13fc6 Binary files /dev/null and b/fonts/fontawesome-webfont.woff2 differ diff --git a/freepaper.info.yml b/freepaper.info.yml new file mode 100644 index 0000000..dd75040 --- /dev/null +++ b/freepaper.info.yml @@ -0,0 +1,7 @@ +name: Above All - Freepaper Flipbook Formatter +type: module +description: 'Freepaper Flipbook formatter' +package: Above All - Twelve Tribes +core_version_requirement: ^9 || ^10 +dependencies: + - field diff --git a/freepaper.libraries.yml b/freepaper.libraries.yml new file mode 100644 index 0000000..5e0d8b6 --- /dev/null +++ b/freepaper.libraries.yml @@ -0,0 +1,12 @@ +flipbook: + version: 1.x + js: + js/html2canvas.min.js: {} + js/three.min.js: {} + js/pdf.min.js: {} + js/3dflipbook.min.js: {} + js/freepaper-actions.js: {} + js/granim.min.js: {} + dependencies: + - core/jquery + - core/drupalSettings diff --git a/freepaper.module b/freepaper.module new file mode 100644 index 0000000..20f8513 --- /dev/null +++ b/freepaper.module @@ -0,0 +1,95 @@ +Freepaper Info and Flipbook +

Description

+

This is a custom module which works with the Above All template for the twelvetribes.org website. + The module displays two different modals (popups): Info and Flipbook. Info displays the body text of the + Publication, along with its image and title. The Flipbook displays a browsable 3D view of the PDF. +

Requirements

+ The 3dflipbook plugin is found at: https://3dflipbook.net. We have a license.

+

Configuration

+ The module works best by creating a view of Publications. Add fields to the views, and exclude them (make them hidden). + Then, create a visible "Global: Custom Text" and put this in the text: +

+        <div class="pub__container">
+          <div class="pub__cover">
+            <img src="{{field_image}}" class="pub__image">
+          </div>
+          <h5>{{title}}</h5>
+          <h6>{{created}}</h6>
+          <div class="pub__middle">
+            <div class="pub__text">
+	             <a class="btn btn-default" href="#" role="button" data-action="freepaper-info" data-id="pub_i{{nid}}" data-title=" {{ title }}" data-body="{{ body }}" ><i class="fa fa-1x fa-info-circle"></i> Info</a>
+	             <a class="btn" href="#" role="button" data-action="freepaper-flipbook" data-id="pub_f{{nid}}" data-title=" {{ title_1 }}" data-pdf="{{ field_pdf }}"><i class="fa fa-1x fa-book-open"></i> View</a>
+	             <a class="btn" href="{{ field_pdf }}" target="_blank"><i class="fa fa-1x fa-download"></i> Download</a>
+	          </div>
+          </div>
+          <div class="receiver"></div>
+        </div>
+        
+ The classes and structure are important. They work together with the other files to load new text into the receiver element. +

Fields

+ +

Data Attributes

+ Within the Button tags are several data attributes, which are used to pass data to the javascript functions. + +

Receiver

+ Within each div.pub__container, outside of all other elements but within the DIV, you must have a div.receiver. The module trader_will + fill that DIV tag with new content to create the modal. +
+ +

Files

+ +

- Mevaser

+ '); + } +} + +function freepaper_preprocess_page(&$variables){ + // Drupal 8-9 + // global $base_url; + // $host = $base_url; + // $variables['#attached']['drupalSettings']['modulepath'] = drupal_get_path('module', 'freepaper'); + // $variables['#attached']['drupalSettings']['host'] = $host; + // // $variables['#attached']['library'][] = 'freepaper/flipbook'; We will attach it in the twig template + + // DRUPAL 10 + $host = Url::fromRoute('', [], ['absolute' => TRUE])->toString(); + $extension_path_resolver = Drupal::service('extension.path.resolver'); + $module_path = $extension_path_resolver->getPath('module', 'freepaper'); + $variables['#attached']['drupalSettings']['modulepath'] = $module_path; + $variables['#attached']['drupalSettings']['host'] = $host; +} diff --git a/images/dark-loader.gif b/images/dark-loader.gif new file mode 100644 index 0000000..5b22245 Binary files /dev/null and b/images/dark-loader.gif differ diff --git a/images/inverse-texture.jpg b/images/inverse-texture.jpg new file mode 100644 index 0000000..5299449 Binary files /dev/null and b/images/inverse-texture.jpg differ diff --git a/images/light-loader.gif b/images/light-loader.gif new file mode 100644 index 0000000..6fae678 Binary files /dev/null and b/images/light-loader.gif differ diff --git a/images/loading.gif b/images/loading.gif new file mode 100644 index 0000000..98912a6 Binary files /dev/null and b/images/loading.gif differ diff --git a/images/loading_1.gif b/images/loading_1.gif new file mode 100644 index 0000000..216f4ab Binary files /dev/null and b/images/loading_1.gif differ diff --git a/images/paper.jpg b/images/paper.jpg new file mode 100644 index 0000000..0566312 Binary files /dev/null and b/images/paper.jpg differ diff --git a/images/paper.png b/images/paper.png new file mode 100644 index 0000000..03f39ea Binary files /dev/null and b/images/paper.png differ diff --git a/images/texture.jpg b/images/texture.jpg new file mode 100644 index 0000000..cb4c591 Binary files /dev/null and b/images/texture.jpg differ diff --git a/js/3dflipbook.min.js b/js/3dflipbook.min.js new file mode 100644 index 0000000..5a2b9d0 --- /dev/null +++ b/js/3dflipbook.min.js @@ -0,0 +1,17 @@ +var pathr = drupalSettings.host + "/" + drupalSettings.modulepath; +!function(modules){function __webpack_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module=installedModules[moduleId]={i:moduleId,l:!1,exports:{}};return modules[moduleId].call(module.exports,module,module.exports,__webpack_require__),module.l=!0,module.exports}var installedModules={};return __webpack_require__.m=modules,__webpack_require__.c=installedModules,__webpack_require__.i=function(value){return value},__webpack_require__.d=function(exports,name,getter){__webpack_require__.o(exports,name)||Object.defineProperty(exports,name,{configurable:!1,enumerable:!0,get:getter})},__webpack_require__.n=function(module){var getter=module&&module.__esModule?function(){return module.default}:function(){return module};return __webpack_require__.d(getter,"a",getter),getter},__webpack_require__.o=function(object,property){return Object.prototype.hasOwnProperty.call(object,property)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=72)}([function(module,exports,__webpack_require__){"use strict";exports.__esModule=!0;var _$=window.jQuery,_html2canvas=window.html2canvas,_THREE=window.THREE,_React=window.React,_ReactDOM=window.ReactDOM,_PDFJS=window.PDFJS,_tr=function(s){return(window.iberezansky||{}).tr&&window.iberezansky.tr(s)||s};exports.$=_$,exports.html2canvas=_html2canvas,exports.THREE=_THREE,exports.React=_React,exports.ReactDOM=_ReactDOM,exports.PDFJS=_PDFJS,exports.tr=_tr},function(module,exports,__webpack_require__){"use strict";exports.__esModule=!0;var _$=window.jQuery,_html2canvas=window.html2canvas,_THREE=window.THREE,_PDFJS=window.PDFJS;exports.$=_$,exports.html2canvas=_html2canvas,exports.THREE=_THREE,exports.PDFJS=_PDFJS},function(module,exports){"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}exports.__esModule=!0;var BaseMathUtils=function(){function BaseMathUtils(){_classCallCheck(this,BaseMathUtils)}return BaseMathUtils.sum1=function(ka,a,kb,b){return[ka*a[0]+kb*b[0]]},BaseMathUtils.sum2=function(ka,a,kb,b){return[ka*a[0]+kb*b[0],ka*a[1]+kb*b[1]]},BaseMathUtils.sum3=function(ka,a,kb,b){return[ka*a[0]+kb*b[0],ka*a[1]+kb*b[1],ka*a[2]+kb*b[2]]},BaseMathUtils.sum4=function(ka,a,kb,b){return[ka*a[0]+kb*b[0],ka*a[1]+kb*b[1],ka*a[2]+kb*b[2],ka*a[3]+kb*b[3]]},BaseMathUtils.rk4=function(dy,t,dt,y){var sum=arguments.length>4&&void 0!==arguments[4]?arguments[4]:BaseMathUtils.sum[y.length-1],k1=dy(t,y),k2=dy(t+dt/2,sum(1,y,dt/2,k1)),k3=dy(t+dt/2,sum(1,y,dt/2,k2)),k4=dy(t+dt,sum(1,y,dt,k3));return sum(1,y,dt/6,sum(1,sum(1,k1,2,k2),1,sum(2,k3,1,k4)))},BaseMathUtils.extrapolateLinear=function(x,y,xi){return y[0]+(y[1]-y[0])/(x[1]-x[0])*(xi-x[0])},BaseMathUtils.interpolateLinear=function(x,y,xi){var yi=void 0;return x[0]>x[1]&&(x=x.reverse(),y=y.reverse()),yi=xix[1]?y[1]:BaseMathUtils.extrapolateLinear(x,y,xi)},BaseMathUtils.calcScale=function(srcW,srcH,dstW,dstH){return Math.min(dstW/srcW,dstH/srcH)},BaseMathUtils.mulM=function(a,b){for(var r=[],i=0;i=_iterator.length)break;_ref=_iterator[_i++]}else{if(_i=_iterator.next(),_i.done)break;_ref=_i.value}var x=_ref;s+=x}return s/data.length},BaseMathUtils.disp=function(data){for(var M=BaseMathUtils.mat(data),s=0,_iterator2=data,_isArray2=Array.isArray(_iterator2),_i2=0,_iterator2=_isArray2?_iterator2:_iterator2[Symbol.iterator]();;){var _ref2;if(_isArray2){if(_i2>=_iterator2.length)break;_ref2=_iterator2[_i2++]}else{if(_i2=_iterator2.next(),_i2.done)break;_ref2=_i2.value}var x=_ref2;s+=(x-M)*(x-M)}return s/data.length},BaseMathUtils.predict=function(data,num){var r=[],l=data.length,D=BaseMathUtils.disp(data);if(D1){for(var am=[],bm=[],i=0;iBaseMathUtils.eps){var dx=BaseMathUtils.det2(b1,a1[1],b2,a2[1]),dy=BaseMathUtils.det2(a1[0],b1,a2[0],b2);res={x:dx/d,y:dy/d}}return res},BaseMathUtils.isInsidePoly=function(ps,p){for(var done=!1,ct=void 0,i=0;iMath.min(p0.x,p1.x)-BaseMathUtils.eps&&ip.xMath.min(p0.y,p1.y)-BaseMathUtils.eps&&ip.y0}}}}return ct%2},BaseMathUtils.isInsideConvPoly=function(ps,p){for(var sg=[0,0],i=0;i1;){var mid=Math.floor((l+h)/2);cmp(x,a[mid])<0?h=mid:l=mid}return cmp(x,a[h])>=0?h:l},Utils}();exports.default=Utils},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}exports.__esModule=!0;var _libs=__webpack_require__(0),_GraphUtils=__webpack_require__(7),_GraphUtils2=_interopRequireDefault(_GraphUtils),ImageBase=function(){function ImageBase(context,width,height,color){_classCallCheck(this,ImageBase),this.context=context,this.wnd=context.wnd,this.doc=context.doc,this.element=context.element||context.doc.body,this.c=context.renderCanvas||ImageBase.renderCanvas,this.ctx=context.renderCanvasCtx||ImageBase.renderCanvasCtx,this.resW=this.width=width,this.resH=this.height=height,this.color=color}return ImageBase.prototype.dispose=function(){},ImageBase.prototype.renderBlankPage=function(){this.ctx.beginPath(),this.ctx.fillStyle=_GraphUtils2.default.color2Rgba(this.color,1),this.ctx.rect(0,0,this.c.width,this.c.height),this.ctx.fill()},ImageBase.prototype.renderImage=function(image){this.pushCtx(),this.ctx.drawImage(image,0,0),this.popCtx()},ImageBase.prototype.normToConv=function(p){return{x:p.x*this.c.width,y:(1-p.y)*this.c.height}},ImageBase.prototype.renderHit=function(poly){var ctx=this.ctx;ctx.fillStyle="rgba(255,255,0,0.4)",ctx.beginPath();var p=this.normToConv(poly[0]);ctx.moveTo(p.x,p.y);for(var i=1;i")[0],ImageBase.renderCanvasCtx=ImageBase.renderCanvas.getContext("2d"),exports.default=ImageBase},function(module,exports,__webpack_require__){"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}exports.__esModule=!0;var _extends=Object.assign||function(target){for(var i=1;i>16&255,color>>8&255,255&color]},GraphUtils.inverseColor=function(color){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,bs=GraphUtils.getColorBytes(color),ibs=[255-bs[0],255-bs[1],255-bs[2]],nbs=[Math.round(GraphUtils.interpolate01(bs[0],ibs[0],t)),Math.round(GraphUtils.interpolate01(bs[1],ibs[1],t)),Math.round(GraphUtils.interpolate01(bs[2],ibs[2],t))];return GraphUtils.bytes2Color(nbs)},GraphUtils.color2Rgba=function(color,a){return GraphUtils.bytes2Rgba(GraphUtils.getColorBytes(color),a)},GraphUtils.bytes2Rgba=function(bs,a){return"rgba("+bs.join(",")+","+a+")"},GraphUtils.bytes2Color=function(bs){return bs[2]|bs[1]<<8|bs[0]<<16},GraphUtils}();exports.default=GraphUtils},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}exports.__esModule=!0;var _Cache=__webpack_require__(14),_Cache2=_interopRequireDefault(_Cache),_BlankImage=__webpack_require__(44),_BlankImage2=_interopRequireDefault(_BlankImage),_StaticImage=__webpack_require__(59),_StaticImage2=_interopRequireDefault(_StaticImage),_PdfImage=__webpack_require__(57),_PdfImage2=_interopRequireDefault(_PdfImage),_InteractiveImage=__webpack_require__(51),_InteractiveImage2=_interopRequireDefault(_InteractiveImage),ImageFactory=function(){function ImageFactory(context,cache){_classCallCheck(this,ImageFactory),this.context=context,this.cache=cache||new _Cache2.default}return ImageFactory.prototype.build=function(info){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,widthTexels=arguments.length>2&&void 0!==arguments[2]?arguments[2]:210,heightTexels=arguments.length>3&&void 0!==arguments[3]?arguments[3]:297,color=arguments.length>4&&void 0!==arguments[4]?arguments[4]:16777215,injector=arguments.length>5&&void 0!==arguments[5]?arguments[5]:void 0,image=void 0;switch(info.type){case"html":image=new _InteractiveImage2.default(this.context,widthTexels,heightTexels,color,info.src,this.cache,injector);break;case"image":image=new _StaticImage2.default(this.context,widthTexels,heightTexels,color,info.src);break;case"pdf":image=new _PdfImage2.default(this.context,widthTexels,heightTexels,color,info.src,n);break;case"blank":default:image=new _BlankImage2.default(this.context,widthTexels,heightTexels,color)}return image},ImageFactory}();exports.default=ImageFactory},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}exports.__esModule=!0;var _extends=Object.assign||function(target){for(var i=1;i4&&void 0!==arguments[4]?arguments[4]:0,_this=this,state=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"closed",height=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0;_classCallCheck(this,SheetBlock),this.visual=visual,this.p=_extends({},p,{first:first,last:last});var props=this.getProps(),loadedPoints=this.loadPoints();Object.keys(loadedPoints).map(function(k){_this[k]=loadedPoints[k][props.shape]||loadedPoints[k][0]}),this.pSpline=new _libs.THREE.Spline([]);for(var i=0;i=_iterator.length)break;_ref=_iterator[_i2++]}else{if(_i2=_iterator.next(),_i2.done)break;_ref=_i2.value}var _i3=_ref,marker=_ThreeUtils2.default.createMarker(this.geometry.vertices[_i3],_i3=_iterator2.length)break;_ref2=_iterator2[_i4++]}else{if(_i4=_iterator2.next(),_i4.done)break;_ref2=_i4.value}var m=_ref2;m.map&&(m.map=null,m.needsUpdate=!0),m.dispose()}delete this.materials,this.geometry.dispose()},SheetBlock.prototype.getSize=function(){return this.p.last-this.p.first},SheetBlock.prototype.getProps=function(){return _extends({},this.p.page,{sheets:this.p.sheets})},SheetBlock.prototype.getTopCerners=function(){var off=this.angle>Math.PI/2?this.geometry.vertices.length/2:0;return[this.geometry.vertices[off],this.geometry.vertices[_sheetBlock2.default.resX-1+off],this.geometry.vertices[(_sheetBlock2.default.resZ-1)*_sheetBlock2.default.resX+off],this.geometry.vertices[_sheetBlock2.default.resZ*_sheetBlock2.default.resX-1+off]]},SheetBlock.prototype.getTopSize=function(){var vs=this.getTopCerners();return{width:vs[0].distanceTo(vs[1]),height:vs[0].distanceTo(vs[2])}},SheetBlock.prototype.getTopWorldRotation=function(q){return q.x=-Math.PI/2,q},SheetBlock.prototype.getTopWorldPosition=function(v){var l=this.geometry.vertices.length,off=this.angle>Math.PI/2?l/2:0,vs=[this.geometry.vertices[off],this.geometry.vertices[_sheetBlock2.default.resX-1+off],this.geometry.vertices[(_sheetBlock2.default.resZ-1)*_sheetBlock2.default.resX+off],this.geometry.vertices[_sheetBlock2.default.resZ*_sheetBlock2.default.resX-1+off]];v.set(0,0,0);for(var _iterator3=vs,_isArray3=Array.isArray(_iterator3),_i5=0,_iterator3=_isArray3?_iterator3:_iterator3[Symbol.iterator]();;){var _ref3;if(_isArray3){if(_i5>=_iterator3.length)break;_ref3=_iterator3[_i5++]}else{if(_i5=_iterator3.next(),_i5.done)break;_ref3=_i5.value}var vi=_ref3;v.x+=.25*vi.x,v.y+=.25*vi.y,v.z+=.25*vi.z}return this.three.localToWorld(v),v},SheetBlock.prototype.getInterpolationPoints=function(inds,mod){for(var ps={x:[],y:[]},K=this.getProps().wave,_iterator4=inds,_isArray4=Array.isArray(_iterator4),_i6=0,_iterator4=_isArray4?_iterator4:_iterator4[Symbol.iterator]();;){var _ref4;if(_isArray4){if(_i6>=_iterator4.length)break;_ref4=_iterator4[_i6++]}else{if(_i6=_iterator4.next(),_i6.done)break;_ref4=_i6.value}var i=_ref4;ps.x.push([].concat(this.interpolationPoints.x[i])),ps.y.push(~mod.indexOf(i)?this.interpolationPoints.y[i].map(function(n){return K*n}):[].concat(this.interpolationPoints.y[i]))}return ps},SheetBlock.prototype.set=function(angle){var state=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.state,height=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.corner.height,first=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.p.first,last=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.p.last,PI=Math.PI;this.state=state;var closedAngle=void 0,binderTurn=void 0;"object"===("undefined"==typeof angle?"undefined":_typeof(angle))?(this.angle=angle.openedAngle,closedAngle=angle.closedAngle,binderTurn=angle.binderTurn>PI/2?PI-angle.binderTurn:angle.binderTurn):this.angle=angle,this.corner.height=height,this.p.first===first&&this.p.last===last||(this.sideTexture.repeat.set(0,last-first),this.sideTexture.needsUpdate=!0,this.p.first!==first&&this.p.setTexture(this.materials[0],2*first),this.p.last!==last&&this.p.setTexture(this.materials[1],2*last-1)),this.p.first=first,this.p.last=last;var points=void 0,props=this.getProps();if("closed"===this.state)points=this.getInterpolationPoints(this.closedInterpolationIndeces,this.closedInterpolationIndeces);else if("opened"===this.state)if(void 0!==closedAngle&&Math.abs(closedAngle-PI/2)>.01){points=this.getInterpolationPoints(this.flatInterpolationIndeces,[]);var ps=this.getPointsAtAngle(this.getInterpolationPoints(this.closedInterpolationIndeces,this.closedInterpolationIndeces),closedAngle>PI/2?PI-closedAngle:closedAngle);points.x=[ps.x].concat(points.x),points.y=[ps.y].concat(points.y)}else points=this.getInterpolationPoints(this.openedInterpolationIndeces,this.closedInterpolationIndeces);var hl=void 0,hr=void 0,offset=.5*props.sheets*props.depth;"closed"===this.state&&(offset-=7e-6*this.p.scale),this.angle<=PI/2?(hl=(props.sheets-first)*props.depth,hr=(props.sheets-last)*props.depth):(hl=first*props.depth,hr=last*props.depth);var inAngle=this.angle>PI/2?PI-this.angle:this.angle,hAngle="closed"===this.state?inAngle:void 0===binderTurn?PI/2:binderTurn,_getPointsAtAngleAndH=this.getPointsAtAngleAndHs(points,inAngle,hAngle,[hl/props.width,hr/props.width]),left=_getPointsAtAngleAndH[0],right=_getPointsAtAngleAndH[1];this.angle>PI/2&&(this.inverse(left),this.inverse(right),offset=-offset),this.setPoints(left,right,offset)},SheetBlock.prototype.setPoints=function(left,right,offset){for(var _this2=this,p=this.getProps(),i=0,ys=[right,left],y=0;y<_sheetBlock2.default.resY;++y)for(var z=0;z<_sheetBlock2.default.resZ;++z)for(var x=0;x<_sheetBlock2.default.resX;++x)this.geometry.vertices[i++].set(ys[y].x[x]*p.width+offset,ys[y].y[x]*p.width,z*p.height/(_sheetBlock2.default.resZ-1)-.5*p.height);if(i!==this.geometry.vertices.length&&console.warn("setPoints: bad mapping!"),this.corner.use&&!this.corner.points.length){var plane=new _libs.THREE.Plane,normal=plane.normal,planeOffset=(1-this.getProps().flexibleCorner)*Math.min(p.width,p.height),proj=new _libs.THREE.Vector3;plane.setFromNormalAndCoplanarPoint(new _libs.THREE.Vector3(-1,0,-1).normalize(),new _libs.THREE.Vector3(planeOffset+offset,0,.5*p.height));for(var _i7=0,l=this.geometry.vertices.length;_i70){var d=proj.length()/planeOffset;this.corner.maxDistance=Math.max(this.corner.maxDistance,d),this.corner.points.push({vertex:_i7,distance:d})}}if(this.corner.use&&Math.abs(this.corner.height)>.001){var d2Angle=function(d){return p.cornerDeviation*_this2.corner.height/(1+Math.exp(-p.bending*(d-.5*_this2.corner.maxDistance)))};this.corner.axis.set(-1,0,1).normalize(),this.corner.axis.applyAxisAngle(this.corner.OZ,this.angle);for(var _iterator5=this.corner.points,_isArray5=Array.isArray(_iterator5),_i8=0,_iterator5=_isArray5?_iterator5:_iterator5[Symbol.iterator]();;){var _ref5;if(_isArray5){if(_i8>=_iterator5.length)break;_ref5=_iterator5[_i8++]}else{if(_i8=_iterator5.next(),_i8.done)break;_ref5=_i8.value}var point=_ref5;this.geometry.vertices[point.vertex].applyAxisAngle(this.corner.axis,d2Angle(point.distance))}}for(var _iterator6=this.markers,_isArray6=Array.isArray(_iterator6),_i9=0,_iterator6=_isArray6?_iterator6:_iterator6[Symbol.iterator]();;){var _ref6;if(_isArray6){if(_i9>=_iterator6.length)break;_ref6=_iterator6[_i9++]}else{if(_i9=_iterator6.next(),_i9.done)break;_ref6=_i9.value}var m=_ref6;m.marker.position.copy(this.geometry.vertices[m.vertex])}this.geometry.computeVertexNormals(),this.geometry.computeBoundingSphere(),this.geometry.verticesNeedUpdate=!0,this.markup&&this.markup.computeVertices()},SheetBlock.prototype.inverse=function(ps){for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:void 0;_classCallCheck(this,CSS3DObject);var _this=_possibleConstructorReturn(this,_THREE$Object3D.call(this));return element&&_this.set(element),_this}return _inherits(CSS3DObject,_THREE$Object3D),CSS3DObject.prototype.set=function(element){this.element=element,this.element.style.position="absolute",this.addEventListener("removed",function(){null!==this.element.parentNode&&this.element.parentNode.removeChild(this.element)})},CSS3DObject}(_libs.THREE.Object3D),_libs.THREE.CSS3DSprite=function(_THREE$CSS3DObject){function CSS3DSprite(element){return _classCallCheck(this,CSS3DSprite),_possibleConstructorReturn(this,_THREE$CSS3DObject.call(this,element))}return _inherits(CSS3DSprite,_THREE$CSS3DObject),CSS3DSprite}(_libs.THREE.CSS3DObject),_libs.THREE.CSS3DRenderer=function CSS3DRenderer(){function epsilon(value){return Math.abs(value)<1e-10?0:value}function getCameraCSSMatrix(matrix){var elements=matrix.elements;return"matrix3d("+epsilon(elements[0])+","+epsilon(-elements[1])+","+epsilon(elements[2])+","+epsilon(elements[3])+","+epsilon(elements[4])+","+epsilon(-elements[5])+","+epsilon(elements[6])+","+epsilon(elements[7])+","+epsilon(elements[8])+","+epsilon(-elements[9])+","+epsilon(elements[10])+","+epsilon(elements[11])+","+epsilon(elements[12])+","+epsilon(-elements[13])+","+epsilon(elements[14])+","+epsilon(elements[15])+")"}function getObjectCSSMatrix(matrix,cameraCSSMatrix){var elements=matrix.elements,matrix3d="matrix3d("+epsilon(elements[0])+","+epsilon(elements[1])+","+epsilon(elements[2])+","+epsilon(elements[3])+","+epsilon(-elements[4])+","+epsilon(-elements[5])+","+epsilon(-elements[6])+","+epsilon(-elements[7])+","+epsilon(elements[8])+","+epsilon(elements[9])+","+epsilon(elements[10])+","+epsilon(elements[11])+","+epsilon(elements[12])+","+epsilon(elements[13])+","+epsilon(elements[14])+","+epsilon(elements[15])+")";return isIE?"translate(-50%,-50%)translate("+_widthHalf+"px,"+_heightHalf+"px)"+cameraCSSMatrix+matrix3d:"translate(-50%,-50%)"+matrix3d}function renderObject(object,camera,cameraCSSMatrix){if(object instanceof _libs.THREE.CSS3DObject){var style;object instanceof _libs.THREE.CSS3DSprite?(matrix.copy(camera.matrixWorldInverse),matrix.transpose(),matrix.copyPosition(object.matrixWorld),matrix.scale(object.scale),matrix.elements[3]=0,matrix.elements[7]=0,matrix.elements[11]=0,matrix.elements[15]=1,style=getObjectCSSMatrix(matrix,cameraCSSMatrix)):style=getObjectCSSMatrix(object.matrixWorld,cameraCSSMatrix);var element=object.element,cachedStyle=cache.objects[object.id]&&cache.objects[object.id].style;void 0!==cachedStyle&&cachedStyle===style||(element.style.WebkitTransform=style,element.style.MozTransform=style,element.style.transform=style,cache.objects[object.id]={style:style},isIE&&(cache.objects[object.id].distanceToCameraSquared=getDistanceToSquared(camera,object))),element.parentNode!==cameraElement&&cameraElement.appendChild(element)}for(var i=0,l=object.children.length;i2&&void 0!==arguments[2]?arguments[2]:1024;_classCallCheck(this,CSSLayer);var _this=_possibleConstructorReturn(this,_CSS3DObject.call(this));_this.jContainer=(0,_libs.$)('');var heightPxs=height/width*widthPxs;return _this.jContainer.width(widthPxs).height(heightPxs),_this.scale.x/=widthPxs/width,_this.scale.y/=widthPxs/width,_this.setData(),_this.set(_this.jContainer[0]),_this}return _inherits(CSSLayer,_CSS3DObject),CSSLayer.init=function(doc){var delay=arguments.length>1&&void 0!==arguments[1]?arguments[1]:150;CSSLayer.delay=delay,CSSLayer.style=(0,_libs.$)("").appendTo(doc.head)},CSSLayer.dispose=function(){CSSLayer.style.remove()},CSSLayer.prototype.callInternal=function(name){if(this.object&&this.object[name])try{this.object[name]()}catch(e){console.error(e)}},CSSLayer.prototype.dispose=function(){this.clearInternals()},CSSLayer.prototype.clearInternals=function(){this.callInternal("dispose"),!this.css||this.css.remove(),!this.html||this.html.remove()},CSSLayer.prototype.setData=function setData(){var css=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",html=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",js=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";this.clearInternals(),this.css=(0,_libs.$)('").appendTo(this.jContainer),this.html=(0,_libs.$)(html).appendTo(this.jContainer);var init=eval(js);init&&(this.object=init(this.jContainer)||{})},CSSLayer.prototype.pendedCall=function(clb){var _this2=this,timestamp=this.timestamp=Date.now();setTimeout(function(){timestamp===_this2.timestamp&&clb()},CSSLayer.delay)},CSSLayer.prototype.isHidden=function(){return this.jContainer.hasClass("hidden")},CSSLayer.prototype.hide=function(){var _this3=this,res=void 0;return this.isHidden()?res=Promise.resolve():(this.jContainer.addClass("hidden"),this.callInternal("hide"),res=new Promise(function(resolve){_this3.pendedCall(function(){_this3.callInternal("hidden"),resolve()})})),res},CSSLayer.prototype.show=function(){var _this4=this,res=void 0;return this.isHidden()?(this.jContainer.removeClass("hidden"),this.callInternal("show"),res=new Promise(function(resolve){_this4.pendedCall(function(){_this4.callInternal("shown"),resolve()})})):res=Promise.resolve(),res},CSSLayer}(_CSS3DRenderer.CSS3DObject);exports.default=CSSLayer},function(module,exports){"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}exports.__esModule=!0;var Cache=function(){function Cache(){var maxSize=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1/0,sizeof=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Cache.countSizeof;_classCallCheck(this,Cache),this.os=new Map,this.sizeof=sizeof,this.maxSize=maxSize,this.size=0}return Cache.prototype.forEach=function(clb){this.os.forEach(function(v,k){return clb([k,v])})},Cache.countSizeof=function(value){return 1},Cache.prototype.remove=function(k){var res=!1,v=this.os.get(k);return v.locked&&v.locked(k)||(this.size-=this.sizeof(v),v.dispose&&v.dispose(),this.os.delete(k),res=!0),res},Cache.prototype.freeSpace=function(){for(var arr=[],_iterator=this.os,_isArray=Array.isArray(_iterator),_i=0,_iterator=_isArray?_iterator:_iterator[Symbol.iterator]();;){var _ref;if(_isArray){if(_i>=_iterator.length)break;_ref=_iterator[_i++]}else{if(_i=_iterator.next(),_i.done)break;_ref=_i.value}var p=_ref;arr.push({timestamp:p[1].timestamp,key:p[0]})}arr.sort(function(a,b){return a.timestamp-b.timestamp});for(var i=0;i3*this.maxSize/4;++i)this.remove(arr[i].key)},Cache.prototype.dispose=function(){for(var arr=[],_iterator2=this.os,_isArray2=Array.isArray(_iterator2),_i2=0,_iterator2=_isArray2?_iterator2:_iterator2[Symbol.iterator]();;){var _ref2;if(_isArray2){if(_i2>=_iterator2.length)break;_ref2=_iterator2[_i2++]}else{if(_i2=_iterator2.next(),_i2.done)break;_ref2=_i2.value}var p=_ref2;arr.push({v:p[1],k:p[0]})}for(var _iterator3=arr,_isArray3=Array.isArray(_iterator3),_i3=0,_iterator3=_isArray3?_iterator3:_iterator3[Symbol.iterator]();;){var _ref3;if(_isArray3){if(_i3>=_iterator3.length)break;_ref3=_iterator3[_i3++]}else{if(_i3=_iterator3.next(),_i3.done)break;_ref3=_i3.value}var o=_ref3;o.v.dispose&&o.v.dispose(),this.os.delete(o.k)}},Cache.recursionSizeof=function(value){var size=0;if(value){++size;var len=value.length;if(void 0===len)for(var p in value)value.hasOwnProperty(p)&&(size+=Cache.recursionSizeof(value[p]));else size+=len}return size},Cache.prototype.getTimestamp=function(){return Date.now()},Cache.prototype.get=function(key){var value=this.os.get(key);return value&&(value.timestamp=this.getTimestamp()),value},Cache.prototype.put=function(key,value){return value.timestamp=this.getTimestamp(),this.os.set(key,value),this.size+=this.sizeof(value),this.size>this.maxSize&&this.freeSpace(),value},Cache}();exports.default=Cache},function(module,exports,__webpack_require__){"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}exports.__esModule=!0;var _libs=__webpack_require__(0),Controller=function(_THREE$EventDispatche){function Controller(){return _classCallCheck(this,Controller),_possibleConstructorReturn(this,_THREE$EventDispatche.apply(this,arguments))}return _inherits(Controller,_THREE$EventDispatche),Controller.prototype.handleDefault=function(id,e,data){},Controller.prototype.dispatchAsync=function(e){var _this2=this;Promise.resolve().then(function(){return _this2.dispatchEvent(e)})},Controller.prototype.dispose=function(){},Controller}(_libs.THREE.EventDispatcher);exports.default=Controller},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}exports.__esModule=!0;var _EventConverter2=__webpack_require__(6),_EventConverter3=_interopRequireDefault(_EventConverter2),CustomEventConverter=function(_EventConverter){function CustomEventConverter(wnd,doc){var customTest=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){return!1},eDoc=arguments[3];_classCallCheck(this,CustomEventConverter);var _this=_possibleConstructorReturn(this,_EventConverter.call(this,wnd,doc));return _this.eDoc=eDoc,_this.customTest=customTest,_this.customs=[],_this}return _inherits(CustomEventConverter,_EventConverter),CustomEventConverter.prototype.test=function(object1,object2){return!(!object1||!object2)&&this.customTest(object1,object2)},CustomEventConverter.prototype.getCallback=function(object){return object.target.callback},CustomEventConverter.prototype.addCustom=function(custom){this.customs.push(custom)},CustomEventConverter.prototype.getObject=function(e,data){var object=void 0;if(data.doc===this.eDoc)for(var _iterator=this.customs,_isArray=Array.isArray(_iterator),_i=0,_iterator=_isArray?_iterator:_iterator[Symbol.iterator]();;){var _ref;if(_isArray){if(_i>=_iterator.length)break;_ref=_iterator[_i++]}else{if(_i=_iterator.next(),_i.done)break;_ref=_i.value}var custom=_ref;if(object=custom.testIntersection(e,data))break}return object},CustomEventConverter}(_EventConverter3.default);exports.default=CustomEventConverter},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}exports.__esModule=!0;var _extends=Object.assign||function(target){for(var i=1;i=0;--i)if(Finder.isDelimetr(this.str[i])||0===i){f=0===i?0:i+1,--dels;break}}else for(var _i=l+2;_i100?100:cur,_this.loadingProgress(cur))}_this.progresData=data}).then(function(handler){_this.handler=handler;for(var done=Promise.resolve(handler),_loop=function(){if(_isArray){if(_i>=_iterator.length)return"break";_ref=_iterator[_i++]}else{if(_i=_iterator.next(),_i.done)return"break";_ref=_i.value}var clb=_ref;done=done.then(function(handler){return clb(handler),handler})},_iterator=_this.handlerQueue.reverse(),_isArray=Array.isArray(_iterator),_i=0,_iterator=_isArray?_iterator:_iterator[Symbol.iterator]();;){var _ref,_ret=_loop();if("break"===_ret)break}})}return Pdf.prototype.dispose=function(){this.handlerQueue.splice(0,this.handlerQueue.length),delete this.handler},Pdf.prototype.setLoadingProgressClb=function(clb){this.loadingProgress=clb},Pdf.prototype.getPagesNum=function(){return this.handler?this.handler.numPages:void 0},Pdf.getPageSize=function(page){return{width:page.view[2]-page.view[0],height:page.view[3]-page.view[1]}},Pdf.prototype.getHandler=function(clb){this.handler?clb(this.handler):this.handlerQueue.push(clb)},Pdf}();exports.default=Pdf},function(module,exports,__webpack_require__){"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}exports.__esModule=!0;var _libs=__webpack_require__(0),ThreeEventConverterFs=function(){function ThreeEventConverterFs(visualWorld){var test=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ThreeEventConverterFs.objectsAndFacesTest;_classCallCheck(this,ThreeEventConverterFs),this.visual=visualWorld,this.coords=new _libs.THREE.Vector2,this.raycaster=this.visual.raycaster,this.camera=this.visual.camera,this.threes=[],this.test=test}return ThreeEventConverterFs.objectsTest=function(object1,object2){return!(!object1||!object2)&&object1.object===object2.object},ThreeEventConverterFs.objectsAndFacesTest=function(object1,object2){return!(!object1||!object2)&&(object1.object===object2.object&&object1.face.materialIndex===object2.face.materialIndex)},ThreeEventConverterFs.prototype.addThree=function(three){this.threes.push(three)},ThreeEventConverterFs.prototype.removeThree=function(three){var i=this.threes.indexOf(three);~i&&this.threes.splice(i,1)},ThreeEventConverterFs.prototype.getObject=function(e){this.setCoordsFromEvent(e),this.raycaster.setFromCamera(this.coords,this.camera);var intersects=this.raycaster.intersectObjects(this.threes);return intersects[0]},ThreeEventConverterFs}();exports.default=ThreeEventConverterFs},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}exports.__esModule=!0;var _BaseMathUtils=__webpack_require__(2),_BaseMathUtils2=_interopRequireDefault(_BaseMathUtils),ThreeUtils=function(){function ThreeUtils(){_classCallCheck(this,ThreeUtils)}return ThreeUtils.vertices2UVs=function(vertices,indeces,first,last,converClb){for(var r=[],i=first;i=_iterator.length)break;_ref=_iterator[_i++]}else{if(_i=_iterator.next(),_i.done)break;_ref=_i.value}for(var p=_ref,found=!1,i=first;i").appendTo("body"),function(){_Detector2.default.webgl?(scene.loadingCtrl=new _LoadingController2.default(scene.view,!0,function(progress){return 0===progress?"Please wait... the Application is Loading":"PDF is Loading: "+progress+"%"}),scene.visual=new _VisualWorld2.default(scene.view.getContainer().ownerDocument.defaultView,scene.view.getContainer().ownerDocument,scene.view.getView()),scene.bookBuilder=function(props,sheets,pageCallback){options.propertiesCallback&&(props=options.propertiesCallback(props)),scene.book=new _Book2.default(scene.visual,sheets,pageCallback,props),scene.bookPrinter=new _BookPrinter2.default(scene.visual,scene.book,(options.template||{}).printStyle),scene.loadingCtrl.dispose(),delete scene.loadingCtrl,scene.ctrl=new _BookController2.default(scene.book,scene.view,options.controlsProps),scene.book.setInjector(function(w){w.jQuery=w.$=_libs.$,w.book=scene.book,w.bookCtrl=scene.ctrl,props.injector&&props.injector(w)}),scene.view.addHandler(scene.ctrl),scene.ctrl.setPrinter(scene.bookPrinter);var test=pageCallback(0);scene.search=new _Search2.default(scene.view.getSearchView(),scene.book.getPages()),scene.search.onQuery=scene.book.setQuery.bind(scene.book),scene.book.addEventListener("searchResults",function(e){scene.search.setResults(e.results,e.lastPage)}),scene.thumbnails=new _Thumbnails2.default(scene.visual,scene.view.getThumbnailsView(),pageCallback,2*(sheets+2),{kWtoH:props.width/props.height}),scene.tocCtrl=new _TocController2.default(scene.view,scene.ctrl),scene.tocCtrl.setThumbnails(scene.thumbnails),scene.tocCtrl.setSearch(scene.search),scene.ctrl.setTocCtrl(scene.tocCtrl),scene.view.addHandler(scene.tocCtrl),"pdf"===test.type&&(scene.pdfLinksHandler=new _PdfLinksHandler2.default(test.src,scene.ctrl,scene.visual.element),scene.book.addEventListener("pdfAnnotation",scene.pdfLinksHandler.handleEvent.bind(scene.pdfLinksHandler)),test.src.getHandler(function(handler){handler.getOutline().then(function(outline){scene.bookmarks=new _Bookmarks2.default(scene.view.getBookmarksView(),outline),scene.tocCtrl.setBookmarks(scene.bookmarks,test.src)})}),options.pdfLinks&&options.pdfLinks.handler&&scene.pdfLinksHandler.setHandler(options.pdfLinks.handler)),scene.sounds=new _SoundsEnviroment2.default(options.template),scene.ctrl.setSounds(scene.sounds),scene.sounds.subscribeFlips(scene.ctrl),scene.ready=!0,new _AutoNavigator2.default(scene.visual,scene.ctrl,options.autoNavigation).dispose(),options.ready&&options.ready(scene),scene.pendingDispose&&scene.dispose()},options.pdf?(scene.propsBuilder=new _PdfBookPropsBuilder2.default(options.pdf,scene.bookBuilder),scene.propsBuilder.pdf.setLoadingProgressClb(scene.loadingCtrl.setProgress.bind(scene.loadingCtrl))):options.pageCallback?scene.propsBuilder=new _ClbBookPropsBuilder2.default(scene.visual,options.pageCallback,options.pages,scene.bookBuilder):scene.propsBuilder=new _ClbBookPropsBuilder2.default(scene.visual,_Book2.default.pageCallback,6,scene.bookBuilder)):_Detector2.default.addGetWebGLMessage({parent:scene.view.getView()})},options.template),scene},(0,_libs.$)(function(){for(var containers=(0,_libs.$)(".flip-book-container"),i=0;i>>0,start=arguments[1],relativeStart=start>>0,k=relativeStart<0?Math.max(len+relativeStart,0):Math.min(relativeStart,len),end=arguments[2],relativeEnd=void 0===end?len:end>>0,final=relativeEnd<0?Math.max(len+relativeEnd,0):Math.min(relativeEnd,len);k>>0,thisArg=arguments[1],i=0;i>>0,thisArg=arguments[1],i=0;i2&&void 0!==arguments[2]?arguments[2]:{};_classCallCheck(this,AutoNavigator),props=_extends({},props,{urlParam:props.urlParam||"fb3d-page",navigates:void 0===props.navigates?1:props.navigates}),this.props=props,this.context=context,this.bookCtrl=bookCtrl,this.urlParam=props.urlParam,this.wnd=context.wnd,this.wnd.fb3d=_extends({},this.wnd.fb3d),this.wnd.fb3d.navigator=_extends({},this.wnd.fb3d.navigator),this.navigator=this.wnd.fb3d.navigator[this.urlParam]=_extends({},this.wnd.fb3d.navigator[this.urlParam]),this.navigator.instances=(this.navigator.instances||0)+1,this.navigator.instances<=this.props.navigates&&this.bookCtrl.goToPage(this.getPageNumber())}return AutoNavigator.prototype.dispose=function(){},AutoNavigator.prototype.getParameterByName=function(name,url){url||(url=window.location.href),name=name.replace(/[\[\]]/g,"\\$&");var regex=new RegExp("[?&]"+name+"(=([^]*)|&|#|$)"),results=regex.exec(url);return results?results[2]?decodeURIComponent(results[2].replace(/\+/g," ")):"":null},AutoNavigator.prototype.getPageNumber=function(){var number=this.getParameterByName(this.urlParam);return number=parseInt(number),isNaN(number)&&(number=1),number-1},AutoNavigator}();exports.default=AutoNavigator},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}exports.__esModule=!0;var _extends=Object.assign||function(target){for(var i=1;i=_iterator.length)break;_ref=_iterator[_i++]}else{if(_i=_iterator.next(),_i.done)break;_ref=_i.value}var m=_ref;m.map&&(m.map=null,m.needsUpdate=!0),m.dispose()}delete this.materials,this.backG.dispose()},Binder.prototype.set=function(angle){var right=void 0,left=void 0;angle>Math.PI/2?(right=Math.PI/2,left=angle-Math.PI/2):(right=angle,left=0);var p=this.p,tr1={x:-.5*p.cover.depth,y:.5*p.backSize-p.cover.depth};this.backRT.position.set(tr1.x,tr1.y,0),this.backRR.position.set(-tr1.x,-tr1.y,0),this.backRR.quaternion.setFromAxisAngle(this.OZ,right);var tr2={x:p.backSize-2*p.cover.depth-.5*p.cover.depth,y:.5*p.backSize-p.cover.depth};this.backLT.position.set(tr2.x,tr2.y,0),this.backLR.position.set(-tr2.x,-tr2.y,0),this.backLR.quaternion.setFromAxisAngle(this.OZ,left)},Binder.prototype.setLeft=function(angle){var PI=Math.PI;this.leftPivot.position.set(_MathUtils2.default.interpolateLinear([-PI,-PI/2],[0,this.p.cover.depth],angle),.5*this.p.backSize-.5*this.p.cover.depth,0),this.leftPivot.quaternion.setFromAxisAngle(this.OZ,angle)},Binder.prototype.setRight=function(angle){var PI=Math.PI;this.rightPivot.position.set(_MathUtils2.default.interpolateLinear([-PI/2,0],[this.p.cover.depth,0],angle),-.5*this.p.backSize+.5*this.p.cover.depth,0),this.rightPivot.quaternion.setFromAxisAngle(this.OZ,angle)},Binder.prototype.joinLeftCover=function(cover){cover.three.position.set(0,-.5*this.p.cover.depth,0),this.leftPivot.add(cover.three)},Binder.prototype.disconnectLeftCover=function(cover){this.leftPivot.remove(cover.three)},Binder.prototype.joinRightCover=function(cover){cover.three.position.set(0,-.5*this.p.cover.depth,0),this.rightPivot.add(cover.three)},Binder.prototype.disconnectRightCover=function(cover){this.rightPivot.remove(cover.three)},Binder}();exports.default=Binder},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}exports.__esModule=!0;var _extends=Object.assign||function(target){for(var i=1;i0&&_this.addSheetBlock(0,new _SheetBlock2.default(visual,_extends({},_this.p,{setTexture:_this.setPageTexture.bind(_this)}),0,sheets,0,"closed")),_this.angle=_this.p.rtl?Math.PI:0,_this.closedAngle=0,_this.set(_this.angle,0),_this.lastMousePos={t:0},_this.three.position.set(-.5*_this.p.cover.depth+.5*sheets*_this.p.page.depth,0,0),_this.sheetPhysics=new _SheetPhysics2.default(_this.p.page.width/_this.p.scale,_this.p.gravity,_this.p.page.cornerDeviation),_this.binds={update:_this.update.bind(_this),lastMousePos:function(e){_this.lastMousePos=_extends({},_this.lastMousePos,{pageX:e.pageX,pageY:e.pageY})}},_this.visual.addRenderCallback(_this.binds.update),(0,_libs.$)(_this.visual.doc).on("mousemove",_this.binds.lastMousePos),_this.binds.onPickCallback=_this.onPickCallback.bind(_this),_this.visual.drag.onPickCallback=_this.binds.onPickCallback,_this.binds.onDragCallback=_this.onDragCallback.bind(_this),_this.visual.drag.onDragCallback=_this.binds.onDragCallback,_this.binds.onReleaseCallback=_this.onReleaseCallback.bind(_this),_this.visual.drag.onReleaseCallback=_this.binds.onReleaseCallback,_this.dragAngle=.05,_this.tmp={boxs:[new _libs.THREE.Box3,new _libs.THREE.Box3]},_this.visual.addObject(_this.three),setTimeout(function(){_this.notifyBeforeAnimation(),_this.notifyAfterAnimation()},100),_this}return _inherits(Book,_THREE$EventDispatche),Book.prototype.dispose=function(){this.visual.removeObject(this.three),this.sheetPhysics.dispose(),delete this.visual.drag.onPickCallback,delete this.visual.drag.onDragCallback,delete this.visual.drag.onReleaseCallback,(0,_libs.$)(this.visual.doc).off("mousemove",this.binds.lastMousePos),this.visual.removeRenderCallback(this.binds.update),this.removeSheetBlocks(0,this.sheetBlocks.length),this.binder.disconnectLeftCover(this.leftCover),this.removeSheetBlock(this.leftCover),this.binder.disconnectRightCover(this.rightCover),this.removeSheetBlock(this.rightCover),this.binder.dispose(),this.layerManager.dispose(),_CSSLayer2.default.dispose(),this.pageManager.dispose()},Book.prototype.getPageCallback=function(){return this.p.pageCallback},Book.prototype.setQuery=function(query){this.searchEngine.setQuery(query)},Book.prototype.isProcessing=function(){return 0!==this.sheetPhysics.getSize()},Book.prototype.getPages=function(){return 4+2*this.p.sheets},Book.prototype.setFlipProgressClb=function(clb){this.p.flipProgressClb=clb},Book.prototype.setInjector=function(injector){this.p.injector=injector},Book.prototype.isActivePage=function(n){var res=!0;if(n>1&&n=_iterator.length)break;_ref=_iterator[_i++]}else{if(_i=_iterator.next(),_i.done)break;_ref=_i.value}var b=_ref;if(n-2>2*b.p.first&&n-2<2*b.p.last-1){res=!1;break}}return res},Book.prototype.getBlockByPage=function(n){var block=void 0;if(n<2)block=this.leftCover;else if(n<2*(this.p.sheets+1))for(var _iterator2=this.sheetBlocks,_isArray2=Array.isArray(_iterator2),_i2=0,_iterator2=_isArray2?_iterator2:_iterator2[Symbol.iterator]();;){var _ref2;if(_isArray2){if(_i2>=_iterator2.length)break;_ref2=_iterator2[_i2++]}else{if(_i2=_iterator2.next(),_i2.done)break;_ref2=_i2.value}var b=_ref2;if(n-2>=2*b.p.first&&n-2<2*b.p.last){block=b;break}}else block=this.rightCover;return block},Book.prototype.getBlockPages=function(block){var range=void 0;switch(block){case this.leftCover:range=[0,1];break;case this.rightCover:range=[2*(this.p.sheets+1),2*(this.p.sheets+1)+1];break;default:range=block?[2*(block.p.first+1),2*(block.p.last+1)-1]:void 0}return range},Book.prototype.getPage=function(){var PI=Math.PI,p=void 0;if(this.angle===PI/2||this.angle===3*PI/2){for(var _iterator3=this.sheetBlocks,_isArray3=Array.isArray(_iterator3),_i3=0,_iterator3=_isArray3?_iterator3:_iterator3[Symbol.iterator]();;){var _ref3;if(_isArray3){if(_i3>=_iterator3.length)break;_ref3=_iterator3[_i3++]}else{if(_i3=_iterator3.next(),_i3.done)break;_ref3=_i3.value}var block=_ref3;if(block.angle<=PI/2){p=this.getBlockPages(block)[0]-1;break}}p||(p=this.getPages()-3)}else this.angle3*PI/2?p=1:this.angle=PI&&(p=this.getPages()-1);return p},Book.prototype.getLeftFlipping=function(){var block=void 0,left=this.sheetBlocks[0],PI=Math.PI;return this.angle===PI?block=this.rightCover:left&&"closed"===left.state&&left.angle>PI/2?block=left:this.angle!==PI/2&&this.angle!==3*PI/2||(block=this.leftCover),block},Book.prototype.getRightFlipping=function(){var block=void 0,right=this.sheetBlocks[this.sheetBlocks.length-1],PI=Math.PI;return 0===this.angle?block=this.leftCover:right&&"closed"===right.state&&right.angle<=PI/2?block=right:this.angle!==PI/2&&this.angle!==3*PI/2||(block=this.rightCover),block},Book.prototype.getClosedBlockAngle=function(angle){var closedAngle=void 0,PI=Math.PI;if(this.leftCover.physicId){var test=void 0;try{test=Math.abs(this.sheetPhysics.getParametr(this.leftCover.physicId,"angle")-angle)}catch(e){test=0}closedAngle=angle>PI/2||test>PI/6?PI/2:this.closedAngle}else if(this.rightCover.physicId){var _test=void 0;try{_test=Math.abs(this.sheetPhysics.getParametr(this.rightCover.physicId,"angle")-angle)}catch(e){_test=0}closedAngle=anglePI/6?PI/2+1e-7:this.closedAngle}else closedAngle=PI/2+1e-7*(0!==angle);return{openedAngle:angle,closedAngle:closedAngle,binderTurn:this.closedAngle}},Book.prototype.flipLeft=function(){var _this2=this,size=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,progressClb=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.p.flipProgressClb,block=void 0,res=void 0;return this.sheetPhysics.getSize()<25&&!function(){var left=_this2.sheetBlocks[0],PI=Math.PI;_this2.angle===PI?res=_this2.connectPhysics(block=_this2.rightCover,_this2.p.cover.mass,PI,-_this2.p.cover.startVelocity,_this2.p.cover.flexibility,0,function(angle,height){return _this2.set(3*PI/2-angle/2,height)},function(angle,height){_this2.set(3*PI/2-angle/2,0),_this2.setSheetBlocks(angle?PI:PI/2+1e-7,"closed")},progressClb):left&&"closed"===left.state&&left.angle>PI/2?(block=sizePI/2&&_this2.setSheetBlocks(angle?PI/2:0,"closed")},function(angle,height){return _this2.set(0===angle?0:2*PI-angle/2,0)},progressClb))}(),res},Book.prototype.flipRight=function(){var _this3=this,size=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,progressClb=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.p.flipProgressClb,block=void 0,res=void 0;return this.sheetPhysics.getSize()<25&&!function(){var right=_this3.sheetBlocks[_this3.sheetBlocks.length-1],PI=Math.PI;0===_this3.angle?res=_this3.connectPhysics(block=_this3.leftCover,_this3.p.cover.mass,0,_this3.p.cover.startVelocity,_this3.p.cover.flexibility,0,function(angle,height){return _this3.set(angle/2,height)},function(angle,height){_this3.set(angle/2,0),_this3.setSheetBlocks(angle?PI/2:0,"closed")},progressClb):right&&"closed"===right.state&&right.angle<=PI/2?(block=size1&&void 0!==arguments[1]?arguments[1]:1;return i?this.flipLeft(size):this.flipRight(size)},Book.prototype.isTouchDevice=function(){return(this.visual.wnd.devicePixelRatio||1)>1},Book.prototype.cornerCallback=function(e,data){var _this4=this,_data$data=data.data,i=_data$data.i,n=_data$data.n;if("mouseover"!==e.type||this.isTouchDevice()){if(this.hoverInfo&&"mouseout"===e.type)void 0!==this.hoverInfo.pendings?--this.hoverInfo.pendings:n===this.hoverInfo.n&&this.clearHoverInfo();else if("mousedown"===e.type)this.cornerClickData={x:e.pageX,y:e.pageY};else if("click"===e.type){if(Math.sqrt(Math.pow(this.cornerClickData.x-e.pageX,2)+Math.pow(this.cornerClickData.y-e.pageY,2))<5){var hover=this.getBlockByPage(n);if(hover.physicId){var id=hover.physicId,props=hover.getProps();this.sheetPhysics.setParametr(id,"velocity",(i?-1:1)*props.startVelocity)}}delete this.cornerClickData}}else this.hoverInfo&&void 0!==this.hoverInfo.pendings?++this.hoverInfo.pendings:(this.hoverInfo&&(console.warn("Wrong state: element is already hover"),this.hoverInfo.n!==n&&this.clearHoverInfo()),this.hoverInfo||this.dragInfo||!function(){var res=Promise.resolve(void 0),hoverAngle=.02,hover=_this4.getBlockByPage(n),possible=_this4.getFlipping(i);if(n>1&&n<2*(_this4.p.sheets+1)&&hover.physicId&&(hover.angleMath.PI-hoverAngle))res=Promise.resolve(hover);else if(hover===possible){var sheetBlocks=[_this4.leftCover].concat(_this4.sheetBlocks,[_this4.rightCover]),j=sheetBlocks.indexOf(hover),nextBlock=~j?sheetBlocks[j+2*i-1]:void 0;(!nextBlock||!nextBlock.physicId||nextBlock.angle>hoverAngle&&nextBlock.angle=_iterator4.length)break;_ref4=_iterator4[_i4++]}else{if(_i4=_iterator4.next(),_i4.done)break;_ref4=_i4.value}var block=_ref4;this.removeSheetBlock(block)}},Book.prototype.setTexture=function(material,n){if(this.p.rtl){var pages=2*(this.p.sheets+2);n=pages-1-n}this.pageManager.setTexture(material,n)},Book.prototype.setPageTexture=function(material,n){this.setTexture(material,n+2)},Book.prototype.setLeftCoverTexture=function(material,n){this.setTexture(material,n)},Book.prototype.setRightCoverTexture=function(material,n){this.setTexture(material,n+2*(this.p.sheets+1))},Book.finishAnimationClb=function(angle){this.block.set(this.book.getClosedBlockAngle(angle).closedAngle,"closed",0);var i=this.book.sheetBlocks.indexOf(this.block);~i&&(0===angle?this.book.mergeSheetBlocks(i,this.book.sheetBlocks.length-i):this.book.mergeSheetBlocks(0,i+1))},Book.prototype.calcBlockForce=function(block,object,angle,velocity,cornerHeight){return block.force?block.force(object,angle,velocity,cornerHeight):0},Book.prototype.calcBlockCornerForce=function(block,object,angle,velocity,cornerHeight){return block.cornerForce?block.cornerForce(object,angle,velocity,cornerHeight):0},Book.prototype.notifyBeforeAnimation=function(){var res=void 0;return this.animationNotification?res=Promise.reject():(this.animationNotification=!0,res=this.layerManager.hide()),res},Book.prototype.notifyAfterAnimation=function(){this.animationNotification&&(delete this.animationNotification,this.layerManager.show())},Book.prototype.connectPhysics=function(block,mass,angle,velocity,flexibility,coverHeight,simulateClb,removeClb,progressClb){var _this6=this,type=function(){return _this6.hoverInfo?"hover":_this6.dragInfo?"drag":"free"; +},res=this.sheetPhysics.getSize()?Promise.resolve():this.notifyBeforeAnimation();return res.then(function(){return block.physicId=_this6.sheetPhysics.addObject(mass,angle,velocity,flexibility,coverHeight,function(angl,ch){simulateClb(angl,ch),progressClb(block,Math.abs(angle-angl)/Math.PI,"process",type())},function(angl,ch){removeClb(angl,ch),delete block.physicId,progressClb(block,Math.abs(angle-angl)/Math.PI,"finish",type()),Promise.resolve().then(function(){_this6.sheetPhysics.getSize()||_this6.notifyAfterAnimation()})},function(object,angle,velocity,cornerHeight){return _this6.calcBlockForce(block,object,angle,velocity,cornerHeight)},function(object,angle,velocity,cornerHeight){return _this6.calcBlockCornerForce(block,object,angle,velocity,cornerHeight)}),progressClb(block,0,"init",type()),block}).catch(function(){})},Book.prototype.update=function(dt){var _this7=this;this.lastMousePos.t+=dt,this.isProcessing&&void 0!==this.lastMousePos.pageX&&this.lastMousePos.t-(this.lastMousePos.lastT||0)>.25&&!this.hoverInfo&&!this.dragInfo&&(this.lastMousePos.lastT=this.lastMousePos.t,Promise.resolve().then(function(){(0,_libs.$)(_this7.visual.element).trigger(_libs.$.Event("mousemove",_this7.lastMousePos))})),this.sheetPhysics.simulate(dt)},Book.prototype.splitSheetBlock=function(i,leftSize){var block=this.sheetBlocks[i];if(block&&leftSize1&&void 0!==arguments[1]?arguments[1]:0;this.angle=angle;var PI=Math.PI;if(angle'),ctx=jC[0].getContext("2d");return ctx.beginPath(),ctx.fillStyle=_GraphUtils2.default.color2Rgba(color,1),ctx.rect(0,0,8,7),ctx.fill(),ctx.beginPath(),ctx.fillStyle=_GraphUtils2.default.color2Rgba(_GraphUtils2.default.inverseColor(color,.5),1),ctx.rect(0,7,8,1),ctx.fill(),jC[0]},Book.prepareProps=function(props){return Book.calcProps(Book.mergeProps((0,_book.props)(),props))},Book.mergeProps=function(first,second){return second=second||{},_extends({},first,second,{sheet:_extends({},first.sheet,second.sheet),cover:_extends({},first.cover,second.cover),page:_extends({},first.page,second.page)})},Book.calcProps=function(props){var p=_extends({},props,{sheet:_extends({},props.sheet),cover:_extends({},props.sheet,props.cover),page:_extends({},props.sheet,props.page)}),scale=10,height=scale*p.height,width=scale*p.width,flipProgressClb=function(){},sheet={sideTexture:p.sheet.sideTexture||Book.createSideTexture(p.sheet.color)},cover=_extends({},sheet,p.cover,{depth:scale*p.cover.depth,width:width,height:height,padding:scale*p.cover.padding}),page=_extends({},sheet,p.page,{depth:scale*p.page.depth,width:cover.width-cover.padding,height:cover.height-2*cover.padding}),marker={use:!1,color:16711680,size:.001*scale};return _extends({},p,{scale:scale,height:height,width:width,flipProgressClb:flipProgressClb,cover:cover,page:page,marker:marker})},Book}(_libs.THREE.EventDispatcher);exports.default=Book},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}exports.__esModule=!0;var _extends=Object.assign||function(target){for(var i=1;i1,stats:_this.actions.cmdStats.active,lighting:_this.p.lighting.default,activeSide:1},_this.boxs=[new _libs.THREE.Box3,new _libs.THREE.Box3],_this.bookWatcher=new _Object3DWatcher2.default(_this.visual,function(){return _this.state.singlePage?_this.state.activeSide?_this.boxs[0].setFromObject(book.rightCover.three):_this.boxs[0].setFromObject(book.leftCover.three):(_this.boxs[0].setFromObject(book.leftCover.three),_this.boxs[1].setFromObject(book.rightCover.three),_this.boxs[0].union(_this.boxs[1])),_this.boxs[0]}),_this.bookWatcher.scale=_this.p.scale.default,_this.Stats=new _stats2.default,_this.Stats.domElement.style.position="absolute",_this.Stats.domElement.style.top="0px",_this.visual.setExtraLighting(_this.state.lighting),_this.binds={onScreenModeChanged:_this.onScreenModeChanged.bind(_this),stats:_this.Stats.update.bind(_this.Stats),onUpdateView:_this.updateView.bind(_this)},_FullScreen2.default.addEventListener(_this.view.getParentContainer().ownerDocument,_this.binds.onScreenModeChanged),_this.cmdSmartPan(),_this.view.templateObject.appLoaded&&Promise.resolve().then(_this.view.templateObject.appLoaded),_this}return _inherits(BookController,_Controller),BookController.prototype.dispose=function(){_FullScreen2.default.removeEventListener(this.view.getParentContainer().ownerDocument,this.binds.onScreenModeChanged),delete this.book,delete this.view,delete this.visual},BookController.prototype.setTocCtrl=function(tocCtrl){this.tocCtrl=tocCtrl,this.tocCtrl.onChange=this.updateView.bind(this),this.updateView()},BookController.prototype.setPrinter=function(printer){this.printer=printer,this.updateView()},BookController.prototype.setSounds=function(sounds){this.sounds=sounds,sounds.setEnabled(this.actions.cmdSounds.active),this.updateView()},BookController.prototype.onScreenModeChanged=function(e){this.updateView()},BookController.prototype.canZoomIn=function(){return!this.state.smartPan||Math.abs(this.bookWatcher.scale-this.p.scale.max)>this.p.eps},BookController.prototype.canZoomOut=function(){return!this.state.smartPan||Math.abs(this.bookWatcher.scale-this.p.scale.min)>this.p.eps},BookController.prototype.canDefaultZoom=function(){return this.state.smartPan},BookController.prototype.cmdZoomIn=function(){this.state.smartPan?this.bookWatcher.scale=Math.min(this.p.scale.max,this.bookWatcher.scale+this.p.scale.delta):this.orbit.zoomIn(6.6*this.p.scale.delta/.32),this.updateView()},BookController.prototype.cmdZoomOut=function(){this.state.smartPan?this.bookWatcher.scale=Math.max(this.p.scale.min,this.bookWatcher.scale-this.p.scale.delta):this.orbit.zoomOut(6.6*this.p.scale.delta/.32),this.updateView()},BookController.prototype.cmdDefaultZoom=function(){this.state.smartPan&&(this.bookWatcher.scale=this.p.scale.default,this.updateView())},BookController.prototype.cmdToc=function(){this.tocCtrl&&this.tocCtrl.togle()},BookController.prototype.cmdFastBackward=function(){this.startFlip(this.book.flipLeft(5))},BookController.prototype.cmdBackward=function(){var _this2=this;this.state.singlePage?(this.state.activeSide=(this.getPage()+1)%2,this.state.activeSide?(this.state.activeSide=0,this.updateView()):this.startFlip(this.book.flipLeft(1)).then(function(block){block&&(_this2.state.activeSide=1)})):this.startFlip(this.book.flipLeft(1))},BookController.prototype.cmdForward=function(){var _this3=this;this.state.singlePage?(this.state.activeSide=(this.getPage()+1)%2,this.state.activeSide?this.startFlip(this.book.flipRight(1)).then(function(block){block&&(_this3.state.activeSide=0)}):(this.state.activeSide=1,this.updateView())):this.startFlip(this.book.flipRight(1))},BookController.prototype.cmdFastForward=function(){this.startFlip(this.book.flipRight(5))},BookController.prototype.cmdSave=function(){window.open(this.p.downloadURL,"_blank")},BookController.prototype.cmdPrint=function(){this.printer.print()},BookController.prototype.cmdFullScreen=function(){_FullScreen2.default.activated()?_FullScreen2.default.cancel():_FullScreen2.default.request(this.view.getParentContainer())},BookController.prototype.cmdSmartPan=function(){this.state.smartPan=!this.state.smartPan,this.state.smartPan?(this.orbit.minAzimuthAngle=0,this.orbit.maxAzimuthAngle=0,this.orbit.minPolarAngle=0,this.orbit.maxPolarAngle=Math.PI/4,this.bookWatcher.enabled=!0):(this.orbit.minAzimuthAngle=-(1/0),this.orbit.maxAzimuthAngle=1/0,this.orbit.minPolarAngle=0,this.orbit.maxPolarAngle=Math.PI,this.bookWatcher.enabled=!1),this.updateView()},BookController.prototype.cmdSinglePage=function(){this.state.singlePage=!this.state.singlePage,this.updateView()},BookController.prototype.cmdSounds=function(){this.sounds&&this.sounds.togle(),this.updateView()},BookController.prototype.cmdStats=function(){this.state.stats=!this.state.stats,this.state.stats?((0,_libs.$)(this.view.getContainer()).append(this.Stats.domElement),this.visual.addRenderCallback(this.binds.stats)):((0,_libs.$)(this.view.getContainer()).find(this.Stats.domElement).remove(),this.visual.removeRenderCallback(this.binds.stats)),this.updateView()},BookController.prototype.cmdLightingUp=function(){this.state.lighting=Math.min(this.state.lighting+this.p.lighting.delta,this.p.lighting.max),this.visual.setExtraLighting(this.state.lighting),this.updateView()},BookController.prototype.cmdLightingDown=function(){this.state.lighting=Math.max(this.state.lighting-this.p.lighting.delta,this.p.lighting.min),this.visual.setExtraLighting(this.state.lighting),this.updateView()},BookController.prototype.goToPage=function(page){var _this4=this;this.p.rtl&&(page=this.book.getPages()-1-page);var pageNum=Math.max(Math.min(page,this.book.getPages()-1),0);this.state.activeSide=(pageNum+1)%2;var target=Math.max(Math.min(page-1+page%2,this.book.getPages()-1),0),current=this.book.getPage(),flips=[],covs=0;if(target!=current){0===current?(flips.push(1),current+=1,++covs):current===this.book.getPages()-1&&(flips.push(-1),current-=2,++covs);var cv=0;0===target?(cv=-1,target+=1,++covs):target===this.book.getPages()-1&&(cv=1,target-=2,++covs),target-current&&flips.push(Math.ceil((target-current)/2)),cv&&flips.push(cv)}var setClb=function(fl,time,clb){setTimeout(function(){fl<0?_this4.startFlip(_this4.book.flipLeft(-fl,clb)):_this4.startFlip(_this4.book.flipRight(fl,clb))},time)};if(2===covs)setClb(flips[0],0,function(block,progress,state){"finish"==state&&1==progress&&setClb(flips[flips.length-1],0)}),setClb(flips[1],500);else for(var time=0,_iterator=flips,_isArray=Array.isArray(_iterator),_i=0,_iterator=_isArray?_iterator:_iterator[Symbol.iterator]();;){var _ref;if(_isArray){if(_i>=_iterator.length)break;_ref=_iterator[_i++]}else{if(_i=_iterator.next(),_i.done)break;_ref=_i.value}var fl=_ref;setClb(fl,time),time+=250}},BookController.prototype.startFlip=function(flipRes){var _this5=this;return flipRes?flipRes.then(function(block){return block&&_this5.dispatchAsync({type:"startFlip"}),block}):Promise.resolve(void 0)},BookController.prototype.endFlip=function(block){return this.dispatchAsync({type:"endFlip"}),block},BookController.prototype.getPage=function(){var page=this.book.getPage();return page?Math.min(this.book.getPage()+this.state.activeSide,this.book.getPages()-1):0},BookController.prototype.getPageForGUI=function(){var n=(this.state.singlePage?this.getPage():this.book.getPage())+1;return this.p.rtl&&(n=this.book.getPages()-n+1),n},BookController.prototype.inpPage=function(e,data){this.goToPage(data-1)},BookController.prototype.updateViewIfState=function(block,progress,state,type){"init"!==state&&"finish"!==state||setTimeout(this.updateView.bind(this),100),"finish"===state&&this.endFlip(block)},BookController.prototype.updateView=function(){if(this.view){this.view.setState("cmdZoomIn",{enable:this.canZoomIn(),visible:this.actions.cmdZoomIn.enabled,active:!1}),this.view.setState("cmdZoomOut",{enable:this.canZoomOut(),visible:this.actions.cmdZoomOut.enabled,active:!1}),this.view.setState("cmdDefaultZoom",{enable:this.canDefaultZoom(),visible:this.actions.cmdDefaultZoom.enabled,active:this.canDefaultZoom()&&Math.abs(this.bookWatcher.scale-this.p.scale.default)=_iterator2.length)break;_ref2=_iterator2[_i2++]}else{if(_i2=_iterator2.next(),_i2.done)break;_ref2=_i2.value}var name=_ref2;this.view.setState(name,{enable:flippersEnable[name],visible:this.actions[name].enabled,active:!1})}this.view.setState("inpPages",{visible:!0,value:this.book.getPages()}),this.view.setState("inpPage",{visible:!0,enable:!this.book.isProcessing(),value:this.getPageForGUI()}),this.view.setState("cmdSave",{enable:!0,visible:this.actions.cmdSave.enabled&&!!this.p.downloadURL,active:!1}),this.view.setState("cmdPrint",{enable:!0,visible:this.actions.cmdPrint.enabled&&!!this.printer,active:!1}),this.view.setState("cmdFullScreen",{enable:_FullScreen2.default.available(),visible:this.actions.cmdFullScreen.enabled,active:_FullScreen2.default.available()&&_FullScreen2.default.activated()}),this.view.setState("widSettings",{enable:!0,visible:this.actions.widSettings.enabled,active:!1}),this.view.setState("cmdSmartPan",{enable:!0,visible:this.actions.cmdSmartPan.enabled,active:this.state.smartPan}),this.view.setState("cmdSinglePage",{enable:!0,visible:this.actions.cmdSinglePage.enabled,active:this.state.singlePage}),this.view.setState("cmdSounds",{enable:!0,visible:this.actions.cmdSounds.enabled&&!!this.sounds,active:!!this.sounds&&this.sounds.enabled}),this.view.setState("cmdStats",{enable:!0,visible:this.actions.cmdStats.enabled,active:this.state.stats}),this.view.setState("cmdLightingUp",{enable:Math.abs(this.state.lighting-this.p.lighting.max)>this.p.eps,visible:this.actions.cmdLightingUp.enabled,active:!1}),this.view.setState("cmdLightingDown",{enable:Math.abs(this.state.lighting-this.p.lighting.min)>this.p.eps,visible:this.actions.cmdLightingDown.enabled,active:!1})}},BookController.prototype.getActions=function(){var _this6=this,isSwipping=function(name){return _this6.actions.touchCmdSwipe.enabled&&_this6.actions.touchCmdSwipe.code===_this6.actions[name].code&&_this6.state.smartPan&&_this6.bookWatcher.scale<=1};return{cmdZoomIn:{activate:this.cmdZoomIn.bind(this)},cmdZoomOut:{activate:this.cmdZoomOut.bind(this)},cmdDefaultZoom:{activate:this.cmdDefaultZoom.bind(this)},cmdToc:{activate:this.cmdToc.bind(this)},cmdFastBackward:{activate:this.cmdFastBackward.bind(this)},cmdBackward:{activate:this.cmdBackward.bind(this)},cmdForward:{activate:this.cmdForward.bind(this)},cmdFastForward:{activate:this.cmdFastForward.bind(this)},cmdSave:{activate:this.cmdSave.bind(this)},cmdPrint:{activate:this.cmdPrint.bind(this)},cmdFullScreen:{activate:this.cmdFullScreen.bind(this)},cmdSmartPan:{activate:this.cmdSmartPan.bind(this)},cmdSinglePage:{activate:this.cmdSinglePage.bind(this)},cmdSounds:{activate:this.cmdSounds.bind(this)},cmdStats:{activate:this.cmdStats.bind(this)},cmdLightingUp:{activate:this.cmdLightingUp.bind(this)},cmdLightingDown:{activate:this.cmdLightingDown.bind(this)},cmdPanLeft:{activate:function(e){return _this6.orbit.actions.pan(e,{state:"move",dx:-_this6.p.pan.speed,dy:0})}},cmdPanRight:{activate:function(e){return _this6.orbit.actions.pan(e,{state:"move",dx:_this6.p.pan.speed,dy:0})}},cmdPanUp:{activate:function(e){return _this6.orbit.actions.pan(e,{state:"move",dx:0,dy:-_this6.p.pan.speed})}},cmdPanDown:{activate:function(e){return _this6.orbit.actions.pan(e,{state:"move",dx:0,dy:_this6.p.pan.speed})}},mouseCmdRotate:{activate:this.orbit.actions.rotate},mouseCmdDragZoom:{activate:function(e,data){data.dy>0?_this6.cmdZoomOut():data.dy<0&&_this6.cmdZoomIn()}},mouseCmdPan:{activate:this.orbit.actions.pan},mouseCmdWheelZoom:{activate:function(e){e.preventDefault(),e.deltaY<0?_this6.cmdZoomOut():e.deltaY>0&&_this6.cmdZoomIn()}},touchCmdRotate:{activate:function(e,data){isSwipping("touchCmdRotate")||(e.preventDefault(),_this6.orbit.actions.rotate(e,data))}},touchCmdZoom:{activate:function(e,data){isSwipping("touchCmdZoom")||(e.preventDefault(),data.dy>0?_this6.cmdZoomOut():data.dy<0&&_this6.cmdZoomIn())}},touchCmdPan:{activate:function(e,data){isSwipping("touchCmdPan")||(e.preventDefault(),_this6.orbit.actions.pan(e,data))}},touchCmdSwipe:{activate:function(e,data){if(isSwipping("touchCmdSwipe"))if(e.preventDefault(),"start"===data.state){var touch=(e.touches||e.originalEvent.touches)[_this6.actions.touchCmdSwipe.code-1];_this6.swipeData={handled:!1,x0:touch.pageX,y0:touch.pageY,x:touch.pageX,y:touch.pageY}}else"move"===data.state?_this6.swipeData.handled||(_this6.swipeData=_extends({},_this6.swipeData,{x:_this6.swipeData.x+data.dx,y:_this6.swipeData.y+data.dy}),Math.abs(_this6.swipeData.x0-_this6.swipeData.x)>100&&(_this6.swipeData.x0>_this6.swipeData.x?_this6.cmdForward():_this6.cmdBackward(),_this6.swipeData.handled=!0)):delete _this6.swipeData}},widSettings:{activate:function(){}}}},BookController.prototype.bindActions=function(){this.eToA=new _EventsToActions2.default((0,_libs.$)(this.visual.element)),this.eToA.addAction(function(e){return e.preventDefault()},"contextmenu",_EventsToActions2.default.mouseButtons.Right,0),this.actions=this.getActions();for(var _iterator3=Object.keys(this.actions),_isArray3=Array.isArray(_iterator3),_i3=0,_iterator3=_isArray3?_iterator3:_iterator3[Symbol.iterator]();;){var _ref3;if(_isArray3){if(_i3>=_iterator3.length)break;_ref3=_iterator3[_i3++]}else{if(_i3=_iterator3.next(),_i3.done)break;_ref3=_i3.value}var name=_ref3,action=_extends({},this.actions[name],this.p.actions[name]);if(this.actions[name]=action,action.enabled){var flags=action.flags||0;action.type?this.eToA.addAction(action.activate,action.type,action.code,flags):void 0!==action.code&&this.eToA.addAction(action.activate,"keydown",action.code,flags)}}},BookController.prepareProps=function(props){return BookController.calcProps(BookController.mergeProps((0,_bookController.props)(),props))},BookController.setActions=function(props,actions){for(var _iterator4=Object.keys(actions||{}),_isArray4=Array.isArray(_iterator4),_i4=0,_iterator4=_isArray4?_iterator4:_iterator4[Symbol.iterator]();;){var _ref4;if(_isArray4){if(_i4>=_iterator4.length)break;_ref4=_iterator4[_i4++]}else{if(_i4=_iterator4.next(),_i4.done)break;_ref4=_i4.value}var name=_ref4;props.actions[name]=_extends({},props.actions[name],actions[name])}},BookController.mergeProps=function(first,second){second=second||{};var props=_extends({},first,second,{scale:_extends({},first.scale,second.scale),lighting:_extends({},first.lighting,second.lighting),pan:_extends({},first.pan,second.pan),actions:_extends({},first.actions)});return BookController.setActions(props,first.actions),BookController.setActions(props,second.actions),props},BookController.calcProps=function(props){return props.scale.delta=(props.scale.max-props.scale.min)/props.scale.levels,props.lighting.delta=(props.lighting.max-props.lighting.min)/props.lighting.levels,props},BookController}(_Controller3.default);exports.default=BookController},function(module,exports,__webpack_require__){"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}exports.__esModule=!0;var _libs=__webpack_require__(1),BookPrinter=function(){function BookPrinter(context,book,styleSheet){_classCallCheck(this,BookPrinter),this.book=book,this.styleSheet=styleSheet,this.wnd=context.wnd,this.doc=context.doc,this.pageCallback=book.getPageCallback();var test=this.pageCallback(0);this.type=test.type,"pdf"===this.type&&(this.pdfSrc=test.src.src)}return BookPrinter.prototype.cancel=function(){this.canceled=!0},BookPrinter.prototype.dispose=function(){this.frame&&(this.frame.remove(),delete this.frame)},BookPrinter.prototype.print=function(){var _this=this;delete this.canceled,"pdf"===this.type?!function(){var printWnd=void 0,callManually=!1;_this.useIFrame()?(callManually=!!_this.frame,_this.frame||(_this.frame=(0,_libs.$)('').appendTo(_this.doc.body)),printWnd=_this.frame[0].contentWindow):printWnd=_this.wnd.open(_this.pdfSrc),callManually?printWnd.print():(0,_libs.$)(printWnd).on("load",function(){try{printWnd.print()}catch(e){console.error(e)}})}():this.renderContent().then(function(content){var printWnd=_this.wnd.open(),printDoc=printWnd.document,html='\n \n \n \n \n 3D FlipBook - Printing\n '+content.head+'\n \n \n \n '+content.body+"\n \n \n ";printDoc.open(),printDoc.write(html),printDoc.close()}).catch(function(e){return console.warn("3D FlipBook - Printing was canceled")})},BookPrinter.prototype.progress=function(v){if(this.canceled)throw"Cancel Printing";this.onProgress&&this.onProgress(Math.floor(100*v))},BookPrinter.prototype.renderContent=function(){for(var _this2=this,pages=this.book.getPages(),head=new Set,body=[],done=Promise.resolve(),_loop=function(page){var info=_this2.pageCallback(page);"image"===info.type?done=done.then(function(){return _this2.progress(page/pages),_this2.renderImage(head,body,info.src)}):"html"===info.type&&(done=done.then(function(){return _this2.progress(page/pages),_this2.renderHtml(head,body,info.src)}))},page=0;page'+content+""},BookPrinter.prototype.renderImage=function(head,body,src){body.push(BookPrinter.wrap(''))},BookPrinter.prototype.renderHtml=function(head,body,src){return new Promise(function(resolve,reject){_libs.$.get(src,function(html){for(var links=html.match(//gi)||[],_iterator=links,_isArray=Array.isArray(_iterator),_i=0,_iterator=_isArray?_iterator:_iterator[Symbol.iterator]();;){var _ref;if(_isArray){if(_i>=_iterator.length)break;_ref=_iterator[_i++]}else{if(_i=_iterator.next(),_i.done)break;_ref=_i.value}var link=_ref;if(link.match(/stylesheet/i)){var href=link.match(/href\s*=\s*['"](.*)['"]/i);href&&head.add(href[1])}}var content=html.match(/([\S\s]*)<\/body>/i);content&&body.push(BookPrinter.wrap(content[1])),resolve()}).fail(function(e){console.error(e.responseText),reject()})})},BookPrinter.prototype.renderHead=function(head){var content=[];return head.forEach(function(k){return content.push('')}),content.push(this.styleSheet?'':BookPrinter.defaultStyleSheet()),content.join("\n")},BookPrinter.prototype.useIFrame=function(){var isChromium=this.wnd.chrome,winNav=this.wnd.navigator,vendorName=winNav.vendor,isIEedge=winNav.userAgent.indexOf("Edge")>-1,isIOSChrome=winNav.userAgent.match("CriOS"),use=void 0;return use=!!isIOSChrome||!(!isChromium||"Google Inc."!==vendorName||isIEedge)},BookPrinter.defaultStyleSheet=function(){return'\n \n '},BookPrinter}();exports.default=BookPrinter},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}exports.__esModule=!0;var _View2=(__webpack_require__(1),__webpack_require__(65)),_View3=_interopRequireDefault(_View2),BookView=function(_View){function BookView(container,onLoad,template,handler){return _classCallCheck(this,BookView),_possibleConstructorReturn(this,_View.call(this,container,onLoad,template,handler))}return _inherits(BookView,_View),BookView.prototype.initView=function(){this.view=this.container.find(".view"),this.bookmarksView=this.container.find(".widBookmarks"),this.thumbnailsView=this.container.find(".widThumbnails"),this.searchView=this.container.find(".widSearch")},BookView.prototype.getHandlers=function(id){var _this2=this,handlers=void 0;return handlers="inpPage"===id?[{inpPage:function(e,data){return _this2.callLater(_View.prototype.getHandlers.call(_this2,id),id,e,data,BookView.PAGE_HANDLER_DELAY)}}]:_View.prototype.getHandlers.call(this,id)},BookView.prototype.onItemStateChanged=function(id,state){"cmdFullScreen"===id&&(state.active?this.parentContainer.addClass("fullscreen"):this.parentContainer.removeClass("fullscreen"))},BookView.prototype.getView=function(){return this.view},BookView.prototype.getBookmarksView=function(){return this.bookmarksView},BookView.prototype.getThumbnailsView=function(){return this.thumbnailsView},BookView.prototype.getSearchView=function(){return this.searchView},BookView.prototype.getForms=function(){return[]},BookView.prototype.getLinks=function(){return["cmdZoomIn","cmdZoomOut","cmdDefaultZoom","cmdToc","cmdFastBackward","cmdBackward","cmdForward","cmdFastForward","cmdSave","cmdPrint","cmdFullScreen","cmdSmartPan","cmdSinglePage","cmdSounds","cmdStats","cmdLightingUp","cmdLightingDown","cmdCloseToc","cmdBookmarks","cmdSearch","cmdThumbnails"]},BookView.prototype.getWidgets=function(){return["widLoadingProgress","widFloatWnd","widTocMenu","widBookmarks","widThumbnails","widSearch","widSettings"]},BookView.prototype.getInputs=function(){return["inpPage","inpPages"]},BookView.prototype.getTexts=function(){return["txtLoadingProgress"]},BookView.prototype.getTemplate=function(){return{html:"templates/default-book-view.html",styles:["css/black-book-view.css"],links:[{rel:"stylesheet",href:"css/font-awesome.min.css"}],script:"js/default-book-view.js"}},BookView}(_View3.default);BookView.PAGE_HANDLER_DELAY=1e3,exports.default=BookView},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass); +subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}exports.__esModule=!0;var _BookPropsBuilder2=__webpack_require__(9),_BookPropsBuilder3=_interopRequireDefault(_BookPropsBuilder2),_ImageFactory=__webpack_require__(8),_ImageFactory2=_interopRequireDefault(_ImageFactory),ClbBookPropsBuilder=function(_BookPropsBuilder){function ClbBookPropsBuilder(context,pageCallback,pages,onReady){_classCallCheck(this,ClbBookPropsBuilder);var _this=_possibleConstructorReturn(this,_BookPropsBuilder.call(this,onReady));return _this.calcSheets(pages),_this.pageCallback=pageCallback,_this.binds={pageCallback:pageCallback.bind(_this)},_this.imageFactory=new _ImageFactory2.default(context),pages>0?!function(){var test=_this.imageFactory.build(pageCallback(0),0,_this.defaults.sheet.widthTexels,_this.defaults.sheet.heightTexels,_this.defaults.sheet.color);test.onLoad=function(){_this.calcProps(test.width,test.height),test.dispose(),_this.ready()}}():(_this.props=_this.defaults,_this.ready()),_this}return _inherits(ClbBookPropsBuilder,_BookPropsBuilder),ClbBookPropsBuilder}(_BookPropsBuilder3.default);exports.default=ClbBookPropsBuilder},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}exports.__esModule=!0;var _extends=Object.assign||function(target){for(var i=1;i=_iterator.length)break;_ref=_iterator[_i++]}else{if(_i=_iterator.next(),_i.done)break;_ref=_i.value}var w=_ref;w.layers.forEach(function(l){return l.dispose()})}delete this.wrappers},CssLayersManager.prototype.show=function(){var _this=this;this.hidden=!1;for(var _loop=function(){if(_isArray2){if(_i2>=_iterator2.length)return"break";_ref2=_iterator2[_i2++]}else{if(_i2=_iterator2.next(),_i2.done)return"break";_ref2=_i2.value}var n=_ref2,w=_this.wrappers[n];w?"ready"===w.state&&w.layers.length&&!function(){var block=_this.book.getBlockByPage(n);w.layers.forEach(function(l){l.isHidden()&&(l.update(block),l.show())})}():!function(){var w=_this.wrappers[n]={state:"loading",layers:[]};Promise.resolve().then(function(){_this.pageManager.getLayers(n,function(layers){if(layers.length&&_this.wrappers){for(var block=_this.book.getBlockByPage(n),_iterator3=layers,_isArray3=Array.isArray(_iterator3),_i3=0,_iterator3=_isArray3?_iterator3:_iterator3[Symbol.iterator]();;){var _ref3;if(_isArray3){if(_i3>=_iterator3.length)break;_ref3=_iterator3[_i3++]}else{if(_i3=_iterator3.next(),_i3.done)break;_ref3=_i3.value}var l=_ref3,sl=new _SheetCssLayer2.default(_this.visual,block);w.layers.push(sl),sl.set(l.css,l.html,l.js)}setTimeout(function(){!_this.hidden&&~_this.getActives().indexOf(n)&&w.layers.forEach(function(l){return l.show()})},10)}w.state="ready"})})}()},_iterator2=this.getActives(),_isArray2=Array.isArray(_iterator2),_i2=0,_iterator2=_isArray2?_iterator2:_iterator2[Symbol.iterator]();;){var _ref2,_ret=_loop();if("break"===_ret)break}},CssLayersManager.prototype.hide=function(){this.hidden=!0;for(var wait=[],_iterator4=Object.values(this.wrappers),_isArray4=Array.isArray(_iterator4),_i4=0,_iterator4=_isArray4?_iterator4:_iterator4[Symbol.iterator]();;){var _ref4;if(_isArray4){if(_i4>=_iterator4.length)break;_ref4=_iterator4[_i4++]}else{if(_i4=_iterator4.next(),_i4.done)break;_ref4=_i4.value}var _w=_ref4;_w.layers.forEach(function(l){return wait.push(l.hide())})}return Promise.all(wait)},CssLayersManager}();exports.default=CssLayersManager},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}exports.__esModule=!0;var _extends=Object.assign||function(target){for(var i=1;i")[0],this.imageFactory=new _ImageFactory2.default(_extends({},visual,{dispatchEvent:book.dispatchEvent.bind(book),renderCanvas:this.canvas,renderCanvasCtx:this.canvas.getContext("2d")}),this.resourcesCache),this.loadings=[],this.renderQueue=[],this.pageRequests=[],this.predictedRequests=[],this.tmpMaterial=new _libs.THREE.MeshBasicMaterial,visual.addObject(new _libs.THREE.Mesh(new _libs.THREE.PlaneGeometry(0,0),this.tmpMaterial)),this.loading={},this.loading[p.cover.color]=this.createLoadingTexture(p.cover),p.page.color!==p.cover.color&&(this.loading[p.page.color]=this.createLoadingTexture(p.page)),this.turnOnEvents(),visual.addRenderCallback(this.update.bind(this)),setInterval(this.updateRenderQueue.bind(this),250)}return PageManager.prototype.createLoadingTexture=function(p){var spriteTiles=6,scale=Math.sqrt(1262992.5/(p.widthTexels*p.heightTexels)),animation=new _LoadingAnimation2.default(scale*p.widthTexels,scale*p.heightTexels,p.color),animator=new _TextureAnimator2.default(animation.createSprite(spriteTiles),spriteTiles,1,spriteTiles,.2);return animation.dispose(),animator},PageManager.prototype.dispose=function(){this.turnOffEvents();for(var _iterator=Object.keys(this.loading),_isArray=Array.isArray(_iterator),_i=0,_iterator=_isArray?_iterator:_iterator[Symbol.iterator]();;){var _ref;if(_isArray){if(_i>=_iterator.length)break;_ref=_iterator[_i++]}else{if(_i=_iterator.next(),_i.done)break;_ref=_i.value}var color=_ref;this.loading[color].dispose()}delete this.loading,this.resourcesCache.dispose(),this.pageCache.dispose(),this.canvas.height=this.canvas.width=0,delete this.canvas},PageManager.prototype.isCover=function(n){return n<2||n>=2*(this.p.sheets+1)},PageManager.prototype.isMobile=function(){return(this.visual.wnd.devicePixelRatio||1)>1},PageManager.prototype.update=function(dt){for(var loading={},_iterator2=this.loadings,_isArray2=Array.isArray(_iterator2),_i2=0,_iterator2=_isArray2?_iterator2:_iterator2[Symbol.iterator]();;){var _ref2;if(_isArray2){if(_i2>=_iterator2.length)break;_ref2=_iterator2[_i2++]}else{if(_i2=_iterator2.next(),_i2.done)break;_ref2=_i2.value}var o=_ref2;o.isActive()&&(loading[o.color]=!0)}for(var _iterator3=Object.keys(loading),_isArray3=Array.isArray(_iterator3),_i3=0,_iterator3=_isArray3?_iterator3:_iterator3[Symbol.iterator]();;){var _ref3;if(_isArray3){if(_i3>=_iterator3.length)break;_ref3=_iterator3[_i3++]}else{if(_i3=_iterator3.next(),_i3.done)break;_ref3=_i3.value}var color=_ref3;this.loading[color].update(dt)}},PageManager.prototype.removeFromLoadings=function(o){var i=this.loadings.indexOf(o);~i&&this.loadings.splice(i,1)},PageManager.prototype.removeFromRenderQueue=function(o){var i=this.renderQueue.indexOf(o);~i&&this.renderQueue.splice(i,1)},PageManager.prototype.refreshPageQuery=function(n){var query=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";this.pageQuery=query;var object=this.pageCache.get(n);object&&object.wrapper&&object.wrapper.setQuery&&(this.pageCache.remove(n)||object.wrapper.setQuery(query))},PageManager.prototype.getLayers=function(n,clb){var _this=this;this.p.cssLayersLoader?this.p.cssLayersLoader(n,function(){for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];var object=_this.pageCache.get(n);object&&("active"!==object.state?object.pendings.push({clb:clb,args:args}):clb.apply(void 0,args))}):clb([])},PageManager.prototype.resolvePendings=function(pendings){for(var _iterator4=pendings,_isArray4=Array.isArray(_iterator4),_i4=0,_iterator4=_isArray4?_iterator4:_iterator4[Symbol.iterator]();;){var _ref4;if(_isArray4){if(_i4>=_iterator4.length)break;_ref4=_iterator4[_i4++]}else{if(_i4=_iterator4.next(),_i4.done)break;_ref4=_i4.value}var p=_ref4;try{p.clb.apply(p,p.args)}catch(e){console.error(e)}}pendings.splice(0,pendings.length)},PageManager.prototype.load=function(material,n){var _this2=this,pi=this.p.pageCallback(n),p=this.isCover(n)?this.p.cover:this.p.page,o={texture:new _libs.THREE.Texture,wrapper:null,state:"loading",locked:function(n){return"loading"===o.state||"rendering"===o.state||_this2.book.isActivePage(n)},color:p.color,isActive:function(){return _this2.book.isActivePage(n)},dispose:function(){_this2.removeFromLoadings(o),_this2.removeFromRenderQueue(o),o.wrapper&&o.wrapper.dispose&&o.wrapper.dispose(),o.texture.dispose(),delete o.texture,delete o.wrapper},pendings:[]};return o.texture.minFilter=_libs.THREE.LinearFilter,this.loadings.push(o),this.setMaterial(o,material),Promise.resolve().then(function(){if(o.texture){var widthTexels=pi.widthTexels||p.widthTexels,heightTexels=pi.heightTexels||p.heightTexels;o.wrapper=_this2.imageFactory.build(pi,void 0===pi.number?n:pi.number,widthTexels,heightTexels,p.color,_this2.p.injector),o.wrapper.setQuery&&o.wrapper.setQuery(_this2.pageQuery),o.simulate=pi.interactive?(o.wrapper.simulate||function(){}).bind(o.wrapper):void 0,o.wrapper.onLoad=function(){"queuedForRender"!==o.state&&(o.state="queuedForRender",_this2.renderQueue.push(o),_this2.updateRenderQueue())},o.wrapper.onChange=function(image){o.texture&&(_this2.removeFromLoadings(o),o.material&&(o.material.map=o.texture,o.material.needsUpdate=!0),o.texture.image=image,o.texture.needsUpdate=!0,o.texture.onUpdate=function(){"queuedForRender"!==o.state&&(o.state="active",_this2.resolvePendings(o.pendings)),delete _this2.rendering,_this2.updateRenderQueue()},_this2.tmpMaterial.map=o.texture,_this2.tmpMaterial.needsUpdate=!0)}}}),this.pageCache.put(n,o)},PageManager.prototype.updateRenderQueue=function(){var p=this.book.p;if(!this.rendering&&(p.renderWhileFlipping||!this.book.isProcessing())){for(var _iterator5=this.renderQueue,_isArray5=Array.isArray(_iterator5),_i5=0,_iterator5=_isArray5?_iterator5:_iterator5[Symbol.iterator]();;){var _ref5;if(_isArray5){if(_i5>=_iterator5.length)break;_ref5=_iterator5[_i5++]}else{if(_i5=_iterator5.next(),_i5.done)break;_ref5=_i5.value}var o=_ref5;if(o.isActive()){this.rendering=o;break}}(this.isMobile()&&p.renderInactivePagesOnMobile||!this.isMobile()&&p.renderInactivePages)&&(this.rendering=this.rendering||this.renderQueue[0]),this.rendering&&(this.removeFromRenderQueue(this.rendering),this.rendering.state="rendering",this.rendering.wrapper.startRender())}},PageManager.prototype.turnOnEvents=function(){this.transferEvents=!0},PageManager.prototype.turnOffEvents=function(){var mouseup=_libs.$.Event("mouseup"),mouseout=_libs.$.Event("mouseout");this.pageCache.forEach(function(ent){var object=ent[1];object.simulate&&(object.simulate(mouseup,void 0,0,0),object.simulate(mouseout,void 0,0,0))}),this.transferEvents=!1},PageManager.prototype.transferEventToTexture=function(n,e,data){var _this3=this;if(this.transferEvents){var toObject=this.getOrLoadTextureObject(void 0,n);toObject.wrapper&&!function(){var uv=data.uv,toDoc=toObject.wrapper.getSimulatedDoc();_this3.pageCache.forEach(function(ent){var object=ent[1];object.simulate&&object.simulate(e,toDoc,uv.x,uv.y)})}()}},PageManager.prototype.loadPredictedPages=function(){this.predictedRequests=_BaseMathUtils2.default.predict(this.pageRequests,this.p.preloadPages);for(var _iterator6=this.predictedRequests,_isArray6=Array.isArray(_iterator6),_i6=0,_iterator6=_isArray6?_iterator6:_iterator6[Symbol.iterator]();;){var _ref6;if(_isArray6){if(_i6>=_iterator6.length)break;_ref6=_iterator6[_i6++]}else{if(_i6=_iterator6.next(),_i6.done)break;_ref6=_i6.value}var p=_ref6;pthis.p.pagesForPredicting&&this.pageRequests.shift(),Promise.resolve().then(this.loadPredictedPages.bind(this))},PageManager.prototype.setMaterial=function(o,material){this.pageCache.forEach(function(e){var ob=e[1];o!==ob&&ob.material===material&&delete ob.material}),material&&material!==o.material&&(o.material=material,material.map=o.texture.image?o.texture:this.loading[o.color].texture,material.needsUpdate=!0)},PageManager.prototype.getOrLoadTextureObject=function(material,n){var object=this.pageCache.get(n);return object?this.setMaterial(object,material):(object=this.load(material,n),this.addPageRequest(n)),object},PageManager.prototype.setTexture=function(material,n){~this.predictedRequests.indexOf(n)&&this.addPageRequest(n),this.getOrLoadTextureObject(material,n)},PageManager}();exports.default=PageManager},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}exports.__esModule=!0;var _BookPropsBuilder2=__webpack_require__(9),_BookPropsBuilder3=_interopRequireDefault(_BookPropsBuilder2),_Pdf=__webpack_require__(18),_Pdf2=_interopRequireDefault(_Pdf),PdfBookPropsBuilder=function(_BookPropsBuilder){function PdfBookPropsBuilder(src,onReady){_classCallCheck(this,PdfBookPropsBuilder);var _this=_possibleConstructorReturn(this,_BookPropsBuilder.call(this,onReady));return _this.pdf=new _Pdf2.default(src),_this.pageDescription={type:"pdf",src:_this.pdf,interactive:!0},_this.binds={pageCallback:_this.pageCallback.bind(_this)},_this.pdf.getHandler(_this.init.bind(_this)),_this}return _inherits(PdfBookPropsBuilder,_BookPropsBuilder),PdfBookPropsBuilder.prototype.dispose=function(){this.pdf.dispose(),_BookPropsBuilder.prototype.dispose.call(this)},PdfBookPropsBuilder.prototype.init=function(handler){var _this2=this;this.calcSheets(this.pdf.getPagesNum()),this.pdf.getPagesNum()>0?handler.getPage(1).then(function(page){var size=_Pdf2.default.getPageSize(page);_this2.calcProps(size.width,size.height),_this2.ready()}).catch(function(e){console.error(e)}):(this.props=this.defaults,this.ready())},PdfBookPropsBuilder.prototype.pageCallback=function(n){return this.pageDescription},PdfBookPropsBuilder}(_BookPropsBuilder3.default);exports.default=PdfBookPropsBuilder},function(module,exports,__webpack_require__){"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}exports.__esModule=!0;var _libs=__webpack_require__(1),PdfLinksHandler=function(){function PdfLinksHandler(pdf,ctrl,element){_classCallCheck(this,PdfLinksHandler),this.pdf=pdf,this.ctrl=ctrl,this.element=(0,_libs.$)(element),this.cursors=[]}return PdfLinksHandler.prototype.dispose=function(){},PdfLinksHandler.prototype.setHandler=function(handler){this.handler=handler},PdfLinksHandler.prototype.defaultHandler=function(type,destination){"internal"===type?this.ctrl.goToPage(destination):"external"===type&&window.open(destination,"_blank")},PdfLinksHandler.prototype.callHandlers=function(type,destination){this.handler&&this.handler(type,destination)||this.defaultHandler(type,destination)},PdfLinksHandler.prototype.handleEvent=function(data){var _this=this,e=data.event,anno=data.annotation;switch(e.type){case"mouseover":this.cursors.push(this.element.css("cursor")),this.element.css("cursor","pointer");break;case"mouseout":this.element.css("cursor",this.cursors.pop()||"");break;case"touchtap":case"click":if(anno.url)this.callHandlers("external",anno.url);else if(anno.dest){var destPromise=void 0;destPromise="string"==typeof anno.dest?this.pdf.handler.getDestination(anno.dest):Promise.resolve(anno.dest),destPromise.then(function(dest){return"number"==typeof dest[0]?dest[0]:_this.pdf.handler.getPageIndex(dest[0])}).then(function(number){return _this.callHandlers("internal",number)}).catch(function(){return console.error("Bad link")})}}},PdfLinksHandler}();exports.default=PdfLinksHandler},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}exports.__esModule=!0;var _Finder=__webpack_require__(17),_Finder2=_interopRequireDefault(_Finder),SearchEngine=function(){function SearchEngine(pageCallback,pages){_classCallCheck(this,SearchEngine),this.pageCallback=pageCallback,this.pages=pages,this.results=[]}return SearchEngine.prototype.setQuery=function(query){this.query=query,this.update=!0,this.process()},SearchEngine.prototype.process=function(){var _this=this;if(this.update){var results=this.results;if(this.results=[],this.onPageHitsChanged)for(var _iterator=results,_isArray=Array.isArray(_iterator),_i=0,_iterator=_isArray?_iterator:_iterator[Symbol.iterator]();;){var _ref;if(_isArray){if(_i>=_iterator.length)break;_ref=_iterator[_i++]}else{if(_i=_iterator.next(),_i.done)break;_ref=_i.value}this.onPageHitsChanged(void 0,"")}this.update=!1,this.page=0,this.stamp=Date.now(),this.query.length>1&&this.process()}else this.page0&&void 0!==arguments[0]?arguments[0]:1,gravity=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,cornerDeviation=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.15,fps=arguments.length>3&&void 0!==arguments[3]?arguments[3]:240;_classCallCheck(this,SheetPhysics),this.p={r:r,cornerDeviation:cornerDeviation,l:Math.PI*r,startDt:1/fps,gravity:gravity,margin:.002*r,infM:1e4,attempts:16,maxIterations:100},this.os=[]}return SheetPhysics.targetForceClb=function(o,a,v,ch){var l=a*this.r;return 100*this.m*this.g*(2/(1+Math.exp(10*(l-this.tl)))-1)-40*this.m*v},SheetPhysics.hoverCornerForceClb=function(o,v,l,ch){return 5},SheetPhysics.prototype.getTargetForceClb=function(mass,targetAngle){return SheetPhysics.targetForceClb.bind({g:this.p.gravity,m:mass,tl:targetAngle*this.p.r,r:this.p.r})},SheetPhysics.dragForceClb=function(o,a,v,ch){return o.flbt*o.m*(10*o.g*ch-50*v/(1+Math.exp(3.5*Math.abs(ch))))},SheetPhysics.dragCornerForceClb=function(o,a,v,ch){return 15*(2/(1+Math.exp(10*(a-this.ta)*o.r))-1)},SheetPhysics.getDragCornerForceClb=function(targetAngle){return SheetPhysics.dragCornerForceClb.bind({ta:targetAngle})},SheetPhysics.prototype.dispose=function(){this.os=[]},SheetPhysics.prototype.getSize=function(){return this.os.length},SheetPhysics.prototype.addObject=function(mass,angle,velocity,flexibility,cornerHeight,simulateClb,removeClb){var forceClb=arguments.length>7&&void 0!==arguments[7]?arguments[7]:function(){return 0},cornerForceClb=arguments.length>8&&void 0!==arguments[8]?arguments[8]:function(){return 0},no={id:_MathUtils2.default.getUnique(),m:mass,v:velocity,l:angle*this.p.r,f:forceClb,cf:cornerForceClb,ch:cornerHeight,flbt:flexibility,simulateClb:simulateClb,removeClb:removeClb},i=this.os.findIndex(function(o){return no.l<=o.l});return i=~i?i:this.os.length,this.os.splice(i,0,no),no.id},SheetPhysics.prototype.getParametrMap=function(name){var map={mass:"m",velocity:"v",flexibility:"flbt",cornerHeight:"ch",simulateClb:"simulateClb",removeClb:"removeClb",forceClb:"f",cornerForceClb:"cf"};return map[name]},SheetPhysics.prototype.setParametr=function(id,name,value){var o=this.os.find(function(o){return o.id===id});"angle"===name?o.l=value*this.p.r:o[this.getParametrMap(name)]=value},SheetPhysics.prototype.getParametr=function(id,name){var o=this.os.find(function(o){return o.id===id}),value=void 0;return value="angle"===name?o.l/this.p.r:o[this.getParametrMap(name)]},SheetPhysics.prototype.simulate=function(T){for(var t=0,dt=this.p.startDt,attempt=0,it=0;tT-t&&(dt=T-t);var nos=this.integrate(this.os,dt),ci=this.findCollisions(nos);if(ci.num>1&&attempt1){for(var gs=[],last=-2,_iterator=ci.all,_isArray=Array.isArray(_iterator),_i=0,_iterator=_isArray?_iterator:_iterator[Symbol.iterator]();;){var _ref;if(_isArray){if(_i>=_iterator.length)break;_ref=_iterator[_i++]}else{if(_i=_iterator.next(),_i.done)break;_ref=_i.value}var i=_ref;i-last>1&&gs.push([]),gs[gs.length-1].push(i),last=i}for(var _iterator2=gs,_isArray2=Array.isArray(_iterator2),_i2=0,_iterator2=_isArray2?_iterator2:_iterator2[Symbol.iterator]();;){var _ref2;if(_isArray2){if(_i2>=_iterator2.length)break;_ref2=_iterator2[_i2++]}else{if(_i2=_iterator2.next(),_i2.done)break;_ref2=_i2.value}var g=_ref2,sg=void 0,i0=void 0;nos[g[0]].l>Math.PI/2*this.p.r?(sg=-1,i0=g[g.length-1]):(sg=1,i0=g[0]);for(var _i3=i0;_i3-1;_i3+=sg){var o=nos[_i3+sg];if(!(o&&sg*(o.l-nos[_i3].l)<=this.p.margin))break;o.l=nos[_i3].l+2*sg*this.p.margin,(o.l>this.p.l||o.l<0)&&(o.l=o.l>this.p.l?this.p.l:0,o.ch=0,o.v=0,console.error("Bad collision"))}}}this.os=nos,this.findAndSolveCornerCollisions(),t+=dt,dt=this.p.startDt,attempt=0}++it}this.removeStatics()},SheetPhysics.prototype.removeStatics=function(){for(var nos=[],notify=[[],[]],_iterator3=this.os,_isArray3=Array.isArray(_iterator3),_i4=0,_iterator3=_isArray3?_iterator3:_iterator3[Symbol.iterator]();;){var _ref3;if(_isArray3){if(_i4>=_iterator3.length)break;_ref3=_iterator3[_i4++]}else{if(_i4=_iterator3.next(),_i4.done)break;_ref3=_i4.value}var o=_ref3;o.simulateClb&&o.simulateClb(o.l/this.p.r,o.ch),o.l!==this.p.l&&0!==o.l||0!==o.v?nos.push(o):void 0!==o.removeClb&¬ify[(o.l!==this.p.l)+0].push(o)}this.os=nos;for(var _iterator4=notify[0].reverse(),_isArray4=Array.isArray(_iterator4),_i5=0,_iterator4=_isArray4?_iterator4:_iterator4[Symbol.iterator]();;){var _ref4;if(_isArray4){if(_i5>=_iterator4.length)break;_ref4=_iterator4[_i5++]}else{if(_i5=_iterator4.next(),_i5.done)break;_ref4=_i5.value}var _o=_ref4;_o.removeClb(Math.PI,_o.ch)}for(var _iterator5=notify[1],_isArray5=Array.isArray(_iterator5),_i6=0,_iterator5=_isArray5?_iterator5:_iterator5[Symbol.iterator]();;){var _ref5;if(_isArray5){if(_i6>=_iterator5.length)break;_ref5=_iterator5[_i6++]}else{if(_i6=_iterator5.next(),_i6.done)break;_ref5=_i6.value}var _o2=_ref5;_o2.removeClb(0,_o2.ch)}},SheetPhysics.prototype.findAndSolveCornerCollisions=function(){if(this.os.length)for(var os=[_extends({},this.os[0],{l:0,m:this.p.infM,ch:0})].concat(this.os,[_extends({},this.os[0],{l:1.05*this.p.l,m:this.p.infM,ch:0})]),i=1;ibl&&a.ch>b.ch){var dCh=a.ch-b.ch,dv=a.m/a.flbt+b.m/b.flbt,ka=a.m/a.flbt/dv,kb=b.m/b.flbt/dv;a.ch=a.ch-kb*dCh,b.ch=b.ch+ka*dCh}}},SheetPhysics.prototype.solveCollision=function(a,b){var mm=b.m+a.m,av=(-a.v*b.m+a.m*a.v+2*b.m*b.v)/mm,bv=(b.m*b.v-b.v*a.m+2*a.m*a.v)/mm;return[_extends({},a,{v:av}),_extends({},b,{v:bv})]},SheetPhysics.prototype.findCollisions=function(os){for(var ci={num:0,last:0,all:[]},i=1;ios[i].l||this.isCollision(os[i-1],os[i]))&&(os[i-1].l>os[i].l&&++ci.num,++ci.num,ci.last=i,ci.all.indexOf(i-1)===-1&&ci.all.push(i-1),ci.all.indexOf(i)===-1&&ci.all.push(i));return ci},SheetPhysics.prototype.isCollision=function(a,b){return Math.abs(a.l-b.l)b.v},SheetPhysics.prototype.integrate=function(os,dt){for(var nos=[],_iterator6=os,_isArray6=Array.isArray(_iterator6),_i7=0,_iterator6=_isArray6?_iterator6:_iterator6[Symbol.iterator]();;){var _ref6;if(_isArray6){if(_i7>=_iterator6.length)break;_ref6=_iterator6[_i7++]}else{if(_i7=_iterator6.next(),_i7.done)break;_ref6=_i7.value}var o=_ref6,vl=_MathUtils2.default.rk4(this.dy.bind({g:this.p.gravity,r:this.p.r,m:o.m,f:o.f,cf:o.cf,ch:o.ch,flbt:o.flbt}),0,dt,[o.v,o.l,o.ch]),no=_extends({},o,{v:vl[0],l:vl[1],ch:vl[2]});(no.l<=0||no.l>=this.p.l)&&(no.l=no.l<=0?0:this.p.l,no.v=0,no.ch=0),nos.push(no)}return nos},SheetPhysics.prototype.dy=function(t,y){var v=y[0],l=y[1],ch=y[2],f=this.f(this,l/this.r,v,ch),cf=this.cf(this,l/this.r,v,ch);return[(-this.g*Math.cos(l/this.r)*this.m+f)/this.m,v+.01*(Math.random()-.5),this.flbt*((2/(1+Math.exp(-.2*cf))-1)*(1-2/(1+Math.exp(-5*(Math.abs(ch)-2))))-ch)]},SheetPhysics}();exports.default=SheetPhysics},function(module,exports){"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}exports.__esModule=!0;var SoundsEnviroment=function(){function SoundsEnviroment(){var template=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};_classCallCheck(this,SoundsEnviroment),this.sounds=template.sounds||{},this.audio={},this.sounds.startFlip&&(this.audio.startFlip=new Audio(this.sounds.startFlip)), +this.sounds.endFlip&&(this.audio.endFlip=new Audio(this.sounds.endFlip))}return SoundsEnviroment.prototype.setEnabled=function(enabled){this.enabled=enabled},SoundsEnviroment.prototype.togle=function(){this.enabled=!this.enabled},SoundsEnviroment.prototype.dispose=function(){delete this.audio.startFlip,delete this.audio.endFlip},SoundsEnviroment.prototype.startFlip=function(){this.enabled&&this.audio.startFlip&&this.audio.startFlip.play()},SoundsEnviroment.prototype.endFlip=function(){this.enabled&&this.audio.startFlip&&(this.audio.startFlip.pause(),this.audio.startFlip.currentTime=0),this.enabled&&this.audio.endFlip&&this.audio.endFlip.play()},SoundsEnviroment.prototype.subscribeFlips=function(emitter){emitter.addEventListener("startFlip",this.startFlip.bind(this)),emitter.addEventListener("endFlip",this.endFlip.bind(this))},SoundsEnviroment}();exports.default=SoundsEnviroment},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}exports.__esModule=!0;var _WidgetController2=__webpack_require__(67),_WidgetController3=_interopRequireDefault(_WidgetController2),TocController=function(_WidgetController){function TocController(view,bookCtrl){_classCallCheck(this,TocController);var _this=_possibleConstructorReturn(this,_WidgetController.call(this,view));return _this.bookCtrl=bookCtrl,_this.tab="none",_this}return _inherits(TocController,_WidgetController),TocController.prototype.setThumbnails=function(thumbnails){this.thumbnails=thumbnails,thumbnails.onNavigate=this.navigateThumbnails.bind(this),"none"===this.tab&&(this.tab="thumbnails"),this.fireChange()},TocController.prototype.setSearch=function(search){this.search=search,search.onNavigate=this.navigateSearch.bind(this),this.fireChange()},TocController.prototype.setBookmarks=function(bookmarks,pdf){this.bookmarks=bookmarks,this.pdf=pdf,bookmarks.onNavigate=this.navigateBookmarks.bind(this),bookmarks.getSize()&&(this.tab="bookmarks",this.isBookmarks=!0),this.fireChange()},TocController.prototype.cmdBookmarks=function(){this.tab="bookmarks",this.fireChange()},TocController.prototype.cmdThumbnails=function(){this.tab="thumbnails",this.fireChange()},TocController.prototype.cmdSearch=function(){this.tab="search",this.fireChange()},TocController.prototype.cmdCloseToc=function(){this.hide()},TocController.prototype.navigateThumbnails=function(number){this.bookCtrl.goToPage(number)},TocController.prototype.navigateSearch=function(number){this.bookCtrl.goToPage(number)},TocController.prototype.navigateBookmarks=function(item){var _this2=this;if(item.url)window.open(item.url,"_blank");else if(item.dest){var destPromise=void 0;destPromise="string"==typeof item.dest?this.pdf.handler.getDestination(item.dest):Promise.resolve(item.dest),destPromise.then(function(dest){return _this2.pdf.handler.getPageIndex(dest[0])}).then(function(number){return _this2.bookCtrl.goToPage(number)}).catch(function(){return console.error("Bad bookmark")})}},TocController.prototype.updateView=function(){var _this3=this;this.view&&(this.view.setState("widTocMenu",{enable:!0,visible:!0,active:!1}),this.view.setState("widThumbnails",{enable:!0,visible:"thumbnails"===this.tab,active:!1}),this.view.setState("widSearch",{enable:!0,visible:"search"===this.tab,active:!1}),this.view.setState("widBookmarks",{enable:!0,visible:"bookmarks"===this.tab,active:!1}),this.view.setState("cmdBookmarks",{enable:!0,visible:!0,active:"bookmarks"===this.tab}),this.view.setState("cmdThumbnails",{enable:!0,visible:!0,active:"thumbnails"===this.tab}),this.view.setState("cmdSearch",{enable:!0,visible:!0,active:"search"===this.tab}),Promise.resolve().then(function(){return _this3.thumbnails.setEnable(_this3.visible&&"thumbnails"===_this3.tab)}),_WidgetController.prototype.updateView.call(this))},TocController}(_WidgetController3.default);exports.default=TocController},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}exports.__esModule=!0;var _libs=__webpack_require__(1),_ThreeUtils=__webpack_require__(20),_ThreeUtils2=_interopRequireDefault(_ThreeUtils),resX=11,resY=2,resZ=15,scale=1,faces=[],frontGeometry=new _libs.THREE.PlaneGeometry(scale,scale,resX-1,resY-1);frontGeometry.translate(.5*scale,.5*scale,scale);var backGeometry=new _libs.THREE.PlaneGeometry(scale,scale,resX-1,resY-1);backGeometry.rotateY(Math.PI),backGeometry.translate(.5*scale,.5*scale,0);var leftGeometry=new _libs.THREE.PlaneGeometry(scale,scale,resZ-1,resY-1);leftGeometry.rotateY(-Math.PI/2),leftGeometry.translate(0,.5*scale,.5*scale);var rightGeometry=new _libs.THREE.PlaneGeometry(scale,scale,resZ-1,resY-1);rightGeometry.rotateY(Math.PI/2),rightGeometry.translate(scale,.5*scale,.5*scale);var topGeometry=new _libs.THREE.PlaneGeometry(scale,scale,resX-1,resZ-1);topGeometry.rotateX(-Math.PI/2),topGeometry.translate(.5*scale,scale,.5*scale);var bottomGeometry=topGeometry.clone();bottomGeometry.translate(0,-scale,0);for(var _iterator=bottomGeometry.faces,_isArray=Array.isArray(_iterator),_i=0,_iterator=_isArray?_iterator:_iterator[Symbol.iterator]();;){var _ref;if(_isArray){if(_i>=_iterator.length)break;_ref=_iterator[_i++]}else{if(_i=_iterator.next(),_i.done)break;_ref=_i.value}var f=_ref,_ref3=[f.b,f.a];f.a=_ref3[0],f.b=_ref3[1]}var geometry=new _libs.THREE.Geometry;geometry.vertices=[].concat(bottomGeometry.vertices,topGeometry.vertices);var addFaces=function(fs,map){for(var _iterator2=fs,_isArray2=Array.isArray(_iterator2),_i2=0,_iterator2=_isArray2?_iterator2:_iterator2[Symbol.iterator]();;){var _ref2;if(_isArray2){if(_i2>=_iterator2.length)break;_ref2=_iterator2[_i2++]}else{if(_i2=_iterator2.next(),_i2.done)break;_ref2=_i2.value}var f=_ref2;geometry.faces.push(new _libs.THREE.Face3(map(f.a),map(f.b),map(f.c)))}faces.push(geometry.faces.length)},mapVertices=function(src,dst){for(var map=[],eq=function(a,b){return Math.abs(a.x-b.x)+Math.abs(a.y-b.y)+Math.abs(a.z-b.z)<1e-4},i=0;i2&&void 0!==arguments[2]?arguments[2]:function(i){return i.title},getItems=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(i){return i.items};_classCallCheck(this,Bookmarks),this.container=container,this.map=[],this.getTitle=getTitle,this.getItems=getItems,this.nodes=this.mapNodes(items,this.map),this.binds={togle:function(e){e.preventDefault();for(var li=(0,_libs.$)(e.target);li[0]&&li[0]!==container[0]&&!li.hasClass("item");)li=(0,_libs.$)(li[0].parentNode);if(li.hasClass("item")){for(var cmd=(0,_libs.$)(e.target);cmd[0]&&cmd[0]!==li[0]&&!cmd.hasClass("cmd");)cmd=(0,_libs.$)(cmd[0].parentNode);if(cmd.hasClass("cmd")){var node=_this.map[li.attr("data-id")];cmd.hasClass("togle")?(node.minimized=!node.minimized,node.minimized?(li.find("ul").remove(),li.find(".togle").addClass("minimized")):(li.find(".togle").removeClass("minimized"),li.append((_this.renderNode(node).match(//)||[""])[0]))):_this.onNavigate&&_this.onNavigate(node.item)}}}},container.on("click",this.binds.togle),this.update()}return Bookmarks.prototype.getSize=function(){return this.map.length},Bookmarks.prototype.dispose=function(){this.container.off("click",this.binds.togle),this.container.html("")},Bookmarks.prototype.update=function(){this.container.html(this.renderNodes(this.nodes))},Bookmarks.prototype.forEach=function(f){for(var nodes=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.nodes,_iterator=nodes||[],_isArray=Array.isArray(_iterator),_i=0,_iterator=_isArray?_iterator:_iterator[Symbol.iterator]();;){var _ref;if(_isArray){if(_i>=_iterator.length)break;_ref=_iterator[_i++]}else{if(_i=_iterator.next(),_i.done)break;_ref=_i.value}var node=_ref;f(node),this.forEach(f,node.children)}},Bookmarks.prototype.expand=function(){this.forEach(function(n){return n.minimized=!1}),this.update()},Bookmarks.prototype.minimize=function(){this.forEach(function(n){return n.minimized=!0}),this.update()},Bookmarks.prototype.renderNode=function(node){return['
',node.children?' ':' ','',node.title,"
",node.minimized?"":this.renderNodes(node.children)].join("")},Bookmarks.prototype.renderNodes=function(nodes){var res=['
'];if(nodes&&nodes.length){res.push('
    ');for(var _iterator2=nodes,_isArray2=Array.isArray(_iterator2),_i2=0,_iterator2=_isArray2?_iterator2:_iterator2[Symbol.iterator]();;){var _ref2;if(_isArray2){if(_i2>=_iterator2.length)break;_ref2=_iterator2[_i2++]}else{if(_i2=_iterator2.next(),_i2.done)break;_ref2=_i2.value}var node=_ref2;res.push(['
  • ',this.renderNode(node),"
  • "].join(""))}res.push("
")}return res.push("
"),res.join("")},Bookmarks.prototype.mapNodes=function(items){var map=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],level=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,nodes=null;if(items&&items.length){nodes=[];for(var _iterator3=items,_isArray3=Array.isArray(_iterator3),_i3=0,_iterator3=_isArray3?_iterator3:_iterator3[Symbol.iterator]();;){var _ref3;if(_isArray3){if(_i3>=_iterator3.length)break;_ref3=_iterator3[_i3++]}else{if(_i3=_iterator3.next(),_i3.done)break;_ref3=_i3.value}var item=_ref3,id=map.length;map.push(void 0);var node={id:id,title:this.getTitle(item),level:level,item:item,minimized:!0,children:this.mapNodes(this.getItems(item),map,level+1)};nodes.push(node),map[id]=node}}return nodes},Bookmarks}();exports.default=Bookmarks},function(module,exports,__webpack_require__){"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}exports.__esModule=!0;var _libs=__webpack_require__(0),Detector=function(){function Detector(){_classCallCheck(this,Detector)}return Detector.getWebGLErrorMessage=function(){var element=document.createElement("div");return element.id="webgl-error-message",element.style.fontFamily="monospace",element.style.fontSize="13px",element.style.fontWeight="normal",element.style.textAlign="center",element.style.background="#fff",element.style.color="#000",element.style.padding="1.5em",element.style.width="400px",element.style.margin="5em auto 0",Detector.webgl||(element.innerHTML=window.WebGLRenderingContext?['Your graphics card does not seem to support WebGL.
','Find out how to get it here.'].join("\n"):['Your browser does not seem to support WebGL.
','Find out how to get it here.'].join("\n")),element},Detector.addGetWebGLMessage=function(parameters){var parent=void 0,id=void 0,element=void 0;parameters=parameters||{},parent=parameters.parent||(0,_libs.$)(document.body),id=parameters.id||"oldie",element=Detector.getWebGLErrorMessage(),parent.append(element)},Detector}();Detector.canvas=!!window.CanvasRenderingContext2D,Detector.webgl=function(){try{var canvas=document.createElement("canvas");return!(!window.WebGLRenderingContext||!canvas.getContext("webgl")&&!canvas.getContext("experimental-webgl"))}catch(e){return!1}}(),Detector.workers=!!window.Worker,Detector.fileapi=window.File&&window.FileReader&&window.FileList&&window.Blob,exports.default=Detector},function(module,exports,__webpack_require__){"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}exports.__esModule=!0;var _libs=__webpack_require__(0),DocMouseSimulator=function(){function DocMouseSimulator(jFrame,element){var bElement=arguments.length>2&&void 0!==arguments[2]?arguments[2]:document.body;_classCallCheck(this,DocMouseSimulator),this.jFrame=jFrame,this.wnd=jFrame[0].contentWindow,this.doc=jFrame[0].contentDocument,this.element=element||doc.body,this.bElement=bElement,this.resendProperties=this.getDefaultResendProperties(),this.undefinedProperties=this.getDefaultUndefinedProperties(),this.cursors=[],this.onDocChangeClbs=[];for(var terms=[{find:":hover",replace:"."+DocMouseSimulator.HOVER},{find:":active",replace:"."+DocMouseSimulator.ACTIVE}],style=['"),(0,_libs.$)(this.doc.head).append((0,_libs.$)(style.join("")))}return DocMouseSimulator.prototype.convertCoords=function(x,y){var jElement=(0,_libs.$)(this.element),offset=jElement.offset();return{x:offset.left+jElement.width()*x,y:offset.top+jElement.height()*(1-y)}},DocMouseSimulator.prototype.triggerEvent=function(element,e,p,type,advancedProps){for(var props={},_iterator2=this.resendProperties,_isArray2=Array.isArray(_iterator2),_i2=0,_iterator2=_isArray2?_iterator2:_iterator2[Symbol.iterator]();;){var _ref2;if(_isArray2){if(_i2>=_iterator2.length)break;_ref2=_iterator2[_i2++]}else{if(_i2=_iterator2.next(),_i2.done)break;_ref2=_i2.value}var _n=_ref2;props[_n]=e[_n]}for(var _iterator3=this.undefinedProperties,_isArray3=Array.isArray(_iterator3),_i3=0,_iterator3=_isArray3?_iterator3:_iterator3[Symbol.iterator]();;){var _ref3;if(_isArray3){if(_i3>=_iterator3.length)break;_ref3=_iterator3[_i3++]}else{if(_i3=_iterator3.next(),_i3.done)break;_ref3=_i3.value}var _n2=_ref3;props[_n2]=void 0}for(var n in advancedProps)advancedProps.hasOwnProperty(n)&&(props[n]=advancedProps[n]);props.view=this.wnd,props.pageX=p.x,props.pageY=p.y;var jE=_libs.$.Event(type,props);jE.timeStamp=e.timeStamp,(0,_libs.$)(element).trigger(jE)},DocMouseSimulator.prototype.addClass=function(element,name){(0,_libs.$)(element).addClass(name);var style=this.wnd.getComputedStyle(element);this.cursors.push((0,_libs.$)(this.bElement).css("cursor")),(0,_libs.$)(this.bElement).css("cursor",style.getPropertyValue("cursor"))},DocMouseSimulator.prototype.removeClass=function(element,name){(0,_libs.$)(element).removeClass(name),(0,_libs.$)(this.bElement).css("cursor",this.cursors.pop())},DocMouseSimulator.prototype.enterElement=function(element){this.addClass(element,DocMouseSimulator.HOVER)},DocMouseSimulator.prototype.leaveElement=function(element){this.removeClass(element,DocMouseSimulator.HOVER)},DocMouseSimulator.prototype.activateElement=function(element){this.addClass(element,DocMouseSimulator.ACTIVE)},DocMouseSimulator.prototype.deactivateElement=function(element){this.removeClass(element,DocMouseSimulator.ACTIVE)},DocMouseSimulator.prototype.addDocChangeClb=function(clb){this.onDocChangeClbs.push(clb)},DocMouseSimulator.prototype.notify=function(){for(var _iterator4=this.onDocChangeClbs,_isArray4=Array.isArray(_iterator4),_i4=0,_iterator4=_isArray4?_iterator4:_iterator4[Symbol.iterator]();;){var _ref4;if(_isArray4){if(_i4>=_iterator4.length)break;_ref4=_iterator4[_i4++]}else{if(_i4=_iterator4.next(),_i4.done)break;_ref4=_i4.value}var clb=_ref4;clb(this.wnd,this.doc)}},DocMouseSimulator.prototype.elementFromPoint=function(p){for(var node=this.doc.body,next=!0;next;){next=!1;for(var i=0;ioffset.left&&p.xoffset.top&&p.y','',xhtml,"",""].join("")})}function newUtil(){function mimes(){var WOFF="application/font-woff",JPEG="image/jpeg";return{woff:WOFF,woff2:WOFF,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:JPEG,jpeg:JPEG,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml"}}function parseExtension(url){var match=/\.([^\.\/]*?)$/g.exec(url);return match?match[1]:""}function mimeType(url){var extension=parseExtension(url).toLowerCase();return mimes()[extension]||""}function isDataUrl(url){return url.search(/^(data:)/)!==-1}function toBlob(canvas){return new Promise(function(resolve){for(var binaryString=self.window.atob(canvas.toDataURL().split(",")[1]),length=binaryString.length,binaryArray=new self.window.Uint8Array(length),i=0;i=_iterator.length)break;_ref=_iterator[_i++]}else{if(_i=_iterator.next(),_i.done)break;_ref=_i.value}var _resolve=_ref;_resolve(data.content)}data.pendings=[],resolve(data.content)},encoder.readAsDataURL(request.response)}}function timeout(){fail("timeout of "+TIMEOUT+"ms occured while fetching resource: "+url)}function fail(message){console.error(message),resolve("")}var request=new self.window.XMLHttpRequest;request.onreadystatechange=done,request.ontimeout=timeout,request.responseType="blob",request.timeout=TIMEOUT,request.open("GET",url,!0),request.send()})}function dataAsUrl(content,type){ +return["data:",type,";base64,",content].join("")}function escape(string){return string.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1")}function delay(ms){return function(arg){return new Promise(function(resolve){setTimeout(function(){resolve(arg)},ms)})}}function asArray(arrayLike){for(var array=[],length=arrayLike.length,i=0;i0){var selected=intersects[0].object;if(!this.onPickCallback(intersects[0]))return;var v=intersects[0].point.clone();this.distance=v.sub(this.raycaster.ray.origin).length(),this.controlsState=this.visual.getControlsState(),this.visual.setControlsState(!1),this.plane.setFromNormalAndCoplanarPoint(this.visual.camera.getWorldDirection(this.plane.normal),intersects[0].point),this.selected=selected}}},Drag.prototype.onMouseMove=function(e){this.enabled&&(e.preventDefault(),this.selected&&(this.setCoordsFromEvent(e),this.raycaster.setFromCamera(this.coords,this.camera),this.raycaster.ray.intersectPlane(this.plane,this.intersection)&&(this.onDragCallback(this.intersection)||this.onMouseUp(e))))},Drag.prototype.onMouseUp=function(e){this.selected&&(this.onReleaseCallback(),this.selected=null,this.visual.setControlsState(this.controlsState)),this.enabled&&e.preventDefault()},Drag}();exports.default=Drag},function(module,exports,__webpack_require__){"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}exports.__esModule=!0;var _extends=Object.assign||function(target){for(var i=1;i=_iterator.length)break;_ref=_iterator[_i++]}else{if(_i=_iterator.next(),_i.done)break;_ref=_i.value}var action=_ref;action(e,data)}},EventsToActions.prototype.contextMenu=function(e){if(this.enabled){var flags=EventsToActions.getEventFlags(e);this.fireActions(this.getActions("contextmenu",e.button,flags),e)}},EventsToActions.prototype.mouseDown=function(e){if(this.picked&&this.mouseUpDoc(),this.enabled){var flags=EventsToActions.getEventFlags(e);this.fireActions(this.getActions("mousedown",e.button,flags),e),this.picked={x:e.pageX,y:e.pageY,actions:this.getActions("mousedrag",e.button,flags)},this.fireActions(this.picked.actions,e,{state:"start"})}},EventsToActions.prototype.mouseMove=function(e){if(this.enabled){var flags=EventsToActions.getEventFlags(e);this.fireActions(this.getActions("mousemove",e.button,flags),e)}},EventsToActions.prototype.mouseMoveDoc=function(e){this.enabled&&this.picked&&(this.fireActions(this.picked.actions,e,{state:"move",dx:e.pageX-this.picked.x,dy:e.pageY-this.picked.y}),this.picked={x:e.pageX,y:e.pageY,actions:this.picked.actions})},EventsToActions.prototype.mouseUp=function(e){if(this.enabled){var flags=EventsToActions.getEventFlags(e);this.fireActions(this.getActions("mouseup",e.button,flags),e)}},EventsToActions.prototype.mouseUpDoc=function(e){this.picked&&(this.fireActions(this.picked.actions,e,{state:"end"}),delete this.picked)},EventsToActions.prototype.mouseWheel=function(e){if(this.enabled){var flags=EventsToActions.getEventFlags(e);this.fireActions(this.getActions("mousewheel",0,flags),e)}},EventsToActions.prototype.clicks=function(e,type){if(this.enabled){var flags=EventsToActions.getEventFlags(e);this.fireActions(this.getActions(type,e.button,flags),e)}},EventsToActions.prototype.click=function(e){this.clicks(e,"click")},EventsToActions.prototype.dblclick=function(e){this.clicks(e,"dblclick")},EventsToActions.prototype.touchPick=function(e,flags,touches){this.touchPicked=_extends({},EventsToActions.getPosition(touches),{actions:this.getActions("touchdrag",touches.length,flags),code:touches.length,flags:flags}),this.fireActions(this.touchPicked.actions,e,{state:"start"})},EventsToActions.prototype.touchStart=function(e){if(this.touchPicked&&this.touchEnd(e),this.enabled){var flags=EventsToActions.getEventFlags(e),touches=e.touches||e.originalEvent.touches;this.fireActions(this.getActions("touchstart",touches.length,flags),e),this.touchPick(e,flags,touches)}},EventsToActions.prototype.touchMove=function(e){if(this.enabled){var flags=EventsToActions.getEventFlags(e),touches=e.touches||e.originalEvent.touches;if(this.fireActions(this.getActions("touchmove",touches.length,flags),e),this.touchPicked)if(this.touchPicked.code===touches.length&&this.touchPicked.flags===flags){var pos=EventsToActions.getPosition(touches);this.fireActions(this.touchPicked.actions,e,{state:"move",dx:pos.x-this.touchPicked.x,dy:pos.y-this.touchPicked.y}),this.touchPicked=_extends({},this.touchPicked,pos)}else this.touchEnd(e),this.touchPick(e,flags,touches)}},EventsToActions.prototype.touchEnd=function(e){this.touchPicked&&(this.fireActions(this.touchPicked.actions,e,{state:"end"}),delete this.touchPicked)},EventsToActions.prototype.key=function(e,type){if(this.enabled){var flags=EventsToActions.getEventFlags(e);this.fireActions(this.getActions(type,e.keyCode,flags),e)}},EventsToActions.prototype.keyDown=function(e){this.key(e,"keydown")},EventsToActions.prototype.keyPress=function(e){this.key(e,"keypress")},EventsToActions.prototype.keyUp=function(e){this.key(e,"keyup")},EventsToActions.prototype.dispose=function(){this.element.off("contextmenu",this.binds.contextMenu),this.element.off("mousedown",this.binds.mouseDown),this.element.off("mousemove",this.binds.mouseMove),this.element.off("mouseup",this.binds.mouseUp),this.element.off("mousewheel",this.binds.mouseWheel),(0,_libs.$)(this.doc).off("mousemove",this.binds.mouseMoveDoc),(0,_libs.$)(this.doc).off("mouseup",this.binds.mouseUpDoc),this.element.off("click",this.binds.click),this.element.off("dblclick",this.binds.dblclick),this.element.off("touchstart",this.binds.touchStart),this.element.off("touchmove",this.binds.touchMove),this.element.off("touchend",this.binds.touchEnd),(0,_libs.$)(this.wnd).off("keydown",this.binds.keyDown),(0,_libs.$)(this.wnd).off("keypress",this.binds.keyPress),(0,_libs.$)(this.wnd).off("keyup",this.binds.keyUp)},EventsToActions}();EventsToActions.modKeys={Ctrl:1,Shift:2,Alt:4},EventsToActions.mouseButtons={Left:0,Middle:1,Right:2},exports.default=EventsToActions},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}exports.__esModule=!0;var _libs=__webpack_require__(0),_ImageBase2=__webpack_require__(5),_ImageBase3=_interopRequireDefault(_ImageBase2),_BaseMathUtils=__webpack_require__(2),_BaseMathUtils2=_interopRequireDefault(_BaseMathUtils),_Dom2Image=__webpack_require__(48),_Dom2Image2=_interopRequireDefault(_Dom2Image),_DocMouseSimulator=__webpack_require__(47),_DocMouseSimulator2=_interopRequireDefault(_DocMouseSimulator),InteractiveImage=function(_ImageBase){function InteractiveImage(context,width,height,color,src,cache,injector){_classCallCheck(this,InteractiveImage);var _this=_possibleConstructorReturn(this,_ImageBase.call(this,context,width,height,color));_this.iId="i"+_BaseMathUtils2.default.getUnique();var jFrame=(0,_libs.$)('');return(0,_libs.$)(_this.doc.body).append(jFrame),_this.frame=jFrame[0],_this.binds={},injector&&injector(_this.frame.contentWindow),_this.doc.implementation.hasFeature("www.http://w3.org/TR/SVG11/feature#Extensibility","1.1")&&(_this.image=new Image,_this.binds.imageLoad=function(){_this.renderImage(_this.image),_this.finishRender()},(0,_libs.$)(_this.image).on("load",_this.binds.imageLoad),_this.svgRender=new _Dom2Image2.default(_this.frame.contentWindow,_this.frame.contentDocument,cache)),_this.binds.frameLoad=function(){~_this.frame.contentDocument.title.indexOf("404")?(_this.startRender=function(){_this.renderNotFoundPage(),_this.finishRender()},_this.finishLoad()):setTimeout(function(){_this.frame&&(_this.width=(0,_libs.$)(_this.frame.contentDocument.body).width(),_this.height=(0,_libs.$)(_this.frame.contentDocument.body).height(),jFrame.css("width",_this.width+"px").css("height",_this.height+"px"),jFrame.offset({left:-_this.width-100,top:0}),_this.svgRender&&(_this.simulator=new _DocMouseSimulator2.default(jFrame,_this.frame.contentDocument.body,_this.element),_this.simulator.addDocChangeClb(_this.finishLoad.bind(_this))),_this.startRender=function(){_this.render()},_this.finishLoad())},500)},(0,_libs.$)(_this.frame.contentWindow).on("load",_this.binds.frameLoad),_this}return _inherits(InteractiveImage,_ImageBase),InteractiveImage.prototype.getSimulatedDoc=function(){return this.frame.contentDocument},InteractiveImage.prototype.render=function(){var _this2=this;this.svgRender?this.svgRender.toSvg(this.simulator.element,{height:this.height+"px",width:this.width+"px"}).then(function(dataUrl){_this2.image.src=dataUrl}).catch(function(error){console.error("Dom2Image: ",error),_this2.renderBlankPage(),_this2.finishRender()}):(0,_libs.html2canvas)(this.frame.contentDocument.body,{timeout:3e4}).then(function(canvas){_this2.renderImage(canvas),_this2.finishRender()})},InteractiveImage.prototype.dispose=function(){(0,_libs.$)(this.image).off("load",this.binds.imageLoad),(0,_libs.$)(this.frame.contentWindow).off("load",this.binds.frameLoad),(0,_libs.$)(this.doc.body).find("#"+this.iId).remove(),this.image&&(this.image.src="",delete this.image),this.frame.src="",delete this.frame,_ImageBase.prototype.dispose.call(this)},InteractiveImage.prototype.simulate=function(e,doc,x,y){this.simulator&&this.simulator.simulate(e,doc,x,y)},InteractiveImage}(_ImageBase3.default);exports.default=InteractiveImage},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}exports.__esModule=!0;var _libs=__webpack_require__(0),_GraphUtils=__webpack_require__(7),_GraphUtils2=_interopRequireDefault(_GraphUtils),_MathUtils=__webpack_require__(3),_MathUtils2=_interopRequireDefault(_MathUtils),LoadingAnimation=function(){function LoadingAnimation(width,height,color){_classCallCheck(this,LoadingAnimation);var jC=(0,_libs.$)('');this.c=jC[0],this.p={g:9.8,dt:1/60,color:color,updateInterval:.25},this.ctx=this.c.getContext("2d"),this.os=[-2,Math.PI/2],this.t=this.p.updateInterval}return LoadingAnimation.prototype.dy=function(t,y){var w=y[0],a=y[1];return[-this.g*Math.cos(a),w]},LoadingAnimation.prototype.integrate=function(T){for(var t=0,dt=this.p.dt,os=this.os;tT&&(dt=T-t),os=_MathUtils2.default.rk4(this.dy.bind({g:this.p.g}),0,dt,os),t+=dt;return os},LoadingAnimation.prototype.calcTimeTo=function(target){for(var t=0,dt=this.p.dt,os=this.os;Math.abs(os[1]-target)>1e-4;){var nos=_MathUtils2.default.rk4(this.dy.bind({g:this.p.g}),0,dt,os);nos[0]<0&&nos[1]0&&nos[1]>target?dt/=2:(os=nos,t+=dt)}return t},LoadingAnimation.prototype.update=function(T){if(this.os=this.integrate(T),this.t+=T,this.t>=this.p.updateInterval){this.t=0;var r=.1*Math.min(this.c.width,this.c.height),a=this.os[1],x0=.5*this.c.width,y0=.5*this.c.height,ctx=this.ctx;ctx.clearRect(0,0,this.c.width,this.c.height),ctx.beginPath(),ctx.fillStyle=_GraphUtils2.default.color2Rgba(this.p.color,1),ctx.rect(0,0,this.c.width,this.c.height),ctx.fill(),ctx.beginPath(),ctx.shadowBlur=50,ctx.fillStyle=_GraphUtils2.default.color2Rgba(_GraphUtils2.default.inverseColor(this.p.color,.9),Math.abs(this.os[0]/6.36)),ctx.shadowColor=_GraphUtils2.default.color2Rgba(_GraphUtils2.default.inverseColor(this.p.color,1),.9),ctx.shadowOffsetX=0,ctx.shadowOffsetY=0,ctx.font="bold "+Math.round(.25*r)+"px Arial",ctx.textAlign="center",ctx.textBaseline="middle",ctx.fillText("Loading...",x0,y0);var ps=10,da=2*Math.PI/ps;ctx.shadowColor=_GraphUtils2.default.color2Rgba(_GraphUtils2.default.inverseColor(this.p.color,1),.7);for(var i=0,_a=a,_r=.2*r;i')[0],ctx=c.getContext("2d"),t=this.calcTimeTo(this.os[1]+2*Math.sign(this.os[0])*Math.PI),dt=t/(n+1),updateInterval=this.p.updateInterval;this.p.updateInterval=0;for(var i=0;i1&&void 0!==arguments[1])||arguments[1],loadingMsg=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;_classCallCheck(this,LoadingController),this.view=view,this.progress=0,this.showProgress=showProgress,this.getLoadingMsg=loadingMsg||LoadingController.defaultLoadingMsg,this.updateView()}return LoadingController.defaultLoadingMsg=function(progress){return["Please wait... the Application is Loading: ",progress,"%"].join("")},LoadingController.prototype.dispose=function(){this.showProgress=!1,this.updateView(),delete this.view},LoadingController.prototype.setProgress=function(v){this.progress=v,this.updateView()},LoadingController.prototype.updateView=function(){if(this.view){this.view.setState("widLoadingProgress",{enable:!0,visible:this.showProgress,active:!1}),this.view.setState("txtLoadingProgress",{value:this.getLoadingMsg(this.progress),visible:!0});for(var _iterator=this.view.getLinks(),_isArray=Array.isArray(_iterator),_i=0,_iterator=_isArray?_iterator:_iterator[Symbol.iterator]();;){var _ref;if(_isArray){if(_i>=_iterator.length)break;_ref=_iterator[_i++]}else{if(_i=_iterator.next(),_i.done)break;_ref=_i.value}var name=_ref;this.view.setState(name,{enable:!1,visible:!0,active:!1})}this.view.setState("inpPages",{visible:!0,value:""}),this.view.setState("inpPage",{visible:!0,enable:!1,value:""})}},LoadingController}());exports.default=LoadingController},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}exports.__esModule=!0;var _libs=__webpack_require__(0),_EventConverter2=__webpack_require__(6),_EventConverter3=_interopRequireDefault(_EventConverter2),MouseEventConverter=function(_EventConverter){function MouseEventConverter(wnd,doc,element){_classCallCheck(this,MouseEventConverter);var _this=_possibleConstructorReturn(this,_EventConverter.call(this,wnd,doc));return _this.element=element,_this.binds={convert:_this.convert.bind(_this)},(0,_libs.$)(_this.element).on("mousemove mousedown mouseover mouseout click",_this.binds.convert),(0,_libs.$)(_this.doc).on("mouseup",_this.binds.convert),_this}return _inherits(MouseEventConverter,_EventConverter),MouseEventConverter.prototype.dispose=function(){(0,_libs.$)(this.element).off("mousemove mousedown mouseover mouseout click",this.binds.convert),(0,_libs.$)(this.doc).off("mouseup",this.binds.convert)},MouseEventConverter}(_EventConverter3.default);exports.default=MouseEventConverter},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}exports.__esModule=!0;var _extends=Object.assign||function(target){for(var i=1;i2&&void 0!==arguments[2]?arguments[2]:this.testScale;_classCallCheck(this,Object3DWatcher),this.visual=visual,this.boundBoxClb=boundBoxClb,this.testScale=testScale,this.camera=visual.camera,this.element=this.visual.element,this.elementSize={w:1,h:1},this.devicePixelRatio=this.visual.wnd.devicePixelRatio||1,this.orbit=visual.getOrbit(),this.scale=1,this.eps=1e-4,this.v=new _libs.THREE.Vector3,this.dv=new _libs.THREE.Vector2,this.enabled=!1,visual.addRenderCallback(this.update.bind(this)),this.os={vx:0,vy:0,x:0,y:0},this.orbit.update(),this.camera.updateMatrixWorld();var box=this.computeClientBoundBox(),k=1.11;this.movePan({x:-k*box.mid.x,y:-k*box.mid.y})}return Object3DWatcher.prototype.movePan=function(dv){this.orbit.pan(dv.x*this.visual.width(),-dv.y*this.visual.height())},Object3DWatcher.prototype.vToCamera=function(v){return v.project(this.camera),{x:.5*v.x,y:.5*v.y}},Object3DWatcher.prototype.computeClientBoundBox=function(){for(var box=this.boundBoxClb(),xs=[box.min.x,box.max.x],ys=[0,0],zs=[box.min.z,box.max.z],ps=[],res={max:{},min:{}},_iterator=xs,_isArray=Array.isArray(_iterator),_i=0,_iterator=_isArray?_iterator:_iterator[Symbol.iterator]();;){var _ref;if(_isArray){if(_i>=_iterator.length)break;_ref=_iterator[_i++]}else{if(_i=_iterator.next(),_i.done)break;_ref=_i.value}for(var x=_ref,_iterator2=ys,_isArray2=Array.isArray(_iterator2),_i2=0,_iterator2=_isArray2?_iterator2:_iterator2[Symbol.iterator]();;){var _ref2;if(_isArray2){if(_i2>=_iterator2.length)break;_ref2=_iterator2[_i2++]}else{if(_i2=_iterator2.next(),_i2.done)break;_ref2=_i2.value}for(var y=_ref2,_iterator3=zs,_isArray3=Array.isArray(_iterator3),_i3=0,_iterator3=_isArray3?_iterator3:_iterator3[Symbol.iterator]();;){var _ref3;if(_isArray3){if(_i3>=_iterator3.length)break;_ref3=_iterator3[_i3++]}else{if(_i3=_iterator3.next(),_i3.done)break;_ref3=_i3.value}var z=_ref3;ps.push(this.vToCamera(this.v.set(x,y,z)))}}}return ps.sort(function(p1,p2){return p1.x-p2.x}),res.min.x=ps[0].x,res.max.x=ps[ps.length-1].x,ps.sort(function(p1,p2){return p1.y-p2.y}),res.min.y=ps[0].y,res.max.y=ps[ps.length-1].y,res.width=res.max.x-res.min.x,res.height=res.max.y-res.min.y,res.mid={x:.5*(res.max.x+res.min.x),y:.5*(res.max.y+res.min.y)},res},Object3DWatcher.prototype.setObject=function(boundBoxClb){this.boundBoxClb=boundBoxClb},Object3DWatcher.prototype.testScale=function(){return!0},Object3DWatcher.prototype.computeCorr=function(K,min,max){var corr=0;return K<1?min>-.5?corr=-.5-min:max<.5&&(corr=.5-max):min<-.5?corr=-.5-min:max>.5&&(corr=.5-max),corr},Object3DWatcher.prototype.getScale=function(){var box=this.computeClientBoundBox(),Kx=this.elementSize.w/box.width,Ky=this.elementSize.h/box.height;return 1/Math.min(Kx,Ky)},Object3DWatcher.prototype.centerView=function(T){var _this=this,box=this.computeClientBoundBox(),Kx=this.elementSize.w/box.width,Ky=this.elementSize.h/box.height,K=Math.min(Kx,Ky);if(this.testScale()&&Math.abs(1/K-this.scale)>this.eps){var scale=1/K+.2*(this.scale-1/K);this.orbit.setScale(this.orbit.getScale()/(K*scale)),this.orbit.update(),this.camera.updateMatrixWorld(),box=this.computeClientBoundBox(),Kx=this.elementSize.w/box.width,Ky=this.elementSize.h/box.height,K=Math.min(Kx,Ky)}var dv=this.dv;if(K>1-this.eps?dv.set(-box.mid.x,-box.mid.y):dv.set(this.computeCorr(Kx,box.min.x,box.max.x),this.computeCorr(Ky,box.min.y,box.max.y)),Math.sqrt(this.os.vx*this.os.vx+this.os.vy*this.os.vy)>.003||dv.length()>.003){var dt=1/60,t=0,os=_extends({},this.os,{x:0,y:0});for(os.tf=function(vx,vy,x,y){return{x:75*(dv.x-x)/Math.pow(_this.devicePixelRatio,1),y:75*(dv.y-y)/Math.pow(_this.devicePixelRatio,1)}};tT&&(dt=T-t),os=this.integrate(os,dt),t+=dt;this.movePan(os),this.os=os}},Object3DWatcher.prototype.integrate=function(os,dt){var _MathUtils$rk=_MathUtils2.default.rk4(this.dy.bind(os),0,dt,[os.vx,os.vy,os.x,os.y]),vx=_MathUtils$rk[0],vy=_MathUtils$rk[1],x=_MathUtils$rk[2],y=_MathUtils$rk[3]; +return _extends({},os,{vx:vx,vy:vy,x:x,y:y})},Object3DWatcher.prototype.dy=function(t,Y){var vx=Y[0],vy=Y[1],x=Y[2],y=Y[3],vd=15,tf=this.tf(vx,vy,x,y);return[tf.x-vd*vx,tf.y-vd*vy,vx,vy]},Object3DWatcher.prototype.update=function(dt){this.enabled&&this.boundBoxClb&&this.centerView(dt)},Object3DWatcher}();exports.default=Object3DWatcher},function(module,exports,__webpack_require__){"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}exports.__esModule=!0;var _libs=__webpack_require__(0),Orbit=function(_THREE$EventDispatche){function Orbit(object,domElement){function getAutoRotationAngle(){return 2*Math.PI/60/60*scope.autoRotateSpeed}function getZoomScale(){return Math.pow(.95,scope.zoomSpeed)}function rotateLeft(angle){sphericalDelta.theta-=angle}function rotateUp(angle){sphericalDelta.phi-=angle}function dollyIn(dollyScale){scope.object instanceof _libs.THREE.PerspectiveCamera?scale/=dollyScale:scope.object instanceof _libs.THREE.OrthographicCamera?(scope.object.zoom=Math.max(scope.minZoom,Math.min(scope.maxZoom,scope.object.zoom*dollyScale)),scope.object.updateProjectionMatrix(),zoomChanged=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type-dolly/zoom disabled."),scope.enableZoom=!1)}function dollyOut(dollyScale){scope.object instanceof _libs.THREE.PerspectiveCamera?scale*=dollyScale:scope.object instanceof _libs.THREE.OrthographicCamera?(scope.object.zoom=Math.max(scope.minZoom,Math.min(scope.maxZoom,scope.object.zoom/dollyScale)),scope.object.updateProjectionMatrix(),zoomChanged=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type-dolly/zoom disabled."),scope.enableZoom=!1)}function rotate(event,data){if(scope.enabled&&scope.enableRotate&&"move"===data.state){var element=scope.domElement;rotateLeft(2*Math.PI*data.dx/element.clientWidth*scope.rotateSpeed),rotateUp(2*Math.PI*data.dy/element.clientHeight*scope.rotateSpeed),scope.update()}}function pan(event,data){scope.enabled&&scope.enablePan&&"move"===data.state&&(scope.pan(data.dx,data.dy),scope.update())}function offsetDolly(event,data){scope.enabled&&scope.enableZoom&&"move"===data.state&&(data.dy>0?dollyIn(getZoomScale()):data.dy<0&&dollyOut(getZoomScale()),scope.update())}function wheelDolly(event){scope.enabled&&scope.enableZoom&&(event.deltaY>0?dollyOut(getZoomScale()):event.deltaY<0&&dollyIn(getZoomScale()),scope.update())}_classCallCheck(this,Orbit);var _this=_possibleConstructorReturn(this,_THREE$EventDispatche.call(this));_this.object=object,_this.domElement=domElement||document.body,_this.enabled=!0,_this.target=new _libs.THREE.Vector3,_this.minDistance=0,_this.maxDistance=1/0,_this.minZoom=0,_this.maxZoom=1/0,_this.minPolarAngle=0,_this.maxPolarAngle=Math.PI,_this.minAzimuthAngle=-(1/0),_this.maxAzimuthAngle=1/0,_this.enableDamping=!1,_this.dampingFactor=.25,_this.enableZoom=!0,_this.zoomSpeed=1,_this.enableRotate=!0,_this.rotateSpeed=1,_this.enablePan=!0,_this.autoRotate=!1,_this.autoRotateSpeed=2,_this.target0=_this.target.clone(),_this.position0=_this.object.position.clone(),_this.zoom0=_this.object.zoom,_this.getPolarAngle=function(){return spherical.phi},_this.getAzimuthalAngle=function(){return spherical.theta},_this.reset=function(){scope.target.copy(scope.target0),scope.object.position.copy(scope.position0),scope.object.zoom=scope.zoom0,scope.object.updateProjectionMatrix(),scope.dispatchEvent(changeEvent),scope.update()},_this.zoomOut=function(){var speed=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.zoomSpeed,_speed=this.zoomSpeed;this.zoomSpeed=speed,dollyIn(getZoomScale()),this.zoomSpeed=_speed},_this.zoomIn=function(){var speed=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.zoomSpeed,_speed=this.zoomSpeed;this.zoomSpeed=speed,dollyOut(getZoomScale()),this.zoomSpeed=_speed},_this.getScale=function(){return scale},_this.setScale=function(newScale){scale=newScale},_this.update=function(){var offset=new _libs.THREE.Vector3,quat=(new _libs.THREE.Quaternion).setFromUnitVectors(object.up,new _libs.THREE.Vector3(0,1,0)),quatInverse=quat.clone().inverse(),lastPosition=new _libs.THREE.Vector3,lastQuaternion=new _libs.THREE.Quaternion;return function(){var position=scope.object.position;return offset.copy(position).sub(scope.target),offset.applyQuaternion(quat),spherical.setFromVector3(offset),scope.autoRotate&&rotateLeft(getAutoRotationAngle()),spherical.theta+=sphericalDelta.theta,spherical.phi+=sphericalDelta.phi,spherical.theta=Math.max(scope.minAzimuthAngle,Math.min(scope.maxAzimuthAngle,spherical.theta)),spherical.phi=Math.max(scope.minPolarAngle,Math.min(scope.maxPolarAngle,spherical.phi)),spherical.makeSafe(),spherical.radius*=scale,spherical.radius=Math.max(scope.minDistance,Math.min(scope.maxDistance,spherical.radius)),scope.target.add(panOffset),offset.setFromSpherical(spherical),offset.applyQuaternion(quatInverse),position.copy(scope.target).add(offset),scope.object.lookAt(scope.target),scope.enableDamping===!0?(sphericalDelta.theta*=1-scope.dampingFactor,sphericalDelta.phi*=1-scope.dampingFactor):sphericalDelta.set(0,0,0),scale=1,panOffset.set(0,0,0),!!(zoomChanged||lastPosition.distanceToSquared(scope.object.position)>EPS||8*(1-lastQuaternion.dot(scope.object.quaternion))>EPS)&&(scope.dispatchEvent(changeEvent),lastPosition.copy(scope.object.position),lastQuaternion.copy(scope.object.quaternion),zoomChanged=!1,!0)}}(),_this.dispose=function(){};var scope=_this,changeEvent={type:"change"},EPS=1e-6,spherical=new _libs.THREE.Spherical,sphericalDelta=new _libs.THREE.Spherical,scale=1,panOffset=new _libs.THREE.Vector3,zoomChanged=!1,panLeft=function(){var v=new _libs.THREE.Vector3;return function(distance,objectMatrix){v.setFromMatrixColumn(objectMatrix,0),v.multiplyScalar(-distance),panOffset.add(v)}}(),panUp=function(){var v=new _libs.THREE.Vector3;return function(distance,objectMatrix){v.setFromMatrixColumn(objectMatrix,1),v.multiplyScalar(distance),panOffset.add(v)}}();return scope.pan=function(){var offset=new _libs.THREE.Vector3;return function(deltaX,deltaY){var element=scope.domElement;if(scope.object instanceof _libs.THREE.PerspectiveCamera){var position=scope.object.position;offset.copy(position).sub(scope.target);var targetDistance=offset.length();targetDistance*=Math.tan(scope.object.fov/2*Math.PI/180),panLeft(2*deltaX*targetDistance/element.clientHeight,scope.object.matrix),panUp(2*deltaY*targetDistance/element.clientHeight,scope.object.matrix)}else scope.object instanceof _libs.THREE.OrthographicCamera?(panLeft(deltaX*(scope.object.right-scope.object.left)/scope.object.zoom/element.clientWidth,scope.object.matrix),panUp(deltaY*(scope.object.top-scope.object.bottom)/scope.object.zoom/element.clientHeight,scope.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type-pan disabled."),scope.enablePan=!1)}}(),_this.actions={rotate:rotate,pan:pan,offsetDolly:offsetDolly,wheelDolly:wheelDolly},_this.update(),_this}return _inherits(Orbit,_THREE$EventDispatche),Orbit}(_libs.THREE.EventDispatcher);exports.default=Orbit},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}exports.__esModule=!0;var _libs=__webpack_require__(0),_ImageBase2=__webpack_require__(5),_ImageBase3=_interopRequireDefault(_ImageBase2),_Pdf=__webpack_require__(18),_Pdf2=_interopRequireDefault(_Pdf),_BaseMathUtils=__webpack_require__(2),_BaseMathUtils2=_interopRequireDefault(_BaseMathUtils),_CustomEventConverter=__webpack_require__(16),_CustomEventConverter2=_interopRequireDefault(_CustomEventConverter),_PolyTarget=__webpack_require__(69),_PolyTarget2=_interopRequireDefault(_PolyTarget),_Finder=__webpack_require__(17),_Finder2=_interopRequireDefault(_Finder),PdfImage=function(_ImageBase){function PdfImage(context,width,height,color,pdf,n){_classCallCheck(this,PdfImage);var _this=_possibleConstructorReturn(this,_ImageBase.call(this,context,width,height,color));return _this.query="",_this.n=n,_this.pdf=pdf,_this.v={x:0,y:0,z:0,set:function(x,y,z){return this.x=x,this.y=y,this.z=z,this},transform:function(m){var x=m.m[0][0]*this.x+m.m[1][0]*this.y+m.m[2][0]*this.z,y=m.m[0][1]*this.x+m.m[1][1]*this.y+m.m[2][1]*this.z,z=m.m[0][2]*this.x+m.m[0][2]*this.y+m.m[2][0]*this.z;return this.x=x,this.y=y,this.z=z,this}},_this.m={m:[[1,0,0],[0,1,0],[0,0,1]],set:function(m00,m01,m02,m10,m11,m12,m20,m21,m22){return this.m=[[m00,m01,m02],[m10,m11,m12],[m20,m21,m22]],this}},_this.startRender=function(){_this.pdf.getHandler(_this.render.bind(_this))},Promise.resolve().then(function(){return _this.pdf.getHandler(_this.init.bind(_this))}),_this}return _inherits(PdfImage,_ImageBase),PdfImage.prototype.setQuery=function(query){this.query=query.trim(),this.textContent&&(this.setHits(this.textContent),this.finishLoad())},PdfImage.prototype.rectSize=function(r){return{width:r[2]-r[0],height:r[3]-r[1]}},PdfImage.prototype.createPoly=function(m,p,s){var poly=[],v=this.v;return v.set(p.x,p.y,1).transform(m),poly.push({x:v.x,y:v.y}),v.set(p.x,p.y+s.height,1).transform(m),poly.push({x:v.x,y:v.y}),v.set(p.x+s.width,p.y+s.height,1).transform(m),poly.push({x:v.x,y:v.y}),v.set(p.x+s.width,p.y,1).transform(m),poly.push({x:v.x,y:v.y}),poly},PdfImage.prototype.getSimulatedDoc=function(){return this.page},PdfImage.prototype.simulate=function(e,doc,x,y){this.eventConverter&&this.eventConverter.convert(e,{doc:doc,x:x,y:y})},PdfImage.prototype.setAnnotations=function(annos){var _this2=this,t=this.viewport.transform,targets=[];this.m.set(t[0],t[1],0,t[2],t[3],0,t[4],t[5],1);for(var _iterator=annos,_isArray=Array.isArray(_iterator),_i=0,_iterator=_isArray?_iterator:_iterator[Symbol.iterator]();;){var _ref;if(_isArray){if(_i>=_iterator.length)break;_ref=_iterator[_i++]}else{if(_i=_iterator.next(),_i.done)break;_ref=_i.value}var anno=_ref;if("Link"===anno.subtype){var rect=anno.rect,aPos={x:rect[0],y:rect[1]},aSz=this.rectSize(rect),_target=new _PolyTarget2.default(this.createPoly(this.m,aPos,aSz).map(function(p){return{x:p.x/_this2.viewport.width,y:1-p.y/_this2.viewport.height}}));_target.anno=anno,_target.callback=this.annoClb.bind(this),targets.push(_target)}}if(targets.length){this.eventConverter=new _CustomEventConverter2.default(this.wnd,this.doc,_PolyTarget2.default.test,this.page);for(var _iterator2=targets,_isArray2=Array.isArray(_iterator2),_i2=0,_iterator2=_isArray2?_iterator2:_iterator2[Symbol.iterator]();;){var _ref2;if(_isArray2){if(_i2>=_iterator2.length)break;_ref2=_iterator2[_i2++]}else{if(_i2=_iterator2.next(),_i2.done)break;_ref2=_i2.value}var target=_ref2;this.eventConverter.addCustom(target)}}},PdfImage.prototype.setHits=function(textContent){this.textContent=textContent,""!==this.query&&(this.finder=new _Finder2.default(textContent.items.map(function(item){return item.str}),this.query,{contexts:!1}))},PdfImage.prototype.renderHits=function(){var _this3=this;if(this.finder){for(var testSz=(this.page.view,(0,_libs.$)('
').appendTo("body")),textDiv=testSz[0],baseOffset=testSz.offset().left,_iterator3=this.finder.getHits(),_isArray3=Array.isArray(_iterator3),_i3=0,_iterator3=_isArray3?_iterator3:_iterator3[Symbol.iterator]();;){var _ref3;if(_isArray3){if(_i3>=_iterator3.length)break;_ref3=_iterator3[_i3++]}else{if(_i3=_iterator3.next(),_i3.done)break;_ref3=_i3.value}var hit=_ref3,item=this.textContent.items[hit.index],t=PDFJS.Util.transform(this.viewport.transform,item.transform),style=this.textContent.styles[item.fontName],angle=Math.atan2(t[1],t[0])+(style.vertical?Math.PI/2:0),fontHeight=Math.sqrt(t[2]*t[2]+t[3]*t[3]),fontAscent=style.ascent?style.ascent*fontHeight:style.descent?(1+style.descent)*fontHeight:fontHeight;testSz.html(item.str.substr(0,hit.offset)+""+item.str.substr(hit.offset,hit.length)+""+item.str.substr(hit.offset+hit.length)),textDiv.style.fontSize=fontHeight+"px",textDiv.style.fontFamily=style.fontFamily;var testSpan=testSz.find("span"),iwidth=style.vertical?item.height*this.viewport.scale:item.width*this.viewport.scale,width=testSz.width(),relativeOffset=(testSpan.offset().left-baseOffset)/width;this.m.set(1,0,0,0,1,0,t[4]+fontAscent*Math.sin(angle),t[5]-fontAscent*Math.cos(angle),1);var poly=this.createPoly(this.m,{x:relativeOffset*iwidth,y:0},{width:iwidth*testSpan.width()/width,height:testSpan.height()});poly=poly.map(function(p){return{x:p.x/_this3.viewport.width,y:1-p.y/_this3.viewport.height}}),this.renderHit(poly)}testSz.remove()}},PdfImage.prototype.annoClb=function(e,data){this.context.dispatchEvent&&this.context.dispatchEvent({type:"pdfAnnotation",event:e,annotation:data.target.anno})},PdfImage.prototype.init=function(handler){var _this4=this;handler.getPage(this.n+1).then(function(page){_this4.page=page,_this4.size=_Pdf2.default.getPageSize(page),page.getAnnotations().then(_this4.setAnnotations.bind(_this4)),page.getTextContent().then(_this4.setHits.bind(_this4));var scale=_BaseMathUtils2.default.calcScale(_this4.size.width,_this4.size.height,_this4.resW,_this4.resH);_this4.viewport=page.getViewport(scale),_this4.resW=_this4.width=_this4.viewport.width,_this4.resH=_this4.height=_this4.viewport.height,_this4.finishLoad()}).catch(function(e){console.error("Cannot load PDF page: "+(_this4.n+1)),_this4.finishLoad()})},PdfImage.prototype.render=function(handler){var _this5=this;this.page?this.page.render({canvasContext:this.pushCtx(),viewport:this.viewport}).then(function(){_this5.renderHits(),_this5.popCtx(),_this5.finishRender()}):(this.renderBlankPage(),this.finishRender())},PdfImage}(_ImageBase3.default);exports.default=PdfImage},function(module,exports,__webpack_require__){"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}exports.__esModule=!0;var _libs=__webpack_require__(0),Search=function(){function Search(container,pages){_classCallCheck(this,Search),this.container=container,this.pages=pages,this.prevResults=[],container.html('\n \n '),this.query=container.find(".query input"),this.results=container.find(".results"),this.status=container.find(".status"),this.binds={navigate:this.navigate.bind(this),doQuery:this.doQuery.bind(this)},this.query.on("keydown",this.binds.doQuery),this.results.on("click",this.binds.navigate)}return Search.prototype.dispose=function(){this.results.off("click",this.binds.navigate),this.query.off("keydown",this.binds.doQuery)},Search.prototype.navigate=function(e){if(e.preventDefault(),void 0!==this.onNavigate){var target=(0,_libs.$)(e.target);if(!target.hasClass("result")){var t=target.find(".result");if(t.length)target=t;else for(;target.length&&!target.hasClass("result");)target=(0,_libs.$)(target[0].parentNode)}var page=target.attr("data");void 0!==page&&this.onNavigate(parseInt(page))}},Search.prototype.doQuery=function(){var _this=this;if(this.onQuery){var queryStamp=this.queryStamp=Date.now();setTimeout(function(){queryStamp===_this.queryStamp&&_this.onQuery(_this.query[0].value.trim())},1e3)}},Search.prototype.setResults=function(results,lastPage){this.prevResults.length&&results[0]!==this.prevResults[0]&&(this.prevResults=[],this.results.html(""));for(var htmls=[],i=this.prevResults.length;i'),htmls.push(''),htmls.push("
"+result.contexts.join("
")+"
"),htmls.push("
"),htmls.push("")}(0,_libs.$)(htmls.join("")).appendTo(this.results),this.prevResults=[].concat(results),void 0===lastPage?this.status.html(""):this.status.html(lastPage+" of "+this.pages)},Search}();exports.default=Search},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}exports.__esModule=!0;var _libs=__webpack_require__(0),_ImageBase2=__webpack_require__(5),_ImageBase3=_interopRequireDefault(_ImageBase2),_Utils=__webpack_require__(4),_Utils2=_interopRequireDefault(_Utils),StaticImage=function(_ImageBase){function StaticImage(context,width,height,color,src){_classCallCheck(this,StaticImage);var _this=_possibleConstructorReturn(this,_ImageBase.call(this,context,width,height,color));return _this.binds={},_this.image=new Image,_this.image.crossOrigin="Anonymous",_this.binds.imageLoad=function(){_this.width=_this.image.width,_this.height=_this.image.height,_this.startRender=function(){_this.renderImage(_this.image),_this.finishRender()},_this.finishLoad()},_this.binds.imageError=function(){_this.startRender=function(){_this.renderNotFoundPage(),_this.finishRender()},_this.finishLoad()},(0,_libs.$)(_this.image).on("load",_this.binds.imageLoad).on("error",_this.binds.imageError),_this.image.src=_Utils2.default.normalizeUrl(src),_this}return _inherits(StaticImage,_ImageBase),StaticImage.prototype.dispose=function(){(0,_libs.$)(this.image).off("load",this.binds.imageLoad).off("error",this.binds.imageError),this.image.src="",delete this.image,_ImageBase.prototype.dispose.call(this)},StaticImage}(_ImageBase3.default);exports.default=StaticImage},function(module,exports,__webpack_require__){"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}exports.__esModule=!0;var _libs=__webpack_require__(0),TextureAnimator=function(){function TextureAnimator(img,tilesHoriz,tilesVert,numTiles,tileDispDuration){_classCallCheck(this,TextureAnimator);var texture=new _libs.THREE.Texture;texture.minFilter=_libs.THREE.LinearFilter,texture.image=img,texture.needsUpdate=!0,this.texture=texture,this.tilesHorizontal=tilesHoriz,this.tilesVertical=tilesVert,this.numberOfTiles=numTiles,texture.repeat.set(1/this.tilesHorizontal,1/this.tilesVertical),this.tileDisplayDuration=tileDispDuration,this.currentDisplayTime=0,this.currentTile=0}return TextureAnimator.prototype.update=function(milliSec){for(this.currentDisplayTime+=milliSec;this.currentDisplayTime>this.tileDisplayDuration;){this.currentDisplayTime-=this.tileDisplayDuration,++this.currentTile,this.currentTile==this.numberOfTiles&&(this.currentTile=0);var currentColumn=this.currentTile%this.tilesHorizontal;this.texture.offset.x=currentColumn/this.tilesHorizontal;var currentRow=Math.floor(this.currentTile/this.tilesHorizontal);this.texture.offset.y=currentRow/this.tilesVertical}},TextureAnimator.prototype.dispose=function(){var img=this.texture.image;img.height=img.width=0,this.texture.dispose()},TextureAnimator}();exports.default=TextureAnimator},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}exports.__esModule=!0;var _libs=__webpack_require__(0),_Utils=__webpack_require__(4),_Utils2=_interopRequireDefault(_Utils),_MouseEventConverter2=__webpack_require__(54),_MouseEventConverter3=_interopRequireDefault(_MouseEventConverter2),_ThreeEventConverter=__webpack_require__(19),_ThreeEventConverter2=_interopRequireDefault(_ThreeEventConverter),ThreeMouseEventConverter=function(_MouseEventConverter){function ThreeMouseEventConverter(wnd,doc,visualWorld,test){_classCallCheck(this,ThreeMouseEventConverter);var _this=_possibleConstructorReturn(this,_MouseEventConverter.call(this,wnd,doc,visualWorld.element));return _Utils2.default.extends(_this,new _ThreeEventConverter2.default(visualWorld,test)),_this}return _inherits(ThreeMouseEventConverter,_MouseEventConverter),ThreeMouseEventConverter.prototype.getCallback=function(object){return object.object.userData.mouseCallback},ThreeMouseEventConverter.prototype.setCoordsFromEvent=function(e){var jElement=(0,_libs.$)(this.element),offset=jElement.offset();return this.coords.x=(e.pageX-offset.left)/jElement.width()*2-1,this.coords.y=2*-((e.pageY-offset.top)/jElement.height())+1,this.coords},ThreeMouseEventConverter}(_MouseEventConverter3.default);exports.default=ThreeMouseEventConverter},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}exports.__esModule=!0;var _libs=__webpack_require__(0),_Utils=__webpack_require__(4),_Utils2=_interopRequireDefault(_Utils),_TouchEventConverter2=__webpack_require__(64),_TouchEventConverter3=_interopRequireDefault(_TouchEventConverter2),_ThreeEventConverter=__webpack_require__(19),_ThreeEventConverter2=_interopRequireDefault(_ThreeEventConverter),ThreeTouchEventConverter=function(_TouchEventConverter){function ThreeTouchEventConverter(wnd,doc,visualWorld,test){_classCallCheck(this,ThreeTouchEventConverter);var _this=_possibleConstructorReturn(this,_TouchEventConverter.call(this,wnd,doc,visualWorld.element));return _Utils2.default.extends(_this,new _ThreeEventConverter2.default(visualWorld,test)),_this}return _inherits(ThreeTouchEventConverter,_TouchEventConverter),ThreeTouchEventConverter.prototype.getCallback=function(object){return object.object.userData.touchCallback},ThreeTouchEventConverter.prototype.setCoordsFromEvent=function(e){var jElement=(0,_libs.$)(this.element),offset=jElement.offset(),touches=e.touches||e.originalEvent.touches,touch=touches.length?touches[0]:(this.lastTouches||[{pageX:0,pageY:0}])[0],pageX=touch.pageX,pageY=touch.pageY;return this.lastTouches=touches.length?touches:this.lastTouches,this.coords.x=(pageX-offset.left)/jElement.width()*2-1,this.coords.y=2*-((pageY-offset.top)/jElement.height())+1,this.coords},ThreeTouchEventConverter}(_TouchEventConverter3.default);exports.default=ThreeTouchEventConverter},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}exports.__esModule=!0;var _extends=Object.assign||function(target){for(var i=1;i4&&void 0!==arguments[4]?arguments[4]:{kWtoH:210/297};_classCallCheck(this,Thumbnails),this.container=container,this.p=props,this.thumbnailsClb=thumbnailsClb,this.size=size,this.canvas=(0,_libs.$)("")[0],this.imageFactory=new _ImageFactory2.default(_extends({},context,{renderCanvas:this.canvas,renderCanvasCtx:this.canvas.getContext("2d")})),this.thumbnails=[];for(var i=0;i=_iterator.length)break;_ref=_iterator[_i++]}else{if(_i=_iterator.next(),_i.done)break;_ref=_i.value}var thumbnail=_ref;Math.max(thumbnail.first,first)=_iterator2.length)break;_ref2=_iterator2[_i2++]}else{if(_i2=_iterator2.next(),_i2.done)break;_ref2=_i2.value}var thumbnail=_ref2;if(!thumbnail.loaded){this.load(thumbnail);break}}}},Thumbnails.prototype.setImage=function(thumbnail,img){thumbnail.img=img,thumbnail.thumbnail.css("background-image",["url('",img,"')"].join("")),thumbnail.thumbnail.removeClass("loading")},Thumbnails.prototype.render=function(){for(var elements=['
'],i=0;i
"].join(""));elements.push(""),this.container.append(elements.join(""));for(var items=this.container.find(".item"),base=this.container.find(".thumbnails").offset().top,_i3=0;_i3=_iterator3.length)break;_ref3=_iterator3[_i4++]}else{if(_i4=_iterator3.next(),_i4.done)break;_ref3=_i4.value}var a=_ref3;a.dataThumbnail=this.thumbnails[_i3]}}this.container.find("a").on("click",this.binds.navigate),this.built=!0},Thumbnails}();exports.default=Thumbnails},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}exports.__esModule=!0;var _libs=__webpack_require__(0),_EventConverter2=__webpack_require__(6),_EventConverter3=_interopRequireDefault(_EventConverter2),TouchConverter=function(_EventConverter){function TouchConverter(wnd,doc,element){_classCallCheck(this,TouchConverter);var _this=_possibleConstructorReturn(this,_EventConverter.call(this,wnd,doc));return _this.element=element,_this.binds={convert:_this.convert.bind(_this)},(0,_libs.$)(_this.element).on("touchstart touchmove",_this.binds.convert),(0,_libs.$)(_this.doc).on("touchend",_this.binds.convert), +_this}return _inherits(TouchConverter,_EventConverter),TouchConverter.prototype.dispose=function(){(0,_libs.$)(this.element).off("touchstart touchmove",this.binds.convert),(0,_libs.$)(this.doc).off("touchend",this.binds.convert)},TouchConverter}(_EventConverter3.default);exports.default=TouchConverter},function(module,exports,__webpack_require__){"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}exports.__esModule=!0;var _extends=Object.assign||function(target){for(var i=1;i2&&void 0!==arguments[2]?arguments[2]:{};_classCallCheck(this,View),this.pendings={},this.binds={onResize:this.onResize.bind(this)},this.parentContainer=(0,_libs.$)(parentContainer),this.isIOS=/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,this.parentContainer.html(''),this.frame=this.parentContainer.find("iframe")[0],this.frame.contentWindow.stop&&this.frame.contentWindow.stop(),this.isIOS&&((0,_libs.$)(this.parentContainer[0].ownerDocument.defaultView).on("resize",this.binds.onResize),this.onResize()),this.container=(0,_libs.$)(this.frame.contentDocument.body),this.container.css("margin","0"),this.head=(0,_libs.$)(this.frame.contentDocument.head),this.onLoad=onLoad,this.handlers=[];var script=template.html?template.script:this.getTemplate().script,urls={styles:template.styles||this.getTemplate().styles,html:[template.html||this.getTemplate().html],script:script?[script]:[]},files={},links=template.links||this.getTemplate().links;this.loadFiles(urls,files).then(function(){for(var _loop3=function(){if(_isArray6){if(_i6>=_iterator6.length)return"break";_ref6=_iterator6[_i6++]}else{if(_i6=_iterator6.next(),_i6.done)return"break";_ref6=_i6.value}var style=_ref6,textCss=style.data,url=style.url;textCss=textCss.replace(/url\(['"](.*?)["']\)/g,function(r,r1){return["url(",_this2.urlResolver(url,r1),")"].join("")}),(0,_libs.$)('").appendTo(_this2.head)},_iterator6=files.styles,_isArray6=Array.isArray(_iterator6),_i6=0,_iterator6=_isArray6?_iterator6:_iterator6[Symbol.iterator]();;){var _ref6,_ret3=_loop3();if("break"===_ret3)break}_this2.container.html(files.html[0].data);for(var _iterator7=links,_isArray7=Array.isArray(_iterator7),_i7=0,_iterator7=_isArray7?_iterator7:_iterator7[Symbol.iterator]();;){var _ref7;if(_isArray7){if(_i7>=_iterator7.length)break;_ref7=_iterator7[_i7++]}else{if(_i7=_iterator7.next(),_i7.done)break;_ref7=_i7.value}var link=_ref7;(0,_libs.$)(_this2.head).append([""].join(""))}if(files.script[0]){var init=eval(files.script[0].data);_this2.templateObject=init(_this2.container)}else _this2.templateObject={};_this2.linkControls={};for(var _iterator8=_this2.getLinks(),_isArray8=Array.isArray(_iterator8),_i8=0,_iterator8=_isArray8?_iterator8:_iterator8[Symbol.iterator]();;){var _ref8;if(_isArray8){if(_i8>=_iterator8.length)break;_ref8=_iterator8[_i8++]}else{if(_i8=_iterator8.next(),_i8.done)break;_ref8=_i8.value}var id=_ref8;_this2.linkControls[id]=_this2.container.find("."+id),_this2.binds[id]=View.handleLinkEvent.bind({getHandlers:_this2.getHandlers.bind(_this2),id:id}),_this2.linkControls[id].on("click",_this2.binds[id])}_this2.widgetControls={};for(var _iterator9=_this2.getWidgets(),_isArray9=Array.isArray(_iterator9),_i9=0,_iterator9=_isArray9?_iterator9:_iterator9[Symbol.iterator]();;){var _ref9;if(_isArray9){if(_i9>=_iterator9.length)break;_ref9=_iterator9[_i9++]}else{if(_i9=_iterator9.next(),_i9.done)break;_ref9=_i9.value}var _id=_ref9;_this2.widgetControls[_id]=_this2.container.find("."+_id)}_this2.inputControls={};for(var _iterator10=_this2.getInputs(),_isArray10=Array.isArray(_iterator10),_i10=0,_iterator10=_isArray10?_iterator10:_iterator10[Symbol.iterator]();;){var _ref10;if(_isArray10){if(_i10>=_iterator10.length)break;_ref10=_iterator10[_i10++]}else{if(_i10=_iterator10.next(),_i10.done)break;_ref10=_i10.value}var _id2=_ref10;_this2.inputControls[_id2]=_this2.container.find("."+_id2),_this2.binds[_id2]=View.handleInputEvent.bind({getHandlers:_this2.getHandlers.bind(_this2),id:_id2}),_this2.inputControls[_id2].on("keyup",_this2.binds[_id2])}_this2.formControls={};for(var _iterator11=_this2.getForms(),_isArray11=Array.isArray(_iterator11),_i11=0,_iterator11=_isArray11?_iterator11:_iterator11[Symbol.iterator]();;){var _ref11;if(_isArray11){if(_i11>=_iterator11.length)break;_ref11=_iterator11[_i11++]}else{if(_i11=_iterator11.next(),_i11.done)break;_ref11=_i11.value}var _id3=_ref11;_this2.formControls[_id3]=_this2.container.find("."+_id3),_this2.binds[_id3]=View.handleFormEvent.bind({getHandlers:_this2.getHandlers.bind(_this2),id:_id3}),_this2.formControls[_id3].on("submit",_this2.binds[_id3])}_this2.textControls={};for(var _iterator12=_this2.getTexts(),_isArray12=Array.isArray(_iterator12),_i12=0,_iterator12=_isArray12?_iterator12:_iterator12[Symbol.iterator]();;){var _ref12;if(_isArray12){if(_i12>=_iterator12.length)break;_ref12=_iterator12[_i12++]}else{if(_i12=_iterator12.next(),_i12.done)break;_ref12=_i12.value}var _id4=_ref12;_this2.textControls[_id4]=_this2.container.find("."+_id4)}_this2.stateSetters=[{map:_this2.linkControls,setter:_this2.setLinkControlState.bind(_this2)},{map:_this2.widgetControls,setter:_this2.setWidgetControlState.bind(_this2)},{map:_this2.inputControls,setter:_this2.setInputControlState.bind(_this2)},{map:_this2.textControls,setter:_this2.setTextControlState.bind(_this2)}],_this2.initView(),_this2.onLoad&&_this2.onLoad()}).catch(function(res){return console.error(res)})}return View.classProperty=function(ctrl,className,value){value?ctrl.addClass(className):ctrl.removeClass(className)},View.attributeProperty=function(ctrl,attributeName,value){value?ctrl.attr(attributeName,attributeName):ctrl.removeAttr(attributeName)},View.callHandlers=function(handlers,id,e,data){for(var _iterator=handlers,_isArray=Array.isArray(_iterator),_i=0,_iterator=_isArray?_iterator:_iterator[Symbol.iterator]();;){var _ref;if(_isArray){if(_i>=_iterator.length)break;_ref=_iterator[_i++]}else{if(_i=_iterator.next(),_i.done)break;_ref=_i.value}var handler=_ref;handler[id]?handler[id](e,data):handler.handleDefault&&handler.handleDefault(id,e,data)}},View.handleEvent=function(id,getHandlers,e,data){View.callHandlers(getHandlers(id),id,e,data)},View.handleLinkEvent=function(e){e.preventDefault(),View.handleEvent(this.id,this.getHandlers,e)},View.handleInputEvent=function(e){View.handleEvent(this.id,this.getHandlers,e,e.target.value)},View.handleFormEvent=function(e){e.preventDefault(),View.handleEvent(this.id,this.getHandlers,e)},View.prototype.getLinks=function(){return null},View.prototype.getWidgets=function(){return null},View.prototype.getInputs=function(){return null},View.prototype.getTexts=function(){return null},View.prototype.getTemplate=function(){return{}},View.prototype.getHandlers=function(id){return this.handlers},View.prototype.callLater=function(handlers,id,e,data,ms){var _this=this;this.pendings[id]={timestamp:(new Date).getTime()},setTimeout(function(){var timestamp=(new Date).getTime(),pending=_this.pendings[id];pending&×tamp-pending.timestamp>=ms&&(View.callHandlers(handlers,id,e,data),delete _this.pendings[id])},ms)},View.prototype.loadFiles=function(urls,files){for(var tasks=[],_loop=function(){if(_isArray2){if(_i2>=_iterator2.length)return"break";_ref2=_iterator2[_i2++]}else{if(_i2=_iterator2.next(),_i2.done)return"break";_ref2=_i2.value}var name=_ref2;files[name]=[];for(var _loop2=function(){if(_isArray3){if(_i3>=_iterator3.length)return"break";_ref3=_iterator3[_i3++]}else{if(_i3=_iterator3.next(),_i3.done)return"break";_ref3=_i3.value}var url=_ref3;tasks.push(new Promise(function(resolve,reject){_libs.$.get(url,function(data){files[name].push({url:url,data:data}),resolve()}).fail(function(res){reject(res)})}))},_iterator3=urls[name],_isArray3=Array.isArray(_iterator3),_i3=0,_iterator3=_isArray3?_iterator3:_iterator3[Symbol.iterator]();;){var _ref3,_ret2=_loop2();if("break"===_ret2)break}},_iterator2=Object.keys(urls),_isArray2=Array.isArray(_iterator2),_i2=0,_iterator2=_isArray2?_iterator2:_iterator2[Symbol.iterator]();;){var _ref2,_ret=_loop();if("break"===_ret)break}return Promise.all(tasks)},View.prototype.urlResolver=function(baseUrl,url){if(url=url.replace(/\\/g,"/"),"/"!==url.charAt(0)){baseUrl=baseUrl.replace(/\\/g,"/");var p=baseUrl.lastIndexOf("/");url=(~p?baseUrl.substr(0,p+1):"")+url;var parts=url.split("/");url=[];for(var _iterator4=parts,_isArray4=Array.isArray(_iterator4),_i4=0,_iterator4=_isArray4?_iterator4:_iterator4[Symbol.iterator]();;){var _ref4;if(_isArray4){if(_i4>=_iterator4.length)break;_ref4=_iterator4[_i4++]}else{if(_i4=_iterator4.next(),_i4.done)break;_ref4=_i4.value}var part=_ref4;"."===part||(".."===part?!url.length||1===url.length&&""===url[0]||url.pop():url.push(part))}url=url.join("/")}return url},View.prototype.objToAttrsStr=function(o){for(var res=[],_iterator5=Object.keys(o),_isArray5=Array.isArray(_iterator5),_i5=0,_iterator5=_isArray5?_iterator5:_iterator5[Symbol.iterator]();;){var _ref5;if(_isArray5){if(_i5>=_iterator5.length)break;_ref5=_iterator5[_i5++]}else{if(_i5=_iterator5.next(),_i5.done)break;_ref5=_i5.value}var _name=_ref5;res.push([_name,'="',o[_name],'"'].join(""))}return res.join(" ")},View.prototype.onResize=function(){this.frame.width=this.parentContainer.width(),this.frame.height=this.parentContainer.height()},View.prototype.dispose=function(){delete this.textControls;for(var _iterator13=this.getLinks(),_isArray13=Array.isArray(_iterator13),_i13=0,_iterator13=_isArray13?_iterator13:_iterator13[Symbol.iterator]();;){var _ref13;if(_isArray13){if(_i13>=_iterator13.length)break;_ref13=_iterator13[_i13++]}else{if(_i13=_iterator13.next(),_i13.done)break;_ref13=_i13.value}var id=_ref13;this.linkControls[id].off("click",this.binds[id])}delete this.linkControls,delete this.widgetControls;for(var _iterator14=this.getInputs(),_isArray14=Array.isArray(_iterator14),_i14=0,_iterator14=_isArray14?_iterator14:_iterator14[Symbol.iterator]();;){var _ref14;if(_isArray14){if(_i14>=_iterator14.length)break;_ref14=_iterator14[_i14++]}else{if(_i14=_iterator14.next(),_i14.done)break;_ref14=_i14.value}var _id5=_ref14;this.inputControls[_id5].off("keyup",this.binds[_id5])}delete this.inputControls;for(var _iterator15=this.getForms(),_isArray15=Array.isArray(_iterator15),_i15=0,_iterator15=_isArray15?_iterator15:_iterator15[Symbol.iterator]();;){var _ref15;if(_isArray15){if(_i15>=_iterator15.length)break;_ref15=_iterator15[_i15++]}else{if(_i15=_iterator15.next(),_i15.done)break;_ref15=_i15.value}var _id6=_ref15;this.formControls[_id6].off("submit",this.binds[_id6])}delete this.formControls,!this.templateObject.dispose||this.templateObject.dispose(),this.isIOS&&(0,_libs.$)(this.parentContainer[0].ownerDocument.defaultView).off("resize",this.binds.onResize),this.parentContainer.html("")},View.prototype.getContainer=function(){return this.container[0]},View.prototype.getParentContainer=function(){return this.parentContainer[0]},View.prototype.addHandler=function(handler){this.handlers.push(handler)},View.prototype.initView=function(){},View.setControlState=function(ctrl,defaults,state,stateHandlers){if(ctrl){var st=_extends({},defaults,state);for(var _name2 in st)st.hasOwnProperty(_name2)&&stateHandlers[_name2]&&stateHandlers[_name2](ctrl,st[_name2])}},View.prototype.setLinkControlState=function(id,state){View.setControlState(this.linkControls[id],{visible:!0,active:!1,enable:!0},state,View.linkStateHandlers)},View.prototype.setWidgetControlState=function(id,state){View.setControlState(this.widgetControls[id],{visible:!0,active:!1,enable:!0},state,View.widgetStateHandlers)},View.prototype.setInputControlState=function(id,state){View.setControlState(this.inputControls[id],{visible:!0,enable:!0,value:""},state,View.inputStateHandlers)},View.prototype.setTextControlState=function(id,state){View.setControlState(this.textControls[id],{visible:!0,value:""},state,View.textStateHandlers)},View.prototype.onItemStateChanged=function(){},View.prototype.setState=function(id,state){for(var _iterator16=this.stateSetters,_isArray16=Array.isArray(_iterator16),_i16=0,_iterator16=_isArray16?_iterator16:_iterator16[Symbol.iterator]();;){var _ref16;if(_isArray16){if(_i16>=_iterator16.length)break;_ref16=_iterator16[_i16++]}else{if(_i16=_iterator16.next(),_i16.done)break;_ref16=_i16.value}var item=_ref16;if(item.map[id]){item.setter(id,state),this.onItemStateChanged(id,state);break}}},View}();View.linkStateHandlers={visible:function(ctrl,value){return View.classProperty(ctrl,"hidden",!value)},active:function(ctrl,value){return View.classProperty(ctrl,"active",value)},enable:function(ctrl,value){return View.classProperty(ctrl,"disabled",!value)}},View.widgetStateHandlers={visible:function(ctrl,value){return View.classProperty(ctrl,"hidden",!value)},active:function(ctrl,value){return View.classProperty(ctrl,"active",value)},enable:function(ctrl,value){return View.classProperty(ctrl,"disabled",!value)}},View.inputStateHandlers={visible:function(ctrl,value){return View.classProperty(ctrl,"hidden",!value)},value:function(ctrl,_value){return ctrl[0].value=_value},enable:function(ctrl,value){return View.attributeProperty(ctrl,"disabled",!value)}},View.textStateHandlers={visible:function(ctrl,value){return View.classProperty(ctrl,"hidden",!value)},value:function(ctrl,_value2){return ctrl.text(_value2)}},exports.default=View},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}exports.__esModule=!0;var _extends=Object.assign||function(target){for(var i=1;i3&&void 0!==arguments[3]&&arguments[3];_classCallCheck(this,VisualWorld),this.wnd=wnd,this.doc=doc,this.jContainer=container,this.renderCallbacks=[],this.clock=new _libs.THREE.Clock,this.raycaster=new _libs.THREE.Raycaster,this.scene=new _libs.THREE.Scene,this.cssScene=new _libs.THREE.Scene,this.camera=new _libs.THREE.PerspectiveCamera(30,this.width()/this.height(),.2,2e3);var scale=1;this.camera.position.x=0,this.camera.position.y=5.5*scale,this.camera.position.z=0,this.renderer=new _libs.THREE.WebGLRenderer({alpha:!0,antialias:!0}),this.renderer.setClearColor(0,0),this.renderer.setPixelRatio(this.wnd.devicePixelRatio),this.renderer.setSize(this.width(),this.height()),this.jContainer.append(this.renderer.domElement),this.cssRenderer=new _CSS3DRenderer2.default,this.cssRenderer.setSize(this.width(),this.height()),(0,_libs.$)(this.cssRenderer.domElement).css({position:"absolute",top:0,margin:0,padding:0}),this.jContainer.append(this.cssRenderer.domElement),this.element=this.cssRenderer.domElement,this.controls=new _Orbit2.default(this.camera,this.element),this.controls.target.y=.5;var cssScene=(0,_libs.$)(this.cssRenderer.domElement).find("div"),tmpVector=new _libs.THREE.Vector3;this.controls.addEventListener("change",function(){_this.camera.getWorldDirection(tmpVector),cssScene.css("display",tmpVector.y-_this.camera.position.y>0?"none":"block")}),this.textureLoader=new _libs.THREE.TextureLoader,this.scene.add(new _libs.THREE.AmbientLight(13684944)),this.light=new _libs.THREE.DirectionalLight(4210752,1),this.light.position.set(0,6*scale,0),this.light.castShadow=!1,this.scene.add(this.light),useHelpers&&this.scene.add(new _libs.THREE.AxisHelper(5)),this.binds={onWindowResize:this.onWindowResize.bind(this),animate:this.animate.bind(this)},(0,_libs.$)(this.wnd).on("resize",this.binds.onWindowResize),this.mouseEvents=new _ThreeMouseEventConverter2.default(this.wnd,this.doc,this),this.touchEvents=new _ThreeTouchEventConverter2.default(this.wnd,this.doc,this);var filterData={type:"mousemove"};this.mouseEvents.filter=function(element,e){var types=["mouseenter","mouseover","mouseleave","mouseout"],contains=function(p,c){return p===c||_libs.$.contains(p,c)};return"mousemove"===e.type&&(filterData.pageX=e.pageX,filterData.pageY=e.pageY),e.relatedTarget&&~types.indexOf(e.type)&&contains(element,e.target)&&contains(element,e.relatedTarget)?_extends({},e,filterData):e},this.drag=new _Drag2.default(this.wnd,this.doc,this),this.animate()}return VisualWorld.prototype.dispose=function(){delete this.binds.animate,(0,_libs.$)(this.wnd).off("resize",this.binds.onWindowResize),this.mouseEvents.dispose(),this.touchEvents.dispose(),this.drag.dispose(),this.controls.dispose()},VisualWorld.prototype.width=function(){return this.jContainer.width()},VisualWorld.prototype.height=function(){return this.jContainer.height()},VisualWorld.prototype.setExtraLighting=function(v){this.light.intensity=v},VisualWorld.prototype.getOrbit=function(){return this.controls},VisualWorld.prototype.setControlsState=function(state){this.controls.enabled=state},VisualWorld.prototype.getControlsState=function(){return this.controls.enabled},VisualWorld.prototype.onWindowResize=function(){var _this2=this,updateCamera=function(camera){camera.aspect=_this2.width()/_this2.height(),camera.updateProjectionMatrix()},updateRenderer=function(renderer){renderer.setSize(_this2.width(),_this2.height())};updateCamera(this.camera),updateRenderer(this.renderer),updateRenderer(this.cssRenderer)},VisualWorld.prototype.addObject=function(object){this.scene.add(object)},VisualWorld.prototype.addCssObject=function(object){this.cssScene.add(object)},VisualWorld.prototype.removeCssObject=function(object){this.cssScene.remove(object)},VisualWorld.prototype.removeObject=function(object){this.scene.remove(object)},VisualWorld.prototype.animate=function(){this.binds.animate&&requestAnimationFrame(this.binds.animate),this.render()},VisualWorld.prototype.addRenderCallback=function(clb){this.renderCallbacks.push(clb)},VisualWorld.prototype.removeRenderCallback=function(clb){var i=this.renderCallbacks.indexOf(clb);~i&&this.renderCallbacks.splice(i,1)},VisualWorld.prototype.render=function(){var deltaTime=this.clock.getDelta();this.controls.update(deltaTime);for(var _iterator=this.renderCallbacks,_isArray=Array.isArray(_iterator),_i=0,_iterator=_isArray?_iterator:_iterator[Symbol.iterator]();;){var _ref;if(_isArray){if(_i>=_iterator.length)break;_ref=_iterator[_i++]}else{if(_i=_iterator.next(),_i.done)break;_ref=_i.value}var clb=_ref;clb(deltaTime)}this.cssRenderer.render(this.cssScene,this.camera),this.renderer.render(this.scene,this.camera)},VisualWorld.prototype.processGeometry=function(bufGeometry,mesh){mesh.geometry=bufGeometry;var geometry=(new _libs.THREE.Geometry).fromBufferGeometry(bufGeometry);geometry.mergeVertices();var indexedBufferGeom=this.createIndexedBufferGeometryFromGeometry(geometry);return this.mapIndices(bufGeometry,indexedBufferGeom)},VisualWorld.prototype.createIndexedBufferGeometryFromGeometry=function(geometry){for(var numVertices=geometry.vertices.length,numFaces=geometry.faces.length,bufferGeom=new _libs.THREE.BufferGeometry,vertices=new Float32Array(3*numVertices),indices=new(3*numFaces>65535?Uint32Array:Uint16Array)(3*numFaces),i=0;ig+1e3&&(r.update(1e3*a/(c-g),100),g=c,a=0,t)){var d=performance.memory;t.update(d.usedJSHeapSize/1048576,d.jsHeapSizeLimit/1048576)}return c},update:function(){k=this.end()},domElement:c,setMode:u}};return f.Panel=function(e,f,l){var c=1/0,k=0,g=Math.round,a=g(window.devicePixelRatio||1),r=80*a,h=48*a,t=3*a,v=2*a,d=3*a,m=15*a,n=74*a,p=30*a,q=document.createElement("canvas");q.width=r,q.height=h,q.style.cssText="width:80px;height:48px";var b=q.getContext("2d");return b.font="bold "+9*a+"px Helvetica,Arial,sans-serif",b.textBaseline="top",b.fillStyle=l,b.fillRect(0,0,r,h),b.fillStyle=f,b.fillText(e,t,v),b.fillRect(d,m,n,p),b.fillStyle=l,b.globalAlpha=.9,b.fillRect(d,m,n,p),{dom:q,update:function(h,w){c=Math.min(c,h),k=Math.max(k,h),b.fillStyle=l,b.globalAlpha=1,b.fillRect(0,0,r,m),b.fillStyle=f,b.fillText(g(h)+" "+e+" ("+g(c)+"-"+g(k)+")",t,v),b.drawImage(q,d+a,m,n-a,p,d,m,n-a,p),b.fillRect(d+n-a,m,a,p),b.fillStyle=l,b.globalAlpha=.9,b.fillRect(d+n-a,m,a,g((1-h/w)*p))}}},f})},function(module,exports,__webpack_require__){var define=!1;/*! + * jQuery Mousewheel 3.1.13 + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + */ +!function(factory){"function"==typeof define&&define.amd?define(["jquery"],factory):module.exports=factory}(function($){function handler(event){var orgEvent=event||window.event,args=slice.call(arguments,1),delta=0,deltaX=0,deltaY=0,absDelta=0,offsetX=0,offsetY=0;if(event=$.event.fix(orgEvent),event.type="mousewheel","detail"in orgEvent&&(deltaY=orgEvent.detail*-1),"wheelDelta"in orgEvent&&(deltaY=orgEvent.wheelDelta),"wheelDeltaY"in orgEvent&&(deltaY=orgEvent.wheelDeltaY),"wheelDeltaX"in orgEvent&&(deltaX=orgEvent.wheelDeltaX*-1),"axis"in orgEvent&&orgEvent.axis===orgEvent.HORIZONTAL_AXIS&&(deltaX=deltaY*-1,deltaY=0),delta=0===deltaY?deltaX:deltaY,"deltaY"in orgEvent&&(deltaY=orgEvent.deltaY*-1,delta=deltaY),"deltaX"in orgEvent&&(deltaX=orgEvent.deltaX,0===deltaY&&(delta=deltaX*-1)),0!==deltaY||0!==deltaX){if(1===orgEvent.deltaMode){var lineHeight=$.data(this,"mousewheel-line-height");delta*=lineHeight,deltaY*=lineHeight,deltaX*=lineHeight}else if(2===orgEvent.deltaMode){var pageHeight=$.data(this,"mousewheel-page-height");delta*=pageHeight,deltaY*=pageHeight,deltaX*=pageHeight}if(absDelta=Math.max(Math.abs(deltaY),Math.abs(deltaX)),(!lowestDelta||absDelta=1?"floor":"ceil"](delta/lowestDelta),deltaX=Math[deltaX>=1?"floor":"ceil"](deltaX/lowestDelta),deltaY=Math[deltaY>=1?"floor":"ceil"](deltaY/lowestDelta),special.settings.normalizeOffset&&this.getBoundingClientRect){var boundingRect=this.getBoundingClientRect();offsetX=event.clientX-boundingRect.left,offsetY=event.clientY-boundingRect.top}return event.deltaX=deltaX,event.deltaY=deltaY,event.deltaFactor=lowestDelta,event.offsetX=offsetX,event.offsetY=offsetY,event.deltaMode=0,args.unshift(event,delta,deltaX,deltaY),nullLowestDeltaTimeout&&clearTimeout(nullLowestDeltaTimeout),nullLowestDeltaTimeout=setTimeout(nullLowestDelta,200),($.event.dispatch||$.event.handle).apply(this,args)}}function nullLowestDelta(){lowestDelta=null}function shouldAdjustOldDeltas(orgEvent,absDelta){return special.settings.adjustOldDeltas&&"mousewheel"===orgEvent.type&&absDelta%120===0}var nullLowestDeltaTimeout,lowestDelta,toFix=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],toBind="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],slice=Array.prototype.slice;if($.event.fixHooks)for(var i=toFix.length;i;)$.event.fixHooks[toFix[--i]]=$.event.mouseHooks;var special=$.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var i=toBind.length;i;)this.addEventListener(toBind[--i],handler,!1);else this.onmousewheel=handler;$.data(this,"mousewheel-line-height",special.getLineHeight(this)),$.data(this,"mousewheel-page-height",special.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var i=toBind.length;i;)this.removeEventListener(toBind[--i],handler,!1);else this.onmousewheel=null;$.removeData(this,"mousewheel-line-height"),$.removeData(this,"mousewheel-page-height")},getLineHeight:function(elem){var $elem=$(elem),$parent=$elem["offsetParent"in $.fn?"offsetParent":"parent"]();return $parent.length||($parent=$("body")),parseInt($parent.css("fontSize"),10)||parseInt($elem.css("fontSize"),10)||16},getPageHeight:function(elem){return $(elem).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};$.fn.extend({mousewheel:function(fn){return fn?this.bind("mousewheel",fn):this.trigger("mousewheel")},unmousewheel:function(fn){return this.unbind("mousewheel",fn)}})})},function(module,exports,__webpack_require__){__webpack_require__(23),module.exports=__webpack_require__(22)}]); \ No newline at end of file diff --git a/js/bootstrap.min.js b/js/bootstrap.min.js new file mode 100644 index 0000000..e1cd129 --- /dev/null +++ b/js/bootstrap.min.js @@ -0,0 +1,7 @@ +/*! + * Bootstrap v3.3.7 (http://getbootstrap.com) + * Copyright 2011-2016 Twitter, Inc. + * Licensed under the MIT license + */ +if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1||b[0]>3)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){if(a(b.target).is(this))return b.handleObj.handler.apply(this,arguments)}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.7",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a("#"===f?[]:f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.7",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c).prop(c,!0)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c).prop(c,!1))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")?(c.prop("checked")&&(a=!1),b.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==c.prop("type")&&(c.prop("checked")!==this.$element.hasClass("active")&&(a=!1),this.$element.toggleClass("active")),c.prop("checked",this.$element.hasClass("active")),a&&c.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target).closest(".btn");b.call(d,"toggle"),a(c.target).is('input[type="radio"], input[type="checkbox"]')||(c.preventDefault(),d.is("input,button")?d.trigger("focus"):d.find("input:visible,button:visible").first().trigger("focus"))}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.7",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));if(!(a>this.$items.length-1||a<0))return this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){if(!this.sliding)return this.slide("next")},c.prototype.prev=function(){if(!this.sliding)return this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a('[data-toggle="collapse"][href="#'+b.id+'"],[data-toggle="collapse"][data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.7",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":e.data();c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function c(c){c&&3===c.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=b(d),f={relatedTarget:this};e.hasClass("open")&&(c&&"click"==c.type&&/input|textarea/i.test(c.target.tagName)&&a.contains(e[0],c.target)||(e.trigger(c=a.Event("hide.bs.dropdown",f)),c.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger(a.Event("hidden.bs.dropdown",f)))))}))}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.7",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=b(e),g=f.hasClass("open");if(c(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click",c);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger(a.Event("shown.bs.dropdown",h))}return!1}},g.prototype.keydown=function(c){if(/(38|40|27|32)/.test(c.which)&&!/input|textarea/i.test(c.target.tagName)){var d=a(this);if(c.preventDefault(),c.stopPropagation(),!d.is(".disabled, :disabled")){var e=b(d),g=e.hasClass("open");if(!g&&27!=c.which||g&&27==c.which)return 27==c.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.disabled):visible a",i=e.find(".dropdown-menu"+h);if(i.length){var j=i.index(c.target);38==c.which&&j>0&&j--,40==c.which&&jdocument.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},c.prototype.checkScrollbar=function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this.bodyIsOverflowing=document.body.clientWidth
',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(a.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusin"==b.type?"focus":"hover"]=!0),c.tip().hasClass("in")||"in"==c.hoverState?void(c.hoverState="in"):(clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.isInStateTrue=function(){for(var a in this.inState)if(this.inState[a])return!0;return!1},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);if(c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusout"==b.type?"focus":"hover"]=!1),!c.isInStateTrue())return clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide()},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.getPosition(this.$viewport);h="bottom"==h&&k.bottom+m>o.bottom?"top":"top"==h&&k.top-mo.width?"left":"left"==h&&k.left-lg.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;jg.right&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){if(!this.$tip&&(this.$tip=a(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),b?(c.inState.click=!c.inState.click,c.isInStateTrue()?c.enter(c):c.leave(c)):c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type),a.$tip&&a.$tip.detach(),a.$tip=null,a.$arrow=null,a.$viewport=null,a.$element=null})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;!e&&/destroy|hide/.test(b)||(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.3.7",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:''}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){this.$body=a(document.body),this.$scrollElement=a(a(c).is(document.body)?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",a.proxy(this.process,this)),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.3.7",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b=this,c="offset",d=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),a.isWindow(this.$scrollElement[0])||(c="position",d=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var b=a(this),e=b.data("target")||b.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[c]().top+d,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b=e[a]&&(void 0===e[a+1]||b .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu").length&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.7",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return e=a-d&&"bottom"},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=Math.max(a(document).height(),a(document.body).height());"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery); \ No newline at end of file diff --git a/js/default-book-view.js b/js/default-book-view.js new file mode 100644 index 0000000..d0ab2d1 --- /dev/null +++ b/js/default-book-view.js @@ -0,0 +1,94 @@ +function init(container) { + var instance; + if(window.jQuery) { + var $ = window.jQuery; + instance = { + floatWnd: container.find('.float-wnd'), + binds: { + showDropMenu: function(e) { + e.preventDefault(); + var el = $(e.target); + while(!el.hasClass('toggle')) { + el = $(el[0].parentNode); + } + var menu = el.find('.menu'); + if(menu.hasClass('hidden')) { + container.find('.ctrl .fnavbar .menu').addClass('hidden'); + menu.removeClass('hidden'); + e.stopPropagation(); + } + }, + hideDropMenu: function() { + container.find('.ctrl .fnavbar .menu').addClass('hidden'); + }, + pickFloatWnd: function(e) { + if(instance.pos) { + instance.binds.dropFloatWnd(); + } + else { + instance.pos = { + x: e.pageX, + y: e.pageY + }; + } + }, + moveFloatWnd: function(e) { + if(instance.pos) { + var dv = { + x: e.pageX-instance.pos.x, + y: e.pageY-instance.pos.y + }, old = { + x: parseInt(instance.floatWnd.css('left')), + y: parseInt(instance.floatWnd.css('top')) + }; + instance.floatWnd.css('left', old.x+dv.x+'px').css('top', old.y+dv.y+'px'); + instance.pos = { + x: e.pageX, + y: e.pageY + }; + } + }, + dropFloatWnd: function() { + delete instance.pos; + }, + jsCenter: function() { + var ns = container.find('.js-center'); + for(var i=0; i 100; + var isLoop = this.states[this.activeState].loop !== undefined ? this.states[this.activeState].loop : true; + var progressPercent, isLooping, nextGradient; + + // If tab was inactive then resumed, reset the previous timestamp + if (this.previousTimeStamp === null || wasWindowIdled) { + this.previousTimeStamp = timestamp; + } + + // Compute progress and save the timestamp + this.progress = this.progress + (timestamp - this.previousTimeStamp); + progressPercent = (this.progress / this.activetransitionSpeed * 100).toFixed(2); + this.previousTimeStamp = timestamp; + + // Set the new gradient colors in a property + this.refreshColorsAndPos(progressPercent); + + // Continue the animation or prepare for the next one + if (progressPercent < 100) { + this.animation = requestAnimationFrame(this.animateColors.bind(this)); + + } else { + // if the current animation index is inferior to the penultimate gradient + // or to the last gradient with the loop mode activated + if (this.channelsIndex < this.states[this.activeState].gradients.length - 2 || isLoop) { + + // Set the active transition speed to the active state one after changing state + if (this.isChangingState) { + this.activetransitionSpeed = this.states[this.activeState].transitionSpeed || 5000; + this.isChangingState = false; + } + + // Resetting properties + this.previousTimeStamp = null; + this.progress = 0; + this.channelsIndex++; + isLooping = false; + + // If it's going to loop or if it's the transition after the loop + if (this.channelsIndex === this.states[this.activeState].gradients.length - 1) { + isLooping = true; + + } else if (this.channelsIndex === this.states[this.activeState].gradients.length) { + this.channelsIndex = 0; + } + + // Checking the next gradient to send in args of an event and a callback + nextGradient = this.states[this.activeState].gradients[this.channelsIndex + 1] === undefined ? + this.states[this.activeState].gradients[0] : + this.states[this.activeState].gradients[this.channelsIndex + 1]; + + // Compute the colors for the transition and render a new frame + this.setColors(); + this.animation = requestAnimationFrame(this.animateColors.bind(this)); + + // Callback and Event + if (this.callbacks.onGradientChange) { + this.callbacks.onGradientChange({ + isLooping: isLooping, + colorsFrom: this.states[this.activeState].gradients[this.channelsIndex], + colorsTo: nextGradient, + activeState: this.activeState + }); + } + + this.canvas.dispatchEvent(this.events.gradientChange({ + isLooping: isLooping, + colorsFrom: this.states[this.activeState].gradients[this.channelsIndex], + colorsTo: nextGradient, + activeState: this.activeState + })); + + // Else if it was the last gradient on the list and the loop mode is off + } else { + cancelAnimationFrame(this.animation); + + // Callback and Event + if (this.callbacks.onEnd) this.callbacks.onEnd(); + this.canvas.dispatchEvent(new CustomEvent('granim:end')); + } + } +}; + +},{}],3:[function(require,module,exports){ +'use strict'; + +module.exports = function(newBlendingMode) { + this.context.clearRect(0, 0, this.x1, this.y1); + this.context.globalCompositeOperation = + this.image.blendingMode = newBlendingMode; + this.validateInput('blendingMode'); + if (this.isPaused) this.refreshColorsAndPos(); +}; + +},{}],4:[function(require,module,exports){ +'use strict'; + +module.exports = function(newDirection) { + this.context.clearRect(0, 0, this.x1, this.y1); + this.direction = newDirection; + this.validateInput('direction'); + if (this.isPaused) this.refreshColorsAndPos(); +}; + +},{}],5:[function(require,module,exports){ +'use strict'; + +module.exports = function(newState) { + var _this = this; + + // Prevent transitioning to the same state + if (this.activeState === newState) { + return; + } + + // Setting the good properties for the transition + if (!this.isPaused) { + this.isPaused = true; + this.pause(); + } + + this.channelsIndex = -1; + this.activetransitionSpeed = this.stateTransitionSpeed; + this.activeColorsDiff = []; + this.activeColorsPosDiff = []; + this.activeColors = this.getCurrentColors(); + this.activeColorsPos = this.getCurrentColorsPos(); + this.progress = 0; + this.previousTimeStamp = null; + this.isChangingState = true; + + // Compute the gradient color and pos diff between the last frame gradient + // and the first one of the new state + this.states[newState].gradients[0].forEach(function(gradientColor, i, arr) { + var nextColors = _this.convertColorToRgba(_this.getColor(gradientColor)); + var nextColorsPos = _this.getColorPos(gradientColor, i); + var colorDiff = _this.getColorDiff(_this.activeColors[i], nextColors); + var colorPosDiff = _this.getColorPosDiff(_this.activeColorsPos[i], nextColorsPos); + _this.activeColorsDiff.push(colorDiff); + _this.activeColorsPosDiff.push(colorPosDiff); + }); + + // Start the animation + this.activeState = newState; + this.play(); +}; + +},{}],6:[function(require,module,exports){ +'use strict'; + +module.exports = function() { + if (!this.isPaused) { + cancelAnimationFrame(this.animation); + + } else { + this.isPaused = false; + } + this.isCleared = true; + this.context.clearRect(0, 0, this.x1, this.y1); +}; + +},{}],7:[function(require,module,exports){ +'use strict'; + +var regex = { + hexa: /^#(?:[0-9a-fA-F]{3}){1,2}$/, + rgba: /^rgba\((\d{1,3}), ?(\d{1,3}), ?(\d{1,3}), ?(.?\d{1,3})\)$/, + rgb: /^rgb\((\d{1,3}), ?(\d{1,3}), ?(\d{1,3})\)$/, + hsla: /^hsla\((\d{1,3}), ?(\d{1,3})%, ?(\d{1,3})%, ?(.?\d{1,3})\)$/, + hsl: /^hsl\((\d{1,3}), ?(\d{1,3})%, ?(\d{1,3})%\)$/ +}, match; + +module.exports = function(color) { + switch(identifyColorType(color)) { + default: + this.triggerError('colorType'); + + case 'hexa': + return hexToRgba(color); + + case 'rgba': + return [ + parseInt(match[1], 10), + parseInt(match[2], 10), + parseInt(match[3], 10), + parseFloat(match[4]) + ]; + + case 'rgb': + return [ + parseInt(match[1], 10), + parseInt(match[2], 10), + parseInt(match[3], 10), + 1 + ]; + + case 'hsla': + return hslaToRgb( + parseInt(match[1], 10) / 360, + parseInt(match[2], 10) / 100, + parseInt(match[3], 10) / 100, + parseFloat(match[4]) + ); + + case 'hsl': + return hslaToRgb( + parseInt(match[1], 10) / 360, + parseInt(match[2], 10) / 100, + parseInt(match[3], 10) / 100, + 1 + ); + } +}; + +function identifyColorType(color) { + var colorTypes = Object.keys(regex); + var i = 0; + for (i; i < colorTypes.length; i++) { + match = regex[colorTypes[i]].exec(color); + if (match) return colorTypes[i]; + } + return false; +} + +function hexToRgba(hex) { + // Expand shorthand form (e.g. '03F') to full form (e.g. '0033FF') + var shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i; + hex = hex.replace(shorthandRegex, function(m, r, g, b) { + return r + r + g + g + b + b; + }); + var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); + return result ? [ + parseInt(result[1], 16), + parseInt(result[2], 16), + parseInt(result[3], 16), + 1 + ] : null; +} + +function hue2rgb(p, q, t) { + if (t < 0) t += 1; + if (t > 1) t -= 1; + if (t < 1 / 6) return p + (q - p) * 6 * t; + if (t < 1 / 2) return q; + if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6; + return p; +} + +function hslaToRgb(h, s, l, a) { + var r, g, b, q, p; + if (s === 0) { + r = g = b = l; // achromatic + } else { + q = l < 0.5 ? l * (1 + s) : l + s - l * s; + p = 2 * l - q; + r = hue2rgb(p, q, h + 1/3); + g = hue2rgb(p, q, h); + b = hue2rgb(p, q, h - 1/3); + } + return [Math.round(r * 255), Math.round(g * 255), Math.round(b * 255), a]; +} + +},{}],8:[function(require,module,exports){ +'use strict'; + +module.exports = function() { + this.onResize('removeListeners'); + this.onScroll('removeListeners'); + this.clear(); +}; + +},{}],9:[function(require,module,exports){ +'use strict'; + +module.exports = function() { + if ( typeof window.CustomEvent === 'function' ) return; + + function CustomEvent(event, params) { + params = params || { bubbles: false, cancelable: false, detail: undefined }; + var evt = document.createEvent('CustomEvent'); + evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); + return evt; + } + + CustomEvent.prototype = window.Event.prototype; + + window.CustomEvent = CustomEvent; +}; + +},{}],10:[function(require,module,exports){ +'use strict'; + +module.exports = function(gradientColor) { + if (typeof gradientColor === 'string') { + return gradientColor; + + } else if (typeof gradientColor === 'object' && gradientColor.color) { + return gradientColor.color; + + } else { + this.triggerError('gradient.color'); + } +}; + +},{}],11:[function(require,module,exports){ +'use strict'; + +module.exports = function(colorA, colorB) { + var i = 0; + var colorDiff = []; + + for (i; i < 4; i++) { + colorDiff.push(colorB[i] - colorA[i]); + } + + return colorDiff; +}; + +},{}],12:[function(require,module,exports){ +'use strict'; + +module.exports = function(gradientColor, i) { + if (typeof gradientColor === 'object' && gradientColor.pos) { + return gradientColor.pos; + + } else { + // Ensure first and last position to be 0 and 100 + return parseFloat(!i ? 0 : ((1 / (this.gradientLength - 1)) * i).toFixed(2)); + } +}; + +},{}],13:[function(require,module,exports){ +'use strict'; + +module.exports = function(posA, posB) { + return posB - posA; +}; + +},{}],14:[function(require,module,exports){ +'use strict'; + +module.exports = function() { + var i, j; + var currentColors = []; + + for (i = 0; i < this.currentColors.length; i++) { + currentColors.push([]); + + for (j = 0; j < 4; j++) { + currentColors[i].push(this.currentColors[i][j]); + } + } + + // Return a deep copy of the current colors + return currentColors; +}; + +},{}],15:[function(require,module,exports){ +'use strict'; + +module.exports = function() { + var currentColorsPos = [], i; + + for (i = 0; i < this.currentColorsPos.length; i++) { + currentColorsPos.push(this.currentColorsPos[i]); + } + + // Return a deep copy of the current colors + return currentColorsPos; +}; + +},{}],16:[function(require,module,exports){ +'use strict'; + +module.exports = function() { + this.x1 = this.canvas.offsetWidth; + this.y1 = this.canvas.offsetHeight; +}; + +},{}],17:[function(require,module,exports){ +'use strict'; + +module.exports = function(element) { + if (element instanceof HTMLCanvasElement) { + this.canvas = element; + + } else if (typeof element === 'string') { + this.canvas = document.querySelector(element); + + } else { + throw new Error('The element you used is neither a String, nor a HTMLCanvasElement'); + } + + if (!this.canvas) { + throw new Error('`' + element + '` could not be found in the DOM'); + } +}; + +},{}],18:[function(require,module,exports){ +'use strict'; + +module.exports = function() { + var currentColors = this.getCurrentColors(); + var gradientAverage = null; + var lightnessAverage, i; + var colorsAverage = currentColors.map(function(el) { + // Compute the average lightness of each color + // in the current gradient + return Math.max(el[0], el[1], el[2]); + }); + + for (i = 0; i < colorsAverage.length; i++) { + // Add all the average lightness of each color + gradientAverage = gradientAverage === null ? + colorsAverage[i] : gradientAverage + colorsAverage[i]; + + if (i === colorsAverage.length - 1) { + // if it's the last lightness average + // divide it by the total length to + // have the global average lightness + lightnessAverage = Math.round(gradientAverage / (i + 1)); + } + } + + return lightnessAverage >= 128 ? 'light' : 'dark'; +}; + +},{}],19:[function(require,module,exports){ +'use strict'; + +module.exports = function() { + var gradient = this.setDirection(); + var elToSetClassOnClass = document.querySelector(this.elToSetClassOn).classList; + var i = 0; + this.context.clearRect(0, 0, this.x1, this.y1); + + if (this.image) { + this.context.drawImage( + this.imageNode, + this.imagePosition.x, + this.imagePosition.y, + this.imagePosition.width, + this.imagePosition.height + ); + } + + for (i; i < this.currentColors.length; i++) { + gradient.addColorStop(this.currentColorsPos[i], 'rgba(' + + this.currentColors[i][0] + ', ' + + this.currentColors[i][1] + ', ' + + this.currentColors[i][2] + ', ' + + this.currentColors[i][3] + ')' + ); + } + + if (this.name) { + if (this.getLightness() === 'light') { + elToSetClassOnClass.remove(this.name + '-dark'); + elToSetClassOnClass.add(this.name + '-light'); + + } else { + elToSetClassOnClass.remove(this.name + '-light'); + elToSetClassOnClass.add(this.name + '-dark'); + } + } + + this.context.fillStyle = gradient; + this.context.fillRect(0, 0, this.x1, this.y1); +}; + +},{}],20:[function(require,module,exports){ +'use strict'; + +module.exports = function(type) { + if (type === 'removeListeners') { + window.removeEventListener('resize', this.setSizeAttributesNameSpace); + return; + } + + window.addEventListener('resize', this.setSizeAttributesNameSpace); +}; + +},{}],21:[function(require,module,exports){ +'use strict'; + +module.exports = function(type) { + if (type === 'removeListeners') { + window.removeEventListener('scroll', this.pauseWhenNotInViewNameSpace); + return; + } + + window.addEventListener('scroll', this.pauseWhenNotInViewNameSpace); + this.pauseWhenNotInViewNameSpace(); +}; + +},{}],22:[function(require,module,exports){ +'use strict'; + +module.exports = function(state) { + var isPausedBecauseNotInView = state === 'isPausedBecauseNotInView'; + if (this.isCleared) return; + if (!isPausedBecauseNotInView) this.isPaused = true; + cancelAnimationFrame(this.animation); + this.animating = false; +}; + +},{}],23:[function(require,module,exports){ +'use strict'; + +module.exports = function() { + var _this = this; + if (this.scrollDebounceTimeout) clearTimeout(this.scrollDebounceTimeout); + + this.scrollDebounceTimeout = setTimeout(function() { + var elPos = _this.canvas.getBoundingClientRect(); + _this.isCanvasInWindowView = !(elPos.bottom < 0 || elPos.right < 0 || + elPos.left > window.innerWidth || elPos.top > window.innerHeight); + + if (_this.isCanvasInWindowView) { + if (!_this.isPaused || _this.firstScrollInit) { + if (_this.image && !_this.isImgLoaded) {return;} + _this.isPausedBecauseNotInView = false; + _this.play('isPlayedBecauseInView'); + _this.firstScrollInit = false; + } + + } else { + if (!_this.image && _this.firstScrollInit) { + _this.refreshColorsAndPos(); + _this.firstScrollInit = false; + } + + if (!_this.isPaused && !_this.isPausedBecauseNotInView) { + _this.isPausedBecauseNotInView = true; + _this.pause('isPausedBecauseNotInView'); + } + } + }, this.scrollDebounceThreshold); +}; + +},{}],24:[function(require,module,exports){ +'use strict'; + +module.exports = function(state) { + var isPlayedBecauseInView = state === 'isPlayedBecauseInView'; + if (!isPlayedBecauseInView) this.isPaused = false; + this.isCleared = false; + if (!this.animating) { + this.animation = requestAnimationFrame(this.animateColors.bind(this)); + this.animating = true; + } +}; + +},{}],25:[function(require,module,exports){ +'use strict'; + +module.exports = function() { + var _this = this; + + if (!this.imagePosition) { + this.imagePosition = { x: 0, y: 0, width: 0, height: 0 }; + } + + if (this.image.blendingMode) { + this.context.globalCompositeOperation = this.image.blendingMode; + } + + if (this.imageNode) { + setImagePosition(); + return; + } + + this.imageNode = new Image(); + this.imageNode.onerror = function() { + throw new Error('Granim: The image source is invalid.'); + }; + this.imageNode.onload = function() { + _this.imgOriginalWidth = _this.imageNode.width; + _this.imgOriginalHeight = _this.imageNode.height; + setImagePosition(); + _this.refreshColorsAndPos(); + if (!_this.isPausedWhenNotInView || _this.isCanvasInWindowView) { + _this.animation = requestAnimationFrame(_this.animateColors.bind(_this)); + } + _this.isImgLoaded = true; + }; + this.imageNode.src = this.image.source; + + function setImagePosition() { + var i, currentAxis; + + for (i = 0; i < 2; i++) { + currentAxis = !i ? 'x' : 'y'; + setImageAxisPosition(currentAxis); + } + + function setImageAxisPosition(axis) { + var canvasWidthOrHeight = _this[axis + '1']; + var imgOriginalWidthOrHeight = _this[axis === 'x' ? 'imgOriginalWidth' : 'imgOriginalHeight']; + var imageAlignIndex = axis === 'x' ? _this.image.position[0] : _this.image.position[1]; + var imageAxisPosition; + switch(imageAlignIndex) { + case 'center': + imageAxisPosition = imgOriginalWidthOrHeight > canvasWidthOrHeight + ? -(imgOriginalWidthOrHeight - canvasWidthOrHeight) / 2 + : (canvasWidthOrHeight - imgOriginalWidthOrHeight) / 2; + _this.imagePosition[axis] = imageAxisPosition; + _this.imagePosition[axis === 'x' ? 'width' : 'height'] = imgOriginalWidthOrHeight; + break; + + case 'top': + _this.imagePosition['y'] = 0; + _this.imagePosition['height'] = imgOriginalWidthOrHeight; + break; + + case 'bottom': + _this.imagePosition['y'] = canvasWidthOrHeight - imgOriginalWidthOrHeight; + _this.imagePosition['height'] = imgOriginalWidthOrHeight; + break; + + case 'right': + _this.imagePosition['x'] = canvasWidthOrHeight - imgOriginalWidthOrHeight; + _this.imagePosition['width'] = imgOriginalWidthOrHeight; + break; + + case 'left': + _this.imagePosition['x'] = 0; + _this.imagePosition['width'] = imgOriginalWidthOrHeight; + break; + } + + if (_this.image.stretchMode) { + imageAlignIndex = axis === 'x' ? _this.image.stretchMode[0] : _this.image.stretchMode[1]; + switch(imageAlignIndex) { + case 'none': + break; + case 'stretch': + _this.imagePosition[axis] = 0; + _this.imagePosition[axis === 'x' ? 'width' : 'height'] = canvasWidthOrHeight; + break; + + case 'stretch-if-bigger': + if (imgOriginalWidthOrHeight < canvasWidthOrHeight) break; + _this.imagePosition[axis] = 0; + _this.imagePosition[axis === 'x' ? 'width' : 'height'] = canvasWidthOrHeight; + break; + + case 'stretch-if-smaller': + if (imgOriginalWidthOrHeight > canvasWidthOrHeight) break; + _this.imagePosition[axis] = 0; + _this.imagePosition[axis === 'x' ? 'width' : 'height'] = canvasWidthOrHeight; + break; + } + } + } + } +}; + +},{}],26:[function(require,module,exports){ +'use strict'; + +module.exports = function(progressPercent) { + var _this = this, activeChannel, activeChannelPos, i, j; + + // Loop through each colors of the active gradient + for (i = 0; i < this.activeColors.length; i++) { + + // Generate RGBA colors + for (j = 0; j < 4; j++) { + // If color value [0-255] round to the integer, + // Else if opacity [0-1] round to 2 decimals + activeChannel = _this.activeColors[i][j] + + (j !== 3 + ? Math.ceil(_this.activeColorsDiff[i][j] / 100 * progressPercent) + : Math.round((_this.activeColorsDiff[i][j] / 100 * progressPercent) * 100) / 100 + ); + + // Prevent colors values from going < 0 & > 255 + if (activeChannel <= 255 && activeChannel >= 0) { + _this.currentColors[i][j] = activeChannel; + } + } + + // Generate gradient color position + activeChannelPos = parseFloat((_this.activeColorsPos[i] + + (_this.activeColorsPosDiff[i] / 100 * progressPercent) + ).toFixed(4)); + + if (activeChannelPos <= 1 && activeChannelPos >= 0) { + _this.currentColorsPos[i] = activeChannelPos; + } + } + + this.makeGradient(); +}; + +},{}],27:[function(require,module,exports){ +'use strict'; + +module.exports = function() { + var _this = this, colorDiff, colorPosDiff, nextColors, nextColorsPos; + + if (!this.channels[this.activeState]) this.channels[this.activeState] = []; + + // If the actual channel exist, reassign properties and exit + // (each channel is saved to prevent recomputing it each time) + if (this.channels[this.activeState][this.channelsIndex] !== undefined) { + this.activeColors = this.channels[this.activeState][this.channelsIndex].colors; + this.activeColorsDiff = this.channels[this.activeState][this.channelsIndex].colorsDiff; + this.activeColorsPos = this.channels[this.activeState][this.channelsIndex].colorsPos; + this.activeColorsPosDiff = this.channels[this.activeState][this.channelsIndex].colorsPosDiff; + return; + } + + // Set blank properties + this.channels[this.activeState].push([{}]); + this.channels[this.activeState][this.channelsIndex].colors = []; + this.channels[this.activeState][this.channelsIndex].colorsDiff = []; + this.channels[this.activeState][this.channelsIndex].colorsPos = []; + this.channels[this.activeState][this.channelsIndex].colorsPosDiff = []; + this.activeColors = []; + this.activeColorsDiff = []; + this.activeColorsPos = []; + this.activeColorsPosDiff = []; + + // Go on each gradient of the current state + this.states[this.activeState].gradients[this.channelsIndex].forEach(function(color, i) { + // Push the hex color converted to rgba on the channel and the active color properties + var colorPos = _this.getColorPos(color, i); + var color = _this.getColor(color); + var rgbaColor = _this.convertColorToRgba(color); + var activeChannel = _this.channels[_this.activeState]; + + activeChannel[_this.channelsIndex].colors.push(rgbaColor); + _this.activeColors.push(rgbaColor); + activeChannel[_this.channelsIndex].colorsPos.push(colorPos); + _this.activeColorsPos.push(colorPos); + + // If it's the first channel to be set, set the currentColors + if (!_this.isCurrentColorsSet) { + _this.currentColors.push(_this.convertColorToRgba(color)); + _this.currentColorsPos.push(colorPos); + } + + // If it's the last gradient, compute the color diff between the last gradient and the first one, + // else between the penultimate one and the last one + if (_this.channelsIndex === _this.states[_this.activeState].gradients.length - 1) { + colorDiff = _this.getColorDiff( + activeChannel[_this.channelsIndex].colors[i], + activeChannel[0].colors[i] + ); + colorPosDiff = _this.getColorPosDiff( + activeChannel[_this.channelsIndex].colorsPos[i], + activeChannel[0].colorsPos[i] + ); + + } else { + nextColors = _this.convertColorToRgba(_this.getColor(_this.states[_this.activeState].gradients[_this.channelsIndex + 1][i])); + nextColorsPos = _this.getColorPos(_this.states[_this.activeState].gradients[_this.channelsIndex + 1][i], i); + colorDiff = _this.getColorDiff(activeChannel[_this.channelsIndex].colors[i], nextColors); + colorPosDiff = _this.getColorPosDiff(activeChannel[_this.channelsIndex].colorsPos[i], nextColorsPos); + } + + activeChannel[_this.channelsIndex].colorsDiff.push(colorDiff); + _this.activeColorsDiff.push(colorDiff); + activeChannel[_this.channelsIndex].colorsPosDiff.push(colorPosDiff); + _this.activeColorsPosDiff.push(colorPosDiff); + }); + + this.activetransitionSpeed = this.states[this.activeState].transitionSpeed || 5000; + this.isCurrentColorsSet = true; +}; + +},{}],28:[function(require,module,exports){ +'use strict'; + +module.exports = function() { + var ctx = this.context; + + switch(this.direction) { + case 'diagonal': + return ctx.createLinearGradient(0, 0, this.x1, this.y1); + + case 'left-right': + return ctx.createLinearGradient(0, 0, this.x1, 0); + + case 'top-bottom': + return ctx.createLinearGradient(this.x1 / 2, 0, this.x1 / 2, this.y1); + + case 'radial': + return ctx.createRadialGradient(this.x1 / 2, this.y1 / 2, this.x1 / 2, this.x1 / 2, this.y1 / 2, 0); + + case 'custom': + return ctx.createLinearGradient( + getCustomCoordinateInPixels(this.customDirection.x0, this.x1), + getCustomCoordinateInPixels(this.customDirection.y0, this.y1), + getCustomCoordinateInPixels(this.customDirection.x1, this.x1), + getCustomCoordinateInPixels(this.customDirection.y1, this.y1) + ); + } +}; + +function getCustomCoordinateInPixels(coordinate, size) { + return coordinate.indexOf('%') > -1 + ? size / 100 * parseInt(coordinate.split('%')[0], 10) + : parseInt(coordinate.split('px')[0], 10); +} + +},{}],29:[function(require,module,exports){ +'use strict'; + +module.exports = function() { + this.getDimensions(); + this.canvas.setAttribute('width', this.x1); + this.canvas.setAttribute('height', this.y1); + if (this.image) this.prepareImage(); + this.refreshColorsAndPos(); +}; + +},{}],30:[function(require,module,exports){ +'use strict'; + +module.exports = function(element) { + var siteURL = 'https://sarcadass.github.io/granim.js/api.html'; + throw new Error('Granim: Input error on "' + element + '" option.\nCheck the API ' + siteURL + '.'); +}; + +},{}],31:[function(require,module,exports){ +'use strict'; + +module.exports = function(inputType) { + var xPositionValues = ['left', 'center', 'right']; + var yPositionValues = ['top', 'center', 'bottom']; + var stretchModeValues = ['none', 'stretch', 'stretch-if-smaller', 'stretch-if-bigger']; + var blendingModeValues = ['multiply', 'screen', 'normal', 'overlay', 'darken', + 'lighten', 'lighter', 'color-dodge', 'color-burn', 'hard-light', 'soft-light', + 'difference', 'exclusion', 'hue', 'saturation', 'color', 'luminosity']; + var directionValues = ['diagonal', 'left-right', 'top-bottom', 'radial', 'custom']; + + switch(inputType) { + case 'image': + // Validate image.position + if ((!Array.isArray(this.image.position) || this.image.position.length !== 2) || + xPositionValues.indexOf(this.image.position[0]) === -1 || + yPositionValues.indexOf(this.image.position[1]) === -1 + ) { this.triggerError('image.position'); } + // Validate image.stretchMode + if (this.image.stretchMode) { + if ((!Array.isArray(this.image.stretchMode) || this.image.stretchMode.length !== 2) || + stretchModeValues.indexOf(this.image.stretchMode[0]) === -1 || + stretchModeValues.indexOf(this.image.stretchMode[1]) === -1 + ) { this.triggerError('image.stretchMode'); } + } + break; + + case 'blendingMode': + if (blendingModeValues.indexOf(this.image.blendingMode) === -1) { + this.clear(); + this.triggerError('blendingMode'); + } + break; + + case 'direction': + if (directionValues.indexOf(this.direction) === -1) { + this.triggerError('direction'); + } else { + if (this.direction === 'custom') { + if (!areDefinedInPixelsOrPercentage([ + this.customDirection.x0, + this.customDirection.x1, + this.customDirection.y0, + this.customDirection.y1 + ])) { + this.triggerError('customDirection'); + } + } + } + break; + } +}; + +function areDefinedInPixelsOrPercentage(array) { + var definedInPixelsOrPercentage = true, i = 0, value; + while (definedInPixelsOrPercentage && i < array.length) { + value = array[i]; + if (typeof value !== 'string') { + definedInPixelsOrPercentage = false; + } else { + var splittedValue = null; + var unit = null; + if (value.indexOf('px') !== -1) unit = 'px'; + if (value.indexOf('%') !== -1) unit = '%'; + splittedValue = value.split(unit).filter(function(value) { + return value.length > 0; + }); + // Check if there is a unit ('px' or '%'), + // a char before the unit, + // no char after the unit, + // the string without the unit is only composed of digits + if ( + !unit + || splittedValue.length > 2 + || !splittedValue[0] + || splittedValue[1] + || !/^-?\d+\.?\d*$/.test(splittedValue[0]) + ) { + definedInPixelsOrPercentage = false; + } + } + i++; + } + return definedInPixelsOrPercentage; +} + +},{}],32:[function(require,module,exports){ +window.Granim = require('./lib/Granim.js'); + +},{"./lib/Granim.js":1}]},{},[32]); diff --git a/js/granim.min.js b/js/granim.min.js new file mode 100644 index 0000000..5dd306b --- /dev/null +++ b/js/granim.min.js @@ -0,0 +1,2 @@ +/*! Granim v2.0.0 - https://sarcadass.github.io/granim.js */ +!function t(e,i,s){function o(r,a){if(!i[r]){if(!e[r]){var h="function"==typeof require&&require;if(!a&&h)return h(r,!0);if(n)return n(r,!0);var c=new Error("Cannot find module '"+r+"'");throw c.code="MODULE_NOT_FOUND",c}var l=i[r]={exports:{}};e[r][0].call(l.exports,function(t){var i=e[r][1][t];return o(i?i:t)},l,l.exports,t,e,i,s)}return i[r].exports}for(var n="function"==typeof require&&require,r=0;r100,n=void 0===this.states[this.activeState].loop||this.states[this.activeState].loop;(null===this.previousTimeStamp||o)&&(this.previousTimeStamp=t),this.progress=this.progress+(t-this.previousTimeStamp),e=(this.progress/this.activetransitionSpeed*100).toFixed(2),this.previousTimeStamp=t,this.refreshColorsAndPos(e),e<100?this.animation=requestAnimationFrame(this.animateColors.bind(this)):this.channelsIndex1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}function r(t,e,i,s){var o,r,a,h,c;return 0===e?o=r=a=i:(h=i<.5?i*(1+e):i+e-i*e,c=2*i-h,o=n(c,h,t+1/3),r=n(c,h,t),a=n(c,h,t-1/3)),[Math.round(255*o),Math.round(255*r),Math.round(255*a),s]}var a,h={hexa:/^#(?:[0-9a-fA-F]{3}){1,2}$/,rgba:/^rgba\((\d{1,3}), ?(\d{1,3}), ?(\d{1,3}), ?(.?\d{1,3})\)$/,rgb:/^rgb\((\d{1,3}), ?(\d{1,3}), ?(\d{1,3})\)$/,hsla:/^hsla\((\d{1,3}), ?(\d{1,3})%, ?(\d{1,3})%, ?(.?\d{1,3})\)$/,hsl:/^hsl\((\d{1,3}), ?(\d{1,3})%, ?(\d{1,3})%\)$/};e.exports=function(t){switch(s(t)){default:this.triggerError("colorType");case"hexa":return o(t);case"rgba":return[parseInt(a[1],10),parseInt(a[2],10),parseInt(a[3],10),parseFloat(a[4])];case"rgb":return[parseInt(a[1],10),parseInt(a[2],10),parseInt(a[3],10),1];case"hsla":return r(parseInt(a[1],10)/360,parseInt(a[2],10)/100,parseInt(a[3],10)/100,parseFloat(a[4]));case"hsl":return r(parseInt(a[1],10)/360,parseInt(a[2],10)/100,parseInt(a[3],10)/100,1)}}},{}],8:[function(t,e,i){"use strict";e.exports=function(){this.onResize("removeListeners"),this.onScroll("removeListeners"),this.clear()}},{}],9:[function(t,e,i){"use strict";e.exports=function(){function t(t,e){e=e||{bubbles:!1,cancelable:!1,detail:void 0};var i=document.createEvent("CustomEvent");return i.initCustomEvent(t,e.bubbles,e.cancelable,e.detail),i}"function"!=typeof window.CustomEvent&&(t.prototype=window.Event.prototype,window.CustomEvent=t)}},{}],10:[function(t,e,i){"use strict";e.exports=function(t){return"string"==typeof t?t:"object"==typeof t&&t.color?t.color:void this.triggerError("gradient.color")}},{}],11:[function(t,e,i){"use strict";e.exports=function(t,e){var i=0,s=[];for(i;i<4;i++)s.push(e[i]-t[i]);return s}},{}],12:[function(t,e,i){"use strict";e.exports=function(t,e){return"object"==typeof t&&t.pos?t.pos:parseFloat(e?(1/(this.gradientLength-1)*e).toFixed(2):0)}},{}],13:[function(t,e,i){"use strict";e.exports=function(t,e){return e-t}},{}],14:[function(t,e,i){"use strict";e.exports=function(){var t,e,i=[];for(t=0;t=128?"light":"dark"}},{}],19:[function(t,e,i){"use strict";e.exports=function(){var t=this.setDirection(),e=document.querySelector(this.elToSetClassOn).classList,i=0;for(this.context.clearRect(0,0,this.x1,this.y1),this.image&&this.context.drawImage(this.imageNode,this.imagePosition.x,this.imagePosition.y,this.imagePosition.width,this.imagePosition.height),i;iwindow.innerWidth||e.top>window.innerHeight),t.isCanvasInWindowView){if(!t.isPaused||t.firstScrollInit){if(t.image&&!t.isImgLoaded)return;t.isPausedBecauseNotInView=!1,t.play("isPlayedBecauseInView"),t.firstScrollInit=!1}}else!t.image&&t.firstScrollInit&&(t.refreshColorsAndPos(),t.firstScrollInit=!1),t.isPaused||t.isPausedBecauseNotInView||(t.isPausedBecauseNotInView=!0,t.pause("isPausedBecauseNotInView"))},this.scrollDebounceThreshold)}},{}],24:[function(t,e,i){"use strict";e.exports=function(t){var e="isPlayedBecauseInView"===t;e||(this.isPaused=!1),this.isCleared=!1,this.animating||(this.animation=requestAnimationFrame(this.animateColors.bind(this)),this.animating=!0)}},{}],25:[function(t,e,i){"use strict";e.exports=function(){function t(){function t(t){var i,s=e[t+"1"],o=e["x"===t?"imgOriginalWidth":"imgOriginalHeight"],n="x"===t?e.image.position[0]:e.image.position[1];switch(n){case"center":i=o>s?-(o-s)/2:(s-o)/2,e.imagePosition[t]=i,e.imagePosition["x"===t?"width":"height"]=o;break;case"top":e.imagePosition.y=0,e.imagePosition.height=o;break;case"bottom":e.imagePosition.y=s-o,e.imagePosition.height=o;break;case"right":e.imagePosition.x=s-o,e.imagePosition.width=o;break;case"left":e.imagePosition.x=0,e.imagePosition.width=o}if(e.image.stretchMode)switch(n="x"===t?e.image.stretchMode[0]:e.image.stretchMode[1]){case"none":break;case"stretch":e.imagePosition[t]=0,e.imagePosition["x"===t?"width":"height"]=s;break;case"stretch-if-bigger":if(os)break;e.imagePosition[t]=0,e.imagePosition["x"===t?"width":"height"]=s}}var i,s;for(i=0;i<2;i++)s=i?"y":"x",t(s)}var e=this;return this.imagePosition||(this.imagePosition={x:0,y:0,width:0,height:0}),this.image.blendingMode&&(this.context.globalCompositeOperation=this.image.blendingMode),this.imageNode?void t():(this.imageNode=new Image,this.imageNode.onerror=function(){throw new Error("Granim: The image source is invalid.")},this.imageNode.onload=function(){e.imgOriginalWidth=e.imageNode.width,e.imgOriginalHeight=e.imageNode.height,t(),e.refreshColorsAndPos(),e.isPausedWhenNotInView&&!e.isCanvasInWindowView||(e.animation=requestAnimationFrame(e.animateColors.bind(e))),e.isImgLoaded=!0},void(this.imageNode.src=this.image.source))}},{}],26:[function(t,e,i){"use strict";e.exports=function(t){var e,i,s,o,n=this;for(s=0;s=0&&(n.currentColors[s][o]=e);i=parseFloat((n.activeColorsPos[s]+n.activeColorsPosDiff[s]/100*t).toFixed(4)),i<=1&&i>=0&&(n.currentColorsPos[s]=i)}this.makeGradient()}},{}],27:[function(t,e,i){"use strict";e.exports=function(){var t,e,i,s,o=this;return this.channels[this.activeState]||(this.channels[this.activeState]=[]),void 0!==this.channels[this.activeState][this.channelsIndex]?(this.activeColors=this.channels[this.activeState][this.channelsIndex].colors,this.activeColorsDiff=this.channels[this.activeState][this.channelsIndex].colorsDiff,this.activeColorsPos=this.channels[this.activeState][this.channelsIndex].colorsPos,void(this.activeColorsPosDiff=this.channels[this.activeState][this.channelsIndex].colorsPosDiff)):(this.channels[this.activeState].push([{}]),this.channels[this.activeState][this.channelsIndex].colors=[],this.channels[this.activeState][this.channelsIndex].colorsDiff=[],this.channels[this.activeState][this.channelsIndex].colorsPos=[],this.channels[this.activeState][this.channelsIndex].colorsPosDiff=[],this.activeColors=[],this.activeColorsDiff=[],this.activeColorsPos=[],this.activeColorsPosDiff=[],this.states[this.activeState].gradients[this.channelsIndex].forEach(function(n,r){var a=o.getColorPos(n,r),n=o.getColor(n),h=o.convertColorToRgba(n),c=o.channels[o.activeState];c[o.channelsIndex].colors.push(h),o.activeColors.push(h),c[o.channelsIndex].colorsPos.push(a),o.activeColorsPos.push(a),o.isCurrentColorsSet||(o.currentColors.push(o.convertColorToRgba(n)),o.currentColorsPos.push(a)),o.channelsIndex===o.states[o.activeState].gradients.length-1?(t=o.getColorDiff(c[o.channelsIndex].colors[r],c[0].colors[r]),e=o.getColorPosDiff(c[o.channelsIndex].colorsPos[r],c[0].colorsPos[r])):(i=o.convertColorToRgba(o.getColor(o.states[o.activeState].gradients[o.channelsIndex+1][r])),s=o.getColorPos(o.states[o.activeState].gradients[o.channelsIndex+1][r],r),t=o.getColorDiff(c[o.channelsIndex].colors[r],i),e=o.getColorPosDiff(c[o.channelsIndex].colorsPos[r],s)),c[o.channelsIndex].colorsDiff.push(t),o.activeColorsDiff.push(t),c[o.channelsIndex].colorsPosDiff.push(e),o.activeColorsPosDiff.push(e)}),this.activetransitionSpeed=this.states[this.activeState].transitionSpeed||5e3,void(this.isCurrentColorsSet=!0))}},{}],28:[function(t,e,i){"use strict";function s(t,e){return t.indexOf("%")>-1?e/100*parseInt(t.split("%")[0],10):parseInt(t.split("px")[0],10)}e.exports=function(){var t=this.context;switch(this.direction){case"diagonal":return t.createLinearGradient(0,0,this.x1,this.y1);case"left-right":return t.createLinearGradient(0,0,this.x1,0);case"top-bottom":return t.createLinearGradient(this.x1/2,0,this.x1/2,this.y1);case"radial":return t.createRadialGradient(this.x1/2,this.y1/2,this.x1/2,this.x1/2,this.y1/2,0);case"custom":return t.createLinearGradient(s(this.customDirection.x0,this.x1),s(this.customDirection.y0,this.y1),s(this.customDirection.x1,this.x1),s(this.customDirection.y1,this.y1))}}},{}],29:[function(t,e,i){"use strict";e.exports=function(){this.getDimensions(),this.canvas.setAttribute("width",this.x1),this.canvas.setAttribute("height",this.y1),this.image&&this.prepareImage(),this.refreshColorsAndPos()}},{}],30:[function(t,e,i){"use strict";e.exports=function(t){var e="https://sarcadass.github.io/granim.js/api.html";throw new Error('Granim: Input error on "'+t+'" option.\nCheck the API '+e+".")}},{}],31:[function(t,e,i){"use strict";function s(t){for(var e,i=!0,s=0;i&&s0}),(!n||o.length>2||!o[0]||o[1]||!/^-?\d+\.?\d*$/.test(o[0]))&&(i=!1)}s++}return i}e.exports=function(t){var e=["left","center","right"],i=["top","center","bottom"],o=["none","stretch","stretch-if-smaller","stretch-if-bigger"],n=["multiply","screen","normal","overlay","darken","lighten","lighter","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],r=["diagonal","left-right","top-bottom","radial","custom"];switch(t){case"image":Array.isArray(this.image.position)&&2===this.image.position.length&&e.indexOf(this.image.position[0])!==-1&&i.indexOf(this.image.position[1])!==-1||this.triggerError("image.position"),this.image.stretchMode&&(Array.isArray(this.image.stretchMode)&&2===this.image.stretchMode.length&&o.indexOf(this.image.stretchMode[0])!==-1&&o.indexOf(this.image.stretchMode[1])!==-1||this.triggerError("image.stretchMode"));break;case"blendingMode":n.indexOf(this.image.blendingMode)===-1&&(this.clear(),this.triggerError("blendingMode"));break;case"direction":r.indexOf(this.direction)===-1?this.triggerError("direction"):"custom"===this.direction&&(s([this.customDirection.x0,this.customDirection.x1,this.customDirection.y0,this.customDirection.y1])||this.triggerError("customDirection"))}}},{}],32:[function(t,e,i){window.Granim=t("./lib/Granim.js")},{"./lib/Granim.js":1}]},{},[32]); \ No newline at end of file diff --git a/js/html2canvas.min.js b/js/html2canvas.min.js new file mode 100644 index 0000000..1ac9989 --- /dev/null +++ b/js/html2canvas.min.js @@ -0,0 +1,8 @@ +/* + html2canvas 0.5.0-beta4 + Copyright (c) 2016 Niklas von Hertzen + + Released under License +*/ +!function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.html2canvas=a()}}(function(){var a;return function b(a,c,d){function e(g,h){if(!c[g]){if(!a[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};a[g][0].call(k.exports,function(b){var c=a[g][1][b];return e(c?c:b)},k,k.exports,b,a,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g1&&(d=c[0]+"@",a=c[1]),a=a.replace(H,".");var e=a.split("."),f=g(e,b).join(".");return d+f}function i(a){for(var b,c,d=[],e=0,f=a.length;f>e;)b=a.charCodeAt(e++),b>=55296&&56319>=b&&f>e?(c=a.charCodeAt(e++),56320==(64512&c)?d.push(((1023&b)<<10)+(1023&c)+65536):(d.push(b),e--)):d.push(b);return d}function j(a){return g(a,function(a){var b="";return a>65535&&(a-=65536,b+=L(a>>>10&1023|55296),a=56320|1023&a),b+=L(a)}).join("")}function k(a){return 10>a-48?a-22:26>a-65?a-65:26>a-97?a-97:x}function l(a,b){return a+22+75*(26>a)-((0!=b)<<5)}function m(a,b,c){var d=0;for(a=c?K(a/B):a>>1,a+=K(a/b);a>J*z>>1;d+=x)a=K(a/J);return K(d+(J+1)*a/(a+A))}function n(a){var b,c,d,e,g,h,i,l,n,o,p=[],q=a.length,r=0,s=D,t=C;for(c=a.lastIndexOf(E),0>c&&(c=0),d=0;c>d;++d)a.charCodeAt(d)>=128&&f("not-basic"),p.push(a.charCodeAt(d));for(e=c>0?c+1:0;q>e;){for(g=r,h=1,i=x;e>=q&&f("invalid-input"),l=k(a.charCodeAt(e++)),(l>=x||l>K((w-r)/h))&&f("overflow"),r+=l*h,n=t>=i?y:i>=t+z?z:i-t,!(n>l);i+=x)o=x-n,h>K(w/o)&&f("overflow"),h*=o;b=p.length+1,t=m(r-g,b,0==g),K(r/b)>w-s&&f("overflow"),s+=K(r/b),r%=b,p.splice(r++,0,s)}return j(p)}function o(a){var b,c,d,e,g,h,j,k,n,o,p,q,r,s,t,u=[];for(a=i(a),q=a.length,b=D,c=0,g=C,h=0;q>h;++h)p=a[h],128>p&&u.push(L(p));for(d=e=u.length,e&&u.push(E);q>d;){for(j=w,h=0;q>h;++h)p=a[h],p>=b&&j>p&&(j=p);for(r=d+1,j-b>K((w-c)/r)&&f("overflow"),c+=(j-b)*r,b=j,h=0;q>h;++h)if(p=a[h],b>p&&++c>w&&f("overflow"),p==b){for(k=c,n=x;o=g>=n?y:n>=g+z?z:n-g,!(o>k);n+=x)t=k-o,s=x-o,u.push(L(l(o+t%s,0))),k=K(t/s);u.push(L(l(k,0))),g=m(c,r,d==e),c=0,++d}++c,++b}return u.join("")}function p(a){return h(a,function(a){return F.test(a)?n(a.slice(4).toLowerCase()):a})}function q(a){return h(a,function(a){return G.test(a)?"xn--"+o(a):a})}var r="object"==typeof d&&d&&!d.nodeType&&d,s="object"==typeof c&&c&&!c.nodeType&&c,t="object"==typeof b&&b;(t.global===t||t.window===t||t.self===t)&&(e=t);var u,v,w=2147483647,x=36,y=1,z=26,A=38,B=700,C=72,D=128,E="-",F=/^xn--/,G=/[^\x20-\x7E]/,H=/[\x2E\u3002\uFF0E\uFF61]/g,I={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},J=x-y,K=Math.floor,L=String.fromCharCode;if(u={version:"1.3.2",ucs2:{decode:i,encode:j},decode:n,encode:o,toASCII:q,toUnicode:p},"function"==typeof a&&"object"==typeof a.amd&&a.amd)a("punycode",function(){return u});else if(r&&s)if(c.exports==r)s.exports=u;else for(v in u)u.hasOwnProperty(v)&&(r[v]=u[v]);else e.punycode=u}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(a,b,c){function d(a,b,c){!a.defaultView||b===a.defaultView.pageXOffset&&c===a.defaultView.pageYOffset||a.defaultView.scrollTo(b,c)}function e(a,b){try{b&&(b.width=a.width,b.height=a.height,b.getContext("2d").putImageData(a.getContext("2d").getImageData(0,0,a.width,a.height),0,0))}catch(c){h("Unable to copy canvas content from",a,c)}}function f(a,b){for(var c=3===a.nodeType?document.createTextNode(a.nodeValue):a.cloneNode(!1),d=a.firstChild;d;)(b===!0||1!==d.nodeType||"SCRIPT"!==d.nodeName)&&c.appendChild(f(d,b)),d=d.nextSibling;return 1===a.nodeType&&(c._scrollTop=a.scrollTop,c._scrollLeft=a.scrollLeft,"CANVAS"===a.nodeName?e(a,c):("TEXTAREA"===a.nodeName||"SELECT"===a.nodeName)&&(c.value=a.value)),c}function g(a){if(1===a.nodeType){a.scrollTop=a._scrollTop,a.scrollLeft=a._scrollLeft;for(var b=a.firstChild;b;)g(b),b=b.nextSibling}}var h=a("./log");b.exports=function(a,b,c,e,h,i,j){var k=f(a.documentElement,h.javascriptEnabled),l=b.createElement("iframe");return l.className="html2canvas-container",l.style.visibility="hidden",l.style.position="fixed",l.style.left="-10000px",l.style.top="0px",l.style.border="0",l.width=c,l.height=e,l.scrolling="no",b.body.appendChild(l),new Promise(function(b){var c=l.contentWindow.document;l.contentWindow.onload=l.onload=function(){var a=setInterval(function(){c.body.childNodes.length>0&&(g(c.documentElement),clearInterval(a),"view"===h.type&&(l.contentWindow.scrollTo(i,j),!/(iPad|iPhone|iPod)/g.test(navigator.userAgent)||l.contentWindow.scrollY===j&&l.contentWindow.scrollX===i||(c.documentElement.style.top=-j+"px",c.documentElement.style.left=-i+"px",c.documentElement.style.position="absolute")),b(l))},50)},c.open(),c.write(""),d(a,i,j),c.replaceChild(c.adoptNode(k),c.documentElement),c.close()})}},{"./log":13}],3:[function(a,b,c){function d(a){this.r=0,this.g=0,this.b=0,this.a=null;this.fromArray(a)||this.namedColor(a)||this.rgb(a)||this.rgba(a)||this.hex6(a)||this.hex3(a)}d.prototype.darken=function(a){var b=1-a;return new d([Math.round(this.r*b),Math.round(this.g*b),Math.round(this.b*b),this.a])},d.prototype.isTransparent=function(){return 0===this.a},d.prototype.isBlack=function(){return 0===this.r&&0===this.g&&0===this.b},d.prototype.fromArray=function(a){return Array.isArray(a)&&(this.r=Math.min(a[0],255),this.g=Math.min(a[1],255),this.b=Math.min(a[2],255),a.length>3&&(this.a=a[3])),Array.isArray(a)};var e=/^#([a-f0-9]{3})$/i;d.prototype.hex3=function(a){var b=null;return null!==(b=a.match(e))&&(this.r=parseInt(b[1][0]+b[1][0],16),this.g=parseInt(b[1][1]+b[1][1],16),this.b=parseInt(b[1][2]+b[1][2],16)),null!==b};var f=/^#([a-f0-9]{6})$/i;d.prototype.hex6=function(a){var b=null;return null!==(b=a.match(f))&&(this.r=parseInt(b[1].substring(0,2),16),this.g=parseInt(b[1].substring(2,4),16),this.b=parseInt(b[1].substring(4,6),16)),null!==b};var g=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/;d.prototype.rgb=function(a){var b=null;return null!==(b=a.match(g))&&(this.r=Number(b[1]),this.g=Number(b[2]),this.b=Number(b[3])),null!==b};var h=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d?\.?\d+)\s*\)$/;d.prototype.rgba=function(a){var b=null;return null!==(b=a.match(h))&&(this.r=Number(b[1]),this.g=Number(b[2]),this.b=Number(b[3]),this.a=Number(b[4])),null!==b},d.prototype.toString=function(){return null!==this.a&&1!==this.a?"rgba("+[this.r,this.g,this.b,this.a].join(",")+")":"rgb("+[this.r,this.g,this.b].join(",")+")"},d.prototype.namedColor=function(a){a=a.toLowerCase();var b=i[a];if(b)this.r=b[0],this.g=b[1],this.b=b[2];else if("transparent"===a)return this.r=this.g=this.b=this.a=0,!0;return!!b},d.prototype.isColor=!0;var i={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};b.exports=d},{}],4:[function(b,c,d){function e(a,b){var c=x++;if(b=b||{},b.logging&&(r.options.logging=!0,r.options.start=Date.now()),b.async="undefined"==typeof b.async?!0:b.async,b.allowTaint="undefined"==typeof b.allowTaint?!1:b.allowTaint,b.removeContainer="undefined"==typeof b.removeContainer?!0:b.removeContainer,b.javascriptEnabled="undefined"==typeof b.javascriptEnabled?!1:b.javascriptEnabled,b.imageTimeout="undefined"==typeof b.imageTimeout?1e4:b.imageTimeout,b.renderer="function"==typeof b.renderer?b.renderer:n,b.strict=!!b.strict,"string"==typeof a){if("string"!=typeof b.proxy)return Promise.reject("Proxy must be used when rendering url");var d=null!=b.width?b.width:window.innerWidth,e=null!=b.height?b.height:window.innerHeight;return u(l(a),b.proxy,document,d,e,b).then(function(a){return g(a.contentWindow.document.documentElement,a,b,d,e)})}var h=(void 0===a?[document.documentElement]:a.length?a:[a])[0];return h.setAttribute(w+c,c),f(h.ownerDocument,b,h.ownerDocument.defaultView.innerWidth,h.ownerDocument.defaultView.innerHeight,c).then(function(a){return"function"==typeof b.onrendered&&(r("options.onrendered is deprecated, html2canvas returns a Promise containing the canvas"),b.onrendered(a)),a})}function f(a,b,c,d,e){return t(a,a,c,d,b,a.defaultView.pageXOffset,a.defaultView.pageYOffset).then(function(f){r("Document cloned");var h=w+e,i="["+h+"='"+e+"']";a.querySelector(i).removeAttribute(h);var j=f.contentWindow,k=j.document.querySelector(i),l="function"==typeof b.onclone?Promise.resolve(b.onclone(j.document)):Promise.resolve(!0);return l.then(function(){return g(k,f,b,c,d)})})}function g(a,b,c,d,e){var f=b.contentWindow,g=new m(f.document),l=new o(c,g),n=v(a),q="view"===c.type?d:j(f.document),s="view"===c.type?e:k(f.document),t=new c.renderer(q,s,l,c,document),u=new p(a,t,g,l,c);return u.ready.then(function(){r("Finished rendering");var d;return d="view"===c.type?i(t.canvas,{width:t.canvas.width,height:t.canvas.height,top:0,left:0,x:0,y:0}):a===f.document.body||a===f.document.documentElement||null!=c.canvas?t.canvas:i(t.canvas,{width:null!=c.width?c.width:n.width,height:null!=c.height?c.height:n.height,top:n.top,left:n.left,x:0,y:0}),h(b,c),d})}function h(a,b){b.removeContainer&&(a.parentNode.removeChild(a),r("Cleaned up container"))}function i(a,b){var c=document.createElement("canvas"),d=Math.min(a.width-1,Math.max(0,b.left)),e=Math.min(a.width,Math.max(1,b.left+b.width)),f=Math.min(a.height-1,Math.max(0,b.top)),g=Math.min(a.height,Math.max(1,b.top+b.height));c.width=b.width,c.height=b.height;var h=e-d,i=g-f;return r("Cropping canvas at:","left:",b.left,"top:",b.top,"width:",h,"height:",i),r("Resulting crop with width",b.width,"and height",b.height,"with x",d,"and y",f),c.getContext("2d").drawImage(a,d,f,h,i,b.x,b.y,h,i),c}function j(a){return Math.max(Math.max(a.body.scrollWidth,a.documentElement.scrollWidth),Math.max(a.body.offsetWidth,a.documentElement.offsetWidth),Math.max(a.body.clientWidth,a.documentElement.clientWidth))}function k(a){return Math.max(Math.max(a.body.scrollHeight,a.documentElement.scrollHeight),Math.max(a.body.offsetHeight,a.documentElement.offsetHeight),Math.max(a.body.clientHeight,a.documentElement.clientHeight))}function l(a){var b=document.createElement("a");return b.href=a,b.href=b.href,b}var m=b("./support"),n=b("./renderers/canvas"),o=b("./imageloader"),p=b("./nodeparser"),q=b("./nodecontainer"),r=b("./log"),s=b("./utils"),t=b("./clone"),u=b("./proxy").loadUrlDocument,v=s.getBounds,w="data-html2canvas-node",x=0;e.CanvasRenderer=n,e.NodeContainer=q,e.log=r,e.utils=s;var y="undefined"==typeof document||"function"!=typeof Object.create||"function"!=typeof document.createElement("canvas").getContext?function(){return Promise.reject("No canvas support")}:e;c.exports=y,"function"==typeof a&&a.amd&&a("html2canvas",[],function(){return y})},{"./clone":2,"./imageloader":11,"./log":13,"./nodecontainer":14,"./nodeparser":15,"./proxy":16,"./renderers/canvas":20,"./support":22,"./utils":26}],5:[function(a,b,c){function d(a){if(this.src=a,e("DummyImageContainer for",a),!this.promise||!this.image){e("Initiating DummyImageContainer"),d.prototype.image=new Image;var b=this.image;d.prototype.promise=new Promise(function(a,c){b.onload=a,b.onerror=c,b.src=f(),b.complete===!0&&a(b)})}}var e=a("./log"),f=a("./utils").smallImage;b.exports=d},{"./log":13,"./utils":26}],6:[function(a,b,c){function d(a,b){var c,d,f=document.createElement("div"),g=document.createElement("img"),h=document.createElement("span"),i="Hidden Text";f.style.visibility="hidden",f.style.fontFamily=a,f.style.fontSize=b,f.style.margin=0,f.style.padding=0,document.body.appendChild(f),g.src=e(),g.width=1,g.height=1,g.style.margin=0,g.style.padding=0,g.style.verticalAlign="baseline",h.style.fontFamily=a,h.style.fontSize=b,h.style.margin=0,h.style.padding=0,h.appendChild(document.createTextNode(i)),f.appendChild(h),f.appendChild(g),c=g.offsetTop-h.offsetTop+1,f.removeChild(h),f.appendChild(document.createTextNode(i)),f.style.lineHeight="normal",g.style.verticalAlign="super",d=g.offsetTop-f.offsetTop+1,document.body.removeChild(f),this.baseline=c,this.lineWidth=1,this.middle=d}var e=a("./utils").smallImage;b.exports=d},{"./utils":26}],7:[function(a,b,c){function d(){this.data={}}var e=a("./font");d.prototype.getMetrics=function(a,b){return void 0===this.data[a+"-"+b]&&(this.data[a+"-"+b]=new e(a,b)),this.data[a+"-"+b]},b.exports=d},{"./font":6}],8:[function(a,b,c){function d(b,c,d){this.image=null,this.src=b;var e=this,g=f(b);this.promise=(c?new Promise(function(a){"about:blank"===b.contentWindow.document.URL||null==b.contentWindow.document.documentElement?b.contentWindow.onload=b.onload=function(){a(b)}:a(b)}):this.proxyLoad(d.proxy,g,d)).then(function(b){var c=a("./core");return c(b.contentWindow.document.documentElement,{type:"view",width:b.width,height:b.height,proxy:d.proxy,javascriptEnabled:d.javascriptEnabled,removeContainer:d.removeContainer,allowTaint:d.allowTaint,imageTimeout:d.imageTimeout/2})}).then(function(a){return e.image=a})}var e=a("./utils"),f=e.getBounds,g=a("./proxy").loadUrlDocument;d.prototype.proxyLoad=function(a,b,c){var d=this.src;return g(d.src,a,d.ownerDocument,b.width,b.height,c)},b.exports=d},{"./core":4,"./proxy":16,"./utils":26}],9:[function(a,b,c){function d(a){this.src=a.value,this.colorStops=[],this.type=null,this.x0=.5,this.y0=.5,this.x1=.5,this.y1=.5,this.promise=Promise.resolve(!0)}d.TYPES={LINEAR:1,RADIAL:2},d.REGEXP_COLORSTOP=/^\s*(rgba?\(\s*\d{1,3},\s*\d{1,3},\s*\d{1,3}(?:,\s*[0-9\.]+)?\s*\)|[a-z]{3,20}|#[a-f0-9]{3,6})(?:\s+(\d{1,3}(?:\.\d+)?)(%|px)?)?(?:\s|$)/i,b.exports=d},{}],10:[function(a,b,c){function d(a,b){this.src=a,this.image=new Image;var c=this;this.tainted=null,this.promise=new Promise(function(d,e){c.image.onload=d,c.image.onerror=e,b&&(c.image.crossOrigin="anonymous"),c.image.src=a,c.image.complete===!0&&d(c.image)})}b.exports=d},{}],11:[function(a,b,c){function d(a,b){this.link=null,this.options=a,this.support=b,this.origin=this.getOrigin(window.location.href)}var e=a("./log"),f=a("./imagecontainer"),g=a("./dummyimagecontainer"),h=a("./proxyimagecontainer"),i=a("./framecontainer"),j=a("./svgcontainer"),k=a("./svgnodecontainer"),l=a("./lineargradientcontainer"),m=a("./webkitgradientcontainer"),n=a("./utils").bind;d.prototype.findImages=function(a){var b=[];return a.reduce(function(a,b){switch(b.node.nodeName){case"IMG":return a.concat([{args:[b.node.src],method:"url"}]);case"svg":case"IFRAME":return a.concat([{args:[b.node],method:b.node.nodeName}])}return a},[]).forEach(this.addImage(b,this.loadImage),this),b},d.prototype.findBackgroundImage=function(a,b){return b.parseBackgroundImages().filter(this.hasImageBackground).forEach(this.addImage(a,this.loadImage),this),a},d.prototype.addImage=function(a,b){return function(c){c.args.forEach(function(d){this.imageExists(a,d)||(a.splice(0,0,b.call(this,c)),e("Added image #"+a.length,"string"==typeof d?d.substring(0,100):d))},this)}},d.prototype.hasImageBackground=function(a){return"none"!==a.method},d.prototype.loadImage=function(a){if("url"===a.method){var b=a.args[0];return!this.isSVG(b)||this.support.svg||this.options.allowTaint?b.match(/data:image\/.*;base64,/i)?new f(b.replace(/url\(['"]{0,}|['"]{0,}\)$/gi,""),!1):this.isSameOrigin(b)||this.options.allowTaint===!0||this.isSVG(b)?new f(b,!1):this.support.cors&&!this.options.allowTaint&&this.options.useCORS?new f(b,!0):this.options.proxy?new h(b,this.options.proxy):new g(b):new j(b)}return"linear-gradient"===a.method?new l(a):"gradient"===a.method?new m(a):"svg"===a.method?new k(a.args[0],this.support.svg):"IFRAME"===a.method?new i(a.args[0],this.isSameOrigin(a.args[0].src),this.options):new g(a)},d.prototype.isSVG=function(a){return"svg"===a.substring(a.length-3).toLowerCase()||j.prototype.isInline(a)},d.prototype.imageExists=function(a,b){return a.some(function(a){return a.src===b})},d.prototype.isSameOrigin=function(a){return this.getOrigin(a)===this.origin},d.prototype.getOrigin=function(a){var b=this.link||(this.link=document.createElement("a"));return b.href=a,b.href=b.href,b.protocol+b.hostname+b.port},d.prototype.getPromise=function(a){return this.timeout(a,this.options.imageTimeout)["catch"](function(){var b=new g(a.src);return b.promise.then(function(b){a.image=b})})},d.prototype.get=function(a){var b=null;return this.images.some(function(c){return(b=c).src===a})?b:null},d.prototype.fetch=function(a){return this.images=a.reduce(n(this.findBackgroundImage,this),this.findImages(a)),this.images.forEach(function(a,b){a.promise.then(function(){e("Succesfully loaded image #"+(b+1),a)},function(c){e("Failed loading image #"+(b+1),a,c)})}),this.ready=Promise.all(this.images.map(this.getPromise,this)),e("Finished searching images"),this},d.prototype.timeout=function(a,b){var c,d=Promise.race([a.promise,new Promise(function(d,f){c=setTimeout(function(){e("Timed out loading image",a),f(a)},b)})]).then(function(a){return clearTimeout(c),a});return d["catch"](function(){clearTimeout(c)}),d},b.exports=d},{"./dummyimagecontainer":5,"./framecontainer":8,"./imagecontainer":10,"./lineargradientcontainer":12,"./log":13,"./proxyimagecontainer":17,"./svgcontainer":23,"./svgnodecontainer":24,"./utils":26,"./webkitgradientcontainer":27}],12:[function(a,b,c){function d(a){e.apply(this,arguments),this.type=e.TYPES.LINEAR;var b=d.REGEXP_DIRECTION.test(a.args[0])||!e.REGEXP_COLORSTOP.test(a.args[0]);b?a.args[0].split(/\s+/).reverse().forEach(function(a,b){switch(a){case"left":this.x0=0,this.x1=1;break;case"top":this.y0=0,this.y1=1;break;case"right":this.x0=1,this.x1=0;break;case"bottom":this.y0=1,this.y1=0;break;case"to":var c=this.y0,d=this.x0;this.y0=this.y1,this.x0=this.x1,this.x1=d,this.y1=c;break;case"center":break;default:var e=.01*parseFloat(a,10);if(isNaN(e))break;0===b?(this.y0=e,this.y1=1-this.y0):(this.x0=e,this.x1=1-this.x0)}},this):(this.y0=0,this.y1=1),this.colorStops=a.args.slice(b?1:0).map(function(a){var b=a.match(e.REGEXP_COLORSTOP),c=+b[2],d=0===c?"%":b[3];return{color:new f(b[1]),stop:"%"===d?c/100:null}}),null===this.colorStops[0].stop&&(this.colorStops[0].stop=0),null===this.colorStops[this.colorStops.length-1].stop&&(this.colorStops[this.colorStops.length-1].stop=1),this.colorStops.forEach(function(a,b){null===a.stop&&this.colorStops.slice(b).some(function(c,d){return null!==c.stop?(a.stop=(c.stop-this.colorStops[b-1].stop)/(d+1)+this.colorStops[b-1].stop,!0):!1},this)},this)}var e=a("./gradientcontainer"),f=a("./color");d.prototype=Object.create(e.prototype),d.REGEXP_DIRECTION=/^\s*(?:to|left|right|top|bottom|center|\d{1,3}(?:\.\d+)?%?)(?:\s|$)/i,b.exports=d},{"./color":3,"./gradientcontainer":9}],13:[function(a,b,c){var d=function(){d.options.logging&&window.console&&window.console.log&&Function.prototype.bind.call(window.console.log,window.console).apply(window.console,[Date.now()-d.options.start+"ms","html2canvas:"].concat([].slice.call(arguments,0)))};d.options={logging:!1},b.exports=d},{}],14:[function(a,b,c){function d(a,b){this.node=a,this.parent=b,this.stack=null,this.bounds=null,this.borders=null,this.clip=[],this.backgroundClip=[],this.offsetBounds=null,this.visible=null,this.computedStyles=null,this.colors={},this.styles={},this.backgroundImages=null,this.transformData=null,this.transformMatrix=null,this.isPseudoElement=!1,this.opacity=null}function e(a){var b=a.options[a.selectedIndex||0];return b?b.text||"":""}function f(a){if(a&&"matrix"===a[1])return a[2].split(",").map(function(a){return parseFloat(a.trim())});if(a&&"matrix3d"===a[1]){var b=a[2].split(",").map(function(a){return parseFloat(a.trim())});return[b[0],b[1],b[4],b[5],b[12],b[13]]}}function g(a){return-1!==a.toString().indexOf("%")}function h(a){return a.replace("px","")}function i(a){return parseFloat(a)}var j=a("./color"),k=a("./utils"),l=k.getBounds,m=k.parseBackgrounds,n=k.offsetBounds;d.prototype.cloneTo=function(a){a.visible=this.visible,a.borders=this.borders,a.bounds=this.bounds,a.clip=this.clip,a.backgroundClip=this.backgroundClip,a.computedStyles=this.computedStyles,a.styles=this.styles,a.backgroundImages=this.backgroundImages,a.opacity=this.opacity},d.prototype.getOpacity=function(){return null===this.opacity?this.opacity=this.cssFloat("opacity"):this.opacity},d.prototype.assignStack=function(a){this.stack=a,a.children.push(this)},d.prototype.isElementVisible=function(){return this.node.nodeType===Node.TEXT_NODE?this.parent.visible:"none"!==this.css("display")&&"hidden"!==this.css("visibility")&&!this.node.hasAttribute("data-html2canvas-ignore")&&("INPUT"!==this.node.nodeName||"hidden"!==this.node.getAttribute("type"))},d.prototype.css=function(a){return this.computedStyles||(this.computedStyles=this.isPseudoElement?this.parent.computedStyle(this.before?":before":":after"):this.computedStyle(null)),this.styles[a]||(this.styles[a]=this.computedStyles[a])},d.prototype.prefixedCss=function(a){var b=["webkit","moz","ms","o"],c=this.css(a);return void 0===c&&b.some(function(b){return c=this.css(b+a.substr(0,1).toUpperCase()+a.substr(1)),void 0!==c},this),void 0===c?null:c},d.prototype.computedStyle=function(a){return this.node.ownerDocument.defaultView.getComputedStyle(this.node,a)},d.prototype.cssInt=function(a){var b=parseInt(this.css(a),10);return isNaN(b)?0:b},d.prototype.color=function(a){return this.colors[a]||(this.colors[a]=new j(this.css(a)))},d.prototype.cssFloat=function(a){var b=parseFloat(this.css(a));return isNaN(b)?0:b},d.prototype.fontWeight=function(){var a=this.css("fontWeight");switch(parseInt(a,10)){case 401:a="bold";break;case 400:a="normal"}return a},d.prototype.parseClip=function(){var a=this.css("clip").match(this.CLIP);return a?{top:parseInt(a[1],10),right:parseInt(a[2],10),bottom:parseInt(a[3],10),left:parseInt(a[4],10)}:null},d.prototype.parseBackgroundImages=function(){return this.backgroundImages||(this.backgroundImages=m(this.css("backgroundImage")))},d.prototype.cssList=function(a,b){var c=(this.css(a)||"").split(",");return c=c[b||0]||c[0]||"auto",c=c.trim().split(" "),1===c.length&&(c=[c[0],g(c[0])?"auto":c[0]]),c},d.prototype.parseBackgroundSize=function(a,b,c){var d,e,f=this.cssList("backgroundSize",c);if(g(f[0]))d=a.width*parseFloat(f[0])/100;else{if(/contain|cover/.test(f[0])){var h=a.width/a.height,i=b.width/b.height;return i>h^"contain"===f[0]?{width:a.height*i,height:a.height}:{width:a.width,height:a.width/i}}d=parseInt(f[0],10)}return e="auto"===f[0]&&"auto"===f[1]?b.height:"auto"===f[1]?d/b.width*b.height:g(f[1])?a.height*parseFloat(f[1])/100:parseInt(f[1],10),"auto"===f[0]&&(d=e/b.height*b.width),{width:d,height:e}},d.prototype.parseBackgroundPosition=function(a,b,c,d){var e,f,h=this.cssList("backgroundPosition",c);return e=g(h[0])?(a.width-(d||b).width)*(parseFloat(h[0])/100):parseInt(h[0],10),f="auto"===h[1]?e/b.width*b.height:g(h[1])?(a.height-(d||b).height)*parseFloat(h[1])/100:parseInt(h[1],10),"auto"===h[0]&&(e=f/b.height*b.width),{left:e,top:f}},d.prototype.parseBackgroundRepeat=function(a){return this.cssList("backgroundRepeat",a)[0]},d.prototype.parseTextShadows=function(){var a=this.css("textShadow"),b=[];if(a&&"none"!==a)for(var c=a.match(this.TEXT_SHADOW_PROPERTY),d=0;c&&d0?(this.renderIndex=0,this.asyncRenderer(this.renderQueue,a)):a():(this.renderQueue.forEach(this.paint,this),a())},this))},this))}function e(a){return a.parent&&a.parent.clip.length}function f(a){return a.replace(/(\-[a-z])/g,function(a){return a.toUpperCase().replace("-","")})}function g(){}function h(a,b,c,d){return a.map(function(e,f){if(e.width>0){var g=b.left,h=b.top,i=b.width,j=b.height-a[2].width;switch(f){case 0:j=a[0].width,e.args=l({c1:[g,h],c2:[g+i,h],c3:[g+i-a[1].width,h+j],c4:[g+a[3].width,h+j]},d[0],d[1],c.topLeftOuter,c.topLeftInner,c.topRightOuter,c.topRightInner);break;case 1:g=b.left+b.width-a[1].width,i=a[1].width,e.args=l({c1:[g+i,h],c2:[g+i,h+j+a[2].width],c3:[g,h+j],c4:[g,h+a[0].width]},d[1],d[2],c.topRightOuter,c.topRightInner,c.bottomRightOuter,c.bottomRightInner);break;case 2:h=h+b.height-a[2].width,j=a[2].width,e.args=l({c1:[g+i,h+j],c2:[g,h+j],c3:[g+a[3].width,h],c4:[g+i-a[3].width,h]},d[2],d[3],c.bottomRightOuter,c.bottomRightInner,c.bottomLeftOuter,c.bottomLeftInner);break;case 3:i=a[3].width,e.args=l({c1:[g,h+j+a[2].width],c2:[g,h],c3:[g+i,h+a[0].width],c4:[g+i,h+j]},d[3],d[0],c.bottomLeftOuter,c.bottomLeftInner,c.topLeftOuter,c.topLeftInner)}}return e})}function i(a,b,c,d){var e=4*((Math.sqrt(2)-1)/3),f=c*e,g=d*e,h=a+c,i=b+d;return{topLeft:k({x:a,y:i},{x:a,y:i-g},{x:h-f,y:b},{x:h,y:b}),topRight:k({x:a,y:b},{x:a+f,y:b},{x:h,y:i-g},{x:h,y:i}),bottomRight:k({x:h,y:b},{x:h,y:b+g},{x:a+f,y:i},{x:a,y:i}),bottomLeft:k({x:h,y:i},{x:h-f,y:i},{x:a,y:b+g},{x:a,y:b})}}function j(a,b,c){var d=a.left,e=a.top,f=a.width,g=a.height,h=b[0][0]f+c[3].width?0:k-c[3].width,l-c[0].width).topRight.subdivide(.5),bottomRightOuter:i(d+s,e+r,m,n).bottomRight.subdivide(.5),bottomRightInner:i(d+Math.min(s,f-c[3].width),e+Math.min(r,g+c[0].width),Math.max(0,m-c[1].width),n-c[2].width).bottomRight.subdivide(.5), +bottomLeftOuter:i(d,e+t,o,p).bottomLeft.subdivide(.5),bottomLeftInner:i(d+c[3].width,e+t,Math.max(0,o-c[3].width),p-c[2].width).bottomLeft.subdivide(.5)}}function k(a,b,c,d){var e=function(a,b,c){return{x:a.x+(b.x-a.x)*c,y:a.y+(b.y-a.y)*c}};return{start:a,startControl:b,endControl:c,end:d,subdivide:function(f){var g=e(a,b,f),h=e(b,c,f),i=e(c,d,f),j=e(g,h,f),l=e(h,i,f),m=e(j,l,f);return[k(a,g,j,m),k(m,l,i,d)]},curveTo:function(a){a.push(["bezierCurve",b.x,b.y,c.x,c.y,d.x,d.y])},curveToReversed:function(d){d.push(["bezierCurve",c.x,c.y,b.x,b.y,a.x,a.y])}}}function l(a,b,c,d,e,f,g){var h=[];return b[0]>0||b[1]>0?(h.push(["line",d[1].start.x,d[1].start.y]),d[1].curveTo(h)):h.push(["line",a.c1[0],a.c1[1]]),c[0]>0||c[1]>0?(h.push(["line",f[0].start.x,f[0].start.y]),f[0].curveTo(h),h.push(["line",g[0].end.x,g[0].end.y]),g[0].curveToReversed(h)):(h.push(["line",a.c2[0],a.c2[1]]),h.push(["line",a.c3[0],a.c3[1]])),b[0]>0||b[1]>0?(h.push(["line",e[1].end.x,e[1].end.y]),e[1].curveToReversed(h)):h.push(["line",a.c4[0],a.c4[1]]),h}function m(a,b,c,d,e,f,g){b[0]>0||b[1]>0?(a.push(["line",d[0].start.x,d[0].start.y]),d[0].curveTo(a),d[1].curveTo(a)):a.push(["line",f,g]),(c[0]>0||c[1]>0)&&a.push(["line",e[0].start.x,e[0].start.y])}function n(a){return a.cssInt("zIndex")<0}function o(a){return a.cssInt("zIndex")>0}function p(a){return 0===a.cssInt("zIndex")}function q(a){return-1!==["inline","inline-block","inline-table"].indexOf(a.css("display"))}function r(a){return a instanceof V}function s(a){return a.node.data.trim().length>0}function t(a){return/^(normal|none|0px)$/.test(a.parent.css("letterSpacing"))}function u(a){return["TopLeft","TopRight","BottomRight","BottomLeft"].map(function(b){var c=a.css("border"+b+"Radius"),d=c.split(" ");return d.length<=1&&(d[1]=d[0]),d.map(G)})}function v(a){return a.nodeType===Node.TEXT_NODE||a.nodeType===Node.ELEMENT_NODE}function w(a){var b=a.css("position"),c=-1!==["absolute","relative","fixed"].indexOf(b)?a.css("zIndex"):"auto";return"auto"!==c}function x(a){return"static"!==a.css("position")}function y(a){return"none"!==a.css("float")}function z(a){return-1!==["inline-block","inline-table"].indexOf(a.css("display"))}function A(a){var b=this;return function(){return!a.apply(b,arguments)}}function B(a){return a.node.nodeType===Node.ELEMENT_NODE}function C(a){return a.isPseudoElement===!0}function D(a){return a.node.nodeType===Node.TEXT_NODE}function E(a){return function(b,c){return b.cssInt("zIndex")+a.indexOf(b)/a.length-(c.cssInt("zIndex")+a.indexOf(c)/a.length)}}function F(a){return a.getOpacity()<1}function G(a){return parseInt(a,10)}function H(a){return a.width}function I(a){return a.node.nodeType!==Node.ELEMENT_NODE||-1===["SCRIPT","HEAD","TITLE","OBJECT","BR","OPTION"].indexOf(a.node.nodeName)}function J(a){return[].concat.apply([],a)}function K(a){var b=a.substr(0,1);return b===a.substr(a.length-1)&&b.match(/'|"/)?a.substr(1,a.length-2):a}function L(a){for(var b,c=[],d=0,e=!1;a.length;)M(a[d])===e?(b=a.splice(0,d),b.length&&c.push(P.ucs2.encode(b)),e=!e,d=0):d++,d>=a.length&&(b=a.splice(0,d),b.length&&c.push(P.ucs2.encode(b)));return c}function M(a){return-1!==[32,13,10,9,45].indexOf(a)}function N(a){return/[^\u0000-\u00ff]/.test(a)}var O=a("./log"),P=a("punycode"),Q=a("./nodecontainer"),R=a("./textcontainer"),S=a("./pseudoelementcontainer"),T=a("./fontmetrics"),U=a("./color"),V=a("./stackingcontext"),W=a("./utils"),X=W.bind,Y=W.getBounds,Z=W.parseBackgrounds,$=W.offsetBounds;d.prototype.calculateOverflowClips=function(){this.nodes.forEach(function(a){if(B(a)){C(a)&&a.appendToDOM(),a.borders=this.parseBorders(a);var b="hidden"===a.css("overflow")?[a.borders.clip]:[],c=a.parseClip();c&&-1!==["absolute","fixed"].indexOf(a.css("position"))&&b.push([["rect",a.bounds.left+c.left,a.bounds.top+c.top,c.right-c.left,c.bottom-c.top]]),a.clip=e(a)?a.parent.clip.concat(b):b,a.backgroundClip="hidden"!==a.css("overflow")?a.clip.concat([a.borders.clip]):a.clip,C(a)&&a.cleanDOM()}else D(a)&&(a.clip=e(a)?a.parent.clip:[]);C(a)||(a.bounds=null)},this)},d.prototype.asyncRenderer=function(a,b,c){c=c||Date.now(),this.paint(a[this.renderIndex++]),a.length===this.renderIndex?b():c+20>Date.now()?this.asyncRenderer(a,b,c):setTimeout(X(function(){this.asyncRenderer(a,b)},this),0)},d.prototype.createPseudoHideStyles=function(a){this.createStyles(a,"."+S.prototype.PSEUDO_HIDE_ELEMENT_CLASS_BEFORE+':before { content: "" !important; display: none !important; }.'+S.prototype.PSEUDO_HIDE_ELEMENT_CLASS_AFTER+':after { content: "" !important; display: none !important; }')},d.prototype.disableAnimations=function(a){this.createStyles(a,"* { -webkit-animation: none !important; -moz-animation: none !important; -o-animation: none !important; animation: none !important; -webkit-transition: none !important; -moz-transition: none !important; -o-transition: none !important; transition: none !important;}")},d.prototype.createStyles=function(a,b){var c=a.createElement("style");c.innerHTML=b,a.body.appendChild(c)},d.prototype.getPseudoElements=function(a){var b=[[a]];if(a.node.nodeType===Node.ELEMENT_NODE){var c=this.getPseudoElement(a,":before"),d=this.getPseudoElement(a,":after");c&&b.push(c),d&&b.push(d)}return J(b)},d.prototype.getPseudoElement=function(a,b){var c=a.computedStyle(b);if(!c||!c.content||"none"===c.content||"-moz-alt-content"===c.content||"none"===c.display)return null;for(var d=K(c.content),e="url"===d.substr(0,3),g=document.createElement(e?"img":"html2canvaspseudoelement"),h=new S(g,a,b),i=c.length-1;i>=0;i--){var j=f(c.item(i));g.style[j]=c[j]}if(g.className=S.prototype.PSEUDO_HIDE_ELEMENT_CLASS_BEFORE+" "+S.prototype.PSEUDO_HIDE_ELEMENT_CLASS_AFTER,e)return g.src=Z(d)[0].args[0],[h];var k=document.createTextNode(d);return g.appendChild(k),[h,new R(k,h)]},d.prototype.getChildren=function(a){return J([].filter.call(a.node.childNodes,v).map(function(b){var c=[b.nodeType===Node.TEXT_NODE?new R(b,a):new Q(b,a)].filter(I);return b.nodeType===Node.ELEMENT_NODE&&c.length&&"TEXTAREA"!==b.tagName?c[0].isElementVisible()?c.concat(this.getChildren(c[0])):[]:c},this))},d.prototype.newStackingContext=function(a,b){var c=new V(b,a.getOpacity(),a.node,a.parent);a.cloneTo(c);var d=b?c.getParentStack(this):c.parent.stack;d.contexts.push(c),a.stack=c},d.prototype.createStackingContexts=function(){this.nodes.forEach(function(a){B(a)&&(this.isRootElement(a)||F(a)||w(a)||this.isBodyWithTransparentRoot(a)||a.hasTransform())?this.newStackingContext(a,!0):B(a)&&(x(a)&&p(a)||z(a)||y(a))?this.newStackingContext(a,!1):a.assignStack(a.parent.stack)},this)},d.prototype.isBodyWithTransparentRoot=function(a){return"BODY"===a.node.nodeName&&a.parent.color("backgroundColor").isTransparent()},d.prototype.isRootElement=function(a){return null===a.parent},d.prototype.sortStackingContexts=function(a){a.contexts.sort(E(a.contexts.slice(0))),a.contexts.forEach(this.sortStackingContexts,this)},d.prototype.parseTextBounds=function(a){return function(b,c,d){if("none"!==a.parent.css("textDecoration").substr(0,4)||0!==b.trim().length){if(this.support.rangeBounds&&!a.parent.hasTransform()){var e=d.slice(0,c).join("").length;return this.getRangeBounds(a.node,e,b.length)}if(a.node&&"string"==typeof a.node.data){var f=a.node.splitText(b.length),g=this.getWrapperBounds(a.node,a.parent.hasTransform());return a.node=f,g}}else(!this.support.rangeBounds||a.parent.hasTransform())&&(a.node=a.node.splitText(b.length));return{}}},d.prototype.getWrapperBounds=function(a,b){var c=a.ownerDocument.createElement("html2canvaswrapper"),d=a.parentNode,e=a.cloneNode(!0);c.appendChild(a.cloneNode(!0)),d.replaceChild(c,a);var f=b?$(c):Y(c);return d.replaceChild(e,c),f},d.prototype.getRangeBounds=function(a,b,c){var d=this.range||(this.range=a.ownerDocument.createRange());return d.setStart(a,b),d.setEnd(a,b+c),d.getBoundingClientRect()},d.prototype.parse=function(a){var b=a.contexts.filter(n),c=a.children.filter(B),d=c.filter(A(y)),e=d.filter(A(x)).filter(A(q)),f=c.filter(A(x)).filter(y),h=d.filter(A(x)).filter(q),i=a.contexts.concat(d.filter(x)).filter(p),j=a.children.filter(D).filter(s),k=a.contexts.filter(o);b.concat(e).concat(f).concat(h).concat(i).concat(j).concat(k).forEach(function(a){this.renderQueue.push(a),r(a)&&(this.parse(a),this.renderQueue.push(new g))},this)},d.prototype.paint=function(a){try{a instanceof g?this.renderer.ctx.restore():D(a)?(C(a.parent)&&a.parent.appendToDOM(),this.paintText(a),C(a.parent)&&a.parent.cleanDOM()):this.paintNode(a)}catch(b){if(O(b),this.options.strict)throw b}},d.prototype.paintNode=function(a){r(a)&&(this.renderer.setOpacity(a.opacity),this.renderer.ctx.save(),a.hasTransform()&&this.renderer.setTransform(a.parseTransform())),"INPUT"===a.node.nodeName&&"checkbox"===a.node.type?this.paintCheckbox(a):"INPUT"===a.node.nodeName&&"radio"===a.node.type?this.paintRadio(a):this.paintElement(a)},d.prototype.paintElement=function(a){var b=a.parseBounds();this.renderer.clip(a.backgroundClip,function(){this.renderer.renderBackground(a,b,a.borders.borders.map(H))},this),this.renderer.clip(a.clip,function(){this.renderer.renderBorders(a.borders.borders)},this),this.renderer.clip(a.backgroundClip,function(){switch(a.node.nodeName){case"svg":case"IFRAME":var c=this.images.get(a.node);c?this.renderer.renderImage(a,b,a.borders,c):O("Error loading <"+a.node.nodeName+">",a.node);break;case"IMG":var d=this.images.get(a.node.src);d?this.renderer.renderImage(a,b,a.borders,d):O("Error loading ",a.node.src);break;case"CANVAS":this.renderer.renderImage(a,b,a.borders,{image:a.node});break;case"SELECT":case"INPUT":case"TEXTAREA":this.paintFormValue(a)}},this)},d.prototype.paintCheckbox=function(a){var b=a.parseBounds(),c=Math.min(b.width,b.height),d={width:c-1,height:c-1,top:b.top,left:b.left},e=[3,3],f=[e,e,e,e],g=[1,1,1,1].map(function(a){return{color:new U("#A5A5A5"),width:a}}),i=j(d,f,g);this.renderer.clip(a.backgroundClip,function(){this.renderer.rectangle(d.left+1,d.top+1,d.width-2,d.height-2,new U("#DEDEDE")),this.renderer.renderBorders(h(g,d,i,f)),a.node.checked&&(this.renderer.font(new U("#424242"),"normal","normal","bold",c-3+"px","arial"),this.renderer.text("✔",d.left+c/6,d.top+c-1))},this)},d.prototype.paintRadio=function(a){var b=a.parseBounds(),c=Math.min(b.width,b.height)-2;this.renderer.clip(a.backgroundClip,function(){this.renderer.circleStroke(b.left+1,b.top+1,c,new U("#DEDEDE"),1,new U("#A5A5A5")),a.node.checked&&this.renderer.circle(Math.ceil(b.left+c/4)+1,Math.ceil(b.top+c/4)+1,Math.floor(c/2),new U("#424242"))},this)},d.prototype.paintFormValue=function(a){var b=a.getValue();if(b.length>0){var c=a.node.ownerDocument,d=c.createElement("html2canvaswrapper"),e=["lineHeight","textAlign","fontFamily","fontWeight","fontSize","color","paddingLeft","paddingTop","paddingRight","paddingBottom","width","height","borderLeftStyle","borderTopStyle","borderLeftWidth","borderTopWidth","boxSizing","whiteSpace","wordWrap"];e.forEach(function(b){try{d.style[b]=a.css(b)}catch(c){O("html2canvas: Parse: Exception caught in renderFormValue: "+c.message)}});var f=a.parseBounds();d.style.position="fixed",d.style.left=f.left+"px",d.style.top=f.top+"px",d.textContent=b,c.body.appendChild(d),this.paintText(new R(d.firstChild,a)),c.body.removeChild(d)}},d.prototype.paintText=function(a){a.applyTextTransform();var b=P.ucs2.decode(a.node.data),c=this.options.letterRendering&&!t(a)||N(a.node.data)?b.map(function(a){return P.ucs2.encode([a])}):L(b),d=a.parent.fontWeight(),e=a.parent.css("fontSize"),f=a.parent.css("fontFamily"),g=a.parent.parseTextShadows();this.renderer.font(a.parent.color("color"),a.parent.css("fontStyle"),a.parent.css("fontVariant"),d,e,f),g.length?this.renderer.fontShadow(g[0].color,g[0].offsetX,g[0].offsetY,g[0].blur):this.renderer.clearShadow(),this.renderer.clip(a.parent.clip,function(){c.map(this.parseTextBounds(a),this).forEach(function(b,d){b&&(this.renderer.text(c[d],b.left,b.bottom),this.renderTextDecoration(a.parent,b,this.fontMetrics.getMetrics(f,e)))},this)},this)},d.prototype.renderTextDecoration=function(a,b,c){switch(a.css("textDecoration").split(" ")[0]){case"underline":this.renderer.rectangle(b.left,Math.round(b.top+c.baseline+c.lineWidth),b.width,1,a.color("color"));break;case"overline":this.renderer.rectangle(b.left,Math.round(b.top),b.width,1,a.color("color"));break;case"line-through":this.renderer.rectangle(b.left,Math.ceil(b.top+c.middle+c.lineWidth),b.width,1,a.color("color"))}};var _={inset:[["darken",.6],["darken",.1],["darken",.1],["darken",.6]]};d.prototype.parseBorders=function(a){var b=a.parseBounds(),c=u(a),d=["Top","Right","Bottom","Left"].map(function(b,c){var d=a.css("border"+b+"Style"),e=a.color("border"+b+"Color");"inset"===d&&e.isBlack()&&(e=new U([255,255,255,e.a]));var f=_[d]?_[d][c]:null;return{width:a.cssInt("border"+b+"Width"),color:f?e[f[0]](f[1]):e,args:null}}),e=j(b,c,d);return{clip:this.parseBackgroundClip(a,e,d,c,b),borders:h(d,b,e,c)}},d.prototype.parseBackgroundClip=function(a,b,c,d,e){var f=a.css("backgroundClip"),g=[];switch(f){case"content-box":case"padding-box":m(g,d[0],d[1],b.topLeftInner,b.topRightInner,e.left+c[3].width,e.top+c[0].width),m(g,d[1],d[2],b.topRightInner,b.bottomRightInner,e.left+e.width-c[1].width,e.top+c[0].width),m(g,d[2],d[3],b.bottomRightInner,b.bottomLeftInner,e.left+e.width-c[1].width,e.top+e.height-c[2].width),m(g,d[3],d[0],b.bottomLeftInner,b.topLeftInner,e.left+c[3].width,e.top+e.height-c[2].width);break;default:m(g,d[0],d[1],b.topLeftOuter,b.topRightOuter,e.left,e.top),m(g,d[1],d[2],b.topRightOuter,b.bottomRightOuter,e.left+e.width,e.top),m(g,d[2],d[3],b.bottomRightOuter,b.bottomLeftOuter,e.left+e.width,e.top+e.height),m(g,d[3],d[0],b.bottomLeftOuter,b.topLeftOuter,e.left,e.top+e.height)}return g},b.exports=d},{"./color":3,"./fontmetrics":7,"./log":13,"./nodecontainer":14,"./pseudoelementcontainer":18,"./stackingcontext":21,"./textcontainer":25,"./utils":26,punycode:1}],16:[function(a,b,c){function d(a,b,c){var d="withCredentials"in new XMLHttpRequest;if(!b)return Promise.reject("No proxy configured");var e=g(d),i=h(b,a,e);return d?k(i):f(c,i,e).then(function(a){return o(a.content)})}function e(a,b,c){var d="crossOrigin"in new Image,e=g(d),i=h(b,a,e);return d?Promise.resolve(i):f(c,i,e).then(function(a){return"data:"+a.type+";base64,"+a.content})}function f(a,b,c){return new Promise(function(d,e){var f=a.createElement("script"),g=function(){delete window.html2canvas.proxy[c],a.body.removeChild(f)};window.html2canvas.proxy[c]=function(a){g(),d(a)},f.src=b,f.onerror=function(a){g(),e(a)},a.body.appendChild(f)})}function g(a){return a?"":"html2canvas_"+Date.now()+"_"+ ++p+"_"+Math.round(1e5*Math.random())}function h(a,b,c){return a+"?url="+encodeURIComponent(b)+(c.length?"&callback=html2canvas.proxy."+c:"")}function i(a){return function(b){var c,d=new DOMParser;try{c=d.parseFromString(b,"text/html")}catch(e){m("DOMParser not supported, falling back to createHTMLDocument"),c=document.implementation.createHTMLDocument("");try{c.open(),c.write(b),c.close()}catch(f){m("createHTMLDocument write not supported, falling back to document.body.innerHTML"),c.body.innerHTML=b}}var g=c.querySelector("base");if(!g||!g.href.host){var h=c.createElement("base");h.href=a,c.head.insertBefore(h,c.head.firstChild)}return c}}function j(a,b,c,e,f,g){return new d(a,b,window.document).then(i(a)).then(function(a){return n(a,c,e,f,g,0,0)})}var k=a("./xhr"),l=a("./utils"),m=a("./log"),n=a("./clone"),o=l.decode64,p=0;c.Proxy=d,c.ProxyURL=e,c.loadUrlDocument=j},{"./clone":2,"./log":13,"./utils":26,"./xhr":28}],17:[function(a,b,c){function d(a,b){var c=document.createElement("a");c.href=a,a=c.href,this.src=a,this.image=new Image;var d=this;this.promise=new Promise(function(c,f){d.image.crossOrigin="Anonymous",d.image.onload=c,d.image.onerror=f,new e(a,b,document).then(function(a){d.image.src=a})["catch"](f)})}var e=a("./proxy").ProxyURL;b.exports=d},{"./proxy":16}],18:[function(a,b,c){function d(a,b,c){e.call(this,a,b),this.isPseudoElement=!0,this.before=":before"===c}var e=a("./nodecontainer");d.prototype.cloneTo=function(a){d.prototype.cloneTo.call(this,a),a.isPseudoElement=!0,a.before=this.before},d.prototype=Object.create(e.prototype),d.prototype.appendToDOM=function(){this.before?this.parent.node.insertBefore(this.node,this.parent.node.firstChild):this.parent.node.appendChild(this.node),this.parent.node.className+=" "+this.getHideClass()},d.prototype.cleanDOM=function(){this.node.parentNode.removeChild(this.node),this.parent.node.className=this.parent.node.className.replace(this.getHideClass(),"")},d.prototype.getHideClass=function(){return this["PSEUDO_HIDE_ELEMENT_CLASS_"+(this.before?"BEFORE":"AFTER")]},d.prototype.PSEUDO_HIDE_ELEMENT_CLASS_BEFORE="___html2canvas___pseudoelement_before",d.prototype.PSEUDO_HIDE_ELEMENT_CLASS_AFTER="___html2canvas___pseudoelement_after",b.exports=d},{"./nodecontainer":14}],19:[function(a,b,c){function d(a,b,c,d,e){this.width=a,this.height=b,this.images=c,this.options=d,this.document=e}var e=a("./log");d.prototype.renderImage=function(a,b,c,d){var e=a.cssInt("paddingLeft"),f=a.cssInt("paddingTop"),g=a.cssInt("paddingRight"),h=a.cssInt("paddingBottom"),i=c.borders,j=b.width-(i[1].width+i[3].width+e+g),k=b.height-(i[0].width+i[2].width+f+h);this.drawImage(d,0,0,d.image.width||j,d.image.height||k,b.left+e+i[3].width,b.top+f+i[0].width,j,k)},d.prototype.renderBackground=function(a,b,c){b.height>0&&b.width>0&&(this.renderBackgroundColor(a,b),this.renderBackgroundImage(a,b,c))},d.prototype.renderBackgroundColor=function(a,b){var c=a.color("backgroundColor");c.isTransparent()||this.rectangle(b.left,b.top,b.width,b.height,c)},d.prototype.renderBorders=function(a){a.forEach(this.renderBorder,this)},d.prototype.renderBorder=function(a){a.color.isTransparent()||null===a.args||this.drawShape(a.args,a.color)},d.prototype.renderBackgroundImage=function(a,b,c){var d=a.parseBackgroundImages();d.reverse().forEach(function(d,f,g){switch(d.method){case"url":var h=this.images.get(d.args[0]);h?this.renderBackgroundRepeating(a,b,h,g.length-(f+1),c):e("Error loading background-image",d.args[0]);break;case"linear-gradient":case"gradient":var i=this.images.get(d.value);i?this.renderBackgroundGradient(i,b,c):e("Error loading background-image",d.args[0]);break;case"none":break;default:e("Unknown background-image type",d.args[0])}},this)},d.prototype.renderBackgroundRepeating=function(a,b,c,d,e){var f=a.parseBackgroundSize(b,c.image,d),g=a.parseBackgroundPosition(b,c.image,d,f),h=a.parseBackgroundRepeat(d);switch(h){case"repeat-x":case"repeat no-repeat":this.backgroundRepeatShape(c,g,f,b,b.left+e[3],b.top+g.top+e[0],99999,f.height,e);break;case"repeat-y":case"no-repeat repeat":this.backgroundRepeatShape(c,g,f,b,b.left+g.left+e[3],b.top+e[0],f.width,99999,e);break;case"no-repeat":this.backgroundRepeatShape(c,g,f,b,b.left+g.left+e[3],b.top+g.top+e[0],f.width,f.height,e);break;default:this.renderBackgroundRepeat(c,g,f,{top:b.top,left:b.left},e[3],e[0])}},b.exports=d},{"./log":13}],20:[function(a,b,c){function d(a,b){f.apply(this,arguments),this.canvas=this.options.canvas||this.document.createElement("canvas"),this.options.canvas||(this.canvas.width=a,this.canvas.height=b),this.ctx=this.canvas.getContext("2d"),this.taintCtx=this.document.createElement("canvas").getContext("2d"),this.ctx.textBaseline="bottom",this.variables={},h("Initialized CanvasRenderer with size",a,"x",b)}function e(a){return a.length>0}var f=a("../renderer"),g=a("../lineargradientcontainer"),h=a("../log");d.prototype=Object.create(f.prototype),d.prototype.setFillStyle=function(a){return this.ctx.fillStyle="object"==typeof a&&a.isColor?a.toString():a,this.ctx},d.prototype.rectangle=function(a,b,c,d,e){this.setFillStyle(e).fillRect(a,b,c,d)},d.prototype.circle=function(a,b,c,d){this.setFillStyle(d),this.ctx.beginPath(),this.ctx.arc(a+c/2,b+c/2,c/2,0,2*Math.PI,!0),this.ctx.closePath(),this.ctx.fill()},d.prototype.circleStroke=function(a,b,c,d,e,f){this.circle(a,b,c,d),this.ctx.strokeStyle=f.toString(),this.ctx.stroke()},d.prototype.drawShape=function(a,b){this.shape(a),this.setFillStyle(b).fill()},d.prototype.taints=function(a){if(null===a.tainted){this.taintCtx.drawImage(a.image,0,0);try{this.taintCtx.getImageData(0,0,1,1),a.tainted=!1}catch(b){this.taintCtx=document.createElement("canvas").getContext("2d"),a.tainted=!0}}return a.tainted},d.prototype.drawImage=function(a,b,c,d,e,f,g,h,i){(!this.taints(a)||this.options.allowTaint)&&this.ctx.drawImage(a.image,b,c,d,e,f,g,h,i)},d.prototype.clip=function(a,b,c){this.ctx.save(),a.filter(e).forEach(function(a){this.shape(a).clip()},this),b.call(c),this.ctx.restore()},d.prototype.shape=function(a){return this.ctx.beginPath(),a.forEach(function(a,b){"rect"===a[0]?this.ctx.rect.apply(this.ctx,a.slice(1)):this.ctx[0===b?"moveTo":a[0]+"To"].apply(this.ctx,a.slice(1))},this),this.ctx.closePath(),this.ctx},d.prototype.font=function(a,b,c,d,e,f){this.setFillStyle(a).font=[b,c,d,e,f].join(" ").split(",")[0]},d.prototype.fontShadow=function(a,b,c,d){this.setVariable("shadowColor",a.toString()).setVariable("shadowOffsetY",b).setVariable("shadowOffsetX",c).setVariable("shadowBlur",d)},d.prototype.clearShadow=function(){this.setVariable("shadowColor","rgba(0,0,0,0)")},d.prototype.setOpacity=function(a){this.ctx.globalAlpha=a},d.prototype.setTransform=function(a){this.ctx.translate(a.origin[0],a.origin[1]),this.ctx.transform.apply(this.ctx,a.matrix),this.ctx.translate(-a.origin[0],-a.origin[1])},d.prototype.setVariable=function(a,b){return this.variables[a]!==b&&(this.variables[a]=this.ctx[a]=b),this},d.prototype.text=function(a,b,c){this.ctx.fillText(a,b,c)},d.prototype.backgroundRepeatShape=function(a,b,c,d,e,f,g,h,i){var j=[["line",Math.round(e),Math.round(f)],["line",Math.round(e+g),Math.round(f)],["line",Math.round(e+g),Math.round(h+f)],["line",Math.round(e),Math.round(h+f)]];this.clip([j],function(){this.renderBackgroundRepeat(a,b,c,d,i[3],i[0])},this)},d.prototype.renderBackgroundRepeat=function(a,b,c,d,e,f){var g=Math.round(d.left+b.left+e),h=Math.round(d.top+b.top+f);this.setFillStyle(this.ctx.createPattern(this.resizeImage(a,c),"repeat")),this.ctx.translate(g,h),this.ctx.fill(),this.ctx.translate(-g,-h)},d.prototype.renderBackgroundGradient=function(a,b){if(a instanceof g){var c=this.ctx.createLinearGradient(b.left+b.width*a.x0,b.top+b.height*a.y0,b.left+b.width*a.x1,b.top+b.height*a.y1);a.colorStops.forEach(function(a){c.addColorStop(a.stop,a.color.toString())}),this.rectangle(b.left,b.top,b.width,b.height,c)}},d.prototype.resizeImage=function(a,b){var c=a.image;if(c.width===b.width&&c.height===b.height)return c;var d,e=document.createElement("canvas");return e.width=b.width,e.height=b.height,d=e.getContext("2d"),d.drawImage(c,0,0,c.width,c.height,0,0,b.width,b.height),e},b.exports=d},{"../lineargradientcontainer":12,"../log":13,"../renderer":19}],21:[function(a,b,c){function d(a,b,c,d){e.call(this,c,d),this.ownStacking=a,this.contexts=[],this.children=[],this.opacity=(this.parent?this.parent.stack.opacity:1)*b}var e=a("./nodecontainer");d.prototype=Object.create(e.prototype),d.prototype.getParentStack=function(a){var b=this.parent?this.parent.stack:null;return b?b.ownStacking?b:b.getParentStack(a):a.stack},b.exports=d},{"./nodecontainer":14}],22:[function(a,b,c){function d(a){this.rangeBounds=this.testRangeBounds(a),this.cors=this.testCORS(),this.svg=this.testSVG()}d.prototype.testRangeBounds=function(a){var b,c,d,e,f=!1;return a.createRange&&(b=a.createRange(),b.getBoundingClientRect&&(c=a.createElement("boundtest"),c.style.height="123px",c.style.display="block",a.body.appendChild(c),b.selectNode(c),d=b.getBoundingClientRect(),e=d.height,123===e&&(f=!0),a.body.removeChild(c))),f},d.prototype.testCORS=function(){return"undefined"!=typeof(new Image).crossOrigin},d.prototype.testSVG=function(){var a=new Image,b=document.createElement("canvas"),c=b.getContext("2d");a.src="data:image/svg+xml,";try{c.drawImage(a,0,0),b.toDataURL()}catch(d){return!1}return!0},b.exports=d},{}],23:[function(a,b,c){function d(a){this.src=a,this.image=null;var b=this;this.promise=this.hasFabric().then(function(){return b.isInline(a)?Promise.resolve(b.inlineFormatting(a)):e(a)}).then(function(a){return new Promise(function(c){window.html2canvas.svg.fabric.loadSVGFromString(a,b.createCanvas.call(b,c))})})}var e=a("./xhr"),f=a("./utils").decode64;d.prototype.hasFabric=function(){return window.html2canvas.svg&&window.html2canvas.svg.fabric?Promise.resolve():Promise.reject(new Error("html2canvas.svg.js is not loaded, cannot render svg"))},d.prototype.inlineFormatting=function(a){return/^data:image\/svg\+xml;base64,/.test(a)?this.decode64(this.removeContentType(a)):this.removeContentType(a)},d.prototype.removeContentType=function(a){return a.replace(/^data:image\/svg\+xml(;base64)?,/,"")},d.prototype.isInline=function(a){return/^data:image\/svg\+xml/i.test(a)},d.prototype.createCanvas=function(a){var b=this;return function(c,d){var e=new window.html2canvas.svg.fabric.StaticCanvas("c");b.image=e.lowerCanvasEl,e.setWidth(d.width).setHeight(d.height).add(window.html2canvas.svg.fabric.util.groupSVGElements(c,d)).renderAll(),a(e.lowerCanvasEl)}},d.prototype.decode64=function(a){return"function"==typeof window.atob?window.atob(a):f(a)},b.exports=d},{"./utils":26,"./xhr":28}],24:[function(a,b,c){function d(a,b){this.src=a,this.image=null;var c=this;this.promise=b?new Promise(function(b,d){c.image=new Image,c.image.onload=b,c.image.onerror=d,c.image.src="data:image/svg+xml,"+(new XMLSerializer).serializeToString(a),c.image.complete===!0&&b(c.image)}):this.hasFabric().then(function(){return new Promise(function(b){window.html2canvas.svg.fabric.parseSVGDocument(a,c.createCanvas.call(c,b))})})}var e=a("./svgcontainer");d.prototype=Object.create(e.prototype),b.exports=d},{"./svgcontainer":23}],25:[function(a,b,c){function d(a,b){f.call(this,a,b)}function e(a,b,c){return a.length>0?b+c.toUpperCase():void 0}var f=a("./nodecontainer");d.prototype=Object.create(f.prototype),d.prototype.applyTextTransform=function(){this.node.data=this.transform(this.parent.css("textTransform"))},d.prototype.transform=function(a){var b=this.node.data;switch(a){case"lowercase":return b.toLowerCase();case"capitalize":return b.replace(/(^|\s|:|-|\(|\))([a-z])/g,e);case"uppercase":return b.toUpperCase();default:return b}},b.exports=d},{"./nodecontainer":14}],26:[function(a,b,c){c.smallImage=function(){return"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"},c.bind=function(a,b){return function(){return a.apply(b,arguments)}},c.decode64=function(a){var b,c,d,e,f,g,h,i,j="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",k=a.length,l="";for(b=0;k>b;b+=4)c=j.indexOf(a[b]),d=j.indexOf(a[b+1]),e=j.indexOf(a[b+2]),f=j.indexOf(a[b+3]),g=c<<2|d>>4,h=(15&d)<<4|e>>2,i=(3&e)<<6|f,l+=64===e?String.fromCharCode(g):64===f||-1===f?String.fromCharCode(g,h):String.fromCharCode(g,h,i);return l},c.getBounds=function(a){if(a.getBoundingClientRect){var b=a.getBoundingClientRect(),c=null==a.offsetWidth?b.width:a.offsetWidth;return{top:b.top,bottom:b.bottom||b.top+b.height,right:b.left+c,left:b.left,width:c,height:null==a.offsetHeight?b.height:a.offsetHeight}}return{}},c.offsetBounds=function(a){var b=a.offsetParent?c.offsetBounds(a.offsetParent):{top:0,left:0};return{top:a.offsetTop+b.top,bottom:a.offsetTop+a.offsetHeight+b.top,right:a.offsetLeft+b.left+a.offsetWidth,left:a.offsetLeft+b.left,width:a.offsetWidth,height:a.offsetHeight}},c.parseBackgrounds=function(a){var b,c,d,e,f,g,h,i=" \r\n ",j=[],k=0,l=0,m=function(){b&&('"'===c.substr(0,1)&&(c=c.substr(1,c.length-2)),c&&h.push(c),"-"===b.substr(0,1)&&(e=b.indexOf("-",1)+1)>0&&(d=b.substr(0,e),b=b.substr(e)),j.push({prefix:d,method:b.toLowerCase(),value:f,args:h,image:null})),h=[],b=d=c=f=""};return h=[],b=d=c=f="",a.split("").forEach(function(a){if(!(0===k&&i.indexOf(a)>-1)){switch(a){case'"':g?g===a&&(g=null):g=a;break;case"(":if(g)break;if(0===k)return k=1,void(f+=a);l++;break;case")":if(g)break;if(1===k){if(0===l)return k=0,f+=a,void m();l--}break;case",":if(g)break;if(0===k)return void m();if(1===k&&0===l&&!b.match(/^url$/i))return h.push(c),c="",void(f+=a)}f+=a,0===k?b+=a:c+=a}}),m(),j}},{}],27:[function(a,b,c){function d(a){e.apply(this,arguments),this.type="linear"===a.args[0]?e.TYPES.LINEAR:e.TYPES.RADIAL}var e=a("./gradientcontainer");d.prototype=Object.create(e.prototype),b.exports=d},{"./gradientcontainer":9}],28:[function(a,b,c){function d(a){return new Promise(function(b,c){var d=new XMLHttpRequest;d.open("GET",a),d.onload=function(){200===d.status?b(d.responseText):c(new Error(d.statusText))},d.onerror=function(){c(new Error("Network Error"))},d.send()})}b.exports=d},{}]},{},[4])(4)}); \ No newline at end of file diff --git a/js/pdf.min.js b/js/pdf.min.js new file mode 100644 index 0000000..c8d75ef --- /dev/null +++ b/js/pdf.min.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("pdfjs-dist/build/pdf",[],t):"object"==typeof exports?exports["pdfjs-dist/build/pdf"]=t():e["pdfjs-dist/build/pdf"]=e.pdfjsDistBuildPdf=t()}(this,function(){return function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=63)}([function(e,t,r){"use strict";function n(e){v>=m.warnings&&console.log("Warning: "+e)}function i(e){throw new Error(e)}function a(e,t){e||i(t)}function s(e){a("string"==typeof e,"Invalid argument for stringToBytes");for(var t=e.length,r=new Uint8Array(t),n=0;n2&&void 0!==arguments[2]?arguments[2]:null;return e?new Promise(function(n,i){n(e.apply(r,t))}):Promise.resolve(void 0)}function c(e){if("object"!==(void 0===e?"undefined":f(e)))return e;switch(e.name){case"AbortException":return new R(e.message);case"MissingPDFException":return new y(e.message);case"UnexpectedResponseException":return new A(e.message,e.status);default:return new b(e.message,e.details)}}function h(e,t,r){t?e.resolve():e.reject(r)}function d(e,t,r){var n=this;this.sourceName=e,this.targetName=t,this.comObj=r,this.callbackId=1,this.streamId=1,this.postMessageTransfers=!0,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null);var i=this.callbacksCapabilities=Object.create(null),a=this.actionHandler=Object.create(null);this._onComObjOnMessage=function(e){var t=e.data;if(t.targetName===n.sourceName)if(t.stream)n._processStreamMessage(t);else if(t.isReply){var s=t.callbackId;if(!(t.callbackId in i))throw new Error("Cannot resolve callback "+s);var o=i[s];delete i[s],"error"in t?o.reject(c(t.error)):o.resolve(t.data)}else{if(!(t.action in a))throw new Error("Unknown action from worker: "+t.action);var l=a[t.action];if(t.callbackId){var u=n.sourceName,h=t.sourceName;Promise.resolve().then(function(){return l[0].call(l[1],t.data)}).then(function(e){r.postMessage({sourceName:u,targetName:h,isReply:!0,callbackId:t.callbackId,data:e})},function(e){r.postMessage({sourceName:u,targetName:h,isReply:!0,callbackId:t.callbackId,error:function(e){return!(e instanceof Error)||e instanceof R||e instanceof y||e instanceof A||e instanceof b?e:new b(e.message,e.toString())}(e)})})}else t.streamId?n._createStreamSink(t):l[0].call(l[1],t.data)}},r.addEventListener("message",this._onComObjOnMessage)}Object.defineProperty(t,"__esModule",{value:!0}),t.unreachable=t.warn=t.utf8StringToString=t.stringToUTF8String=t.stringToPDFString=t.stringToBytes=t.string32=t.shadow=t.setVerbosityLevel=t.ReadableStream=t.removeNullCharacters=t.readUint32=t.readUint16=t.readInt8=t.log2=t.loadJpegStream=t.isEvalSupported=t.isLittleEndian=t.createValidAbsoluteUrl=t.isSameOrigin=t.isNodeJS=t.isSpace=t.isString=t.isNum=t.isEmptyObj=t.isBool=t.isArrayBuffer=t.info=t.getVerbosityLevel=t.getLookupTableFactory=t.deprecated=t.createObjectURL=t.createPromiseCapability=t.createBlob=t.bytesToString=t.assert=t.arraysToBytes=t.arrayByteLength=t.FormatError=t.XRefParseException=t.Util=t.UnknownErrorException=t.UnexpectedResponseException=t.TextRenderingMode=t.StreamType=t.StatTimer=t.PasswordResponses=t.PasswordException=t.PageViewport=t.NotImplementedException=t.NativeImageDecoding=t.MissingPDFException=t.MissingDataException=t.MessageHandler=t.InvalidPDFException=t.AbortException=t.CMapCompressionType=t.ImageKind=t.FontType=t.AnnotationType=t.AnnotationFlag=t.AnnotationFieldFlag=t.AnnotationBorderStyleType=t.UNSUPPORTED_FEATURES=t.VERBOSITY_LEVELS=t.OPS=t.IDENTITY_MATRIX=t.FONT_IDENTITY_MATRIX=void 0;var f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};r(64);var p=r(111),m={errors:0,warnings:1,infos:5},v=m.warnings,g=function(){function e(e,t){this.name="PasswordException",this.message=e,this.code=t}return e.prototype=new Error,e.constructor=e,e}(),b=function(){function e(e,t){this.name="UnknownErrorException",this.message=e,this.details=t}return e.prototype=new Error,e.constructor=e,e}(),_=function(){function e(e){this.name="InvalidPDFException",this.message=e}return e.prototype=new Error,e.constructor=e,e}(),y=function(){function e(e){this.name="MissingPDFException",this.message=e}return e.prototype=new Error,e.constructor=e,e}(),A=function(){function e(e,t){this.name="UnexpectedResponseException",this.message=e,this.status=t}return e.prototype=new Error,e.constructor=e,e}(),S=function(){function e(e){this.message=e}return e.prototype=new Error,e.prototype.name="NotImplementedException",e.constructor=e,e}(),w=function(){function e(e,t){this.begin=e,this.end=t,this.message="Missing data ["+e+", "+t+")"}return e.prototype=new Error,e.prototype.name="MissingDataException",e.constructor=e,e}(),P=function(){function e(e){this.message=e}return e.prototype=new Error,e.prototype.name="XRefParseException",e.constructor=e,e}(),C=function(){function e(e){this.message=e}return e.prototype=new Error,e.prototype.name="FormatError",e.constructor=e,e}(),R=function(){function e(e){this.name="AbortException",this.message=e}return e.prototype=new Error,e.constructor=e,e}(),k=/\x00/g,x=function(){function e(){}var t=["rgb(",0,",",0,",",0,")"];e.makeCssRgb=function(e,r,n){return t[1]=e,t[3]=r,t[5]=n,t.join("")},e.transform=function(e,t){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]},e.applyTransform=function(e,t){return[e[0]*t[0]+e[1]*t[2]+t[4],e[0]*t[1]+e[1]*t[3]+t[5]]},e.applyInverseTransform=function(e,t){var r=t[0]*t[3]-t[1]*t[2];return[(e[0]*t[3]-e[1]*t[2]+t[2]*t[5]-t[4]*t[3])/r,(-e[0]*t[1]+e[1]*t[0]+t[4]*t[1]-t[5]*t[0])/r]},e.getAxialAlignedBoundingBox=function(t,r){var n=e.applyTransform(t,r),i=e.applyTransform(t.slice(2,4),r),a=e.applyTransform([t[0],t[3]],r),s=e.applyTransform([t[2],t[1]],r);return[Math.min(n[0],i[0],a[0],s[0]),Math.min(n[1],i[1],a[1],s[1]),Math.max(n[0],i[0],a[0],s[0]),Math.max(n[1],i[1],a[1],s[1])]},e.inverseTransform=function(e){var t=e[0]*e[3]-e[1]*e[2];return[e[3]/t,-e[1]/t,-e[2]/t,e[0]/t,(e[2]*e[5]-e[4]*e[3])/t,(e[4]*e[1]-e[5]*e[0])/t]},e.apply3dTransform=function(e,t){return[e[0]*t[0]+e[1]*t[1]+e[2]*t[2],e[3]*t[0]+e[4]*t[1]+e[5]*t[2],e[6]*t[0]+e[7]*t[1]+e[8]*t[2]]},e.singularValueDecompose2dScale=function(e){var t=[e[0],e[2],e[1],e[3]],r=e[0]*t[0]+e[1]*t[2],n=e[0]*t[1]+e[1]*t[3],i=e[2]*t[0]+e[3]*t[2],a=e[2]*t[1]+e[3]*t[3],s=(r+a)/2,o=Math.sqrt((r+a)*(r+a)-4*(r*a-i*n))/2,l=s+o||1,u=s-o||1;return[Math.sqrt(l),Math.sqrt(u)]},e.normalizeRect=function(e){var t=e.slice(0);return e[0]>e[2]&&(t[0]=e[2],t[2]=e[0]),e[1]>e[3]&&(t[1]=e[3],t[3]=e[1]),t},e.intersect=function(t,r){function n(e,t){return e-t}var i=[t[0],t[2],r[0],r[2]].sort(n),a=[t[1],t[3],r[1],r[3]].sort(n),s=[];return t=e.normalizeRect(t),r=e.normalizeRect(r),(i[0]===t[0]&&i[1]===r[0]||i[0]===r[0]&&i[1]===t[0])&&(s[0]=i[1],s[2]=i[2],(a[0]===t[1]&&a[1]===r[1]||a[0]===r[1]&&a[1]===t[1])&&(s[1]=a[1],s[3]=a[2],s))};var r=["","C","CC","CCC","CD","D","DC","DCC","DCCC","CM","","X","XX","XXX","XL","L","LX","LXX","LXXX","XC","","I","II","III","IV","V","VI","VII","VIII","IX"];return e.toRoman=function(e,t){a(Number.isInteger(e)&&e>0,"The number should be a positive integer.");for(var n,i=[];e>=1e3;)e-=1e3,i.push("M");n=e/100|0,e%=100,i.push(r[n]),n=e/10|0,e%=10,i.push(r[10+n]),i.push(r[20+e]);var s=i.join("");return t?s.toLowerCase():s},e.appendToArray=function(e,t){Array.prototype.push.apply(e,t)},e.prependToArray=function(e,t){Array.prototype.unshift.apply(e,t)},e.extendObj=function(e,t){for(var r in t)e[r]=t[r]},e.getInheritableProperty=function(e,t,r){for(;e&&!e.has(t);)e=e.get("Parent");return e?r?e.getArray(t):e.get(t):null},e.inherit=function(e,t,r){e.prototype=Object.create(t.prototype),e.prototype.constructor=e;for(var n in r)e.prototype[n]=r[n]},e.loadScript=function(e,t){var r=document.createElement("script"),n=!1;r.setAttribute("src",e),t&&(r.onload=function(){n||t(),n=!0}),document.getElementsByTagName("head")[0].appendChild(r)},e}(),T=function(){function e(e,t,r,n,i,a){this.viewBox=e,this.scale=t,this.rotation=r,this.offsetX=n,this.offsetY=i;var s,o,l,u,c=(e[2]+e[0])/2,h=(e[3]+e[1])/2;switch(r%=360,r=r<0?r+360:r){case 180:s=-1,o=0,l=0,u=1;break;case 90:s=0,o=1,l=1,u=0;break;case 270:s=0,o=-1,l=-1,u=0;break;default:s=1,o=0,l=0,u=-1}a&&(l=-l,u=-u);var d,f,p,m;0===s?(d=Math.abs(h-e[1])*t+n,f=Math.abs(c-e[0])*t+i,p=Math.abs(e[3]-e[1])*t,m=Math.abs(e[2]-e[0])*t):(d=Math.abs(c-e[0])*t+n,f=Math.abs(h-e[1])*t+i,p=Math.abs(e[2]-e[0])*t,m=Math.abs(e[3]-e[1])*t),this.transform=[s*t,o*t,l*t,u*t,d-s*t*c-l*t*h,f-o*t*c-u*t*h],this.width=p,this.height=m,this.fontScale=t}return e.prototype={clone:function(t){var r="scale"in(t=t||{})?t.scale:this.scale,n="rotation"in t?t.rotation:this.rotation;return new e(this.viewBox.slice(),r,n,this.offsetX,this.offsetY,t.dontFlip)},convertToViewportPoint:function(e,t){return x.applyTransform([e,t],this.transform)},convertToViewportRectangle:function(e){var t=x.applyTransform([e[0],e[1]],this.transform),r=x.applyTransform([e[2],e[3]],this.transform);return[t[0],t[1],r[0],r[1]]},convertToPdfPoint:function(e,t){return x.applyInverseTransform([e,t],this.transform)}},e}(),E=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,728,711,710,729,733,731,730,732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8226,8224,8225,8230,8212,8211,402,8260,8249,8250,8722,8240,8222,8220,8221,8216,8217,8218,8482,64257,64258,321,338,352,376,381,305,322,339,353,382,0,8364],O=function(){function e(e,t,r){for(;e.lengtha&&(a=s.length)}for(t=0,r=n.length;t2&&void 0!==arguments[2]&&arguments[2])&&URL.createObjectURL){var n=L(t,r);return URL.createObjectURL(n)}for(var i="data:"+r+";base64,",a=0,s=t.length;a>2]+e[(3&o)<<4|l>>4]+e[a+1>6:64]+e[a+21&&void 0!==arguments[1]?arguments[1]:1,r=arguments[2];if(!this.isCancelled){var n=this.desiredSize;this.desiredSize-=t,n>0&&this.desiredSize<=0&&(this.sinkCapability=l(),this.ready=this.sinkCapability.promise),c({stream:"enqueue",chunk:e,transfers:r})}},close:function(){this.isCancelled||(this.isCancelled=!0,c({stream:"close"}),delete r.streamSinks[i])},error:function(e){this.isCancelled||(this.isCancelled=!0,c({stream:"error",reason:e}))},sinkCapability:l(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:a,ready:null};h.sinkCapability.resolve(),h.ready=h.sinkCapability.promise,this.streamSinks[i]=h,u(n[0],[e.data,h],n[1]).then(function(){c({stream:"start_complete",success:!0})},function(e){c({stream:"start_complete",success:!1,reason:e})})},_processStreamMessage:function(e){var t=this,r=this.sourceName,n=e.sourceName,i=e.streamId,s=function(e){var a=e.stream,s=e.success,o=e.reason;t.comObj.postMessage({sourceName:r,targetName:n,stream:a,success:s,streamId:i,reason:o})},o=function(){Promise.all([t.streamControllers[e.streamId].startCall,t.streamControllers[e.streamId].pullCall,t.streamControllers[e.streamId].cancelCall].map(function(e){return e&&function(e){return Promise.resolve(e).catch(function(){})}(e.promise)})).then(function(){delete t.streamControllers[e.streamId]})};switch(e.stream){case"start_complete":h(this.streamControllers[e.streamId].startCall,e.success,c(e.reason));break;case"pull_complete":h(this.streamControllers[e.streamId].pullCall,e.success,c(e.reason));break;case"pull":if(!this.streamSinks[e.streamId]){s({stream:"pull_complete",success:!0});break}this.streamSinks[e.streamId].desiredSize<=0&&e.desiredSize>0&&this.streamSinks[e.streamId].sinkCapability.resolve(),this.streamSinks[e.streamId].desiredSize=e.desiredSize,u(this.streamSinks[e.streamId].onPull).then(function(){s({stream:"pull_complete",success:!0})},function(e){s({stream:"pull_complete",success:!1,reason:e})});break;case"enqueue":a(this.streamControllers[e.streamId],"enqueue should have stream controller"),this.streamControllers[e.streamId].isClosed||this.streamControllers[e.streamId].controller.enqueue(e.chunk);break;case"close":if(a(this.streamControllers[e.streamId],"close should have stream controller"),this.streamControllers[e.streamId].isClosed)break;this.streamControllers[e.streamId].isClosed=!0,this.streamControllers[e.streamId].controller.close(),o();break;case"error":a(this.streamControllers[e.streamId],"error should have stream controller"),this.streamControllers[e.streamId].controller.error(c(e.reason)),o();break;case"cancel_complete":h(this.streamControllers[e.streamId].cancelCall,e.success,c(e.reason)),o();break;case"cancel":if(!this.streamSinks[e.streamId])break;u(this.streamSinks[e.streamId].onCancel,[c(e.reason)]).then(function(){s({stream:"cancel_complete",success:!0})},function(e){s({stream:"cancel_complete",success:!1,reason:e})}),this.streamSinks[e.streamId].sinkCapability.reject(c(e.reason)),this.streamSinks[e.streamId].isCancelled=!0,delete this.streamSinks[e.streamId];break;default:throw new Error("Unexpected stream case")}},postMessage:function(e,t){t&&this.postMessageTransfers?this.comObj.postMessage(e,t):this.comObj.postMessage(e)},destroy:function(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}},t.FONT_IDENTITY_MATRIX=[.001,0,0,.001,0,0],t.IDENTITY_MATRIX=[1,0,0,1,0,0],t.OPS={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotations:78,endAnnotations:79,beginAnnotation:80,endAnnotation:81,paintJpegXObject:82,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91},t.VERBOSITY_LEVELS=m,t.UNSUPPORTED_FEATURES={unknown:"unknown",forms:"forms",javaScript:"javaScript",smask:"smask",shadingPattern:"shadingPattern",font:"font"},t.AnnotationBorderStyleType={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},t.AnnotationFieldFlag={READONLY:1,REQUIRED:2,NOEXPORT:4,MULTILINE:4096,PASSWORD:8192,NOTOGGLETOOFF:16384,RADIO:32768,PUSHBUTTON:65536,COMBO:131072,EDIT:262144,SORT:524288,FILESELECT:1048576,MULTISELECT:2097152,DONOTSPELLCHECK:4194304,DONOTSCROLL:8388608,COMB:16777216,RICHTEXT:33554432,RADIOSINUNISON:33554432,COMMITONSELCHANGE:67108864},t.AnnotationFlag={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512},t.AnnotationType={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26},t.FontType={UNKNOWN:0,TYPE1:1,TYPE1C:2,CIDFONTTYPE0:3,CIDFONTTYPE0C:4,TRUETYPE:5,CIDFONTTYPE2:6,TYPE3:7,OPENTYPE:8,TYPE0:9,MMTYPE1:10},t.ImageKind={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},t.CMapCompressionType={NONE:0,BINARY:1,STREAM:2},t.AbortException=R,t.InvalidPDFException=_,t.MessageHandler=d,t.MissingDataException=w,t.MissingPDFException=y,t.NativeImageDecoding={NONE:"none",DECODE:"decode",DISPLAY:"display"},t.NotImplementedException=S,t.PageViewport=T,t.PasswordException=g,t.PasswordResponses={NEED_PASSWORD:1,INCORRECT_PASSWORD:2},t.StatTimer=O,t.StreamType={UNKNOWN:0,FLATE:1,LZW:2,DCT:3,JPX:4,JBIG:5,A85:6,AHX:7,CCF:8,RL:9},t.TextRenderingMode={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4},t.UnexpectedResponseException=A,t.UnknownErrorException=b,t.Util=x,t.XRefParseException=P,t.FormatError=C,t.arrayByteLength=o,t.arraysToBytes=function(e){if(1===e.length&&e[0]instanceof Uint8Array)return e[0];var t,r,n,i=0,a=e.length;for(t=0;t=m.infos&&console.log("Info: "+e)},t.isArrayBuffer=function(e){return"object"===(void 0===e?"undefined":f(e))&&null!==e&&void 0!==e.byteLength},t.isBool=function(e){return"boolean"==typeof e},t.isEmptyObj=function(e){for(var t in e)return!1;return!0},t.isNum=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isSpace=function(e){return 32===e||9===e||13===e||10===e},t.isNodeJS=function(){return"object"===("undefined"==typeof process?"undefined":f(process))&&process+""=="[object process]"},t.isSameOrigin=function(e,t){try{var r=new URL(e);if(!r.origin||"null"===r.origin)return!1}catch(e){return!1}var n=new URL(t,r);return r.origin===n.origin},t.createValidAbsoluteUrl=function(e,t){if(!e)return null;try{var r=t?new URL(e,t):new URL(e);if(function(e){if(!e)return!1;switch(e.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(r))return r}catch(e){}return null},t.isLittleEndian=function(){var e=new Uint8Array(4);return e[0]=1,1===new Uint32Array(e.buffer,0,1)[0]},t.isEvalSupported=function(){try{return new Function(""),!0}catch(e){return!1}},t.loadJpegStream=function(e,t,r){var i=new Image;i.onload=function(){r.resolve(e,i)},i.onerror=function(){r.resolve(e,null),n("Error during JPEG image loading")},i.src=t},t.log2=function(e){for(var t=1,r=0;e>t;)t<<=1,r++;return r},t.readInt8=function(e,t){return e[t]<<24>>24},t.readUint16=function(e,t){return e[t]<<8|e[t+1]},t.readUint32=function(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0},t.removeNullCharacters=function(e){return"string"!=typeof e?(n("The argument for removeNullCharacters must be a string."),e):e.replace(k,"")},t.ReadableStream=p.ReadableStream,t.setVerbosityLevel=function(e){v=e},t.shadow=function(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!1}),r},t.string32=function(e){return String.fromCharCode(e>>24&255,e>>16&255,e>>8&255,255&e)},t.stringToBytes=s,t.stringToPDFString=function(e){var t,r=e.length,n=[];if("þ"===e[0]&&"ÿ"===e[1])for(t=2;t0&&t>0,"Invalid SVG dimensions");var r=document.createElementNS(u,"svg:svg");return r.setAttribute("version","1.1"),r.setAttribute("width",e+"px"),r.setAttribute("height",t+"px"),r.setAttribute("preserveAspectRatio","none"),r.setAttribute("viewBox","0 0 "+e+" "+t),r}},{key:"createElement",value:function(e){return(0,s.assert)("string"==typeof e,"Invalid SVG element type"),document.createElementNS(u,e)}}]),e}(),f=function(){function e(t,r){n(this,e),this.nodeName=t,this.nodeValue=r,Object.defineProperty(this,"parentNode",{value:null,writable:!0})}return a(e,[{key:"hasChildNodes",value:function(){return this.childNodes&&this.childNodes.length>0}},{key:"firstChild",get:function(){return this.childNodes[0]}},{key:"nextSibling",get:function(){var e=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[e+1]}},{key:"textContent",get:function(){return this.childNodes?this.childNodes.map(function(e){return e.textContent}).join(""):this.nodeValue||""}}]),e}(),p=function(){function e(){n(this,e)}return a(e,[{key:"parseFromString",value:function(e){var t=this,r=[];e=(e=(e=(e=e.replace(/<\?[\s\S]*?\?>|/g,"").trim()).replace(/\[]+(\[[^\]]+)?[^>]+>/g,"").trim()).replace(/>([^<][\s\S]*?)<":">"+i+",<"})).replace(//g,function(e,t){var n=r.length,i=new f("#text",t);return r.push(i),n+","});var n=/<([\w\:]+)((?:[\s\w:=]|'[^']*'|"[^"]*")*)(?:\/>|>([\d,]*)<\/[^>]+>)/g,i=void 0;do{i=r.length,e=e.replace(n,function(e,t,n,i){var a=r.length,s=new f(t),o=[];return i&&((i=i.split(",")).pop(),i.forEach(function(e){var t=r[+e];t.parentNode=s,o.push(t)})),s.childNodes=o,r.push(s),a+","})}while(i";case"quot":return'"';case"apos":return"'"}return"&"+t+";"})}}]),e}(),m=function(){function e(){}var t=["ms","Moz","Webkit","O"],r=Object.create(null);return e.getProp=function(e,n){if(1===arguments.length&&"string"==typeof r[e])return r[e];var i,a,s=(n=n||document.documentElement).style;if("string"==typeof s[e])return r[e]=e;a=e.charAt(0).toUpperCase()+e.slice(1);for(var o=0,l=t.length;o0?t:e.length,r>0?r:e.length);return e.substring(e.lastIndexOf("/",n)+1,n)},t.LinkTarget=g,t.getDefaultSetting=i,t.DEFAULT_LINK_REL=l,t.DOMCanvasFactory=c,t.DOMCMapReaderFactory=h,t.DOMSVGFactory=d,t.SimpleXMLParser=p},function(e,t,r){"use strict";var n=r(3),i=r(11),a=r(7),s=r(20)("src"),o=Function.toString,l=(""+o).split("toString");r(5).inspectSource=function(e){return o.call(e)},(e.exports=function(e,t,r,o){var u="function"==typeof r;u&&(a(r,"name")||i(r,"name",t)),e[t]!==r&&(u&&(a(r,s)||i(r,s,e[t]?""+e[t]:l.join(String(t)))),e===n?e[t]=r:o?e[t]?e[t]=r:i(e,t,r):(delete e[t],i(e,t,r)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[s]||o.call(this)})},function(e,t,r){"use strict";var n=r(16);e.exports=function(e,t,r){if(n(e),void 0===t)return e;switch(r){case 1:return function(r){return e.call(t,r)};case 2:return function(r,n){return e.call(t,r,n)};case 3:return function(r,n,i){return e.call(t,r,n,i)}}return function(){return e.apply(t,arguments)}}},function(e,t,r){"use strict";var n=r(15),i=r(25);e.exports=r(12)?function(e,t,r){return n.f(e,t,i(1,r))}:function(e,t,r){return e[t]=r,e}},function(e,t,r){"use strict";e.exports=!r(13)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t,r){"use strict";e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,r){"use strict";e.exports="undefined"!=typeof window&&window.Math===Math?window:"undefined"!=typeof global&&global.Math===Math?global:"undefined"!=typeof self&&self.Math===Math?self:{}},function(e,t,r){"use strict";var n=r(6),i=r(39),a=r(40),s=Object.defineProperty;t.f=r(12)?Object.defineProperty:function(e,t,r){if(n(e),t=a(t,!0),n(r),i)try{return s(e,t,r)}catch(e){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(e[t]=r.value),e}},function(e,t,r){"use strict";e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,r){"use strict";var n=r(26),i=r(27);e.exports=function(e){return n(i(e))}},function(e,t,r){"use strict";var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,r){"use strict";e.exports={}},function(e,t,r){"use strict";var n=0,i=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+i).toString(36))}},function(e,t,r){"use strict";var n=r(68),i=r(43);e.exports=Object.keys||function(e){return n(e,i)}},function(e,t,r){"use strict";var n=r(15).f,i=r(7),a=r(2)("toStringTag");e.exports=function(e,t,r){e&&!i(e=r?e:e.prototype,a)&&n(e,a,{configurable:!0,value:t})}},function(e,t,r){"use strict";var n=r(10),i=r(87),a=r(88),s=r(6),o=r(28),l=r(89),u={},c={},h=e.exports=function(e,t,r,h,d){var f,p,m,v,g=d?function(){return e}:l(e),b=n(r,h,t?2:1),_=0;if("function"!=typeof g)throw TypeError(e+" is not iterable!");if(a(g)){for(f=o(e.length);f>_;_++)if((v=t?b(s(p=e[_])[0],p[1]):b(e[_]))===u||v===c)return v}else for(m=g.call(e);!(p=m.next()).done;)if((v=i(m,b,p.value,t))===u||v===c)return v};h.BREAK=u,h.RETURN=c},function(e,t,r){"use strict";var n=r(1),i=r(3).document,a=n(i)&&n(i.createElement);e.exports=function(e){return a?i.createElement(e):{}}},function(e,t,r){"use strict";e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,r){"use strict";var n=r(18);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==n(e)?e.split(""):Object(e)}},function(e,t,r){"use strict";e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,r){"use strict";var n=r(29),i=Math.min;e.exports=function(e){return e>0?i(n(e),9007199254740991):0}},function(e,t,r){"use strict";var n=Math.ceil,i=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?i:n)(e)}},function(e,t,r){"use strict";var n=r(42)("keys"),i=r(20);e.exports=function(e){return n[e]||(n[e]=i(e))}},function(e,t,r){"use strict";t.f={}.propertyIsEnumerable},function(e,t,r){"use strict";var n=r(18),i=r(2)("toStringTag"),a="Arguments"==n(function(){return arguments}());e.exports=function(e){var t,r,s;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),i))?r:a?n(t):"Object"==(s=n(t))&&"function"==typeof t.callee?"Arguments":s}},function(e,t,r){"use strict";var n=r(27);e.exports=function(e){return Object(n(e))}},function(e,t,r){"use strict";e.exports=function(e,t,r,n){if(!(e instanceof t)||void 0!==n&&n in e)throw TypeError(r+": incorrect invocation!");return e}},function(e,t,r){"use strict";var n=r(16);e.exports.f=function(e){return new function(e){var t,r;this.promise=new e(function(e,n){if(void 0!==t||void 0!==r)throw TypeError("Bad Promise constructor");t=e,r=n}),this.resolve=n(t),this.reject=n(r)}(e)}},function(e,t,r){"use strict";var n=r(9);e.exports=function(e,t,r){for(var i in t)n(e,i,t[i],r);return e}},function(e,t,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=r(20)("meta"),a=r(1),s=r(7),o=r(15).f,l=0,u=Object.isExtensible||function(){return!0},c=!r(13)(function(){return u(Object.preventExtensions({}))}),h=function(e){o(e,i,{value:{i:"O"+ ++l,w:{}}})},d=e.exports={KEY:i,NEED:!1,fastKey:function(e,t){if(!a(e))return"symbol"==(void 0===e?"undefined":n(e))?e:("string"==typeof e?"S":"P")+e;if(!s(e,i)){if(!u(e))return"F";if(!t)return"E";h(e)}return e[i].i},getWeak:function(e,t){if(!s(e,i)){if(!u(e))return!0;if(!t)return!1;h(e)}return e[i].w},onFreeze:function(e){return c&&d.NEED&&u(e)&&!s(e,i)&&h(e),e}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateResponseStatus=t.validateRangeRequestCapabilities=t.createResponseStatusError=void 0;var n=r(0);t.createResponseStatusError=function(e,t){return 404===e||0===e&&/^file:/.test(t)?new n.MissingPDFException('Missing PDF "'+t+'".'):new n.UnexpectedResponseException("Unexpected server response ("+e+') while retrieving PDF "'+t+'".',e)},t.validateRangeRequestCapabilities=function(e){var t=e.getResponseHeader,r=e.isHttp,i=e.rangeChunkSize,a=e.disableRange;(0,n.assert)(i>0);var s={allowRangeRequests:!1,suggestedLength:void 0};if(a||!r)return s;if("bytes"!==t("Accept-Ranges"))return s;if("identity"!==(t("Content-Encoding")||"identity"))return s;var o=parseInt(t("Content-Length"),10);return Number.isInteger(o)?(s.suggestedLength=o,o<=2*i?s:(s.allowRangeRequests=!0,s)):s},t.validateResponseStatus=function(e){return 200===e||206===e}},function(e,t,r){"use strict";e.exports=!r(12)&&!r(13)(function(){return 7!=Object.defineProperty(r(24)("div"),"a",{get:function(){return 7}}).a})},function(e,t,r){"use strict";var n=r(1);e.exports=function(e,t){if(!n(e))return e;var r,i;if(t&&"function"==typeof(r=e.toString)&&!n(i=r.call(e)))return i;if("function"==typeof(r=e.valueOf)&&!n(i=r.call(e)))return i;if(!t&&"function"==typeof(r=e.toString)&&!n(i=r.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},function(e,t,r){"use strict";var n=r(17),i=r(28),a=r(69);e.exports=function(e){return function(t,r,s){var o,l=n(t),u=i(l.length),c=a(s,u);if(e&&r!=r){for(;u>c;)if((o=l[c++])!=o)return!0}else for(;u>c;c++)if((e||c in l)&&l[c]===r)return e||c||0;return!e&&-1}}},function(e,t,r){"use strict";var n=r(3),i=n["__core-js_shared__"]||(n["__core-js_shared__"]={});e.exports=function(e){return i[e]||(i[e]={})}},function(e,t,r){"use strict";e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,r){"use strict";var n=r(2)("unscopables"),i=Array.prototype;void 0==i[n]&&r(11)(i,n,{}),e.exports=function(e){i[n][e]=!0}},function(e,t,r){"use strict";var n=r(32),i={};i[r(2)("toStringTag")]="z",i+""!="[object z]"&&r(9)(Object.prototype,"toString",function(){return"[object "+n(this)+"]"},!0)},function(e,t,r){"use strict";var n=r(47),i=r(4),a=r(9),s=r(11),o=r(7),l=r(19),u=r(80),c=r(22),h=r(83),d=r(2)("iterator"),f=!([].keys&&"next"in[].keys()),p=function(){return this};e.exports=function(e,t,r,m,v,g,b){u(r,t,m);var _,y,A,S=function(e){if(!f&&e in R)return R[e];switch(e){case"keys":case"values":return function(){return new r(this,e)}}return function(){return new r(this,e)}},w=t+" Iterator",P="values"==v,C=!1,R=e.prototype,k=R[d]||R["@@iterator"]||v&&R[v],x=k||S(v),T=v?P?S("entries"):x:void 0,E="Array"==t?R.entries||k:k;if(E&&(A=h(E.call(new e)))!==Object.prototype&&A.next&&(c(A,w,!0),n||o(A,d)||s(A,d,p)),P&&k&&"values"!==k.name&&(C=!0,x=function(){return k.call(this)}),n&&!b||!f&&!C&&R[d]||s(R,d,x),l[t]=x,l[w]=p,v)if(_={values:P?x:S("values"),keys:g?x:S("keys"),entries:T},b)for(y in _)y in R||a(R,y,_[y]);else i(i.P+i.F*(f||C),t,_);return _}},function(e,t,r){"use strict";e.exports=!1},function(e,t,r){"use strict";var n=r(3).document;e.exports=n&&n.documentElement},function(e,t,r){"use strict";for(var n=r(84),i=r(21),a=r(9),s=r(3),o=r(11),l=r(19),u=r(2),c=u("iterator"),h=u("toStringTag"),d=l.Array,f={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},p=i(f),m=0;mr;)t.push(arguments[r++]);return g[++v]=function(){o("function"==typeof e?e:Function(e),t)},n(v),v},f=function(e){delete g[e]},"process"==r(18)(h)?n=function(e){h.nextTick(s(b,e,1))}:m&&m.now?n=function(e){m.now(s(b,e,1))}:p?(a=(i=new p).port2,i.port1.onmessage=_,n=s(a.postMessage,a,1)):c.addEventListener&&"function"==typeof postMessage&&!c.importScripts?(n=function(e){c.postMessage(e+"","*")},c.addEventListener("message",_,!1)):n="onreadystatechange"in u("script")?function(e){l.appendChild(u("script")).onreadystatechange=function(){l.removeChild(this),b.call(e)}}:function(e){setTimeout(s(b,e,1),0)}),e.exports={set:d,clear:f}},function(e,t,r){"use strict";e.exports=function(e){try{return{e:!1,v:e()}}catch(e){return{e:!0,v:e}}}},function(e,t,r){"use strict";var n=r(6),i=r(1),a=r(35);e.exports=function(e,t){if(n(e),i(t)&&t.constructor===e)return t;var r=a.f(e);return(0,r.resolve)(t),r.promise}},function(e,t,r){"use strict";var n=r(2)("iterator"),i=!1;try{var a=[7][n]();a.return=function(){i=!0},Array.from(a,function(){throw 2})}catch(e){}e.exports=function(e,t){if(!t&&!i)return!1;var r=!1;try{var a=[7],s=a[n]();s.next=function(){return{done:r=!0}},a[n]=function(){return s},e(a)}catch(e){}return r}},function(e,t,r){"use strict";var n=r(10),i=r(26),a=r(33),s=r(28),o=r(97);e.exports=function(e,t){var r=1==e,l=2==e,u=3==e,c=4==e,h=6==e,d=5==e||h,f=t||o;return function(t,o,p){for(var m,v,g=a(t),b=i(g),_=n(o,p,3),y=s(b.length),A=0,S=r?f(t,y):l?f(t,0):void 0;y>A;A++)if((d||A in b)&&(m=b[A],v=_(m,A,g),e))if(r)S[A]=v;else if(v)switch(e){case 3:return!0;case 5:return m;case 6:return A;case 2:S.push(m)}else if(c)return!1;return h?-1:u||c?c:S}}},function(e,t,r){"use strict";var n=r(1);e.exports=function(e,t){if(!n(e)||e._t!==t)throw TypeError("Incompatible receiver, "+t+" required!");return e}},function(e,t,r){"use strict";function n(e){var t,r=new S;if("string"==typeof e)t={url:e};else if((0,o.isArrayBuffer)(e))t={data:e};else if(e instanceof w)t={range:e};else{if("object"!==(void 0===e?"undefined":s(e)))throw new Error("Invalid parameter in getDocument, need either Uint8Array, string or a parameter object");if(!e.url&&!e.data&&!e.range)throw new Error("Invalid parameter object: need either .data, .range or .url");t=e}var n={},i=null,a=null,u=l.DOMCMapReaderFactory;for(var c in t)if("url"!==c||"undefined"==typeof window)if("range"!==c)if("worker"!==c)if("data"!==c||t[c]instanceof Uint8Array)"CMapReaderFactory"!==c?n[c]=t[c]:u=t[c];else{var h=t[c];if("string"==typeof h)n[c]=(0,o.stringToBytes)(h);else if("object"!==(void 0===h?"undefined":s(h))||null===h||isNaN(h.length)){if(!(0,o.isArrayBuffer)(h))throw new Error("Invalid PDF binary data: either typed array, string or array-like object is expected in the data property.");n[c]=new Uint8Array(h)}else n[c]=new Uint8Array(h)}else a=t[c];else i=t[c];else n[c]=new URL(t[c],window.location).href;n.rangeChunkSize=n.rangeChunkSize||p,n.ignoreErrors=!0!==n.stopAtErrors;var d=Object.values(o.NativeImageDecoding);if(void 0!==n.nativeImageDecoderSupport&&d.includes(n.nativeImageDecoderSupport)||(n.nativeImageDecoderSupport=o.NativeImageDecoding.DECODE),!a){var m=(0,l.getDefaultSetting)("workerPort");a=m?k.fromPort(m):new k,r._worker=a}var g=r.docId;return a.promise.then(function(){if(r.destroyed)throw new Error("Loading aborted");return function(e,t,r,n){if(e.destroyed)return Promise.reject(new Error("Worker was destroyed"));t.disableAutoFetch=(0,l.getDefaultSetting)("disableAutoFetch"),t.disableStream=(0,l.getDefaultSetting)("disableStream"),t.chunkedViewerLoading=!!r,r&&(t.length=r.length,t.initialData=r.initialData);return e.messageHandler.sendWithPromise("GetDocRequest",{docId:n,apiVersion:"2.0.114",source:{data:t.data,url:t.url,password:t.password,disableAutoFetch:t.disableAutoFetch,rangeChunkSize:t.rangeChunkSize,length:t.length},maxImageSize:(0,l.getDefaultSetting)("maxImageSize"),disableFontFace:(0,l.getDefaultSetting)("disableFontFace"),disableCreateObjectURL:(0,l.getDefaultSetting)("disableCreateObjectURL"),postMessageTransfers:(0,l.getDefaultSetting)("postMessageTransfers")&&!v,docBaseUrl:t.docBaseUrl,nativeImageDecoderSupport:t.nativeImageDecoderSupport,ignoreErrors:t.ignoreErrors,isEvalSupported:(0,l.getDefaultSetting)("isEvalSupported")}).then(function(t){if(e.destroyed)throw new Error("Worker was destroyed");return t})}(a,n,i,g).then(function(e){if(r.destroyed)throw new Error("Loading aborted");var t=void 0;i?t=new f.PDFDataTransportStream(n,i):n.data||(t=new A({source:n,disableRange:(0,l.getDefaultSetting)("disableRange")}));var s=new o.MessageHandler(g,e,a.port);s.postMessageTransfers=a.postMessageTransfers;var c=new x(s,r,t,u);r._transport=c,s.send("Ready",null)})}).catch(r._capability.reject),r}Object.defineProperty(t,"__esModule",{value:!0}),t.build=t.version=t.setPDFNetworkStreamClass=t.PDFPageProxy=t.PDFDocumentProxy=t.PDFWorker=t.PDFDataRangeTransport=t.LoopbackPort=t.getDocument=void 0;var i,a=function(){function e(e,t){for(var r=0;r=0&&a.renderTasks.splice(n,1),t.cleanupAfterRender&&(t.pendingCleanup=!0),t._tryCleanup(),e?u.capability.reject(e):u.capability.resolve(),r.timeEnd("Rendering"),r.timeEnd("Overall")},u=new O(s,e,this.objs,this.commonObjs,a.operatorList,this.pageNumber,i);u.useRequestAnimationFrame="print"!==n,a.renderTasks||(a.renderTasks=[]),a.renderTasks.push(u);var c=u.task;return a.displayReadyCapability.promise.then(function(e){t.pendingCleanup?s():(r.time("Rendering"),u.initializeGraphics(e),u.operatorListChanged())}).catch(s),c},getOperatorList:function(){function e(){if(r.operatorList.lastChunk){r.opListReadCapability.resolve(r.operatorList);var e=r.renderTasks.indexOf(t);e>=0&&r.renderTasks.splice(e,1)}}this.intentStates.oplist||(this.intentStates.oplist=Object.create(null));var t,r=this.intentStates.oplist;return r.opListReadCapability||((t={}).operatorListChanged=e,r.receivingOperatorList=!0,r.opListReadCapability=(0,o.createPromiseCapability)(),r.renderTasks=[],r.renderTasks.push(t),r.operatorList={fnArray:[],argsArray:[],lastChunk:!1},this.transport.messageHandler.send("RenderPageRequest",{pageIndex:this.pageIndex,intent:"oplist"})),r.opListReadCapability.promise},streamTextContent:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this.pageNumber-1,normalizeWhitespace:!0===e.normalizeWhitespace,combineTextItems:!0!==e.disableCombineTextItems},{highWaterMark:100,size:function(e){return e.items.length}})},getTextContent:function(e){e=e||{};var t=this.streamTextContent(e);return new Promise(function(e,r){function n(){i.read().then(function(t){var r=t.value;t.done?e(a):(o.Util.extendObj(a.styles,r.styles),o.Util.appendToArray(a.items,r.items),n())},r)}var i=t.getReader(),a={items:[],styles:Object.create(null)};n()})},_destroy:function(){this.destroyed=!0,this.transport.pageCache[this.pageIndex]=null;var e=[];return Object.keys(this.intentStates).forEach(function(t){if("oplist"!==t){this.intentStates[t].renderTasks.forEach(function(t){var r=t.capability.promise.catch(function(){});e.push(r),t.cancel()})}},this),this.objs.clear(),this.annotationsPromise=null,this.pendingCleanup=!1,Promise.all(e)},cleanup:function(){this.pendingCleanup=!0,this._tryCleanup()},_tryCleanup:function(){this.pendingCleanup&&!Object.keys(this.intentStates).some(function(e){var t=this.intentStates[e];return 0!==t.renderTasks.length||t.receivingOperatorList},this)&&(Object.keys(this.intentStates).forEach(function(e){delete this.intentStates[e]},this),this.objs.clear(),this.annotationsPromise=null,this.pendingCleanup=!1)},_startRenderPage:function(e,t){var r=this.intentStates[t];r.displayReadyCapability&&r.displayReadyCapability.resolve(e)},_renderPageChunk:function(e,t){var r,n,i=this.intentStates[t];for(r=0,n=e.length;r=0;return n=e===a?e:l?new e.constructor(a,e.byteOffset,e.byteLength):new e.constructor(e),i.set(e,n),n}n=Array.isArray(e)?[]:{},i.set(e,n);for(var u in e){for(var c,h=e;!(c=Object.getOwnPropertyDescriptor(h,u));)h=Object.getPrototypeOf(h);void 0!==c.value&&"function"!=typeof c.value&&(n[u]=r(c.value))}return n}var n=this;if(this._defer){var i=new WeakMap,a={data:r(e)};this._deferred.then(function(){n._listeners.forEach(function(e){e.call(this,a)},n)})}else this._listeners.forEach(function(t){t.call(this,{data:e})},this)}},{key:"addEventListener",value:function(e,t){this._listeners.push(t)}},{key:"removeEventListener",value:function(e,t){var r=this._listeners.indexOf(t);this._listeners.splice(r,1)}},{key:"terminate",value:function(){this._listeners=[]}}]),e}(),k=function(){function e(){if(void 0!==i)return i;if((0,l.getDefaultSetting)("workerSrc"))return(0,l.getDefaultSetting)("workerSrc");if(g)return g.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2");throw new Error("No PDFJS.workerSrc specified")}function t(e,t){if(t&&a.has(t))throw new Error("Cannot use more than one PDFWorker per port");if(this.name=e,this.destroyed=!1,this.postMessageTransfers=!0,this._readyCapability=(0,o.createPromiseCapability)(),this._port=null,this._webWorker=null,this._messageHandler=null,t)return a.set(t,this),void this._initializeFromPort(t);this._initialize()}var r=0,n=void 0,a=new WeakMap;return t.prototype={get promise(){return this._readyCapability.promise},get port(){return this._port},get messageHandler(){return this._messageHandler},_initializeFromPort:function(e){this._port=e,this._messageHandler=new o.MessageHandler("main","worker",e),this._messageHandler.on("ready",function(){}),this._readyCapability.resolve()},_initialize:function(){var t=this;if(!m&&!(0,l.getDefaultSetting)("disableWorker")&&"undefined"!=typeof Worker){var r=e();try{(0,o.isSameOrigin)(window.location.href,r)||(r=function(e){var t="importScripts('"+e+"');";return URL.createObjectURL(new Blob([t]))}(new URL(r,window.location).href));var n=new Worker(r),i=new o.MessageHandler("main","worker",n),a=function(){n.removeEventListener("error",s),i.destroy(),n.terminate(),t.destroyed?t._readyCapability.reject(new Error("Worker was destroyed")):t._setupFakeWorker()},s=function(){t._webWorker||a()};n.addEventListener("error",s),i.on("test",function(e){if(n.removeEventListener("error",s),t.destroyed)a();else{e&&e.supportTypedArray?(t._messageHandler=i,t._port=n,t._webWorker=n,e.supportTransfers||(t.postMessageTransfers=!1,v=!0),t._readyCapability.resolve(),i.send("configure",{verbosity:(0,o.getVerbosityLevel)()})):(t._setupFakeWorker(),i.destroy(),n.terminate())}}),i.on("console_log",function(e){console.log.apply(console,e)}),i.on("console_error",function(e){console.error.apply(console,e)}),i.on("ready",function(e){if(n.removeEventListener("error",s),t.destroyed)a();else try{u()}catch(e){t._setupFakeWorker()}});var u=function(){var e=(0,l.getDefaultSetting)("postMessageTransfers")&&!v,t=new Uint8Array([e?255:0]);try{i.send("test",t,[t.buffer])}catch(e){(0,o.info)("Cannot use postMessage transfers"),t[0]=0,i.send("test",t)}};return void u()}catch(e){(0,o.info)("The worker has been disabled.")}}this._setupFakeWorker()},_setupFakeWorker:function(){var t=this;m||(0,l.getDefaultSetting)("disableWorker")||((0,o.warn)("Setting up fake worker."),m=!0),(n?n.promise:(n=(0,o.createPromiseCapability)(),(b||function(t){o.Util.loadScript(e(),function(){t(window.pdfjsDistBuildPdfWorker.WorkerMessageHandler)})})(n.resolve),n.promise)).then(function(e){if(t.destroyed)t._readyCapability.reject(new Error("Worker was destroyed"));else{var n=Uint8Array!==Float32Array,i=new R(n);t._port=i;var a="fake"+r++,s=new o.MessageHandler(a+"_worker",a,i);e.setup(s,i);var l=new o.MessageHandler(a,a+"_worker",i);t._messageHandler=l,t._readyCapability.resolve()}})},destroy:function(){this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),a.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}},t.fromPort=function(e){return a.has(e)?a.get(e):new t(null,e)},t}(),x=function(){function e(e,t,r,n){this.messageHandler=e,this.loadingTask=t,this.commonObjs=new T,this.fontLoader=new u.FontLoader(t.docId),this.CMapReaderFactory=new n({baseUrl:(0,l.getDefaultSetting)("cMapUrl"),isCompressed:(0,l.getDefaultSetting)("cMapPacked")}),this.destroyed=!1,this.destroyCapability=null,this._passwordCapability=null,this._networkStream=r,this._fullReader=null,this._lastProgress=null,this.pageCache=[],this.pagePromises=[],this.downloadInfoCapability=(0,o.createPromiseCapability)(),this.setupMessageHandler()}return e.prototype={destroy:function(){var e=this;if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=(0,o.createPromiseCapability)(),this._passwordCapability&&this._passwordCapability.reject(new Error("Worker was destroyed during onPassword callback"));var t=[];this.pageCache.forEach(function(e){e&&t.push(e._destroy())}),this.pageCache=[],this.pagePromises=[];var r=this.messageHandler.sendWithPromise("Terminate",null);return t.push(r),Promise.all(t).then(function(){e.fontLoader.clear(),e._networkStream&&e._networkStream.cancelAllRequests(),e.messageHandler&&(e.messageHandler.destroy(),e.messageHandler=null),e.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise},setupMessageHandler:function(){var e=this.messageHandler,t=this.loadingTask;e.on("GetReader",function(e,t){var r=this;(0,o.assert)(this._networkStream),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=function(e){r._lastProgress={loaded:e.loaded,total:e.total}},t.onPull=function(){r._fullReader.read().then(function(e){var r=e.value;e.done?t.close():((0,o.assert)((0,o.isArrayBuffer)(r)),t.enqueue(new Uint8Array(r),1,[r]))}).catch(function(e){t.error(e)})},t.onCancel=function(e){r._fullReader.cancel(e)}},this),e.on("ReaderHeadersReady",function(e){var t=this,r=(0,o.createPromiseCapability)(),n=this._fullReader;return n.headersReady.then(function(){if(!n.isStreamingSupported||!n.isRangeSupported){if(t._lastProgress){var e=t.loadingTask;e.onProgress&&e.onProgress(t._lastProgress)}n.onProgress=function(e){var r=t.loadingTask;r.onProgress&&r.onProgress({loaded:e.loaded,total:e.total})}}r.resolve({isStreamingSupported:n.isStreamingSupported,isRangeSupported:n.isRangeSupported,contentLength:n.contentLength})},r.reject),r.promise},this),e.on("GetRangeReader",function(e,t){(0,o.assert)(this._networkStream);var r=this._networkStream.getRangeReader(e.begin,e.end);t.onPull=function(){r.read().then(function(e){var r=e.value;e.done?t.close():((0,o.assert)((0,o.isArrayBuffer)(r)),t.enqueue(new Uint8Array(r),1,[r]))}).catch(function(e){t.error(e)})},t.onCancel=function(e){r.cancel(e)}},this),e.on("GetDoc",function(e){var t=e.pdfInfo;this.numPages=e.pdfInfo.numPages;var r=this.loadingTask,n=new P(t,this,r);this.pdfDocument=n,r._capability.resolve(n)},this),e.on("PasswordRequest",function(e){var r=this;if(this._passwordCapability=(0,o.createPromiseCapability)(),t.onPassword){var n=function(e){r._passwordCapability.resolve({password:e})};t.onPassword(n,e.code)}else this._passwordCapability.reject(new o.PasswordException(e.message,e.code));return this._passwordCapability.promise},this),e.on("PasswordException",function(e){t._capability.reject(new o.PasswordException(e.message,e.code))},this),e.on("InvalidPDF",function(e){this.loadingTask._capability.reject(new o.InvalidPDFException(e.message))},this),e.on("MissingPDF",function(e){this.loadingTask._capability.reject(new o.MissingPDFException(e.message))},this),e.on("UnexpectedResponse",function(e){this.loadingTask._capability.reject(new o.UnexpectedResponseException(e.message,e.status))},this),e.on("UnknownError",function(e){this.loadingTask._capability.reject(new o.UnknownErrorException(e.message,e.details))},this),e.on("DataLoaded",function(e){this.downloadInfoCapability.resolve(e)},this),e.on("PDFManagerReady",function(e){},this),e.on("StartRenderPage",function(e){if(!this.destroyed){var t=this.pageCache[e.pageIndex];t.stats.timeEnd("Page Request"),t._startRenderPage(e.transparency,e.intent)}},this),e.on("RenderPageChunk",function(e){if(!this.destroyed){this.pageCache[e.pageIndex]._renderPageChunk(e.operatorList,e.intent)}},this),e.on("commonobj",function(e){var t=this;if(!this.destroyed){var r=e[0],n=e[1];if(!this.commonObjs.hasData(r))switch(n){case"Font":var i=e[2];if("error"in i){var a=i.error;(0,o.warn)("Error during font loading: "+a),this.commonObjs.resolve(r,a);break}var s=null;(0,l.getDefaultSetting)("pdfBug")&&h.default.FontInspector&&h.default.FontInspector.enabled&&(s={registerFont:function(e,t){h.default.FontInspector.fontAdded(e,t)}});var c=new u.FontFaceObject(i,{isEvalSupported:(0,l.getDefaultSetting)("isEvalSupported"),disableFontFace:(0,l.getDefaultSetting)("disableFontFace"),fontRegistry:s}),d=function(e){t.commonObjs.resolve(r,c)};this.fontLoader.bind([c],d);break;case"FontPath":this.commonObjs.resolve(r,e[2]);break;default:throw new Error("Got unknown common object type "+n)}}},this),e.on("obj",function(e){if(!this.destroyed){var t,r=e[0],n=e[1],i=e[2],a=this.pageCache[n];if(!a.objs.hasData(r))switch(i){case"JpegStream":t=e[3],(0,o.loadJpegStream)(r,t,a.objs);break;case"Image":t=e[3],a.objs.resolve(r,t);t&&"data"in t&&t.data.length>8e6&&(a.cleanupAfterRender=!0);break;default:throw new Error("Got unknown object type "+i)}}},this),e.on("DocProgress",function(e){if(!this.destroyed){var t=this.loadingTask;t.onProgress&&t.onProgress({loaded:e.loaded,total:e.total})}},this),e.on("PageError",function(e){if(!this.destroyed){var t=this.pageCache[e.pageNum-1].intentStates[e.intent];if(!t.displayReadyCapability)throw new Error(e.error);if(t.displayReadyCapability.reject(e.error),t.operatorList){t.operatorList.lastChunk=!0;for(var r=0;rthis.numPages)return Promise.reject(new Error("Invalid page request"));var n=e-1;if(n in this.pagePromises)return this.pagePromises[n];var i=this.messageHandler.sendWithPromise("GetPage",{pageIndex:n}).then(function(e){if(r.destroyed)throw new Error("Transport destroyed");var t=new C(n,e,r);return r.pageCache[n]=t,t});return this.pagePromises[n]=i,i},getPageIndex:function(e){return this.messageHandler.sendWithPromise("GetPageIndex",{ref:e}).catch(function(e){return Promise.reject(new Error(e))})},getAnnotations:function(e,t){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:e,intent:t})},getDestinations:function(){return this.messageHandler.sendWithPromise("GetDestinations",null)},getDestination:function(e){return this.messageHandler.sendWithPromise("GetDestination",{id:e})},getPageLabels:function(){return this.messageHandler.sendWithPromise("GetPageLabels",null)},getPageMode:function(){return this.messageHandler.sendWithPromise("GetPageMode",null)},getAttachments:function(){return this.messageHandler.sendWithPromise("GetAttachments",null)},getJavaScript:function(){return this.messageHandler.sendWithPromise("GetJavaScript",null)},getOutline:function(){return this.messageHandler.sendWithPromise("GetOutline",null)},getMetadata:function(){return this.messageHandler.sendWithPromise("GetMetadata",null).then(function(e){return{info:e[0],metadata:e[1]?new d.Metadata(e[1]):null}})},getStats:function(){return this.messageHandler.sendWithPromise("GetStats",null)},startCleanup:function(){var e=this;this.messageHandler.sendWithPromise("Cleanup",null).then(function(){for(var t=0,r=e.pageCache.length;t\\376\\377([^<]+)/g,function(e,t){for(var r=t.replace(/\\([0-3])([0-7])([0-7])/g,function(e,t,r,n){return String.fromCharCode(64*t+8*r+1*n)}),n="",i=0,a=r.length;i=32&&s<127&&60!==s&&62!==s&&38!==s?String.fromCharCode(s):"&#x"+(65536+s).toString(16).substring(1)+";"}return">"+n})}},{key:"_parse",value:function(e){var t=e.documentElement;if("rdf:rdf"!==t.nodeName.toLowerCase())for(t=t.firstChild;t&&"rdf:rdf"!==t.nodeName.toLowerCase();)t=t.nextSibling;var r=t?t.nodeName.toLowerCase():null;if(t&&"rdf:rdf"===r&&t.hasChildNodes())for(var n=t.childNodes,i=0,a=n.length;i1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];a(this,e),this.isRenderable=r,this.data=t.data,this.layer=t.layer,this.page=t.page,this.viewport=t.viewport,this.linkService=t.linkService,this.downloadManager=t.downloadManager,this.imageResourcesPath=t.imageResourcesPath,this.renderInteractiveForms=t.renderInteractiveForms,this.svgFactory=t.svgFactory,r&&(this.container=this._createContainer(n))}return s(e,[{key:"_createContainer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.data,r=this.page,n=this.viewport,i=document.createElement("section"),a=t.rect[2]-t.rect[0],s=t.rect[3]-t.rect[1];i.setAttribute("data-annotation-id",t.id);var u=l.Util.normalizeRect([t.rect[0],r.view[3]-t.rect[1]+r.view[1],t.rect[2],r.view[3]-t.rect[3]+r.view[1]]);if(o.CustomStyle.setProp("transform",i,"matrix("+n.transform.join(",")+")"),o.CustomStyle.setProp("transformOrigin",i,-u[0]+"px "+-u[1]+"px"),!e&&t.borderStyle.width>0){i.style.borderWidth=t.borderStyle.width+"px",t.borderStyle.style!==l.AnnotationBorderStyleType.UNDERLINE&&(a-=2*t.borderStyle.width,s-=2*t.borderStyle.width);var c=t.borderStyle.horizontalCornerRadius,h=t.borderStyle.verticalCornerRadius;if(c>0||h>0){var d=c+"px / "+h+"px";o.CustomStyle.setProp("borderRadius",i,d)}switch(t.borderStyle.style){case l.AnnotationBorderStyleType.SOLID:i.style.borderStyle="solid";break;case l.AnnotationBorderStyleType.DASHED:i.style.borderStyle="dashed";break;case l.AnnotationBorderStyleType.BEVELED:(0,l.warn)("Unimplemented border style: beveled");break;case l.AnnotationBorderStyleType.INSET:(0,l.warn)("Unimplemented border style: inset");break;case l.AnnotationBorderStyleType.UNDERLINE:i.style.borderBottomStyle="solid"}t.color?i.style.borderColor=l.Util.makeCssRgb(0|t.color[0],0|t.color[1],0|t.color[2]):i.style.borderWidth=0}return i.style.left=u[0]+"px",i.style.top=u[1]+"px",i.style.width=a+"px",i.style.height=s+"px",i}},{key:"_createPopup",value:function(e,t,r){t||((t=document.createElement("div")).style.height=e.style.height,t.style.width=e.style.width,e.appendChild(t));var n=new _({container:e,trigger:t,color:r.color,title:r.title,contents:r.contents,hideWrapper:!0}).render();n.style.left=e.style.width,e.appendChild(n)}},{key:"render",value:function(){throw new Error("Abstract method `AnnotationElement.render` called")}}]),e}(),h=function(e){function t(e){a(this,t);var r=!!(e.data.url||e.data.dest||e.data.action);return n(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r))}return i(t,c),s(t,[{key:"render",value:function(){this.container.className="linkAnnotation";var e=document.createElement("a");return(0,o.addLinkAttributes)(e,{url:this.data.url,target:this.data.newWindow?o.LinkTarget.BLANK:void 0}),this.data.url||(this.data.action?this._bindNamedAction(e,this.data.action):this._bindLink(e,this.data.dest)),this.container.appendChild(e),this.container}},{key:"_bindLink",value:function(e,t){var r=this;e.href=this.linkService.getDestinationHash(t),e.onclick=function(){return t&&r.linkService.navigateTo(t),!1},t&&(e.className="internalLink")}},{key:"_bindNamedAction",value:function(e,t){var r=this;e.href=this.linkService.getAnchorUrl(""),e.onclick=function(){return r.linkService.executeNamedAction(t),!1},e.className="internalLink"}}]),t}(),d=function(e){function t(e){a(this,t);var r=!!(e.data.hasPopup||e.data.title||e.data.contents);return n(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r))}return i(t,c),s(t,[{key:"render",value:function(){this.container.className="textAnnotation";var e=document.createElement("img");return e.style.height=this.container.style.height,e.style.width=this.container.style.width,e.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",e.alt="[{{type}} Annotation]",e.dataset.l10nId="text_annotation_type",e.dataset.l10nArgs=JSON.stringify({type:this.data.name}),this.data.hasPopup||this._createPopup(this.container,e,this.data),this.container.appendChild(e),this.container}}]),t}(),f=function(e){function t(){return a(this,t),n(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i(t,c),s(t,[{key:"render",value:function(){return this.container}}]),t}(),p=function(e){function t(e){a(this,t);var r=e.renderInteractiveForms||!e.data.hasAppearance&&!!e.data.fieldValue;return n(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r))}return i(t,f),s(t,[{key:"render",value:function(){var e=["left","center","right"];this.container.className="textWidgetAnnotation";var t=null;if(this.renderInteractiveForms){if(this.data.multiLine?(t=document.createElement("textarea")).textContent=this.data.fieldValue:((t=document.createElement("input")).type="text",t.setAttribute("value",this.data.fieldValue)),t.disabled=this.data.readOnly,null!==this.data.maxLen&&(t.maxLength=this.data.maxLen),this.data.comb){var r=(this.data.rect[2]-this.data.rect[0])/this.data.maxLen;t.classList.add("comb"),t.style.letterSpacing="calc("+r+"px - 1ch)"}}else{(t=document.createElement("div")).textContent=this.data.fieldValue,t.style.verticalAlign="middle",t.style.display="table-cell";var n=null;this.data.fontRefName&&(n=this.page.commonObjs.getData(this.data.fontRefName)),this._setTextStyle(t,n)}return null!==this.data.textAlignment&&(t.style.textAlign=e[this.data.textAlignment]),this.container.appendChild(t),this.container}},{key:"_setTextStyle",value:function(e,t){var r=e.style;if(r.fontSize=this.data.fontSize+"px",r.direction=this.data.fontDirection<0?"rtl":"ltr",t){r.fontWeight=t.black?t.bold?"900":"bold":t.bold?"bold":"normal",r.fontStyle=t.italic?"italic":"normal";var n=t.loadedName?'"'+t.loadedName+'", ':"",i=t.fallbackName||"Helvetica, sans-serif";r.fontFamily=n+i}}}]),t}(),m=function(e){function t(e){return a(this,t),n(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,e.renderInteractiveForms))}return i(t,f),s(t,[{key:"render",value:function(){this.container.className="buttonWidgetAnnotation checkBox";var e=document.createElement("input");return e.disabled=this.data.readOnly,e.type="checkbox",this.data.fieldValue&&"Off"!==this.data.fieldValue&&e.setAttribute("checked",!0),this.container.appendChild(e),this.container}}]),t}(),v=function(e){function t(e){return a(this,t),n(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,e.renderInteractiveForms))}return i(t,f),s(t,[{key:"render",value:function(){this.container.className="buttonWidgetAnnotation radioButton";var e=document.createElement("input");return e.disabled=this.data.readOnly,e.type="radio",e.name=this.data.fieldName,this.data.fieldValue===this.data.buttonValue&&e.setAttribute("checked",!0),this.container.appendChild(e),this.container}}]),t}(),g=function(e){function t(e){return a(this,t),n(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,e.renderInteractiveForms))}return i(t,f),s(t,[{key:"render",value:function(){this.container.className="choiceWidgetAnnotation";var e=document.createElement("select");e.disabled=this.data.readOnly,this.data.combo||(e.size=this.data.options.length,this.data.multiSelect&&(e.multiple=!0));for(var t=0,r=this.data.options.length;t=0&&i.setAttribute("selected",!0),e.appendChild(i)}return this.container.appendChild(e),this.container}}]),t}(),b=function(e){function t(e){a(this,t);var r=!(!e.data.title&&!e.data.contents);return n(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r))}return i(t,c),s(t,[{key:"render",value:function(){if(this.container.className="popupAnnotation",["Line","Square","Circle","PolyLine","Polygon"].indexOf(this.data.parentType)>=0)return this.container;var e='[data-annotation-id="'+this.data.parentId+'"]',t=this.layer.querySelector(e);if(!t)return this.container;var r=new _({container:this.container,trigger:t,color:this.data.color,title:this.data.title,contents:this.data.contents}),n=parseFloat(t.style.left),i=parseFloat(t.style.width);return o.CustomStyle.setProp("transformOrigin",this.container,-(n+i)+"px -"+t.style.top),this.container.style.left=n+i+"px",this.container.appendChild(r.render()),this.container}}]),t}(),_=function(){function e(t){a(this,e),this.container=t.container,this.trigger=t.trigger,this.color=t.color,this.title=t.title,this.contents=t.contents,this.hideWrapper=t.hideWrapper||!1,this.pinned=!1}return s(e,[{key:"render",value:function(){var e=document.createElement("div");e.className="popupWrapper",this.hideElement=this.hideWrapper?e:this.container,this.hideElement.setAttribute("hidden",!0);var t=document.createElement("div");t.className="popup";var r=this.color;if(r){var n=.7*(255-r[0])+r[0],i=.7*(255-r[1])+r[1],a=.7*(255-r[2])+r[2];t.style.backgroundColor=l.Util.makeCssRgb(0|n,0|i,0|a)}var s=this._formatContents(this.contents),o=document.createElement("h1");return o.textContent=this.title,this.trigger.addEventListener("click",this._toggle.bind(this)),this.trigger.addEventListener("mouseover",this._show.bind(this,!1)),this.trigger.addEventListener("mouseout",this._hide.bind(this,!1)),t.addEventListener("click",this._hide.bind(this,!0)),t.appendChild(o),t.appendChild(s),e.appendChild(t),e}},{key:"_formatContents",value:function(e){for(var t=document.createElement("p"),r=e.split(/(?:\r\n?|\n)/),n=0,i=r.length;n0&&void 0!==arguments[0]&&arguments[0]&&(this.pinned=!0),this.hideElement.hasAttribute("hidden")&&(this.hideElement.removeAttribute("hidden"),this.container.style.zIndex+=1)}},{key:"_hide",value:function(){(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&(this.pinned=!1),this.hideElement.hasAttribute("hidden")||this.pinned||(this.hideElement.setAttribute("hidden",!0),this.container.style.zIndex-=1)}}]),e}(),y=function(e){function t(e){a(this,t);var r=!!(e.data.hasPopup||e.data.title||e.data.contents);return n(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r,!0))}return i(t,c),s(t,[{key:"render",value:function(){this.container.className="lineAnnotation";var e=this.data,t=e.rect[2]-e.rect[0],r=e.rect[3]-e.rect[1],n=this.svgFactory.create(t,r),i=this.svgFactory.createElement("svg:line");return i.setAttribute("x1",e.rect[2]-e.lineCoordinates[0]),i.setAttribute("y1",e.rect[3]-e.lineCoordinates[1]),i.setAttribute("x2",e.rect[2]-e.lineCoordinates[2]),i.setAttribute("y2",e.rect[3]-e.lineCoordinates[3]),i.setAttribute("stroke-width",e.borderStyle.width),i.setAttribute("stroke","transparent"),n.appendChild(i),this.container.append(n),this._createPopup(this.container,i,e),this.container}}]),t}(),A=function(e){function t(e){a(this,t);var r=!!(e.data.hasPopup||e.data.title||e.data.contents);return n(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r,!0))}return i(t,c),s(t,[{key:"render",value:function(){this.container.className="squareAnnotation";var e=this.data,t=e.rect[2]-e.rect[0],r=e.rect[3]-e.rect[1],n=this.svgFactory.create(t,r),i=e.borderStyle.width,a=this.svgFactory.createElement("svg:rect");return a.setAttribute("x",i/2),a.setAttribute("y",i/2),a.setAttribute("width",t-i),a.setAttribute("height",r-i),a.setAttribute("stroke-width",i),a.setAttribute("stroke","transparent"),a.setAttribute("fill","none"),n.appendChild(a),this.container.append(n),this._createPopup(this.container,a,e),this.container}}]),t}(),S=function(e){function t(e){a(this,t);var r=!!(e.data.hasPopup||e.data.title||e.data.contents);return n(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r,!0))}return i(t,c),s(t,[{key:"render",value:function(){this.container.className="circleAnnotation";var e=this.data,t=e.rect[2]-e.rect[0],r=e.rect[3]-e.rect[1],n=this.svgFactory.create(t,r),i=e.borderStyle.width,a=this.svgFactory.createElement("svg:ellipse");return a.setAttribute("cx",t/2),a.setAttribute("cy",r/2),a.setAttribute("rx",t/2-i/2),a.setAttribute("ry",r/2-i/2),a.setAttribute("stroke-width",i),a.setAttribute("stroke","transparent"),a.setAttribute("fill","none"),n.appendChild(a),this.container.append(n),this._createPopup(this.container,a,e),this.container}}]),t}(),w=function(e){function t(e){a(this,t);var r=!!(e.data.hasPopup||e.data.title||e.data.contents),i=n(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r,!0));return i.containerClassName="polylineAnnotation",i.svgElementName="svg:polyline",i}return i(t,c),s(t,[{key:"render",value:function(){this.container.className=this.containerClassName;for(var e=this.data,t=e.rect[2]-e.rect[0],r=e.rect[3]-e.rect[1],n=this.svgFactory.create(t,r),i=e.vertices,a=[],s=0,o=i.length;s1&&(h.vertical?s.canvasWidth=t.height*e._viewport.scale:s.canvasWidth=t.width*e._viewport.scale),e._textDivProperties.set(a,s),e._textContentStream&&e._layoutText(a),e._enhanceTextSelection){var v=1,g=0;0!==c&&(v=Math.cos(c),g=Math.sin(c));var b,_,y=(h.vertical?t.height:t.width)*e._viewport.scale,A=d;0!==c?(b=[v,g,-g,v,p,m],_=n.Util.getAxialAlignedBoundingBox([0,0,y,A],b)):_=[p,m,p+y,m+A],e._bounds.push({left:_[0],top:_[1],right:_[2],bottom:_[3],div:a,size:[y,A],m:b})}}function t(e){if(!e._canceled){var t=e._textDivs,r=e._capability,n=t.length;if(n>o)return e._renderingDone=!0,void r.resolve();if(!e._textContentStream)for(var i=0;i0&&(n=n?Math.min(a,n):a)}return n},g=1+Math.min(Math.abs(d),Math.abs(f));l.paddingLeft=v(m,32,16)/g,l.paddingTop=v(m,48,16)/g,l.paddingRight=v(m,0,16)/g,l.paddingBottom=v(m,16,16)/g,e._textDivProperties.set(o,l)}else l.paddingLeft=t[s].left-i[s].left,l.paddingTop=t[s].top-i[s].top,l.paddingRight=i[s].right-t[s].right,l.paddingBottom=i[s].bottom-t[s].bottom,e._textDivProperties.set(o,l)}}function a(e,t){t.sort(function(e,t){return e.x1-t.x1||e.index-t.index});var r=[{start:-1/0,end:1/0,boundary:{x1:-1/0,y1:-1/0,x2:0,y2:1/0,index:-1,x1New:0,x2New:0}}];t.forEach(function(e){for(var t=0;t=0&&r[n].start>=e.y2;)n--;var i,a,s,o,l=-1/0;for(s=t;s<=n;s++){var u;(u=(a=(i=r[s]).boundary).x2>e.x1?a.index>e.index?a.x1New:e.x1:void 0===a.x2New?(a.x2+e.x1)/2:a.x2New)>l&&(l=u)}for(e.x1New=l,s=t;s<=n;s++)void 0===(a=(i=r[s]).boundary).x2New?a.x2>e.x1?a.index>e.index&&(a.x2New=a.x2):a.x2New=l:a.x2New>l&&(a.x2New=Math.max(l,a.x2));var c=[],h=null;for(s=t;s<=n;s++){var d=(a=(i=r[s]).boundary).x2>e.x2?a:e;h===d?c[c.length-1].end=i.end:(c.push({start:i.start,end:i.end,boundary:d}),h=d)}for(r[t].start=0&&r[o].start>=a.y1;o--)f=r[o].boundary===a;for(o=n+1;!f&&o0&&(r.scale=r.canvasWidth/s,o="scaleX("+r.scale+")"),0!==r.angle&&(o="rotate("+r.angle+"deg) "+o),""!==o&&(r.originalTransform=o,i.CustomStyle.setProp("transform",e,o)),this._textDivProperties.set(e,r),t.appendChild(e)}},_render:function(e){var r=this,i=(0,n.createPromiseCapability)(),a=Object.create(null),s=document.createElement("canvas");if(s.mozOpaque=!0,this._layoutTextCtx=s.getContext("2d",{alpha:!1}),this._textContent){var o=this._textContent.items,l=this._textContent.styles;this._processItems(o,l),i.resolve()}else{if(!this._textContentStream)throw new Error('Neither "textContent" nor "textContentStream" parameters specified.');this._reader=this._textContentStream.getReader(),function e(){r._reader.read().then(function(t){var s=t.value;t.done?i.resolve():(n.Util.extendObj(a,s.styles),r._processItems(s.items,a),e())},i.reject)}()}i.promise.then(function(){a=null,e?r._renderTimer=setTimeout(function(){t(r),r._renderTimer=null},e):t(r)},this._capability.reject)},expandTextDivs:function(e){if(this._enhanceTextSelection&&this._renderingDone){null!==this._bounds&&(r(this),this._bounds=null);for(var t=0,n=this._textDivs.length;t>24&255,r[i+1]=a>>16&255,r[i+2]=a>>8&255,r[i+3]=255&a,r[i+=4]=255&e.charCodeAt(0),r[i+1]=255&e.charCodeAt(1),r[i+2]=255&e.charCodeAt(2),r[i+3]=255&e.charCodeAt(3),i+=4,r.set(t,i);var o=function(e,t,r){for(var n=-1,i=t;i>>8^s[a]}return-1^n}(r,n+4,i+=t.length);r[i]=o>>24&255,r[i+1]=o>>16&255,r[i+2]=o>>8&255,r[i+3]=255&o}function t(e){var t=e.length,r=Math.ceil(t/65535),n=new Uint8Array(2+t+5*r+4),i=0;n[i++]=120,n[i++]=156;for(var a=0;t>65535;)n[i++]=0,n[i++]=255,n[i++]=255,n[i++]=0,n[i++]=0,n.set(e.subarray(a,a+65535),i),i+=65535,a+=65535,t-=65535;n[i++]=1,n[i++]=255&t,n[i++]=t>>8&255,n[i++]=255&~t,n[i++]=(65535&~t)>>8&255,n.set(e.subarray(a),i),i+=e.length-a;var s=function(e,t,r){for(var n=1,i=0,a=t;a>24&255,n[i++]=s>>16&255,n[i++]=s>>8&255,n[i++]=255&s,n}function r(r,s,o){var l,u,c,h=r.width,d=r.height,f=r.data;switch(s){case n.ImageKind.GRAYSCALE_1BPP:u=0,l=1,c=h+7>>3;break;case n.ImageKind.RGB_24BPP:u=2,l=8,c=3*h;break;case n.ImageKind.RGBA_32BPP:u=6,l=8,c=4*h;break;default:throw new Error("invalid format")}var p,m,v=new Uint8Array((1+c)*d),g=0,b=0;for(p=0;p>24&255,h>>16&255,h>>8&255,255&h,d>>24&255,d>>16&255,d>>8&255,255&d,l,u,0,0,0]),y=function(e){if(!(0,n.isNodeJS)())return t(e);try{var r;r=parseInt(process.versions.node)>=8?e:new Buffer(e);var i=require("zlib").deflateSync(r,{level:9});return i instanceof Uint8Array?i:new Uint8Array(i)}catch(e){(0,n.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+e)}return t(e)}(v),A=i.length+3*a+_.length+y.length,S=new Uint8Array(A),w=0;return S.set(i,w),w+=i.length,e("IHDR",_,S,w),w+=a+_.length,e("IDATA",y,S,w),w+=a+y.length,e("IEND",new Uint8Array(0),S,w),(0,n.createObjectURL)(S,"image/png",o)}for(var i=new Uint8Array([137,80,78,71,13,10,26,10]),a=12,s=new Int32Array(256),o=0;o<256;o++){for(var l=o,u=0;u<8;u++)l=1&l?3988292384^l>>1&2147483647:l>>1&2147483647;s[o]=l}return function(e,t){return r(e,void 0===e.kind?n.ImageKind.GRAYSCALE_1BPP:e.kind,t)}}(),l=function(){function e(){this.fontSizeScale=1,this.fontWeight=s.fontWeight,this.fontSize=0,this.textMatrix=n.IDENTITY_MATRIX,this.fontMatrix=n.FONT_IDENTITY_MATRIX,this.leading=0,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRise=0,this.fillColor=s.fillColor,this.strokeColor="#000000",this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.lineJoin="",this.lineCap="",this.miterLimit=0,this.dashArray=[],this.dashPhase=0,this.dependencies=[],this.activeClipUrl=null,this.clipGroup=null,this.maskId=""}return e.prototype={clone:function(){return Object.create(this)},setCurrentPoint:function(e,t){this.x=e,this.y=t}},e}();t.SVGGraphics=a=function(){function e(e){if(Number.isInteger(e))return e.toString();var t=e.toFixed(10),r=t.length-1;if("0"!==t[r])return t;do{r--}while("0"===t[r]);return t.substr(0,"."===t[r]?r:r+1)}function t(t){if(0===t[4]&&0===t[5]){if(0===t[1]&&0===t[2])return 1===t[0]&&1===t[3]?"":"scale("+e(t[0])+" "+e(t[3])+")";if(t[0]===t[3]&&t[1]===-t[2]){return"rotate("+e(180*Math.acos(t[0])/Math.PI)+")"}}else if(1===t[0]&&0===t[1]&&0===t[2]&&1===t[3])return"translate("+e(t[4])+" "+e(t[5])+")";return"matrix("+e(t[0])+" "+e(t[1])+" "+e(t[2])+" "+e(t[3])+" "+e(t[4])+" "+e(t[5])+")"}function r(e,t,r){this.svgFactory=new i.DOMSVGFactory,this.current=new l,this.transformMatrix=n.IDENTITY_MATRIX,this.transformStack=[],this.extraStack=[],this.commonObjs=e,this.objs=t,this.pendingClip=null,this.pendingEOFill=!1,this.embedFonts=!1,this.embeddedFonts=Object.create(null),this.cssStyle=null,this.forceDataSchema=!!r}var a="http://www.w3.org/1999/xlink",u=["butt","round","square"],c=["miter","round","bevel"],h=0,d=0;return r.prototype={save:function(){this.transformStack.push(this.transformMatrix);var e=this.current;this.extraStack.push(e),this.current=e.clone()},restore:function(){this.transformMatrix=this.transformStack.pop(),this.current=this.extraStack.pop(),this.pendingClip=null,this.tgrp=null},group:function(e){this.save(),this.executeOpTree(e),this.restore()},loadDependencies:function(e){for(var t=this,r=e.fnArray,i=r.length,a=e.argsArray,s=0;s=0,c=/Chrome\/(39|40)\./.test(a),h=a.indexOf("CriOS")>=0,d=a.indexOf("Trident")>=0,f=/\b(iPad|iPhone|iPod)(?=;)/.test(a),p=a.indexOf("Opera")>=0,m=/Safari\//.test(a)&&!/(Chrome\/|Android\s)/.test(a),v="object"===("undefined"==typeof window?"undefined":n(window))&&"object"===("undefined"==typeof document?"undefined":n(document));"undefined"==typeof PDFJS&&(i.PDFJS={}),PDFJS.compatibilityChecked=!0,i.URL||(i.URL=i.webkitURL),function(){if(void 0!==Object.defineProperty){var e=!0;try{v&&Object.defineProperty(new Image,"id",{value:"test"});var t=function(){};t.prototype={get id(){}},Object.defineProperty(new t,"id",{value:"",configurable:!0,enumerable:!0,writable:!1})}catch(t){e=!1}if(e)return}Object.defineProperty=function(e,t,r){delete e[t],"get"in r&&e.__defineGetter__(t,r.get),"set"in r&&e.__defineSetter__(t,r.set),"value"in r&&(e.__defineSetter__(t,function(e){return this.__defineGetter__(t,function(){return e}),e}),e[t]=r.value)}}(),function(){if("undefined"!=typeof XMLHttpRequest){var e=XMLHttpRequest.prototype,t=new XMLHttpRequest;"overrideMimeType"in t||Object.defineProperty(e,"overrideMimeType",{value:function(e){}}),"responseType"in t||(Object.defineProperty(e,"responseType",{get:function(){return this._responseType||"text"},set:function(e){"text"!==e&&"arraybuffer"!==e||(this._responseType=e,"arraybuffer"===e&&"function"==typeof this.overrideMimeType&&this.overrideMimeType("text/plain; charset=x-user-defined"))}}),"undefined"==typeof VBArray?Object.defineProperty(e,"response",{get:function(){if("arraybuffer"!==this.responseType)return this.responseText;var e,t=this.responseText,r=t.length,n=new Uint8Array(r);for(e=0;e>4,u=r+1>6:64,c=r+2>2)+e.charAt(l)+e.charAt(u)+e.charAt(c)}return i}}}(),function(){if(!("atob"in i)){i.atob=function(e){if((e=e.replace(/=+$/,"")).length%4==1)throw new Error("bad atob input");for(var t,r,n=0,i=0,a="";r=e.charAt(i++);~r&&(t=n%4?64*t+r:r,n++%4)?a+=String.fromCharCode(255&t>>(-2*n&6)):0)r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(r);return a}}}(),void 0===Function.prototype.bind&&(Function.prototype.bind=function(e){var t=this,r=Array.prototype.slice.call(arguments,1);return function(){var n=r.concat(Array.prototype.slice.call(arguments));return t.apply(e,n)}}),function(){if(v){"dataset"in document.createElement("div")||Object.defineProperty(HTMLElement.prototype,"dataset",{get:function(){if(this._dataset)return this._dataset;for(var e={},t=0,r=this.attributes.length;t=0&&n&&i.splice(a,1),e.className=i.join(" "),a>=0}if(v){if(!("classList"in document.createElement("div"))){var t={add:function(t){e(this.element,t,!0,!1)},contains:function(t){return e(this.element,t,!1,!1)},remove:function(t){e(this.element,t,!1,!0)},toggle:function(t){e(this.element,t,!0,!0)}};Object.defineProperty(HTMLElement.prototype,"classList",{get:function(){if(this._classList)return this._classList;var e=Object.create(t,{element:{value:this,writable:!1,enumerable:!0}});return Object.defineProperty(this,"_classList",{value:e,writable:!1,enumerable:!1}),e},enumerable:!0})}}}(),function(){if(!("undefined"==typeof importScripts||"console"in i)){var e={},t={log:function(){var e=Array.prototype.slice.call(arguments);i.postMessage({targetName:"main",action:"console_log",data:e})},error:function(){var e=Array.prototype.slice.call(arguments);i.postMessage({targetName:"main",action:"console_error",data:e})},time:function(t){e[t]=Date.now()},timeEnd:function(t){var r=e[t];if(!r)throw new Error("Unknown timer name "+t);this.log("Timer:",t,Date.now()-r)}};i.console=t}}(),function(){if(v){if("console"in window)return"bind"in console.log?void 0:(console.log=function(e){return function(t){return e(t)}}(console.log),console.error=function(e){return function(t){return e(t)}}(console.error),void(console.warn=function(e){return function(t){return e(t)}}(console.warn)));window.console={log:function(){},error:function(){},warn:function(){}}}}(),function(){function e(e){t(e.target)&&e.stopPropagation()}function t(e){return e.disabled||e.parentNode&&t(e.parentNode)}p&&document.addEventListener("click",e,!0)}(),(d||h)&&(PDFJS.disableCreateObjectURL=!0),"undefined"!=typeof navigator&&("language"in navigator||(PDFJS.locale=navigator.userLanguage||"en-US")),(m||o||c||f)&&(PDFJS.disableRange=!0,PDFJS.disableStream=!0),v&&(history.pushState&&!o||(PDFJS.disableHistory=!0)),function(){if(v)if(window.CanvasPixelArray)"function"!=typeof window.CanvasPixelArray.prototype.set&&(window.CanvasPixelArray.prototype.set=function(e){for(var t=0,r=this.length;t32&&t<127&&-1===[34,35,60,62,63,96].indexOf(t)?e:encodeURIComponent(e)}function s(e){var t=e.charCodeAt(0);return t>32&&t<127&&-1===[34,35,60,62,96].indexOf(t)?e:encodeURIComponent(e)}function o(n,i,o){function l(e){_.push(e)}var u=i||"scheme start",c=0,h="",g=!1,b=!1,_=[];e:for(;(n[c-1]!==p||0===c)&&!this._isInvalid;){var y=n[c];switch(u){case"scheme start":if(!y||!m.test(y)){if(i){l("Invalid scheme.");break e}h="",u="no scheme";continue}h+=y.toLowerCase(),u="scheme";break;case"scheme":if(y&&v.test(y))h+=y.toLowerCase();else{if(":"!==y){if(i){if(y===p)break e;l("Code point not allowed in scheme: "+y);break e}h="",c=0,u="no scheme";continue}if(this._scheme=h,h="",i)break e;e(this._scheme)&&(this._isRelative=!0),u="file"===this._scheme?"relative":this._isRelative&&o&&o._scheme===this._scheme?"relative or authority":this._isRelative?"authority first slash":"scheme data"}break;case"scheme data":"?"===y?(this._query="?",u="query"):"#"===y?(this._fragment="#",u="fragment"):y!==p&&"\t"!==y&&"\n"!==y&&"\r"!==y&&(this._schemeData+=a(y));break;case"no scheme":if(o&&e(o._scheme)){u="relative";continue}l("Missing scheme."),t.call(this);break;case"relative or authority":if("/"!==y||"/"!==n[c+1]){l("Expected /, got: "+y),u="relative";continue}u="authority ignore slashes";break;case"relative":if(this._isRelative=!0,"file"!==this._scheme&&(this._scheme=o._scheme),y===p){this._host=o._host,this._port=o._port,this._path=o._path.slice(),this._query=o._query,this._username=o._username,this._password=o._password;break e}if("/"===y||"\\"===y)"\\"===y&&l("\\ is an invalid code point."),u="relative slash";else if("?"===y)this._host=o._host,this._port=o._port,this._path=o._path.slice(),this._query="?",this._username=o._username,this._password=o._password,u="query";else{if("#"!==y){var A=n[c+1],S=n[c+2];("file"!==this._scheme||!m.test(y)||":"!==A&&"|"!==A||S!==p&&"/"!==S&&"\\"!==S&&"?"!==S&&"#"!==S)&&(this._host=o._host,this._port=o._port,this._username=o._username,this._password=o._password,this._path=o._path.slice(),this._path.pop()),u="relative path";continue}this._host=o._host,this._port=o._port,this._path=o._path.slice(),this._query=o._query,this._fragment="#",this._username=o._username,this._password=o._password,u="fragment"}break;case"relative slash":if("/"!==y&&"\\"!==y){"file"!==this._scheme&&(this._host=o._host,this._port=o._port,this._username=o._username,this._password=o._password),u="relative path";continue}"\\"===y&&l("\\ is an invalid code point."),u="file"===this._scheme?"file host":"authority ignore slashes";break;case"authority first slash":if("/"!==y){l("Expected '/', got: "+y),u="authority ignore slashes";continue}u="authority second slash";break;case"authority second slash":if(u="authority ignore slashes","/"!==y){l("Expected '/', got: "+y);continue}break;case"authority ignore slashes":if("/"!==y&&"\\"!==y){u="authority";continue}l("Expected authority, got: "+y);break;case"authority":if("@"===y){g&&(l("@ already seen."),h+="%40"),g=!0;for(var w=0;wu;)a.call(s,r=o[u++])&&c.push(e?[r,s[r]]:s[r]);return c}}},function(e,t,r){"use strict";var n=r(7),i=r(17),a=r(41)(!1),s=r(30)("IE_PROTO");e.exports=function(e,t){var r,o=i(e),l=0,u=[];for(r in o)r!=s&&n(o,r)&&u.push(r);for(;t.length>l;)n(o,r=t[l++])&&(~a(u,r)||u.push(r));return u}},function(e,t,r){"use strict";var n=r(29),i=Math.max,a=Math.min;e.exports=function(e,t){return(e=n(e))<0?i(e+t,0):a(e,t)}},function(e,t,r){"use strict";r(71),e.exports=r(5).Array.includes},function(e,t,r){"use strict";var n=r(4),i=r(41)(!0);n(n.P,"Array",{includes:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),r(44)("includes")},function(e,t,r){"use strict";r(73),e.exports=r(5).Number.isNaN},function(e,t,r){"use strict";var n=r(4);n(n.S,"Number",{isNaN:function(e){return e!=e}})},function(e,t,r){"use strict";r(75),e.exports=r(5).Number.isInteger},function(e,t,r){"use strict";var n=r(4);n(n.S,"Number",{isInteger:r(76)})},function(e,t,r){"use strict";var n=r(1),i=Math.floor;e.exports=function(e){return!n(e)&&isFinite(e)&&i(e)===e}},function(e,t,r){"use strict";r(45),r(78),r(49),r(86),r(93),r(94),e.exports=r(5).Promise},function(e,t,r){"use strict";var n=r(79)(!0);r(46)(String,"String",function(e){this._t=String(e),this._i=0},function(){var e,t=this._t,r=this._i;return r>=t.length?{value:void 0,done:!0}:(e=n(t,r),this._i+=e.length,{value:e,done:!1})})},function(e,t,r){"use strict";var n=r(29),i=r(27);e.exports=function(e){return function(t,r){var a,s,o=String(i(t)),l=n(r),u=o.length;return l<0||l>=u?e?"":void 0:(a=o.charCodeAt(l))<55296||a>56319||l+1===u||(s=o.charCodeAt(l+1))<56320||s>57343?e?o.charAt(l):a:e?o.slice(l,l+2):s-56320+(a-55296<<10)+65536}}},function(e,t,r){"use strict";var n=r(81),i=r(25),a=r(22),s={};r(11)(s,r(2)("iterator"),function(){return this}),e.exports=function(e,t,r){e.prototype=n(s,{next:i(1,r)}),a(e,t+" Iterator")}},function(e,t,r){"use strict";var n=r(6),i=r(82),a=r(43),s=r(30)("IE_PROTO"),o=function(){},l=function(){var e,t=r(24)("iframe"),n=a.length;for(t.style.display="none",r(48).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("