From a8d17843e0cdd09e3094b43d194b7a303e0d0076 Mon Sep 17 00:00:00 2001 From: cundamic Date: Tue, 7 Apr 2015 00:19:40 +0200 Subject: [PATCH 1/7] Update sk.coffee translation: teachers --- app/locale/sk.coffee | 74 ++++++++++++++++++++++---------------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/app/locale/sk.coffee b/app/locale/sk.coffee index 66e993114..a2dfae9ee 100644 --- a/app/locale/sk.coffee +++ b/app/locale/sk.coffee @@ -64,7 +64,7 @@ module.exports = nativeDescription: "slovenčina", englishDescription: "Slovak", achievements: "Úspechy" # Tooltip on achievement list button from /play account: "Účet" # Tooltip on account button from /play settings: "Nastavenia" # Tooltip on settings button from /play -# poll: "Poll" # Tooltip on poll button from /play + poll: "Anketa" # Tooltip on poll button from /play next: "Ďalší" # Go from choose hero to choose inventory before playing a level change_hero: "Zmeniť hrdinu" # Go back from choose inventory to choose hero choose_inventory: "Vyzbrojiť sa s predmetmi" @@ -254,7 +254,7 @@ module.exports = nativeDescription: "slovenčina", englishDescription: "Slovak", victory_sign_up: "Přihlásit se pre uloženie progresu" victory_sign_up_poke: "Chceš uložiť svoj kód? Vytvorte si účet zdarma!" victory_rate_the_level: "Ohodnoťte túto úroveň: " # Only in old-style levels. - victory_return_to_ladder: "Vrátiť sa na Rebríčky" + victory_return_to_ladder: "Rebríčky" victory_play_continue: "Pokračovať" victory_saving_progress: "Stav ukladania" victory_go_home: "Návrat Domov" # Only in old-style levels. @@ -334,7 +334,7 @@ module.exports = nativeDescription: "slovenčina", englishDescription: "Slovak", tip_javascript_java: "Porovnávať Javu a JavaScript je ako porovnávať auto a lietajúci koberec. - Chris Heilmann" tip_move_forward: "Ak nevieš lietať, bež, ak nemôžeš bežať, kráčaj, ak nemôžeš kráčať, choď po štyroch, ale nech už robíš čokoľvek, musíš sa hýbať vpred - Martin Luther King Jr." tip_google: "Máš problém, ktorý nevieš vyriešiť ? Vygoogluj si ho !" - tip_adding_evil: "pridanie špitky zla." + tip_adding_evil: "Pridanie špitky zla." tip_hate_computers: "Ľudia, ktorí si myslia, že nenávidia počítače, v skutočnosti nenávidia mizerných programátorov. - Larry Niven" tip_open_source_contribute: "Aj ty môžeš zlepšiť CodeCombat !" tip_recurse: "Iterácia je ľudská, rekurzia božská.. - L. Peter Deutsch" @@ -484,10 +484,10 @@ module.exports = nativeDescription: "slovenčina", englishDescription: "Slovak", backstab: "Pichnutie do chrbta" # As in "this dagger does this much backstab damage" skills: "Schopnosti" attack_1: "Upravuje na" - attack_2: "hodnotu udávanej" - attack_3: "újmy zbraňou." + attack_2: "hodnotu udávanej újmy zbraňou pre typ" + attack_3: "." health_1: "Upravuje hodnotu zdravia na" - health_2: "hodnoty zaručenej" + health_2: "hodnoty zaručenej pre typ" health_3: "brnením." speed_1: "Pohybuje sa rýchlosťou" speed_2: "metrov za sekundu." @@ -575,40 +575,40 @@ module.exports = nativeDescription: "slovenčina", englishDescription: "Slovak", # retrostyle_title: "Illustration" # retrostyle_blurb: "RetroStyle Games" -# teachers: -# title: "CodeCombat: Info for Teachers" -# intro_1: "CodeCombat is an online game that teaches programming. Students write code in real programming languages." -# intro_2: "No experience required!" -# free_title: "How much does it cost?" + teachers: + title: "CodeCombat: Informácie pre učiteľov" + intro_1: "CodeCombat je online hra, ktorá učí programovať. Študenti píšu kód v skutočných programovacích jazykoch." + intro_2: "Nie sú nutné žiadne predchádzajúce skúsenosti !" + free_title: "Koľko to stojí ?" # cost_china: "CodeCombat in China is free for the first five levels, after which it costs $9.99 per month for access to our other 120+ levels on our exclusive China servers." -# free_1: "CodeCombat Basic is FREE! There are 70+ free levels which cover every concept." -# free_2: "A monthly subscription provides access to video tutorials and extra practice levels." -# teacher_subs_title: "Teachers get free subscriptions!" -# teacher_subs_1: "Please contact" -# teacher_subs_2: "to set up a free monthly subscription." -# sub_includes_title: "What is included in the subscription?" -# sub_includes_1: "In additional to the 70+ basic levels, students with a monthly subscription get access to these additional features:" -# sub_includes_2: "40+ practice levels" -# sub_includes_3: "Video tutorials" -# sub_includes_4: "Premium email support" -# sub_includes_5: "7 new heroes with unique skills to master" -# sub_includes_6: "3500 bonus gems every month" -# who_for_title: "Who is CodeCombat for?" -# who_for_1: "We recommend CodeCombat for students aged 9 and up. No prior programming experience is needed." -# who_for_2: "We've designed CodeCombat to appeal to both boys and girls." -# material_title: "How much material is there?" + free_1: "CodeCombat Basic is ZDARMA ! K dispozícii je 70+ úrovní pokrývajúcich každý koncept." + free_2: "Mesačné predplatné poskytuje prístup k videonávodom a k úrovniam na precvičenie navyše." + teacher_subs_title: "Pre učiteľov je predplatné zdarma !" + teacher_subs_1: "Napíšte na" + teacher_subs_2: "pre zriadenie mesačného predplatného zdarma." + sub_includes_title: "Čo zahrnuje predplatné ?" + sub_includes_1: "Študenti s mesačným predplatným získajú ku 70+ základným úrovniam aj :" + sub_includes_2: "40+ tréningových úrovní" + sub_includes_3: "Video návody" + sub_includes_4: "Prémiovú emailovú podporu" + sub_includes_5: "7 nových hrdinov s jedinečnými schopnosťami" + sub_includes_6: "3500 bonusových diamantov každý mesiac" + who_for_title: "Pre koho je určený CodeComabt ?" + who_for_1: "CodeCombat odporúčame pre žiakov od 9 rokov. Nie sú nutné žiadne predchádzajúce skúsenosti s programovaním." + who_for_2: "CodeCombat sme navrhli tak, aby oslovil chlapcov aj dievčatá." + material_title: "Aký je objem učebnej látky ?" # material_china: "Approximately 22 hours of gameplay spread over 120+ subscriber-only levels so far, with 5 new levels every week." -# material_1: "Approximately 8 hours of free content and an additional 14 hours of subscriber content, with 5 new levels every week." -# concepts_title: "What concepts are covered?" -# how_much_title: "How much does a monthly subscription cost?" -# how_much_1: "A" -# how_much_2: "monthly subscription" -# how_much_3: "costs $9.99, and can be cancelled anytime." -# how_much_4: "Additionally, we provide discounts for larger groups:" + material_1: "Asi 8 hodín bezplatného obsahu a ďalších 14 hodín pre predplatiteľov. 5 nových úrovní každý týždeň." + concepts_title: "Aké pojmy sú pokryté ?" + how_much_title: "Koľko stojí mesačné predplatné ?" + how_much_1: "" + how_much_2: "Mesačné predplatné" + how_much_3: ", ktoré môže byť kedykoľvek zrušené, stojí 9.99$." + how_much_4: "Zľavy pre väčšie skupiny:" # group_discounts_1: "We also offer group discounts for bulk subscriptions." -# sys_requirements_title: "System Requirements" -# sys_requirements_1: "A modern web browser. Newer versions of Chrome, Firefox, or Safari. Internet Explorer 9 or later." -# sys_requirements_2: "CodeCombat is not supported on iPad yet." + sys_requirements_title: "Systémové požiadavky" + sys_requirements_1: "Moderný webový prehliadač. Nové verzie prehliadačov Chrome, Firefox alebo Safari. Internet Explorer 9 alebo novší." + sys_requirements_2: "CodeCombat nie je zatiaľ podprovaný pre iPad." versions: save_version_title: "Ulož novú verziu" From 3d7f73a773fcead519f7166376042747773957d5 Mon Sep 17 00:00:00 2001 From: cundamic Date: Tue, 7 Apr 2015 14:48:32 +0200 Subject: [PATCH 2/7] Update sk.coffee translation: about --- app/locale/sk.coffee | 52 ++++++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/app/locale/sk.coffee b/app/locale/sk.coffee index 66e993114..2499d40d8 100644 --- a/app/locale/sk.coffee +++ b/app/locale/sk.coffee @@ -542,32 +542,32 @@ module.exports = nativeDescription: "slovenčina", englishDescription: "Slovak", editor_config_behaviors_label: "Chytré správanie" editor_config_behaviors_description: "Automaticky doplňuje hranaté a oblé zátvorky a úvodzovky." -# about: -# why_codecombat: "Why CodeCombat?" -# why_paragraph_1: "If you want to learn to program, you don't need lessons. You need to write a lot of code and have a great time doing it." -# why_paragraph_2_prefix: "That's what programming is about. It's gotta be fun. Not fun like" -# why_paragraph_2_italic: "yay a badge" -# why_paragraph_2_center: "but fun like" -# why_paragraph_2_italic_caps: "NO MOM I HAVE TO FINISH THE LEVEL!" -# why_paragraph_2_suffix: "That's why CodeCombat is a multiplayer game, not a gamified lesson course. We won't stop until you can't stop--but this time, that's a good thing." -# why_paragraph_3: "If you're going to get addicted to some game, get addicted to this one and become one of the wizards of the tech age." -# press_title: "Bloggers/Press" -# press_paragraph_1_prefix: "Want to write about us? Feel free to download and use all of the resources included in our" -# press_paragraph_1_link: "press packet" -# press_paragraph_1_suffix: ". All logos and images may be used without contacting us directly." -# team: "Team" -# george_title: "Cofounder" -# george_blurb: "Businesser" -# scott_title: "Cofounder" -# scott_blurb: "Reasonable One" -# nick_title: "Cofounder" -# nick_blurb: "Motivation Guru" -# michael_title: "Programmer" -# michael_blurb: "Sys Admin" -# matt_title: "Programmer" -# matt_blurb: "Bicyclist" -# cat_title: "Chief Artisan" -# cat_blurb: "Airbender" + about: + why_codecombat: "Prečo CodeCombat?" + why_paragraph_1: "Ak sa chceš naučiť programovať, nepotrebuješ lekcie. To, čo potrebuješ je možnosť písať veľa kódu a baviť sa pri tom." + why_paragraph_2_prefix: "O tom je programovanie. Nemá to byť zábava typu" + why_paragraph_2_italic: "jéj, mám ďalší odznak" + why_paragraph_2_center: ",ale nadšenie ako" + why_paragraph_2_italic_caps: "HNEĎ MAMI, LEN DOKONČÍM TÚTO ÚROVEŇ !" + why_paragraph_2_suffix: "CodeCombat je skutočná hra pre viacej hráčov, od ktorej sa dá ťažko odtrhnúť." + why_paragraph_3: "Ak už sa máš byť závislý na nejakej hre, tak nech je to táto, pri ktorej sa staneš čarodejníkom technického veku." + press_title: "Blogeri/Tlač" + press_paragraph_1_prefix: "Chceš o nás písať ? Môžeš si stiahnúť a použiť všetky zdroje zahrnuté v našom" + press_paragraph_1_link: "tlačovom balíčku" + press_paragraph_1_suffix: ". Všetky logá a obrázky môžeš použiť bez toho, aby si nás priamo kontaktoval." + team: "Tím" + george_title: "Spoluzakladateľ" + george_blurb: "Podnikateľ" + scott_title: "Spoluzakladateľ" + scott_blurb: "Ten rozumný" + nick_title: "Spoluzakladateľ" + nick_blurb: "Motivačný Guru" + michael_title: "Programátor" + michael_blurb: "Systémový administrátor" + matt_title: "Programátor" + matt_blurb: "Bicyklista" + cat_title: "Najvyššia remeselníčka" + cat_blurb: "Ohýbačka vzduchu" # josh_title: "Game Designer" # josh_blurb: "Floor Is Lava" # jose_title: "Music" From 1fe85e8a5cffc9ca3126fe9ac6ec9f5fb6b0ee1c Mon Sep 17 00:00:00 2001 From: cundamic Date: Tue, 7 Apr 2015 16:19:03 +0200 Subject: [PATCH 3/7] Update sk.coffee translation: ladder --- app/locale/sk.coffee | 84 ++++++++++++++++++++++---------------------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/app/locale/sk.coffee b/app/locale/sk.coffee index 66e993114..2e63d4142 100644 --- a/app/locale/sk.coffee +++ b/app/locale/sk.coffee @@ -896,48 +896,48 @@ module.exports = nativeDescription: "slovenčina", englishDescription: "Slovak", # translating_diplomats: "Our Translating Diplomats:" # helpful_ambassadors: "Our Helpful Ambassadors:" -# ladder: -# please_login: "Please log in first before playing a ladder game." -# my_matches: "My Matches" -# simulate: "Simulate" -# simulation_explanation: "By simulating games you can get your game ranked faster!" -# simulate_games: "Simulate Games!" -# simulate_all: "RESET AND SIMULATE GAMES" -# games_simulated_by: "Games simulated by you:" -# games_simulated_for: "Games simulated for you:" -# games_simulated: "Games simulated" -# games_played: "Games played" -# ratio: "Ratio" -# leaderboard: "Leaderboard" -# battle_as: "Battle as " -# summary_your: "Your " -# summary_matches: "Matches - " -# summary_wins: " Wins, " -# summary_losses: " Losses" -# rank_no_code: "No New Code to Rank" -# rank_my_game: "Rank My Game!" -# rank_submitting: "Submitting..." -# rank_submitted: "Submitted for Ranking" -# rank_failed: "Failed to Rank" -# rank_being_ranked: "Game Being Ranked" -# rank_last_submitted: "submitted " -# help_simulate: "Help simulate games?" -# code_being_simulated: "Your new code is being simulated by other players for ranking. This will refresh as new matches come in." -# no_ranked_matches_pre: "No ranked matches for the " -# no_ranked_matches_post: " team! Play against some competitors and then come back here to get your game ranked." -# choose_opponent: "Choose an Opponent" -# select_your_language: "Select your language!" -# tutorial_play: "Play Tutorial" -# tutorial_recommended: "Recommended if you've never played before" -# tutorial_skip: "Skip Tutorial" -# tutorial_not_sure: "Not sure what's going on?" -# tutorial_play_first: "Play the Tutorial first." -# simple_ai: "Simple AI" -# warmup: "Warmup" -# friends_playing: "Friends Playing" -# log_in_for_friends: "Log in to play with your friends!" -# social_connect_blurb: "Connect and play against your friends!" -# invite_friends_to_battle: "Invite your friends to join you in battle!" + ladder: + please_login: "Pred hraním rebríčkovej hry sa musíš najskôr prihlásiť." + my_matches: "Moje súboje" + simulate: "Simuluj" + simulation_explanation: "Simulovaním sa dostane hra rýchlejšie do rebríčka !!" + simulate_games: "Simuluj hry !" + simulate_all: "RESETUJ A SIMULUJ HRY" + games_simulated_by: "Tebou simulované hry:" + games_simulated_for: "Pre teba simulvané hry:" + games_simulated: "Simulované hry" + games_played: "Odohrané hry" + ratio: "Pomer" + leaderboard: "Rebríček" + battle_as: "Hraj ako " + summary_your: "Tvoje " + summary_matches: "Súboje - počet výhier " + summary_wins: ", počet prehier " + summary_losses: " " + rank_no_code: "Žiadny nový kód na ocenenie" + rank_my_game: "Oceň moju hru !" + rank_submitting: "Odosielam..." + rank_submitted: "Odoslané na ocenenie" + rank_failed: "Chyba pri oceňovaní" + rank_being_ranked: "Hra je oceňovaná" + rank_last_submitted: "odoslané " + help_simulate: "Pomôžeš so simuláciou hier ?" + code_being_simulated: "Tvoj nový kód je simulovaný iným hráčom. Rebríček sa obnoví po nových súbojoch." + no_ranked_matches_pre: "Žiadne ocenené súboje pre " + no_ranked_matches_post: " tím ! Hraj proti súperom a potom sa sem vráť a uvidíš ocenenie svojej hry." + choose_opponent: "Vyber si súpera" + select_your_language: "Vyber si jazyk !" + tutorial_play: "Hraj tutoriál" + tutorial_recommended: "Odporúčané, pokiaľ si ešte nikdy nehral" + tutorial_skip: "Preskoč tutoriál" + tutorial_not_sure: "Nie si si istý, čo sa deje ?" + tutorial_play_first: "Hraj najskôr tutoriál." + simple_ai: "Jednoduchá umelá inteligencia" + warmup: "Na rozohratie" + friends_playing: "Hra proti priateľom" + log_in_for_friends: "Prihlás sa a hraj s priateľmi !" + social_connect_blurb: "Pripoj sa a hraj proti svojím priateľom !" + invite_friends_to_battle: "Pozvi priateľov a bojuj s nimi !" # fight: "Fight!" # watch_victory: "Watch your victory" # defeat_the: "Defeat the" From c1ec1611adbd251156b2e6e6cc3ed8c9ba200182 Mon Sep 17 00:00:00 2001 From: Nick Winter Date: Tue, 7 Apr 2015 08:55:33 -0700 Subject: [PATCH 4/7] Fixed style reversion for page loading bar showing over code area. --- app/views/play/level/tome/SpellListTabEntryView.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/play/level/tome/SpellListTabEntryView.coffee b/app/views/play/level/tome/SpellListTabEntryView.coffee index 3a2b9945e..65113cd1e 100644 --- a/app/views/play/level/tome/SpellListTabEntryView.coffee +++ b/app/views/play/level/tome/SpellListTabEntryView.coffee @@ -154,7 +154,7 @@ module.exports = class SpellListTabEntryView extends SpellListEntryView break $codearea = $('#code-area') $codearea.on transitionListener, => - $codearea.css 'z-index', 1 unless $('html').hasClass 'fullscreen-editor' + $codearea.css 'z-index', 2 unless $('html').hasClass 'fullscreen-editor' destroy: -> From 8673cca96c9d35cffaacbdbb46f9590e23a13817 Mon Sep 17 00:00:00 2001 From: Nick Winter Date: Tue, 7 Apr 2015 09:05:13 -0700 Subject: [PATCH 5/7] Added Viking Helmet reward icon and removed Master Sword reward icon. Not showing Apocalypse particles after you have beaten it. Fixed #2580. --- app/templates/play/campaign-view.jade | 4 ++-- app/views/play/CampaignView.coffee | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/templates/play/campaign-view.jade b/app/templates/play/campaign-view.jade index 813e622d5..62625832c 100644 --- a/app/templates/play/campaign-view.jade +++ b/app/templates/play/campaign-view.jade @@ -15,8 +15,8 @@ if campaign if level.unlocksHero && (!level.purchasedHero || editorMode) img.hero-portrait(src="/file/db/thang.type/#{level.unlocksHero}/portrait.png") a(href=level.type == 'hero' ? '#' : level.disabled ? "/play" : "/play/#{level.levelPath || 'level'}/#{level.slug}", disabled=level.disabled, data-level-slug=level.slug, data-level-path=level.levelPath || 'level', data-level-name=level.name) - if level.slug == 'apocalypse' - img.star(src="/file/db/thang.type/54ea89112b7506e891ca717d/portrait.png") + if level.slug == 'lost-viking' + img.star(src="/file/db/thang.type/5441c3144e9aeb727cc97111/portrait.png") else if level.requiresSubscription img.star(src="/images/pages/play/star.png") if levelStatusMap[level.slug] === 'complete' diff --git a/app/views/play/CampaignView.coffee b/app/views/play/CampaignView.coffee index c62c93d44..3fb8e9e86 100644 --- a/app/views/play/CampaignView.coffee +++ b/app/views/play/CampaignView.coffee @@ -334,7 +334,7 @@ module.exports = class CampaignView extends RootView @particleMan ?= new ParticleMan() @particleMan.removeEmitters() @particleMan.attach @$el.find('.map') - for level in @campaign.renderedLevels ? {} when level.hidden or level.slug is 'apocalypse' + for level in @campaign.renderedLevels ? {} when level.hidden or (level.slug is 'apocalypse' and @levelStatusMap[level.slug] isnt 'complete') particleKey = ['level', @terrain] particleKey.push level.type if level.type and level.type isnt 'hero' particleKey.push 'premium' if level.requiresSubscription From 7f41ad6c52e8e0e048826d808266f5ccd89095ee Mon Sep 17 00:00:00 2001 From: Nick Winter Date: Tue, 7 Apr 2015 09:25:42 -0700 Subject: [PATCH 6/7] Added OSTraining and Breakout Mentors resources. --- app/templates/play/menu/guide-view.jade | 8 ++++++++ server/routes/mail.coffee | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app/templates/play/menu/guide-view.jade b/app/templates/play/menu/guide-view.jade index 4a90e6a6b..1ff5cf8d0 100644 --- a/app/templates/play/menu/guide-view.jade +++ b/app/templates/play/menu/guide-view.jade @@ -14,6 +14,14 @@ if docs.length === 1 hr h3 Want more programming lessons? ul + li + strong + a(class="resource-link", data-resource="breakout-mentors", href='http://breakoutmentors.com/?referral=codecombat') Breakout Mentors + | : Personalized code mentoring for kids from Stanford and UC Berkeley mentors, online or in person. + li + strong + a(class="resource-link", data-resource="ostraining", href='https://www.ostraining.com/codecombat/') OSTraining + | : Watch over 2600 videos on how to make great websites with Wordpress, Drupal, Joomla, and more. li strong a(class="resource-link", data-resource="one-month", href='http://mbsy.co/bVRtZ') One Month diff --git a/server/routes/mail.coffee b/server/routes/mail.coffee index 2f698cdc4..af4008698 100644 --- a/server/routes/mail.coffee +++ b/server/routes/mail.coffee @@ -727,8 +727,9 @@ sendNextStepsEmail = (user, now, daysAgo) -> 'maker-square': isAdult and isFast 'the-firehose-project': isAdult and isFast #'mv-code-club': isKid # TODO: geodetect, get landing page URL + 'breakout-mentors': isKid nAdditionalOffers = Math.max 0, 4 - _.filter(offers).length - possibleAdditionalOffers = ['code-school', 'one-month', 'learnable', 'pluralsight'] + possibleAdditionalOffers = ['ostraining', 'code-school', 'one-month', 'learnable', 'pluralsight'] for offer in _.sample possibleAdditionalOffers, nAdditionalOffers offers[offer] = true if user.isPremium() From 970dedbea5921e33b0769dc05077a23e90c1e1c1 Mon Sep 17 00:00:00 2001 From: Matt Lott Date: Tue, 7 Apr 2015 10:03:44 -0700 Subject: [PATCH 7/7] Update Stripe checkout.js --- vendor/scripts/checkout.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vendor/scripts/checkout.js b/vendor/scripts/checkout.js index 5d8551546..bcb1b6572 100644 --- a/vendor/scripts/checkout.js +++ b/vendor/scripts/checkout.js @@ -1,3 +1,3 @@ -if(typeof JSON!=="object"){JSON={}}(function(){"use strict";function f(n){return n<10?"0"+n:n}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()}}var cx,escapable,gap,indent,meta,rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==="string"?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+string+'"'}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==="object"&&typeof value.toJSON==="function"){value=value.toJSON(key)}if(typeof rep==="function"){value=rep.call(holder,key,value)}switch(typeof value){case"string":return quote(value);case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null"}gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==="[object Array]"){length=value.length;for(i=0;ij;i=f<=j?++_i:--_i){if(this[i]===obj){return i}}return-1}}}).call(this);StripeCheckout.require.define({"lib/helpers":function(exports,require,module){(function(){var delurkWinPhone,helpers,uaVersionFn;uaVersionFn=function(re){return function(){var uaMatch;uaMatch=helpers.userAgent.match(re);return uaMatch&&parseInt(uaMatch[1])}};delurkWinPhone=function(fn){return function(){return fn()&&!helpers.isWindowsPhone()}};helpers={userAgent:window.navigator.userAgent,escape:function(value){return value&&(""+value).replace(/&/g,"&").replace(//g,">").replace(/\"/g,""")},trim:function(value){return value.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},sanitizeURL:function(value){var SCHEME_WHITELIST,allowed,scheme,_i,_len;if(!value){return}value=helpers.trim(value);SCHEME_WHITELIST=["data:","http:","https:"];allowed=false;for(_i=0,_len=SCHEME_WHITELIST.length;_i<_len;_i++){scheme=SCHEME_WHITELIST[_i];if(value.indexOf(scheme)===0){allowed=true;break}}if(!allowed){return null}return encodeURI(value)},iOSVersion:uaVersionFn(/(?:iPhone OS |iPad; CPU OS )(\d+)_\d+/),iOSMinorVersion:uaVersionFn(/(?:iPhone OS |iPad; CPU OS )\d+_(\d+)/),iOSBuildVersion:uaVersionFn(/(?:iPhone OS |iPad; CPU OS )\d+_\d+_(\d+)/),androidWebkitVersion:uaVersionFn(/Mozilla\/5\.0.*Android.*AppleWebKit\/([\d]+)/),androidVersion:uaVersionFn(/Android (\d+)\.\d+/),firefoxVersion:uaVersionFn(/Firefox\/(\d+)\.\d+/),chromeVersion:uaVersionFn(/Chrome\/(\d+)\.\d+/),safariVersion:uaVersionFn(/Version\/(\d+)\.\d+ Safari/),iOSChromeVersion:uaVersionFn(/CriOS\/(\d+)\.\d+/),iOSNativeVersion:uaVersionFn(/Stripe\/(\d+)\.\d+/),ieVersion:uaVersionFn(/(?:MSIE |Trident\/.*rv:)(\d{1,2})\./),isiOSChrome:function(){return/CriOS/.test(helpers.userAgent)},isiOSWebView:function(){return/(iPhone|iPod|iPad).*AppleWebKit((?!.*Safari)|(.*\([^)]*like[^)]*Safari[^)]*\)))/i.test(helpers.userAgent)},isiOS:delurkWinPhone(function(){return/(iPhone|iPad|iPod)/i.test(helpers.userAgent)}),isiOSNative:function(){return this.isiOS()&&this.iOSNativeVersion()>=3},isiPad:function(){return/(iPad)/i.test(helpers.userAgent)},isMac:delurkWinPhone(function(){return/mac/i.test(helpers.userAgent)}),isWindowsPhone:function(){return/(Windows\sPhone|IEMobile)/i.test(helpers.userAgent)},isWindowsOS:function(){return/(Windows NT \d\.\d)/i.test(helpers.userAgent)},isIE:function(){return/(MSIE ([0-9]{1,}[\.0-9]{0,})|Trident\/)/i.test(helpers.userAgent)},isChrome:function(){return"chrome"in window},isSafari:delurkWinPhone(function(){var userAgent;userAgent=helpers.userAgent;return/Safari/i.test(userAgent)&&!/Chrome/i.test(userAgent)}),isFirefox:delurkWinPhone(function(){return helpers.firefoxVersion()!=null}),isAndroidBrowser:function(){var version;version=helpers.androidWebkitVersion();return version&&version<537},isAndroidChrome:function(){var version;version=helpers.androidWebkitVersion();return version&&version>=537},isAndroidDevice:delurkWinPhone(function(){return/Android/.test(helpers.userAgent)}),isAndroidWebView:function(){return helpers.isAndroidChrome()&&/Version\/\d+\.\d+/.test(helpers.userAgent)},isNativeWebContainer:function(){return window.cordova!=null},isSupportedMobileOS:function(){return helpers.isiOS()||helpers.isAndroidDevice()},isAndroidWebapp:function(){var metaTag;if(!helpers.isAndroidChrome()){return false}metaTag=document.getElementsByName("apple-mobile-web-app-capable")[0]||document.getElementsByName("mobile-web-app-capable")[0];return metaTag&&metaTag.content==="yes"},isiOSBroken:function(){if(!(helpers.isiPad()&&helpers.iOSVersion()===8)){return false}switch(helpers.iOSMinorVersion()){case 0:return true;case 1:return helpers.iOSBuildVersion()<1}return false},isInsideFrame:function(){return window.top!==window.self},isFallback:function(){var androidVersion,criosVersion,ffVersion,iOSVersion;if(!("postMessage"in window)||window.postMessageDisabled||document.documentMode&&document.documentMode<8){return true}androidVersion=helpers.androidVersion();if(androidVersion&&androidVersion<4){return true}iOSVersion=helpers.iOSVersion();if(iOSVersion&&iOSVersion<6){return true}ffVersion=helpers.firefoxVersion();if(ffVersion&&ffVersion<11){return true}criosVersion=helpers.iOSChromeVersion();if(criosVersion&&criosVersion<36){return true}return false},isSmallScreen:function(){return Math.min(window.screen.availHeight,window.screen.availWidth)<=640||/FakeCheckoutMobile/.test(helpers.userAgent)},pad:function(number,width,padding){var leading;if(width==null){width=2}if(padding==null){padding="0"}number=number+"";if(number.length>width){return number}leading=new Array(width-number.length+1).join(padding);return leading+number},requestAnimationFrame:function(callback){return(typeof window.requestAnimationFrame==="function"?window.requestAnimationFrame(callback):void 0)||(typeof window.webkitRequestAnimationFrame==="function"?window.webkitRequestAnimationFrame(callback):void 0)||window.setTimeout(callback,100)},requestAnimationInterval:function(func,interval){var callback,previous;previous=new Date;callback=function(){var frame,now,remaining;frame=helpers.requestAnimationFrame(callback);now=new Date;remaining=interval-(now-previous);if(remaining<=0){previous=now;func()}return frame};return callback()},getQueryParameterByName:function(name){var match;match=RegExp("[?&]"+name+"=([^&]*)").exec(window.location.search);return match&&decodeURIComponent(match[1].replace(/\+/g," "))},addQueryParameter:function(url,name,value){var hashParts,query;query=encodeURIComponent(name)+"="+encodeURIComponent(value);hashParts=new String(url).split("#");hashParts[0]+=hashParts[0].indexOf("?")!==-1?"&":"?";hashParts[0]+=query;return hashParts.join("#")},bind:function(element,name,callback){if(element.addEventListener){return element.addEventListener(name,callback,false)}else{return element.attachEvent("on"+name,callback)}},unbind:function(element,name,callback){if(element.removeEventListener){return element.removeEventListener(name,callback,false)}else{return element.detachEvent("on"+name,callback)}},host:function(url){var parent,parser;parent=document.createElement("div");parent.innerHTML='x';parser=parent.firstChild;return""+parser.protocol+"//"+parser.host},strip:function(html){var tmp,_ref,_ref1;tmp=document.createElement("div");tmp.innerHTML=html;return(_ref=(_ref1=tmp.textContent)!=null?_ref1:tmp.innerText)!=null?_ref:""},setAutocomplete:function(el,type){var secureCCFill;secureCCFill=helpers.chromeVersion()>14||helpers.safariVersion()>7;if(type!=="cc-csc"&&(!/^cc-/.test(type)||secureCCFill)){el.setAttribute("x-autocompletetype",type);el.setAttribute("autocompletetype",type)}else{el.setAttribute("autocomplete","off")}if(!(type==="country-name"||type==="language"||type==="sex"||type==="gender-identity")){el.setAttribute("autocorrect","off");el.setAttribute("spellcheck","off")}if(!(/name|honorific/.test(type)||(type==="locality"||type==="city"||type==="adminstrative-area"||type==="state"||type==="province"||type==="region"||type==="language"||type==="org"||type==="organization-title"||type==="sex"||type==="gender-identity"))){return el.setAttribute("autocapitalize","off")}},hashCode:function(str){var hash,i,_i,_ref;hash=5381;for(i=_i=0,_ref=str.length;_i<_ref;i=_i+=1){hash=(hash<<5)+hash+str.charCodeAt(i)}return(hash>>>0)%65535},stripeUrlPrefix:function(){var match;match=window.location.hostname.match("^([a-z-]*)checkout.");if(match){return match[1]}else{return""}}};module.exports=helpers}).call(this)}});StripeCheckout.require.define({"lib/rpc":function(exports,require,module){(function(){var RPC,helpers,tracker,__bind=function(fn,me){return function(){return fn.apply(me,arguments)}},__slice=[].slice;helpers=require("lib/helpers");tracker=require("lib/tracker");RPC=function(){function RPC(target,options){if(options==null){options={}}this.processMessage=__bind(this.processMessage,this);this.sendMessage=__bind(this.sendMessage,this);this.invoke=__bind(this.invoke,this);this.startSession=__bind(this.startSession,this);this.rpcID=0;this.target=target;this.callbacks={};this.readyQueue=[];this.readyStatus=false;this.methods={};helpers.bind(window,"message",function(_this){return function(){var args;args=1<=arguments.length?__slice.call(arguments,0):[];return _this.message.apply(_this,args)}}(this))}RPC.prototype.startSession=function(){this.sendMessage("frameReady");return this.frameReady()};RPC.prototype.invoke=function(){var args,method;method=arguments[0],args=2<=arguments.length?__slice.call(arguments,1):[];tracker.trace.rpcInvoke(method);return this.ready(function(_this){return function(){return _this.sendMessage(method,args)}}(this))};RPC.prototype.message=function(e){var shouldProcess;shouldProcess=false;try{shouldProcess=e.source===this.target}catch(_error){}if(shouldProcess){return this.processMessage(e.data)}};RPC.prototype.ready=function(fn){if(this.readyStatus){return fn()}else{return this.readyQueue.push(fn)}};RPC.prototype.frameCallback=function(id,result){var _base;if(typeof(_base=this.callbacks)[id]==="function"){_base[id](result)}delete this.callbacks[id];return true};RPC.prototype.frameReady=function(){var callbacks,cb,_i,_len;this.readyStatus=true;callbacks=this.readyQueue.slice(0);for(_i=0,_len=callbacks.length;_i<_len;_i++){cb=callbacks[_i];cb()}return false};RPC.prototype.isAlive=function(){return true};RPC.prototype.sendMessage=function(method,args){var err,id,message,_ref;if(args==null){args=[]}id=++this.rpcID;if(typeof args[args.length-1]==="function"){this.callbacks[id]=args.pop()}message=JSON.stringify({method:method,args:args,id:id});if(((_ref=this.target)!=null?_ref.postMessage:void 0)==null){err=new Error("Unable to communicate with Checkout. Please contact support@stripe.com if the problem persists.");if(this.methods.rpcError!=null){this.methods.rpcError(err)}else{throw err}return}this.target.postMessage(message,"*");return tracker.trace.rpcPostMessage(method,args,id)};RPC.prototype.processMessage=function(data){var method,result,_base,_name;try{data=JSON.parse(data)}catch(_error){return}if(["frameReady","frameCallback","isAlive"].indexOf(data.method)!==-1){result=null;method=this[data.method];if(method!=null){result=method.apply(this,data.args)}}else{result=typeof(_base=this.methods)[_name=data.method]==="function"?_base[_name].apply(_base,data.args):void 0}if(data.method!=="frameCallback"){return this.invoke("frameCallback",data.id,result)}};return RPC}();module.exports=RPC}).call(this)}});StripeCheckout.require.define({"lib/uuid":function(exports,require,module){(function(){var S4;S4=function(){return((1+Math.random())*65536|0).toString(16).substring(1)};module.exports.generate=function(){var delim;delim="-";return S4()+S4()+delim+S4()+delim+S4()+delim+S4()+delim+S4()+S4()+S4()}}).call(this)}});StripeCheckout.require.define({"lib/pixel":function(exports,require,module){(function(){var canTrack,encode,generateID,getCookie,getCookieID,getLocalStorageID,request,setCookie,track;generateID=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(c){var r,v;r=Math.random()*16|0;v=c==="x"?r:r&3|8;return v.toString(16)})};setCookie=function(name,value,options){var cookie,expires;if(options==null){options={}}if(options.expires===true){options.expires=-1}if(typeof options.expires==="number"){expires=new Date;expires.setTime(expires.getTime()+options.expires*24*60*60*1e3);options.expires=expires}if(options.path==null){options.path="/"}value=(value+"").replace(/[^!#-+\--:<-\[\]-~]/g,encodeURIComponent);cookie=encodeURIComponent(name)+"="+value;if(options.expires){cookie+=";expires="+options.expires.toGMTString()}if(options.path){cookie+=";path="+options.path}if(options.domain){cookie+=";domain="+options.domain}return document.cookie=cookie};getCookie=function(name){var cookie,cookies,index,key,value,_i,_len;cookies=document.cookie.split("; ");for(_i=0,_len=cookies.length;_i<_len;_i++){cookie=cookies[_i];index=cookie.indexOf("=");key=decodeURIComponent(cookie.substr(0,index));value=decodeURIComponent(cookie.substr(index+1));if(key===name){return value}}return null};encode=function(param){if(typeof param==="string"){return encodeURIComponent(param)}else{return encodeURIComponent(JSON.stringify(param))}};request=function(url,params,callback){var image,k,v;if(params==null){params={}}params.i=(new Date).getTime();params=function(){var _results;_results=[];for(k in params){v=params[k];_results.push(""+k+"="+encode(v))}return _results}().join("&");image=new Image;if(callback){image.onload=callback}image.src=""+url+"?"+params;return true};canTrack=function(){var dnt,_ref;dnt=(_ref=window.navigator.doNotTrack)!=null?_ref.toString().toLowerCase():void 0;switch(dnt){case"1":case"yes":case"true":return false;default:return true}};getLocalStorageID=function(){var err,lsid;if(!canTrack()){return"DNT"}try{lsid=localStorage.getItem("lsid");if(!lsid){lsid=generateID();localStorage.setItem("lsid",lsid)}return lsid}catch(_error){err=_error;return"NA"}};getCookieID=function(){var err,id;if(!canTrack()){return"DNT"}try{id=getCookie("cid")||generateID();setCookie("cid",id,{expires:360*20,domain:".stripe.com"});return id}catch(_error){err=_error;return"NA"}};track=function(event,params,callback){var k,referrer,request_params,search,v;if(params==null){params={}}referrer=document.referrer;search=window.location.search;request_params={event:event,rf:referrer,sc:search};for(k in params){v=params[k];request_params[k]=v}request_params.lsid||(request_params.lsid=getLocalStorageID());request_params.cid||(request_params.cid=getCookieID());return request("https://q.stripe.com",request_params,callback)};module.exports.track=track;module.exports.getLocalStorageID=getLocalStorageID;module.exports.getCookieID=getCookieID}).call(this)}});StripeCheckout.require.define({"vendor/base64":function(exports,require,module){var utf8Encode=function(string){string=(string+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n");var utftext="",start,end;var stringl=0,n;start=end=0;stringl=string.length;for(n=0;n127&&c1<2048){enc=String.fromCharCode(c1>>6|192,c1&63|128)}else{enc=String.fromCharCode(c1>>12|224,c1>>6&63|128,c1&63|128)}if(enc!==null){if(end>start){utftext+=string.substring(start,end)}utftext+=enc;start=end=n+1}}if(end>start){utftext+=string.substring(start,string.length)}return utftext};module.exports.encode=function(data){var b64="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";var o1,o2,o3,h1,h2,h3,h4,bits,i=0,ac=0,enc="",tmp_arr=[];if(!data){return data}data=utf8Encode(data);do{o1=data.charCodeAt(i++);o2=data.charCodeAt(i++);o3=data.charCodeAt(i++);bits=o1<<16|o2<<8|o3;h1=bits>>18&63;h2=bits>>12&63;h3=bits>>6&63;h4=bits&63;tmp_arr[ac++]=b64.charAt(h1)+b64.charAt(h2)+b64.charAt(h3)+b64.charAt(h4)}while(i0){throw new Error("Missing required data ("+missingKeys.join(", ")+") for tracking "+eventName+".")}parameters.distinct_id=config.distinctId;if(options.appendStateParameters==null){options.appendStateParameters=true}if(options.appendStateParameters){for(k in stateParameters){v=stateParameters[k];parameters[k]=v}}parameters.h=screen.height;parameters.w=screen.width;for(v=_i=0,_len=parameters.length;_i<_len;v=++_i){k=parameters[v];if(v instanceof Array){v.sort()}}fullEventName=""+config.eventNamePrefix+eventName;if(!options.excludeMixpanel){mixpanel.track(fullEventName,parameters)}return pixel.track(fullEventName,parameters)};mixpanel={};mixpanel.track=function(eventName,options){var dataStr,properties;if(options==null){options={}}if(!(typeof $!=="undefined"&&$!==null&&config.mixpanelKey!=null)){return}properties=$.extend({token:config.mixpanelKey,userAgent:window.navigator.userAgent},options);delete properties["stripe_token"];dataStr=base64.encode(JSON.stringify({event:eventName,properties:properties}));return(new Image).src="https://api.mixpanel.com/track/?ip=1&img=1&data="+dataStr};traceSerialize=function(value){var k,obj,v;if(value instanceof Array){return JSON.stringify(function(){var _i,_len,_results;_results=[];for(_i=0,_len=value.length;_i<_len;_i++){v=value[_i];_results.push(traceSerialize(v))}return _results}())}else if(value!=null&&value.target!=null&&value.type!=null){return traceSerialize({type:value.type,target_id:value.target.id})}else if(value instanceof Object){if(value.constructor===Object){obj={};for(k in value){v=value[k];obj[k]=traceSerialize(v)}return JSON.stringify(obj)}else{return value.toString()}}else{return value}};module.exports=tracker}).call(this)}});StripeCheckout.require.define({"outer/lib/fallbackRpc":function(exports,require,module){(function(){var FallbackRPC,cacheBust,interval,lastHash,re,__bind=function(fn,me){return function(){return fn.apply(me,arguments)}};cacheBust=1;interval=null;lastHash=null;re=/^#?\d+&/;FallbackRPC=function(){function FallbackRPC(target,host){this.invokeTarget=__bind(this.invokeTarget,this);this.target=target;this.host=host}FallbackRPC.prototype.invokeTarget=function(message){var url;message=+new Date+cacheBust++ +"&"+encodeURIComponent(message);url=this.host+"";return this.target.location=url.replace(/#.*$/,"")+"#"+message};FallbackRPC.prototype.receiveMessage=function(callback,delay){if(delay==null){delay=100}interval&&clearInterval(interval);return interval=setInterval(function(){var hash;hash=decodeURIComponent(window.location.hash);if(hash!==lastHash&&re.test(hash)){window.location.hash="";lastHash=hash;return callback({data:hash.replace(re,"")})}},delay)};return FallbackRPC}();module.exports=FallbackRPC}).call(this)}});StripeCheckout.require.define({"outer/lib/utils":function(exports,require,module){(function(){var $,$$,addClass,append,css,hasAttr,hasClass,insertAfter,insertBefore,parents,remove,resolve,text,trigger,__indexOf=[].indexOf||function(item){for(var i=0,l=this.length;i=0};css=function(element,css){return element.style.cssText+=";"+css};insertBefore=function(element,child){return element.parentNode.insertBefore(child,element)};insertAfter=function(element,child){return element.parentNode.insertBefore(child,element.nextSibling)};append=function(element,child){return element.appendChild(child)};remove=function(element){var _ref;return(_ref=element.parentNode)!=null?_ref.removeChild(element):void 0};parents=function(node){var ancestors;ancestors=[];while((node=node.parentNode)&&node!==document&&__indexOf.call(ancestors,node)<0){ancestors.push(node)}return ancestors};resolve=function(url){var parser;parser=document.createElement("a");parser.href=url;return""+parser.href};text=function(element,value){if("innerText"in element){element.innerText=value}else{element.textContent=value}return value};module.exports={$:$,$$:$$,hasAttr:hasAttr,trigger:trigger,addClass:addClass,hasClass:hasClass,css:css,insertBefore:insertBefore,insertAfter:insertAfter,append:append,remove:remove,parents:parents,resolve:resolve,text:text}}).call(this)}});StripeCheckout.require.define({"outer/controllers/app":function(exports,require,module){(function(){var App,Checkout,RPC,TokenCallback,tracker,utils,__bind=function(fn,me){return function(){return fn.apply(me,arguments)}};Checkout=require("outer/controllers/checkout");TokenCallback=require("outer/controllers/tokenCallback");RPC=require("lib/rpc");tracker=require("lib/tracker");utils=require("outer/lib/utils");App=function(){function App(options){var _ref,_ref1;if(options==null){options={}}this.setHost=__bind(this.setHost,this);this.configure=__bind(this.configure,this);this.close=__bind(this.close,this);this.open=__bind(this.open,this);this.configurations={};this.checkouts={};this.host="https://checkout.stripe.com";this.timeLoaded=Math.floor((new Date).getTime()/1e3);this.totalButtons=0;if(((_ref=window.Prototype)!=null?(_ref1=_ref.Version)!=null?_ref1.indexOf("1.6"):void 0:void 0)===0){console.error("Stripe Checkout is not compatible with your version of Prototype.js. Please upgrade to version 1.7 or greater.")}}App.prototype.open=function(options,buttonId){var checkout,k,mergedOptions,v,_ref;if(buttonId==null){buttonId=null}mergedOptions={referrer:document.referrer,url:document.URL,timeLoaded:this.timeLoaded};if(buttonId&&this.configurations[buttonId]){_ref=this.configurations[buttonId];for(k in _ref){v=_ref[k];mergedOptions[k]=v}}for(k in options){v=options[k];mergedOptions[k]=v}if(mergedOptions.image){mergedOptions.image=utils.resolve(mergedOptions.image)}this.validateOptions(options,"open");if(buttonId){checkout=this.checkouts[buttonId]}else{checkout=new Checkout(new TokenCallback(options),this.host)}this.trackOpen(checkout,mergedOptions);return checkout.open(mergedOptions)};App.prototype.close=function(buttonId){var _ref;return(_ref=this.checkouts[buttonId])!=null?_ref.close():void 0};App.prototype.configure=function(buttonId,options){if(options==null){options={}}if(buttonId instanceof Object){options=buttonId;buttonId="button"+this.totalButtons++}if(options.image){options.image=utils.resolve(options.image)}this.validateOptions(options,"configure");this.configurations[buttonId]=options;this.checkouts[buttonId]=new Checkout(new TokenCallback(options),this.host);this.checkouts[buttonId].preload(options);return{open:function(_this){return function(options){return _this.open(options,buttonId)}}(this),close:function(_this){return function(){return _this.close(buttonId)}}(this)}};App.prototype.validateOptions=function(options,which){var url;try{return JSON.stringify(options)}catch(_error){url="https://stripe.com/docs/checkout#integration-custom";throw new Error("Stripe Checkout was unable to serialize the options passed to StripeCheckout."+which+"(). Please consult the doumentation to confirm that you're supplying values of the expected type: "+url)}};App.prototype.setHost=function(host){return this.host=host};App.prototype.trackOpen=function(checkout,options){tracker.setEnabled(!options.notrack);return tracker.track.outerOpen({key:options.key,lsid:"NA",cid:"NA"})};return App}();module.exports=App}).call(this)}});StripeCheckout.require.define({"outer/controllers/button":function(exports,require,module){(function(){var $$,Button,addClass,append,hasAttr,hasClass,helpers,insertAfter,parents,text,trigger,_ref,__bind=function(fn,me){return function(){return fn.apply(me,arguments)}};_ref=require("outer/lib/utils"),$$=_ref.$$,hasClass=_ref.hasClass,addClass=_ref.addClass,trigger=_ref.trigger,append=_ref.append,text=_ref.text,parents=_ref.parents,insertAfter=_ref.insertAfter,hasAttr=_ref.hasAttr;helpers=require("lib/helpers");Button=function(){Button.totalButtonId=0;Button.load=function(app){var button,el,element;element=$$("stripe-button");element=function(){var _i,_len,_results;_results=[];for(_i=0,_len=element.length;_i<_len;_i++){el=element[_i];if(!hasClass(el,"active")){_results.push(el)}}return _results}();element=element[element.length-1];if(!element){return}addClass(element,"active");button=new Button(element,app);return button.append()};function Button(scriptEl,app){this.parseOptions=__bind(this.parseOptions,this);this.parentHead=__bind(this.parentHead,this);this.parentForm=__bind(this.parentForm,this);this.onToken=__bind(this.onToken,this);this.open=__bind(this.open,this);this.submit=__bind(this.submit,this);this.append=__bind(this.append,this);this.render=__bind(this.render,this);var _base;this.scriptEl=scriptEl;this.app=app;this.document=this.scriptEl.ownerDocument;this.nostyle=helpers.isFallback();this.options=this.parseOptions();(_base=this.options).label||(_base.label="Pay with Card");this.options.token=this.onToken;this.$el=document.createElement("button");this.$el.setAttribute("type","submit");this.$el.className="stripe-button-el";helpers.bind(this.$el,"click",this.submit);helpers.bind(this.$el,"touchstart",function(){});this.render()}Button.prototype.render=function(){this.$el.innerHTML="";this.$span=document.createElement("span");text(this.$span,this.options.label);if(!this.nostyle){this.$el.style.visibility="hidden";this.$span.style.display="block";this.$span.style.minHeight="30px"}this.$style=document.createElement("link");this.$style.setAttribute("type","text/css");this.$style.setAttribute("rel","stylesheet");this.$style.setAttribute("href",this.app.host+"/v3/checkout/button-qpwW2WfkB0oGWVWIASjIOQ.css");return append(this.$el,this.$span)};Button.prototype.append=function(){var head;if(this.scriptEl){insertAfter(this.scriptEl,this.$el)}if(!this.nostyle){head=this.parentHead();if(head){append(head,this.$style)}}if(this.$form=this.parentForm()){helpers.unbind(this.$form,"submit",this.submit);helpers.bind(this.$form,"submit",this.submit)}if(!this.nostyle){setTimeout(function(_this){return function(){return _this.$el.style.visibility="visible"}}(this),1e3)}this.app.setHost(helpers.host(this.scriptEl.src));return this.appHandler=this.app.configure(this.options,{form:this.$form})};Button.prototype.disable=function(){return this.$el.setAttribute("disabled",true)};Button.prototype.enable=function(){return this.$el.removeAttribute("disabled")};Button.prototype.isDisabled=function(){return hasAttr(this.$el,"disabled")};Button.prototype.submit=function(e){if(typeof e.preventDefault==="function"){e.preventDefault()}if(!this.isDisabled()){this.open()}return false};Button.prototype.open=function(){return this.appHandler.open(this.options)};Button.prototype.onToken=function(token,args){var $input,$tokenInput,$tokenTypeInput,key,value;trigger(this.scriptEl,"token",token);if(this.$form){$tokenInput=this.renderInput("stripeToken",token.id);append(this.$form,$tokenInput);$tokenTypeInput=this.renderInput("stripeTokenType",token.type);append(this.$form,$tokenTypeInput);if(token.email){append(this.$form,this.renderInput("stripeEmail",token.email))}if(args){for(key in args){value=args[key];$input=this.renderInput(this.formatKey(key),value);append(this.$form,$input)}}this.$form.submit()}return this.disable()};Button.prototype.formatKey=function(key){var arg,args,_i,_len;args=key.split("_");key="";for(_i=0,_len=args.length;_i<_len;_i++){arg=args[_i];if(arg.length>0){key=key+arg.substr(0,1).toUpperCase()+arg.substr(1).toLowerCase()}}return"stripe"+key};Button.prototype.renderInput=function(name,value){var input;input=document.createElement("input");input.type="hidden";input.name=name;input.value=value;return input};Button.prototype.parentForm=function(){var el,elements,_i,_len,_ref1;elements=parents(this.$el);for(_i=0,_len=elements.length;_i<_len;_i++){el=elements[_i];if(((_ref1=el.tagName)!=null?_ref1.toLowerCase():void 0)==="form"){return el}}return null};Button.prototype.parentHead=function(){var _ref1,_ref2;return((_ref1=this.document)!=null?_ref1.head:void 0)||((_ref2=this.document)!=null?_ref2.getElementsByTagName("head")[0]:void 0)||this.document.body};Button.prototype.parseOptions=function(){var attr,match,options,_i,_len,_ref1;options={};_ref1=this.scriptEl.attributes;for(_i=0,_len=_ref1.length;_i<_len;_i++){attr=_ref1[_i];match=attr.name.match(/^data-(.+)$/);if(match!=null?match[1]:void 0){options[match[1]]=attr.value}}return options};return Button}();module.exports=Button}).call(this)}});StripeCheckout.require.define({"outer/controllers/checkout":function(exports,require,module){(function(){var Checkout,FallbackView,IframeView,TabView,cookie,helpers,__bind=function(fn,me){return function(){return fn.apply(me,arguments)}};helpers=require("lib/helpers");IframeView=require("outer/views/iframeView");TabView=require("outer/views/tabView");FallbackView=require("outer/views/fallbackView");cookie=require("vendor/cookie");Checkout=function(){Checkout.activeView=null;function Checkout(tokenCallback,host){this.onTokenCallback=__bind(this.onTokenCallback,this);this.preload=__bind(this.preload,this);this.open=__bind(this.open,this);var path,shouldPopup,viewClass;this.tokenCallback=tokenCallback;this.host=host;this.onToken=function(_this){return function(data){return tokenCallback.trigger(data.token,data.args,_this.onTokenCallback)}}(this);if(helpers.isFallback()){viewClass=FallbackView;path="/v3/fallback/6UQ6gx0KTH1syE44E6yZA.html"}else{path="/v3/lB3wUljfuCi9MIXuTlvvg.html";if(Math.random()<.1){path="/v3/nocdn-hlnqFn7LdeQOmPLkwVzeA.html"}shouldPopup=helpers.isSupportedMobileOS()&&!(helpers.isNativeWebContainer()||helpers.isiOSWebView()||helpers.isAndroidWebapp()||helpers.isiOSBroken());if(shouldPopup){viewClass=TabView}else{viewClass=IframeView}}this.view=new viewClass(this.onToken,this.host,path)}Checkout.prototype.open=function(options){if(options==null){options={}}if(Checkout.activeView&&Checkout.activeView!==this.view){Checkout.activeView.close()}Checkout.activeView=this.view;options.supportsTokenCallback=this.tokenCallback.supportsTokenCallback();return this.view.open(options,function(_this){return function(status){if(status){return}if(!(_this.view instanceof TabView)){return}_this.view=new IframeView(_this.onToken,_this.host,"/v3/lB3wUljfuCi9MIXuTlvvg.html");return _this.open(options)}}(this))};Checkout.prototype.close=function(){var _ref;return(_ref=this.view)!=null?_ref.close():void 0};Checkout.prototype.preload=function(options){return this.view.preload(options)};Checkout.prototype.onTokenCallback=function(){return this.view.triggerTokenCallback.apply(this.view,arguments)};return Checkout}();module.exports=Checkout}).call(this)}});StripeCheckout.require.define({"outer/controllers/tokenCallback":function(exports,require,module){(function(){var TokenCallback,__bind=function(fn,me){return function(){return fn.apply(me,arguments)}};TokenCallback=function(){function TokenCallback(options){this.supportsTokenCallback=__bind(this.supportsTokenCallback,this);this.trigger=__bind(this.trigger,this);if(options.token){this.fn=options.token;this.version=1}else if(options.onToken){this.fn=options.onToken;this.version=2}}TokenCallback.prototype.trigger=function(token,addresses,callback){var data,k,shipping,v;if(this.version===2){data={token:token};shipping=null;for(k in addresses){v=addresses[k];if(/^shipping_/.test(k)){if(shipping==null){shipping={}}shipping[k.replace(/^shipping_/,"")]=v}}if(shipping!=null){data.shipping=shipping}return this.fn(data,callback)}else{return this.fn(token,addresses)}};TokenCallback.prototype.supportsTokenCallback=function(){return this.version>1};return TokenCallback}();module.exports=TokenCallback}).call(this)}});StripeCheckout.require.define({"outer/views/fallbackView":function(exports,require,module){(function(){var FallbackRPC,FallbackView,View,__bind=function(fn,me){return function(){return fn.apply(me,arguments)}},__hasProp={}.hasOwnProperty,__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};FallbackRPC=require("outer/lib/fallbackRpc");View=require("outer/views/view");FallbackView=function(_super){__extends(FallbackView,_super);function FallbackView(){this.triggerTokenCallback=__bind(this.triggerTokenCallback,this);this.close=__bind(this.close,this);this.open=__bind(this.open,this);FallbackView.__super__.constructor.apply(this,arguments)}FallbackView.prototype.open=function(options,callback){var message,url;FallbackView.__super__.open.apply(this,arguments);url=this.host+this.path;this.frame=window.open(url,"stripe_checkout_app","width=400,height=400,location=yes,resizable=yes,scrollbars=yes");if(this.frame==null){alert("Disable your popup blocker to proceed with checkout.");url="https://stripe.com/docs/checkout#integration-more-runloop";throw new Error("To learn how to prevent the Stripe Checkout popup from being blocked, please visit "+url)}this.rpc=new FallbackRPC(this.frame,url);this.rpc.receiveMessage(function(_this){return function(e){var data;try{data=JSON.parse(e.data)}catch(_error){return}return _this.onToken(data)}}(this));message=JSON.stringify(this.options);this.rpc.invokeTarget(message);return callback(true)};FallbackView.prototype.close=function(){var _ref;return(_ref=this.frame)!=null?_ref.close():void 0};FallbackView.prototype.triggerTokenCallback=function(err){if(err){return alert(err)}};return FallbackView}(View);module.exports=FallbackView}).call(this)}});StripeCheckout.require.define({"outer/views/iframeView":function(exports,require,module){(function(){var IframeView,RPC,View,helpers,ready,utils,__bind=function(fn,me){return function(){return fn.apply(me,arguments)}},__hasProp={}.hasOwnProperty,__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};utils=require("outer/lib/utils");helpers=require("lib/helpers");RPC=require("lib/rpc");View=require("outer/views/view");ready=require("vendor/ready");IframeView=function(_super){__extends(IframeView,_super);function IframeView(){this.configure=__bind(this.configure,this);this.removeFrame=__bind(this.removeFrame,this);this.removeTouchOverlay=__bind(this.removeTouchOverlay,this);this.showTouchOverlay=__bind(this.showTouchOverlay,this);this.attachIframe=__bind(this.attachIframe,this);this.setToken=__bind(this.setToken,this);this.closed=__bind(this.closed,this);this.close=__bind(this.close,this);this.preload=__bind(this.preload,this);this.open=__bind(this.open,this);return IframeView.__super__.constructor.apply(this,arguments)}IframeView.prototype.open=function(options,callback){IframeView.__super__.open.apply(this,arguments);return ready(function(_this){return function(){var left,loaded,_ref;_this.originalOverflowValue=document.body.style.overflow;if(_this.frame==null){_this.configure()}if(typeof $!=="undefined"&&$!==null?(_ref=$.fn)!=null?_ref.modal:void 0:void 0){$(document).off("focusin.bs.modal").off("focusin.modal")}_this.frame.style.display="block";if(_this.shouldShowTouchOverlay()){_this.showTouchOverlay();_this.frame.style.top=(window.scrollY||window.pageYOffset)+"px";left=(window.scrollX||window.pageXOffset)+(window.innerWidth-_this.iframeWidth())/2;left=Math.min(window.innerWidth-_this.iframeWidth(),Math.max(0,left));left=Math.max(0,left);_this.frame.style.left=left+"px"}loaded=false;setTimeout(function(){if(loaded){return}loaded=true;callback(false);return _this.removeFrame()},8e3);return _this.rpc.ready(function(){if(loaded){return}loaded=true;callback(true);_this.rpc.invoke("render","","iframe",_this.options);document.body.style.overflow="hidden";return _this.rpc.invoke("open",{timeLoaded:_this.options.timeLoaded},function(success){var _base;if(success){return typeof(_base=_this.options).opened==="function"?_base.opened():void 0}})})}}(this))};IframeView.prototype.preload=function(options){return ready(function(_this){return function(){_this.configure();return _this.rpc.invoke("preload",options)}}(this))};IframeView.prototype.iframeWidth=function(){if(helpers.isSmallScreen()){return 328}else{return 380}};IframeView.prototype.close=function(){return this.rpc.invoke("close")};IframeView.prototype.closed=function(){var _base;document.body.style.overflow=this.originalOverflowValue;this.removeFrame();if(typeof(_base=this.options).closed==="function"){_base.closed()}clearTimeout(this.tokenTimeout);if(this.token!=null){this.onToken(this.token)}this.token=null;this.preload(this.options);return true};IframeView.prototype.setToken=function(data){this.token=data;return this.tokenTimeout!=null?this.tokenTimeout:this.tokenTimeout=setTimeout(function(_this){return function(){_this.onToken(_this.token);_this.tokenTimeout=null;return _this.token=null}}(this),2500)};IframeView.prototype.attachIframe=function(){var cssText,iframe;iframe=document.createElement("iframe");iframe.setAttribute("frameBorder","0");iframe.setAttribute("allowtransparency","true");cssText="z-index: 9999;\ndisplay: none;\nbackground: transparent;\nbackground: rgba(0,0,0,0.005);\nborder: 0px none transparent;\noverflow-x: hidden;\noverflow-y: auto;\nvisibility: hidden;\nmargin: 0;\npadding: 0;\n-webkit-tap-highlight-color: transparent;\n-webkit-touch-callout: none;";if(this.shouldShowTouchOverlay()){cssText+="position: absolute;\nwidth: "+this.iframeWidth()+"px;\nheight: 100%;"}else{cssText+="position: fixed;\nleft: 0;\ntop: 0;\nwidth: 100%;\nheight: 100%;"}iframe.style.cssText=cssText;helpers.bind(iframe,"load",function(){return iframe.style.visibility="visible"});iframe.src=this.host+this.path;iframe.className=iframe.name="stripe_checkout_app";utils.append(document.body,iframe);return iframe};IframeView.prototype.showTouchOverlay=function(){var toRepaint;if(this.overlay){return}this.overlay=document.createElement("div");this.overlay.style.cssText="z-index: 9998;\nbackground: #000;\nopacity: 0;\nborder: 0px none transparent;\noverflow: none;\nmargin: 0;\npadding: 0;\n-webkit-tap-highlight-color: transparent;\n-webkit-touch-callout: none;\nposition: fixed;\nleft: 0;\ntop: 0;\nwidth: 200%;\nheight: 200%;\ntransition: opacity 320ms ease;\n-webkit-transition: opacity 320ms ease;\n-moz-transition: opacity 320ms ease;\n-ms-transition: opacity 320ms ease;";utils.append(document.body,this.overlay);toRepaint=this.overlay.offsetHeight;return this.overlay.style.opacity="0.5"};IframeView.prototype.removeTouchOverlay=function(){var overlay;if(!this.overlay){return}overlay=this.overlay;overlay.style.opacity="0";setTimeout(function(){return utils.remove(overlay)},400);return this.overlay=null};IframeView.prototype.removeFrame=function(){var frame;if(this.shouldShowTouchOverlay()){this.removeTouchOverlay()}frame=this.frame;setTimeout(function(){return utils.remove(frame)},500);return this.frame=null};IframeView.prototype.configure=function(){if(this.frame!=null){this.removeFrame()}this.frame=this.attachIframe();this.rpc=new RPC(this.frame.contentWindow,{host:this.host});this.rpc.methods.closed=this.closed;return this.rpc.methods.setToken=this.setToken};IframeView.prototype.shouldShowTouchOverlay=function(){return helpers.isSupportedMobileOS()};return IframeView}(View);module.exports=IframeView}).call(this)}});StripeCheckout.require.define({"outer/views/tabView":function(exports,require,module){(function(){var RPC,TabView,View,helpers,__bind=function(fn,me){return function(){return fn.apply(me,arguments)}},__hasProp={}.hasOwnProperty,__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};RPC=require("lib/rpc");helpers=require("lib/helpers");View=require("outer/views/view");TabView=function(_super){__extends(TabView,_super);function TabView(){this.closed=__bind(this.closed,this);this.checkForClosedTab=__bind(this.checkForClosedTab,this);this.setToken=__bind(this.setToken,this);this.fullPath=__bind(this.fullPath,this);this.close=__bind(this.close,this);this.open=__bind(this.open,this);TabView.__super__.constructor.apply(this,arguments);this.closedTabInterval=null;this.color=null;this.colorSet=false}TabView.prototype.open=function(options,callback){var targetName,url,_base,_ref,_ref1;TabView.__super__.open.apply(this,arguments);try{if((_ref=this.frame)!=null){_ref.close()}}catch(_error){}if(window.name==="stripe_checkout_tabview"){window.name=""}if(helpers.isiOSChrome()){targetName="_blank"}else{targetName="stripe_checkout_tabview"}this.frame=window.open(this.fullPath(),targetName);if(!this.frame&&((_ref1=this.options.key)!=null?_ref1.indexOf("test"):void 0)!==-1){url="https://stripe.com/docs/checkout#integration-more-runloop";console.error("Stripe Checkout was unable to open a new window, possibly due to a popup blocker.\nTo provide the best experience for your users, follow the guide at "+url+".\nThis message will only appear when using a test publishable key.")}if(!this.frame||this.frame===window){this.close();callback(false);return}if(typeof(_base=this.frame).focus==="function"){_base.focus()}this.rpc=new RPC(this.frame,{host:this.host});this.rpc.methods.setToken=this.setToken;this.rpc.methods.closed=this.closed;return this.rpc.ready(function(_this){return function(){var _base1;callback(true);_this.rpc.invoke("render","","tab",_this.options);_this.rpc.invoke("open");if(typeof(_base1=_this.options).opened==="function"){_base1.opened()}return _this.checkForClosedTab()}}(this))};TabView.prototype.close=function(){if(this.frame&&this.frame!==window){return this.frame.close()}};TabView.prototype.fullPath=function(){return this.host+this.path};TabView.prototype.setToken=function(data){this.token=data;return this.tokenTimeout!=null?this.tokenTimeout:this.tokenTimeout=setTimeout(function(_this){return function(){_this.onToken(_this.token);_this.tokenTimeout=null;return _this.token=null}}(this),2500)};TabView.prototype.checkForClosedTab=function(){if(this.closedTabInterval){clearInterval(this.closedTabInterval)}return this.closedTabInterval=setInterval(function(_this){return function(){if(!_this.frame||!_this.frame.postMessage||_this.frame.closed){return _this.closed()}}}(this),100)};TabView.prototype.closed=function(){var _base;clearInterval(this.closedTabInterval);if(typeof(_base=this.options).closed==="function"){_base.closed()}clearTimeout(this.tokenTimeout);if(this.token!=null){return this.onToken(this.token)}};return TabView}(View);module.exports=TabView}).call(this)}});StripeCheckout.require.define({"outer/views/view":function(exports,require,module){(function(){var View,__bind=function(fn,me){return function(){return fn.apply(me,arguments)}},__slice=[].slice;View=function(){function View(onToken,host,path){this.triggerTokenCallback=__bind(this.triggerTokenCallback,this);this.open=__bind(this.open,this);this.onToken=onToken;this.host=host;this.path=path}View.prototype.open=function(options,callback){return this.options=options};View.prototype.close=function(){};View.prototype.preload=function(options){};View.prototype.triggerTokenCallback=function(){var args;args=arguments;return this.rpc.ready(function(_this){return function(){var _ref;return(_ref=_this.rpc).invoke.apply(_ref,["tokenCallback"].concat(__slice.call(args)))}}(this))};return View}();module.exports=View}).call(this)}});(function(){var App,Button,app,require,_ref,_ref1;require=require||this.StripeCheckout.require;Button=require("outer/controllers/button");App=require("outer/controllers/app");if(((_ref=this.StripeCheckout)!=null?_ref.__app:void 0)==null){this.StripeCheckout||(this.StripeCheckout={});this.StripeCheckout.__app=app=new App;this.StripeCheckout.open=app.open;this.StripeCheckout.configure=app.configure;this.StripeButton=this.StripeCheckout;if(((_ref1=this.StripeCheckout)!=null?_ref1.__host:void 0)&&this.StripeCheckout.__host!==""){app.setHost(this.StripeCheckout.__host)}}Button.load(this.StripeCheckout.__app)}).call(this); +if(typeof JSON!=="object"){JSON={}}(function(){"use strict";function f(n){return n<10?"0"+n:n}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()}}var cx,escapable,gap,indent,meta,rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==="string"?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+string+'"'}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==="object"&&typeof value.toJSON==="function"){value=value.toJSON(key)}if(typeof rep==="function"){value=rep.call(holder,key,value)}switch(typeof value){case"string":return quote(value);case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null"}gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==="[object Array]"){length=value.length;for(i=0;ij;i=f<=j?++_i:--_i){if(this[i]===obj){return i}}return-1}}}).call(this);StripeCheckout.require.define({"lib/helpers":function(exports,require,module){(function(){var delurkWinPhone,helpers,uaVersionFn;uaVersionFn=function(re){return function(){var uaMatch;uaMatch=helpers.userAgent.match(re);return uaMatch&&parseInt(uaMatch[1])}};delurkWinPhone=function(fn){return function(){return fn()&&!helpers.isWindowsPhone()}};helpers={userAgent:window.navigator.userAgent,escape:function(value){return value&&(""+value).replace(/&/g,"&").replace(//g,">").replace(/\"/g,""")},trim:function(value){return value.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},sanitizeURL:function(value){var SCHEME_WHITELIST,allowed,scheme,_i,_len;if(!value){return}value=helpers.trim(value);SCHEME_WHITELIST=["data:","http:","https:"];allowed=false;for(_i=0,_len=SCHEME_WHITELIST.length;_i<_len;_i++){scheme=SCHEME_WHITELIST[_i];if(value.indexOf(scheme)===0){allowed=true;break}}if(!allowed){return null}return encodeURI(value)},iOSVersion:uaVersionFn(/(?:iPhone OS |iPad; CPU OS )(\d+)_\d+/),iOSMinorVersion:uaVersionFn(/(?:iPhone OS |iPad; CPU OS )\d+_(\d+)/),iOSBuildVersion:uaVersionFn(/(?:iPhone OS |iPad; CPU OS )\d+_\d+_(\d+)/),androidWebkitVersion:uaVersionFn(/Mozilla\/5\.0.*Android.*AppleWebKit\/([\d]+)/),androidVersion:uaVersionFn(/Android (\d+)\.\d+/),firefoxVersion:uaVersionFn(/Firefox\/(\d+)\.\d+/),chromeVersion:uaVersionFn(/Chrome\/(\d+)\.\d+/),safariVersion:uaVersionFn(/Version\/(\d+)\.\d+ Safari/),iOSChromeVersion:uaVersionFn(/CriOS\/(\d+)\.\d+/),iOSNativeVersion:uaVersionFn(/Stripe\/(\d+)\.\d+/),ieVersion:uaVersionFn(/(?:MSIE |Trident\/.*rv:)(\d{1,2})\./),isiOSChrome:function(){return/CriOS/.test(helpers.userAgent)},isiOSWebView:function(){return/(iPhone|iPod|iPad).*AppleWebKit((?!.*Safari)|(.*\([^)]*like[^)]*Safari[^)]*\)))/i.test(helpers.userAgent)},isiOS:delurkWinPhone(function(){return/(iPhone|iPad|iPod)/i.test(helpers.userAgent)}),isiOSNative:function(){return this.isiOS()&&this.iOSNativeVersion()>=3},isiPad:function(){return/(iPad)/i.test(helpers.userAgent)},isMac:delurkWinPhone(function(){return/mac/i.test(helpers.userAgent)}),isWindowsPhone:function(){return/(Windows\sPhone|IEMobile)/i.test(helpers.userAgent)},isWindowsOS:function(){return/(Windows NT \d\.\d)/i.test(helpers.userAgent)},isIE:function(){return/(MSIE ([0-9]{1,}[\.0-9]{0,})|Trident\/)/i.test(helpers.userAgent)},isChrome:function(){return"chrome"in window},isSafari:delurkWinPhone(function(){var userAgent;userAgent=helpers.userAgent;return/Safari/i.test(userAgent)&&!/Chrome/i.test(userAgent)}),isFirefox:delurkWinPhone(function(){return helpers.firefoxVersion()!=null}),isAndroidBrowser:function(){var version;version=helpers.androidWebkitVersion();return version&&version<537},isAndroidChrome:function(){var version;version=helpers.androidWebkitVersion();return version&&version>=537},isAndroidDevice:delurkWinPhone(function(){return/Android/.test(helpers.userAgent)}),isAndroidWebView:function(){return helpers.isAndroidChrome()&&/Version\/\d+\.\d+/.test(helpers.userAgent)},isNativeWebContainer:function(){return window.cordova!=null||/GSA\/\d+\.\d+/.test(helpers.userAgent)},isSupportedMobileOS:function(){return helpers.isiOS()||helpers.isAndroidDevice()},isAndroidWebapp:function(){var metaTag;if(!helpers.isAndroidChrome()){return false}metaTag=document.getElementsByName("apple-mobile-web-app-capable")[0]||document.getElementsByName("mobile-web-app-capable")[0];return metaTag&&metaTag.content==="yes"},isiOSBroken:function(){if(!(helpers.isiPad()&&helpers.iOSVersion()===8)){return false}switch(helpers.iOSMinorVersion()){case 0:return true;case 1:return helpers.iOSBuildVersion()<1}return false},isUserGesture:function(){var _ref,_ref1;return(_ref=(_ref1=window.event)!=null?_ref1.type:void 0)==="click"||_ref==="touchstart"||_ref==="touchend"},isInsideFrame:function(){return window.top!==window.self},isFallback:function(){var androidVersion,criosVersion,ffVersion,iOSVersion;if(!("postMessage"in window)||window.postMessageDisabled||document.documentMode&&document.documentMode<8){return true}androidVersion=helpers.androidVersion();if(androidVersion&&androidVersion<4){return true}iOSVersion=helpers.iOSVersion();if(iOSVersion&&iOSVersion<6){return true}ffVersion=helpers.firefoxVersion();if(ffVersion&&ffVersion<11){return true}criosVersion=helpers.iOSChromeVersion();if(criosVersion&&criosVersion<36){return true}return false},isSmallScreen:function(){return Math.min(window.screen.availHeight,window.screen.availWidth)<=640||/FakeCheckoutMobile/.test(helpers.userAgent)},pad:function(number,width,padding){var leading;if(width==null){width=2}if(padding==null){padding="0"}number=number+"";if(number.length>width){return number}leading=new Array(width-number.length+1).join(padding);return leading+number},requestAnimationFrame:function(callback){return(typeof window.requestAnimationFrame==="function"?window.requestAnimationFrame(callback):void 0)||(typeof window.webkitRequestAnimationFrame==="function"?window.webkitRequestAnimationFrame(callback):void 0)||window.setTimeout(callback,100)},requestAnimationInterval:function(func,interval){var callback,previous;previous=new Date;callback=function(){var frame,now,remaining;frame=helpers.requestAnimationFrame(callback);now=new Date;remaining=interval-(now-previous);if(remaining<=0){previous=now;func()}return frame};return callback()},getQueryParameterByName:function(name){var match;match=RegExp("[?&]"+name+"=([^&]*)").exec(window.location.search);return match&&decodeURIComponent(match[1].replace(/\+/g," "))},addQueryParameter:function(url,name,value){var hashParts,query;query=encodeURIComponent(name)+"="+encodeURIComponent(value);hashParts=new String(url).split("#");hashParts[0]+=hashParts[0].indexOf("?")!==-1?"&":"?";hashParts[0]+=query;return hashParts.join("#")},bind:function(element,name,callback){if(element.addEventListener){return element.addEventListener(name,callback,false)}else{return element.attachEvent("on"+name,callback)}},unbind:function(element,name,callback){if(element.removeEventListener){return element.removeEventListener(name,callback,false)}else{return element.detachEvent("on"+name,callback)}},host:function(url){var parent,parser;parent=document.createElement("div");parent.innerHTML='x';parser=parent.firstChild;return""+parser.protocol+"//"+parser.host},strip:function(html){var tmp,_ref,_ref1;tmp=document.createElement("div");tmp.innerHTML=html;return(_ref=(_ref1=tmp.textContent)!=null?_ref1:tmp.innerText)!=null?_ref:""},setAutocomplete:function(el,type){var secureCCFill;secureCCFill=helpers.chromeVersion()>14||helpers.safariVersion()>7;if(type!=="cc-csc"&&(!/^cc-/.test(type)||secureCCFill)){el.setAttribute("x-autocompletetype",type);el.setAttribute("autocompletetype",type)}else{el.setAttribute("autocomplete","off")}if(!(type==="country-name"||type==="language"||type==="sex"||type==="gender-identity")){el.setAttribute("autocorrect","off");el.setAttribute("spellcheck","off")}if(!(/name|honorific/.test(type)||(type==="locality"||type==="city"||type==="adminstrative-area"||type==="state"||type==="province"||type==="region"||type==="language"||type==="org"||type==="organization-title"||type==="sex"||type==="gender-identity"))){return el.setAttribute("autocapitalize","off")}},hashCode:function(str){var hash,i,_i,_ref;hash=5381;for(i=_i=0,_ref=str.length;_i<_ref;i=_i+=1){hash=(hash<<5)+hash+str.charCodeAt(i)}return(hash>>>0)%65535},stripeUrlPrefix:function(){var match;match=window.location.hostname.match("^([a-z-]*)checkout.");if(match){return match[1]}else{return""}}};module.exports=helpers}).call(this)}});StripeCheckout.require.define({"lib/rpc":function(exports,require,module){(function(){var RPC,helpers,tracker,__bind=function(fn,me){return function(){return fn.apply(me,arguments)}},__slice=[].slice;helpers=require("lib/helpers");tracker=require("lib/tracker");RPC=function(){function RPC(target,options){if(options==null){options={}}this.processMessage=__bind(this.processMessage,this);this.sendMessage=__bind(this.sendMessage,this);this.invoke=__bind(this.invoke,this);this.startSession=__bind(this.startSession,this);this.rpcID=0;this.target=target;this.callbacks={};this.readyQueue=[];this.readyStatus=false;this.methods={};helpers.bind(window,"message",function(_this){return function(){var args;args=1<=arguments.length?__slice.call(arguments,0):[];return _this.message.apply(_this,args)}}(this))}RPC.prototype.startSession=function(){this.sendMessage("frameReady");return this.frameReady()};RPC.prototype.invoke=function(){var args,method;method=arguments[0],args=2<=arguments.length?__slice.call(arguments,1):[];tracker.trace.rpcInvoke(method);return this.ready(function(_this){return function(){return _this.sendMessage(method,args)}}(this))};RPC.prototype.message=function(e){var shouldProcess;shouldProcess=false;try{shouldProcess=e.source===this.target}catch(_error){}if(shouldProcess){return this.processMessage(e.data)}};RPC.prototype.ready=function(fn){if(this.readyStatus){return fn()}else{return this.readyQueue.push(fn)}};RPC.prototype.frameCallback=function(id,result){var _base;if(typeof(_base=this.callbacks)[id]==="function"){_base[id](result)}delete this.callbacks[id];return true};RPC.prototype.frameReady=function(){var callbacks,cb,_i,_len;this.readyStatus=true;callbacks=this.readyQueue.slice(0);for(_i=0,_len=callbacks.length;_i<_len;_i++){cb=callbacks[_i];cb()}return false};RPC.prototype.isAlive=function(){return true};RPC.prototype.sendMessage=function(method,args){var err,id,message,_ref;if(args==null){args=[]}id=++this.rpcID;if(typeof args[args.length-1]==="function"){this.callbacks[id]=args.pop()}message=JSON.stringify({method:method,args:args,id:id});if(((_ref=this.target)!=null?_ref.postMessage:void 0)==null){err=new Error("Unable to communicate with Checkout. Please contact support@stripe.com if the problem persists.");if(this.methods.rpcError!=null){this.methods.rpcError(err)}else{throw err}return}this.target.postMessage(message,"*");return tracker.trace.rpcPostMessage(method,args,id)};RPC.prototype.processMessage=function(data){var method,result,_base,_name;try{data=JSON.parse(data)}catch(_error){return}if(["frameReady","frameCallback","isAlive"].indexOf(data.method)!==-1){result=null;method=this[data.method];if(method!=null){result=method.apply(this,data.args)}}else{result=typeof(_base=this.methods)[_name=data.method]==="function"?_base[_name].apply(_base,data.args):void 0}if(data.method!=="frameCallback"){return this.invoke("frameCallback",data.id,result)}};return RPC}();module.exports=RPC}).call(this)}});StripeCheckout.require.define({"lib/uuid":function(exports,require,module){(function(){var S4;S4=function(){return((1+Math.random())*65536|0).toString(16).substring(1)};module.exports.generate=function(){var delim;delim="-";return S4()+S4()+delim+S4()+delim+S4()+delim+S4()+delim+S4()+S4()+S4()}}).call(this)}});StripeCheckout.require.define({"lib/pixel":function(exports,require,module){(function(){var canTrack,encode,generateID,getCookie,getCookieID,getLocalStorageID,request,setCookie,track;generateID=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(c){var r,v;r=Math.random()*16|0;v=c==="x"?r:r&3|8;return v.toString(16)})};setCookie=function(name,value,options){var cookie,expires;if(options==null){options={}}if(options.expires===true){options.expires=-1}if(typeof options.expires==="number"){expires=new Date;expires.setTime(expires.getTime()+options.expires*24*60*60*1e3);options.expires=expires}if(options.path==null){options.path="/"}value=(value+"").replace(/[^!#-+\--:<-\[\]-~]/g,encodeURIComponent);cookie=encodeURIComponent(name)+"="+value;if(options.expires){cookie+=";expires="+options.expires.toGMTString()}if(options.path){cookie+=";path="+options.path}if(options.domain){cookie+=";domain="+options.domain}return document.cookie=cookie};getCookie=function(name){var cookie,cookies,index,key,value,_i,_len;cookies=document.cookie.split("; ");for(_i=0,_len=cookies.length;_i<_len;_i++){cookie=cookies[_i];index=cookie.indexOf("=");key=decodeURIComponent(cookie.substr(0,index));value=decodeURIComponent(cookie.substr(index+1));if(key===name){return value}}return null};encode=function(param){if(typeof param==="string"){return encodeURIComponent(param)}else{return encodeURIComponent(JSON.stringify(param))}};request=function(url,params,callback){var image,k,v;if(params==null){params={}}params.i=(new Date).getTime();params=function(){var _results;_results=[];for(k in params){v=params[k];_results.push(""+k+"="+encode(v))}return _results}().join("&");image=new Image;if(callback){image.onload=callback}image.src=""+url+"?"+params;return true};canTrack=function(){var dnt,_ref;dnt=(_ref=window.navigator.doNotTrack)!=null?_ref.toString().toLowerCase():void 0;switch(dnt){case"1":case"yes":case"true":return false;default:return true}};getLocalStorageID=function(){var err,lsid;if(!canTrack()){return"DNT"}try{lsid=localStorage.getItem("lsid");if(!lsid){lsid=generateID();localStorage.setItem("lsid",lsid)}return lsid}catch(_error){err=_error;return"NA"}};getCookieID=function(){var err,id;if(!canTrack()){return"DNT"}try{id=getCookie("cid")||generateID();setCookie("cid",id,{expires:360*20,domain:".stripe.com"});return id}catch(_error){err=_error;return"NA"}};track=function(event,params,callback){var k,referrer,request_params,search,v;if(params==null){params={}}referrer=document.referrer;search=window.location.search;request_params={event:event,rf:referrer,sc:search};for(k in params){v=params[k];request_params[k]=v}request_params.lsid||(request_params.lsid=getLocalStorageID());request_params.cid||(request_params.cid=getCookieID());return request("https://q.stripe.com",request_params,callback)};module.exports.track=track;module.exports.getLocalStorageID=getLocalStorageID;module.exports.getCookieID=getCookieID}).call(this)}});StripeCheckout.require.define({"vendor/base64":function(exports,require,module){var utf8Encode=function(string){string=(string+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n");var utftext="",start,end;var stringl=0,n;start=end=0;stringl=string.length;for(n=0;n127&&c1<2048){enc=String.fromCharCode(c1>>6|192,c1&63|128)}else{enc=String.fromCharCode(c1>>12|224,c1>>6&63|128,c1&63|128)}if(enc!==null){if(end>start){utftext+=string.substring(start,end)}utftext+=enc;start=end=n+1}}if(end>start){utftext+=string.substring(start,string.length)}return utftext};module.exports.encode=function(data){var b64="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";var o1,o2,o3,h1,h2,h3,h4,bits,i=0,ac=0,enc="",tmp_arr=[];if(!data){return data}data=utf8Encode(data);do{o1=data.charCodeAt(i++);o2=data.charCodeAt(i++);o3=data.charCodeAt(i++);bits=o1<<16|o2<<8|o3;h1=bits>>18&63;h2=bits>>12&63;h3=bits>>6&63;h4=bits&63;tmp_arr[ac++]=b64.charAt(h1)+b64.charAt(h2)+b64.charAt(h3)+b64.charAt(h4)}while(i0){throw new Error("Missing required data ("+missingKeys.join(", ")+") for tracking "+eventName+".")}parameters.distinct_id=config.distinctId;if(options.appendStateParameters==null){options.appendStateParameters=true}if(options.appendStateParameters){for(k in stateParameters){v=stateParameters[k];parameters[k]=v}}parameters.h=screen.height;parameters.w=screen.width;for(v=_i=0,_len=parameters.length;_i<_len;v=++_i){k=parameters[v];if(v instanceof Array){v.sort()}}fullEventName=""+config.eventNamePrefix+eventName;if(!options.excludeMixpanel){mixpanel.track(fullEventName,parameters)}return pixel.track(fullEventName,parameters)};mixpanel={};mixpanel.track=function(eventName,options){var dataStr,properties;if(options==null){options={}}if(!(typeof $!=="undefined"&&$!==null&&config.mixpanelKey!=null)){return}properties=$.extend({token:config.mixpanelKey,userAgent:window.navigator.userAgent},options);delete properties["stripe_token"];dataStr=base64.encode(JSON.stringify({event:eventName,properties:properties}));return(new Image).src="https://api.mixpanel.com/track/?ip=1&img=1&data="+dataStr};traceSerialize=function(value){var k,obj,v;if(value instanceof Array){return JSON.stringify(function(){var _i,_len,_results;_results=[];for(_i=0,_len=value.length;_i<_len;_i++){v=value[_i];_results.push(traceSerialize(v))}return _results}())}else if(value!=null&&value.target!=null&&value.type!=null){return traceSerialize({type:value.type,target_id:value.target.id})}else if(value instanceof Object){if(value.constructor===Object){obj={};for(k in value){v=value[k];obj[k]=traceSerialize(v)}return JSON.stringify(obj)}else{return value.toString()}}else{return value}};module.exports=tracker}).call(this)}});StripeCheckout.require.define({"outer/lib/fallbackRpc":function(exports,require,module){(function(){var FallbackRPC,cacheBust,interval,lastHash,re,__bind=function(fn,me){return function(){return fn.apply(me,arguments)}};cacheBust=1;interval=null;lastHash=null;re=/^#?\d+&/;FallbackRPC=function(){function FallbackRPC(target,host){this.invokeTarget=__bind(this.invokeTarget,this);this.target=target;this.host=host}FallbackRPC.prototype.invokeTarget=function(message){var url;message=+new Date+cacheBust++ +"&"+encodeURIComponent(message);url=this.host+"";return this.target.location=url.replace(/#.*$/,"")+"#"+message};FallbackRPC.prototype.receiveMessage=function(callback,delay){if(delay==null){delay=100}interval&&clearInterval(interval);return interval=setInterval(function(){var hash;hash=decodeURIComponent(window.location.hash);if(hash!==lastHash&&re.test(hash)){window.location.hash="";lastHash=hash;return callback({data:hash.replace(re,"")})}},delay)};return FallbackRPC}();module.exports=FallbackRPC}).call(this)}});StripeCheckout.require.define({"outer/lib/utils":function(exports,require,module){(function(){var $,$$,addClass,append,css,hasAttr,hasClass,insertAfter,insertBefore,parents,remove,resolve,text,trigger,__indexOf=[].indexOf||function(item){for(var i=0,l=this.length;i=0};css=function(element,css){return element.style.cssText+=";"+css};insertBefore=function(element,child){return element.parentNode.insertBefore(child,element)};insertAfter=function(element,child){return element.parentNode.insertBefore(child,element.nextSibling)};append=function(element,child){return element.appendChild(child)};remove=function(element){var _ref;return(_ref=element.parentNode)!=null?_ref.removeChild(element):void 0};parents=function(node){var ancestors;ancestors=[];while((node=node.parentNode)&&node!==document&&__indexOf.call(ancestors,node)<0){ancestors.push(node)}return ancestors};resolve=function(url){var parser;parser=document.createElement("a");parser.href=url;return""+parser.href};text=function(element,value){if("innerText"in element){element.innerText=value}else{element.textContent=value}return value};module.exports={$:$,$$:$$,hasAttr:hasAttr,trigger:trigger,addClass:addClass,hasClass:hasClass,css:css,insertBefore:insertBefore,insertAfter:insertAfter,append:append,remove:remove,parents:parents,resolve:resolve,text:text}}).call(this)}});StripeCheckout.require.define({"outer/controllers/app":function(exports,require,module){(function(){var App,Checkout,RPC,TokenCallback,tracker,utils,__bind=function(fn,me){return function(){return fn.apply(me,arguments)}};Checkout=require("outer/controllers/checkout");TokenCallback=require("outer/controllers/tokenCallback");RPC=require("lib/rpc");tracker=require("lib/tracker");utils=require("outer/lib/utils");App=function(){function App(options){var _ref,_ref1;if(options==null){options={}}this.setHost=__bind(this.setHost,this);this.configure=__bind(this.configure,this);this.close=__bind(this.close,this);this.open=__bind(this.open,this);this.configurations={};this.checkouts={};this.host="https://checkout.stripe.com";this.timeLoaded=Math.floor((new Date).getTime()/1e3);this.totalButtons=0;if(((_ref=window.Prototype)!=null?(_ref1=_ref.Version)!=null?_ref1.indexOf("1.6"):void 0:void 0)===0){console.error("Stripe Checkout is not compatible with your version of Prototype.js. Please upgrade to version 1.7 or greater.")}}App.prototype.open=function(options,buttonId){var checkout,k,mergedOptions,v,_ref;if(buttonId==null){buttonId=null}mergedOptions={referrer:document.referrer,url:document.URL,timeLoaded:this.timeLoaded};if(buttonId&&this.configurations[buttonId]){_ref=this.configurations[buttonId];for(k in _ref){v=_ref[k];mergedOptions[k]=v}}for(k in options){v=options[k];mergedOptions[k]=v}if(mergedOptions.image){mergedOptions.image=utils.resolve(mergedOptions.image)}this.validateOptions(options,"open");if(buttonId){checkout=this.checkouts[buttonId]}else{checkout=new Checkout(new TokenCallback(options),this.host)}this.trackOpen(checkout,mergedOptions);return checkout.open(mergedOptions)};App.prototype.close=function(buttonId){var _ref;return(_ref=this.checkouts[buttonId])!=null?_ref.close():void 0};App.prototype.configure=function(buttonId,options){if(options==null){options={}}if(buttonId instanceof Object){options=buttonId;buttonId="button"+this.totalButtons++}if(options.image){options.image=utils.resolve(options.image)}this.validateOptions(options,"configure");this.configurations[buttonId]=options;this.checkouts[buttonId]=new Checkout(new TokenCallback(options),this.host);this.checkouts[buttonId].preload(options);return{open:function(_this){return function(options){return _this.open(options,buttonId)}}(this),close:function(_this){return function(){return _this.close(buttonId)}}(this)}};App.prototype.validateOptions=function(options,which){var url;try{return JSON.stringify(options)}catch(_error){url="https://stripe.com/docs/checkout#integration-custom";throw new Error("Stripe Checkout was unable to serialize the options passed to StripeCheckout."+which+"(). Please consult the doumentation to confirm that you're supplying values of the expected type: "+url)}};App.prototype.setHost=function(host){return this.host=host};App.prototype.trackOpen=function(checkout,options){tracker.setEnabled(!options.notrack);return tracker.track.outerOpen({key:options.key,lsid:"NA",cid:"NA"})};return App}();module.exports=App}).call(this)}});StripeCheckout.require.define({"outer/controllers/button":function(exports,require,module){(function(){var $$,Button,addClass,append,hasAttr,hasClass,helpers,insertAfter,parents,text,trigger,_ref,__bind=function(fn,me){return function(){return fn.apply(me,arguments)}};_ref=require("outer/lib/utils"),$$=_ref.$$,hasClass=_ref.hasClass,addClass=_ref.addClass,trigger=_ref.trigger,append=_ref.append,text=_ref.text,parents=_ref.parents,insertAfter=_ref.insertAfter,hasAttr=_ref.hasAttr;helpers=require("lib/helpers");Button=function(){Button.totalButtonId=0;Button.load=function(app){var button,el,element;element=$$("stripe-button");element=function(){var _i,_len,_results;_results=[];for(_i=0,_len=element.length;_i<_len;_i++){el=element[_i];if(!hasClass(el,"active")){_results.push(el)}}return _results}();element=element[element.length-1];if(!element){return}addClass(element,"active");button=new Button(element,app);return button.append()};function Button(scriptEl,app){this.parseOptions=__bind(this.parseOptions,this);this.parentHead=__bind(this.parentHead,this);this.parentForm=__bind(this.parentForm,this);this.onToken=__bind(this.onToken,this);this.open=__bind(this.open,this);this.submit=__bind(this.submit,this);this.append=__bind(this.append,this);this.render=__bind(this.render,this);var _base;this.scriptEl=scriptEl;this.app=app;this.document=this.scriptEl.ownerDocument;this.nostyle=helpers.isFallback();this.options=this.parseOptions();(_base=this.options).label||(_base.label="Pay with Card");this.options.token=this.onToken;this.$el=document.createElement("button");this.$el.setAttribute("type","submit");this.$el.className="stripe-button-el";helpers.bind(this.$el,"click",this.submit);helpers.bind(this.$el,"touchstart",function(){});this.render()}Button.prototype.render=function(){this.$el.innerHTML="";this.$span=document.createElement("span");text(this.$span,this.options.label);if(!this.nostyle){this.$el.style.visibility="hidden";this.$span.style.display="block";this.$span.style.minHeight="30px"}this.$style=document.createElement("link");this.$style.setAttribute("type","text/css");this.$style.setAttribute("rel","stylesheet");this.$style.setAttribute("href",this.app.host+"/v3/checkout/button-qpwW2WfkB0oGWVWIASjIOQ.css");return append(this.$el,this.$span)};Button.prototype.append=function(){var head;if(this.scriptEl){insertAfter(this.scriptEl,this.$el)}if(!this.nostyle){head=this.parentHead();if(head){append(head,this.$style)}}if(this.$form=this.parentForm()){helpers.unbind(this.$form,"submit",this.submit);helpers.bind(this.$form,"submit",this.submit)}if(!this.nostyle){setTimeout(function(_this){return function(){return _this.$el.style.visibility="visible"}}(this),1e3)}this.app.setHost(helpers.host(this.scriptEl.src));return this.appHandler=this.app.configure(this.options,{form:this.$form})};Button.prototype.disable=function(){return this.$el.setAttribute("disabled",true)};Button.prototype.enable=function(){return this.$el.removeAttribute("disabled")};Button.prototype.isDisabled=function(){return hasAttr(this.$el,"disabled")};Button.prototype.submit=function(e){if(typeof e.preventDefault==="function"){e.preventDefault()}if(!this.isDisabled()){this.open()}return false};Button.prototype.open=function(){return this.appHandler.open(this.options)};Button.prototype.onToken=function(token,args){var $input,$tokenInput,$tokenTypeInput,key,value;trigger(this.scriptEl,"token",token);if(this.$form){$tokenInput=this.renderInput("stripeToken",token.id);append(this.$form,$tokenInput);$tokenTypeInput=this.renderInput("stripeTokenType",token.type);append(this.$form,$tokenTypeInput);if(token.email){append(this.$form,this.renderInput("stripeEmail",token.email))}if(args){for(key in args){value=args[key];$input=this.renderInput(this.formatKey(key),value);append(this.$form,$input)}}this.$form.submit()}return this.disable()};Button.prototype.formatKey=function(key){var arg,args,_i,_len;args=key.split("_");key="";for(_i=0,_len=args.length;_i<_len;_i++){arg=args[_i];if(arg.length>0){key=key+arg.substr(0,1).toUpperCase()+arg.substr(1).toLowerCase()}}return"stripe"+key};Button.prototype.renderInput=function(name,value){var input;input=document.createElement("input");input.type="hidden";input.name=name;input.value=value;return input};Button.prototype.parentForm=function(){var el,elements,_i,_len,_ref1;elements=parents(this.$el);for(_i=0,_len=elements.length;_i<_len;_i++){el=elements[_i];if(((_ref1=el.tagName)!=null?_ref1.toLowerCase():void 0)==="form"){return el}}return null};Button.prototype.parentHead=function(){var _ref1,_ref2;return((_ref1=this.document)!=null?_ref1.head:void 0)||((_ref2=this.document)!=null?_ref2.getElementsByTagName("head")[0]:void 0)||this.document.body};Button.prototype.parseOptions=function(){var attr,match,options,_i,_len,_ref1;options={};_ref1=this.scriptEl.attributes;for(_i=0,_len=_ref1.length;_i<_len;_i++){attr=_ref1[_i];match=attr.name.match(/^data-(.+)$/);if(match!=null?match[1]:void 0){options[match[1]]=attr.value}}return options};return Button}();module.exports=Button}).call(this)}});StripeCheckout.require.define({"outer/controllers/checkout":function(exports,require,module){(function(){var Checkout,FallbackView,IframeView,TabView,helpers,tracker,__bind=function(fn,me){return function(){return fn.apply(me,arguments)}};helpers=require("lib/helpers");IframeView=require("outer/views/iframeView");TabView=require("outer/views/tabView");FallbackView=require("outer/views/fallbackView");tracker=require("lib/tracker");Checkout=function(){Checkout.activeView=null;function Checkout(tokenCallback,host){this.onTokenCallback=__bind(this.onTokenCallback,this);this.preload=__bind(this.preload,this);this.open=__bind(this.open,this);var path,shouldPopup,viewClass;this.tokenCallback=tokenCallback;this.host=host;this.onToken=function(_this){return function(data){return tokenCallback.trigger(data.token,data.args,_this.onTokenCallback)}}(this);if(helpers.isFallback()){viewClass=FallbackView;path="/v3/fallback/k2cOG4aMoRCi4ihFwg.html"}else{path="/v3/JOxxtiCiYdXIToC8is2w.html";if(Math.random()<.5){path="/v3/var-7kWUNyrVt1xEYx3R74jxg.html"}shouldPopup=helpers.isSupportedMobileOS()&&!(helpers.isNativeWebContainer()||helpers.isAndroidWebapp()||helpers.isiOSWebView()||helpers.isiOSChrome()&&!helpers.isUserGesture()||helpers.isiOSBroken());if(shouldPopup){viewClass=TabView}else{viewClass=IframeView}}path=""+path+"?distinct_id="+tracker.getDistinctID();this.view=new viewClass(this.onToken,this.host,path)}Checkout.prototype.open=function(options){if(options==null){options={}}if(Checkout.activeView&&Checkout.activeView!==this.view){Checkout.activeView.close()}Checkout.activeView=this.view;options.supportsTokenCallback=this.tokenCallback.supportsTokenCallback();return this.view.open(options,function(_this){return function(status){if(status){return}if(!(_this.view instanceof TabView)){return}_this.view=new IframeView(_this.onToken,_this.host,"/v3/JOxxtiCiYdXIToC8is2w.html");return _this.open(options)}}(this))};Checkout.prototype.close=function(){var _ref;return(_ref=this.view)!=null?_ref.close():void 0};Checkout.prototype.preload=function(options){return this.view.preload(options)};Checkout.prototype.onTokenCallback=function(){return this.view.triggerTokenCallback.apply(this.view,arguments)};return Checkout}();module.exports=Checkout}).call(this)}});StripeCheckout.require.define({"outer/controllers/tokenCallback":function(exports,require,module){(function(){var TokenCallback,__bind=function(fn,me){return function(){return fn.apply(me,arguments)}};TokenCallback=function(){function TokenCallback(options){this.supportsTokenCallback=__bind(this.supportsTokenCallback,this);this.trigger=__bind(this.trigger,this);if(options.token){this.fn=options.token;this.version=1}else if(options.onToken){this.fn=options.onToken;this.version=2}}TokenCallback.prototype.trigger=function(token,addresses,callback){var data,k,shipping,v;if(this.version===2){data={token:token};shipping=null;for(k in addresses){v=addresses[k];if(/^shipping_/.test(k)){if(shipping==null){shipping={}}shipping[k.replace(/^shipping_/,"")]=v}}if(shipping!=null){data.shipping=shipping}return this.fn(data,callback)}else{return this.fn(token,addresses)}};TokenCallback.prototype.supportsTokenCallback=function(){return this.version>1};return TokenCallback}();module.exports=TokenCallback}).call(this)}});StripeCheckout.require.define({"outer/views/fallbackView":function(exports,require,module){(function(){var FallbackRPC,FallbackView,View,__bind=function(fn,me){return function(){return fn.apply(me,arguments)}},__hasProp={}.hasOwnProperty,__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};FallbackRPC=require("outer/lib/fallbackRpc");View=require("outer/views/view");FallbackView=function(_super){__extends(FallbackView,_super);function FallbackView(){this.triggerTokenCallback=__bind(this.triggerTokenCallback,this);this.close=__bind(this.close,this);this.open=__bind(this.open,this);FallbackView.__super__.constructor.apply(this,arguments)}FallbackView.prototype.open=function(options,callback){var message,url;FallbackView.__super__.open.apply(this,arguments);url=this.host+this.path;this.frame=window.open(url,"stripe_checkout_app","width=400,height=400,location=yes,resizable=yes,scrollbars=yes");if(this.frame==null){alert("Disable your popup blocker to proceed with checkout.");url="https://stripe.com/docs/checkout#integration-more-runloop";throw new Error("To learn how to prevent the Stripe Checkout popup from being blocked, please visit "+url)}this.rpc=new FallbackRPC(this.frame,url);this.rpc.receiveMessage(function(_this){return function(e){var data;try{data=JSON.parse(e.data)}catch(_error){return}return _this.onToken(data)}}(this));message=JSON.stringify(this.options);this.rpc.invokeTarget(message);return callback(true)};FallbackView.prototype.close=function(){var _ref;return(_ref=this.frame)!=null?_ref.close():void 0};FallbackView.prototype.triggerTokenCallback=function(err){if(err){return alert(err)}};return FallbackView}(View);module.exports=FallbackView}).call(this)}});StripeCheckout.require.define({"outer/views/iframeView":function(exports,require,module){(function(){var IframeView,RPC,View,helpers,ready,utils,__bind=function(fn,me){return function(){return fn.apply(me,arguments)}},__hasProp={}.hasOwnProperty,__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};utils=require("outer/lib/utils");helpers=require("lib/helpers");RPC=require("lib/rpc");View=require("outer/views/view");ready=require("vendor/ready");IframeView=function(_super){__extends(IframeView,_super);function IframeView(){this.configure=__bind(this.configure,this);this.removeFrame=__bind(this.removeFrame,this);this.removeTouchOverlay=__bind(this.removeTouchOverlay,this);this.showTouchOverlay=__bind(this.showTouchOverlay,this);this.attachIframe=__bind(this.attachIframe,this);this.setToken=__bind(this.setToken,this);this.closed=__bind(this.closed,this);this.close=__bind(this.close,this);this.preload=__bind(this.preload,this);this.open=__bind(this.open,this);return IframeView.__super__.constructor.apply(this,arguments)}IframeView.prototype.open=function(options,callback){IframeView.__super__.open.apply(this,arguments);return ready(function(_this){return function(){var left,loaded,_ref;_this.originalOverflowValue=document.body.style.overflow;if(_this.frame==null){_this.configure()}if(typeof $!=="undefined"&&$!==null?(_ref=$.fn)!=null?_ref.modal:void 0:void 0){$(document).off("focusin.bs.modal").off("focusin.modal")}_this.frame.style.display="block";if(_this.shouldShowTouchOverlay()){_this.showTouchOverlay();_this.frame.style.top=(window.scrollY||window.pageYOffset)+"px";left=(window.scrollX||window.pageXOffset)+(window.innerWidth-_this.iframeWidth())/2;left=Math.min(window.innerWidth-_this.iframeWidth(),Math.max(0,left));left=Math.max(0,left);_this.frame.style.left=left+"px"}loaded=false;setTimeout(function(){if(loaded){return}loaded=true;callback(false);return _this.removeFrame()},8e3);return _this.rpc.ready(function(){if(loaded){return}loaded=true;callback(true);_this.rpc.invoke("render","","iframe",_this.options);document.body.style.overflow="hidden";return _this.rpc.invoke("open",{timeLoaded:_this.options.timeLoaded},function(success){var _base;if(success){return typeof(_base=_this.options).opened==="function"?_base.opened():void 0}})})}}(this))};IframeView.prototype.preload=function(options){return ready(function(_this){return function(){_this.configure();return _this.rpc.invoke("preload",options)}}(this))};IframeView.prototype.iframeWidth=function(){if(helpers.isSmallScreen()){return 328}else{return 380}};IframeView.prototype.close=function(){return this.rpc.invoke("close")};IframeView.prototype.closed=function(){var _base;document.body.style.overflow=this.originalOverflowValue;this.removeFrame();clearTimeout(this.tokenTimeout);if(this.token!=null){this.onToken(this.token)}this.token=null;if(typeof(_base=this.options).closed==="function"){_base.closed()}this.preload(this.options);return true};IframeView.prototype.setToken=function(data){this.token=data;return this.tokenTimeout!=null?this.tokenTimeout:this.tokenTimeout=setTimeout(function(_this){return function(){_this.onToken(_this.token);_this.tokenTimeout=null;return _this.token=null}}(this),3e3)};IframeView.prototype.attachIframe=function(){var cssText,iframe;iframe=document.createElement("iframe");iframe.setAttribute("frameBorder","0");iframe.setAttribute("allowtransparency","true");cssText="z-index: 9999;\ndisplay: none;\nbackground: transparent;\nbackground: rgba(0,0,0,0.005);\nborder: 0px none transparent;\noverflow-x: hidden;\noverflow-y: auto;\nvisibility: hidden;\nmargin: 0;\npadding: 0;\n-webkit-tap-highlight-color: transparent;\n-webkit-touch-callout: none;";if(this.shouldShowTouchOverlay()){cssText+="position: absolute;\nwidth: "+this.iframeWidth()+"px;\nheight: 100%;"}else{cssText+="position: fixed;\nleft: 0;\ntop: 0;\nwidth: 100%;\nheight: 100%;"}iframe.style.cssText=cssText;helpers.bind(iframe,"load",function(){return iframe.style.visibility="visible"});iframe.src=this.host+this.path;iframe.className=iframe.name="stripe_checkout_app";utils.append(document.body,iframe);return iframe};IframeView.prototype.showTouchOverlay=function(){var toRepaint;if(this.overlay){return}this.overlay=document.createElement("div");this.overlay.style.cssText="z-index: 9998;\nbackground: #000;\nopacity: 0;\nborder: 0px none transparent;\noverflow: none;\nmargin: 0;\npadding: 0;\n-webkit-tap-highlight-color: transparent;\n-webkit-touch-callout: none;\nposition: fixed;\nleft: 0;\ntop: 0;\nwidth: 200%;\nheight: 200%;\ntransition: opacity 320ms ease;\n-webkit-transition: opacity 320ms ease;\n-moz-transition: opacity 320ms ease;\n-ms-transition: opacity 320ms ease;";utils.append(document.body,this.overlay);toRepaint=this.overlay.offsetHeight;return this.overlay.style.opacity="0.5"};IframeView.prototype.removeTouchOverlay=function(){var overlay;if(!this.overlay){return}overlay=this.overlay;overlay.style.opacity="0";setTimeout(function(){return utils.remove(overlay)},400);return this.overlay=null};IframeView.prototype.removeFrame=function(){var frame;if(this.shouldShowTouchOverlay()){this.removeTouchOverlay()}frame=this.frame;setTimeout(function(){return utils.remove(frame)},500);return this.frame=null};IframeView.prototype.configure=function(){if(this.frame!=null){this.removeFrame()}this.frame=this.attachIframe();this.rpc=new RPC(this.frame.contentWindow,{host:this.host});this.rpc.methods.closed=this.closed;return this.rpc.methods.setToken=this.setToken};IframeView.prototype.shouldShowTouchOverlay=function(){return helpers.isSupportedMobileOS()};return IframeView}(View);module.exports=IframeView}).call(this)}});StripeCheckout.require.define({"outer/views/tabView":function(exports,require,module){(function(){var RPC,TabView,View,helpers,__bind=function(fn,me){return function(){return fn.apply(me,arguments)}},__hasProp={}.hasOwnProperty,__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};RPC=require("lib/rpc");helpers=require("lib/helpers");View=require("outer/views/view");TabView=function(_super){__extends(TabView,_super);function TabView(){this.closed=__bind(this.closed,this);this.checkForClosedTab=__bind(this.checkForClosedTab,this);this.setToken=__bind(this.setToken,this);this.fullPath=__bind(this.fullPath,this);this.close=__bind(this.close,this);this.open=__bind(this.open,this);TabView.__super__.constructor.apply(this,arguments);this.closedTabInterval=null;this.color=null;this.colorSet=false}TabView.prototype.open=function(options,callback){var targetName,url,_base,_ref,_ref1;TabView.__super__.open.apply(this,arguments);try{if((_ref=this.frame)!=null){_ref.close()}}catch(_error){}if(window.name==="stripe_checkout_tabview"){window.name=""}if(helpers.isiOSChrome()){targetName="_blank"}else{targetName="stripe_checkout_tabview"}this.frame=window.open(this.fullPath(),targetName);if(!this.frame&&((_ref1=this.options.key)!=null?_ref1.indexOf("test"):void 0)!==-1){url="https://stripe.com/docs/checkout#integration-more-runloop";console.error("Stripe Checkout was unable to open a new window, possibly due to a popup blocker.\nTo provide the best experience for your users, follow the guide at "+url+".\nThis message will only appear when using a test publishable key.")}if(!this.frame||this.frame===window){this.close();callback(false);return}if(typeof(_base=this.frame).focus==="function"){_base.focus()}this.rpc=new RPC(this.frame,{host:this.host});this.rpc.methods.setToken=this.setToken;this.rpc.methods.closed=this.closed;return this.rpc.ready(function(_this){return function(){var _base1;callback(true);_this.rpc.invoke("render","","tab",_this.options);_this.rpc.invoke("open");if(typeof(_base1=_this.options).opened==="function"){_base1.opened()}return _this.checkForClosedTab()}}(this))};TabView.prototype.close=function(){if(this.frame&&this.frame!==window){return this.frame.close()}};TabView.prototype.fullPath=function(){return this.host+this.path};TabView.prototype.setToken=function(data){this.token=data;return this.tokenTimeout!=null?this.tokenTimeout:this.tokenTimeout=setTimeout(function(_this){return function(){_this.onToken(_this.token);_this.tokenTimeout=null;return _this.token=null}}(this),3e3)};TabView.prototype.checkForClosedTab=function(){if(this.closedTabInterval){clearInterval(this.closedTabInterval)}return this.closedTabInterval=setInterval(function(_this){return function(){if(!_this.frame||!_this.frame.postMessage||_this.frame.closed){return _this.closed()}}}(this),100)};TabView.prototype.closed=function(){var _base;clearInterval(this.closedTabInterval);clearTimeout(this.tokenTimeout);if(this.token!=null){this.onToken(this.token)}return typeof(_base=this.options).closed==="function"?_base.closed():void 0};return TabView}(View);module.exports=TabView}).call(this)}});StripeCheckout.require.define({"outer/views/view":function(exports,require,module){(function(){var View,__bind=function(fn,me){return function(){return fn.apply(me,arguments)}},__slice=[].slice;View=function(){function View(onToken,host,path){this.triggerTokenCallback=__bind(this.triggerTokenCallback,this);this.open=__bind(this.open,this);this.onToken=onToken;this.host=host;this.path=path}View.prototype.open=function(options,callback){return this.options=options};View.prototype.close=function(){};View.prototype.preload=function(options){};View.prototype.triggerTokenCallback=function(){var args;args=arguments;return this.rpc.ready(function(_this){return function(){var _ref;return(_ref=_this.rpc).invoke.apply(_ref,["tokenCallback"].concat(__slice.call(args)))}}(this))};return View}();module.exports=View}).call(this)}});(function(){var App,Button,app,require,_ref,_ref1;require=require||this.StripeCheckout.require;Button=require("outer/controllers/button");App=require("outer/controllers/app");if(((_ref=this.StripeCheckout)!=null?_ref.__app:void 0)==null){this.StripeCheckout||(this.StripeCheckout={});this.StripeCheckout.__app=app=new App;this.StripeCheckout.open=app.open;this.StripeCheckout.configure=app.configure;this.StripeButton=this.StripeCheckout;if(((_ref1=this.StripeCheckout)!=null?_ref1.__host:void 0)&&this.StripeCheckout.__host!==""){app.setHost(this.StripeCheckout.__host)}}Button.load(this.StripeCheckout.__app)}).call(this); //# sourceMappingURL=https://sourcemaps.stripe.com/checkout/checkout.js.map