diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 766addf4..cf072cbd 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -9,4 +9,4 @@ community_bridge: # Replace with a single Community Bridge project-name e.g., cl liberapay: # Replace with a single Liberapay username issuehunt: # Replace with a single IssueHunt username otechie: # Replace with a single Otechie username -custom: ["https://codebar.io/donations/new"] +custom: ["https://codebar.enthuse.com/donate/#!/"] diff --git a/.gitignore b/.gitignore index 7ff05a84..850441a3 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,5 @@ node_modules # sourcemaps *.map + +.idea diff --git a/.ruby-version b/.ruby-version index c043eea7..4d9d11cf 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.2.1 +3.4.2 diff --git a/Gemfile b/Gemfile index c452bbf3..fc183a50 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,3 @@ source 'https://rubygems.org/' -gem 'jekyll', '~> 3.6.3' # https://pages.github.com/versions/ - -group :jekyll_plugins do - gem 'jekyll-livereload' -end +gem 'github-pages', group: :jekyll_plugins \ No newline at end of file diff --git a/Gemfile.lock b/Gemfile.lock index 5a679a25..ceff5507 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,60 +1,283 @@ GEM remote: https://rubygems.org/ specs: - addressable (2.5.2) - public_suffix (>= 2.0.2, < 4.0) + activesupport (8.0.4.1) + base64 + benchmark (>= 0.3) + bigdecimal + concurrent-ruby (~> 1.0, >= 1.3.1) + connection_pool (>= 2.2.5) + drb + i18n (>= 1.6, < 2) + logger (>= 1.4.2) + minitest (>= 5.1, < 6) + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) + uri (>= 0.13.1) + addressable (2.8.7) + public_suffix (>= 2.0.2, < 7.0) + base64 (0.3.0) + benchmark (0.5.0) + bigdecimal (4.0.1) + coffee-script (2.4.1) + coffee-script-source + execjs + coffee-script-source (1.12.2) colorator (1.1.0) - em-websocket (0.5.1) + commonmarker (0.23.11) + concurrent-ruby (1.3.6) + connection_pool (3.0.2) + csv (3.3.2) + dnsruby (1.73.1) + base64 (>= 0.2) + logger (~> 1.6) + simpleidn (~> 0.2.1) + drb (2.2.3) + em-websocket (0.5.3) eventmachine (>= 0.12.9) - http_parser.rb (~> 0.6.0) - eventmachine (1.2.5) - ffi (1.9.25) + http_parser.rb (~> 0) + ethon (0.16.0) + ffi (>= 1.15.0) + eventmachine (1.2.7) + execjs (2.10.0) + faraday (2.14.2) + faraday-net_http (>= 2.0, < 3.5) + json + logger + faraday-net_http (3.4.2) + net-http (~> 0.5) + ffi (1.17.1) forwardable-extended (2.6.0) - http_parser.rb (0.6.0) - jekyll (3.6.3) + gemoji (4.1.0) + github-pages (232) + github-pages-health-check (= 1.18.2) + jekyll (= 3.10.0) + jekyll-avatar (= 0.8.0) + jekyll-coffeescript (= 1.2.2) + jekyll-commonmark-ghpages (= 0.5.1) + jekyll-default-layout (= 0.1.5) + jekyll-feed (= 0.17.0) + jekyll-gist (= 1.5.0) + jekyll-github-metadata (= 2.16.1) + jekyll-include-cache (= 0.2.1) + jekyll-mentions (= 1.6.0) + jekyll-optional-front-matter (= 0.3.2) + jekyll-paginate (= 1.1.0) + jekyll-readme-index (= 0.3.0) + jekyll-redirect-from (= 0.16.0) + jekyll-relative-links (= 0.6.1) + jekyll-remote-theme (= 0.4.3) + jekyll-sass-converter (= 1.5.2) + jekyll-seo-tag (= 2.8.0) + jekyll-sitemap (= 1.4.0) + jekyll-swiss (= 1.0.0) + jekyll-theme-architect (= 0.2.0) + jekyll-theme-cayman (= 0.2.0) + jekyll-theme-dinky (= 0.2.0) + jekyll-theme-hacker (= 0.2.0) + jekyll-theme-leap-day (= 0.2.0) + jekyll-theme-merlot (= 0.2.0) + jekyll-theme-midnight (= 0.2.0) + jekyll-theme-minimal (= 0.2.0) + jekyll-theme-modernist (= 0.2.0) + jekyll-theme-primer (= 0.6.0) + jekyll-theme-slate (= 0.2.0) + jekyll-theme-tactile (= 0.2.0) + jekyll-theme-time-machine (= 0.2.0) + jekyll-titles-from-headings (= 0.5.3) + jemoji (= 0.13.0) + kramdown (= 2.4.0) + kramdown-parser-gfm (= 1.1.0) + liquid (= 4.0.4) + mercenary (~> 0.3) + minima (= 2.5.1) + nokogiri (>= 1.16.2, < 2.0) + rouge (= 3.30.0) + terminal-table (~> 1.4) + webrick (~> 1.8) + github-pages-health-check (1.18.2) + addressable (~> 2.3) + dnsruby (~> 1.60) + octokit (>= 4, < 8) + public_suffix (>= 3.0, < 6.0) + typhoeus (~> 1.3) + html-pipeline (2.14.3) + activesupport (>= 2) + nokogiri (>= 1.4) + http_parser.rb (0.8.0) + i18n (1.14.8) + concurrent-ruby (~> 1.0) + jekyll (3.10.0) addressable (~> 2.4) colorator (~> 1.0) + csv (~> 3.0) + em-websocket (~> 0.5) + i18n (>= 0.7, < 2) jekyll-sass-converter (~> 1.0) - jekyll-watch (~> 1.1) - kramdown (~> 1.14) + jekyll-watch (~> 2.0) + kramdown (>= 1.17, < 3) liquid (~> 4.0) mercenary (~> 0.3.3) pathutil (~> 0.9) - rouge (>= 1.7, < 3) + rouge (>= 1.7, < 4) safe_yaml (~> 1.0) - jekyll-livereload (0.2.2) - em-websocket (~> 0.5) - jekyll (~> 3.0) + webrick (>= 1.0) + jekyll-avatar (0.8.0) + jekyll (>= 3.0, < 5.0) + jekyll-coffeescript (1.2.2) + coffee-script (~> 2.2) + coffee-script-source (~> 1.12) + jekyll-commonmark (1.4.0) + commonmarker (~> 0.22) + jekyll-commonmark-ghpages (0.5.1) + commonmarker (>= 0.23.7, < 1.1.0) + jekyll (>= 3.9, < 4.0) + jekyll-commonmark (~> 1.4.0) + rouge (>= 2.0, < 5.0) + jekyll-default-layout (0.1.5) + jekyll (>= 3.0, < 5.0) + jekyll-feed (0.17.0) + jekyll (>= 3.7, < 5.0) + jekyll-gist (1.5.0) + octokit (~> 4.2) + jekyll-github-metadata (2.16.1) + jekyll (>= 3.4, < 5.0) + octokit (>= 4, < 7, != 4.4.0) + jekyll-include-cache (0.2.1) + jekyll (>= 3.7, < 5.0) + jekyll-mentions (1.6.0) + html-pipeline (~> 2.3) + jekyll (>= 3.7, < 5.0) + jekyll-optional-front-matter (0.3.2) + jekyll (>= 3.0, < 5.0) + jekyll-paginate (1.1.0) + jekyll-readme-index (0.3.0) + jekyll (>= 3.0, < 5.0) + jekyll-redirect-from (0.16.0) + jekyll (>= 3.3, < 5.0) + jekyll-relative-links (0.6.1) + jekyll (>= 3.3, < 5.0) + jekyll-remote-theme (0.4.3) + addressable (~> 2.0) + jekyll (>= 3.5, < 5.0) + jekyll-sass-converter (>= 1.0, <= 3.0.0, != 2.0.0) + rubyzip (>= 1.3.0, < 3.0) jekyll-sass-converter (1.5.2) sass (~> 3.4) - jekyll-watch (1.5.1) + jekyll-seo-tag (2.8.0) + jekyll (>= 3.8, < 5.0) + jekyll-sitemap (1.4.0) + jekyll (>= 3.7, < 5.0) + jekyll-swiss (1.0.0) + jekyll-theme-architect (0.2.0) + jekyll (> 3.5, < 5.0) + jekyll-seo-tag (~> 2.0) + jekyll-theme-cayman (0.2.0) + jekyll (> 3.5, < 5.0) + jekyll-seo-tag (~> 2.0) + jekyll-theme-dinky (0.2.0) + jekyll (> 3.5, < 5.0) + jekyll-seo-tag (~> 2.0) + jekyll-theme-hacker (0.2.0) + jekyll (> 3.5, < 5.0) + jekyll-seo-tag (~> 2.0) + jekyll-theme-leap-day (0.2.0) + jekyll (> 3.5, < 5.0) + jekyll-seo-tag (~> 2.0) + jekyll-theme-merlot (0.2.0) + jekyll (> 3.5, < 5.0) + jekyll-seo-tag (~> 2.0) + jekyll-theme-midnight (0.2.0) + jekyll (> 3.5, < 5.0) + jekyll-seo-tag (~> 2.0) + jekyll-theme-minimal (0.2.0) + jekyll (> 3.5, < 5.0) + jekyll-seo-tag (~> 2.0) + jekyll-theme-modernist (0.2.0) + jekyll (> 3.5, < 5.0) + jekyll-seo-tag (~> 2.0) + jekyll-theme-primer (0.6.0) + jekyll (> 3.5, < 5.0) + jekyll-github-metadata (~> 2.9) + jekyll-seo-tag (~> 2.0) + jekyll-theme-slate (0.2.0) + jekyll (> 3.5, < 5.0) + jekyll-seo-tag (~> 2.0) + jekyll-theme-tactile (0.2.0) + jekyll (> 3.5, < 5.0) + jekyll-seo-tag (~> 2.0) + jekyll-theme-time-machine (0.2.0) + jekyll (> 3.5, < 5.0) + jekyll-seo-tag (~> 2.0) + jekyll-titles-from-headings (0.5.3) + jekyll (>= 3.3, < 5.0) + jekyll-watch (2.2.1) listen (~> 3.0) - kramdown (1.17.0) - liquid (4.0.0) - listen (3.1.1) - rb-fsevent (>= 0.9.3) - rb-inotify (>= 0.9.7) + jemoji (0.13.0) + gemoji (>= 3, < 5) + html-pipeline (~> 2.2) + jekyll (>= 3.0, < 5.0) + json (2.19.5) + kramdown (2.4.0) + rexml + kramdown-parser-gfm (1.1.0) + kramdown (~> 2.0) + liquid (4.0.4) + listen (3.9.0) + rb-fsevent (~> 0.10, >= 0.10.3) + rb-inotify (~> 0.9, >= 0.9.10) + logger (1.7.0) mercenary (0.3.6) - pathutil (0.16.1) + mini_portile2 (2.8.9) + minima (2.5.1) + jekyll (>= 3.5, < 5.0) + jekyll-feed (~> 0.9) + jekyll-seo-tag (~> 2.1) + minitest (5.27.0) + net-http (0.9.1) + uri (>= 0.11.1) + nokogiri (1.19.3) + mini_portile2 (~> 2.8.2) + racc (~> 1.4) + octokit (4.25.1) + faraday (>= 1, < 3) + sawyer (~> 0.9) + pathutil (0.16.2) forwardable-extended (~> 2.6) - public_suffix (3.0.3) - rb-fsevent (0.10.3) - rb-inotify (0.9.10) - ffi (>= 0.5.0, < 2) - rouge (2.2.1) - safe_yaml (1.0.4) - sass (3.6.0) + public_suffix (5.1.1) + racc (1.8.1) + rb-fsevent (0.11.2) + rb-inotify (0.11.1) + ffi (~> 1.0) + rexml (3.4.2) + rouge (3.30.0) + rubyzip (2.4.1) + safe_yaml (1.0.5) + sass (3.7.4) sass-listen (~> 4.0.0) sass-listen (4.0.0) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) + sawyer (0.9.2) + addressable (>= 2.3.5) + faraday (>= 0.17.3, < 3) + securerandom (0.4.1) + simpleidn (0.2.3) + terminal-table (1.8.0) + unicode-display_width (~> 1.1, >= 1.1.1) + typhoeus (1.4.1) + ethon (>= 0.9.0) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + unicode-display_width (1.8.0) + uri (1.1.1) + webrick (1.9.1) PLATFORMS ruby DEPENDENCIES - jekyll (~> 3.6.3) - jekyll-livereload + github-pages BUNDLED WITH - 1.16.6 + 2.6.5 diff --git a/README.md b/README.md index 82558640..a6741064 100644 --- a/README.md +++ b/README.md @@ -123,7 +123,7 @@ Follow the [quick installation guide](https://rvm.io/rvm/install#quick-guided-in ```bash $ rvm install 2.2.1 # inside `codebar/tutorials` folder $ rvm gemset use codebar-tutorial --create -$ gem install bundler +$ gem install bundler -v 1.17.3 $ bundle install $ jekyll serve # go to http://127.0.0.1:4000/ ``` diff --git a/_config.yml b/_config.yml index fffe3e98..f32a2c37 100644 --- a/_config.yml +++ b/_config.yml @@ -8,8 +8,9 @@ kramdown: input: GFM hard_wrap: false extensions: ["no_intra_emphasis", "fenced_code_blocks", "autolink", "tables", "with_toc_data"] -exclude: [ - "javascripts-dev", - "node_modules" -] +exclude: + - javascripts-dev + - node_modules + - vendor livereload: true + diff --git a/examples/hangman/script.js b/examples/hangman/script.js index cb7ee61f..11e71277 100644 --- a/examples/hangman/script.js +++ b/examples/hangman/script.js @@ -1,7 +1,7 @@ function newGame() { $.ajax({ type: "POST", - url: "http://hangman-api.herokuapp.com/hangman", + url: "https://hangman-api.herokuapp.com/hangman", }).done(function(data) { $('.hangman-word').text(data.hangman); $('.token').text(data.token); @@ -14,7 +14,7 @@ function guess(token, letter) { $.ajax({ type: "PUT", dataType: 'json', - url: "http://hangman-api.herokuapp.com/hangman", + url: "https://hangman-api.herokuapp.com/hangman", data: { "token": token, "letter": letter}, beforeSend: function() { $(".letter").prop('disabled', true); @@ -42,7 +42,7 @@ function getSolution(token) { $.ajax({ type: "GET", dataType: 'json', - url: "http://hangman-api.herokuapp.com/hangman", + url: "https://hangman-api.herokuapp.com/hangman", data: { "token": token }, }).done(function(data) { var hangman_word = $('.hangman-word').text(); diff --git a/general/getting-started-in-tech.md b/general/getting-started-in-tech.md new file mode 100644 index 00000000..dbd2c26f --- /dev/null +++ b/general/getting-started-in-tech.md @@ -0,0 +1,97 @@ +--- +layout: page +title: Getting Started in Tech +--- + +Technology is a vast subject. It can enable you to write a to-do list on your phone, sell goods online or send a rover and a helicopter to Mars. Software is built by developers and codebar is here to teach you how to write such software. Whether you want to make a career of it or acquire some exta skills. + +Typically software can fall into two (very broad) categories: + +- **User interface** - How to present information to people using the technology and enable them to interact with it. For example: + - Displaying your vehicle and responding to joystick inputs in a game of Mario Kart + - Displaying your balance and allowing you to make a payment in your bank’s online banking site + - Displaying current temperature and allowing you to change the target on your Hive or Nest smart thermostat +- **Data processing** - How to manipulate the data and perform the task that the software implements. For example: + - Calculating the position of your vehicle and detecting collisions + - Validating that your account has enough funds to send this payment and processing the payment + - Starting or stopping your heating or air conditioning depending on the current temperature and the target you set + +At codebar, we concentrate on web technologies for several reasons: + +- No initial investment is needed: all the tools you need to learn about web technologies are available online for free. And the computer you use doesn’t have to be new or a top of the range model, most computers will perform well, including shared computers in libraries. +- You can see results very fast. +- They are ubiquitous: a lot of technologies that started on the web are now used in many other places. Even if you end up working in a domain that has nothing to do with the web, you will likely use or interact with web technologies. + +Web technologies are designed in such a way that they tend to more clearly separate user interface work from data processing work. As a result, web developer jobs typically fall into three broad categories: +- Front end: work that deals with user interfaces +- Back end: work that deals with data processing +- Full stack: work that combines both aspects + +Both front-end and back-end have their own complexities and neither is easier than the other. So let’s have a look at what they both involve. Take this web page as an example. It is a page on the codebar.io website and you are reading it via a web browser on a computer or mobile device. The codebar website runs on a computer in a data center that runs a piece of software called a web server. Both talk to each other via the internet. + +To build a website like this involves two pieces of code: +- The front-end code that runs in the web browser +- The back-end code that runs on the web server + +Below we go into more depth about these roles, and what languages you would need to learn. + +## Front-end Development + +As a front-end developer you would be responsible for the code that runs in the web browser and displays information to visitors. It is typically the practice of writing HTML, CSS and JavaScript. + +### HTML (Hyper Text Markup Language) + +HTML is the language used to build websites. All text and content that you see on the internet is built using HTML. + +### CSS (Cascading Style Sheets) + +CSS is used alongside HTML to style the page and make it look good. + +### JavaScript + +JavaScript is used to change what is displayed on a web page in response to user activity. + +## Back-end Development + +As a back-end developer you would be responsible for the code that runs on the server. This type of development usually consists of three parts: a server, an application, and a database. Many back-end developers know front-end languages such as HTML and CSS but need to use languages such as Ruby, Python, PHP, Java, and .NET to get the job done. + +Front-end and Back-end development overlap a fair amount so starting in one role doesn’t mean that you can't switch or learn the other, should you change your mind further down the line. They also have strong ties to other areas of technology. For instance, front-end development shares a lot with mobile app development; back-end development with data science. + +### Ruby +Ruby is an object oriented scripting programming language typically used for building web applications. It is most commonly used with Ruby on Rails, a web development framework built with Ruby. + +### Python +Python is the preferred option for data science thanks to scientific libraries like NumPy and pandas. + +### Node.js +Node.js is a development framework built with JavaScript. It allows you to write back-end components with the same technologies as the ones used in front-end work, which makes it particularly attractive when the same developers work on the front-end and back-end. + +### PHP +PHP is a general-purpose scripting language especially suited to web development. It is a server side scripting language that is embedded in HTML. It is used to manage dynamic content, databases, session tracking, even build entire e-commerce sites. Also commonly used with WordPress so if custom WordPress themes interests you, then learn PHP. + +### SQL +SQL is a domain-specific language designed for managing data held in a relational database management system. It is often combined with the technologies described above. + +## Full-stack Development + +A full-stack web developer is a person who can develop both client (front-end) and server (back-end) software. For this we suggest learning any of the languages under front-end development and back-end development. Below are some further subjects that relate to both: + +### Testing +Why do you want to test and what different types of tests you can do: +- Unit testing +- Integration testing +- End to end testing +- Acceptance testing +- Security testing +- Performance testing + +### REST API +Basics on HTTP, JSON and how to put this together to use or build an API. + +### Privacy +Basics on privacy, things like GDPR and overall principles. + +### Accessibility +How you use web technologies to build your websites has an impact on who can access and interact with the information you provide. Accessibility is a set of guidelines and techniques to ensure that your websites can be used by as wide a variety of people as possible, irrespective of whether they get on the web like you do or in a very different way. + +[MDN Article](https://developer.mozilla.org/en-US/docs/Learn/Accessibility) diff --git a/gulpfile.js b/gulpfile.js index c237105c..dd364b1d 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,48 +1,50 @@ -var -browsersync = require('browser-sync').create(), - concat = require('gulp-concat'), - gulp = require('gulp'), - sourcemaps = require('gulp-sourcemaps'), - uglify = require('gulp-uglify'), - paths = { - jsdev: [ - './javascripts-dev/vendor/jszip.js', - './javascripts-dev/vendor/jszip-utils.js', - './javascripts-dev/vendor/FileSaver.js', - './javascripts-dev/src/downloader.js', - './javascripts-dev/src/zipper.js', - './javascripts-dev/src/ui.js', - './javascripts-dev/main.js', - ], - jsdist: './javascripts/', - }; +const browsersync = require('browser-sync').create(); +const concat = require('gulp-concat'); +const gulp = require('gulp'); +const sourcemaps = require('gulp-sourcemaps'); +const uglify = require('gulp-uglify'); -gulp.task('js', function() { +const paths = { + jsdev: [ + './javascripts-dev/vendor/jszip.js', + './javascripts-dev/vendor/jszip-utils.js', + './javascripts-dev/vendor/FileSaver.js', + './javascripts-dev/src/downloader.js', + './javascripts-dev/src/zipper.js', + './javascripts-dev/src/ui.js', + './javascripts-dev/main.js', + ], + jsdist: './javascripts/', +}; + +function js() { return gulp - .src(paths.jsdev) - .pipe(sourcemaps.init()) - .pipe(concat('downloader-bundle.js')) - .pipe(uglify()) - .pipe(sourcemaps.write('./')) - .pipe(gulp.dest(paths.jsdist)); -}); + .src(paths.jsdev) + .pipe(sourcemaps.init()) + .pipe(concat('downloader-bundle.js')) + .pipe(uglify()) + .pipe(sourcemaps.write('./')) + .pipe(gulp.dest(paths.jsdist)); +} -gulp.task('watch', function() { - gulp.watch(paths.jsdev, ['js']); -}); +function watch() { + gulp.watch(paths.jsdev, js); +} -gulp.task('server', function() { +function server() { browsersync.init({ server: { baseDir: './', routes: { - "/test" : 'javascripts-dev' - } + "/test": 'javascripts-dev', + }, }, - port: 4000, + port: 4000, notify: false, - open: false + open: false, }); -}); +} + +const build = gulp.series(js, gulp.parallel(watch, server)); -gulp.task('default', ['js', 'watch', 'server']); +gulp.task('default', build); \ No newline at end of file diff --git a/html/lesson2/tutorial.md b/html/lesson2/tutorial.md index 723c42e6..b6f41fa6 100644 --- a/html/lesson2/tutorial.md +++ b/html/lesson2/tutorial.md @@ -6,19 +6,19 @@ footer: true ## Introduction to CSS -### Objectives - +### Objectives + In this tutorial we are going to look at: - -* What is CSS? -* What you can do with CSS? -* Introductions to selectors -* Linking your CSS file -* Cascading selectors -* Pseudo classes - + +- What is CSS? +- What you can do with CSS? +- Introductions to selectors +- Linking your CSS file +- Cascading selectors +- Pseudo classes + ### Goal - + Today we will be styling [this page](https://github.com/codebar/tutorials/blob/master/html/lesson2/example.html) so that it looks [like this example](https://tutorials.codebar.io/html/lesson2/example.html). ### Required files @@ -33,7 +33,7 @@ It defines the visual representation of the content. For example colour, margins ### What does it stand for? - **C**ascading **S**tyle **S**heets. +**C**ascading **S**tyle **S**heets. ### What makes a website @@ -43,7 +43,6 @@ CSS: presentation _**CSS** works in conjunction with **HTML**_ - ## What can I do with CSS? You can change the color, position, dimensions and presentation of different elements @@ -84,9 +83,7 @@ In the head of the html page define a style tag ```html I love owls - + ``` @@ -102,7 +99,7 @@ Let's set the font that we want our page to use ```css body { - font-family: Helvetica, Arial, sans-serif; + font-family: Helvetica, Arial, sans-serif; } ``` @@ -112,7 +109,7 @@ Let's also remove the bullet from the lists that we have defined ```css ul { - list-style: none; + list-style: none; } ``` @@ -120,12 +117,13 @@ and change the appearance of the links on our page ```css a { - color: #a369d5; - text-decoration: none; - border-bottom: 1px dotted #a369d5; + color: #a369d5; + text-decoration: none; + border-bottom: 1px dotted #a369d5; } ``` -**color** defines the color of the text. `#a369d5` is the representation of the color in hex. + +**color** defines the color of the text. `#a369d5` is the representation of the color in hex. **text-decoration** specifies the decoration applied to the text. Some other options you can try out are _underline_, _overline_ and _line-through_. As links by default have an underline text decoration applied to them, by setting this to none, we reset that property. @@ -139,7 +137,7 @@ a { **#a369d5** defines the color of the border -How about changing the border thickness to 5px to see what happens? +How about changing the border thickness to 5px to see what happens? #### Selector: class @@ -147,8 +145,8 @@ A class selector selects all elements that use the specified class. ```css .pictures { - margin: 10px auto; - width: 900px; + margin: 10px auto; + width: 900px; } ``` @@ -172,8 +170,8 @@ Selects the element with the id logo. ```css #logo { - margin: 0 auto 30px; - width: 200px; + margin: 0 auto 30px; + width: 200px; } ``` @@ -185,8 +183,8 @@ Selects all list elements that are nested within a **class** pictures ```css .pictures li { - display: inline; - margin: 3px; + display: inline; + margin: 3px; } ``` @@ -194,6 +192,50 @@ Selects all list elements that are nested within a **class** pictures > Change inline to inline-block, and to block. Can you notice the difference? +#### Selector: child selector + +Another common selector that allows you to select only the immediate child inside the parent element. + +Let's use the markup for a layered store menu that needs to style the `
  • ` tags in the list with the `menu` class, but not the `submenu`. + +```html + +``` + +If you use a nested (contextual) selector, then the CSS rule will be applied to all `
  • ` tags, and each will have a red border. + +```css +/* ❌ note solve task */ +.menu li { + border: 1px solid tomato; +} +``` + +The child selector helps solve this problem by selecting only the children of the
  • that are the children (first nesting) of the `ul.menu` list. + +```css +/* ✅ Exactly what we need */ +.menu > li { + border: 1px solid tomato; +} +``` + ## Ways of connecting CSS to HTML ### Embedded CSS @@ -203,15 +245,12 @@ At the beginning of the tutorial we described how to connect the CSS to our page ```html I love owls - + ``` This method of using CSS, by defining it within our HTML page is called **embedded**. The problem with this, is that it cannot be reused across other pages and it also makes it a bit harder to work. - ### Linked CSS A better way to define CSS, is to include it within a separate stylesheet. This is easier to maintain and can be reused across several pages. @@ -221,7 +260,7 @@ To achieve this, let's move our CSS outside of the head of the page and into a n ```html I love owls - + ``` @@ -252,7 +291,6 @@ We can change the styling of some of these images by defining a more specific se So far we have explained some selectors and presented others with more self explanatory names. Knowing every selector, is not an easy task, but don't let this put you off. The internet is your friend. [Here you can find a list of all CSS properties](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference?redirectlocale=en-US&redirectslug=CSS%2FCSS_Reference) - ## Styling our page further ### line-height @@ -277,6 +315,7 @@ In the HTML page you will notice a div element with the id **main**. Let's use t padding: 0; } ``` + To achieve centering of a container, we must define its width. If you remove the width property you will notice that it won't be in the center of the page. We have also used another type of _shorthand_ to define the margin. The long version looks like this @@ -292,8 +331,7 @@ margin-left: auto; **padding** is the area around an element but within its border. -> Don't confuse padding with margin, have a look using an inspector to see how the padding and margin of an element differ. - +> Don't confuse padding with margin, have a look using an inspector to see how the padding and margin of an element differ. ### Floating elements @@ -352,13 +390,13 @@ h2 { } h4 { - color: #6D6A6A; + color: #6d6a6a; font-size: 19px; padding: 27px 25px 15px; } small { - color: #6D6A6A; + color: #6d6a6a; font-size: 15px; margin: 0 30px 10px; text-align: right; @@ -370,7 +408,7 @@ ol { } ol li { - background-color: #F6F4F8; + background-color: #f6f4f8; color: #663095; font-size: 16px; font-weight: 400; @@ -387,7 +425,7 @@ ol li { ### A bit more styling ```css -#the-quote{ +#the-quote { border-bottom: 1px solid #f6f4f8; border-top: 1px solid #f6f4f8; margin: 40px auto; @@ -407,7 +445,6 @@ ol li { #text-block { height: 370px; } - ``` ### More cascading selectors @@ -416,13 +453,12 @@ ol li { .pictures li img { border: 2px solid #b9b1bf; } - ``` ### Some extra touches ```css -.bigimg{ +.bigimg { display: inline; } ``` @@ -443,7 +479,6 @@ Let's add the code below to make sure we only apply a margin to the _first li el > What happens when you remove _:first-child_ from your selector? - ### Bonus - Resetting styles You've probably noticed that pages look quite different when loading them in different browsers. To try and avoid these browser inconsistencies a common technique is **CSS resetting** @@ -451,7 +486,24 @@ You've probably noticed that pages look quite different when loading them in dif Let's apply this to the elements used within our page ```css -html, body, div, h1, h2, h3, h4, h5, h6, p, a, img, small, b, i, ol, ul, li { +html, +body, +div, +h1, +h2, +h3, +h4, +h5, +h6, +p, +a, +img, +small, +b, +i, +ol, +ul, +li { margin: 0; padding: 0; border: 0; @@ -460,13 +512,13 @@ html, body, div, h1, h2, h3, h4, h5, h6, p, a, img, small, b, i, ol, ul, li { } ``` -If you have some time how about you go back through the tutorial making little amends to your CSS to see what things you can change. +If you have some time how about you go back through the tutorial making little amends to your CSS to see what things you can change. + +--- ------ This ends our second lesson, we hope you enjoyed it and learnt something. If you have some spare time how about going back through this tutorial and, by yourself, make some amendments. If there is something you did not understand or want to give us some feedback please [send us an email.](mailto:feedback@codebar.io) ## Further reading -* [CSS Properties](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference?redirectlocale=en-US&redirectslug=CSS%2FCSS_Reference) -* [More CSS](https://learn.shayhowe.com/html-css/) - +- [CSS Properties](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference?redirectlocale=en-US&redirectslug=CSS%2FCSS_Reference) +- [More CSS](https://learn.shayhowe.com/html-css/) diff --git a/html/lesson3/example.html b/html/lesson3/example.html index c8a1c5fd..662d2ba9 100644 --- a/html/lesson3/example.html +++ b/html/lesson3/example.html @@ -23,29 +23,29 @@

    Hi, I'm Ada Lovelace

    -

    My name is August Ada King. I'm the Countess of Lovelace.

    +

    My name is Augusta Ada King. I'm the Countess of Lovelace.

    -

    I am a mathematician and a writer. People know me from my work on Charle's Babbage's early mechanical general-purpose computer, the Analytical engine. I wrote the first algorithm intended to be processed by a machine. In other words, I am the world's first programmer.

    +

    I am a mathematician and a writer. People know me from my work on Charles Babbage's early mechanical general-purpose computer, the Analytical Engine. I wrote the first algorithm intended to be processed by a machine. In other words, I am the world's first programmer.

    My mother, Anne Isabella Byron, was a great help to me as she helped me by promoting my interest in mathematics and logic, but I also never forgot about my dad, who moved to Greece when I was just an infant to help out in the civil war.

    “I do not believe that my father was such a poet as I shall be an Analyst; for with me the two go together indissolubly.”
    -

    Throughout my life, mathematics have been my primary interest. I always question even basic assumptions by integrating poetry, another great love of mine, and science. I also have a keen interest in scientific developments and trends of my era like phrenology and mesmerism.

    +

    Throughout my life, mathematics has been my primary interest. I always question even basic assumptions by integrating poetry, another great love of mine, and science. I also have a keen interest in scientific developments and trends of my era like phrenology and mesmerism.

    Charles Babbage wrote the following poem of me
    Forget this world and all its troubles and if
    - possible its multitudinous Charlatans-every thing
    + possible its multitudinous Charlatans—every thing
    in short but the Enchantress of Numbers.

    The computer language Ada, was named after me. The Defense Military standard for the language, MIL-STD-1815 was also given the year of my birth.

    -

    These days, the British Computer Society runs an annual competitions for women students of computer science in my name. Also, the annual conference for women undergraduates is named after me. Google also dedicated its Google doodle to me, on the 197th anniversary of my birth.

    +

    These days, the British Computer Society runs an annual competition for women students of computer science in my name. Also, the annual conference for women undergraduates is named after me. Google also dedicated its Google doodle to me, on the 197th anniversary of my birth.

    diff --git a/html/lesson6/tutorial.md b/html/lesson6/tutorial.md index a9727102..cee11dbd 100644 --- a/html/lesson6/tutorial.md +++ b/html/lesson6/tutorial.md @@ -165,5 +165,5 @@ Some of your users might be using screenreaders or keyboards to navigate across - The [A11Y Project](https://a11yproject.com/) is an open source project on providing the most up to date and easy to access information regarding accessibility. #### These extensions are handy if you wish to check if your website meets the criteria and areas to improve: -- Chrome: WAVE Evaluation Tool +- Chrome: [WAVE Evaluation Tool](https://chrome.google.com/webstore/detail/wave-evaluation-tool/jbbplnpkjmmeebjpijfedlgcdilocofh) - Firefox:[AInspector](https://addons.mozilla.org/en-US/firefox/addon/ainspector-sidebar/) diff --git a/html/lesson7/tutorial.md b/html/lesson7/tutorial.md index c075ef5b..e708bc99 100644 --- a/html/lesson7/tutorial.md +++ b/html/lesson7/tutorial.md @@ -195,7 +195,7 @@ Have a go at styling these up, you can compare yours with the below example. color: white; } -Look at your changes in Chrome (Chrome has some great developer tools which are going to help your responsive design). Open up the chrome inspect tool by right clicking and choosing 'inspect'. In the top left hand corner of the inspect tool you should see an icon that looks like a mobile in front of a monitor +Look at your changes in Chrome (Chrome has some great developer tools which are going to help your responsive design). Open up the Chrome Inspect Tool by right clicking and choosing 'Inspect'. In the top left hand corner of the inspect tool you should see an icon that looks like a mobile in front of a monitor inspect tool diff --git a/index.html b/index.html index b565918f..8c2cc790 100644 --- a/index.html +++ b/index.html @@ -32,13 +32,16 @@

    codebar tutorials

    Guides

    -

    HTML & CSS

    +

    Frontend

    + +

    HTML & CSS

    -

    JavaScript

    +

    JavaScript

    -

    Ruby

    +

    Backend

    + +

    Ruby

    -

    Python

    +

    Python

    -

    Other Recommended Python Resources

    +

    Other Recommended Python Resources

    -

    Android

    +

    PHP

    +

    Getting your PHP environment set up can be complicated. We've summarized the + simplest solutions in our simple guide to using PHP

    + + + +

    Apps

    + +

    Android

    Available only at special codebar android workshops! Materials over at https://codebar.github.io/android-tutorials/

    -

    iOS

    +

    iOS

    Available only at special codebar iOS workshops! Materials over at https://codebar.github.io/ios-tutorials/

    -

    PHP

    -

    Getting your PHP environment set up can be complicated. We've summarized the - simplest solutions in our simple guide to using PHP

    +

    General

    +

    Version Control

    -

    Command Line

    +

    Command Line

    -

    Version Control

    - - -

    Other Useful Resources

    +

    Other Useful Resources

    The following resources can be helpful to continue learning. They all have content related to the topics listed above.

    + + - + + diff --git a/javascripts/downloader-bundle.js b/javascripts/downloader-bundle.js index 522ca810..ceb7c1b1 100644 --- a/javascripts/downloader-bundle.js +++ b/javascripts/downloader-bundle.js @@ -1,5 +1,2 @@ -!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.JSZip=t()}}(function(){var t;return function e(t,r,n){function i(s,o){if(!r[s]){if(!t[s]){var u="function"==typeof require&&require;if(!o&&u)return u(s,!0);if(a)return a(s,!0);var h=new Error("Cannot find module '"+s+"'");throw h.code="MODULE_NOT_FOUND",h}var l=r[s]={exports:{}};t[s][0].call(l.exports,function(e){var r=t[s][1][e];return i(r?r:e)},l,l.exports,e,t,r,n)}return r[s].exports}for(var a="function"==typeof require&&require,s=0;sf?t[f++]:0,i=c>f?t[f++]:0):(e=t.charCodeAt(f++),r=c>f?t.charCodeAt(f++):0,i=c>f?t.charCodeAt(f++):0),s=e>>2,o=(3&e)<<4|r>>4,u=d>1?(15&r)<<2|i>>6:64,h=d>2?63&i:64,l.push(a.charAt(s)+a.charAt(o)+a.charAt(u)+a.charAt(h));return l.join("")},r.decode=function(t){var e,r,n,s,o,u,h,l=0,f=0;t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");var c=3*t.length/4;t.charAt(t.length-1)===a.charAt(64)&&c--,t.charAt(t.length-2)===a.charAt(64)&&c--;var d;for(d=i.uint8array?new Uint8Array(c):new Array(c);l>4,r=(15&o)<<4|u>>2,n=(3&u)<<6|h,d[f++]=e,64!==u&&(d[f++]=r),64!==h&&(d[f++]=n);return d}},{"./support":27,"./utils":29}],2:[function(t,e,r){"use strict";function n(t,e,r,n,i){this.compressedSize=t,this.uncompressedSize=e,this.crc32=r,this.compression=n,this.compressedContent=i}var i=t("./external"),a=t("./stream/DataWorker"),s=t("./stream/DataLengthProbe"),o=t("./stream/Crc32Probe"),s=t("./stream/DataLengthProbe");n.prototype={getContentWorker:function(){var t=new a(i.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new s("data_length")),e=this;return t.on("end",function(){if(this.streamInfo.data_length!==e.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),t},getCompressedWorker:function(){return new a(i.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},n.createWorkerFrom=function(t,e,r){return t.pipe(new o).pipe(new s("uncompressedSize")).pipe(e.compressWorker(r)).pipe(new s("compressedSize")).withStreamInfo("compression",e)},e.exports=n},{"./external":6,"./stream/Crc32Probe":22,"./stream/DataLengthProbe":23,"./stream/DataWorker":24}],3:[function(t,e,r){"use strict";var n=t("./stream/GenericWorker");r.STORE={magic:"\x00\x00",compressWorker:function(t){return new n("STORE compression")},uncompressWorker:function(){return new n("STORE decompression")}},r.DEFLATE=t("./flate")},{"./flate":7,"./stream/GenericWorker":25}],4:[function(t,e,r){"use strict";function n(){for(var t,e=[],r=0;256>r;r++){t=r;for(var n=0;8>n;n++)t=1&t?3988292384^t>>>1:t>>>1;e[r]=t}return e}function i(t,e,r,n){var i=o,a=n+r;t=-1^t;for(var s=n;a>s;s++)t=t>>>8^i[255&(t^e[s])];return-1^t}function a(t,e,r,n){var i=o,a=n+r;t=-1^t;for(var s=n;a>s;s++)t=t>>>8^i[255&(t^e.charCodeAt(s))];return-1^t}var s=t("./utils"),o=n();e.exports=function(t,e){if("undefined"==typeof t||!t.length)return 0;var r="string"!==s.getTypeOf(t);return r?i(0|e,t,t.length,0):a(0|e,t,t.length,0)}},{"./utils":29}],5:[function(t,e,r){"use strict";r.base64=!1,r.binary=!1,r.dir=!1,r.createFolders=!0,r.date=null,r.compression=null,r.compressionOptions=null,r.comment=null,r.unixPermissions=null,r.dosPermissions=null},{}],6:[function(t,e,r){"use strict";var n=t("es6-promise").Promise;e.exports={Promise:n}},{"es6-promise":37}],7:[function(t,e,r){"use strict";function n(t,e){o.call(this,"FlateWorker/"+t),this._pako=new a[t]({raw:!0,level:e.level||-1}),this.meta={};var r=this;this._pako.onData=function(t){r.push({data:t,meta:r.meta})}}var i="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,a=t("pako"),s=t("./utils"),o=t("./stream/GenericWorker"),u=i?"uint8array":"array";r.magic="\b\x00",s.inherits(n,o),n.prototype.processChunk=function(t){this.meta=t.meta,this._pako.push(s.transformTo(u,t.data),!1)},n.prototype.flush=function(){o.prototype.flush.call(this),this._pako.push([],!0)},n.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this._pako=null},r.compressWorker=function(t){return new n("Deflate",t)},r.uncompressWorker=function(){return new n("Inflate",{})}},{"./stream/GenericWorker":25,"./utils":29,pako:38}],8:[function(t,e,r){"use strict";function n(t,e,r,n){a.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=e,this.zipPlatform=r,this.encodeFileName=n,this.streamFiles=t,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}var i=t("../utils"),a=t("../stream/GenericWorker"),s=t("../utf8"),o=t("../crc32"),u=t("../signature"),h=function(t,e){var r,n="";for(r=0;e>r;r++)n+=String.fromCharCode(255&t),t>>>=8;return n},l=function(t,e){var r=t;return t||(r=e?16893:33204),(65535&r)<<16},f=function(t,e){return 63&(t||0)},c=function(t,e,r,n,a,c){var d,p,m=t.file,_=t.compression,g=c!==s.utf8encode,v=i.transformTo("string",c(m.name)),w=i.transformTo("string",s.utf8encode(m.name)),b=m.comment,y=i.transformTo("string",c(b)),k=i.transformTo("string",s.utf8encode(b)),x=w.length!==m.name.length,S=k.length!==b.length,z="",A="",E="",C=m.dir,I=m.date,O={crc32:0,compressedSize:0,uncompressedSize:0};e&&!r||(O.crc32=t.crc32,O.compressedSize=t.compressedSize,O.uncompressedSize=t.uncompressedSize);var T=0;e&&(T|=8),g||!x&&!S||(T|=2048);var B=0,R=0;C&&(B|=16),"UNIX"===a?(R=798,B|=l(m.unixPermissions,C)):(R=20,B|=f(m.dosPermissions,C)),d=I.getUTCHours(),d<<=6,d|=I.getUTCMinutes(),d<<=5,d|=I.getUTCSeconds()/2,p=I.getUTCFullYear()-1980,p<<=4,p|=I.getUTCMonth()+1,p<<=5,p|=I.getUTCDate(),x&&(A=h(1,1)+h(o(v),4)+w,z+="up"+h(A.length,2)+A),S&&(E=h(1,1)+h(o(y),4)+k,z+="uc"+h(E.length,2)+E);var D="";D+="\n\x00",D+=h(T,2),D+=_.magic,D+=h(d,2),D+=h(p,2),D+=h(O.crc32,4),D+=h(O.compressedSize,4),D+=h(O.uncompressedSize,4),D+=h(v.length,2),D+=h(z.length,2);var F=u.LOCAL_FILE_HEADER+D+v+z,N=u.CENTRAL_FILE_HEADER+h(R,2)+D+h(y.length,2)+"\x00\x00\x00\x00"+h(B,4)+h(n,4)+v+z+y;return{fileRecord:F,dirRecord:N}},d=function(t,e,r,n,a){var s="",o=i.transformTo("string",a(n));return s=u.CENTRAL_DIRECTORY_END+"\x00\x00\x00\x00"+h(t,2)+h(t,2)+h(e,4)+h(r,4)+h(o.length,2)+o},p=function(t){var e="";return e=u.DATA_DESCRIPTOR+h(t.crc32,4)+h(t.compressedSize,4)+h(t.uncompressedSize,4)};i.inherits(n,a),n.prototype.push=function(t){var e=t.meta.percent||0,r=this.entriesCount,n=this._sources.length;this.accumulate?this.contentBuffer.push(t):(this.bytesWritten+=t.data.length,a.prototype.push.call(this,{data:t.data,meta:{currentFile:this.currentFile,percent:r?(e+100*(r-n-1))/r:100}}))},n.prototype.openedSource=function(t){if(this.currentSourceOffset=this.bytesWritten,this.currentFile=t.file.name,this.streamFiles&&!t.file.dir){var e=c(t,this.streamFiles,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:e.fileRecord,meta:{percent:0}})}else this.accumulate=!0},n.prototype.closedSource=function(t){this.accumulate=!1;var e=c(t,this.streamFiles,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(e.dirRecord),this.streamFiles&&!t.file.dir)this.push({data:p(t),meta:{percent:100}});else for(this.push({data:e.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},n.prototype.flush=function(){for(var t=this.bytesWritten,e=0;e0?t.substring(0,e):""},_=function(t){return"/"!==t.slice(-1)&&(t+="/"),t},g=function(t,e){return e="undefined"!=typeof e?e:u.createFolders,t=_(t),this.files[t]||p.call(this,t,null,{dir:!0,createFolders:e}),this.files[t]},v={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(t){var e,r,n;for(e in this.files)this.files.hasOwnProperty(e)&&(n=this.files[e],r=e.slice(this.root.length,e.length),r&&e.slice(0,this.root.length)===this.root&&t(r,n))},filter:function(t){var e=[];return this.forEach(function(r,n){t(r,n)&&e.push(n)}),e},file:function(t,e,r){if(1===arguments.length){if(n(t)){var i=t;return this.filter(function(t,e){return!e.dir&&i.test(t)})}var a=this.files[this.root+t];return a&&!a.dir?a:null}return t=this.root+t,p.call(this,t,e,r),this},folder:function(t){if(!t)return this;if(n(t))return this.filter(function(e,r){return r.dir&&t.test(e)});var e=this.root+t,r=g.call(this,e),i=this.clone();return i.root=r.name,i},remove:function(t){t=this.root+t;var e=this.files[t];if(e||("/"!==t.slice(-1)&&(t+="/"),e=this.files[t]),e&&!e.dir)delete this.files[t];else for(var r=this.filter(function(e,r){return r.name.slice(0,t.length)===t}),n=0;n=0;--a)if(this.data[a]===e&&this.data[a+1]===r&&this.data[a+2]===n&&this.data[a+3]===i)return a-this.zero;return-1},n.prototype.readAndCheckSignature=function(t){var e=t.charCodeAt(0),r=t.charCodeAt(1),n=t.charCodeAt(2),i=t.charCodeAt(3),a=this.readData(4);return e===a[0]&&r===a[1]&&n===a[2]&&i===a[3]},n.prototype.readData=function(t){if(this.checkOffset(t),0===t)return[];var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=n},{"../utils":29,"./DataReader":15}],15:[function(t,e,r){"use strict";function n(t){this.data=t,this.length=t.length,this.index=0,this.zero=0}var i=t("../utils");n.prototype={checkOffset:function(t){this.checkIndex(this.index+t)},checkIndex:function(t){if(this.lengtht)throw new Error("End of data reached (data length = "+this.length+", asked index = "+t+"). Corrupted zip ?")},setIndex:function(t){this.checkIndex(t),this.index=t},skip:function(t){this.setIndex(this.index+t)},byteAt:function(t){},readInt:function(t){var e,r=0;for(this.checkOffset(t),e=this.index+t-1;e>=this.index;e--)r=(r<<8)+this.byteAt(e);return this.index+=t,r},readString:function(t){return i.transformTo("string",this.readData(t))},readData:function(t){},lastIndexOfSignature:function(t){},readAndCheckSignature:function(t){},readDate:function(){var t=this.readInt(4);return new Date(Date.UTC((t>>25&127)+1980,(t>>21&15)-1,t>>16&31,t>>11&31,t>>5&63,(31&t)<<1))}},e.exports=n},{"../utils":29}],16:[function(t,e,r){"use strict";function n(t){i.call(this,t)}var i=t("./Uint8ArrayReader"),a=t("../utils");a.inherits(n,i),n.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=n},{"../utils":29,"./Uint8ArrayReader":18}],17:[function(t,e,r){"use strict";function n(t){i.call(this,t)}var i=t("./DataReader"),a=t("../utils");a.inherits(n,i),n.prototype.byteAt=function(t){return this.data.charCodeAt(this.zero+t)},n.prototype.lastIndexOfSignature=function(t){return this.data.lastIndexOf(t)-this.zero},n.prototype.readAndCheckSignature=function(t){var e=this.readData(4);return t===e},n.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=n},{"../utils":29,"./DataReader":15}],18:[function(t,e,r){"use strict";function n(t){i.call(this,t)}var i=t("./ArrayReader"),a=t("../utils");a.inherits(n,i),n.prototype.readData=function(t){if(this.checkOffset(t),0===t)return new Uint8Array(0);var e=this.data.subarray(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=n},{"../utils":29,"./ArrayReader":14}],19:[function(t,e,r){"use strict";var n=t("../utils"),i=t("../support"),a=t("./ArrayReader"),s=t("./StringReader"),o=t("./NodeBufferReader"),u=t("./Uint8ArrayReader");e.exports=function(t){var e=n.getTypeOf(t);return n.checkSupport(e),"string"!==e||i.uint8array?"nodebuffer"===e?new o(t):i.uint8array?new u(n.transformTo("uint8array",t)):new a(n.transformTo("array",t)):new s(t)}},{"../support":27,"../utils":29,"./ArrayReader":14,"./NodeBufferReader":16,"./StringReader":17,"./Uint8ArrayReader":18}],20:[function(t,e,r){"use strict";r.LOCAL_FILE_HEADER="PK",r.CENTRAL_FILE_HEADER="PK",r.CENTRAL_DIRECTORY_END="PK",r.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",r.ZIP64_CENTRAL_DIRECTORY_END="PK",r.DATA_DESCRIPTOR="PK\b"},{}],21:[function(t,e,r){"use strict";function n(t){i.call(this,"ConvertWorker to "+t),this.destType=t}var i=t("./GenericWorker"),a=t("../utils");a.inherits(n,i),n.prototype.processChunk=function(t){this.push({data:a.transformTo(this.destType,t.data),meta:t.meta})},e.exports=n},{"../utils":29,"./GenericWorker":25}],22:[function(t,e,r){"use strict";function n(){i.call(this,"Crc32Probe")}var i=t("./GenericWorker"),a=t("../crc32"),s=t("../utils");s.inherits(n,i),n.prototype.processChunk=function(t){this.streamInfo.crc32=a(t.data,this.streamInfo.crc32||0),this.push(t)},e.exports=n},{"../crc32":4,"../utils":29,"./GenericWorker":25}],23:[function(t,e,r){"use strict";function n(t){a.call(this,"DataLengthProbe for "+t),this.propName=t,this.withStreamInfo(t,0)}var i=t("../utils"),a=t("./GenericWorker");i.inherits(n,a),n.prototype.processChunk=function(t){if(t){var e=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=e+t.data.length}a.prototype.processChunk.call(this,t)},e.exports=n},{"../utils":29,"./GenericWorker":25}],24:[function(t,e,r){"use strict";function n(t){a.call(this,"DataWorker");var e=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,t.then(function(t){e.dataIsReady=!0,e.data=t,e.max=t&&t.length||0,e.type=i.getTypeOf(t),e.isPaused||e._tickAndRepeat()},function(t){e.error(t)})}var i=t("../utils"),a=t("./GenericWorker"),s=16384;i.inherits(n,a),n.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this.data=null},n.prototype.resume=function(){return a.prototype.resume.call(this)?(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,i.delay(this._tickAndRepeat,[],this)),!0):!1},n.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(i.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},n.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var t=s,e=null,r=Math.min(this.max,this.index+t);if(this.index>=this.max)return this.end();switch(this.type){case"string":e=this.data.substring(this.index,r);break;case"uint8array":e=this.data.subarray(this.index,r);break;case"array":case"nodebuffer":e=this.data.slice(this.index,r)}return this.index=r,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})},e.exports=n},{"../utils":29,"./GenericWorker":25}],25:[function(t,e,r){"use strict";function n(t){this.name=t||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}n.prototype={push:function(t){this.emit("data",t)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(t){this.emit("error",t)}return!0},error:function(t){return this.isFinished?!1:(this.isPaused?this.generatedError=t:(this.isFinished=!0,this.emit("error",t),this.previous&&this.previous.error(t),this.cleanUp()),!0)},on:function(t,e){return this._listeners[t].push(e),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(t,e){if(this._listeners[t])for(var r=0;r "+t:t}},e.exports=n},{}],26:[function(t,e,r){(function(r){"use strict";function n(t,e,r){switch(t){case"blob":return o.newBlob(o.transformTo("arraybuffer",e),r);case"base64":return l.encode(e);default:return o.transformTo(t,e)}}function i(t,e){var n,i=0,a=null,s=0;for(n=0;nl;l++)h[l]=l>=252?6:l>=248?5:l>=240?4:l>=224?3:l>=192?2:1;h[254]=h[254]=1;var f=function(t){var e,r,n,i,a,o=t.length,u=0;for(i=0;o>i;i++)r=t.charCodeAt(i),55296===(64512&r)&&o>i+1&&(n=t.charCodeAt(i+1),56320===(64512&n)&&(r=65536+(r-55296<<10)+(n-56320),i++)),u+=128>r?1:2048>r?2:65536>r?3:4;for(e=s.uint8array?new Uint8Array(u):new Array(u),a=0,i=0;u>a;i++)r=t.charCodeAt(i),55296===(64512&r)&&o>i+1&&(n=t.charCodeAt(i+1),56320===(64512&n)&&(r=65536+(r-55296<<10)+(n-56320),i++)),128>r?e[a++]=r:2048>r?(e[a++]=192|r>>>6,e[a++]=128|63&r):65536>r?(e[a++]=224|r>>>12,e[a++]=128|r>>>6&63,e[a++]=128|63&r):(e[a++]=240|r>>>18,e[a++]=128|r>>>12&63,e[a++]=128|r>>>6&63,e[a++]=128|63&r);return e},c=function(t,e){var r;for(e=e||t.length,e>t.length&&(e=t.length),r=e-1;r>=0&&128===(192&t[r]);)r--;return 0>r?e:0===r?e:r+h[t[r]]>e?r:e},d=function(t){var e,r,n,i,s=t.length,o=new Array(2*s);for(r=0,e=0;s>e;)if(n=t[e++],128>n)o[r++]=n;else if(i=h[n],i>4)o[r++]=65533,e+=i-1;else{for(n&=2===i?31:3===i?15:7;i>1&&s>e;)n=n<<6|63&t[e++],i--;i>1?o[r++]=65533:65536>n?o[r++]=n:(n-=65536,o[r++]=55296|n>>10&1023,o[r++]=56320|1023&n)}return o.length!==r&&(o.subarray?o=o.subarray(0,r):o.length=r),a.applyFromCharCode(o)};r.utf8encode=function(t){return s.nodebuffer?o.newBuffer(t,"utf-8"):f(t)},r.utf8decode=function(t){return s.nodebuffer?a.transformTo("nodebuffer",t).toString("utf-8"):(t=a.transformTo(s.uint8array?"uint8array":"array",t),d(t))},a.inherits(n,u),n.prototype.processChunk=function(t){var e=a.transformTo(s.uint8array?"uint8array":"array",t.data);if(this.leftOver&&this.leftOver.length){if(s.uint8array){var n=e;e=new Uint8Array(n.length+this.leftOver.length),e.set(this.leftOver,0),e.set(n,this.leftOver.length)}else e=this.leftOver.concat(e);this.leftOver=null}var i=c(e),o=e;i!==e.length&&(s.uint8array?(o=e.subarray(0,i),this.leftOver=e.subarray(i,e.length)):(o=e.slice(0,i),this.leftOver=e.slice(i,e.length))),this.push({data:r.utf8decode(o),meta:t.meta})},n.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:r.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},r.Utf8DecodeWorker=n,a.inherits(i,u),i.prototype.processChunk=function(t){this.push({data:r.utf8encode(t.data),meta:t.meta})},r.Utf8EncodeWorker=i},{"./nodejsUtils":12,"./stream/GenericWorker":25,"./support":27,"./utils":29}],29:[function(t,e,r){"use strict";function n(t){var e=null;return e=u.uint8array?new Uint8Array(t.length):new Array(t.length),a(t,e)}function i(t){return t}function a(t,e){for(var r=0;r1;)try{return d.stringifyByChunk(t,n,e)}catch(a){e=Math.floor(e/2)}return d.stringifyByChar(t)}function o(t,e){for(var r=0;r=a)return String.fromCharCode.apply(null,t);for(;a>i;)"array"===e||"nodebuffer"===e?n.push(String.fromCharCode.apply(null,t.slice(i,Math.min(i+r,a)))):n.push(String.fromCharCode.apply(null,t.subarray(i,Math.min(i+r,a)))),i+=r;return n.join("")},stringifyByChar:function(t){for(var e="",r=0;re?"0":"")+e.toString(16).toUpperCase();return n},r.delay=function(t,e,r){f(function(){t.apply(r||null,e||[])})},r.inherits=function(t,e){var r=function(){};r.prototype=e.prototype,t.prototype=new r},r.extend=function(){var t,e,r={};for(t=0;ti;)t=this.reader.readInt(2),e=this.reader.readInt(4),r=this.reader.readData(e),this.zip64ExtensibleData[t]={id:t,length:e,value:r}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),this.disksCount>1)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var t,e;for(t=0;tt){var e=!this.isSignature(0,s.LOCAL_FILE_HEADER);throw e?new Error("Can't find end of central directory : is this a zip file ? If it is, see http://stuk.github.io/jszip/documentation/howto/read_zip.html"):new Error("Corrupted zip : can't find end of central directory")}this.reader.setIndex(t);var r=t;if(this.checkSignature(s.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===a.MAX_VALUE_16BITS||this.diskWithCentralDirStart===a.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===a.MAX_VALUE_16BITS||this.centralDirRecords===a.MAX_VALUE_16BITS||this.centralDirSize===a.MAX_VALUE_32BITS||this.centralDirOffset===a.MAX_VALUE_32BITS){if(this.zip64=!0,t=this.reader.lastIndexOfSignature(s.ZIP64_CENTRAL_DIRECTORY_LOCATOR),0>t)throw new Error("Corrupted zip : can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(t),this.checkSignature(s.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,s.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(s.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip : can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(s.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var n=this.centralDirOffset+this.centralDirSize;this.zip64&&(n+=20,n+=12+this.zip64EndOfCentralSize);var i=r-n;if(i>0)this.isSignature(r,s.CENTRAL_FILE_HEADER)||(this.reader.zero=i);else if(0>i)throw new Error("Corrupted zip: missing "+Math.abs(i)+" bytes.")},prepareReader:function(t){this.reader=i(t)},load:function(t){this.prepareReader(t),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},e.exports=n},{"./reader/readerFor":19,"./signature":20,"./support":27,"./utf8":28,"./utils":29,"./zipEntry":31}],31:[function(t,e,r){"use strict";function n(t,e){this.options=t,this.loadOptions=e}var i=t("./reader/readerFor"),a=t("./utils"),s=t("./compressedObject"),o=t("./crc32"),u=t("./utf8"),h=t("./compressions"),l=t("./support"),f=0,c=3,d=function(t){for(var e in h)if(h.hasOwnProperty(e)&&h[e].magic===t)return h[e];return null};n.prototype={isEncrypted:function(){return 1===(1&this.bitFlag)},useUTF8:function(){return 2048===(2048&this.bitFlag)},readLocalPart:function(t){var e,r;if(t.skip(22),this.fileNameLength=t.readInt(2),r=t.readInt(2),this.fileName=t.readData(this.fileNameLength),t.skip(r),-1===this.compressedSize||-1===this.uncompressedSize)throw new Error("Bug or corrupted zip : didn't get enough informations from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(e=d(this.compressionMethod),null===e)throw new Error("Corrupted zip : compression "+a.pretty(this.compressionMethod)+" unknown (inner file : "+a.transformTo("string",this.fileName)+")");this.decompressed=new s(this.compressedSize,this.uncompressedSize,this.crc32,e,t.readData(this.compressedSize))},readCentralPart:function(t){this.versionMadeBy=t.readInt(2),t.skip(2),this.bitFlag=t.readInt(2),this.compressionMethod=t.readString(2),this.date=t.readDate(),this.crc32=t.readInt(4),this.compressedSize=t.readInt(4),this.uncompressedSize=t.readInt(4);var e=t.readInt(2);if(this.extraFieldsLength=t.readInt(2),this.fileCommentLength=t.readInt(2),this.diskNumberStart=t.readInt(2),this.internalFileAttributes=t.readInt(2),this.externalFileAttributes=t.readInt(4),this.localHeaderOffset=t.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");t.skip(e),this.readExtraFields(t),this.parseZIP64ExtraField(t),this.fileComment=t.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var t=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),t===f&&(this.dosPermissions=63&this.externalFileAttributes),t===c&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(t){if(this.extraFields[1]){var e=i(this.extraFields[1].value);this.uncompressedSize===a.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===a.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===a.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===a.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4))}},readExtraFields:function(t){var e,r,n,i=t.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});t.indexl){for(var e=0,r=o.length-h;r>e;e++)o[e]=o[e+h];o.length-=h,h=0}}o.length=0,h=0,u=!1}function i(t){var e=1,r=new f(t),n=document.createTextNode("");return r.observe(n,{characterData:!0}),function(){e=-e,n.data=e}}function a(t){return function(){function e(){clearTimeout(r),clearInterval(n),t()}var r=setTimeout(e,0),n=setInterval(e,50)}}e.exports=r;var s,o=[],u=!1,h=0,l=1024,f=t.MutationObserver||t.WebKitMutationObserver;s="function"==typeof f?i(n):a(n),r.requestFlush=s,r.makeRequestCallFromTimer=a}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],35:[function(t,e,r){},{}],36:[function(t,e,r){function n(){l=!1,o.length?h=o.concat(h):f=-1,h.length&&i()}function i(){if(!l){var t=setTimeout(n);l=!0;for(var e=h.length;e;){for(o=h,h=[];++f1)for(var r=1;rt;t+=2){var e=rt[t],r=rt[t+1];e(r),rt[t]=void 0,rt[t+1]=void 0}q=0}function _(){try{var t=e,r=t("vertx");return G=r.runOnLoop||r.runOnContext,f()}catch(n){return p()}}function g(){}function v(){return new TypeError("You cannot resolve a promise with itself")}function w(){return new TypeError("A promises callback cannot return that same promise.")}function b(t){try{return t.then}catch(e){return st.error=e,st}}function y(t,e,r,n){try{t.call(e,r,n)}catch(i){return i}}function k(t,e,r){J(function(t){var n=!1,i=y(r,e,function(r){n||(n=!0,e!==r?z(t,r):E(t,r))},function(e){n||(n=!0,C(t,e))},"Settle: "+(t._label||" unknown promise"));!n&&i&&(n=!0,C(t,i))},t)}function x(t,e){e._state===it?E(t,e._result):e._state===at?C(t,e._result):I(e,void 0,function(e){z(t,e)},function(e){C(t,e)})}function S(t,e){if(e.constructor===t.constructor)x(t,e);else{var r=b(e);r===st?C(t,st.error):void 0===r?E(t,e):s(r)?k(t,e,r):E(t,e)}}function z(t,e){t===e?C(t,v()):a(e)?S(t,e):E(t,e)}function A(t){t._onerror&&t._onerror(t._result),O(t)}function E(t,e){t._state===nt&&(t._result=e,t._state=it,0!==t._subscribers.length&&J(O,t))}function C(t,e){t._state===nt&&(t._state=at,t._result=e,J(A,t))}function I(t,e,r,n){var i=t._subscribers,a=i.length;t._onerror=null,i[a]=e,i[a+it]=r,i[a+at]=n,0===a&&t._state&&J(O,t)}function O(t){var e=t._subscribers,r=t._state;if(0!==e.length){for(var n,i,a=t._result,s=0;ss;s++)I(n.resolve(t[s]),void 0,e,r);return i}function L(t){var e=this;if(t&&"object"==typeof t&&t.constructor===e)return t;var r=new e(g);return z(r,t),r}function P(t){var e=this,r=new e(g);return C(r,t),r}function Z(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function W(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function j(t){this._id=dt++,this._state=void 0,this._result=void 0,this._subscribers=[],g!==t&&(s(t)||Z(),this instanceof j||W(),D(this,t))}function M(){var t;if("undefined"!=typeof i)t=i;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var r=t.Promise;r&&"[object Promise]"===Object.prototype.toString.call(r.resolve())&&!r.cast||(t.Promise=pt)}var H;H=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};var G,X,Y,K=H,q=0,J=({}.toString,function(t,e){rt[q]=t,rt[q+1]=e,q+=2,2===q&&(X?X(m):Y())}),V="undefined"!=typeof window?window:void 0,Q=V||{},$=Q.MutationObserver||Q.WebKitMutationObserver,tt="undefined"!=typeof n&&"[object process]"==={}.toString.call(n),et="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,rt=new Array(1e3);Y=tt?l():$?c():et?d():void 0===V&&"function"==typeof e?_():p();var nt=void 0,it=1,at=2,st=new T,ot=new T;F.prototype._validateInput=function(t){return K(t)},F.prototype._validationError=function(){return new Error("Array Methods must be provided an Array")},F.prototype._init=function(){this._result=new Array(this.length)};var ut=F;F.prototype._enumerate=function(){for(var t=this,e=t.length,r=t.promise,n=t._input,i=0;r._state===nt&&e>i;i++)t._eachEntry(n[i],i)},F.prototype._eachEntry=function(t,e){var r=this,n=r._instanceConstructor;o(t)?t.constructor===n&&t._state!==nt?(t._onerror=null,r._settledAt(t._state,e,t._result)):r._willSettleAt(n.resolve(t),e):(r._remaining--,r._result[e]=t)},F.prototype._settledAt=function(t,e,r){var n=this,i=n.promise;i._state===nt&&(n._remaining--,t===at?C(i,r):n._result[e]=r),0===n._remaining&&E(i,n._result)},F.prototype._willSettleAt=function(t,e){var r=this;I(t,void 0,function(t){r._settledAt(it,e,t)},function(t){r._settledAt(at,e,t)})};var ht=N,lt=U,ft=L,ct=P,dt=0,pt=j;j.all=ht,j.race=lt,j.resolve=ft,j.reject=ct,j._setScheduler=u,j._setAsap=h,j._asap=J,j.prototype={constructor:j,then:function(t,e){var r=this,n=r._state;if(n===it&&!t||n===at&&!e)return this;var i=new this.constructor(g),a=r._result;if(n){var s=arguments[n-1];J(function(){R(n,i,s,a)})}else I(r,i,t,e);return i},"catch":function(t){return this.then(null,t)}};var mt=M,_t={Promise:pt,polyfill:mt};"function"==typeof t&&t.amd?t(function(){return _t}):"undefined"!=typeof r&&r.exports?r.exports=_t:"undefined"!=typeof this&&(this.ES6Promise=_t),mt()}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:36}],38:[function(t,e,r){"use strict";var n=t("./lib/utils/common").assign,i=t("./lib/deflate"),a=t("./lib/inflate"),s=t("./lib/zlib/constants"),o={};n(o,i,a,s),e.exports=o},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(t,e,r){"use strict";function n(t){if(!(this instanceof n))return new n(t);this.options=u.assign({level:v,method:b,chunkSize:16384,windowBits:15,memLevel:8,strategy:w,to:""},t||{});var e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new f,this.strm.avail_out=0;var r=o.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(r!==m)throw new Error(l[r]);if(e.header&&o.deflateSetHeader(this.strm,e.header),e.dictionary){var i;if(i="string"==typeof e.dictionary?h.string2buf(e.dictionary):"[object ArrayBuffer]"===c.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,r=o.deflateSetDictionary(this.strm,i),r!==m)throw new Error(l[r]);this._dict_set=!0}}function i(t,e){var r=new n(e);if(r.push(t,!0),r.err)throw r.msg;return r.result}function a(t,e){return e=e||{},e.raw=!0,i(t,e)}function s(t,e){return e=e||{},e.gzip=!0,i(t,e)}var o=t("./zlib/deflate"),u=t("./utils/common"),h=t("./utils/strings"),l=t("./zlib/messages"),f=t("./zlib/zstream"),c=Object.prototype.toString,d=0,p=4,m=0,_=1,g=2,v=-1,w=0,b=8;n.prototype.push=function(t,e){var r,n,i=this.strm,a=this.options.chunkSize;if(this.ended)return!1;n=e===~~e?e:e===!0?p:d,"string"==typeof t?i.input=h.string2buf(t):"[object ArrayBuffer]"===c.call(t)?i.input=new Uint8Array(t):i.input=t,i.next_in=0,i.avail_in=i.input.length;do{if(0===i.avail_out&&(i.output=new u.Buf8(a),i.next_out=0,i.avail_out=a),r=o.deflate(i,n),r!==_&&r!==m)return this.onEnd(r),this.ended=!0,!1;0!==i.avail_out&&(0!==i.avail_in||n!==p&&n!==g)||("string"===this.options.to?this.onData(h.buf2binstring(u.shrinkBuf(i.output,i.next_out))):this.onData(u.shrinkBuf(i.output,i.next_out)))}while((i.avail_in>0||0===i.avail_out)&&r!==_);return n===p?(r=o.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===m):n===g?(this.onEnd(m),i.avail_out=0,!0):!0},n.prototype.onData=function(t){this.chunks.push(t)},n.prototype.onEnd=function(t){t===m&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=u.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},r.Deflate=n,r.deflate=i,r.deflateRaw=a,r.gzip=s},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(t,e,r){"use strict";function n(t){if(!(this instanceof n))return new n(t);this.options=o.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0===(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new f,this.strm.avail_out=0;var r=s.inflateInit2(this.strm,e.windowBits);if(r!==h.Z_OK)throw new Error(l[r]);this.header=new c,s.inflateGetHeader(this.strm,this.header)}function i(t,e){var r=new n(e);if(r.push(t,!0),r.err)throw r.msg;return r.result}function a(t,e){return e=e||{},e.raw=!0,i(t,e)}var s=t("./zlib/inflate"),o=t("./utils/common"),u=t("./utils/strings"),h=t("./zlib/constants"),l=t("./zlib/messages"),f=t("./zlib/zstream"),c=t("./zlib/gzheader"),d=Object.prototype.toString;n.prototype.push=function(t,e){var r,n,i,a,l,f,c=this.strm,p=this.options.chunkSize,m=this.options.dictionary,_=!1;if(this.ended)return!1;n=e===~~e?e:e===!0?h.Z_FINISH:h.Z_NO_FLUSH,"string"==typeof t?c.input=u.binstring2buf(t):"[object ArrayBuffer]"===d.call(t)?c.input=new Uint8Array(t):c.input=t,c.next_in=0,c.avail_in=c.input.length;do{if(0===c.avail_out&&(c.output=new o.Buf8(p),c.next_out=0,c.avail_out=p),r=s.inflate(c,h.Z_NO_FLUSH),r===h.Z_NEED_DICT&&m&&(f="string"==typeof m?u.string2buf(m):"[object ArrayBuffer]"===d.call(m)?new Uint8Array(m):m,r=s.inflateSetDictionary(this.strm,f)),r===h.Z_BUF_ERROR&&_===!0&&(r=h.Z_OK,_=!1),r!==h.Z_STREAM_END&&r!==h.Z_OK)return this.onEnd(r),this.ended=!0,!1;c.next_out&&(0!==c.avail_out&&r!==h.Z_STREAM_END&&(0!==c.avail_in||n!==h.Z_FINISH&&n!==h.Z_SYNC_FLUSH)||("string"===this.options.to?(i=u.utf8border(c.output,c.next_out),a=c.next_out-i,l=u.buf2string(c.output,i),c.next_out=a,c.avail_out=p-a,a&&o.arraySet(c.output,c.output,i,a,0),this.onData(l)):this.onData(o.shrinkBuf(c.output,c.next_out)))),0===c.avail_in&&0===c.avail_out&&(_=!0)}while((c.avail_in>0||0===c.avail_out)&&r!==h.Z_STREAM_END);return r===h.Z_STREAM_END&&(n=h.Z_FINISH),n===h.Z_FINISH?(r=s.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===h.Z_OK):n===h.Z_SYNC_FLUSH?(this.onEnd(h.Z_OK),c.avail_out=0,!0):!0},n.prototype.onData=function(t){this.chunks.push(t)},n.prototype.onEnd=function(t){t===h.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=o.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},r.Inflate=n,r.inflate=i,r.inflateRaw=a,r.ungzip=i},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(t,e,r){"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;r.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var r=e.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var n in r)r.hasOwnProperty(n)&&(t[n]=r[n])}}return t},r.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var i={arraySet:function(t,e,r,n,i){if(e.subarray&&t.subarray)return void t.set(e.subarray(r,r+n),i);for(var a=0;n>a;a++)t[i+a]=e[r+a]},flattenChunks:function(t){var e,r,n,i,a,s;for(n=0,e=0,r=t.length;r>e;e++)n+=t[e].length;for(s=new Uint8Array(n),i=0,e=0,r=t.length;r>e;e++)a=t[e],s.set(a,i),i+=a.length;return s}},a={arraySet:function(t,e,r,n,i){for(var a=0;n>a;a++)t[i+a]=e[r+a]},flattenChunks:function(t){return[].concat.apply([],t)}};r.setTyped=function(t){t?(r.Buf8=Uint8Array,r.Buf16=Uint16Array,r.Buf32=Int32Array,r.assign(r,i)):(r.Buf8=Array,r.Buf16=Array,r.Buf32=Array,r.assign(r,a))},r.setTyped(n)},{}],42:[function(t,e,r){"use strict";function n(t,e){if(65537>e&&(t.subarray&&s||!t.subarray&&a))return String.fromCharCode.apply(null,i.shrinkBuf(t,e));for(var r="",n=0;e>n;n++)r+=String.fromCharCode(t[n]);return r}var i=t("./common"),a=!0,s=!0;try{String.fromCharCode.apply(null,[0])}catch(o){a=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(o){s=!1}for(var u=new i.Buf8(256),h=0;256>h;h++)u[h]=h>=252?6:h>=248?5:h>=240?4:h>=224?3:h>=192?2:1;u[254]=u[254]=1,r.string2buf=function(t){var e,r,n,a,s,o=t.length,u=0;for(a=0;o>a;a++)r=t.charCodeAt(a),55296===(64512&r)&&o>a+1&&(n=t.charCodeAt(a+1),56320===(64512&n)&&(r=65536+(r-55296<<10)+(n-56320),a++)),u+=128>r?1:2048>r?2:65536>r?3:4;for(e=new i.Buf8(u),s=0,a=0;u>s;a++)r=t.charCodeAt(a),55296===(64512&r)&&o>a+1&&(n=t.charCodeAt(a+1),56320===(64512&n)&&(r=65536+(r-55296<<10)+(n-56320),a++)),128>r?e[s++]=r:2048>r?(e[s++]=192|r>>>6,e[s++]=128|63&r):65536>r?(e[s++]=224|r>>>12,e[s++]=128|r>>>6&63,e[s++]=128|63&r):(e[s++]=240|r>>>18,e[s++]=128|r>>>12&63,e[s++]=128|r>>>6&63,e[s++]=128|63&r);return e},r.buf2binstring=function(t){return n(t,t.length)},r.binstring2buf=function(t){for(var e=new i.Buf8(t.length),r=0,n=e.length;n>r;r++)e[r]=t.charCodeAt(r);return e},r.buf2string=function(t,e){var r,i,a,s,o=e||t.length,h=new Array(2*o);for(i=0,r=0;o>r;)if(a=t[r++],128>a)h[i++]=a;else if(s=u[a],s>4)h[i++]=65533,r+=s-1;else{for(a&=2===s?31:3===s?15:7;s>1&&o>r;)a=a<<6|63&t[r++],s--;s>1?h[i++]=65533:65536>a?h[i++]=a:(a-=65536,h[i++]=55296|a>>10&1023,h[i++]=56320|1023&a)}return n(h,i)},r.utf8border=function(t,e){var r;for(e=e||t.length,e>t.length&&(e=t.length),r=e-1;r>=0&&128===(192&t[r]);)r--;return 0>r?e:0===r?e:r+u[t[r]]>e?r:e}},{"./common":41}],43:[function(t,e,r){"use strict";function n(t,e,r,n){for(var i=65535&t|0,a=t>>>16&65535|0,s=0;0!==r;){s=r>2e3?2e3:r,r-=s;do i=i+e[n++]|0,a=a+i|0;while(--s);i%=65521,a%=65521}return i|a<<16|0}e.exports=n},{}],44:[function(t,e,r){"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(t,e,r){"use strict";function n(){for(var t,e=[],r=0;256>r;r++){t=r;for(var n=0;8>n;n++)t=1&t?3988292384^t>>>1:t>>>1;e[r]=t}return e}function i(t,e,r,n){var i=a,s=n+r;t^=-1;for(var o=n;s>o;o++)t=t>>>8^i[255&(t^e[o])];return-1^t}var a=n();e.exports=i},{}],46:[function(t,e,r){"use strict";function n(t,e){return t.msg=D[e],e}function i(t){return(t<<1)-(t>4?9:0)}function a(t){for(var e=t.length;--e>=0;)t[e]=0}function s(t){var e=t.state,r=e.pending;r>t.avail_out&&(r=t.avail_out),0!==r&&(O.arraySet(t.output,e.pending_buf,e.pending_out,r,t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,0===e.pending&&(e.pending_out=0))}function o(t,e){T._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,s(t.strm)}function u(t,e){t.pending_buf[t.pending++]=e}function h(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function l(t,e,r,n){var i=t.avail_in;return i>n&&(i=n),0===i?0:(t.avail_in-=i,O.arraySet(e,t.input,t.next_in,i,r),1===t.state.wrap?t.adler=B(t.adler,e,i,r):2===t.state.wrap&&(t.adler=R(t.adler,e,i,r)),t.next_in+=i,t.total_in+=i,i)}function f(t,e){var r,n,i=t.max_chain_length,a=t.strstart,s=t.prev_length,o=t.nice_match,u=t.strstart>t.w_size-ft?t.strstart-(t.w_size-ft):0,h=t.window,l=t.w_mask,f=t.prev,c=t.strstart+lt,d=h[a+s-1],p=h[a+s];t.prev_length>=t.good_match&&(i>>=2),o>t.lookahead&&(o=t.lookahead);do if(r=e,h[r+s]===p&&h[r+s-1]===d&&h[r]===h[a]&&h[++r]===h[a+1]){a+=2,r++;do;while(h[++a]===h[++r]&&h[++a]===h[++r]&&h[++a]===h[++r]&&h[++a]===h[++r]&&h[++a]===h[++r]&&h[++a]===h[++r]&&h[++a]===h[++r]&&h[++a]===h[++r]&&c>a);if(n=lt-(c-a),a=c-lt,n>s){if(t.match_start=e,s=n,n>=o)break;d=h[a+s-1],p=h[a+s]}}while((e=f[e&l])>u&&0!==--i);return s<=t.lookahead?s:t.lookahead}function c(t){var e,r,n,i,a,s=t.w_size;do{if(i=t.window_size-t.lookahead-t.strstart,t.strstart>=s+(s-ft)){O.arraySet(t.window,t.window,s,s,0),t.match_start-=s,t.strstart-=s,t.block_start-=s,r=t.hash_size,e=r;do n=t.head[--e],t.head[e]=n>=s?n-s:0;while(--r);r=s,e=r;do n=t.prev[--e],t.prev[e]=n>=s?n-s:0;while(--r);i+=s}if(0===t.strm.avail_in)break;if(r=l(t.strm,t.window,t.strstart+t.lookahead,i),t.lookahead+=r,t.lookahead+t.insert>=ht)for(a=t.strstart-t.insert,t.ins_h=t.window[a],t.ins_h=(t.ins_h<t.pending_buf_size-5&&(r=t.pending_buf_size-5);;){if(t.lookahead<=1){if(c(t),0===t.lookahead&&e===F)return bt;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+r;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,o(t,!1),0===t.strm.avail_out))return bt;if(t.strstart-t.block_start>=t.w_size-ft&&(o(t,!1),0===t.strm.avail_out))return bt}return t.insert=0,e===L?(o(t,!0),0===t.strm.avail_out?kt:xt):t.strstart>t.block_start&&(o(t,!1),0===t.strm.avail_out)?bt:bt}function p(t,e){for(var r,n;;){if(t.lookahead=ht&&(t.ins_h=(t.ins_h<=ht)if(n=T._tr_tally(t,t.strstart-t.match_start,t.match_length-ht),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=ht){t.match_length--;do t.strstart++,t.ins_h=(t.ins_h<=ht&&(t.ins_h=(t.ins_h<4096)&&(t.match_length=ht-1)),t.prev_length>=ht&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-ht,n=T._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-ht),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=i&&(t.ins_h=(t.ins_h<=ht&&t.strstart>0&&(i=t.strstart-1,n=s[i],n===s[++i]&&n===s[++i]&&n===s[++i])){a=t.strstart+lt;do;while(n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&a>i);t.match_length=lt-(a-i),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=ht?(r=T._tr_tally(t,1,t.match_length-ht),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=T._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(o(t,!1),0===t.strm.avail_out))return bt}return t.insert=0,e===L?(o(t,!0),0===t.strm.avail_out?kt:xt):t.last_lit&&(o(t,!1),0===t.strm.avail_out)?bt:yt}function g(t,e){for(var r;;){if(0===t.lookahead&&(c(t),0===t.lookahead)){if(e===F)return bt;break}if(t.match_length=0,r=T._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(o(t,!1),0===t.strm.avail_out))return bt}return t.insert=0,e===L?(o(t,!0),0===t.strm.avail_out?kt:xt):t.last_lit&&(o(t,!1),0===t.strm.avail_out)?bt:yt}function v(t,e,r,n,i){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=n,this.func=i}function w(t){t.window_size=2*t.w_size,a(t.head),t.max_lazy_match=I[t.level].max_lazy,t.good_match=I[t.level].good_length,t.nice_match=I[t.level].nice_length,t.max_chain_length=I[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=ht-1,t.match_available=0,t.ins_h=0}function b(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Q,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new O.Buf16(2*ot),this.dyn_dtree=new O.Buf16(2*(2*at+1)),this.bl_tree=new O.Buf16(2*(2*st+1)),a(this.dyn_ltree),a(this.dyn_dtree),a(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new O.Buf16(ut+1),this.heap=new O.Buf16(2*it+1),a(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new O.Buf16(2*it+1),a(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function y(t){var e;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=V,e=t.state,e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?dt:vt,t.adler=2===e.wrap?0:1,e.last_flush=F,T._tr_init(e),Z):n(t,j)}function k(t){var e=y(t);return e===Z&&w(t.state),e}function x(t,e){return t&&t.state?2!==t.state.wrap?j:(t.state.gzhead=e,Z):j}function S(t,e,r,i,a,s){if(!t)return j;var o=1;if(e===G&&(e=6),0>i?(o=0,i=-i):i>15&&(o=2,i-=16),1>a||a>$||r!==Q||8>i||i>15||0>e||e>9||0>s||s>q)return n(t,j);8===i&&(i=9);var u=new b;return t.state=u,u.strm=t,u.wrap=o,u.gzhead=null,u.w_bits=i,u.w_size=1<>1,u.l_buf=3*u.lit_bufsize,u.level=e,u.strategy=s,u.method=r,k(t)}function z(t,e){return S(t,e,Q,tt,et,J)}function A(t,e){var r,o,l,f;if(!t||!t.state||e>P||0>e)return t?n(t,j):j;if(o=t.state,!t.output||!t.input&&0!==t.avail_in||o.status===wt&&e!==L)return n(t,0===t.avail_out?H:j);if(o.strm=t,r=o.last_flush,o.last_flush=e,o.status===dt)if(2===o.wrap)t.adler=0,u(o,31),u(o,139),u(o,8),o.gzhead?(u(o,(o.gzhead.text?1:0)+(o.gzhead.hcrc?2:0)+(o.gzhead.extra?4:0)+(o.gzhead.name?8:0)+(o.gzhead.comment?16:0)),u(o,255&o.gzhead.time),u(o,o.gzhead.time>>8&255),u(o,o.gzhead.time>>16&255),u(o,o.gzhead.time>>24&255),u(o,9===o.level?2:o.strategy>=Y||o.level<2?4:0),u(o,255&o.gzhead.os),o.gzhead.extra&&o.gzhead.extra.length&&(u(o,255&o.gzhead.extra.length),u(o,o.gzhead.extra.length>>8&255)),o.gzhead.hcrc&&(t.adler=R(t.adler,o.pending_buf,o.pending,0)),o.gzindex=0,o.status=pt):(u(o,0),u(o,0),u(o,0),u(o,0),u(o,0),u(o,9===o.level?2:o.strategy>=Y||o.level<2?4:0),u(o,St),o.status=vt);else{var c=Q+(o.w_bits-8<<4)<<8,d=-1;d=o.strategy>=Y||o.level<2?0:o.level<6?1:6===o.level?2:3,c|=d<<6,0!==o.strstart&&(c|=ct),c+=31-c%31,o.status=vt,h(o,c),0!==o.strstart&&(h(o,t.adler>>>16),h(o,65535&t.adler)),t.adler=1}if(o.status===pt)if(o.gzhead.extra){for(l=o.pending;o.gzindex<(65535&o.gzhead.extra.length)&&(o.pending!==o.pending_buf_size||(o.gzhead.hcrc&&o.pending>l&&(t.adler=R(t.adler,o.pending_buf,o.pending-l,l)),s(t),l=o.pending,o.pending!==o.pending_buf_size));)u(o,255&o.gzhead.extra[o.gzindex]),o.gzindex++;o.gzhead.hcrc&&o.pending>l&&(t.adler=R(t.adler,o.pending_buf,o.pending-l,l)),o.gzindex===o.gzhead.extra.length&&(o.gzindex=0,o.status=mt)}else o.status=mt;if(o.status===mt)if(o.gzhead.name){l=o.pending;do{if(o.pending===o.pending_buf_size&&(o.gzhead.hcrc&&o.pending>l&&(t.adler=R(t.adler,o.pending_buf,o.pending-l,l)),s(t),l=o.pending,o.pending===o.pending_buf_size)){f=1;break}f=o.gzindexl&&(t.adler=R(t.adler,o.pending_buf,o.pending-l,l)),0===f&&(o.gzindex=0,o.status=_t)}else o.status=_t;if(o.status===_t)if(o.gzhead.comment){l=o.pending;do{if(o.pending===o.pending_buf_size&&(o.gzhead.hcrc&&o.pending>l&&(t.adler=R(t.adler,o.pending_buf,o.pending-l,l)),s(t),l=o.pending,o.pending===o.pending_buf_size)){f=1;break}f=o.gzindexl&&(t.adler=R(t.adler,o.pending_buf,o.pending-l,l)),0===f&&(o.status=gt)}else o.status=gt;if(o.status===gt&&(o.gzhead.hcrc?(o.pending+2>o.pending_buf_size&&s(t),o.pending+2<=o.pending_buf_size&&(u(o,255&t.adler),u(o,t.adler>>8&255),t.adler=0,o.status=vt)):o.status=vt),0!==o.pending){if(s(t),0===t.avail_out)return o.last_flush=-1,Z}else if(0===t.avail_in&&i(e)<=i(r)&&e!==L)return n(t,H);if(o.status===wt&&0!==t.avail_in)return n(t,H);if(0!==t.avail_in||0!==o.lookahead||e!==F&&o.status!==wt){var p=o.strategy===Y?g(o,e):o.strategy===K?_(o,e):I[o.level].func(o,e);if(p!==kt&&p!==xt||(o.status=wt),p===bt||p===kt)return 0===t.avail_out&&(o.last_flush=-1),Z;if(p===yt&&(e===N?T._tr_align(o):e!==P&&(T._tr_stored_block(o,0,0,!1),e===U&&(a(o.head),0===o.lookahead&&(o.strstart=0,o.block_start=0,o.insert=0))),s(t),0===t.avail_out))return o.last_flush=-1,Z}return e!==L?Z:o.wrap<=0?W:(2===o.wrap?(u(o,255&t.adler),u(o,t.adler>>8&255),u(o,t.adler>>16&255),u(o,t.adler>>24&255),u(o,255&t.total_in),u(o,t.total_in>>8&255),u(o,t.total_in>>16&255),u(o,t.total_in>>24&255)):(h(o,t.adler>>>16),h(o,65535&t.adler)),s(t),o.wrap>0&&(o.wrap=-o.wrap),0!==o.pending?Z:W)}function E(t){var e;return t&&t.state?(e=t.state.status,e!==dt&&e!==pt&&e!==mt&&e!==_t&&e!==gt&&e!==vt&&e!==wt?n(t,j):(t.state=null,e===vt?n(t,M):Z)):j}function C(t,e){var r,n,i,s,o,u,h,l,f=e.length;if(!t||!t.state)return j;if(r=t.state,s=r.wrap,2===s||1===s&&r.status!==dt||r.lookahead)return j;for(1===s&&(t.adler=B(t.adler,e,f,0)),r.wrap=0,f>=r.w_size&&(0===s&&(a(r.head),r.strstart=0,r.block_start=0,r.insert=0),l=new O.Buf8(r.w_size),O.arraySet(l,e,f-r.w_size,r.w_size,0),e=l,f=r.w_size),o=t.avail_in,u=t.next_in,h=t.input,t.avail_in=f,t.next_in=0,t.input=e,c(r);r.lookahead>=ht;){n=r.strstart,i=r.lookahead-(ht-1);do r.ins_h=(r.ins_h<_&&(m+=E[a++]<<_,_+=8,m+=E[a++]<<_,_+=8),y=g[m&w];e:for(;;){if(k=y>>>24,m>>>=k,_-=k,k=y>>>16&255,0===k)C[o++]=65535&y;else{if(!(16&k)){if(0===(64&k)){y=g[(65535&y)+(m&(1<_&&(m+=E[a++]<<_,_+=8),x+=m&(1<>>=k,_-=k),15>_&&(m+=E[a++]<<_,_+=8,m+=E[a++]<<_,_+=8),y=v[m&b];r:for(;;){if(k=y>>>24,m>>>=k,_-=k,k=y>>>16&255,!(16&k)){if(0===(64&k)){y=v[(65535&y)+(m&(1<_&&(m+=E[a++]<<_,_+=8,k>_&&(m+=E[a++]<<_,_+=8)),S+=m&(1<l){t.msg="invalid distance too far back",r.mode=n;break t}if(m>>>=k,_-=k,k=o-u,S>k){if(k=S-k,k>c&&r.sane){t.msg="invalid distance too far back",r.mode=n;break t}if(z=0,A=p,0===d){if(z+=f-k,x>k){x-=k;do C[o++]=p[z++];while(--k);z=o-S,A=C}}else if(k>d){if(z+=f+d-k,k-=d,x>k){x-=k;do C[o++]=p[z++];while(--k);if(z=0,x>d){k=d,x-=k;do C[o++]=p[z++];while(--k);z=o-S,A=C}}}else if(z+=d-k,x>k){x-=k;do C[o++]=p[z++];while(--k);z=o-S,A=C}for(;x>2;)C[o++]=A[z++],C[o++]=A[z++],C[o++]=A[z++],x-=3;x&&(C[o++]=A[z++],x>1&&(C[o++]=A[z++]))}else{z=o-S;do C[o++]=C[z++],C[o++]=C[z++],C[o++]=C[z++],x-=3;while(x>2);x&&(C[o++]=C[z++],x>1&&(C[o++]=C[z++]))}break}}break}}while(s>a&&h>o);x=_>>3,a-=x,_-=x<<3,m&=(1<<_)-1,t.next_in=a,t.next_out=o,t.avail_in=s>a?5+(s-a):5-(a-s),t.avail_out=h>o?257+(h-o):257-(o-h),r.hold=m,r.bits=_}},{}],49:[function(t,e,r){"use strict";function n(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function i(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new v.Buf16(320),this.work=new v.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function a(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=U,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new v.Buf32(mt),e.distcode=e.distdyn=new v.Buf32(_t),e.sane=1,e.back=-1,I):B}function s(t){var e;return t&&t.state?(e=t.state,e.wsize=0,e.whave=0,e.wnext=0,a(t)):B}function o(t,e){var r,n;return t&&t.state?(n=t.state,0>e?(r=0,e=-e):(r=(e>>4)+1,48>e&&(e&=15)),e&&(8>e||e>15)?B:(null!==n.window&&n.wbits!==e&&(n.window=null),n.wrap=r,n.wbits=e,s(t))):B}function u(t,e){var r,n;return t?(n=new i,t.state=n,n.window=null,r=o(t,e),r!==I&&(t.state=null),r):B}function h(t){return u(t,vt)}function l(t){if(wt){var e;for(_=new v.Buf32(512),g=new v.Buf32(32),e=0;144>e;)t.lens[e++]=8;for(;256>e;)t.lens[e++]=9;for(;280>e;)t.lens[e++]=7;for(;288>e;)t.lens[e++]=8;for(k(S,t.lens,0,288,_,0,t.work,{bits:9}),e=0;32>e;)t.lens[e++]=5;k(z,t.lens,0,32,g,0,t.work,{bits:5}),wt=!1}t.lencode=_,t.lenbits=9,t.distcode=g,t.distbits=5}function f(t,e,r,n){var i,a=t.state;return null===a.window&&(a.wsize=1<=a.wsize?(v.arraySet(a.window,e,r-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):(i=a.wsize-a.wnext,i>n&&(i=n),v.arraySet(a.window,e,r-n,i,a.wnext),n-=i,n?(v.arraySet(a.window,e,r-n,n,0),a.wnext=n,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whaved;){if(0===u)break t;u--,c+=i[s++]<>>8&255,r.check=b(r.check,Et,2,0),c=0,d=0,r.mode=L;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&c)<<8)+(c>>8))%31){t.msg="incorrect header check",r.mode=ct;break}if((15&c)!==N){t.msg="unknown compression method",r.mode=ct;break}if(c>>>=4,d-=4,kt=(15&c)+8,0===r.wbits)r.wbits=kt;else if(kt>r.wbits){t.msg="invalid window size",r.mode=ct;break}r.dmax=1<d;){if(0===u)break t;u--,c+=i[s++]<>8&1),512&r.flags&&(Et[0]=255&c,Et[1]=c>>>8&255,r.check=b(r.check,Et,2,0)),c=0,d=0,r.mode=P;case P:for(;32>d;){if(0===u)break t;u--,c+=i[s++]<>>8&255,Et[2]=c>>>16&255,Et[3]=c>>>24&255,r.check=b(r.check,Et,4,0)),c=0,d=0,r.mode=Z;case Z:for(;16>d;){if(0===u)break t;u--,c+=i[s++]<>8),512&r.flags&&(Et[0]=255&c,Et[1]=c>>>8&255,r.check=b(r.check,Et,2,0)),c=0,d=0,r.mode=W;case W:if(1024&r.flags){for(;16>d;){if(0===u)break t;u--,c+=i[s++]<>>8&255,r.check=b(r.check,Et,2,0)),c=0,d=0}else r.head&&(r.head.extra=null);r.mode=j;case j:if(1024&r.flags&&(_=r.length,_>u&&(_=u),_&&(r.head&&(kt=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),v.arraySet(r.head.extra,i,s,_,kt)),512&r.flags&&(r.check=b(r.check,i,_,s)),u-=_,s+=_,r.length-=_),r.length))break t;r.length=0,r.mode=M;case M:if(2048&r.flags){if(0===u)break t;_=0;do kt=i[s+_++],r.head&&kt&&r.length<65536&&(r.head.name+=String.fromCharCode(kt));while(kt&&u>_);if(512&r.flags&&(r.check=b(r.check,i,_,s)),u-=_,s+=_,kt)break t}else r.head&&(r.head.name=null);r.length=0,r.mode=H;case H:if(4096&r.flags){if(0===u)break t;_=0;do kt=i[s+_++],r.head&&kt&&r.length<65536&&(r.head.comment+=String.fromCharCode(kt));while(kt&&u>_);if(512&r.flags&&(r.check=b(r.check,i,_,s)),u-=_,s+=_,kt)break t}else r.head&&(r.head.comment=null);r.mode=G;case G:if(512&r.flags){for(;16>d;){if(0===u)break t;u--,c+=i[s++]<>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=K;break;case X:for(;32>d;){if(0===u)break t;u--,c+=i[s++]<>>=7&d,d-=7&d,r.mode=ht;break}for(;3>d;){if(0===u)break t;u--,c+=i[s++]<>>=1,d-=1,3&c){case 0:r.mode=J;break;case 1:if(l(r),r.mode=rt,e===C){c>>>=2,d-=2;break t}break;case 2:r.mode=$;break;case 3:t.msg="invalid block type",r.mode=ct}c>>>=2,d-=2;break;case J:for(c>>>=7&d,d-=7&d;32>d;){if(0===u)break t;u--,c+=i[s++]<>>16^65535)){t.msg="invalid stored block lengths",r.mode=ct;break}if(r.length=65535&c,c=0,d=0,r.mode=V,e===C)break t;case V:r.mode=Q;case Q:if(_=r.length){if(_>u&&(_=u),_>h&&(_=h),0===_)break t;v.arraySet(a,i,s,_,o),u-=_,s+=_,h-=_,o+=_,r.length-=_;break}r.mode=K;break;case $:for(;14>d;){if(0===u)break t;u--,c+=i[s++]<>>=5,d-=5,r.ndist=(31&c)+1,c>>>=5,d-=5,r.ncode=(15&c)+4,c>>>=4,d-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=ct;break}r.have=0,r.mode=tt;case tt:for(;r.haved;){if(0===u)break t;u--,c+=i[s++]<>>=3,d-=3}for(;r.have<19;)r.lens[Ct[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,St={bits:r.lenbits},xt=k(x,r.lens,0,19,r.lencode,0,r.work,St),r.lenbits=St.bits,xt){t.msg="invalid code lengths set",r.mode=ct;break}r.have=0,r.mode=et;case et:for(;r.have>>24,gt=At>>>16&255,vt=65535&At,!(d>=_t);){if(0===u)break t;u--,c+=i[s++]<vt)c>>>=_t,d-=_t,r.lens[r.have++]=vt;else{if(16===vt){for(zt=_t+2;zt>d;){if(0===u)break t;u--,c+=i[s++]<>>=_t,d-=_t,0===r.have){t.msg="invalid bit length repeat",r.mode=ct;break}kt=r.lens[r.have-1],_=3+(3&c),c>>>=2,d-=2}else if(17===vt){for(zt=_t+3;zt>d;){if(0===u)break t;u--,c+=i[s++]<>>=_t,d-=_t,kt=0,_=3+(7&c),c>>>=3,d-=3}else{for(zt=_t+7;zt>d;){if(0===u)break t;u--,c+=i[s++]<>>=_t,d-=_t,kt=0,_=11+(127&c),c>>>=7,d-=7}if(r.have+_>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=ct;break}for(;_--;)r.lens[r.have++]=kt}}if(r.mode===ct)break;if(0===r.lens[256]){t.msg="invalid code -- missing end-of-block",r.mode=ct;break}if(r.lenbits=9,St={bits:r.lenbits},xt=k(S,r.lens,0,r.nlen,r.lencode,0,r.work,St),r.lenbits=St.bits,xt){t.msg="invalid literal/lengths set",r.mode=ct;break}if(r.distbits=6,r.distcode=r.distdyn,St={bits:r.distbits},xt=k(z,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,St),r.distbits=St.bits,xt){t.msg="invalid distances set",r.mode=ct;break}if(r.mode=rt,e===C)break t;case rt:r.mode=nt;case nt:if(u>=6&&h>=258){t.next_out=o,t.avail_out=h,t.next_in=s,t.avail_in=u,r.hold=c,r.bits=d,y(t,m),o=t.next_out,a=t.output,h=t.avail_out,s=t.next_in,i=t.input,u=t.avail_in,c=r.hold,d=r.bits,r.mode===K&&(r.back=-1);break}for(r.back=0;At=r.lencode[c&(1<>>24,gt=At>>>16&255,vt=65535&At,!(d>=_t);){if(0===u)break t;u--,c+=i[s++]<>wt)],_t=At>>>24,gt=At>>>16&255,vt=65535&At,!(d>=wt+_t);){if(0===u)break t;u--,c+=i[s++]<>>=wt,d-=wt,r.back+=wt}if(c>>>=_t,d-=_t,r.back+=_t,r.length=vt,0===gt){r.mode=ut;break}if(32>){r.back=-1,r.mode=K;break}if(64>){t.msg="invalid literal/length code",r.mode=ct;break}r.extra=15>,r.mode=it;case it:if(r.extra){for(zt=r.extra;zt>d;){if(0===u)break t;u--,c+=i[s++]<>>=r.extra,d-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=at;case at:for(;At=r.distcode[c&(1<>>24,gt=At>>>16&255,vt=65535&At,!(d>=_t);){if(0===u)break t;u--,c+=i[s++]<>wt)],_t=At>>>24,gt=At>>>16&255,vt=65535&At,!(d>=wt+_t);){if(0===u)break t;u--,c+=i[s++]<>>=wt,d-=wt,r.back+=wt}if(c>>>=_t,d-=_t,r.back+=_t,64>){t.msg="invalid distance code",r.mode=ct;break}r.offset=vt,r.extra=15>,r.mode=st;case st:if(r.extra){for(zt=r.extra;zt>d;){if(0===u)break t;u--,c+=i[s++]<>>=r.extra,d-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=ct;break}r.mode=ot;case ot:if(0===h)break t;if(_=m-h,r.offset>_){if(_=r.offset-_,_>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=ct;break}_>r.wnext?(_-=r.wnext,g=r.wsize-_):g=r.wnext-_,_>r.length&&(_=r.length),mt=r.window}else mt=a,g=o-r.offset,_=r.length;_>h&&(_=h),h-=_,r.length-=_;do a[o++]=mt[g++];while(--_);0===r.length&&(r.mode=nt);break;case ut:if(0===h)break t;a[o++]=r.length,h--,r.mode=nt;break;case ht:if(r.wrap){for(;32>d;){if(0===u)break t;u--,c|=i[s++]<d;){if(0===u)break t;u--,c+=i[s++]<=I;I++)W[I]=0;for(O=0;p>O;O++)W[e[r+O]]++;for(R=C,B=i;B>=1&&0===W[B];B--);if(R>B&&(R=B),0===B)return m[_++]=20971520,m[_++]=20971520,v.bits=1,0;for(T=1;B>T&&0===W[T];T++);for(T>R&&(R=T),N=1,I=1;i>=I;I++)if(N<<=1,N-=W[I],0>N)return-1;if(N>0&&(t===o||1!==B))return-1;for(j[1]=0,I=1;i>I;I++)j[I+1]=j[I]+W[I];for(O=0;p>O;O++)0!==e[r+O]&&(g[j[e[r+O]]++]=O);if(t===o?(P=M=g,S=19):t===u?(P=l,Z-=257,M=f,H-=257,S=256):(P=c,M=d,S=-1),L=0,O=0,I=T,x=_,D=R,F=0,y=-1,U=1<a||t===h&&U>s)return 1;for(var G=0;;){G++,z=I-F,g[O]S?(A=M[H+g[O]],E=P[Z+g[O]]):(A=96,E=0),w=1<>F)+b]=z<<24|A<<16|E|0;while(0!==b);for(w=1<>=1;if(0!==w?(L&=w-1,L+=w):L=0,O++,0===--W[I]){if(I===B)break;I=e[r+g[O]]}if(I>R&&(L&k)!==y){for(0===F&&(F=R),x+=T,D=I-F,N=1<D+F&&(N-=W[D+F],!(0>=N));)D++,N<<=1;if(U+=1<a||t===h&&U>s)return 1;y=L&k,m[y]=R<<24|D<<16|x-_|0}}return 0!==L&&(m[x+L]=I-F<<24|64<<16|0),v.bits=R,0}},{"../utils/common":41}],51:[function(t,e,r){"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(t,e,r){"use strict";function n(t){for(var e=t.length;--e>=0;)t[e]=0}function i(t,e,r,n,i){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=t&&t.length}function a(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function s(t){return 256>t?ut[t]:ut[256+(t>>>7)]}function o(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function u(t,e,r){t.bi_valid>q-r?(t.bi_buf|=e<>q-t.bi_valid,t.bi_valid+=r-q):(t.bi_buf|=e<>>=1,r<<=1;while(--e>0);return r>>>1}function f(t){16===t.bi_valid?(o(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}function c(t,e){var r,n,i,a,s,o,u=e.dyn_tree,h=e.max_code,l=e.stat_desc.static_tree,f=e.stat_desc.has_stree,c=e.stat_desc.extra_bits,d=e.stat_desc.extra_base,p=e.stat_desc.max_length,m=0;for(a=0;K>=a;a++)t.bl_count[a]=0;for(u[2*t.heap[t.heap_max]+1]=0,r=t.heap_max+1;Y>r;r++)n=t.heap[r],a=u[2*u[2*n+1]+1]+1,a>p&&(a=p,m++),u[2*n+1]=a,n>h||(t.bl_count[a]++,s=0,n>=d&&(s=c[n-d]),o=u[2*n],t.opt_len+=o*(a+s),f&&(t.static_len+=o*(l[2*n+1]+s)));if(0!==m){do{for(a=p-1;0===t.bl_count[a];)a--;t.bl_count[a]--,t.bl_count[a+1]+=2,t.bl_count[p]--,m-=2}while(m>0);for(a=p;0!==a;a--)for(n=t.bl_count[a];0!==n;)i=t.heap[--r],i>h||(u[2*i+1]!==a&&(t.opt_len+=(a-u[2*i+1])*u[2*i],u[2*i+1]=a),n--)}}function d(t,e,r){var n,i,a=new Array(K+1),s=0;for(n=1;K>=n;n++)a[n]=s=s+r[n-1]<<1;for(i=0;e>=i;i++){var o=t[2*i+1];0!==o&&(t[2*i]=l(a[o]++,o))}}function p(){var t,e,r,n,a,s=new Array(K+1);for(r=0,n=0;j-1>n;n++)for(lt[n]=r,t=0;t<1<n;n++)for(ft[n]=a,t=0;t<1<>=7;G>n;n++)for(ft[n]=a<<7,t=0;t<1<=e;e++)s[e]=0;for(t=0;143>=t;)st[2*t+1]=8,t++,s[8]++;for(;255>=t;)st[2*t+1]=9,t++,s[9]++;for(;279>=t;)st[2*t+1]=7,t++,s[7]++;for(;287>=t;)st[2*t+1]=8,t++,s[8]++;for(d(st,H+1,s),t=0;G>t;t++)ot[2*t+1]=5,ot[2*t]=l(t,5);ct=new i(st,et,M+1,H,K),dt=new i(ot,rt,0,G,K),pt=new i(new Array(0),nt,0,X,J)}function m(t){var e;for(e=0;H>e;e++)t.dyn_ltree[2*e]=0;for(e=0;G>e;e++)t.dyn_dtree[2*e]=0;for(e=0;X>e;e++)t.bl_tree[2*e]=0;t.dyn_ltree[2*V]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function _(t){t.bi_valid>8?o(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function g(t,e,r,n){_(t),n&&(o(t,r),o(t,~r)),B.arraySet(t.pending_buf,t.window,e,r,t.pending),t.pending+=r}function v(t,e,r,n){var i=2*e,a=2*r;return t[i]r;r++)0!==a[2*r]?(t.heap[++t.heap_len]=h=r,t.depth[r]=0):a[2*r+1]=0;for(;t.heap_len<2;)i=t.heap[++t.heap_len]=2>h?++h:0,a[2*i]=1,t.depth[i]=0,t.opt_len--,o&&(t.static_len-=s[2*i+1]);for(e.max_code=h,r=t.heap_len>>1;r>=1;r--)w(t,a,r);i=u;do r=t.heap[1],t.heap[1]=t.heap[t.heap_len--],w(t,a,1),n=t.heap[1],t.heap[--t.heap_max]=r,t.heap[--t.heap_max]=n,a[2*i]=a[2*r]+a[2*n],t.depth[i]=(t.depth[r]>=t.depth[n]?t.depth[r]:t.depth[n])+1,a[2*r+1]=a[2*n+1]=i,t.heap[1]=i++,w(t,a,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],c(t,e),d(a,h,t.bl_count)}function k(t,e,r){var n,i,a=-1,s=e[1],o=0,u=7,h=4;for(0===s&&(u=138,h=3),e[2*(r+1)+1]=65535,n=0;r>=n;n++)i=s,s=e[2*(n+1)+1], -++oo?t.bl_tree[2*i]+=o:0!==i?(i!==a&&t.bl_tree[2*i]++,t.bl_tree[2*Q]++):10>=o?t.bl_tree[2*$]++:t.bl_tree[2*tt]++,o=0,a=i,0===s?(u=138,h=3):i===s?(u=6,h=3):(u=7,h=4))}function x(t,e,r){var n,i,a=-1,s=e[1],o=0,l=7,f=4;for(0===s&&(l=138,f=3),n=0;r>=n;n++)if(i=s,s=e[2*(n+1)+1],!(++oo){do h(t,i,t.bl_tree);while(0!==--o)}else 0!==i?(i!==a&&(h(t,i,t.bl_tree),o--),h(t,Q,t.bl_tree),u(t,o-3,2)):10>=o?(h(t,$,t.bl_tree),u(t,o-3,3)):(h(t,tt,t.bl_tree),u(t,o-11,7));o=0,a=i,0===s?(l=138,f=3):i===s?(l=6,f=3):(l=7,f=4)}}function S(t){var e;for(k(t,t.dyn_ltree,t.l_desc.max_code),k(t,t.dyn_dtree,t.d_desc.max_code),y(t,t.bl_desc),e=X-1;e>=3&&0===t.bl_tree[2*it[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}function z(t,e,r,n){var i;for(u(t,e-257,5),u(t,r-1,5),u(t,n-4,4),i=0;n>i;i++)u(t,t.bl_tree[2*it[i]+1],3);x(t,t.dyn_ltree,e-1),x(t,t.dyn_dtree,r-1)}function A(t){var e,r=4093624447;for(e=0;31>=e;e++,r>>>=1)if(1&r&&0!==t.dyn_ltree[2*e])return D;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return F;for(e=32;M>e;e++)if(0!==t.dyn_ltree[2*e])return F;return D}function E(t){mt||(p(),mt=!0),t.l_desc=new a(t.dyn_ltree,ct),t.d_desc=new a(t.dyn_dtree,dt),t.bl_desc=new a(t.bl_tree,pt),t.bi_buf=0,t.bi_valid=0,m(t)}function C(t,e,r,n){u(t,(U<<1)+(n?1:0),3),g(t,e,r,!0)}function I(t){u(t,L<<1,3),h(t,V,st),f(t)}function O(t,e,r,n){var i,a,s=0;t.level>0?(t.strm.data_type===N&&(t.strm.data_type=A(t)),y(t,t.l_desc),y(t,t.d_desc),s=S(t),i=t.opt_len+3+7>>>3,a=t.static_len+3+7>>>3,i>=a&&(i=a)):i=a=r+5,i>=r+4&&-1!==e?C(t,e,r,n):t.strategy===R||a===i?(u(t,(L<<1)+(n?1:0),3),b(t,st,ot)):(u(t,(P<<1)+(n?1:0),3),z(t,t.l_desc.max_code+1,t.d_desc.max_code+1,s+1),b(t,t.dyn_ltree,t.dyn_dtree)),m(t),n&&_(t)}function T(t,e,r){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&r,t.last_lit++,0===e?t.dyn_ltree[2*r]++:(t.matches++,e--,t.dyn_ltree[2*(ht[r]+M+1)]++,t.dyn_dtree[2*s(e)]++),t.last_lit===t.lit_bufsize-1}var B=t("../utils/common"),R=4,D=0,F=1,N=2,U=0,L=1,P=2,Z=3,W=258,j=29,M=256,H=M+1+j,G=30,X=19,Y=2*H+1,K=15,q=16,J=7,V=256,Q=16,$=17,tt=18,et=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],rt=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],nt=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],it=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],at=512,st=new Array(2*(H+2));n(st);var ot=new Array(2*G);n(ot);var ut=new Array(at);n(ut);var ht=new Array(W-Z+1);n(ht);var lt=new Array(j);n(lt);var ft=new Array(G);n(ft);var ct,dt,pt,mt=!1;r._tr_init=E,r._tr_stored_block=C,r._tr_flush_block=O,r._tr_tally=T,r._tr_align=I},{"../utils/common":41}],53:[function(t,e,r){"use strict";function n(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}e.exports=n},{}]},{},[10])(10)}),!function(t){"object"==typeof exports?module.exports=t():"function"==typeof define&&define.amd?define(t):"undefined"!=typeof window?window.JSZipUtils=t():"undefined"!=typeof global?global.JSZipUtils=t():"undefined"!=typeof self&&(self.JSZipUtils=t())}(function(){return function t(e,r,n){function i(s,o){if(!r[s]){if(!e[s]){var u="function"==typeof require&&require;if(!o&&u)return u(s,!0);if(a)return a(s,!0);throw new Error("Cannot find module '"+s+"'")}var h=r[s]={exports:{}};e[s][0].call(h.exports,function(t){var r=e[s][1][t];return i(r?r:t)},h,h.exports,t,e,r,n)}return r[s].exports}for(var a="function"==typeof require&&require,s=0;s>4,a=1>6:64,s=2>2)+c.charAt(i)+c.charAt(a)+c.charAt(s));return o.join("")},r.decode=function(e){var t,r,n,i,a,s,o,h=0,u=0,l=3*(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length/4;for(e.charAt(e.length-1)===c.charAt(64)&&l--,e.charAt(e.length-2)===c.charAt(64)&&l--,o=new(d.uint8array?Uint8Array:Array)(l);h>2,r=(3&a)<<6|(s=c.indexOf(e.charAt(h++))),o[u++]=n<<2|i>>4,64!==a&&(o[u++]=t),64!==s&&(o[u++]=r);return o}},{"./support":27,"./utils":29}],2:[function(e,t,r){var n=e("./external"),i=e("./stream/DataWorker"),a=e("./stream/DataLengthProbe"),s=e("./stream/Crc32Probe"),a=e("./stream/DataLengthProbe");function o(e,t,r,n,i){this.compressedSize=e,this.uncompressedSize=t,this.crc32=r,this.compression=n,this.compressedContent=i}o.prototype={getContentWorker:function(){var e=new i(n.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new a("data_length")),t=this;return e.on("end",function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),e},getCompressedWorker:function(){return new i(n.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},o.createWorkerFrom=function(e,t,r){return e.pipe(new s).pipe(new a("uncompressedSize")).pipe(t.compressWorker(r)).pipe(new a("compressedSize")).withStreamInfo("compression",t)},t.exports=o},{"./external":6,"./stream/Crc32Probe":22,"./stream/DataLengthProbe":23,"./stream/DataWorker":24}],3:[function(e,t,r){var n=e("./stream/GenericWorker");r.STORE={magic:"\0\0",compressWorker:function(e){return new n("STORE compression")},uncompressWorker:function(){return new n("STORE decompression")}},r.DEFLATE=e("./flate")},{"./flate":7,"./stream/GenericWorker":25}],4:[function(e,t,r){var p=e("./utils");var m=(()=>{for(var e=[],t=0;t<256;t++){for(var r=t,n=0;n<8;n++)r=1&r?3988292384^r>>>1:r>>>1;e[t]=r}return e})();t.exports=function(e,t){if(void 0===e||!e.length)return 0;if("string"!==p.getTypeOf(e)){var r=0|t,n=e,i=e.length,a=0,s=m,o=a+i;r^=-1;for(var h=a;h>>8^s[255&(r^n[h])];return-1^r}var u=0|t,l=e,i=e.length,a=0,f=m,d=a+i;u^=-1;for(var c=a;c>>8^f[255&(u^l.charCodeAt(c))];return-1^u}},{"./utils":29}],5:[function(e,t,r){r.base64=!1,r.binary=!1,r.dir=!1,r.createFolders=!0,r.date=null,r.compression=null,r.compressionOptions=null,r.comment=null,r.unixPermissions=null,r.dosPermissions=null},{}],6:[function(e,t,r){e=e("es6-promise").Promise;t.exports={Promise:e}},{"es6-promise":37}],7:[function(e,t,r){var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,i=e("pako"),a=e("./utils"),s=e("./stream/GenericWorker"),o=n?"uint8array":"array";function h(e,t){s.call(this,"FlateWorker/"+e),this._pako=new i[e]({raw:!0,level:t.level||-1}),this.meta={};var r=this;this._pako.onData=function(e){r.push({data:e,meta:r.meta})}}r.magic="\b\0",a.inherits(h,s),h.prototype.processChunk=function(e){this.meta=e.meta,this._pako.push(a.transformTo(o,e.data),!1)},h.prototype.flush=function(){s.prototype.flush.call(this),this._pako.push([],!0)},h.prototype.cleanUp=function(){s.prototype.cleanUp.call(this),this._pako=null},r.compressWorker=function(e){return new h("Deflate",e)},r.uncompressWorker=function(){return new h("Inflate",{})}},{"./stream/GenericWorker":25,"./utils":29,pako:38}],8:[function(e,t,r){function w(e,t){for(var r="",n=0;n>>=8;return r}function n(e,t,r,n,i,a){var s=e.file,o=e.compression,h=a!==v.utf8encode,u=b.transformTo("string",a(s.name)),l=b.transformTo("string",v.utf8encode(s.name)),f=s.comment,a=b.transformTo("string",a(f)),d=b.transformTo("string",v.utf8encode(f)),c=l.length!==s.name.length,f=d.length!==f.length,p="",m=s.dir,_=s.date,g={crc32:0,compressedSize:0,uncompressedSize:0},r=(t&&!r||(g.crc32=e.crc32,g.compressedSize=e.compressedSize,g.uncompressedSize=e.uncompressedSize),0),e=(t&&(r|=8),h||!c&&!f||(r|=2048),0),t=0,_=(m&&(e|=16),"UNIX"===i?(t=798,e|=(h=s.unixPermissions,i=m,(65535&(h?h:i?16893:33204))<<16)):(t=20,e|=63&(s.dosPermissions||0)),m=_.getUTCHours(),m<<=6,m=(m=(m|_.getUTCMinutes())<<5)|_.getUTCSeconds()/2,h=_.getUTCFullYear()-1980,h=(h=((h<<=4)|_.getUTCMonth()+1)<<5)|_.getUTCDate(),c&&(i=w(1,1)+w(y(u),4)+l,p+="up"+w(i.length,2)+i),f&&(s=w(1,1)+w(y(a),4)+d,p+="uc"+w(s.length,2)+s),""),_=(_=(_=(_=(_=(_=(_=(_=(_=(_+="\n\0")+w(r,2))+o.magic)+w(m,2))+w(h,2))+w(g.crc32,4))+w(g.compressedSize,4))+w(g.uncompressedSize,4))+w(u.length,2))+w(p.length,2);return{fileRecord:k.LOCAL_FILE_HEADER+_+u+p,dirRecord:k.CENTRAL_FILE_HEADER+w(t,2)+_+w(a.length,2)+"\0\0\0\0"+w(e,4)+w(n,4)+u+p+a}}var b=e("../utils"),i=e("../stream/GenericWorker"),v=e("../utf8"),y=e("../crc32"),k=e("../signature");function a(e,t,r,n){i.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=r,this.encodeFileName=n,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}b.inherits(a,i),a.prototype.push=function(e){var t=e.meta.percent||0,r=this.entriesCount,n=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,i.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:r?(t+100*(r-n-1))/r:100}}))},a.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name,this.streamFiles&&!e.file.dir?(e=n(e,this.streamFiles,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName),this.push({data:e.fileRecord,meta:{percent:0}})):this.accumulate=!0},a.prototype.closedSource=function(e){this.accumulate=!1;var t=n(e,this.streamFiles,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(t.dirRecord),this.streamFiles&&!e.file.dir)this.push({data:(e=e,k.DATA_DESCRIPTOR+w(e.crc32,4)+w(e.compressedSize,4)+w(e.uncompressedSize,4)),meta:{percent:100}});else for(this.push({data:t.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},a.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t(i=b.transformTo("string",i(n)),k.CENTRAL_DIRECTORY_END+"\0\0\0\0"+w(e,2)+w(e,2)+w(t,4)+w(r,4)+w(i.length,2)+i))(this.dirRecords.length,r,e,this.zipComment,this.encodeFileName);this.push({data:r,meta:{percent:100}})},a.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},a.prototype.registerPrevious=function(e){this._sources.push(e);var t=this;return e.on("data",function(e){t.processChunk(e)}),e.on("end",function(){t.closedSource(t.previous.streamInfo),t._sources.length?t.prepareNextSource():t.end()}),e.on("error",function(e){t.error(e)}),this},a.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},a.prototype.error=function(e){var t=this._sources;if(!i.prototype.error.call(this,e))return!1;for(var r=0;r{if(t=u[e=e||t])return t;throw new Error(e+" is not a valid compression method !")})(t.options.compression,s.compression),n=t.options.compressionOptions||s.compressionOptions||{},i=t.dir,a=t.date;t._compressWorker(r,n).withStreamInfo("file",{name:e,dir:i,date:a,comment:t.comment||"",unixPermissions:t.unixPermissions,dosPermissions:t.dosPermissions}).pipe(o)}),o.entriesCount=h}catch(e){o.error(e)}return o}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(e,t,r){function n(){if(!(this instanceof n))return new n;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files={},this.comment=null,this.root="",this.clone=function(){var e,t=new n;for(e in this)"function"!=typeof this[e]&&(t[e]=this[e]);return t}}(n.prototype=e("./object")).loadAsync=e("./load"),n.support=e("./support"),n.defaults=e("./defaults"),n.loadAsync=function(e,t){return(new n).loadAsync(e,t)},n.external=e("./external"),t.exports=n},{"./defaults":5,"./external":6,"./load":11,"./object":13,"./support":27}],11:[function(e,t,r){var n=e("./utils"),s=e("./external"),o=e("./utf8"),n=e("./utils"),h=e("./zipEntries"),u=e("./stream/Crc32Probe"),l=e("./nodejsUtils");t.exports=function(e,i){var a=this;return i=n.extend(i||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:o.utf8decode}),l.isNode&&l.isStream(e)?s.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):n.prepareContent("the loaded zip file",e,!0,i.optimizedBinaryString,i.base64).then(function(e){var t=new h(i);return t.load(e),t}).then(function(e){var t=[s.Promise.resolve(e)],r=e.files;if(i.checkCRC32)for(var n=0;nnew s.Promise(function(e,t){var r=n.decompressed.getContentWorker().pipe(new u);r.on("error",function(e){t(e)}).on("end",function(){r.streamInfo.crc32!==n.decompressed.crc32?t(new Error("Corrupted zip : CRC32 mismatch")):e()}).resume()}))(r[n]));return s.Promise.all(t)}).then(function(e){for(var e=e.shift(),t=e.files,r=0;r=this.index;t--)r=(r<<8)+this.byteAt(t);return this.index+=e,r},readString:function(e){return n.transformTo("string",this.readData(e))},readData:function(e){},lastIndexOfSignature:function(e){},readAndCheckSignature:function(e){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}},t.exports=i},{"../utils":29}],16:[function(e,t,r){var n=e("./Uint8ArrayReader");function i(e){n.call(this,e)}e("../utils").inherits(i,n),i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":29,"./Uint8ArrayReader":18}],17:[function(e,t,r){var n=e("./DataReader");function i(e){n.call(this,e)}e("../utils").inherits(i,n),i.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},i.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},i.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":29,"./DataReader":15}],18:[function(e,t,r){var n=e("./ArrayReader");function i(e){n.call(this,e)}e("../utils").inherits(i,n),i.prototype.readData=function(e){var t;return this.checkOffset(e),0===e?new Uint8Array(0):(t=this.data.subarray(this.zero+this.index,this.zero+this.index+e),this.index+=e,t)},t.exports=i},{"../utils":29,"./ArrayReader":14}],19:[function(e,t,r){var n=e("../utils"),i=e("../support"),a=e("./ArrayReader"),s=e("./StringReader"),o=e("./NodeBufferReader"),h=e("./Uint8ArrayReader");t.exports=function(e){var t=n.getTypeOf(e);return n.checkSupport(t),"string"!==t||i.uint8array?"nodebuffer"===t?new o(e):i.uint8array?new h(n.transformTo("uint8array",e)):new a(n.transformTo("array",e)):new s(e)}},{"../support":27,"../utils":29,"./ArrayReader":14,"./NodeBufferReader":16,"./StringReader":17,"./Uint8ArrayReader":18}],20:[function(e,t,r){r.LOCAL_FILE_HEADER="PK",r.CENTRAL_FILE_HEADER="PK",r.CENTRAL_DIRECTORY_END="PK",r.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",r.ZIP64_CENTRAL_DIRECTORY_END="PK",r.DATA_DESCRIPTOR="PK\b"},{}],21:[function(e,t,r){var n=e("./GenericWorker"),i=e("../utils");function a(e){n.call(this,"ConvertWorker to "+e),this.destType=e}i.inherits(a,n),a.prototype.processChunk=function(e){this.push({data:i.transformTo(this.destType,e.data),meta:e.meta})},t.exports=a},{"../utils":29,"./GenericWorker":25}],22:[function(e,t,r){var n=e("./GenericWorker"),i=e("../crc32");function a(){n.call(this,"Crc32Probe")}e("../utils").inherits(a,n),a.prototype.processChunk=function(e){this.streamInfo.crc32=i(e.data,this.streamInfo.crc32||0),this.push(e)},t.exports=a},{"../crc32":4,"../utils":29,"./GenericWorker":25}],23:[function(e,t,r){var n=e("../utils"),i=e("./GenericWorker");function a(e){i.call(this,"DataLengthProbe for "+e),this.propName=e,this.withStreamInfo(e,0)}n.inherits(a,i),a.prototype.processChunk=function(e){var t;e&&(t=this.streamInfo[this.propName]||0,this.streamInfo[this.propName]=t+e.data.length),i.prototype.processChunk.call(this,e)},t.exports=a},{"../utils":29,"./GenericWorker":25}],24:[function(e,t,r){var n=e("../utils"),i=e("./GenericWorker");function a(e){i.call(this,"DataWorker");var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,e.then(function(e){t.dataIsReady=!0,t.data=e,t.max=e&&e.length||0,t.type=n.getTypeOf(e),t.isPaused||t._tickAndRepeat()},function(e){t.error(e)})}n.inherits(a,i),a.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,n.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished)||(n.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0)},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=null,t=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":e=this.data.substring(this.index,t);break;case"uint8array":e=this.data.subarray(this.index,t);break;case"array":case"nodebuffer":e=this.data.slice(this.index,t)}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})},t.exports=a},{"../utils":29,"./GenericWorker":25}],25:[function(e,t,r){function n(e){this.name=e||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}n.prototype={push:function(e){this.emit("data",e)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(e){this.emit("error",e)}return!0},error:function(e){return!this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit("error",e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){if(this._listeners[e])for(var r=0;r "+e:e}},t.exports=n},{}],26:[function(s,o,e){!function(h){var u=s("../utils"),i=s("./ConvertWorker"),a=s("./GenericWorker"),l=s("../base64"),t=s("../nodejs/NodejsStreamOutputAdapter"),r=s("../external");function n(e,o){return new r.Promise(function(t,r){var n=[],i=e._internalType,a=e._outputType,s=e._mimeType;e.on("data",function(e,t){n.push(e),o&&o(t)}).on("error",function(e){n=[],r(e)}).on("end",function(){try{var e=((e,t,r)=>{switch(e){case"blob":return u.newBlob(u.transformTo("arraybuffer",t),r);case"base64":return l.encode(t);default:return u.transformTo(e,t)}})(a,((e,t)=>{for(var r=0,n=null,i=0,a=0;a>>6:(r<65536?t[i++]=224|r>>>12:(t[i++]=240|r>>>18,t[i++]=128|r>>>12&63),t[i++]=128|r>>>6&63),t[i++]=128|63&r);return t},i.utf8decode=function(e){if(u.nodebuffer)return h.transformTo("nodebuffer",e).toString("utf-8");for(var t,r,n=e=h.transformTo(u.uint8array?"uint8array":"array",e),i=n.length,a=new Array(2*i),s=0,o=0;o>10&1023,a[s++]=56320|1023&t)}return a.length!==s&&(a.subarray?a=a.subarray(0,s):a.length=s),h.applyFromCharCode(a)},h.inherits(a,r),a.prototype.processChunk=function(e){var t=h.transformTo(u.uint8array?"uint8array":"array",e.data),r=(this.leftOver&&this.leftOver.length&&(u.uint8array?(r=t,(t=new Uint8Array(r.length+this.leftOver.length)).set(this.leftOver,0),t.set(r,this.leftOver.length)):t=this.leftOver.concat(t),this.leftOver=null),((e,t)=>{for(var r=(t=(t=t||e.length)>e.length?e.length:t)-1;0<=r&&128==(192&e[r]);)r--;return!(r<0)&&0!==r&&r+f[e[r]]>t?r:t})(t)),n=t;r!==t.length&&(u.uint8array?(n=t.subarray(0,r),this.leftOver=t.subarray(r,t.length)):(n=t.slice(0,r),this.leftOver=t.slice(r,t.length))),this.push({data:i.utf8decode(n),meta:e.meta})},a.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:i.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},i.Utf8DecodeWorker=a,h.inherits(s,r),s.prototype.processChunk=function(e){this.push({data:i.utf8encode(e.data),meta:e.meta})},i.Utf8EncodeWorker=s},{"./nodejsUtils":12,"./stream/GenericWorker":25,"./support":27,"./utils":29}],29:[function(e,t,o){var h=e("./support"),u=e("./base64"),r=e("./nodejsUtils"),n=e("asap"),l=e("./external");function i(e){return e}function f(e,t){for(var r=0;r{try{return h.uint8array&&1===String.fromCharCode.apply(null,new Uint8Array(1)).length}catch(e){return!1}})(),nodebuffer:(()=>{try{return h.nodebuffer&&1===String.fromCharCode.apply(null,r.newBuffer(1)).length}catch(e){return!1}})()}};function s(e){var t=65536,r=o.getTypeOf(e),n=!0;if("uint8array"===r?n=a.applyCanBeUsed.uint8array:"nodebuffer"===r&&(n=a.applyCanBeUsed.nodebuffer),n)for(;1{for(var t in h)if(h.hasOwnProperty(t)&&h[t].magic===e)return h[t];return null})(this.compressionMethod)))throw new Error("Corrupted zip : compression "+i.pretty(this.compressionMethod)+" unknown (inner file : "+i.transformTo("string",this.fileName)+")");this.decompressed=new a(this.compressedSize,this.uncompressedSize,this.crc32,t,e.readData(this.compressedSize))},readCentralPart:function(e){this.versionMadeBy=e.readInt(2),e.skip(2),this.bitFlag=e.readInt(2),this.compressionMethod=e.readString(2),this.date=e.readDate(),this.crc32=e.readInt(4),this.compressedSize=e.readInt(4),this.uncompressedSize=e.readInt(4);var t=e.readInt(2);if(this.extraFieldsLength=e.readInt(2),this.fileCommentLength=e.readInt(2),this.diskNumberStart=e.readInt(2),this.internalFileAttributes=e.readInt(2),this.externalFileAttributes=e.readInt(4),this.localHeaderOffset=e.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");e.skip(t),this.readExtraFields(e),this.parseZIP64ExtraField(e),this.fileComment=e.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var e=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),0==e&&(this.dosPermissions=63&this.externalFileAttributes),3==e&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(e){var t;this.extraFields[1]&&(t=n(this.extraFields[1].value),this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=t.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=t.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=t.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS)&&(this.diskNumberStart=t.readInt(4))},readExtraFields:function(e){var t,r,n,i=e.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});e.index{try{e.call(t,r,n)}catch(e){return e}})(i,n,function(e){r||(r=!0,(n!==e?z:A)(t,e))},function(e){r||(r=!0,E(t,e))},t._label);!r&&e&&(r=!0,E(t,e))},e)}function S(e,t){var r,n;t.constructor===e.constructor?(r=e,(n=t)._state===v?A(r,n._result):n._state===y?E(r,n._result):C(n,void 0,function(e){z(r,e)},function(e){E(r,e)})):(n=(e=>{try{return e.then}catch(e){return k.error=e,k}})(t))===k?E(e,k.error):void 0!==n&&u(n)?x(e,t,n):A(e,t)}function z(e,t){var r;e===t?E(e,new TypeError("You cannot resolve a promise with itself")):("function"==typeof(r=t)||"object"==typeof r&&null!==r?S:A)(e,t)}function N(e){e._onerror&&e._onerror(e._result),I(e)}function A(e,t){e._state===b&&(e._result=t,e._state=v,0!==e._subscribers.length)&&o(I,e)}function E(e,t){e._state===b&&(e._state=y,e._result=t,o(N,e))}function C(e,t,r,n){var i=e._subscribers,a=i.length;e._onerror=null,i[a]=t,i[a+v]=r,i[a+y]=n,0===a&&e._state&&o(I,e)}function I(e){var t=e._subscribers,r=e._state;if(0!==t.length){for(var n,i,a=e._result,s=0;s{try{return e(t)}catch(e){return T.error=e,T}})(r,n))===T?(o=!0,a=i.error,i=null):s=!0,t===i)return void E(t,new TypeError("A promises callback cannot return that same promise."))}else i=n,s=!0;t._state===b&&(h&&s?z(t,i):o?E(t,a):e===v?A(t,i):e===y&&E(t,i))}function R(e,t){var r=this;r._instanceConstructor=e,r.promise=new e(g),r._validateInput(t)?(r._input=t,r.length=t.length,r._remaining=t.length,r._init(),0!==r.length&&(r.length=r.length||0,r._enumerate(),0!==r._remaining)||A(r.promise,r._result)):E(r.promise,r._validationError())}R.prototype._validateInput=function(e){return s(e)},R.prototype._validationError=function(){return new Error("Array Methods must be provided an Array")},R.prototype._init=function(){this._result=new Array(this.length)};var U=R;R.prototype._enumerate=function(){for(var e=this.length,t=this.promise,r=this._input,n=0;t._state===b&&n>>6:(r<65536?t[i++]=224|r>>>12:(t[i++]=240|r>>>18,t[i++]=128|r>>>12&63),t[i++]=128|r>>>6&63),t[i++]=128|63&r);return t},r.buf2binstring=function(e){return l(e,e.length)},r.binstring2buf=function(e){for(var t=new h.Buf8(e.length),r=0,n=t.length;r>10&1023,a[s++]=56320|1023&r)}return l(a,s)},r.utf8border=function(e,t){for(var r=(t=(t=t||e.length)>e.length?e.length:t)-1;0<=r&&128==(192&e[r]);)r--;return!(r<0)&&0!==r&&r+u[e[r]]>t?r:t}},{"./common":41}],43:[function(e,t,r){t.exports=function(e,t,r,n){for(var i=65535&e|0,a=e>>>16&65535|0,s=0;0!==r;){for(r-=s=2e3{for(var e=[],t=0;t<256;t++){for(var r=t,n=0;n<8;n++)r=1&r?3988292384^r>>>1:r>>>1;e[t]=r}return e})();t.exports=function(e,t,r,n){var i=o,a=n+r;e^=-1;for(var s=n;s>>8^i[255&(e^t[s])];return-1^e}},{}],46:[function(e,N,t){var o,f=e("../utils/common"),h=e("./trees"),d=e("./adler32"),c=e("./crc32"),U=e("./messages"),u=0,l=4,p=0,m=-2,L=-1,P=4,Z=2,_=8,W=9,r=286,j=30,M=19,H=2*r+1,G=15,g=3,w=258,b=w+g+1,v=42,y=113,k=1,x=2,S=3,z=4;function A(e,t){return e.msg=U[t],t}function E(e){return(e<<1)-(4>>8&255,e.pending_buf[e.pending++]=255&t}function a(e,t){var r,n,i=e.max_chain_length,a=e.strstart,s=e.prev_length,o=e.nice_match,h=e.w_size-b>=2),e.lookaheadh&&0!=--i);return s<=e.lookahead?s:e.lookahead}function R(e){var t,r,n,i,a,s,o,h,u,l=e.w_size;do{if(h=e.window_size-e.lookahead-e.strstart,l+(l-b)<=e.strstart){for(f.arraySet(e.window,e.window,l,l,0),e.match_start-=l,e.strstart-=l,e.block_start-=l,t=r=e.hash_size;n=e.head[--t],e.head[t]=l<=n?n-l:0,--r;);for(t=r=l;n=e.prev[--t],e.prev[t]=l<=n?n-l:0,--r;);h+=l}if(0===e.strm.avail_in)break;if(s=e.window,o=e.strstart+e.lookahead,h=h,u=void 0,u=(a=e.strm).avail_in,r=0===(u=h=g){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<>1,o.l_buf=3*o.lit_bufsize,o.level=t,o.strategy=a,o.method=r,F(e)}o=[new s(0,0,0,0,function(e,t){var r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(R(e),0===e.lookahead&&t===u)return k;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,O(e,!1),0===e.strm.avail_out))return k;if(e.w_size-b<=e.strstart-e.block_start&&(O(e,!1),0===e.strm.avail_out))return k}return e.insert=0,t===l?(O(e,!0),0===e.strm.avail_out?S:z):(e.block_start>8&255),T(n,n.gzhead.time>>16&255),T(n,n.gzhead.time>>24&255),T(n,9===n.level?2:2<=n.strategy||n.level<2?4:0),T(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(T(n,255&n.gzhead.extra.length),T(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=c(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69):(T(n,0),T(n,0),T(n,0),T(n,0),T(n,0),T(n,9===n.level?2:2<=n.strategy||n.level<2?4:0),T(n,3),n.status=y)):(s=_+(n.w_bits-8<<4)<<8,s|=(2<=n.strategy||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(s|=32),s+=31-s%31,n.status=y,B(n,s),0!==n.strstart&&(B(n,e.adler>>>16),B(n,65535&e.adler)),e.adler=1)),69===n.status)if(n.gzhead.extra){for(i=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>i&&(e.adler=c(e.adler,n.pending_buf,n.pending-i,i)),I(e),i=n.pending,n.pending!==n.pending_buf_size));)T(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>i&&(e.adler=c(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=73)}else n.status=73;if(73===n.status)if(n.gzhead.name){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=c(e.adler,n.pending_buf,n.pending-i,i)),I(e),i=n.pending,n.pending===n.pending_buf_size)){a=1;break}}while(a=n.gzindexi&&(e.adler=c(e.adler,n.pending_buf,n.pending-i,i)),0===a&&(n.gzindex=0,n.status=91)}else n.status=91;if(91===n.status)if(n.gzhead.comment){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=c(e.adler,n.pending_buf,n.pending-i,i)),I(e),i=n.pending,n.pending===n.pending_buf_size)){a=1;break}}while(a=n.gzindexi&&(e.adler=c(e.adler,n.pending_buf,n.pending-i,i)),0===a&&(n.status=103)}else n.status=103;if(103===n.status&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&I(e),n.pending+2<=n.pending_buf_size&&(T(n,255&e.adler),T(n,e.adler>>8&255),e.adler=0,n.status=y)):n.status=y),0!==n.pending){if(I(e),0===e.avail_out)return n.last_flush=-1,p}else if(0===e.avail_in&&E(t)<=E(r)&&t!==l)return A(e,-5);if(666===n.status&&0!==e.avail_in)return A(e,-5);if(0!==e.avail_in||0!==n.lookahead||t!==u&&666!==n.status){var s=2===n.strategy?((e,t)=>{for(var r;;){if(0===e.lookahead&&(R(e),0===e.lookahead)){if(t===u)return k;break}if(e.match_length=0,r=h._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(O(e,!1),0===e.strm.avail_out))return k}return e.insert=0,t===l?(O(e,!0),0===e.strm.avail_out?S:z):e.last_lit&&(O(e,!1),0===e.strm.avail_out)?k:x})(n,t):3===n.strategy?((e,t)=>{for(var r,n,i,a,s=e.window;;){if(e.lookahead<=w){if(R(e),e.lookahead<=w&&t===u)return k;if(0===e.lookahead)break}if(e.match_length=0,g<=e.lookahead&&0>8&255),T(n,e.adler>>16&255),T(n,e.adler>>24&255),T(n,255&e.total_in),T(n,e.total_in>>8&255),T(n,e.total_in>>16&255),T(n,e.total_in>>24&255)):(B(n,e.adler>>>16),B(n,65535&e.adler)),I(e),0=g;){for(n=r.strstart,i=r.lookahead-(g-1);r.ins_h=(r.ins_h<>>=n=r>>>24,k-=n,0===(n=r>>>16&255))c[d++]=65535&r;else{if(!(16&n)){if(0==(64&n)){r=x[(65535&r)+(y&(1<>>=n,k-=n),k<15&&(y+=l[u++]<>>=n=r>>>24,k-=n,!(16&(n=r>>>16&255))){if(0==(64&n)){r=S[(65535&r)+(y&(1<>>=n,k-=n,(n=d-p)>3)<<3))-1,e.next_in=u-=i,e.next_out=d,e.avail_in=u>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function a(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new T.Buf16(320),this.work=new T.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function s(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=Z,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new T.Buf32(n),t.distcode=t.distdyn=new T.Buf32(i),t.sane=1,t.back=-1,L):P}function o(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,s(e)):P}function h(e,t){var r,n;return!e||!e.state||(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15>>8&255,r.check=R(r.check,E,2,0),l=u=0,r.mode=2;else if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&u)<<8)+(u>>8))%31)e.msg="incorrect header check",r.mode=30;else if(8!=(15&u))e.msg="unknown compression method",r.mode=30;else{if(l-=4,k=8+(15&(u>>>=4)),0===r.wbits)r.wbits=k;else if(k>r.wbits){e.msg="invalid window size",r.mode=30;break}r.dmax=1<>8&1),512&r.flags&&(E[0]=255&u,E[1]=u>>>8&255,r.check=R(r.check,E,2,0)),l=u=0,r.mode=3;case 3:for(;l<32;){if(0===o)break e;o--,u+=n[a++]<>>8&255,E[2]=u>>>16&255,E[3]=u>>>24&255,r.check=R(r.check,E,4,0)),l=u=0,r.mode=4;case 4:for(;l<16;){if(0===o)break e;o--,u+=n[a++]<>8),512&r.flags&&(E[0]=255&u,E[1]=u>>>8&255,r.check=R(r.check,E,2,0)),l=u=0,r.mode=5;case 5:if(1024&r.flags){for(;l<16;){if(0===o)break e;o--,u+=n[a++]<>>8&255,r.check=R(r.check,E,2,0)),l=u=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((c=o<(c=r.length)?o:c)&&(r.head&&(k=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),T.arraySet(r.head.extra,n,a,c,k)),512&r.flags&&(r.check=R(r.check,n,c,a)),o-=c,a+=c,r.length-=c),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===o)break e;for(c=0;k=n[a+c++],r.head&&k&&r.length<65536&&(r.head.name+=String.fromCharCode(k)),k&&c>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=12;break;case 10:for(;l<32;){if(0===o)break e;o--,u+=n[a++]<>>=7&l,l-=7&l,r.mode=27;else{for(;l<3;){if(0===o)break e;o--,u+=n[a++]<>>=1)){case 0:r.mode=14;break;case 1:I=O=void 0;var I,O=r;if(H){for(j=new T.Buf32(512),M=new T.Buf32(32),I=0;I<144;)O.lens[I++]=8;for(;I<256;)O.lens[I++]=9;for(;I<280;)O.lens[I++]=7;for(;I<288;)O.lens[I++]=8;for(F(N,O.lens,0,288,j,0,O.work,{bits:9}),I=0;I<32;)O.lens[I++]=5;F(U,O.lens,0,32,M,0,O.work,{bits:5}),H=!1}if(O.lencode=j,O.lenbits=9,O.distcode=M,O.distbits=5,r.mode=20,6!==t)break;u>>>=2,l-=2;break e;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=30}u>>>=2,l-=2}break;case 14:for(u>>>=7&l,l-=7&l;l<32;){if(0===o)break e;o--,u+=n[a++]<>>16^65535)){e.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&u,l=u=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(c=r.length){if(0===(c=h<(c=o>>=5,l-=5,r.ndist=1+(31&u),u>>>=5,l-=5,r.ncode=4+(15&u),u>>>=4,l-=4,286>>=3,l-=3}for(;r.have<19;)r.lens[C[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,S={bits:r.lenbits},x=F(0,r.lens,0,19,r.lencode,0,r.work,S),r.lenbits=S.bits,x){e.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have>>16&255,w=65535&A,!((_=A>>>24)<=l);){if(0===o)break e;o--,u+=n[a++]<>>=_,l-=_,r.lens[r.have++]=w;else{if(16===w){for(z=_+2;l>>=_,l-=_,0===r.have){e.msg="invalid bit length repeat",r.mode=30;break}k=r.lens[r.have-1],c=3+(3&u),u>>>=2,l-=2}else if(17===w){for(z=_+3;l>>=_)),u>>>=3,l=l-_-3}else{for(z=_+7;l>>=_)),u>>>=7,l=l-_-7}if(r.have+c>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=30;break}for(;c--;)r.lens[r.have++]=k}}if(30===r.mode)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,S={bits:r.lenbits},x=F(N,r.lens,0,r.nlen,r.lencode,0,r.work,S),r.lenbits=S.bits,x){e.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,S={bits:r.distbits},x=F(U,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,S),r.distbits=S.bits,x){e.msg="invalid distances set",r.mode=30;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(6<=o&&258<=h){e.next_out=s,e.avail_out=h,e.next_in=a,e.avail_in=o,r.hold=u,r.bits=l,D(e,d),s=e.next_out,i=e.output,h=e.avail_out,a=e.next_in,n=e.input,o=e.avail_in,u=r.hold,l=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;g=(A=r.lencode[u&(1<>>16&255,w=65535&A,!((_=A>>>24)<=l);){if(0===o)break e;o--,u+=n[a++]<>b)])>>>16&255,w=65535&A,!(b+(_=A>>>24)<=l);){if(0===o)break e;o--,u+=n[a++]<>>=b,l-=b,r.back+=b}if(u>>>=_,l-=_,r.back+=_,r.length=w,0===g){r.mode=26;break}if(32&g){r.back=-1,r.mode=12;break}if(64&g){e.msg="invalid literal/length code",r.mode=30;break}r.extra=15&g,r.mode=22;case 22:if(r.extra){for(z=r.extra;l>>=r.extra,l-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;g=(A=r.distcode[u&(1<>>16&255,w=65535&A,!((_=A>>>24)<=l);){if(0===o)break e;o--,u+=n[a++]<>b)])>>>16&255,w=65535&A,!(b+(_=A>>>24)<=l);){if(0===o)break e;o--,u+=n[a++]<>>=b,l-=b,r.back+=b}if(u>>>=_,l-=_,r.back+=_,64&g){e.msg="invalid distance code",r.mode=30;break}r.offset=w,r.extra=15&g,r.mode=24;case 24:if(r.extra){for(z=r.extra;l>>=r.extra,l-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===h)break e;if(r.offset>(c=d-h)){if((c=r.offset-c)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=30;break}p=c>r.wnext?(c-=r.wnext,r.wsize-c):r.wnext-c,c>r.length&&(c=r.length),m=r.window}else m=i,p=s-r.offset,c=r.length;for(h-=c=hc?(m=B[R+s[b]],C[I+s[b]]):(m=96,0),h=1<<(p=w-S),v=u=1<>S)+(u-=h)]=p<<24|m<<16|_|0,0!==u;);for(h=1<>=1;if(E=0!==h?(E&h-1)+h:0,b++,0==--O[w]){if(w===y)break;w=t[r+s[b]]}if(k>>7)]}function i(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function F(e,t,r){e.bi_valid>n-r?(e.bi_buf|=t<>n-e.bi_valid,e.bi_valid+=r-n):(e.bi_buf|=t<>>=1,r<<=1,0<--t;);return r>>>1}function j(e,t,r){for(var n,i=new Array(A+1),a=0,s=1;s<=A;s++)i[s]=a=a+r[s-1]<<1;for(n=0;n<=t;n++){var o=e[2*n+1];0!==o&&(e[2*n]=W(i[o]++,o))}}function M(e){for(var t=0;t>1;1<=r;r--)U(e,a,r);for(i=h;r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],U(e,a,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,a[2*i]=a[2*r]+a[2*n],e.depth[i]=(e.depth[r]>=e.depth[n]?e.depth[r]:e.depth[n])+1,a[2*r+1]=a[2*n+1]=i,e.heap[1]=i++,U(e,a,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1];for(var l,f,d,c,p,m=e,_=t.dyn_tree,g=t.max_code,w=t.stat_desc.static_tree,b=t.stat_desc.has_stree,v=t.stat_desc.extra_bits,y=t.stat_desc.extra_base,k=t.stat_desc.max_length,x=0,S=0;S<=A;S++)m.bl_count[S]=0;for(_[2*m.heap[m.heap_max]+1]=0,l=m.heap_max+1;l>=7;s{for(var t=4093624447,r=0;r<=31;r++,t>>>=1)if(1&t&&0!==e.dyn_ltree[2*r])return l;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return f;for(r=32;r{var t;for(Y(e,e.dyn_ltree,e.l_desc.max_code),Y(e,e.dyn_dtree,e.d_desc.max_code),L(e,e.bl_desc),t=_-1;3<=t&&0===e.bl_tree[2*x[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t})(e),(a=e.static_len+3+7>>>3)<=(i=e.opt_len+3+7>>>3)&&(i=a)):i=a=r+5,r+4<=i&&-1!==t)J(e,t,r,n);else if(4===e.strategy||a===i)F(e,2+(n?1:0),3),X(e,S,E);else{F(e,4+(n?1:0),3);var o,h=e,t=e.l_desc.max_code+1,r=e.d_desc.max_code+1,u=s+1;for(F(h,t-257,5),F(h,r-1,5),F(h,u-4,4),o=0;o>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(I[r]+c+1)]++,e.dyn_dtree[2*D(t)]++),e.last_lit===e.lit_bufsize-1},e._tr_align=function(e){F(e,2,3),N(e,g,S),16===(e=e).bi_valid?(i(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):8<=e.bi_valid&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}},{"../utils/common":41}],53:[function(e,t,r){t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}]},{},[10])(10)}),(e=>{"object"==typeof exports?module.exports=e():"function"==typeof define&&define.amd?define(e):"undefined"!=typeof window?window.JSZipUtils=e():"undefined"!=typeof global?global.JSZipUtils=e():"undefined"!=typeof self&&(self.JSZipUtils=e())})(function(){return function n(i,a,s){function o(r,e){if(!a[r]){if(!i[r]){var t="function"==typeof require&&require;if(!e&&t)return t(r,!0);if(h)return h(r,!0);throw new Error("Cannot find module '"+r+"'")}e=a[r]={exports:{}};i[r][0].call(e.exports,function(e){var t=i[r][1][e];return o(t||e)},e,e.exports,n,i,a,s)}return a[r].exports}for(var h="function"==typeof require&&require,e=0;e{try{return new window.ActiveXObject("Microsoft.XMLHTTP")}catch(e){}})()}:n;s.getBinaryContent=function(n,i){try{var a=o();a.open("GET",n,!0),"responseType"in a&&(a.responseType="arraybuffer"),a.overrideMimeType&&a.overrideMimeType("text/plain; charset=x-user-defined"),a.onreadystatechange=function(e){var t,r;if(4===a.readyState)if(200===a.status||0===a.status){r=t=null;try{t=s._getBinaryFromXHR(a)}catch(e){r=new Error(e)}i(r,t)}else i(new Error("Ajax error for "+n+" : "+this.status+" "+this.statusText),null)},a.send()}catch(e){i(new Error(e),null)}},t.exports=s},{}]},{},[1])(1)});var saveAs=saveAs||"undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob&&navigator.msSaveOrOpenBlob.bind(navigator)||(c=>{var p,r,m,_,g,w,a,b,v,y,e,k,n,t,i;if("undefined"==typeof navigator||!/MSIE [1-9]\./.test(navigator.userAgent))return p=c.document,r=c.URL||c.webkitURL||c,m=p.createElementNS("http://www.w3.org/1999/xhtml","a"),_=!c.externalHost&&"download"in m,g=c.webkitRequestFileSystem,w=c.requestFileSystem||g||c.mozRequestFileSystem,a=function(e){(c.setImmediate||c.setTimeout)(function(){throw e},0)},b="application/octet-stream",v=0,y=[],e=function(){for(var e=y.length;e--;){var t=y[e];"string"==typeof t?r.revokeObjectURL(t):t.remove()}y.length=0},k=function(e,t,r){for(var n=(t=[].concat(t)).length;n--;){var i=e["on"+t[n]];if("function"==typeof i)try{i.call(e,r||e)}catch(e){a(e)}}},i=function(e,t){return new n(e,t)},(t=(n=function(n,r){function i(){!u&&e||(e=l(n)),s?s.location.href=e:window.open(e,"_blank"),o.readyState=o.DONE,f()}function a(e){return function(){if(o.readyState!==o.DONE)return e.apply(this,arguments)}}var e,s,t,o=this,h=n.type,u=!1,l=function(){var e=(c.URL||c.webkitURL||c).createObjectURL(n);return y.push(e),e},f=function(){k(o,"writestart progress write writeend".split(" "))},d={create:!0,exclusive:!1};o.readyState=o.INIT,r=r||"download",_?(e=l(n),p=c.document,(m=p.createElementNS("http://www.w3.org/1999/xhtml","a")).href=e,m.download=r,(t=p.createEvent("MouseEvents")).initMouseEvent("click",!0,!1,c,0,0,0,0,0,!1,!1,!1,!1,0,null),m.dispatchEvent(t),o.readyState=o.DONE,f()):(c.chrome&&h&&h!==b&&(t=n.slice||n.webkitSlice,n=t.call(n,0,n.size,b),u=!0),g&&"download"!==r&&(r+=".download"),h!==b&&!g||(s=c),w?(v+=n.size,w(c.TEMPORARY,v,a(function(e){e.root.getDirectory("saved",d,a(function(e){function t(){e.getFile(r,d,a(function(r){r.createWriter(a(function(t){t.onwriteend=function(e){s.location.href=r.toURL(),y.push(r),o.readyState=o.DONE,k(o,"writeend",e)},t.onerror=function(){var e=t.error;e.code!==e.ABORT_ERR&&i()},"writestart progress write abort".split(" ").forEach(function(e){t["on"+e]=o["on"+e]}),t.write(n),o.abort=function(){t.abort(),o.readyState=o.DONE},o.readyState=o.WRITING}),i)}),i)}e.getFile(r,{create:!1},a(function(e){e.remove(),t()}),a(function(e){(e.code===e.NOT_FOUND_ERR?t:i)()}))}),i)}),i)):i())}).prototype).abort=function(){this.readyState=this.DONE,k(this,"abort")},t.readyState=t.INIT=0,t.WRITING=1,t.DONE=2,t.error=t.onwritestart=t.onprogress=t.onwrite=t.onabort=t.onerror=t.onwriteend=null,c.addEventListener("unload",e,!1),i.unload=function(){e(),c.removeEventListener("unload",e,!1)},i})("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||this.content),Downloader=("undefined"!=typeof module&&(module.exports=saveAs),Downloader||{}),Zipper=(Downloader.getFile=function(e){var i;return i=e,new(window.Promise||JSZip.external.Promise)(function(e,t){var r,n;r=e,n=t,JSZipUtils.getBinaryContent(i,function(e,t){e?n(e):r(t)})})},{zip:new JSZip}),UserInterface=(Zipper.createZip=function(t){var r;JSZip.support.blob?(Files.all.map(function(e){r=e.replace(/.*\//g,""),Zipper.zip.file(r,t.getFile(e),{binary:!0})}),Zipper.zip.generateAsync({type:"blob"}).then(function(e){saveAs(e,"files.zip")},function(e){console.log(e)})):console.log("Blob is not supported")},{selector:"a[href=download]"});UserInterface.setup=function(e,t){var r,n=function(){e.createZip(t)};(r=document.body.querySelector(UserInterface.selector))&&r.addEventListener("click",function(e){e.preventDefault(),n()},!1)},UserInterface.setup(Zipper,Downloader); //# sourceMappingURL=downloader-bundle.js.map diff --git a/js/lesson1/tutorial.md b/js/lesson1/tutorial.md index 38daf5e9..e616934d 100644 --- a/js/lesson1/tutorial.md +++ b/js/lesson1/tutorial.md @@ -11,40 +11,33 @@ JavaScript is a programming language that runs in all modern web browsers. It is used to change what is displayed on a web page in response to user activity. -This tutorial will give you your first introduction to JavaScript. It -barely scratches the surface of all the things that you can do - this -one is intended to be just enough for you to understand our next -tutorials that do more interesting things. - -Some words in programming have special meanings. We're going to take -some time during this tutorial to explain what some of the most -commonly used words mean. Words which mean a specific thing will be -marked in **bold**. Try to remember them, because it's important for -you to understand what other programmers mean when they use these -words, and what the documentation means when you read it. You can -always look back at this tutorial later to remind yourself. +This tutorial is intended to give you a very brief introduction to JavaScript. It +barely scratches the surface of all the things that you can do with it - it is enough for you to understand our next tutorials that do more interesting things. + +Most words in programming have special meanings. We're going to take +some time during this tutorial to explain what some of the commonly used words mean. Words which mean a specific thing will be marked in **bold**. Try to remember them, as it's important for you to understand what other programmers mean when they use them, and what the documentation means when you read it. You can always look back at this tutorial later to remind yourself. ## Getting started Download the files required to begin working through the tutorial from [here](https://gist.github.com/despo/0b674ec9d5ae9cb09704/download). -We recommend that you use chrome for this tutorial, as the +We recommend that you use Chrome for this tutorial, as the instructions are written to match it closely, but you should be able to do all the same things in any web browser. We've given you two files. One is `script.js`, which you should open in your text editor. This is where you're going to write your code. The other is `index.html`, which you should open in your web -browser. This is a very short file that just tells your browser to run +browser. This is a very small file that tells your browser to run the code in `script.js`. For this tutorial, you will also need to open the console. In Google Chrome, use `Ctrl + Shift + J` on Windows/Linux -or `Alt + Cmd + I` on Mac. The console should look something like this: +or `Alt + Cmd + I` on Mac. You can also right click with your mouse and press "Inspect". The console should look something like this: -console example +google chrome console example -The console can appear in several different places. Below is the example of two of them: "docked to bottom", and "docked to right". You can change the location of the console by clicking on the three vertical dots located next to the cross (clicking on the cross will close the console). Their locations are indicated on the picture below. +The console can appear in several different places. Below is the example of two of them, the first "docked to bottom", and the second "docked to right". You can change the location of the console by clicking on the three vertical dots located next to the cross (clicking on the cross will close the console). Their locations are indicated on the picture below. console locations @@ -82,7 +75,7 @@ Let's move on to writing code in a file. Type the same `console.log` line into your `script.js` file. Save and reload the page in your browser so that it can read the change you made. -This time, you should just see the line that says `Hello!`, and not +This time, you should only see the line that says `Hello!` in the browser console, and not the lines that said `console.log('Hello!');` or `undefined` with arrows next to them. That's because you didn't type the JavaScript into the console this time. @@ -113,17 +106,21 @@ expression. As you've just seen, the value of `1` is just `1`, and the value of two numbers with a `+` sign between them is those two numbers added together. -We want to do things with words as well as numbers. A value containing -letters is a **string**, and you write it in quotes. Try typing -`'Hello'` on the console. Like before, you'll see it repeated back to -you. + +> Now that you've learnt how to do some simple maths, why not try out some more examples in your console? + + +On websites however, we don't just see numbers so we want to do things with words too. A value containing letters is a **string**, and you write it in quotes. Try typing +`'Hello'` on the console. Like before, you'll see it repeated back to you. Try `'Hello' + 'there'`. You should see it combine the two strings into one. The value of two strings with a `+` sign between them is -those two strings concatenated. You'll also see that it's missing a +those two strings **concatenated**. You'll also see that it's missing a space - can you fix that? -Try typing `Hello` without any quotes around it. See how you just get +> Now that you've learnt how to concatenate 2 strings, trying practising more so you become more comfortable with it + +Try typing `Hello` without any quotes around it. See how you get an error about `Hello` not being defined? Words that are not wrapped in quotes are not strings. There's a couple of things that they could be, which we'll discuss later, but the important thing to remember for @@ -147,13 +144,11 @@ Try typing this on the console: var a = 17; ``` -You'll see that it returns the value as `undefined`. undefined just +You'll see that it returns the value as `undefined`, undefined means that the thing you typed doesn't really have a value. However, this did something else: it created a **variable** named `a`. -Now try typing `a` on the console. You should see that you get back -17. Variables are a way of giving names to **values** so that you can -use them later. +Now try typing `a` on the console. You should see that you get back 17. Variables are a way of giving names to **values** so that you can use them later. Try typing these: @@ -175,7 +170,7 @@ You can also change the value of a variable. That's why it's a b = 2; ``` -Notice that you don't have `var` this time. If you just have a +Notice that you don't have `var` this time. If you have a variable name, an equals sign, and an expression, then this is a **variable assignment**, which changes the value of a variable that you defined earlier. @@ -245,7 +240,7 @@ again. Let's move some of this into `script.js`. We wrote the function definition all on one line because that's all the space you have in -the console, but the normal way to write one is like this: +the console, but the typical way to write a function is like this: ```js function sayHello() { @@ -253,7 +248,7 @@ function sayHello() { } ``` -Put that into `script.js` and reload the page. Now just try calling +Put that into `script.js` and reload the page. Now try calling the `sayHello` function on the console, without doing anything else. You should see that it still works, using the definition that you put into `script.js`. @@ -270,7 +265,7 @@ function conversation() { Try calling the `conversation()` function on the console. See how it did all three things in order? Functions are lists of things to -do. When you call the function, it does all the things in its +do. When you call the function, it will do all the things in its definition. Let's get a few words for these things before we move on: @@ -306,10 +301,9 @@ function sayHello(person) { Now try calling it using `sayHello('Archibald')`. -That probably isn't your name. Try calling the function again using -your own name. +> Try calling the function again using your own name? -What you've done here is to add a **parameter** to the function. When +What you've done here is added a **parameter** to the function. When you call the function, you put a string between the parentheses. In the definition, you put the word `person` between the parentheses. While the function runs, `person` is defined to be a new @@ -340,7 +334,7 @@ far, this one has a value. `return` is another **keyword**: it means "return the value of this expression from this function". The value of a **function call** is the value that was given to `return`. If the function got to the end -without ever seeing `return` then the value of the call will just be +without ever seeing `return` then the value of the call will be `undefined`. Now change your `sayHello` function to use this new `greeting` @@ -349,9 +343,8 @@ function, instead of having the message in it. Check that ## Multiple function parameters -Functions can have as many parameters as you want. You separate them -with commas. Try changing the first line of the definition of -`conversation` to be: +Functions can have as many parameters as you want, you separate them +with commas. Change the first line of your `conversation` function to be: ```js function conversation(person, topic) { @@ -366,7 +359,7 @@ Similarly, you call the function like this: conversation('Archibald', 'owls'); ``` -Try it out for yourself. +> Try it out for yourself. ### What you've learned so far @@ -396,18 +389,17 @@ console.log( ); ``` -Use spaces and newlines to make your program easy to read. When you're -just starting out, it won't be immediately clear to you what makes -things easier to read, so just try to follow the patterns that we use -in the tutorials. As you read and write more programs this will start +Use spaces and newlines to make your code easier to read. When you're +starting out, it won't be immediately clear to you what makes +things easier to read, so try to follow the patterns that we use +in the tutorials. As you write more code this will start to make sense to you. ### Semicolons Semicolons are needed after any statement that does not end in a `}`. While it is sometimes possible to leave out semicolons and have -the program still work, this is likely to break in surprising ways, so -you should try to put them in the right places. +the program still work, we suggest doing this when learning to make it more readable. One important exception to these rules is the `return` statement. You may not add a newline immediately after the word `return`, because if @@ -437,8 +429,7 @@ We apologise for this quirk of the language. ## Objects -Another type of **value** is an **object**. A way to create an object -is like this: +Another type of **value** in JavaScript is an **object**. An object looks like this: ```js var person = { @@ -515,7 +506,7 @@ return to them in a later tutorial. ## Summary -You now know what all of these words mean: +You should now be familiar with these words and what they mean: * strings * expressions diff --git a/js/lesson2/tutorial.md b/js/lesson2/tutorial.md index 77501305..7d11a65f 100644 --- a/js/lesson2/tutorial.md +++ b/js/lesson2/tutorial.md @@ -42,7 +42,7 @@ var person = { console.log('Hello ' + person.first_name + '!'); ``` -We're going to introduce one more important type: **booleans**. A +We are now going to introduce one more important type: **booleans**. A boolean can only be `true` or `false`, for example: ```js @@ -84,7 +84,7 @@ console.log('Division: x / y = ' + division); // Division: x / y = 2 #### More maths -Other basic but useful math operators are `%`, `**`, `++` and `--`: +Other useful math operators are `%`, `**`, `++` and `--`: > The modulus `%` operator returns the remainder when dividing one operand by another. @@ -137,8 +137,7 @@ console.log('Apples and oranges are different: ' + notEqual); ``` > You may also see `==` and `!=`, these are similar but have some quirks so it's generally recommended to avoid them. -> You can just use `===` and `!==` and they will -> always do what you expect. +> It is safer to use `===` and `!==` as they will always do what you expect. The `>` and `<` operators are "greater than" and "less than". You can use them to tell which of two numbers is bigger. @@ -155,6 +154,7 @@ var lessStudents = students < pizzas; console.log('Are there fewer students than pizzas?' + lessStudents); ``` +> Play around with changing the `coaches`, `students` and `pizzas` variable numbers to familiarise yourself with operators. You can also combine operators. @@ -177,6 +177,8 @@ if (codebarIsAwesome) { } ``` +> Change the `codebarIsAwesome` variable to false, what happens now? + You can use an expression inside an if statement. ```js @@ -205,6 +207,24 @@ if (totalPeople > pizzas) { } ``` +#### Ternaries - Additional learning + +You may also see if/else statements written slightly differently. + +The condition followed by a question mark (?), then an expression to execute if the condition is truthy followed by a colon (:) and finally the expression to execute if the condition is falsy. + +```js +condition ? expression1 : expression2 +``` + +Using the people and pizza example we wrote above and using the Ternary Operator instead of if/else it would look like this: + +```js +totalPeople > pizzas + ? console.log('We have more people than pizzas.') + : console.log('We have waaay too much pizza. That can never be bad! :)') +``` + ## Loops A loop is used to execute a set of statements repeatedly until a condition is met. @@ -219,9 +239,9 @@ while (test) { } ``` -When the while loop starts, the test is checked. If it is false, then the while loop is skipped. If the test is true, then just like an `if` block the statements in the curly braces are executed. +When the while loop starts, the test is checked. If it is false, then the while loop is skipped. If the test is true, then like an `if` block the statements in the curly braces are executed. -The difference is in what happens after the statements in the block. With an `if`, everything is finished and the statements below the if block are executed. With a `while`, we go back up to the test. If the test is still true, the statements in the block are executed again, and so on until the test is false. This is why we call it a loop. +The difference is what happens after the statements in the block. With an `if`, everything is finished and the statements below the if block are executed. With a `while`, we go back up to the test. If the test is still true, the statements in the block are executed again, and so on until the test is false. This is why we call it a loop. For example, if we wanted to set a timer on an online ticket outlet, we could count the timer down and while it hasn't reached zero, the option to buy the ticket could still be available. @@ -263,7 +283,7 @@ for (/* before loop starts */; /* test before each iteration */; /* after each i The stuff in the round brackets is split into three parts by `;`. The first part is used once, before the loop begins. It's a good place to set an initial value for a counter (like `x = 1` in the `while` loop example). -The second part is a test, and just like in the `while` loop it is checked before each iteration. +The second part is a test, and like in the `while` loop it is checked before each iteration. The third part is executed after each loop iteration. It's useful for incrementing the loop counter. @@ -283,13 +303,13 @@ console.log('Total: ' + total); ``` > Another way to write the for loop is `for (var i = 1; i <= 10; i++)`. The `i++` is a short way of writing "increase i by one". -Even though `while` loops are more simple than `for` loops, it is more common to see `for` loops. This is because loops are often used to do something with arrays, which are introduced in the next section. +Even though `while` loops are simpler than `for` loops, it is more common to see `for` loops. This is because loops are often used to do something with arrays, which are introduced in the next section. ## Arrays An array is a simple *data structure*. It can hold a list of elements of the same or different types (e.g. strings, numbers, booleans). In an array each element can be accessed using the **index**. -It may be a bit confusing, but the first index of an array is 0, not 1. +Confusingly, the first index of an array in JavaScript is 0, not 1. To understand this better, let's create an array of strings. @@ -304,6 +324,8 @@ To retrieve an item from the array, we use **square bracket notation** To get the first item `animals[0]`, the second `animals[1]` etc. +> Create an array that includes 5 names and then access the 3rd item in the array. (don't forget to access the third item in the array you won't be doing [3]) + ### Properties - `length` The `length` property returns the size of the array @@ -341,7 +363,7 @@ var animals = ['dog', 'cat', 'rabbit', 'horse', 'elephant', 'monkey']; animals.unshift('cow'); animals.push('zebra'); -console.log(animals); +console.log(animals); // Expected output: ['cow', 'dog', 'cat', 'rabbit', 'horse', 'elephant', 'monkey', 'zebra'] ``` @@ -580,3 +602,7 @@ Modify the JavaScript file we used in the first part of the lesson, and its HTML --- This ends our **Beginning JavaScript**. Is there something you don't understand? Try and go through the provided resources with your coach. If you have any feedback, or can think of ways to improve this tutorial [send us an email](mailto:feedback@codebar.io) and let us know. + +### Further Learning + +If you want to learn how to Build a Random Phrase Generator in JavaScript, then watch this video on our [YouTube](https://youtu.be/PIEALPH8CE0). diff --git a/js/lesson4/tutorial.md b/js/lesson4/tutorial.md index a2fa3362..0a95b861 100644 --- a/js/lesson4/tutorial.md +++ b/js/lesson4/tutorial.md @@ -1,15 +1,14 @@ --- layout: page -title: HTTP Requests, AJAX and APIs +title: HTTP Requests and APIs --- ### Objectives In this tutorial we are going to look at: -* The HTTP protocol +* HTTP Requests * APIs -* AJAX * JSON * Loading API data into web pages * Using jQuery AJAX functionality @@ -18,36 +17,27 @@ In this tutorial we are going to look at: By the end of this tutorial you will have built: -* A webpage that can retrieve information about a specified GitHub user -* A webpage that can show the upcoming schedule for BBC shows +* A webpage that can retrieve information from a GitHub user -# HTTP Requests +## HTTP Requests -## What are HTTP Requests? +### What are HTTP Requests? -Every time the browser fetches data from a server (which could be a page, an image, a script etc) it does it using HTTP. HTTP is the **H**​yperText **T**​ransport **P**​rotocol. The server then sends back a **response**. An API is an easy way of fetching information from a remote service, in a way that's easy for a computer to understand. +**H**​yperText **T**​ransport **P**​rotocol -GitHub offers a [simple API](https://www.githubstatus.com/api/) for viewing its current and historical server availability. +Every time the browser fetches data from a server (which could be a page, an image, a script etc) it does it using HTTP. The server then sends back a **response**. An API is an easy way of fetching information from a remote service, in a way that a computer can understand, typically in **JSON** format (we'll talk more about JSON later). -> Availability means whether or not the GitHub website was accessible to users and accepting traffic. If your website is down, it is not available. +GitHub offers a [simple API](https://www.githubstatus.com/api/) for viewing its current and historical server availability. Availability means whether or not the GitHub website was accessible to users and accepting traffic. If your website is down, it is not available. -You can access an API in your web browser. Just pop the following into the address bar: +You can access an API in your web browser. Pop the following into the address bar: https://www.githubstatus.com/api/v2/summary.json -If you are on a mac or a linux/unix machine, you can access the API using curl: - - curl https://www.githubstatus.com/api/v2/summary.json - -> Paste the following command into Terminal, which you can find in Finder - first go into the Applications folder, then Utilities. - -Here is an example of the **GET** requests issued by the [wishlist tutorial](https://tutorials.codebar.io/examples/wishlist/index.html). - -\*You can view any requests issued by a website by going to the Network (or Net) tab. +You can view all requests issued by a website by going to the Network (or Net) tab. ![](assets/images/inspector_requests.png) -As part of the response, a request gives back a **status code**. You can use this to identify if the request was successful or not. +As part of the response, a request gives back a **status code**. You can use this to identify if the request was successful or not. Below is a list of the most common status codes. | Status code | Message | Description | | ------------| ------- | ------------ | @@ -56,23 +46,17 @@ As part of the response, a request gives back a **status code**. You can use thi | 400 | Bad Request | The server did no understand the request | | 404 | Not Found | The server could not find the requested resource | -### HTTP Verbs +### HTTP Methods -HTTP verbs are sent by the browser or client, and along with the URL used and data transmitted form part of the instruction to the API. There are several verbs, but in this tutorial we will be primarily using GET. GET is used to fetch information from an API. Another common verb is POST, which is used to create a new object on the remote service. +There are several HTTP Methods, but in this tutorial we will primarily be using **GET** and **POST**. GET is used to request data from your specified API, whereas POST is used to send data to your specified API. ## Exercise 1 - Retrieve GitHub user information -We'll build a small application that gives us back information about a GitHub user - we want to show their username, information and their picture. [Download](https://gist.github.com/deniseyu/d1bc03b8091153b4b1a7/download) the exercise files or clone them directly from Github `https://gist.github.com/deniseyu/d1bc03b8091153b4b1a7` - -GitHub offers an API where you can request information for a given username. The verb to use is GET, and the url is `https://api.github.com/users/`. For codebar, this would be: `https://api.github.com/users/codebar`. Again, to request this you can use curl: +We are going to build a small application that requests information about a GitHub user - we want to show their username, information and picture. - $ curl -XGET https://api.github.com/users/codebar +> Take a second to think about what HTTP Method we will use to retrieve this data. Is it GET or POST? -or, as GET is the default verb, just: - - $ curl https://api.github.com/users/codebar - -Again, you can simply access this URL in your web browser by inserting `https://api.github.com/users/codebar` into the address bar. +If you guessed GET congrats! Now let's retrieve some data. See what happens when you put `https://api.github.com/users/codebar` into your address bar. The response will look something like the JSON data below, which we have shortened: @@ -96,8 +80,12 @@ The response will look something like the JSON data below, which we have shorten This data is what's called key value pairs, meaning that the name of the field is displayed immediately before the value. As you can see, the URL for the avatar (user's icon) is in the `avatar_url` field, and is `https://avatars.githubusercontent.com/u/9906?v=2`. +> Run the same URL but with your GitHub name. + ### Getting started +Now [Download](https://gist.github.com/deniseyu/d1bc03b8091153b4b1a7/download) the exercise files or clone them directly from Github `https://gist.github.com/deniseyu/d1bc03b8091153b4b1a7`. + First, open the HTML page supplied in the download. As you can see, there is a box to type in a username. When the user has typed in the username, they should be able to trigger the API call to GitHub by pressing \. The following code allows you to listen for a keypress on the input field, and to see if it was the \ key that was pressed. @@ -147,13 +135,13 @@ function getGithubInfo(username) { We create an `XMLHttpRequest` object and then call the `open` method, passing three arguments to the GitHub API. -1. the `verb` - in this case, `'GET'` +1. the `method` - in this case, `'GET'` 2. the `url` - in this case the url eg https://api.github.com/users/codebar 3. whether or not to run this request synchronously or asynchronously. In this case, we'll specify synchronously by passing `false`. This means the browser will wait for the call to the GitHub API to finish before continuing. -> Making requests synchronously is not good practice, but we're doing it for now to keep things simple. Your browser may show a deprecation warning but the request will still work. We'll move onto asynchronous requests further down once we have the basics of APIs covered. +Making requests synchronously is not good practice, but we're doing it for now to keep things simple. Your browser may show a deprecation warning but the request will still work. We'll move onto asynchronous requests further down once we have the basics of APIs covered. You can now call `getGithubInfo`, passing the username, from the `keypress` block above. That will log the data to the console. Next, we need to pass this back to the web page via the DOM. @@ -227,214 +215,10 @@ Well done, you've finished! For a bonus, switch your `getGithubInfo` method to r > Coach... explain the difference between synchronous and asynchronous requests. There's a good explanation on [Mozilla Developer Network (MDN)](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Synchronous_and_Asynchronous_Requests) +### Further Learning -## ~~Exercise 2 - BBC's tomorrow's TV schedule~~ - -![](https://cdn0.iconfinder.com/data/icons/shift-free/32/Error-128.png) - -**Part 2 of this exercise is no longer possible as the API that it uses has been taken down by the BBC.** -**Sorry, we're working on fixing the exercise!** - -[Download](https://gist.github.com/despo/05cab2f0b38bc02318e7/download) the exercise files or clone them directly from github `git clone https://gist.github.com/05cab2f0b38bc02318e7.git` - -For the second exercise, we will build an application that retrieves tomorrow's TV schedule for each genre using BBC's API. - -### What we will be doing: - -1. Retrieve and render available genres using `http://www.bbc.co.uk/tv/programmes/genres.json` - -2. Write a function that retrieves tomorrow's TV schedule using a genre `http://www.bbc.co.uk/tv/programmes/genres//schedules/tomorrow.json` - -3. Write a function that displays each programme - -4. **Bonus** Retrieve all upcoming episodes of a programme - -### Request using jQuery - -This time, let's use jQuery's `ajax()` method. Things are a bit easier when using jQuery as we can create different code blocks that handle successful or failed requests. - -Also, jQuery isolates us from the differences between browser implementations of AJAX calls (for example, if we wanted to make the previous AJAX call work in Internet Explorer, we will have to write [a much longer method](http://www.tutorialspoint.com/ajax/ajax_browser_support.htm)!) - -```js -$.ajax({ - url: request_url, - dataType: 'json', - beforeSend: function() { - // do something before running the request - } -}).done(function(data) { - // process data -}).fail(function() { - // code -}).always(function() { - // code that runs regardless of request succeeding or failing -}); -``` - -`datatype` defines the type of result we will be getting back. This avoids us having to parse the response to JSON. - -`beforeSend` can be used if we need to perform something before running the request. - -`.done()` handles a response that returns a success status code - -`.fail()` is called when the request fails - - -## Retrieving and displaying all available genres - -Write a function `retrieveGenres()` that does an AJAX call to the API. - -```javascript -function retrieveGenres() { - // AJAX call using jQuery that retrieve and process the result -} -``` -> Try logging the resulted data and have a look in the console to see and explore the created objects - -> `` is the genre format we need to retrieve results from the API - -> You can use `` to display a humanly readable format of the Genre - -As you can see from the console, the resulting objects are returned inside an Array. We want to iterate over the list using the native Array `forEach( )` function and add each item to the `#genres` list, as a **list item**. As we need to have access to the `key` as well, we can set that as the list item's `id`. - -Now that we have all the available genres, we can move on to making calls to the API using the genre to retrieve tomorrow's schedule!! - -## Retrieve schedule - -Now, let's create a function that retrieves films using genre. - -```javascript -function getTomorrowsSchedule(genre) { - // call to retrieve TV schedule -} -``` - -The response you get back should look similar to this, with multiple objects in the broadcasts array. - -```json -{ - "broadcasts": [ - { - "is_repeat": false, - "is_blanked": false, - "schedule_date": "2014-01-15", - "start": "2014-01-15T00:10:00Z", - "end": "2014-01-15T01:50:00Z", - "duration": 6000, - "service": { - "type": "tv", - "id": "bbc_one", - "key": "bbcone", - "title": "BBC One", - "outlets": [ - { - "id": "bbc_one_wales", - "key": "wales", - "title": "Wales" - }, - { - "id": "bbc_one_wales_hd", - "key": "wales_hd", - "title": "Wales HD" - } - ] - }, - "programme": { - "type": "episode", - "pid": "b00sbk03", - "position": null, - "title": "Disturbia", - "short_synopsis": "Thriller about a high school student convinced that his neighbour is a serial killer.", - "media_type": "audio_video", - "duration": 6000, - "image": { - "pid": "p01gqbj3" - }, - "display_titles": { - "title": "Disturbia", - "subtitle": "" - }, - "first_broadcast_date": "2010-05-03T22:30:00+01:00", - "ownership": { - "service": { - "type": "tv", - "id": "bbc_three", - "key": "bbcthree", - "title": "BBC Three" - } - }, - "is_available_mediaset_pc_sd": false, - "is_legacy_media": false - } - }] - } -``` - -To process the response, we want to iterate over the `response.broadcasts` array and add each item, to `#programmes` as a list item. - -To make this a bit easier, this is how you can access the values we need: - -* `item.programme.display_titles.title` -* `item.programme.short_synopsis` -* `item.programme.image.pid` _only if `item.programme.image` is set_ -* `item.start` and `item.end` -* `item.duration` -* `item.service.title` - -It would be easier to use string concatenation to construct the html, before appending each item to the list. -Also, to make your code easier to read, try constructing the html in a method that you pass the response object. - -```javascript -function processEpisode(episode) { - var item_html = '<li>'; - item_html += '<h2>' + episode.programme.display_titles.title + '</h2>'; - // display short short synopsis - // display image - // display date and time - // display duration (HINT: the duration is in seconds, convert that to minutes) - // display the channel (or service, as its called by the API) - add this in a span with the class `service` - ... -} -``` - -> To display the date formatted correctly, you can use the `formatDate( )` function as we won't be going into details about dates in this tutorial. If you want to know how it works, try going through the code and ask your coach any questions you have. - -To display an image for a programme, we need to use `<img src=http://ichef.bbci.co.uk/images/ic/272x153/<pid>.jpg />`. As not all programmes have an image, we can use an image placeholder when no image is set `<img src='http://placehold.it/272x153' />` - -### Binding the call to the click event - -Handle a `click` event on `#genres li` and make a call to `getTomorrowsSchedule(genre)` - -### Improving our function - -To make the genre we have just clicked active, we also want to add the CSS class `active` to the element that the event has been triggered from. Don't forget to remove the class `active` from any other `#genres li` items. - -> Did you remember to commit your changes? - -### Using `beforeSend` - -Every time we issue a call to the API, we want to clear the `#programmes` list. We can do that using `empty()`. -Also, as some of the requests take a while, we want to display a spinning image `<div class='spinner'><img src='spinner.gif' /></div>`. - -> Don't forget to remove the spinner, when the request is completed successfully. - -## Bonus: Retrieving all upcoming episodes of a programme - -To get back all the upcoming shows for an episode, we need to utilise the programme pid, that we can retrieve from the response using `episode.programme.programme.pid`. The URL for the request is `http://www.bbc.co.uk/programmes/<pid>/episodes/upcoming.json` - -> **Hint:** The programme `pid` is only available if `episode.programme.position` is set. - - -```javascript -function getUpcomingEpisodes(pid) { - // AJAX call to retrieve upcoming episodes -} -``` -Since the response structure is similar to the one for retrieving tomorrow's schedule, we should be able to re-use the `processEpisode( )` function to display each item from the broadcasts array. - -Handle the `click` event to retrieve and display the upcoming episodes! +If you want to continue your learning on API's, then watch this video with Kevin Lewis over on our [YouTube](https://youtu.be/66xLBqosPog), where he'll send himself a text message using the [Vonage API](http://tutorials.codebar.io/js/lesson4a/tutorial.html). -Here is our version of the [tv schedule app](../../examples/tv-schedule/index.html). --- -This ends our **HTTP Requests, AJAX and APIs** tutorial. Is there something you don't understand? Try and go through the provided resources with your coach. If you have any feedback, or can think of ways to improve this tutorial [send us an email](mailto:feedback@codebar.io) and let us know. +This ends our **HTTP Requests and APIs** tutorial. Is there something you don't understand? Try and go through the provided resources with your coach. If you have any feedback, or can think of ways to improve this tutorial [send us an email](mailto:feedback@codebar.io) and let us know. diff --git a/js/lesson4a/assets/images/VonageLogo.png b/js/lesson4a/assets/images/VonageLogo.png new file mode 100644 index 00000000..f7410ca7 Binary files /dev/null and b/js/lesson4a/assets/images/VonageLogo.png differ diff --git a/js/lesson4a/tutorial.md b/js/lesson4a/tutorial.md new file mode 100644 index 00000000..574630f1 --- /dev/null +++ b/js/lesson4a/tutorial.md @@ -0,0 +1,27 @@ +--- +layout: page +title: API's part 2 - Send yourself an SMS with Vonage +--- + +### Goal + +By the end of this tutorial you will have: + +* Sent yourself an SMS using the Vonage API + +## Refresh + +From the previous tutorial you learnt how HTTP requests work, the different between **GET** and **POST** and status codes. If you need a refresher pop back to the previous tutorial to remind yourself. + +## Exercise - Send yourself an SMS with the Vonage API + +<img src="./assets/images/VonageLogo.png" alt="Vonage Logo" width="350px"> + +In the following Vonage API tutorial you will create an account, and send yourself an SMS. Just a heads up, it will involve you creating an account and giving your phone number. + +When signing up select NodeJS as your language. NodeJS is a runtine enviroment that allows you to run JavaScript on the server than in the browser which is what you would've been doing if you've followed our first few JavaScript tutorials. + +[Send yourself an SMS with the Vonage API](https://developer.nexmo.com/?utm_source=codebar&utm_campaign=Events&utm_medium=bitly&utm_source=Events) + +--- +This ends our sponsored Vonage tutorial **API's part 2 - Send yourself an SMS with Vonage**. Is there something you don't understand? Try and go through the provided resources with your coach. If you have any feedback, or can think of ways to improve this tutorial [send us an email](mailto:feedback@codebar.io) and let us know. diff --git a/package.json b/package.json index e4fc3cb8..e19639b3 100644 --- a/package.json +++ b/package.json @@ -7,13 +7,13 @@ }, "author": "", "devDependencies": { - "browser-sync": "^2.12.3", - "gulp": "^3.9.1", - "gulp-concat": "^2.6.0", - "gulp-sourcemaps": "^2.0.0-alpha", - "gulp-uglify": "^1.5.3" + "browser-sync": "^3.0.3", + "gulp": "^5.0.0", + "gulp-concat": "^2.6.1", + "gulp-sourcemaps": "^3.0.0", + "gulp-uglify": "^3.0.2" }, "dependencies": { - "gulp": "^3.9.1" + "gulp": "^5.0.0" } } diff --git a/php/lesson2/tutorial.md b/php/lesson2/tutorial.md index dc7485d7..a933a9cc 100644 --- a/php/lesson2/tutorial.md +++ b/php/lesson2/tutorial.md @@ -25,8 +25,7 @@ For this tutorial, we will be using the interactive mode of the PHP command-line Let's try doing nothing. You can add comments in three ways: ```php // Comment style 1 - anything after the double slash to the end of the line is ignored -# Comment style 2 - anything after the hash sign to the end of the line is ignored -/* Comment style 3 - anything to the next star and slash are ignored, can be in the middle of a +/* Comment style 2 - anything to the next star and slash are ignored, can be in the middle of a line, or be several lines long */ ``` Try these out and see absolutely nothing happen! We'll be using these on the end of our example lines to explain them and what you might see as output. You *don't* have to type out comments. @@ -113,7 +112,7 @@ Array ``` Err, wasn't expecting that? The PHP echo command has to convert values to strings to display them. Most of the time it knows what to do, but it doesn't like to second guess you so wants you to be more specific. So actually it's outputted the string `Array` and warned you with the `PHP Notice` line why it's not what you expected. We can use a `var_dump`, or a string function that can tell it how to format the array items. Here's an example: ```php -echo join(", ", [4, 5, 6]); +echo implode(", ", [4, 5, 6]); ``` This tells it to join each element in the array together with a comma, so the output becomes: ``` @@ -121,7 +120,7 @@ This tells it to join each element in the array together with a comma, so the ou ``` You don't have to have items of just one type in an array, you can mix them up. E.g: ```php -echo join(", ", ["odd", "squad", 4, true]); // displays odd, squad, 4, 1 +echo implode(", ", ["odd", "squad", 4, true]); // displays odd, squad, 4, 1 ``` #### Associative Arrays diff --git a/php/using-php/simple.md b/php/using-php/simple.md index dd7dc565..17d742b8 100644 --- a/php/using-php/simple.md +++ b/php/using-php/simple.md @@ -14,9 +14,9 @@ PHP has two main ways of operating - as a command-line tool (CLI), or as part of You should be able to try out most things in the PHP tutorials with any online PHP tool. Some are limited by whether you have full control of the HTML, or whether other features are available, like a filesystem or database. -### Using PHPFiddle +### Using PHPHub sandbox -[PHPFiddle.org](https://phpfiddle.org/) is a simple and well featured way to try out PHP. It is able to serve a full web page, and even provides MySQL database access if you set up a login. +[phphub.net/sandbox/](https://phphub.net/sandbox/) is a simple and feature-rich way to try out PHP. It even provides MySQL database access. ## Installing on your machine diff --git a/python/lesson0/tutorial.md b/python/lesson0/tutorial.md index 0e5f2914..144fc81b 100644 --- a/python/lesson0/tutorial.md +++ b/python/lesson0/tutorial.md @@ -21,7 +21,7 @@ outdated these days, so we need to upgrade: 3. Click "Downloads". 4. There will be two options; one for Python 3 and one for Python 2. **Download Python 3**. At the time of writing, the version available is - 3.8.3. + 3.14.5. 5. When the download's complete, your browser should automatically mount the disk image and open a Finder window of what's inside, but if that doesn't happen, you'll have to find the file `Python.mpkg` in your downloads folder @@ -30,7 +30,7 @@ outdated these days, so we need to upgrade: the Free software license as well as enter your administrator password. Just follow the prompts and you'll be fine. -If you get lost, have a look at this [tutorial with pictures on DiveIntoPython3](http://www.diveintopython3.net/installing-python.html#macosx). +If you get lost, have a look at this [tutorial with pictures on DiveIntoPython3](https://diveintopython3.problemsolving.io/installing-python.html#macosx). ### Windows: @@ -38,13 +38,13 @@ If you get lost, have a look at this [tutorial with pictures on DiveIntoPython3] 2. Click "Downloads". 3. There will be two options; one for Python 3 and one for Python 2. **Download Python 3**. At the time of writing, the version available is - 3.8.3. + 3.14.5. 4. Run the downloaded installer and click *Next* until you reach the *Customization* page. 5. Scroll down to the bottom and choose to *Add python.exe to PATH*. 6. Continue clicking *Next* until it's installed. -If you get lost, have a look at this [tutorial with pictures on DiveIntoPython3](http://www.diveintopython3.net/installing-python.html#windows). +If you get lost, have a look at this [tutorial with pictures on DiveIntoPython3](https://diveintopython3.problemsolving.io/installing-python.html#windows). ### Linux @@ -70,7 +70,7 @@ have to use the `scl` workaround: 4. Run `scn enable python3 /bin/bash`. This will put you into a shell that supports Python 3. -For more information on this process, take a look at [this tutorial](https://devops.profitbricks.com/tutorials/install-python-3-in-centos-7/). +For more information on this process, take a look at [this tutorial](https://devops.ionos.com/tutorials/install-python-3-on-centos-7.html). #### Arch @@ -96,7 +96,7 @@ On Windows, open `cmd` or on Mac OS / GNU/Linux open `terminal` and type What you should see is: - $ python 3.8.3 + $ python 3.14.5 On Mac OS running `python --version` might run the outdated Python 2.7 which is bundled with the operating system. If this is your case, then you need to run `python3` instead of `python`. @@ -109,7 +109,7 @@ Now, open the *REPL* by typing: And you should see something like this: - Python 3.8.3 (default, Aug 6 2016, 15:44:26) + Python 3.14.5 (default, Jun 1 2026, 15:44:26) [GCC 5.4.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> diff --git a/python/lesson1/tutorial.md b/python/lesson1/tutorial.md index 42290a57..1cb904c6 100644 --- a/python/lesson1/tutorial.md +++ b/python/lesson1/tutorial.md @@ -7,7 +7,7 @@ In this tutorial, we're going to start to work with the basic types of Python: strings (for text) and integers & floats (for numeric values). Notice that in this tutorial you are working in REPL (IDLE). You can find more information -on REPL and how to start Python in your `cmd` or `terminal` in the [Installing Python tutorial](python/lesson0/tutorial.html) . +on REPL and how to start Python in your `cmd` or `terminal` in the [Installing Python tutorial](/python/lesson0/tutorial.html) . ## Hello, World! @@ -146,13 +146,15 @@ it with: >>> quit() -Then you should be able to load the file. - +Then you should be able to load the file. + This concludes today's tutorial. In the next tutorial, we'll find out how to combine the results of multiple separate expressions using variables, get input from the user, and make decisions based on that information. -### Further Reading +### Further Learning + +We recommend watching Gaurav Pandey’s How to Get Started with Python video from codebar Festival 2022 over on our [YouTube](https://youtu.be/N0-op9-2eRU). There is a very good introductory article in [Google Developers Guide](https://developers.google.com/edu/python/introduction). diff --git a/stylesheets/github.css b/stylesheets/github.css index 2e66cabd..e58807ad 100644 --- a/stylesheets/github.css +++ b/stylesheets/github.css @@ -1,6 +1,6 @@ body { font-family: Helvetica, arial, sans-serif; - font-size: 14px; + font-size: 16px; line-height: 1.6; padding-top: 10px; padding-bottom: 10px; diff --git a/stylesheets/styles.css b/stylesheets/styles.css index 319db271..0bea1d67 100644 --- a/stylesheets/styles.css +++ b/stylesheets/styles.css @@ -2,8 +2,8 @@ body { padding: 25px; - font: 14px/1.5 Lato, "Helvetica Neue", Helvetica, Arial, sans-serif; - color: #585858; + font: 16px Lato, "Helvetica Neue", Helvetica, Arial, sans-serif; + color: #001c00; font-weight: 300; } @@ -16,6 +16,10 @@ p, ul, ol, table, pre, dl { margin: 0 0 20px; } +li { + line-height: 25px; +} + h1, h2, h3 { line-height: 1.1; } @@ -32,6 +36,14 @@ h3, h4, h5, h6 { color: #494949; } +.language-heading { + background: #ff036a; + color: #fff; + padding: 15px 10px; + margin-top: 60px; + margin-bottom: 25px; +} + a { color: #005d8c; font-weight: 400; @@ -48,6 +60,8 @@ a small { .wrapper { width: 860px; margin: 0 auto; + display: flex; + justify-content: space-between; } .logo { @@ -102,8 +116,6 @@ img { header { width: 270px; - float: left; - position: fixed; } header ul { @@ -166,7 +178,6 @@ header ul a strong { section { width: 500px; - float: right; padding-bottom: 50px; } @@ -182,10 +193,30 @@ hr { } footer { - width: 270px; - float: left; - position: fixed; - bottom: 50px; + max-width: 860px; + margin: 0 auto; + display: flex; + flex-direction: column; + text-align: center; +} + +.donation-box { + border: 4px solid #4bafff; + padding: 65px 0; + margin-bottom: 50px; +} + +.donation-box p { + font-size: 20px; +} + +.donation-box a { + background-color: #4bafff; + color: #fff; + font-weight: bold; + font-size: 18px; + padding: 10px 13px; + border-radius: 5px; } @media print, screen and (max-width: 960px) { @@ -193,23 +224,20 @@ footer { div.wrapper { width: auto; margin: 0; + flex-direction: column; } - header, section, footer { - float: none; - position: static; - width: auto; + header { + width: 100%; + text-align: center; } - header { - padding-right: 320px; + section, footer { + width: auto; } section { - border: 1px solid #e5e5e5; - border-width: 1px 0; padding: 20px 0; - margin: 0 0 20px; } header a small { @@ -239,6 +267,15 @@ footer { pre, code { word-wrap: normal; } + + .donation-box { + padding: 50px 0; + } + + .donation-box p { + font-size: 17px; + } + } @media print, screen and (max-width: 480px) { diff --git a/version-control/command-line/tutorial.md b/version-control/command-line/tutorial.md index cfda5d68..ac54fa18 100644 --- a/version-control/command-line/tutorial.md +++ b/version-control/command-line/tutorial.md @@ -528,9 +528,9 @@ After typing a couple of commands in the terminal to generate some history, try > You can see the entire history by running `history` -## The next step +## Further Learning -Get learning JavaScript, HTML, CSS, Ruby and more on [codebar](http://tutorials.codebar.io/). +If you want to continue your learning on Git, then watch this video with Anna Skoulikari on our [YouTube](https://youtu.be/aJE_l7IjONk). ----- This ends **Introduction to the Git command line** tutorial. Is there something you don't understand? Try and go through the provided resources with your coach. If you have any feedback, or can think of ways to improve this tutorial [send us an email](mailto:feedback@codebar.io) and let us know.