// Brunch automatically concatenates all files in your
// watched paths. Those paths can be configured at
// config.paths.watched in "brunch-config.js".
//
// However, those files will only be executed if
// explicitly imported. The only exception are files
// in vendor, which are never wrapped in imports and
// therefore are always executed.

// Import dependencies
//
// If you no longer want to use a dependency, remember
// to also remove its path from "config.paths.watched".
import "phoenix_html"

// Import local files
//
// Local files can be imported directly using relative
// paths "./socket" or full ones "web/static/js/socket".

// import socket from "./socket"
//

$('#choose-existing .form-group').hide();
$('#choose-existing .form-error').hide();
$('#create-new .form-group').hide();
$('#create-new .form-error').hide();

$('#choose-existing a').on('click', function() {
  $(this).toggleClass('active');
  $('#create-new a').removeClass('active');
  $('#choose-existing .form-group').toggle();
  $('#choose-existing .form-error').toggle();
  $('#create-new .form-group').hide();
  $('#create-new .form-error').hide();
});

$('#create-new a').on('click', function() {
  $(this).toggleClass('active');
  $('#choose-existing a').removeClass('active');
  $('#create-new .form-group').toggle();
  $('#create-new .form-error').toggle();
  $('#choose-existing .form-group').hide();
  $('#choose-existing .form-error').hide();
});

@@ -1,683 +1,452 @@
-// Brunch automatically concatenates all files in your%0A// watched paths. Those paths can be configured at%0A// config.paths.watched in %22brunch-config.js%22.%0A//%0A// However, those files will only be executed if%0A// explicitly imported. The only exception are files%0A// in vendor
+import %22phoenix_html%22%0A%0Avar chooseExistingId = '#choose-existing';%0Avar createNewId = '#create-new';%0A%0Afunction toggleVisibleFormGroup(visibleId
 , 
-w
 hi
-ch are never wrapped in imports and%0A// therefore are always executed.%0A%0A// Import dependencies%0A//%0A// If you no longer want to use a dependency, remember%0A// to also remove its path from %22config.paths.watched%22.%0Aimport %22phoenix_html%22%0A%0A// Import local files%0A//%0A// Local files can be imported directly using relative%0A// paths %22./socket%22 or full ones %22web/static/js/socket%22.%0A%0A// import socket from %22./socket%22%0A//
+ddenId) %7B%0A  if (!$(this).hasClass('active')) %7B%0A    $(this).toggleClass('active');%0A    $(hiddenId + ' a').removeClass('active');%0A    $(visibleId + ' .form-group').toggle();%0A    $(visibleId + ' .form-error').toggle();%0A    $(hiddenId + ' .form-group').hide();%0A    $(hiddenId + ' .form-error').hide();%0A  %7D%0A%7D
 %0A%0A$(
@@ -649,32 +649,37 @@
 ction() %7B%0A  
+if (!
 $(this).
 toggleClass(
@@ -658,38 +658,35 @@
 %0A  if (!$(this).
-toggle
+has
 Class('active');
@@ -688,223 +688,109 @@
 ve')
-;%0A
+) %7B%0A 
   
+ 
 $(
-'#create-new a').removeClass('active');%0A  $('#choose-existing .form-g
+this).toggleClass('active');%0A    toggleVisibleFormG
 roup
-').toggle();%0A  $('#
+(
 choose
--e
+E
 xisting
- .form-error').toggle();%0A  $('#create-new .form-group').hide();%0A  $('#create-new .form-error').hide();
+Id, createNewId);%0A  %7D
 %0A%7D);
@@ -837,24 +837,29 @@
 n() %7B%0A  
+if (!
 $(this).
 toggleCl
@@ -842,38 +842,35 @@
 %0A  if (!$(this).
-toggle
+has
 Class('active');
@@ -872,41 +872,29 @@
 ve')
-;%0A
+) %7B%0A 
   
+ 
 $(
-'#choose-existing a').remov
+this).toggl
 eCla
@@ -913,176 +913,71 @@
 ;%0A  
-$('#create-new .form-g
+  toggleVisibleFormG
 roup
-').toggle();%0A  $('#create-new .form-error').toggle();%0A  $('#
+(createNewId, 
 choose
--e
+E
 xisting
- .form-group').hide();%0A  $('#choose-existing .form-error').hide();
+Id);%0A  %7D
 %0A%7D);%0A
+%0A%0A

clean up js