dune-dashboard 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (561) hide show
  1. checksums.yaml +7 -0
  2. data/.bowerrc +3 -0
  3. data/.gitignore +22 -0
  4. data/.rspec +2 -0
  5. data/.travis.yml +13 -0
  6. data/CHANGELOG.md +6 -0
  7. data/Gemfile +12 -0
  8. data/Gemfile.lock +392 -0
  9. data/LICENSE.txt +22 -0
  10. data/README.md +58 -0
  11. data/Rakefile +23 -0
  12. data/app/assets/images/dune/dashboard/logo@2x.png +0 -0
  13. data/app/assets/javascripts/adapters/channel_adapter.coffee +1 -0
  14. data/app/assets/javascripts/adapters/form_data.coffee +26 -0
  15. data/app/assets/javascripts/adapters/press_asset_adapter.coffee +1 -0
  16. data/app/assets/javascripts/configs.coffee +10 -0
  17. data/app/assets/javascripts/controllers/.gitkeep +0 -0
  18. data/app/assets/javascripts/controllers/channels.coffee +40 -0
  19. data/app/assets/javascripts/controllers/contributions.coffee +26 -0
  20. data/app/assets/javascripts/controllers/press_assets.coffee +24 -0
  21. data/app/assets/javascripts/controllers/projects.coffee +36 -0
  22. data/app/assets/javascripts/controllers/sessions.coffee +2 -0
  23. data/app/assets/javascripts/controllers/tags.coffee +24 -0
  24. data/app/assets/javascripts/controllers/users.coffee +8 -0
  25. data/app/assets/javascripts/dashboard.coffee +5 -0
  26. data/app/assets/javascripts/dune-dashboard-application.js +16 -0
  27. data/app/assets/javascripts/dune-dashboard-libs.js +25 -0
  28. data/app/assets/javascripts/dune-dashboard-templates.js +1 -0
  29. data/app/assets/javascripts/helpers/daterangepicker.coffee +1 -0
  30. data/app/assets/javascripts/helpers/format-date.coffee +5 -0
  31. data/app/assets/javascripts/helpers/loading.coffee +14 -0
  32. data/app/assets/javascripts/helpers/number-to-currency.coffee +5 -0
  33. data/app/assets/javascripts/helpers/pagination.coffee +1 -0
  34. data/app/assets/javascripts/helpers/show-boolean.coffee +5 -0
  35. data/app/assets/javascripts/i18n/translations_en.js +165 -0
  36. data/app/assets/javascripts/initializers/authentication.coffee +50 -0
  37. data/app/assets/javascripts/mixins/modal-controller.coffee +7 -0
  38. data/app/assets/javascripts/mixins/modal-view.coffee +15 -0
  39. data/app/assets/javascripts/mixins/paginable.coffee +25 -0
  40. data/app/assets/javascripts/mixins/searchable.coffee +58 -0
  41. data/app/assets/javascripts/models/.gitkeep +0 -0
  42. data/app/assets/javascripts/models/channel.coffee +25 -0
  43. data/app/assets/javascripts/models/contributions.coffee +15 -0
  44. data/app/assets/javascripts/models/press_asset.coffee +5 -0
  45. data/app/assets/javascripts/models/project.coffee +16 -0
  46. data/app/assets/javascripts/models/reward.coffee +4 -0
  47. data/app/assets/javascripts/models/tag.coffee +4 -0
  48. data/app/assets/javascripts/models/user.coffee +13 -0
  49. data/app/assets/javascripts/router.coffee +36 -0
  50. data/app/assets/javascripts/routes/.gitkeep +0 -0
  51. data/app/assets/javascripts/routes/application.coffee +35 -0
  52. data/app/assets/javascripts/routes/channels-edit.coffee +4 -0
  53. data/app/assets/javascripts/routes/channels-new.coffee +4 -0
  54. data/app/assets/javascripts/routes/channels.coffee +21 -0
  55. data/app/assets/javascripts/routes/contributions.coffee +29 -0
  56. data/app/assets/javascripts/routes/index.coffee +4 -0
  57. data/app/assets/javascripts/routes/press_assets-edit.coffee +4 -0
  58. data/app/assets/javascripts/routes/press_assets-new.coffee +5 -0
  59. data/app/assets/javascripts/routes/press_assets.coffee +13 -0
  60. data/app/assets/javascripts/routes/projects.coffee +23 -0
  61. data/app/assets/javascripts/routes/sessions.coffee +3 -0
  62. data/app/assets/javascripts/routes/tags-edit.coffee +4 -0
  63. data/app/assets/javascripts/routes/tags-new.coffee +5 -0
  64. data/app/assets/javascripts/routes/tags.coffee +15 -0
  65. data/app/assets/javascripts/routes/users.coffee +17 -0
  66. data/app/assets/javascripts/serializers/channel.coffee +10 -0
  67. data/app/assets/javascripts/serializers/file.coffee +6 -0
  68. data/app/assets/javascripts/serializers/object.coffee +6 -0
  69. data/app/assets/javascripts/serializers/project.coffee +4 -0
  70. data/app/assets/javascripts/store.coffee +5 -0
  71. data/app/assets/javascripts/templates/.gitkeep +0 -0
  72. data/app/assets/javascripts/templates/channels/_form.emblem +256 -0
  73. data/app/assets/javascripts/templates/channels/edit.emblem +1 -0
  74. data/app/assets/javascripts/templates/channels/index.emblem +66 -0
  75. data/app/assets/javascripts/templates/channels/new.emblem +1 -0
  76. data/app/assets/javascripts/templates/channels/search-form.emblem +13 -0
  77. data/app/assets/javascripts/templates/contributions/index.emblem +111 -0
  78. data/app/assets/javascripts/templates/contributions/search-form.emblem +27 -0
  79. data/app/assets/javascripts/templates/contributions/show.emblem +79 -0
  80. data/app/assets/javascripts/templates/daterangepicker.emblem +5 -0
  81. data/app/assets/javascripts/templates/layouts/application.emblem +19 -0
  82. data/app/assets/javascripts/templates/layouts/header.emblem +25 -0
  83. data/app/assets/javascripts/templates/layouts/sidebar.emblem +32 -0
  84. data/app/assets/javascripts/templates/pagination.emblem +10 -0
  85. data/app/assets/javascripts/templates/press_assets/_form.emblem +33 -0
  86. data/app/assets/javascripts/templates/press_assets/edit.emblem +1 -0
  87. data/app/assets/javascripts/templates/press_assets/index.emblem +45 -0
  88. data/app/assets/javascripts/templates/press_assets/new.emblem +1 -0
  89. data/app/assets/javascripts/templates/projects/index.emblem +119 -0
  90. data/app/assets/javascripts/templates/projects/search-form.emblem +19 -0
  91. data/app/assets/javascripts/templates/search-tab.emblem +6 -0
  92. data/app/assets/javascripts/templates/sessions/new.emblem +17 -0
  93. data/app/assets/javascripts/templates/tags/_form.emblem +24 -0
  94. data/app/assets/javascripts/templates/tags/edit.emblem +1 -0
  95. data/app/assets/javascripts/templates/tags/index.emblem +46 -0
  96. data/app/assets/javascripts/templates/tags/new.emblem +1 -0
  97. data/app/assets/javascripts/templates/users/index.emblem +51 -0
  98. data/app/assets/javascripts/templates/users/search-form.emblem +13 -0
  99. data/app/assets/javascripts/views/auto-save-checkbox.coffee +14 -0
  100. data/app/assets/javascripts/views/contributions/show.coffee +1 -0
  101. data/app/assets/javascripts/views/daterangepicker.coffee +60 -0
  102. data/app/assets/javascripts/views/file.coffee +7 -0
  103. data/app/assets/javascripts/views/layouts/header.coffee +23 -0
  104. data/app/assets/javascripts/views/layouts/sidebar.coffee +6 -0
  105. data/app/assets/javascripts/views/page-title.coffee +45 -0
  106. data/app/assets/javascripts/views/pagination.coffee +51 -0
  107. data/app/assets/javascripts/views/projects/index.coffee +5 -0
  108. data/app/assets/javascripts/views/search-tab.coffee +24 -0
  109. data/app/assets/stylesheets/core/core.sass +299 -0
  110. data/app/assets/stylesheets/core/mixins.sass +83 -0
  111. data/app/assets/stylesheets/core/settings.sass +75 -0
  112. data/app/assets/stylesheets/dune-dashboard-application.sass +12 -0
  113. data/app/assets/stylesheets/modules/alerts.sass +21 -0
  114. data/app/assets/stylesheets/modules/avatar.sass +13 -0
  115. data/app/assets/stylesheets/modules/boxes.sass +274 -0
  116. data/app/assets/stylesheets/modules/buttons.sass +160 -0
  117. data/app/assets/stylesheets/modules/dl-details.sass +13 -0
  118. data/app/assets/stylesheets/modules/forms.sass +53 -0
  119. data/app/assets/stylesheets/modules/generic.sass +9 -0
  120. data/app/assets/stylesheets/modules/header.sass +153 -0
  121. data/app/assets/stylesheets/modules/labels.sass +3 -0
  122. data/app/assets/stylesheets/modules/navs.sass +98 -0
  123. data/app/assets/stylesheets/modules/pagination.sass +19 -0
  124. data/app/assets/stylesheets/modules/sidebar.sass +147 -0
  125. data/app/assets/stylesheets/modules/small-box.sass +78 -0
  126. data/app/assets/stylesheets/pages/login.sass +42 -0
  127. data/app/controllers/dune/dashboard/ember_controller.rb +7 -0
  128. data/app/views/layouts/dune/dashboard/application.html.erb +15 -0
  129. data/bower.json +28 -0
  130. data/config/ember-i18n.yml +2 -0
  131. data/config/ember_locales/channels.en.yml +49 -0
  132. data/config/ember_locales/contributions.en.yml +42 -0
  133. data/config/ember_locales/en.yml +1 -0
  134. data/config/ember_locales/layouts.en.yml +16 -0
  135. data/config/ember_locales/press_assets.en.yml +14 -0
  136. data/config/ember_locales/projects.en.yml +33 -0
  137. data/config/ember_locales/sessions.en.yml +11 -0
  138. data/config/ember_locales/tags.en.yml +12 -0
  139. data/config/ember_locales/titles.en.yml +22 -0
  140. data/config/ember_locales/users.en.yml +12 -0
  141. data/config/ember_locales/words.en.yml +12 -0
  142. data/config/routes.rb +4 -0
  143. data/dune-dashboard.gemspec +28 -0
  144. data/lib/dune/dashboard.rb +11 -0
  145. data/lib/dune/dashboard/engine.rb +12 -0
  146. data/lib/dune/dashboard/i18n.rb +108 -0
  147. data/lib/dune/dashboard/version.rb +5 -0
  148. data/spec/dummy/README.rdoc +28 -0
  149. data/spec/dummy/Rakefile +6 -0
  150. data/spec/dummy/app/assets/images/.keep +0 -0
  151. data/spec/dummy/app/assets/javascripts/application.js +13 -0
  152. data/spec/dummy/app/assets/stylesheets/application.css +13 -0
  153. data/spec/dummy/app/controllers/application_controller.rb +5 -0
  154. data/spec/dummy/app/controllers/concerns/.keep +0 -0
  155. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  156. data/spec/dummy/app/mailers/.keep +0 -0
  157. data/spec/dummy/app/models/.keep +0 -0
  158. data/spec/dummy/app/models/concerns/.keep +0 -0
  159. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  160. data/spec/dummy/bin/bundle +3 -0
  161. data/spec/dummy/bin/rails +4 -0
  162. data/spec/dummy/bin/rake +4 -0
  163. data/spec/dummy/config.ru +4 -0
  164. data/spec/dummy/config/application.rb +30 -0
  165. data/spec/dummy/config/boot.rb +5 -0
  166. data/spec/dummy/config/environment.rb +5 -0
  167. data/spec/dummy/config/environments/development.rb +29 -0
  168. data/spec/dummy/config/environments/production.rb +80 -0
  169. data/spec/dummy/config/environments/test.rb +38 -0
  170. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  171. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  172. data/spec/dummy/config/initializers/inflections.rb +16 -0
  173. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  174. data/spec/dummy/config/initializers/secret_token.rb +12 -0
  175. data/spec/dummy/config/initializers/session_store.rb +3 -0
  176. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  177. data/spec/dummy/config/locales/en.yml +23 -0
  178. data/spec/dummy/config/routes.rb +3 -0
  179. data/spec/dummy/lib/assets/.keep +0 -0
  180. data/spec/dummy/log/.keep +0 -0
  181. data/spec/dummy/public/404.html +58 -0
  182. data/spec/dummy/public/422.html +58 -0
  183. data/spec/dummy/public/500.html +57 -0
  184. data/spec/dummy/public/favicon.ico +0 -0
  185. data/spec/javascripts/controllers/channels_spec.coffee +16 -0
  186. data/spec/javascripts/controllers/press_assets_spec.coffee +5 -0
  187. data/spec/javascripts/controllers/projects_spec.coffee +16 -0
  188. data/spec/javascripts/controllers/users_spec.coffee +16 -0
  189. data/spec/javascripts/fixtures/channels.coffee +49 -0
  190. data/spec/javascripts/fixtures/contributions.coffee +46 -0
  191. data/spec/javascripts/fixtures/press_assets.coffee +15 -0
  192. data/spec/javascripts/fixtures/projects.coffee +108 -0
  193. data/spec/javascripts/fixtures/tags.coffee +15 -0
  194. data/spec/javascripts/fixtures/users.coffee +26 -0
  195. data/spec/javascripts/helpers/auththentication.coffee +11 -0
  196. data/spec/javascripts/integration/channels_spec.coffee +109 -0
  197. data/spec/javascripts/integration/contributions_spec.coffee +108 -0
  198. data/spec/javascripts/integration/press_assets_spec.coffee +66 -0
  199. data/spec/javascripts/integration/projects_spec.coffee +110 -0
  200. data/spec/javascripts/integration/sessions_spec.coffee +71 -0
  201. data/spec/javascripts/integration/tags_spec.coffee +65 -0
  202. data/spec/javascripts/integration/users_spec.coffee +108 -0
  203. data/spec/javascripts/models/channel_spec.coffee +4 -0
  204. data/spec/javascripts/models/contribution_spec.coffee +4 -0
  205. data/spec/javascripts/models/press_asset_spec.coffee +5 -0
  206. data/spec/javascripts/models/project_spec.coffee +4 -0
  207. data/spec/javascripts/models/reward_spec.coffee +4 -0
  208. data/spec/javascripts/models/tag_spec.coffee +4 -0
  209. data/spec/javascripts/models/user_spec.coffee +4 -0
  210. data/spec/javascripts/spec_helper.coffee +56 -0
  211. data/spec/javascripts/support/jquery.mockjax.js +598 -0
  212. data/spec/teaspoon_env.rb +183 -0
  213. data/vendor/assets/components/cldr/.bower.json +14 -0
  214. data/vendor/assets/components/cldr/README.md +47 -0
  215. data/vendor/assets/components/cldr/plurals.js +240 -0
  216. data/vendor/assets/components/ember-i18n/.bower.json +46 -0
  217. data/vendor/assets/components/ember-i18n/CONTRIBUTING.md +13 -0
  218. data/vendor/assets/components/ember-i18n/Changelog.md +82 -0
  219. data/vendor/assets/components/ember-i18n/LICENSE +10 -0
  220. data/vendor/assets/components/ember-i18n/README.md +148 -0
  221. data/vendor/assets/components/ember-i18n/VERSION +1 -0
  222. data/vendor/assets/components/ember-i18n/bower.json +34 -0
  223. data/vendor/assets/components/ember-i18n/lib/i18n.js +215 -0
  224. data/vendor/assets/components/ember-i18n/package.json +27 -0
  225. data/vendor/assets/components/ember-i18n/script/buildSuite.js +34 -0
  226. data/vendor/assets/components/ember-i18n/script/fetch_vendor.js +66 -0
  227. data/vendor/assets/components/ember-i18n/script/run.js +24 -0
  228. data/vendor/assets/components/ember-simple-auth/.bower.json +31 -0
  229. data/vendor/assets/components/ember-simple-auth/LICENSE +20 -0
  230. data/vendor/assets/components/ember-simple-auth/README.md +15 -0
  231. data/vendor/assets/components/ember-simple-auth/bower.json +21 -0
  232. data/vendor/assets/components/ember-simple-auth/simple-auth-cookie-store.amd.js +220 -0
  233. data/vendor/assets/components/ember-simple-auth/simple-auth-cookie-store.js +284 -0
  234. data/vendor/assets/components/ember-simple-auth/simple-auth-devise.amd.js +243 -0
  235. data/vendor/assets/components/ember-simple-auth/simple-auth-devise.js +312 -0
  236. data/vendor/assets/components/ember-simple-auth/simple-auth-oauth2.amd.js +386 -0
  237. data/vendor/assets/components/ember-simple-auth/simple-auth-oauth2.js +455 -0
  238. data/vendor/assets/components/ember-simple-auth/simple-auth-testing.amd.js +79 -0
  239. data/vendor/assets/components/ember-simple-auth/simple-auth-testing.js +137 -0
  240. data/vendor/assets/components/ember-simple-auth/simple-auth-torii.amd.js +142 -0
  241. data/vendor/assets/components/ember-simple-auth/simple-auth-torii.js +199 -0
  242. data/vendor/assets/components/ember-simple-auth/simple-auth.amd.js +1450 -0
  243. data/vendor/assets/components/ember-simple-auth/simple-auth.js +1548 -0
  244. data/vendor/assets/components/ember/.bower.json +21 -0
  245. data/vendor/assets/components/ember/.gitignore +5 -0
  246. data/vendor/assets/components/ember/Makefile +9 -0
  247. data/vendor/assets/components/ember/README.md +12 -0
  248. data/vendor/assets/components/ember/bower.json +11 -0
  249. data/vendor/assets/components/ember/component.json +13 -0
  250. data/vendor/assets/components/ember/composer.json +27 -0
  251. data/vendor/assets/components/ember/ember-template-compiler.js +336 -0
  252. data/vendor/assets/components/ember/ember.js +46762 -0
  253. data/vendor/assets/components/ember/ember.min.js +20 -0
  254. data/vendor/assets/components/ember/ember.prod.js +46319 -0
  255. data/vendor/assets/components/ember/package.json +11 -0
  256. data/vendor/assets/components/handlebars/.bower.json +16 -0
  257. data/vendor/assets/components/handlebars/.gitignore +2 -0
  258. data/vendor/assets/components/handlebars/README.md +11 -0
  259. data/vendor/assets/components/handlebars/bower.json +6 -0
  260. data/vendor/assets/components/handlebars/component.json +9 -0
  261. data/vendor/assets/components/handlebars/composer.json +35 -0
  262. data/vendor/assets/components/handlebars/handlebars-source.gemspec +21 -0
  263. data/vendor/assets/components/handlebars/handlebars.amd.js +2719 -0
  264. data/vendor/assets/components/handlebars/handlebars.amd.min.js +28 -0
  265. data/vendor/assets/components/handlebars/handlebars.js +2746 -0
  266. data/vendor/assets/components/handlebars/handlebars.js.nuspec +17 -0
  267. data/vendor/assets/components/handlebars/handlebars.min.js +28 -0
  268. data/vendor/assets/components/handlebars/handlebars.runtime.amd.js +515 -0
  269. data/vendor/assets/components/handlebars/handlebars.runtime.amd.min.js +27 -0
  270. data/vendor/assets/components/handlebars/handlebars.runtime.js +530 -0
  271. data/vendor/assets/components/handlebars/handlebars.runtime.min.js +27 -0
  272. data/vendor/assets/components/handlebars/lib/handlebars/source.rb +11 -0
  273. data/vendor/assets/components/jquery/.bower.json +37 -0
  274. data/vendor/assets/components/jquery/MIT-LICENSE.txt +21 -0
  275. data/vendor/assets/components/jquery/bower.json +27 -0
  276. data/vendor/assets/components/jquery/dist/jquery.js +9111 -0
  277. data/vendor/assets/components/jquery/dist/jquery.min.js +5 -0
  278. data/vendor/assets/components/jquery/dist/jquery.min.map +1 -0
  279. data/vendor/assets/components/jquery/src/ajax.js +806 -0
  280. data/vendor/assets/components/jquery/src/ajax/jsonp.js +89 -0
  281. data/vendor/assets/components/jquery/src/ajax/load.js +75 -0
  282. data/vendor/assets/components/jquery/src/ajax/parseJSON.js +13 -0
  283. data/vendor/assets/components/jquery/src/ajax/parseXML.js +28 -0
  284. data/vendor/assets/components/jquery/src/ajax/script.js +64 -0
  285. data/vendor/assets/components/jquery/src/ajax/var/nonce.js +5 -0
  286. data/vendor/assets/components/jquery/src/ajax/var/rquery.js +3 -0
  287. data/vendor/assets/components/jquery/src/ajax/xhr.js +130 -0
  288. data/vendor/assets/components/jquery/src/attributes.js +11 -0
  289. data/vendor/assets/components/jquery/src/attributes/attr.js +143 -0
  290. data/vendor/assets/components/jquery/src/attributes/classes.js +158 -0
  291. data/vendor/assets/components/jquery/src/attributes/prop.js +96 -0
  292. data/vendor/assets/components/jquery/src/attributes/support.js +35 -0
  293. data/vendor/assets/components/jquery/src/attributes/val.js +153 -0
  294. data/vendor/assets/components/jquery/src/callbacks.js +205 -0
  295. data/vendor/assets/components/jquery/src/core.js +500 -0
  296. data/vendor/assets/components/jquery/src/core/access.js +60 -0
  297. data/vendor/assets/components/jquery/src/core/init.js +123 -0
  298. data/vendor/assets/components/jquery/src/core/parseHTML.js +39 -0
  299. data/vendor/assets/components/jquery/src/core/ready.js +96 -0
  300. data/vendor/assets/components/jquery/src/core/var/rsingleTag.js +4 -0
  301. data/vendor/assets/components/jquery/src/css.js +455 -0
  302. data/vendor/assets/components/jquery/src/css/addGetHookIf.js +24 -0
  303. data/vendor/assets/components/jquery/src/css/curCSS.js +57 -0
  304. data/vendor/assets/components/jquery/src/css/defaultDisplay.js +69 -0
  305. data/vendor/assets/components/jquery/src/css/hiddenVisibleSelectors.js +15 -0
  306. data/vendor/assets/components/jquery/src/css/support.js +83 -0
  307. data/vendor/assets/components/jquery/src/css/swap.js +28 -0
  308. data/vendor/assets/components/jquery/src/css/var/cssExpand.js +3 -0
  309. data/vendor/assets/components/jquery/src/css/var/getStyles.js +5 -0
  310. data/vendor/assets/components/jquery/src/css/var/isHidden.js +13 -0
  311. data/vendor/assets/components/jquery/src/css/var/rmargin.js +3 -0
  312. data/vendor/assets/components/jquery/src/css/var/rnumnonpx.js +5 -0
  313. data/vendor/assets/components/jquery/src/data.js +175 -0
  314. data/vendor/assets/components/jquery/src/data/Data.js +181 -0
  315. data/vendor/assets/components/jquery/src/data/accepts.js +20 -0
  316. data/vendor/assets/components/jquery/src/data/var/data_priv.js +5 -0
  317. data/vendor/assets/components/jquery/src/data/var/data_user.js +5 -0
  318. data/vendor/assets/components/jquery/src/deferred.js +149 -0
  319. data/vendor/assets/components/jquery/src/deprecated.js +13 -0
  320. data/vendor/assets/components/jquery/src/dimensions.js +50 -0
  321. data/vendor/assets/components/jquery/src/effects.js +642 -0
  322. data/vendor/assets/components/jquery/src/effects/Tween.js +114 -0
  323. data/vendor/assets/components/jquery/src/effects/animatedSelector.js +13 -0
  324. data/vendor/assets/components/jquery/src/event.js +859 -0
  325. data/vendor/assets/components/jquery/src/event/alias.js +39 -0
  326. data/vendor/assets/components/jquery/src/event/support.js +9 -0
  327. data/vendor/assets/components/jquery/src/exports/amd.js +18 -0
  328. data/vendor/assets/components/jquery/src/exports/global.js +32 -0
  329. data/vendor/assets/components/jquery/src/intro.js +44 -0
  330. data/vendor/assets/components/jquery/src/jquery.js +36 -0
  331. data/vendor/assets/components/jquery/src/manipulation.js +583 -0
  332. data/vendor/assets/components/jquery/src/manipulation/_evalUrl.js +18 -0
  333. data/vendor/assets/components/jquery/src/manipulation/support.js +24 -0
  334. data/vendor/assets/components/jquery/src/manipulation/var/rcheckableType.js +3 -0
  335. data/vendor/assets/components/jquery/src/offset.js +204 -0
  336. data/vendor/assets/components/jquery/src/outro.js +1 -0
  337. data/vendor/assets/components/jquery/src/queue.js +142 -0
  338. data/vendor/assets/components/jquery/src/queue/delay.js +22 -0
  339. data/vendor/assets/components/jquery/src/selector-native.js +171 -0
  340. data/vendor/assets/components/jquery/src/selector-sizzle.js +14 -0
  341. data/vendor/assets/components/jquery/src/selector.js +1 -0
  342. data/vendor/assets/components/jquery/src/serialize.js +111 -0
  343. data/vendor/assets/components/jquery/src/sizzle/dist/sizzle.js +2015 -0
  344. data/vendor/assets/components/jquery/src/sizzle/dist/sizzle.min.js +3 -0
  345. data/vendor/assets/components/jquery/src/sizzle/dist/sizzle.min.map +1 -0
  346. data/vendor/assets/components/jquery/src/traversing.js +200 -0
  347. data/vendor/assets/components/jquery/src/traversing/findFilter.js +100 -0
  348. data/vendor/assets/components/jquery/src/traversing/var/rneedsContext.js +6 -0
  349. data/vendor/assets/components/jquery/src/var/arr.js +3 -0
  350. data/vendor/assets/components/jquery/src/var/class2type.js +4 -0
  351. data/vendor/assets/components/jquery/src/var/concat.js +5 -0
  352. data/vendor/assets/components/jquery/src/var/hasOwn.js +5 -0
  353. data/vendor/assets/components/jquery/src/var/indexOf.js +5 -0
  354. data/vendor/assets/components/jquery/src/var/pnum.js +3 -0
  355. data/vendor/assets/components/jquery/src/var/push.js +5 -0
  356. data/vendor/assets/components/jquery/src/var/rnotwhite.js +3 -0
  357. data/vendor/assets/components/jquery/src/var/slice.js +5 -0
  358. data/vendor/assets/components/jquery/src/var/strundefined.js +3 -0
  359. data/vendor/assets/components/jquery/src/var/support.js +4 -0
  360. data/vendor/assets/components/jquery/src/var/toString.js +5 -0
  361. data/vendor/assets/components/jquery/src/var/trim.js +3 -0
  362. data/vendor/assets/components/jquery/src/wrap.js +78 -0
  363. data/vendor/assets/components/moment/.bower.json +30 -0
  364. data/vendor/assets/components/moment/LICENSE +22 -0
  365. data/vendor/assets/components/moment/bower.json +20 -0
  366. data/vendor/assets/components/moment/lang/ar-ma.js +56 -0
  367. data/vendor/assets/components/moment/lang/ar-sa.js +96 -0
  368. data/vendor/assets/components/moment/lang/ar.js +97 -0
  369. data/vendor/assets/components/moment/lang/az.js +102 -0
  370. data/vendor/assets/components/moment/lang/bg.js +86 -0
  371. data/vendor/assets/components/moment/lang/bn.js +106 -0
  372. data/vendor/assets/components/moment/lang/br.js +107 -0
  373. data/vendor/assets/components/moment/lang/bs.js +139 -0
  374. data/vendor/assets/components/moment/lang/ca.js +66 -0
  375. data/vendor/assets/components/moment/lang/cs.js +155 -0
  376. data/vendor/assets/components/moment/lang/cv.js +59 -0
  377. data/vendor/assets/components/moment/lang/cy.js +77 -0
  378. data/vendor/assets/components/moment/lang/da.js +56 -0
  379. data/vendor/assets/components/moment/lang/de-at.js +72 -0
  380. data/vendor/assets/components/moment/lang/de.js +71 -0
  381. data/vendor/assets/components/moment/lang/el.js +90 -0
  382. data/vendor/assets/components/moment/lang/en-au.js +62 -0
  383. data/vendor/assets/components/moment/lang/en-ca.js +59 -0
  384. data/vendor/assets/components/moment/lang/en-gb.js +63 -0
  385. data/vendor/assets/components/moment/lang/eo.js +65 -0
  386. data/vendor/assets/components/moment/lang/es.js +75 -0
  387. data/vendor/assets/components/moment/lang/et.js +76 -0
  388. data/vendor/assets/components/moment/lang/eu.js +60 -0
  389. data/vendor/assets/components/moment/lang/fa.js +97 -0
  390. data/vendor/assets/components/moment/lang/fi.js +103 -0
  391. data/vendor/assets/components/moment/lang/fo.js +56 -0
  392. data/vendor/assets/components/moment/lang/fr-ca.js +54 -0
  393. data/vendor/assets/components/moment/lang/fr.js +58 -0
  394. data/vendor/assets/components/moment/lang/gl.js +71 -0
  395. data/vendor/assets/components/moment/lang/he.js +77 -0
  396. data/vendor/assets/components/moment/lang/hi.js +105 -0
  397. data/vendor/assets/components/moment/lang/hr.js +140 -0
  398. data/vendor/assets/components/moment/lang/hu.js +105 -0
  399. data/vendor/assets/components/moment/lang/hy-am.js +113 -0
  400. data/vendor/assets/components/moment/lang/id.js +67 -0
  401. data/vendor/assets/components/moment/lang/is.js +124 -0
  402. data/vendor/assets/components/moment/lang/it.js +59 -0
  403. data/vendor/assets/components/moment/lang/ja.js +58 -0
  404. data/vendor/assets/components/moment/lang/ka.js +108 -0
  405. data/vendor/assets/components/moment/lang/km.js +55 -0
  406. data/vendor/assets/components/moment/lang/ko.js +63 -0
  407. data/vendor/assets/components/moment/lang/lb.js +160 -0
  408. data/vendor/assets/components/moment/lang/lt.js +118 -0
  409. data/vendor/assets/components/moment/lang/lv.js +77 -0
  410. data/vendor/assets/components/moment/lang/mk.js +86 -0
  411. data/vendor/assets/components/moment/lang/ml.js +64 -0
  412. data/vendor/assets/components/moment/lang/mr.js +104 -0
  413. data/vendor/assets/components/moment/lang/ms-my.js +66 -0
  414. data/vendor/assets/components/moment/lang/nb.js +57 -0
  415. data/vendor/assets/components/moment/lang/ne.js +105 -0
  416. data/vendor/assets/components/moment/lang/nl.js +67 -0
  417. data/vendor/assets/components/moment/lang/nn.js +56 -0
  418. data/vendor/assets/components/moment/lang/pl.js +98 -0
  419. data/vendor/assets/components/moment/lang/pt-br.js +56 -0
  420. data/vendor/assets/components/moment/lang/pt.js +60 -0
  421. data/vendor/assets/components/moment/lang/ro.js +72 -0
  422. data/vendor/assets/components/moment/lang/ru.js +166 -0
  423. data/vendor/assets/components/moment/lang/sk.js +156 -0
  424. data/vendor/assets/components/moment/lang/sl.js +144 -0
  425. data/vendor/assets/components/moment/lang/sq.js +61 -0
  426. data/vendor/assets/components/moment/lang/sr-cyrl.js +106 -0
  427. data/vendor/assets/components/moment/lang/sr.js +106 -0
  428. data/vendor/assets/components/moment/lang/sv.js +63 -0
  429. data/vendor/assets/components/moment/lang/ta.js +112 -0
  430. data/vendor/assets/components/moment/lang/th.js +58 -0
  431. data/vendor/assets/components/moment/lang/tl-ph.js +58 -0
  432. data/vendor/assets/components/moment/lang/tr.js +93 -0
  433. data/vendor/assets/components/moment/lang/tzm-latn.js +55 -0
  434. data/vendor/assets/components/moment/lang/tzm.js +55 -0
  435. data/vendor/assets/components/moment/lang/uk.js +157 -0
  436. data/vendor/assets/components/moment/lang/uz.js +55 -0
  437. data/vendor/assets/components/moment/lang/vi.js +62 -0
  438. data/vendor/assets/components/moment/lang/zh-cn.js +108 -0
  439. data/vendor/assets/components/moment/lang/zh-tw.js +84 -0
  440. data/vendor/assets/components/moment/min/langs.js +6426 -0
  441. data/vendor/assets/components/moment/min/langs.min.js +4 -0
  442. data/vendor/assets/components/moment/min/moment-with-langs.js +8521 -0
  443. data/vendor/assets/components/moment/min/moment-with-langs.min.js +9 -0
  444. data/vendor/assets/components/moment/min/moment.min.js +6 -0
  445. data/vendor/assets/components/moment/moment.js +2610 -0
  446. data/vendor/assets/components/moment/readme.md +388 -0
  447. data/vendor/assets/components/numeral/.bower.json +28 -0
  448. data/vendor/assets/components/numeral/.gitignore +29 -0
  449. data/vendor/assets/components/numeral/.travis.yml +7 -0
  450. data/vendor/assets/components/numeral/Gruntfile.js +91 -0
  451. data/vendor/assets/components/numeral/LICENSE +22 -0
  452. data/vendor/assets/components/numeral/README.md +213 -0
  453. data/vendor/assets/components/numeral/bower.json +16 -0
  454. data/vendor/assets/components/numeral/component.json +16 -0
  455. data/vendor/assets/components/numeral/languages.js +989 -0
  456. data/vendor/assets/components/numeral/languages/be-nl.js +35 -0
  457. data/vendor/assets/components/numeral/languages/chs.js +34 -0
  458. data/vendor/assets/components/numeral/languages/cs.js +34 -0
  459. data/vendor/assets/components/numeral/languages/da-dk.js +34 -0
  460. data/vendor/assets/components/numeral/languages/de-ch.js +34 -0
  461. data/vendor/assets/components/numeral/languages/de.js +34 -0
  462. data/vendor/assets/components/numeral/languages/en-gb.js +38 -0
  463. data/vendor/assets/components/numeral/languages/es-ES.js +39 -0
  464. data/vendor/assets/components/numeral/languages/es.js +39 -0
  465. data/vendor/assets/components/numeral/languages/et.js +37 -0
  466. data/vendor/assets/components/numeral/languages/fi.js +34 -0
  467. data/vendor/assets/components/numeral/languages/fr-CA.js +34 -0
  468. data/vendor/assets/components/numeral/languages/fr-ch.js +34 -0
  469. data/vendor/assets/components/numeral/languages/fr.js +34 -0
  470. data/vendor/assets/components/numeral/languages/hu.js +34 -0
  471. data/vendor/assets/components/numeral/languages/it.js +34 -0
  472. data/vendor/assets/components/numeral/languages/ja.js +34 -0
  473. data/vendor/assets/components/numeral/languages/nl-nl.js +35 -0
  474. data/vendor/assets/components/numeral/languages/pl.js +34 -0
  475. data/vendor/assets/components/numeral/languages/pt-br.js +34 -0
  476. data/vendor/assets/components/numeral/languages/pt-pt.js +34 -0
  477. data/vendor/assets/components/numeral/languages/ru-UA.js +35 -0
  478. data/vendor/assets/components/numeral/languages/ru.js +37 -0
  479. data/vendor/assets/components/numeral/languages/sk.js +34 -0
  480. data/vendor/assets/components/numeral/languages/th.js +34 -0
  481. data/vendor/assets/components/numeral/languages/tr.js +67 -0
  482. data/vendor/assets/components/numeral/languages/uk-UA.js +35 -0
  483. data/vendor/assets/components/numeral/min/languages.min.js +129 -0
  484. data/vendor/assets/components/numeral/min/languages/be-nl.min.js +6 -0
  485. data/vendor/assets/components/numeral/min/languages/chs.min.js +6 -0
  486. data/vendor/assets/components/numeral/min/languages/cs.min.js +6 -0
  487. data/vendor/assets/components/numeral/min/languages/da-dk.min.js +6 -0
  488. data/vendor/assets/components/numeral/min/languages/de-ch.min.js +6 -0
  489. data/vendor/assets/components/numeral/min/languages/de.min.js +6 -0
  490. data/vendor/assets/components/numeral/min/languages/en-gb.min.js +6 -0
  491. data/vendor/assets/components/numeral/min/languages/es-ES.min.js +6 -0
  492. data/vendor/assets/components/numeral/min/languages/es.min.js +6 -0
  493. data/vendor/assets/components/numeral/min/languages/et.min.js +9 -0
  494. data/vendor/assets/components/numeral/min/languages/fi.min.js +6 -0
  495. data/vendor/assets/components/numeral/min/languages/fr-CA.min.js +6 -0
  496. data/vendor/assets/components/numeral/min/languages/fr-ch.min.js +6 -0
  497. data/vendor/assets/components/numeral/min/languages/fr.min.js +6 -0
  498. data/vendor/assets/components/numeral/min/languages/hu.min.js +6 -0
  499. data/vendor/assets/components/numeral/min/languages/it.min.js +6 -0
  500. data/vendor/assets/components/numeral/min/languages/ja.min.js +6 -0
  501. data/vendor/assets/components/numeral/min/languages/nl-nl.min.js +6 -0
  502. data/vendor/assets/components/numeral/min/languages/pl.min.js +6 -0
  503. data/vendor/assets/components/numeral/min/languages/pt-br.min.js +6 -0
  504. data/vendor/assets/components/numeral/min/languages/pt-pt.min.js +6 -0
  505. data/vendor/assets/components/numeral/min/languages/ru-UA.min.js +1 -0
  506. data/vendor/assets/components/numeral/min/languages/ru.min.js +6 -0
  507. data/vendor/assets/components/numeral/min/languages/sk.min.js +6 -0
  508. data/vendor/assets/components/numeral/min/languages/th.min.js +6 -0
  509. data/vendor/assets/components/numeral/min/languages/tr.min.js +6 -0
  510. data/vendor/assets/components/numeral/min/languages/uk-UA.min.js +1 -0
  511. data/vendor/assets/components/numeral/min/numeral.min.js +8 -0
  512. data/vendor/assets/components/numeral/numeral.js +679 -0
  513. data/vendor/assets/components/numeral/package.json +50 -0
  514. data/vendor/assets/components/numeral/tests/languages/be-nl.js +107 -0
  515. data/vendor/assets/components/numeral/tests/languages/chs.js +101 -0
  516. data/vendor/assets/components/numeral/tests/languages/cs.js +102 -0
  517. data/vendor/assets/components/numeral/tests/languages/da-dk.js +101 -0
  518. data/vendor/assets/components/numeral/tests/languages/de-ch.js +101 -0
  519. data/vendor/assets/components/numeral/tests/languages/de.js +101 -0
  520. data/vendor/assets/components/numeral/tests/languages/en-gb.js +101 -0
  521. data/vendor/assets/components/numeral/tests/languages/en.js +98 -0
  522. data/vendor/assets/components/numeral/tests/languages/es-ES.js +101 -0
  523. data/vendor/assets/components/numeral/tests/languages/es.js +101 -0
  524. data/vendor/assets/components/numeral/tests/languages/et.js +101 -0
  525. data/vendor/assets/components/numeral/tests/languages/fi.js +101 -0
  526. data/vendor/assets/components/numeral/tests/languages/fr-CA.js +101 -0
  527. data/vendor/assets/components/numeral/tests/languages/fr-ch.js +101 -0
  528. data/vendor/assets/components/numeral/tests/languages/fr.js +101 -0
  529. data/vendor/assets/components/numeral/tests/languages/hu.js +101 -0
  530. data/vendor/assets/components/numeral/tests/languages/it.js +101 -0
  531. data/vendor/assets/components/numeral/tests/languages/ja.js +101 -0
  532. data/vendor/assets/components/numeral/tests/languages/nl-nl.js +109 -0
  533. data/vendor/assets/components/numeral/tests/languages/pl.js +102 -0
  534. data/vendor/assets/components/numeral/tests/languages/pt-br.js +101 -0
  535. data/vendor/assets/components/numeral/tests/languages/pt-pt.js +101 -0
  536. data/vendor/assets/components/numeral/tests/languages/ru-UA.js +102 -0
  537. data/vendor/assets/components/numeral/tests/languages/ru.js +102 -0
  538. data/vendor/assets/components/numeral/tests/languages/sk.js +101 -0
  539. data/vendor/assets/components/numeral/tests/languages/th.js +101 -0
  540. data/vendor/assets/components/numeral/tests/languages/tr.js +101 -0
  541. data/vendor/assets/components/numeral/tests/languages/uk-UA.js +102 -0
  542. data/vendor/assets/components/numeral/tests/numeral/format.js +204 -0
  543. data/vendor/assets/components/numeral/tests/numeral/manipulate.js +104 -0
  544. data/vendor/assets/components/numeral/tests/numeral/misc.js +123 -0
  545. data/vendor/assets/components/numeral/tests/numeral/unformat.js +96 -0
  546. data/vendor/assets/components/qunit-bdd/.bower.json +31 -0
  547. data/vendor/assets/components/qunit-bdd/LICENSE +13 -0
  548. data/vendor/assets/components/qunit-bdd/README.md +282 -0
  549. data/vendor/assets/components/qunit-bdd/bower.json +22 -0
  550. data/vendor/assets/components/qunit-bdd/karma.conf.js +70 -0
  551. data/vendor/assets/components/qunit-bdd/lib/qunit-bdd.js +755 -0
  552. data/vendor/assets/components/qunit-bdd/package.json +33 -0
  553. data/vendor/assets/javascripts/bs-breadcrumbs.js +85 -0
  554. data/vendor/assets/javascripts/bs-core.js +476 -0
  555. data/vendor/assets/javascripts/bs-notifications.js +111 -0
  556. data/vendor/assets/javascripts/daterangepicker.js +1030 -0
  557. data/vendor/assets/javascripts/fix_bind_phantomjs.js +37 -0
  558. data/vendor/assets/javascripts/jquery-deparam.js +97 -0
  559. data/vendor/assets/javascripts/sidebar-tree.js +68 -0
  560. data/vendor/assets/stylesheets/daterangepicker.css +271 -0
  561. metadata +766 -0
@@ -0,0 +1,1450 @@
1
+ (function(global) {
2
+ var define = global.define;
3
+ var require = global.require;
4
+ var Ember = global.Ember;
5
+ if (typeof Ember === 'undefined' && typeof require !== 'undefined') {
6
+ Ember = require('ember');
7
+ }
8
+
9
+ Ember.libraries.register('Ember Simple Auth', '0.6.4');
10
+
11
+ define("simple-auth/authenticators/base",
12
+ ["exports"],
13
+ function(__exports__) {
14
+ "use strict";
15
+ /**
16
+ The base for all authenticators. __This serves as a starting point for
17
+ implementing custom authenticators and must not be used directly.__
18
+
19
+ The authenticator authenticates the session. The actual mechanism used to do
20
+ this might e.g. be posting a set of credentials to a server and in exchange
21
+ retrieving an access token, initiating authentication against an external
22
+ provider like Facebook etc. and depends on the specific authenticator. Any
23
+ data that the authenticator receives upon successful authentication and
24
+ resolves with from the
25
+ [`Authenticators.Base#authenticate`](#SimpleAuth-Authenticators-Base-authenticate)
26
+ method is stored in the session and can then be used by the authorizer (see
27
+ [`Authorizers.Base`](#SimpleAuth-Authorizers-Base)).
28
+
29
+ The authenticator also decides whether a set of data that was restored from
30
+ the session store (see
31
+ [`Stores.Base`](#SimpleAuth-Stores-Base)) is sufficient for the session to be
32
+ authenticated or not.
33
+
34
+ __Custom authenticators have to be registered with Ember's dependency
35
+ injection container__ so that the session can retrieve an instance, e.g.:
36
+
37
+ ```javascript
38
+ import Base from 'simple-auth/authenticators/base';
39
+
40
+ var CustomAuthenticator = Base.extend({
41
+ ...
42
+ });
43
+
44
+ Ember.Application.initializer({
45
+ name: 'authentication',
46
+ initialize: function(container, application) {
47
+ container.register('authenticator:custom', CustomAuthenticator);
48
+ }
49
+ });
50
+ ```
51
+
52
+ ```javascript
53
+ // app/controllers/login.js
54
+ import AuthenticationControllerMixin from 'simple-auth/mixins/authentication-controller-mixin';
55
+
56
+ export default Ember.Controller.extend(AuthenticationControllerMixin, {
57
+ authenticator: 'authenticator:custom'
58
+ });
59
+ ```
60
+
61
+ @class Base
62
+ @namespace SimpleAuth.Authenticators
63
+ @module simple-auth/authenticators/base
64
+ @extends Ember.Object
65
+ @uses Ember.Evented
66
+ */
67
+ __exports__["default"] = Ember.Object.extend(Ember.Evented, {
68
+ /**
69
+ __Triggered when the data that constitutes the session is updated by the
70
+ authenticator__. This might happen e.g. because the authenticator refreshes
71
+ it or an event from is triggered from an external authentication provider.
72
+ The session automatically catches that event, passes the updated data back
73
+ to the authenticator's
74
+ [SimpleAuth.Authenticators.Base#restore](#SimpleAuth-Authenticators-Base-restore)
75
+ method and handles the result of that invocation accordingly.
76
+
77
+ @event sessionDataUpdated
78
+ @param {Object} data The updated session data
79
+ */
80
+ /**
81
+ __Triggered when the data that constitutes the session is invalidated by
82
+ the authenticator__. This might happen e.g. because the date expires or an
83
+ event is triggered from an external authentication provider. The session
84
+ automatically catches that event and invalidates itself.
85
+
86
+ @event sessionDataInvalidated
87
+ @param {Object} data The updated session data
88
+ */
89
+
90
+ /**
91
+ Restores the session from a set of properties. __This method is invoked by
92
+ the session either after the application starts up and session data was
93
+ restored from the store__ or when properties in the store have changed due
94
+ to external events (e.g. in another tab) and the new set of properties
95
+ needs to be re-checked for whether it still constitutes an authenticated
96
+ session.
97
+
98
+ __This method returns a promise. A resolving promise will result in the
99
+ session being authenticated.__ Any properties the promise resolves with
100
+ will be saved in and accessible via the session. In most cases the `data`
101
+ argument will simply be forwarded through the promise. A rejecting promise
102
+ indicates that authentication failed and the session will remain unchanged.
103
+
104
+ `SimpleAuth.Authenticators.Base`'s implementation always returns a
105
+ rejecting promise.
106
+
107
+ @method restore
108
+ @param {Object} data The data to restore the session from
109
+ @return {Ember.RSVP.Promise} A promise that when it resolves results in the session being authenticated
110
+ */
111
+ restore: function(data) {
112
+ return new Ember.RSVP.reject();
113
+ },
114
+
115
+ /**
116
+ Authenticates the session with the specified `options`. These options vary
117
+ depending on the actual authentication mechanism the authenticator
118
+ implements (e.g. a set of credentials or a Facebook account id etc.). __The
119
+ session will invoke this method when an action in the appliaction triggers
120
+ authentication__ (see
121
+ [SimpleAuth.AuthenticationControllerMixin.actions#authenticate](#SimpleAuth-AuthenticationControllerMixin-authenticate)).
122
+
123
+ __This method returns a promise. A resolving promise will result in the
124
+ session being authenticated.__ Any properties the promise resolves with
125
+ will be saved in and accessible via the session. A rejecting promise
126
+ indicates that authentication failed and the session will remain unchanged.
127
+
128
+ `SimpleAuth.Authenticators.Base`'s implementation always returns a
129
+ rejecting promise and thus never authenticates the session.
130
+
131
+ @method authenticate
132
+ @param {Object} options The options to authenticate the session with
133
+ @return {Ember.RSVP.Promise} A promise that when it resolves results in the session being authenticated
134
+ */
135
+ authenticate: function(options) {
136
+ return new Ember.RSVP.reject();
137
+ },
138
+
139
+ /**
140
+ This callback is invoked when the session is invalidated. While the session
141
+ will invalidate itself and clear all session properties, it might be
142
+ necessary for some authenticators to perform additional tasks (e.g.
143
+ invalidating an access token on the server), which should be done in this
144
+ method.
145
+
146
+ __This method returns a promise. A resolving promise will result in the
147
+ session being invalidated.__ A rejecting promise will result in the session
148
+ invalidation being intercepted and the session being left authenticated.
149
+
150
+ `SimpleAuth.Authenticators.Base`'s implementation always returns a
151
+ resolving promise and thus never intercepts session invalidation.
152
+
153
+ @method invalidate
154
+ @param {Object} data The data that the session currently holds
155
+ @return {Ember.RSVP.Promise} A promise that when it resolves results in the session being invalidated
156
+ */
157
+ invalidate: function(data) {
158
+ return new Ember.RSVP.resolve();
159
+ }
160
+ });
161
+ });
162
+ define("simple-auth/authorizers/base",
163
+ ["exports"],
164
+ function(__exports__) {
165
+ "use strict";
166
+ /**
167
+ The base for all authorizers. __This serves as a starting point for
168
+ implementing custom authorizers and must not be used directly.__
169
+
170
+ __The authorizer preprocesses all XHR requests__ (except ones to 3rd party
171
+ origins, see
172
+ [Configuration.crossOriginWhitelist](#SimpleAuth-Configuration-crossOriginWhitelist))
173
+ and makes sure they have the required data attached that allows the server to
174
+ identify the user making the request. This data might be an HTTP header,
175
+ query string parameters in the URL, cookies etc. __The authorizer has to fit
176
+ the authenticator__ (see
177
+ [SimpleAuth.Authenticators.Base](#SimpleAuth-Authenticators-Base))
178
+ as it relies on data that the authenticator acquires during authentication.
179
+
180
+ @class Base
181
+ @namespace SimpleAuth.Authorizers
182
+ @module simple-auth/authorizers/base
183
+ @extends Ember.Object
184
+ */
185
+ __exports__["default"] = Ember.Object.extend({
186
+ /**
187
+ The session the authorizer gets the data it needs to authorize requests
188
+ from.
189
+
190
+ @property session
191
+ @readOnly
192
+ @type SimpleAuth.Session
193
+ @default the session instance
194
+ */
195
+ session: null,
196
+
197
+ /**
198
+ Authorizes an XHR request by adding some sort of secret information that
199
+ allows the server to identify the user making the request (e.g. a token in
200
+ the `Authorization` header or some other secret in the query string etc.).
201
+
202
+ `SimpleAuth.Authorizers.Base`'s implementation does nothing.
203
+
204
+ @method authorize
205
+ @param {jqXHR} jqXHR The XHR request to authorize (see http://api.jquery.com/jQuery.ajax/#jqXHR)
206
+ @param {Object} requestOptions The options as provided to the `$.ajax` method (see http://api.jquery.com/jQuery.ajaxPrefilter/)
207
+ */
208
+ authorize: function(jqXHR, requestOptions) {
209
+ }
210
+ });
211
+ });
212
+ define("simple-auth/configuration",
213
+ ["./utils/get-global-config","exports"],
214
+ function(__dependency1__, __exports__) {
215
+ "use strict";
216
+ var getGlobalConfig = __dependency1__["default"];
217
+
218
+ /**
219
+ Ember Simple Auth's configuration object.
220
+
221
+ To change any of these values, define a global environment object for Ember
222
+ Simple Auth and define the values there:
223
+
224
+ ```javascript
225
+ window.ENV = window.ENV || {};
226
+ window.ENV['simple-auth'] = {
227
+ authenticationRoute: 'sign-in'
228
+ };
229
+ ```
230
+
231
+ @class Configuration
232
+ @namespace SimpleAuth
233
+ @module simple-auth/configuration
234
+ */
235
+ __exports__["default"] = {
236
+ /**
237
+ The route to transition to for authentication.
238
+
239
+ @property authenticationRoute
240
+ @readOnly
241
+ @static
242
+ @type String
243
+ @default 'login'
244
+ */
245
+ authenticationRoute: 'login',
246
+
247
+ /**
248
+ The route to transition to after successful authentication.
249
+
250
+ @property routeAfterAuthentication
251
+ @readOnly
252
+ @static
253
+ @type String
254
+ @default 'index'
255
+ */
256
+ routeAfterAuthentication: 'index',
257
+
258
+ /**
259
+ The name of the property that the session is injected with into routes and
260
+ controllers.
261
+
262
+ @property sessionPropertyName
263
+ @readOnly
264
+ @static
265
+ @type String
266
+ @default 'session'
267
+ */
268
+ sessionPropertyName: 'session',
269
+
270
+ /**
271
+ The authorizer factory to use as it is registered with Ember's container,
272
+ see
273
+ [Ember's API docs](http://emberjs.com/api/classes/Ember.Application.html#method_register);
274
+ when the application does not interact with a server that requires
275
+ authorized requests, no auzthorizer is needed.
276
+
277
+ @property authorizer
278
+ @readOnly
279
+ @static
280
+ @type String
281
+ @default null
282
+ */
283
+ authorizer: null,
284
+
285
+ /**
286
+ The session factory to use as it is registered with Ember's container,
287
+ see
288
+ [Ember's API docs](http://emberjs.com/api/classes/Ember.Application.html#method_register).
289
+
290
+ @property session
291
+ @readOnly
292
+ @static
293
+ @type String
294
+ @default 'simple-auth-session:main'
295
+ */
296
+ session: 'simple-auth-session:main',
297
+
298
+ /**
299
+ The store factory to use as it is registered with Ember's container, see
300
+ [Ember's API docs](http://emberjs.com/api/classes/Ember.Application.html#method_register).
301
+
302
+ @property store
303
+ @readOnly
304
+ @static
305
+ @type String
306
+ @default simple-auth-session-store:local-storage
307
+ */
308
+ store: 'simple-auth-session-store:local-storage',
309
+
310
+ /**
311
+ Ember Simple Auth will never authorize requests going to a different origin
312
+ than the one the Ember.js application was loaded from; to explicitely
313
+ enable authorization for additional origins, whitelist those origins with
314
+ this setting. _Beware that origins consist of protocol, host and port (port
315
+ can be left out when it is 80 for HTTP or 443 for HTTPS)_
316
+
317
+ @property crossOriginWhitelist
318
+ @readOnly
319
+ @static
320
+ @type Array
321
+ @default []
322
+ */
323
+ crossOriginWhitelist: [],
324
+
325
+ /**
326
+ @property applicationRootUrl
327
+ @private
328
+ */
329
+ applicationRootUrl: null,
330
+
331
+ /**
332
+ @method load
333
+ @private
334
+ */
335
+ load: function(container) {
336
+ var globalConfig = getGlobalConfig('simple-auth');
337
+ this.authenticationRoute = globalConfig.authenticationRoute || this.authenticationRoute;
338
+ this.routeAfterAuthentication = globalConfig.routeAfterAuthentication || this.routeAfterAuthentication;
339
+ this.sessionPropertyName = globalConfig.sessionPropertyName || this.sessionPropertyName;
340
+ this.authorizer = globalConfig.authorizer || this.authorizer;
341
+ this.session = globalConfig.session || this.session;
342
+ this.store = globalConfig.store || this.store;
343
+ this.crossOriginWhitelist = globalConfig.crossOriginWhitelist || this.crossOriginWhitelist;
344
+ this.applicationRootUrl = container.lookup('router:main').get('rootURL') || '/';
345
+ }
346
+ };
347
+ });
348
+ define("simple-auth/ember",
349
+ ["./initializer"],
350
+ function(__dependency1__) {
351
+ "use strict";
352
+ var initializer = __dependency1__["default"];
353
+
354
+ Ember.onLoad('Ember.Application', function(Application) {
355
+ Application.initializer(initializer);
356
+ });
357
+ });
358
+ define("simple-auth/initializer",
359
+ ["./setup","exports"],
360
+ function(__dependency1__, __exports__) {
361
+ "use strict";
362
+ var setup = __dependency1__["default"];
363
+
364
+ __exports__["default"] = {
365
+ name: 'simple-auth',
366
+ initialize: function(container, application) {
367
+ setup(container, application);
368
+ }
369
+ };
370
+ });
371
+ define("simple-auth/mixins/application-route-mixin",
372
+ ["./../configuration","exports"],
373
+ function(__dependency1__, __exports__) {
374
+ "use strict";
375
+ var Configuration = __dependency1__["default"];
376
+
377
+ /**
378
+ The mixin for the application route; defines actions to authenticate the
379
+ session as well as to invalidate it. These actions can be used in all
380
+ templates like this:
381
+
382
+ ```handlebars
383
+ {{#if session.isAuthenticated}}
384
+ <a {{ action 'invalidateSession' }}>Logout</a>
385
+ {{else}}
386
+ <a {{ action 'authenticateSession' }}>Login</a>
387
+ {{/if}}
388
+ ```
389
+
390
+ or in the case that the application uses a dedicated route for logging in:
391
+
392
+ ```handlebars
393
+ {{#if session.isAuthenticated}}
394
+ <a {{ action 'invalidateSession' }}>Logout</a>
395
+ {{else}}
396
+ {{#link-to 'login'}}Login{{/link-to}}
397
+ {{/if}}
398
+ ```
399
+
400
+ This mixin also defines actions that are triggered whenever the session is
401
+ successfully authenticated or invalidated and whenever authentication or
402
+ invalidation fails. These actions provide a good starting point for adding
403
+ custom behavior to these events.
404
+
405
+ __When this mixin is used and the application's `ApplicationRoute` defines
406
+ the `beforeModel` method, that method has to call `_super`.__
407
+
408
+ Using this mixin is optional. Without using it, the session's events will not
409
+ be automatically translated into route actions but would have to be handled
410
+ inidivially, e.g. in an initializer:
411
+
412
+ ```javascript
413
+ Ember.Application.initializer({
414
+ name: 'authentication',
415
+ after: 'simple-auth',
416
+ initialize: function(container, application) {
417
+ var applicationRoute = container.lookup('route:application');
418
+ var session = container.lookup('simple-auth-session:main');
419
+ // handle the session events
420
+ session.on('sessionAuthenticationSucceeded', function() {
421
+ applicationRoute.transitionTo('index');
422
+ });
423
+ }
424
+ });
425
+ ```
426
+
427
+ @class ApplicationRouteMixin
428
+ @namespace SimpleAuth
429
+ @module simple-auth/mixins/application-route-mixin
430
+ @extends Ember.Mixin
431
+ @static
432
+ */
433
+ __exports__["default"] = Ember.Mixin.create({
434
+ /**
435
+ @method beforeModel
436
+ @private
437
+ */
438
+ beforeModel: function(transition) {
439
+ this._super(transition);
440
+ if (!this.get('_authEventListenersAssigned')) {
441
+ this.set('_authEventListenersAssigned', true);
442
+ var _this = this;
443
+ Ember.A([
444
+ 'sessionAuthenticationSucceeded',
445
+ 'sessionAuthenticationFailed',
446
+ 'sessionInvalidationSucceeded',
447
+ 'sessionInvalidationFailed',
448
+ 'authorizationFailed'
449
+ ]).forEach(function(event) {
450
+ _this.get(Configuration.sessionPropertyName).on(event, function(error) {
451
+ Array.prototype.unshift.call(arguments, event);
452
+ transition.send.apply(transition, arguments);
453
+ });
454
+ });
455
+ }
456
+ },
457
+
458
+ actions: {
459
+ /**
460
+ This action triggers transition to the
461
+ [`Configuration.authenticationRoute`](#SimpleAuth-Configuration-authenticationRoute).
462
+ It can be used in templates as shown above. It is also triggered
463
+ automatically by the
464
+ [`AuthenticatedRouteMixin`](#SimpleAuth-AuthenticatedRouteMixin) whenever
465
+ a route that requries authentication is accessed but the session is not
466
+ currently authenticated.
467
+
468
+ __For an application that works without an authentication route (e.g.
469
+ because it opens a new window to handle authentication there), this is
470
+ the action to override, e.g.:__
471
+
472
+ ```javascript
473
+ App.ApplicationRoute = Ember.Route.extend(SimpleAuth.ApplicationRouteMixin, {
474
+ actions: {
475
+ authenticateSession: function() {
476
+ this.get('session').authenticate('authenticator:custom', {});
477
+ }
478
+ }
479
+ });
480
+ ```
481
+
482
+ @method actions.authenticateSession
483
+ */
484
+ authenticateSession: function() {
485
+ this.transitionTo(Configuration.authenticationRoute);
486
+ },
487
+
488
+ /**
489
+ This action is triggered whenever the session is successfully
490
+ authenticated. If there is a transition that was previously intercepted
491
+ by
492
+ [`AuthenticatedRouteMixin#beforeModel`](#SimpleAuth-AuthenticatedRouteMixin-beforeModel)
493
+ it will retry it. If there is no such transition, this action transitions
494
+ to the
495
+ [`Configuration.routeAfterAuthentication`](#SimpleAuth-Configuration-routeAfterAuthentication).
496
+
497
+ @method actions.sessionAuthenticationSucceeded
498
+ */
499
+ sessionAuthenticationSucceeded: function() {
500
+ var attemptedTransition = this.get(Configuration.sessionPropertyName).get('attemptedTransition');
501
+ if (attemptedTransition) {
502
+ attemptedTransition.retry();
503
+ this.get(Configuration.sessionPropertyName).set('attemptedTransition', null);
504
+ } else {
505
+ this.transitionTo(Configuration.routeAfterAuthentication);
506
+ }
507
+ },
508
+
509
+ /**
510
+ This action is triggered whenever session authentication fails. The
511
+ `error` argument is the error object that the promise the authenticator
512
+ returns rejects with. (see
513
+ [`Authenticators.Base#authenticate`](#SimpleAuth-Authenticators-Base-authenticate)).
514
+
515
+ It can be overridden to display error messages etc.:
516
+
517
+ ```javascript
518
+ App.ApplicationRoute = Ember.Route.extend(SimpleAuth.ApplicationRouteMixin, {
519
+ actions: {
520
+ sessionAuthenticationFailed: function(error) {
521
+ this.controllerFor('application').set('loginErrorMessage', error.message);
522
+ }
523
+ }
524
+ });
525
+ ```
526
+
527
+ @method actions.sessionAuthenticationFailed
528
+ @param {any} error The error the promise returned by the authenticator rejects with, see [`Authenticators.Base#authenticate`](#SimpleAuth-Authenticators-Base-authenticate)
529
+ */
530
+ sessionAuthenticationFailed: function(error) {
531
+ },
532
+
533
+ /**
534
+ This action invalidates the session (see
535
+ [`Session#invalidate`](#SimpleAuth-Session-invalidate)).
536
+ If invalidation succeeds, it reloads the application (see
537
+ [`ApplicationRouteMixin#sessionInvalidationSucceeded`](#SimpleAuth-ApplicationRouteMixin-sessionInvalidationSucceeded)).
538
+
539
+ @method actions.invalidateSession
540
+ */
541
+ invalidateSession: function() {
542
+ this.get(Configuration.sessionPropertyName).invalidate();
543
+ },
544
+
545
+ /**
546
+ This action is invoked whenever the session is successfully invalidated.
547
+ It reloads the Ember.js application by redirecting the browser to the
548
+ application's root URL so that all in-memory data (such as Ember Data
549
+ stores etc.) gets cleared. The root URL is automatically retrieved from
550
+ the Ember.js application's router (see
551
+ http://emberjs.com/guides/routing/#toc_specifying-a-root-url).
552
+
553
+ @method actions.sessionInvalidationSucceeded
554
+ */
555
+ sessionInvalidationSucceeded: function() {
556
+ window.location.replace(Configuration.applicationRootUrl);
557
+ },
558
+
559
+ /**
560
+ This action is invoked whenever session invalidation fails. This mainly
561
+ serves as an extension point to add custom behavior and does nothing by
562
+ default.
563
+
564
+ @method actions.sessionInvalidationFailed
565
+ @param {any} error The error the promise returned by the authenticator rejects with, see [`Authenticators.Base#invalidate`](#SimpleAuth-Authenticators-Base-invalidate)
566
+ */
567
+ sessionInvalidationFailed: function(error) {
568
+ },
569
+
570
+ /**
571
+ This action is invoked when an authorization error occurs (which is
572
+ the case __when the server responds with HTTP status 401__). It
573
+ invalidates the session and reloads the application (see
574
+ [`ApplicationRouteMixin#sessionInvalidationSucceeded`](#SimpleAuth-ApplicationRouteMixin-sessionInvalidationSucceeded)).
575
+
576
+ @method actions.authorizationFailed
577
+ */
578
+ authorizationFailed: function() {
579
+ if (this.get(Configuration.sessionPropertyName).get('isAuthenticated')) {
580
+ this.get(Configuration.sessionPropertyName).invalidate();
581
+ }
582
+ }
583
+ }
584
+ });
585
+ });
586
+ define("simple-auth/mixins/authenticated-route-mixin",
587
+ ["./../configuration","exports"],
588
+ function(__dependency1__, __exports__) {
589
+ "use strict";
590
+ var Configuration = __dependency1__["default"];
591
+
592
+ /**
593
+ This mixin is for routes that require the session to be authenticated to be
594
+ accessible. Including this mixin in a route automatically adds a hook that
595
+ enforces the session to be authenticated and redirects to the
596
+ [`Configuration.authenticationRoute`](#SimpleAuth-Configuration-authenticationRoute)
597
+ if it is not.
598
+
599
+ ```javascript
600
+ // app/routes/protected.js
601
+ import AuthenticatedRouteMixin from 'simple-auth/mixins/authenticated-route-mixin';
602
+
603
+ export default Ember.Route.extend(AuthenticatedRouteMixin);
604
+ ```
605
+
606
+ `AuthenticatedRouteMixin` performs the redirect in the `beforeModel` method
607
+ so that in all methods executed after that the session is guaranteed to be
608
+ authenticated. __If `beforeModel` is overridden, ensure that the custom
609
+ implementation calls `this._super(transition)`__ so that the session
610
+ enforcement code is actually executed.
611
+
612
+ @class AuthenticatedRouteMixin
613
+ @namespace SimpleAuth
614
+ @module simple-auth/mixins/authenticated-route-mixin
615
+ @extends Ember.Mixin
616
+ @static
617
+ */
618
+ __exports__["default"] = Ember.Mixin.create({
619
+ /**
620
+ This method implements the enforcement of the session being authenticated.
621
+ If the session is not authenticated, the current transition will be aborted
622
+ and a redirect will be triggered to the
623
+ [`Configuration.authenticationRoute`](#SimpleAuth-Configuration-authenticationRoute).
624
+ The method also saves the intercepted transition so that it can be retried
625
+ after the session has been authenticated (see
626
+ [`ApplicationRouteMixin#sessionAuthenticationSucceeded`](#SimpleAuth-ApplicationRouteMixin-sessionAuthenticationSucceeded)).
627
+
628
+ @method beforeModel
629
+ @param {Transition} transition The transition that lead to this route
630
+ */
631
+ beforeModel: function(transition) {
632
+ this._super(transition);
633
+ if (!this.get(Configuration.sessionPropertyName).get('isAuthenticated')) {
634
+ transition.abort();
635
+ this.get(Configuration.sessionPropertyName).set('attemptedTransition', transition);
636
+ transition.send('authenticateSession');
637
+ }
638
+ }
639
+ });
640
+ });
641
+ define("simple-auth/mixins/authentication-controller-mixin",
642
+ ["./../configuration","exports"],
643
+ function(__dependency1__, __exports__) {
644
+ "use strict";
645
+ var Configuration = __dependency1__["default"];
646
+
647
+ /**
648
+ This mixin is for the controller that handles the
649
+ [`Configuration.authenticationRoute`](#SimpleAuth-Configuration-authenticationRoute).
650
+ It provides the `authenticate` action that will authenticate the session with
651
+ the configured authenticator (see
652
+ [`AuthenticationControllerMixin#authenticator`](#SimpleAuth-AuthenticationControllerMixin-authenticator)).
653
+
654
+ @class AuthenticationControllerMixin
655
+ @namespace SimpleAuth
656
+ @module simple-auth/mixins/authentication-controller-mixin
657
+ @extends Ember.Mixin
658
+ */
659
+ __exports__["default"] = Ember.Mixin.create({
660
+ /**
661
+ The authenticator factory to use as it is registered with Ember's
662
+ container, see
663
+ [Ember's API docs](http://emberjs.com/api/classes/Ember.Application.html#method_register).
664
+
665
+ @property authenticator
666
+ @type String
667
+ @default null
668
+ */
669
+ authenticator: null,
670
+
671
+ actions: {
672
+ /**
673
+ This action will authenticate the session with the configured
674
+ authenticator (see
675
+ [`AuthenticationControllerMixin#authenticator`](#SimpleAuth-AuthenticationControllerMixin-authenticator),
676
+ [`Session#authenticate`](#SimpleAuth-Session-authenticate)).
677
+
678
+ @method actions.authenticate
679
+ @param {Object} options Any options the authenticator needs to authenticate the session
680
+ */
681
+ authenticate: function(options) {
682
+ var authenticator = this.get('authenticator');
683
+ Ember.assert('AuthenticationControllerMixin/LoginControllerMixin require the authenticator property to be set on the controller', !Ember.isEmpty(authenticator));
684
+ return this.get(Configuration.sessionPropertyName).authenticate(this.get('authenticator'), options);
685
+ }
686
+ }
687
+ });
688
+ });
689
+ define("simple-auth/mixins/login-controller-mixin",
690
+ ["./../configuration","./authentication-controller-mixin","exports"],
691
+ function(__dependency1__, __dependency2__, __exports__) {
692
+ "use strict";
693
+ var Configuration = __dependency1__["default"];
694
+ var AuthenticationControllerMixin = __dependency2__["default"];
695
+
696
+ /**
697
+ This mixin is for the controller that handles the
698
+ [`Configuration.authenticationRoute`](#SimpleAuth-Configuration-authenticationRoute)
699
+ if the used authentication mechanism works with a login form that asks for
700
+ user credentials. It provides the `authenticate` action that will
701
+ authenticate the session with the configured authenticator when invoked.
702
+ __This is a specialization of
703
+ [`AuthenticationControllerMixin`](#SimpleAuth-AuthenticationControllerMixin).__
704
+
705
+ Accompanying the controller that this mixin is mixed in the application needs
706
+ to have a `login` template with the fields `identification` and `password` as
707
+ well as an actionable button or link that triggers the `authenticate` action,
708
+ e.g.:
709
+
710
+ ```handlebars
711
+ <form {{action 'authenticate' on='submit'}}>
712
+ <label for="identification">Login</label>
713
+ {{input id='identification' placeholder='Enter Login' value=identification}}
714
+ <label for="password">Password</label>
715
+ {{input id='password' placeholder='Enter Password' type='password' value=password}}
716
+ <button type="submit">Login</button>
717
+ </form>
718
+ ```
719
+
720
+ @class LoginControllerMixin
721
+ @namespace SimpleAuth
722
+ @module simple-auth/mixins/login-controller-mixin
723
+ @extends SimpleAuth.AuthenticationControllerMixin
724
+ */
725
+ __exports__["default"] = Ember.Mixin.create(AuthenticationControllerMixin, {
726
+ actions: {
727
+ /**
728
+ This action will authenticate the session with the configured
729
+ authenticator (see
730
+ [AuthenticationControllerMixin#authenticator](#SimpleAuth-Authentication-authenticator))
731
+ if both `identification` and `password` are non-empty. It passes both
732
+ values to the authenticator.
733
+
734
+ __The action also resets the `password` property so sensitive data does
735
+ not stay in memory for longer than necessary.__
736
+
737
+ @method actions.authenticate
738
+ */
739
+ authenticate: function() {
740
+ var data = this.getProperties('identification', 'password');
741
+ this.set('password', null);
742
+ return this._super(data);
743
+ }
744
+ }
745
+ });
746
+ });
747
+ define("simple-auth/session",
748
+ ["exports"],
749
+ function(__exports__) {
750
+ "use strict";
751
+ /**
752
+ __The session provides access to the current authentication state as well as
753
+ any data the authenticator resolved with__ (see
754
+ [`Authenticators.Base#authenticate`](#SimpleAuth-Authenticators-Base-authenticate)).
755
+ It is created when Ember Simple Auth is set up and __injected into all
756
+ controllers and routes so that these parts of the application can always
757
+ access the current authentication state and other data__, depending on the
758
+ authenticator in use and whether the session is actually authenticated (see
759
+ [`Authenticators.Base`](#SimpleAuth-Authenticators-Base)).
760
+
761
+ The session also provides methods to authenticate and to invalidate itself
762
+ (see
763
+ [`Session#authenticate`](#SimpleAuth-Session-authenticate),
764
+ [`Session#invaldiate`](#SimpleAuth-Session-invaldiate)).
765
+ These methods are usually invoked through actions from routes or controllers.
766
+ To authenticate the session manually, simple call the
767
+ [`Session#authenticate`](#SimpleAuth-Session-authenticate)
768
+ method with the authenticator factory to use as well as any options the
769
+ authenticator needs to authenticate the session:
770
+
771
+ ```javascript
772
+ this.get('session').authenticate('authenticator:custom', { some: 'option' }).then(function() {
773
+ // authentication was successful
774
+ }, function() {
775
+ // authentication failed
776
+ });
777
+ ```
778
+
779
+ The session also observes the store and - if it is authenticated - the
780
+ authenticator for changes (see
781
+ [`Authenticators.Base`](#SimpleAuth-Authenticators-Base)
782
+ end [`Stores.Base`](#SimpleAuth-Stores-Base)).
783
+
784
+ @class Session
785
+ @namespace SimpleAuth
786
+ @module simple-auth/session
787
+ @extends Ember.ObjectProxy
788
+ @uses Ember.Evented
789
+ */
790
+ __exports__["default"] = Ember.ObjectProxy.extend(Ember.Evented, {
791
+ /**
792
+ Triggered __whenever the session is successfully authenticated__. When the
793
+ application uses the
794
+ [`ApplicationRouteMixin` mixin](#SimpleAuth-ApplicationRouteMixin),
795
+ [`ApplicationRouteMixin.actions#sessionAuthenticationSucceeded`](#SimpleAuth-ApplicationRouteMixin-sessionAuthenticationSucceeded)
796
+ will be invoked whenever this event is triggered.
797
+
798
+ @event sessionAuthenticationSucceeded
799
+ */
800
+ /**
801
+ Triggered __whenever an attempt to authenticate the session fails__. When
802
+ the application uses the
803
+ [`ApplicationRouteMixin` mixin](#SimpleAuth-ApplicationRouteMixin),
804
+ [`ApplicationRouteMixin.actions#sessionAuthenticationFailed`](#SimpleAuth-ApplicationRouteMixin-sessionAuthenticationFailed)
805
+ will be invoked whenever this event is triggered.
806
+
807
+ @event sessionAuthenticationFailed
808
+ @param {Object} error The error object; this depends on the authenticator in use, see [SimpleAuth.Authenticators.Base#authenticate](#SimpleAuth-Authenticators-Base-authenticate)
809
+ */
810
+ /**
811
+ Triggered __whenever the session is successfully invalidated__. When the
812
+ application uses the
813
+ [`ApplicationRouteMixin` mixin](#SimpleAuth-ApplicationRouteMixin),
814
+ [`ApplicationRouteMixin.actions#sessionInvalidationSucceeded`](#SimpleAuth-ApplicationRouteMixin-sessionInvalidationSucceeded)
815
+ will be invoked whenever this event is triggered.
816
+
817
+ @event sessionInvalidationSucceeded
818
+ */
819
+ /**
820
+ Triggered __whenever an attempt to invalidate the session fails__. When the
821
+ application uses the
822
+ [`ApplicationRouteMixin` mixin](#SimpleAuth-ApplicationRouteMixin),
823
+ [`ApplicationRouteMixin.actions#sessionInvalidationFailed`](#SimpleAuth-ApplicationRouteMixin-sessionInvalidationFailed)
824
+ will be invoked whenever this event is triggered.
825
+
826
+ @event sessionInvalidationFailed
827
+ @param {Object} error The error object; this depends on the authenticator in use, see [SimpleAuth.Authenticators.Base#invalidate](#SimpleAuth-Authenticators-Base-invalidate)
828
+ */
829
+ /**
830
+ Triggered __whenever the server rejects the authorization information
831
+ passed with a request and responds with status 401__. When the application
832
+ uses the
833
+ [`ApplicationRouteMixin` mixin](#SimpleAuth-ApplicationRouteMixin),
834
+ [`ApplicationRouteMixin.actions#authorizationFailed`](#SimpleAuth-ApplicationRouteMixin-authorizationFailed)
835
+ will be invoked whenever this event is triggered.
836
+
837
+ @event authorizationFailed
838
+ */
839
+
840
+ /**
841
+ The authenticator factory to use as it is registered with Ember's
842
+ container, see
843
+ [Ember's API docs](http://emberjs.com/api/classes/Ember.Application.html#method_register).
844
+ This is only set when the session is currently authenticated.
845
+
846
+ @property authenticator
847
+ @type String
848
+ @readOnly
849
+ @default null
850
+ */
851
+ authenticator: null,
852
+ /**
853
+ The store used to persist session properties.
854
+
855
+ @property store
856
+ @type SimpleAuth.Stores.Base
857
+ @readOnly
858
+ @default null
859
+ */
860
+ store: null,
861
+ /**
862
+ The Ember.js container,
863
+
864
+ @property container
865
+ @type Container
866
+ @readOnly
867
+ @default null
868
+ */
869
+ container: null,
870
+ /**
871
+ Returns whether the session is currently authenticated.
872
+
873
+ @property isAuthenticated
874
+ @type Boolean
875
+ @readOnly
876
+ @default false
877
+ */
878
+ isAuthenticated: false,
879
+ /**
880
+ @property attemptedTransition
881
+ @private
882
+ */
883
+ attemptedTransition: null,
884
+ /**
885
+ @property content
886
+ @private
887
+ */
888
+ content: {},
889
+
890
+ /**
891
+ Authenticates the session with an `authenticator` and appropriate
892
+ `options`. __This delegates the actual authentication work to the
893
+ `authenticator`__ and handles the returned promise accordingly (see
894
+ [`Authenticators.Base#authenticate`](#SimpleAuth-Authenticators-Base-authenticate)).
895
+ All data the authenticator resolves with will be saved in the session.
896
+
897
+ __This method returns a promise itself. A resolving promise indicates that
898
+ the session was successfully authenticated__ while a rejecting promise
899
+ indicates that authentication failed and the session remains
900
+ unauthenticated.
901
+
902
+ @method authenticate
903
+ @param {String} authenticator The authenticator factory to use as it is registered with Ember's container, see [Ember's API docs](http://emberjs.com/api/classes/Ember.Application.html#method_register)
904
+ @param {Object} options The options to pass to the authenticator; depending on the type of authenticator these might be a set of credentials, a Facebook OAuth Token, etc.
905
+ @return {Ember.RSVP.Promise} A promise that resolves when the session was authenticated successfully
906
+ */
907
+ authenticate: function(authenticator, options) {
908
+ Ember.assert('Session#authenticate requires the authenticator factory to be specified, was ' + authenticator, !Ember.isEmpty(authenticator));
909
+ var _this = this;
910
+ return new Ember.RSVP.Promise(function(resolve, reject) {
911
+ _this.container.lookup(authenticator).authenticate(options).then(function(content) {
912
+ _this.setup(authenticator, content, true);
913
+ resolve();
914
+ }, function(error) {
915
+ _this.clear();
916
+ _this.trigger('sessionAuthenticationFailed', error);
917
+ reject(error);
918
+ });
919
+ });
920
+ },
921
+
922
+ /**
923
+ Invalidates the session with the authenticator it is currently
924
+ authenticated with (see
925
+ [`Session#authenticator`](#SimpleAuth-Session-authenticator)). __This
926
+ invokes the authenticator's `invalidate` method and handles the returned
927
+ promise accordingly__ (see
928
+ [`Authenticators.Base#invalidate`](#SimpleAuth-Authenticators-Base-invalidate)).
929
+
930
+ __This method returns a promise itself. A resolving promise indicates that
931
+ the session was successfully invalidated__ while a rejecting promise
932
+ indicates that the promise returned by the `authenticator` rejected and
933
+ thus invalidation was cancelled. In that case the session remains
934
+ authenticated. Once the session is successfully invalidated it clears all
935
+ of its data.
936
+
937
+ @method invalidate
938
+ @return {Ember.RSVP.Promise} A promise that resolves when the session was invalidated successfully
939
+ */
940
+ invalidate: function() {
941
+ Ember.assert('Session#invalidate requires the session to be authenticated', this.get('isAuthenticated'));
942
+ var _this = this;
943
+ return new Ember.RSVP.Promise(function(resolve, reject) {
944
+ var authenticator = _this.container.lookup(_this.authenticator);
945
+ authenticator.invalidate(_this.content).then(function() {
946
+ authenticator.off('sessionDataUpdated');
947
+ _this.clear(true);
948
+ resolve();
949
+ }, function(error) {
950
+ _this.trigger('sessionInvalidationFailed', error);
951
+ reject(error);
952
+ });
953
+ });
954
+ },
955
+
956
+ /**
957
+ @method restore
958
+ @private
959
+ */
960
+ restore: function() {
961
+ var _this = this;
962
+ return new Ember.RSVP.Promise(function(resolve, reject) {
963
+ var restoredContent = _this.store.restore();
964
+ var authenticator = restoredContent.authenticator;
965
+ if (!!authenticator) {
966
+ delete restoredContent.authenticator;
967
+ _this.container.lookup(authenticator).restore(restoredContent).then(function(content) {
968
+ _this.setup(authenticator, content);
969
+ resolve();
970
+ }, function() {
971
+ _this.store.clear();
972
+ reject();
973
+ });
974
+ } else {
975
+ _this.store.clear();
976
+ reject();
977
+ }
978
+ });
979
+ },
980
+
981
+ /**
982
+ @method setup
983
+ @private
984
+ */
985
+ setup: function(authenticator, content, trigger) {
986
+ content = Ember.merge(Ember.merge({}, this.content), content);
987
+ trigger = !!trigger && !this.get('isAuthenticated');
988
+ this.beginPropertyChanges();
989
+ this.setProperties({
990
+ isAuthenticated: true,
991
+ authenticator: authenticator,
992
+ content: content
993
+ });
994
+ this.bindToAuthenticatorEvents();
995
+ this.updateStore();
996
+ this.endPropertyChanges();
997
+ if (trigger) {
998
+ this.trigger('sessionAuthenticationSucceeded');
999
+ }
1000
+ },
1001
+
1002
+ /**
1003
+ @method clear
1004
+ @private
1005
+ */
1006
+ clear: function(trigger) {
1007
+ trigger = !!trigger && this.get('isAuthenticated');
1008
+ this.beginPropertyChanges();
1009
+ this.setProperties({
1010
+ isAuthenticated: false,
1011
+ authenticator: null,
1012
+ content: {}
1013
+ });
1014
+ this.store.clear();
1015
+ this.endPropertyChanges();
1016
+ if (trigger) {
1017
+ this.trigger('sessionInvalidationSucceeded');
1018
+ }
1019
+ },
1020
+
1021
+ /**
1022
+ @method setUnknownProperty
1023
+ @private
1024
+ */
1025
+ setUnknownProperty: function(key, value) {
1026
+ var result = this._super(key, value);
1027
+ this.updateStore();
1028
+ return result;
1029
+ },
1030
+
1031
+ /**
1032
+ @method updateStore
1033
+ @private
1034
+ */
1035
+ updateStore: function() {
1036
+ var data = this.content;
1037
+ if (!Ember.isEmpty(this.authenticator)) {
1038
+ data = Ember.merge({ authenticator: this.authenticator }, data);
1039
+ }
1040
+ if (!Ember.isEmpty(data)) {
1041
+ this.store.persist(data);
1042
+ }
1043
+ },
1044
+
1045
+ /**
1046
+ @method bindToAuthenticatorEvents
1047
+ @private
1048
+ */
1049
+ bindToAuthenticatorEvents: function() {
1050
+ var _this = this;
1051
+ var authenticator = this.container.lookup(this.authenticator);
1052
+ authenticator.off('sessionDataUpdated');
1053
+ authenticator.off('sessionDataInvalidated');
1054
+ authenticator.on('sessionDataUpdated', function(content) {
1055
+ _this.setup(_this.authenticator, content);
1056
+ });
1057
+ authenticator.on('sessionDataInvalidated', function(content) {
1058
+ _this.clear(true);
1059
+ });
1060
+ },
1061
+
1062
+ /**
1063
+ @method bindToStoreEvents
1064
+ @private
1065
+ */
1066
+ bindToStoreEvents: function() {
1067
+ var _this = this;
1068
+ this.store.on('sessionDataUpdated', function(content) {
1069
+ var authenticator = content.authenticator;
1070
+ if (!!authenticator) {
1071
+ delete content.authenticator;
1072
+ _this.container.lookup(authenticator).restore(content).then(function(content) {
1073
+ _this.setup(authenticator, content, true);
1074
+ }, function() {
1075
+ _this.clear(true);
1076
+ });
1077
+ } else {
1078
+ _this.clear(true);
1079
+ }
1080
+ });
1081
+ }.observes('store')
1082
+ });
1083
+ });
1084
+ define("simple-auth/setup",
1085
+ ["./configuration","./session","./stores/local-storage","./stores/ephemeral","exports"],
1086
+ function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __exports__) {
1087
+ "use strict";
1088
+ var Configuration = __dependency1__["default"];
1089
+ var Session = __dependency2__["default"];
1090
+ var LocalStorage = __dependency3__["default"];
1091
+ var Ephemeral = __dependency4__["default"];
1092
+
1093
+ function extractLocationOrigin(location) {
1094
+ if (Ember.typeOf(location) === 'string') {
1095
+ var link = document.createElement('a');
1096
+ link.href = location;
1097
+ //IE requires the following line when url is relative.
1098
+ //First assignment of relative url to link.href results in absolute url on link.href but link.hostname and other properties are not set
1099
+ //Second assignment of absolute url to link.href results in link.hostname and other properties being set as expected
1100
+ link.href = link.href;
1101
+ location = link;
1102
+ }
1103
+ var port = location.port;
1104
+ if (Ember.isEmpty(port)) {
1105
+ //need to include the port whether its actually present or not as some versions of IE will always set it
1106
+ port = location.protocol === 'http:' ? '80' : (location.protocol === 'https:' ? '443' : '');
1107
+ }
1108
+ return location.protocol + '//' + location.hostname + (port !== '' ? ':' + port : '');
1109
+ }
1110
+
1111
+ var urlOrigins = {};
1112
+ var crossOriginWhitelist;
1113
+ function shouldAuthorizeRequest(options) {
1114
+ if (options.crossDomain === false) {
1115
+ return true;
1116
+ }
1117
+ var urlOrigin = urlOrigins[options.url] = urlOrigins[options.url] || extractLocationOrigin(options.url);
1118
+ return crossOriginWhitelist.indexOf(urlOrigin) > -1;
1119
+ }
1120
+
1121
+ function registerFactories(container) {
1122
+ container.register('simple-auth-session-store:local-storage', LocalStorage);
1123
+ container.register('simple-auth-session-store:ephemeral', Ephemeral);
1124
+ container.register('simple-auth-session:main', Session);
1125
+ }
1126
+
1127
+ /**
1128
+ @method setup
1129
+ @private
1130
+ **/
1131
+ __exports__["default"] = function(container, application) {
1132
+ Configuration.load(container);
1133
+ application.deferReadiness();
1134
+ registerFactories(container);
1135
+
1136
+ var store = container.lookup(Configuration.store);
1137
+ var session = container.lookup(Configuration.session);
1138
+ session.setProperties({ store: store, container: container });
1139
+ Ember.A(['controller', 'route']).forEach(function(component) {
1140
+ container.injection(component, Configuration.sessionPropertyName, Configuration.session);
1141
+ });
1142
+
1143
+ crossOriginWhitelist = Ember.A(Configuration.crossOriginWhitelist).map(function(origin) {
1144
+ return extractLocationOrigin(origin);
1145
+ });
1146
+
1147
+ if (!Ember.isEmpty(Configuration.authorizer)) {
1148
+ var authorizer = container.lookup(Configuration.authorizer);
1149
+ if (!!authorizer) {
1150
+ authorizer.set('session', session);
1151
+ Ember.$.ajaxPrefilter(function(options, originalOptions, jqXHR) {
1152
+ if (!authorizer.isDestroyed && shouldAuthorizeRequest(options)) {
1153
+ authorizer.authorize(jqXHR, options);
1154
+ }
1155
+ });
1156
+ Ember.$(document).ajaxError(function(event, jqXHR, setting, exception) {
1157
+ if (jqXHR.status === 401) {
1158
+ session.trigger('authorizationFailed');
1159
+ }
1160
+ });
1161
+ }
1162
+ } else {
1163
+ Ember.Logger.debug('No authorizer factory was configured for Ember Simple Auth - specify one if backend requests need to be authorized.');
1164
+ }
1165
+
1166
+ var advanceReadiness = function() {
1167
+ application.advanceReadiness();
1168
+ };
1169
+ session.restore().then(advanceReadiness, advanceReadiness);
1170
+ }
1171
+ });
1172
+ define("simple-auth/stores/base",
1173
+ ["../utils/flat-objects-are-equal","exports"],
1174
+ function(__dependency1__, __exports__) {
1175
+ "use strict";
1176
+ var flatObjectsAreEqual = __dependency1__["default"];
1177
+
1178
+ /**
1179
+ The base for all store types. __This serves as a starting point for
1180
+ implementing custom stores and must not be used directly.__
1181
+
1182
+ Stores are used to persist the session's state so it survives a page reload
1183
+ and is synchronized across multiple tabs or windows of the same application.
1184
+ The store to be used with the application can be configured in the global
1185
+ configuration object:
1186
+
1187
+ ```js
1188
+ window.ENV = window.ENV || {};
1189
+ window.ENV['simple-auth'] = {
1190
+ store: 'simple-auth-session-store:local-storage'
1191
+ }
1192
+ ```
1193
+
1194
+ @class Base
1195
+ @namespace SimpleAuth.Stores
1196
+ @module simple-auth/stores/base
1197
+ @extends Ember.Object
1198
+ @uses Ember.Evented
1199
+ */
1200
+ __exports__["default"] = Ember.Object.extend(Ember.Evented, {
1201
+ /**
1202
+ __Triggered when the data that constitutes the session changes in the
1203
+ store. This usually happens because the session is authenticated or
1204
+ invalidated in another tab or window.__ The session automatically catches
1205
+ that event, passes the updated data to its authenticator's
1206
+ [`Authenticators.Base#restore`](#SimpleAuth-Authenticators-Base-restore)
1207
+ method and handles the result of that invocation accordingly.
1208
+
1209
+ @event sessionDataUpdated
1210
+ @param {Object} data The updated session data
1211
+ */
1212
+
1213
+ /**
1214
+ Persists the `data` in the store. This actually replaces all currently
1215
+ stored data.
1216
+
1217
+ `Stores.Base`'s implementation does nothing.
1218
+
1219
+ @method persist
1220
+ @param {Object} data The data to persist
1221
+ */
1222
+ persist: function(data) {
1223
+ },
1224
+
1225
+ /**
1226
+ Restores all data currently saved in the store as a plain object.
1227
+
1228
+ `Stores.Base`'s implementation always returns an empty plain Object.
1229
+
1230
+ @method restore
1231
+ @return {Object} The data currently persisted in the store.
1232
+ */
1233
+ restore: function() {
1234
+ return {};
1235
+ },
1236
+
1237
+ /**
1238
+ Clears the store.
1239
+
1240
+ `Stores.Base`'s implementation does nothing.
1241
+
1242
+ @method clear
1243
+ */
1244
+ clear: function() {
1245
+ }
1246
+ });
1247
+ });
1248
+ define("simple-auth/stores/ephemeral",
1249
+ ["./base","exports"],
1250
+ function(__dependency1__, __exports__) {
1251
+ "use strict";
1252
+ var Base = __dependency1__["default"];
1253
+
1254
+ /**
1255
+ Store that saves its data in memory and thus __is not actually persistent__.
1256
+ It does also not synchronize the session's state across multiple tabs or
1257
+ windows as those cannot share memory.
1258
+
1259
+ __This store is mainly useful for testing.__
1260
+
1261
+ _The factory for this store is registered as
1262
+ `'simple-auth-session-store:ephemeral'` in Ember's container._
1263
+
1264
+ @class Ephemeral
1265
+ @namespace SimpleAuth.Stores
1266
+ @module simple-auth/stores/ephemeral
1267
+ @extends Stores.Base
1268
+ */
1269
+ __exports__["default"] = Base.extend({
1270
+ /**
1271
+ @method init
1272
+ @private
1273
+ */
1274
+ init: function() {
1275
+ this.clear();
1276
+ },
1277
+
1278
+ /**
1279
+ Persists the `data`.
1280
+
1281
+ @method persist
1282
+ @param {Object} data The data to persist
1283
+ */
1284
+ persist: function(data) {
1285
+ this._data = JSON.stringify(data || {});
1286
+ },
1287
+
1288
+ /**
1289
+ Restores all data currently saved as a plain object.
1290
+
1291
+ @method restore
1292
+ @return {Object} All data currently persisted
1293
+ */
1294
+ restore: function() {
1295
+ return JSON.parse(this._data) || {};
1296
+ },
1297
+
1298
+ /**
1299
+ Clears the store.
1300
+
1301
+ @method clear
1302
+ */
1303
+ clear: function() {
1304
+ delete this._data;
1305
+ this._data = '{}';
1306
+ }
1307
+ });
1308
+ });
1309
+ define("simple-auth/stores/local-storage",
1310
+ ["./base","../utils/flat-objects-are-equal","exports"],
1311
+ function(__dependency1__, __dependency2__, __exports__) {
1312
+ "use strict";
1313
+ var Base = __dependency1__["default"];
1314
+ var flatObjectsAreEqual = __dependency2__["default"];
1315
+
1316
+ /**
1317
+ Store that saves its data in the browser's `localStorage`.
1318
+
1319
+ _The factory for this store is registered as
1320
+ `'simple-auth-session-store:local-storage'` in Ember's container._
1321
+
1322
+ __`Stores.LocalStorage` is Ember Simple Auth's default store.__
1323
+
1324
+ @class LocalStorage
1325
+ @namespace SimpleAuth.Stores
1326
+ @module simple-auth/stores/local-storage
1327
+ @extends Stores.Base
1328
+ */
1329
+ __exports__["default"] = Base.extend({
1330
+ /**
1331
+ The key the store stores the data in.
1332
+
1333
+ @property key
1334
+ @type String
1335
+ @default 'ember_simple_auth:session'
1336
+ */
1337
+ key: 'ember_simple_auth:session',
1338
+
1339
+ /**
1340
+ @method init
1341
+ @private
1342
+ */
1343
+ init: function() {
1344
+ this.bindToStorageEvents();
1345
+ },
1346
+
1347
+ /**
1348
+ Persists the `data` in the `localStorage`.
1349
+
1350
+ @method persist
1351
+ @param {Object} data The data to persist
1352
+ */
1353
+ persist: function(data) {
1354
+ data = JSON.stringify(data || {});
1355
+ localStorage.setItem(this.key, data);
1356
+ this._lastData = this.restore();
1357
+ },
1358
+
1359
+ /**
1360
+ Restores all data currently saved in the `localStorage` identified by the
1361
+ `keyPrefix` as one plain object.
1362
+
1363
+ @method restore
1364
+ @return {Object} All data currently persisted in the `localStorage`
1365
+ */
1366
+ restore: function() {
1367
+ var data = localStorage.getItem(this.key);
1368
+ return JSON.parse(data) || {};
1369
+ },
1370
+
1371
+ /**
1372
+ Clears the store by deleting all `localStorage` keys prefixed with the
1373
+ `keyPrefix`.
1374
+
1375
+ @method clear
1376
+ */
1377
+ clear: function() {
1378
+ localStorage.removeItem(this.key);
1379
+ this._lastData = null;
1380
+ },
1381
+
1382
+ /**
1383
+ @method bindToStorageEvents
1384
+ @private
1385
+ */
1386
+ bindToStorageEvents: function() {
1387
+ var _this = this;
1388
+ Ember.$(window).bind('storage', function(e) {
1389
+ var data = _this.restore();
1390
+ if (!flatObjectsAreEqual(data, _this._lastData)) {
1391
+ _this._lastData = data;
1392
+ _this.trigger('sessionDataUpdated', data);
1393
+ }
1394
+ });
1395
+ }
1396
+ });
1397
+ });
1398
+ define("simple-auth/utils/flat-objects-are-equal",
1399
+ ["exports"],
1400
+ function(__exports__) {
1401
+ "use strict";
1402
+ /**
1403
+ @method flatObjectsAreEqual
1404
+ @private
1405
+ */
1406
+ __exports__["default"] = function(a, b) {
1407
+ function sortObject(object) {
1408
+ var array = [];
1409
+ for (var property in object) {
1410
+ array.push([property, object[property]]);
1411
+ }
1412
+ return array.sort(function(a, b) {
1413
+ if (a[0] < b[0]) {
1414
+ return -1;
1415
+ } else if (a[0] > b[0]) {
1416
+ return 1;
1417
+ } else {
1418
+ return 0;
1419
+ }
1420
+ });
1421
+ }
1422
+ return JSON.stringify(sortObject(a)) === JSON.stringify(sortObject(b));
1423
+ }
1424
+ });
1425
+ define("simple-auth/utils/get-global-config",
1426
+ ["exports"],
1427
+ function(__exports__) {
1428
+ "use strict";
1429
+ var global = (typeof window !== 'undefined') ? window : {};
1430
+
1431
+ __exports__["default"] = function(scope) {
1432
+ return(global.ENV || {})[scope] || {};
1433
+ }
1434
+ });
1435
+ define("simple-auth/utils/is-secure-url",
1436
+ ["exports"],
1437
+ function(__exports__) {
1438
+ "use strict";
1439
+ /**
1440
+ @method isSecureUrl
1441
+ @private
1442
+ */
1443
+ __exports__["default"] = function(url) {
1444
+ var link = document.createElement('a');
1445
+ link.href = url;
1446
+ link.href = link.href;
1447
+ return link.protocol == 'https:';
1448
+ }
1449
+ });
1450
+ })((typeof global !== 'undefined') ? global : window);