diff --git a/app/views/form.server.view.html b/app/views/form.server.view.html index 2ff4952c..0ca15feb 100644 --- a/app/views/form.server.view.html +++ b/app/views/form.server.view.html @@ -106,9 +106,10 @@ + - + {% for jsFile in formJSFiles %} diff --git a/bower.json b/bower.json index 8838115d..26d1b6e0 100755 --- a/bower.json +++ b/bower.json @@ -50,7 +50,8 @@ "angular-ui-select": "compiled", "jspdf": "~1.0.178", "angular-sanitize": "1.4.14", - "angular-ui-sortable": "^0.17.1" + "angular-ui-sortable": "^0.17.1", + "angular-ui-date": "~0.0.11" }, "overrides": { "BOWER-PACKAGE": { diff --git a/public/dist/application.js b/public/dist/application.js index 05d8869f..ccb0127c 100644 --- a/public/dist/application.js +++ b/public/dist/application.js @@ -614,7 +614,7 @@ angular.module('TellForm.templates', []).run(['$templateCache', function ($templ " \n" + " \n" + "\n" + - "

{{ 'ADD_FIELD_LG' | translate }}

{{ 'ADD_FIELD_MD' | translate }}

{{ 'ADD_FIELD_SM' | translate }}

{{ 'WELCOME_SCREEN' | translate }}


{{field.title}} *

{{ 'CLICK_FIELDS_FOOTER' | translate }}


{{ 'END_SCREEN' | translate }}

"); + "

{{ 'ADD_FIELD_LG' | translate }}

{{ 'ADD_FIELD_MD' | translate }}

{{ 'ADD_FIELD_SM' | translate }}

{{ 'WELCOME_SCREEN' | translate }}


{{field.title}} *

{{ 'CLICK_FIELDS_FOOTER' | translate }}


{{ 'END_SCREEN' | translate }}

"); $templateCache.put("modules/forms/admin/views/directiveViews/form/edit-submissions-form.client.view.html", "
{{ 'TOTAL_VIEWS' | translate }}
{{ 'RESPONSES' | translate }}
{{ 'COMPLETION_RATE' | translate }}
{{ 'AVERAGE_TIME_TO_COMPLETE' | translate }}
{{myform.analytics.visitors.length}}
{{myform.analytics.submissions}}
{{myform.analytics.conversionRate | number:0}}%
{{ AverageTimeElapsed | secondsToDateTime | date:'mm:ss'}}
{{ 'DESKTOP_AND_LAPTOP' | translate }}
{{ 'TABLETS' | translate }}
{{ 'PHONES' | translate }}
{{ 'OTHER' | translate }}
{{ 'UNIQUE_VISITS' | translate }}
{{DeviceStatistics.desktop.visits}}
{{ 'UNIQUE_VISITS' | translate }}
{{DeviceStatistics.tablet.visits}}
{{ 'UNIQUE_VISITS' | translate }}
{{DeviceStatistics.tablet.visits}}
{{ 'UNIQUE_VISITS' | translate }}
{{DeviceStatistics.other.visits}}
{{ 'RESPONSES' | translate }}
{{DeviceStatistics.desktop.responses}}
{{ 'RESPONSES' | translate }}
{{DeviceStatistics.tablet.responses}}
{{ 'RESPONSES' | translate }}
{{DeviceStatistics.phone.responses}}
{{ 'RESPONSES' | translate }}
{{DeviceStatistics.other.responses}}
{{ 'COMPLETION_RATE' | translate }}
{{DeviceStatistics.desktop.completion}}%
{{ 'COMPLETION_RATE' | translate }}
{{DeviceStatistics.tablet.completion}}%
{{ 'COMPLETION_RATE' | translate }}
{{DeviceStatistics.phone.completion}}%
{{ 'COMPLETION_RATE' | translate }}
{{DeviceStatistics.other.completion}}%
{{ 'AVERAGE_TIME_TO_COMPLETE' | translate }}
{{DeviceStatistics.desktop.average_time | secondsToDateTime | date:'mm:ss'}}
{{ 'AVERAGE_TIME_TO_COMPLETE' | translate }}
{{DeviceStatistics.tablet.average_time | secondsToDateTime | date:'mm:ss'}}
{{ 'AVERAGE_TIME_TO_COMPLETE' | translate }}
{{DeviceStatistics.phone.average_time | secondsToDateTime | date:'mm:ss'}}
{{ 'AVERAGE_TIME_TO_COMPLETE' | translate }}
{{DeviceStatistics.other.average_time | secondsToDateTime | date:'mm:ss'}}
{{ 'FIELD_TITLE' | translate }}
{{ 'FIELD_VIEWS' | translate }}
{{ 'FIELD_RESPONSES' | translate }}
{{ 'FIELD_DROPOFF' | translate }}
{{fieldStats.field.title}}
{{fieldStats.totalViews}}
{{fieldStats.responses}}
{{fieldStats.continueRate}}%

#{{value.title}}{{ 'PERCENTAGE_COMPLETE' | translate }}{{ 'TIME_ELAPSED' | translate }}{{ 'DEVICE' | translate }}{{ 'LOCATION' | translate }}{{ 'IP_ADDRESS' | translate }}{{ 'DATE_SUBMITTED' | translate }} (UTC)
{{$index+1}}{{field.fieldValue}}{{row.percentageComplete}}%{{row.timeElapsed | secondsToDateTime | date:'mm:ss'}}{{row.device.name}}, {{row.device.type}}{{row.geoLocation.City}}, {{row.geoLocation.Country}}{{row.ipAddr}}{{row.created | date:'yyyy-MM-dd HH:mm:ss'}}
"); $templateCache.put("modules/forms/base/views/directiveViews/entryPage/startPage.html", @@ -2781,18 +2781,17 @@ angular.module('forms').directive('editFormDirective', ['$rootScope', 'FormField //Setup UI-Sortable $scope.sortableOptions = { appendTo: '.dropzone', - helper: 'clone', + //helper: 'clone', forceHelperSize: true, forcePlaceholderSize: true, update: function(e, ui) { - console.log(ui); - console.log(e); - console.log($scope.myform.form_fields); + console.log(ui.item.sortable.model); $scope.update(false, $scope.myform, false, false, function(err){ }); }, start: function(e, ui) { - } + console.log(ui) + } }; /* diff --git a/public/dist/application.min.js b/public/dist/application.min.js index 40fcc485..d13eef78 100644 --- a/public/dist/application.min.js +++ b/public/dist/application.min.js @@ -1,5 +1,5 @@ -"use strict";var ApplicationConfiguration=function(){var a="NodeForm",b=["duScroll","ui.select","ngSanitize","vButton","ngResource","TellForm.templates","ui.router","ui.bootstrap","ui.utils","pascalprecht.translate"],c=function(b,c){angular.module(b,c||[]),angular.module(a).requires.push(b)};return{applicationModuleName:a,applicationModuleVendorDependencies:b,registerModule:c}}();angular.module(ApplicationConfiguration.applicationModuleName,ApplicationConfiguration.applicationModuleVendorDependencies),angular.module(ApplicationConfiguration.applicationModuleName).config(["$locationProvider",function(a){a.hashPrefix("!")}]),angular.module(ApplicationConfiguration.applicationModuleName).constant("APP_PERMISSIONS",{viewAdminSettings:"viewAdminSettings",editAdminSettings:"editAdminSettings",editForm:"editForm",viewPrivateForm:"viewPrivateForm"}),angular.module(ApplicationConfiguration.applicationModuleName).constant("USER_ROLES",{admin:"admin",normal:"user",superuser:"superuser"}),angular.module(ApplicationConfiguration.applicationModuleName).constant("FORM_URL","/forms/:formId"),angular.element(document).ready(function(){"#_=_"===window.location.hash&&(window.location.hash="#!"),angular.bootstrap(document,[ApplicationConfiguration.applicationModuleName])}),angular.module("TellForm.templates",[]).run(["$templateCache",function(a){a.put("modules/core/views/header.client.view.html","
"),a.put("modules/forms/admin/views/admin-form.client.view.html",'
{{ \'TELLFORM_URL\' | translate }}
{{ \'COPY_AND_PASTE\' | translate }}
{{ \'BACKGROUND_COLOR\' | translate }}
{{ \'QUESTION_TEXT_COLOR\' | translate }}
{{ \'ANSWER_TEXT_COLOR\' | translate }}
{{ \'BTN_BACKGROUND_COLOR\' | translate }}
{{ \'BTN_TEXT_COLOR\' | translate }}
'),a.put("modules/forms/admin/views/list-forms.client.view.html",'

{{ \'CREATE_A_NEW_FORM\' | translate }}
{{ \'NAME\' | translate }}
{{ \'LANGUAGE\' | translate }}

{{ form.submissions.length }} {{ \'RESPONSES\' | translate }}

{{ \'FORM_PAUSED\' | translate }}
'),a.put("modules/forms/base/views/submit-form.client.view.html","
"),a.put("modules/forms/admin/views/adminTabs/analyze.html",""),a.put("modules/forms/admin/views/adminTabs/configure.html",""),a.put("modules/forms/admin/views/adminTabs/create.html",""),a.put("modules/forms/admin/views/directiveViews/form/configure-form.client.view.html",'
{{ \'FORM_NAME\' | translate }}
{{ \'FORM_STATUS\' | translate }}
{{ \'LANGUAGE\' | translate }}
* {{ \'REQUIRED_FIELD\' | translate }}
{{ \'GA_TRACKING_CODE\' | translate }}
{{ \'DISPLAY_FOOTER\' | translate }}
{{ \'DISPLAY_START_PAGE\' | translate }}
{{ \'DISPLAY_END_PAGE\' | translate }}
'),a.put("modules/forms/admin/views/directiveViews/form/edit-form.client.view.html",'

{{ \'WELCOME_SCREEN\' | translate }}


{{field.title}} *

{{ \'CLICK_FIELDS_FOOTER\' | translate }}


{{ \'END_SCREEN\' | translate }}

'), +"use strict";var ApplicationConfiguration=function(){var a="NodeForm",b=["duScroll","ui.select","ngSanitize","vButton","ngResource","TellForm.templates","ui.router","ui.bootstrap","ui.utils","pascalprecht.translate"],c=function(b,c){angular.module(b,c||[]),angular.module(a).requires.push(b)};return{applicationModuleName:a,applicationModuleVendorDependencies:b,registerModule:c}}();angular.module(ApplicationConfiguration.applicationModuleName,ApplicationConfiguration.applicationModuleVendorDependencies),angular.module(ApplicationConfiguration.applicationModuleName).config(["$locationProvider",function(a){a.hashPrefix("!")}]),angular.module(ApplicationConfiguration.applicationModuleName).constant("APP_PERMISSIONS",{viewAdminSettings:"viewAdminSettings",editAdminSettings:"editAdminSettings",editForm:"editForm",viewPrivateForm:"viewPrivateForm"}),angular.module(ApplicationConfiguration.applicationModuleName).constant("USER_ROLES",{admin:"admin",normal:"user",superuser:"superuser"}),angular.module(ApplicationConfiguration.applicationModuleName).constant("FORM_URL","/forms/:formId"),angular.element(document).ready(function(){"#_=_"===window.location.hash&&(window.location.hash="#!"),angular.bootstrap(document,[ApplicationConfiguration.applicationModuleName])}),angular.module("TellForm.templates",[]).run(["$templateCache",function(a){a.put("modules/core/views/header.client.view.html","
"),a.put("modules/forms/admin/views/admin-form.client.view.html",'
{{ \'TELLFORM_URL\' | translate }}
{{ \'COPY_AND_PASTE\' | translate }}
{{ \'BACKGROUND_COLOR\' | translate }}
{{ \'QUESTION_TEXT_COLOR\' | translate }}
{{ \'ANSWER_TEXT_COLOR\' | translate }}
{{ \'BTN_BACKGROUND_COLOR\' | translate }}
{{ \'BTN_TEXT_COLOR\' | translate }}
'),a.put("modules/forms/admin/views/list-forms.client.view.html",'

{{ \'CREATE_A_NEW_FORM\' | translate }}
{{ \'NAME\' | translate }}
{{ \'LANGUAGE\' | translate }}

{{ form.submissions.length }} {{ \'RESPONSES\' | translate }}

{{ \'FORM_PAUSED\' | translate }}
'),a.put("modules/forms/base/views/submit-form.client.view.html","
"),a.put("modules/forms/admin/views/adminTabs/analyze.html",""),a.put("modules/forms/admin/views/adminTabs/configure.html",""),a.put("modules/forms/admin/views/adminTabs/create.html",""),a.put("modules/forms/admin/views/directiveViews/form/configure-form.client.view.html",'
{{ \'FORM_NAME\' | translate }}
{{ \'FORM_STATUS\' | translate }}
{{ \'LANGUAGE\' | translate }}
* {{ \'REQUIRED_FIELD\' | translate }}
{{ \'GA_TRACKING_CODE\' | translate }}
{{ \'DISPLAY_FOOTER\' | translate }}
{{ \'DISPLAY_START_PAGE\' | translate }}
{{ \'DISPLAY_END_PAGE\' | translate }}
'),a.put("modules/forms/admin/views/directiveViews/form/edit-form.client.view.html",'

{{ \'WELCOME_SCREEN\' | translate }}


{{field.title}} *

{{ \'CLICK_FIELDS_FOOTER\' | translate }}


{{ \'END_SCREEN\' | translate }}

'), a.put("modules/forms/admin/views/directiveViews/form/edit-submissions-form.client.view.html","
{{ 'TOTAL_VIEWS' | translate }}
{{ 'RESPONSES' | translate }}
{{ 'COMPLETION_RATE' | translate }}
{{ 'AVERAGE_TIME_TO_COMPLETE' | translate }}
{{myform.analytics.visitors.length}}
{{myform.analytics.submissions}}
{{myform.analytics.conversionRate | number:0}}%
{{ AverageTimeElapsed | secondsToDateTime | date:'mm:ss'}}
{{ 'DESKTOP_AND_LAPTOP' | translate }}
{{ 'TABLETS' | translate }}
{{ 'PHONES' | translate }}
{{ 'OTHER' | translate }}
{{ 'UNIQUE_VISITS' | translate }}
{{DeviceStatistics.desktop.visits}}
{{ 'UNIQUE_VISITS' | translate }}
{{DeviceStatistics.tablet.visits}}
{{ 'UNIQUE_VISITS' | translate }}
{{DeviceStatistics.tablet.visits}}
{{ 'UNIQUE_VISITS' | translate }}
{{DeviceStatistics.other.visits}}
{{ 'RESPONSES' | translate }}
{{DeviceStatistics.desktop.responses}}
{{ 'RESPONSES' | translate }}
{{DeviceStatistics.tablet.responses}}
{{ 'RESPONSES' | translate }}
{{DeviceStatistics.phone.responses}}
{{ 'RESPONSES' | translate }}
{{DeviceStatistics.other.responses}}
{{ 'COMPLETION_RATE' | translate }}
{{DeviceStatistics.desktop.completion}}%
{{ 'COMPLETION_RATE' | translate }}
{{DeviceStatistics.tablet.completion}}%
{{ 'COMPLETION_RATE' | translate }}
{{DeviceStatistics.phone.completion}}%
{{ 'COMPLETION_RATE' | translate }}
{{DeviceStatistics.other.completion}}%
{{ 'AVERAGE_TIME_TO_COMPLETE' | translate }}
{{DeviceStatistics.desktop.average_time | secondsToDateTime | date:'mm:ss'}}
{{ 'AVERAGE_TIME_TO_COMPLETE' | translate }}
{{DeviceStatistics.tablet.average_time | secondsToDateTime | date:'mm:ss'}}
{{ 'AVERAGE_TIME_TO_COMPLETE' | translate }}
{{DeviceStatistics.phone.average_time | secondsToDateTime | date:'mm:ss'}}
{{ 'AVERAGE_TIME_TO_COMPLETE' | translate }}
{{DeviceStatistics.other.average_time | secondsToDateTime | date:'mm:ss'}}
{{ 'FIELD_TITLE' | translate }}
{{ 'FIELD_VIEWS' | translate }}
{{ 'FIELD_RESPONSES' | translate }}
{{ 'FIELD_DROPOFF' | translate }}
{{fieldStats.field.title}}
{{fieldStats.totalViews}}
{{fieldStats.responses}}
{{fieldStats.continueRate}}%

#{{value.title}}{{ 'PERCENTAGE_COMPLETE' | translate }}{{ 'TIME_ELAPSED' | translate }}{{ 'DEVICE' | translate }}{{ 'LOCATION' | translate }}{{ 'IP_ADDRESS' | translate }}{{ 'DATE_SUBMITTED' | translate }} (UTC)
{{$index+1}}{{field.fieldValue}}{{row.percentageComplete}}%{{row.timeElapsed | secondsToDateTime | date:'mm:ss'}}{{row.device.name}}, {{row.device.type}}{{row.geoLocation.City}}, {{row.geoLocation.Country}}{{row.ipAddr}}{{row.created | date:'yyyy-MM-dd HH:mm:ss'}}
"),a.put("modules/forms/base/views/directiveViews/entryPage/startPage.html",'

{{pageData.introTitle}}

{{pageData.introParagraph}}

'),a.put("modules/forms/base/views/directiveViews/field/date.html",'

{{index+1}} {{field.title}} {{ \'OPTIONAL\' | translate }}

{{field.description}}

'),a.put("modules/forms/base/views/directiveViews/field/dropdown.html",'
'),a.put("modules/forms/base/views/directiveViews/field/file.html",'

{{index+1}} {{field.title}} {{ \'OPTIONAL\' | translate }}

{{field.file.originalname}}
{{ UPLOAD_FILE | translate }}
'),a.put("modules/forms/base/views/directiveViews/field/hidden.html",''),a.put("modules/forms/base/views/directiveViews/field/legal.html",'
'),a.put("modules/forms/base/views/directiveViews/field/radio.html",'

{{index+1}} {{field.title}} {{ \'OPTIONAL\' | translate }}

{{field.description}}


'),a.put("modules/forms/base/views/directiveViews/field/rating.html",'

{{index+1}} {{field.title}} {{ \'OPTIONAL\' | translate }}

{{field.description}}

'),a.put("modules/forms/base/views/directiveViews/field/statement.html",'

{{field.title}}

{{field.description}}

{{field.description}}


'),a.put("modules/forms/base/views/directiveViews/field/textarea.html",'

{{index+1}} {{field.title}} {{ \'OPTIONAL\' | translate }}

{{ \'NEWLINE\' | translate }}

{{field.description}}

{{ \'NEWLINE\' | translate }}
'),a.put("modules/forms/base/views/directiveViews/field/textfield.html",'

{{index+1}} {{field.title}} ({{ \'OPTIONAL\' | translate }})

{{field.description}}

'),a.put("modules/forms/base/views/directiveViews/field/yes_no.html",'

{{index+1}} {{field.title}} {{ \'OPTIONAL\' | translate }}

{{field.description}}


'),a.put("modules/forms/base/views/directiveViews/form/submit-form.client.view.html",'

{{myform.startPage.introTitle}}

{{myform.startPage.introParagraph}}

{{ \'COMPLETING_NEEDED\' | translate:translateAdvancementData }}
{{ \'FORM_SUCCESS\' | translate }}

{{myform.endPage.title}}

{{myform.endPage.paragraph}}

'),a.put("modules/users/views/authentication/access-denied.client.view.html","

{{ 'ACCESS_DENIED_TEXT' | translate }}

{{ 'SIGNIN_BTN' | translate }}
"),a.put("modules/users/views/authentication/signin.client.view.html",'
'),a.put("modules/users/views/authentication/signup-success.client.view.html",'

{{ \'SUCCESS_HEADER\' | translate }}

{{ \'SUCCESS_TEXT\' | translate }}

{{ \'NOT_ACTIVATED_YET\' | translate }}



{{ \'BEFORE_YOU_CONTINUE\' | translate }} polydaic@gmail.com

'),a.put("modules/users/views/authentication/signup.client.view.html",'
'), a.put("modules/users/views/password/forgot-password.client.view.html",'
{{error}}
{{success}}
'),a.put("modules/users/views/password/reset-password-invalid.client.view.html","

{{ 'PASSWORD_RESET_INVALID' | translate }}

{{ 'ASK_FOR_NEW_PASSWORD' | translate }}
"),a.put("modules/users/views/password/reset-password-success.client.view.html","

{{ 'PASSWORD_RESET_SUCCESS' | translate }}

{{ 'CONTINUE_TO_LOGIN' | translate }}
"),a.put("modules/users/views/password/reset-password.client.view.html",'

{{ \'RESET_PASSWORD\' | translate }}

'),a.put("modules/users/views/settings/change-password.client.view.html",'

{{ \'CHANGE_PASSWORD\' | translate }}

'),a.put("modules/users/views/settings/edit-profile.client.view.html",'

{{ \'EDIT_PROFILE\' | translate }}

'),a.put("modules/users/views/settings/social-accounts.client.view.html",'

{{ \'CONNECTED_SOCIAL_ACCOUNTS\' | translate }}:

{{ \'CONNECT_OTHER_SOCIAL_ACCOUNTS\' | translate }}

'),a.put("modules/users/views/verify/resend-verify-email.client.view.html",'
{{error}}

{{ \'VERIFICATION_EMAIL_SENT\' | translate }}

{{ \'VERIFICATION_EMAIL_SENT_TO\' | translate }} {{username}}.
{{ \'NOT_ACTIVATED_YET\' | translate }}

{{ \'CHECK_YOUR_EMAIL\' | translate }} polydaic@gmail.com

'),a.put("modules/users/views/verify/verify-account.client.view.html",'

{{ \'VERIFY_SUCCESS\' | translate }}

')}]),ApplicationConfiguration.registerModule("core",["users"]),ApplicationConfiguration.registerModule("forms",["ngFileUpload","ui.router.tabs","ui.date","ui.sortable","angular-input-stars","users","ngclipboard"]),ApplicationConfiguration.registerModule("users"),angular.module("forms").config(["$translateProvider",function(a){a.translations("en",{ADVANCED_SETTINGS:"Advanced Settings",FORM_NAME:"Form Name",FORM_STATUS:"Form Status",PUBLIC:"Public",PRIVATE:"Private",GA_TRACKING_CODE:"Google Analytics Tracking Code",DISPLAY_FOOTER:"Display Form Footer?",SAVE_CHANGES:"Save Changes",CANCEL:"Cancel",DISPLAY_START_PAGE:"Display Start Page?",DISPLAY_END_PAGE:"Display Custom End Page?",CREATE_A_NEW_FORM:"Create a new form",CREATE_FORM:"Create form",CREATED_ON:"Created on",MY_FORMS:"My forms",NAME:"Name",LANGUAGE:"Language",FORM_PAUSED:"Form paused",EDIT_FIELD:"Edit this Field",SAVE_FIELD:"Save",ON:"ON",OFF:"OFF",REQUIRED_FIELD:"Required",LOGIC_JUMP:"Logic Jump",SHOW_BUTTONS:"Additional Buttons",SAVE_START_PAGE:"Save",ARE_YOU_SURE:"Are you ABSOLUTELY sure?",READ_WARNING:"Unexpected bad things will happen if you don’t read this!",DELETE_WARNING1:'This action CANNOT be undone. This will permanently delete the "',DELETE_WARNING2:'" form and remove all associated form submissions.',DELETE_CONFIRM:"Please type in the name of the form to confirm.",I_UNDERSTAND:"I understand the consequences, delete this form.",DELETE_FORM_SM:"Delete",DELETE_FORM_MD:"Delete Form",DELETE:"Delete",FORM:"Form",VIEW:"View",LIVE:"Live",PREVIEW:"Preview",COPY:"Copy",COPY_AND_PASTE:"Copy and Paste this to add your TellForm to your website",CHANGE_WIDTH_AND_HEIGHT:"Change the width and height values to suit you best",POWERED_BY:"Powered by",TELLFORM_URL:"Your TellForm is permanently at this URL",DISABLED:"Disabled",YES:"YES",NO:"NO",ADD_LOGIC_JUMP:"Add Logic Jump",ADD_FIELD_LG:"Click to Add New Field",ADD_FIELD_MD:"Add New Field",ADD_FIELD_SM:"Add Field",EDIT_START_PAGE:"Edit Start Page",EDIT_END_PAGE:"Edit End Page",WELCOME_SCREEN:"Start Page",END_SCREEN:"End Page",INTRO_TITLE:"Title",INTRO_PARAGRAPH:"Paragraph",INTRO_BTN:"Start Button",TITLE:"Title",PARAGRAPH:"Paragraph",BTN_TEXT:"Go Back Button",BUTTONS:"Buttons",BUTTON_TEXT:"Text",BUTTON_LINK:"Link",ADD_BUTTON:"Add Button",PREVIEW_FIELD:"Preview Question",QUESTION_TITLE:"Title",QUESTION_DESCRIPTION:"Description",OPTIONS:"Options",ADD_OPTION:"Add Option",NUM_OF_STEPS:"Number of Steps",CLICK_FIELDS_FOOTER:"Click on fields to add them here",SHAPE:"Shape",IF_THIS_FIELD:"If this field",IS_EQUAL_TO:"is equal to",IS_NOT_EQUAL_TO:"is not equal to",IS_GREATER_THAN:"is greater than",IS_GREATER_OR_EQUAL_THAN:"is greater or equal than",IS_SMALLER_THAN:"is_smaller_than",IS_SMALLER_OR_EQUAL_THAN:"is smaller or equal than",CONTAINS:"contains",DOES_NOT_CONTAINS:"does not contain",ENDS_WITH:"ends with",DOES_NOT_END_WITH:"does not end with",STARTS_WITH:"starts with",DOES_NOT_START_WITH:"does not start with",THEN_JUMP_TO:"then jump to",TOTAL_VIEWS:"total unique visits",RESPONSES:"responses",COMPLETION_RATE:"completion rate",AVERAGE_TIME_TO_COMPLETE:"avg. completion time",DESKTOP_AND_LAPTOP:"Desktops",TABLETS:"Tablets",PHONES:"Phones",OTHER:"Other",UNIQUE_VISITS:"Unique Visits",FIELD_TITLE:"Field Title",FIELD_VIEWS:"Field Views",FIELD_DROPOFF:"Field Completion",FIELD_RESPONSES:"Field Responses",DELETE_SELECTED:"Delete Selected",EXPORT_TO_EXCEL:"Export to Excel",EXPORT_TO_CSV:"Export to CSV",EXPORT_TO_JSON:"Export to JSON",PERCENTAGE_COMPLETE:"Percentage Complete",TIME_ELAPSED:"Time Elapsed",DEVICE:"Device",LOCATION:"Location",IP_ADDRESS:"IP Address",DATE_SUBMITTED:"Date Submitted",GENERATED_PDF:"Generated PDF",BACKGROUND_COLOR:"Background Color",DESIGN_HEADER:"Change how your Form Looks",QUESTION_TEXT_COLOR:"Question Text Color",ANSWER_TEXT_COLOR:"Answer Text Color",BTN_BACKGROUND_COLOR:"Button Background Color",BTN_TEXT_COLOR:"Button Text Color",EMBED_YOUR_FORM:"Embed your form",SHARE_YOUR_FORM:"Share your form",CREATE_TAB:"Create",DESIGN_TAB:"Design",CONFIGURE_TAB:"Configure",ANALYZE_TAB:"Analyze",SHARE_TAB:"Share",SHORT_TEXT:"Short Text",EMAIL:"Email",MULTIPLE_CHOICE:"Multiple Choice",DROPDOWN:"Dropdown",DATE:"Date",PARAGRAPH_T:"Paragraph",YES_NO:"Yes/No",LEGAL:"Legal",RATING:"Rating",NUMBERS:"Numbers",SIGNATURE:"Signature",FILE_UPLOAD:"File upload",OPTION_SCALE:"Option Scale",PAYMENT:"Payment",STATEMENT:"Statement",LINK:"Link"})}]),angular.module("forms").config(["$translateProvider",function(a){a.translations("es",{ADVANCED_SETTINGS:"Configuraciones avanzadas",FORM_NAME:"Nombre del formulario",FORM_STATUS:"Estado del formulario",PUBLIC:"Público",PRIVATE:"Privado",GA_TRACKING_CODE:"Código de Google Analytics",DISPLAY_FOOTER:"¿Mostrar pie de página?",SAVE_CHANGES:"Grabar",CANCEL:"Cancelar",DISPLAY_START_PAGE:"¿Mostrar página de inicio?",DISPLAY_END_PAGE:"¿Mostrar paǵina de fin?",CREATE_A_NEW_FORM:"Crear formulario",CREATE_FORM:"Crear formulario",CREATED_ON:"Creado en",MY_FORMS:"Mis formularios",NAME:"Nombre",LANGUAGE:"Idioma",FORM_PAUSED:"Formulario pausado",EDIT_FIELD:"Editar este campo",SAVE_FIELD:"Grabar",ON:"ON",OFF:"OFF",REQUIRED_FIELD:"Requerido",LOGIC_JUMP:"Salto lógico",SHOW_BUTTONS:"Botones adicionales",SAVE_START_PAGE:"Grabar",ARE_YOU_SURE:"¿Estás absolutamente seguro?",READ_WARNING:"¡Algo malo ocurrirá si no lees esto!",DELETE_WARNING1:'Esta acción no tiene vuelta atrás. Esto borrará permanentemente el "',DELETE_WARNING2:'" formulario y todos los datos asociados.',DELETE_CONFIRM:"Por favor escribí el nombre del formulario para confirmar.",I_UNDERSTAND:"Entiendo las consecuencias y quiero borrarlo.",DELETE_FORM_SM:"Borrar",DELETE_FORM_MD:"Borrar formulario",DELETE:"Borrar",FORM:"Formulario",VIEW:"Vista",LIVE:"Online",PREVIEW:"Vista previa",COPY:"Copiar",COPY_AND_PASTE:"Copiar y pegar esto para agregar su TellForm a su sitio web",CHANGE_WIDTH_AND_HEIGHT:"Cambie los valores de ancho y altura para adaptar el formulario a sus necesidades",POWERED_BY:"Con la tecnlogía de",TELLFORM_URL:"Tu TellForm está en esta URL permanente",DISABLED:"Deshabilitado",YES:"SI",NO:"NO",ADD_LOGIC_JUMP:"Agregar salto lógico",ADD_FIELD_LG:"Click para agregar campo",ADD_FIELD_MD:"Agregar nuevo campo",ADD_FIELD_SM:"Agregar campo",EDIT_START_PAGE:"Editar paǵina de inicio",EDIT_END_PAGE:"Editar página de finalización",WELCOME_SCREEN:"Comienzo",END_SCREEN:"Fin",INTRO_TITLE:"Título",INTRO_PARAGRAPH:"Parágrafo",INTRO_BTN:"Botón de comienzo",TITLE:"Título",PARAGRAPH:"Paragrafo",BTN_TEXT:"Botón para volver atrás",BUTTONS:"Botones",BUTTON_TEXT:"Texto",BUTTON_LINK:"Link",ADD_BUTTON:"Agregar Botón",PREVIEW_FIELD:"Vista previa Pregunta",QUESTION_TITLE:"Título",QUESTION_DESCRIPTION:"Descripción",OPTIONS:"Opciones",ADD_OPTION:"Agregar Opciones",NUM_OF_STEPS:"Cantidad de pasos",CLICK_FIELDS_FOOTER:"Click en los campos para agregar",SHAPE:"Forma",IF_THIS_FIELD:"Si este campo",IS_EQUAL_TO:"es igual a",IS_NOT_EQUAL_TO:"no es igual a",IS_GREATER_THAN:"es mayor que",IS_GREATER_OR_EQUAL_THAN:"es mayor o igual que",IS_SMALLER_THAN:"es menor que",IS_SMALLER_OR_EQUAL_THAN:"is menor o igual que",CONTAINS:"contiene",DOES_NOT_CONTAINS:"no contiene",ENDS_WITH:"termina con",DOES_NOT_END_WITH:"no termina con",STARTS_WITH:"comienza con",DOES_NOT_START_WITH:"no comienza con",THEN_JUMP_TO:"luego salta a",TOTAL_VIEWS:"Total de visitas únicas",RESPONSES:"respuestas",COMPLETION_RATE:"Taza de terminación",AVERAGE_TIME_TO_COMPLETE:"Promedio de tiempo de rellenado",DESKTOP_AND_LAPTOP:"Computadora",TABLETS:"Tablets",PHONES:"Móviles",OTHER:"Otros",UNIQUE_VISITS:"Visitas únicas",FIELD_TITLE:"Título de campo",FIELD_VIEWS:"Vistas de campo",FIELD_DROPOFF:"Finalización de campo",FIELD_RESPONSES:"Respuestas de campo",DELETE_SELECTED:"Borrar selección",EXPORT_TO_EXCEL:"Exportar a Excel",EXPORT_TO_CSV:"Exportar a CSV",EXPORT_TO_JSON:"Exportar a JSON",PERCENTAGE_COMPLETE:"Porcentaje de completitud",TIME_ELAPSED:"Tiempo usado",DEVICE:"Dispositivo",LOCATION:"Lugar",IP_ADDRESS:"Dirección IP",DATE_SUBMITTED:"Fecha de envío",GENERATED_PDF:"PDF generado",BACKGROUND_COLOR:"Color de fondo",DESIGN_HEADER:"Cambiar diseño de formulario",QUESTION_TEXT_COLOR:"Color de la pregunta",ANSWER_TEXT_COLOR:"Color de la respuesta",BTN_BACKGROUND_COLOR:"Color de fondo del botón",BTN_TEXT_COLOR:"Color del texto del botón",EMBED_YOUR_FORM:"Pone tu formulario",SHARE_YOUR_FORM:"Compartí tu formulario",CREATE_TAB:"Crear",DESIGN_TAB:"Diseño",CONFIGURE_TAB:"Configuración",ANALYZE_TAB:"Análisis",SHARE_TAB:"Compartir",SHORT_TEXT:"Texto corto",EMAIL:"Email",MULTIPLE_CHOICE:"Opciones múltiples",DROPDOWN:"Desplegable",DATE:"Fecha",PARAGRAPH_T:"Párrafo",YES_NO:"Si/No",LEGAL:"Legal",RATING:"Puntaje",NUMBERS:"Números",SIGNATURE:"Firma",FILE_UPLOAD:"Subir archivo",OPTION_SCALE:"Escala",PAYMENT:"Pago",STATEMENT:"Declaración",LINK:"Enlace"})}]),angular.module("forms").config(["$translateProvider",function(a){a.translations("en",{FORM_SUCCESS:"Form entry successfully submitted!",REVIEW:"Review",BACK_TO_FORM:"Go back to Form",EDIT_FORM:"Edit this TellForm",CREATE_FORM:"Create this TellForm",ADVANCEMENT:"{{done}} out of {{total}} answered",CONTINUE_FORM:"Continue to Form",REQUIRED:"required",COMPLETING_NEEDED:"{{answers_not_completed}} answer(s) need completing",OPTIONAL:"optional",ERROR_EMAIL_INVALID:"Please enter a valid email address",ERROR_NOT_A_NUMBER:"Please enter valid numbers only",ERROR_URL_INVALID:"Please a valid url",OK:"OK",ENTER:"press ENTER",YES:"Yes",NO:"No",NEWLINE:"press SHIFT+ENTER to create a newline",CONTINUE:"Continue",LEGAL_ACCEPT:"I accept",LEGAL_NO_ACCEPT:"I don’t accept",DELETE:"Delete",CANCEL:"Cancel",SUBMIT:"Submit",UPLOAD_FILE:"Upload your File",TYPE_OR_SELECT_OPTION:"Type or select an option",ABORT_UPLOAD:"Abort ongoing upload",CLEAR_SELECTED_FILES:"Clear selected files"})}]),angular.module("forms").config(["$translateProvider",function(a){a.translations("fr",{FORM_SUCCESS:"Votre formulaire a été enregistré!",REVIEW:"Incomplet",BACK_TO_FORM:"Retourner au formulaire",EDIT_FORM:"Éditer le Tellform",CREATE_FORM:"Créer un TellForm",ADVANCEMENT:"{{done}} complétés sur {{total}}",CONTINUE_FORM:"Aller au formulaire",REQUIRED:"obligatoire",COMPLETING_NEEDED:"{{answers_not_completed}} réponse(s) doive(nt) être complétée(s)",OPTIONAL:"facultatif",ERROR_EMAIL_INVALID:"Merci de rentrer une adresse mail valide",ERROR_NOT_A_NUMBER:"Merce de ne rentrer que des nombres",ERROR_URL_INVALID:"Merci de rentrer une url valide",OK:"OK",ENTER:"presser ENTRÉE",YES:"Oui",NO:"Non",NEWLINE:"presser SHIFT+ENTER pour créer une nouvelle ligne",CONTINUE:"Continuer",LEGAL_ACCEPT:"J’accepte",LEGAL_NO_ACCEPT:"Je n’accepte pas",DELETE:"Supprimer",CANCEL:"Réinitialiser",SUBMIT:"Enregistrer",UPLOAD_FILE:"Envoyer un fichier",Y:"O",N:"N"})}]),angular.module("forms").config(["$translateProvider",function(a){a.translations("de",{FORM_SUCCESS:"Ihre Angaben wurden gespeichert.",REVIEW:"Unvollständig",BACK_TO_FORM:"Zurück zum Formular",EDIT_FORM:"Bearbeiten Sie diese TellForm",CREATE_FORM:"Erstellen Sie eine TellForm",ADVANCEMENT:"{{done}} von {{total}} beantwortet",CONTINUE_FORM:"Zum Formular",REQUIRED:"verpflichtend",COMPLETING_NEEDED:"Es fehlen/fehtl noch {{answers_not_completed}} Antwort(en)",OPTIONAL:"fakultativ",ERROR_EMAIL_INVALID:"Bitte gültige Mailadresse eingeben",ERROR_NOT_A_NUMBER:"Bitte nur Zahlen eingeben",ERROR_URL_INVALID:"Bitte eine gültige URL eingeben",OK:"Okay",ENTER:"Eingabetaste drücken",YES:"Ja",NO:"Nein",NEWLINE:"Für eine neue Zeile SHIFT+ENTER drücken",CONTINUE:"Weiter",LEGAL_ACCEPT:"Ich akzeptiere",LEGAL_NO_ACCEPT:"Ich akzeptiere nicht",DELETE:"Entfernen",CANCEL:"Canceln",SUBMIT:"Speichern",UPLOAD_FILE:"Datei versenden",Y:"J",N:"N"})}]),angular.module("forms").config(["$translateProvider",function(a){a.translations("it",{FORM_SUCCESS:"Il formulario è stato inviato con successo!",REVIEW:"Incompleto",BACK_TO_FORM:"Ritorna al formulario",EDIT_FORM:"Modifica questo Tellform",CREATE_FORM:"Creare un TellForm",ADVANCEMENT:"{{done}} su {{total}} completate",CONTINUE_FORM:"Vai al formulario",REQUIRED:"obbligatorio",COMPLETING_NEEDED:"{{answers_not_completed}} risposta/e deve/ono essere completata/e",OPTIONAL:"opzionale",ERROR_EMAIL_INVALID:"Si prega di inserire un indirizzo email valido",ERROR_NOT_A_NUMBER:"Si prega di inserire solo numeri",ERROR_URL_INVALID:"Grazie per inserire un URL valido",OK:"OK",ENTER:"premere INVIO",YES:"Sì",NO:"No",NEWLINE:"premere SHIFT+INVIO per creare una nuova linea",CONTINUE:"Continua",LEGAL_ACCEPT:"Accetto",LEGAL_NO_ACCEPT:"Non accetto",DELETE:"Cancella",CANCEL:"Reset",SUBMIT:"Registra",UPLOAD_FILE:"Invia un file",Y:"S",N:"N"})}]),angular.module("forms").config(["$translateProvider",function(a){a.translations("es",{FORM_SUCCESS:"¡El formulario ha sido enviado con éxito!",REVIEW:"Revisar",BACK_TO_FORM:"Regresar al formulario",EDIT_FORM:"Crear un TellForm",CREATE_FORM:"Editar este TellForm",ADVANCEMENT:"{{done}} de {{total}} contestadas",CONTINUE_FORM:"Continuar al formulario",REQUIRED:"Información requerida",COMPLETING_NEEDED:"{{answers_not_completed}} respuesta(s) necesita(n) ser completada(s)",OPTIONAL:"Opcional",ERROR_EMAIL_INVALID:"Favor de proporcionar un correo electrónico válido",ERROR_NOT_A_NUMBER:"Por favor, introduzca sólo números válidos",ERROR_URL_INVALID:"Favor de proporcionar un url válido",OK:"OK",ENTER:"pulse INTRO",YES:"Si",NO:"No",NEWLINE:"presione SHIFT+INTRO para crear una nueva línea",CONTINUE:"Continuar",LEGAL_ACCEPT:"Acepto",LEGAL_NO_ACCEPT:"No acepto",DELETE:"Eliminar",CANCEL:"Cancelar",SUBMIT:"Registrar",UPLOAD_FILE:"Cargar el archivo",Y:"S",N:"N",TYPE_OR_SELECT_OPTION:"Escriba o seleccione una opción",ABORT_UPLOAD:"Cancelar la subida en curso",CLEAR_SELECTED_FILES:"Borrar los archivos seleccionados"})}]),angular.module("core").config(["$stateProvider","$urlRouterProvider",function(a,b,c){b.otherwise("/forms")}]),angular.module(ApplicationConfiguration.applicationModuleName).run(["$rootScope","Auth","$state","$stateParams",function(a,b,c,d){a.$state=c,a.$stateParams=d,a.$on("$stateChangeSuccess",function(a,d,e,f){c.previous=f;var g=["home","signin","resendVerifyEmail","verify","signup","signup-success","forgot","reset-invalid","reset","reset-success"];g.indexOf(d.name)>0?b.isAuthenticated()&&(a.preventDefault(),c.go("listForms")):"access_denied"===d.name||b.isAuthenticated()||"submitForm"===d.name||(a.preventDefault(),c.go("listForms"))})}]),angular.module(ApplicationConfiguration.applicationModuleName).run(["$rootScope","Auth","User","Authorizer","$state","$stateParams",function(a,b,c,d,e,f){a.$on("$stateChangeStart",function(a,f){var g,h,i;h=f&&f.data&&f.data.permissions?f.data.permissions:null,b.ensureHasCurrentUser(c),i=b.currentUser,i&&(g=new d(i),null!==h&&(g.canAccess(h)||(a.preventDefault(),e.go("access_denied"))))})}]),angular.module("core").controller("HeaderController",["$rootScope","$scope","Menus","$state","Auth","User","$window","$translate","$locale",function(a,b,c,d,e,f,g,h,i){a.signupDisabled=g.signupDisabled,b.user=a.user=e.ensureHasCurrentUser(f),b.authentication=a.authentication=e,a.languages=b.languages=["en","fr","es","it","de"],b.authentication.isAuthenticated()?a.language=b.user.language:a.language=i.id.substring(0,2),h.use(a.language),b.isCollapsed=!1,a.hideNav=!1,b.menu=c.getMenu("topbar"),b.signout=function(){var c=f.logout();c.then(function(){e.logout(),e.ensureHasCurrentUser(f),b.user=a.user=null,d.go("listForms"),d.reload()},function(a){console.error("Logout Failed: "+a)})},b.toggleCollapsibleMenu=function(){b.isCollapsed=!b.isCollapsed},b.$on("$stateChangeSuccess",function(c,d,e,f,g){b.isCollapsed=!1,a.hideNav=!1,angular.isDefined(d.data)&&angular.isDefined(d.data.hideNav)&&(a.hideNav=d.data.hideNav)})}]),angular.module("core").service("Menus",[function(){this.defaultRoles=["*"],this.menus={};var a=function(a){if(a){if(~this.roles.indexOf("*"))return!0;for(var b in a.roles)for(var c in this.roles)if(this.roles[c]===a.roles[b])return!0;return!1}return this.isPublic};this.validateMenuExistance=function(a){if(a&&a.length){if(this.menus[a])return!0;throw new Error("Menu does not exists")}throw new Error("MenuId was not provided")},this.getMenu=function(a){return this.validateMenuExistance(a),this.menus[a]},this.addMenu=function(b,c,d){return this.menus[b]={isPublic:c||!1,roles:d||this.defaultRoles,items:[],shouldRender:a},this.menus[b]},this.removeMenu=function(a){this.validateMenuExistance(a),delete this.menus[a]},this.addMenuItem=function(b,c,d,e,f,g,h,i){return this.validateMenuExistance(b),this.menus[b].items.push({title:c,link:d,menuItemType:e||"item",menuItemClass:e,uiRoute:f||"/"+d,isPublic:null===g||"undefined"==typeof g?this.menus[b].isPublic:g,roles:null===h||"undefined"==typeof h?this.menus[b].roles:h,position:i||0,items:[],shouldRender:a}),this.menus[b]},this.addSubMenuItem=function(b,c,d,e,f,g,h,i){this.validateMenuExistance(b);for(var j in this.menus[b].items)this.menus[b].items[j].link===c&&this.menus[b].items[j].items.push({title:d,link:e,uiRoute:f||"/"+e,isPublic:null===g||"undefined"==typeof g?this.menus[b].items[j].isPublic:g,roles:null===h||"undefined"==typeof h?this.menus[b].items[j].roles:h,position:i||0,shouldRender:a});return this.menus[b]},this.removeMenuItem=function(a,b){this.validateMenuExistance(a);for(var c in this.menus[a].items)this.menus[a].items[c].link===b&&this.menus[a].items.splice(c,1);return this.menus[a]},this.removeSubMenuItem=function(a,b){this.validateMenuExistance(a);for(var c in this.menus[a].items)for(var d in this.menus[a].items[c].items)this.menus[a].items[c].items[d].link===b&&this.menus[a].items[c].items.splice(d,1);return this.menus[a]},this.addMenu("topbar",!1,["*"]),this.addMenu("bottombar",!1,["*"])}]),function(){function a(a,b){function c(a){g.socket=io(a,{transports:["websocket","polling"]})}function d(a,b){g.socket&&g.socket.emit(a,b)}function e(b,c){g.socket&&g.socket.on(b,function(b){a(function(){c(b)})})}function f(a){g.socket&&g.socket.removeListener(a)}var g={connect:c,emit:d,on:e,removeListener:f,socket:null};return c(window.location.protocol+"//"+window.location.hostname),g}angular.module("core").factory("Socket",a),a.$inject=["$timeout","$window"]}(),angular.module("core").factory("subdomain",["$location",function(a){var b=a.host();return b.indexOf(".")<0?null:b.split(".")[0]}]),angular.module("forms").run(["Menus",function(a){a.addMenuItem("topbar","My Forms","forms","","/forms",!1)}]).filter("secondsToDateTime",[function(){return function(a){return new Date(1970,0,1).setSeconds(a)}}]).filter("formValidity",function(){return function(a){if(a&&a.form_fields&&a.visible_form_fields){var b=Object.keys(a),c=(b.filter(function(a){return"$"!==a[0]}),a.form_fields),d=c.filter(function(a){return"object"==typeof a&&"statement"!==a.fieldType&&"rating"!==a.fieldType?!!a.fieldValue:"rating"===a.fieldType||void 0}).length;return d-(a.form_fields.length-a.visible_form_fields.length)}return 0}}).config(["$provide",function(a){a.decorator("accordionDirective",["$delegate",function(a){var b=a[0];return b.replace=!0,a}])}]),angular.module("forms").config(["$stateProvider",function(a){a.state("listForms",{url:"/forms",templateUrl:"modules/forms/admin/views/list-forms.client.view.html"}).state("submitForm",{url:"/forms/:formId",templateUrl:"modules/forms/base/views/submit-form.client.view.html",data:{hideNav:!0},resolve:{Forms:"Forms",myForm:["Forms","$stateParams",function(a,b){return a.get({formId:b.formId}).$promise}]},controller:"SubmitFormController",controllerAs:"ctrl"}).state("viewForm",{url:"/forms/:formId/admin",templateUrl:"modules/forms/admin/views/admin-form.client.view.html",data:{permissions:["editForm"]},resolve:{Forms:"Forms",myForm:["Forms","$stateParams",function(a,b){return a.get({formId:b.formId}).$promise}]},controller:"AdminFormController"}).state("viewForm.configure",{url:"/configure",templateUrl:"modules/forms/admin/views/adminTabs/configure.html"}).state("viewForm.design",{url:"/design",templateUrl:"modules/forms/admin/views/adminTabs/design.html"}).state("viewForm.analyze",{url:"/analyze",templateUrl:"modules/forms/admin/views/adminTabs/analyze.html"}).state("viewForm.create",{url:"/create",templateUrl:"modules/forms/admin/views/adminTabs/create.html"})}]),function(){function a(){function a(a,b){}function b(){}var c={send:a};return b(),c}angular.module("forms").factory("SendVisitorData",a),a.$inject=[]}(),angular.module("forms").directive("keyToOption",function(){return{restrict:"A",scope:{field:"="},link:function(a,b,c,d){b.bind("keydown keypress",function(b){var c=b.which||b.keyCode,d=parseInt(String.fromCharCode(c))-1;d-1;case a.viewPrivateForm:case a.editForm:return c.roles.indexOf(b.admin)>-1||c.roles.indexOf(b.normal)>-1}}return!1}}}}]),angular.module("users").factory("User",["$window","$q","$timeout","$http","$state",function(a,b,c,d,e){var f={getCurrent:function(){var a=b.defer();return d.get("/users/me").success(function(b){a.resolve(b)}).error(function(){a.reject("User's session has expired")}),a.promise},login:function(a){var c=b.defer();return d.post("/auth/signin",a).then(function(a){c.resolve(a.data)},function(a){c.reject(a.data.message||a.data)}),c.promise},logout:function(){var a=b.defer();return d.get("/auth/signout").then(function(b){a.resolve(null)},function(b){a.reject(b.data.message||b.data)}),a.promise},signup:function(a){var c=b.defer();return d.post("/auth/signup",a).then(function(a){c.resolve(a.data)},function(a){c.reject(a.data.message||a.data)}),c.promise},resendVerifyEmail:function(a){var c=b.defer();return d.post("/auth/verify",{email:a}).then(function(a){c.resolve(a.data)},function(a){c.reject(a.data.message||a.data)}),c.promise},validateVerifyToken:function(a){var c=/^([A-Za-z0-9]{48})$/g;if(!c.test(a))throw new Error("Error token: "+a+" is not a valid verification token");var e=b.defer();return d.get("/auth/verify/"+a).then(function(a){e.resolve(a.data)},function(a){e.reject(a.data)}),e.promise},resetPassword:function(a,c){var e=b.defer();return d.post("/auth/reset/"+c,a).then(function(a){e.resolve(a)},function(a){e.reject(a.data.message||a.data)}),e.promise},askForPasswordReset:function(a){var c=b.defer();return d.post("/auth/forgot",a).then(function(a){c.resolve(a.data)},function(a){c.reject(a.data.message||a.data)}),c.promise}};return f}]),angular.module("users").factory("Users",["$resource",function(a){return a("users",{},{update:{method:"PUT"}})}]),angular.module("core").config(["$translateProvider",function(a){a.translations("en",{MENU:"MENU",SIGNUP_TAB:"Sign Up",SIGNIN_TAB:"Sign In",SIGNOUT_TAB:"Signout",EDIT_PROFILE:"Edit Profile",MY_FORMS:"My Forms",MY_SETTINGS:"My Settings",CHANGE_PASSWORD:"Change Password"}),a.preferredLanguage("en").fallbackLanguage("en").useSanitizeValueStrategy("escape")}]),angular.module("core").config(["$translateProvider",function(a){a.translations("fr",{MENU:"MENU",SIGNUP_TAB:"Créer un Compte",SIGNIN_TAB:"Connexion",SIGNOUT_TAB:"Créer un compte",EDIT_PROFILE:"Modifier Mon Profil",MY_FORMS:"Mes Formulaires",MY_SETTINGS:"Mes Paramètres",CHANGE_PASSWORD:"Changer mon Mot de Pass"})}]),angular.module("core").config(["$translateProvider",function(a){a.translations("es",{MENU:"MENU",SIGNUP_TAB:"Registrarse",SIGNIN_TAB:"Entrar",SIGNOUT_TAB:"Salir",EDIT_PROFILE:"Editar Perfil",MY_FORMS:"Mis formularios",MY_SETTINGS:"Mis configuraciones",CHANGE_PASSWORD:"Cambiar contraseña"})}]),angular.module("forms").controller("AdminFormController",["$rootScope","$window","$scope","$stateParams","$state","Forms","CurrentForm","$http","$uibModal","myForm","$filter","$sce",function(a,b,c,d,e,f,g,h,i,j,k,l){c.trustSrc=function(a){return l.trustAsResourceUrl(a)},c.activePill=0,c.copied=!1,c.onCopySuccess=function(a){c.copied=!0},c=a,c.animationsEnabled=!0,c.myform=j,a.saveInProgress=!1,g.setForm(c.myform),c.formURL="/#!/forms/"+c.myform._id,c.myform.isLive?b.subdomainsDisabled===!0?c.actualFormURL=window.location.protocol+"//"+window.location.host+"/view"+c.formURL:window.location.host.split(".").length<3?c.actualFormURL=window.location.protocol+"//"+c.myform.admin.username+"."+window.location.host+c.formURL:c.actualFormURL=window.location.protocol+"//"+c.myform.admin.username+"."+window.location.host.split(".").slice(1,3).join(".")+c.formURL:c.actualFormURL=window.location.protocol+"//"+window.location.host+c.formURL;var m=c.refreshFrame=function(){document.getElementById("iframe")&&document.getElementById("iframe").contentWindow.location.reload()};c.tabData=[{heading:k("translate")("CONFIGURE_TAB"),templateName:"configure"}],c.setForm=function(a){c.myform=a},a.resetForm=function(){c.myform=f.get({formId:d.formId})},c.openDeleteModal=function(){c.deleteModal=i.open({animation:c.animationsEnabled,templateUrl:"formDeleteModal.html",controller:"AdminFormController",resolve:{myForm:function(){return c.myform}}}),c.deleteModal.result.then(function(a){c.selected=a},function(){console.log("Modal dismissed at: "+new Date)})},c.cancelDeleteModal=function(){c.deleteModal&&c.deleteModal.dismiss("cancel")},c.removeCurrentForm=function(){if(c.deleteModal&&c.deleteModal.opened){c.deleteModal.close();var a=c.myform._id;if(!a)throw new Error("Error - removeCurrentForm(): $scope.myform._id does not exist");h["delete"]("/forms/"+a).then(function(a){console.log("form deleted successfully"),e.go("listForms",{},{reload:!0})},function(a){console.log("ERROR: Form could not be deleted."),console.error(a)})}},c.update=a.update=function(b,d,e,f,g){m();var i=!0;if(b||(i=!a.saveInProgress),i){var j=null;if(b||(a.saveInProgress=!0),e)c.updatePromise=h.put("/forms/"+c.myform._id,{changes:d}).then(function(b){f&&(a.myform=c.myform=b.data)})["catch"](function(a){console.log("Error occured during form UPDATE.\n"),j=a.data})["finally"](function(){if(b||(a.saveInProgress=!1),"function"==typeof g)return g(j)});else{var k=d;k.analytics&&k.analytics.visitors&&delete k.analytics.visitors,k.submissions&&delete k.submissions,c.updatePromise=h.put("/forms/"+c.myform._id,{form:k}).then(function(b){f&&(a.myform=c.myform=b.data)})["catch"](function(a){console.log("Error occured during form UPDATE.\n"),j=a.data})["finally"](function(){if(b||(a.saveInProgress=!1),"function"==typeof g)return g(j)})}}}}]),angular.module("forms").controller("ListFormsController",["$rootScope","$scope","$stateParams","$state","Forms","CurrentForm","$http","$uibModal",function(a,b,c,d,e,f,g,h){b=a,b.forms={},b.showCreateModal=!1,a.languageRegExp={regExp:/[@!#$%^&*()\-+={}\[\]|\\/'";:`.,~№?<>]+/i,test:function(a){return!this.regExp.test(a)}},b.openDeleteModal=function(a){b.deleteModal=h.open({animation:b.animationsEnabled,templateUrl:"deleteModalListForms.html",controller:["$uibModalInstance","items","$scope",function(a,b,c){c.content=b,c.cancel=c.cancelDeleteModal,c.deleteForm=function(){c.$parent.removeForm(b.formIndex)}}],resolve:{items:function(){return{currFormTitle:b.myforms[a].title,formIndex:a}}}})},b.cancelDeleteModal=function(){b.deleteModal&&b.deleteModal.dismiss("cancel")},b.findAll=function(){e.query(function(a){b.myforms=a})},b.openCreateModal=function(){b.showCreateModal||(b.showCreateModal=!0)},b.closeCreateModal=function(){b.showCreateModal&&(b.showCreateModal=!1)},b.setForm=function(a){b.myform=a},b.goToWithId=function(a,b){d.go(a,{formId:b},{reload:!0})},b.duplicateForm=function(a){var c=_.cloneDeep(b.myforms[a]);delete c._id,g.post("/forms",{form:c}).success(function(c,d,e){b.myforms.splice(a+1,0,c)}).error(function(a){console.error(a),null===a&&(b.error=a.data.message)})},b.createNewForm=function(){var a={};a.title=b.forms.createForm.title.$modelValue,a.language=b.forms.createForm.language.$modelValue,b.forms.createForm.$valid&&b.forms.createForm.$dirty&&g.post("/forms",{form:a}).success(function(a,c,d){b.goToWithId("viewForm.create",a._id+"")}).error(function(a){console.error(a),b.error=a.data.message})},b.removeForm=function(a){if(a>=b.myforms.length||a<0)throw new Error("Error: form_index in removeForm() must be between 0 and "+b.myforms.length-1);g["delete"]("/forms/"+b.myforms[a]._id).success(function(c,d,e){b.myforms.splice(a,1),b.cancelDeleteModal()}).error(function(a){console.error(a)})}}]),angular.module("forms").directive("configureFormDirective",["$rootScope","$http","Upload","CurrentForm",function(a,b,c,d){return{templateUrl:"modules/forms/admin/views/directiveViews/form/configure-form.client.view.html",restrict:"E",scope:{myform:"=",user:"=",pdfFields:"@",formFields:"@"},controller:["$scope",function(b){b.log="",b.languages=a.languages,b.resetForm=a.resetForm,b.update=a.update}]}}]),angular.module("forms").directive("editFormDirective",["$rootScope","FormFields","$uibModal",function(a,b,c){return{templateUrl:"modules/forms/admin/views/directiveViews/form/edit-form.client.view.html",restrict:"E",transclude:!0,scope:{myform:"="},controller:["$scope",function(d){var e;d.sortableOptions={appendTo:".dropzone",helper:"clone",forceHelperSize:!0,forcePlaceholderSize:!0,update:function(a,b){console.log(b),console.log(a),console.log(d.myform.form_fields),d.update(!1,d.myform,!1,!1,function(a){})},start:function(a,b){}},d.openEditModal=function(a){d.editFieldModal=c.open({animation:!0,templateUrl:"editFieldModal.html",windowClass:"edit-modal-window",controller:["$uibModalInstance","$scope",function(b,c){c.field=a,c.showLogicJump=!1,c.showAddOptions=function(a){return"dropdown"===a.fieldType||"checkbox"===a.fieldType||"radio"===a.fieldType},c.validShapes=["Heart","Star","thumbs-up","thumbs-down","Circle","Square","Check Circle","Smile Outlined","Hourglass","bell","Paper Plane","Comment","Trash"],c.addOption=function(a){if("checkbox"===a.fieldType||"dropdown"===a.fieldType||"radio"===a.fieldType){a.fieldOptions||(a.fieldOptions=[]);var b=a.fieldOptions.length+1,c={option_id:Math.floor(1e5*Math.random()),option_title:"Option "+b,option_value:"Option "+b};a.fieldOptions.push(c)}},c.deleteOption=function(a,b){if("checkbox"===a.fieldType||"dropdown"===a.fieldType||"radio"===a.fieldType)for(var c=0;c',restrict:"E",scope:{typeName:"@"},controller:["$scope",function(a){var b={textfield:"fa fa-pencil-square-o",dropdown:"fa fa-th-list",date:"fa fa-calendar",checkbox:"fa fa-check-square-o",radio:"fa fa-dot-circle-o",email:"fa fa-envelope-o",textarea:"fa fa-pencil-square",legal:"fa fa-legal",file:"fa fa-cloud-upload",rating:"fa fa-star-half-o",link:"fa fa-link",scale:"fa fa-sliders",stripe:"fa fa-credit-card",statement:"fa fa-quote-left",yes_no:"fa fa-toggle-on",number:"fa fa-slack"};a.typeIcon=b[a.typeName]}]}});var __indexOf=[].indexOf||function(a){for(var b=0,c=this.length;b=0&&(c=c+b+".html"),d.get(c)};return{template:"
{{field.title}}
",restrict:"E",scope:{field:"=",required:"&",design:"=",index:"=",forms:"="},link:function(a,d){c.chooseDefaultOption=a.chooseDefaultOption=function(b){"yes_no"===b?a.field.fieldValue="true":"rating"===b?a.field.fieldValue=0:"radio"===a.field.fieldType?a.field.fieldValue=a.field.fieldOptions[0].option_value:"legal"===b&&(a.field.fieldValue="true",c.nextField())},a.setActiveField=c.setActiveField,"date"===a.field.fieldType&&(a.dateOptions={changeYear:!0,changeMonth:!0,altFormat:"mm/dd/yyyy",yearRange:"1900:-0",defaultDate:0});var e=a.field.fieldType;if("number"===a.field.fieldType||"textfield"===a.field.fieldType||"email"===a.field.fieldType||"link"===a.field.fieldType){switch(a.field.fieldType){case"textfield":a.input_type="text";break;case"email":a.input_type="email",a.placeholder="joesmith@example.com";break;case"number":a.input_type="text",a.validateRegex=/^-?\d+$/;break;default:a.input_type="url",a.placeholder="http://example.com"}e="textfield"}var g=f(e);d.html(g).show();b(d.contents())(a)}}}]),angular.module("forms").directive("onEnterKey",["$rootScope",function(a){return{restrict:"A",link:function(b,c,d){c.bind("keydown keypress",function(b){var c=b.which||b.keyCode,e=!1;null!==d.onEnterKeyDisabled&&(e=d.onEnterKeyDisabled),13!==c||b.shiftKey||e||(b.preventDefault(),a.$apply(function(){a.$eval(d.onEnterKey)}))})}}}]).directive("onTabKey",["$rootScope",function(a){return{restrict:"A",link:function(b,c,d){c.bind("keydown keypress",function(b){var c=b.which||b.keyCode;9!==c||b.shiftKey||(b.preventDefault(),a.$apply(function(){a.$eval(d.onTabKey)}))})}}}]).directive("onEnterOrTabKey",["$rootScope",function(a){return{restrict:"A",link:function(b,c,d){c.bind("keydown keypress",function(b){var c=b.which||b.keyCode;13!==c&&9!==c||b.shiftKey||(b.preventDefault(),a.$apply(function(){a.$eval(d.onEnterOrTabKey)}))})}}}]).directive("onTabAndShiftKey",["$rootScope",function(a){return{restrict:"A",link:function(b,c,d){c.bind("keydown keypress",function(b){var c=b.which||b.keyCode;9===c&&b.shiftKey&&(b.preventDefault(),a.$apply(function(){a.$eval(d.onTabAndShiftKey)}))})}}}]),angular.module("forms").directive("onFinishRender",["$rootScope",function(a){return{restrict:"A",link:function(b,c,d){if(c.attr("ng-repeat")||c.attr("data-ng-repeat")){var e=d.onFinishRender||"ngRepeat";b.$first&&!b.$last?b.$evalAsync(function(){a.$broadcast(e+" Started")}):b.$last&&b.$evalAsync(function(){a.$broadcast(e+" Finished")})}}}}]),angular.module("forms").directive("submitFormDirective",["$http","TimeCounter","$filter","$rootScope","Auth","SendVisitorData",function(a,b,c,d,e,f){return{templateUrl:"modules/forms/base/views/directiveViews/form/submit-form.client.view.html",restrict:"E",scope:{myform:"="},controller:["$document","$window","$scope",function(e,g,h){h.authentication=d.authentication,h.noscroll=!1,h.forms={};var i=h.myform.visible_form_fields.filter(function(a){return"statement"!==a.fieldType&&"rating"!==a.fieldType}).length,j=c("formValidity")(h.myform);h.translateAdvancementData={done:j,total:i,answers_not_completed:i-j},h.reloadForm=function(){h.myform.submitted=!1,h.myform.form_fields=_.chain(h.myform.visible_form_fields).map(function(a){return a.fieldValue="",a}).value(),h.loading=!1,h.error="",h.selected={_id:"",index:0},h.setActiveField(h.myform.visible_form_fields[0]._id,0,!1),b.restartClock()},g.onscroll=function(){h.scrollPos=document.body.scrollTop||document.documentElement.scrollTop||0;var a=document.getElementsByClassName("activeField")[0].getBoundingClientRect();h.fieldTop=a.top,h.fieldBottom=a.bottom;var b,c;h.noscroll||(h.selected.index===h.myform.visible_form_fields.length-1&&h.fieldBottom<200?(c=h.selected.index+1,b="submit_field",h.setActiveField(b,c,!1)):h.selected.index===h.myform.visible_form_fields.length?h.fieldTop>200&&(c=h.selected.index-1,b=h.myform.visible_form_fields[c]._id,h.setActiveField(b,c,!1)):h.fieldBottom<0?(c=h.selected.index+1,b=h.myform.visible_form_fields[c]._id,h.setActiveField(b,c,!1)):0!==h.selected.index&&h.fieldTop>0&&(c=h.selected.index-1,b=h.myform.visible_form_fields[c]._id,h.setActiveField(b,c,!1)),h.$apply())};var k=function(){if(null===h.selected)throw console.error("current active field is null"),new Error("current active field is null");return"submit_field"===h.selected._id?h.myform.form_fields.length-1:h.selected.index};h.setActiveField=d.setActiveField=function(a,b,d){if(null!==h.selected&&h.selected._id!==a){h.selected._id=a,h.selected.index=b;var f=c("formValidity")(h.myform);h.translateAdvancementData={done:f,total:i,answers_not_completed:i-f},d?(h.noscroll=!0,setTimeout(function(){e.scrollToElement(angular.element(".activeField"),-10,200).then(function(){h.noscroll=!1,setTimeout(function(){document.querySelectorAll(".activeField .focusOn").length?document.querySelectorAll(".activeField .focusOn")[0].focus():document.querySelectorAll(".activeField input").length?document.querySelectorAll(".activeField input")[0].focus():document.querySelectorAll(".activeField .selectize-input")[0].focus()})})})):setTimeout(function(){void 0!==document.querySelectorAll(".activeField .focusOn")[0]?document.querySelectorAll(".activeField .focusOn")[0].focus():void 0!==document.querySelectorAll(".activeField input")[0]&&document.querySelectorAll(".activeField input")[0].focus()})}},d.nextField=h.nextField=function(){var a,b;h.selected.index0){var a=h.selected.index-1,b=h.myform.visible_form_fields[a]._id;h.setActiveField(b,a,!0)}},h.exitStartPage=function(){h.myform.startPage.showStart=!1,h.myform.visible_form_fields.length>0&&(h.selected._id=h.myform.visible_form_fields[0]._id)},d.goToInvalid=h.goToInvalid=function(){document.querySelectorAll(".ng-invalid.focusOn")[0].focus()},d.submitForm=h.submitForm=function(d){var e=b.stopClock();h.loading=!0;var g=_.cloneDeep(h.myform);g.timeElapsed=e,g.percentageComplete=c("formValidity")(h.myform)/h.myform.visible_form_fields.length*100,delete g.visible_form_fields;for(var i=0;i-1;case a.viewPrivateForm:case a.editForm:return c.roles.indexOf(b.admin)>-1||c.roles.indexOf(b.normal)>-1}}return!1}}}}]),angular.module("users").factory("User",["$window","$q","$timeout","$http","$state",function(a,b,c,d,e){var f={getCurrent:function(){var a=b.defer();return d.get("/users/me").success(function(b){a.resolve(b)}).error(function(){a.reject("User's session has expired")}),a.promise},login:function(a){var c=b.defer();return d.post("/auth/signin",a).then(function(a){c.resolve(a.data)},function(a){c.reject(a.data.message||a.data)}),c.promise},logout:function(){var a=b.defer();return d.get("/auth/signout").then(function(b){a.resolve(null)},function(b){a.reject(b.data.message||b.data)}),a.promise},signup:function(a){var c=b.defer();return d.post("/auth/signup",a).then(function(a){c.resolve(a.data)},function(a){c.reject(a.data.message||a.data)}),c.promise},resendVerifyEmail:function(a){var c=b.defer();return d.post("/auth/verify",{email:a}).then(function(a){c.resolve(a.data)},function(a){c.reject(a.data.message||a.data)}),c.promise},validateVerifyToken:function(a){var c=/^([A-Za-z0-9]{48})$/g;if(!c.test(a))throw new Error("Error token: "+a+" is not a valid verification token");var e=b.defer();return d.get("/auth/verify/"+a).then(function(a){e.resolve(a.data)},function(a){e.reject(a.data)}),e.promise},resetPassword:function(a,c){var e=b.defer();return d.post("/auth/reset/"+c,a).then(function(a){e.resolve(a)},function(a){e.reject(a.data.message||a.data)}),e.promise},askForPasswordReset:function(a){var c=b.defer();return d.post("/auth/forgot",a).then(function(a){c.resolve(a.data)},function(a){c.reject(a.data.message||a.data)}),c.promise}};return f}]),angular.module("users").factory("Users",["$resource",function(a){return a("users",{},{update:{method:"PUT"}})}]),angular.module("core").config(["$translateProvider",function(a){a.translations("en",{MENU:"MENU",SIGNUP_TAB:"Sign Up",SIGNIN_TAB:"Sign In",SIGNOUT_TAB:"Signout",EDIT_PROFILE:"Edit Profile",MY_FORMS:"My Forms",MY_SETTINGS:"My Settings",CHANGE_PASSWORD:"Change Password"}),a.preferredLanguage("en").fallbackLanguage("en").useSanitizeValueStrategy("escape")}]),angular.module("core").config(["$translateProvider",function(a){a.translations("fr",{MENU:"MENU",SIGNUP_TAB:"Créer un Compte",SIGNIN_TAB:"Connexion",SIGNOUT_TAB:"Créer un compte",EDIT_PROFILE:"Modifier Mon Profil",MY_FORMS:"Mes Formulaires",MY_SETTINGS:"Mes Paramètres",CHANGE_PASSWORD:"Changer mon Mot de Pass"})}]),angular.module("core").config(["$translateProvider",function(a){a.translations("es",{MENU:"MENU",SIGNUP_TAB:"Registrarse",SIGNIN_TAB:"Entrar",SIGNOUT_TAB:"Salir",EDIT_PROFILE:"Editar Perfil",MY_FORMS:"Mis formularios",MY_SETTINGS:"Mis configuraciones",CHANGE_PASSWORD:"Cambiar contraseña"})}]),angular.module("forms").controller("AdminFormController",["$rootScope","$window","$scope","$stateParams","$state","Forms","CurrentForm","$http","$uibModal","myForm","$filter","$sce",function(a,b,c,d,e,f,g,h,i,j,k,l){c.trustSrc=function(a){return l.trustAsResourceUrl(a)},c.activePill=0,c.copied=!1,c.onCopySuccess=function(a){c.copied=!0},c=a,c.animationsEnabled=!0,c.myform=j,a.saveInProgress=!1,g.setForm(c.myform),c.formURL="/#!/forms/"+c.myform._id,c.myform.isLive?b.subdomainsDisabled===!0?c.actualFormURL=window.location.protocol+"//"+window.location.host+"/view"+c.formURL:window.location.host.split(".").length<3?c.actualFormURL=window.location.protocol+"//"+c.myform.admin.username+"."+window.location.host+c.formURL:c.actualFormURL=window.location.protocol+"//"+c.myform.admin.username+"."+window.location.host.split(".").slice(1,3).join(".")+c.formURL:c.actualFormURL=window.location.protocol+"//"+window.location.host+c.formURL;var m=c.refreshFrame=function(){document.getElementById("iframe")&&document.getElementById("iframe").contentWindow.location.reload()};c.tabData=[{heading:k("translate")("CONFIGURE_TAB"),templateName:"configure"}],c.setForm=function(a){c.myform=a},a.resetForm=function(){c.myform=f.get({formId:d.formId})},c.openDeleteModal=function(){c.deleteModal=i.open({animation:c.animationsEnabled,templateUrl:"formDeleteModal.html",controller:"AdminFormController",resolve:{myForm:function(){return c.myform}}}),c.deleteModal.result.then(function(a){c.selected=a},function(){console.log("Modal dismissed at: "+new Date)})},c.cancelDeleteModal=function(){c.deleteModal&&c.deleteModal.dismiss("cancel")},c.removeCurrentForm=function(){if(c.deleteModal&&c.deleteModal.opened){c.deleteModal.close();var a=c.myform._id;if(!a)throw new Error("Error - removeCurrentForm(): $scope.myform._id does not exist");h["delete"]("/forms/"+a).then(function(a){console.log("form deleted successfully"),e.go("listForms",{},{reload:!0})},function(a){console.log("ERROR: Form could not be deleted."),console.error(a)})}},c.update=a.update=function(b,d,e,f,g){m();var i=!0;if(b||(i=!a.saveInProgress),i){var j=null;if(b||(a.saveInProgress=!0),e)c.updatePromise=h.put("/forms/"+c.myform._id,{changes:d}).then(function(b){f&&(a.myform=c.myform=b.data)})["catch"](function(a){console.log("Error occured during form UPDATE.\n"),j=a.data})["finally"](function(){if(b||(a.saveInProgress=!1),"function"==typeof g)return g(j)});else{var k=d;k.analytics&&k.analytics.visitors&&delete k.analytics.visitors,k.submissions&&delete k.submissions,c.updatePromise=h.put("/forms/"+c.myform._id,{form:k}).then(function(b){f&&(a.myform=c.myform=b.data)})["catch"](function(a){console.log("Error occured during form UPDATE.\n"),j=a.data})["finally"](function(){if(b||(a.saveInProgress=!1),"function"==typeof g)return g(j)})}}}}]),angular.module("forms").controller("ListFormsController",["$rootScope","$scope","$stateParams","$state","Forms","CurrentForm","$http","$uibModal",function(a,b,c,d,e,f,g,h){b=a,b.forms={},b.showCreateModal=!1,a.languageRegExp={regExp:/[@!#$%^&*()\-+={}\[\]|\\/'";:`.,~№?<>]+/i,test:function(a){return!this.regExp.test(a)}},b.openDeleteModal=function(a){b.deleteModal=h.open({animation:b.animationsEnabled,templateUrl:"deleteModalListForms.html",controller:["$uibModalInstance","items","$scope",function(a,b,c){c.content=b,c.cancel=c.cancelDeleteModal,c.deleteForm=function(){c.$parent.removeForm(b.formIndex)}}],resolve:{items:function(){return{currFormTitle:b.myforms[a].title,formIndex:a}}}})},b.cancelDeleteModal=function(){b.deleteModal&&b.deleteModal.dismiss("cancel")},b.findAll=function(){e.query(function(a){b.myforms=a})},b.openCreateModal=function(){b.showCreateModal||(b.showCreateModal=!0)},b.closeCreateModal=function(){b.showCreateModal&&(b.showCreateModal=!1)},b.setForm=function(a){b.myform=a},b.goToWithId=function(a,b){d.go(a,{formId:b},{reload:!0})},b.duplicateForm=function(a){var c=_.cloneDeep(b.myforms[a]);delete c._id,g.post("/forms",{form:c}).success(function(c,d,e){b.myforms.splice(a+1,0,c)}).error(function(a){console.error(a),null===a&&(b.error=a.data.message)})},b.createNewForm=function(){var a={};a.title=b.forms.createForm.title.$modelValue,a.language=b.forms.createForm.language.$modelValue,b.forms.createForm.$valid&&b.forms.createForm.$dirty&&g.post("/forms",{form:a}).success(function(a,c,d){b.goToWithId("viewForm.create",a._id+"")}).error(function(a){console.error(a),b.error=a.data.message})},b.removeForm=function(a){if(a>=b.myforms.length||a<0)throw new Error("Error: form_index in removeForm() must be between 0 and "+b.myforms.length-1);g["delete"]("/forms/"+b.myforms[a]._id).success(function(c,d,e){b.myforms.splice(a,1),b.cancelDeleteModal()}).error(function(a){console.error(a)})}}]),angular.module("forms").directive("configureFormDirective",["$rootScope","$http","Upload","CurrentForm",function(a,b,c,d){return{templateUrl:"modules/forms/admin/views/directiveViews/form/configure-form.client.view.html",restrict:"E",scope:{myform:"=",user:"=",pdfFields:"@",formFields:"@"},controller:["$scope",function(b){b.log="",b.languages=a.languages,b.resetForm=a.resetForm,b.update=a.update}]}}]),angular.module("forms").directive("editFormDirective",["$rootScope","FormFields","$uibModal",function(a,b,c){return{templateUrl:"modules/forms/admin/views/directiveViews/form/edit-form.client.view.html",restrict:"E",transclude:!0,scope:{myform:"="},controller:["$scope",function(d){var e;d.sortableOptions={appendTo:".dropzone",forceHelperSize:!0,forcePlaceholderSize:!0,update:function(a,b){console.log(b.item.sortable.model),d.update(!1,d.myform,!1,!1,function(a){})},start:function(a,b){console.log(b)}},d.openEditModal=function(a){d.editFieldModal=c.open({animation:!0,templateUrl:"editFieldModal.html",windowClass:"edit-modal-window",controller:["$uibModalInstance","$scope",function(b,c){c.field=a,c.showLogicJump=!1,c.showAddOptions=function(a){return"dropdown"===a.fieldType||"checkbox"===a.fieldType||"radio"===a.fieldType},c.validShapes=["Heart","Star","thumbs-up","thumbs-down","Circle","Square","Check Circle","Smile Outlined","Hourglass","bell","Paper Plane","Comment","Trash"],c.addOption=function(a){if("checkbox"===a.fieldType||"dropdown"===a.fieldType||"radio"===a.fieldType){a.fieldOptions||(a.fieldOptions=[]);var b=a.fieldOptions.length+1,c={option_id:Math.floor(1e5*Math.random()),option_title:"Option "+b,option_value:"Option "+b};a.fieldOptions.push(c)}},c.deleteOption=function(a,b){if("checkbox"===a.fieldType||"dropdown"===a.fieldType||"radio"===a.fieldType)for(var c=0;c',restrict:"E",scope:{typeName:"@"},controller:["$scope",function(a){var b={textfield:"fa fa-pencil-square-o",dropdown:"fa fa-th-list",date:"fa fa-calendar",checkbox:"fa fa-check-square-o",radio:"fa fa-dot-circle-o",email:"fa fa-envelope-o",textarea:"fa fa-pencil-square",legal:"fa fa-legal",file:"fa fa-cloud-upload",rating:"fa fa-star-half-o",link:"fa fa-link",scale:"fa fa-sliders",stripe:"fa fa-credit-card",statement:"fa fa-quote-left",yes_no:"fa fa-toggle-on",number:"fa fa-slack"};a.typeIcon=b[a.typeName]}]}});var __indexOf=[].indexOf||function(a){for(var b=0,c=this.length;b=0&&(c=c+b+".html"),d.get(c)};return{template:"
{{field.title}}
",restrict:"E",scope:{field:"=",required:"&",design:"=",index:"=",forms:"="},link:function(a,d){c.chooseDefaultOption=a.chooseDefaultOption=function(b){"yes_no"===b?a.field.fieldValue="true":"rating"===b?a.field.fieldValue=0:"radio"===a.field.fieldType?a.field.fieldValue=a.field.fieldOptions[0].option_value:"legal"===b&&(a.field.fieldValue="true",c.nextField())},a.setActiveField=c.setActiveField,"date"===a.field.fieldType&&(a.dateOptions={changeYear:!0,changeMonth:!0,altFormat:"mm/dd/yyyy",yearRange:"1900:-0",defaultDate:0});var e=a.field.fieldType;if("number"===a.field.fieldType||"textfield"===a.field.fieldType||"email"===a.field.fieldType||"link"===a.field.fieldType){switch(a.field.fieldType){case"textfield":a.input_type="text";break;case"email":a.input_type="email",a.placeholder="joesmith@example.com";break;case"number":a.input_type="text",a.validateRegex=/^-?\d+$/;break;default:a.input_type="url",a.placeholder="http://example.com"}e="textfield"}var g=f(e);d.html(g).show();b(d.contents())(a)}}}]),angular.module("forms").directive("onEnterKey",["$rootScope",function(a){return{restrict:"A",link:function(b,c,d){c.bind("keydown keypress",function(b){var c=b.which||b.keyCode,e=!1;null!==d.onEnterKeyDisabled&&(e=d.onEnterKeyDisabled),13!==c||b.shiftKey||e||(b.preventDefault(),a.$apply(function(){a.$eval(d.onEnterKey)}))})}}}]).directive("onTabKey",["$rootScope",function(a){return{restrict:"A",link:function(b,c,d){c.bind("keydown keypress",function(b){var c=b.which||b.keyCode;9!==c||b.shiftKey||(b.preventDefault(),a.$apply(function(){a.$eval(d.onTabKey)}))})}}}]).directive("onEnterOrTabKey",["$rootScope",function(a){return{restrict:"A",link:function(b,c,d){c.bind("keydown keypress",function(b){var c=b.which||b.keyCode;13!==c&&9!==c||b.shiftKey||(b.preventDefault(),a.$apply(function(){a.$eval(d.onEnterOrTabKey)}))})}}}]).directive("onTabAndShiftKey",["$rootScope",function(a){return{restrict:"A",link:function(b,c,d){c.bind("keydown keypress",function(b){var c=b.which||b.keyCode;9===c&&b.shiftKey&&(b.preventDefault(),a.$apply(function(){a.$eval(d.onTabAndShiftKey)}))})}}}]),angular.module("forms").directive("onFinishRender",["$rootScope",function(a){return{restrict:"A",link:function(b,c,d){if(c.attr("ng-repeat")||c.attr("data-ng-repeat")){var e=d.onFinishRender||"ngRepeat";b.$first&&!b.$last?b.$evalAsync(function(){a.$broadcast(e+" Started")}):b.$last&&b.$evalAsync(function(){a.$broadcast(e+" Finished")})}}}}]),angular.module("forms").directive("submitFormDirective",["$http","TimeCounter","$filter","$rootScope","Auth","SendVisitorData",function(a,b,c,d,e,f){return{templateUrl:"modules/forms/base/views/directiveViews/form/submit-form.client.view.html",restrict:"E",scope:{myform:"="},controller:["$document","$window","$scope",function(e,g,h){h.authentication=d.authentication,h.noscroll=!1,h.forms={};var i=h.myform.visible_form_fields.filter(function(a){return"statement"!==a.fieldType&&"rating"!==a.fieldType}).length,j=c("formValidity")(h.myform);h.translateAdvancementData={done:j,total:i,answers_not_completed:i-j},h.reloadForm=function(){h.myform.submitted=!1,h.myform.form_fields=_.chain(h.myform.visible_form_fields).map(function(a){return a.fieldValue="",a}).value(),h.loading=!1,h.error="",h.selected={_id:"",index:0},h.setActiveField(h.myform.visible_form_fields[0]._id,0,!1),b.restartClock()},g.onscroll=function(){h.scrollPos=document.body.scrollTop||document.documentElement.scrollTop||0;var a=document.getElementsByClassName("activeField")[0].getBoundingClientRect();h.fieldTop=a.top,h.fieldBottom=a.bottom;var b,c;h.noscroll||(h.selected.index===h.myform.visible_form_fields.length-1&&h.fieldBottom<200?(c=h.selected.index+1,b="submit_field",h.setActiveField(b,c,!1)):h.selected.index===h.myform.visible_form_fields.length?h.fieldTop>200&&(c=h.selected.index-1,b=h.myform.visible_form_fields[c]._id,h.setActiveField(b,c,!1)):h.fieldBottom<0?(c=h.selected.index+1,b=h.myform.visible_form_fields[c]._id,h.setActiveField(b,c,!1)):0!==h.selected.index&&h.fieldTop>0&&(c=h.selected.index-1,b=h.myform.visible_form_fields[c]._id,h.setActiveField(b,c,!1)),h.$apply())};var k=function(){if(null===h.selected)throw console.error("current active field is null"),new Error("current active field is null");return"submit_field"===h.selected._id?h.myform.form_fields.length-1:h.selected.index};h.setActiveField=d.setActiveField=function(a,b,d){if(null!==h.selected&&h.selected._id!==a){h.selected._id=a,h.selected.index=b;var f=c("formValidity")(h.myform);h.translateAdvancementData={done:f,total:i,answers_not_completed:i-f},d?(h.noscroll=!0,setTimeout(function(){e.scrollToElement(angular.element(".activeField"),-10,200).then(function(){h.noscroll=!1,setTimeout(function(){document.querySelectorAll(".activeField .focusOn").length?document.querySelectorAll(".activeField .focusOn")[0].focus():document.querySelectorAll(".activeField input").length?document.querySelectorAll(".activeField input")[0].focus():document.querySelectorAll(".activeField .selectize-input")[0].focus()})})})):setTimeout(function(){void 0!==document.querySelectorAll(".activeField .focusOn")[0]?document.querySelectorAll(".activeField .focusOn")[0].focus():void 0!==document.querySelectorAll(".activeField input")[0]&&document.querySelectorAll(".activeField input")[0].focus()})}},d.nextField=h.nextField=function(){var a,b;h.selected.index0){var a=h.selected.index-1,b=h.myform.visible_form_fields[a]._id;h.setActiveField(b,a,!0)}},h.exitStartPage=function(){h.myform.startPage.showStart=!1,h.myform.visible_form_fields.length>0&&(h.selected._id=h.myform.visible_form_fields[0]._id)},d.goToInvalid=h.goToInvalid=function(){document.querySelectorAll(".ng-invalid.focusOn")[0].focus()},d.submitForm=h.submitForm=function(d){var e=b.stopClock();h.loading=!0;var g=_.cloneDeep(h.myform);g.timeElapsed=e,g.percentageComplete=c("formValidity")(h.myform)/h.myform.visible_form_fields.length*100,delete g.visible_form_fields;for(var i=0;i