{"version":3,"file":"../www/app/javascripts/app.js","sources":["app/application.coffee","app/config.coffee","app/controllers/base/controller.coffee","app/controllers/catalogue-controller.coffee","app/initialize.coffee","app/lib/support.coffee","app/lib/utils.coffee","app/lib/view-helper.coffee","app/models/base/collection.coffee","app/models/base/model.coffee","app/models/bookmark.coffee","app/models/bookmarks.coffee","app/models/catalogue.coffee","app/models/description.coffee","app/models/email.coffee","app/models/note.coffee","app/models/notes.coffee","app/routes.coffee","app/views/base/collection-view.coffee","app/views/base/view.coffee","app/views/bookmark-view.coffee","app/views/bookmarks-popup-view.coffee","app/views/bookmarks-view.coffee","app/views/catalogue-page-view.coffee","app/views/description-popup-view.coffee","app/views/email-popup-view.coffee","app/views/header-view.coffee","app/views/list-popup-view.coffee","app/views/note-view.coffee","app/views/notes-popup-view.coffee","app/views/notes-view.coffee","app/views/progressbar-view.coffee","app/views/purchase-popup-view.coffee","app/views/search-popup-view.coffee","app/views/site-view.coffee","app/views/templates/bookmark.hbs","app/views/templates/bookmarks-popup.hbs","app/views/templates/bookmarks.hbs","app/views/templates/catalogue.hbs","app/views/templates/description-popup.hbs","app/views/templates/email-popup.hbs","app/views/templates/header.hbs","app/views/templates/list-popup.hbs","app/views/templates/note.hbs","app/views/templates/notes-popup.hbs","app/views/templates/notes.hbs","app/views/templates/progressbar.hbs","app/views/templates/purchase-popup.hbs","app/views/templates/search-popup.hbs","app/views/templates/site.hbs","app/views/templates/thumbnail-popup.hbs","app/views/templates/thumbnails.hbs","app/views/thumbnail-popup-view.coffee","app/views/thumbnails-view.coffee"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA7DA;;A,CCAA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAdA;;A,CCAA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA1BA;;A,CCAA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAxCA;;A,CCAA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA;;A,CCAA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AATA;;A,CCAA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAnCA;;A,CCAA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAnJA;;A,CCAA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAnBA;;A,CCAA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAjBA;;A,CCAA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAtBA;;A,CCAA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA/EA;;A,CCAA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA/IA;;A,CCAA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA5GA;;A,CCAA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAlCA;;A,CCAA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAtBA;;A,CCAA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA/EA;;A,CCAA;;AACA;AACA;AACA;AACA;AACA;AALA;;A,CCAA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AArBA;;A,CCAA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAvBA;;A,CCAA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAxCA;;A,CCAA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAxKA;;A,CCAA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA/BA;;A,CCAA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA9XA;;A,CCAA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAlHA;;A,CCAA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA9EA;;A,CCAA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAxNA;;A,CCAA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAvEA;;A,CCAA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAvDA;;A,CCAA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAvLA;;A,CCAA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AApEA;;A,CCAA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAzCA;;A,CCAA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAzEA;;A,CCAA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA5DA;;A,CCAA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA7IA;;A,CCAA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAZA;;A,CCAA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA;;A,CCAA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA;;A,CCAA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA3EA;;A,CCAA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAnFA;;A,CCAA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA;;A,CCAA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA;;A,CCAA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAxCA;;A,CCAA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAhBA;;A,CCAA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA;;A,CCAA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA;;A,CCAA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA;;A,CCAA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAhBA;;A,CCAA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA/CA;;A,CCAA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA;;A,CCAA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAvIA;;A,CCAA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAzBA;;A,CCAA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AApJA;;A,CCAA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA3FA;;A","sourcesContent":["var Application, Chaplin, config, routes, _ref,\n  __hasProp = {}.hasOwnProperty,\n  __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };\n\nChaplin = require('chaplin');\n\nroutes = require('routes');\n\nconfig = require('config');\n\nmodule.exports = Application = (function(_super) {\n  __extends(Application, _super);\n\n  function Application() {\n    _ref = Application.__super__.constructor.apply(this, arguments);\n    return _ref;\n  }\n\n  Application.prototype.title = 'Virtual Catalog';\n\n  Application.prototype.initialize = function() {\n    Application.__super__.initialize.apply(this, arguments);\n    this.initAjaxSetup();\n    this.initRouter(routes);\n    this.initDispatcher({\n      controllerSuffix: '-controller'\n    });\n    this.initLayout();\n    this.initComposer();\n    this.initMediator();\n    this.startRouting();\n    this.initResizeReload();\n    return typeof Object.freeze === \"function\" ? Object.freeze(this) : void 0;\n  };\n\n  Application.prototype.initMediator = function() {\n    Chaplin.mediator.catalogue = null;\n    Chaplin.mediator.bookmarks = null;\n    Chaplin.mediator.notes = null;\n    return Chaplin.mediator.seal();\n  };\n\n  Application.prototype.initAjaxSetup = function() {\n    return $.ajaxSetup({\n      beforeSend: function(jqXHR, settings) {\n        return settings.url = \"\" + (config.localData ? config.api.testData + '/1876.json?' : config.api.root) + settings.url;\n      },\n      crossDomain: true\n    });\n  };\n\n  Application.prototype.initResizeReload = function() {\n    var _this = this;\n    return window.addEventListener('orientationchange', function() {\n      return window.location.href = window.location.href;\n    });\n  };\n\n  return Application;\n\n})(Chaplin.Application);\n","var config;\n\nconfig = {\n  api: {\n    root: 'http://netcatbackup.qopsrv.net/view/',\n    corsProxy: 'http://netcatbackup.qopsrv.net/view/',\n    testData: '/testdata/'\n  },\n  localData: false,\n  preloadingThumbs: true,\n  preloadPageNum: 6\n};\n\nmodule.exports = config;\n","var Chaplin, Controller, HeaderView, SiteView, _ref,\n  __hasProp = {}.hasOwnProperty,\n  __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };\n\nChaplin = require('chaplin');\n\nSiteView = require('views/site-view');\n\nHeaderView = require('views/header-view');\n\nmodule.exports = Controller = (function(_super) {\n  __extends(Controller, _super);\n\n  function Controller() {\n    _ref = Controller.__super__.constructor.apply(this, arguments);\n    return _ref;\n  }\n\n  Controller.prototype.beforeAction = function() {\n    this.compose('site', SiteView);\n    return this.compose('header', HeaderView);\n  };\n\n  return Controller;\n\n})(Chaplin.Controller);\n","var Catalogue, CatalogueController, CataloguePageView, Chaplin, Controller, _ref,\n  __hasProp = {}.hasOwnProperty,\n  __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };\n\nController = require('controllers/base/controller');\n\nCataloguePageView = require('views/catalogue-page-view');\n\nCatalogue = require('models/catalogue');\n\nChaplin = require('chaplin');\n\nmodule.exports = CatalogueController = (function(_super) {\n  __extends(CatalogueController, _super);\n\n  function CatalogueController() {\n    _ref = CatalogueController.__super__.constructor.apply(this, arguments);\n    return _ref;\n  }\n\n  CatalogueController.prototype.catalogue = function(options) {\n    var model;\n    model = new Catalogue({\n      id: options != null ? options.catalogue : void 0\n    });\n    model.fetch();\n    this.view = new CataloguePageView({\n      region: 'main',\n      model: model\n    });\n    return Chaplin.mediator.catalogue = model;\n  };\n\n  CatalogueController.prototype.index = function() {\n    return this.redirectTo('catalogue/1876');\n  };\n\n  return CatalogueController;\n\n})(Controller);\n","var Application;\n\nApplication = require('application');\n\n$(function() {\n  return (new Application).initialize();\n});\n","var Chaplin, support, utils;\n\nChaplin = require('chaplin');\n\nutils = require('lib/utils');\n\nsupport = utils.beget(Chaplin.support);\n\nmodule.exports = support;\n","var Chaplin, utils;\n\nChaplin = require('chaplin');\n\nutils = Chaplin.utils.beget(Chaplin.utils);\n\n_(utils).extend({\n  isMobile: {\n    Android: function() {\n      return navigator.userAgent.match(/Android/i);\n    },\n    BlackBerry: function() {\n      return navigator.userAgent.match(/BlackBerry/i);\n    },\n    iOS: function() {\n      return navigator.userAgent.match(/iPhone|iPad|iPod/i);\n    },\n    Opera: function() {\n      return navigator.userAgent.match(/Opera Mini/i);\n    },\n    Windows: function() {\n      return navigator.userAgent.match(/IEMobile/i);\n    },\n    any: function() {\n      return this.Android() || this.BlackBerry() || this.iOS() || this.Opera() || this.Windows();\n    },\n    isAndroidNativeBrawser: function() {\n      var nua;\n      nua = navigator.userAgent;\n      return (nua.indexOf('Mozilla/5.0') > -1 && nua.indexOf('Android ') > -1 && nua.indexOf('AppleWebKit') > -1) && !(nua.indexOf('Chrome') > -1);\n    }\n  }\n});\n\nmodule.exports = utils;\n","var Chaplin, config,\n  __slice = [].slice;\n\nChaplin = require('chaplin');\n\nconfig = require('config');\n\nHandlebars.registerHelper('with', function(context, options) {\n  if (!context || Handlebars.Utils.isEmpty(context)) {\n    return options.inverse(this);\n  } else {\n    return options.fn(context);\n  }\n});\n\nHandlebars.registerHelper('getCoordsLine', function(coords, factor) {\n  var resultArray;\n  if (factor == null) {\n    factor = 1;\n  }\n  resultArray = [];\n  _(coords).each(function(o) {\n    resultArray.push(o.x * factor);\n    return resultArray.push(o.y * factor);\n  });\n  resultArray.join(',');\n  return resultArray;\n});\n\nHandlebars.registerHelper('getURL', function(url, page) {\n  if (url) {\n    return new Handlebars.SafeString(url);\n  }\n  return new Handlebars.SafeString(\"page://\" + page);\n});\n\nHandlebars.registerHelper('without', function(context, options) {\n  var inverse;\n  inverse = options.inverse;\n  options.inverse = options.fn;\n  options.fn = inverse;\n  return Handlebars.helpers[\"with\"].call(this, context, options);\n});\n\nHandlebars.registerHelper('url', function() {\n  var options, params, routeName, _i;\n  routeName = arguments[0], params = 3 <= arguments.length ? __slice.call(arguments, 1, _i = arguments.length - 1) : (_i = 1, []), options = arguments[_i++];\n  return Chaplin.helpers.reverse(routeName, params);\n});\n\nHandlebars.registerHelper('limitLength', function(text, length, tail) {\n  var text2;\n  if (!text) {\n    return;\n  }\n  text2 = text != null ? text.substr(0, length) : void 0;\n  if (length < (text != null ? text.length : void 0)) {\n    if (typeof tail !== 'string') {\n      tail = '<span class=\"gray\">...</span>';\n    }\n    text2 += tail;\n  }\n  return new Handlebars.SafeString(text2);\n});\n\nHandlebars.registerHelper('generateThumbList', function(pages) {\n  var catalogue, createImg, first, height, i, last, li, page, result, width, _i, _len;\n  pages = pages.slice(0);\n  catalogue = Chaplin.mediator.catalogue;\n  if (pages.length % 2 === 0) {\n    last = pages.pop(pages);\n  }\n  first = pages.shift(pages);\n  width = catalogue.get('image_sizes').thumbnail.width;\n  height = catalogue.get('image_sizes').thumbnail.height;\n  result = [];\n  i = 0;\n  createImg = function(n) {\n    return \"<img src='\" + config.api.root + \"catalogues/\" + (catalogue.get('info').folder) + \"/page_images/\" + n.page_number + \"_thumbnail.jpg' width='\" + width + \"' height='\" + height + \"'/> \";\n  };\n  result.push(\"<li data-page='0,1'>\" + (createImg(first)) + \"</li>\");\n  for (i = _i = 0, _len = pages.length; _i < _len; i = _i += 2) {\n    page = pages[i];\n    li = [];\n    li.push(createImg(pages[i]));\n    if (pages[i + 1]) {\n      li.push(createImg(pages[i + 1]));\n    }\n    result.push(\"<li data-page='\" + pages[i].page_number + \",\" + pages[i + 1].page_number + \"'>\" + (li.join('')) + \"</li>\");\n  }\n  if (last) {\n    result.push(\"<li data-page='\" + last.page_number + \",0'>\" + (createImg(last)) + \"</li>\");\n  }\n  return new Handlebars.SafeString(result.join(''));\n});\n\nHandlebars.registerHelper('getHeader', function(title) {\n  if (title) {\n    return title;\n  }\n  return 'No title';\n});\n\nHandlebars.registerHelper('getActualImage', function(pageNumber) {\n  return \"page_images/\" + pageNumber + \"_\" + (Chaplin.mediator.catalogue.get('image_sizes').actualSize) + \".jpg\";\n});\n\nHandlebars.registerHelper('filterTag', function(key, body) {\n  var skipWords;\n  skipWords = ['table'];\n  if (_(skipWords).indexOf(key.toLowerCase()) === -1) {\n    return new Handlebars.SafeString(\"<\" + key + \">\" + body + \"</\" + key + \">\");\n  }\n  return '';\n});\n\nHandlebars.registerHelper('filterLinks', function(type, options) {\n  if (type === 'shopping_cart') {\n    return options.fn(this);\n  }\n});\n\nHandlebars.registerHelper('constructImage', function(image) {\n  var imagestring;\n  imagestring = Chaplin.mediator.catalogue.get('description').imagestring;\n  Handlebars.registerHelper('constructImage', function(image) {\n    if (_(image).isEmpty()) {\n      return '';\n    }\n    return imagestring.replace('##imageref##', image);\n  });\n  return Handlebars.helpers.constructImage(image);\n});\n\nHandlebars.registerHelper('getProductInfo', function(context, options) {\n  var product, _ref;\n  product = (_ref = Chaplin.mediator.catalogue.get('description')) != null ? _ref.products[context.link_to_product] : void 0;\n  if (!product) {\n    product = {\n      title: 'No title',\n      imageref: '',\n      isNoDesc: true\n    };\n  }\n  product.link_to_product = context.link_to_product;\n  return options.fn(product);\n});\n","var Chaplin, Collection, Model, _ref,\n  __hasProp = {}.hasOwnProperty,\n  __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };\n\nChaplin = require('chaplin');\n\nModel = require('models/base/model');\n\nmodule.exports = Collection = (function(_super) {\n  __extends(Collection, _super);\n\n  function Collection() {\n    _ref = Collection.__super__.constructor.apply(this, arguments);\n    return _ref;\n  }\n\n  return Collection;\n\n})(Chaplin.Collection);\n","var Chaplin, Model, _ref,\n  __hasProp = {}.hasOwnProperty,\n  __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };\n\nChaplin = require('chaplin');\n\nmodule.exports = Model = (function(_super) {\n  __extends(Model, _super);\n\n  function Model() {\n    _ref = Model.__super__.constructor.apply(this, arguments);\n    return _ref;\n  }\n\n  return Model;\n\n})(Chaplin.Model);\n","var Bookmark, Model, _ref,\n  __hasProp = {}.hasOwnProperty,\n  __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };\n\nModel = require('models/base/model');\n\nmodule.exports = Bookmark = (function(_super) {\n  __extends(Bookmark, _super);\n\n  function Bookmark() {\n    _ref = Bookmark.__super__.constructor.apply(this, arguments);\n    return _ref;\n  }\n\n  Bookmark.prototype.defaults = {\n    page_num: 0,\n    text: ''\n  };\n\n  return Bookmark;\n\n})(Model);\n","var Bookmark, Bookmarks, Collection, _ref,\n  __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },\n  __hasProp = {}.hasOwnProperty,\n  __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };\n\nCollection = require('models/base/collection');\n\nBookmark = require('./bookmark');\n\nmodule.exports = Bookmarks = (function(_super) {\n  __extends(Bookmarks, _super);\n\n  function Bookmarks() {\n    this.save = __bind(this.save, this);\n    this.fetch = __bind(this.fetch, this);\n    _ref = Bookmarks.__super__.constructor.apply(this, arguments);\n    return _ref;\n  }\n\n  Bookmarks.prototype.model = Bookmark;\n\n  Bookmarks.prototype.url = \"catalogue_functions/fetch_bookmarks_js.php\";\n\n  Bookmarks.prototype.saveUrl = \"catalogue_functions/update_bookmarks_js.php\";\n\n  Bookmarks.prototype.fetch = function(catalogId, email, password) {\n    var fetchString, result,\n      _this = this;\n    this.trigger('bookmarks:loadStarted');\n    fetchString = \"catalogue_id=\" + catalogId + \"&email=\" + email + \"&password=\" + password;\n    result = $.ajax({\n      dataType: 'json',\n      type: 'POST',\n      url: this.url,\n      data: fetchString\n    });\n    return result.done(function(response) {\n      var resultJSON;\n      resultJSON = response;\n      if (!resultJSON.length) {\n        _this.trigger('bookmarks:loadFailed', {\n          error: \"Nothing found!\"\n        });\n        return;\n      }\n      _this.reset(resultJSON);\n      return _this.trigger('bookmarks:loadCompleted');\n    });\n  };\n\n  Bookmarks.prototype.save = function(catalogId, email, password) {\n    var result, saveString,\n      _this = this;\n    this.trigger('bookmarks:saveStarted');\n    saveString = [\"bookmarks[\" + catalogId + \"][email]=\" + email, \"bookmarks[\" + catalogId + \"][password]=\" + password];\n    this.each(function(bookmark, index) {\n      saveString.push(\"bookmarks[\" + catalogId + \"][\" + index + \"][page]=\" + (bookmark.get('page_num')));\n      return saveString.push(\"bookmarks[\" + catalogId + \"][\" + index + \"][name]=\" + (bookmark.get('text')));\n    });\n    result = $.ajax({\n      dataType: 'json',\n      type: 'POST',\n      url: this.saveUrl,\n      data: saveString.join('&')\n    });\n    return result.done(function(response) {\n      var resultJSON;\n      resultJSON = response;\n      if ((resultJSON != null ? resultJSON.success : void 0) === 'success') {\n        return _this.trigger('bookmarks:saveCompleted');\n      } else {\n        return _this.trigger('bookmarks:saveFailed');\n      }\n    });\n  };\n\n  return Bookmarks;\n\n})(Collection);\n","var Catalogue, Model, config, _ref,\n  __hasProp = {}.hasOwnProperty,\n  __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };\n\nModel = require('models/base/model');\n\nconfig = require('config');\n\nmodule.exports = Catalogue = (function(_super) {\n  __extends(Catalogue, _super);\n\n  function Catalogue() {\n    _ref = Catalogue.__super__.constructor.apply(this, arguments);\n    return _ref;\n  }\n\n  Catalogue.prototype.url = function() {\n    return \"catalogue.php?catalog=\" + (this.get('id'));\n  };\n\n  Catalogue.prototype.searchUrl = \"catalogue_functions/search_json.php\";\n\n  Catalogue.prototype.initialize = function() {\n    Catalogue.__super__.initialize.apply(this, arguments);\n    this.subscribeEvent('catalogue:searchByKeyWord', this.searchOnServer);\n    return this.listenTo(this, 'sync', this.catalogueSynced);\n  };\n\n  Catalogue.prototype.parse = function(response) {\n    response.products.description = response.descriptions;\n    response = response.products;\n    response.config = $.extend({}, config);\n    console.log(response);\n    this.modifyImageSizes(response);\n    return response;\n  };\n\n  Catalogue.prototype.modifyImageSizes = function(response) {\n    var HEADER_HEIGHT, bodyHeight, bodyWidth, normalSize, originalAspectRatio;\n    HEADER_HEIGHT = 110;\n    normalSize = response.image_sizes.normal;\n    response.image_sizes.original_normal = $.extend(true, {}, normalSize);\n    originalAspectRatio = normalSize.width * 2 / normalSize.height;\n    bodyWidth = $(window).width();\n    bodyHeight = $(window).height() - HEADER_HEIGHT;\n    if (bodyHeight * originalAspectRatio < bodyWidth) {\n      response.image_sizes.normal = {\n        width: (bodyHeight * originalAspectRatio) / 2,\n        height: bodyHeight\n      };\n    } else {\n      response.image_sizes.normal = {\n        width: bodyWidth / 2,\n        height: bodyWidth / originalAspectRatio\n      };\n    }\n    response.image_sizes.scaleFactor = response.image_sizes.normal.width / response.image_sizes.original_normal.width;\n    return response.image_sizes.actualSize = response.image_sizes.original_normal.width >= response.image_sizes.normal.width ? 'normal' : 'zoom';\n  };\n\n  Catalogue.prototype.search = function(keyWord) {\n    var searchResults,\n      _this = this;\n    searchResults = [];\n    _(this.get('pages').page).each(function(page) {\n      if (_this.testStingOnKey(page.title, keyWord)) {\n        searchResults.push({\n          page: page.number,\n          text: page.title\n        });\n      }\n      if (page.hotspots) {\n        return _(page.hotspots.hotspot).each(function(hotspot) {\n          if (_this.testStingOnKey(hotspot.title, keyWord)) {\n            searchResults.push({\n              page: page.number,\n              text: hotspot.title\n            });\n          }\n          if (_this.testStingOnKey(hotspot.alt_tag, keyWord)) {\n            return searchResults.push({\n              page: page.number,\n              text: hotspot.alt_tag\n            });\n          }\n        });\n      }\n    });\n    return searchResults;\n  };\n\n  Catalogue.prototype.testStingOnKey = function(string, key) {\n    if (string == null) {\n      string = '';\n    }\n    if (key == null) {\n      key = null;\n    }\n    return (string.toLowerCase().indexOf(key.toLowerCase())) !== -1;\n  };\n\n  Catalogue.prototype.searchOnServer = function(keyWord) {\n    var result, searchString,\n      _this = this;\n    this.publishEvent('catalogue:search:start');\n    searchString = \"catalogue_id=\" + (this.get('id')) + \"&search=\" + keyWord;\n    result = $.ajax({\n      dataType: 'json',\n      type: 'post',\n      url: this.searchUrl,\n      data: searchString\n    });\n    return result.done(function(response) {\n      if (!response.length) {\n        response = [];\n      }\n      response = {\n        success: true,\n        hit: response\n      };\n      return _this.publishEvent('catalogue:search:complete', response);\n    });\n  };\n\n  Catalogue.prototype.catalogueSynced = function() {\n    return this.publishEvent('catalogue:loaded', this);\n  };\n\n  Catalogue.prototype.getPagesOffset = function() {\n    var index;\n    index = _(this.get('pages')).findIndex({\n      title: 'Page 1'\n    });\n    if (index !== -1) {\n      return index;\n    } else {\n      return 0;\n    }\n  };\n\n  return Catalogue;\n\n})(Model);\n","var Chaplin, Description, Model, config, _ref,\n  __hasProp = {}.hasOwnProperty,\n  __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };\n\nModel = require('models/base/model');\n\nChaplin = require('chaplin');\n\nconfig = require('config');\n\nmodule.exports = Description = (function(_super) {\n  __extends(Description, _super);\n\n  function Description() {\n    _ref = Description.__super__.constructor.apply(this, arguments);\n    return _ref;\n  }\n\n  Description.prototype.url = 'catalogue_functions/get_description.php';\n\n  Description.prototype.addToCartURL = 'index.php?go=account.enquiry&do=add&pcsr={%product%}&inc=a';\n\n  Description.prototype.purchaseUrl = 'index.php';\n\n  Description.prototype.defaults = {\n    page: null,\n    title: null,\n    position: {\n      left: 0,\n      top: 0\n    },\n    productURL: null\n  };\n\n  Description.prototype.fetch = function() {\n    return Description.__super__.fetch.call(this, {\n      data: \"url=\" + (this.get('productURL')),\n      type: 'post',\n      dataType: 'json'\n    });\n  };\n\n  Description.prototype.addToCart = function(title) {\n    var result,\n      _this = this;\n    if (title == null) {\n      title = this.get('title');\n    }\n    result = $.ajax({\n      beforeSend: function() {\n        return {};\n      },\n      method: 'get',\n      crossDomain: true,\n      headers: {\n        'X-Requested-With': 'XMLHttpRequest'\n      },\n      url: this.constructorAddToCartURL(title)\n    });\n    return result.done(function(response) {\n      response = response.replace(/^o\\|/gi, '');\n      _this.set({\n        content: response\n      }, {\n        silent: true\n      });\n      return _this.publishEvent('catalogue:showAddToCartPopup', _this);\n    });\n  };\n\n  Description.prototype.constructorAddToCartURL = function(title) {\n    var domain;\n    domain = this.urlDomain(Chaplin.mediator.catalogue.get('info').url_store);\n    return config.api.corsProxy + domain.host.replace(':80', '') + '/' + this.addToCartURL.replace('{%product%}', title);\n  };\n\n  Description.prototype.constructorPurchaseURL = function() {\n    var domain;\n    domain = this.urlDomain(Chaplin.mediator.catalogue.get('info').url_store);\n    return config.api.corsProxy + domain.host.replace(':80', '') + '/' + this.purchaseUrl;\n  };\n\n  Description.prototype.urlDomain = function(data) {\n    var a;\n    a = document.createElement('a');\n    a.href = data;\n    return a;\n  };\n\n  Description.prototype.pushPurchaseMessage = function(serializedForm) {\n    var result;\n    return result = $.ajax({\n      beforeSend: function() {\n        return {};\n      },\n      method: 'post',\n      crossDomain: true,\n      headers: {\n        'X-Requested-With': 'XMLHttpRequest'\n      },\n      data: serializedForm,\n      url: this.constructorPurchaseURL()\n    });\n  };\n\n  return Description;\n\n})(Model);\n","var Email, Model, config, _ref,\n  __hasProp = {}.hasOwnProperty,\n  __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };\n\nModel = require('models/base/model');\n\nconfig = require('config');\n\nmodule.exports = Email = (function(_super) {\n  __extends(Email, _super);\n\n  function Email() {\n    _ref = Email.__super__.constructor.apply(this, arguments);\n    return _ref;\n  }\n\n  Email.prototype.url = 'catalogue_functions/send_to_friend_withoutlogo.php';\n\n  Email.prototype.save = function() {\n    var def,\n      _this = this;\n    def = $.ajax({\n      url: this.url,\n      method: 'post',\n      data: this.attributes\n    });\n    return def.done(function() {\n      return _this.trigger('sentSuccess');\n    });\n  };\n\n  return Email;\n\n})(Model);\n","var Model, Note, _ref,\n  __hasProp = {}.hasOwnProperty,\n  __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };\n\nModel = require('models/base/model');\n\nmodule.exports = Note = (function(_super) {\n  __extends(Note, _super);\n\n  function Note() {\n    _ref = Note.__super__.constructor.apply(this, arguments);\n    return _ref;\n  }\n\n  Note.prototype.defaults = {\n    page_num: 0,\n    text: ''\n  };\n\n  return Note;\n\n})(Model);\n","var Collection, Note, Notes, _ref,\n  __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },\n  __hasProp = {}.hasOwnProperty,\n  __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };\n\nCollection = require('models/base/collection');\n\nNote = require('./note');\n\nmodule.exports = Notes = (function(_super) {\n  __extends(Notes, _super);\n\n  function Notes() {\n    this.save = __bind(this.save, this);\n    this.fetch = __bind(this.fetch, this);\n    _ref = Notes.__super__.constructor.apply(this, arguments);\n    return _ref;\n  }\n\n  Notes.prototype.model = Note;\n\n  Notes.prototype.url = \"catalogue_functions/fetch_notes_js.php\";\n\n  Notes.prototype.saveUrl = \"catalogue_functions/update_notes_js.php\";\n\n  Notes.prototype.fetch = function(catalogId, email, password) {\n    var fetchString, result,\n      _this = this;\n    this.trigger('notes:loadStarted');\n    fetchString = \"catalogue_id=\" + catalogId + \"&email=\" + email + \"&password=\" + password;\n    result = $.ajax({\n      dataType: 'json',\n      type: 'POST',\n      url: this.url,\n      data: fetchString\n    });\n    return result.done(function(response) {\n      var resultJSON;\n      resultJSON = response;\n      if (resultJSON.length == null) {\n        _this.trigger('notes:loadFailed', {\n          error: 'Nothing found'\n        });\n        return;\n      }\n      _this.reset(resultJSON);\n      return _this.trigger('notes:loadCompleted');\n    });\n  };\n\n  Notes.prototype.save = function(catalogId, email, password) {\n    var result, saveString,\n      _this = this;\n    this.trigger('notes:saveStarted');\n    saveString = [\"notes[\" + catalogId + \"][email]=\" + email, \"notes[\" + catalogId + \"][password]=\" + password];\n    this.each(function(note, index) {\n      saveString.push(\"notes[\" + catalogId + \"][\" + index + \"][page]=\" + (note.get('page_num')));\n      return saveString.push(\"notes[\" + catalogId + \"][\" + index + \"][name]=\" + (note.get('text')));\n    });\n    result = $.ajax({\n      dataType: 'json',\n      type: 'POST',\n      url: this.saveUrl,\n      data: saveString.join('&')\n    });\n    return result.done(function(response) {\n      var resultJSON;\n      resultJSON = response;\n      if ((resultJSON != null ? resultJSON.success : void 0) === 'success') {\n        return _this.trigger('notes:saveCompleted');\n      } else {\n        return _this.trigger('notes:saveFailed');\n      }\n    });\n  };\n\n  return Notes;\n\n})(Collection);\n","module.exports = function(match) {\n  match('view/app', 'catalogue#index');\n  match('view/app/index.html', 'catalogue#catalogue');\n  return match('index.html', 'catalogue#catalogue');\n};\n","var Chaplin, CollectionView, View, _ref,\n  __hasProp = {}.hasOwnProperty,\n  __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };\n\nChaplin = require('chaplin');\n\nView = require('views/base/view');\n\nmodule.exports = CollectionView = (function(_super) {\n  __extends(CollectionView, _super);\n\n  function CollectionView() {\n    _ref = CollectionView.__super__.constructor.apply(this, arguments);\n    return _ref;\n  }\n\n  CollectionView.prototype.getTemplateFunction = View.prototype.getTemplateFunction;\n\n  return CollectionView;\n\n})(Chaplin.CollectionView);\n","var Chaplin, View, _ref,\n  __hasProp = {}.hasOwnProperty,\n  __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };\n\nChaplin = require('chaplin');\n\nrequire('lib/view-helper');\n\nmodule.exports = View = (function(_super) {\n  __extends(View, _super);\n\n  function View() {\n    _ref = View.__super__.constructor.apply(this, arguments);\n    return _ref;\n  }\n\n  View.prototype.getTemplateFunction = function() {\n    return this.template;\n  };\n\n  return View;\n\n})(Chaplin.View);\n","var BookmarkView, View, template, _ref,\n  __hasProp = {}.hasOwnProperty,\n  __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };\n\nView = require('./base/view');\n\ntemplate = require('./templates/bookmark');\n\nmodule.exports = BookmarkView = (function(_super) {\n  __extends(BookmarkView, _super);\n\n  function BookmarkView() {\n    _ref = BookmarkView.__super__.constructor.apply(this, arguments);\n    return _ref;\n  }\n\n  BookmarkView.prototype.template = template;\n\n  BookmarkView.prototype.tagName = 'li';\n\n  BookmarkView.prototype.className = 'item';\n\n  BookmarkView.prototype.events = {\n    'click': 'goToPage',\n    'click .btn-delete': 'deleteBookmark'\n  };\n\n  BookmarkView.prototype.goToPage = function() {\n    this.publishEvent('catalogue:goToPage', parseInt(this.model.get('page_num')));\n    return false;\n  };\n\n  BookmarkView.prototype.deleteBookmark = function() {\n    this.model.destroy();\n    return false;\n  };\n\n  return BookmarkView;\n\n})(View);\n","var Bookmarks, BookmarksPopupView, BookmarksView, Chaplin, View, template, _ref,\n  __hasProp = {}.hasOwnProperty,\n  __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };\n\ntemplate = require('views/templates/bookmarks-popup');\n\nView = require('views/base/view');\n\nBookmarks = require('models/bookmarks');\n\nBookmarksView = require('views/bookmarks-view');\n\nChaplin = require('chaplin');\n\nmodule.exports = BookmarksPopupView = (function(_super) {\n  __extends(BookmarksPopupView, _super);\n\n  function BookmarksPopupView() {\n    _ref = BookmarksPopupView.__super__.constructor.apply(this, arguments);\n    return _ref;\n  }\n\n  BookmarksPopupView.prototype.template = template;\n\n  BookmarksPopupView.prototype.className = 'popup wide';\n\n  BookmarksPopupView.prototype.tagName = 'div';\n\n  BookmarksPopupView.prototype.id = 'bookmarks-popup';\n\n  BookmarksPopupView.prototype.autoRender = true;\n\n  BookmarksPopupView.prototype.container = 'body';\n\n  BookmarksPopupView.prototype.regions = {\n    '#bookmarks-container': 'bookmarks'\n  };\n\n  BookmarksPopupView.prototype.events = {\n    'click .btn-close': 'closePopup',\n    'click #btn-create-bookmark-section': 'showCreateSection',\n    'click #btn-save-bookmark-section': 'showSaveSection',\n    'click #btn-load-bookmark-section': 'showLoadSection',\n    'click .btn-go-back': 'showManageSection',\n    'submit #load-section-credentials': 'loadBookmarks',\n    'submit #create-section-credentials': 'createBookmark',\n    'submit #save-section-credentials': 'saveBookmarks'\n  };\n\n  BookmarksPopupView.prototype.listen = {\n    'catalogue:bookmarksManage mediator': 'showManageSection',\n    'catalogue:bookmarksLoad mediator': 'showLoadSection',\n    'catalogue:bookmarksNew mediator': 'showCreateSection',\n    'catalogue:bookmarksSave mediator': 'showSaveSection',\n    'bookmarks:loadStarted collection': 'showLoader',\n    'bookmarks:loadCompleted collection': 'loadCompleted',\n    'bookmarks:loadFailed collection': 'loadFailed',\n    'bookmarks:saveStarted collection': 'showLoader',\n    'bookmarks:saveCompleted collection': 'saveCompleted'\n  };\n\n  BookmarksPopupView.prototype.closePopup = function() {\n    this.dispose();\n    return false;\n  };\n\n  BookmarksPopupView.prototype.initialize = function() {\n    BookmarksPopupView.__super__.initialize.apply(this, arguments);\n    if (Chaplin.mediator.bookmarks === null) {\n      Chaplin.mediator.bookmarks = new Bookmarks();\n    }\n    return this.collection = Chaplin.mediator.bookmarks;\n  };\n\n  BookmarksPopupView.prototype.render = function() {\n    BookmarksPopupView.__super__.render.apply(this, arguments);\n    return this.addBookmarksBlock('bookmarks', this.collection);\n  };\n\n  BookmarksPopupView.prototype.addCollectionListeners = function() {};\n\n  BookmarksPopupView.prototype.addBookmarksBlock = function(region, collection) {\n    var bookmarksSubView;\n    bookmarksSubView = new BookmarksView({\n      region: region,\n      collection: collection\n    });\n    return this.subview('bookmarks', bookmarksSubView);\n  };\n\n  BookmarksPopupView.prototype.showManageSection = function() {\n    this.$('.section').hide();\n    return this.$('#manage-section').show();\n  };\n\n  BookmarksPopupView.prototype.showLoadSection = function() {\n    this.$('.section').hide();\n    return this.$('#load-section').show();\n  };\n\n  BookmarksPopupView.prototype.showCreateSection = function() {\n    this.$('.section').hide();\n    return this.$('#create-section').show();\n  };\n\n  BookmarksPopupView.prototype.showSaveSection = function() {\n    this.$('.section').hide();\n    return this.$('#save-section').show();\n  };\n\n  BookmarksPopupView.prototype.createBookmark = function(event) {\n    var formData,\n      _this = this;\n    formData = $(event.currentTarget).serializeObject();\n    this.publishEvent('catalogue:getActivePage', function(activePage) {\n      _this.collection.create({\n        page_num: activePage[0] || activePage[1],\n        text: formData != null ? formData.text : void 0\n      });\n      _this.showManageSection();\n      return event.currentTarget.reset();\n    });\n    return false;\n  };\n\n  BookmarksPopupView.prototype.saveBookmarks = function(event) {\n    var formData;\n    formData = $(event.currentTarget).serializeObject();\n    this.collection.save(Chaplin.mediator.catalogue.get('id'), formData != null ? formData.email : void 0, formData != null ? formData.password : void 0);\n    event.currentTarget.reset();\n    return false;\n  };\n\n  BookmarksPopupView.prototype.saveCompleted = function() {\n    this.hideLoader();\n    alert('Your bookmarks successfully saved');\n    return this.showManageSection();\n  };\n\n  BookmarksPopupView.prototype.loadBookmarks = function(event) {\n    var formData;\n    formData = $(event.currentTarget).serializeObject();\n    this.collection.fetch(Chaplin.mediator.catalogue.get('id'), formData != null ? formData.email : void 0, formData != null ? formData.password : void 0);\n    event.currentTarget.reset();\n    return false;\n  };\n\n  BookmarksPopupView.prototype.loadCompleted = function() {\n    this.hideLoader();\n    return this.showManageSection();\n  };\n\n  BookmarksPopupView.prototype.loadFailed = function(error) {\n    alert(error.error);\n    return this.hideLoader();\n  };\n\n  BookmarksPopupView.prototype.showLoader = function() {\n    return this.$('.loading').show();\n  };\n\n  BookmarksPopupView.prototype.hideLoader = function() {\n    return this.$('.loading').hide();\n  };\n\n  return BookmarksPopupView;\n\n})(View);\n","var BookmarkView, BookmarksView, CollectionView, template, _ref,\n  __hasProp = {}.hasOwnProperty,\n  __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };\n\nCollectionView = require('./base/collection-view');\n\nBookmarkView = require('./bookmark-view');\n\ntemplate = require('./templates/bookmarks');\n\nmodule.exports = BookmarksView = (function(_super) {\n  __extends(BookmarksView, _super);\n\n  function BookmarksView() {\n    _ref = BookmarksView.__super__.constructor.apply(this, arguments);\n    return _ref;\n  }\n\n  BookmarksView.prototype.template = template;\n\n  BookmarksView.prototype.itemView = BookmarkView;\n\n  BookmarksView.prototype.autoRender = true;\n\n  BookmarksView.prototype.listSelector = '#bookmarks-list';\n\n  BookmarksView.prototype.itemSelector = '.item';\n\n  return BookmarksView;\n\n})(CollectionView);\n","var CataloguePageView, ProgressbarView, View, config, template, utils, _ref,\n  __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },\n  __hasProp = {}.hasOwnProperty,\n  __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };\n\ntemplate = require('views/templates/catalogue');\n\nView = require('views/base/view');\n\nProgressbarView = require('views/progressbar-view');\n\nconfig = require('config');\n\nutils = require('lib/utils');\n\nmodule.exports = CataloguePageView = (function(_super) {\n  __extends(CataloguePageView, _super);\n\n  function CataloguePageView() {\n    this.showImageOnLoad = __bind(this.showImageOnLoad, this);\n    this.preloadCurrentImages = __bind(this.preloadCurrentImages, this);\n    this.initCompleted = __bind(this.initCompleted, this);\n    this.initImagePreloader = __bind(this.initImagePreloader, this);\n    _ref = CataloguePageView.__super__.constructor.apply(this, arguments);\n    return _ref;\n  }\n\n  CataloguePageView.prototype.autoRender = false;\n\n  CataloguePageView.prototype.className = 'catalogue-page';\n\n  CataloguePageView.prototype.flipbook = null;\n\n  CataloguePageView.prototype.activePages = null;\n\n  CataloguePageView.prototype.containerMethod = 'html';\n\n  CataloguePageView.prototype.turnPageCallback = null;\n\n  CataloguePageView.prototype.isTurning = false;\n\n  CataloguePageView.prototype.regions = {\n    '#images-preload-progress': 'preloadProgress'\n  };\n\n  CataloguePageView.prototype.template = template;\n\n  CataloguePageView.prototype.events = {\n    'mouseover polygon': 'hightlightHotspot',\n    'mouseleave polygon': 'unHightlightHotspot',\n    'click polygon': 'clickPolygon',\n    'click rect': 'hideDescriptions',\n    'click .next': 'nextPage',\n    'click .prev': 'previousPage'\n  };\n\n  CataloguePageView.prototype.listen = {\n    'sync model': 'render',\n    'addedToDOM': 'initImagePreloader',\n    'catalogue:next mediator': 'nextPage',\n    'catalogue:previous mediator': 'previousPage',\n    'catalogue:goToPage mediator': 'goToPage',\n    'catalogue:goToPageByPageNumber mediator': 'goToPageByPageNumber',\n    'catalogue:goToStart mediator': 'goToStart',\n    'catalogue:goToEnd mediator': 'goToEnd',\n    'catalogue:zoomIn mediator': 'zoomIn',\n    'catalogue:zoomOut mediator': 'zoomOut',\n    'catalogue:print mediator': 'print',\n    'catalogue:getActivePage mediator': 'getActivePage',\n    'catalogue:hideAllDescriptions mediator': 'hideDescriptions',\n    'catalogue:pageTurned mediator': 'hideDescriptions',\n    'catalogue:pageTurned mediator': 'preloadCurrentImages',\n    'catalogue:higlelightHotspotByTitle mediator': 'higlelightHotspotByTitle',\n    'catalogue:setTurnPageCallback mediator': 'setTurnPageCallback',\n    'catalogue:disable mediator': 'disable'\n  };\n\n  CataloguePageView.prototype.addProgressbarBlock = function(region) {\n    var progressbarSubView;\n    progressbarSubView = new ProgressbarView({\n      region: region\n    });\n    return this.subview('progressBar', progressbarSubView);\n  };\n\n  CataloguePageView.prototype.initImagePreloader = function() {\n    var imageLoader, images, totalImages, totalLoaded,\n      _this = this;\n    this.flipbook = this.$(\"#flipbook\");\n    if (!config.preloadingThumbs) {\n      this.initCompleted();\n      return;\n    }\n    this.addProgressbarBlock('preloadProgress');\n    this.preloadCurrentImages([0, 1]);\n    images = this.flipbook.find('img:lt(5)').toArray();\n    images = images.concat($(\"#thumbnails img:lt(30), #flipbook .page:lt(\" + config.preloadNum + \") img\").toArray());\n    totalImages = images.length;\n    totalLoaded = 0;\n    imageLoader = new imagesLoaded(images);\n    imageLoader.on('progress', function(instance, image) {\n      var progress;\n      progress = (++totalLoaded / totalImages).toPrecision(3);\n      return _this.publishEvent('progressUpdate', progress);\n    });\n    return imageLoader.on('always', this.initCompleted);\n  };\n\n  CataloguePageView.prototype.initCompleted = function() {\n    this.initPrevNextButtons();\n    this.initFlip();\n    this.initZoom();\n    return this.publishEvent('catalogue:initCompleted');\n  };\n\n  CataloguePageView.prototype.initPrevNextButtons = function() {\n    var _this = this;\n    return this.$(\".prev-next-page\").each(function(index, elem) {\n      if (index % 2 === 0) {\n        return $(elem).addClass('next');\n      } else {\n        return $(elem).addClass('prev');\n      }\n    });\n  };\n\n  CataloguePageView.prototype.initFlip = function() {\n    var imageNormalSize,\n      _this = this;\n    if (!this.flipbook.length) {\n      return;\n    }\n    imageNormalSize = this.model.get('image_sizes').normal;\n    this.flipbook.css('margin-top', ($('body').height() - imageNormalSize.height - 107) / 2);\n    return this.flipbook.turn({\n      width: imageNormalSize.width * 2,\n      height: imageNormalSize.height,\n      autoCenter: true,\n      when: {\n        start: function(event, pageObject, corner) {\n          return _this.isTurning = true;\n        },\n        end: function(event, pageObject, corner) {\n          return _this.isTurning = false;\n        },\n        turned: function(event, page, view) {\n          _this.activePages = view;\n          _this.publishEvent('catalogue:pageTurned', _this.activePages);\n          $('.page-wrapper').removeClass('active');\n          $(\".page-wrapper[page='\" + view[0] + \"']\").addClass('active');\n          $(\".page-wrapper[page='\" + view[1] + \"']\").addClass('active');\n          if (_this.turnPageCallback) {\n            _this.turnPageCallback();\n            return _this.turnPageCallback = null;\n          }\n        }\n      }\n    });\n  };\n\n  CataloguePageView.prototype.disable = function(isDisable) {\n    return this.flipbook.turn('disable', isDisable);\n  };\n\n  CataloguePageView.prototype.initZoom = function() {\n    var imageNormalSize,\n      _this = this;\n    this.flipZoom = this.$(\".magazine-viewport\");\n    if (!this.flipZoom.length || !this.flipbook.length) {\n      return;\n    }\n    this.flipZoom.zoom({\n      flipbook: this.flipbook,\n      when: {\n        zoomIn: function() {\n          return _this.flipZoom.toggleClass('zoomedOut zoomedIn');\n        },\n        zoomOut: function() {\n          _this.flipZoom.toggleClass('zoomedOut zoomedIn');\n          return setTimeout(function() {\n            return _this.flipZoom.toggleClass('animated');\n          }, 0);\n        },\n        swipeLeft: function() {},\n        swipeRight: function() {}\n      }\n    });\n    setTimeout(function() {\n      return _this.flipZoom.toggleClass('animated');\n    }, 0);\n    imageNormalSize = this.model.get('image_sizes').normal;\n    return this.$('.container').width(imageNormalSize.width).height(imageNormalSize.height).css('left', -imageNormalSize.width / 2);\n  };\n\n  CataloguePageView.prototype.hightlightHotspot = function(e) {\n    $(e.currentTarget).attr('stroke-opacity', 1);\n    if (this.isTurning) {\n\n    }\n  };\n\n  CataloguePageView.prototype.unHightlightHotspot = function(e) {\n    $(e.currentTarget).attr('stroke-opacity', 0);\n    if (this.isTurning) {\n\n    }\n  };\n\n  CataloguePageView.prototype.clickPolygon = function(e) {\n    if (this.isTurning) {\n      return;\n    }\n    if (utils.isMobile.isAndroidNativeBrawser()) {\n      return;\n    }\n    return this.clickHotspot($(e.currentTarget));\n  };\n\n  CataloguePageView.prototype.higlelightHotspotByTitle = function(title) {\n    var $polygon;\n    $polygon = this.$(\"polygon[title='\" + title + \"']\");\n    return this.clickHotspot($polygon);\n  };\n\n  CataloguePageView.prototype.clickHotspot = function($polygon) {\n    var hotspot, url;\n    this.publishEvent('catalogue:hideAllDescriptions');\n    url = $polygon.attr('data-url');\n    if (/^https?:\\/\\//ig.test(url)) {\n      hotspot = {\n        url: url,\n        points: $polygon.attr('points'),\n        page: $polygon.attr('data-page'),\n        title: $polygon.attr('title'),\n        polygonHeight: this.getPolygonHeight($polygon),\n        polygonWidth: this.getPolygonWidth($polygon),\n        left: $polygon.offset().left - $polygon.parents('svg').offset().left,\n        top: $polygon.offset().top - $polygon.parents('svg').offset().top,\n        offsetPosition: $polygon.offset(),\n        elevation: 0\n      };\n      this.showDescription(hotspot);\n      return;\n    }\n    return this.publishEvent('catalogue:goToPage', url.replace(\"page://\", \"\"));\n  };\n\n  CataloguePageView.prototype.getPolygonHeight = function($polygon) {\n    var points, tops;\n    points = $polygon.attr('points').split(/,|\\s/ig);\n    tops = _(points).map(function(v, i) {\n      if (i % 2 !== 0) {\n        return parseInt(v);\n      }\n    });\n    tops = _(tops).compact();\n    return _(tops).max() - _(tops).min();\n  };\n\n  CataloguePageView.prototype.getPolygonWidth = function($polygon) {\n    var lefts, points;\n    points = $polygon.attr('points').split(/,|\\s/ig);\n    lefts = _(points).map(function(v, i) {\n      if ((i % 2) === 0) {\n        return parseInt(v);\n      }\n    });\n    lefts = _(lefts).compact();\n    return _(lefts).max() - _(lefts).min();\n  };\n\n  CataloguePageView.prototype.setTurnPageCallback = function(callback) {\n    return this.turnPageCallback = callback;\n  };\n\n  CataloguePageView.prototype.showDescription = function(hotspot) {\n    this.$(\"#map-\" + hotspot.page + \" defs mask polygon\").attr('points', hotspot.points);\n    this.$(\"[page='\" + this.activePages[0] + \"'] svg rect, [page='\" + this.activePages[1] + \"'] svg rect\").attr('visibility', 'visible');\n    this.publishEvent('catalogue:disable', true);\n    return this.publishEvent('catalogue:showDescription', hotspot);\n  };\n\n  CataloguePageView.prototype.hideDescriptions = function() {\n    this.$(\".page-wrapper svg rect\").attr('visibility', 'hidden');\n    this.$(\".page-wrapper svg mask polygon\").attr('points', '');\n    this.publishEvent('catalogue:disable', false);\n    return this.publishEvent('catalogue:hideDescription');\n  };\n\n  CataloguePageView.prototype.goToPage = function(page) {\n    var pageNum, _ref1;\n    if (page < 1) {\n      return;\n    }\n    pageNum = this.model.get('pages').length;\n    if (page > pageNum) {\n      page = pageNum;\n    }\n    if ((_ref1 = this.flipbook) != null ? _ref1.length : void 0) {\n      return this.flipbook.turn(\"page\", page);\n    }\n  };\n\n  CataloguePageView.prototype.goToPageByPageNumber = function(page) {\n    page += this.model.getPagesOffset();\n    return this.goToPage(page);\n  };\n\n  CataloguePageView.prototype.nextPage = function() {\n    var _ref1;\n    if ((_ref1 = this.flipbook) != null ? _ref1.length : void 0) {\n      return this.flipbook.turn(\"next\");\n    }\n  };\n\n  CataloguePageView.prototype.previousPage = function() {\n    var _ref1;\n    if ((_ref1 = this.flipbook) != null ? _ref1.length : void 0) {\n      return this.flipbook.turn(\"previous\");\n    }\n  };\n\n  CataloguePageView.prototype.goToStart = function() {\n    return this.publishEvent('catalogue:goToPage', 1);\n  };\n\n  CataloguePageView.prototype.goToEnd = function() {\n    return this.publishEvent('catalogue:goToPage', this.model.get('pages').length);\n  };\n\n  CataloguePageView.prototype.zoomIn = function() {\n    var _ref1;\n    this.flipZoom.toggleClass('animated');\n    if ((_ref1 = this.flipZoom) != null ? _ref1.length : void 0) {\n      return this.flipZoom.zoom('zoomIn');\n    }\n  };\n\n  CataloguePageView.prototype.zoomOut = function() {\n    var _ref1;\n    if ((_ref1 = this.flipZoom) != null ? _ref1.length : void 0) {\n      return this.flipZoom.zoom('zoomOut');\n    }\n  };\n\n  CataloguePageView.prototype.print = function() {\n    return window.print();\n  };\n\n  CataloguePageView.prototype.getActivePage = function(callback) {\n    return callback(this.activePages);\n  };\n\n  CataloguePageView.prototype.preloadCurrentImages = function(activePages) {\n    var endPage, i, _results;\n    i = activePages[0] - config.preloadPageNum;\n    endPage = activePages[0] + config.preloadPageNum;\n    _results = [];\n    while (i < endPage) {\n      this.loadImageOnPage(this.flipbook.find(\"div.page[data-page-num='\" + i + \"']\").get(0));\n      _results.push(i++);\n    }\n    return _results;\n  };\n\n  CataloguePageView.prototype.loadImageOnPage = function(page) {\n    var img;\n    img = $(page).find('img');\n    if (img.attr('src')) {\n      return;\n    }\n    img.attr('src', img.attr('data-src'));\n    return img.on('load', this.showImageOnLoad);\n  };\n\n  CataloguePageView.prototype.showImageOnLoad = function(e) {\n    return $(e.currentTarget).fadeIn(300);\n  };\n\n  return CataloguePageView;\n\n})(View);\n","var Chaplin, Description, DescriptionPopupView, View, template, _ref,\n  __hasProp = {}.hasOwnProperty,\n  __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };\n\ntemplate = require('views/templates/description-popup');\n\nView = require('views/base/view');\n\nChaplin = require('chaplin');\n\nDescription = require('models/description');\n\nmodule.exports = DescriptionPopupView = (function(_super) {\n  __extends(DescriptionPopupView, _super);\n\n  function DescriptionPopupView() {\n    _ref = DescriptionPopupView.__super__.constructor.apply(this, arguments);\n    return _ref;\n  }\n\n  DescriptionPopupView.prototype.template = template;\n\n  DescriptionPopupView.prototype.className = 'popup';\n\n  DescriptionPopupView.prototype.tagName = 'div';\n\n  DescriptionPopupView.prototype.id = 'description-popup';\n\n  DescriptionPopupView.prototype.autoRender = false;\n\n  DescriptionPopupView.prototype.container = 'body';\n\n  DescriptionPopupView.prototype.listen = {\n    'catalogue:hideDescription mediator': 'closePopup',\n    'sync model': 'render'\n  };\n\n  DescriptionPopupView.prototype.events = {\n    'click .btn-close': 'closeAllDescriptions',\n    'click .btn-cart': 'showCartPopup'\n  };\n\n  DescriptionPopupView.prototype.closePopup = function() {\n    this.dispose();\n    return false;\n  };\n\n  DescriptionPopupView.prototype.closeAllDescriptions = function() {\n    this.publishEvent('catalogue:hideAllDescriptions');\n    return false;\n  };\n\n  DescriptionPopupView.prototype.initialize = function(options) {\n    var catalogue, error, hotspot, product, _ref1;\n    hotspot = options.hotspot;\n    catalogue = Chaplin.mediator.catalogue;\n    product = (_ref1 = catalogue.get('description')) != null ? _ref1.products[hotspot.title] : void 0;\n    if (!(product != null ? product.desc : void 0)) {\n      error = 'No description';\n    }\n    this.model = new Description({\n      left: hotspot.left,\n      top: hotspot.top,\n      polygonHeight: hotspot.polygonHeight,\n      polygonWidth: hotspot.polygonWidth,\n      offsetPosition: hotspot.offsetPosition,\n      page: hotspot.page,\n      productURL: hotspot.url,\n      title: hotspot.title,\n      product: product,\n      error: error\n    });\n    return this.render();\n  };\n\n  DescriptionPopupView.prototype.attach = function() {\n    var pagePosition;\n    DescriptionPopupView.__super__.attach.apply(this, arguments);\n    pagePosition = $(\"#map-\" + (this.model.get('page'))).offset();\n    return this.moveToPosition(pagePosition.left + parseInt(this.model.get('left')), pagePosition.top + parseInt(this.model.get('top')));\n  };\n\n  DescriptionPopupView.prototype.moveToPosition = function(left, top) {\n    if (this.model.get('offsetPosition').left > $('body').width() / 2) {\n      this.$el.css({\n        'left': left - this.$el.width() - 20\n      });\n      this.$el.addClass('right');\n    } else {\n      this.$el.css({\n        'left': left + 20 + this.model.get('polygonWidth')\n      });\n      this.$el.addClass('left');\n    }\n    if (top < Chaplin.mediator.catalogue.get('image_sizes').normal.height / 2) {\n      this.$el.css({\n        'top': top\n      });\n      return this.$el.addClass('top');\n    } else {\n      this.$el.css({\n        'top': top + this.model.get('polygonHeight') - this.$el.height()\n      });\n      return this.$el.addClass('bottom');\n    }\n  };\n\n  DescriptionPopupView.prototype.showCartPopup = function() {\n    return this.model.addToCart();\n  };\n\n  return DescriptionPopupView;\n\n})(View);\n","var Chaplin, EmailModel, EmailPopupView, View, template, _ref,\n  __hasProp = {}.hasOwnProperty,\n  __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };\n\ntemplate = require('views/templates/email-popup');\n\nView = require('views/base/view');\n\nChaplin = require('chaplin');\n\nEmailModel = require('models/email');\n\nmodule.exports = EmailPopupView = (function(_super) {\n  __extends(EmailPopupView, _super);\n\n  function EmailPopupView() {\n    _ref = EmailPopupView.__super__.constructor.apply(this, arguments);\n    return _ref;\n  }\n\n  EmailPopupView.prototype.template = template;\n\n  EmailPopupView.prototype.className = 'popup';\n\n  EmailPopupView.prototype.tagName = 'div';\n\n  EmailPopupView.prototype.id = 'email-popup';\n\n  EmailPopupView.prototype.autoRender = true;\n\n  EmailPopupView.prototype.container = 'body';\n\n  EmailPopupView.prototype.listen = {\n    'sentSuccess model': 'showSuccessMessage'\n  };\n\n  EmailPopupView.prototype.events = {\n    'click .btn-close': 'closePopup',\n    'submit form': 'send'\n  };\n\n  EmailPopupView.prototype.initialize = function() {\n    var info;\n    EmailPopupView.__super__.initialize.apply(this, arguments);\n    info = Chaplin.mediator.catalogue.get('info');\n    return this.model = new EmailModel({\n      catalogueFolder: info.folder,\n      catalogueName: info.name\n    });\n  };\n\n  EmailPopupView.prototype.closePopup = function() {\n    this.dispose();\n    return false;\n  };\n\n  EmailPopupView.prototype.send = function(e) {\n    var serializedData,\n      _this = this;\n    serializedData = this.$('#email-form').serializeObject();\n    this.model.set(serializedData);\n    this.publishEvent('catalogue:getActivePage', function(activePages) {\n      _this.model.set({\n        pageNum: activePages[0] || activePages[1]\n      });\n      return _this.model.save();\n    });\n    return false;\n  };\n\n  EmailPopupView.prototype.showSuccessMessage = function() {\n    this.$('.success-message').fadeIn();\n    return this.$('.popup-form').hide();\n  };\n\n  return EmailPopupView;\n\n})(View);\n","var Chaplin, HeaderView, Thumbnails, View, config, template, _ref,\n  __hasProp = {}.hasOwnProperty,\n  __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };\n\nChaplin = require('chaplin');\n\nView = require('views/base/view');\n\ntemplate = require('views/templates/header');\n\nThumbnails = require('views/thumbnails-view');\n\nconfig = require('config');\n\nmodule.exports = HeaderView = (function(_super) {\n  __extends(HeaderView, _super);\n\n  function HeaderView() {\n    _ref = HeaderView.__super__.constructor.apply(this, arguments);\n    return _ref;\n  }\n\n  HeaderView.prototype.autoRender = false;\n\n  HeaderView.prototype.className = 'header';\n\n  HeaderView.prototype.region = 'header';\n\n  HeaderView.prototype.id = 'header';\n\n  HeaderView.prototype.template = template;\n\n  HeaderView.prototype.listen = {\n    'catalogue:initCompleted mediator': 'showHeader'\n  };\n\n  HeaderView.prototype.regions = {\n    \"#thumbs-holder\": 'thumbs'\n  };\n\n  HeaderView.prototype.events = {\n    'click .btn-page-next': 'nextPage',\n    'click .btn-page-prev': 'prevPage',\n    'click .btn-page-start': 'toStart',\n    'click .btn-page-end': 'toEnd',\n    'submit #page-num-form': 'goToPage',\n    'click .btn-zoom-in': 'zoomIn',\n    'click .btn-zoom-out': 'zoomOut',\n    'click #btn-search': 'search',\n    'click #search-form': 'search',\n    'click #btn-print': 'print',\n    'click .btn-thumbnails': 'thumbnails',\n    'click .btn-list': 'list',\n    'click .btn-email': 'email',\n    'click #btn-download': 'download',\n    'click .btn-bookmarks-new': 'bookmarksOpen',\n    'click .btn-bookmarks-load': 'bookmarksOpen',\n    'click .btn-bookmarks-save': 'bookmarksOpen',\n    'click .btn-bookmarks-manage': 'bookmarksOpen',\n    'click.spec .btn-bookmarks-new': 'bookmarksNew',\n    'click.spec .btn-bookmarks-load': 'bookmarksLoad',\n    'click.spec .btn-bookmarks-save': 'bookmarksSave',\n    'click.spec .btn-bookmarks-manage': 'bookmarksManage',\n    'click .btn-notes-new': 'notesOpen',\n    'click .btn-notes-load': 'notesOpen',\n    'click .btn-notes-save': 'notesOpen',\n    'click .btn-notes-manage': 'notesOpen',\n    'click.spec .btn-notes-new': 'notesNew',\n    'click.spec .btn-notes-load': 'notesLoad',\n    'click.spec .btn-notes-save': 'notesSave',\n    'click.spec .btn-notes-manage': 'notesManage'\n  };\n\n  HeaderView.prototype.attach = function() {\n    HeaderView.__super__.attach.apply(this, arguments);\n    return this.createThumbnails();\n  };\n\n  HeaderView.prototype.showHeader = function() {\n    return this.$('nav').removeClass('hidden');\n  };\n\n  HeaderView.prototype.nextPage = function() {\n    this.publishEvent('catalogue:next');\n    return false;\n  };\n\n  HeaderView.prototype.prevPage = function() {\n    this.publishEvent('catalogue:previous');\n    return false;\n  };\n\n  HeaderView.prototype.toStart = function() {\n    this.publishEvent('catalogue:goToStart');\n    return false;\n  };\n\n  HeaderView.prototype.toEnd = function() {\n    this.publishEvent('catalogue:goToEnd');\n    return false;\n  };\n\n  HeaderView.prototype.goToPage = function() {\n    var page;\n    page = parseInt(this.$('#page-num').val());\n    if (!isNaN(page)) {\n      this.publishEvent('catalogue:goToPageByPageNumber', page);\n    }\n    return false;\n  };\n\n  HeaderView.prototype.search = function() {\n    var keyWord;\n    keyWord = this.$('#search').val();\n    if (!keyWord.length) {\n      return false;\n    }\n    this.publishEvent('catalogue:searchByKeyWord', keyWord);\n    return false;\n  };\n\n  HeaderView.prototype.zoomIn = function() {\n    this.publishEvent('catalogue:zoomIn');\n    return false;\n  };\n\n  HeaderView.prototype.zoomOut = function() {\n    this.publishEvent('catalogue:zoomOut');\n    return false;\n  };\n\n  HeaderView.prototype.print = function() {\n    this.publishEvent('catalogue:print');\n    return false;\n  };\n\n  HeaderView.prototype.thumbnails = function() {\n    this.publishEvent('catalogue:thumbnails');\n    return false;\n  };\n\n  HeaderView.prototype.list = function() {\n    this.publishEvent('catalogue:list');\n    return false;\n  };\n\n  HeaderView.prototype.bookmarksOpen = function() {\n    this.publishEvent('catalogue:bookmarksOpen');\n    return false;\n  };\n\n  HeaderView.prototype.bookmarksManage = function() {\n    this.publishEvent('catalogue:bookmarksManage');\n    return false;\n  };\n\n  HeaderView.prototype.bookmarksLoad = function() {\n    this.publishEvent('catalogue:bookmarksLoad');\n    return false;\n  };\n\n  HeaderView.prototype.bookmarksNew = function() {\n    this.publishEvent('catalogue:bookmarksNew');\n    return false;\n  };\n\n  HeaderView.prototype.bookmarksSave = function() {\n    return this.publishEvent('catalogue:bookmarksSave');\n  };\n\n  HeaderView.prototype.notesOpen = function() {\n    this.publishEvent('catalogue:notesOpen');\n    return false;\n  };\n\n  HeaderView.prototype.notesManage = function() {\n    this.publishEvent('catalogue:notesManage');\n    return false;\n  };\n\n  HeaderView.prototype.notesLoad = function() {\n    this.publishEvent('catalogue:notesLoad');\n    return false;\n  };\n\n  HeaderView.prototype.notesNew = function() {\n    this.publishEvent('catalogue:notesNew');\n    return false;\n  };\n\n  HeaderView.prototype.notesSave = function() {\n    this.publishEvent('catalogue:notesSave');\n    return false;\n  };\n\n  HeaderView.prototype.email = function() {\n    this.publishEvent('catalogue:sendEmail');\n    return false;\n  };\n\n  HeaderView.prototype.download = function() {\n    window.location.href = \"\" + config.api.root + \"catalogues/\" + (Chaplin.mediator.catalogue.get('info').folder) + \"/pdf_files/uploaded.pdf\";\n    return false;\n  };\n\n  HeaderView.prototype.createThumbnails = function() {\n    var thumbnails;\n    thumbnails = new Thumbnails({\n      region: 'thumbs'\n    });\n    return this.subview('thumbnails', thumbnails);\n  };\n\n  return HeaderView;\n\n})(View);\n","var Chaplin, ListPopupView, View, template, _ref,\n  __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },\n  __hasProp = {}.hasOwnProperty,\n  __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };\n\ntemplate = require('views/templates/list-popup');\n\nView = require('views/base/view');\n\nChaplin = require('chaplin');\n\nmodule.exports = ListPopupView = (function(_super) {\n  __extends(ListPopupView, _super);\n\n  function ListPopupView() {\n    this.changeActivePage = __bind(this.changeActivePage, this);\n    _ref = ListPopupView.__super__.constructor.apply(this, arguments);\n    return _ref;\n  }\n\n  ListPopupView.prototype.template = template;\n\n  ListPopupView.prototype.className = 'popup';\n\n  ListPopupView.prototype.tagName = 'div';\n\n  ListPopupView.prototype.id = 'list-popup';\n\n  ListPopupView.prototype.autoRender = true;\n\n  ListPopupView.prototype.container = 'body';\n\n  ListPopupView.prototype.events = {\n    'click .btn-close': 'closePopup',\n    'click .page-list li': 'goToPage'\n  };\n\n  ListPopupView.prototype.listen = {\n    'catalogue:pageTurned mediator': 'changeActivePage'\n  };\n\n  ListPopupView.prototype.closePopup = function() {\n    this.dispose();\n    return false;\n  };\n\n  ListPopupView.prototype.goToPage = function(e) {\n    var page;\n    page = $(e.currentTarget).attr('data-page');\n    this.publishEvent('catalogue:goToPage', parseInt(page));\n    return false;\n  };\n\n  ListPopupView.prototype.initialize = function() {\n    ListPopupView.__super__.initialize.apply(this, arguments);\n    return this.model = Chaplin.mediator.catalogue;\n  };\n\n  ListPopupView.prototype.attach = function() {\n    ListPopupView.__super__.attach.apply(this, arguments);\n    return this.publishEvent('catalogue:getActivePage', this.changeActivePage);\n  };\n\n  ListPopupView.prototype.changeActivePage = function(activePage) {\n    this.$(\"li\").removeClass('active');\n    return this.$(\"li[data-page='\" + activePage[0] + \"'], li[data-page='\" + activePage[1] + \"']\").addClass('active');\n  };\n\n  return ListPopupView;\n\n})(View);\n","var NoteView, View, template, _ref,\n  __hasProp = {}.hasOwnProperty,\n  __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };\n\nView = require('./base/view');\n\ntemplate = require('./templates/note');\n\nmodule.exports = NoteView = (function(_super) {\n  __extends(NoteView, _super);\n\n  function NoteView() {\n    _ref = NoteView.__super__.constructor.apply(this, arguments);\n    return _ref;\n  }\n\n  NoteView.prototype.template = template;\n\n  NoteView.prototype.tagName = 'li';\n\n  NoteView.prototype.className = 'item';\n\n  NoteView.prototype.events = {\n    'click .btn-delete': 'deleteNote',\n    'click .btn-edit': 'editNote',\n    'click .btn-save': 'saveNote'\n  };\n\n  NoteView.prototype.listen = {\n    'change model': 'render'\n  };\n\n  NoteView.prototype.deleteNote = function() {\n    this.model.destroy();\n    return false;\n  };\n\n  NoteView.prototype.editNote = function() {\n    this.publishEvent('note:startEdit', this.$el);\n    this.$el.addClass('edit');\n    return false;\n  };\n\n  NoteView.prototype.saveNote = function() {\n    this.model.save({\n      text: this.$('.item-text-edit').val()\n    });\n    this.$el.removeClass('edit');\n    this.publishEvent('note:finishEdit', this.$el);\n    return false;\n  };\n\n  return NoteView;\n\n})(View);\n","var Chaplin, Notes, NotesPopupView, NotesView, View, template, _ref,\n  __hasProp = {}.hasOwnProperty,\n  __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };\n\ntemplate = require('views/templates/notes-popup');\n\nView = require('views/base/view');\n\nNotes = require('models/notes');\n\nNotesView = require('views/notes-view');\n\nChaplin = require('chaplin');\n\nmodule.exports = NotesPopupView = (function(_super) {\n  __extends(NotesPopupView, _super);\n\n  function NotesPopupView() {\n    _ref = NotesPopupView.__super__.constructor.apply(this, arguments);\n    return _ref;\n  }\n\n  NotesPopupView.prototype.template = template;\n\n  NotesPopupView.prototype.className = 'popup wide';\n\n  NotesPopupView.prototype.tagName = 'div';\n\n  NotesPopupView.prototype.id = 'notes-popup';\n\n  NotesPopupView.prototype.autoRender = true;\n\n  NotesPopupView.prototype.container = 'body';\n\n  NotesPopupView.prototype.regions = {\n    '#notes-container': 'notes'\n  };\n\n  NotesPopupView.prototype.events = {\n    'click .btn-close': 'closePopup',\n    'click #btn-create-note-section': 'showCreateSection',\n    'click #btn-save-note-section': 'showSaveSection',\n    'click #btn-load-note-section': 'showLoadSection',\n    'click .btn-go-back': 'showManageSection',\n    'submit #load-section-credentials': 'loadNotes',\n    'submit #create-section-credentials': 'createNote',\n    'submit #save-section-credentials': 'saveNotes'\n  };\n\n  NotesPopupView.prototype.listen = {\n    'catalogue:notesManage mediator': 'showManageSection',\n    'catalogue:notesLoad mediator': 'showLoadSection',\n    'catalogue:notesNew mediator': 'showCreateSection',\n    'catalogue:notesSave mediator': 'showSaveSection',\n    'notes:loadStarted collection': 'showLoader',\n    'notes:loadCompleted collection': 'loadCompleted',\n    'notes:loadFailed collection': 'loadFailed',\n    'notes:saveStarted collection': 'showLoader',\n    'notes:saveCompleted collection': 'saveCompleted',\n    'note:startEdit mediator': 'startNoteEdit',\n    'note:finishEdit mediator': 'finishNoteEdit'\n  };\n\n  NotesPopupView.prototype.closePopup = function() {\n    this.dispose();\n    return false;\n  };\n\n  NotesPopupView.prototype.initialize = function() {\n    NotesPopupView.__super__.initialize.apply(this, arguments);\n    if (Chaplin.mediator.notes === null) {\n      Chaplin.mediator.notes = new Notes();\n    }\n    return this.collection = Chaplin.mediator.notes;\n  };\n\n  NotesPopupView.prototype.render = function() {\n    NotesPopupView.__super__.render.apply(this, arguments);\n    this.addNotesBlock('notes', this.collection);\n    return this.publishEvent('notes:update');\n  };\n\n  NotesPopupView.prototype.addCollectionListeners = function() {};\n\n  NotesPopupView.prototype.addNotesBlock = function(region, collection) {\n    var notesSubView;\n    notesSubView = new NotesView({\n      region: region,\n      collection: collection\n    });\n    return this.subview('notes', notesSubView);\n  };\n\n  NotesPopupView.prototype.showManageSection = function() {\n    this.$('.section').hide();\n    return this.$('#manage-section').show();\n  };\n\n  NotesPopupView.prototype.showLoadSection = function() {\n    this.$('.section').hide();\n    return this.$('#load-section').show();\n  };\n\n  NotesPopupView.prototype.showCreateSection = function() {\n    this.$('.section').hide();\n    return this.$('#create-section').show();\n  };\n\n  NotesPopupView.prototype.showSaveSection = function() {\n    this.$('.section').hide();\n    return this.$('#save-section').show();\n  };\n\n  NotesPopupView.prototype.createNote = function(event) {\n    var formData,\n      _this = this;\n    formData = $(event.currentTarget).serializeObject();\n    this.publishEvent('catalogue:getActivePage', function(activePage) {\n      _this.collection.create({\n        page_num: activePage[0] || activePage[1],\n        text: formData != null ? formData.text : void 0\n      }, _this.publishEvent('notes:getForPage', activePage));\n      return _this.showManageSection();\n    });\n    event.currentTarget.reset();\n    return false;\n  };\n\n  NotesPopupView.prototype.saveNotes = function(event) {\n    var catalogueInfo, formData;\n    formData = $(event.currentTarget).serializeObject();\n    catalogueInfo = Chaplin.mediator.catalogue.get('info');\n    this.collection.save(Chaplin.mediator.catalogue.get('id'), formData != null ? formData.email : void 0, formData != null ? formData.password : void 0);\n    event.currentTarget.reset();\n    return false;\n  };\n\n  NotesPopupView.prototype.saveCompleted = function() {\n    this.hideLoader();\n    alert('Your notes successfully saved');\n    return this.showManageSection();\n  };\n\n  NotesPopupView.prototype.loadNotes = function(event) {\n    var formData;\n    formData = $(event.currentTarget).serializeObject();\n    this.collection.fetch(Chaplin.mediator.catalogue.get('id'), formData != null ? formData.email : void 0, formData != null ? formData.password : void 0);\n    event.currentTarget.reset();\n    return false;\n  };\n\n  NotesPopupView.prototype.loadCompleted = function() {\n    this.hideLoader();\n    return this.showManageSection();\n  };\n\n  NotesPopupView.prototype.loadFailed = function(error) {\n    alert(error.error);\n    return this.hideLoader();\n  };\n\n  NotesPopupView.prototype.showLoader = function() {\n    return this.$('.loading').show();\n  };\n\n  NotesPopupView.prototype.hideLoader = function() {\n    return this.$('.loading').hide();\n  };\n\n  NotesPopupView.prototype.startNoteEdit = function(noteElement) {\n    var items;\n    items = this.$('.item');\n    items.addClass('hidden');\n    return items.filter(noteElement).removeClass('hidden');\n  };\n\n  NotesPopupView.prototype.finishNoteEdit = function(noteElement) {\n    return this.$('.item').removeClass('hidden');\n  };\n\n  return NotesPopupView;\n\n})(View);\n","var CollectionView, NoteView, NotesView, template, _ref,\n  __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },\n  __hasProp = {}.hasOwnProperty,\n  __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };\n\nCollectionView = require('./base/collection-view');\n\nNoteView = require('./note-view');\n\ntemplate = require('./templates/notes');\n\nmodule.exports = NotesView = (function(_super) {\n  __extends(NotesView, _super);\n\n  function NotesView() {\n    this.changeActivePage = __bind(this.changeActivePage, this);\n    this.getNotesForPage = __bind(this.getNotesForPage, this);\n    this.filterer = __bind(this.filterer, this);\n    _ref = NotesView.__super__.constructor.apply(this, arguments);\n    return _ref;\n  }\n\n  NotesView.prototype.template = template;\n\n  NotesView.prototype.itemView = NoteView;\n\n  NotesView.prototype.autoRender = true;\n\n  NotesView.prototype.listSelector = '#notes-list';\n\n  NotesView.prototype.itemSelector = '.item';\n\n  NotesView.prototype.currentPage = [];\n\n  NotesView.prototype.listen = {\n    'catalogue:pageTurned mediator': 'changeActivePage',\n    'reset collection': 'notesUpdate',\n    'notes:update mediator': 'notesUpdate',\n    'notes:getForPage mediator': 'getNotesForPage'\n  };\n\n  NotesView.prototype.initialize = function() {\n    return NotesView.__super__.initialize.apply(this, arguments);\n  };\n\n  NotesView.prototype.filterer = function(model) {\n    var pageNumber;\n    pageNumber = parseInt(model.get(\"page_num\"));\n    return -1 !== this.currentPage.indexOf(pageNumber);\n  };\n\n  NotesView.prototype.getNotesForPage = function(page) {\n    this.currentPage = page;\n    return this.renderAllItems();\n  };\n\n  NotesView.prototype.changeActivePage = function(activePage) {\n    this.getNotesForPage(activePage);\n    return false;\n  };\n\n  NotesView.prototype.notesUpdate = function() {\n    return this.publishEvent('catalogue:getActivePage', this.getNotesForPage);\n  };\n\n  return NotesView;\n\n})(CollectionView);\n","var ProgressBarView, View, template, _ref,\n  __hasProp = {}.hasOwnProperty,\n  __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };\n\ntemplate = require('views/templates/progressbar');\n\nView = require('views/base/view');\n\nmodule.exports = ProgressBarView = (function(_super) {\n  __extends(ProgressBarView, _super);\n\n  function ProgressBarView() {\n    _ref = ProgressBarView.__super__.constructor.apply(this, arguments);\n    return _ref;\n  }\n\n  ProgressBarView.prototype.template = template;\n\n  ProgressBarView.prototype[\"class\"] = 'progressbar';\n\n  ProgressBarView.prototype.autoRender = true;\n\n  ProgressBarView.prototype.listen = {\n    'progressUpdate mediator': 'updateProgress'\n  };\n\n  ProgressBarView.prototype.updateProgress = function(progress) {\n    if (progress >= 1) {\n      this.$el.hide();\n      return;\n    }\n    progress = Math.round(progress * 100) + '%';\n    this.$('.meter div').css({\n      width: progress\n    });\n    return this.$('.progress span').html(progress);\n  };\n\n  return ProgressBarView;\n\n})(View);\n","var Chaplin, PurchasePopupView, View, template, _ref,\n  __hasProp = {}.hasOwnProperty,\n  __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };\n\ntemplate = require('views/templates/purchase-popup');\n\nView = require('views/base/view');\n\nChaplin = require('chaplin');\n\nmodule.exports = PurchasePopupView = (function(_super) {\n  __extends(PurchasePopupView, _super);\n\n  function PurchasePopupView() {\n    _ref = PurchasePopupView.__super__.constructor.apply(this, arguments);\n    return _ref;\n  }\n\n  PurchasePopupView.prototype.template = template;\n\n  PurchasePopupView.prototype.className = 'popup';\n\n  PurchasePopupView.prototype.tagName = 'div';\n\n  PurchasePopupView.prototype.id = 'purchase-popup';\n\n  PurchasePopupView.prototype.autoRender = true;\n\n  PurchasePopupView.prototype.container = 'body';\n\n  PurchasePopupView.prototype.listen = {\n    'catalogue:hideDescription mediator': 'closePopup'\n  };\n\n  PurchasePopupView.prototype.events = {\n    'click .btn-close': 'close',\n    'click input[type=\"submit\"]': 'submitForm',\n    'click input[type=\"reset\"]': 'cancelForm'\n  };\n\n  PurchasePopupView.prototype.closePopup = function() {\n    this.dispose();\n    return false;\n  };\n\n  PurchasePopupView.prototype.close = function() {\n    return this.publishEvent('catalogue:hideAllDescriptions');\n  };\n\n  PurchasePopupView.prototype.cancelForm = function() {\n    return this.publishEvent('catalogue:hideAllDescriptions');\n  };\n\n  PurchasePopupView.prototype.submitForm = function(e) {\n    var def, serializedForm,\n      _this = this;\n    e.preventDefault();\n    serializedForm = this.$('form').serialize();\n    def = this.model.pushPurchaseMessage(serializedForm);\n    def.done(function() {\n      return _this.showSuccessMessage();\n    });\n    return false;\n  };\n\n  PurchasePopupView.prototype.showSuccessMessage = function() {\n    this.$('.success-area').fadeIn();\n    return this.$('.form-area').hide();\n  };\n\n  return PurchasePopupView;\n\n})(View);\n","var Chaplin, SearchPopupView, View, template, _ref,\n  __hasProp = {}.hasOwnProperty,\n  __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };\n\ntemplate = require('views/templates/search-popup');\n\nView = require('views/base/view');\n\nChaplin = require('chaplin');\n\nmodule.exports = SearchPopupView = (function(_super) {\n  __extends(SearchPopupView, _super);\n\n  function SearchPopupView() {\n    _ref = SearchPopupView.__super__.constructor.apply(this, arguments);\n    return _ref;\n  }\n\n  SearchPopupView.prototype.template = template;\n\n  SearchPopupView.prototype.className = 'popup';\n\n  SearchPopupView.prototype.tagName = 'div';\n\n  SearchPopupView.prototype.id = 'search-popup';\n\n  SearchPopupView.prototype.autoRender = true;\n\n  SearchPopupView.prototype.container = 'body';\n\n  SearchPopupView.prototype.listen = {\n    'catalogue:search:complete mediator': 'searchComplete'\n  };\n\n  SearchPopupView.prototype.events = {\n    'click .btn-close': 'closePopup',\n    'click .page-list li': 'goToPage'\n  };\n\n  SearchPopupView.prototype.closePopup = function() {\n    this.dispose();\n    return false;\n  };\n\n  SearchPopupView.prototype.goToPage = function(e) {\n    var page;\n    page = $(e.currentTarget).attr('data-page');\n    this.publishEvent('catalogue:goToPage', parseInt(page));\n    this.closePopup();\n    return false;\n  };\n\n  SearchPopupView.prototype.searchComplete = function(result) {\n    this.model = new Chaplin.Model(result);\n    return this.render();\n  };\n\n  return SearchPopupView;\n\n})(View);\n","var BookmarksPopup, DescriptionPopup, EmailPopup, ListPopup, NotesPopup, PurchasePopup, SearchPopup, SiteView, ThumbnailPopup, View, template, utils, _ref,\n  __hasProp = {}.hasOwnProperty,\n  __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };\n\nView = require('views/base/view');\n\ntemplate = require('views/templates/site');\n\nSearchPopup = require('views/search-popup-view');\n\nListPopup = require('views/list-popup-view');\n\nBookmarksPopup = require('views/bookmarks-popup-view');\n\nEmailPopup = require('views/email-popup-view');\n\nNotesPopup = require('views/notes-popup-view');\n\nDescriptionPopup = require('views/description-popup-view');\n\nPurchasePopup = require('views/purchase-popup-view');\n\nThumbnailPopup = require('views/thumbnail-popup-view');\n\nutils = require('lib/utils');\n\nmodule.exports = SiteView = (function(_super) {\n  __extends(SiteView, _super);\n\n  function SiteView() {\n    _ref = SiteView.__super__.constructor.apply(this, arguments);\n    return _ref;\n  }\n\n  SiteView.prototype.container = 'body';\n\n  SiteView.prototype.id = 'site-container';\n\n  SiteView.prototype.searchPopup = null;\n\n  SiteView.prototype.emailPopup = null;\n\n  SiteView.prototype.descriptionPopup = null;\n\n  SiteView.prototype.purchasePopup = null;\n\n  SiteView.prototype.regions = {\n    '#header-container': 'header',\n    '#page-container': 'main'\n  };\n\n  SiteView.prototype.template = template;\n\n  SiteView.prototype.listen = {\n    'catalogue:search:start mediator': 'createSearchPopup',\n    'catalogue:list mediator': 'createListPopup',\n    'catalogue:bookmarksOpen mediator': 'createBookmarksPopup',\n    'catalogue:sendEmail mediator': 'createEmailPopup',\n    'catalogue:notesOpen mediator': 'createNotesPopup',\n    'catalogue:showDescription mediator': 'createDescriptionPopup',\n    'catalogue:showAddToCartPopup mediator': 'createPurchasePopup',\n    'thumnails:showPopup mediator': 'createThumbnailPopup'\n  };\n\n  SiteView.prototype.createSearchPopup = function() {\n    var _ref1;\n    if ((_ref1 = this.searchPopup) != null) {\n      _ref1.dispose();\n    }\n    return this.searchPopup = new SearchPopup();\n  };\n\n  SiteView.prototype.createListPopup = function() {\n    var _ref1;\n    if ((_ref1 = this.listPopup) != null) {\n      _ref1.dispose();\n    }\n    return this.listPopup = new ListPopup();\n  };\n\n  SiteView.prototype.createBookmarksPopup = function() {\n    var _ref1;\n    if ((_ref1 = this.bookmarksPopup) != null) {\n      _ref1.dispose();\n    }\n    return this.bookmarksPopup = new BookmarksPopup();\n  };\n\n  SiteView.prototype.createEmailPopup = function() {\n    var _ref1;\n    if ((_ref1 = this.emailPopup) != null) {\n      _ref1.dispose();\n    }\n    return this.emailPopup = new EmailPopup();\n  };\n\n  SiteView.prototype.createNotesPopup = function() {\n    var _ref1;\n    if ((_ref1 = this.notesPopup) != null) {\n      _ref1.dispose();\n    }\n    return this.notesPopup = new NotesPopup();\n  };\n\n  SiteView.prototype.createDescriptionPopup = function(hotspot) {\n    var _ref1;\n    if (utils.isMobile.isAndroidNativeBrawser()) {\n      return;\n    }\n    if ((_ref1 = this.descriptionPopup) != null) {\n      _ref1.dispose();\n    }\n    return this.descriptionPopup = new DescriptionPopup({\n      hotspot: hotspot\n    });\n  };\n\n  SiteView.prototype.createPurchasePopup = function(model) {\n    var _ref1;\n    if ((_ref1 = this.purchasePopup) != null) {\n      _ref1.dispose();\n    }\n    return this.purchasePopup = new PurchasePopup({\n      model: model\n    });\n  };\n\n  SiteView.prototype.createThumbnailPopup = function(activePage, position) {\n    var _ref1;\n    if ((_ref1 = this.thumbnailPopup) != null) {\n      _ref1.dispose();\n    }\n    return this.thumbnailPopup = new ThumbnailPopup({\n      activePage: activePage,\n      position: position\n    });\n  };\n\n  return SiteView;\n\n})(View);\n","module.exports = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {\n  this.compilerInfo = [4,'>= 1.0.0'];\nhelpers = this.merge(helpers, Handlebars.helpers); data = data || {};\n  var buffer = \"\", stack1, functionType=\"function\", escapeExpression=this.escapeExpression;\n\n\n  buffer += \"<li>\\n    <span>\";\n  if (stack1 = helpers.text) { stack1 = stack1.call(depth0, {hash:{},data:data}); }\n  else { stack1 = depth0.text; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }\n  buffer += escapeExpression(stack1)\n    + \"</span>\\n    <div class=\\\"btn-delete\\\">&#x2716;</div>\\n</li>\";\n  return buffer;\n  });","module.exports = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {\n  this.compilerInfo = [4,'>= 1.0.0'];\nhelpers = this.merge(helpers, Handlebars.helpers); data = data || {};\n  \n\n\n  return \"<div class=\\\"btn-close\\\">&#x2716;</div>\\n<div class=\\\"popup-inner\\\">\\n    <h2>Bookmarks:</h2>\\n    <div class=\\\"sections\\\">\\n        <div class=\\\"section\\\" id=\\\"manage-section\\\">\\n            <div>\\n                <h3>Manage bookmarks</h3>\\n                <ul class=\\\"bookmarks-menu\\\">\\n                    <li>\\n                        <input type=\\\"button\\\" id=\\\"btn-create-bookmark-section\\\" value=\\\"Create\\\"/>\\n                    </li>\\n                    <li>\\n                        <input type=\\\"button\\\" id=\\\"btn-load-bookmark-section\\\" value=\\\"Load\\\"/>\\n                    </li>\\n                    <li>\\n                        <input type=\\\"button\\\" id=\\\"btn-save-bookmark-section\\\" value=\\\"Save\\\"/>\\n                    </li>\\n                </ul>\\n                <p>\\n                    <strong>Click a bookmark to go that page</strong>\\n                </p>\\n                <div id=\\\"bookmarks-container\\\">\\n                </div>\\n            </div>\\n        </div>\\n        <div class=\\\"section\\\" id=\\\"save-section\\\">\\n            <div>\\n                <h3>Save your bookmarks</h3>\\n                <form id=\\\"save-section-credentials\\\">\\n                    <p>Your email</p>\\n                    <input type=\\\"text\\\" required=\\\"required\\\" name=\\\"email\\\" value=\\\"\\\"/>\\n                    <p>Your password</p>\\n                    <input type=\\\"password\\\" required=\\\"required\\\" name=\\\"password\\\" value=\\\"\\\"/>\\n                    <ul class=\\\"bookmarks-menu right\\\">\\n                        <li>\\n                            <input type=\\\"submit\\\" value=\\\"Save\\\"/>\\n                        </li>\\n                        <li>\\n                            <input type=\\\"button\\\" class=\\\"btn-go-back\\\" value=\\\"Back to list\\\"/>\\n                        </li>\\n                    </ul>\\n                </form>\\n            </div>\\n        </div>\\n        \\n        <div class=\\\"section\\\" id=\\\"load-section\\\">\\n            <h3>Open your saved bookmarks</h3>\\n                <p>Your email</p>\\n                <form id=\\\"load-section-credentials\\\">\\n                    <input type=\\\"email\\\" required=\\\"required\\\" name=\\\"email\\\" value=\\\"\\\"/>\\n                    <p>Your password</p>\\n                    <input type=\\\"password\\\" required=\\\"required\\\" name=\\\"password\\\" value=\\\"\\\"/>\\n                    <ul class=\\\"bookmarks-menu right\\\">\\n                        <li>\\n                            <input type=\\\"submit\\\" id=\\\"btn-open-bookmarks-list\\\" value=\\\"Open\\\"/>\\n                        </li>\\n                        <li>\\n                            <input type=\\\"button\\\" class=\\\"btn-go-back\\\" value=\\\"Back to list\\\"/>\\n                        </li>\\n                    </ul>\\n                </form>\\n        </div>\\n        <div class=\\\"section\\\" id=\\\"create-section\\\">\\n            <div>\\n                <h3>Create a new bookmarks for this page</h3>\\n                <p>Name this bookmark</p>\\n                <form id=\\\"create-section-credentials\\\">\\n                    <input type=\\\"text\\\" required=\\\"required\\\" name=\\\"text\\\" value=\\\"\\\"/>\\n                    <ul class=\\\"bookmarks-menu right\\\">\\n                        <li>\\n                            <input type=\\\"submit\\\" value=\\\"Add\\\"/>\\n                        </li>\\n                        <li>\\n                            <input type=\\\"button\\\" class=\\\"btn-go-back\\\" value=\\\"Back to list\\\"/>\\n                        </li>\\n                    </ul>\\n                </form>\\n            </div>\\n        </div>\\n    </div>\\n    <div class=\\\"loading black-overlay\\\"></div>\\n</div>\\n\";\n  });","module.exports = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {\n  this.compilerInfo = [4,'>= 1.0.0'];\nhelpers = this.merge(helpers, Handlebars.helpers); data = data || {};\n  \n\n\n  return \"<ul id=\\\"bookmarks-list\\\">\\n</ul>\";\n  });","module.exports = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {\n  this.compilerInfo = [4,'>= 1.0.0'];\nhelpers = this.merge(helpers, Handlebars.helpers); data = data || {};\n  var buffer = \"\", stack1, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, functionType=\"function\", self=this;\n\nfunction program1(depth0,data,depth1) {\n  \n  var buffer = \"\", stack1, stack2, options;\n  buffer += \"\\n            <div class=\\\"page\\\" data-page-num=\\\"\";\n  if (stack1 = helpers.page_number) { stack1 = stack1.call(depth0, {hash:{},data:data}); }\n  else { stack1 = depth0.page_number; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }\n  buffer += escapeExpression(stack1)\n    + \"\\\">\\n                <div class=\\\"prev-next-page\\\"></div>\\n                <img data-src=\\\"\"\n    + escapeExpression(((stack1 = ((stack1 = ((stack1 = depth1.config),stack1 == null || stack1 === false ? stack1 : stack1.api)),stack1 == null || stack1 === false ? stack1 : stack1.root)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))\n    + \"catalogues/\"\n    + escapeExpression(((stack1 = ((stack1 = depth1.info),stack1 == null || stack1 === false ? stack1 : stack1.folder)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))\n    + \"/\";\n  options = {hash:{},data:data};\n  buffer += escapeExpression(((stack1 = helpers.getActualImage || depth0.getActualImage),stack1 ? stack1.call(depth0, depth0.page_number, options) : helperMissing.call(depth0, \"getActualImage\", depth0.page_number, options)))\n    + \"\\\" width=\\\"\"\n    + escapeExpression(((stack1 = ((stack1 = ((stack1 = depth1.image_sizes),stack1 == null || stack1 === false ? stack1 : stack1.normal)),stack1 == null || stack1 === false ? stack1 : stack1.width)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))\n    + \"\\\" height=\\\"\"\n    + escapeExpression(((stack1 = ((stack1 = ((stack1 = depth1.image_sizes),stack1 == null || stack1 === false ? stack1 : stack1.normal)),stack1 == null || stack1 === false ? stack1 : stack1.height)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))\n    + \"\\\" alt=\\\"\\\" class=\\\"page-image\\\" />\\n                <div class=\\\"normal\\\">\\n                    <svg version=\\\"1.2\\\" baseProfile=\\\"tiny\\\" width=\\\"\"\n    + escapeExpression(((stack1 = ((stack1 = ((stack1 = depth1.image_sizes),stack1 == null || stack1 === false ? stack1 : stack1.normal)),stack1 == null || stack1 === false ? stack1 : stack1.width)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))\n    + \"\\\" height=\\\"\"\n    + escapeExpression(((stack1 = ((stack1 = ((stack1 = depth1.image_sizes),stack1 == null || stack1 === false ? stack1 : stack1.normal)),stack1 == null || stack1 === false ? stack1 : stack1.height)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))\n    + \"\\\" id=\\\"map-\";\n  if (stack2 = helpers.db_id) { stack2 = stack2.call(depth0, {hash:{},data:data}); }\n  else { stack2 = depth0.db_id; stack2 = typeof stack2 === functionType ? stack2.apply(depth0) : stack2; }\n  buffer += escapeExpression(stack2)\n    + \"\\\">\\n                        <defs>\\n                            <mask id=\\\"mask-\";\n  if (stack2 = helpers.db_id) { stack2 = stack2.call(depth0, {hash:{},data:data}); }\n  else { stack2 = depth0.db_id; stack2 = typeof stack2 === functionType ? stack2.apply(depth0) : stack2; }\n  buffer += escapeExpression(stack2)\n    + \"\\\">\\n                                <rect x=\\\"0\\\" y=\\\"0\\\" width=\\\"100%\\\" height=\\\"100%\\\" fill=\\\"#666\\\" />\\n                                <polygon\\n                                    fill=\\\"#000000\\\"\\n                                    fill-opacity=\\\"1\\\"\\n                                    stroke-opacity=\\\"1\\\"\\n                                />\\n                            </mask>\\n                        </defs>\\n                        <rect x=\\\"-5\\\" y=\\\"-5\\\" width=\\\"105%\\\" height=\\\"105%\\\" fill=\\\"#000000\\\" mask=\\\"url(#mask-\";\n  if (stack2 = helpers.db_id) { stack2 = stack2.call(depth0, {hash:{},data:data}); }\n  else { stack2 = depth0.db_id; stack2 = typeof stack2 === functionType ? stack2.apply(depth0) : stack2; }\n  buffer += escapeExpression(stack2)\n    + \")\\\" visibility=\\\"hidden\\\"/>\\n                        <g>\\n                            \";\n  stack2 = helpers.each.call(depth0, depth0.hotspots, {hash:{},inverse:self.noop,fn:self.programWithDepth(2, program2, data, depth0, depth1),data:data});\n  if(stack2 || stack2 === 0) { buffer += stack2; }\n  buffer += \"\\n\\n                        </g>\\n                    </svg>\\n                </div>\\n            </div>\\n            \";\n  return buffer;\n  }\nfunction program2(depth0,data,depth1,depth2) {\n  \n  var buffer = \"\", stack1, stack2, options;\n  buffer += \"\\n                                <polygon\\n                                    points=\\\"\";\n  options = {hash:{},data:data};\n  buffer += escapeExpression(((stack1 = helpers.getCoordsLine || depth0.getCoordsLine),stack1 ? stack1.call(depth0, depth0.points, ((stack1 = depth2.image_sizes),stack1 == null || stack1 === false ? stack1 : stack1.scaleFactor), options) : helperMissing.call(depth0, \"getCoordsLine\", depth0.points, ((stack1 = depth2.image_sizes),stack1 == null || stack1 === false ? stack1 : stack1.scaleFactor), options)))\n    + \"\\\"\\n                                    fill-opacity=\\\"0\\\"\\n                                    stroke-opacity=\\\"0\\\"\\n                                    stroke=\\\"#\"\n    + escapeExpression(((stack1 = ((stack1 = depth2.info),stack1 == null || stack1 === false ? stack1 : stack1.hotspot_outlinecolour)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))\n    + \"\\\"\\n                                    data-url=\\\"\";\n  options = {hash:{},data:data};\n  buffer += escapeExpression(((stack1 = helpers.getURL || depth0.getURL),stack1 ? stack1.call(depth0, depth0.url, depth0.page, options) : helperMissing.call(depth0, \"getURL\", depth0.url, depth0.page, options)))\n    + \"\\\"\\n                                    title=\\\"\";\n  if (stack2 = helpers.link_to_product) { stack2 = stack2.call(depth0, {hash:{},data:data}); }\n  else { stack2 = depth0.link_to_product; stack2 = typeof stack2 === functionType ? stack2.apply(depth0) : stack2; }\n  buffer += escapeExpression(stack2)\n    + \"\\\"\\n                                    data-alt-tag=\\\"\";\n  if (stack2 = helpers.alt_tag) { stack2 = stack2.call(depth0, {hash:{},data:data}); }\n  else { stack2 = depth0.alt_tag; stack2 = typeof stack2 === functionType ? stack2.apply(depth0) : stack2; }\n  buffer += escapeExpression(stack2)\n    + \"\\\"\\n                                    data-page=\\\"\"\n    + escapeExpression(((stack1 = depth1.db_id),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))\n    + \"\\\"\\n                                />\\n                            \";\n  return buffer;\n  }\n\n  buffer += \"<div id=\\\"images-preload-progress\\\">\\n</div> \\n<div class=\\\"magazine-viewport zoomedOut\\\">\\n    <div class=\\\"container\\\">\\n        <div id=\\\"flipbook\\\">\\n            \";\n  stack1 = helpers.each.call(depth0, depth0.pages, {hash:{},inverse:self.noop,fn:self.programWithDepth(1, program1, data, depth0),data:data});\n  if(stack1 || stack1 === 0) { buffer += stack1; }\n  buffer += \"\\n        </div>\\n    </div>\\n</div>\\n\";\n  return buffer;\n  });","module.exports = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {\n  this.compilerInfo = [4,'>= 1.0.0'];\nhelpers = this.merge(helpers, Handlebars.helpers); data = data || {};\n  var buffer = \"\", stack1, functionType=\"function\", escapeExpression=this.escapeExpression, helperMissing=helpers.helperMissing, self=this;\n\nfunction program1(depth0,data) {\n  \n  var buffer = \"\", stack1;\n  buffer += \"\\n        <h3 class=\\\"error\\\">\";\n  if (stack1 = helpers.error) { stack1 = stack1.call(depth0, {hash:{},data:data}); }\n  else { stack1 = depth0.error; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }\n  buffer += escapeExpression(stack1)\n    + \"</h3>\\n    \";\n  return buffer;\n  }\n\nfunction program3(depth0,data) {\n  \n  var buffer = \"\", stack1;\n  buffer += \"\\n        \";\n  stack1 = helpers['if'].call(depth0, depth0.product, {hash:{},inverse:self.program(10, program10, data),fn:self.program(4, program4, data),data:data});\n  if(stack1 || stack1 === 0) { buffer += stack1; }\n  buffer += \"\\n    \";\n  return buffer;\n  }\nfunction program4(depth0,data) {\n  \n  var buffer = \"\", stack1, stack2;\n  buffer += \"\\n            <button class=\\\"btn-cart shiny-blue\\\">Add Product</button>\\n            <h1>\"\n    + escapeExpression(((stack1 = ((stack1 = depth0.product),stack1 == null || stack1 === false ? stack1 : stack1.title)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))\n    + \"</h1>\\n            <div class=\\\"content-holder\\\">\\n                <div class=\\\"sub-inner\\\">\\n                        \";\n  stack2 = helpers['with'].call(depth0, depth0.product, {hash:{},inverse:self.noop,fn:self.program(5, program5, data),data:data});\n  if(stack2 || stack2 === 0) { buffer += stack2; }\n  buffer += \"\\n\\n                    <!--\";\n  stack2 = helpers.each.call(depth0, depth0.success, {hash:{},inverse:self.noop,fn:self.program(7, program7, data),data:data});\n  if(stack2 || stack2 === 0) { buffer += stack2; }\n  buffer += \"-->\\n                </div>\\n            </div>\\n        \";\n  return buffer;\n  }\nfunction program5(depth0,data) {\n  \n  var buffer = \"\", stack1, stack2, options;\n  buffer += \"\\n\\n                            <div class=\\\"desc\\\">\\n                                <img src=\\\"\";\n  options = {hash:{},data:data};\n  buffer += escapeExpression(((stack1 = helpers.constructImage || depth0.constructImage),stack1 ? stack1.call(depth0, depth0.imageref, options) : helperMissing.call(depth0, \"constructImage\", depth0.imageref, options)))\n    + \"\\\" class=\\\"product-photo\\\"/>\\n                                \";\n  if (stack2 = helpers.desc) { stack2 = stack2.call(depth0, {hash:{},data:data}); }\n  else { stack2 = depth0.desc; stack2 = typeof stack2 === functionType ? stack2.apply(depth0) : stack2; }\n  buffer += escapeExpression(stack2)\n    + \"\\n                            </div>\\n                        \";\n  return buffer;\n  }\n\nfunction program7(depth0,data) {\n  \n  var buffer = \"\", stack1;\n  buffer += \"-->\\n                        <!--\";\n  stack1 = helpers.each.call(depth0, depth0, {hash:{},inverse:self.noop,fn:self.program(8, program8, data),data:data});\n  if(stack1 || stack1 === 0) { buffer += stack1; }\n  buffer += \"-->\\n                    <!--\";\n  return buffer;\n  }\nfunction program8(depth0,data) {\n  \n  var buffer = \"\", stack1, options;\n  buffer += \"-->\\n                            <!--\";\n  options = {hash:{},data:data};\n  buffer += escapeExpression(((stack1 = helpers.filterTag || depth0.filterTag),stack1 ? stack1.call(depth0, ((stack1 = data),stack1 == null || stack1 === false ? stack1 : stack1.key), depth0, options) : helperMissing.call(depth0, \"filterTag\", ((stack1 = data),stack1 == null || stack1 === false ? stack1 : stack1.key), depth0, options)))\n    + \"-->\\n                        <!--\";\n  return buffer;\n  }\n\nfunction program10(depth0,data) {\n  \n  \n  return \"\\n            <div class=\\\"loading black-overlay\\\"></div>\\n        \";\n  }\n\n  buffer += \"<div class=\\\"btn-close\\\">&#x2716;</div>\\n\\n<div class=\\\"popup-inner\\\">\\n    \";\n  stack1 = helpers['if'].call(depth0, depth0.error, {hash:{},inverse:self.program(3, program3, data),fn:self.program(1, program1, data),data:data});\n  if(stack1 || stack1 === 0) { buffer += stack1; }\n  buffer += \"\\n</div>\\n\";\n  return buffer;\n  });","module.exports = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {\n  this.compilerInfo = [4,'>= 1.0.0'];\nhelpers = this.merge(helpers, Handlebars.helpers); data = data || {};\n  \n\n\n  return \"<div class=\\\"btn-close\\\">&#x2716;</div>\\n<div class=\\\"popup-inner\\\">\\n    <h2>Send to a friend:</h2>\\n    <form action=\\\"#\\\" id=\\\"email-form\\\">\\n        <fieldset class=\\\"popup-form\\\">\\n            <strong>Complete this form to send a link to a friend</strong>\\n            <div class=\\\"form-row\\\">\\n                <label for=\\\"userName\\\">Your name</label>\\n                <input type=\\\"text\\\" id=\\\"userName\\\" name=\\\"userName\\\" required=\\\"required\\\"/>\\n            </div>\\n            <div class=\\\"form-row\\\">\\n                <label for=\\\"userEmail\\\">Your email address</label>\\n                <input type=\\\"email\\\" id=\\\"userEmail\\\" name=\\\"userEmail\\\" required=\\\"required\\\"/>\\n            </div>\\n            <div class=\\\"form-row\\\">\\n                <label for=\\\"userMessage\\\">Add a message of your own</label>\\n                <textarea name=\\\"userMessage\\\" id=\\\"userMessage\\\" cols=\\\"30\\\" rows=\\\"10\\\" required=\\\"required\\\"></textarea>\\n            </div>\\n            <div class=\\\"form-row\\\">\\n                <label for=\\\"friendName\\\">Your friend's name</label>\\n                <input type=\\\"text\\\" id=\\\"friendName\\\" name=\\\"friendName\\\" required=\\\"required\\\"/>\\n            </div>\\n            <div class=\\\"form-row\\\">\\n                <label for=\\\"friendEmail\\\">Your friend's email address</label>\\n                <input type=\\\"email\\\" id=\\\"friendEmail\\\" name=\\\"friendEmail\\\" required=\\\"required\\\"/>\\n            </div>\\n            <div class=\\\"form-row check-box-holder\\\">\\n                <button id=\\\"submit-form\\\">Send</button>\\n                <!--<input type=\\\"checkbox\\\" id=\\\"uploadPhoto\\\" name=\\\"uploadPhoto\\\"/>-->\\n                <!--<label for=\\\"uploadPhoto\\\">send the catalogue with uploaded logo?</label>-->\\n            </div>\\n        </fieldset>\\n    </form>\\n    <div class=\\\"success-message\\\">\\n        <p>The email was sent successfully.</p>\\n        <p>Thank you.</p>\\n    </div>\\n</div>\\n\";\n  });","module.exports = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {\n  this.compilerInfo = [4,'>= 1.0.0'];\nhelpers = this.merge(helpers, Handlebars.helpers); data = data || {};\n  \n\n\n  return \"<nav id=\\\"main-nav\\\" class=\\\"hidden\\\">\\n    <div class=\\\"wrapper\\\">\\n        <div class=\\\"nav-block\\\">\\n            <a href=\\\"#\\\" class=\\\"btn-bookmarks-manage icon\\\">Manage</a>\\n            <a href=\\\"#\\\" class=\\\"btn-list icon\\\">List</a>\\n            <a class=\\\"btn-page-start icon\\\" href=\\\"#\\\"><i class=\\\"icon-backward\\\"></i>&nbsp;</a>\\n            <a class=\\\"btn-page-prev icon\\\" href=\\\"#\\\"><i class=\\\"icon-caret-left icon-large\\\"></i>&nbsp;</a>\\n            <div id=\\\"thumbs-holder\\\"></div>\\n            <div class=\\\"controls-holder\\\">\\n                <a class=\\\"btn-page-next icon\\\" href=\\\"#\\\">&nbsp;<i class=\\\"icon-caret-right icon-large\\\"></i></a>\\n                <a class=\\\"btn-page-end icon\\\" href=\\\"#\\\">&nbsp;<i class=\\\"icon-forward\\\"></i></a>\\n                <form action=\\\"#\\\" id=\\\"page-num-form\\\">\\n                    <input type=\\\"text\\\" name=\\\"\\\" id=\\\"page-num\\\"/>\\n                    <button id=\\\"btn-go-to-page\\\" class=\\\"icon\\\">GO</button>\\n                </form>\\n                <form action=\\\"#\\\" id=\\\"form-search\\\">\\n                    <input type=\\\"text\\\" name=\\\"\\\" id=\\\"search\\\"/>\\n                    <button id=\\\"btn-search\\\" class=\\\"icon\\\">Search</button>\\n                </form>\\n                <a href=\\\"#\\\" id=\\\"btn-print\\\" class=\\\"icon\\\">Print</a>\\n                <a href=\\\"#\\\" id=\\\"btn-download\\\" class=\\\"icon\\\">Download</a>\\n                <!--<a href=\\\"#\\\" id=\\\"btn-help\\\" class=\\\"icon\\\">Help</a>-->\\n                <!--<a href=\\\"#\\\" id=\\\"btn-close\\\" class=\\\"icon\\\">Close</a>-->\\n            </div>\\n        </div>\\n        <!--<div class=\\\"nav-block menu-holder\\\">-->\\n            <!--<ul>-->\\n                <!--&lt;!&ndash;<li><a href=\\\"#\\\" class=\\\"btn-list\\\">List</a></li>&ndash;&gt;-->\\n                <!--&lt;!&ndash;<li>&ndash;&gt;-->\\n                    <!--&lt;!&ndash;<span>Pages</span>&ndash;&gt;-->\\n                    <!--&lt;!&ndash;<div class=\\\"drop\\\">&ndash;&gt;-->\\n                        <!--&lt;!&ndash;<ul>&ndash;&gt;-->\\n                            <!--&lt;!&ndash;<li><a href=\\\"#\\\" class=\\\"btn-thumbnails\\\">Thumbnails</a></li>&ndash;&gt;-->\\n\\n                        <!--&lt;!&ndash;</ul>&ndash;&gt;-->\\n                    <!--&lt;!&ndash;</div>&ndash;&gt;-->\\n                <!--&lt;!&ndash;</li>&ndash;&gt;-->\\n                <!--&lt;!&ndash;<li>&ndash;&gt;-->\\n                    <!--&lt;!&ndash;<span>Bookmarks</span>&ndash;&gt;-->\\n                    <!--&lt;!&ndash;<div class=\\\"drop\\\">&ndash;&gt;-->\\n                        <!--&lt;!&ndash;<ul>&ndash;&gt;-->\\n                            <!--&lt;!&ndash;<li><a href=\\\"#\\\" class=\\\"btn-bookmarks-manage\\\">Manage</a></li>&ndash;&gt;-->\\n                            <!--&lt;!&ndash;<li><a href=\\\"#\\\" class=\\\"btn-bookmarks-new\\\">New</a></li>&ndash;&gt;-->\\n                            <!--&lt;!&ndash;<li><a href=\\\"#\\\" class=\\\"btn-bookmarks-load\\\">Load</a></li>&ndash;&gt;-->\\n                            <!--&lt;!&ndash;<li><a href=\\\"#\\\" class=\\\"btn-bookmarks-save\\\">Save</a></li>&ndash;&gt;-->\\n                        <!--&lt;!&ndash;</ul>&ndash;&gt;-->\\n                    <!--&lt;!&ndash;</div>&ndash;&gt;-->\\n                <!--&lt;!&ndash;</li>&ndash;&gt;-->\\n                <!--&lt;!&ndash;<li>&ndash;&gt;-->\\n                    <!--&lt;!&ndash;<span>Notes</span>&ndash;&gt;-->\\n                    <!--&lt;!&ndash;<div class=\\\"drop\\\">&ndash;&gt;-->\\n                        <!--&lt;!&ndash;<ul>&ndash;&gt;-->\\n                            <!--&lt;!&ndash;<li><a href=\\\"#\\\" class=\\\"btn-notes-manage\\\">Manage</a></li>&ndash;&gt;-->\\n                            <!--&lt;!&ndash;<li><a href=\\\"#\\\" class=\\\"btn-notes-new\\\">New</a></li>&ndash;&gt;-->\\n                            <!--&lt;!&ndash;<li><a href=\\\"#\\\" class=\\\"btn-notes-load\\\">Load</a></li>&ndash;&gt;-->\\n                            <!--&lt;!&ndash;<li><a href=\\\"#\\\" class=\\\"btn-notes-save\\\">Save</a></li>&ndash;&gt;-->\\n                        <!--&lt;!&ndash;</ul>&ndash;&gt;-->\\n                    <!--&lt;!&ndash;</div>&ndash;&gt;-->\\n                <!--&lt;!&ndash;</li>&ndash;&gt;-->\\n                <!--&lt;!&ndash;<li><a href=\\\"#\\\" id=\\\"btn-print\\\">Print</a></li>&ndash;&gt;-->\\n                <!--&lt;!&ndash;<li><a href=\\\"#\\\" class=\\\"btn-email\\\">Send</a></li>&ndash;&gt;-->\\n                <!--&lt;!&ndash;<li><a href=\\\"/\\\">Language</a></li>&ndash;&gt;-->\\n                <!--&lt;!&ndash;<li><a class=\\\"btn-zoom-in\\\"  href=\\\"#\\\">+</a></li>&ndash;&gt;-->\\n                <!--&lt;!&ndash;<li><a class=\\\"btn-zoom-out\\\" href=\\\"#\\\">-</a></li>&ndash;&gt;-->\\n            <!--</ul>-->\\n        <!--</div>-->\\n    </div>\\n</nav>\";\n  });","module.exports = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {\n  this.compilerInfo = [4,'>= 1.0.0'];\nhelpers = this.merge(helpers, Handlebars.helpers); data = data || {};\n  var buffer = \"\", stack1, functionType=\"function\", escapeExpression=this.escapeExpression, self=this;\n\nfunction program1(depth0,data) {\n  \n  var buffer = \"\", stack1;\n  buffer += \"\\n        <ul class=\\\"page-list\\\">\\n            \";\n  stack1 = helpers.each.call(depth0, depth0.pages, {hash:{},inverse:self.noop,fn:self.program(2, program2, data),data:data});\n  if(stack1 || stack1 === 0) { buffer += stack1; }\n  buffer += \"\\n        </ul>\\n    \";\n  return buffer;\n  }\nfunction program2(depth0,data) {\n  \n  var buffer = \"\", stack1;\n  buffer += \"\\n                <li data-page=\\\"\";\n  if (stack1 = helpers.page_number) { stack1 = stack1.call(depth0, {hash:{},data:data}); }\n  else { stack1 = depth0.page_number; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }\n  buffer += escapeExpression(stack1)\n    + \"\\\">\\n                    \";\n  if (stack1 = helpers.title) { stack1 = stack1.call(depth0, {hash:{},data:data}); }\n  else { stack1 = depth0.title; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }\n  buffer += escapeExpression(stack1)\n    + \"\\n                </li>\\n            \";\n  return buffer;\n  }\n\nfunction program4(depth0,data) {\n  \n  \n  return \"\\n        <div class=\\\"loading black-overlay\\\"></div>\\n    \";\n  }\n\n  buffer += \"<div class=\\\"btn-close\\\">&#x2716;</div>\\n<div class=\\\"popup-inner\\\">\\n    <h2>Contents:</h2>\\n    \";\n  stack1 = helpers['if'].call(depth0, depth0.pages, {hash:{},inverse:self.program(4, program4, data),fn:self.program(1, program1, data),data:data});\n  if(stack1 || stack1 === 0) { buffer += stack1; }\n  buffer += \"\\n</div>\\n\";\n  return buffer;\n  });","module.exports = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {\n  this.compilerInfo = [4,'>= 1.0.0'];\nhelpers = this.merge(helpers, Handlebars.helpers); data = data || {};\n  var buffer = \"\", stack1, functionType=\"function\", escapeExpression=this.escapeExpression;\n\n\n  buffer += \"<div class=\\\"item-view\\\">\\n  <span>\";\n  if (stack1 = helpers.text) { stack1 = stack1.call(depth0, {hash:{},data:data}); }\n  else { stack1 = depth0.text; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }\n  buffer += escapeExpression(stack1)\n    + \"</span>\\n  <div class=\\\"btn-edit\\\"></div>\\n  <div class=\\\"btn-delete\\\">&#x2716;</div>\\n</div>\\n<div class=\\\"item-edit\\\">\\n  <textarea class=\\\"item-text-edit\\\">\";\n  if (stack1 = helpers.text) { stack1 = stack1.call(depth0, {hash:{},data:data}); }\n  else { stack1 = depth0.text; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }\n  buffer += escapeExpression(stack1)\n    + \"</textarea>\\n  <input type=\\\"button\\\" class=\\\"btn-save\\\" value=\\\"Save\\\">\\n</div>\";\n  return buffer;\n  });","module.exports = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {\n  this.compilerInfo = [4,'>= 1.0.0'];\nhelpers = this.merge(helpers, Handlebars.helpers); data = data || {};\n  \n\n\n  return \"<div class=\\\"btn-close\\\">&#x2716;</div>\\n<div class=\\\"popup-inner\\\">\\n    <h2>Notes:</h2>\\n    <div class=\\\"sections\\\">\\n        <div class=\\\"section\\\" id=\\\"manage-section\\\">\\n            <div>\\n                <h3>Manage notes</h3>\\n                <ul class=\\\"notes-menu\\\">\\n                    <li>\\n                        <input type=\\\"button\\\" id=\\\"btn-create-note-section\\\" value=\\\"Create\\\"/>\\n                    </li>\\n                    <li>\\n                        <input type=\\\"button\\\" id=\\\"btn-load-note-section\\\" value=\\\"Load\\\"/>\\n                    </li>\\n                    <li>\\n                        <input type=\\\"button\\\" id=\\\"btn-save-note-section\\\" value=\\\"Save\\\"/>\\n                    </li>\\n                </ul>\\n                <p>\\n                    <strong>Click a note to edit</strong>\\n                </p>\\n                <div id=\\\"notes-container\\\">\\n                </div>\\n            </div>\\n        </div>\\n        <div class=\\\"section\\\" id=\\\"save-section\\\">\\n            <div>\\n                <h3>Save your notes</h3>\\n                <form id=\\\"save-section-credentials\\\">\\n                    <p>Your email</p>\\n                    <input type=\\\"text\\\" required=\\\"required\\\" name=\\\"email\\\" value=\\\"\\\"/>\\n                    <p>Your password</p>\\n                    <input type=\\\"text\\\" required=\\\"required\\\" name=\\\"password\\\" value=\\\"\\\"/>\\n                    <ul class=\\\"notes-menu right\\\">\\n                        <li>\\n                            <input type=\\\"submit\\\" value=\\\"Save\\\"/>\\n                        </li>\\n                        <li>\\n                            <input type=\\\"button\\\" class=\\\"btn-go-back\\\" value=\\\"Back to list\\\"/>\\n                        </li>\\n                    </ul>\\n                </form>\\n            </div>\\n        </div>\\n        \\n        <div class=\\\"section\\\" id=\\\"load-section\\\">\\n            <h3>Open your saved notes</h3>\\n                <p>Your email</p>\\n                <form id=\\\"load-section-credentials\\\">\\n                    <input type=\\\"email\\\" required=\\\"required\\\" name=\\\"email\\\" value=\\\"\\\"/>\\n                    <p>Your password</p>\\n                    <input type=\\\"password\\\" required=\\\"required\\\" name=\\\"password\\\" value=\\\"\\\"/>\\n                    <ul class=\\\"notes-menu right\\\">\\n                        <li>\\n                            <input type=\\\"submit\\\" id=\\\"btn-open-notes-list\\\" value=\\\"Open\\\"/>\\n                        </li>\\n                        <li>\\n                            <input type=\\\"button\\\" class=\\\"btn-go-back\\\" value=\\\"Back to list\\\"/>\\n                        </li>\\n                    </ul>\\n                </form>\\n        </div>\\n        <div class=\\\"section\\\" id=\\\"create-section\\\">\\n            <div>\\n                <h3>Create a new notes for this page</h3>\\n                <p>Type your note</p>\\n                <form id=\\\"create-section-credentials\\\">\\n                    <textarea required=\\\"required\\\" name=\\\"text\\\"></textarea>\\n                    <ul class=\\\"notes-menu right\\\">\\n                        <li>\\n                            <input type=\\\"submit\\\" value=\\\"Add\\\"/>\\n                        </li>\\n                        <li>\\n                            <input type=\\\"button\\\" class=\\\"btn-go-back\\\" value=\\\"Back to list\\\"/>\\n                        </li>\\n                    </ul>\\n                </form>\\n            </div>\\n        </div>\\n    </div>\\n    <div class=\\\"loading black-overlay\\\"></div>\\n</div>\\n\";\n  });","module.exports = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {\n  this.compilerInfo = [4,'>= 1.0.0'];\nhelpers = this.merge(helpers, Handlebars.helpers); data = data || {};\n  \n\n\n  return \"<ul id=\\\"notes-list\\\">\\n</ul>\";\n  });","module.exports = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {\n  this.compilerInfo = [4,'>= 1.0.0'];\nhelpers = this.merge(helpers, Handlebars.helpers); data = data || {};\n  \n\n\n  return \"<div id=\\\"preloader-container\\\">\\n\t<p>Preloading images</p>\\n\t<div class=\\\"meter\\\">\\n        <p class=\\\"progress\\\">Progress <span>0</span></p>\\n        <div style=\\\"width: 0\\\">\\n            <p class=\\\"progress\\\">Progress <span>0</span></p>\\n        </div>\\n    </div>\\n\\n</div>\";\n  });","module.exports = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {\n  this.compilerInfo = [4,'>= 1.0.0'];\nhelpers = this.merge(helpers, Handlebars.helpers); data = data || {};\n  var buffer = \"\", stack1, functionType=\"function\", escapeExpression=this.escapeExpression;\n\n\n  buffer += \"<div class=\\\"btn-close\\\">&#x2716;</div>\\n<div class=\\\"popup-inner\\\">\\n    <div class=\\\"success-area\\\">\\n        <h3>Product has been purchased</h3>\\n        <p>You can visit the <a href=\\\"\";\n  if (stack1 = helpers.productURL) { stack1 = stack1.call(depth0, {hash:{},data:data}); }\n  else { stack1 = depth0.productURL; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }\n  buffer += escapeExpression(stack1)\n    + \"\\\">store</a> to see your product cart.</p>\\n    </div>\\n    <div class=\\\"form-area\\\">\";\n  if (stack1 = helpers.content) { stack1 = stack1.call(depth0, {hash:{},data:data}); }\n  else { stack1 = depth0.content; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }\n  if(stack1 || stack1 === 0) { buffer += stack1; }\n  buffer += \"</div>\\n</div>\\n\";\n  return buffer;\n  });","module.exports = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {\n  this.compilerInfo = [4,'>= 1.0.0'];\nhelpers = this.merge(helpers, Handlebars.helpers); data = data || {};\n  var buffer = \"\", stack1, functionType=\"function\", escapeExpression=this.escapeExpression, helperMissing=helpers.helperMissing, self=this;\n\nfunction program1(depth0,data) {\n  \n  var buffer = \"\", stack1;\n  buffer += \"\\n        <ul class=\\\"page-list\\\">\\n            \";\n  stack1 = helpers.each.call(depth0, depth0.hit, {hash:{},inverse:self.noop,fn:self.program(2, program2, data),data:data});\n  if(stack1 || stack1 === 0) { buffer += stack1; }\n  buffer += \"\\n        </ul>\\n    \";\n  return buffer;\n  }\nfunction program2(depth0,data) {\n  \n  var buffer = \"\", stack1, options;\n  buffer += \"\\n                <li data-page=\\\"\";\n  if (stack1 = helpers.page_number) { stack1 = stack1.call(depth0, {hash:{},data:data}); }\n  else { stack1 = depth0.page_number; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }\n  buffer += escapeExpression(stack1)\n    + \"\\\">\\n                    <span>Page \";\n  if (stack1 = helpers.page_number) { stack1 = stack1.call(depth0, {hash:{},data:data}); }\n  else { stack1 = depth0.page_number; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }\n  buffer += escapeExpression(stack1)\n    + \"</span> - <em>matches <strong>\";\n  if (stack1 = helpers.count) { stack1 = stack1.call(depth0, {hash:{},data:data}); }\n  else { stack1 = depth0.count; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }\n  buffer += escapeExpression(stack1)\n    + \"</strong></em>\\n                    <!--<p>\";\n  options = {hash:{},data:data};\n  buffer += escapeExpression(((stack1 = helpers.limitLength || depth0.limitLength),stack1 ? stack1.call(depth0, depth0.page_text, 100, options) : helperMissing.call(depth0, \"limitLength\", depth0.page_text, 100, options)))\n    + \"</p>-->\\n                </li>\\n            \";\n  return buffer;\n  }\n\nfunction program4(depth0,data) {\n  \n  \n  return \"\\n        <div class=\\\"loading black-overlay\\\"></div>\\n    \";\n  }\n\n  buffer += \"<div class=\\\"btn-close\\\">&#x2716;</div>\\n<div class=\\\"popup-inner\\\">\\n    <h2>Search results for:</h2>\\n    \";\n  stack1 = helpers['if'].call(depth0, depth0.success, {hash:{},inverse:self.program(4, program4, data),fn:self.program(1, program1, data),data:data});\n  if(stack1 || stack1 === 0) { buffer += stack1; }\n  buffer += \"\\n</div>\\n\";\n  return buffer;\n  });","module.exports = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {\n  this.compilerInfo = [4,'>= 1.0.0'];\nhelpers = this.merge(helpers, Handlebars.helpers); data = data || {};\n  \n\n\n  return \"<div class=\\\"container outer-container\\\">\\n  <div class=\\\"page-container\\\" id=\\\"page-container\\\">\\n    <div class=\\\"loading black-overlay\\\"></div>\\n  </div>\\n</div>\\n<header class=\\\"header-container\\\" id=\\\"header-container\\\"></header>\\n\";\n  });","module.exports = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {\n  this.compilerInfo = [4,'>= 1.0.0'];\nhelpers = this.merge(helpers, Handlebars.helpers); data = data || {};\n  var buffer = \"\", stack1, stack2, functionType=\"function\", escapeExpression=this.escapeExpression, self=this, helperMissing=helpers.helperMissing;\n\nfunction program1(depth0,data,depth1) {\n  \n  var buffer = \"\", stack1, stack2, options;\n  buffer += \"\\n                    \";\n  options = {hash:{},inverse:self.noop,fn:self.programWithDepth(2, program2, data, depth1),data:data};\n  stack2 = ((stack1 = helpers.filterLinks || depth0.filterLinks),stack1 ? stack1.call(depth0, depth0['hotspot type'], options) : helperMissing.call(depth0, \"filterLinks\", depth0['hotspot type'], options));\n  if(stack2 || stack2 === 0) { buffer += stack2; }\n  buffer += \"\\n                \";\n  return buffer;\n  }\nfunction program2(depth0,data,depth2) {\n  \n  var buffer = \"\", stack1, stack2, options;\n  buffer += \"\\n                        <li>\\n                            \";\n  options = {hash:{},inverse:self.noop,fn:self.programWithDepth(3, program3, data, depth2),data:data};\n  stack2 = ((stack1 = helpers.getProductInfo || depth0.getProductInfo),stack1 ? stack1.call(depth0, depth0, options) : helperMissing.call(depth0, \"getProductInfo\", depth0, options));\n  if(stack2 || stack2 === 0) { buffer += stack2; }\n  buffer += \"\\n                            <!--<img src=\\\"\"\n    + escapeExpression(((stack1 = ((stack1 = depth0.product_info),stack1 == null || stack1 === false ? stack1 : stack1.image)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))\n    + \"\\\" alt=\\\"\\\" width=\\\"40\\\" class=\\\"product-photo\\\" data-product=\\\"\"\n    + escapeExpression(((stack1 = ((stack1 = depth2.page1),stack1 == null || stack1 === false ? stack1 : stack1.page_number)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))\n    + \",\";\n  if (stack2 = helpers.link_to_product) { stack2 = stack2.call(depth0, {hash:{},data:data}); }\n  else { stack2 = depth0.link_to_product; stack2 = typeof stack2 === functionType ? stack2.apply(depth0) : stack2; }\n  buffer += escapeExpression(stack2)\n    + \"\\\"/>-->\\n                            <!--<strong>\";\n  options = {hash:{},data:data};\n  buffer += escapeExpression(((stack1 = helpers.getHeader || depth0.getHeader),stack1 ? stack1.call(depth0, ((stack1 = depth0.product_info),stack1 == null || stack1 === false ? stack1 : stack1.title), options) : helperMissing.call(depth0, \"getHeader\", ((stack1 = depth0.product_info),stack1 == null || stack1 === false ? stack1 : stack1.title), options)))\n    + \"</strong>-->\\n                        </li>\\n                    \";\n  return buffer;\n  }\nfunction program3(depth0,data,depth3) {\n  \n  var buffer = \"\", stack1, stack2, options;\n  buffer += \"\\n                                \";\n  stack1 = helpers.unless.call(depth0, depth0.isNoDesc, {hash:{},inverse:self.noop,fn:self.program(4, program4, data),data:data});\n  if(stack1 || stack1 === 0) { buffer += stack1; }\n  buffer += \"\\n                                <img src=\\\"\";\n  options = {hash:{},data:data};\n  buffer += escapeExpression(((stack1 = helpers.constructImage || depth0.constructImage),stack1 ? stack1.call(depth0, depth0.imageref, options) : helperMissing.call(depth0, \"constructImage\", depth0.imageref, options)))\n    + \"\\\" alt=\\\"\\\" width=\\\"40\\\" class=\\\"product-photo\\\" data-product=\\\"\"\n    + escapeExpression(((stack1 = ((stack1 = depth3.page1),stack1 == null || stack1 === false ? stack1 : stack1.page_number)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))\n    + \",\";\n  if (stack2 = helpers.link_to_product) { stack2 = stack2.call(depth0, {hash:{},data:data}); }\n  else { stack2 = depth0.link_to_product; stack2 = typeof stack2 === functionType ? stack2.apply(depth0) : stack2; }\n  buffer += escapeExpression(stack2)\n    + \"\\\"/>\\n                                <strong>\";\n  if (stack2 = helpers.title) { stack2 = stack2.call(depth0, {hash:{},data:data}); }\n  else { stack2 = depth0.title; stack2 = typeof stack2 === functionType ? stack2.apply(depth0) : stack2; }\n  buffer += escapeExpression(stack2)\n    + \"</strong>\\n                            \";\n  return buffer;\n  }\nfunction program4(depth0,data) {\n  \n  var buffer = \"\", stack1;\n  buffer += \"<a class=\\\"btn-add-to-cart\\\" href=\\\"#\\\" title=\\\"\";\n  if (stack1 = helpers.link_to_product) { stack1 = stack1.call(depth0, {hash:{},data:data}); }\n  else { stack1 = depth0.link_to_product; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }\n  buffer += escapeExpression(stack1)\n    + \"\\\">add to cart</a>\";\n  return buffer;\n  }\n\nfunction program6(depth0,data,depth1) {\n  \n  var buffer = \"\", stack1, stack2, options;\n  buffer += \"\\n                    \";\n  options = {hash:{},inverse:self.noop,fn:self.programWithDepth(7, program7, data, depth1),data:data};\n  stack2 = ((stack1 = helpers.filterLinks || depth0.filterLinks),stack1 ? stack1.call(depth0, depth0['hotspot type'], options) : helperMissing.call(depth0, \"filterLinks\", depth0['hotspot type'], options));\n  if(stack2 || stack2 === 0) { buffer += stack2; }\n  buffer += \"\\n                \";\n  return buffer;\n  }\nfunction program7(depth0,data,depth2) {\n  \n  var buffer = \"\", stack1, stack2, options;\n  buffer += \"\\n                        <li>\\n                            \";\n  options = {hash:{},inverse:self.noop,fn:self.programWithDepth(8, program8, data, depth2),data:data};\n  stack2 = ((stack1 = helpers.getProductInfo || depth0.getProductInfo),stack1 ? stack1.call(depth0, depth0, options) : helperMissing.call(depth0, \"getProductInfo\", depth0, options));\n  if(stack2 || stack2 === 0) { buffer += stack2; }\n  buffer += \"\\n                            <!--<img src=\\\"\"\n    + escapeExpression(((stack1 = ((stack1 = depth0.product_info),stack1 == null || stack1 === false ? stack1 : stack1.image)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))\n    + \"\\\" alt=\\\"\\\" width=\\\"40\\\" class=\\\"product-photo\\\" data-product=\\\"\"\n    + escapeExpression(((stack1 = ((stack1 = depth2.page2),stack1 == null || stack1 === false ? stack1 : stack1.page_number)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))\n    + \",\";\n  if (stack2 = helpers.link_to_product) { stack2 = stack2.call(depth0, {hash:{},data:data}); }\n  else { stack2 = depth0.link_to_product; stack2 = typeof stack2 === functionType ? stack2.apply(depth0) : stack2; }\n  buffer += escapeExpression(stack2)\n    + \"\\\"/>-->\\n                            <!--<strong>\";\n  options = {hash:{},data:data};\n  buffer += escapeExpression(((stack1 = helpers.getHeader || depth0.getHeader),stack1 ? stack1.call(depth0, ((stack1 = depth0.product_info),stack1 == null || stack1 === false ? stack1 : stack1.title), options) : helperMissing.call(depth0, \"getHeader\", ((stack1 = depth0.product_info),stack1 == null || stack1 === false ? stack1 : stack1.title), options)))\n    + \"</strong>-->\\n                        </li>\\n                    \";\n  return buffer;\n  }\nfunction program8(depth0,data,depth3) {\n  \n  var buffer = \"\", stack1, stack2, options;\n  buffer += \"\\n                                \";\n  stack1 = helpers.unless.call(depth0, depth0.isNoDesc, {hash:{},inverse:self.noop,fn:self.program(4, program4, data),data:data});\n  if(stack1 || stack1 === 0) { buffer += stack1; }\n  buffer += \"\\n                                <img src=\\\"\";\n  options = {hash:{},data:data};\n  buffer += escapeExpression(((stack1 = helpers.constructImage || depth0.constructImage),stack1 ? stack1.call(depth0, depth0.imageref, options) : helperMissing.call(depth0, \"constructImage\", depth0.imageref, options)))\n    + \"\\\" alt=\\\"\\\" width=\\\"40\\\" class=\\\"product-photo\\\" data-product=\\\"\"\n    + escapeExpression(((stack1 = ((stack1 = depth3.page2),stack1 == null || stack1 === false ? stack1 : stack1.page_number)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))\n    + \",\";\n  if (stack2 = helpers.link_to_product) { stack2 = stack2.call(depth0, {hash:{},data:data}); }\n  else { stack2 = depth0.link_to_product; stack2 = typeof stack2 === functionType ? stack2.apply(depth0) : stack2; }\n  buffer += escapeExpression(stack2)\n    + \"\\\"/>\\n                                <strong>\";\n  if (stack2 = helpers.title) { stack2 = stack2.call(depth0, {hash:{},data:data}); }\n  else { stack2 = depth0.title; stack2 = typeof stack2 === functionType ? stack2.apply(depth0) : stack2; }\n  buffer += escapeExpression(stack2)\n    + \"</strong>\\n                            \";\n  return buffer;\n  }\n\n  buffer += \"<div class=\\\"popup-inner\\\">\\n    <a href=\\\"#\\\" class=\\\"btn-view\\\">View</a>\\n    <h3>Pages \"\n    + escapeExpression(((stack1 = ((stack1 = depth0.page1),stack1 == null || stack1 === false ? stack1 : stack1.page)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))\n    + \" and \"\n    + escapeExpression(((stack1 = ((stack1 = depth0.page2),stack1 == null || stack1 === false ? stack1 : stack1.page)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))\n    + \"</h3>\\n\\n    <div class=\\\"column-holder\\\">\\n        <div class=\\\"col1\\\">\\n            <ul class=\\\"product-list\\\">\\n                \";\n  stack2 = helpers.each.call(depth0, ((stack1 = depth0.page1),stack1 == null || stack1 === false ? stack1 : stack1.hotspots), {hash:{},inverse:self.noop,fn:self.programWithDepth(1, program1, data, depth0),data:data});\n  if(stack2 || stack2 === 0) { buffer += stack2; }\n  buffer += \"\\n            </ul>\\n        </div>\\n        <div class=\\\"col2\\\">\\n            <ul class=\\\"product-list\\\">\\n                \";\n  stack2 = helpers.each.call(depth0, ((stack1 = depth0.page2),stack1 == null || stack1 === false ? stack1 : stack1.hotspots), {hash:{},inverse:self.noop,fn:self.programWithDepth(6, program6, data, depth0),data:data});\n  if(stack2 || stack2 === 0) { buffer += stack2; }\n  buffer += \"\\n            </ul>\\n        </div>\\n    </div>\\n\\n</div>\\n\";\n  return buffer;\n  });","module.exports = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {\n  this.compilerInfo = [4,'>= 1.0.0'];\nhelpers = this.merge(helpers, Handlebars.helpers); data = data || {};\n  var buffer = \"\", stack1, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, self=this;\n\nfunction program1(depth0,data) {\n  \n  var buffer = \"\", stack1, options;\n  buffer += \"\\n    <ul class=\\\"thumb-list\\\">\\n        \";\n  options = {hash:{},data:data};\n  buffer += escapeExpression(((stack1 = helpers.generateThumbList || depth0.generateThumbList),stack1 ? stack1.call(depth0, depth0.pages, options) : helperMissing.call(depth0, \"generateThumbList\", depth0.pages, options)))\n    + \"\\n    </ul>\\n\";\n  return buffer;\n  }\n\nfunction program3(depth0,data) {\n  \n  \n  return \"\\n    <div class=\\\"loading black-overlay\\\"></div>\\n\";\n  }\n\n  stack1 = helpers['if'].call(depth0, depth0.pages, {hash:{},inverse:self.program(3, program3, data),fn:self.program(1, program1, data),data:data});\n  if(stack1 || stack1 === 0) { buffer += stack1; }\n  buffer += \"\\n\\n\";\n  return buffer;\n  });","var Chaplin, Description, Model, ThumbnailPopupView, View, template, _ref,\n  __hasProp = {}.hasOwnProperty,\n  __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };\n\ntemplate = require('views/templates/thumbnail-popup');\n\nView = require('views/base/view');\n\nChaplin = require('chaplin');\n\nModel = require('models/base/model');\n\nDescription = require('models/description');\n\nmodule.exports = ThumbnailPopupView = (function(_super) {\n  __extends(ThumbnailPopupView, _super);\n\n  function ThumbnailPopupView() {\n    _ref = ThumbnailPopupView.__super__.constructor.apply(this, arguments);\n    return _ref;\n  }\n\n  ThumbnailPopupView.prototype.template = template;\n\n  ThumbnailPopupView.prototype.className = 'popup';\n\n  ThumbnailPopupView.prototype.tagName = 'div';\n\n  ThumbnailPopupView.prototype.id = 'thumbnail-popup';\n\n  ThumbnailPopupView.prototype.autoRender = false;\n\n  ThumbnailPopupView.prototype.container = 'body';\n\n  ThumbnailPopupView.prototype.position = null;\n\n  ThumbnailPopupView.prototype.hideTimeout = null;\n\n  ThumbnailPopupView.prototype.listen = {\n    'thumbnails:mouseout mediator': 'startHideTimeout'\n  };\n\n  ThumbnailPopupView.prototype.events = {\n    'click .btn-close': 'closePopup',\n    'click .btn-view': 'goToPage',\n    'click .btn-add-to-cart': 'addToCart',\n    'mouseenter': 'stopHideTimeout',\n    'mouseleave': 'startHideTimeout',\n    'click .product-photo': 'hightlightProduct'\n  };\n\n  ThumbnailPopupView.prototype.startHideTimeout = function() {\n    var _this = this;\n    this.hideTimeout = window.setTimeout((function() {\n      return _this.closePopup();\n    }), 400);\n    return false;\n  };\n\n  ThumbnailPopupView.prototype.stopHideTimeout = function() {\n    window.clearTimeout(this.hideTimeout);\n    this.hideTimeout = null;\n    return false;\n  };\n\n  ThumbnailPopupView.prototype.closePopup = function() {\n    this.dispose();\n    return false;\n  };\n\n  ThumbnailPopupView.prototype.initialize = function(options) {\n    var activePage, catalogue, page1, page2;\n    ThumbnailPopupView.__super__.initialize.apply(this, arguments);\n    activePage = options.activePage;\n    this.position = options.position;\n    catalogue = Chaplin.mediator.catalogue;\n    page1 = _(catalogue.get('pages')).find({\n      page_number: activePage[0]\n    });\n    if (page1 != null) {\n      page1.page = (page1 != null ? page1.page_number : void 0) - 1;\n    }\n    page2 = _(catalogue.get('pages')).find({\n      page_number: activePage[1]\n    });\n    if (page2 != null) {\n      page2.page = (page2 != null ? page2.page_number : void 0) - 1;\n    }\n    if (!(page1 != null ? page1.hotspots : void 0) && !(page2 != null ? page2.hotspots : void 0)) {\n      return;\n    }\n    this.model = new Model({\n      page1: page1,\n      page2: page2\n    });\n    return this.render();\n  };\n\n  ThumbnailPopupView.prototype.attach = function() {\n    ThumbnailPopupView.__super__.attach.apply(this, arguments);\n    return this.moveToPosition(this.position);\n  };\n\n  ThumbnailPopupView.prototype.moveToPosition = function(position) {\n    return this.$el.css({\n      'left': position.left - this.$el.width() / 2 + 38,\n      'top': position.top - this.$el.height() - 30\n    });\n  };\n\n  ThumbnailPopupView.prototype.goToPage = function() {\n    this.publishEvent('catalogue:goToPage', this.model.get('page1').page_number);\n    return false;\n  };\n\n  ThumbnailPopupView.prototype.addToCart = function(e) {\n    var description;\n    description = new Description({\n      title: $(e.currentTarget).attr('title')\n    });\n    description.addToCart();\n    this.closePopup();\n    return false;\n  };\n\n  ThumbnailPopupView.prototype.hightlightProduct = function(e) {\n    var hotspot, page, productData,\n      _this = this;\n    productData = $(e.currentTarget).attr('data-product').split(',');\n    page = parseInt(productData[0]);\n    hotspot = productData[1];\n    this.publishEvent('catalogue:hideAllDescriptions');\n    this.publishEvent('catalogue:getActivePage', function(activePages) {\n      if ((page === activePages[0]) || (page === activePages[1])) {\n        return _this.publishEvent('catalogue:higlelightHotspotByTitle', hotspot);\n      } else {\n        _this.publishEvent('catalogue:goToPage', page);\n        return _this.publishEvent('catalogue:setTurnPageCallback', function() {\n          return _this.publishEvent('catalogue:higlelightHotspotByTitle', hotspot);\n        });\n      }\n    });\n    return this.closePopup();\n  };\n\n  return ThumbnailPopupView;\n\n})(View);\n","var ThumbnailsView, View, template, utils, _ref,\n  __hasProp = {}.hasOwnProperty,\n  __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };\n\ntemplate = require('views/templates/thumbnails');\n\nView = require('views/base/view');\n\nutils = require('lib/utils');\n\nmodule.exports = ThumbnailsView = (function(_super) {\n  __extends(ThumbnailsView, _super);\n\n  function ThumbnailsView() {\n    _ref = ThumbnailsView.__super__.constructor.apply(this, arguments);\n    return _ref;\n  }\n\n  ThumbnailsView.prototype.template = template;\n\n  ThumbnailsView.prototype.tagName = 'div';\n\n  ThumbnailsView.prototype.id = 'thumbnails';\n\n  ThumbnailsView.prototype.autoRender = true;\n\n  ThumbnailsView.prototype.$list = null;\n\n  ThumbnailsView.prototype.events = {\n    'click .thumb-list li': 'goToPage',\n    'touchstart .thumb-list li': 'goToPage',\n    'mouseover .thumb-list li': 'showThumbPopup',\n    'mouseout .thumb-list li': 'hideThumbPopup'\n  };\n\n  ThumbnailsView.prototype.listen = {\n    'catalogue:loaded mediator': 'init',\n    'catalogue:pageTurned mediator': 'moveToPage'\n  };\n\n  ThumbnailsView.prototype.goToPage = function(e) {\n    var page;\n    e.stopPropagation();\n    page = $(e.currentTarget).attr('data-page');\n    this.publishEvent('catalogue:goToPage', parseInt(page));\n    return false;\n  };\n\n  ThumbnailsView.prototype.init = function(catalogue) {\n    this.model = catalogue;\n    return this.render();\n  };\n\n  ThumbnailsView.prototype.attach = function() {\n    ThumbnailsView.__super__.attach.apply(this, arguments);\n    return this.$list = this.$('ul');\n  };\n\n  ThumbnailsView.prototype.moveToPage = function(page) {\n    var activeItem, positionOfItem;\n    activeItem = this.$list.find(\"li[data-page='\" + (page.join(',')) + \"']\");\n    this.$list.find('li').removeClass('active');\n    activeItem.addClass('active');\n    positionOfItem = activeItem.position();\n    return this.$list.animate({\n      'left': -positionOfItem.left\n    });\n  };\n\n  ThumbnailsView.prototype.showThumbPopup = function(e) {\n    var $el, activePage;\n    if (utils.isMobile.any()) {\n      return false;\n    }\n    $el = $(e.currentTarget);\n    activePage = $el.attr('data-page').split(',');\n    this.publishEvent('thumnails:showPopup', activePage, $el.offset());\n    return false;\n  };\n\n  ThumbnailsView.prototype.hideThumbPopup = function() {\n    if (utils.isMobile.any()) {\n      return false;\n    }\n    this.publishEvent('thumbnails:mouseout');\n    return false;\n  };\n\n  return ThumbnailsView;\n\n})(View);\n"]}