This file is a merged representation of a subset of the codebase, containing files not matching ignore patterns, combined into a single document by Repomix.
The content has been processed where comments have been removed, empty lines have been removed.

<file_summary>
This section contains a summary of this file.

<purpose>
This file contains a packed representation of a subset of the repository's contents that is considered the most important context.
It is designed to be easily consumable by AI systems for analysis, code review,
or other automated processes.
</purpose>

<file_format>
The content is organized as follows:
1. This summary section
2. Repository information
3. Directory structure
4. Repository files (if enabled)
5. Multiple file entries, each consisting of:
  - File path as an attribute
  - Full contents of the file
</file_format>

<usage_guidelines>
- This file should be treated as read-only. Any changes should be made to the
  original repository files, not this packed version.
- When processing this file, use the file path to distinguish
  between different files in the repository.
- Be aware that this file may contain sensitive information. Handle it with
  the same level of security as you would the original repository.
</usage_guidelines>

<notes>
- Some files may have been excluded based on .gitignore rules and Repomix's configuration
- Binary files are not included in this packed representation. Please refer to the Repository Structure section for a complete list of file paths, including binary files
- Files matching these patterns are excluded: **/.git/**, **/.github/**, **/node_modules/**, **/vendor/**, **/third_party/**, **/external/**, **/libs/**, **/lib/**, **/bin/**, **/obj/**, **/build/**, **/dist/**, **/target/**, **/out/**, **/release/**, **/debug/**, **/wwwroot/**, **/public/**, **/assets/**, **/static/**, **/[tT]est/**, **/[tT]ests/**, **/__tests__/**, **/[lL]ogs/**, **/[mM]igrations/**, **/.vs/**, **/.vscode/**, **/.idea/**, **/.pnpm-store/**, **/.yarn/**, **/.npm/**, **/__pycache__/**, **/.pytest_cache/**, **/.mypy_cache/**, **/.gradle/**, **/.mvn/**, **/coverage/**, **/.coverage/**, **/reports/**, **/report/**, **/TestResults/**, **/tmp/**, **/temp/**, **/.tmp/**, **/.cache/**, **/.history/**, **/.DS_Store, **/Thumbs.db, **/*.log, **/*.out, **/*.err, **/*.trace, **/*.trc, **/*.tmp, **/*.cache, **/*.dmp, **/*.dump, **/*.core, **/*.binlog, **/*.ndjson, **/*.jsonl, **/*.csv, **/*.evtx, **/*.etl, **/*.access, **/*.error, **/*.exe, **/*.dll, **/*.so, **/*.dylib, **/*.bin, **/*.app, **/*.msi, **/*.apk, **/*.ipa, **/*.lib, **/*.a, **/*.o, **/*.obj, **/*.lo, **/*.lai, **/*.class, **/*.jar, **/*.war, **/*.ear, **/*.pdb, **/*.idb, **/*.ilk, **/*.nupkg, **/*.snupkg, **/*.gem, **/*.whl, **/*.egg, **/*.deb, **/*.rpm, **/*.zip, **/*.tar, **/*.gz, **/*.tgz, **/*.rar, **/*.bz2, **/*.xz, **/*.7z, **/*.lz, **/*.lzma, **/*.min.js, **/*.min.css, **/*.map, **/*.css, **/*.scss, **/*.sass, **/*.less, **/*.jpg, **/*.jpeg, **/*.png, **/*.gif, **/*.bmp, **/*.tif, **/*.tiff, **/*.webp, **/*.heif, **/*.heic, **/*.svg, **/*.eps, **/*.ai, **/*.raw, **/*.cr2, **/*.cr3, **/*.nef, **/*.arw, **/*.dng, **/*.orf, **/*.rw2, **/*.avif, **/*.apng, **/*.ico, **/*.psd, **/*.psb, **/*.xcf, **/*.hdr, **/*.exr, **/*.dcm, **/*.dicom, **/*.fits, **/*.ppm, **/*.pgm, **/*.pbm, **/*.j2k, **/*.jp2, **/*.pcx, **/*.tga, **/*.iff, **/*.sgi, **/*.ras, **/*.coverage, **/*.lcov, **/*.gcov, **/*.gcda, **/*.gcno, **/*.generated, **/*.g.cs, **/*.designer.cs, **/*.lock, **/*.lock.json, **/*.eot, **/*.ttf, **/*.woff, **/*.woff2, **/*.pfx, **/*.p12, **/*.cer, **/*.crt, **/*.key, **/*.editorconfig, **/*.tool-versions, **/*.onnx, **/*.pt, **/*.pth, **/*.h5, **/*.ckpt, **/*.sln, **/*.csproj, **/*.config, **/*.user, **/*.vsidx, **/*.v2, **/*.db*, **/.*ignore, **/.git*, **/*.config.*, **/*.bzl, **/BUILD, **/BUILD.bazel, **/pom.xml, **/build.gradle, **/settings.gradle, **/gradlew, **/gradlew.bat, **/Makefile, **/CMakeLists.txt, **/*.cmake, **/*.mk, **/*.proto, **/*.avsc, **/*.pdl, **/*.cddl, **/*.thrift, **/*.smithy, **/.idea/**, **/.vscode/**, **/.eclipse/**, **/.settings/**, **/gen/**, **/generated/**, **/auto/**, **/out/**, **/build/**, **/dist/**, **/node_modules/**, **/bower_components/**, **/vendor/**, **/locale/**, **/*.lock, **/*.example, **/*.dist, **/*.production, **/*.development, **/.env*, **/.gitignore, **/.gitattributes, **/.editorconfig, **/.eslintignore, **/.eslintrc*, **/.prettierignore, **/.jshintrc, **/.flowconfig, **/.npmrc, **/.babelrc, **/.bowerrc, **/*.zip, **/*.tar, **/*.gz, **/*.tgz, **/*.rar, **/*.7z, **/*.png, **/*.jpg, **/*.jpeg, **/*.gif, **/*.svg, **/*.ico, **/*.woff, **/*.woff2, **/*.ttf, **/*.otf, **/*.eot
- Files matching patterns in .gitignore are excluded
- Files matching default ignore patterns are excluded
- Code comments have been removed from supported file types
- Empty lines have been removed from all files
- Files are sorted by Git change count (files with more changes are at the bottom)
</notes>

</file_summary>

<directory_structure>
admin/
  admin.php
  index.php
application/
  commands/
    AddNotificationCommand.php
    CheckIntegrityCommand.php
    CompileAssetsCommand.php
    console.php
    DemomodeCommand.php
    FlushAssetsCommand.php
    ImportSurveyCommand.php
    InstallCommand.php
    InstallFromConfigCommand.php
    PluginCommand.php
    ResetPasswordCommand.php
    TwigCommand.php
    UpdateDbCommand.php
    ValidateExpressionCommand.php
    WipeCommand.php
    XmlTranslationCommand.php
  config/
    rest/
      v1/
        example/
          survey-patch-all.json
          survey-post-template.json
          survey-responses-patch.json
        auth.php
        file-upload.php
        i18n.php
        permissions.php
        site-settings.php
        statistics.php
        survey-group.php
        survey-responses.php
        survey.php
        user.php
        version-info.php
      v1.php
    config-defaults.php
    config-sample-dblib.php
    config-sample-mysql.php
    config-sample-pgsql.php
    config-sample-sqlsrv.php
    console.php
    email.php
    fonts.php
    index.html
    internal.php
    ldap.php
    packages.php
    questiontypes.php
    rest.php
    routes.php
    tcpdf.php
    updater_version.php
    vendor.php
  controllers/
    admin/
      Authentication.php
      CheckIntegrity.php
      ConditionsAction.php
      Database.php
      DatabaseUpdate.php
      DataEntry.php
      dumpdb.php
      EmailTemplates.php
      Export.php
      Expressions.php
      ExpressionValidate.php
      globalsettings.php
      HtmlEditorPop.php
      index.html
      Labels.php
      NotificationController.php
      ParticipantsAction.php
      PluginHelper.php
      PluginManagerController.php
      PrintableSurvey.php
      QuestionThemes.php
      RemoteControl.php
      Saved.php
      Statistics.php
      SurveymenuController.php
      SurveymenuEntryController.php
      SurveysGroupsController.php
      Themes.php
      Tokens.php
      TutorialEntryController.php
      TutorialsController.php
      Update.php
      UserAction.php
    survey/
      SurveyIndex.php
    AdminController.php
    AjaxAlertController.php
    AssessmentController.php
    DashboardController.php
    EditorLinkController.php
    FailedEmailController.php
    HomepageSettingsController.php
    index.html
    InstallerController.php
    LimereplacementfieldsController.php
    LSBaseController.php
    OptinController.php
    OptoutController.php
    PluginsController.php
    PrintanswersController.php
    QuestionAdministrationController.php
    QuestionGroupsAdministrationController.php
    QuickTranslationController.php
    QuotasController.php
    RegisterController.php
    ResponsesController.php
    RestController.php
    SmtpOAuthController.php
    StatisticsUserController.php
    SurveyAdministrationController.php
    SurveyController.php
    SurveyPermissionsController.php
    SurveysController.php
    SurveysGroupsPermissionController.php
    ThemeOptionsController.php
    UploaderController.php
    UserGroupController.php
    UserManagementController.php
    UserRoleController.php
    VerificationController.php
  core/
    db/
      DbConnection.php
      LimeSurveyMssqlPdoAdapter.php
      LSMssqlDbCommandBuilder.php
      LSMysqlDbCommandBuilder.php
      LSPgsqlDbCommandBuilder.php
      MssqlSchema.php
      MysqlSchema.php
      PgsqlSchema.php
    plugins/
      AuditLog/
        AuditLog.php
        config.xml
        mdlAuditLog.php
      Authdb/
        Authdb.php
        config.xml
      AuthLDAP/
        AuthLDAP.php
        config.xml
      Authwebserver/
        Authwebserver.php
        config.xml
      AzureOAuthSMTP/
        views/
          Help.twig
        AzureOAuthSMTP.php
        config.xml
      ComfortUpdateChecker/
        helpers/
          CUCMenuClass.php
        ComfortUpdateChecker.php
        config.xml
      customToken/
        config.xml
        customToken.php
        LICENSE.txt
        README.md
      dateFunctions/
        config.xml
        dateFunctions.php
        EMFunctions.php
      ExportR/
        config.xml
        ExportR.php
        RDataWriter.php
        RSyntaxWriter.php
      ExportSPSSsav/
        config.xml
        ExportSPSSsav.php
        SPSSWriter.php
      ExportSTATAxml/
        config.xml
        ExportSTATAxml.php
        STATAxmlWriter.php
      ExpressionAnswerOptions/
        views/
          expressionAnswerOptionsInfo.twig
        AnswerOptionsFunctions.php
        config.xml
        ExpressionAnswerOptions.php
        LICENSE
        README.md
      expressionFixedDbVar/
        config.xml
        expressionFixedDbVar.php
      expressionQuestionForAll/
        config.xml
        expressionQuestionForAll.php
      expressionQuestionHelp/
        sample/
          limesurvey_survey_expressionQuestionHelp.lss
        config.xml
        expressionQuestionHelp.php
      FunctionStatic/
        views/
          StaticFunctionsInfo.twig
        config.xml
        FunctionStatic.php
        README.md
        StaticFunctions.php
      GoogleOAuthSMTP/
        views/
          Help.twig
        config.xml
        GoogleOAuthSMTP.php
      mailSenderToFrom/
        config.xml
        mailSenderToFrom.php
      oldUrlCompat/
        config.xml
        oldUrlCompat.php
      PasswordRequirement/
        config.xml
        PasswordRequirement.php
      ReactEditor/
        js/
          activateEditor.js
        views/
          _modalActivateDeactivateEditor.php
        autoload.php
        config.xml
        EditorMessages.php
        EditorSlides.php
        ReactEditor.php
      statFunctions/
        config.xml
        countFunctions.php
        questionCodeHelper.php
        statFunctions.php
      TwoFactorAdminLogin/
        helper/
          phpqrcode.php
          TFAHelper.php
          TFAMenuClass.php
          TFAQrCodeGenerator.php
          TFAYubikeyOtpHelper.php
        installer/
          TFAPluginInstaller.php
        models/
          TFAUser.php
          TFAUserKey.php
        views/
          _partial/
            create.php
            error.php
            unset.php
          index.php
          userindex.php
        composer.json
        config.xml
        index.html
        TwoFactorAdminLogin.php
      UpdateCheck/
        config.xml
        UpdateCheck.php
    QuestionTypes/
      5PointChoice/
        DataSetFivePointChoice.php
        RenderFivePointChoice.php
      Array10ChoiceQuestions/
        DataSetArray10ChoiceQuestion.php
        RenderArray10ChoiceQuestion.php
      Array5ChoiceQuestions/
        DataSetArray5ChoiceQuestion.php
        RenderArray5ChoiceQuestion.php
      ArrayFlexibleColumn/
        DataSetArrayFlexibleColumn.php
        RendererArrayFlexibleColumn.php
      ArrayFlexibleRow/
        DataSetArrayFlexibleRow.php
        RenderArrayFlexibleRow.php
      ArrayMultiFlexNumbers/
        DataSetArrayMultiFlexNumbers.php
        RenderArrayMultiFlexNumbers.php
      ArrayMultiFlexText/
        DataSetArrayMultiFlexText.php
        RenderArrayMultiFlexText.php
      ArrayMultiscale/
        DataSetArrayMultiscale.php
        RenderArrayMultiscale.php
      ArrayOfIncSameDecQuestions/
        DataSetArrayOfIncSameDecQuestions.php
        RenderArrayOfIncSameDecQuestions.php
      ArrayYesUncertainNo/
        DataSetArrayYesUncertainNo.php
        RenderArrayYesUncertainNo.php
      BoilerplateQuestion/
        DataSetBoilerplate.php
        RenderBoilerplate.php
      Date/
        DataSetDate.php
        RenderDate.php
      DummyQuestion/
        DataSetDummyQuestion.php
        RenderDummyQuestion.php
      Equation/
        DataSetEquation.php
        RenderEquation.php
      FileUpload/
        DataSetFileUpload.php
        RenderFileUpload.php
      GenderDropdown/
        DataSetGenderDropdown.php
        RenderGenderDropdown.php
      HugeFreeText/
        DataSetHugeFreeText.php
        RenderHugeFreeText.php
      Language/
        DataSetLanguage.php
        RenderLanguageSelector.php
      ListDropdown/
        DataSetListDropdown.php
        RenderListDropdown.php
      ListRadio/
        DataSetListRadio.php
        RenderListRadio.php
      ListWithComment/
        DataSetListWithComment.php
        RenderListComment.php
      LongFreeText/
        DataSetLongFreeText.php
        RenderLongFreeText.php
      MultipleChoice/
        DataSetMultipleChoice.php
        RenderMultipleChoice.php
      MultipleChoiceWithComments/
        DataSetMultipleChoiceWithComments.php
        RenderMultipleChoiceWithComments.php
      MultipleNumericalQuestion/
        DataSetMultipleNumerical.php
        RenderMultipleNumerical.php
      MultipleShortText/
        DataSetMultipleShortText.php
        RenderMultipleShortText.php
      Numerical/
        DataSetNumerical.php
        RenderNumerical.php
      RankingStyle/
        DataSetRanking.php
        RenderRanking.php
      ShortFreeText/
        DataSetShortFreeText.php
        RenderShortFreeText.php
      YesNoRadio/
        DataSetYesNoRadio.php
        RenderYesNoRadio.php
      LoadQuestionTypes.php
    Traits/
      LSApplicationTrait.php
    utils/
      fileExtensions.php
    web/
      DbHttpSession.php
    AuthPluginBase.php
    ConsoleApplication.php
    ConsoleHttpSession.php
    LimeMailer.php
    LS_Twig_Debug_Extension.php
    LS_Twig_Extension.php
    LSAuthResult.php
    LSBootstrap.php
    LSCActiveDataProvider.php
    LSCaptcha.php
    LSDbCriteria.php
    LsDefaultDataSets.php
    LSETwigViewRenderer.php
    LSFileHelper.php
    LSGettextMoFile.php
    LSHttpRequest.php
    LSMessageSource.php
    LSSodium.php
    LSSodiumOld.php
    LSUserException.php
    LSUserIdentity.php
    LSWebUser.php
    LSYii_Application.php
    LSYii_AssetManager.php
    LSYii_CaseValidator.php
    LSYii_ClientScript.php
    LSYii_CompareInsensitiveValidator.php
    LSYii_Controller.php
    LSYii_DisableUpdateValidator.php
    LSYii_EmailIDNAValidator.php
    LSYii_FilterValidator.php
    LSYii_HtmlPurifier.php
    LSYii_ImageValidator.php
    LSYii_Locale.php
    LSYii_NonFormulaValidator.php
    LSYii_NoUpdateValidator.php
    LSYii_ShortUrlValidator.php
    LSYii_Validators.php
    PluginBase.php
    PluginEvent.php
    PluginManager.php
    StaticModel.php
    SurveyCommonAction.php
    TopbarConfiguration.php
    WrongTemplateVersionException.php
  datavalueobjects/
    BlacklistResult.php
    CopyQuestionTextValues.php
    CopyQuestionValues.php
    EmailPluginInfo.php
    FormElement.php
    GeneralOption.php
    OperationResult.php
    SimpleSurveyValues.php
    SwitchOption.php
    ThemeFileCategory.php
    ThemeFileInfo.php
    TypedMessage.php
  errors/
    error_404.php
    error_db.php
    error_general.php
    error_php.php
    index.html
  exceptions/
    CPDBException.php
  extensions/
    AccordionWidget/
      views/
        accordion.php
      AccordionWidget.php
    admin/
      BoxesWidget/
        views/
          box.php
          boxes.php
        BoxesWidget.php
      grid/
        BarActionsWidget/
          views/
            action_list.php
          BarActionsWidget.php
        ColumnFilterWidget/
          views/
            columns_filter.php
          ColumnFilterWidget.php
        FloatingActionsWidget/
          actions/
            AttributeListMassiveActions.php
            FailedEmailMassiveActions.php
            ParticipantListMassiveActions.php
            QuestionListMassiveActions.php
            QuestionThemeMassiveActions.php
            QuotaListMassiveActions.php
            ResponseListMassiveActions.php
            SurveyListMassiveActions.php
            SurveyMenuEntriesMassiveActions.php
            SurveyMenuListMassiveActions.php
            SurveyThemeMassiveActions.php
            TokenListMassiveActions.php
            UserManagementMassiveActions.php
            UserRoleListMassiveActions.php
          views/
            floating_bar.php
          FloatingActionsWidget.php
        GridActionsWidget/
          views/
            action_dropdown.php
            dropdown_item.php
          GridActionsWidget.php
        MassiveActionsWidget/
          views/
            modals/
              _cancel_base.php
              cancel-add.php
              cancel-apply.php
              cancel-change.php
              cancel-delete.php
              cancel-export.php
              cancel-resend.php
              cancel-save.php
              empty-lg.php
              empty.php
              first-select.php
              unknown_modal_type.php
              yes-no-lg.php
              yes-no.php
            _selected_items.php
            listOfActions.php
            selector.php
          MassiveActionsWidget.php
          README.md
        views/
          template.php
        CLSGridView.php
        CLSYiiPager.php
      PreviewModalWidget/
        views/
          grouped_select_modal.php
          open_modal_button.php
          select_modal.php
          simple_grouped_select.php
          simple_select.php
        PreviewModalWidget.php
      SearchBoxWidget/
        views/
          searchBox.php
        SearchBoxWidget.php
      survey/
        LanguagesWidget/
          LanguagesWidget.php
        ListSurveysWidget/
          views/
            massive_actions/
              _action_results.php
              _change_survey_group.php
              _expiry_dialog.php
              _export_archive_results.php
              _select_survey_theme.php
              _selector.php
            listSurveys.php
          ListSurveysWidget.php
          README.md
        question/
          PositionWidget/
            views/
              ajax_form_group.php
              form_group.php
              no_group.php
              unknown_view.php
            PositionWidget.php
            README.md
        SurveySidemenuWidget/
          views/
            sidebarIconsItem.php
            sidemenu.php
            sideMenuLogo.php
          SideMenuActiveItemMapper.php
          SurveySidemenuWidget.php
      TextDisplaySwitch/
        views/
          default.php
          short.php
        README.md
        TextDisplaySwitch.php
    AdminFooter/
      views/
        footer.php
      AdminFooter.php
    AdvancedSettingWidget/
      views/
        buttongroup.php
        columns.php
        float.php
        integer.php
        layout.php
        singleselect.php
        switch.php
        text.php
        textarea.php
      AdvancedSettingWidget.php
    AlertWidget/
      views/
        alert.php
        error-summary.php
      AlertWidget.php
    BaselineModalWidget/
      views/
        modal.php
      BaselineModalWidget.php
    bootstrap5/
      behaviors/
        TbWidget.php
      helpers/
        TbArray.php
        TbHtml.php
      widgets/
        TbActiveForm.php
        TbButtonColumn.php
        TbDataColumn.php
        TbGridView.php
        TbModal.php
      README.md
    BreadcrumbWidget/
      views/
        breadcrumb.php
      BreadcrumbWidget.php
    ButtonGroupWidget/
      views/
        buttongroup.php
      ButtonGroupWidget.php
    ButtonWidget/
      views/
        button.php
      ButtonWidget.php
      README.md
    captchaExtended/
      fonts/
        readme.txt
      CaptchaExtendedAction.php
      CaptchaExtendedValidator.php
      CHANGELOG
      LICENSE
      README
      words.de.txt
      words.en.txt
      words.ru.txt
      words.sk.txt
      words.txt
    DateTimePickerWidget/
      views/
        datetimepicker.php
      DateTimePicker.php
      README.md
    FlashMessage/
      views/
        message.php
      FlashMessage.php
    GeneralOptionWidget/
      settings/
        ClearDefaultGeneralOption.php
        EncryptionGeneralOption.php
        GroupSelectorGeneralOption.php
        MandatoryGeneralOption.php
        OtherGeneralOption.php
        QuestionThemeGeneralOption.php
        RelevanceEquationGeneralOption.php
        SaveAsDefaultGeneralOption.php
        ValidationGeneralOption.php
      views/
        buttongroup.php
        layout.php
        questiongroup.php
        questiontheme.php
        switch.php
        text.php
        textarea.php
      GeneralOptionWidget.php
    InputWidget/
      views/
        input.php
      InputWidget.php
    LimeDebug/
      LimeDebug.php
    LimeScript/
      LimeScript.php
    LimeTopbarWidget/
      views/
        topbar.php
      TopbarWidget.php
    OptionsModalWidget/
      views/
        modal.php
      OptionsModalWidget.php
    PanelBoxWidget/
      views/
        box.php
        row_footer.php
        row_header.php
      PanelBoxWidget.php
    SettingsWidget/
      SettingsWidget.php
    SideBarWidget/
      views/
        side_bar.php
      SideBarWidget.php
    UserPermissionsWidget/
      views/
        table.php
      UserPermissionsWidget.php
    yii-jsoneditor/
      jsoneditor-2.3.6/
        docs/
          api.md
          usage.md
        examples/
          requirejs_demo/
            scripts/
              main.js
              require.js
            requirejs_demo.html
          01_basic_usage.html
          02_viewer.html
          03_switch_mode.html
        HISTORY.md
        jsoneditor-min.js
        jsoneditor.js
        LICENSE
        NOTICE
        README.md
      JsonEditor.php
      widget.js
    yiiwheels/
      behaviors/
        WhPlugin.php
      widgets/
        ace/
          WhAceEditor.php
        box/
          WhBox.php
        buttongroup/
          WhButtonGroup.php
        datepicker/
          WhDatePicker.php
        daterangepicker/
          WhDateRangePicker.php
        datetimepicker/
          WhDateTimePicker.php
        detail/
          WhDetailView.php
        fileupload/
          views/
            download.php
            form.php
            gallery.php
            upload.php
          WhBasicFileUpload.php
          WhFileUpload.php
        formhelpers/
          WhCountries.php
          WhDatePickerHelper.php
          WhDropDownInputWidget.php
          WhFonts.php
          WhFontSizes.php
          WhGoogleFonts.php
          WhInputWidget.php
          WhLanguages.php
          WhPhone.php
          WhSelectBox.php
          WhStates.php
          WhTimePickerHelper.php
          WhTimezones.php
        google/
          WhVisualizationChart.php
        grid/
          actions/
            WhToggleAction.php
          behaviors/
            WhChart.php
            WhResponsive.php
          operations/
            WhCountOfTypeOperation.php
            WhOperation.php
            WhPercentOfTypeEasyPieOperation.php
            WhPercentOfTypeGooglePieOperation.php
            WhPercentOfTypeOperation.php
            WhSumOperation.php
          WhGridView.php
          WhGroupGridView.php
          WhImageColumn.php
          WhRelationalColumn.php
          WhToggleColumn.php
        html5editor/
          WhHtml5Editor.php
        maskinput/
          WhMaskInput.php
        maskmoney/
          WhMaskMoney.php
        modal/
          WhModal.php
        multiselect/
          WhMultiSelect.php
        rangeslider/
          WhRangeSlider.php
        redactor/
          license.md
          WhRedactor.php
        select2/
          WhSelect2.php
        sparklines/
          WhSparklines.php
        switch/
          WhSwitch.php
        timeago/
          WhTimeAgo.php
          WhTimeAgoFormatter.php
        timepicker/
          WhTimePicker.php
        typeahead/
          WhTypeAhead.php
      composer.json
      LICENSE.txt
      README.md
      YiiWheels.php
    CallbackColumn.php
    CustomFormatter.php
    GridViewWidget.php
  helpers/
    admin/
      export/
        CsvWriter.php
        DocWriter.php
        ExcelWriter.php
        FormattingOptions.php
        HtmlWriter.php
        IWriter.php
        JsonWriter.php
        PdfWriter.php
        SurveyDao.php
        SurveyObj.php
        Translator.php
        Writer.php
      activate_helper.php
      ajax_helper.php
      backupdb_helper.php
      exportresults_helper.php
      htmleditor_helper.php
      import_helper.php
      label_helper.php
      permission_helper.php
      statistics_helper.php
      survey_helper.php
      template_helper.php
      token_helper.php
    adodb/
      adodb-time.inc_helper.php
    expressions/
      emcache/
        em_cache_exception.php
        em_cache_helper.php
      warnings/
        EMWarningAssignment.php
        EMWarningBase.php
        EMWarningHTMLBaker.php
        EMWarningInterface.php
        EMWarningInvalidComparison.php
        EMWarningLaterQuestion.php
        EMWarningPlusOperator.php
      em_core_helper.php
      em_manager_helper.php
    remotecontrol/
      remotecontrol_handle.php
    update/
      updates/
        Update_133.php
        Update_134.php
        Update_135.php
        Update_136.php
        Update_137.php
        Update_138.php
        Update_139.php
        Update_140.php
        Update_141.php
        Update_142.php
        Update_143.php
        Update_145.php
        Update_146.php
        Update_147.php
        Update_148.php
        Update_149.php
        Update_150.php
        Update_151.php
        Update_152.php
        Update_153.php
        Update_154.php
        Update_155.php
        Update_156.php
        Update_157.php
        Update_158.php
        Update_159.php
        Update_160.php
        Update_161.php
        Update_162.php
        Update_164.php
        Update_165.php
        Update_166.php
        Update_167.php
        Update_168.php
        Update_169.php
        Update_170.php
        Update_171.php
        Update_172.php
        Update_173.php
        Update_174.php
        Update_175.php
        Update_176.php
        Update_177.php
        Update_178.php
        Update_179.php
        Update_180.php
        Update_181.php
        Update_183.php
        Update_184.php
        Update_250.php
        Update_251.php
        Update_252.php
        Update_253.php
        Update_254.php
        Update_255.php
        Update_256.php
        Update_257.php
        Update_258.php
        Update_259.php
        Update_260.php
        Update_261.php
        Update_262.php
        Update_263.php
        Update_290.php
        Update_291.php
        Update_293.php
        Update_294.php
        Update_296.php
        Update_298.php
        Update_304.php
        Update_305.php
        Update_306.php
        Update_307.php
        Update_308.php
        Update_309.php
        Update_310.php
        Update_311.php
        Update_312.php
        Update_313.php
        Update_314.php
        Update_315.php
        Update_316.php
        Update_317.php
        Update_318.php
        Update_319.php
        Update_320.php
        Update_321.php
        Update_322.php
        Update_323.php
        Update_324.php
        Update_325.php
        Update_326.php
        Update_327.php
        Update_328.php
        Update_329.php
        Update_330.php
        Update_331.php
        Update_332.php
        Update_333.php
        Update_334.php
        Update_335.php
        Update_336.php
        Update_337.php
        Update_338.php
        Update_339.php
        Update_340.php
        Update_341.php
        Update_342.php
        Update_343.php
        Update_344.php
        Update_345.php
        Update_346.php
        Update_347.php
        Update_348.php
        Update_349.php
        Update_350.php
        Update_351.php
        Update_352.php
        Update_353.php
        Update_354.php
        Update_355.php
        Update_356.php
        Update_357.php
        Update_358.php
        Update_359.php
        Update_360.php
        Update_363.php
        Update_364.php
        Update_400.php
        Update_401.php
        Update_402.php
        Update_403.php
        Update_404.php
        Update_405.php
        Update_406.php
        Update_407.php
        Update_408.php
        Update_409.php
        Update_410.php
        Update_411.php
        Update_412.php
        Update_413.php
        Update_414.php
        Update_415.php
        Update_416.php
        Update_417.php
        Update_418.php
        Update_419.php
        Update_420.php
        Update_421.php
        Update_422.php
        Update_423.php
        Update_424.php
        Update_425.php
        Update_426.php
        Update_427.php
        Update_428.php
        Update_429.php
        Update_430.php
        Update_431.php
        Update_432.php
        Update_433.php
        Update_434.php
        Update_435.php
        Update_436.php
        Update_437.php
        Update_438.php
        Update_439.php
        Update_440.php
        Update_441.php
        Update_442.php
        Update_443.php
        Update_444.php
        Update_445.php
        Update_446.php
        Update_447.php
        Update_448.php
        Update_449.php
        Update_450.php
        Update_451.php
        Update_452.php
        Update_453.php
        Update_460.php
        Update_470.php
        Update_471.php
        Update_472.php
        Update_473.php
        Update_475.php
        Update_476.php
        Update_477.php
        Update_478.php
        Update_479.php
        Update_480.php
        Update_481.php
        Update_482.php
        Update_483.php
        Update_484.php
        Update_485.php
        Update_486.php
        Update_487.php
        Update_488.php
        Update_489.php
        Update_490.php
        Update_491.php
        Update_492.php
        Update_493.php
        Update_494.php
        Update_495.php
        Update_600.php
        Update_601.php
        Update_602.php
        Update_603.php
        Update_604.php
        Update_605.php
        Update_606.php
        Update_607.php
        Update_608.php
        Update_609.php
        Update_610.php
        Update_611.php
        Update_612.php
        Update_613.php
        Update_614.php
        Update_615.php
        Update_616.php
        Update_617.php
        Update_618.php
        Update_619.php
        Update_620.php
        Update_621.php
        Update_622.php
        Update_623.php
        Update_624.php
        Update_625.php
        Update_626.php
        Update_627.php
        Update_628.php
        Update_629.php
        Update_630.php
        Update_631.php
        Update_632.php
        Update_633.php
        Update_634.php
        Update_636.php
        Update_637.php
        Update_638.php
        Update_639.php
        Update_640.php
        Update_641.php
        Update_642.php
        Update_643.php
        Update_644.php
        Update_645.php
        Update_646.php
        Update_647.php
        Update_648.php
        Update_649.php
        Update_650.php
        Update_651.php
        Update_700.php
        Update_701.php
        Update_702.php
        Update_703.php
        Update_704.php
        Update_705.php
        Update_706.php
        Update_707.php
        Update_708.php
        Update_709.php
        Update_710.php
        Update_711.php
        Update_712.php
        Update_713.php
        Update_714.php
        Update_715.php
        Update_716.php
        Update_717.php
      DatabaseUpdateBase.php
      README.md
      update_helper.php
      updatedb_helper.php
    ClassFactory.php
    common_helper.php
    ConfigMergeHelper.php
    database_helper.php
    DbVersionHelper.php
    export_helper.php
    frontend_helper.php
    globals.php
    Hash.php
    index.html
    LayoutHelper.php
    ldap_helper.php
    pdfHelper.php
    qanda_helper.php
    questionHelper.php
    questionIndexHelper.php
    replacements_helper.php
    sanitize_helper.php
    SortHelper.php
    statisticschart_helper.php
    SurveyRuntimeHelper.php
    SurveyThemeHelper.php
    surveytranslator_helper.php
    userstatistics_helper.php
    viewHelper.php
    ZipHelper.php
  libraries/
    admin/
      pdf.php
      quexmlpdf.php
      settingsstorage.php
    Api/
      Authentication/
        AuthenticationException.php
        AuthenticationInterface.php
        AuthenticationTokenSimple.php
        SessionUtil.php
      Command/
        Mixin/
          Accessor/
            AppTrait.php
            QuestionGroupModelCollectionWithL10nsBySidTrait.php
            QuestionGroupModelTrait.php
            QuestionGroupModelWithL10nsByIdTrait.php
            QuestionModelTrait.php
            QuestionModelWithL10nsByIdAndLanguageTrait.php
            SurveyModelTrait.php
          Auth/
            AuthPermissionTrait.php
        Request/
          Request.php
        Response/
          Status/
            StatusError.php
            StatusErrorBadRequest.php
            StatusErrorForbidden.php
            StatusErrorNotFound.php
            StatusErrorUnauthorised.php
            StatusSuccess.php
            StatusSuccessCreated.php
            StatusSuccessNoContent.php
          Response.php
          ResponseFactory.php
          Status.php
        ResponseData/
          ResponseDataError.php
        V1/
          Exception/
            ExceptionInvalidUser.php
          SurveyPatch/
            Response/
              ExceptionErrorItem.php
              ExceptionErrors.php
              SurveyResponse.php
              TempIdMapItem.php
              TempIdMapping.php
              ValidationErrorItem.php
              ValidationErrors.php
            Traits/
              OpHandlerExceptionTrait.php
              OpHandlerQuestionTrait.php
              OpHandlerSurveyTrait.php
              OpHandlerValidationTrait.php
            OpHandlerAnswer.php
            OpHandlerAnswerDelete.php
            OpHandlerImport.php
            OpHandlerLanguageSettingsUpdate.php
            OpHandlerQuestionAttributeUpdate.php
            OpHandlerQuestionCondition.php
            OpHandlerQuestionCreate.php
            OpHandlerQuestionDelete.php
            OpHandlerQuestionGroup.php
            OpHandlerQuestionGroupL10n.php
            OpHandlerQuestionGroupReorder.php
            OpHandlerQuestionL10nUpdate.php
            OpHandlerQuestionUpdate.php
            OpHandlerSubQuestion.php
            OpHandlerSubquestionDelete.php
            OpHandlerSurveyAccessMode.php
            OpHandlerSurveyStatus.php
            OpHandlerSurveyUpdate.php
            OpHandlerThemeSettings.php
            PatcherSurvey.php
          SurveyResponses/
            conditions/
              ConditionHandlerHelperTrait.php
              ContainConditionHandler.php
              DateRangeConditionHandler.php
              EqualConditionHandler.php
              GreaterThanConditionHandler.php
              MultiSelectConditionHandler.php
              NullConditionHandler.php
              RangeConditionHandler.php
            patch/
              OpHandlerResponsesDelete.php
              OpHandlerResponsesFileDelete.php
              OpHandlerResponsesUpdate.php
            FilterPatcher.php
            HandlerInterface.php
            PatcherSurveyResponses.php
            ResponseMappingTrait.php
            SortingHandler.php
            SurveyRequestTrait.php
            SurveyResponseFiles.php
          Transformer/
            Input/
              TransformerInputAnswer.php
              TransformerInputAnswerL10ns.php
              TransformerInputAnswerL10nsCollection.php
              TransformerInputQuestion.php
              TransformerInputQuestionAggregate.php
              TransformerInputQuestionAttribute.php
              TransformerInputQuestionGroup.php
              TransformerInputQuestionGroupAggregate.php
              TransformerInputQuestionGroupL10ns.php
              TransformerInputQuestionGroupReorder.php
              TransformerInputQuestionL10ns.php
              TransformerInputSubQuestion.php
              TransformerInputSubQuestionAggregate.php
              TransformerInputSubQuestionL10ns.php
              TransformerInputSurvey.php
              TransformerInputSurveyLanguageSettings.php
              TransformerInputThemeSettings.php
            Output/
              TransformerOutputAnswer.php
              TransformerOutputAnswerL10ns.php
              TransformerOutputQuestion.php
              TransformerOutputQuestionAttribute.php
              TransformerOutputQuestionGroup.php
              TransformerOutputQuestionGroupL10ns.php
              TransformerOutputQuestionL10ns.php
              TransformerOutputSurvey.php
              TransformerOutputSurveyDetail.php
              TransformerOutputSurveyGroup.php
              TransformerOutputSurveyLanguageSettings.php
              TransformerOutputSurveyMenuItems.php
              TransformerOutputSurveyMenus.php
              TransformerOutputSurveyOwner.php
              TransformerOutputSurveyResponses.php
              TransformerOutputUserPermissions.php
          AuthSessionCreate.php
          AuthTokenSimpleCreate.php
          AuthTokenSimpleRefresh.php
          AuthTokenSimpleRelease.php
          ExpressionScriptValidate.php
          FileUpload.php
          I18n.php
          I18nMissing.php
          I18nRefreshLanguages.php
          SiteSettings.php
          Statistics.php
          StatisticsOverview.php
          SurveyArchive.php
          SurveyDetail.php
          SurveyGroupList.php
          SurveyGroups.php
          SurveyImport.php
          SurveyList.php
          SurveyLogic.php
          SurveyPatch.php
          SurveyQuestionsFieldname.php
          SurveyResponses.php
          SurveyResponsesExport.php
          SurveyResponsesPatch.php
          SurveyStatisticsGlance.php
          SurveyTemplate.php
          UserDetail.php
          UserList.php
          UserPermission.php
          UserSettingGetValue.php
          UserSettingSetValue.php
          VersionInfo.php
        ApiCommandException.php
        CommandInterface.php
        Exception.php
        Options.php
      Rest/
        Endpoint/
          EndpointFactory.php
        Renderer/
          RendererBasic.php
          RendererInterface.php
        V1/
          SchemaFactory/
            SchemaFactoryAnswer.php
            SchemaFactoryAuthToken.php
            SchemaFactoryError.php
            SchemaFactoryExpressionScriptValidation.php
            SchemaFactoryExpressionScriptValidationRequest.php
            SchemaFactoryI18n.php
            SchemaFactoryI18nMissingTranslations.php
            SchemaFactoryI18nMissingTranslationsResponse.php
            SchemaFactoryI18nRefreshLanguages.php
            SchemaFactoryPermission.php
            SchemaFactoryQuestion.php
            SchemaFactoryQuestionAttribute.php
            SchemaFactoryQuestionAttributes.php
            SchemaFactoryQuestionGroup.php
            SchemaFactoryQuestionGroupL10ns.php
            SchemaFactoryQuestionL10ns.php
            SchemaFactorySiteSettings.php
            SchemaFactorySurvey.php
            SchemaFactorySurveyArchive.php
            SchemaFactorySurveyDetail.php
            SchemaFactorySurveyGroup.php
            SchemaFactorySurveyGroupList.php
            SchemaFactorySurveyGroups.php
            SchemaFactorySurveyLanguageSettings.php
            SchemaFactorySurveyList.php
            SchemaFactorySurveyLogic.php
            SchemaFactorySurveyPatch.php
            SchemaFactorySurveyQuestionsFieldname.php
            SchemaFactorySurveyResponses.php
            SchemaFactorySurveyResponsesExport.php
            SchemaFactorySurveyResponsesPatch.php
            SchemaFactorySurveySingleResponse.php
            SchemaFactorySurveyStatistics.php
            SchemaFactorySurveyStatisticsGlance.php
            SchemaFactorySurveyStatisticsOverview.php
            SchemaFactorySurveyTemplate.php
            SchemaFactoryUser.php
            SchemaFactoryUserList.php
            SchemaFactoryUserPermission.php
            SchemaFactoryUserSetting.php
            SchemaFactoryVersionInfo.php
          RestRendererV1.php
        Endpoint.php
        RestConfig.php
      Transformer/
        Filter/
          Filter.php
        Formatter/
          FormatterDateTimeToJson.php
          FormatterInterface.php
          FormatterIntToBool.php
          FormatterMandatory.php
          FormatterYnToBool.php
        Output/
          TransformerOutputActiveRecord.php
        Registry/
          Registry.php
        Validator/
          ValidatorDate.php
          ValidatorEmpty.php
          ValidatorInterface.php
          ValidatorLength.php
          ValidatorNull.php
          ValidatorNumerical.php
          ValidatorRange.php
          ValidatorRegex.php
          ValidatorRequired.php
        Transformer.php
        TransformerException.php
        TransformerInterface.php
      ApiConfig.php
      ApiException.php
    ExtensionInstaller/
      ExtensionInstaller.php
      ExtensionUpdater.php
      ExtensionUpdaterServiceLocator.php
      FileFetcher.php
      FileFetcherUploadZip.php
      GitVersionFetcher.php
      PluginInstaller.php
      PluginUpdater.php
      QuestionThemeInstaller.php
      README.md
      RESTVersionFetcher.php
      ThemeUpdater.php
      VersionFetcher.php
      VersionFetcherServiceLocator.php
    FormExtension/
      Inputs/
        BaseInput.php
        CheckboxInput.php
        DefaultBaseRenderer.php
        FileInput.php
        GlobalSettingsRenderer.php
        InputInterface.php
        RawHtmlInput.php
        TextInput.php
      FormExtensionService.php
      FormExtensionWidget.php
      README.md
      SaveFailedException.php
    MenuObjects/
      views/
        _extraMenu.php
      ExtendedMenuInterface.php
      ExtendedMenuItemInterface.php
      Menu.php
      MenuButton.php
      MenuButtonInterface.php
      MenuInterface.php
      MenuItem.php
      MenuItemInterface.php
      MenuMinimalInterface.php
    ObjectPatch/
      Op/
        OpInterface.php
        OpStandard.php
      OpHandler/
        OpHandlerActiveRecordUpdate.php
        OpHandlerException.php
        OpHandlerInterface.php
      OpType/
        OpType.php
        OpTypeCreate.php
        OpTypeDelete.php
        OpTypeInterface.php
        OpTypeUpdate.php
      ObjectPatchException.php
      Patcher.php
    PluginManager/
      Storage/
        DbStorage.php
        DummyStorage.php
        iPluginStorage.php
      AuthPluginBase.php
      EmailPluginBase.php
      EventDocumentor.php
      index.php
      iPlugin.php
      LimesurveyApi.php
      PluginBase.php
      PluginEvent.php
      PluginEventContent.php
      PluginManager.php
      PluginManagerShutdownFunction.php
      SmtpOAuthPluginBase.php
    Spreadsheet/
      ExcelCellFormat.php
      ExcelWorkbookWriter.php
      ExcelWorksheetWriter.php
    Yii/
      Application/
        AppErrorHandler.php
    BigData.php
    Date_Time_Converter.php
    DI.php
    index.html
    jsonRPCClient.php
    jsonRPCServer.php
    LSjsonRPCServer.php
    LSZend_XmlRpc_Response_Http.php
    MersenneTwister.php
    Save.php
    simpletester.php
    Zip.php
  models/
    behaviors/
      PluginEventBehavior.php
    Interfaces/
      PermissionInterface.php
    services/
      EditorService/
        EditorConfig.php
        EditorRedirector.php
        EditorRequestHelper.php
      Exception/
        BadRequestException.php
        NotFoundException.php
        PermissionDeniedException.php
        PersistErrorException.php
        QuestionHasConditionsException.php
      Export/
        CsvExportWriter.php
        ExportAnswerFormatter.php
        ExportHeadingTrait.php
        ExportWriterInterface.php
        HtmlExportWriter.php
      Proxy/
        ProxyExpressionManager.php
        ProxyQuestion.php
        ProxyQuestionGroup.php
        ProxySettingsUser.php
      QuestionAggregateService/
        AnswersService.php
        AttributesService.php
        DeleteService.php
        L10nService.php
        QuestionService.php
        SaveService.php
        SubQuestionsService.php
        ValidateTrait.php
      QuestionOrderingService/
        QuestionOrderingService.php
        RandomizerHelper.php
        SortingStrategy.php
      SurveyAggregateService/
        GeneralSettings.php
        LanguageConsistency.php
        LanguageSettings.php
        TemplateConfiguration.php
        UrlParams.php
      SurveyStatistics/
        Charts/
          DailyActivity/
            DailyActivityStatistics.php
          Questions/
            Processors/
              AbstractQuestionProcessor.php
              ArrayNumbersProcessor.php
              ArrayTextProcessor.php
              DualScaleProcessor.php
              FileUploadProcessor.php
              MultipleChoiceProcessor.php
              MultipleNumericalProcessor.php
              NumericalProcessor.php
              RankingProcessor.php
              ResponseAggregateBatch.php
              SingleOptionMultipleChartsProcessor.php
              SingleOptionProcessor.php
              TextProcessor.php
            QuestionStatistics.php
          SurveyOverview/
            SurveyOverviewStatistics.php
          StatisticsChartDTO.php
          StatisticsChartInterface.php
        StatisticsResponseFilters.php
        StatisticsService.php
      CopyQuestion.php
      CopyQuestionGroup.php
      CopySurvey.php
      CopySurveyOptions.php
      CopySurveyQuotas.php
      CopySurveyResources.php
      CopySurveyResult.php
      CoreQuestionAttributeProvider.php
      CreateSurvey.php
      EditorService.php
      Exception.php
      ExportSurveyResultsService.php
      FileUploadService.php
      FilterImportedResources.php
      GroupHelper.php
      HiddenQuestionAttributeProvider.php
      IpAddressAnonymizer.php
      ParticipantAttributeService.php
      ParticipantBlacklistHandler.php
      PasswordManagement.php
      PermissionManager.php
      PluginQuestionAttributeProvider.php
      QuestionAggregateService.php
      QuestionAttributeFetcher.php
      QuestionAttributeHelper.php
      QuestionAttributeProvider.php
      QuestionGroupService.php
      QuickTranslation.php
      Quotas.php
      README.md
      SurveyAccessModeService.php
      SurveyActivate.php
      SurveyAggregateService.php
      SurveyAnswerCache.php
      SurveyCondition.php
      SurveyDeactivate.php
      SurveyDetailService.php
      SurveyIntegrity.php
      SurveyPermissions.php
      SurveyResponseService.php
      SurveysGroupCreator.php
      SurveyThemeConfiguration.php
      SurveyUseCaptcha.php
      ThemeQuestionAttributeProvider.php
      TranslationMoToJson.php
      UploadValidator.php
      UserManager.php
      ZipExtractor.php
    Traits/
      PermissionTrait.php
    AdminTheme.php
    Answer.php
    AnswerL10n.php
    ArchivedTableSettings.php
    Assessment.php
    AssetVersion.php
    Box.php
    Condition.php
    DataIntegrityChecker.php
    DefaultValue.php
    DefaultValueL10n.php
    Dynamic.php
    ExpressionError.php
    ExtensionConfig.php
    ExtensionUpdateInfo.php
    FailedEmail.php
    FailedLoginAttempt.php
    index.html
    InstallerConfigForm.php
    Label.php
    LabelL10n.php
    LabelSet.php
    LSActiveRecord.php
    MapTutorialUsers.php
    Notification.php
    Participant.php
    ParticipantAttribute.php
    ParticipantAttributeName.php
    ParticipantAttributeNameLang.php
    ParticipantAttributeValue.php
    ParticipantShare.php
    Permission.php
    Permissiontemplates.php
    Plugin.php
    PluginDynamic.php
    PluginSetting.php
    Question.php
    QuestionAttribute.php
    QuestionBaseDataSet.php
    QuestionBaseRenderer.php
    QuestionCreate.php
    QuestionGroup.php
    QuestionGroupL10n.php
    QuestionL10n.php
    QuestionTemplate.php
    QuestionTheme.php
    QuestionType.php
    Quota.php
    QuotaLanguageSetting.php
    QuotaMember.php
    Response.php
    SavedControl.php
    Session.php
    SettingGlobal.php
    SettingsUser.php
    Survey.php
    SurveyActivator.php
    SurveyDeactivator.php
    SurveyDynamic.php
    SurveyLanguageSetting.php
    SurveyLight.php
    SurveyLink.php
    Surveymenu.php
    SurveymenuEntries.php
    SurveymenuEntryData.php
    SurveysGroups.php
    SurveysGroupsettings.php
    SurveysInGroup.php
    SurveyTimingDynamic.php
    SurveyURLParameter.php
    Template.php
    TemplateConfig.php
    TemplateConfiguration.php
    TemplateManifest.php
    Timing.php
    Token.php
    TokenDynamic.php
    TokenEmptyGridFilter.php
    Tutorial.php
    TutorialEntry.php
    TutorialEntryRelation.php
    UniqueNotification.php
    UpdateForm.php
    User.php
    UserGroup.php
    UserInGroup.php
    UserInPermissionrole.php
    UserParser.php
  views/
    admin/
      authentication/
        ajaxLogin.php
        error.php
        forgotpassword.php
        login.php
        message.php
        newPassword.php
        sidebar.php
      checkintegrity/
        check_view.php
        fix_view.php
      conditions/
        includes/
          condition.php
          conditions_edit.php
          conditions_scenario.php
          copyform.php
          form_editconditions_header.php
          navigator.php
          quickAddConditionForm.php
        partial/
          topbarBtns/
            leftSideButtons.php
            rightSideButtons.php
        conditionshead_view.php
        conditionslist_view.php
        customized_conditions.php
        deleteAllConditions.php
        no_condition.php
      database/
        database_view.php
      databaseupdate/
        db.php
        verify.php
      dataentry/
        includes/
          editdata/
            edit.php
            editdata.php
        active_html_view.php
        caption_view.php
        content_view.php
        dataentry_header_view.php
        delete.php
        edit.php
        import_result.php
        import.php
        insert.php
        iteratesurvey.php
        vvimport_result.php
        vvimport.php
      dumpdb/
        dumpdb_view.php
      editor/
        _activateEditorItem.php
      emailtemplates/
        email_language_tab.php
        email_language_template_tab.php
        emailtemplates_view.php
      export/
        exportresult_panels/
          _columns-control.php
          _format.php
          _general.php
          _headings.php
          _range.php
          _responses.php
          _single-value.php
          _token-control.php
        generatestats/
          simplestats/
            _statisticsoutput_answer.php
            _statisticsoutput_arithmetic.php
            _statisticsoutput_graphs.php
            _statisticsoutput_header.php
            _statisticsoutput_nograph.php
          _header.php
          _statisticsoutput_answer.php
          _statisticsoutput_arithmetic.php
          _statisticsoutput_footer.php
          _statisticsoutput_graphs.php
          _statisticsoutput_gross_total.php
          _statisticsoutput_header.php
        statistics_subviews/
          _filter.php
          _general_filters.php
          _mainoptions.php
          _outputoptions.php
          _question.php
          _response_filter_choice.php
          _response_filters.php
          _statistics_output.php
          _statistics_view_scripts.php
        exportresults_view.php
        spss_view.php
        statistics_browse_view.php
        statistics_graph_view.php
        statistics_user_view.php
        statistics_view.php
        vv_view.php
      expressions/
        partial/
          topbarBtns/
            rightSideButtons.php
        test_view.php
        validationList.php
      globalsettings/
        partial/
          topbarBtns/
            rightSideButtons.php
          topbarBtns_surveysettings/
            rightSideButtons.php
        _bounce.php
        _email.php
        _emailTestConfirmation.php
        _emailTestResults.php
        _general.php
        _interfaces.php
        _language.php
        _overview.php
        _presentation.php
        _security.php
        _storage_ajax.php
        _storage.php
        _updates.php
        _useradministration.php
        globalSettings_view.php
        surveySettings.php
      htmleditor/
        modal_editor_partial.php
        pop_editor_view.php
        pop_nofields_view.php
      labels/
        partials/
          topbarBtns/
            leftSideButtons.php
            rightSideButtons.php
          topbarBtns_export/
            rightSideButtons.php
          topbarBtns_newimport/
            rightSideButtons.php
          topbarBtns_singlelabelset/
            leftSideButtons.php
            rightSideButtons.php
        _labelviewquickadd_view.php
        _labelviewrightcontent_view.php
        _labelviewtabcontent_view.php
        editlabel_view.php
        exportmulti_view.php
        import_view.php
        importlabelresources_view.php
        labelRow.twig
        labelsets_view.php
        labelview_view.php
      notification/
        index.php
      notifications/
        notifications.php
      participants/
        massive_actions/
          _selector_attribute.php
          _selector_share.php
          _selector.php
          _update_results.php
          _update.php
        modal_subviews/
          attributes/
            date.php
            dropdown.php
            textbox.php
          _addToSurvey.php
          _deleteParticipant.php
          _editAttribute.php
          _editParticipant.php
          _exportCSV.php
          _shareParticipant.php
          _showParticipantSurveys.php
        partial/
          topbarBtns/
            leftSideButtons.php
            rightSideButtons.php
        attributeControl_view.php
        attributeMap_view.php
        attributeMapCSV_view.php
        attributeMapToken_view.php
        blacklist_view.php
        displayParticipants_view.php
        importCSV_view.php
        participantsPanel_view.php
        sharePanel_view.php
        summary_view.php
        uploadSummary_view.php
      pluginmanager/
        partial/
          topbarBtns/
            leftSideButtons.php
        configure.php
        index.php
        overview.php
        scanFilesResult.php
        uploadConfirm.php
        uploadModal.php
      remotecontrol/
        index_view.php
      saved/
        savedbar_view.php
        savedlist_view.php
      super/
        permissions/
          addGroupForm.php
          addUserForm.php
        _configuration_menu.php
        _help_menu.php
        _renderJson.php
        admin_notifications.php
        dummy.php
        footer.php
        header.php
        help_button_dropup.php
        layout_insurvey.php
        layout_main.php
        layout_minimal.php
        messagebox.php
        quickmenu.php
        sidebody.php
      survey/
        Question/
          massive_actions/
            _delete_results.php
            _selector.php
            _set_css_class.php
            _set_question_group_position.php
            _set_questions_mandatory.php
            _set_questions_other.php
            _set_statistics_options.php
            _set_subquestansw_order.php
          subquestionsAndAnswers/
            _subquestion.twig
          _subQuestionsAndAnwsersJsVariables.php
          yesNo_defaultvalue_widget.php
        subview/
          accordion/
            _generaloptions_panel.php
            _integration_panel.php
            _notification_panel.php
            _plugin_panel.php
            _plugins_panel.php
            _presentation_panel.php
            _publication_panel.php
            _resources_panel.php
            _tokens_panel.php
          surveydashboard/
            001-sharingpanel.twig
            002-surveytextpanel.twig
            003-publicationpanel.twig
            004-generalsettingspanel.twig
            005-hintsandwarnings.twig
            006dbanalytics.twig
          _template_carousel.php
          import_ressources_modal.php
          tab_edit_view_datasecurity.php
          tab_edit_view.php
        topbar/
          topbar_view.php
        copySurvey_view.php
        editDataSecurityLocalSettings_view.php
        editLocalSettings_view.php
        newSurveyBrowserMessage.php
        organizeGroupsAndQuestions_view.php
        prepareEditorScript_view.php
        printablesurvey_view.php
        queXMLSurvey_view.php
        surveybar_addgroupquestion.php
        surveybar_displayexport.php
        surveybar_plugins.php
        surveybar_rightactionbuttons.php
        surveybar_statistics.php
        surveybar_tools.php
      SurveyFiles/
        _copymove.php
        _jsVariables.php
        _upload.php
        surveyview.php
        view.php
      surveymenu/
        massive_action/
          _selector.php
          _update_results.php
          _update.php
        partial/
          topbarBtns/
            leftSideButtons.php
            rightSideButtons.php
        _form.php
        create.php
        index.php
        shortlist.php
        update.php
      surveymenu_entries/
        massive_action/
          _selector.php
          _update_results.php
          _update.php
        _form.php
        create.php
        index.php
        shortlist.php
        update.php
      surveysgroups/
        _form.php
        create.php
        surveySettings.php
        update.php
      themes/
        partial/
          topbarBtns/
            leftSideButtons.php
        importform_view.php
        importuploaded_view.php
        templateeditor_assessments_view.php
        templateeditor_completed_view.php
        templateeditor_navigator_view.php
        templateeditor_preview.php
        templateeditor_printablesurvey_quesanswer_view.php
        templateeditor_printoutput_view.php
        templateeditor_question_answer_view.php
        templateeditor_question_answerlist_view.php
        templateeditor_question_answertext_view.php
        templateeditor_question_meta_view.php
        templateeditor_register_view.php
        templateeditorbar_view.php
        templatesummary_view.php
      token/
        attribute_subviews/
          tokenformAttributesWrapper.php
          tokenformDateInput.php
          tokenformSelect.php
          tokenformTextInput.php
        massive_actions/
          _delete_results.php
          _export_archive_results.php
          _selector.php
          _update_results.php
          _update.php
        _attributeTypeModal.php
        _bounceProcessingModal.php
        actions.php
        addtokenpost.php
        afterDeleteParticipantsTable.php
        bounce.php
        browse.php
        createParticipantsTable.php
        csvimportresult.php
        csvupload.php
        deleteParticipantsTable.php
        dummytokenform.php
        emailpost.php
        emailwarning.php
        exportdialog.php
        import.php
        invite.php
        ldapform.php
        ldappost.php
        managetokenattributes.php
        remind.php
        surveyParticipantView.php
        tokenform.php
        tokenwarning.php
      tutorialentries/
        _form.php
        _search.php
        _view.php
        admin.php
        create.php
        index.php
        update.php
        view.php
      tutorials/
        _form.php
        _search.php
        _view.php
        admin.php
        create.php
        index.php
        update.php
        view.php
      update/
        check_updates/
          update_buttons/
            _updatesavailable_error.php
            _updatesavailable.php
        manage/
          manage_key.php
          subscribe.php
        partials/
          topbarBtns/
            rightSideButtons.php
          topbarBtns_subscribe/
            rightSideButtons.php
        updater/
          steps/
            textaeras/
              _existingfiles.php
              _modifiedfiles.php
              _readonlyfiles.php
            _backup.php
            _change_log.php
            _check_local_errors.php
            _fileSystem.php
            _final.php
            _old_step4b.php
            _updater_updated.php
          welcome/
            _error_files_update_updater.php
            _key_updated.php
            _subscribe.php
            _updater_update.php
            _welcome.php
          _error.php
          _progress.php
          _right_container.php
          _updater.php
        _ajaxVariables.php
        _update_notification.php
        _updateContainer.php
      user/
        deluser.php
        mboxwithredirect.php
        modifyuser.php
        personalsettings.php
        setuserpermissions.php
        setusertemplates.php
      endScripts_view.php
      error_view.php
      index.php
    assessment/
      assessments_delete.php
      assessments_edit.php
      assessments_view.php
    dashboard/
      welcome.php
    failedEmail/
      notification_message/
        _notification_message.php
      partials/
        modal/
          delete_form.php
          delete_result_body.php
          delete_result.php
          email_content.php
          email_error.php
          resend_body.php
          resend_form.php
          resend_result_body.php
          resend_result.php
      failedEmail_index.php
    homepageSettings/
      partial/
        topbarBtns/
          leftSideButtons.php
          rightSideButtons.php
      _form.php
      create.php
      index.php
      update.php
    installer/
      dbconfig_view.php
      license_view.php
      nodatabase_view.php
      optconfig_view.php
      populatedb_view.php
      precheck_view.php
      redirectmessage_view.php
      sidebar_view.php
      success_view.php
      welcome_view.php
    layouts/
      partial_modals/
        modal_footer_canceladd.php
        modal_footer_cancelapply.php
        modal_footer_cancelchange.php
        modal_footer_canceldelete.php
        modal_footer_cancelexport.php
        modal_footer_cancelresend.php
        modal_footer_cancelsave.php
        modal_header.php
      partial_topbar/
        right_close_saveclose_save.php
      adminmenu.php
      bare.php
      header.php
      installer.php
      layout_questioneditor.php
      main.php
      messagebox.php
      sidemenu.php
      survey.php
      template_title_btn_bar.php
      title_bar.php
      with_sidebar.php
    limereplacementfields/
      limeReplacementFields_view.php
    questionAdministration/
      partial/
        topbarBtns/
          copyQuestionTopbarRight_view.php
          editQuestionTopbarLeft_view.php
          editQuestionTopbarRight_view.php
          importQuestionTopbarRight_view.php
          listquestiongroupsTopbarLeft_view.php
          listquestionsTopbarLeft_view.php
          previewQuestionButton_view.php
          questionSummaryTopbarRight_view.php
          questionToolsDropdownItems.php
          questionToolsDropdownMenu.php
          questionTopbar_view.php
          questionTopbarLeft_view.php
          questionTopbarRight_view.php
        groupView.php
        questionView.php
      _copyQuestionTabsLanguages.php
      _jsVariables.php
      advancedSettings.php
      answerOptionRow.twig
      answerOptions.twig
      copyQuestionForm.php
      create.php
      editdefaultvalues.php
      extraOptions.php
      generalSettings.php
      import.php
      importQuestion.php
      languageselector.php
      listquestions.php
      modals.twig
      questionCode.php
      questionSummary.php
      subquestionRow.twig
      subquestions.twig
      summary.php
      textElements.php
      typeSelector.php
    questionGroupsAdministration/
      partial/
        topbarBtns/
          addGroupTopbarLeft_view.php
          addGroupTopbarRight_view.php
          editGroupTopbarLeft_view.php
          editGroupTopbarRight_view.php
          groupToolsDropdownItems.php
          groupTopbarLeft_view.php
          groupTopbarRight_view.php
          importGroupTopbarRight_view.php
          listquestiongroupsTopbarLeft_view.php
          previewGroupButton_view.php
      _jsVariables.php
      addGroup_view.php
      editGroup_view.php
      group_view.php
      importGroup_view.php
    quickTranslation/
      index.php
      translateFieldData.php
      translateformheader_view.php
      translatetabs_view.php
    quotas/
      _form_langsetting.php
      _form_langsettings.php
      _form.php
      _newanswer_equation.php
      editquota_view.php
      index.php
      newanswer_view.php
      newanswererror_view.php
      newanswertwo_view.php
      newquota_view.php
      viewquotas_massive_langsettings_form.php
      viewquotas_massive_selector.php
      viewquotas_quota_members_actions.php
      viewquotas_quota_members_item.php
      viewquotas_quota_members.php
      viewquotasempty_view.php
    responses/
      massive_actions/
        _selector.php
      modal_subviews/
        filterColumns.php
      partial/
        topbarBtns/
          leftSideButtons.php
          responsesExportDropdownItems.php
          responsesImportDropdownItems.php
          responseViewTopbarRight_view.php
          rightSideButtons.php
        notSubmittedResponseListTable.php
        responseListTable.php
        responseSummary.php
      browseidrow_view.php
      browseindex_view.php
      browsetimerow_view.php
    smtpOAuth/
      redirectToAuth.php
      responseReceived.php
    survey/
      questions/
        answer/
          5pointchoice/
            rows/
              item_row.twig
            answer.twig
            config.xml
          arrays/
            10point/
              columns/
                col.twig
              rows/
                cells/
                  answer_td_input.twig
                  header_answer.twig
                  header_information.twig
                answer_row.twig
              answer.twig
              config.xml
            5point/
              columns/
                col.twig
              rows/
                cells/
                  answer_td_answertext.twig
                  answer_td_input.twig
                  header_answer.twig
                  header_information.twig
                answer_row.twig
              answer.twig
              config.xml
            array/
              dropdown/
                rows/
                  answer_row.twig
                answer.twig
                empty.twig
              no_dropdown/
                columns/
                  col.twig
                rows/
                  cells/
                    answer_td.twig
                    header_answer.twig
                    header_information.twig
                  answer_row.twig
                  repeat_header.twig
                answer.twig
              config.xml
            column/
              answer.twig
              config.xml
            dualscale/
              answer_dropdown.twig
              answer_header.twig
              answer.twig
              config.xml
              content_header.twig
              repeat_header.twig
            increasesamedecrease/
              columns/
                col.twig
              rows/
                cells/
                  thead.twig
                answer_row.twig
              answer.twig
              config.xml
            multiflexi/
              rows/
                cells/
                  answer_td_checkboxes.twig
                  answer_td.twig
                answer_row.twig
                repeat_header.twig
              answer.twig
              config.xml
              empty_error.twig
              translations.php
            texts/
              columns/
                col_total.twig
              rows/
                cells/
                  answer_td.twig
                  td_grand_total.twig
                  td_total.twig
                  thead.twig
                answer_row.twig
                repeat_header.twig
              answer.twig
              config.xml
              empty_error.twig
            yesnouncertain/
              columns/
                col.twig
              rows/
                cells/
                  thead.twig
                answer_row.twig
              answer.twig
              config.xml
          boilerplate/
            answer.twig
            config.xml
          date/
            dropdown/
              rows/
                datepart.twig
                day.twig
                hour.twig
                minute.twig
                month.twig
                year.twig
              answer.twig
            selector/
              answer.twig
            config.xml
            translations.php
          dummy/
            answer.twig
          equation/
            answer.twig
            config.xml
          file_upload/
            answer.twig
            config.xml
            modal-container.twig
            translations.php
          gender/
            buttons/
              answer.twig
            radio/
              answer.twig
            config.xml
          global/
            table/
              cell/
                head_header.twig
                head_information.twig
          hugefreetext/
            answer.twig
            config.xml
          language/
            answer.twig
            config.xml
          list_dropdown/
            rows/
              optgroup.twig
              option.twig
              othertext.twig
            answer.twig
            config.xml
            translations.php
          list_with_comment/
            dropdown/
              rows/
                option.twig
              answer.twig
            list/
              rows/
                answer_row.twig
              answer.twig
            config.xml
            translations.php
          listradio/
            columns/
              column_footer.twig
              column_header.twig
            rows/
              answer_row_noanswer.twig
              answer_row_other.twig
              answer_row.twig
            answer.twig
            config.xml
            translations.php
          longfreetext/
            answer.twig
            config.xml
          multiplechoice/
            rows/
              answer_row_other.twig
              answer_row.twig
            answer.twig
            config.xml
            translations.php
          multiplechoice_with_comments/
            rows/
              answer_row_other.twig
              answer_row.twig
            answer.twig
            config.xml
            translations.php
          multiplenumeric/
            rows/
              input/
                answer_row.twig
              sliders/
                answer_row.twig
                horizontal_slider.twig
                vertical_slider.twig
              dynamic_slider.twig
              dynamic.twig
            answer_input.twig
            answer.twig
            config.xml
            empty.twig
            translations.php
          multipleshorttext/
            rows/
              answer_row_inputtext.twig
              answer_row_textarea.twig
            answer.twig
            config.xml
            empty.twig
            translations.php
          numerical/
            answer.twig
            config.xml
          ranking/
            rows/
              answer_row.twig
            answer.twig
            config.xml
            translations.php
          shortfreetext/
            location_mapservice/
              item_100.twig
              item.twig
            text/
              item.twig
            textarea/
              item.twig
            config.xml
            translations.php
          yesno/
            buttons/
              item.twig
            radio/
              item.twig
            config.xml
        question_help/
          asterisk.twig
          em_tip.twig
          error_tip.twig
          help.twig
          mandatory_tip.twig
          questionhelp.php
          softmandatory_input.twig
        question_timer/
          timer_content.twig
          timer_header.twig
          timer_javascript.twig
          timer.twig
      system/
        actionButton/
          moveNext.php
          movePrevious.php
          moveSubmit.php
        LanguageChanger/
          LanguageChanger.php
          LanguageChangerForm.php
        print_survey/
          header.php
        privacy/
          heading.php
          message.php
        display.php
        errorAlert.php
        errorWarning.php
        message.php
        no-javascript.php
        required.php
        url.php
    surveyAdministration/
      partial/
        topbar/
          _modalSurveyActivation.php
          languagesDropdownItems.php
          previewOrRunButton_view.php
          surveyToolsDropdownItems.php
          surveyTopbarLeft_view.php
          surveyTopbarRight_view.php
        topbar_quotas/
          rightSideButtons.php
        topbar_statistics/
          rightSideButtons.php
        topbar_tokens/
          leftSideButtons.php
          rightSideButtons.php
          tokensCreateDropdownItems.php
          tokensInvRemDropdownItems.php
        topbarBtns/
          leftSideButtons.php
        topbarBtns_create_survey/
          rightSideButtons.php
        _modalActivateSuccess.php
        _modalCopySurvey.php
        _modalDeleteSurvey.php
        _modalImportSurvey.php
      surveyActivation/
        _activateFooterBtns.php
        _activateSurveyCheckFailed.php
        _activateSurveyOptions.php
        _activation_error.php
        _activation_feedback.php
        _failedFooterBtn.php
        _feedbackOpenAccess.php
      _inherit_sub_footer.php
      _user_management_sub_footer.php
      activateSurvey.php
      addPanelIntegrationParameter_view.php
      afterDeactivateSurvey_view.php
      copySurveyResult_view.php
      deactivateSurvey_view.php
      deleteSurvey_view.php
      editLocalSettings_main_view.php
      importSurvey_view.php
      importSurveyResources_view.php
      listSurveys_view.php
      newSurvey_view.php
      sidebody.php
      stopSurvey_view.php
      surveySummary_view.php
      tab_survey_view.php
      tabCreate_view.php
      tabImport_view.php
    surveyPermissions/
      partial/
        editpermission.php
      _overview_table.php
      index.php
      settingsPermission.php
    surveys/
      display.php
    SurveysGroupsPermission/
      subviews/
        addGroupForm.php
        addUserForm.php
        addUserGroupResult.php
        addUserResult.php
        currentUsersList.php
        deleteUserResult.php
        setPermissionForm.php
        viewCurrents.php
      index.php
    themeOptions/
      partial/
        topbarBtns/
          leftSideButtons.php
      _selector.php
      advanced.php
      availablethemelist.php
      import_modal.php
      index.php
      installedthemelist.php
      options_core.php
      surveythemelist.php
      surveythememenu.php
      theme_buttons.php
      update.php
    userGroup/
      partial/
        topbarBtns/
          leftSideButtons.php
          rightSideButtons.php
        topbarBtns_mail/
          rightSideButtons.php
        topbarBtns_manageGroup/
          leftSideButtons.php
      _addUserDropdown.php
      addUserGroup_view.php
      editUserGroup_view.php
      mailUserGroup_view.php
      usergroups_view.php
      viewUserGroup_view.php
    userManagement/
      massiveAction/
        _addtousergroup.php
        _selector.php
        _updateexpires.php
        _updatepermissions.php
        _updaterole.php
        _updatestatus.php
      partial/
        mjmltemplate/
          usernotification.html
          usernotification.mjml
        topbarBtns/
          dropDownItemsExport.php
          dropDownItemsImport.php
          leftSideButtons.php
        addedituser.php
        addrole.php
        confirmuseractivation.php
        confirmuserdelete.php
        editpermissions.php
        edittemplatepermissions.php
        error.php
        importuser.php
        json.php
        permissionsuccess.php
        showuser.php
        success.php
        transfersurveys.php
        usernotificationemail.php
      index.php
    userRole/
      massiveAction/
        _selector.php
        _updatepermissions.php
        _updaterole.php
      partials/
        topbarBtns/
          leftSideButtons.php
        _form.php
        _import.php
        _permissions.php
        _view.php
        error.php
        success.php
      edit.php
      index.php
    index.html
    opt_view.php
    statistics_user_view.php
    survey_view.php
  .htaccess
  index.html
docs/
  demosurveys/
    ls205_array_filter_tests.lss
    ls205_cascading_array_filter_exclude.lss
    ls205_cascading_array_filter.lss
    ls205_comma_as_radix_separator.lss
    ls205_countifop_sumifop.lss
    ls205_em_tailoring.lss
    ls205_em_validation_q.lss
    ls205_group_relevance.lss
    ls205_maximum_chars_feature.lss
    ls205_plurals_test.lss
    ls205_randomization_group_test.lss
    ls205_sample_survey_english.lss
    ls205_self_and_that.lss
    ls205_subquestion_relevance.lss
    ls205_test_em_sq_validation.lss
    ls205_validation_tests.lss
    ls206_em_subquestion_relevance.lss
    ls5_EM_question_attributes.lss
    ls5_sample_survey_multilingual_fr_de_en_it.lss
    ls6_sample_survey_multilingual_fr_de_en_it_ru.lss
    ls7_EM_question_attributes_multilang.lss
    ls7_Samplesurvey_en_de.lss
  open-api/
    v1.json
  swagger/
    index.html
    oauth2-redirect.html
    swagger-initializer.js
    swagger-ui-bundle.js
    swagger-ui-es-bundle-core.js
    swagger-ui-es-bundle.js
    swagger-ui-standalone-preset.js
    swagger-ui.js
  themes/
    questiontheme_example/
      survey/
        questions/
          answer/
            listradio/
              columns/
                column_footer.twig
                column_header.twig
              rows/
                answer_row_noanswer.twig
                answer_row_other.twig
                answer_row.twig
              answer.twig
              config.xml
  credits.txt
  limesurvey-ruleset.xml
  release_notes.txt
editor/
  __mocks__/
    fileMock.cjs
    rawSvgMock.cjs
    svgMock.cjs
    sweetalert2.js
  .storybook/
    mocks/
      i18n.js
    main.js
    preview.js
  scripts/
    postbuild.js
  src/
    components/
      ConditionDesigner/
        ConditionFormFields/
          AnswerOptionsSelect.js
          AnswerTypeSelect.js
          ConstantInput.js
          index.js
          OperatorSelect.js
          ParticipantDataSelect.js
          QuestionsAsAnswerSelect.js
          QuestionsSelect.js
          QuestionTypeToggle.js
          RegexInput.js
        ExpressionScript/
          ExpressionScript.js
          ExpressionScriptInputBox.js
          handleConditionScriptUpdate.js
          index.js
        handlers/
          previousQuestions/
            helpers/
              addNoAnswerIfAllowed.js
              createAnswer.js
              createNumericAnswers.js
              createQuestion.js
              createStandardAnswers.js
              getAnswerText.js
              getQuestionText.js
              index.js
              questionTypeRequiresBlankNoAnswer.js
            typeHandlers/
              arrayDualScaleTypeHandler.js
              arrayNumbersTextsTypeHandler.js
              arrayTypeHandler.js
              dateTimeTypeHandler.js
              defaultTypeHandler.js
              fivePointChoiceTypeHandler.js
              genderTypeHandler.js
              increaseDecreaseTypeHandler.js
              index.js
              multipleChoiceTypeHandler.js
              multipleInputsTypeHandler.js
              numericTypeHandler.js
              rankingTypeHandler.js
              singleChoiceTypeHandler.js
              tenPointChoiceTypeHandler.js
              yesNoTypeHandler.js
              yesNoUncertainTypeHandler.js
            utils/
              findFieldname.js
              index.js
            previousQuestionsHandler.js
        Overlays/
          ConditionScriptOverwriteConfirmation.js
          ConditionsOverwriteConfirmationOverlay.js
          DeleteScenarioOverlay.js
          ExpressionScriptEditorOverlay.js
          index.js
          ResetAllConditionsOverlay.js
          UnsavedChangesOverlay.js
        utils/
          conditionAlertHelpers.js
          expressionScriptHelpers.js
          getAllowedMethods.js
          getApiOperationActions.js
          getConditionTypeInfo.js
          index.js
          questionConditionHelpers.js
          scenarioConditionsParser.js
          scenarioPayloadBuilder.js
        AddScenario.js
        ConditionDesigner.js
        ConditionItem.js
        ScenarioList.js
      EditableImage/
        EditableImage.js
        EditableImage.stories.js
      EndScreenSettings/
        EndScreenSettings.js
        EndScreenSettings.stories.js
        EndScreenSettings.test.js
      feedback/
        FeedbackPopup.js
        index.js
      GroupSettings/
        GroupAttribute.js
        groupAttributes.js
        GroupSettings.js
      icons/
        AddIcon.js
        AlignLeftIcon.js
        AlignMiddleIcon.js
        AlignRightIcon.js
        ArrowBackIcon.js
        ArrowDownIcon.js
        ArrowLeftIcon.js
        ArrowRightIcon.js
        ArrowRightLineIcon.js
        ArrowUpIcon.js
        BrushIcon.js
        CheckIcon.js
        ClipBoardIcon.js
        ClockArrowIcon.js
        ClockIcon.js
        CloseCircleFillIcon.js
        CloseCircleIcon.js
        CloseIcon.js
        ColumnsIcon.js
        CopyIcon.js
        CornerMediumIcon.js
        CornerNormalIcon.js
        CornerRoundedIcon.js
        DateIcon.js
        DeleteIcon.js
        DeleteIconFilled.js
        DoubleGreaterThanArrow.js
        DownloadIcon.js
        DragIcon.js
        DropdownIcon.js
        EditIcon.js
        EditNotPossibleIcon.js
        EditPossibleIcon.js
        ExclamationIcon.js
        ExclamationMark.js
        ExpandIcon.js
        ExpandPreviewIcon.js
        ExternalLinkIcon.js
        EyeIcon.js
        FeedbackIcon.js
        FilterIcon.js
        GlobalIcon.js
        GreaterThanArrow.js
        icons.stories.js
        ImportIcon.js
        index.js
        InfoIcon.js
        InformationIcon.js
        InvisibleIcon.js
        LanguageIcon.js
        LeftSideBarToggleIcon.js
        LockIcon.js
        MenuIcon.js
        MergeIcon.js
        MinimizeIcon.js
        OverviewIcon.js
        ParticipantsIcon.js
        PrivacyMandatoryInlineIcon.js
        PrivacyMandatoryNoIcon.js
        PrivacyMandatoryPopUpIcon.js
        PushPinIcon.js
        QrCodeIcon.js
        QuestionInserterDataIcon.js
        QuestionInserterMultipleChoice.js
        QuestionInserterNumberIcon.js
        QuestionInserterRankIcon.js
        QuestionInserterSingleChoiceIcon.js
        QuestionInserterTextIcon.js
        QuestionListIcon.js
        QuestionMarkIcon.js
        RadioSelectedIcon.js
        RadioUnselectedIcon.js
        RankingIcon.js
        RecoverIcon.js
        RefreshIcon.js
        ResetIcon.js
        ResponsesAvailableIcon.js
        ResponsesNotAvailableIcon.js
        ResponseTableIcon.js
        SearchIcon.js
        Separator.js
        SettingsIcon.js
        ShareBoxIcon.js
        ShortcutIcon.js
        ShutDownIcon.js
        SmallCheckMarkIcon.js
        SmallThreeDotIcon.js
        StarIcon.js
        StopIcon.js
        SurveyMenuIcon.js
        SurveyPermissionsIcon.js
        SurveyPresentationIcon.js
        SurveySettingsIcon.js
        SurveyStructureIcon.js
        SurveyTranslationIcon.js
        TableIcon.js
        TextIcon.js
        TrashIcon.js
        UploadIcon.js
        XIcon.js
        XIconWithBorder.js
      ImportSurvey/
        decodeHtmlEntities.js
        importSurveyConfig.js
        ImportSurveyForm.js
        ImportSurveyModal.js
        ImportSurveyModal.test.js
        importSurveyNotifications.js
        ImportSurveySummary.js
        index.js
      MeatballMenu/
        MeatballMenu.js
        MeatballMenu.test.js
        MeatbalMenu.stories.js
      Modals/
        ComponentModal.js
        ConfirmModal.js
        index.js
      PublicSurveyAlias/
        SurveyAccessMode/
          surveyAccessMode.test.js
          surveyAccessModeHandler.js
          SurveyAccessModeSelector.js
        CopyButton.js
        PublicSurveyAlias.js
      PublishSettings/
        PublishSettings.js
        SurveyActivationHandler.js
      QuestionSettings/
        array/
          getArrayByColumnSettings.js
          getArrayDualScaleSettings.js
          getArrayNumbersSettings.js
          getArrayPointChoiceSettings.js
          getArrayTextsSettings.js
          index.js
        attributes/
          getDisplayAttributes.js
          getFileMetaDataAttributes.js
          getGeneralAttributes.js
          getImageAttributes.js
          getInputAttributes.js
          getLocationAttributes.js
          getLogicAttributes.js
          getOtherAttributes.js
          getSliderAttributes.js
          getStatisticsAttributes.js
          getThemeAttributes.js
          getTimerAttributes.js
          ImageAttributes.js
          index.js
          QuestionCodeAttribute.js
          QuestionTypeAttribute.js
        datesAndData/
          getBrowserDetectionSettings.js
          getDateTimeSettings.js
          getFileUploadSettings.js
          index.js
        multipleChoice/
          getMultipleChoiceButtonsSettings.js
          getMultipleChoiceImageSettings.js
          getMultipleChoiceSettings.js
          getMultipleChoiceWithCommentsSettings.js
          index.js
        number/
          getEquationSettings.js
          getMultipleNumericalInputsSettings.js
          getTextDisplaySettings.js
          index.js
        rankingAndRating/
          getGenderSettings.js
          getRankingAdvancedSettings.js
          getRankingSettings.js
          getRatingSettings.js
          getYesNoSettings.js
          index.js
        singleChoice/
          getDropdownSettings.js
          getFivePointChoiceSettings.js
          getListImageSelectSettings.js
          getListRadioSettings.js
          getListWithCommentRadioSettings.js
          getSingleChoiceButtonsSettings.js
          index.js
        textQuestion/
          getLongTextSettings.js
          getMultipleShortTextSettings.js
          getNumericSettings.js
          getShortTextSettings.js
          index.js
        DefaultValuesActions.js
        DefaultValuesActions.test.js
        getQuestionSettings.js
        QuestionSettings.js
        Setting.js
        Setting.stories.js
      QuestionsParticipantMode/
        ArrayParticipantMode/
          ArrayParticipantMode.js
        index.js
      QuestionTypes/
        ArrayQuestion/
          ArrayColumnsTitles/
            ArrayColumnsTitles.js
            ArrayColumnTitle.js
          ArrayRows/
            ArrayRow.js
            ArrayRows.js
            ArraySubQuestionNumberAnswers.js
            ArraySubQuestionRadioAnswers.js
            ArraySubQuestionTextAnswers.js
          arrayLayout.js
          ArrayQuestion.js
          index.js
        DateTime/
          DateTime.js
        Equation/
          Equation.js
        FileUpload/
          FileRejectionItems.js
          FileUpload.js
          FileUploadItem.js
          FileUploadParticipantView.js
        FivePointChoiceQuestion/
          FivePointChoiceQuestion.js
        GenderQuestion/
          GenderQuestion.js
        MultipleChoice/
          MultipleChoice.js
          MultipleChoiceButtonSubquestion.js
          MultipleChoiceCheckboxSubquestion.js
          MultipleChoiceImageSubquestion.js
          MultipleChoiceNumericalSlider.js
          MultipleChoiceNumericalSubquestion.js
          MultipleChoiceShortTextSubquestion.js
          MultipleChoiceSubquestion.js
        QuestionModes/
          OptionQuestionEditMode.js
          OptionQuestionViewMode.js
        RankingAdvancedQuestion/
          RankingAdvancedQuestion.js
          RankingAdvancedQuestionSubquestions.js
          RankingAdvancedQuestionSubquestionsPlaceholder.js
        RankingQuestion/
          RankingQuestion.js
          RankingQuestionSubquestion.js
          RankingQuestionSubquestions.js
        RatingQuestion/
          RatingQuestion.js
        stories/
          Arrays.stories.js
          Mask.stories.js
          MultipleChoice.stories.js
          SingleChoice.stories.js
          Text.stories.js
        TextQuestion/
          BrowserDetectionTextAnswer.js
          BrowserDetectionTextAnswer.test.js
          LongTextAnswer.js
          NumericAnswer.js
          ShortTextAnswer.js
          TextDisplay.js
          TextQuestion.js
        Utils/
          index.js
          isQuestionWithAnswers.js
          isQuestionWithSubquestions.js
        YesNoQuestion/
          YesNoQuestion.js
        AssessmentValue.test.js
        AssessmentValueBadge.js
        AssessmentValueInput.js
        getNotSupportedQuestionTypeInfo.js
        getQuestionTypeInfo.js
        ImageChoice.js
        index.js
        NoAnswerPreselection.test.js
        questionEditComponents.js
        questionPreviewComponents.js
        questionViewComponents.js
        singleChoiceThemes.js
        SubquestionCode.test.js
        subquestionCodeComponents.js
        Text.test.js
      QuestionTypeSelector/
        constants.js
        index.js
        QuestionTypeSelector.js
        QuestionTypeSelector.stories.js
        QuestionTypeSelector.test.js
      SharingPanel/
        menus/
          overview/
            AliasSettingsCard.js
            LanguageSelector.js
            ParticipantsListCard.js
            QRCodeCard.js
            SharingOverview.js
            SocialMediaCard.js
          index.js
        index.js
        SharingSidebar.js
      SideBar/
        index.js
        QuestionContextMenu.js
        SectionHeader.js
        SideBar.js
        SideBar.stories.js
        SideBarHeader.js
        SideBarPanel.js
        SideBarPanelItem.js
        SideBarRow.js
      SocialMediaShare/
        SocialMediaShare.js
      Survey/
        AddQuestion/
          AddQuestion.js
          index.js
        QuestionGroups/
          index.js
          QuestionGroup.js
          QuestionGroup.stories.js
          QuestionGroup.test.js
          QuestionGroupBody.js
          QuestionGroupFooter.js
          QuestionGroupHeader.js
          QuestionGroupHeader.test.js
          QuestionGroups.js
          QuestionGroupSchema.js
        Questions/
          QuestionPreview/
            index.js
            QuestionPreview.js
            QuestionPreviewBody.js
            QuestionPreviewHeader.js
          index.js
          Question.js
          QuestionBody.js
          QuestionCodeSchema.js
          QuestionContainer.js
          QuestionFooter.js
          QuestionFooter.test.js
          QuestionHeader.js
          Questions.js
          QuestionSchema.js
        Card.js
        index.js
        Section.js
        Survey.js
        Survey.stories.js
        SurveyBody.js
        SurveyFooter.js
        SurveyFooter.stories.js
        SurveyFooter.test.js
        SurveyHeader.js
        SurveyHeader.stories.js
        SurveyHeader.test.js
        SurveyLanguageSwitch.js
      SurveyOverview/
        OverViewToast.js
        SurveyOverview.js
      SurveySettings/
        AdvancedOptions/
          index.js
        components/
          SettingsBlocksRenderer.js
        GeneralSettings/
          LanguageSwitch.js
          Theme.js
        Settings/
          themeOptionTypes/
            handleButtonType.js
            handleColorPickerType.js
            handleDropdownType.js
            handleDurationType.js
            handleIconType.js
            handleTextareaType.js
            handleTextType.js
            index.js
            types.js
          getGeneralSettingsBlocks.js
          getNotificationsDataSettingsBlocks.js
          getParticipantsSettingsBlocks.js
          getPresentationSettingsBlocks.js
          getPresentationSettingsBlocks.test.js
          getPrivacyPolicySettingsBlocks.js
          getThemeOptionsSettingsBlocks.js
          index.js
        utils/
          settingHelpers.js
          settingsConfig.js
          updateSettingHelpers.js
        panelOptions.js
        SettingItem.js
        SurveySetting.js
        SurveySettingBlock.js
        SurveySettings.js
        SurveySettings.stories.js
      SurveyStatusSwitchPopup/
        index.js
        SurveyDeactivationPopup.js
        SurveyReactivationPopup.js
        SurveyStatusSwitchConfig.js
        surveyStatusSwitchPopup.js
        SurveyStatusSwitchPopupCard.js
        SurveyStatusSwitchPopupCardElement.js
        SurveyStatusSwitchPopupFooter.js
        SurveyStatusSwitchPopupHeader.js
        SurveyStatusSwitchPopupResponsesSelect.js
      SurveyStructure/
        stories/
          RowQuestionGroup.stories.js
          SurveyStructure.stories.js
        index.js
        RowPinned.js
        RowQuestion.js
        RowQuestionGroup.js
        RowQuestionGroup.test.js
        RowQuestionsList.js
        SurveyLogicModal.js
        SurveyStructure.js
        SurveyStructure.test.js
      ThemeOptions/
        ThemeOptionsIconSelect.js
        ThemeOptionsImageUpload.js
        ThemeOptionsPreview.js
      TooltipContainer/
        TooltipContainer.js
        TooltipContainer.stories.js
      TopBar/
        Button/
          ActionButton.js
          ButtonBackToClassicEditor.js
        index.js
        PreviewButton.js
        SurveyListComponent.js
        SurveyNavigation.js
        SurveyTitleSelector.js
        TopBar.js
        TopBar.stories.js
        TopBar.test.js
        TopBarActions.js
        TopBarQuestionInserter.js
      Tutorial/
        Tutorial.js
        TutorialTooltip.js
      UIComponents/
        Badge/
          Badge.js
        Buttons/
          AlignButtons.js
          AlignButtons.test.js
          Button.js
          CustomizeButton.js
          index.js
          PrivacyPolicyButtons.js
          PrivacyPolicyButtons.test.js
          ResetButton.js
          ToggleButtons.js
          ToggleButtons.test.js
        CheckboxRadio/
          CheckboxRadio.js
        Collapsible/
          Collapsible.js
        ColorPicker/
          ColorPicker.js
          PopoverPicker.js
        ContentEditor/
          CodeEditor/
            CodeEditor.js
          TinyMCE/
            mceToolbar.js
            TinyMCE.js
            tinyMCEIcons.js
            toolbarActions.js
          ContentEditable.js
          ContentEditor.js
          ContentEditor.test.js
        DateRangePicker/
          DateRangePicker.js
        DateTimePicker/
          DateTimePicker.js
        DragAndDrop/
          DragAndDrop.js
          DragAndDrop.test.js
        Dropdown/
          Dropdown.js
        DropZone/
          DropZone.js
          DropZone.test.js
        ExpressionScriptEditor/
          ExpressionScriptEditor.js
          expressionScriptExtensions.js
          expressionScriptExtensions.test.js
          index.js
        FileDropZone/
          FileDropZone.js
          FileDropZone.test.js
        FormCheck/
          FormCheck.js
        ImageEditor/
          ImageEditor.js
        Input/
          Input.js
          Input.test.js
          TextArea.js
        InputRange/
          InputRange.js
          InputRange.test.js
        LSTable/
          index.js
          LSTable.js
          RowActions.js
        PaginationButtons/
          PaginationButtons.js
        Range/
          Range.js
          Range.test.js
        SearchInput/
          SearchInput.js
        Select/
          ColorSelect.js
          Select.js
        SettingsWrapper/
          SettingsWrapper.js
        Skeletons/
          QuestionSkeleton.js
        stories/
          button/
            AlignButton.stories.js
            ToggleButton.stories.js
          ContentEditor.stories.js
          DateTimePicker.stories.js
          DragAndDrop.stories.js
          DropZone.stories.js
          ImageEditor.stories.js
          Input.stories.js
          InputRange.stories.js
          LSTable.stories.js
          Range.stories.js
          Select.stories.js
        index.js
        RatingItems.js
      WelcomeSettings/
        WelcomeSettings.js
      wrappers/
        EditorContextController.js
        index.js
        SurveyLogicProvider.js
        SurveyWorkspace.js
      AuthGate.js
      ExportOptionsForm.js
      index.js
    helpers/
      Buffer/
        operationsHandlers/
          handleAnswerOperation/
            handleAnswerOperation.js
            handleAnswerOperation.test.js
          handleQuestionConditionOperation/
            handleQuestionConditionOperation.js
            handleQuestionConditionOperation.test.js
          handleQuestionGroupOperation/
            handleQuestionGroupOperation.js
            handleQuestionGroupOperation.test.js
          handleQuestionOperation/
            handleQuestionOperation.js
            handleQuestionOperation.test.js
          handleSubquestionOperation/
            handleSubquestionOperation.js
            handleSubquestionOperation.test.js
          handleSurveyOperation/
            handleSurveyOperation.js
            handleSurveyOperation.test.js
          index.js
        operationsScheme/
          answer/
            answerCreateJoi.js
            answerDeleteJoi.js
            answerSchemes.test.js
            answerUpdateJoi.js
          question/
            index.js
            questionAttributeUpdateJoi.js
            questionCreateJoi.js
            questionDeleteJoi.js
            questionL10nUpdateJoi.js
            questionSchemes.test.js
            questionUpdateJoi.js
          questionCondition/
            index.js
            questionConditionBaseJoi.js
            questionConditionCreateJoi.js
            questionConditionDeleteJoi.js
            questionConditionSchemas.test.js
            questionConditionSchemes.test.js
            questionConditionUpdateJoi.js
          questionGroup/
            questionGroupCreateJoi.js
            questionGroupDeleteJoi.js
            questionGroupL10nUpdateJoi.js
            questionGroupSchemes.test.js
            questionGroupUpdateJoi.js
          subQuestion/
            subquestionCreateJoi.js
            subquestionDeleteJoi.js
            subQuestionSchemes.test.js
            subquestionUpdateJoi.js
          survey/
            accessModeUpdate.Joi.js
            languageSettingUpdateJoi.js
            surveyImportResponsesJoi.js
            surveySchemes.test.js
            surveyStatusUpdateJoi.js
            surveyUpdateJoi.js
            themeSettingUpdateJoi.js
        Buffer.test.js
        Entities.js
        EntitiesPath.js
        EntitiesType.js
        getOperationScheme.js
        index.js
        Operation.js
        Operations.js
        OperationsBuffer.js
      constants/
        constants.js
        docUrls.js
        index.js
        languages.js
        questionTypes.js
        slider.js
      data/
        survey-detail.json
      feedback/
        feedbackConfig.js
        FeedbackEventHandler.js
        index.js
        utils.js
      L10ns/
        L10ns.js
        L10ns.test.js
      network/
        axiosErrorHandler.js
      options/
        getColumnWidthOptions.js
        getCommentedCheckboxOptions.js
        getDisplayButtonTypeOptions.js
        getFormatOptions.js
        getLabelWrapperWidthOptions.js
        getOnOffOptions.js
        getOrderOptions.js
        getSliderLayoutOptions.js
        getSurveyPanels.js
        getTooltipMessages.js
        getVisualizationOptions.js
        getYesNoOptions.js
        index.js
      questionImage/
        getAndGenerateQuestionImageStyles.js
        getClearedQuestionImageObject.js
        getQuestionImageObjectFromImageAttribute.js
        index.js
      Alert.js
      arrayDeleteItem.js
      arrayInsertItem.js
      categorizeFileTypes.js
      createQuestionGroup.js
      dayJsHelper.js
      decodeHtml.js
      decodeHTMLEntities.js
      downloadBlob.js
      downloadCanvasAsImage.js
      DuplicateQuestion.js
      DuplicateQuestionGroup.js
      entityHelpers.js
      extractStrings.js
      filterArray.js
      filterCollection.js
      filterObjectByStructure.js
      filterToNumericOrEmpty.js
      getAnswerById.js
      getAnswerByProperty.js
      getAnswerExample.js
      getApiUrl.js
      getAttributeValue.js
      getCurrentUtcTimestamp.js
      getDisabledQuestionTypes.js
      getEntityInfo.js
      getGroupById.js
      getInfoFromObjectByIndex.js
      GetInvalidSurveyObjects.js
      getNoAnswerLabel.js
      getPreviousQuestions.js
      getQuestionAttributesTitles.js
      getQuestionById.js
      getQuestionExample.js
      getQuestionExample.test.js
      getReorganizedQuestionGroups.js
      getReorganizedQuestions.js
      getSettingValueFromSurvey.js
      getSiteUrl.js
      getSubquestionById.js
      getSubquestionByProperty.js
      getSurveyAccessLink.js
      getSurveyParticipantAttributes.js
      hasTempId.js
      htmlToPlainText.js
      index.js
      InsertElementAndIncrementProperty.js
      isArrayQuestion.js
      IsElementOnScreen.js
      isRankingQuestion.js
      isSingleChoiceQuestion.js
      isSurveyExpired.js
      isTempId.js
      isTrue.js
      maybe.js
      mockAnswer.js
      MoveQuestion.js
      moveQuestionGroup.js
      MoveQuestionToGroup.js
      placeholder.js
      questionAndAnswerCodeGenerators.js
      RandomNumber.js
      RemoveHTMLTagsInString.js
      ReplaceQuestionCodesWithAnswers.js
      replaceValuesInObject.js
      ScrollToElement.js
      sleep.js
      sliderUtils.js
      SortByProperty.js
      surveyExample.js
      updateQuestionsSortOrder.js
      Utils.js
      uuid.js
    hooks/
      feedback/
        index.js
        useCookieFeedbackStore.js
        useFeedbackForm.js
      index.js
      useAppState.js
      useAuth.js
      useAuthService.js
      useBuffer.js
      useChildKeyboardShortcuts.js
      useClickOutside.js
      useConditionDesigner.js
      useDebounce.js
      useDebouncedCallback.js
      useEditorCompatibilityGuard.js
      useElementClick.js
      useErrors.js
      useExpressionScriptValidation.js
      useFileService.js
      useFocused.js
      useGlobalStates.js
      useInViewport.js
      useOperationCallback.js
      useQueryRetry.js
      useQuestionAnswers.js
      useQuestionChildren.js
      useQuestionChildren.test.js
      useQuestionComments.js
      useQuestionFiles.js
      useQuestionResponses.js
      useResponses.js
      useRestClient.js
      useSetAllLanguages.js
      useStatistics.js
      useStatisticsAtGlance.js
      useSurvey.js
      useSurveyArchive.js
      useSurveyGroupsService.js
      useSurveyImportService.js
      useSurveyLogic.js
      useSurveyRequestTimestamp.js
      useSurveyService.js
      useSurveyUpdatePermission.js
      useTranslationsService.js
      useUserService.js
    i18n/
      scripts/
        identifyAndReportMissingTranslations.js
      CustomI18nBackend.js
    pages/
      Editor/
        LeftSideBar/
          FeedbackButton.js
          index.js
          LeftSideBar.js
          LeftSideBar.stories.js
          LeftSideBar.test.js
        RightSideBar/
          RightSideBar.js
          RightSideBar.stories.js
        Editor.js
        Editor.stories.js
        Editor.test.js
        EditorTutorial.js
        index.js
        Layout.js
        LoadingIndicator.js
      Errors/
        index.js
        NotFound.js
        Unauthorized.js
      Responses/
        components/
          Overview/
            index.js
            ResponsesOverview.js
          ResponsesStatistics/
            Charts/
              BarChart.js
              CustomLegend.js
              DoughnutChart.js
              DualScaleDoughnutChart.js
              GroupedBarChart.js
              index.js
              LineChart.js
              PieChart.js
              PolarAreaChart.js
              RadarChart.js
              RankingBarChart.js
              StackedBarChart.js
              StackedLegend.js
            StatisticsFiltersModal/
              sources/
                fields/
                  DateField.js
                  DateRangeField.js
                  FileUploadedToggle.js
                  IncludedToggle.js
                  index.js
                  LanguageMultiSelect.js
                  NumberRangeField.js
                ArrayFilter.js
                index.js
                ParticipantSource.js
                QuestionSource.js
                RankingFilter.js
                SurveyDataSource.js
              utils/
                buildQuestionOptions.js
                filterModel.js
                index.js
                surveyDataFields.js
              FilterSelect.js
              FilterSelectionRow.js
              index.js
              ResetIcon.js
              StatisticsFiltersBuilder.js
            ArrayTextTable.js
            ChartHeader.js
            ChartRenderV2.js
            ChartsUtils.js
            ChartsUtils.test.js
            CommentsModal.js
            FileUploadTable.js
            index.js
            MultiNumericalGrid.js
            QuestionComments.js
            ResponsesGrid.js
            ResponsesStatistics.js
            StatisticsContainer.js
            StatisticsDetailModal.js
            StatisticsFilters.js
            StatisticsFilterSelect.js
            StatisticsTable.js
          ResponsesTable/
            FileInfoCell.js
            index.js
            ResponsesTable.js
            ResponsesTableBody.js
            ResponsesTableHeader.js
            TableCell.js
          BulkActions.js
          ChartRenderer.js
          ColumnActions.js
          ColumnFilter.js
          ColumnsManagement.js
          ColumnsManagement.test.js
          ExportResponsesModal.js
          index.js
          ResponseDetailView.js
          ResponseModals.js
        Sidebars/
          getResponsesPanels.js
          index.js
          LeftSideBar.js
          RightSideBar.js
        utils/
          columnVisibility.js
          columnVisibility.test.js
          filterTypes.js
          generateColumns.js
          generateColumns.test.js
          generateData.js
          generateData.test.js
          getCellInfo.js
          getCommonPinningStyles.js
          getDefaultColumns.js
          getSelectedRowIdsFromTable.js
          index.js
          renderCellText.js
          tabKeys.js
        index.js
        Responses.js
        ResponsesHeader.js
      SharingPanel/
        SharingPanel.js
      index.js
    plugins/
      PluginManager.js
      pluginRegistry.js
      PluginSlot.js
      slots.js
    providers/
      I18nextProvider.js
      index.js
      PermissionsProvider.js
    sbook/
      helpers/
        constants/
          index.js
          languages.js
        fixtures/
          mockEmptyQuestion.js
          mockQuestion.js
          mockQuestionType.js
          mockQuestionTypeWithSettings.js
          QuestionPreview.js
          StoryOutput.js
          StoryWrapper.js
        functions/
          waitFor.js
      index.js
    services/
      auth.service.js
      expressionScriptValidation.service.js
      file.service.js
      index.js
      responses.service.js
      restClient.service.js
      siteSettings.service.js
      statistics.service.js
      survey.service.js
      surveyArchive.service.js
      surveyGroups.service.js
      surveyImport.service.js
      surveyLogic.service.js
      translations.service.js
      user.service.js
      userSettings.service.js
      versionInfo.service.js
    shared/
      BrandedQRCode.js
      getPlaceholdersConfig.js
      getPublicationAccessSettingsBlocks.js
      getSharingPanels.js
      getSurveyPanelConfig.js
      sharingPanelOptions.js
      translationPanelOptions.js
    App.js
    appInstrumentation.js
    config.js
    i18next.test.js
    i18nInit.js
    index.js
    queryClient.js
    reportWebVitals.js
    routes.js
    setupTests.js
  .env
  .eslintrc.json
  .prettierrc.json
  babel.config.cjs
  build.cjs
  index.html
  jest.config.cjs
  jsconfig.json
  package.json
  README.md
  rsbuild.config.js
  start.cjs
installer/
  create-database.php
modules/
  admin/
    globalsettings/
      controller/
        globalsettings.php
      views/
        _overview.php
        globalSettings_view.php
        HelloWorld.php
      README.md
    HelloWorld/
      controller/
        HelloWorld.php
      views/
        HelloWorldSurvey.php
        index.php
        sayHelloUser.php
      README.md
  root/
    HelloWorld/
      controllers/
        HelloWorldController.php
      HelloWorldModule.php
      README.md
    README.md
plugins/
  Demo/
    demoAddEmFunction/
      demo/
        limesurvey_survey_demo.lss
      config.xml
      demoAddEmFunction.php
      exampleFunctions.php
    DemoDateSetting/
      config.xml
      DemoDateSetting.php
      LICENSE
    Example/
      Example.php
    noMailToExample/
      config.xml
      noMailToExample.php
    ShowResponse/
      ShowResponse.php
    UnActivatable/
      UnActivatable.php
  index.html
themes/
  admin/
    Sea_Green/
      images/
        limesurvey.pal
      config.xml
    index.html
    README_RTL.txt
  question/
    bootstrap_buttons/
      survey/
        questions/
          answer/
            listradio/
              columns/
                column_footer.twig
                column_header.twig
              rows/
                answer_row_noanswer.twig
                answer_row_other.twig
                answer_row.twig
              answer.twig
              config.xml
              translations.php
    bootstrap_buttons_multi/
      survey/
        questions/
          answer/
            multiplechoice/
              rows/
                answer_row_other.twig
                answer_row.twig
              answer.twig
              config.xml
              translations.php
    bootstrap_dropdown/
      survey/
        questions/
          answer/
            list_dropdown/
              rows/
                answer_row.twig
                optgroup.twig
                option.twig
                othertext.twig
              answer.twig
              config.xml
              translations.php
    browserdetect/
      survey/
        questions/
          answer/
            shortfreetext/
              text/
                item.twig
              config.xml
              translations.php
    image_select-listradio/
      survey/
        questions/
          answer/
            listradio/
              rows/
                answer_row_noanswer.twig
                answer_row_other.twig
                answer_row.twig
              answer.twig
              config.xml
              translations.php
    image_select-multiplechoice/
      survey/
        questions/
          answer/
            multiplechoice/
              columns/
                column_header.twig
              rows/
                answer_row_other.twig
                answer_row.twig
              answer.twig
              config.xml
              translations.php
    inputondemand/
      survey/
        questions/
          answer/
            multipleshorttext/
              rows/
                answer_row_inputtext.twig
                answer_row_textarea.twig
              answer.twig
              config.xml
              empty.twig
              translations.php
    ranking_advanced/
      survey/
        questions/
          answer/
            ranking/
              rows/
                answer_row_alt.twig
                answer_row.twig
              answer_alt.twig
              answer.twig
              config.xml
              translations.php
      views/
        basic.twig
        blocks.twig
        bubbles.twig
        buttons.twig
        list.twig
    README.md
  survey/
    bootswatch/
      css/
        variations/
          README.txt
      options/
        index.html
        options.js
        options.twig
        README.md
      scripts/
        index.html
      views/
        subviews/
          content/
            index.html
          survey/
            question_subviews/
              index.html
              question_text_container.twig
              valid_message_and_help.twig
            index.html
      config.xml
    fruity/
      css/
        variations/
          index.html
        index.html
      files/
        index.html
      options/
        index.html
        options.js
        options.twig
      scripts/
        index.html
      views/
        subviews/
          content/
            index.html
          header/
            custom_header.twig
            index.html
          messages/
            index.html
          navigation/
            index.html
          printanswers/
            question_types/
              index.html
            index.html
          privacy/
            index.html
          registration/
            index.html
          survey/
            group_subviews/
              index.html
            question_subviews/
              index.html
            index.html
          index.html
        index.html
      config.xml
      index.html
    fruity_twentythree/
      css/
        index.html
      files/
        index.html
      options/
        index.html
        options.js
        options.twig
      scripts/
        ajaxify.js
        custom.js
        index.html
        theme.js
      views/
        subviews/
          content/
            clearall.twig
            firstpage.twig
            index.html
            load.twig
            main.twig
            mainrow.twig
            optin.twig
            optout.twig
            outerframe.twig
            printanswers.twig
            quotas.twig
            README.md
            register.twig
            save.twig
            statistics_user.twig
            submit_preview.twig
            submit.twig
            userforms.twig
          footer/
            footer.twig
          header/
            custom_header.twig
            google_analytics.twig
            head.twig
            index.html
            nav_bar.twig
            progress_bar.twig
            start_form.twig
          logincomponents/
            captcha.twig
            token_privacy.twig
            token.twig
          messages/
            assessments.twig
            bootstrap_alert_modal.twig
            index.html
            justsaved.twig
            no_js_alert.twig
            warnings.twig
            welcome.twig
          navigation/
            ajax_indicator.twig
            back.twig
            clearall_buttons.twig
            clearall_links.twig
            index.html
            language_changer_first_page.twig
            language_changer_form.twig
            language_changer_top_menu.twig
            language_changer.twig
            navigator_complement.twig
            navigator.twig
            question_index_buttons.twig
            question_index_groups_buttons.twig
            question_index_menu.twig
            question_index_questions_buttons.twig
            save_buttons.twig
            save_links.twig
          print/
            print_group.twig
            print_question.twig
          printanswers/
            question_types/
              index.html
              template_array-10-pt.twig
              template_array-5-pt.twig
              template_array-flexible-column.twig
              template_array-flexible-dual-scale.twig
              template_array-flexible-row.twig
              template_array-increase-same-decrease.twig
              template_array-multi-flexi-text.twig
              template_array-multi-flexi.twig
              template_array-yes-uncertain-no.twig
              template_boilerplate.twig
              template_choice-5-pt-radio.twig
              template_date.twig
              template_equation.twig
              template_gender.twig
              template_generic_question.twig
              template_language.twig
              template_list-dropdown.twig
              template_list-radio-flexible.twig
              template_list-radio.twig
              template_list-with-comment.twig
              template_multiple-opt-comments.twig
              template_multiple-opt.twig
              template_multiple-short-txt.twig
              template_numeric-multi.twig
              template_numeric.twig
              template_ranking.twig
              template_text-huge.twig
              template_text-long.twig
              template_text-short.twig
              template_upload-files.twig
              template_yes-no.twig
              text_question.twig
            index.html
            printanswers_foot.twig
            printanswers_head.twig
            printanswers_question.twig
            printanswers_style.twig
            printanswers_table.twig
            README.md
          privacy/
            allinone_mode_welcome_privacy.twig
            index.html
            privacy_datasecurity_notice_label.twig
            privacy_modal.twig
            privacy_text.twig
            privacy.twig
          registration/
            index.html
            register_error.twig
            register_form.twig
            register_head.twig
            register_message.twig
            register_privacy.twig
            register_success.twig
            required.twig
          statistics_user/
            index.html
            statistics_user_content.twig
            statistics_user_foot.twig
            statistics_user_head.twig
          survey/
            group_subviews/
              group_container.twig
              group_desc.twig
              group_name.twig
              index.html
            question_subviews/
              answers.twig
              asterisk.twig
              index.html
              question_image_container.twig
              question_image.twig
              question_text_container.twig
              question_text_content.twig
              survey_question_help.twig
              valid_message_and_help.twig
            group.twig
            index.html
            question_container.twig
            question.twig
            README.md
          index.html
          README.md
        index.html
        layout_errors.twig
        layout_global.twig
        layout_maintenance.twig
        layout_print.twig
        layout_printanswers.twig
        layout_statistics_user.twig
        layout_survey_list.twig
        layout_user_forms.twig
        ls_logo_svg.twig
        README.md
      config.xml
      index.html
    vanilla/
      css/
        index.html
      files/
        index.html
      options/
        index.html
        options.js
        options.twig
        README.md
      scripts/
        ajaxify.js
        custom.js
        index.html
        theme.js
      views/
        subviews/
          content/
            clearall.twig
            firstpage.twig
            index.html
            load.twig
            main.twig
            mainrow.twig
            optin.twig
            optout.twig
            outerframe.twig
            printanswers.twig
            quotas.twig
            README.md
            register.twig
            save.twig
            statistics_user.twig
            submit_preview.twig
            submit.twig
            userforms.twig
          footer/
            footer.twig
          header/
            custom_header.twig
            google_analytics.twig
            head.twig
            index.html
            nav_bar.twig
            progress_bar.twig
            start_form.twig
          logincomponents/
            captcha.twig
            token_privacy.twig
            token.twig
          messages/
            assessments.twig
            bootstrap_alert_modal.twig
            index.html
            justsaved.twig
            no_js_alert.twig
            warnings.twig
            welcome.twig
          navigation/
            ajax_indicator.twig
            clearall_buttons.twig
            clearall_links.twig
            index.html
            language_changer_first_page.twig
            language_changer_form.twig
            language_changer_top_menu.twig
            language_changer.twig
            navigator_complement.twig
            navigator.twig
            question_index_buttons.twig
            question_index_groups_buttons.twig
            question_index_menu.twig
            question_index_questions_buttons.twig
            save_buttons.twig
            save_links.twig
          print/
            print_group.twig
            print_question.twig
          printanswers/
            question_types/
              index.html
              template_array-10-pt.twig
              template_array-5-pt.twig
              template_array-flexible-column.twig
              template_array-flexible-dual-scale.twig
              template_array-flexible-row.twig
              template_array-increase-same-decrease.twig
              template_array-multi-flexi-text.twig
              template_array-multi-flexi.twig
              template_array-yes-uncertain-no.twig
              template_boilerplate.twig
              template_choice-5-pt-radio.twig
              template_date.twig
              template_equation.twig
              template_gender.twig
              template_generic_question.twig
              template_language.twig
              template_list-dropdown.twig
              template_list-radio-flexible.twig
              template_list-radio.twig
              template_list-with-comment.twig
              template_multiple-opt-comments.twig
              template_multiple-opt.twig
              template_multiple-short-txt.twig
              template_numeric-multi.twig
              template_numeric.twig
              template_ranking.twig
              template_text-huge.twig
              template_text-long.twig
              template_text-short.twig
              template_upload-files.twig
              template_yes-no.twig
              text_question.twig
            index.html
            printanswers_foot.twig
            printanswers_head.twig
            printanswers_question.twig
            printanswers_style.twig
            printanswers_table.twig
            README.md
          privacy/
            allinone_mode_welcome_privacy.twig
            index.html
            privacy_datasecurity_notice_label.twig
            privacy_modal.twig
            privacy_text.twig
            privacy.twig
          registration/
            index.html
            register_error.twig
            register_form.twig
            register_head.twig
            register_message.twig
            register_privacy.twig
            register_success.twig
            required.twig
          statistics_user/
            index.html
            statistics_user_content.twig
            statistics_user_foot.twig
            statistics_user_head.twig
          survey/
            group_subviews/
              group_container.twig
              group_desc.twig
              group_name.twig
              index.html
            question_subviews/
              answers.twig
              asterisk.twig
              index.html
              question_text_container.twig
              question_text_content.twig
              survey_question_help.twig
              valid_message_and_help.twig
            group.twig
            index.html
            question_container.twig
            question.twig
            README.md
          index.html
          README.md
        index.html
        layout_errors.twig
        layout_global.twig
        layout_maintenance.twig
        layout_print.twig
        layout_printanswers.twig
        layout_statistics_user.twig
        layout_survey_list.twig
        layout_user_forms.twig
        README.md
      config.xml
      index.html
      README.md
    index.html
upload/
  admintheme/
    index.html
  global/
    index.html
  labels/
    index.html
    readme.txt
  plugins/
    index.html
  surveys/
    .htaccess
  themes/
    survey/
      generalfiles/
        index.html
      index.html
    index.html
  twig/
    extensions/
      HelloWorld_Twig_Extension/
        HelloWorld_Twig_Extension.php
        HelloWorld_Twig_Extension.xml
        README.md
      README.md
.codespellrc
.eslintrc.json
.htaccess
composer.json
CONTRIBUTING.md
gulpfile.js
index.php
LICENSE
manifest.yml
open-api-gen.php
package.json
phpci.yml
phpcs.ruleset.xml
phpunit.xml
psalm-all.xml
psalm-strict.xml
psalm.xml
publiccode.yml
README.md
SECURITY.md
setdebug.php
</directory_structure>

<files>
This section contains the contents of the repository's files.

<file path="admin/admin.php">
<?php
include_once 'index.php';
</file>

<file path="admin/index.php">
<?php
$config_folder = dirname(__FILE__) . '/../application/config/';
$config_file = $config_folder . 'config.php';
if (!file_exists($config_file)) {
    $config_file = $config_folder . 'config-sample-mysql.php';
}
define('BASEPATH', dirname(__FILE__) . '/..');
$config = require($config_file);
$urlStyle = $config['components']['urlManager']['urlFormat'];
if ($urlStyle == 'path') {
    header('Location: ../index.php/admin');
} else {
    header('Location: ../index.php?r=admin');
}
</file>

<file path="application/commands/AddNotificationCommand.php">
<?php
class AddNotificationCommand extends CConsoleCommand
{
    public function actionIndex($title, $body, $importance = 1)
    {
        $not = new Notification([
            'user_id' => 1,
            'title' => $title,
            'importance' => $importance,
            'message' => $body
        ]);
        $not->save();
    }
}
</file>

<file path="application/commands/CheckIntegrityCommand.php">
<?php
class CheckIntegrityCommand extends CConsoleCommand
{
    const MAX_PASSES = 5;
    public function run($args)
    {
        $integrityChecker = new DataIntegrityChecker();
        $hasWarnings = false;
        $pass = 0;
        $aData = array('integrityok' => false);
        while (!$aData['integrityok'] && $pass < self::MAX_PASSES) {
            $pass++;
            $aData = $integrityChecker->applyAutomaticFixes();
            foreach ($aData['messages'] as $message) {
                echo "[pass {$pass}] " . strip_tags($message) . PHP_EOL;
            }
            foreach ($aData['warnings'] as $warning) {
                echo "[pass {$pass}] WARNING: " . strip_tags($warning) . PHP_EOL;
                $hasWarnings = true;
            }
        }
        $redundantTables = array_merge($aData['redundantsurveytables'] ?? array(), $aData['redundanttokentables'] ?? array());
        if (!empty($redundantTables)) {
            echo PHP_EOL . 'The following old tables still contain response data and were left in place;'
                . ' review and delete them manually via Configuration > Data redundancy check if no longer needed:' . PHP_EOL;
            foreach ($redundantTables as $table) {
                echo '  - ' . $table['table'] . ' (' . strip_tags($table['details']) . ')' . PHP_EOL;
            }
        }
        if (!$aData['integrityok'] && $pass >= self::MAX_PASSES) {
... (29 lines truncated)
</file>

<file path="application/commands/CompileAssetsCommand.php">
<?php
class CompileAssetsCommand extends CConsoleCommand
{
    public function run($args)
    {
        if (isset($args) && count($args) < 2) {
            echo "=========================================================================\n";
            echo "=== Please provide method and path to compile package assets          ===\n";
            echo "=== usage example:                                                    ===\n";
            echo "=== php application/commands/console.php [method] [package] [?silent] ===\n";
            echo "=========================================================================\n";
            return 1;
        }
        $method  = $args[0];
        $package = $args[1];
        $silent  = $args[2] ?? false;
        if (!in_array($method, ['gulp', 'bash', 'npm', 'uglify'])) {
            echo "=========================================================================\n";
            echo "=== ERROR! Please provide a registered method for compiling           ===\n";
            echo "=== Possible methods are:                                             ===\n";
            echo "=== 'gulp', 'bash', 'npm'                                             ===\n";
            echo "=========================================================================\n";
            return 1;
        }
        echo "=========================================================================\n";
        echo "=== Compiling package " . $package . " with " . $method . " \n";
        echo "=========================================================================\n";
        $sCurrentDir = dirname(__FILE__);
        $assetsFolder = realpath($sCurrentDir . '/../../assets/');
        $packageFolder = $assetsFolder . '/packages/' . $package;
... (51 lines truncated)
</file>

<file path="application/commands/console.php">
<?php
if (!isset($argv[0])) {
    die();
}
define('BASEPATH', '.');
define('EXT', '.php');
defined('STDIN') or define('STDIN', fopen('php://stdin', 'r'));
defined('YII_DEBUG') or define('YII_DEBUG', true);
require_once __DIR__ . '/../../vendor/autoload.php';
require_once(dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'yiisoft' . DIRECTORY_SEPARATOR . 'yii' . DIRECTORY_SEPARATOR . 'framework' . DIRECTORY_SEPARATOR . 'yii.php');
$sCurrentDir = dirname(__FILE__);
$settings = require(dirname($sCurrentDir) . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'config-defaults.php');
$config = require(dirname($sCurrentDir) . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'internal.php');
$config['components']['session']['class'] = 'ConsoleHttpSession';
$config['components']['session']['cookieMode'] = 'none';
$config['components']['session']['cookieParams'] = [];
$core = dirname($sCurrentDir) . DIRECTORY_SEPARATOR . 'core' . DIRECTORY_SEPARATOR;
if (isset($config['config'])) {
    $settings = array_merge($settings, $config['config']);
}
unset($config['defaultController']);
unset($config['config']);
if (!isset($config['runtimePath'])) {
    $runtimePath = $settings['tempdir'] . '/runtime';
    if (!is_dir($runtimePath) || !is_writable($runtimePath)) {
        $runtimePath = str_replace($settings['rootdir'], dirname(dirname(dirname(__FILE__))), $runtimePath);
    }
    $config['runtimePath'] = $runtimePath;
}
unset($config['defaultController']);
... (15 lines truncated)
</file>

<file path="application/commands/DemomodeCommand.php">
<?php
class DemomodeCommand extends CConsoleCommand
{
    public function run($args)
    {
        if (isset($args) && isset($args[0]) && $args[0] = 'yes') {
            echo "\n###### Restoring installation to demomode #####\n";
            echo "|| Resetting Database\n";
            $this->resetDatabase();
            echo "|| Resetting Files\n";
            $this->resetFiles();
            echo "|| Installing demo surveys\n";
            $this->createDemo();
            echo "##### Done recreating demo state #####\n";
            return 0;
        } else {
            echo 'This CLI command wipes a LimeSurvey installation clean (including all user except for the user ID 1 and user-uploaded content). '
               . 'For security reasons this command can only started if you add the parameter \'yes\' to the command line.';
            return 1;
        }
    }
    private function resetDatabase()
    {
        Yii::import('application.helpers.common_helper', true);
        Yii::import('application.helpers.database_helper', true);
        $truncatableTables = [
            '{{assessments}}',
            '{{answers}}',
            '{{answer_l10ns}}',
            '{{boxes}}',
... (149 lines truncated)
</file>

<file path="application/commands/FlushAssetsCommand.php">
<?php
class FlushAssetsCommand extends CConsoleCommand
{
    public function run($args)
    {
        $sCurrentDir = dirname(__FILE__);
        $tmpFolder = realpath($sCurrentDir . '/../../tmp/');
        if ($tmpFolder === false) {
            echo 'Tmp folder  ' . $sCurrentDir . '/../../tmp/ not found';
            return;
        }
        echo "Flushing assets in " . $tmpFolder;
        echo "\n";
        $this->_sureRemoveFiles($tmpFolder . '/assets/', false, ['index.html']);
        $this->_sureRemoveFiles($tmpFolder . '/runtime/cache/', false, ['index.html']);
    }
    private function _sureRemoveFiles($dir, $DeleteMe, $exclude = array())
    {
        if (!$dh = @opendir($dir)) {
            return;
        }
        while (false !== ($obj = readdir($dh))) {
            if ($obj == '.' || $obj == '..' || in_array($obj, $exclude)) {
                continue;
            }
            if (!@unlink($dir . '/' . $obj)) {
                $this->_sureRemoveFiles($dir . '/' . $obj, true);
            }
        }
        closedir($dh);
... (8 lines truncated)
</file>

<file path="application/commands/ImportSurveyCommand.php">
<?php
Yii::import('application.helpers.replacements_helper', true);
Yii::import('application.helpers.expressions.em_manager_helper', true);
Yii::import('application.helpers.common_helper', true);
Yii::import('application.helpers.admin.import_helper', true);
class ImportSurveyCommand extends CConsoleCommand
{
    protected function importFile($filename, $baselang)
    {
        $params = [
            "bTranslateLinkFields" => false,
            "sNewSurveyName" => null,
            "DestSurveyID" => null,
        ];
        return importSurveyFile(
            $filename,
            $params["bTranslateLinkFields"],
            $params["sNewSurveyName"],
            $params["DestSurveyID"],
            $baselang
        );
    }
    public function run($args)
    {
        $source = $args[0];
        $baselang = null;
        if (strpos($args[0], ':') !== 0) {
            $split = explode(":", $args[0]);
            $source = $split[0];
            $baselang = $split[1];
... (11 lines truncated)
</file>

<file path="application/commands/InstallCommand.php">
<?php
class InstallCommand extends CConsoleCommand
{
    public $noisy = false;
    public $connection;
    public function run($args)
    {
        if (isset($args) && isset($args[0]) && isset($args[1]) && isset($args[2]) && isset($args[3])) {
            Yii::import('application.helpers.common_helper', true);
            $this->setNoisy($args);
            try {
                $this->output('Connecting to database...');
                $this->connection = App()->getDb();
                $this->connection->active = true;
                $this->output('Using connection string ' . $this->connection->connectionString);
            } catch (CDbException $e) {
                $this->output('Could not connect to database: ' . $e->getMessage());
                $this->createDatabase();
            };
            $this->prepareCharset();
            $sFileName = dirname(APPPATH) . '/installer/create-database.php';
            require_once($sFileName);
            try {
                $this->output('Creating tables...');
                populateDatabase($this->connection);
            } catch (Exception $e) {
                $this->output('Could not create LimeSurvey tables: ' . $e->getMessage());
                return 1;
            }
            $this->createUser($args);
... (133 lines truncated)
</file>

<file path="application/commands/InstallFromConfigCommand.php">
<?php
class InstallFromConfigCommand extends CConsoleCommand
{
    public $noisy = false;
    public $configuration = [];
    public $dbConnectionArray = [];
    public $connection;
    public function run($args)
    {
        if (isset($args) && isset($args[0])) {
            $readFromConfig = realpath($args[0]);
            $this->configuration = include($readFromConfig);
            $this->dbConnectionArray = $this->configuration['components']['db'];
            foreach ($this->configuration as $configKey => $configValue) {
                Yii::app()->params[$configKey] = $configValue;
            }
            Yii::import('application.helpers.common_helper', true);
            $this->setNoisy($args);
            try {
                $this->output('Connecting to database...');
                $this->connection = App()->getDb();
                $this->connection->connectionString = $this->dbConnectionArray['connectionString'];
                $this->connection->username = $this->dbConnectionArray['username'];
                $this->connection->password = $this->dbConnectionArray['password'];
                $this->connection->active = true;
                $this->output('Using connection string ' . $this->connection->connectionString);
            } catch (CDbException $e) {
                $this->output('Could not connect to database: ' . $e->getMessage());
                $this->createDatabase();
            };
... (134 lines truncated)
</file>

<file path="application/commands/PluginCommand.php">
<?php
class PluginCommand extends CConsoleCommand
{
    public $connection;
    public function init()
    {
        parent::init();
        Yii::import('application.helpers.common_helper', true);
    }
    public function actionCron($interval = null)
    {
        $pm = \Yii::app()->pluginManager;
        $event = new PluginEvent('cron');
        $event->set('interval', $interval);
        $pm->dispatchEvent($event);
    }
    public function actionIndex($target, $function = null, $option = null)
    {
        $pm = \Yii::app()->pluginManager;
        $event = new PluginEvent('direct');
        $event->set('target', $target);
        $event->set('function', $function);
        $event->set('option', $option);
        $pm->dispatchEvent($event);
    }
}
</file>

<file path="application/commands/ResetPasswordCommand.php">
<?php
class ResetPasswordCommand extends CConsoleCommand
{
    public $connection;
    public function run($args)
    {
        if (isset($args) && isset($args[0]) && isset($args[1])) {
            $oUser = User::findByUsername($args[0]);
            if ($oUser) {
                Yii::import('application.helpers.common_helper', true);
                $oUser->setPassword($args[1]);
                if ($oUser->save(true, ['password', 'session_token'])) {
                    echo "Password for user {$args[0]} was set.\n";
                    return 0;
                } else {
                    echo "An error happen when set password for user {$args[0]}.\n";
                    return 1;
                }
            } else {
                echo "User " . $args[0] . " not found.\n";
                return 1;
            }
        } else {
            echo 'You have to set username and password on the command line like this: php console.php username password';
            return 1;
        }
    }
}
</file>

<file path="application/commands/TwigCommand.php">
<?php
class TwigCommand extends CConsoleCommand
{
    public $aLogs;
    public function init()
    {
        Yii::import('application.helpers.surveytranslator_helper', true);
        Yii::import('application.helpers.common_helper', true);
        Yii::import('application.helpers.expressions.em_manager_helper', true);
        Yii::import('application.helpers.admin.htmleditor_helper', true);
        Yii::app()->assetManager->setBasePath(realpath(__DIR__ . '/../../tmp/assets/'));
        Yii::app()->setConfig('force_xmlsettings_for_survey_rendering', true);
    }
    public function actionIndex()
    {
        echo "This class will generate all the twig cache file from command line, even if LimeSurvey is not installed.\n";
        echo "The current use case is to generate the translation files using Glot Press.\n";
        echo "In the future, it could be use to boost performance of first survey rendering (can be useful after a tmp cleanup, an update, etc).\n";
        echo "\n";
        echo "\n";
        echo "To execute this command :\n";
        echo "php application/commands/console.php Twig generateTwigTmpFiles \n";
    }
    public function actionGenerateTwigTmpFiles($sThemeDir = null, $bGenerateSurveyCache = true, $bGenerateQuestionsCache = true, $bGenerateAdminCache = true, $bGenerateQuestionThemeCache = true)
    {
        $this->aLogs = array();
        $this->aLogs["action"] = "actionGenerateTwigTmpFiles $sThemeDir $bGenerateSurveyCache $bGenerateQuestionsCache $bGenerateAdminCache $bGenerateQuestionThemeCache";
        if ($bGenerateSurveyCache) {
            $this->actionGenerateSurveyThemesCache($sThemeDir);
        }
... (136 lines truncated)
</file>

<file path="application/commands/UpdateDbCommand.php">
<?php
class UpdateDBCommand extends CConsoleCommand
{
    public $configuration = [];
    public $connection;
    public function run($args = null)
    {
        $usingCustomConfig = isset($args) && isset($args[0]) && $args[0];
        if ($usingCustomConfig) {
            $this->useCustomConfig($args[0]);
        }
        $newDbVersion = (int) Yii::app()->getConfig('dbversionnumber');
        $currentDbVersion = $usingCustomConfig
            ? $this->getCurrentDbVersion()
            : intval(Yii::app()->getConfig('DBVersion'));
        if (!$currentDbVersion) {
            throw new CException("Database version was not found, LimeSurvey is not correctly installed.");
        }
        if ($newDbVersion > $currentDbVersion) {
            echo "Update " . Yii::app()->db->connectionString . " with prefix :";
            echo Yii::app()->db->tablePrefix . " from {$currentDbVersion} to {$newDbVersion}\n";
            Yii::import('application.helpers.common_helper', true);
            Yii::import('application.helpers.update.update_helper', true);
            Yii::import('application.helpers.update.updatedb_helper', true);
            $incompleteUpdate = getIncompleteDatabaseUpdateMarker();
            if ($incompleteUpdate !== null) {
                throw new CException("A previous database update (starting from database version {$incompleteUpdate}) failed or was interrupted, so the database is probably in an inconsistent state. Please restore the database backup you made before the update, then run the update again.");
            }
            $result = db_upgrade_all($currentDbVersion);
            if ($result) {
... (44 lines truncated)
</file>

<file path="application/commands/ValidateExpressionCommand.php">
<?php
class ValidateExpressionCommand extends CConsoleCommand
{
    public function actionEmail($surveyId, $lang, $type)
    {
        $_GET['type'] = $type;
        Yii::import('application.controllers.admin.ExpressionValidate', true);
        Yii::import('application.helpers.expressions.em_manager_helper', true);
        Yii::import('application.helpers.replacements_helper', true);
        Yii::import('application.helpers.common_helper', true);
        $c = new ExpressionValidate();
        $_SESSION['LEMsid'] = $surveyId;
        $c->email($surveyId, $lang);
    }
}
</file>

<file path="application/commands/WipeCommand.php">
<?php
class WipeCommand extends CConsoleCommand
{
    public function run($args)
    {
        if (isset($args) && isset($args[0]) && $args[0] = 'yes') {
            Yii::import('application.helpers.common_helper', true);
            $actquery = "truncate table {{assessments}}";
            Yii::app()->db->createCommand($actquery)->execute();
            $actquery = "truncate table {{answers}}";
            Yii::app()->db->createCommand($actquery)->execute();
            $actquery = "truncate table {{answer_l10ns}}";
            Yii::app()->db->createCommand($actquery)->execute();
            $actquery = "truncate table {{asset_version}}";
            Yii::app()->db->createCommand($actquery)->execute();
            $actquery = "truncate table {{boxes}}";
            Yii::app()->db->createCommand($actquery)->execute();
            $actquery = "truncate table {{conditions}}";
            Yii::app()->db->createCommand($actquery)->execute();
            $actquery = "truncate table {{defaultvalues}}";
            Yii::app()->db->createCommand($actquery)->execute();
            $actquery = "truncate table {{defaultvalue_l10ns}}";
            Yii::app()->db->createCommand($actquery)->execute();
            $actquery = "truncate table {{labels}}";
            Yii::app()->db->createCommand($actquery)->execute();
            $actquery = "truncate table {{label_l10ns}}";
            Yii::app()->db->createCommand($actquery)->execute();
            $actquery = "truncate table {{labelsets}}";
            Yii::app()->db->createCommand($actquery)->execute();
            $actquery = "truncate table " . Yii::app()->db->quoteTableName('{{groups}}');
... (150 lines truncated)
</file>

<file path="application/commands/XmlTranslationCommand.php">
<?php
class XmlTranslationCommand extends CConsoleCommand
{
    public function actionIndex()
    {
        echo "This command will take all config.xml files \n";
        echo "in the following directories:\n \n";
        echo " * " . realpath(dirname(__FILE__) . "/../views/survey/questions/answer") . "\n";
        echo " * " . realpath(dirname(__FILE__) . '/../../themes/question') . "\n \n";
        echo "And it will generate php files with the strings to be translated \n";
        echo "in " . realpath(dirname(__FILE__) . "/../../tmp") . "\n";
    }
    public function actionGenerateTranslationFiles()
    {
        $this->generateFiles(dirname(__FILE__) . '/../views/survey/questions/answer', 'view');
        $oThemesDir = new DirectoryIterator(dirname(__FILE__) . '/../../themes/question');
        foreach ($oThemesDir as $dirInfo) {
            if ($dirInfo->isDot() || $dirInfo->isFile()) {
                continue;
            }
            $sDirPath = $dirInfo->getRealPath();
            $this->generateFiles($sDirPath . '/survey/questions/answer', 'theme');
        }
    }
    private function generateFiles($sViewsDir, $sFilePrefix)
    {
        $oViewsDir = new DirectoryIterator($sViewsDir);
        foreach ($oViewsDir as $fileInfo) {
            if ($fileInfo->isDot() || $fileInfo->isFile()) {
                continue;
... (43 lines truncated)
</file>

<file path="application/config/rest/v1/example/survey-patch-all.json">
{
    "patch": [
        {
            "entity": "survey",
            "op": "update",
            "id": 282267,
            "props": {
                "anonymized": false,
                "language": "de-informal"
            }
        },
        {
            "entity": "languageSetting",
            "op": "update",
            "id": {
                "sid": 282267,
                "language": "de-informal"
            },
            "props": {
                "title": "Beispielfragebogen für Limesurvey EN/FR/DE - reverted"
            }
        },
        {
            "entity": "questionGroup",
            "op": "update",
            "id": {
                "gid": 1
            },
            "props": {
                "groupOrder": 1000
... (54 lines truncated)
</file>

<file path="application/config/rest/v1/example/survey-post-template.json">
{
  "language": "en"
}
</file>

<file path="application/config/rest/v1/example/survey-responses-patch.json">
{
  "patch": [
    {
      "entity": "response",
      "op": "update",
      "id": 1,
      "props": {
        "896595X696X14782SQ001": "Y"
      }
    }
  ]
}
</file>

<file path="application/config/rest/v1/auth.php">
<?php
use LimeSurvey\Api\Command\V1\{
    AuthSessionCreate,
    AuthTokenSimpleCreate,
    AuthTokenSimpleRefresh,
    AuthTokenSimpleRelease
};
use LimeSurvey\Api\Rest\V1\SchemaFactory\{
    SchemaFactoryError,
    SchemaFactoryAuthToken
};
$errorSchema = (new SchemaFactoryError())->make();
$rest = [];
$rest['v1/auth'] = [
    'POST' => [
        'description' => 'Generate new authentication token',
        'commandClass' => AuthTokenSimpleCreate::class,
        'params' => [
            'username' => ['src' => 'form'],
            'password' => ['src' => 'form']
        ],
        'bodyParams' => [],
        'responses' => [
            'success' => [
                'code' => 200,
                'description' => 'Success - returns string access token for use in header '
                    . '"Authorization: Bearer $token"',
                'schema' => (new SchemaFactoryAuthToken())->make()
            ],
            'unauthorized' => [
... (49 lines truncated)
</file>

<file path="application/config/rest/v1/file-upload.php">
<?php
use GoldSpecDigital\ObjectOrientedOAS\Objects\Schema;
use LimeSurvey\Api\Command\V1\FileUpload;
use LimeSurvey\Api\Rest\V1\SchemaFactory\SchemaFactoryError;
$errorSchema = (new SchemaFactoryError())->make();
$fileUploadSchema = Schema::object()
    ->properties(
        Schema::string('file')->format('binary')->description('The file to upload')
    );
$rest = [];
$rest['v1/file-upload-survey-image/$id'] = [
    'POST' => [
        'tag' => 'upload',
        'multipart' => true,
        'description' => 'File upload via  Axios post request (multipart/form-data)',
        'commandClass' => FileUpload::class,
        'params' => [
            'file' => ['src' => 'files'],
        ],
        'schema' => $fileUploadSchema,
        'auth' => true,
        'responses' => [
            'success' => [
                'code' => 200,
                'description' => 'Success',
                'examples' => null,
                'content' => null,
                'schema' => null
            ],
            'unauthorized' => [
... (14 lines truncated)
</file>

<file path="application/config/rest/v1/i18n.php">
<?php
use LimeSurvey\Api\Command\V1\I18n;
use LimeSurvey\Libraries\Api\Command\V1\I18nMissing;
use LimeSurvey\Libraries\Api\Command\V1\I18nRefreshLanguages;
use LimeSurvey\Libraries\Api\Rest\V1\SchemaFactory\SchemaFactoryI18n;
use LimeSurvey\Api\Rest\V1\SchemaFactory\{SchemaFactoryError,
    SchemaFactoryI18nMissingTranslations,
    SchemaFactoryI18nMissingTranslationsResponse,
    SchemaFactoryI18nRefreshLanguages};
$errorSchema = (new SchemaFactoryError())->make();
$i18nRefreshLanguagesSchema = (new SchemaFactoryI18nRefreshLanguages())->make();
$i18nSchema = (new SchemaFactoryI18n())->make();
$i18nMissingSchemaResponse = (new SchemaFactoryI18nMissingTranslationsResponse())->make();
$i18nMissingSchema = (new SchemaFactoryI18nMissingTranslations())->make();
$rest = [];
$rest['v1/i18n/{lang}'] = [
    'GET' => [
        'tag' => 'i18n',
        'summary' => 'Get translations',
        'description' => 'Get all translations for a specific language',
        'operationId' => 'getTranslations',
        'commandClass' => I18n::class,
        'auth' => true,
        'parameters' => [
            [
                'name' => 'lang',
                'in' => 'path',
                'required' => true,
                'schema' => [
                    'type' => 'string'
... (93 lines truncated)
</file>

<file path="application/config/rest/v1/permissions.php">
<?php
use LimeSurvey\Api\Command\V1\UserPermission;
use LimeSurvey\Api\Rest\V1\SchemaFactory\{SchemaFactoryError, SchemaFactoryUserPermission};
$errorSchema = (new SchemaFactoryError())->make();
$rest = [];
$rest['v1/user-permissions'] = [
    'GET' => [
        'tag' => 'user',
        'description' => 'User permissions',
        'commandClass' => UserPermission::class,
        'auth' => true,
        'params' => [
            'surveyId' => ['type' => 'int'],
        ],
        'responses' => [
            'success' => [
                'code' => 200,
                'description' => 'Success',
                'content' => null,
                'schema' => (new SchemaFactoryUserPermission())->make()
            ],
            'unauthorized' => [
                'code' => 401,
                'description' => 'Unauthorized',
                'schema' => $errorSchema
            ],
            'forbidden' => [
                'code' => 403,
                'description' => 'Forbidden',
                'schema' => $errorSchema
... (6 lines truncated)
</file>

<file path="application/config/rest/v1/site-settings.php">
<?php
use LimeSurvey\Api\Command\V1\{
    SiteSettings
};
use LimeSurvey\Api\Rest\V1\SchemaFactory\SchemaFactorySiteSettings;
$rest = [];
$rest['v1/site-settings'] = [
    'GET' => [
        'description' => 'Site Settings',
        'commandClass' => SiteSettings::class,
        'params' => [],
        'responses' => [
            'success' => [
                'code' => 200,
                'description' => 'Success',
                'content' => null,
                'schema' => (new SchemaFactorySiteSettings())->make()
            ]
        ]
    ]
];
return $rest;
</file>

<file path="application/config/rest/v1/statistics.php">
<?php
use LimeSurvey\Libraries\Api\Command\V1\SurveyStatisticsGlance;
use LimeSurvey\Libraries\Api\Rest\V1\SchemaFactory\SchemaFactorySurveyStatistics;
use LimeSurvey\Api\Rest\V1\SchemaFactory\{SchemaFactoryError,
    SchemaFactorySurveyPatch,
    SchemaFactorySurveyStatisticsGlance,
    SchemaFactorySurveyStatisticsOverview,
    SchemaFactorySurveyTemplate};
use LimeSurvey\Libraries\Api\Command\V1\Statistics;
use LimeSurvey\Libraries\Api\Command\V1\StatisticsOverview;
$errorSchema = (new SchemaFactoryError())->make();
$surveyPatchSchema = (new SchemaFactorySurveyPatch())->make();
$surveyTemplateSchema = (new SchemaFactorySurveyTemplate())->make();
$rest = [];
$rest['v1/statistics-overview/$id'] = [
    'GET' => [
        'tag' => 'survey',
        'description' => 'Statistics Overview',
        'commandClass' => StatisticsOverview::class,
        'auth' => true,
        'params' => [
        ],
        'responses' => [
            'success' => [
                'code' => 200,
                'description' => 'Success',
                'content' => null,
                'schema' => (new SchemaFactorySurveyStatisticsOverview())->make()
            ],
            'unauthorized' => [
... (65 lines truncated)
</file>

<file path="application/config/rest/v1/survey-group.php">
<?php
use LimeSurvey\Api\Command\V1\{SurveyGroupList, SurveyGroups};
use LimeSurvey\Api\Rest\V1\SchemaFactory\{
    SchemaFactoryError,
    SchemaFactorySurveyGroupList
};
$errorSchema = (new SchemaFactoryError())->make();
$rest = [];
$rest['v1/survey-group-list'] = [
    'GET' => [
        'tag' => 'survey-group',
        'description' => 'Survey group list',
        'commandClass' => SurveyGroupList::class,
        'auth' => true,
        'params' => [
            'pageSize' => ['type' => 'int'],
            'page' => ['type' => 'int']
        ],
        'responses' => [
            'success' => [
                'code' => 200,
                'description' => 'Success',
                'content' => null,
                'schema' => (new SchemaFactorySurveyGroupList())->make()
            ],
            'unauthorized' => [
                'code' => 401,
                'description' => 'Unauthorized',
                'schema' => $errorSchema
            ]
... (30 lines truncated)
</file>

<file path="application/config/rest/v1/survey-responses.php">
<?php
use LimeSurvey\Libraries\Api\Command\V1\SurveyResponses;
use LimeSurvey\Libraries\Api\Command\V1\SurveyResponsesExport;
use LimeSurvey\Libraries\Api\Command\V1\SurveyResponsesPatch;
use LimeSurvey\Libraries\Api\Rest\V1\SchemaFactory\SchemaFactorySurveyResponsesExport;
use LimeSurvey\Api\Rest\V1\SchemaFactory\{
    SchemaFactoryError,
    SchemaFactorySurveyResponses,
    SchemaFactorySurveyResponsesPatch
};
use GoldSpecDigital\ObjectOrientedOAS\Objects\Schema;
$errorSchema = (new SchemaFactoryError())->make();
$responsesSchema = (new SchemaFactorySurveyResponses())->make();
$responsesPatchSchema = (new SchemaFactorySurveyResponsesPatch())->make();
$rest = [];
$rest['v1/survey-responses/$id'] = [
    'POST' => [
        'tag' => 'survey',
        'description' => 'Survey responses',
        'commandClass' => SurveyResponses::class,
        'auth' => true,
        'params' => [
            'filters' => ['type' => 'array'],
            'sort' => ['type' => 'array'],
            'page' => ['type' => 'array'],
            'language' => ['type' => 'string'],
            'fields' => ['type' => 'array'],
            'unnestFiles' => ['type' => 'boolean']
        ],
        'responses' => [
... (76 lines truncated)
</file>

<file path="application/config/rest/v1/survey.php">
<?php
use LimeSurvey\Api\Command\V1\{
    SurveyList,
    SurveyDetail,
    SurveyPatch,
    SurveyTemplate,
    SurveyArchive,
    SurveyImport,
    SurveyLogic,
    SurveyQuestionsFieldname,
    ExpressionScriptValidate
};
use LimeSurvey\Api\Rest\V1\SchemaFactory\{
    SchemaFactoryError,
    SchemaFactorySurveyList,
    SchemaFactorySurveyDetail,
    SchemaFactorySurveyPatch,
    SchemaFactorySurveyTemplate,
    SchemaFactorySurveyArchive,
    SchemaFactorySurveyLogic,
    SchemaFactorySurveyQuestionsFieldname,
    SchemaFactoryExpressionScriptValidation,
    SchemaFactoryExpressionScriptValidationRequest
};
$errorSchema = (new SchemaFactoryError())->make();
$surveyPatchSchema = (new SchemaFactorySurveyPatch())->make();
$surveyTemplateSchema = (new SchemaFactorySurveyTemplate())->make();
$expressionScriptValidationRequestSchema = (new SchemaFactoryExpressionScriptValidationRequest())->make();
$rest = [];
$rest['v1/survey'] = [
... (249 lines truncated)
</file>

<file path="application/config/rest/v1/user.php">
<?php
use LimeSurvey\Libraries\Api\Command\V1\UserDetail;
use LimeSurvey\Libraries\Api\Command\V1\UserSettingGetValue;
use LimeSurvey\Libraries\Api\Command\V1\UserSettingSetValue;
use LimeSurvey\Api\Command\V1\{
  UserList
};
use LimeSurvey\Api\Rest\V1\SchemaFactory\{SchemaFactoryError, SchemaFactoryUser, SchemaFactoryUserList, SchemaFactoryUserSetting};
$errorSchema = (new SchemaFactoryError())->make();
$rest = [];
$rest['v1/user'] = [
  'GET' => [
    'description' => 'User list',
    'commandClass' => UserList::class,
    'auth' => true,
    'params' => [
      'pageSize' => ['type' => 'int'],
      'page' => ['type' => 'int']
    ],
    'responses' => [
      'success' => [
        'code' => 200,
        'description' => 'Success',
        'content' => null,
        'schema' => (new SchemaFactoryUserList())->make()
      ],
      'unauthorized' => [
        'code' => 401,
        'description' => 'Unauthorized',
        'schema' => $errorSchema
... (93 lines truncated)
</file>

<file path="application/config/rest/v1/version-info.php">
<?php
use LimeSurvey\Libraries\Api\Rest\V1\SchemaFactory\SchemaFactoryVersionInfo;
use LimeSurvey\Api\Command\V1\{
    VersionInfo
};
$rest = [];
$rest['v1/version-info'] = [
    'GET' => [
        'description' => 'Version Info',
        'commandClass' => VersionInfo::class,
        'params' => [],
        'responses' => [
            'success' => [
                'code' => 200,
                'description' => 'Success',
                'content' => null,
                'schema' => (new SchemaFactoryVersionInfo())->make()
            ]
        ]
    ]
];
return $rest;
</file>

<file path="application/config/rest/v1.php">
<?php
$rest = [
    'v1' => [
        'title' => 'LimeSurvey V1',
        'description' => 'LimeSurvey V1 REST API',
        'tags' => [
            'survey' => [
                'name' => 'Survey',
                'description' => 'Survey',
            ],
            'auth' => [
                'name' => 'Auth',
                'description' => 'Auth',
            ],
            'session' => [
                'name' => 'Session',
                'description' => 'Session (deprecated - use auth)',
            ],
            'survey-group' => [
                'name' => 'Survey Group',
                'description' => 'Survey Group',
            ],
            'site-settings' => [
                'name' => 'Site Settings',
                'description' => 'Site Settings',
            ],
            'i18n' => [
                'name' => 'I18n',
                'description' => 'Translations',
            ],
... (30 lines truncated)
</file>

<file path="application/config/config-defaults.php">
<?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
$config = array();
$config['rootdir'] = getcwd();
$config['sitename']           = 'LimeSurvey';
$config['scriptname']         = 'admin.php';
$config['defaultuser']        = 'admin';
$config['defaultpass']        = 'password';
$config['admintheme']         = 'Sea_Green';
$config['adminthemeiconsize'] = 32;
$config['maxLoginAttempt']    = 3;
$config['timeOutTime']        = 60 * 10;
$config['maxLoginAttemptParticipants']    = 3;
$config['timeOutParticipants']        = 60 * 10;
$config['printanswershonorsconditions'] = 1;
$config['repeatheadings']            = '25';
$config['minrepeatheadings']         = 3;
$config['defaultlang']               = 'en';
$config['displayTimezone']           = ''; // Timezone (for example 'Europe/Berlin') which is used to displayed any date/time information in the application - if empty defaults to UTC
$config['maxdumpdbrecords']          = 500;
$config['maxdbsizeforbackup']        = 0;
$config['allowexportalldb']          = 0;
$config['maxDatabaseSizeForDump']    = 256;
$config['deletenonvalues']           = 1;
$config['stringcomparizonoperators'] = 0;
$config['blacklistallsurveys']       = 'N';
$config['blacklistnewsurveys']       = 'N';
$config['blockaddingtosurveys']      = 'Y';
... (249 lines truncated)
</file>

<file path="application/config/config-sample-dblib.php">
<?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
return array(
    'name' => 'LimeSurvey',
    'components' => array(
        'db' => array(
            'connectionString' => 'dblib:host=localhost;dbname=limesurvey',
            'username' => 'sa',
            'password' => 'somepassword',
            'charset' => 'utf8',
            'tablePrefix' => 'lime_',
            'initSQLs' => array('SET DATEFORMAT ymd;', 'SET QUOTED_IDENTIFIER ON;'),
        ),
        'urlManager' => array(
            'urlFormat' => 'path',
            'rules' => require('routes.php'),
            'showScriptName' => true,
        ),
    ),
    'config' => array(
        'debug' => 0,
        'debugsql' => 0
    )
);
</file>

<file path="application/config/config-sample-mysql.php">
<?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
return array(
    'components' => array(
        'db' => array(
            'connectionString' => 'mysql:host=127.0.0.1;port=3306;dbname=limesurvey;',
            'emulatePrepare' => true,
            'username' => 'root',
            'password' => 'root',
            'charset' => 'utf8mb4',
            'tablePrefix' => 'lime_',
        ),
        'urlManager' => array(
            'urlFormat' => 'path',
            'rules' => array(
            ),
            'showScriptName' => true,
        ),
    ),
    'config' => array(
        'debug' => 0,
        'debugsql' => 0,
    )
);
</file>

<file path="application/config/config-sample-pgsql.php">
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
return array(
	'components' => array(
		'db' => array(
			'connectionString' => 'pgsql:host=localhost;port=5432;dbname=limesurvey;',
			'emulatePrepare' => true,
			'username' => 'postgres',
			'password' => 'somepassword',
			'charset' => 'utf8',
			'tablePrefix' => 'lime_',
		),
		 'session' => array (
			'sessionName'=>'LS-HIQBFUVHDRJIFHMG',
		 ),
		'urlManager' => array(
			'urlFormat' => 'path',
			'rules' => array(
			),
			'showScriptName' => true,
		),
	),
	'config'=>array(
		'debug'=>0,
		'debugsql'=>0,
	)
);
</file>

<file path="application/config/config-sample-sqlsrv.php">
<?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
return array(
    'name' => 'LimeSurvey',
    'components' => array(
        'db' => array(
            'connectionString' => 'sqlsrv:Server=localhost;Database=limesurvey',
            'username' => 'sa',
            'password' => 'somepassword',
            'charset' => 'utf8',
            'tablePrefix' => 'lime_',
            'initSQLs' => array('SET DATEFORMAT ymd;', 'SET QUOTED_IDENTIFIER ON;'),
        ),
        'urlManager' => array(
            'urlFormat' => 'path',
            'rules' => require('routes.php'),
            'showScriptName' => true,
        ),
    ),
    'config' => array(
        'debug' => 0,
        'debugsql' => 0
    )
);
</file>

<file path="application/config/console.php">
<?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
$config = array();
$config['rootdir']                  = (string) Yii::getPathOfAlias('webroot');
$config['publicdir']                = $config['rootdir'];
$config['homedir']                  = $config['rootdir'];
$config['configdir']                = $config['rootdir'] . DIRECTORY_SEPARATOR . 'application' . DIRECTORY_SEPARATOR . 'config';
$config['tempdir']                  = $config['rootdir'] . DIRECTORY_SEPARATOR . "tmp";
$config['imagedir']                 = $config['rootdir'] . DIRECTORY_SEPARATOR . "assets" . DIRECTORY_SEPARATOR . "images";
$config['uploaddir']                = $config['rootdir'] . DIRECTORY_SEPARATOR . "upload";
$config['standardthemerootdir']     = $config['rootdir'] . DIRECTORY_SEPARATOR . "themes" . DIRECTORY_SEPARATOR . "survey";
$config['publicstylepath']          = $config['rootdir'] . DIRECTORY_SEPARATOR . 'assets' . DIRECTORY_SEPARATOR . 'styles-public';
$config['corequestionthemedir']     = "themes" . DIRECTORY_SEPARATOR . "question";
$config['corequestionthemerootdir'] = $config['rootdir'] . DIRECTORY_SEPARATOR . $config['corequestionthemedir'];
$config['styledir']                 = $config['rootdir'] . DIRECTORY_SEPARATOR . 'themes' . DIRECTORY_SEPARATOR . 'admin';
$config['questiontypedir']          = $config['rootdir'] . DIRECTORY_SEPARATOR . 'application' . DIRECTORY_SEPARATOR . 'extensions' . DIRECTORY_SEPARATOR . 'questionTypes';
$config['userthemerootdir']         = $config['uploaddir'] . DIRECTORY_SEPARATOR . "themes" . DIRECTORY_SEPARATOR . "survey";
$config['customquestionthemedir']     = "themes" . DIRECTORY_SEPARATOR . "question";
$config['userquestionthemerootdir'] = $config['uploaddir'] . DIRECTORY_SEPARATOR . $config['customquestionthemedir'];
return $config;
</file>

<file path="application/config/email.php">
<?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
$config = array();
$config['siteadminemail']     = ''; // The default email address of the site administrator
$config['siteadminbounce']    = ''; // The default email address used for error notification of sent messages for the site administrator (Return-Path)
$config['siteadminname']      = 'Site admin';
$config['emailmethod']        = 'mail';
$config['protocol'] = $config['emailmethod'];
$config['emailsmtphost']      = 'localhost';
$config['emailsmtpuser']      = ''; // SMTP authorisation username - only set this if your server requires authorization - if you set it you HAVE to set a password too
$config['emailsmtppassword']  = ''; // SMTP authorisation password - empty password is not allowed
$config['emailsmtpssl']       = ''; // Set this to 'ssl' to use SSL/TLS or 'tls' to use StartTLS for SMTP connection
$config['emailsmtpdebug']     = 0;
$config['maxemails']          = 50;
$config['emailcharset']       = "utf-8";
return $config;
</file>

<file path="application/config/fonts.php">
<?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
$debug = $userConfig['config']['debug'] ?? 0;
$minVersion = ($debug > 0) ? "" : ".min";
if (isset($_GET['isAjax'])) {
    return array();
}
$coreFonts = array(
    'font-ibm-sans' => array(
        'title' => 'IBM Sans',
        'type' => 'core',
        'devBaseUrl' => 'assets/fonts/ibm-plex-sans',
        'basePath' => 'fonts.ibm-plex-sans',
        'css' => array(
            'ibm-sans.css',
        ),
    ),
    'font-ibm-serif' => array(
        'title' => 'IBM Plex Serif',
        'type' => 'core',
        'devBaseUrl' => 'assets/fonts/ibm-plex-serif',
        'basePath' => 'fonts.ibm-plex-serif',
        'css' => array(
            'ibm-serif.css',
        ),
    ),
    'remix' => array(
        'title' => 'Remix Icon',
... (137 lines truncated)
</file>

<file path="application/config/index.html">
<html>
<head>
	<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
</file>

<file path="application/config/internal.php">
<?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
if (!file_exists(dirname(__FILE__) . '/config.php')) {
    $userConfig = require(dirname(__FILE__) . '/config-sample-mysql.php');
} else {
    $userConfig = require(dirname(__FILE__) . '/config.php');
}
date_default_timezone_set('UTC');
if (function_exists('mb_internal_encoding')) {
    mb_internal_encoding('UTF-8');
} else {
}
$internalConfig = array(
    'basePath' => dirname(dirname(__FILE__)),
    'name' => 'LimeSurvey',
    'localeClass' =>  'LSYii_Locale',
    'defaultController' => 'surveys',
    'aliases' => array(
        'modules' => realpath(__DIR__ . '/../../modules'),
        'vendor' => realpath(__DIR__ . '/../../vendor'),
        'node_modules' => realpath(__DIR__ . '/../../node_modules'),
        'node_modules_datatables' => realpath(__DIR__ . '/../../node_modules/datatables.net'),
        'node_modules_datatables_bs5' => realpath(__DIR__ . '/../../node_modules/datatables.net-bs5'),
        'node_modules_decimal' => realpath(__DIR__ . '/../../node_modules/decimal.js'),
        'node_modules_jquery_actual' => realpath(__DIR__ . '/../../node_modules/jquery.actual'),
        'node_modules.chartjs' => realpath(__DIR__ . '/../../node_modules/chart.js/dist'),
        'node_modules.moment.min' => realpath(__DIR__ . '/../../node_modules/moment/min'),
        'core' => realpath(__DIR__ . '/../../assets/packages'),
... (367 lines truncated)
</file>

<file path="application/config/ldap.php">
<?php
$ldap_server = array();
$ldap_queries = array();
return array('ldap_server' => $ldap_server, 'ldap_queries' => $ldap_queries);
</file>

<file path="application/config/packages.php">
<?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
$debug = $userConfig['config']['debug'] ?? 0;
$minVersion = ($debug > 0) ? "" : ".min";
if (isset($_GET['isAjax'])) {
    return [];
}
return [
    'expressions'       => [
        'devBaseUrl' => 'assets/packages/expressions/',
        'basePath'   => 'core.expressions',
        'js'         => [
            'em_javascript.js',
        ],
        'depends'    => [
            'jquery-migrate',
            'moment',
            'decimalcustom',
        ]
    ],
    'limesurvey-public' => [
        'devBaseUrl' => 'assets/packages/limesurvey/',
        'basePath'   => 'core.limesurvey',
        'css'        => [
            'survey.css',
        ],
        'js'         => [
            'survey.js',
... (364 lines truncated)
</file>

<file path="application/config/questiontypes.php">
<?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
$debug = $userConfig['config']['debug'] ?? 0;
$minVersion = ($debug > 0) ? "" : ".min";
if (isset($_GET['isAjax'])) {
    return array();
}
return array(
    'question-ranking' => array(
        'devBaseUrl'  => 'assets/packages/questions/ranking/',
        'basePath' => 'core.questions.ranking',
        'position' => CClientScript::POS_BEGIN,
        'css' => array(
            'css/ranking.css',
        ),
        'js' => array(
            'scripts/ranking.js',
        ),
        'depends' => array(
            'jquery','jquery-actual',
        )
    ),
    'question-numeric-slider' => array(
        'devBaseUrl'  => 'assets/packages/questions/numeric-slider/',
        'basePath' => 'core.questions.numeric-slider',
        'position' => CClientScript::POS_BEGIN,
        'css' => array(
            'css/numeric-slider.css',
... (66 lines truncated)
</file>

<file path="application/config/rest.php">
<?php
$rest = array_merge(
    include_once __DIR__ . '/rest/v1.php'
);
return array('rest' => $rest);
</file>

<file path="application/config/routes.php">
<?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
$route['<_sid:\d+>/lang-<_lang:\w+[-\w]+>/tk-<_token:\w+>/*'] = "survey/index/sid/<_sid>/lang/<_lang>/token/<_token>";
$route['<_sid:\d+>/lang-<_lang:\w+[-\w]+>/*'] = "survey/index/sid/<_sid>/lang/<_lang>";
$route['<_sid:\d+>/tk-<_token:\w+>/*'] = "survey/index/sid/<_sid>/token/<_token>";
$route['<_sid:\d+>/*'] = "survey/index/sid/<_sid>";
$route['<sid:\d+>'] = array('survey/index', 'matchValue' => true);
$route['admin/index'] = "admin";
$route['admin/<action:\w+>/sa/<sa:\w+>/*'] = 'admin/<action>/sa/<sa>';
$route['admin/<action:\w+>/<sa:\w+>/*'] = 'admin/<action>/sa/<sa>';
$route['admin/labels/<_action:\w+>'] = "admin/labels/index/<_action>";
$route['admin/labels/<_action:\w+>/<_lid:\d+>'] = "admin/labels/index/<_action>/<_lid>";
$route['admin/expressions'] = "admin/expressions/index";
$route['rest/<_api_version:\w+>/<_entity>/<_id>'] = array(
    'rest',
    'verb' => 'GET, PUT, PATCH, POST, DELETE',
    'matchValue' => false
);
$route['rest/<_api_version:\w+>/<_entity>'] = array(
    'rest',
    'verb' => 'GET, PUT, PATCH, POST, DELETE',
    'matchValue' => false
);
$route['rest/<_api_version:\w+>/<_entity>/<_id>/<_basetable>'] = array(
    'rest',
    'verb' => 'GET, PUT, PATCH, POST, DELETE',
    'matchValue' => false
);
... (9 lines truncated)
</file>

<file path="application/config/tcpdf.php">
<?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
    $tcpdf['base_directory'] = APPPATH . 'vendor' . DIRECTORY_SEPARATOR . 'tcpdf' . DIRECTORY_SEPARATOR;
    $tcpdf['base_url'] = 'dummy';
    $tcpdf['fonts_directory'] = $tcpdf['base_directory'] . 'fonts' . DIRECTORY_SEPARATOR;
    $tcpdf['enable_disk_cache'] = false;
    $tcpdf['cache_directory'] = Yii::app()->getConfig('tempdir') . DIRECTORY_SEPARATOR;
    $tcpdf['image_directory'] = AdminTheme::getInstance()->path . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR;
    $tcpdf['blank_image'] = $tcpdf['image_directory'] . '_blank.png';
    $tcpdf['page_format'] = 'A4';
    $tcpdf['page_orientation'] = 'P';
    $tcpdf['page_unit'] = 'mm';
    $tcpdf['page_break_auto'] = true;
    $tcpdf['unicode'] = true;
    $tcpdf['encoding'] = 'UTF-8';
    $tcpdf['creator'] = 'TCPDF';
    $tcpdf['author'] = 'TCPDF';
    $tcpdf['margin_top']    = 27;
    $tcpdf['margin_bottom'] = 27;
    $tcpdf['margin_left']   = 15;
    $tcpdf['margin_right']  = 15;
    $tcpdf['page_font'] = 'dejavusans';
    $tcpdf['page_font_size'] = 9;
    $tcpdf['data_font'] = 'dejavusans';
    $tcpdf['data_font_size'] = 8;
    $tcpdf['mono_font'] = 'freemono';
    $tcpdf['small_font_ratio'] = 2 / 3;
    $tcpdf['header_on'] = true;
... (16 lines truncated)
</file>

<file path="application/config/updater_version.php">
<?php
$config['updaterversion'] = 20;
$config['comfort_update_server_url'] = 'comfortupdate.limesurvey.org';
$config['comfort_update_server_ssl'] = 1;
$config['allow_non_public_release'] = 0;
return $config;
</file>

<file path="application/config/vendor.php">
<?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
$debug = isset($userConfig['config']['debug']) ? $userConfig['config']['debug'] : 0;
$minVersion = ($debug > 0) ? "" : ".min";
$minFolder = ($debug > 0) ? "/dev" : "/min";
$useAssetManager = !empty($userConfig['config']['use_asset_manager']);
if (isset($_GET['isAjax'])) {
    return array();
}
return array(
    'jquery' => array(
        'devBaseUrl' => 'node_modules/jquery/dist',
        'basePath' => 'node_modules.jquery.dist',
        'position' => CClientScript::POS_HEAD,
        'js' => array(
            'jquery' . $minVersion . '.js'
        ),
    ),
    'bootstrap' => array(
        'devBaseUrl' => 'assets/bootstrap_5/build',
        'basePath' => 'bootstrap.build',
        'css' => array(
            'css/bootstrap_5.min.css',
        ),
        'js' => array(
            'js/bootstrap_5.min.js',
        ),
    ),
... (309 lines truncated)
</file>

<file path="application/controllers/admin/Authentication.php">
<?php
class Authentication extends SurveyCommonAction
{
    public function index()
    {
        if (!session_id()) {
            App()->request->cookies->clear();
        }
        if (Yii::app()->request->getParam('loginlang', 'default') != 'default') {
            Yii::app()->session['adminlang'] = Yii::app()->request->getParam('loginlang', 'default');
            Yii::app()->setLanguage(Yii::app()->session["adminlang"]);
        }
        $this->redirectIfLoggedIn();
        $result = self::prepareLogin();
        $isAjax = isset($_GET['ajax']) && $_GET['ajax'] == 1;
        $succeeded = isset($result[0]) && $result[0] == 'success';
        $failed = isset($result[0]) && $result[0] == 'failed';
        if ($isAjax) {
            Yii::import('application.helpers.admin.ajax_helper', true);
            if ($succeeded) {
                ls\ajax\AjaxHelper::outputSuccess(gT('Successful login'));
                return;
            } elseif ($failed) {
                ls\ajax\AjaxHelper::outputError(gT('Incorrect or expired username and/or password!'));
                return;
            }
        } else {
            if ($succeeded) {
                self::doRedirect();
            } elseif ($failed) {
... (262 lines truncated)
</file>

<file path="application/controllers/admin/CheckIntegrity.php">
<?php
class CheckIntegrity extends SurveyCommonAction
{
    private $integrityChecker;
    public function __construct($controller, $id)
    {
        parent::__construct($controller, $id);
        if (!Permission::model()->hasGlobalPermission('superadmin', 'read')) {
            Yii::app()->setFlashMessage(gT("You do not have permission to access this page."), 'error');
            $this->getController()->redirect($this->getController()->createUrl("/admin/"));
        }
        $this->integrityChecker = new DataIntegrityChecker();
    }
    public function index()
    {
        App()->getClientScript()->registerScriptFile(App()->getConfig('adminscripts') . 'checkintegrity.js');
        $aData = $this->integrityChecker->checkintegrity();
        $aData['consistencyCheckRan'] = false;
        $aData = array_merge($aData, $this->getServerConfigurationData());
        $aData['topbar']['title'] = gT('Check data integrity');
        $aData['topbar']['backLink'] = App()->createUrl('dashboard/view');
        $this->renderWrappedTemplate('checkintegrity', 'check_view', $aData);
    }
    public function fixredundancy()
    {
        $oldsmultidelete = Yii::app()->request->getPost('oldsmultidelete', array());
        $aData = [];
        $aData['messages'] = array();
        if (Permission::model()->hasGlobalPermission('settings', 'update') && Yii::app()->request->getPost('ok') == 'Y') {
            $aDelete = $this->integrityChecker->checkintegrity();
... (91 lines truncated)
</file>

<file path="application/controllers/admin/ConditionsAction.php">
<?php
class ConditionsAction extends SurveyCommonAction
{
    private $stringComparisonOperators;
    private $nonStringComparisonOperators;
    private $iSurveyID;
    private $language;
    private $tokenTableExists;
    private $tokenFieldsAndNames;
    private $surveyCondition;
    public function __construct($controller = null, $id = null)
    {
        parent::__construct($controller, $id);
        $this->stringComparisonOperators = array(
            "<"      => gT("Less than"),
            "<="     => gT("Less than or equal to"),
            "=="     => gT("Equals"),
            "!="     => gT("Not equal to"),
            ">="     => gT("Greater than or equal to"),
            ">"      => gT("Greater than"),
            "RX"     => gT("Regular expression"),
            "a<b"    => gT("Less than (Strings)"),
            "a<=b"   => gT("Less than or equal to (Strings)"),
            "a>=b"   => gT("Greater than or equal to (Strings)"),
            "a>b"    => gT("Greater than (Strings)")
        );
        $this->nonStringComparisonOperators = array(
            "<"  => gT("Less than"),
            "<=" => gT("Less than or equal to"),
            "==" => gT("Equals"),
... (736 lines truncated)
</file>

<file path="application/controllers/admin/Database.php">
<?php
use LimeSurvey\Models\Services\Exception\PersistErrorException;
class Database extends SurveyCommonAction
{
    private $iQuestionGroupID;
    private $iQuestionID;
    private $iSurveyID;
    private $oFixCKeditor;
    public function index()
    {
        $sAction = Yii::app()->request->getPost('action');
        $this->iSurveyID = (isset($_POST['sid'])) ? (int) $_POST['sid'] : (int) returnGlobal('sid');
        $this->iQuestionGroupID = (int) returnGlobal('gid');
        $this->iQuestionID = (int) returnGlobal('qid');
        $this->oFixCKeditor = new LSYii_Validators();
        $this->oFixCKeditor->fixCKeditor = true;
        $this->oFixCKeditor->xssfilter = false;
        if ($sAction == "updatedefaultvalues" && Permission::model()->hasSurveyPermission($this->iSurveyID, 'surveycontent', 'update')) {
            $this->actionUpdateDefaultValues($this->iSurveyID);
        }
        if (($sAction == "updatesurveylocalesettings") && (Permission::model()->hasSurveyPermission($this->iSurveyID, 'surveylocale', 'update') || Permission::model()->hasSurveyPermission($this->iSurveyID, 'surveysettings', 'update'))) {
            $this->actionUpdateSurveyLocaleSettings($this->iSurveyID);
        }
        if (
            ($sAction == "updatesurveylocalesettings_generalsettings") &&
            (Permission::model()->hasSurveyPermission($this->iSurveyID, 'surveylocale', 'update') ||
                Permission::model()->hasSurveyPermission($this->iSurveyID, 'surveysettings', 'update'))
        ) {
            $this->actionUpdateSurveyLocaleSettingsGeneralSettings($this->iSurveyID);
        }
... (293 lines truncated)
</file>

<file path="application/controllers/admin/DatabaseUpdate.php">
<?php
class DatabaseUpdate extends SurveyCommonAction
{
    public function db($continue = null)
    {
        Yii::app()->loadHelper("update.update");
        $aData = $aViewUrls = [];
        if (isset($continue) && $continue == "yes") {
            $aViewUrls['output'] = CheckForDBUpgrades($continue);
            $aData['display']['header'] = false;
        } else {
            $aData['display']['header'] = true;
            $aViewUrls['output'] = CheckForDBUpgrades();
        }
        $aData['updatedbaction'] = true;
        $this->renderWrappedTemplate('update', $aViewUrls, $aData, 'layout_minimal.php');
    }
}
</file>

<file path="application/controllers/admin/DataEntry.php">
<?php
class DataEntry extends SurveyCommonAction
{
    public function __construct($controller, $id)
    {
        parent::__construct($controller, $id);
        Yii::app()->loadHelper('surveytranslator');
    }
    public function vvimport()
    {
        $aData = array();
        $aData['display']['menu_bars']['browse'] = gT("Data entry");
        $aData['title_bar']['title'] = gT("Data entry");
        $aData['sidemenu']['state'] = false;
        $iSurveyId = sanitize_int(Yii::app()->request->getParam('surveyid'));
        $aData['iSurveyId'] = $aData['surveyid'] = $iSurveyId;
        $aData['topbar']['rightButtons'] = Yii::app()->getController()->renderPartial(
            '/surveyAdministration/partial/topbar/surveyTopbarRight_view',
            [
                'showImportButton' => true,
                'showCloseButton' => true,
                'closeUrl' => Yii::app()->createUrl('responses/browse', ['surveyId' => $iSurveyId])
            ],
            true
        );
        if (Permission::model()->hasSurveyPermission($iSurveyId, 'responses', 'create')) {
            if (tableExists("{{responses_$iSurveyId}}")) {
                Yii::app()->loadHelper('database');
                $subAction = Yii::app()->request->getPost('subaction');
                if ($subAction != "upload") {
... (2240 lines truncated)
</file>

<file path="application/controllers/admin/dumpdb.php">
<?php
class Dumpdb extends SurveyCommonAction
{
    protected array $data = [];
    public function __construct($controller, $id)
    {
        parent::__construct($controller, $id);
        if (!Permission::model()->hasGlobalPermission('superadmin', 'read')) {
            die();
        }
        if (!in_array(Yii::app()->db->getDriverName(), array('mysql', 'mysqli'))) {
            Yii::app()->setFlashMessage(sprintf(gT('The integrated DB backup feature is only available for MariaDB/MySQL databases. Your database type is "%s".'), Yii::app()->db->getDriverName()), 'error');
            $this->getController()->redirect(Yii::app()->getController()->createUrl("/admin"));
        }
        if (Yii::app()->getConfig('demoMode')) {
            Yii::app()->setFlashMessage(gT('This function cannot be executed because demo mode is active.'), 'error');
            $this->getController()->redirect(Yii::app()->getController()->createUrl("/admin"));
        }
        $this->data = $this->getData();
    }
    public function index()
    {
        $this->data['topbar']['title'] = gT('Database backup');
        $this->data['topbar']['backLink'] = App()->createUrl('admin/index');
        $event = new PluginEvent('beforeRenderDbDumpView');
        App()->getPluginManager()->dispatchEvent($event);
        $htmlContent = $event->get('html');
        $this->renderWrappedTemplate('dumpdb', 'dumpdb_view', array_merge($this->data, ['htmlContent' => $htmlContent]));
    }
    private function outputHeaders(string $sFileName)
... (41 lines truncated)
</file>

<file path="application/controllers/admin/EmailTemplates.php">
<?php
class EmailTemplates extends SurveyCommonAction
{
    public function index($iSurveyId)
    {
        $iSurveyId = sanitize_int($iSurveyId);
        $survey = Survey::model()->findByPk($iSurveyId);
        if (!Permission::model()->hasSurveyPermission($iSurveyId, 'surveylocale', 'read')) {
            Yii::app()->setFlashMessage(gT("You do not have permission to access this page."), 'error');
            $this->getController()->redirect(array('surveyAdministration/view', 'surveyid' => $iSurveyId));
        }
        Yii::app()->loadHelper('admin.htmleditor');
        Yii::app()->loadHelper('surveytranslator');
        Yii::app()->session['FileManagerContext'] = "edit:emailsettings:{$iSurveyId}";
        initKcfinder();
        if (isset($iSurveyId) && getEmailFormat($iSurveyId) == 'html') {
            $ishtml = true;
        } else {
            $ishtml = false;
        }
        $grplangs = Survey::model()->findByPk($iSurveyId)->getAllLanguages();
        $sEditScript = PrepareEditorScript(false, $this->getController());
        $aData['attrib'] = array();
        $aData['bplangs'] = array();
        $aData['defaulttexts'] = array();
        if ($ishtml) {
            $sEscapeMode = 'html';
        } else {
            $sEscapeMode = 'unescaped';
        }
... (252 lines truncated)
</file>

<file path="application/controllers/admin/Export.php">
<?php
class Export extends SurveyCommonAction
{
    public function __construct($controller, $id)
    {
        parent::__construct($controller, $id);
        Yii::app()->loadHelper('export');
        Yii::import('application.controllers.admin.PrintableSurvey', 1);
    }
    public function survey()
    {
        $action = Yii::app()->request->getParam('action');
        $iSurveyID = sanitize_int(Yii::app()->request->getParam('surveyid'));
        if (Permission::model()->hasSurveyPermission($iSurveyID, 'surveycontent', 'export')) {
            $this->surveyexport($action, $iSurveyID);
            return;
        }
    }
    public function group()
    {
        $gid = sanitize_int(Yii::app()->request->getParam('gid'));
        $group = QuestionGroup::model()->findByPk($gid);
        if (empty($group)) {
            throw new CHttpException(404, gT("Invalid group ID"));
        }
        if (!Permission::model()->hasSurveyPermission($group->sid, 'surveycontent', 'export')) {
            throw new CHttpException(403, gT("You do not have permission to access this page."));
        }
        group_export("exportstructurecsvGroup", $group->sid, $gid);
        return;
... (1252 lines truncated)
</file>

<file path="application/controllers/admin/Expressions.php">
<?php
class Expressions extends SurveyCommonAction
{
    public function index()
    {
        $aData = array();
        $needpermission = false;
        $iSurveyID = sanitize_int(Yii::app()->request->getQuery('surveyid', false));
        if (!$iSurveyID) {
            $iSurveyID = sanitize_int(Yii::app()->request->getQuery('sid'));
        }
        $aData['sa'] = $sa = sanitize_paranoid_string(Yii::app()->request->getQuery('sa', 'index'));
        $aData['pagetitle'] = "ExpressionManager:  {$aData['sa']}";
        $aData['topbar']['title'] = $aData['pagetitle'];
        $aData['topbar']['rightButtons'] = Yii::app()->getController()->renderPartial(
            '/layouts/partial_topbar/right_close_saveclose_save',
            [
                'isCloseBtn' => true,
                'isSaveBtn' => false,
                'isSaveAndCloseBtn' => false,
            ],
            true
        );
        if (($aData['sa'] == 'survey_logic_file' || $aData['sa'] == 'navigation_test') && $iSurveyID) {
            $needpermission = true;
        }
        $aInstallationWideActions = array(
            'conditions2relevance',
            'upgrade_conditions2relevance',
            'revert_upgrade_conditions2relevance',
... (226 lines truncated)
</file>

<file path="application/controllers/admin/ExpressionValidate.php">
<?php
class ExpressionValidate extends SurveyCommonAction
{
    private $iSurveyId;
    private $sLang;
    public function index()
    {
        throw new CHttpException(400);
    }
    public function quota($iSurveyId, $quota, $lang = null)
    {
        $oSurvey = Survey::model()->findByPk($iSurveyId);
        if (!Permission::model()->hasSurveyPermission($iSurveyId, 'quotas', 'read')) {
            throw new CHttpException(401, "401 Unauthorized");
        }
        $iQuotaId = $quota;
        if (is_string($lang)) {
            $aLangs = array(\LSYii_Validators::languageCodeFilter($lang));
        } else {
            $aLangs = $oSurvey->allLanguages;
        }
        $aExpressions = array();
        $this->iSurveyId = $iSurveyId;
        foreach ($aLangs as $sLang) {
            $oQuotaLanguageSetting = QuotaLanguageSetting::model()->find("quotals_quota_id =:quota_id and quotals_language=:language", array(':quota_id' => $iQuotaId, ':language' => $sLang));
            if ($oQuotaLanguageSetting) {
                $this->sLang = $sLang;
                $aExpressions['name_' . $sLang] = array(
                    'title' => sprintf(gT("Quota name (%s)"), $sLang),
                    'expression' => $this->getHtmlExpression($oQuotaLanguageSetting->quotals_name, array(), __METHOD__),
... (177 lines truncated)
</file>

<file path="application/controllers/admin/globalsettings.php">
<?php
use LimeSurvey\DI;
use LimeSurvey\Models\Services\SurveyThemeConfiguration;
use LimeSurvey\Libraries\FormExtension\Inputs\TextInput;
class GlobalSettings extends SurveyCommonAction
{
    public function __construct($controller, $id)
    {
        parent::__construct($controller, $id);
        if (!Permission::model()->hasGlobalPermission('settings', 'read')) {
            throw new CHttpException(403, gT("You do not have permission to access this page."));
        }
    }
    public function index()
    {
        if (!empty(Yii::app()->getRequest()->getPost('action'))) {
            $this->saveSettings();
        }
        $this->displaySettings();
    }
    public function showphpinfo()
    {
        if (Yii::app()->getConfig('demoMode') || !Permission::model()->hasGlobalPermission('superadmin', 'read')) {
            throw new CHttpException(403, gT("You do not have permission to access this page."));
        }
        phpinfo();
    }
    public function clearAssetsAndCache()
    {
        if (Permission::model()->hasGlobalPermission('templates', 'create')) {
... (528 lines truncated)
</file>

<file path="application/controllers/admin/HtmlEditorPop.php">
<?php
class HtmlEditorPop extends SurveyCommonAction
{
    public function index()
    {
        Yii::app()->loadHelper('admin.htmleditor');
        $aData = array(
            'ckLanguage' => sTranslateLangCode2CK(Yii::app()->session['adminlang']),
            'sFieldName' => sanitize_xss_string(App()->request->getQuery('name')),
            'sFieldText' => sanitize_xss_string(App()->request->getQuery('text')),
            'sFieldType' => sanitize_xss_string(App()->request->getQuery('type')),
            'sAction' => sanitize_paranoid_string(App()->request->getQuery('action')),
            'iSurveyId' => sanitize_int(App()->request->getQuery('sid', 0)),
            'iGroupId' => sanitize_int(App()->request->getQuery('gid', 0)),
            'iQuestionId' => sanitize_int(App()->request->getQuery('qid', 0)),
        );
        if (!$aData['sFieldName']) {
            $this->getController()->render('/admin/htmleditor/pop_nofields_view', $aData);
        } else {
            $aData['sControlIdEna'] = $aData['sFieldName'] . '_popupctrlena';
            $aData['sControlIdDis'] = $aData['sFieldName'] . '_popupctrldis';
            $aData['toolbarname'] = 'popup';
            $aData['htmlformatoption'] = '';
            $contentsLangDirection = App()->request->getQuery('contdir');
            if (!in_array(strtolower((string) $contentsLangDirection), ['ltr', 'rtl'])) {
                $contentsLangDirection = getLanguageRTL(Yii::app()->session['adminlang']) ? 'rtl' : 'ltr';
            }
            $aData['contentsLangDirection'] = $contentsLangDirection;
            if (isEmailEditorFieldtype($aData['sFieldType'])) {
                $aData['htmlformatoption'] = ',fullPage:true';
... (6 lines truncated)
</file>

<file path="application/controllers/admin/index.html">
<html>
<head>
	<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
</file>

<file path="application/controllers/admin/Labels.php">
<?php
class Labels extends SurveyCommonAction
{
    public function run($sa = null)
    {
        if ($sa == 'newlabelset' || $sa == 'editlabelset') {
            $this->route('index', array('sa', 'lid'));
        }
    }
    public function importlabelresources()
    {
        $lid = $this->validateLabelSetId(App()->request->getParam('lid'), 'update');
        if (Yii::app()->getConfig('demoMode')) {
            $this->getController()->error(gT("Demo mode only: Uploading files is disabled in this system."), $this->getController()->createUrl("admin/labels/sa/view/lid/{$lid}"));
        }
        Yii::import('application.helpers.common_helper', true);
        $extractdir = createRandomTempDir();
        $zipfilename = $_FILES['the_file']['tmp_name'];
        $basedestdir = Yii::app()->getConfig('uploaddir') . "/labels";
        $destdir = $basedestdir . "/$lid/";
        if (!is_writeable($basedestdir)) {
            Yii::app()->setFlashMessage(sprintf(gT("Incorrect permissions in your %s folder."), $basedestdir), 'error');
            $this->getController()->redirect(App()->createUrl("admin/labels/sa/view/lid/{$lid}"));
        }
        if (!is_dir($destdir)) {
            mkdir($destdir);
        }
        $aImportedFilesInfo = array();
        $aErrorFilesInfo = array();
        if (is_file($zipfilename)) {
... (494 lines truncated)
</file>

<file path="application/controllers/admin/NotificationController.php">
<?php
class NotificationController extends SurveyCommonAction
{
    public function getNotificationAsJSON($notId)
    {
        $oNotification = $this->checkPermission($notId);
        header('Content-type: application/json');
        echo json_encode(array('result' => $oNotification->getAttributes()));
    }
    public function notificationRead($notId)
    {
        $oNotification = $this->checkPermission($notId);
        if ($oNotification->entity == 'user' && $oNotification->entity_id <> Yii::app()->user->id) {
            throw new CHttpException(404, sprintf(gT("Invalid notification id"), $notId));
        }
        $result = $oNotification->markAsRead();
        header('Content-type: application/json');
        echo json_encode(array('result' => $result));
    }
    public function actionGetMenuWidget($surveyId = null, $showLoader = false)
    {
        if (App()->user->isGuest) {
            throw new CHttpException(401);
        }
        echo self::getMenuWidget($surveyId, $showLoader);
    }
    public function clearAllNotifications($surveyId = null)
    {
        if (App()->request->isPostRequest) {
            if (App()->user->isGuest) {
... (66 lines truncated)
</file>

<file path="application/controllers/admin/ParticipantsAction.php">
<?php
use ls\ajax\AjaxHelper;
use LimeSurvey\Exceptions\CPDBException;
function subval_sort($a, $subkey, $order)
{
    $b = array();
    $c = array();
    foreach ($a as $k => $v) {
        $b[$k] = strtolower((string) $v[$subkey]);
    }
    if ($order == "asc") {
        asort($b, SORT_REGULAR);
    } else {
        arsort($b, SORT_REGULAR);
    }
    foreach ($b as $key => $val) {
        $c[] = $a[$key];
    }
    return $c;
}
class ParticipantsAction extends SurveyCommonAction
{
    protected $ajaxHelper;
    public function runWithParams($params)
    {
        if (
            !(Permission::model()->hasGlobalPermission('participantpanel', 'read')
            || Permission::model()->hasGlobalPermission('participantpanel', 'create')
            || Permission::model()->hasGlobalPermission('participantpanel', 'update')
            || Permission::model()->hasGlobalPermission('participantpanel', 'delete')
... (2243 lines truncated)
</file>

<file path="application/controllers/admin/PluginHelper.php">
<?php
class PluginHelper extends SurveyCommonAction
{
    public $defaultAction = 'sidebody';
    public function sidebody($surveyid = 0, $plugin = '', $method = '')
    {
        $aData = array();
        $aData['title_bar']['title'] = "";
        $aData['surveybar']['buttons']['view'] = false;
        $aData['activated'] = null;
        if ($surveyid) {
            $surveyid = sanitize_int($surveyid);
            $oSurvey = Survey::model()->findByPk($surveyid);
            if ($oSurvey) {
                $aData['surveybar']['buttons']['view'] = true;
                $aData['title_bar']['title'] = viewHelper::flatEllipsizeText($oSurvey->defaultlanguage->surveyls_title) . " (" . gT("ID") . ":" . $surveyid . ")";
                $aData['activated'] = $oSurvey->active;
            }
        }
        $aData['surveyid'] = $surveyid;
        $content = $this->getContent($surveyid, $plugin, $method);
        $aData['sidemenu'] = array();
        $aData['sidemenu']['state'] = false;
        $aData['sideMenuBehaviour'] = Yii::app()->getConfig('sideMenuBehaviour');
        $aData['content'] = $content;
        $this->renderWrappedTemplate(null, array('super/sidebody'), $aData);
    }
    public function fullpagewrapper($plugin, $method)
    {
        $aData = array();
... (41 lines truncated)
</file>

<file path="application/controllers/admin/PluginManagerController.php">
<?php
use LimeSurvey\ExtensionInstaller\FileFetcherUploadZip;
use LimeSurvey\ExtensionInstaller\PluginInstaller;
use LimeSurvey\Menu\Menu;
use LimeSurvey\Menu\MenuItem;
class PluginManagerController extends SurveyCommonAction
{
    public function init()
    {
    }
    public function index()
    {
        $jsFile = App()->getConfig('adminscripts') . 'plugin_manager.js';
        App()->getClientScript()->registerScriptFile($jsFile);
        $aoPlugins = Plugin::model()->findAll(array('order' => 'name'));
        $data      = [];
        foreach ($aoPlugins as $oPlugin) {
            $data[] = [
                'id'          => $oPlugin->id,
                'name'        => $oPlugin->name,
                'load_error'  => $oPlugin->getLoadError(),
                'description' => '',
                'active'      => $oPlugin->active,
                'settings'    => []
            ];
        }
        if (Yii::app()->request->getParam('pageSize')) {
            Yii::app()->user->setState('pageSize', intval(Yii::app()->request->getParam('pageSize')));
        }
        $aData['data'] = $data;
... (553 lines truncated)
</file>

<file path="application/controllers/admin/PrintableSurvey.php">
<?php
class PrintableSurvey extends SurveyCommonAction
{
    public function index($surveyid, $lang = null, $bReturn = false)
    {
        $surveyid = sanitize_int($surveyid);
        $oSurvey = Survey::model()->findByPk($surveyid);
        if (!Permission::model()->hasSurveyPermission($surveyid, 'surveycontent', 'read')) {
            $aData['surveyid'] = $surveyid;
            $message['title'] = gT('Access denied!');
            $message['message'] = gT('You do not have permission to access this page.');
            $message['class'] = "error";
            $this->renderWrappedTemplate('survey', array("message" => $message), $aData);
        } else {
            Yii::app()->clientScript->reset();
            $aSurveyInfo = getSurveyInfo($surveyid, $lang);
            if ($oSurvey == null) {
                $this->getController()->error('Invalid survey ID');
            }
            SetSurveyLanguage($surveyid, $lang);
            $sLanguageCode = App()->language;
            $templatename = $aSurveyInfo['template'];
            $welcome = $aSurveyInfo['surveyls_welcometext'];
            $end = $aSurveyInfo['surveyls_endtext'];
            $surveyname = $aSurveyInfo['surveyls_title'];
            $surveydesc = $aSurveyInfo['surveyls_description'];
            $surveytable = $oSurvey->responsesTableName;
            $surveyexpirydate = $aSurveyInfo['expires'];
            $dateformattype = $aSurveyInfo['surveyls_dateformat'];
            Yii::app()->loadHelper('surveytranslator');
... (1176 lines truncated)
</file>

<file path="application/controllers/admin/QuestionThemes.php">
<?php
class QuestionThemes extends SurveyCommonAction
{
    public function toggleVisibility($id)
    {
        $this->requirePostRequest();
        if (!Permission::model()->hasGlobalPermission('templates', 'update')) {
            throw new CHttpException(403, gT("We are sorry but you don't have permissions to do this."));
        }
        $aQuestionThemes = QuestionTheme::model()->findAllByAttributes([], 'id = :id', ['id' => $id]);
        foreach ($aQuestionThemes as $oQuestionTheme) {
            if ($oQuestionTheme->visible == 'Y') {
                $oQuestionTheme->setAttribute('visible', 'N');
            } else {
                $oQuestionTheme->setAttribute('visible', 'Y');
            }
            $oQuestionTheme->save();
        }
    }
}
</file>

<file path="application/controllers/admin/RemoteControl.php">
<?php
class RemoteControl extends SurveyCommonAction
{
    protected $xmlrpc;
    public function run()
    {
        Yii::import('application.helpers.remotecontrol.*');
        $setAccessControlHeader = Yii::app()->getConfig('add_access_control_header', 1);
        if ($setAccessControlHeader == 1) {
            header("Access-Control-Allow-Origin: *");
        }
        $oHandler = new remotecontrol_handle($this->controller);
        $RPCType = Yii::app()->getConfig("RPCInterface");
        if (Yii::app()->getRequest()->isPostRequest) {
            if ($RPCType == 'xml') {
                $cur_path = get_include_path();
                set_include_path($cur_path . PATH_SEPARATOR . APPPATH . 'helpers');
                $this->xmlrpc = new Zend_XmlRpc_Server();
                $this->xmlrpc->sendArgumentsToAllMethods(false);
                Yii::import('application.libraries.LSZend_XmlRpc_Response_Http');
                $this->xmlrpc->setResponseClass('LSZend_XmlRpc_Response_Http');
                $this->xmlrpc->setClass($oHandler);
                $result = $this->xmlrpc->handle();
                if ($result instanceof LSZend_XmlRpc_Response_Http) {
                    $result->printXml();
                } else {
                    echo $result;
                }
            } elseif ($RPCType == 'json') {
                Yii::app()->loadLibrary('LSjsonRPCServer');
... (98 lines truncated)
</file>

<file path="application/controllers/admin/Saved.php">
<?php
class Saved extends SurveyCommonAction
{
    public function view($iSurveyId)
    {
        $iSurveyId = sanitize_int($iSurveyId);
        $aViewUrls = array();
        if (!Permission::model()->hasSurveyPermission($iSurveyId, 'responses', 'read')) {
            throw new CHttpException(403, gT("You do not have permission to access this page."));
        }
        $aThisSurvey = getSurveyInfo($iSurveyId);
        $oSavedControlModel = SavedControl::model();
        $oSavedControlModel->sid = $iSurveyId;
        $aFilters = App()->request->getParam('SavedControl');
        if (!empty($aFilters)) {
            $oSavedControlModel->setAttributes($aFilters, false);
        }
        $aData['model'] = $oSavedControlModel;
        $aData['sSurveyName'] = $aThisSurvey['name'];
        $aData['iSurveyId'] = $iSurveyId;
        if (App()->request->getPost('pageSize')) {
            App()->user->setState('savedResponsesPageSize', App()->request->getPost('pageSize'));
        }
        $aData['savedResponsesPageSize'] = App()->user->getState('savedResponsesPageSize', App()->params['defaultPageSize']);
        $aViewUrls[] = 'savedlist_view';
        $this->renderWrappedTemplate('saved', $aViewUrls, $aData);
    }
    public function resendAccesscode($surveyid, $id)
    {
    }
... (50 lines truncated)
</file>

<file path="application/controllers/admin/Statistics.php">
<?php
class Statistics extends SurveyCommonAction
{
    public function __construct($controller, $id)
    {
        parent::__construct($controller, $id);
        Yii::app()->loadHelper("surveytranslator");
    }
    public function run($surveyid = 0, $subaction = null)
    {
        $surveyid = sanitize_int($surveyid);
        $imageurl = Yii::app()->getConfig("imageurl");
        $aData = array('imageurl' => $imageurl);
        $showcombinedresults = 0;
        $maxchars = 50;
        $statisticsoutput = '';
        //output for choosing questions to cross query
        $cr_statisticsoutput = '';
        // This gets all the 'to be shown questions' from the POST and puts these into an array
        $summary = returnGlobal('summary');
        $statlang = returnGlobal('statlang');
        if (isset($summary) && !is_array($summary)) {
            $summary = explode("+", (string) $summary);
        }
        if (!isset($surveyid)) {
            $surveyid = returnGlobal('sid');
        }
        $aData['surveyid'] = $surveyid;
        if (!Permission::model()->hasSurveyPermission($surveyid, 'statistics', 'read')) {
            throw new CHttpException(403, gT("You do not have permission to access this page."));
... (547 lines truncated)
</file>

<file path="application/controllers/admin/SurveymenuController.php">
<?php
class SurveymenuController extends SurveyCommonAction
{
    public function __construct($controller, $id)
    {
        parent::__construct($controller, $id);
        if (!Permission::model()->hasGlobalPermission('settings', 'read')) {
            throw new CHttpException(403, gT("You do not have permission to access this page."));
        }
    }
    public function filters()
    {
        return array(
            'accessControl',
            'postOnly + delete',
        );
    }
    public function accessRules()
    {
        return array(
            array('allow',
                'actions' => array('index', 'view'),
                'users' => array('*'),
            ),
            array('allow',
                'actions' => array('create', 'update'),
                'users' => array('@'),
            ),
            array('allow',
                'actions' => array('admin', 'delete'),
... (294 lines truncated)
</file>

<file path="application/controllers/admin/SurveymenuEntryController.php">
<?php
class SurveymenuEntryController extends SurveyCommonAction
{
    public function __construct($controller, $id)
    {
        parent::__construct($controller, $id);
        if (!Permission::model()->hasGlobalPermission('settings', 'read')) {
            Yii::app()->setFlashMessage(gT("You do not have permission to access this page."), 'error');
            $this->getController()->redirect($this->getController()->createUrl("/admin/"));
        }
    }
    public function filters()
    {
        return array(
            'accessControl',
            'postOnly + delete',
        );
    }
    public function index()
    {
        $this->getController()->redirect(array('admin/menuentries/sa/view'));
    }
    public function view()
    {
        $data = array();
        $filterAndSearch = Yii::app()->request->getPost('SurveymenuEntries', []);
        $data['model'] = SurveymenuEntries::model();
        $data['model']->setAttributes($filterAndSearch);
        $data['user'] = Yii::app()->session['loginID'];
        if (Yii::app()->request->getParam('pageSize')) {
... (305 lines truncated)
</file>

<file path="application/controllers/admin/SurveysGroupsController.php">
<?php
use LimeSurvey\DI;
use LimeSurvey\Models\Services\SurveyThemeConfiguration;
use LimeSurvey\Models\Services\SurveysGroupCreator;
class SurveysGroupsController extends SurveyCommonAction
{
    public function view($id)
    {
        $this->render('view', array(
            'model' => $this->loadModel($id),
        ));
    }
    public function create()
    {
        if (!Permission::model()->hasGlobalPermission('surveysgroups', 'create')) {
            throw new CHttpException(403, gT("You do not have permission to access this page."));
        }
        $model = new SurveysGroups();
        $model->owner_id = Yii::app()->user->id;
        $user = Yii::app()->user;
        $request = Yii::app()->request;
        if ($request->getPost('SurveysGroups')) {
            $service = new SurveysGroupCreator(
                $request,
                $user,
                $model,
                new SurveysGroupsettings()
            );
            if ($service->save()) {
                $this->getController()->redirect(
... (301 lines truncated)
</file>

<file path="application/controllers/admin/Themes.php">
<?php
use LimeSurvey\ExtensionInstaller\FileFetcherUploadZip;
use LimeSurvey\ExtensionInstaller\QuestionThemeInstaller;
class Themes extends SurveyCommonAction
{
    public function runWithParams($params)
    {
        $sTemplateName = trim(Yii::app()->request->getPost('templatename', ''));
        if (Permission::model()->hasGlobalPermission('templates', 'read') || Permission::model()->hasTemplatePermission($sTemplateName)) {
            parent::runWithParams($params);
        } else {
            Yii::app()->setFlashMessage(gT("We are sorry but you don't have permissions to do this."), 'error');
            $this->getController()->redirect(array("themeOptions/index"));
        }
    }
    public function templatezip($templatename)
    {
        $oEditedTemplate = Template::getInstance($templatename, null, null, true);
        if (Permission::model()->hasGlobalPermission('templates', 'export')) {
            $templatedir = $oEditedTemplate->path;
            $tempdir = Yii::app()->getConfig('tempdir');
            $zipfile = "$tempdir/$templatename.zip";
            $zip = new LimeSurvey\Zip();
            $zip->open($zipfile, ZipArchive::CREATE);
            $zipHelper = new LimeSurvey\Helpers\ZipHelper($zip);
            $zipHelper->addFolder($templatedir);
            $zip->close();
            if (is_file($zipfile)) {
                header("Expires: 0");
                header("Cache-Control: must-revalidate");
... (970 lines truncated)
</file>

<file path="application/controllers/admin/Tokens.php">
<?php
use LimeSurvey\Models\Services\SurveyAccessModeService;
class Tokens extends SurveyCommonAction
{
    public function index(int $surveyid, $limit = 50, $start = 0)
    {
        App()->getClientScript()->registerScriptFile(Yii::app()->getConfig('adminscripts') . 'tokens.js', LSYii_ClientScript::POS_BEGIN);
        $iSurveyId = $surveyid;
        $iSurveyId = (int) $iSurveyId;
        $survey = Survey::model()->findByPk($iSurveyId);
        $thissurvey = getSurveyInfo($iSurveyId);
        if (
            !Permission::model()->hasSurveyPermission($iSurveyId, 'tokens', 'read') && !Permission::model()->hasSurveyPermission($iSurveyId, 'tokens', 'create') && !Permission::model()->hasSurveyPermission($iSurveyId, 'tokens', 'update')
            && !Permission::model()->hasSurveyPermission($iSurveyId, 'tokens', 'export') && !Permission::model()->hasSurveyPermission($iSurveyId, 'tokens', 'import')
            && !Permission::model()->hasSurveyPermission($iSurveyId, 'surveysettings', 'update')
        ) {
            Yii::app()->session['flashmessage'] = gT("You do not have permission to access this page.");
            $this->getController()->redirect(array("/surveyAdministration/view/surveyid/{$iSurveyId}"));
        }
        Yii::app()->loadHelper("surveytranslator");
        $aData = array();
        $aData['surveyprivate'] = $thissurvey['anonymized'];
        $aData['title_bar']['title'] = $survey->currentLanguageSettings->surveyls_title . " (" . gT("ID") . ":" . $iSurveyId . ")";
        $aData['sidemenu']["token_menu"] = true;
        $topbarData = TopbarConfiguration::getTokensTopbarData($iSurveyId);
        $aData['topbar']['showDelButton'] = true;
        $topbarData = array_merge($topbarData, $aData['topbar']);
        $aData['topbar']['middleButtons'] = Yii::app()->getController()->renderPartial(
            '/surveyAdministration/partial/topbar_tokens/leftSideButtons',
            $topbarData,
... (2782 lines truncated)
</file>

<file path="application/controllers/admin/TutorialEntryController.php">
<?php
class TutorialEntryController extends SurveyCommonAction
{
    public function filters()
    {
        return array(
            'accessControl',
            'postOnly + delete',
        );
    }
    public function accessRules()
    {
        return array(
            array('allow',
                'actions' => array('index', 'view'),
                'users' => array('*'),
            ),
            array('allow',
                'actions' => array('create', 'update'),
                'users' => array('@'),
            ),
            array('allow',
                'actions' => array('admin', 'delete'),
                'users' => array('admin'),
            ),
            array('deny',
                'users' => array('*'),
            ),
        );
    }
... (77 lines truncated)
</file>

<file path="application/controllers/admin/TutorialsController.php">
<?php
class TutorialsController extends SurveyCommonAction
{
    public function filters()
    {
        return array(
            'accessControl',
            'postOnly + delete',
            'postOnly + triggerfinished',
        );
    }
    public function accessRules()
    {
        return array(
            array(
                'allow',
                'actions' => array('index', 'view'),
                'users' => array('*'),
            ),
            array(
                'allow',
                'actions' => array('create', 'update'),
                'users' => array('@'),
            ),
            array(
                'allow',
                'actions' => array('admin', 'delete'),
                'users' => array('admin'),
            ),
            array(
... (113 lines truncated)
</file>

<file path="application/controllers/admin/Update.php">
<?php
if (class_exists('SurveyCommonAction')) {
    class DynamicSurveyCommonAction extends SurveyCommonAction
    {
    }
} else {
    class DynamicSurveyCommonAction extends Survey_Common_Action
    {
    }
}
class Update extends DynamicSurveyCommonAction
{
    protected function renderWrappedTemplate($sAction = '', $aViewUrls = array(), $aData = array(), $sRenderFile = false)
    {
        if (method_exists(get_parent_class($this), 'renderWrappedTemplate')) {
            parent::renderWrappedTemplate($sAction, $aViewUrls, $aData, $sRenderFile);
        } else {
            parent::_renderWrappedTemplate($sAction, $aViewUrls, $aData, $sRenderFile);
        }
    }
    public function index()
    {
        if (!Permission::model()->hasGlobalPermission('superadmin')) {
            App()->setFlashMessage(gT('You are not allowed to enter this page'), 'error');
            $this->getController()->redirect(App()->getController()->createUrl("/admin"));
        }
        if (Yii::app()->getConfig('demoMode')) {
            App()->setFlashMessage(gT('This function cannot be executed because demo mode is active.'), 'error');
            $this->getController()->redirect(App()->getController()->createUrl("/admin"));
        }
... (408 lines truncated)
</file>

<file path="application/controllers/admin/UserAction.php">
<?php
use LimeSurvey\PluginManager\AuthPluginBase;
class UserAction extends SurveyCommonAction
{
    public function __construct($controller, $id)
    {
        parent::__construct($controller, $id);
        Yii::app()->loadHelper('database');
    }
    public function index()
    {
        $this->getController()->redirect(array("admin/user/sa/personalsettings"));
    }
    public function personalsettings()
    {
        if (Yii::app()->request->getPost("action")) {
            $oUserModel = User::model()->findByPk(Yii::app()->session['loginID']);
            $uresult = true;
            if (Yii::app()->request->getPost('newpasswordshown') == "1") {
                if (Yii::app()->getConfig('demoMode')) {
                    Yii::app()->setFlashMessage(gT("You can't change password if demo mode is active."), 'error');
                    $this->getController()->redirect(array("admin/user/sa/personalsettings"));
                }
                $oldPassword = Yii::app()->request->getPost('oldpassword');
                $currentPasswordOk = $oUserModel->checkPassword($oldPassword);
                if (!$currentPasswordOk) {
                    Yii::app()->setFlashMessage(gT('The current password is not correct.'), 'error');
                    $this->getController()->redirect(array("admin/user/sa/personalsettings"));
                }
                $newPassword = Yii::app()->request->getPost('password');
... (135 lines truncated)
</file>

<file path="application/controllers/survey/SurveyIndex.php">
<?php
class SurveyIndex extends CAction
{
    public $oTemplate;
    public function run()
    {
        $this->action();
    }
    public function action()
    {
        global $surveyid;
        global $thissurvey, $thisstep;
        global $clienttoken, $tokensexist, $token;
        $this->loadRequiredHelpersAndLibraries();
        $param = $this->getParameters(func_get_args(), $_POST);
        $surveyid = (int)$param['sid'];
        $thisstep = (int)$param['thisstep'];
        $move = getMove();
        if (isset($param['newtest']) && $param['newtest'] == "Y") {
            killSurveySession($surveyid);
            resetQuestionTimers($surveyid);
        }
        $clienttoken = trim((string)$param['token']);
        if (mb_strlen($clienttoken) > Token::MAX_LENGTH) {
            $clienttoken = '';
        }
        /* If not set : get by SESSION to avoid multiple submit of same token in different navigator */
        if (empty($clienttoken) && !empty($_SESSION['responses_' . $surveyid]['token'])) {
            $clienttoken = $_SESSION['responses_' . $surveyid]['token'];
        }
... (546 lines truncated)
</file>

<file path="application/controllers/AdminController.php">
<?php
class AdminController extends LSYii_Controller
{
    public $sTemplate = null;
    public $layout = false;
    public $aAdminModulesClasses = array();
    protected $user_id = 0;
    protected $aOverridenCoreActions = array();
    protected $currentModuleAction = '';        // Name of the current action overridden by a custom module
    /**
     * Initialises this controller, does some basic checks and setups
     *
     * REFACTORED ( in LSBaseController )
     *
     * @access protected
     * @return void
     */
    protected function customInit()
    {
        parent::customInit();
        $this->sessioncontrol();
        $this->user_id = Yii::app()->user->getId();
        // Check if the user really exists
        // This scenario happens if the user was deleted while still being logged in
        if (!empty($this->user_id) && User::model()->findByPk($this->user_id) == null) {
            $this->user_id = null;
            Yii::app()->session->destroy();
        }
        if (!Yii::app()->getConfig("surveyid")) {
            Yii::app()->setConfig("surveyid", returnGlobal('sid'));
... (334 lines truncated)
</file>

<file path="application/controllers/AjaxAlertController.php">
<?php
class AjaxAlertController extends LSBaseController
{
    public function actionGetAlertWidget()
    {
        $widgetOptions = $this->translateOptionsForWidget();
        return json_encode(App()->getController()->widget('ext.AlertWidget.AlertWidget', $widgetOptions));
    }
    private function translateOptionsForWidget()
    {
        $request = Yii::app()->request;
        $customOptions = $request->getPost('customOptions', []);
        $translatedOptions = [];
        if (empty($customOptions['useHtml'])) {
            $translatedOptions['text'] = CHtml::encode($request->getPost('message', 'message'));
        } else {
            $translatedOptions['text'] = viewHelper::purified($request->getPost('message', 'message'));
        }
        $translatedOptions['type'] = sanitize_alphanumeric($request->getPost('alertType', 'success'));
        $knownOptions = ['tag', 'isFilled', 'showIcon', 'showCloseButton', 'timeout'];
        foreach ($knownOptions as $knownOption) {
            if (array_key_exists($knownOption, $customOptions)) {
                if ($knownOption == 'tag') {
                    $translatedOptions[$knownOption] = sanitize_alphanumeric($customOptions[$knownOption]);
                } elseif ($knownOption == 'timeout') {
                    $translatedOptions[$knownOption] = intval($customOptions[$knownOption]);
                } else {
                    $translatedOptions[$knownOption] = $customOptions[$knownOption] !== 'false';
                }
            }
... (8 lines truncated)
</file>

<file path="application/controllers/AssessmentController.php">
<?php
class AssessmentController extends LSBaseController
{
    public function accessRules()
    {
        return [
            [
                'allow',
                'actions' => [],
                'users'   => ['*'],
            ],
            [
                'allow',
                'actions' => ['activate', 'delete', 'edit', 'index', 'insertUpdate'],
                'users'   => ['@'],
            ],
            ['deny'],
        ];
    }
    protected function beforeRender($view)
    {
        if (isset($this->aData['surveyid'])) {
            $this->aData['oSurvey'] = $this->aData['oSurvey'] ?? Survey::model()->findByPk($this->aData['surveyid']);
            $this->layout = 'layout_questioneditor';
            LimeExpressionManager::SetSurveyId($this->aData['surveyid']);
        }
        return parent::beforeRender($view);
    }
    public function actionIndex($surveyid)
    {
... (283 lines truncated)
</file>

<file path="application/controllers/DashboardController.php">
<?php
class DashboardController extends LSBaseController
{
    public function __construct($controller, $id)
    {
        parent::__construct($controller, $id);
        App()->loadHelper('surveytranslator');
    }
    public function filters()
    {
        return [];
    }
    public function beforeRender($view)
    {
        $this->layout = 'with_sidebar';
        return parent::beforeRender($view);
    }
    public function actionView(): void
    {
        $aData = $this->getData();
        $this->render('welcome', $aData);
    }
    private function getData(): array
    {
        $aData = [];
        $aData['issuperadmin'] = false;
        if (Permission::model()->hasGlobalPermission('superadmin', 'read')) {
            $aData['issuperadmin'] = true;
        }
        $aData['oldDashboard'] = App()->getConfig('display_old_dashboard') === '1';
... (51 lines truncated)
</file>

<file path="application/controllers/EditorLinkController.php">
<?php
use LimeSurvey\DI;
use LimeSurvey\Api\Authentication\AuthenticationTokenSimple;
class EditorLinkController extends LSYii_Controller
{
    const REACT_APP_BASE_PATH = '/editor/#/';
    public function run($action)
    {
        if (App()->user->isGuest) {
            throw new CHttpException(403, 'Access denied');
        }
        $this->setAuthenticationInitCookie();
        $editorUrl = rtrim(
            App()->request->baseUrl
            . static::REACT_APP_BASE_PATH,
            '/'
        );
        $editorRoute = App()->request->getQuery('route');
        $url = $editorUrl . '/' . $editorRoute;
        $this->redirect($url);
    }
    private function setAuthenticationInitCookie()
    {
        $diContainer = DI::getContainer();
        $cookieName = 'LS_AUTH_INIT';
        $authTokenSimple = $diContainer->get(
            AuthenticationTokenSimple::class
        );
        $session = $authTokenSimple->createSession(
            App()->session['user']
... (14 lines truncated)
</file>

<file path="application/controllers/FailedEmailController.php">
<?php
class FailedEmailController extends LSBaseController
{
    public function beforeRender($view)
    {
        $surveyId = (int)App()->request->getParam('surveyid');
        $this->aData['surveyid'] = $surveyId;
        LimeExpressionManager::SetSurveyId($this->aData['surveyid']);
        $this->layout = 'layout_questioneditor';
        $this->aData['title_bar']['title'] = gT('Failed email notifications');
        $this->aData['subaction'] = gT("Failed email notifications");
        return parent::beforeRender($view);
    }
    public function actionIndex(): void
    {
        $surveyId = sanitize_int(App()->request->getParam('surveyid'));
        $permissions = [
            'update' => Permission::model()->hasSurveyPermission($surveyId, 'responses', 'update'),
            'delete' => Permission::model()->hasSurveyPermission($surveyId, 'responses', 'delete'),
            'read'   => Permission::model()->hasSurveyPermission($surveyId, 'responses', 'read')
        ];
        if (!$surveyId) {
            throw new CHttpException(403, gT("Invalid survey ID"));
        }
        if (!$permissions['read']) {
            App()->user->setFlash('error', gT("You do not have permission to access this page."));
            $this->redirect(['surveyAdministration/view', 'surveyid' => $surveyId]);
        }
        $pageSize = App()->request->getParam('pageSize', null);
        if ($pageSize != null) {
... (162 lines truncated)
</file>

<file path="application/controllers/HomepageSettingsController.php">
<?php
class HomepageSettingsController extends LSBaseController
{
    public function accessRules()
    {
        return array(
            array(
                'allow',
                'actions' => array(),
                'users' => array('*'),
            ),
            array(
                'allow',
                'actions' => array('index',  'changeBoxesInContainer', 'createBox',
                    'deleteBox','resetAllBoxes' ,'toggleShowLastSurveyAndQuestion' ,
                    'updateBox', 'toggleShowLogoStatus', ''),
                'users' => array('@'),
            ),
            array('deny'),
        );
    }
    public function filters()
    {
        return [
            'postOnly + resetAllBoxes, updateBoxesSettings',
        ];
    }
    public function beforeRender($view)
    {
        App()->getClientScript()->registerScriptFile(App()->getConfig('adminscripts') . 'homepagesettings.js');
... (229 lines truncated)
</file>

<file path="application/controllers/index.html">
<html>
<head>
	<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
</file>

<file path="application/controllers/InstallerController.php">
<?php
class InstallerController extends CController
{
    public $connection;
    public $lang = null;
    public $layout = 'installer';
    public function run($action = 'index')
    {
        $this->checkInstallation();
        $this->sessioncontrol();
        App()->loadHelper('common');
        App()->loadHelper('surveytranslator');
        AdminTheme::getInstance();
        App()->getClientScript()->registerCssFile(App()->baseUrl . '/installer/css/main.css');
        App()->getClientScript()->registerCssFile(App()->baseUrl . '/installer/css/fonts.css');
        switch ($action) {
            case 'welcome':
                $this->stepWelcome();
                break;
            case 'license':
                $this->stepLicense();
                break;
            case 'viewlicense':
                $this->stepViewLicense();
                break;
            case 'precheckprepare':
                $this->stepPreInstallationCheckPrepare();
                break;
            case 'precheck':
                $this->stepPreInstallationCheck();
... (725 lines truncated)
</file>

<file path="application/controllers/LimereplacementfieldsController.php">
<?php
class LimeReplacementFieldsController extends LSBaseController
{
    public function actionIndex()
    {
        $surveyid = (int) App()->request->getQuery('surveyid');
        $gid = (int) App()->request->getQuery('gid');
        $qid = (int) App()->request->getQuery('qid');
        $newType = (bool) App()->request->getQuery('newtype', 0);
        $survey = Survey::model()->findByPk($surveyid);
        $fieldtype = sanitize_xss_string(App()->request->getQuery('fieldtype'));
        $action = sanitize_xss_string(App()->request->getQuery('action'));
        if (!Yii::app()->session['loginID']) {
            throw new CHttpException(401);
        }
        if ($surveyid && !Permission::model()->hasSurveyPermission($surveyid, 'survey', 'read')) {
            throw new CHttpException(403);
        }
        if ($newType) {
            $newTypeResponse = $this->getNewTypeResponse($fieldtype, $surveyid, $gid, $qid);
            return $this->renderPartial('/admin/super/_renderJson', ['data' => $newTypeResponse]);
        }
        list($replacementFields, $isInsertAnswerEnabled) = $this->getReplacementFields($fieldtype, $surveyid);
        if ($isInsertAnswerEnabled === true) {
            $fieldmap = createFieldMap($survey, 'full', false, false, $survey->language);
            $surveyformat = $survey->format;
            $questionlist = $this->getQuestionList($action, $gid, $qid, $fieldmap, $fieldtype, $surveyformat);
            $childQuestions = $this->getChildQuestions($questionlist);
        }
        $data = [];
... (408 lines truncated)
</file>

<file path="application/controllers/LSBaseController.php">
<?php
class LSBaseController extends LSYii_Controller
{
    public $sTemplate = null;
    public $aData = [];
    protected $userId = 0;
    protected function customInit()
    {
        parent::customInit();
        $this->layout = 'main';
        $this->sessionControl();
        $this->userId = Yii::app()->user->getId();
        if (!Yii::app()->getConfig("surveyid")) {
            Yii::app()->setConfig("surveyid", returnGlobal('sid'));
        }
        if (!Yii::app()->getConfig("surveyID")) {
            Yii::app()->setConfig("surveyID", returnGlobal('sid'));
        }
        if (!Yii::app()->getConfig("ugid")) {
            Yii::app()->setConfig("ugid", returnGlobal('ugid'));
        }
        if (!Yii::app()->getConfig("gid")) {
            Yii::app()->setConfig("gid", returnGlobal('gid'));
        }
        if (!Yii::app()->getConfig("qid")) {
            Yii::app()->setConfig("qid", returnGlobal('qid'));
        }
        if (!Yii::app()->getConfig("lid")) {
            Yii::app()->setConfig("lid", returnGlobal('lid'));
        }
... (81 lines truncated)
</file>

<file path="application/controllers/OptinController.php">
<?php
class OptinController extends LSYii_Controller
{
    public $layout = 'bare';
    public $defaultAction = 'tokens';
    public function actiontokens()
    {
        Yii::app()->loadHelper('database');
        Yii::app()->loadHelper('sanitize');
        $surveyId = Yii::app()->request->getQuery('surveyid');
        $languageCode = Yii::app()->request->getQuery('langcode');
        $accessToken = Token::sanitizeToken(Yii::app()->request->getQuery('token'));
        if (!filter_var($surveyId, FILTER_VALIDATE_INT) || !$accessToken) {
            throw new CHttpException(400, gT('Invalid request.'));
        }
        $survey = Survey::model()->findByPk($surveyId);
        if (empty($survey) || !$survey->hasTokensTable) {
            throw new CHttpException(404, "This survey does not seem to exist. It may have been deleted or the link you were given is outdated or incorrect.");
        }
        if (!isset($languageCode) || $languageCode == "" || !$languageCode) {
            $baseLanguage = $survey->language;
        } else {
            $baseLanguage = \LSYii_Validators::languageCodeFilter($languageCode);
        }
        Yii::app()->setLanguage($baseLanguage);
        LimeExpressionManager::singleton()->loadTokenInformation($surveyId, $accessToken, false);
        $token = Token::model($surveyId)->findByAttributes(['token' => $accessToken]);
        $link = '';
        $tokenAttributes = [];
        if (!isset($token)) {
... (157 lines truncated)
</file>

<file path="application/controllers/OptoutController.php">
<?php
class OptoutController extends LSYii_Controller
{
    public $layout = 'bare';
    public $defaultAction = 'tokens';
    public function actiontokens()
    {
        $iSurveyID     = Yii::app()->request->getQuery('surveyid');
        $sLanguageCode = Yii::app()->request->getQuery('langcode');
        $sToken        = Token::sanitizeToken(Yii::app()->request->getQuery('token'));
        Yii::app()->loadHelper('database');
        Yii::app()->loadHelper('sanitize');
        if (!filter_var($iSurveyID, FILTER_VALIDATE_INT) || !$sToken) {
            throw new CHttpException(400, gT('Invalid request.'));
        }
        $oSurvey = Survey::model()->findByPk($iSurveyID);
        if (empty($oSurvey) || !$oSurvey->hasTokensTable) {
            throw new CHttpException(404, "The survey in which you are trying to participate does not seem to exist. It may have been deleted or the link you were given is outdated or incorrect.");
        }
        if (!isset($sLanguageCode) || $sLanguageCode == "" || !$sLanguageCode) {
            $sBaseLanguage = $oSurvey->language;
        } else {
            $sBaseLanguage = \LSYii_Validators::languageCodeFilter($sLanguageCode);
        }
        Yii::app()->setLanguage($sBaseLanguage);
        $link = '';
        $tokenAttributes = [];
        $oToken = Token::model($iSurveyID)->findByAttributes(array('token' => $sToken));
        if (!isset($oToken)) {
            $sMessage = gT('You are not a participant of this survey.');
... (193 lines truncated)
</file>

<file path="application/controllers/PluginsController.php">
<?php
class PluginsController extends LSYii_Controller
{
    public function actionDirect($plugin, $function = null)
    {
        $oEvent = new PluginEvent('newDirectRequest');
        $oEvent->set('target', $plugin);
        $oEvent->set('function', $function);
        $oEvent->set('request', App()->request);
        App()->getPluginManager()->dispatchEvent($oEvent);
        $sOutput = '';
        foreach ($oEvent->getAllContent() as $content) {
            $sOutput .= $content->getContent();
        }
        if (!empty($sOutput)) {
            $this->renderText($sOutput);
        }
    }
    /**
     * Launch the event newUnsecureRequest
     * @param $plugin : the target
     * @param $function : the function to call from the plugin
     */
    public function actionUnsecure($plugin, $function = null)
    {
        $oEvent = new PluginEvent('newUnsecureRequest');
        $oEvent->set('target', $plugin);
        $oEvent->set('function', $function);
        $oEvent->set('request', App()->request);
        App()->getPluginManager()->dispatchEvent($oEvent);
... (10 lines truncated)
</file>

<file path="application/controllers/PrintanswersController.php">
<?php
class PrintanswersController extends LSYii_Controller
{
    public $layout = 'survey';
    public $sTemplate;
    public $aReplacementData = array();
    public $aGlobalData = array();
    public function actionView($surveyid, $printableexport = false)
    {
        Yii::app()->loadHelper("frontend");
        Yii::import('application.libraries.admin.pdf');
        $survey = Survey::model()->findByPk($surveyid);
        $iSurveyID = $survey->sid;
        $sExportType = $printableexport;
        Yii::app()->loadHelper('database');
        if (isset($_SESSION['responses_' . $iSurveyID]['sid'])) {
            $iSurveyID = $_SESSION['responses_' . $iSurveyID]['sid'];
        } else {
        }
        if (isset($_SESSION['responses_' . $iSurveyID]['s_lang'])) {
            $sLanguage = $_SESSION['responses_' . $iSurveyID]['s_lang'];
        } elseif ($survey) {
            {
            $sLanguage = $survey->language;
            }
        } else {
            $iSurveyID = 0;
            $sLanguage = Yii::app()->getConfig("defaultlang");
        }
        SetSurveyLanguage($iSurveyID, $sLanguage);
... (96 lines truncated)
</file>

<file path="application/controllers/QuestionAdministrationController.php">
<?php
use LimeSurvey\Models\Services\QuestionAggregateService;
use LimeSurvey\Models\Services\Exception\{
    NotFoundException,
    PermissionDeniedException,
    QuestionHasConditionsException
};
class QuestionAdministrationController extends LSBaseController
{
    public function accessRules()
    {
        return [
            [
                'allow',
                'actions' => [],
                'users'   => ['*'],
            ],
            [
                'allow',
                'actions' => ['view'],
                'users'   => ['@'],
            ],
            ['deny'],
        ];
    }
    protected function beforeRender($view)
    {
        if (isset($this->aData['surveyid'])) {
            $this->aData['oSurvey'] = $this->aData['oSurvey'] ?? Survey::model()->findByPk($this->aData['surveyid']);
            LimeExpressionManager::SetSurveyId($this->aData['surveyid']);
... (1956 lines truncated)
</file>

<file path="application/controllers/QuestionGroupsAdministrationController.php">
<?php
use LimeSurvey\Models\Services\{
    QuestionGroupService,
    Exception\NotFoundException
};
class QuestionGroupsAdministrationController extends LSBaseController
{
    public function accessRules()
    {
        return array(
            array(
                'allow',
                'actions' => array(),
                'users' => array('*'),
            ),
            array(
                'allow',
                'actions' => array(
                    'view',
                    'delete',
                    'add',
                    'getQuestionGroupTopBar',
                    'getQuestionsForGroup',
                    'import',
                    'importView',
                    'loadQuestionGroup',
                    'saveQuestionGroupData',
                    'updateOrder'
                ),
                'users' => array('@'),
... (575 lines truncated)
</file>

<file path="application/controllers/QuickTranslationController.php">
<?php
use Anper\Iuliia\Iuliia;
class QuickTranslationController extends LSBaseController
{
    public $languageCodeMappings = array(
        'cs-informal' => 'cs',
        'de-informal' => 'de',
        'de-easy' => 'de',
        'es-informal' => 'es',
        'es-AR' => 'es',
        'es-AR-informal' => 'es',
        'es-CL' => 'es',
        'es-CO' => 'es',
        'es-MX' => 'es',
        'hat' => 'ht',
        'he' => 'iw',
        'ie' => 'ga',
        'it-informal' => 'it',
        'mya' => 'my',
        'nb' => 'no',
        'nl-informal' => 'nl',
        'nn' => 'no',
        'prs' => 'fa',
        'roh' => 'rm',
        'smi' => 'se',
        'swh' => 'sw',
        'xho' => 'xh',
        'yor' => 'yo',
        'zh-Hans' => 'zh-CN',
        'zh-Hant-HK' => 'zh-TW',
... (342 lines truncated)
</file>

<file path="application/controllers/QuotasController.php">
<?php
class QuotasController extends LSBaseController
{
    public function filters()
    {
        return array(
            'accessControl',
            'postOnly + deleteAnswer, deleteQuota, insertQuotaAnswer',
        );
    }
    protected function beforeRender($view)
    {
        $this->layout = 'layout_questioneditor';
        LimeExpressionManager::SetSurveyId($this->aData['surveyid']);
        LimeExpressionManager::StartProcessingPage(false, true);
        return parent::beforeRender($view);
    }
    public function actionIndex($surveyid)
    {
        $surveyid = sanitize_int($surveyid);
        if (!Permission::model()->hasSurveyPermission($surveyid, 'quotas')) {
            throw new CHttpException(403, gT("You do not have permission for this survey."));
        }
        $oSurvey = Survey::model()->findByPk($surveyid);
        $aData['surveyid'] = $oSurvey->sid;
        if (Yii::app()->getRequest()->getQuery('pageSize')) {
            Yii::app()->user->setState('pageSize', (int) Yii::app()->getRequest()->getQuery('pageSize'));
        }
        $aData['iGridPageSize'] = Yii::app()->user->getState('pageSize', Yii::app()->params['defaultPageSize']);
        $oDataProvider = new CArrayDataProvider($oSurvey->quotas, array(
... (324 lines truncated)
</file>

<file path="application/controllers/RegisterController.php">
<?php
class RegisterController extends LSYii_Controller
{
    public $layout = 'survey';
    public $sTemplate;
    public $aReplacementData = array();
    public $aGlobalData = array();
    private $aRegisterErrors;
    private $sMessage;
    private $sMailMessage;
    private $sendRegistrationEmail;
    public function actions()
    {
        return array(
            'captcha' => array(
                'class' => 'CaptchaExtendedAction',
                'mode' => CaptchaExtendedAction::MODE_MATH
            )
        );
    }
    public function actionAJAXRegisterForm($surveyid)
    {
        Yii::app()->loadHelper('database');
        Yii::app()->loadHelper('replacements');
        $redata = compact(array_keys(get_defined_vars()));
        $iSurveyId = $surveyid;
        $oSurvey = Survey::model()->find('sid=:sid', array(':sid' => $iSurveyId));
        if (!$oSurvey) {
            throw new CHttpException(404, "The survey in which you are trying to participate does not seem to exist. It may have been deleted or the link you were given is outdated or incorrect.");
        }
... (360 lines truncated)
</file>

<file path="application/controllers/ResponsesController.php">
<?php
class ResponsesController extends LSBaseController
{
    private const SELECT_ALL_HARD_CAP = 5000;
    public function __construct($controller, $id)
    {
        parent::__construct($controller, $id);
        App()->loadHelper('surveytranslator');
    }
    public function filters()
    {
        return [
            'postOnly + delete, deleteSingle, deleteAttachments'
        ];
    }
    public function getActionParams()
    {
        return array_merge($_GET, $_POST);
    }
    public function beforeRender($view)
    {
        App()->getClientScript()->registerCssFile(App()->getConfig('publicstyleurl') . 'browse.css');
        $surveyId = (int)App()->request->getParam('surveyId');
        $oSurvey = Survey::model()->findByPk($surveyId);
        $this->aData['subaction'] = gT("Responses and statistics");
        $this->aData['display']['menu_bars']['browse'] = gT('Browse responses');
        $this->aData['title_bar']['title'] = gT('Browse responses') . ': ' . $oSurvey->currentLanguageSettings->surveyls_title;
        $this->aData['topBar']['type'] = 'responses';
        $this->layout = 'layout_questioneditor';
        return parent::beforeRender($view);
... (911 lines truncated)
</file>

<file path="application/controllers/RestController.php">
<?php
use LimeSurvey\Api\Rest\Endpoint\EndpointFactory;
use LimeSurvey\DI;
class RestController extends LSYii_Controller
{
    public function run($actionID)
    {
        Yii::app()->loadConfig('rest');
        $action = new CInlineAction($this, 'index');
        if (Yii::app()->beforeControllerAction($this, $action)) {
            $endpointFactory = DI::getContainer()
                ->get(EndpointFactory::class);
            ($endpointFactory)->create(
                Yii::app()->request
            )->run();
            Yii::app()->afterControllerAction($this, $action);
        }
    }
}
</file>

<file path="application/controllers/SmtpOAuthController.php">
<?php
class SmtpOAuthController extends LSBaseController
{
    public function accessRules()
    {
        return [
            [
                'allow',
                'actions' => ['receiveOAuthResponse'],
                'users'   => ['*'],
            ],
            [
                'allow',
                'actions' => ['prepareRefreshTokenRequest', 'launchRefreshTokenRequest'],
                'users'   => ['@'],
            ],
            ['deny'],
        ];
    }
    public function actionPrepareRefreshTokenRequest($plugin)
    {
        if (!Permission::model()->hasGlobalPermission('settings', 'update')) {
            Yii::app()->user->setFlash('error', gT("Access denied!"));
            $this->redirect(Yii::app()->createUrl("/admin"));
        }
        $pluginModel = Plugin::model()->findByAttributes(['name' => $plugin]);
        if (empty($pluginModel) || !$pluginModel->active) {
            Yii::app()->user->setFlash('error', gT("Invalid plugin"));
            $this->redirect(Yii::app()->createUrl("/admin"));
        }
... (81 lines truncated)
</file>

<file path="application/controllers/StatisticsUserController.php">
<?php
class StatisticsUserController extends SurveyController
{
    public $iSurveyID;
    public $sLanguage;
    public function remap($method, $params = array())
    {
        array_unshift($params, $method);
        return call_user_func_array(array($this, "action"), $params);
    }
    public function actionAction($surveyid, $language = null)
    {
        $sLanguage = $language;
        $survey = Survey::model()->findByPk($surveyid);
        $this->sLanguage = $language;
        $iSurveyID = (int)$survey->sid;
        $this->iSurveyID = $survey->sid;
        Yii::app()->loadHelper("userstatistics");
        Yii::app()->loadHelper('database');
        Yii::app()->loadHelper('surveytranslator');
        $data = array();
        if (!isset($iSurveyID)) {
            $iSurveyID = returnGlobal('sid');
        } else {
            $iSurveyID = (int)$iSurveyID;
        }
        if (!$iSurveyID) {
            throw new CHttpException(404, 'You have to provide a valid survey ID.');
        }
        $actresult = Survey::model()->findAll('sid = :sid AND active = :active', array(':sid' => $iSurveyID, ':active' => 'Y'));
... (189 lines truncated)
</file>

<file path="application/controllers/SurveyAdministrationController.php">
<?php
use LimeSurvey\DI;
use LimeSurvey\Models\Services\CopySurveyOptions;
use LimeSurvey\Models\Services\CopySurveyResources;
use LimeSurvey\Models\Services\FileUploadService;
use LimeSurvey\Models\Services\FilterImportedResources;
use LimeSurvey\Models\Services\GroupHelper;
use LimeSurvey\Models\Services\SurveyAccessModeService;
use LimeSurvey\Models\Services\SurveyDetailService;
use LimeSurvey\Models\Services\SurveyThemeConfiguration;
class SurveyAdministrationController extends LSBaseController
{
    public function accessRules()
    {
        return [
            [
                'allow',
                'actions' => [],
                'users' => ['*'],
            ],
            [
                'allow',
                'actions' => [
                    'view',
                    'delete',
                    'index',
                    'insert',
                    'listsurveys',
                    'newSurvey',
                    'regenerateQuestionCode',
... (2746 lines truncated)
</file>

<file path="application/controllers/SurveyController.php">
<?php
class SurveyController extends LSYii_Controller
{
    public $lang = null;
    public $layout = 'bare';
    public $sTemplate = null;
    public $aReplacementData = array();
    public $aGlobalData = array();
    protected function customInit()
    {
        parent::customInit();
        unset(Yii::app()->session['FileManagerContext']);
        if (!Yii::app()->getConfig("surveyid")) {
            Yii::app()->setConfig("surveyid", returnGlobal('sid'));
        }
        if (!Yii::app()->getConfig("ugid")) {
            Yii::app()->setConfig("ugid", returnGlobal('ugid'));
        }
        if (!Yii::app()->getConfig("gid")) {
            Yii::app()->setConfig("gid", returnGlobal('gid'));
        }
        if (!Yii::app()->getConfig("qid")) {
            Yii::app()->setConfig("qid", returnGlobal('qid'));
        }
        if (!Yii::app()->getConfig("lid")) {
            Yii::app()->setConfig("lid", returnGlobal('lid'));
        }
        if (!Yii::app()->getConfig("code")) {
            Yii::app()->setConfig("code", returnGlobal('code'));
        }
... (89 lines truncated)
</file>

<file path="application/controllers/SurveyPermissionsController.php">
<?php
use LimeSurvey\Models\Services\PermissionManager;
class SurveyPermissionsController extends LSBaseController
{
    public function accessRules()
    {
        return [
            [
                'allow',
                'actions' => [],
                'users' => ['*'],
            ],
            [
                'allow',
                'actions' => [
                    'index',
                    'addUser',
                    'addUserGroups',
                    'deleteUserPermissions',
                    'savePermissions',
                    'SettingsPermissions'
                ],
                'users' => ['@'],
            ],
            ['deny'],
        ];
    }
    protected function beforeRender($view)
    {
        $this->layout = 'layout_questioneditor';
... (222 lines truncated)
</file>

<file path="application/controllers/SurveysController.php">
<?php
class SurveysController extends LSYii_Controller
{
    public $layout = 'public';
    public $sTemplate;
    public $aReplacementData = array();
    public $aGlobalData = array();
    public $defaultAction = 'publicList';
    public function actionPublicList($lang = null)
    {
        if (!empty($lang)) {
            $aLanguages = getLanguageDataRestricted(false, 'short');
            if (!isset($aLanguages[ $lang ])) {
                $lang = Yii::app()->getConfig('defaultlang');
            }
        } else {
            $lang = Yii::app()->getConfig('defaultlang');
        }
        App()->setLanguage($lang);
        LimeExpressionManager::SetSurveyId(0);
        $oTemplate       = Template::model()->getInstance(Yii::app()->getConfig('defaulttheme'));
        $this->sTemplate = $oTemplate->sTemplateName;
        $aData = array(
            'publicSurveys'     => Survey::model()->active()->open()->with('languagesettings')->findAllPublic(),
            'futureSurveys'     => Survey::model()->active()->registration()->with('languagesettings')->findAllPublic(),
            'oTemplate'         => $oTemplate,
            'sSiteName'         => Yii::app()->getConfig('sitename'),
            'sSiteAdminName'    => Yii::app()->getConfig("siteadminname"),
            'sSiteAdminEmail'   => Yii::app()->getConfig("siteadminemail"),
            'bShowClearAll'     => false,
... (124 lines truncated)
</file>

<file path="application/controllers/SurveysGroupsPermissionController.php">
<?php
use LimeSurvey\Models\Services\PermissionManager;
class SurveysGroupsPermissionController extends LSBaseController
{
    public $defaultAction = 'index';
    public function accessRules()
    {
        return [
            [
                'allow',
                'actions' => [],
                'users'   => ['*'],
            ],
            [
                'allow',
                'actions' => ['view'],
                'users'   => ['@'],
            ],
            ['deny'],
        ];
    }
    public function filters()
    {
        return array(
            'postOnly + DeleteUser'
        );
    }
    public function actionIndex(int $id)
    {
        $model = $this->loadModel($id);
... (406 lines truncated)
</file>

<file path="application/controllers/ThemeOptionsController.php">
<?php
use LimeSurvey\DI;
use LimeSurvey\Models\Services\SurveyDetailService;
use LimeSurvey\Models\Services\SurveyThemeConfiguration;
class ThemeOptionsController extends LSBaseController
{
    public function accessRules()
    {
        return [
            [
                'allow',
                'actions' => [],
                'users'   => ['*'],
            ],
            [
                'allow',
                'actions' => ['view'],
                'users'   => ['@'],
            ],
            ['deny'],
        ];
    }
    protected function beforeRender($view)
    {
        if (isset($this->aData['surveyid'])) {
            $this->aData['oSurvey'] = $this->aData['oSurvey'] ?? Survey::model()->findByPk($this->aData['surveyid']);
            LimeExpressionManager::SetSurveyId($this->aData['surveyid']);
            LimeExpressionManager::StartProcessingPage(false, true);
            $this->layout = 'layout_questioneditor';
        }
... (453 lines truncated)
</file>

<file path="application/controllers/UploaderController.php">
<?php
class UploaderController extends SurveyController
{
    public function run($actionID)
    {
        $surveyid = Yii::app()->session['LEMsid'];
        if (empty($surveyid)) {
            throw new CHttpException(401, gT("We are sorry but your session has expired."));
        }
        $oSurvey = Survey::model()->findByPk($surveyid);
        if (!$oSurvey) {
            throw new CHttpException(400);
        }
        $sLanguage = Yii::app()->session['responses_' . $surveyid]['s_lang'] ?? "";
        Yii::app()->setLanguage($sLanguage);
        $uploaddir = Yii::app()->getConfig("uploaddir");
        $tempdir = Yii::app()->getConfig("tempdir");
        Yii::app()->loadHelper("database");
        $sFileGetContent = Yii::app()->request->getParam('filegetcontents', ''); // The file to view fu_ or fu_tmp
        $bDelete = Yii::app()->request->getParam('delete');
        $sFieldName = Yii::app()->request->getParam('fieldname');
        $sFileName = Yii::app()->request->getParam('filename', ''); // The file to delete fu_ or fu_tmp
        $sOriginalFileName = Yii::app()->request->getParam('name', ''); // Used for javascript return only
        $sMode = Yii::app()->request->getParam('mode');
        $sPreview = (int) Yii::app()->request->getParam('preview', 0);
        $sFileGetContentFiltered = preg_replace('/[^a-zA-Z0-9_]/', '', (string) $sFileGetContent);
        $sFileNameFiltered = preg_replace('/[^a-zA-Z0-9_]/', '', (string) $sFileName);
        $sFieldNameFiltered = preg_replace('/[^Q0-9]/', '', (string) $sFieldName);
        if ($sFileGetContent != $sFileGetContentFiltered || $sFileName != $sFileNameFiltered || $sFieldName != $sFieldNameFiltered) {
            // If one seems to be a hack: Bad request
... (372 lines truncated)
</file>

<file path="application/controllers/UserGroupController.php">
<?php
class UserGroupController extends LSBaseController
{
    public function filters()
    {
        return [
            'postOnly + deleteGroup, addUserToGroup, deleteUserFromGroup'
        ];
    }
    public function accessRules()
    {
        return array(
            array(
                'allow',
                'actions' => array(),
                'users' => array('*'),
            ),
            array(
                'allow',
                'actions' => array('index','edit', 'viewGroup', 'addGroup', 'addUserToGroup',
                    'deleteGroup', 'deleteUserFromGroup', 'mailToAllUsersInGroup'),
                'users' => array('@'),
            ),
            array('deny'),
        );
    }
    public function beforeRender($view)
    {
        App()->getClientScript()->registerScriptFile(App()->getConfig('adminscripts') . 'users.js');
        Yii::app()->loadHelper('database');
... (338 lines truncated)
</file>

<file path="application/controllers/UserManagementController.php">
<?php
use LimeSurvey\Models\Services\UserManager;
class UserManagementController extends LSBaseController
{
    public function accessRules()
    {
        return array(
            array(
                'allow',
                'actions' => array(),
                'users' => array('*'),
            ),
            array(
                'allow',
                'actions' => array(
                    'index', 'addEditUser', 'applyEdit',
                    'addRole', 'batchAddGroup', 'batchApplyRoles', 'batchPermissions', 'batchExpires',
                    'batchSendAndResetLoginData', 'deleteConfirm',  'deleteMultiple', 'exportUser', 'importUser',
                    'renderSelectedItems', 'renderUserImport', 'saveRole', 'saveThemePermissions',
                    'takeOwnership', 'userPermissions', 'userTemplatePermissions', 'viewUser'
                ),
                'users' => array('@'),
            ),
            array('deny'),
        );
    }
    public function filters()
    {
        return [
            'postOnly + applyEdit, deleteUser, userActivateDeactivate,'
... (1403 lines truncated)
</file>

<file path="application/controllers/UserRoleController.php">
<?php
class UserRoleController extends LSBaseController
{
    public function filters()
    {
        return [
          'postOnly + delete, applyEdit, savePermissions, batchDelete'
        ];
    }
    public function actionIndex()
    {
        if (!Permission::model()->hasGlobalPermission('superadmin', 'read')) {
            App()->session['flashmessage'] = gT('You have no access to the role management!');
            $this->redirect(array('/admin'));
        }
        App()->getClientScript()->registerPackage('permissionroles');
        $request = App()->request;
        $pageSize = $request->getParam('pageSize');
        if ($pageSize != null) {
            App()->user->setState('pageSize', (int)$pageSize);
        }
        $model = Permissiontemplates::model();
        $aPermissiontemplatesParam = $request->getParam('Permissiontemplates');
        if ($aPermissiontemplatesParam) {
            $model->setAttributes($aPermissiontemplatesParam, false);
        }
        $aData['topbar']['title'] = gT('User roles');
        $aData['topbar']['backLink'] = App()->createUrl('dashboard/view');
        $aData['topbar']['middleButtons'] = $this->renderPartial(
            'partials/topbarBtns/leftSideButtons',
... (336 lines truncated)
</file>

<file path="application/controllers/VerificationController.php">
<?php
class VerificationController extends LSYii_Controller
{
    public function actionImage($sid)
    {
        $iSurveyID = (int) $sid;
        Yii::app()->loadHelper('database');
        $rootdir = Yii::app()->getConfig('rootdir');
        $im = ImageCreate(75, 20);
        $white = ImageColorAllocate($im, 255, 255, 255);
        $black = ImageColorAllocate($im, 0, 0, 0);
        $red = ImageColorAllocate($im, 255, 0, 0);
        $blue = ImageColorAllocate($im, 0, 0, 255);
        $grey_shade = ImageColorAllocate($im, 204, 204, 204);
        srand((float) microtime() * 1000000);
        $num1 = rand(1, 5);
        $found = false;
        while ($found == false) {
            $num2 = rand(1, 100);
            if (preg_match('/^[0-9]+$/', $num2 / 5)) {
                $found = true;
                break;
            }
        }
        $font_c_rand = rand(1, 3);
        if ($font_c_rand == 1) {
            $font_color = $black;
        } elseif ($font_c_rand == 2) {
            $font_color = $red;
        } elseif ($font_c_rand == 3) {
... (40 lines truncated)
</file>

<file path="application/core/db/DbConnection.php">
<?php
class DbConnection extends \CDbConnection
{
    public function __construct($dsn = '', $username = '', $password = '')
    {
        parent::__construct($dsn, $username, $password);
        $this->driverMap = array_merge($this->driverMap, array(
            'mysql' => 'MysqlSchema',
            'mysqli' => 'MysqlSchema',
            'mssql' => 'MssqlSchema',
            'dblib' => 'MssqlSchema',
            'sqlsrv' => 'MssqlSchema',
            'pgsql' => 'PgsqlSchema'
        ));
    }
    protected function createPdoInstance()
    {
        $driver = $this->getDriverName();
        if ($driver !== 'mssql' && $driver !== 'dblib') {
            return parent::createPdoInstance();
        }
        $pdoClass = 'LimeSurveyMssqlPdoAdapter';
        if (!class_exists($pdoClass)) {
            throw new CDbException(
                Yii::t(
                    'yii',
                    'CDbConnection is unable to find PDO class "{className}". Make sure PDO is installed correctly.',
                    array('{className}' => $pdoClass)
                )
            );
... (37 lines truncated)
</file>

<file path="application/core/db/LimeSurveyMssqlPdoAdapter.php">
<?php
class LimeSurveyMssqlPdoAdapter extends CMssqlPdoAdapter
{
    private $lsInTransaction = false;
    public function beginTransaction()
    {
        $result = parent::beginTransaction();
        $this->lsInTransaction = true;
        return $result;
    }
    public function commit()
    {
        $result = parent::commit();
        $this->lsInTransaction = false;
        return $result;
    }
    public function rollBack()
    {
        $result = parent::rollBack();
        $this->lsInTransaction = false;
        return $result;
    }
    public function inTransaction()
    {
        return $this->lsInTransaction;
    }
}
</file>

<file path="application/core/db/LSMssqlDbCommandBuilder.php">
<?php
class LSMssqlDbCommandBuilder extends \CMssqlCommandBuilder
{
    protected $_schema;
    protected $_connection;
    protected function composeMultipleInsertCommand($table, array $data, array $templates = array())
    {
        if (empty($data)) {
            throw new \CDbException(\Yii::t('yii', 'Can not generate multiple insert command with empty data set.'));
        }
        $templates = array_merge(
            array(
                'main' => 'INSERT INTO {{tableName}} ({{columnInsertNames}}) VALUES {{rowInsertValues}}',
                'columnInsertValue' => '{{value}}',
                'columnInsertValueGlue' => ', ',
                'rowInsertValue' => '({{columnInsertValues}})',
                'rowInsertValueGlue' => ', ',
                'columnInsertNameGlue' => ', ',
            ),
            $templates
        );
        $this->ensureTable($table);
        $tableName = $table->rawName;
        $params = array();
        $columnInsertNames = array();
        $rowInsertValues = array();
        $columns = array();
        foreach ($data as $rowData) {
            foreach ($rowData as $columnName => $columnValue) {
                if (!in_array($columnName, $columns, true)) {
... (155 lines truncated)
</file>

<file path="application/core/db/LSMysqlDbCommandBuilder.php">
<?php
class LSMysqlDbCommandBuilder extends \CMysqlCommandBuilder
{
    protected $_schema;
    protected $_connection;
    protected function composeMultipleInsertCommand($table, array $data, array $templates = array())
    {
        if (empty($data)) {
            throw new \CDbException(\Yii::t('yii', 'Can not generate multiple insert command with empty data set.'));
        }
        $templates = array_merge(
            array(
                'main' => 'INSERT INTO {{tableName}} ({{columnInsertNames}}) VALUES {{rowInsertValues}}',
                'columnInsertValue' => '{{value}}',
                'columnInsertValueGlue' => ', ',
                'rowInsertValue' => '({{columnInsertValues}})',
                'rowInsertValueGlue' => ', ',
                'columnInsertNameGlue' => ', ',
            ),
            $templates
        );
        $this->ensureTable($table);
        $tableName = $table->rawName;
        $params = array();
        $columnInsertNames = array();
        $rowInsertValues = array();
        $columns = array();
        foreach ($data as $rowData) {
            foreach ($rowData as $columnName => $columnValue) {
                if (!in_array($columnName, $columns, true)) {
... (155 lines truncated)
</file>

<file path="application/core/db/LSPgsqlDbCommandBuilder.php">
<?php
class LSPgsqlDbCommandBuilder extends \CPgsqlCommandBuilder
{
    protected $_schema;
    protected $_connection;
    protected function composeMultipleInsertCommand($table, array $data, array $templates = array())
    {
        if (empty($data)) {
            throw new \CDbException(\Yii::t('yii', 'Can not generate multiple insert command with empty data set.'));
        }
        $templates = array_merge(
            array(
                'main' => 'INSERT INTO {{tableName}} ({{columnInsertNames}}) VALUES {{rowInsertValues}}',
                'columnInsertValue' => '{{value}}',
                'columnInsertValueGlue' => ', ',
                'rowInsertValue' => '({{columnInsertValues}})',
                'rowInsertValueGlue' => ', ',
                'columnInsertNameGlue' => ', ',
            ),
            $templates
        );
        $this->ensureTable($table);
        $tableName = $table->rawName;
        $params = array();
        $columnInsertNames = array();
        $rowInsertValues = array();
        $columns = array();
        foreach ($data as $rowData) {
            foreach ($rowData as $columnName => $columnValue) {
                if (!in_array($columnName, $columns, true)) {
... (155 lines truncated)
</file>

<file path="application/core/db/MssqlSchema.php">
<?php
class MssqlSchema extends CMssqlSchema
{
    public function __construct($conn)
    {
        parent::__construct($conn);
        $this->columnTypes['text'] = 'nvarchar(max)';
        $this->columnTypes['mediumtext'] = 'nvarchar(max)';
        $this->columnTypes['longtext'] = 'nvarchar(max)';
        $this->columnTypes['pk'] = 'int IDENTITY PRIMARY KEY NOT NULL';
        $this->columnTypes['string'] = 'nvarchar(255)';
        $this->columnTypes['autoincrement'] = 'integer NOT NULL IDENTITY (1,1)';
        $this->columnTypes['longbinary'] = 'varbinary(max)';
        $this->columnTypes['json'] = 'nvarchar(max)';
    }
    public function getColumnType($type)
    {
        $sResult = $type;
        if (isset($this->columnTypes[$type])) {
            $sResult = $this->columnTypes[$type];
        } elseif (preg_match('/^(\w+)\((.+?)\)(.*)$/', (string) $type, $matches)) {
            if (isset($this->columnTypes[$matches[1]])) {
                $sResult = preg_replace('/\(.+\)/', '(' . $matches[2] . ')', (string) $this->columnTypes[$matches[1]]) . $matches[3];
            }
        } elseif (preg_match('/^(\w+)\s+/', (string) $type, $matches)) {
            if (isset($this->columnTypes[$matches[1]])) {
                $sResult = preg_replace('/^\w+/', (string) $this->columnTypes[$matches[1]], (string) $type);
            }
        }
        if (stripos((string) $sResult, 'NULL') === false) {
... (46 lines truncated)
</file>

<file path="application/core/db/MysqlSchema.php">
<?php
class MysqlSchema extends CMysqlSchema
{
    public function __construct($conn)
    {
        parent::__construct($conn);
        $this->columnTypes['autoincrement'] = 'int(11) NOT NULL AUTO_INCREMENT';
        $this->columnTypes['longbinary'] = 'longblob';
        $this->columnTypes['json'] = 'json';
    }
    public function createTable($table, $columns, $options = null)
    {
        if (empty($options)) {
            $options = 'ENGINE=' . Yii::app()->getConfig('mysqlEngine') . ' DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci';
        }
        $cols = array();
        foreach ($columns as $name => $type) {
            if (is_array($type) && $name == 'composite_pk') {
                $cols[] = "\t" . $this->getCompositePrimaryKey($type);
            } elseif (is_string($name)) {
                $cols[] = "\t" . $this->quoteColumnName($name) . ' ' . $this->getColumnType($type);
            } else {
                $cols[] = "\t" . $type;
            }
        }
        $sql = "CREATE TABLE " . $this->quoteTableName($table) . " (\n" . implode(",\n", $cols) . "\n)";
        return $options === null ? $sql : $sql . ' ' . $options;
    }
    public function getCompositePrimaryKey(array $columns)
    {
... (41 lines truncated)
</file>

<file path="application/core/db/PgsqlSchema.php">
<?php
class PgsqlSchema extends CPgsqlSchema
{
    public function __construct($conn)
    {
        parent::__construct($conn);
        $this->columnTypes['autoincrement'] = 'serial';
        $this->columnTypes['longbinary'] = 'bytea';
        $this->columnTypes['decimal'] = 'numeric (10,0)';
        $this->columnTypes['mediumtext'] = 'text';
        $this->columnTypes['longtext'] = 'text';
        $this->columnTypes['json'] = 'json';
    }
    public function getColumnType($type)
    {
        if (isset($this->columnTypes[$type])) {
            $sResult = $this->columnTypes[$type];
        } elseif (preg_match('/^([a-zA-Z ]+)\((.+?)\)(.*)$/', $type, $matches)) {
            $baseType = parent::getColumnType($matches[1]);
            if (preg_match('/^([a-zA-Z ]+)\((.+?)\)(.*)$/', (string) $baseType, $baseMatches)) {
                $sResult = preg_replace('/\(.+\)/', "(" . $matches[2] . ")", (string) parent::getColumnType($matches[1] . " " . $matches[3]));
            } else {
                $sResult = join(" ", array($baseType, "(" . $matches[2] . ")", $matches[3]));
            }
        } else {
            $sResult = parent::getColumnType($type);
        }
        return $sResult;
    }
    public function createTable($table, $columns, $options = null)
... (36 lines truncated)
</file>

<file path="application/core/plugins/AuditLog/AuditLog.php">
<?php
class AuditLog extends \LimeSurvey\PluginManager\PluginBase
{
    protected $storage = 'DbStorage';
    protected static $description = 'Core: Create an audit log of changes';
    protected static $name = 'auditlog';
    public $allowedPublicMethods = array();
    protected $settings = array(
        'settingsIntro' => array(
            'type' => 'info',
            'content' => '<h2 class="h4 mb-3">Log events</h2>',
        ),
        'separatorUsers' => array(
            'type' => 'separator',
            'title' => 'User accounts',
        ),
        'AuditLog_Log_UserSave' => array(
            'type' => 'boolean',
            'label' => 'User created or modified',
            'default' => '1',
        ),
        'AuditLog_Log_UserDelete' => array(
            'type' => 'boolean',
            'label' => 'User deleted',
            'default' => '1',
        ),
        'AuditLog_Log_UserLogin' => array(
            'type' => 'boolean',
            'label' => 'Successful login',
            'default' => '1',
... (507 lines truncated)
</file>

<file path="application/core/plugins/AuditLog/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>AuditLog</name>
        <type>plugin</type>
        <creationDate>2013-03-20</creationDate>
        <lastUpdate>2026-09-18</lastUpdate>
        <author>Carsten Schmitz</author>
        <authorEmail>support@limesurvey.org</authorEmail>
        <authorUrl>https://www.limesurvey.org</authorUrl>
        <license>GNU General Public License version 2 or later</license>
        <version>1.0.1</version>
        <description><![CDATA[Core: Create an audit log of changes]]></description>
    </metadata>
    <compatibility>
        <version>7.0</version>
        <version>6.0</version>
        <version>5.0</version>
        <version>4.0</version>
        <version>3.0</version>
        <version>2.73</version>
    </compatibility>
    <updaters disabled="disabled">
    </updaters>
</config>
</file>

<file path="application/core/plugins/AuditLog/mdlAuditLog.php">
<?php
class mdlAuditlog extends LSActiveRecord
{
    public static function model($className = __CLASS__)
    {
        return parent::model($className);
    }
    public function tableName()
    {
        return '{{auditlog}}';
    }
}
</file>

<file path="application/core/plugins/Authdb/Authdb.php">
<?php
class Authdb extends AuthPluginBase
{
    protected $storage = 'DbStorage';
    protected $_onepass = null;
    protected static $description = 'Core: Database authentication + exports';
    protected static $name = 'LimeSurvey internal database';
    public $allowedPublicMethods = array();
    public function init()
    {
        $this->subscribe('createNewUser');
        $this->subscribe('beforeLogin');
        $this->subscribe('newLoginForm');
        $this->subscribe('afterLoginFormSubmit');
        $this->subscribe('remoteControlLogin');
        $this->subscribe('newUserSession');
        $this->subscribe('beforeDeactivate');
        $this->subscribe('listExportPlugins');
        $this->subscribe('listExportOptions');
        $this->subscribe('newExport');
    }
    public function createNewUser()
    {
        if (!Permission::model()->hasGlobalPermission('users', 'create')) {
            return;
        }
        $oEvent = $this->getEvent();
        $preCollectedUserArray = $oEvent->get('preCollectedUserArray', []);
        $expires = null;
        $status = true;
... (256 lines truncated)
</file>

<file path="application/core/plugins/Authdb/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>Authdb</name>
        <type>plugin</type>
        <creationDate>2013-03-28</creationDate>
        <lastUpdate>2018-01-24</lastUpdate>
        <author>Menno Dekker</author>
        <authorUrl>https://www.limesurvey.org</authorUrl>
        <version>1.0.1</version>
        <license>GNU General Public License version 2 or later</license>
        <description><![CDATA[Core: Database authentication + exports]]></description>
    </metadata>
    <compatibility>
        <version>7.0</version>
        <version>6.0</version>
        <version>5.0</version>
        <version>4.0</version>
        <version>3.0</version>
        <version>2.73</version>
    </compatibility>
    <updaters disabled="disabled">
    </updaters>
</config>
</file>

<file path="application/core/plugins/AuthLDAP/AuthLDAP.php">
<?php
class AuthLDAP extends LimeSurvey\PluginManager\AuthPluginBase
{
    protected $storage = 'DbStorage';
    protected static $description = 'Core: LDAP authentication';
    protected static $name = 'LDAP';
    public $allowedPublicMethods = array();
    protected $autoCreate = false;
    protected $settings = array(
        'server' => array(
            'type' => 'string',
            'label' => 'LDAP server',
            'help' => 'e.g. ldap://ldap.example.com or ldaps://ldap.example.com'
        ),
        'ldapport' => array(
            'type' => 'string',
            'label' => 'Port number',
            'help' => 'Default when omitted is 389',
        ),
        'ldapversion' => array(
            'type' => 'select',
            'label' => 'LDAP version',
            'options' => array('2' => 'LDAPv2', '3'  => 'LDAPv3'),
            'default' => '3',
            'help' => 'LDAPv2 is obsolete and does not reliably support passwords with non-ASCII characters (e.g. §, ä, é) - use LDAPv3 unless your server does not support it.',
            'submitonchange' => true
        ),
        'ldapoptreferrals' => array(
            'type' => 'boolean',
            'label' => 'Select true if referrals must be followed (use false for ActiveDirectory)',
... (478 lines truncated)
</file>

<file path="application/core/plugins/AuthLDAP/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>AuthLDAP</name>
        <type>plugin</type>
        <creationDate>2013-04-05</creationDate>
        <lastUpdate>2018-01-24</lastUpdate>
        <author>Menno Dekker</author>
        <authorUrl>https://www.limesurvey.org</authorUrl>
        <version>1.0.0</version>
        <license>GNU General Public License version 2 or later</license>
        <description><![CDATA[Core: LDAP authentication]]></description>
    </metadata>
    <compatibility>
        <version>7.0</version>
        <version>6.0</version>
        <version>5.0</version>
        <version>4.0</version>
        <version>3.0</version>
        <version>2.73</version>
    </compatibility>
    <updaters disabled="disabled">
    </updaters>
</config>
</file>

<file path="application/core/plugins/Authwebserver/Authwebserver.php">
<?php
class Authwebserver extends LimeSurvey\PluginManager\AuthPluginBase
{
    protected $storage = 'DbStorage';
    protected static $description = 'Core: Webserver authentication';
    protected static $name = 'Webserver';
    public $allowedPublicMethods = array();
    protected $settings = array(
        'strip_domain' => array(
            'type' => 'boolean',
            'label' => 'Strip domain part (DOMAIN\\USER or USER@DOMAIN)',
            'default' => '0',
        ),
        'serverkey' => array(
            'type' => 'string',
            'label' => 'Key to use for username e.g. PHP_AUTH_USER, LOGON_USER, REMOTE_USER. See phpinfo in global settings.',
            'default' => 'REMOTE_USER',
        ),
        'is_default' => array(
            'type' => 'boolean',
            'label' => 'Default authentication method (disables the default LimeSurvey DB authentication if activated).',
            'default' => '1',
        )
    );
    public function init()
    {
        $this->subscribe('getGlobalBasePermissions');
        $this->subscribe('beforeLogin');
        $this->subscribe('newUserSession');
    }
... (111 lines truncated)
</file>

<file path="application/core/plugins/Authwebserver/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>Authwebserver</name>
        <type>plugin</type>
        <creationDate>2013-03-28</creationDate>
        <lastUpdate>2018-02-03</lastUpdate>
        <author>Menno Dekker</author>
        <authorUrl>https://www.limesurvey.org</authorUrl>
        <version>1.0.0</version>
        <license>GNU General Public License version 2 or later</license>
        <description><![CDATA[Core: Webserver authentication]]></description>
    </metadata>
    <compatibility>
        <version>7.0</version>
        <version>6.0</version>
        <version>5.0</version>
        <version>4.0</version>
        <version>3.0</version>
        <version>2.73</version>
    </compatibility>
    <updaters disabled="disabled">
    </updaters>
</config>
</file>

<file path="application/core/plugins/AzureOAuthSMTP/views/Help.twig">
<div class="col-8 offset-2 mb-3">
    <div class="accordion" id="accordionExample">
        <div class="accordion-item border border-info">
            <h2 class="accordion-header" id="headingOne">
                <button class="accordion-button fw-bold collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseOne" aria-expanded="false" aria-controls="collapseOne">
                    {{ gT("Help") }}
                </button>
            </h2>
            <div id="collapseOne" class="accordion-collapse collapse" aria-labelledby="headingOne" data-bs-parent="#accordionExample">
                <div class="accordion-body">
                    <p>
                        <strong>{{ gT("Prerequisites:") }}</strong>
                        <ul>
                            <li>{{ gT("Access LimeSurvey over HTTPS.") }} {{ isHttps ? "<span class='fa fa-check text-success'></span>" : "<span class='fa fa-exclamation-triangle text-danger' data-bs-toggle='tooltip' title='" ~ gT("Currently not served over HTTPS") ~ "'></span>" }}</li>
                        </ul>
                    </p>
                    <p>
                        <strong>{{ gT("Instructions:") }}</strong>
                        <ol>
                            <li>
                                <div>{{ sprintf(gT("Setup the OAuth 2.0 Web Application in %s."), '<a href="https://portal.azure.com/" target="_blank">' ~ gT("Azure Portal") ~ ' <span class="fa fa-external-link"></span></a>') }}</div>
                                <div class="text-break"><strong>{{ gT("Redirect URI:") }}</strong> {{ redirectUri }}</div>
                            </li>
                            <li>{{ gT("Activate the plugin.") }}</li>
                            <li>{{ gT("Set the 'Client ID', 'Client Secret' and 'Tenant ID' below and save the settings.") }}</li>
                            <li>{{ gT("On the plugin overview page, click the 'Get new token' link to open Azure's consent screen in a new window.") }}</li>
                            <li>{{ gT("Follow the steps in the consent screen and check the requested permissions.") }}</li>
                        </ol>
                    </p>
                </div>
... (5 lines truncated)
</file>

<file path="application/core/plugins/AzureOAuthSMTP/AzureOAuthSMTP.php">
<?php
use LimeSurvey\PluginManager\SmtpOAuthPluginBase;
use PHPMailer\PHPMailer\PHPMailer;
class AzureOAuthSMTP extends SmtpOAuthPluginBase
{
    protected $storage = 'DbStorage';
    protected static $description = 'Core: Adds Azure OAuth support for email sending';
    protected static $name = 'AzureOAuthSMTP';
    public $allowedPublicMethods = [];
    protected $credentialAttributes = ['clientId', 'clientSecret', 'tenantId'];
    protected $encryptedSettings = ['clientSecret'];
    protected $settings = [
        'help' => [
            'type' => 'info',
            'content' => '',
        ],
        'clientId' => [
            'type' => 'string',
            'label' => 'Client ID',
        ],
        'clientSecret' => [
            'type' => 'string',
            'label' => 'Client Secret',
        ],
        'tenantId' => [
            'type' => 'string',
            'label' => 'Tenant ID',
        ],
    ];
    public function init()
... (159 lines truncated)
</file>

<file path="application/core/plugins/AzureOAuthSMTP/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>AzureOAuthSMTP</name>
        <type>plugin</type>
        <creationDate>2023-04-06</creationDate>
        <last_update>2023-04-06</last_update>
        <author>LimeSurvey GmbH</author>
        <authorUrl>https://www.limesurvey.org</authorUrl>
        <version>1.0.0</version>
        <license>GNU General Public License version 2 or later</license>
        <description><![CDATA[Core: Adds Azure OAuth support for email sending]]></description>
    </metadata>
    <compatibility>
        <version>7.0</version>
        <version>6.0</version>
    </compatibility>
    <updaters disabled="disabled">
    </updaters>
</config>
</file>

<file path="application/core/plugins/ComfortUpdateChecker/helpers/CUCMenuClass.php">
<?php
namespace ComfortUpdateChecker\helpers;
class CUCMenuClass extends \LimeSurvey\Menu\Menu
{
    public function getLabel()
    {
        return $this->label;
    }
}
</file>

<file path="application/core/plugins/ComfortUpdateChecker/ComfortUpdateChecker.php">
<?php
class ComfortUpdateChecker extends PluginBase
{
    protected $storage = 'DbStorage';
    protected static $description = 'Update Checker for Comfort Update users';
    protected static $name = 'ComfortUpdateChecker';
    public $allowedPublicMethods = array();
    protected $settings = [
        'only_security_update' => array(
            'type' => 'boolean',
            'label' => 'Notification only for security updates',
            'default' => '0',
        ),
        'animate_icon' => array(
            'type' => 'boolean',
            'label' => 'Animate update icon',
            'default' => '0',
        ),
    ];
    public function init()
    {
        Yii::setPathOfAlias(get_class($this), dirname(__FILE__));
        $this->subscribe('beforeAdminMenuRender');
    }
    public function beforeAdminMenuRender()
    {
        $oEvent = $this->getEvent();
        $this->registerAssets();
        $updateNotification = $this->getUpdate();
        if ($updateNotification && $updateNotification->result) {
... (37 lines truncated)
</file>

<file path="application/core/plugins/ComfortUpdateChecker/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>ComfortUpdateChecker</name>
        <type>plugin</type>
        <creationDate>2020-10-12</creationDate>
        <lastUpdate>2020-10-12</lastUpdate>
        <author>LimeSurvey GmbH</author>
        <authorUrl>https://limesurvey.org</authorUrl>
        <email>support@limesurvey.org</email>
        <version>1.0.1</version>
        <license>GNU General Public License version 2 or later</license>
        <description><![CDATA[Checks if a new update is available in ComfortUpdate]]></description>
        <supportUrl>https://www.limesurvey.org</supportUrl>
    </metadata>
    <compatibility>
        <version>7.0</version>
        <version>6.0</version>
        <version>5.0</version>
        <version>4.0</version>
 	    <version>3.0</version>
    </compatibility>
    <updaters disabled="disabled">
    </updaters>
</config>
</file>

<file path="application/core/plugins/customToken/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>customToken</name>
        <type>plugin</type>
        <creationDate>2019-07-22</creationDate>
        <last_update>2019-07-22</last_update>
        <author>Tools for Research</author>
        <authorUrl>https://www.toolsforresearch.com</authorUrl>
        <version>1.0.1</version>
        <license>MIT</license>
        <description><![CDATA[Numeric, non-ambiguous or CAPITAL tokens]]></description>
    </metadata>
    <compatibility>
        <version>7.0</version>
        <version>6.0</version>
        <version>5.0</version>
        <version>4.0</version>
    </compatibility>
    <updaters disabled="disabled">
    </updaters>
</config>
</file>

<file path="application/core/plugins/customToken/customToken.php">
<?php
class customToken extends PluginBase
{
    protected $storage = 'DbStorage';
    protected static $name = 'customToken';
    protected static $description = 'At token generation this plugin enforces certain token formats like Numeric, non-ambiguous or uppercase tokens';
    public $allowedPublicMethods = array();
    public function init()
    {
        $this->subscribe('afterGenerateToken', 'generateCustomToken');
        $this->subscribe('beforeSurveySettings');
        $this->subscribe('newSurveySettings');
        $this->subscribe('beforeDeactivate');
    }
    public function generateCustomToken()
    {
        $event = $this->getEvent();
        $iSurveyID = $event->get('surveyId');
        $iTokenLength = $event->get('iTokenLength');
        $token = "";
        if (empty($this->get('customToken', 'Survey', $iSurveyID))) {
            // 0 or not set. No custom function for this survey: return without changes in $event
            return;
        }
        switch ($this->get('customToken', 'Survey', $iSurveyID)) {
            case 1: // 1 = Numeric tokens
                $token = randomChars($iTokenLength, '123456789');
                break;
            case 2: // 2 = Without ambiguous characters including 'hard to manually enter'
                // https://github.com/LimeSurvey/LimeSurvey/commit/154e026fbe6e53037e46a8c30f2b837459235acc
... (62 lines truncated)
</file>

<file path="application/core/plugins/customToken/LICENSE.txt">
MIT License

Copyright (c) 2019 Tools for Research

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
</file>

<file path="application/core/plugins/customToken/README.md">
# customToken: numeric, non-ambiguous, CAPITAL token formats #

## Installation

In LimeSurvey 4: go to Configuration > Plugin manager > Scan files > Install  
In LimeSurvey 3: the plugin in /plugins/customToken should be recognized automatically.

## Activation

After activation a new item will be in the Simple plugins menu.

## Configuration on the survey level
You can select one out of 4 options on the survey level:  
* No custom function  
* Numeric tokens  
* Without ambiguous characters  
* CAPITALS ONLY  

## Deactivation
On deactivating: the settings for this plugin will be removed from the plugin_settings DB table.

## Uninstallation

In LimeSurvey 4: go to Configuration > Plugin manager > Uninstall the plugin  
In LimeSurvey 3: remove the directory /plugins/customToken    
Note: the files will be deleted from your filesystem, but will be re-installed on a LS update

## Home page & Copyright
- HomePage [Tools for Research](https://www.toolsforresearch.com)
- Copyright © 2019 [Tools for Research](https://www.toolsforresearch.com)
... (2 lines truncated)
</file>

<file path="application/core/plugins/dateFunctions/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>dateFunctions</name>
        <type>plugin</type>
        <creationDate>2022-09-12</creationDate>
        <last_update>2022-09-12</last_update>
        <author>LimeSurvey GmbH</author>
        <authorUrl>https://www.limesurvey.org</authorUrl>
        <version>1.0.0</version>
        <license>GNU General Public License version 2 or later</license>
        <description><![CDATA[Core: Date related Expression Manager functions]]></description>
    </metadata>
    <compatibility>
        <version>7.0</version>
        <version>6.0</version>
        <version>5.0</version>
    </compatibility>
    <updaters disabled="disabled">
    </updaters>
</config>
</file>

<file path="application/core/plugins/dateFunctions/dateFunctions.php">
<?php
class dateFunctions extends PluginBase
{
    protected static $description = 'Core: Date related Expression Manager functions';
    protected static $name = 'dateFunctions';
    public $allowedPublicMethods = array();
    public function init()
    {
        $this->subscribe('ExpressionManagerStart');
    }
    public function ExpressionManagerStart()
    {
        Yii::setPathOfAlias(get_class($this), dirname(__FILE__));
        $newFunctions = array(
            'localize_date' => array(
                '\dateFunctions\EMFunctions::localize_date',
                null,
                $this->gT("Formats a date according to the Survey's date format for the specified language. Example: localize_date(VALIDUNTIL, TOKEN:LANGUAGE)"),
                'string localize_date(date [, language])',
                'https://www.limesurvey.org/manual/',
                1, 2
            )
        );
        $this->getEvent()->append('functions', $newFunctions);
    }
}
</file>

<file path="application/core/plugins/dateFunctions/EMFunctions.php">
<?php
namespace dateFunctions;
use LimeExpressionManager;
use Survey;
class EMFunctions
{
    public static function localize_date($date, $language = null)
    {
        if (empty($date)) {
            return '';
        }
        // Try to get Survey ID from the EM
        $surveyId = LimeExpressionManager::getLEMsurveyId();
        // If it's not set, try to get it from the session
        if (empty($surveyId)) {
            $surveyId = \Yii::app()->session['LEMsid'];
        }
        if (empty($surveyId)) {
            return '';
        }
        $survey = Survey::model()->findByPk($surveyId);
        if (empty($survey)) {
            return '';
        }
        if (empty($language)) {
            $language = \Yii::app()->getLanguage();
        }
        // If the specified language is not one of the survey's languages, fallback to the survey's base language.
        if (!in_array($language, $survey->getAllLanguages()) || empty($survey->languagesettings[$language])) {
            $language = $survey->language;
... (8 lines truncated)
</file>

<file path="application/core/plugins/ExportR/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>ExportR</name>
        <type>plugin</type>
        <creationDate>2013-07-03</creationDate>
        <lastUpdate>2017-11-23</lastUpdate>
        <author>Menno Dekker</author>
        <authorUrl>https://www.limesurvey.org</authorUrl>
        <version>1.0.0</version>
        <license>GNU General Public License version 2 or later</license>
        <description><![CDATA[Core: R-export]]></description>
    </metadata>
    <compatibility>
        <version>7.0</version>
        <version>6.0</version>
        <version>5.0</version>
        <version>4.0</version>
        <version>3.0</version>
        <version>2.73</version>
    </compatibility>
    <updaters disabled="disabled">
    </updaters>
</config>
</file>

<file path="application/core/plugins/ExportR/ExportR.php">
<?php
class ExportR extends \LimeSurvey\PluginManager\PluginBase
{
    protected $storage = 'DbStorage';
    protected static $description = 'Core: R-export';
    protected static $name = 'Export results to R';
    public $allowedPublicMethods = array();
    public function init()
    {
        $this->subscribe('listExportPlugins');
        $this->subscribe('listExportOptions');
        $this->subscribe('newExport');
    }
    public function listExportOptions()
    {
        $event = $this->getEvent();
        $type = $event->get('type');
        switch ($type) {
            case 'rsyntax':
                $tooltip = CHtml::openTag('ol');
                $tooltip .= CHtml::tag('li', array(), gT("Download the data and the syntax file."));
                $tooltip .= CHtml::tag('li', array(), gT("Save both of them on the R working directory (use getwd() and setwd() on the R command window to get and set it)"));
                $tooltip .= CHtml::tag('li', array(), gT("digit:       source(\"filename\", encoding = \"UTF-8\")        on the R command window, replace filename with the actual filename"));
                $tooltip .= CHtml::closeTag('ol');
                $tooltip .= CHtml::tag('br');
                $tooltip .= gT("Your data should be imported now, the data.frame is named \"data\", the variable.labels are attributes of data (\"attributes(data)\$variable.labels\"), like for foreign:read.spss.");
                $event->set('tooltip', $tooltip);
                $event->set('label', gT("R (syntax file)"));
                break;
            case 'rdata':
... (30 lines truncated)
</file>

<file path="application/core/plugins/ExportR/RDataWriter.php">
<?php
Yii::import('application.helpers.admin.export.*');
class RDataWriter extends CsvWriter
{
    public $na = '';
    public $fieldmap = null;
    public function init(\SurveyObj $survey, $sLanguageCode, \FormattingOptions $oOptions)
    {
        parent::init($survey, $sLanguageCode, $oOptions);
        // Change filename
        $this->csvFilename = 'survey_' . $survey->id . '_R_data_file.csv';
        $this->doHeaders = true;
        $oOptions->answerFormat = "short";
        $this->fieldmap = $survey->fieldMap;
    }
    protected function transformResponseValue($value, $fieldType, FormattingOptions $oOptions, $column = null)
    {
        switch ($fieldType) {
            case Question::QT_C_ARRAY_YES_UNCERTAIN_NO:
                if ($value == 'Y') {
                    return 1;
                } elseif ($value == 'N') {
                    return 2;
                } elseif ($value == 'U') {
                    return 3;
                }
                break;
            case Question::QT_E_ARRAY_INC_SAME_DEC:
                if ($value == 'I') {
                    return 1;
... (43 lines truncated)
</file>

<file path="application/core/plugins/ExportR/RSyntaxWriter.php">
<?php
class RSyntaxWriter extends Writer
{
    private $output;
    private $separator;
    private $hasOutputHeader;
    private $maxLength = 25500;
    protected $handle = null;
    protected $customFieldmap = array();
    protected $headers = array();
    function __construct()
    {
        $this->output = '';
        $this->separator = ',';
        $this->hasOutputHeader = false;
    }
    public function init(SurveyObj $survey, $sLanguageCode, FormattingOptions $oOptions)
    {
        parent::init($survey, $sLanguageCode, $oOptions);
        if ($oOptions->output == 'display') {
            header("Content-Disposition: attachment; filename=survey_" . $survey->id . "_R_syntax_file.R");
            header("Content-type: application/download; charset=UTF-8");
            header("Cache-Control: must-revalidate, no-store, no-cache");
            $this->handle = fopen('php://output', 'w');
        } elseif ($oOptions->output == 'file') {
            $this->handle = fopen($this->filename, 'w');
        }
        $this->out('data <- read.csv("survey_' . $survey->id . '_R_data_file.csv", quote = "\'\"", na.strings=c("", "\"\""), stringsAsFactors=FALSE, fileEncoding="UTF-8-BOM")');
        $this->out("");
        $this->out("");
... (133 lines truncated)
</file>

<file path="application/core/plugins/ExportSPSSsav/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>ExportSPSSsav</name>
        <type>plugin</type>
        <creationDate>2021-03-31</creationDate>
        <lastUpdate>2021-08-02</lastUpdate>
        <author>Adam Zammit</author>
        <authorUrl>https://www.acspri.org.au</authorUrl>
        <version>1.0.4</version>
        <license>GNU General Public License version 2 or later</license>
        <description><![CDATA[Core: Export survey results to an SPSS sav file]]></description>
    </metadata>
    <compatibility>
        <version>7.0</version>
        <version>6.0</version>
        <version>5.0</version>
        <version>4.0</version>
        <version>3.0</version>
        <version>2.73</version>
    </compatibility>
    <updaters disabled="disabled">
    </updaters>
</config>
</file>

<file path="application/core/plugins/ExportSPSSsav/ExportSPSSsav.php">
<?php
class ExportSPSSsav extends \LimeSurvey\PluginManager\PluginBase
{
    protected $storage = 'DbStorage';
    protected static $description = 'Core: Export survey results to an SPSS sav file';
    protected static $name = 'SPSS Export';
    public $allowedPublicMethods = array();
    public function init()
    {
        $this->subscribe('listExportPlugins');
        $this->subscribe('listExportOptions');
        $this->subscribe('newExport');
    }
    protected $settings = array(
        'spssfileversion' => array(
            'type' => 'select',
            'label' => 'Export for SPSS',
            'options' => array('16' => 'versions 14 and above', '13'  => 'version 13 and below (limited string length)'),
            'default' => '16',
            'submitonchange' => false
            )
        );
    public function listExportOptions()
    {
        $event = $this->getEvent();
        $type = $event->get('type');
        switch ($type) {
            case 'spsssav':
                $event->set('label', gT("SPSS (.sav)"));
                $event->set('onclick', '
... (32 lines truncated)
</file>

<file path="application/core/plugins/ExportSPSSsav/SPSSWriter.php">
<?php
use SPSS\Sav\Variable;
class SPSSWriter extends Writer
{
    private $output;
    private $outputMode;
    private $separator;
    private $hasOutputHeader;
    protected $handle = null;
    protected $customFieldmap = array();
    protected $customResponsemap = array();
    protected $headers = array();
    protected $headersSGQA = array();
    protected $aQIDnonumericalAnswers = array();
    protected $maxStringLength;
    protected $spssfileversion = null;
    function __construct($pluginsettings)
    {
        $this->output          = '';
        $this->separator       = ',';
        $this->hasOutputHeader = false;
        $this->spssfileversion = $pluginsettings['spssfileversion']['current'];
        if ($this->spssfileversion >= 13) {
            $this->maxStringLength = 32767;
        } else {
            $this->maxStringLength = 255;
        }
    }
    public function init(SurveyObj $survey, $sLanguageCode, FormattingOptions $oOptions)
    {
... (394 lines truncated)
</file>

<file path="application/core/plugins/ExportSTATAxml/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>ExportSTATAxml</name>
        <type>plugin</type>
        <creationDate>2013-08-05</creationDate>
        <lastUpdate>2017-11-23</lastUpdate>
        <author>Mirko Faber</author>
        <authorUrl>https://www.limesurvey.org</authorUrl>
        <version>1.0.1</version>
        <license>GNU General Public License version 2 or later</license>
        <description><![CDATA[Core: Export survey results to a STATA xml file]]></description>
    </metadata>
    <compatibility>
        <version>7.0</version>
        <version>6.0</version>
        <version>5.0</version>
        <version>4.0</version>
        <version>3.0</version>
        <version>2.73</version>
    </compatibility>
    <updaters disabled="disabled">
    </updaters>
</config>
</file>

<file path="application/core/plugins/ExportSTATAxml/ExportSTATAxml.php">
<?php
class ExportSTATAxml extends \LimeSurvey\PluginManager\PluginBase
{
    protected $storage = 'DbStorage';
    protected static $description = 'Core: Export survey results to a STATA xml file';
    protected static $name = 'STATA Export';
    public $allowedPublicMethods = array();
    public function init()
    {
        $this->subscribe('listExportPlugins');
        $this->subscribe('listExportOptions');
        $this->subscribe('newExport');
    }
    protected $settings = array(
        'statafileversion' => array(
            'type' => 'select',
            'label' => 'Export for Stata',
            'options' => array('113' => 'version 8 through 12', '117'  => 'version 13 and up'),
            'default' => '117',
            'submitonchange' => false
        ),
    );
    public function listExportOptions()
    {
        $event = $this->getEvent();
        $type = $event->get('type');
        switch ($type) {
            case 'stataxml':
                $event->set('label', gT("STATA (.xml)"));
                $event->set('onclick', '
... (32 lines truncated)
</file>

<file path="application/core/plugins/ExportSTATAxml/STATAxmlWriter.php">
<?php
class STATAxmlWriter extends Writer
{
    private $output;
    private $separator;
    private $hasOutputHeader;
    private $maxByte = 100;
    private $minByte = -127;
    private $maxInt = 32740;
    private $minInt = -32767;
    private $statafileversion;
    private $maxStringLength;
    protected $handle = null;
    protected $customFieldmap = array();
    protected $customResponsemap = array();
    protected $headers = array();
    protected $headersSGQA = array();
    protected $aQIDnonumericalAnswers = array();
    function __construct($pluginsettings)
    {
        $this->output          = '';
        $this->separator       = ',';
        $this->hasOutputHeader = false;
        $this->statafileversion = $pluginsettings['statafileversion']['current'];
        if ($this->statafileversion >= 117) {
            $this->maxStringLength = 2045;
        } else {
            $this->maxStringLength = 244;
        }
    }
... (449 lines truncated)
</file>

<file path="application/core/plugins/ExpressionAnswerOptions/views/expressionAnswerOptionsInfo.twig">
<div class="well">
    <p>{{ gT("The function can be used with question ID or question code. The results are not updated on the same page.") }}</p>
    <p>{{ gT("Each parameter can use ExpressionScript, and the expressions are checked before being sent to the function.") }}</p>
    <p>{{ gT("The function uses the result of the expression then, for question parameter: if it's a numeric value, start to check if the question ID exists in this survey, and get the primary question. If it's a sub-question and a string, search the primary question title in this survey.") }}</p>
    <p>{{ gT("For the answer code the expression result is used directly.") }}</p>
    <p>{{ gT("Some examples:") }}</p>
    <ul>
        <li>{{ sprintf(gT("Get the answer text of option A1 of current single choice question: %s"), '<code>getAnswerOptionText(self.qid,"A1")</code>') }}</li>
        <li>{{ sprintf(gT("Get the answer text of option A1 of array question with code: %s"), '<code>getAnswerOptionText("Qcode","A1")</code>') }}</li>
        <li>{{ sprintf(gT("Get the answer text of same option choice done in a previous question with code previous to current single choice question: %s"), '<code>getAnswerOptionText(self.qid,prev.NAOK)</code>') }}</li>
    </ul>
</div>
</file>

<file path="application/core/plugins/ExpressionAnswerOptions/AnswerOptionsFunctions.php">
<?php
namespace ExpressionAnswerOptions;
use LimeExpressionManager;
use Question;
use Answer;
use Permission;
use CHtml;
class AnswerOptionsFunctions
{
    public static function getAnswerOptionText($qidortitle, $code, $scale = 0)
    {
        $surveyId = LimeExpressionManager::getLEMsurveyId();
        $oQuestion = null;
        if (is_int($qidortitle) || ctype_digit($qidortitle)) {
            $oQuestion = Question::model()->find(
                "qid = :qid and sid = :sid",
                array(":qid" => $qidortitle, ":sid" => $surveyId)
            );
            if ($oQuestion && $oQuestion->parent_qid) {
                $oQuestion = Question::model()->find(
                    "qid = :qid and sid = :sid",
                    array(":qid" => $oQuestion->parent_qid, ":sid" => $surveyId)
                );
            }
        }
        if (empty($oQuestion)) {
            $oQuestion = Question::model()->find(
                "title = :title and sid = :sid",
                array(":title" => $qidortitle, ":sid" => $surveyId)
            );
... (16 lines truncated)
</file>

<file path="application/core/plugins/ExpressionAnswerOptions/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>ExpressionAnswerOptions</name>
        <type>plugin</type>
        <creationDate>2021-11-18</creationDate>
        <lastUpdate>2021-11-23</lastUpdate>
        <author>Denis Chenu (for Respondage)</author>
        <authorUrl>https://www.respondage.nl</authorUrl>
        <supportUrl>https://www.limesurvey.org</supportUrl>
        <version>0.2.1</version>
        <license>GNU General Public License version 3 or later</license>
        <description><![CDATA[Expression Script: make answer option text available; see settings for documentation and usage.]]></description>
    </metadata>
    <compatibility>
        <version>7.0</version>
        <version>6.0</version>
        <version>5.0</version>
    </compatibility>
    <updaters disabled="disabled">
    </updaters>
</config>
</file>

<file path="application/core/plugins/ExpressionAnswerOptions/ExpressionAnswerOptions.php">
<?php
class ExpressionAnswerOptions extends PluginBase
{
    protected static $description = 'Expression Script: make answer option text available.';
    protected static $name = 'ExpressionAnswerOptions';
    protected $settings = array(
        'information' => array(
            'type' => 'info',
            'content' => '',
            'default' => false
        ),
    );
    public $allowedPublicMethods = array();
    public function init()
    {
        $this->subscribe('ExpressionManagerStart', 'newValidFunctions');
    }
    public function newValidFunctions()
    {
        Yii::setPathOfAlias("ExpressionAnswerOptions", dirname(__FILE__));
        $newFunctions = array(
            'getAnswerOptionText' => array(
                '\ExpressionAnswerOptions\AnswerOptionsFunctions::getAnswerOptionText',
                null,
                $this->gT("Return the answer text related to a question by answer code"),
                'string getAnswerOptionText(QuestionCode, code[, scale = 0])',
                'https://www.respondage.nl',
                2,
                3
            ),
... (20 lines truncated)
</file>

<file path="application/core/plugins/ExpressionAnswerOptions/LICENSE">
GNU GENERAL PUBLIC LICENSE
                       Version 3, 29 June 2007

 Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
 Everyone is permitted to copy and distribute verbatim copies
 of this license document, but changing it is not allowed.

                            Preamble

  The GNU General Public License is a free, copyleft license for
software and other kinds of works.

  The licenses for most software and other practical works are designed
to take away your freedom to share and change the works.  By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.  We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors.  You can apply it to
your programs, too.

  When we speak of free software, we are referring to freedom, not
price.  Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.

  To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights.  Therefore, you have
... (646 lines truncated)
</file>

<file path="application/core/plugins/ExpressionAnswerOptions/README.md">
# ExpressionAnswerOptions

Expression Script: make answer option text available inside survey by expression function.

## Usage

The plugin can be used on single choice question and array question , all question with related answers editable by administrator.

The function getAnswerOptionText get 3 parameters

1. The question id or title
2. The answer code to get
3. The scale (for array dual scale question)

Some sample `getAnswerOptionText(self.qid,"A1")`, `getAnswerOptionText("Qcode","A1")` or `getAnswerOptionText(Qcode_SQ01.qid,"A1")`.
</file>

<file path="application/core/plugins/expressionFixedDbVar/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>expressionFixedDbVar</name>
        <type>plugin</type>
        <creationDate>2019-07-14</creationDate>
        <lastUpdate>2021-01-26</lastUpdate>
        <author>Denis Chenu</author>
        <authorUrl>https://www.sondages.pro</authorUrl>
        <supportUrl>https://manual.limesurvey.org/ExpressionFixedDbVar</supportUrl>
        <version>1.0.2</version>
        <license>GPL</license>
        <description><![CDATA[Adds SEED and other database variable in ExpressionScript Engine. <a href="https://manual.limesurvey.org/ExpressionFixedDbVar">More information in LimeSurvey manual.</a>]]></description>
    </metadata>
    <compatibility>
        <version>7.0</version>
        <version>6.0</version>
        <version>5.0</version>
        <version>4.0</version>
    </compatibility>
    <updaters disabled="disabled">
    </updaters>
</config>
</file>

<file path="application/core/plugins/expressionFixedDbVar/expressionFixedDbVar.php">
<?php
class expressionFixedDbVar extends PluginBase
{
    protected $storage = 'DbStorage';
    protected static $description = 'Add SEED and other DB var in ExpressionScript Engine.';
    protected static $name = 'expressionFixedDbVar';
    public $allowedPublicMethods = array();
    protected $settings = array(
        'SEED' => array(
            'type' => 'boolean',
            'label' => 'Add SEED variable',
            'default' => '1',
            'column' => 'seed',
        ),
        'SUBMITDATE' => array(
            'type' => 'boolean',
            'label' => 'Add SUBMITDATE variable',
            'default' => '1',
            'column' => 'submitdate',
        ),
        'STARTDATE' => array(
            'type' => 'boolean',
            'label' => 'Add STARTDATE variable',
            'default' => '0',
            'column' => 'startdate',
        ),
        'DATESTAMP' => array(
            'type' => 'boolean',
            'label' => 'Add DATESTAMP variable',
            'default' => '1',
... (153 lines truncated)
</file>

<file path="application/core/plugins/expressionQuestionForAll/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>expressionQuestionForAll</name>
        <type>plugin</type>
        <creationDate>2019-07-24</creationDate>
        <lastUpdate>2026-10-17</lastUpdate>
        <author>Denis Chenu</author>
        <authorUrl>https://www.sondages.pro</authorUrl>
        <version>1.1.0</version>
        <license>GPL</license>
        <description><![CDATA[Adds QCODE with its question attributes (QCODE.question, QCODE.qid, QCODE.gid, QCODE.type, QCODE.relevance, QCODE.mandatory…) for questions with subquestions to ExpressionScript. <a href="https://manual.limesurvey.org/ExpressionQuestionForAll">More information in LimeSurvey manual.</a>]]></description>
    </metadata>
    <priority>1</priority>
    <compatibility>
        <version>7.0</version>
        <version>6.0</version>
        <version>5.0</version>
        <version>4.0</version>
    </compatibility>
    <updaters disabled="disabled">
    </updaters>
</config>
</file>

<file path="application/core/plugins/expressionQuestionForAll/expressionQuestionForAll.php">
<?php
class expressionQuestionForAll extends PluginBase
{
    protected static $description = 'Add QCODE with its question attributes for questions with subquestions to ExpressionScript.';
    protected static $name = 'expressionQuestionForAll';
    public $allowedPublicMethods = array();
    public function init()
    {
        $this->subscribe('setVariableExpressionEnd', 'addQuestionAll');
    }
    public function addQuestionAll()
    {
        $language = $this->event->get('language');
        $surveyId =  $this->event->get('surveyId');
        $aQuestionManaged = array(
            \QuestionType::QT_1_ARRAY_DUAL,
            \QuestionType::QT_A_ARRAY_5_POINT,
            \QuestionType::QT_B_ARRAY_10_POINT,
            \QuestionType::QT_C_ARRAY_YES_UNCERTAIN_NO,
            \QuestionType::QT_E_ARRAY_INC_SAME_DEC,
            \QuestionType::QT_F_ARRAY,
            \QuestionType::QT_H_ARRAY_COLUMN,
            \QuestionType::QT_K_MULTIPLE_NUMERICAL,
            \QuestionType::QT_M_MULTIPLE_CHOICE,
            \QuestionType::QT_P_MULTIPLE_CHOICE_WITH_COMMENTS,
            \QuestionType::QT_Q_MULTIPLE_SHORT_TEXT,
            \QuestionType::QT_R_RANKING,
            \QuestionType::QT_COLON_ARRAY_NUMBERS,
            \QuestionType::QT_SEMICOLON_ARRAY_TEXT,
        );
... (40 lines truncated)
</file>

<file path="application/core/plugins/expressionQuestionHelp/sample/limesurvey_survey_expressionQuestionHelp.lss">
<?xml version="1.0" encoding="UTF-8"?>
<document>
 <LimeSurveyDocType>Survey</LimeSurveyDocType>
 <DBVersion>418</DBVersion>
 <languages>
  <language>en</language>
 </languages>
 <groups>
  <fields>
   <fieldname>gid</fieldname>
   <fieldname>sid</fieldname>
   <fieldname>group_order</fieldname>
   <fieldname>randomization_group</fieldname>
   <fieldname>grelevance</fieldname>
  </fields>
  <rows>
   <row>
    <gid><![CDATA[5]]></gid>
    <sid><![CDATA[647542]]></sid>
    <group_order><![CDATA[1]]></group_order>
    <randomization_group/>
    <grelevance/>
   </row>
   <row>
    <gid><![CDATA[6]]></gid>
    <sid><![CDATA[647542]]></sid>
    <group_order><![CDATA[2]]></group_order>
    <randomization_group/>
    <grelevance/>
   </row>
... (296 lines truncated)
</file>

<file path="application/core/plugins/expressionQuestionHelp/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>expressionQuestionHelp</name>
        <type>plugin</type>
        <creationDate>2019-04-05</creationDate>
        <lastUpdate>2021-01-26</lastUpdate>
        <author>Denis Chenu</author>
        <authorUrl>https://www.sondages.pro</authorUrl>
        <version>1.0.1</version>
        <license>GPL</license>
        <description><![CDATA[Add QCODE.help for expression Manager. <a href="https://manual.limesurvey.org/ExpressionQuestionHelp">More information on LimeSurvey manual.</a>]]></description>
    </metadata>
    <compatibility>
        <version>7.0</version>
        <version>6.0</version>
        <version>5.0</version>
        <version>4.0</version>
    </compatibility>
    <updaters disabled="disabled">
    </updaters>
</config>
</file>

<file path="application/core/plugins/expressionQuestionHelp/expressionQuestionHelp.php">
<?php
class expressionQuestionHelp extends PluginBase
{
    protected static $description = 'Add .help to properties of questions.';
    protected static $name = 'expressionQuestionHelp';
    public $allowedPublicMethods = array();
    public function init()
    {
        $this->subscribe('setVariableExpressionEnd', 'addQuestionHelp');
    }
    public function addQuestionHelp()
    {
        $knownVars = $this->event->get('knownVars');
        $language = $this->event->get('language');
        foreach ($knownVars as $var => $values) {
            if (isset($values['question']) && isset($values['qid']) && $values['qid'] != '') {
                $oQuestionL10n = QuestionL10n::model()->find('qid = :qid and language = :language', array(":qid" => $values['qid'],":language" => $language));
                if ($oQuestionL10n) {
                    $knownVars[$var]['help'] = $oQuestionL10n->help;
                }
            }
        }
        $this->event->set('knownVars', $knownVars);
        $this->event->append('newExpressionSuffixes', ['help']);
    }
}
</file>

<file path="application/core/plugins/FunctionStatic/views/StaticFunctionsInfo.twig">
<div class="well">
    <p>{{ gT("The function is used to return a static value of any expression.") }}</p>
    <p>{{ sprintf(gT("Simple usage to get the value of current response before any update: %s"), '{getStatic(self.NAOK)}') }}</p>
</div>
</file>

<file path="application/core/plugins/FunctionStatic/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>FunctionStatic</name>
        <type>plugin</type>
        <creationDate>2022-03-15</creationDate>
        <lastUpdate>2202-04-04</lastUpdate>
        <author>Denis Chenu</author>
        <authorUrl>https://limesurvey.org</authorUrl>
        <supportUrl>https://limesurvey.org</supportUrl>
        <version>0.1.0</version>
        <license>GNU General Public License version 3 or later</license>
        <description><![CDATA[The function is used to return a static value of any expression : {getStatic(expression)}.]]></description>
    </metadata>
    <compatibility>
        <version>7.0</version>
        <version>6.0</version>
        <version>5.0</version>
    </compatibility>
    <updaters disabled="disabled">
    </updaters>
</config>
</file>

<file path="application/core/plugins/FunctionStatic/FunctionStatic.php">
<?php
class FunctionStatic extends PluginBase
{
    protected static $description = 'The function is used to return a static value of any expression.';
    protected static $name = 'FunctionStatic';
    protected $settings = array(
        'information' => array(
            'type' => 'info',
            'content' => '',
            'default' => false
        ),
    );
    public $allowedPublicMethods = array();
    public function init()
    {
        $this->subscribe('ExpressionManagerStart', 'newValidFunctions');
    }
    public function newValidFunctions()
    {
        Yii::setPathOfAlias("FunctionStatic", dirname(__FILE__));
        $newFunctions = array(
            'getStatic' => array(
                '\FunctionStatic\StaticFunctions::getStatic',
                null,
                $this->gT("Return the equation as a static value even if question are in same group."),
                'string getStatic(expression)',
                'https://limesurvey.org',
                1
            ),
        );
... (23 lines truncated)
</file>

<file path="application/core/plugins/FunctionStatic/README.md">
# FunctionStatic

Expression Script: allow to make any expression static for using in other expression

## Usage

The plugin can be used any expression, it just return a static value of this expression. Can be used to test update of current answer

The function getStatic get 1 parameter : the expression

Some sample `getStatic(self.shown)`, usage example : `{if(getStatic(self.shown) == self.shown, "You update current answer")}`
</file>

<file path="application/core/plugins/FunctionStatic/StaticFunctions.php">
<?php
namespace FunctionStatic;
class StaticFunctions
{
    public static function getStatic($equation)
    {
        return $equation;
    }
}
</file>

<file path="application/core/plugins/GoogleOAuthSMTP/views/Help.twig">
<div class="col-8 offset-2 mb-3">
    <div class="accordion" id="accordionExample">
        <div class="accordion-item border border-info">
            <h2 class="accordion-header" id="headingOne">
                <button class="accordion-button fw-bold collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseOne" aria-expanded="false" aria-controls="collapseOne">
                    {{ gT("Help") }}
                </button>
            </h2>
            <div id="collapseOne" class="accordion-collapse collapse" aria-labelledby="headingOne" data-bs-parent="#accordionExample">
                <div class="accordion-body">
                    <p>
                        <strong>{{ gT("Prerequisites:") }}</strong>
                        <ul>
                            <li>{{ gT("Access LimeSurvey over HTTPS.") }} {{ isHttps ? "<span class='fa fa-check text-success'></span>" : "<span class='fa fa-exclamation-triangle text-danger' data-bs-toggle='tooltip' title='" ~ gT("Currently not served over HTTPS") ~ "'></span>" }}</li>
                        </ul>
                    </p>
                    <p>
                        <strong>{{ gT("Instructions:") }}</strong>
                        <ol>
                            <li>
                                <div>{{ sprintf(gT("Setup the OAuth 2.0 Web Application in %s."), '<a href="https://console.cloud.google.com/" target="_blank">' ~ gT("Google Cloud Platform Console") ~ ' <span class="fa fa-external-link"></span></a>') }}</div>
                                <div class="text-break"><strong>{{ gT("Redirect URI:") }}</strong> {{ redirectUri }}</div>
                                <div>{{ sprintf(gT("You can find more details %shere%s"), '<a href="https://support.google.com/cloud/answer/6158849" target="_blank">', ' <span class="fa fa-external-link"></span></a>') }}</div>
                            </li>
                            <li>{{ gT("Activate the plugin.") }}</li>
                            <li>{{ gT("Set the 'Client ID' and 'Client Secret' below and save the settings.") }}</li>
                            <li>{{ gT("On the plugin overview page, click the 'Get new token' link to open Google's consent screen in a new window.") }}</li>
                            <li>{{ gT("Follow the steps in the consent screen and check the requested permissions.") }}</li>
                        </ol>
                    </p>
... (6 lines truncated)
</file>

<file path="application/core/plugins/GoogleOAuthSMTP/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>GoogleOAuthSMTP</name>
        <type>plugin</type>
        <creationDate>2023-01-03</creationDate>
        <last_update>2023-01-03</last_update>
        <author>LimeSurvey GmbH</author>
        <authorUrl>https://www.limesurvey.org</authorUrl>
        <version>1.0.0</version>
        <license>GNU General Public License version 2 or later</license>
        <description><![CDATA[Core: Adds Google OAuth support for email sending]]></description>
    </metadata>
    <compatibility>
        <version>7.0</version>
        <version>6.0</version>
    </compatibility>
    <updaters disabled="disabled">
    </updaters>
</config>
</file>

<file path="application/core/plugins/GoogleOAuthSMTP/GoogleOAuthSMTP.php">
<?php
use League\OAuth2\Client\Provider\Google;
use LimeSurvey\PluginManager\SmtpOAuthPluginBase;
use PHPMailer\PHPMailer\PHPMailer;
class GoogleOAuthSMTP extends SmtpOAuthPluginBase
{
    protected $storage = 'DbStorage';
    protected static $description = 'Core: Adds Google OAuth support for email sending';
    protected static $name = 'GoogleOAuthSMTP';
    public $allowedPublicMethods = [];
    protected $credentialAttributes = ['clientId', 'clientSecret'];
    protected $settings = [
        'help' => [
            'type' => 'info',
            'content' => '',
        ],
        'clientId' => [
            'type' => 'string',
            'label' => 'Client ID',
        ],
        'clientSecret' => [
            'type' => 'string',
            'label' => 'Client Secret',
        ],
    ];
    public function init()
    {
        $this->subscribe('listEmailPlugins');
        $this->subscribe('afterSelectEmailPlugin');
        $this->subscribe('MailerConstruct');
... (138 lines truncated)
</file>

<file path="application/core/plugins/mailSenderToFrom/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>mailSenderToFrom</name>
        <type>plugin</type>
        <creationDate>2019-03-19</creationDate>
        <last_update>2019-03-18</last_update>
        <author>Denis Chenu</author>
        <authorUrl>https://www.sondages.pro</authorUrl>
        <version>1.0.0</version>
        <license>MIT</license>
        <description><![CDATA[Force sender, From etc … to be the mail set for sending email. Some SMTP server need smtp user as From and Return-Path.]]></description>
    </metadata>
    <compatibility>
        <version>7.0</version>
        <version>6.0</version>
        <version>5.0</version>
        <version>4.0</version>
    </compatibility>
    <updaters disabled="disabled">
    </updaters>
</config>
</file>

<file path="application/core/plugins/mailSenderToFrom/mailSenderToFrom.php">
<?php
class mailSenderToFrom extends PluginBase
{
    protected static $description = 'Set sender to the SMTP user.';
    protected static $name = 'mailSenderToFrom';
    public $allowedPublicMethods = array();
    public function init()
    {
        $this->subscribe('beforeEmail', 'beforeEmail');
        $this->subscribe('beforeSurveyEmail', 'beforeEmail');
        $this->subscribe('beforeTokenEmail', 'beforeEmail');
    }
    public function beforeEmail()
    {
        $emailsmtpuser = Yii::app()->getConfig('emailsmtpuser');
        if (empty($emailsmtpuser)) {
            return;
        }
        $limeMailer = $this->getEvent()->get('mailer');
        $limeMailer->AddReplyTo($limeMailer->From, $limeMailer->FromName);
        $limeMailer->From = $emailsmtpuser;
        $limeMailer->Sender = $emailsmtpuser;
        $updateDisable = $this->getEvent()->get('updateDisable');
        $updateDisable['from'] = true;
        $updateDisable['bounce'] = true;
        $this->getEvent()->set('updateDisable', $updateDisable);
    }
}
</file>

<file path="application/core/plugins/oldUrlCompat/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>oldUrlCompat</name>
        <type>plugin</type>
        <creationDate>2016-01-27</creationDate>
        <lastUpdate>2020-01-26</lastUpdate>
        <author>Denis Chenu</author>
        <authorUrl>https://www.limesurvey.org</authorUrl>
        <version>1.0.1</version>
        <license>GNU General Public License version 2 or later</license>
        <description><![CDATA[Old url (pre-2.0) compatible system]]></description>
    </metadata>
    <compatibility>
        <version>7.0</version>
        <version>6.0</version>
        <version>5.0</version>
        <version>4.0</version>
        <version>3.0</version>
        <version>2.73</version>
    </compatibility>
    <updaters disabled="disabled">
    </updaters>
</config>
</file>

<file path="application/core/plugins/oldUrlCompat/oldUrlCompat.php">
<?php
class oldUrlCompat extends PluginBase
{
    protected static $name = 'oldUrlCompat';
    protected static $description = 'Old url (pre-2.0) compatible system';
    public $allowedPublicMethods = array();
    public function init()
    {
        $this->subscribe('afterPluginLoad', 'setUrlCompat');
    }
    public function setUrlCompat()
    {
        if (App()->getController() && App()->getController()->getId() === "surveys" && App()->request->getQuery('sid')) {
            Yii::app()->getController()->forward('survey/index');
        }
    }
}
</file>

<file path="application/core/plugins/PasswordRequirement/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>PasswordRequirement</name>
        <type>plugin</type>
        <plugin_type>core</plugin_type>
        <creationDate>2019-05-21</creationDate>
        <lastUpdate>2022-03-07</lastUpdate>
        <author>LimeSurvey GmbH</author>
        <authorUrl>https://www.limesurvey.org</authorUrl>
        <version>1.1.1</version>
        <license>GNU General Public License version 2 or later</license>
        <description><![CDATA[Core: Password requirement settings]]></description>
    </metadata>
    <compatibility>
        <version>7.0</version>
        <version>6.0</version>
        <version>5.0</version>
        <version>4.0</version>
    </compatibility>
    <updaters disabled="disabled">
    </updaters>
</config>
</file>

<file path="application/core/plugins/PasswordRequirement/PasswordRequirement.php">
<?php
class PasswordRequirement extends \LimeSurvey\PluginManager\PluginBase
{
    protected $storage = 'DbStorage';
    const DEFAULT_NEEDS_NUMBER = true;
    const DEFAULT_NEEDS_UPPERCASE = true;
    const DEFAULT_NEEDS_NON_ALPHANUMERIC = false;
    const DEFAULT_MINIMUM_SIZE = 12;
    const DEFAULT_SURVEY_SAVE_ACTIVE = false;
    const DEFAULT_SURVEY_SAVE_NEEDS_NUMBER = false;
    const DEFAULT_SURVEY_SAVE_NEEDS_UPPERCASE = false;
    const DEFAULT_SURVEY_SAVE_NEEDS_NON_ALPHANUMERIC = false;
    const DEFAULT_SURVEY_SAVE_MINIMUM_SIZE = 8;
    public $allowedPublicMethods = array();
    protected $settings = [
        'adminPart' => array(
            'title' => 'Password requirements for administration login',
            'type' => 'separator',
        ),
        'needsNumber' => array(
            'label' => 'Require at least one digit',
            'type' => 'boolean',
            'default' => self::DEFAULT_NEEDS_NUMBER,
        ),
        'needsUppercase' => array(
            'label' => 'Require at least one uppercase character',
            'type' => 'boolean',
            'default' => self::DEFAULT_NEEDS_UPPERCASE,
        ),
        'needsNonAlphanumeric' => array(
... (187 lines truncated)
</file>

<file path="application/core/plugins/ReactEditor/js/activateEditor.js">
$(document).ready(function () {
    let savedViaSwitch = false;
    const EditorSlider = (function () {
        let slides = [];
        let current = 0;
        let $modal = null;
        function renderSlide(index, animate = true) {
            const slide = slides[index];
            const $title = $modal.find(".editor-slider-title");
            const $image = $modal.find(".editor-slider-image");
            const $desc = $modal.find(".editor-slider-description");
            const $dots = $modal.find(".editor-slider-dot");
            const $infoDefault = $modal.find(".editor-info-default");
            const $infoCustom = $modal.find(".editor-info-custom");
            const FADE_MS = 250;
            const updateContent = () => {
                $title.html(slide.title);
                $image.attr("src", slide.image).attr("alt", slide.title);
                $desc.html(slide.description);
                if (slide.info) {
                    $infoCustom.html(slide.info).removeClass("d-none");
                    $infoDefault.addClass("d-none");
                } else {
                    $infoCustom.empty().addClass("d-none");
                    $infoDefault.removeClass("d-none");
                }
                $dots
                    .removeClass("editor-slider-dot--active")
                    .attr("aria-selected", "false");
                $dots
... (159 lines truncated)
</file>

<file path="application/core/plugins/ReactEditor/views/_modalActivateDeactivateEditor.php">
<?php
$saveUrl = \Yii::app()->createUrl(
    "plugins/direct/plugin/ReactEditor/function/saveActivateDeactivate",
);
$colClassLeft = $hasPathUrlFormat ? 'col-md-5' : 'col-md-6';
$colClassRight = $hasPathUrlFormat ? 'col-md-7' : 'col-md-6 pt-3';
$slidesJson = htmlspecialchars(json_encode($slides), ENT_QUOTES, 'UTF-8');
?>
<!-- Modal to activate/deactivate the react question editor -->
<div id="activate_editor" class="modal fade" role="dialog"
     data-slides="<?= $slidesJson ?>">
    <div class="modal-dialog modal-xl">
        <!-- Modal content-->
        <div class="modal-content">
            <div class="modal-body position-relative p-0">
                <button type="button"
                        class="btn-close position-absolute top-0 end-0 m-3"
                        data-bs-dismiss="modal" aria-label="Close"
                        style="z-index: 1050;"></button> <!-- TODO inline style-->
                <input type="hidden" id="saveUrl" name="saveUrl"
                       value="<?= $saveUrl ?>">
                <input type="hidden" id="successMsgFeatureOptin"
                       value="<?= gT('The new editor was enabled successfully. You can always switch the editor version from your account settings.') ?>">
                <input type="hidden" id="successMsgFeatureOptout"
                       value="<?= gT('The new editor was successfully deactivated.') ?>">
                <input type="hidden" id="errorOnSave"
                       value="<?= gT('An error occurred while saving.') ?>">
                <div class="card">
                    <div class="row g-0">
                        <div class="<?= $colClassLeft ?>">
... (99 lines truncated)
</file>

<file path="application/core/plugins/ReactEditor/autoload.php">
<?php
spl_autoload_register(function ($class) {
    $prefix = 'ReactEditor\\';
    $baseDir = __DIR__ . '/';
    $len = strlen($prefix);
    if (strncmp($prefix, $class, $len) !== 0) {
        return;
    }
    $relativeClass = substr($class, $len);
    $file = $baseDir . str_replace('\\', '/', $relativeClass) . '.php';
    if (file_exists($file)) {
        require $file;
    }
});
</file>

<file path="application/core/plugins/ReactEditor/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>ReactEditor</name>
        <type>plugin</type>
        <plugin_type>core</plugin_type>
        <creationDate>2026-01-26</creationDate>
        <lastUpdate>2026-01-26</lastUpdate>
        <author>LimeSurvey GmbH</author>
        <authorUrl>https://www.limesurvey.org</authorUrl>
        <version>1.0.0</version>
        <license>GNU General Public License version 2 or later</license>
        <description><![CDATA[Core: Activate Editor]]></description>
    </metadata>
    <compatibility>
        <version>7.0</version>
        <version>6.0</version>
    </compatibility>
    <updaters>
    </updaters>
</config>
</file>

<file path="application/core/plugins/ReactEditor/EditorMessages.php">
<?php
namespace ReactEditor;
class EditorMessages
{
    public static function getUrlFormatRequirementHeader()
    {
        return gT(
            'Action needed'
        );
    }
    public static function getUrlFormatRequirementMessage()
    {
        $manualUrl = 'https://www.limesurvey.org/manual/LimeSurvey_7_Question_Editor#Switching_URL_format_from_%22get%22_to_%22path%22_to_enable_the_new_editor_in_LimeSurvey_7';
        $manualLink = '<a class="link-info" href="' . $manualUrl . '" target="_blank" rel="noopener noreferrer">'
            . gT('LimeSurvey 7 question editor')
            . '</a>';
        return sprintf(
            gT('In order to activate the new editor you or your administrator need to set up the application to use "path" as the URL format. For more information, see %s.'),
            $manualLink
        );
    }
}
</file>

<file path="application/core/plugins/ReactEditor/EditorSlides.php">
<?php
namespace ReactEditor;
class EditorSlides
{
    public static function getSlides(): array
    {
        $baseUrl = \Yii::app()->baseUrl;
        return [
            [
                'image'       => $baseUrl . '/assets/images/new_editor_image.png',
                'title'       => gT('Easy survey building'),
                'description' => gT(
                    'Create and organize questions effortlessly, and create a survey in minutes.'
                ),
            ],
        ];
    }
}
</file>

<file path="application/core/plugins/ReactEditor/ReactEditor.php">
<?php
use LimeSurvey\Models\Services\EditorService;
use ReactEditor\EditorMessages;
use ReactEditor\EditorSlides;
require_once(__DIR__ . '/autoload.php');
class ReactEditor extends \PluginBase
{
    const STG_NAME_REACT_EDITOR = "editorEnabled";
    protected $storage = 'DbStorage';
    protected static $description = 'Activate/deactivate the new react editor';
    protected static $name = 'ReactEditor';
    public $allowedPublicMethods = array();
    public function init()
    {
        $this->subscribe('afterSuccessfulLogin', 'createUniqueWrongUrlFormatNotification');
        $this->subscribe('newDirectRequest');
        $this->subscribe('beforeDeactivate');
        $this->subscribe('beforeControllerAction', 'initEditor');
        $this->subscribe('beforeControllerAction', 'renderActivateEditorModal');
        $this->subscribe('beforeControllerAction', 'redirectToDifferentCreateSurveyRoute');
        $this->subscribe('beforeRenderSurveySidemenu');
        $this->subscribe('beforeAdminMenuRender');
        $this->subscribe('beforeSurveyAdminView');
    }
    public function beforeDeactivate()
    {
        $this->getEvent()->set('success', false);
        $this->getEvent()->set('message', gT('Core plugin can not be disabled.'));
    }
    public function initEditor()
... (194 lines truncated)
</file>

<file path="application/core/plugins/statFunctions/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>statFunctions</name>
        <type>plugin</type>
        <creationDate>2019-09-19</creationDate>
        <last_update>2022-09-30</last_update>
        <author>Denis Chenu</author>
        <authorUrl>https://www.limesurvey.org</authorUrl>
        <version>0.2.1</version>
        <license>GNU General Public License version 2 or later</license>
        <description><![CDATA[New function for expression manager to count some statistics data : <ul>
            <li>statCountIf(QuestionCode.sgqa, value[, submitted = true][, self = true])</li>
            <li>statCount(QuestionCode.sgqa[, submitted = true][, self = true])</li>
            </ul>
]]></description>
    </metadata>
    <compatibility>
        <version>7.0</version>
        <version>6.0</version>
        <version>5.0</version>
        <version>4.0</version>
    </compatibility>
    <updaters disabled="disabled">
    </updaters>
</config>
</file>

<file path="application/core/plugins/statFunctions/countFunctions.php">
<?php
namespace statFunctions;
use Yii;
use CHtml;
use LimeExpressionManager;
use Survey;
use SurveyDynamic;
use CDbCriteria;
use Permission;
use LimeSurvey\PluginManager\LimesurveyApi as LimesurveyApi;
class countFunctions
{
    public static function statCountIf($qCode, $comparison, $submitted = true, $self = true)
    {
        $api = new LimesurveyApi();
        $surveyId = $api->getCurrentSurveyid(true);
        if (!$surveyId) {
            return 0;
        }
        $questionCodeHelper = new \statFunctions\questionCodeHelper($surveyId);
        $column = $questionCodeHelper->getColumnByQCode($qCode);
        if (is_null($column)) {
            if (Permission::model()->hasSurveyPermission($surveyId, 'surveycontent')) {
                return sprintf(gT("Invalid question code %s"), CHtml::encode($qCode));
            }
            return "";
        }
        $sQuotedColumn = Yii::app()->db->quoteColumnName($column);
        $oCriteria = new CDbCriteria();
        $oCriteria->condition = "$sQuotedColumn IS NOT NULL";
... (42 lines truncated)
</file>

<file path="application/core/plugins/statFunctions/questionCodeHelper.php">
<?php
namespace statFunctions;
use Yii;
use Survey;
use SurveyDynamic;
use CDbCriteria;
class questionCodeHelper
{
    public $surveyId = 0;
    public function __construct($surveyId)
    {
        $this->surveyId = $surveyId;
    }
    public function getColumnByQCode($qCode)
    {
        $availableColumns = SurveyDynamic::model($this->surveyId)->getAttributes();
        if (array_key_exists($qCode, $availableColumns)) {
            return $qCode;
        }
        return null;
    }
}
</file>

<file path="application/core/plugins/statFunctions/statFunctions.php">
<?php
class statFunctions extends PluginBase
{
    protected static $description = 'Add some function in ExpressionScript Engine to get count from other responses';
    protected static $name = 'statCountFunctions';
    public $allowedPublicMethods = array();
    public function init()
    {
        $this->subscribe('ExpressionManagerStart', 'newValidFunctions');
    }
    public function newValidFunctions()
    {
        Yii::setPathOfAlias(get_class($this), dirname(__FILE__));
        $newFunctions = array(
            'statCountIf' => array(
                '\statFunctions\countFunctions::statCountIf',
                null,
                $this->gT("Count the number of complete responses  with a value equal to a specific value"),
                'integer statCountIf(QuestionCode.sgqa, value[, submitted = true][, self = true])',
                'https://www.limesurvey.org/manual/StatFunctions',
                2, 3, 4
            ),
            'statCount' => array(
                '\statFunctions\countFunctions::statCount',
                null,
                $this->gT("Count the number of complete responses which are not empty"),
                'integer statCount(QuestionCode.sgqa[, submitted = true][, self = true])',
                'https://www.limesurvey.org/manual/StatFunctions',
                1, 2, 3
            ),
... (5 lines truncated)
</file>

<file path="application/core/plugins/TwoFactorAdminLogin/helper/phpqrcode.php">
<?php
    define('QR_MODE_NUL', -1);
    define('QR_MODE_NUM', 0);
    define('QR_MODE_AN', 1);
    define('QR_MODE_8', 2);
    define('QR_MODE_KANJI', 3);
    define('QR_MODE_STRUCTURE', 4);
    define('QR_ECLEVEL_L', 0);
    define('QR_ECLEVEL_M', 1);
    define('QR_ECLEVEL_Q', 2);
    define('QR_ECLEVEL_H', 3);
    define('QR_FORMAT_TEXT', 0);
    define('QR_FORMAT_PNG', 1);
class qrstr
{
    public static function set(&$srctab, $x, $y, $repl, $replLen = false)
    {
        $srctab[$y] = substr_replace((string) $srctab[$y], ($replLen !== false) ? substr((string) $repl, 0, $replLen) : $repl, $x, ($replLen !== false) ? $replLen : strlen((string) $repl));
    }
}
    define('QR_CACHEABLE', false);
    define('QR_CACHE_DIR', false);
    define('QR_LOG_DIR', false);
    define('QR_FIND_BEST_MASK', true);
    define('QR_FIND_FROM_RANDOM', 2);
    define('QR_DEFAULT_MASK', 2);
    define('QR_PNG_MAXIMUM_SIZE', 1024);
class QRtools
{
    public static $frames;
... (2578 lines truncated)
</file>

<file path="application/core/plugins/TwoFactorAdminLogin/helper/TFAHelper.php">
<?php
class TFAHelper
{
    public static function isPluginActive()
    {
        $plugin = Plugin::model()->findByAttributes(["name" => "TwoFactorAdminLogin"]);
        if ($plugin) {
            return (int)$plugin->active;
        } else {
            return 0;
        }
    }
}
</file>

<file path="application/core/plugins/TwoFactorAdminLogin/helper/TFAMenuClass.php">
<?php
class TFAMenuClass extends \LimeSurvey\Menu\Menu
{
    public function getLabel()
    {
        return "<i class='" . $this->iconClass . "'></i>&nbsp;" . $this->label;
    }
}
</file>

<file path="application/core/plugins/TwoFactorAdminLogin/helper/TFAQrCodeGenerator.php">
<?php
require_once(__DIR__ . '/phpqrcode.php');
class TFAQrCodeGenerator implements RobThree\Auth\Providers\Qr\IQRCodeProvider
{
    public function getMimeType(): string
    {
        return 'image/png';
    }
    public function getQRCodeImage(string $qrtext, int $size): string
    {
        ob_start();
        QRCode::png($qrtext, null, QR_ECLEVEL_L, 3, 4);
        $result = ob_get_contents();
        ob_end_clean();
        return $result;
    }
    public function getQRCodeSvg($qrtext, $width = null, $htmlId = false, $compress = false)
    {
        return QRCode::svg($qrtext, $htmlId, false, QR_ECLEVEL_L, $width, 3, 4, $compress);
    }
}
</file>

<file path="application/core/plugins/TwoFactorAdminLogin/helper/TFAYubikeyOtpHelper.php">
<?php
class TFAYubikeyOtpHelper
{
    private $otpCode;
    private $clientId;
    private $clientSecret;
    private $lastError = "";
    /** @var bool If true, already seen OTPs will not be rejected. */
    private $allowReplayedOtp = false;
    /**
     * @param string $otpCode   The full Yubikey OTP code
     * @param string $clientId  The client ID. If not set, the test mode ID will be used.
     * @param string $clientSecret  The client secret. The request won't be signed and the response signature won't be verified.
     */
    function __construct($otpCode, $clientId = null, $clientSecret = null)
    {
        $this->otpCode = trim($otpCode);
        $this->clientId = !empty($clientId) ? $clientId : 1;
        $this->clientSecret = $clientSecret;
    }
    /**
     * Returns the public ID part of the OTP code (in modhex format)
     * @return string
     */
    public function getPublicId()
    {
        if (strlen($this->otpCode) !== 44) {
            $this->setLastError(gT("Yubikey OTP code must be 44 characters long."));
            return null;
        }
... (154 lines truncated)
</file>

<file path="application/core/plugins/TwoFactorAdminLogin/installer/TFAPluginInstaller.php">
<?php
class TFAPluginInstaller
{
    public static $instance = null;
    private $errors = [];
    public static function instance()
    {
        if (self::$instance == null) {
            self::$instance = new TFAPluginInstaller();
        }
        return self::$instance;
    }
    public function install()
    {
        try {
            $this->installTables();
        } catch (CHttpException $e) {
            $this->errors[] = $e;
        }
        if (count($this->errors) > 0) {
            throw new CHttpException(500, join(",\n", array_map(function ($oError) {
                return $oError->getMessage();
            }, $this->errors)));
        }
    }
    public function uninstall()
    {
        try {
            $this->uninstallTables();
        } catch (CHttpException $e) {
... (42 lines truncated)
</file>

<file path="application/core/plugins/TwoFactorAdminLogin/models/TFAUser.php">
<?php
class TFAUser extends User
{
    public function attributeLabels()
    {
        return [
            'authType' => gT('Two-factor authentication method'),
            'secretKey' => gT('Secret base key'),
            'uid' => gT('User ID'),
            'firstLogin' => gT('Logged in with 2FA'),
            'forceNewFirstLogin' => gT('Force to enable 2FA')
        ];
    }
    public static function model($className = __CLASS__)
    {
        $model = parent::model($className);
        return $model;
    }
    public function relations()
    {
        return array(
            'userkeys'  => array(self::HAS_ONE, 'TFAUserKey', array('uid')),
        );
    }
    public function rules()
    {
        $rules = parent::rules();
        $rules[] = ['users_name', 'safe', 'on' => 'search'];
        $rules[] = ['email', 'safe', 'on' => 'search'];
        $rules[] = ['full_name', 'safe', 'on' => 'search'];
... (135 lines truncated)
</file>

<file path="application/core/plugins/TwoFactorAdminLogin/models/TFAUserKey.php">
<?php
class TFAUserKey extends LSActiveRecord
{
    public static $authTypeOptions = [
        'totp' => 'TOTP (Google Authenticator, Authy, etc.)',
        'yubi' => 'YubiKey OTP',
    ];
    public function tableName()
    {
        return '{{user_mfa_settings}}';
    }
    public function primaryKey()
    {
        return 'uid';
    }
    public function attributeLabels()
    {
        return [
            'authType' => gT('Two-factor authentication method'),
            'secretKey' => gT('Secret base key'),
            'uid' => gT('User ID'),
            'firstLogin' => gT('Logged in with 2FA'),
            'forceNewFirstLogin' => gT('Force to enable 2FA')
        ];
    }
    public static function model($className = __CLASS__)
    {
        $model = parent::model($className);
        return $model;
    }
... (92 lines truncated)
</file>

<file path="application/core/plugins/TwoFactorAdminLogin/views/_partial/create.php">
<?= TbHtml::formTb(
    null,
    App()->createUrl(
        'plugins/direct',
        ['plugin' => 'TwoFactorAdminLogin', 'function' => 'directCallConfirmKey']
    ),
    'post',
    ["id" => "TFA--modalform"]
) ?>
<div class="modal-header">
    <h5 class="modal-title"><?= gT('Register 2FA Method'); ?></h5>
</div>
<div class="modal-body">
    <div class="row">
        <div class="errorContainer alert alert-danger" style="display: none"></div>
    </div>
    <?php echo TbHtml::activeHiddenField($model, 'uid'); ?>
    <div class="mb-3">
        <?php echo TbHtml::activeLabel($model, 'authType', ['class' => 'form-label']); ?>
        <?php echo TbHtml::activeDropDownList($model, 'authType', TFAUserKey::$authTypeOptions, [
            'required' => true,
            'class'    => 'form-select'
        ]); ?>
    </div>
    <div id="totpSection">
        <div class="mb-3">
            <?php echo TbHtml::activeLabel($model, 'secretKey', ['class' => 'form-label']); ?>
            <?php echo TbHtml::activeTextField($model, 'secretKey', ['readonly' => true]); ?>
        </div>
        <div class="mb-3">
... (23 lines truncated)
</file>

<file path="application/core/plugins/TwoFactorAdminLogin/views/_partial/error.php">
<?php
?>
<div class="modal-header">
    <?= gT('Error') ?>
</div>
<div class="modal-body">
    <div class="row">
        <div class="col-12 text-center">
            <div class="cross_mark">
                <div class="sa-icon sa-error animate">
                    <span class="sa-line sa-tip animateerrorTip"></span>
                    <span class="sa-line sa-long animateerrorLong"></span>
                    <div class="sa-placeholder"></div>
                    <div class="sa-fix"></div>
                </div>
            </div>
        </div>
    </div>
    <div class="row ls-space margin top-15 bottom-15">
        <?php foreach ($errors as $error) {
            echo "<pre>" . print_r($error, true) . "</pre>";
        }
        ?>
    </div>
</div>
<div class="modal-footer">
    <button id="exitForm" class="btn btn-cancel" data-bs-dismiss="modal">
        <?= gT('Close') ?>
    </button>
</div>
... (1 lines truncated)
</file>

<file path="application/core/plugins/TwoFactorAdminLogin/views/_partial/unset.php">

</file>

<file path="application/core/plugins/TwoFactorAdminLogin/views/index.php">
<?php
echo viewHelper::getViewTestTag('2faUsersIndex');
?>
<?php if (!Permission::model()->hasGlobalPermission('users', 'update')) :?>
<div class="row">
    <div class="col-12">
        <h2><?=gT("No permission")?></h2>
    </div>
</div>
    <?php App()->end();?>
<?php endif; ?>
<?php
    App()->getClientScript()->registerScript('TFA-Management-wrap', 'window.TFA = window.TFA || new TFAUserManagementClass();', LSYii_ClientScript::POS_BEGIN);
?>
<div class="h1 pagetitle">
    2-Factor-Authentication | User management
</div>
<?php if (Permission::model()->hasGlobalPermission('superadmin', 'read')) : ?>
    <?php
    $this->widget('application.extensions.admin.grid.CLSGridView', [
        'id'              => 'tfa-usermanagement-gridPanel',
        'itemsCssClass'   => 'table table-striped items',
        'dataProvider'    => $model->search(),
        'columns'         => $model->getColumns(),
        'filter'          => $model,
        'afterAjaxUpdate' => 'window.TFA.bind',
        'summaryText'     => "<div class='row'>"
            . "<div class='col-6'></div>"
            . "<div class='col-6'>"
            . gT('Displaying {start}-{end} of {count} result(s).') . ' '
... (23 lines truncated)
</file>

<file path="application/core/plugins/TwoFactorAdminLogin/views/userindex.php">
<?php
echo viewHelper::getViewTestTag('2faUsersIndex');
?>
<?php
    App()->getClientScript()->registerScript('TFA-User-wrap', 'window.TFAUser = window.TFAUser || new TFAUserSettingsClass();', LSYii_ClientScript::POS_BEGIN);
?>
    <div class="h1 pagetitle">
    <?=gT("Two-factor authentication (2FA)");?>
    </div>
    <?php if ($oTFAModel == null) { ?>
    <div class="jumbotron">
        <div class="col-12">
            <h2>
            <?=gT("You don't have two-factor authentication (2FA) activated.");?> <br/>
                <?=($force2FA > 1 ? gT("Please activate it now.") : gT("Do you want to activate it now?"))?>
            </h2>
            <p>
                <a role="button" class="btn btn-outline-secondary TFA--actionopenmodal TFA--excludefromlock" data-href="<?=App()->createUrl("plugins/direct/plugin/TwoFactorAdminLogin/function/directCallCreateNewKey")?>" data-bs-toggle="modal" id="TFA--register2fa">
                    <?=gT("Activate 2FA now");?>
                </a>
            <?php if ($force2FA < 2) { ?>
                <a role="button" class="btn btn-danger TFA--excludefromlock" href="<?=App()->createUrl("admin")?>" id="TFA--excludeNotNow">
                    <?=gT("Not now");?>
                </a>
            <?php } ?>
            </p>
        </div>
    </div>
    <?php } else { ?>
    <div class="col-12">
... (36 lines truncated)
</file>

<file path="application/core/plugins/TwoFactorAdminLogin/composer.json">
{
    "require": {
        "robthree/twofactorauth": "^2.0"
    }
}
</file>

<file path="application/core/plugins/TwoFactorAdminLogin/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>TwoFactorAdminLogin</name>
        <type>plugin</type>
        <creationDate>2019-03-10</creationDate>
        <lastUpdate>2025-03-14</lastUpdate>
        <author>LimeSurvey GmbH</author>
        <authorUrl>https://www.limesurvey.org</authorUrl>
        <version>1.3.0</version>
        <license>GNU General Public License version 2 or later</license>
        <description><![CDATA[Use a TOTP based 2 factor authentication on logging in into the admin portal.]]></description>
        <supportUrl>https://www.limesurvey.org</supportUrl>
    </metadata>
    <compatibility>
        <version>7.0</version>
        <version>6.0</version>
        <version>5.0</version>
        <version>4.0</version>
 	    <version>3.0</version>
    </compatibility>
    <updaters disabled="disabled">
        <updater>
            <stable>1</stable>
            <type>rest</type>
            <source>https://comfortupdate.limesurvey.org/index.php?r=limestorerest</source>
        </updater>
    </updaters>
</config>
</file>

<file path="application/core/plugins/TwoFactorAdminLogin/index.html">
<html>
<head>
	<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
</file>

<file path="application/core/plugins/TwoFactorAdminLogin/TwoFactorAdminLogin.php">
<?php
require_once(__DIR__ . '/vendor/autoload.php');
spl_autoload_register(function ($class_name) {
    if (preg_match("/^TFA.*/", $class_name)) {
        if (file_exists(__DIR__ . DIRECTORY_SEPARATOR . 'models' . DIRECTORY_SEPARATOR . $class_name . '.php')) {
            include __DIR__ . DIRECTORY_SEPARATOR . 'models' . DIRECTORY_SEPARATOR . $class_name . '.php';
        } elseif (file_exists(__DIR__ . DIRECTORY_SEPARATOR . 'helper' . DIRECTORY_SEPARATOR . $class_name . '.php')) {
            include __DIR__ . DIRECTORY_SEPARATOR . 'helper' . DIRECTORY_SEPARATOR . $class_name . '.php';
        } elseif (file_exists(__DIR__ . DIRECTORY_SEPARATOR . 'installer' . DIRECTORY_SEPARATOR . $class_name . '.php')) {
            include __DIR__ . DIRECTORY_SEPARATOR . 'installer' . DIRECTORY_SEPARATOR . $class_name . '.php';
        }
    }
});
class TwoFactorAdminLogin extends AuthPluginBase
{
    protected static $description = 'Add two-factor authentication to your admin login';
    protected static $name = 'TwoFactorAdminLogin';
    private $o2FA = null;
    public $allowedPublicMethods = [
        'userindex',
        'index'
    ];
    private $allowedDirectMethods = [
        'directCallCreateNewKey',
        'directCallConfirmKey',
        'directCallDeleteKey',
    ];
    private $writeDirectMethods = [
        'directCallConfirmKey',
        'directCallDeleteKey',
... (440 lines truncated)
</file>

<file path="application/core/plugins/UpdateCheck/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>UpdateCheck</name>
        <type>plugin</type>
        <creationDate>2018-10-04</creationDate>
        <lastUpdate>2018-10-04</lastUpdate>
        <author>LimeSurvey GmbH</author>
        <authorUrl>https://www.limesurvey.org</authorUrl>
        <version>1.0.0</version>
        <license>GNU General Public License version 2 or later</license>
        <description><![CDATA[Use the ExtensionLibrary to check for extension updates.]]></description>
    </metadata>
    <compatibility>
        <version>7.0</version>
        <version>6.0</version>
        <version>5.0</version>
        <version>4.0</version>
    </compatibility>
    <updaters>
    </updaters>
</config>
</file>

<file path="application/core/plugins/UpdateCheck/UpdateCheck.php">
<?php
use LimeSurvey\Menu\Menu;
class UpdateCheck extends PluginBase
{
    protected $storage = 'DbStorage';
    public $allowedPublicMethods = array('checkAll');
    public function init()
    {
        $this->subscribe('afterSuccessfulLogin');
        $this->subscribe('beforeControllerAction');
        $this->subscribe('beforePluginManagerMenuRender');
    }
    public function afterSuccessfulLogin()
    {
        if (Permission::model()->hasGlobalPermission('superadmin')) {
            $value = $this->get('next_extension_update_check');
            $nextCheck = $value ? new DateTime($value) : new DateTime();
            $today = new DateTime("now");
            if ($nextCheck <= $today) {
                Yii::app()->session['do_extensions_update_check'] = true;
            }
        }
    }
    public function beforeControllerAction()
    {
        $controller = $this->getEvent()->get('controller');
        $doUpdateCheckFlag = Yii::app()->session['do_extensions_update_check'];
        if ($controller == 'admin' && $doUpdateCheckFlag) {
            $this->spitOutUrl();
            $this->registerMyScript();
... (122 lines truncated)
</file>

<file path="application/core/QuestionTypes/5PointChoice/DataSetFivePointChoice.php">
<?php
class DataSetFivePointChoice extends QuestionBaseDataSet
{
}
</file>

<file path="application/core/QuestionTypes/5PointChoice/RenderFivePointChoice.php">
<?php
class RenderFivePointChoice extends QuestionBaseRenderer
{
    protected $aPackages = [];
    protected $aScripts = [];
    public function getMainView()
    {
        return '/survey/questions/answer/5pointchoice/answer';
    }
    public function getRows()
    {
        $aRows = [];
        for ($fp = 1; $fp <= 5; $fp++) {
            $aRows[] = array(
                'name'                   => $this->sSGQA,
                'value'                  => $fp,
                'id'                     => $this->sSGQA . $fp,
                'labelText'              => $fp,
                'itemExtraClass'         => '',
                'checkedState'           => ($this->mSessionValue == $fp ? ' CHECKED ' : ''),
                'checkconditionFunction' => $this->checkconditionFunction,
                );
        }
        if ($this->oQuestion->mandatory != "Y" && SHOW_NO_ANSWER == 1) {
            $aRows[] = array(
                'name'                   => $this->sSGQA,
                'value'                  => "",
                'id'                     => $this->sSGQA,
                'labelText'              => gT('No answer'),
                'itemExtraClass'         => 'noanswer-item',
... (51 lines truncated)
</file>

<file path="application/core/QuestionTypes/Array10ChoiceQuestions/DataSetArray10ChoiceQuestion.php">
<?php
class DataSetArray10ChoiceQuestion extends QuestionBaseDataSet
{
}
</file>

<file path="application/core/QuestionTypes/Array10ChoiceQuestions/RenderArray10ChoiceQuestion.php">
<?php
class RenderArray10ChoiceQuestion extends QuestionBaseRenderer
{
    public function getMainView()
    {
        return '/survey/questions/answer/arrays/10point';
    }
    public function getRows()
    {
        return;
    }
    public function render($sCoreClasses = '')
    {
        $this->registerAssets();
        $aLastMoveResult = LimeExpressionManager::GetLastMoveResult();
        $sMandatory = $this->aFieldArray[6];
        $aMandatoryViolationSubQ = ($aLastMoveResult['mandViolation'] && ($sMandatory == 'Y' || $sMandatory == 'S')) ? explode("|", (string) $aLastMoveResult['unansweredSQs']) : [];
        $coreClass = "ls-answers subquestion-list questions-list radio-array";
        if (ctype_digit(trim((string) $this->getQuestionAttribute('answer_width')))) {
            $answerwidth = trim((string) $this->getQuestionAttribute('answer_width'));
        } else {
            $answerwidth = 33;
        }
        $bShowNoAnswerColumn = ($sMandatory != 'Y' && $sMandatory != 'S') && SHOW_NO_ANSWER == 1;
        $cellwidth = 10;
        if ($bShowNoAnswerColumn) {
            ++$cellwidth;
        }
        $cellwidth = round(((100 - $answerwidth) / $cellwidth), 1);
        $iSurveyId = $this->oQuestion->sid;
... (156 lines truncated)
</file>

<file path="application/core/QuestionTypes/Array5ChoiceQuestions/DataSetArray5ChoiceQuestion.php">
<?php
class DataSetArray5ChoiceQuestion extends QuestionBaseDataSet
{
}
</file>

<file path="application/core/QuestionTypes/Array5ChoiceQuestions/RenderArray5ChoiceQuestion.php">
<?php
class RenderArray5ChoiceQuestion extends QuestionBaseRenderer
{
    private $sCheckconditionFunction = "checkconditions";
    private $bShowNoAnswer = false;
    public function getMainView()
    {
        return '/survey/questions/answer/arrays/5point';
    }
    public function getRows()
    {
        return;
    }
    public function render($sCoreClasses = '')
    {
        $this->registerAssets();
        $aLastMoveResult         = LimeExpressionManager::GetLastMoveResult();
        $sMandatory              = $this->aFieldArray[6];
        $aMandatoryViolationSubQ = ($aLastMoveResult['mandViolation'] && ($sMandatory == 'Y' || $sMandatory == 'S')) ? explode("|", (string) $aLastMoveResult['unansweredSQs']) : [];
        $coreClass               = "ls-answers subquestion-list questions-list radio-array";
        $inputnames              = [];
        if (trim((string) $this->getQuestionAttribute('answer_width')) != '') {
            $answerwidth = $this->getQuestionAttribute('answer_width');
            $defaultWidth = false;
        } else {
            $answerwidth = 33;
            $defaultWidth = true;
        }
        $columnswidth = 100 - $answerwidth;
        $colCount = 5;
... (182 lines truncated)
</file>

<file path="application/core/QuestionTypes/ArrayFlexibleColumn/DataSetArrayFlexibleColumn.php">
<?php
class DataSetArrayFlexibleColumn extends QuestionBaseDataSet
{
}
</file>

<file path="application/core/QuestionTypes/ArrayFlexibleColumn/RendererArrayFlexibleColumn.php">
<?php
class RendererArrayFlexibleColumn extends QuestionBaseRenderer
{
    public function getMainView()
    {
        return '/survey/questions/answer/arrays/column/answer';
    }
    public function getRows()
    {
        return;
    }
    public function render($sCoreClasses = '')
    {
        $this->registerAssets();
        $aLastMoveResult = LimeExpressionManager::GetLastMoveResult();
        $YorNorSvalue = $this->aFieldArray[6];
        $isYes = ($YorNorSvalue == 'Y');
        $isS   = ($YorNorSvalue == 'S');
        if ($aLastMoveResult['mandViolation'] && ($isYes || $isS)) {
            $aMandatoryViolationSubQ = explode('|', (string) $aLastMoveResult['unansweredSQs']);
        } else {
            $aMandatoryViolationSubQ = [];
        }
        $coreClass = "ls-answers subquestion-list questions-list array-radio";
        $checkconditionFunction = "checkconditions";
        $sSessionKey = 'responses_' . Yii::app()->getConfig('surveyID');
        $sSurveyLanguage = $_SESSION[$sSessionKey]['s_lang'];
        $aAnswers = Answer::model()->findAll(array('order' => 'sortorder, code', 'condition' => 'qid=:qid AND scale_id=0', 'params' => array(':qid' => $this->oQuestion->qid)));
        $labelans = [];
        $labelcode = [];
... (102 lines truncated)
</file>

<file path="application/core/QuestionTypes/ArrayFlexibleRow/DataSetArrayFlexibleRow.php">
<?php
class DataSetArrayFlexibleRow extends QuestionBaseDataSet
{
}
</file>

<file path="application/core/QuestionTypes/ArrayFlexibleRow/RenderArrayFlexibleRow.php">
<?php
class RenderArrayFlexibleRow extends QuestionBaseRenderer
{
    private $aMandatoryViolationSubQ;
    private $repeatheadings;
    private $minrepeatheadings;
    private $defaultWidth;
    private $columnswidth;
    private $answerwidth;
    private $cellwidth;
    private $sHeaders = '';
    private $sRepeatHeaders = '';
    private $rightExists;
    private $bUseDropdownLayout = false;
    private $inputnames = [];
    public $sCoreClass = "ls-answers subquestion-list questions-list";
    public function __construct($aFieldArray, $bRenderDirect = false)
    {
        parent::__construct($aFieldArray, $bRenderDirect);
        $aLastMoveResult         = LimeExpressionManager::GetLastMoveResult();
        $this->aMandatoryViolationSubQ = ($aLastMoveResult['mandViolation'] && $this->oQuestion->mandatory == 'Y') ? explode("|", (string) $aLastMoveResult['unansweredSQs']) : [];
        $this->repeatheadings    = Yii::app()->getConfig("repeatheadings");
        $this->minrepeatheadings = Yii::app()->getConfig("minrepeatheadings");
        if (ctype_digit((string) $this->repeatheadings) && !empty($this->repeatheadings)) {
            $this->repeatheadings    = intval($this->getQuestionAttribute('repeat_headings'));
            $this->minrepeatheadings = 0;
        }
        if ($this->getQuestionAttribute('use_dropdown') == 1) {
            $this->bUseDropdownLayout = true;
            $this->sCoreClass .= " dropdown-array";
... (288 lines truncated)
</file>

<file path="application/core/QuestionTypes/ArrayMultiFlexNumbers/DataSetArrayMultiFlexNumbers.php">
<?php
class DataSetArrayMultiFlexNumbers extends QuestionBaseDataSet
{
}
</file>

<file path="application/core/QuestionTypes/ArrayMultiFlexNumbers/RenderArrayMultiFlexNumbers.php">
<?php
class RenderArrayMultiFlexNumbers extends QuestionBaseRenderer
{
    private $sSurveyLanguage = '';
    /** @var string Radix point separator of the survey number format */
    private $sSeparator = '.';
    /** @var string[] Field names of the subquestions violating the mandatory rule on last move */
    private $aMandatoryViolationSubQ = [];
    /** @var mixed Repeat the headings every x rows (null or <= 0: never) */
    private $repeatheadings;
    /** @var mixed Minimum number of remaining rows needed to repeat the headings */
    private $minrepeatheadings;
    /** @var string Classes of the answer container */
    private $coreClass = "ls-answers subquestion-list questions-list";
    /** @var string Classes of each answer row */
    private $coreRowClass = "subquestion-list questions-list";
    /** @var string Extra classes of the inputs */
    private $extraclass = "";
    /** @var string Classes of each answer item */
    private $answertypeclass = "";
    /** @var string Javascript function called on input change */
    private $sCheckconditionFunction = "fixnum_checkconditions";
    /** @var mixed Minimum value of the dropdown (or first value if reversed) */
    private $minvalue = 1;
    /** @var mixed Maximum value of the dropdown (or last value if reversed) */
    private $maxvalue = 10;
    /** @var mixed Step of the dropdown values, negative if reversed */
    private $stepvalue = 1;
    /** @var bool Whether the dropdown values are reversed */
    private $reverse = false;
... (348 lines truncated)
</file>

<file path="application/core/QuestionTypes/ArrayMultiFlexText/DataSetArrayMultiFlexText.php">
<?php
class DataSetArrayMultiFlexText extends QuestionBaseDataSet
{
}
</file>

<file path="application/core/QuestionTypes/ArrayMultiFlexText/RenderArrayMultiFlexText.php">
<?php
class RenderArrayMultiFlexText extends QuestionBaseRenderer
{
    private $sSurveyLanguage = '';
    /** @var string Radix point separator of the survey number format */
    private $sSeparator = '.';
    /** @var string[] Field names of the subquestions violating the mandatory rule on last move */
    private $aMandatoryViolationSubQ = [];
    /** @var mixed Repeat the headings every x rows (null or <= 0: never) */
    private $repeatheadings;
    /** @var mixed Minimum number of remaining rows needed to repeat the headings */
    private $minrepeatheadings;
    /** @var string Classes of the answer container */
    private $coreClass = "ls-answers subquestion-list questions-list text-array";
    /** @var string Extra classes of the answer table */
    private $extraclass = "";
    /** @var string Classes of each answer row */
    private $coreRowClass = "subquestion-list questions-list";
    /** @var string Javascript function called on input change */
    private $sCheckconditionFunction = "checkconditions";
    /** @var mixed Value of the show_grand_total attribute, forced to true when totals are shown */
    private $showGrand;
    /** @var string Classes added to the table when totals are shown */
    private $totalsClass = '';
    /** @var string Totals mode : '', 'rowTotals', 'col' or 'both' */
    private $showTotals = '';
    /** @var string Rendered column total cell template */
    private $colTotal = '';
    /** @var string Rendered row total cell template */
    private $rowTotal = '';
... (362 lines truncated)
</file>

<file path="application/core/QuestionTypes/ArrayMultiscale/DataSetArrayMultiscale.php">
<?php
class DataSetArrayMultiscale extends QuestionBaseDataSet
{
}
</file>

<file path="application/core/QuestionTypes/ArrayMultiscale/RenderArrayMultiscale.php">
<?php
class RenderArrayMultiscale extends QuestionBaseRenderer
{
    protected $aLabels;
    protected $numrows;
    protected $aMandatoryViolationSubQ;
    protected $useDropdownLayout;
    protected $answertypeclass;
    protected $answerwidth;
    protected $defaultWidth;
    protected $doDualScaleFunction;
    protected $inputnames;
    public function __construct($aFieldArray, $bRenderDirect = false)
    {
        parent::__construct($aFieldArray, $bRenderDirect = false);
        if ($this->getQuestionAttribute('use_dropdown') == 1) {
            $this->useDropdownLayout = true;
            $this->sCoreClass .= " dropdown-array";
            $this->answertypeclass .= " dropdown";
            $this->doDualScaleFunction = "doDualScaleDropDown";
        } else {
            $this->useDropdownLayout = false;
            $this->sCoreClass .= " radio-array";
            $this->answertypeclass .= " radio";
            $this->doDualScaleFunction = "doDualScaleRadio";
        }
        if (ctype_digit(trim((string) $this->getQuestionAttribute('answer_width')))) {
            $this->answerwidth = trim((string) $this->getQuestionAttribute('answer_width'));
            $this->defaultWidth = false;
        } else {
... (338 lines truncated)
</file>

<file path="application/core/QuestionTypes/ArrayOfIncSameDecQuestions/DataSetArrayOfIncSameDecQuestions.php">
<?php
class DataSetArrayOfIncSameDecQuestions extends QuestionBaseDataSet
{
}
</file>

<file path="application/core/QuestionTypes/ArrayOfIncSameDecQuestions/RenderArrayOfIncSameDecQuestions.php">
<?php
class RenderArrayOfIncSameDecQuestions extends QuestionBaseRenderer
{
    public $sCoreClass = "ls-answers subquestion-list questions-list radio-array";
    public function getMainView()
    {
        return '/survey/questions/answer/arrays/increasesamedecrease/answer';
    }
    public function getRows()
    {
        return;
    }
    public function render($sCoreClasses = '')
    {
        $aLastMoveResult         = LimeExpressionManager::GetLastMoveResult();
        $aMandatoryViolationSubQ = ($aLastMoveResult['mandViolation'] && $this->isMandatory())
            ? explode("|", (string) $aLastMoveResult['unansweredSQs'])
            : [];
        if (ctype_digit(trim((string) $this->getQuestionAttribute('answer_width')))) {
            $answerwidth = trim((string) $this->getQuestionAttribute('answer_width'));
        } else {
            $answerwidth = 33;
        }
        $cellwidth = 3;
        if ($this->showNoAnswer()) {
            ++$cellwidth;
        }
        $cellwidth = round(((100 - $answerwidth) / $cellwidth), 1);
        $sSurveyLanguage = $this->getFromSurveySession('s_lang');
        $aSubquestions   = $this->questionOrderingService->getOrderedSubQuestions(
... (101 lines truncated)
</file>

<file path="application/core/QuestionTypes/ArrayYesUncertainNo/DataSetArrayYesUncertainNo.php">
<?php
class DataSetArrayYesUncertainNo extends QuestionBaseDataSet
{
}
</file>

<file path="application/core/QuestionTypes/ArrayYesUncertainNo/RenderArrayYesUncertainNo.php">
<?php
class RenderArrayYesUncertainNo extends QuestionBaseRenderer
{
    public $sCoreClass = "ls-answers subquestion-list questions-list radio-array";
    public function getMainView()
    {
        return '/survey/questions/answer/arrays/yesnouncertain/answer';
    }
    public function getRows()
    {
        return;
    }
    public function render($sCoreClasses = '')
    {
        $aLastMoveResult         = LimeExpressionManager::GetLastMoveResult();
        $aMandatoryViolationSubQ = ($aLastMoveResult['mandViolation'] && $this->isMandatory())
            ? explode("|", (string) $aLastMoveResult['unansweredSQs'])
            : [];
        if (ctype_digit(trim((string) $this->getQuestionAttribute('answer_width')))) {
            $answerwidth = trim((string) $this->getQuestionAttribute('answer_width'));
        } else {
            $answerwidth = 33;
        }
        $cellwidth = 3;
        if ($this->showNoAnswer()) {
            ++$cellwidth;
        }
        $cellwidth = round(((100 - $answerwidth) / $cellwidth), 1);
        $sSurveyLanguage = $this->getFromSurveySession('s_lang');
        $aSubquestions   = $this->questionOrderingService->getOrderedSubQuestions(
... (98 lines truncated)
</file>

<file path="application/core/QuestionTypes/BoilerplateQuestion/DataSetBoilerplate.php">
<?php
class DataSetBoilerplate extends QuestionBaseDataSet
{
}
</file>

<file path="application/core/QuestionTypes/BoilerplateQuestion/RenderBoilerplate.php">
<?php
class RenderBoilerplate extends QuestionBaseRenderer
{
    public function getMainView()
    {
        return '/survey/questions/answer/boilerplate/answer';
    }
    public function getRows()
    {
        return;
    }
    public function render($sCoreClasses = '')
    {
        $answer = '';
        $inputnames = [];
        if (!empty($this->getQuestionAttribute('time_limit'))) {
            $answer .= $this->getTimeSettingRender();
        }
        $answer .=  Yii::app()->twigRenderer->renderQuestion($this->getMainView(), array(
            'ia' => $this->aFieldArray,
            'name' => $this->sSGQA,
            'basename' => $this->sSGQA,
            'coreClass' => 'ls-answers d-none ' . $sCoreClasses,
            ), true);
        $inputnames[] = $this->sSGQA;
        $this->registerAssets();
        return array($answer, $inputnames);
    }
}
</file>

<file path="application/core/QuestionTypes/Date/DataSetDate.php">
<?php
class DataSetDate extends QuestionBaseDataSet
{
}
</file>

<file path="application/core/QuestionTypes/Date/RenderDate.php">
<?php
class RenderDate extends QuestionBaseRenderer
{
    protected $aDateformatDetails;
    protected $minDate;
    protected $maxDate;
    public function getMainView()
    {
        return '/survey/questions/answer/date/';
    }
    public function getRows()
    {
        return;
    }
    protected function registerAssets()
    {
        $this->addScript(
            "sDateLangvarJS",
            "translt={alertInvalidDate:'" . gT('Date entered is invalid!', 'js') . "'};"
        );
        $this->aScriptFiles[] = [
            'path' => Yii::app()->getConfig("generalscripts") . 'date.js',
            'position' => LSYii_ClientScript::POS_END
        ];
        $this->aPackages = [
            'moment',
        ];
        parent::registerAssets();
    }
    public function getTranslatorData()
... (341 lines truncated)
</file>

<file path="application/core/QuestionTypes/DummyQuestion/DataSetDummyQuestion.php">
<?php
class DataSetDummyQuestion extends QuestionBaseDataSet
{
}
</file>

<file path="application/core/QuestionTypes/DummyQuestion/RenderDummyQuestion.php">
<?php
class DummyQuestionEditContainer extends QuestionBaseRenderer
{
    public function getMainView()
    {
        return '/survey/questions/answer/dummy/answer';
    }
    public function getRows()
    {
        return;
    }
    public function render($sCoreClasses = '')
    {
        $answer = '';
        $inputnames = [];
        if (!empty($this->getQuestionAttribute('time_limit'))) {
            $answer .= $this->getTimeSettingRender();
        }
        $answer .=  Yii::app()->twigRenderer->renderQuestion($this->getMainView(), array(
            'ia' => $this->aFieldArray,
            'name' => $this->sSGQA,
            'basename' => $this->sSGQA,
            'content' => $this->oQuestion,
            'coreClass' => 'ls-answers ' . $sCoreClasses,
            ), true);
        $this->registerAssets();
        $inputnames[] = [];
        return array($answer, $inputnames);
    }
}
... (1 lines truncated)
</file>

<file path="application/core/QuestionTypes/Equation/DataSetEquation.php">
<?php
class DataSetEquation extends QuestionBaseDataSet
{
}
</file>

<file path="application/core/QuestionTypes/Equation/RenderEquation.php">
<?php
class RenderEquation extends QuestionBaseRenderer
{
    public function getRows()
    {
        return;
    }
    public function getMainView()
    {
        return '/survey/questions/answer/equation/answer';
    }
    public function render($sCoreClasses = '')
    {
        $inputnames = [];
        $sEquation  = $this->setDefaultIfEmpty($this->getQuestionAttribute('equation'), $this->aFieldArray[3]);
        $sValue     = htmlspecialchars((string) $_SESSION['responses_' . Yii::app()->getConfig('surveyID')][$this->sSGQA], ENT_QUOTES);
        $answer =  Yii::app()->twigRenderer->renderQuestion($this->getMainView(), array(
            'ia' => $this->aFieldArray,
            'name' => $this->sSGQA,
            'basename' => $this->sSGQA,
            'sValue'    =>  $sValue,
            'sEquation' => LimeExpressionManager::ProcessString($sEquation, $this->oQuestion->qid),
            'coreClass' => 'ls-answers answer-item hidden-item  ' . $sCoreClasses,
            'insideClass' => 'em_equation',
            ), true);
        $this->registerAssets();
        $inputnames[] = $this->sSGQA;
        return array($answer, $inputnames);
    }
}
... (1 lines truncated)
</file>

<file path="application/core/QuestionTypes/FileUpload/DataSetFileUpload.php">
<?php
class DataSetFileUpload extends QuestionBaseDataSet
{
}
</file>

<file path="application/core/QuestionTypes/FileUpload/RenderFileUpload.php">
<?php
class RenderFileUpload extends QuestionBaseRenderer
{
    protected $aPackages = ['question-file-upload'];
    public function getMainView()
    {
        return '/survey/questions/answer/file_upload/answer';
    }
    public function getRows()
    {
        return;
    }
    public function render($sCoreClasses = '')
    {
        $iSurveyId = $this->oQuestion->sid;
        $sAction = Yii::app()->request->getParam('action');
        $bPreview = $sAction == "previewgroup" || $sAction == "previewquestion" || $this->oQuestion->survey->active != "Y";
        $_SESSION['responses_' . $iSurveyId]['fieldname'] = $this->sSGQA;
        $_SESSION['responses_' . $iSurveyId]['preview'] = (int) $bPreview;
        $uploadurl = Yii::app()->getController()->createUrl(
            'uploader/index',
            [
                "sid" => $iSurveyId,
                "fieldname" => $this->sSGQA,
                "qid" => $this->oQuestion->qid,
                "preview" => (int) $bPreview,
                "show_title" => $this->getQuestionAttribute('show_title'),
                "show_comment" => $this->getQuestionAttribute('show_comment'),
                "minfiles" => $this->getQuestionAttribute('min_num_of_files'),
                "maxfiles" => $this->getQuestionAttribute('max_num_of_files'),
... (25 lines truncated)
</file>

<file path="application/core/QuestionTypes/GenderDropdown/DataSetGenderDropdown.php">
<?php
class DataSetGenderDropdown extends QuestionBaseDataSet
{
}
</file>

<file path="application/core/QuestionTypes/GenderDropdown/RenderGenderDropdown.php">
<?php
class RenderGenderDropdown extends QuestionBaseRenderer
{
    public function getMainView()
    {
        if ((int) $this->getQuestionAttribute('display_type') === 0) {
            return '/survey/questions/answer/gender/buttons/answer';
        }
        return '/survey/questions/answer/gender/radio/answer';
    }
    public function getRows()
    {
        return;
    }
    public function render($sCoreClasses = '')
    {
        $this->registerAssets();
        // Null when not set: the hidden "java" field then gets no value attribute at all
        $sValue = $this->getFromSurveySession($this->sSGQA, null);
        // Female/male use the plain 'CHECKED' string while "no answer" uses the CHECKED constant,
        $fChecked  = ($sValue == 'F') ? 'CHECKED' : '';
        $mChecked  = ($sValue == 'M') ? 'CHECKED' : '';
        $naChecked = '';
        $noAnswer = false;
        if (($this->aFieldArray[6] != 'Y' && $this->aFieldArray[6] != 'S') && SHOW_NO_ANSWER == 1) {
            $noAnswer = true;
            if (PRESELECT_NO_ANSWER && $sValue == '') {
                $naChecked = CHECKED;
            }
        }
... (14 lines truncated)
</file>

<file path="application/core/QuestionTypes/HugeFreeText/DataSetHugeFreeText.php">
<?php
class DataSetHugeFreeText extends QuestionBaseDataSet
{
}
</file>

<file path="application/core/QuestionTypes/HugeFreeText/RenderHugeFreeText.php">
<?php
class RenderHugeFreeText extends QuestionBaseRenderer
{
    public function getMainView()
    {
        return '/survey/questions/answer/hugefreetext/answer';
    }
    public function getRows()
    {
        return;
    }
    public function render($sCoreClasses = '')
    {
        $answer = '';
        $inputnames = [];
        $extraclass = "";
        $maxlength = "";
        $withColumn = false;
        $inputsize = null;
        $placeholder = "";
        $drows = $this->setDefaultIfEmpty(
            $this->getQuestionAttribute('display_rows'),
            ($this->oQuestion->type == Question::QT_T_LONG_FREE_TEXT  ? 4 : 30)
        );
        if (intval(trim((string) $this->getQuestionAttribute('maximum_chars'))) > 0) {
            $maxlength = intval(trim((string) $this->getQuestionAttribute('maximum_chars')));
            $extraclass .= " ls-input-maxchars";
        }
        if (trim((string) $this->getQuestionAttribute('text_input_width')) != '') {
            $col         = ($this->getQuestionAttribute('text_input_width') <= 12) ? $this->getQuestionAttribute('text_input_width') : 12;
... (33 lines truncated)
</file>

<file path="application/core/QuestionTypes/Language/DataSetLanguage.php">
<?php
class DataSetLanguage extends QuestionBaseDataSet
{
}
</file>

<file path="application/core/QuestionTypes/Language/RenderLanguageSelector.php">
<?php
class RenderLanguageSelector extends QuestionBaseRenderer
{
    public function getMainView()
    {
        return '/survey/questions/answer/language/answer';
    }
    public function getRows()
    {
        $answerlangs            = $this->oQuestion->survey->additionalLanguages;
        $answerlangs[]          = $this->oQuestion->survey->language;
        return $answerlangs;
    }
    public function render($sCoreClasses = '')
    {
        $answer = '';
        $inputnames = [];
        if (!empty($this->getQuestionAttribute('time_limit'))) {
            $answer .= $this->getTimeSettingRender();
        }
        $sLanguage = $this->sLanguage;
        $aAnswerlangs = $this->getRows();
        if (!in_array($sLanguage, $aAnswerlangs)) {
            $sLanguage = $this->oQuestion->survey->language;
        }
        $answer .=  Yii::app()->twigRenderer->renderQuestion($this->getMainView(), array(
            'name' => $this->sSGQA,
            'basename' => $this->sSGQA,
            'checkconditionFunction' => 'checkconditions(this.value, this.name, this.type)',
            'coreClass' => 'ls-answers answer-item dropdow-item language-item ' . $sCoreClasses,
... (9 lines truncated)
</file>

<file path="application/core/QuestionTypes/ListDropdown/DataSetListDropdown.php">
<?php
class DataSetListDropdown extends QuestionBaseDataSet
{
}
</file>

<file path="application/core/QuestionTypes/ListDropdown/RenderListDropdown.php">
<?php
class RenderListDropdown extends QuestionBaseRenderer
{
    protected $othertext;
    protected $optCategorySeparator;
    protected $bPrefix;
    protected $hasOther = false;
    protected $otherPosition;
    protected $answerBeforeOther;
    protected $otherRendered = false;
    private $iRowNum = 0;
    const OTHER_POS_BEFORE_NOANSWER = 'default';
    const OTHER_POS_START = 'beginning';
    const OTHER_POS_END = 'end';
    const OTHER_POS_AFTER_OPTION = 'specific';
    public function __construct($aFieldArray, $bRenderDirect = false)
    {
        parent::__construct($aFieldArray, $bRenderDirect);
        $this->othertext              = $this->setDefaultIfEmpty($this->getQuestionAttribute('other_replace_text', $this->sLanguage), gT('Other:'));
        $this->optCategorySeparator   = @$this->setDefaultIfEmpty($this->getQuestionAttribute('category_separator'), false);
        $this->sCoreClass             = "ls-answers answer-item";
        $this->bPrefix                = @(sanitize_int($this->getQuestionAttribute('dropdown_prefix')) == 1);
        $this->hasOther               = $this->oQuestion->other == 'Y';
        $this->otherPosition          = $this->setDefaultIfEmpty($this->getQuestionAttribute('other_position'), self::OTHER_POS_BEFORE_NOANSWER);
        $this->answerBeforeOther = '';
        if ($this->hasOther && $this->otherPosition == self::OTHER_POS_AFTER_OPTION) {
            $this->answerBeforeOther = $this->getQuestionAttribute('other_position_code');
        }
        $this->setAnsweroptions();
    }
... (186 lines truncated)
</file>

<file path="application/core/QuestionTypes/ListRadio/DataSetListRadio.php">
<?php
class DataSetListRadio extends QuestionBaseDataSet
{
}
</file>

<file path="application/core/QuestionTypes/ListRadio/RenderListRadio.php">
<?php
class RenderListRadio extends QuestionBaseRenderer
{
    public $sCoreClass = "ls-answers answers-list radio-list";
    protected $sOthertext;
    protected $iNbCols;
    protected $iCountAnswers;
    private $inputnames = [];
    protected $hasOther;
    protected $otherPosition;
    protected $answerBeforeOther;
    const OTHER_POS_BEFORE_NOANSWER = 'default';
    const OTHER_POS_START = 'beginning';
    const OTHER_POS_END = 'end';
    const OTHER_POS_AFTER_OPTION = 'specific';
    public function __construct($aFieldArray, $bRenderDirect = false)
    {
        parent::__construct($aFieldArray, $bRenderDirect);
        $this->sOthertext = $this->setDefaultIfEmpty($this->getQuestionAttribute('other_replace_text', $this->sLanguage), gT('Other:'));
        $this->iNbCols   = $this->setDefaultIfEmpty($this->getQuestionAttribute('display_columns'), ""); // number of columns
        $this->hasOther = $this->oQuestion->other == 'Y';
        $this->otherPosition = $this->setDefaultIfEmpty($this->getQuestionAttribute('other_position'), self::OTHER_POS_BEFORE_NOANSWER);
        $this->answerBeforeOther = '';
        if ($this->hasOther && $this->otherPosition == self::OTHER_POS_AFTER_OPTION) {
            $this->answerBeforeOther = $this->getQuestionAttribute('other_position_code');
        }
        $this->setAnsweroptions();
        if ($this->iNbCols) {
            $this->sCoreClass .= " multiple-list nbcol-{$this->iNbCols}";
        }
... (181 lines truncated)
</file>

<file path="application/core/QuestionTypes/ListWithComment/DataSetListWithComment.php">
<?php
class DataSetListWithComment extends QuestionBaseDataSet
{
}
</file>

<file path="application/core/QuestionTypes/ListWithComment/RenderListComment.php">
<?php
class RenderListComment extends QuestionBaseRenderer
{
    public $sCoreClass = "ls-answers ";
    public $checkconditionFunction = "checkconditions";
    protected $maxoptionsize          = 35;
    public function __construct($aFieldArray, $bRenderDirect = false)
    {
        parent::__construct($aFieldArray, $bRenderDirect);
        $this->setAnsweroptions();
    }
    public function getMainView()
    {
        return '/survey/questions/answer/list_with_comment';
    }
    public function renderList($sCoreClasses)
    {
        $sRows = '';
        foreach ($this->aAnswerOptions[0] as $ansrow) {
            $itemData = array(
                'li_classes'             => 'answer-item radio-item',
                'name'                   => $this->sSGQA,
                'id'                     => 'answer' . $this->sSGQA . $ansrow['code'],
            'value'                  => $ansrow['code'],
            'aid'                    => $ansrow['aid'],
                'check_ans'              => ($this->mSessionValue == $ansrow['code'] ? CHECKED : ''),
                'checkconditionFunction' => $this->checkconditionFunction . '(this.value, this.name, this.type);',
                'labeltext'              => $ansrow->answerl10ns[$this->sLanguage]->answer,
            );
            $sRows .= Yii::app()->twigRenderer->renderQuestion($this->getMainView() . '/list/rows/answer_row', $itemData, true);
... (110 lines truncated)
</file>

<file path="application/core/QuestionTypes/LongFreeText/DataSetLongFreeText.php">
<?php
class DataSetLongFreeText extends QuestionBaseDataSet
{
}
</file>

<file path="application/core/QuestionTypes/LongFreeText/RenderLongFreeText.php">
<?php
class RenderLongFreeText extends QuestionBaseRenderer
{
    public function getMainView()
    {
        return '/survey/questions/answer/longfreetext/answer';
    }
    public function getRows()
    {
        return;
    }
    public function render($sCoreClasses = '')
    {
        $answer = '';
        $inputnames = [];
        $extraclass = "";
        $maxlength = "";
        $withColumn = false;
        $inputsize = null;
        $placeholder = "";
        $drows = $this->setDefaultIfEmpty(
            $this->getQuestionAttribute('display_rows'),
            ($this->oQuestion->type == Question::QT_T_LONG_FREE_TEXT  ? 4 : 30)
        );
        if (intval(trim((string) $this->getQuestionAttribute('maximum_chars'))) > 0) {
            $maxlength = intval(trim((string) $this->getQuestionAttribute('maximum_chars')));
            $extraclass .= " ls-input-maxchars";
        }
        if (trim((string) $this->getQuestionAttribute('text_input_width')) != '') {
            $col         = ($this->getQuestionAttribute('text_input_width') <= 12) ? $this->getQuestionAttribute('text_input_width') : 12;
... (33 lines truncated)
</file>

<file path="application/core/QuestionTypes/MultipleChoice/DataSetMultipleChoice.php">
<?php
class DataSetMultipleChoice extends QuestionBaseDataSet
{
}
</file>

<file path="application/core/QuestionTypes/MultipleChoice/RenderMultipleChoice.php">
<?php
class RenderMultipleChoice extends QuestionBaseRenderer
{
    private $sCoreClasses = 'ls-answers checkbox-list answers-list';
    private $inputnames = [];
    private $iNbCols;
    protected $hasOther;
    protected $otherPosition;
    protected $subquestionBeforeOther;
    protected $otherText;
    const OTHER_POS_END = 'end';
    const OTHER_POS_START = 'beginning';
    const OTHER_POS_AFTER_SUBQUESTION = 'specific';
    public function __construct($aFieldArray, $bRenderDirect = false)
    {
        parent::__construct($aFieldArray, $bRenderDirect);
        $this->setSubquestions();
        $this->iNbCols = intval($this->setDefaultIfEmpty($this->getQuestionAttribute('display_columns'), ""));
        if ($this->iNbCols) {
            $this->sCoreClasses .= " multiple-list nbcol-{$this->iNbCols}";
        }
        $this->hasOther = $this->oQuestion->other == 'Y';
        $this->otherPosition = $this->setDefaultIfEmpty($this->getQuestionAttribute('other_position'), self::OTHER_POS_END);
        $this->subquestionBeforeOther = '';
        if ($this->hasOther && $this->otherPosition == self::OTHER_POS_AFTER_SUBQUESTION) {
            $this->subquestionBeforeOther = $this->getQuestionAttribute('other_position_code');
        }
        $this->otherText = $this->setDefaultIfEmpty($this->getQuestionAttribute('other_replace_text', $this->sLanguage), gT('Other:'));
    }
    public function getMainView()
... (154 lines truncated)
</file>

<file path="application/core/QuestionTypes/MultipleChoiceWithComments/DataSetMultipleChoiceWithComments.php">
<?php
class DataSetMultipleChoiceWithComments extends QuestionBaseDataSet
{
}
</file>

<file path="application/core/QuestionTypes/MultipleChoiceWithComments/RenderMultipleChoiceWithComments.php">
<?php
class RenderMultipleChoiceWithComments extends QuestionBaseRenderer
{
    private $sCoreClasses = 'ls-answers checkbox-list checkbox-text-list';
    private $inputnames = [];
    private $iLabelWidth = 0;
    private $attributeInputContainerWidth;
    private $attributeLabelWidth;
    private $sLabelWidth;
    private $sInputContainerWidth;
    protected $hasOther;
    protected $otherPosition;
    protected $subquestionBeforeOther;
    const OTHER_POS_END = 'end';
    const OTHER_POS_START = 'beginning';
    const OTHER_POS_AFTER_SUBQUESTION = 'specific';
    public function __construct($aFieldArray, $bRenderDirect = false)
    {
        parent::__construct($aFieldArray, $bRenderDirect);
        $this->setSubquestions();
        if ($this->oQuestion->other == 'Y') {
            $this->iLabelWidth = 25;
        }
        $this->attributeInputContainerWidth = intval(trim((string) $this->getQuestionAttribute('text_input_columns')));
        if ($this->attributeInputContainerWidth < 1 || $this->attributeInputContainerWidth > 12) {
            $this->attributeInputContainerWidth = null;
        }
        $this->attributeLabelWidth = intval(trim((string) $this->getQuestionAttribute('choice_input_columns')));
        if ($this->attributeLabelWidth < 1 || $this->attributeLabelWidth > 12) {
            $this->attributeLabelWidth = null;
... (192 lines truncated)
</file>

<file path="application/core/QuestionTypes/MultipleNumericalQuestion/DataSetMultipleNumerical.php">
<?php
class DataSetMultipleNumerical extends QuestionBaseDataSet
{
}
</file>

<file path="application/core/QuestionTypes/MultipleNumericalQuestion/RenderMultipleNumerical.php">
<?php
class RenderMultipleNumerical extends QuestionBaseRenderer
{
    private $handleOptions = [
        'round',
        'square',
        'triangle',
        'custom',
    ];
    private $sSeparator;
    private $useSliderLayout;
    private $sCoreClasses = "ls-answers subquestion-list questions-list ";
    private $inputnames = [];
    private $widthArray = [];
    private $sliderOptionsArray = [];
    private $extraclass = '';
    private $maxlength = '';
    private $inputsize = null;
    private $numbersonly = true;
    private $prefix = '';
    private $suffix = '';
    public function __construct($aFieldArray, $bRenderDirect = false)
    {
        parent::__construct($aFieldArray, $bRenderDirect);
        $this->setSubquestions();
        $this->setPrefixAndSuffix();
        $this->sSeparator   = (getRadixPointData($this->oQuestion->survey->correct_relation_defaultlanguage->surveyls_numberformat))['separator'];
        $this->useSliderLayout = $this->getQuestionAttribute('slider_layout') == 1;
        $this->widthArray = $this->getLabelInputWidth();
        $this->extraclass   .= " numberonly";
... (267 lines truncated)
</file>

<file path="application/core/QuestionTypes/MultipleShortText/DataSetMultipleShortText.php">
<?php
class DataSetMultipleShortText extends QuestionBaseDataSet
{
}
</file>

<file path="application/core/QuestionTypes/MultipleShortText/RenderMultipleShortText.php">
<?php
class RenderMultipleShortText extends QuestionBaseRenderer
{
    private $sCoreClasses = 'ls-answers subquestion-list questions-list text-list ';
    private $inputnames = [];
    private $widthArray = [];
    private $sSeparator = '';
    private $extraclass = '';
    private $maxlength = '';
    private $inputsize = null;
    private $numbersonly = false;
    private $prefix = '';
    private $suffix = '';
    private $placeholder  = '';
    public function __construct($aFieldArray, $bRenderDirect = false)
    {
        parent::__construct($aFieldArray, $bRenderDirect);
        $this->setSubquestions();
        $this->setPrefixAndSuffix();
        $this->setPlaceholder();
        $this->widthArray = $this->getLabelInputWidth();
        $this->numbersonly = ($this->getQuestionAttribute('numbers_only') == 1);
        if ($this->getQuestionAttribute('numbers_only') == 1) {
            $this->sSeparator   = (getRadixPointData($this->oQuestion->survey->correct_relation_defaultlanguage->surveyls_numberformat))['separator'];
            $this->extraclass   .= " numberonly";
            $this->sCoreClasses .= " number-list ";
        }
        if (intval($this->setDefaultIfEmpty($this->getQuestionAttribute('maximum_chars'), 0)) > 0) {
            $this->maxlength = intval(trim((string) $this->getQuestionAttribute('maximum_chars')));
            $this->extraclass .= " ls-input-maxchars";
... (108 lines truncated)
</file>

<file path="application/core/QuestionTypes/Numerical/DataSetNumerical.php">
<?php
class DataSetNumerical extends QuestionBaseDataSet
{
}
</file>

<file path="application/core/QuestionTypes/Numerical/RenderNumerical.php">
<?php
class RenderNumerical extends QuestionBaseRenderer
{
    public function getMainView()
    {
        return '/survey/questions/answer/numerical/answer';
    }
    public function getRows()
    {
        return;
    }
    public function render($sCoreClasses = '')
    {
        $this->registerAssets();
        $extraclass             = "";
        $answertypeclass        = "numeric";
        $checkconditionFunction = "fixnum_checkconditions";
        $coreClass              = "ls-answers answer-item text-item numeric-item";
        $sLanguage              = $this->getSessionLanguage();
        if (trim((string) $this->getQuestionAttribute('prefix', $sLanguage)) != '') {
            $prefix      = $this->getQuestionAttribute('prefix', $sLanguage);
            $extraclass .= " withprefix";
        } else {
            $prefix = '';
        }
        if (trim((string) $this->getQuestionAttribute('suffix', $sLanguage)) != '') {
            $suffix      = $this->getQuestionAttribute('suffix', $sLanguage);
            $extraclass .= " withsuffix";
        } else {
            $suffix = '';
... (87 lines truncated)
</file>

<file path="application/core/QuestionTypes/RankingStyle/DataSetRanking.php">
<?php
class DataSetRanking extends QuestionBaseDataSet
{
}
</file>

<file path="application/core/QuestionTypes/RankingStyle/RenderRanking.php">
<?php
class RenderRanking extends QuestionBaseRenderer
{
    private $inputnames = [];
    private $aDisplayAnswers = [];
    private $iMaxSubquestions;
    private $mMaxAnswers;
    private $mMinAnswers;
    private $sLabeltext;
    public function __construct($aFieldArray, $bRenderDirect = false)
    {
        parent::__construct($aFieldArray, $bRenderDirect);
        $this->setSubquestions();
        $maxSubquestionsAttribute = (int) $this->getQuestionAttribute('max_subquestions');
        $this->iMaxSubquestions = $maxSubquestionsAttribute > 0
            ? $maxSubquestionsAttribute
            : $this->getQuestionCount();
        $maxAnswersAttribute = trim((string) $this->getQuestionAttribute('max_answers'));
        $this->mMaxAnswers = $maxAnswersAttribute != ''
            ? (
                ($this->iMaxSubquestions < $this->getQuestionCount())
                ? min($this->iMaxSubquestions, (int) $maxAnswersAttribute)
                : (int) $maxAnswersAttribute
              )
            : $this->iMaxSubquestions;
        $this->mMinAnswers = $this->setDefaultIfEmpty($this->getQuestionAttribute('min_answers'), 0);
    }
    public function getMainView()
    {
        return '/survey/questions/answer/ranking';
... (109 lines truncated)
</file>

<file path="application/core/QuestionTypes/ShortFreeText/DataSetShortFreeText.php">
<?php
class DataSetShortFreeText extends QuestionBaseDataSet
{
}
</file>

<file path="application/core/QuestionTypes/ShortFreeText/RenderShortFreeText.php">
<?php
class RenderShortFreeText extends QuestionBaseRenderer
{
    public function getMainView()
    {
        return '/survey/questions/answer/shortfreetext/text/item';
    }
    public function getRows()
    {
        return;
    }
    public function render($sCoreClasses = '')
    {
        global $thissurvey;
        $coreClass  = "ls-answers answer-item text-item";
        $extraclass = "";
        $sLanguage  = $this->getSessionLanguage();
        if ($this->getQuestionAttribute('numbers_only') == 1) {
            $sSeparator  = getRadixPointData($thissurvey['surveyls_numberformat'] ?? null);
            $sSeparator  = $sSeparator['separator'];
            $extraclass .= " numberonly";
            $coreClass  .= " numeric-item";
            $numberonly  = true;
        } else {
            $sSeparator = '';
            $numberonly = false;
        }
        if (intval(trim((string) $this->getQuestionAttribute('maximum_chars'))) > 0) {
            $maxlength   = intval(trim((string) $this->getQuestionAttribute('maximum_chars')));
            $extraclass .= " ls-input-maxchars";
... (303 lines truncated)
</file>

<file path="application/core/QuestionTypes/YesNoRadio/DataSetYesNoRadio.php">
<?php
class DataSetYesNoRadio extends QuestionBaseDataSet
{
}
</file>

<file path="application/core/QuestionTypes/YesNoRadio/RenderYesNoRadio.php">
<?php
class RenderYesNoRadio extends QuestionBaseRenderer
{
    public function getMainView()
    {
        if ($this->getDisplayType() === 0) {
            return '/survey/questions/answer/yesno/buttons/item';
        }
        return '/survey/questions/answer/yesno/radio/item';
    }
    public function getRows()
    {
        return;
    }
    public function render($sCoreClasses = '')
    {
        $this->registerAssets();
        // Null when not set: the hidden "java" field then gets no value attribute at all
        $sValue = $this->getFromSurveySession($this->sSGQA, null);
        $yChecked = $nChecked = $naChecked = '';
        if ($sValue == 'Y') {
            $yChecked = CHECKED;
        }
        if ($sValue == 'N') {
            $nChecked = CHECKED;
        }
        $noAnswer = false;
        if (($this->aFieldArray[6] != 'Y' && $this->aFieldArray[6] != 'S') && SHOW_NO_ANSWER == 1) {
            $noAnswer = true;
            if (PRESELECT_NO_ANSWER && empty($sValue)) {
... (22 lines truncated)
</file>

<file path="application/core/QuestionTypes/LoadQuestionTypes.php">
<?php
class LoadQuestionTypes
{
    public static function loadAll()
    {
        Yii::import('questiontypes.5PointChoice.*');
        Yii::import('questiontypes.Array10ChoiceQuestions.*');
        Yii::import('questiontypes.Array5ChoiceQuestions.*');
        Yii::import('questiontypes.ArrayFlexibleColumn.*');
        Yii::import('questiontypes.ArrayFlexibleRow.*');
        Yii::import('questiontypes.ArrayMultiFlexNumbers.*');
        Yii::import('questiontypes.ArrayMultiFlexText.*');
        Yii::import('questiontypes.ArrayMultiscale.*');
        Yii::import('questiontypes.ArrayOfIncSameDecQuestions.*');
        Yii::import('questiontypes.ArrayYesUncertainNo.*');
        Yii::import('questiontypes.BoilerplateQuestion.*');
        Yii::import('questiontypes.Date.*');
        Yii::import('questiontypes.DummyQuestion.*');
        Yii::import('questiontypes.Equation.*');
        Yii::import('questiontypes.FileUpload.*');
        Yii::import('questiontypes.GenderDropdown.*');
        Yii::import('questiontypes.HugeFreeText.*');
        Yii::import('questiontypes.Language.*');
        Yii::import('questiontypes.ListDropdown.*');
        Yii::import('questiontypes.ListRadio.*');
        Yii::import('questiontypes.ListWithComment.*');
        Yii::import('questiontypes.LongFreeText.*');
        Yii::import('questiontypes.MultipleChoice.*');
        Yii::import('questiontypes.MultipleChoiceWithComments.*');
        Yii::import('questiontypes.MultipleNumericalQuestion.*');
... (103 lines truncated)
</file>

<file path="application/core/Traits/LSApplicationTrait.php">
<?php
trait LSApplicationTrait
{
    private $currentUserId;
    public function getCurrentUserId()
    {
        if (empty(App()->session['loginID'])) {
            return App()->session['loginID'];
        }
        if (!is_null($this->currentUserId) && $this->currentUserId == App()->session['loginID']) {
            return $this->currentUserId;
        }
        $this->currentUserId = App()->session['loginID'];
        if ($this->currentUserId) {
            $oUser = User::model()->notexpired()->active()->findByPk($this->currentUserId);
            if (!$oUser || $this->isSessionTokenStale($oUser)) {
                $this->currentUserId = 0;
            }
        }
        return $this->currentUserId;
    }
    private function isSessionTokenStale($oUser)
    {
        if (App()->getConfig('DBVersion') < 716 || empty($oUser->session_token) || empty(App()->session['session_token'])) {
            return false;
        }
        return $oUser->session_token !== App()->session['session_token'];
    }
    public function createPublicUrl($route, $params = array(), $schema = '', $ampersand = '&')
    {
... (163 lines truncated)
</file>

<file path="application/core/utils/fileExtensions.php">
<?php
return array_merge(
    require(Yii::getPathOfAlias('system.utils.fileExtensions') . '.php'),
    array(
        'image/heif' => 'heif',
        'image/heif-sequence' => 'heifs',
        'image/heic' => 'heic',
        'image/heic-sequence' => 'heics',
        'audio/x-m4a' => 'm4a',
        'text/xml' => 'xml',
        'image/svg' => 'svg',
    )
);
</file>

<file path="application/core/web/DbHttpSession.php">
<?php
class DbHttpSession extends \CDbHttpSession
{
    public function getTimeout()
    {
        return (int)Yii::app()->getConfig('iSessionExpirationTime', ini_get('session.gc_maxlifetime'));
    }
}
</file>

<file path="application/core/AuthPluginBase.php">
<?php
class AuthPluginBase extends \LimeSurvey\PluginManager\AuthPluginBase
{
}
</file>

<file path="application/core/ConsoleApplication.php">
<?php
require_once(dirname(dirname(__FILE__)) . '/helpers/globals.php');
require_once __DIR__ . '/Traits/LSApplicationTrait.php';
use LimeSurvey\PluginManager\LimesurveyApi;
class ConsoleApplication extends CConsoleApplication
{
    use LSApplicationTrait;
    protected $config = array();
    protected $api;
    public function getSession()
    {
        return $this->getComponent('session');
    }
    public function __construct($aApplicationConfig = null)
    {
        $baseConfig = require(__DIR__ . '/../config/config-defaults.php');
        if (file_exists(__DIR__ . '/../config/config.php')) {
            $userConfigs = require(__DIR__ . '/../config/config.php');
            if (is_array($userConfigs['config'])) {
                $baseConfig = array_merge($baseConfig, $userConfigs['config']);
            }
        }
        if (!isset($aApplicationConfig['runtimePath'])) {
            $aApplicationConfig['runtimePath'] = $baseConfig['tempdir'] . DIRECTORY_SEPARATOR . 'runtime';
        }
        if (!is_dir($aApplicationConfig['runtimePath'])) {
            @mkdir($aApplicationConfig['runtimePath'], 0775, true);
        }
        parent::__construct($aApplicationConfig);
        Yii::setPathOfAlias('webroot', realpath(Yii::getPathOfAlias('application') . '/../'));
... (98 lines truncated)
</file>

<file path="application/core/ConsoleHttpSession.php">
<?php
class ConsoleHttpSession extends CHttpSession
{
    public function setCookieParams($value)
    {
    }
    public function setCookieMode($value)
    {
    }
    public function setSessionName($value)
    {
    }
    public function get($key, $defaultValue = null)
    {
        return $defaultValue;
    }
}
</file>

<file path="application/core/LimeMailer.php">
<?php
use PHPMailer\PHPMailer\PHPMailer;
class LimeMailer extends PHPMailer
{
    private static $instance = null;
    const ResetNone = 0;
    const ResetBase = 1;
    const ResetComplete = 2;
    const MethodMail = 'mail';
    const MethodSendmail = 'sendmail';
    const MethodQmail = 'qmail';
    const MethodSmtp = 'smtp';
    const MethodPlugin = 'plugin';
    public $surveyId;
    public $mailLanguage;
    public $html = true;
    public $oToken;
    public $aUrlsPlaceholders = [];
    public $index = 0;
    public $aReplacements = [];
    public $emailType = 'unknown';
    private $_aAttachmentByType = array(
        'invite' => 'invitation',
        'remind' => 'reminder',
        'register' => 'registration',
        'confirm' => 'confirmation',
        'admin_notification' => 'admin_notification',
        'admin_responses' => 'admin_detailed_notification',
    );
    public $replaceTokenAttributes = false;
... (760 lines truncated)
</file>

<file path="application/core/LS_Twig_Debug_Extension.php">
<?php
use Twig\Environment;
use Twig\Extension\AbstractExtension;
use Twig\Template;
use Twig\TemplateWrapper;
use Twig\TwigFunction;
class LS_Twig_Debug_Extension extends AbstractExtension
{
    private const DUMP_DEPTH = 10;
    public function getFunctions(): array
    {
        return [
            new TwigFunction(
                'dump',
                [self::class, 'dump'],
                ['is_safe' => ['html'], 'needs_context' => true, 'needs_environment' => true, 'is_variadic' => true]
            ),
        ];
    }
    public static function dump(Environment $env, $context, ...$vars)
    {
        if (!$env->isDebug()) {
            return '';
        }
        if (!$vars) {
            $vars = [];
            foreach ($context as $key => $value) {
                if (!$value instanceof Template && !$value instanceof TemplateWrapper) {
                    $vars[$key] = $value;
                }
... (45 lines truncated)
</file>

<file path="application/core/LS_Twig_Extension.php">
<?php
use Twig\Extension\AbstractExtension;
class LS_Twig_Extension extends AbstractExtension
{
    public static function registerPublicCssFile($sPublicCssFileName)
    {
        Yii::app()->clientScript->registerCssFile(
            Yii::app()->getConfig('publicstyleurl') .
            $sPublicCssFileName
        );
    }
    public static function registerTemplateCssFile($sTemplateCssFileName)
    {
        $oTemplate = self::getTemplateForRessource($sTemplateCssFileName);
        Yii::app()->clientScript->packages[$oTemplate->sPackageName]['css'][] = $sTemplateCssFileName;
    }
    public static function registerGeneralScript($sGeneralScriptFileName, $position = null, array $htmlOptions = array())
    {
        $position = self::getPosition($position);
        Yii::app()->clientScript->registerScriptFile(
            App()->getConfig('generalscripts') .
            $sGeneralScriptFileName,
            $position,
            $htmlOptions
        );
    }
    public static function registerTemplateScript($sTemplateScriptFileName, $position = null, array $htmlOptions = array())
    {
        $oTemplate = self::getTemplateForRessource($sTemplateScriptFileName);
        Yii::app()->clientScript->packages[$oTemplate->sPackageName]['js'][] = $sTemplateScriptFileName;
... (563 lines truncated)
</file>

<file path="application/core/LSAuthResult.php">
<?php
class LSAuthResult
{
    protected $_code;
    protected $_message;
    public function __construct($code = 0, $message = '')
    {
        $this->setError($code, $message);
    }
    public function isValid()
    {
        if ($this->_code === 0) {
            return true;
        }
        return false;
    }
    public function getCode()
    {
        return $this->_code;
    }
    public function getMessage()
    {
        return $this->_message;
    }
    public function setError($code, $message = null)
    {
        $this->_code = $code;
        $this->_message = $message;
    }
}
... (1 lines truncated)
</file>

<file path="application/core/LSBootstrap.php">
<?php
class LSBootstrap
{
}
</file>

<file path="application/core/LSCActiveDataProvider.php">
<?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
class LSCActiveDataProvider extends CActiveDataProvider
{
    protected function fetchData()
    {
        $criteria = clone $this->getCriteria();
        if (($pagination = $this->getPagination()) !== false) {
            $pagination->setItemCount($this->getTotalItemCount());
            $pagination->applyLimit($criteria);
        }
        $baseCriteria = $this->model->getDbCriteria(false);
        if (($sort = $this->getSort()) !== false) {
            if ($baseCriteria !== null) {
                $c = clone $baseCriteria;
                $c->mergeWith($criteria);
                $this->model->setDbCriteria($c);
            } else {
                $this->model->setDbCriteria($criteria);
            }
            $sort->applyOrder($criteria);
        }
        $this->model->setDbCriteria($baseCriteria !== null ? clone $baseCriteria : null);
        $data = $this->model->findAll($criteria);
        if ($this->model->bEncryption) {
            foreach ($data as $row) {
                if (!empty($row)) {
                    $row->decrypt();
... (32 lines truncated)
</file>

<file path="application/core/LSCaptcha.php">
<?php
class LSCaptcha extends CCaptcha
{
    public function renderOut()
    {
        $html = $this->renderImage();
        return $html;
    }
    protected function renderImage()
    {
        if (!isset($this->imageOptions['id'])) {
                    $this->imageOptions['id'] = $this->getId();
        }
        $this->imageOptions['class'] = "img-fluid";
        $url = $this->getController()->createUrl($this->captchaAction, array('v' => uniqid()));
        $alt = $this->imageOptions['alt'] ?? '';
        return CHtml::image($url, $alt, $this->imageOptions);
    }
}
</file>

<file path="application/core/LSDbCriteria.php">
<?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
use LimeSurvey\Models\Services\Exception\{
    BadRequestException
};
class LSDbCriteria extends CDbCriteria
{
    public function compare($column, $value, $partialMatch = false, $operator = 'AND', $escape = true)
    {
        if ($partialMatch && Yii::app()->db->getDriverName() == 'pgsql') {
            $this->addSearchCondition($column, $value, true, $operator, 'ILIKE');
        } else {
            parent::compare($column, $value, $partialMatch, $operator, $escape);
        }
    }
    public function addSearchCondition($column, $keyword, $escape = true, $operator = 'AND', $like = 'LIKE')
    {
        if ($keyword !== '' && $escape && in_array(App()->db->driverName, ['sqlsrv', 'dblib', 'mssql'])) {
                $escapingReplacements = [
                    '%' => '[%]',
                    '_' => '[_]',
                    '[' => '[[]',
                    ']' => '[]]',
                    '\\' => '[\\]',
                ];
                $keyword = '%' . strtr($keyword, $escapingReplacements) . '%';
                $escape = false;
        }
... (84 lines truncated)
</file>

<file path="application/core/LsDefaultDataSets.php">
<?php
class LsDefaultDataSets
{
    public static function getSurveyMenuEntryData()
    {
        $sOldLanguage = App()->language;
        App()->setLanguage('en');
        $headerArray = ['menu_id','user_id','ordering','name','title','menu_title','menu_description','menu_icon','menu_icon_type','menu_class','menu_link','action','template','partial','classes','permission','permission_grade','data','getdatamethod','language','active','changed_at','changed_by','created_at','created_by', 'showincollapse'];
        $basicMenues = [
            [
                1,
                null,
                1,
                'overview',
                gT('Survey overview', 'unescaped'),
                gT('Overview', 'unescaped'),
                gT('Open the general survey overview', 'unescaped'),
                'ri-bar-chart-horizontal-line',
                'remix',
                '',
                'surveyAdministration/view',
                '',
                '',
                '',
                '',
                '',
                '',
                '{"render": { "link": {"data": {"surveyid": ["survey","sid"]}}}}',
                '',
                'en-GB',
... (2767 lines truncated)
</file>

<file path="application/core/LSETwigViewRenderer.php">
<?php
class LSETwigViewRenderer extends ETwigViewRenderer
{
    public $sandboxConfig = array();
    private $_twig;
    public $user_extensions = [];
    function init()
    {
        parent::init();
        if (!empty($this->user_extensions)) {
            $this->addUserExtensions($this->user_extensions);
        }
    }
    public function renderTemplateFromFile($sLayout, $aData, $bReturn)
    {
        $oTemplate = Template::getLastInstance();
        $oLayoutTemplate = $this->getTemplateForView($sLayout, $oTemplate);
        if ($oLayoutTemplate) {
            $line       = file_get_contents($oLayoutTemplate->viewPath . $sLayout);
            $sHtml      = $this->convertTwigToHtml($line, $aData, $oTemplate);
            $sEmHiddenInputs = LimeExpressionManager::FinishProcessPublicPage(true);
            if ($sEmHiddenInputs) {
                $sHtml = str_replace(
                    "<!-- emScriptsAndHiddenInputs -->",
                    "<!-- emScriptsAndHiddenInputs updated -->\n" .
                    $sEmHiddenInputs,
                    $sHtml
                );
            }
            if ($bReturn) {
... (523 lines truncated)
</file>

<file path="application/core/LSFileHelper.php">
<?php
class LSFileHelper extends CFileHelper
{
    public static function getExtensionByMimeType($file, $magicFile = null)
    {
        static $mimeTypes,$customMimeTypes = array();
        if (empty($magicFile) && Yii::app()->getConfig('magic_file')) {
            $magicFile = Yii::app()->getConfig('magic_file');
        }
        if (empty($magicFile) && $mimeTypes === null) {
            $mimeTypes = require(Yii::getPathOfAlias('application.core.utils.fileExtensions') . '.php');
        } elseif ($magicFile !== null && !isset($customMimeTypes[$magicFile])) {
            $customMimeTypes[$magicFile] = require($magicFile);
        }
        $mime = self::getMimeType($file);
        if ($mime !== null) {
            $mime = strtolower($mime);
            if ($magicFile === null && isset($mimeTypes[$mime])) {
                return $mimeTypes[$mime];
            } elseif ($magicFile !== null && isset($customMimeTypes[$magicFile][$mime])) {
                return $customMimeTypes[$magicFile][$mime];
            }
        }
        return null;
    }
    public static function getMimeType($file, $magicFile = null, $checkExtension = true)
    {
        $mimeType = parent::getMimeType($file, $magicFile, $checkExtension);
        if ((!empty($magicFile) && $mimeType != "application/octet-stream")) {
            return $mimeType;
... (13 lines truncated)
</file>

<file path="application/core/LSGettextMoFile.php">
<?php
class LSGettextMoFile extends CGettextMoFile
{
    protected function readString($fr, $length, $offset = null)
    {
        if ($offset !== null) {
            fseek($fr, $offset);
        }
        return (string) $this->readByte($fr, $length);
    }
}
</file>

<file path="application/core/LSHttpRequest.php">
<?php
class LSHttpRequest extends CHttpRequest
{
    private $_pathInfo;
    public $noCsrfValidationRoutes = array();
    public $noCsrfValidationParams = array();
    private $queryParams;
    public function getUrlReferrer($sAlternativeUrl = null)
    {
        $referrer = parent::getUrlReferrer();
        $baseReferrer    = str_replace(Yii::app()->getBaseUrl(true), "", (string) $referrer);
        $baseRequestUri  = str_replace(Yii::app()->getBaseUrl(), "", (string) Yii::app()->request->requestUri);
        $referrer = ($baseReferrer != $baseRequestUri) ? $referrer : null;
        //Use alternative url if the $referrer is still available in the checkLoopInNavigationStack
        if (($this->checkLoopInNavigationStack($referrer)) || (is_null($referrer))) {
            // Checks if the alternative url should be used
            if (isset($sAlternativeUrl)) {
                $referrer = $sAlternativeUrl;
            } else {
                return App()->createUrl('dashboard/view');
            }
        }
        return $referrer;
    }
    public function getOriginalUrlReferrer()
    {
        return parent::getUrlReferrer();
    }
    /**
     * Method to update the LimeSurvey Navigation Stack to prevent looping
... (182 lines truncated)
</file>

<file path="application/core/LSMessageSource.php">
<?php
class LSMessageSource extends CMessageSource
{
    public const CACHE_KEY_PREFIX = 'Yii.LSMessageSource.';
    public const MO_FILE_EXT = '.mo';
    public const PO_FILE_EXT = '.po';
    public $cachingDuration = 0;
    public $cacheID = 'cache';
    public $basePath;
    public $useMoFile = true;
    public $useBigEndian = false;
    protected function loadMessages($category, $language)
    {
        $messageFile = $this->basePath . DIRECTORY_SEPARATOR . $language . DIRECTORY_SEPARATOR . $language;
        if ($this->useMoFile) {
            $messageFile .= self::MO_FILE_EXT;
        } else {
            $messageFile .= self::PO_FILE_EXT;
        }
        if (
            $this->cachingDuration > 0
            && $this->cacheID !== false
            && ($cache = Yii::app()->getComponent($this->cacheID)) !== null
        ) {
            $key = self::CACHE_KEY_PREFIX . $messageFile . $category . '.' . $language;
            if (($data = $cache->get($key)) !== false) {
                return unserialize($data, ['allowed_classes' => false]);
            }
        }
        if (is_file($messageFile)) {
... (47 lines truncated)
</file>

<file path="application/core/LSSodium.php">
<?php
class LSSodium
{
    public $bLibraryExists = false;
    protected $sEncryptionNonce = null;
    protected $sEncryptionSecretBoxKey = null;
    public function init()
    {
        require_once Yii::app()->basePath . '/../vendor/paragonie/sodium_compat/src/Compat.php';
        require_once Yii::app()->basePath . '/../vendor/paragonie/sodium_compat/src/Core/Util.php';
        require_once Yii::app()->basePath . '/../vendor/paragonie/sodium_compat/autoload.php';
        $this->checkIfLibraryExists();
        if ($this->bLibraryExists === false) {
        } else {
            $this->checkIfKeyExists();
        }
    }
    public function checkIfLibraryExists()
    {
        if (function_exists('sodium_crypto_sign_open')) {
            $this->bLibraryExists = true;
        }
    }
    protected function checkIfKeyExists()
    {
        if (empty(App()->getConfig('encryptionsecretboxkey')) && empty(App()->getConfig('encryptionnonce'))) {
            $this->generateEncryptionKeys();
        }
        if ($this->sEncryptionNonce === null) {
            $this->sEncryptionNonce = $this->getEncryptionNonce();
... (122 lines truncated)
</file>

<file path="application/core/LSSodiumOld.php">
<?php
class LSSodiumOld
{
    public $bLibraryExists = false;
    protected $sEncryptionKeypair = null;
    protected $sEncryptionPublicKey = null;
    protected $sEncryptionSecretKey = null;
    public function init()
    {
        require_once Yii::app()->basePath . '/../vendor/paragonie/sodium_compat/src/Compat.php';
        require_once Yii::app()->basePath . '/../vendor/paragonie/sodium_compat/src/Core/Util.php';
        require_once Yii::app()->basePath . '/../vendor/paragonie/sodium_compat/autoload.php';
        $this->checkIfLibraryExists();
        if ($this->bLibraryExists === false) {
        } else {
            $this->checkIfKeyExists();
        }
    }
    public function checkIfLibraryExists()
    {
        if (function_exists('sodium_crypto_sign_open')) {
            $this->bLibraryExists = true;
        }
    }
    protected function checkIfKeyExists()
    {
        if (empty(Yii::app()->getConfig('encryptionkeypair'))) {
            $this->generateEncryptionKeys();
        }
        if ($this->sEncryptionKeypair === null) {
... (107 lines truncated)
</file>

<file path="application/core/LSUserException.php">
<?php
class LSUserException extends CHttpException
{
    private $redirectUrl = null;
    private $noReload = false;
    private $detailedErrors = [];
    public function __construct($status, $message = null, $code = 0, $redirectUrl = null, $noReload = false)
    {
        parent::__construct($status, $message, $code);
        $this->redirectUrl = $redirectUrl;
        $this->noReload = $noReload;
    }
    public function setRedirectUrl($redirectUrl)
    {
        $this->redirectUrl = $redirectUrl;
        return $this;
    }
    public function getRedirectUrl()
    {
        return $this->redirectUrl;
    }
    public function setNoReload($noReload)
    {
        $this->noReload = $noReload;
        return $this;
    }
    public function getNoReload()
    {
        return $this->noReload;
    }
... (40 lines truncated)
</file>

<file path="application/core/LSUserIdentity.php">
<?php
use LimeSurvey\PluginManager\PluginEvent;
class LSUserIdentity extends CUserIdentity
{
    const ERROR_IP_LOCKED_OUT = 98;
    const ERROR_UNKNOWN_HANDLER = 99;
    protected $config = array();
    public $id = null;
    public $user;
    public $plugin = 'Authdb';
    public $oneTimePasswordActorId = null;
    public function authenticate()
    {
        $result = new LSAuthResult(self::ERROR_NONE);
        if (FailedLoginAttempt::model()->isLockedOut(FailedLoginAttempt::TYPE_LOGIN)) {
            $message = sprintf(gT('You have exceeded the number of maximum login attempts. Please wait %d minutes before trying again.'), Yii::app()->getConfig('timeOutTime') / 60);
            $result->setError(self::ERROR_IP_LOCKED_OUT, $message);
        }
        if ($result->isValid()) {
            if (is_null($this->plugin)) {
                $result->setError(self::ERROR_UNKNOWN_HANDLER);
            } else {
                $authEvent = new PluginEvent('newUserSession', $this);
                $authEvent->set('identity', $this);
                App()->getPluginManager()->dispatchEvent($authEvent);
                $pluginResult = $authEvent->get('result');
                if ($pluginResult instanceof LSAuthResult) {
                    $result = $pluginResult;
                } else {
                    $result->setError(self::ERROR_UNKNOWN_IDENTITY);
... (85 lines truncated)
</file>

<file path="application/core/LSWebUser.php">
<?php
class LSWebUser extends CWebUser
{
    protected $sessionVariable = 'LSWebUser';
    public function __construct()
    {
        Yii::import('application.helpers.Hash', true);
        $this->loginUrl = Yii::app()->createUrl('admin/authentication', array('sa' => 'login'));
    }
    public function getId()
    {
        if (empty(parent::getId())) {
            return parent::getId();
        }
        $id = App()->getCurrentUserId();
        if ($id === 0) {
            $this->logout();
        }
        return $id;
    }
    public function setId($id)
    {
        parent::setId($id);
        \Yii::app()->session['loginID'] = $id;
    }
    public function logout($destroySession = true)
    {
        $beforeLogout = new PluginEvent('beforeLogout');
        App()->getPluginManager()->dispatchEvent($beforeLogout);
        regenerateCSRFToken();
... (111 lines truncated)
</file>

<file path="application/core/LSYii_Application.php">
<?php
require_once(dirname(dirname(__FILE__)) . '/helpers/globals.php');
require_once __DIR__ . '/Traits/LSApplicationTrait.php';
use LimeSurvey\Yii\Application\AppErrorHandler;
class LSYii_Application extends CWebApplication
{
    use LSApplicationTrait;
    protected $config = array();
    protected $api;
    protected $plugin;
    protected $dbVersion;
    private $currentUserId;
    private static $surveyId = false;
    private static $questionId = false;
    private static $groupId = false;
    public function __construct($aApplicationConfig = null)
    {
        $baseConfig = require(__DIR__ . '/../config/config-defaults.php');
        $configdir = $baseConfig['configdir'];
        if (file_exists($configdir .  '/config.php')) {
            $userConfigs = require($configdir . '/config.php');
            if (is_array($userConfigs['config'])) {
                $baseConfig = array_merge($baseConfig, $userConfigs['config']);
            }
        }
        if (!isset($aApplicationConfig['runtimePath'])) {
            $aApplicationConfig['runtimePath'] = $baseConfig['tempdir'] . DIRECTORY_SEPARATOR . 'runtime';
        }
        if (!is_dir($aApplicationConfig['runtimePath'])) {
            @mkdir($aApplicationConfig['runtimePath'], 0775, true);
... (363 lines truncated)
</file>

<file path="application/core/LSYii_AssetManager.php">
<?php
class LSYii_AssetManager extends CAssetManager
{
    public $excludeFiles = [
        '.svn',
        '.gitignore',
        '/node_modules',
    ];
    protected function hash($path)
    {
        return sprintf(
            '%x',
            crc32(
                $path .
                App()->getConfig('versionnumber') .
                App()->getConfig('globalAssetsVersion')
            )
        );
    }
    protected function generatePath($file, $hashByName = false)
    {
        if (is_file($file)) {
            $pathForHashing = $hashByName ? dirname((string) $file) : dirname((string) $file) . "." . filemtime($file) . "." . AssetVersion::getAssetVersion($file);
        } else {
            $pathForHashing = $hashByName ? $file : $file . "." . filemtime($file) . "." . AssetVersion::getAssetVersion($file);
        }
        return $this->hash($pathForHashing);
    }
}
</file>

<file path="application/core/LSYii_CaseValidator.php">
<?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
class LSYii_CaseValidator extends CValidator
{
    public $type = 'lower';
    public function validateAttribute($object, $attribute)
    {
        if ($this->type == 'upper') {
            if (strtoupper((string) $object->$attribute) == $object->$attribute) {
                return;
            } else {
                $this->addError($object, $attribute, gT('Text needs to be uppercase.'));
                return;
            }
        } else {
            if (strtolower((string) $object->$attribute) == $object->$attribute) {
                return;
            } else {
                $this->addError($object, $attribute, gT('Text needs to be lowercase.'));
                return;
            }
        }
    }
}
</file>

<file path="application/core/LSYii_ClientScript.php">
<?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
class LSYii_ClientScript extends CClientScript
{
    const POS_POSTSCRIPT = 5;
    const POS_PREBEGIN = 6;
    protected $packagesNotPublishedByAssetManager = ['ckeditor'];
    public function getCssFiles()
    {
        return $this->cssFiles;
    }
    public function recordCachingAction($context, $method, $params)
    {
        if (($controller = Yii::app()->getController()) !== null && (get_class($controller) !== 'ConsoleApplication' )) {
            $controller->recordCachingAction($context, $method, $params);
        }
    }
    public function getScriptFiles()
    {
        return $this->scriptFiles;
    }
    public function getCoreScripts()
    {
        return $this->coreScripts;
    }
    public function getFontPackages()
    {
        $aPackages = array();
... (414 lines truncated)
</file>

<file path="application/core/LSYii_CompareInsensitiveValidator.php">
<?php
class LSYii_CompareInsensitiveValidator extends CValidator
{
    public $compareValue;
    public $allowEmpty = false;
    public $operator = '=';
    protected function validateAttribute($object, $attribute)
    {
        $value = strtolower((string) $object->$attribute);
        if ($this->allowEmpty && $this->isEmpty($value)) {
                    return;
        }
        if ($this->compareValue !== null) {
            $compareTo = $this->compareValue;
            $compareValue = strtolower($compareTo);
        } else {
                throw new CException('compareValue must be set when using LSYii_CompareInsensitiveValidator');
        }
        switch ($this->operator) {
            case '=':
            case '==':
                if ($value != $compareValue) {
                                    $message = $this->message ?? sprintf(gT('%s must be case-insensitive equal to %s'), $attribute, $compareTo);
                }
                break;
            case '!=':
                if ($value == $compareValue) {
                                    $message = $this->message ?? sprintf(gT('%s must not be case-insensitive equal to %s'), $attribute, $compareTo);
                }
                break;
... (9 lines truncated)
</file>

<file path="application/core/LSYii_Controller.php">
<?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
abstract class LSYii_Controller extends CController
{
    public $navData = array();
    public function __construct($id, $module = null)
    {
        parent::__construct($id, $module);
        $this->_checkInstallation();
        $this->loadHelper('expressions.em_manager');
        $this->loadHelper('replacements');
        $this->customInit();
    }
    protected function _checkInstallation()
    {
        $file_name = Yii::app()->getConfig('rootdir') . '/application/config/config.php';
        if (!file_exists($file_name)) {
            $this->redirect(array('/installer'));
        }
    }
    public function loadHelper($helper)
    {
        Yii::app()->loadHelper($helper);
    }
    public function loadLibrary($library)
    {
        Yii::app()->loadLibrary($library);
    }
... (50 lines truncated)
</file>

<file path="application/core/LSYii_DisableUpdateValidator.php">
<?php
class LSYii_DisableUpdateValidator extends CValidator
{
    public function validateAttribute($object, $attribute)
    {
        if ($object->isNewRecord) {
            $object->$attribute = null;
            return;
        }
        if (empty($object->getPrimaryKey())) {
            throw new \InvalidArgumentException('Unable to use LSYii_DisableUpdateValidator without PrimaryKey');
        }
        $classOfObject = get_class($object);
        $originalObject = $classOfObject::model()->findByPk($object->getPrimaryKey());
        if ($object->$attribute != $originalObject->$attribute) {
            $label = $object->getAttributeLabel($attribute);
            $this->addError($object, $attribute, sprintf(gT("%s can not be updated."), $label));
        }
    }
}
</file>

<file path="application/core/LSYii_EmailIDNAValidator.php">
<?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
class LSYii_EmailIDNAValidator extends CValidator
{
    public $allowEmpty = false;
    public $allowMultiple = false;
    public $allowInherit = false;
    public function validateAttribute($object, $attribute)
    {
        if ($object->$attribute == '' && $this->allowEmpty) {
            return;
        }
        // If the attribute is 'inherit' and inherited values are allowed (like in survey settings), it's valid.
        if ($object->$attribute == 'inherit' && $this->allowInherit) {
            return;
        }
        if ($this->allowMultiple) {
              $aEmailAddresses = preg_split("/(,|;)/", (string) $object->$attribute);
        } else {
              $aEmailAddresses = array($object->$attribute);
        }
        foreach ($aEmailAddresses as $sEmailAddress) {
            if (!LimeMailer::validateAddress($sEmailAddress)) {
                $this->addError($object, $attribute, gT('Invalid email address.'));
                return;
            }
        }
        return;
... (3 lines truncated)
</file>

<file path="application/core/LSYii_FilterValidator.php">
<?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
class LSYii_FilterValidator extends CFilterValidator
{
    public $skipOnEmpty = false;
    protected function validateAttribute($object, $attribute)
    {
        if ($this->skipOnEmpty && empty($object->$attribute)) {
            return;
        }
        return parent::validateAttribute($object, $attribute);
    }
}
</file>

<file path="application/core/LSYii_HtmlPurifier.php">
<?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
class LSYii_HtmlPurifier extends CHtmlPurifier
{
    public function getConfig()
    {
        $purifier = $this->getPurifier();
        if ($purifier !== null) {
            return $purifier->config;
        }
    }
    public static function getXssPurifier()
    {
        $instance = new self();
        $instance->options = array(
            'AutoFormat.RemoveEmpty' => false,
            'Core.NormalizeNewlines' => false,
            'CSS.AllowTricky' => true,
            'HTML.SafeObject' => true,
            'Output.FlashCompat' => true,
            'Attr.EnableID' => true,
            'Attr.AllowedFrameTargets' => array('_blank', '_self'),
            'HTML.TargetNoopener' => true,
            'HTML.TargetNoreferrer' => true,
            'URI.AllowedSchemes' => array(
                'http' => true,
                'https' => true,
                'mailto' => true,
... (45 lines truncated)
</file>

<file path="application/core/LSYii_ImageValidator.php">
<?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
class LSYii_ImageValidator
{
    public static function validateImage($file)
    {
        if (is_array($file)) {
            $path = $file['tmp_name'];
            $extension = strtolower(pathinfo((string) $file['name'], PATHINFO_EXTENSION));
            $type = $file['type'];
        } elseif (is_string($file)) {
            $path = $file;
            $extension = strtolower(pathinfo($file, PATHINFO_EXTENSION));
            $type = null;
        } else {
            return [
                'uploadresult' => 'Internal error: $file is not array or string',
                'check' => false
            ];
        }
        $result = [];
        $checkImage = CFileHelper::getMimeType($path, null, false);
        $result['debug'] = $checkImage;
        $allowedExtensions = self::getAllowedExtensions();
        $allowedImageFormats = self::getAllowedMimeTypes($allowedExtensions);
        if (
            !empty($checkImage)
            && in_array($extension, $allowedExtensions)
... (42 lines truncated)
</file>

<file path="application/core/LSYii_Locale.php">
<?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
class LSYii_Locale extends CLocale
{
    public static function getInstance($id)
    {
        if ($id === 'auto' || $id === '' || $id === null) {
            Yii::app()->loadHelper('common');
            $id = getBrowserLanguage();
        }
        $aLanguageData = getLanguageData();
        if (isset($aLanguageData[$id]['cldr'])) {
            $id = $aLanguageData[$id]['cldr'];
        }
        static $locales = array();
        if (isset($locales[$id])) {
                    return $locales[$id];
        } else {
                    return $locales[$id] = new CLocale($id);
        }
    }
}
</file>

<file path="application/core/LSYii_NonFormulaValidator.php">
<?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
class LSYii_NonFormulaValidator extends CValidator
{
    protected const NON_FORMULA_REGEX = '/^[=\+\-\@\t\r]/';
    public function validateAttribute($object, $attribute)
    {
        if (empty($object->$attribute)) {
            return;
        }
        if (preg_match(self::NON_FORMULA_REGEX, $object->$attribute)) {
            $this->addError($object, $attribute, gT('The value cannot start with =, +, -, @, TAB, or Carriage Return.'));
        }
    }
}
</file>

<file path="application/core/LSYii_NoUpdateValidator.php">
<?php
class LSYii_NoUpdateValidator extends CValidator
{
    public function validateAttribute($object, $attribute)
    {
        if ($object->isNewRecord) {
            $object->$attribute = '';
            return;
        }
        if (empty($object->getPrimaryKey())) {
            throw new \InvalidArgumentException('Unable to use LSYii_NoUpdateValidator without PrimaryKey');
        }
        $classOfObject = get_class($object);
        $originalObject = $classOfObject::model()->findByPk($object->getPrimaryKey());
        $object->$attribute = $originalObject->$attribute;
    }
}
</file>

<file path="application/core/LSYii_ShortUrlValidator.php">
<?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
class LSYii_ShortUrlValidator extends CValidator
{
    protected $urlManager = null;
    public function __construct($urlManager = null)
    {
        if (!isset($urlManager)) {
            $urlManager = Yii::app()->getUrlManager();
        }
        $this->urlManager = $urlManager;
    }
    protected function validateAttribute($object, $attribute)
    {
        if (empty($object->$attribute)) {
            return;
        }
        if (
            $this->matchesReservedPath($object->$attribute)
            || $this->matchesExistingRoute($object->$attribute)
            || $this->matchesExistingController($object->$attribute)
        ) {
            $this->addError($object, $attribute, gT('The survey alias matches an existing URL and cannot be used.'));
        }
    }
    protected function matchesExistingController($route, $owner = null)
    {
        if ($owner === null) {
... (78 lines truncated)
</file>

<file path="application/core/LSYii_Validators.php">
<?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
class LSYii_Validators extends CValidator
{
    const XSS_UNSAFE_EM_FUNCTIONS = array('html_entity_decode', 'htmlspecialchars_decode', 'quoted_printable_decode');
    public $fixCKeditor = false;
    public $xssfilter = true;
    public $isUrl = false;
    public $isLanguage = false;
    public $isLanguageMulti = false;
    public $allowDataUri = false;
    public static $refuseChangedExpressions = false;
    private $expressionErrors = array();
    private static $disabledExpressionNotices = array();
    public function __construct()
    {
        if (App()->getConfig('DBVersion') < 172) {
            return $this->xssfilter = ($this->xssfilter && App()->getConfig('filterxsshtml'));
        }
        $this->xssfilter = (
            $this->xssfilter
            && ((defined('PHP_ENV')
                    && PHP_ENV == 'test'
                )
                || (($controller = App()->getController()) !== null
                    && (get_class($controller) !== 'ConsoleApplication')
                )
            )
... (363 lines truncated)
</file>

<file path="application/core/PluginBase.php">
<?php
class PluginBase extends \LimeSurvey\PluginManager\PluginBase
{
}
</file>

<file path="application/core/PluginEvent.php">
<?php
class PluginEvent extends \LimeSurvey\PluginManager\PluginEvent
{
}
</file>

<file path="application/core/PluginManager.php">
<?php
class PluginManager extends CApplicationComponent
{
}
</file>

<file path="application/core/StaticModel.php">
<?php
class StaticModel extends CModel
{
    public static function modelsAttributes()
    {
        return [];
    }
    public function attributeNames()
    {
        return [];
    }
    public static function findOne($pk)
    {
        $modelsAttributes = static::modelsAttributes();
        if (isset($modelsAttributes[$pk])) {
            $model = new static();
            $model->setAttributes($modelsAttributes[$pk], false);
            return $model;
        }
        return null;
    }
}
</file>

<file path="application/core/SurveyCommonAction.php">
<?php
use LimeSurvey\Menu\Menu;
use LimeSurvey\Menu\MenuItem;
class SurveyCommonAction extends CAction
{
    public function __construct($controller = null, $id = null)
    {
        parent::__construct($controller, $id);
        Yii::app()->request->updateNavigationStack();
        Yii::import('application.helpers.viewHelper');
    }
    public function runWithParams($params)
    {
        $sDefault = 'index';
        if (empty($params['sa'])) {
            $sSubAction = $sDefault;
        } else {
            $sSubAction = $params['sa'];
        }
        $oClass = new ReflectionClass($this);
        if (!$oClass->hasMethod($sSubAction)) {
            $sSubAction = 'run';
        }
        $params = $this->addPseudoParams($params);
        if (!empty($params['iSurveyId'])) {
            LimeExpressionManager::SetSurveyId($params['iSurveyId']);
        }
        $oMethod  = new ReflectionMethod($this, $sSubAction);
        $aActions = array_merge(App()->getController()->getActionClasses(), Yii::app()->getController()->getAdminModulesActionClasses());
        if (empty($aActions[$this->getId()]) || strtolower($oMethod->getDeclaringClass()->name) != strtolower((string) $aActions[$this->getId()]) || !$oMethod->isPublic()) {
... (428 lines truncated)
</file>

<file path="application/core/TopbarConfiguration.php">
<?php
class TopbarConfiguration
{
    private $viewName = '';
    /** @var string Topbar ID */
    private $id = '';
    /** @var array Data to be passed to the view */
    private $data = array();
    /** @var string Name of the view used to render the left side of the topbar */
    private $leftSideView = '';
    /** @var string Name of the view used to render the right side of the topbar */
    private $rightSideView = '';
    /** @var boolean Flag to hide the whole topbar */
    private $hide = false;
    /** @var array Maps views to the methods used to get their extra data */
    private $extraDataMapping = [
        'surveyTopbar_view' => 'TopbarConfiguration::getSurveyTopbarData',
        'responsesTopbarLeft_view' => 'TopbarConfiguration::getResponsesTopbarData',
        'responseViewTopbarRight_view' => 'TopbarConfiguration::getResponsesTopbarData',
        'surveyTopbarRight_view' => 'TopbarConfiguration::getRightSurveyTopbarData',
        'tokensTopbarLeft_view' => 'TopbarConfiguration::getTokensTopbarData',
        'tokensTopbarRight_view' => 'TopbarConfiguration::getTokensTopbarData',
        'questionTopbar_view' => 'TopbarConfiguration::getQuestionTopbarData',
        'questionTopbarLeft_view' => 'TopbarConfiguration::getQuestionTopbarData',
        'questionTopbarRight_view' => 'TopbarConfiguration::getQuestionTopbarData',
        'editQuestionTopbarLeft_view' => 'TopbarConfiguration::getQuestionTopbarData',
        'listquestionsTopbarLeft_view' => 'TopbarConfiguration::getQuestionTopbarData',
        'editGroupTopbarLeft_view' => 'TopbarConfiguration::getGroupTopbarData',
        'groupTopbarLeft_view' => 'TopbarConfiguration::getGroupTopbarData',
        'groupTopbarRight_view' => 'TopbarConfiguration::getGroupTopbarData',
... (286 lines truncated)
</file>

<file path="application/core/WrongTemplateVersionException.php">
<?php
class WrongTemplateVersionException extends CException
{
}
</file>

<file path="application/datavalueobjects/BlacklistResult.php">
<?php
namespace LimeSurvey\Datavalueobjects;
class BlacklistResult
{
    private $blacklisted;
    private $messages;
    public function __construct($blacklisted = false, $messages = [''])
    {
        $this->blacklisted = $blacklisted;
        if (!is_array($messages)) {
            $messages = [$messages];
        }
        $this->messages = $messages;
    }
    public function isBlacklisted(): bool
    {
        return $this->blacklisted;
    }
    public function setBlacklisted(bool $blacklisted): void
    {
        $this->blacklisted = $blacklisted;
    }
    public function getMessages()
    {
        return $this->messages;
    }
    public function setMessages($messages)
    {
        $this->messages = $messages;
    }
... (6 lines truncated)
</file>

<file path="application/datavalueobjects/CopyQuestionTextValues.php">
<?php
namespace LimeSurvey\Datavalueobjects;
class CopyQuestionTextValues
{
    private $questionText;
    private $help;
    public function __construct($questionText = '', $help = '')
    {
        $this->questionText = $questionText;
        $this->help = $help;
    }
    public function getQuestionText(): string
    {
        return $this->questionText;
    }
    public function setQuestionText(string $questionText): void
    {
        $this->questionText = $questionText;
    }
    public function getHelp(): string
    {
        return $this->help;
    }
    public function setHelp(string $help): void
    {
        $this->help = $help;
    }
}
</file>

<file path="application/datavalueobjects/CopyQuestionValues.php">
<?php
namespace LimeSurvey\Datavalueobjects;
class CopyQuestionValues
{
        private $questionCode;
        private $questionGroupId;
        private $oSurvey;
        private $questiontoCopy;
        private $questionPositionInGroup;
        private $questionL10nData;
        private $sourceSurveyId;
    public function getSourceSurveyId(): int
    {
        return $this->sourceSurveyId;
    }
    public function setSourceSurveyId(int $sourceSurveyId): void
    {
        $this->sourceSurveyId = $sourceSurveyId;
    }
    public function getQuestionPositionInGroup(): int
    {
        return $this->questionPositionInGroup;
    }
    public function setQuestionPositionInGroup(int $questionPositionInGroup): void
    {
        $this->questionPositionInGroup = $questionPositionInGroup;
    }
    public function getQuestionCode(): string
    {
        return $this->questionCode;
... (39 lines truncated)
</file>

<file path="application/datavalueobjects/EmailPluginInfo.php">
<?php
namespace LimeSurvey\Datavalueobjects;
class EmailPluginInfo
{
    public $pluginId;
    public $name;
    public $class;
    public function __construct($pluginId, $name, $class)
    {
        $this->pluginId = $pluginId;
        $this->name = $name;
        $this->class = $class;
    }
}
</file>

<file path="application/datavalueobjects/FormElement.php">
<?php
namespace LimeSurvey\Datavalueobjects;
class FormElement
{
    public $id;
    public $name;
    public $help;
    public $value;
    public $options;
    public function __construct(
        $id,
        $name,
        $help,
        $value,
        $options
    ) {
        $this->id = $id;
        $this->name = $name;
        $this->help = $help;
        $this->value = $value;
        $this->options = $options;
    }
}
</file>

<file path="application/datavalueobjects/GeneralOption.php">
<?php
namespace LimeSurvey\Datavalueobjects;
use Survey;
class GeneralOption
{
    public $name;
    public $title;
    public $inputType;
    public $formElement;
    public $disableInActive = false;
    public $disabled = false;
    public function __construct(
        $name,
        $title,
        $inputType,
        $formElement
    ) {
        $this->name = $name;
        $this->title = $title;
        $this->inputType = $inputType;
        $this->formElement = $formElement;
    }
    public function setDisableInActive(Survey $survey)
    {
        $this->disableInActive = true;
        if ($survey->active === 'Y') {
            $this->disabled = true;
        }
    }
}
... (1 lines truncated)
</file>

<file path="application/datavalueobjects/OperationResult.php">
<?php
namespace LimeSurvey\Datavalueobjects;
class OperationResult
{
    private $success;
    private $messages;
    public function __construct($success = false, $messages = [])
    {
        $this->success = $success;
        if (!is_array($messages)) {
            $messages = [$messages];
        }
        $this->messages = $messages;
    }
    public function isSuccess(): bool
    {
        return $this->success;
    }
    public function setSuccess(bool $success): void
    {
        $this->success = $success;
    }
    public function getMessages($type = null)
    {
        if ($type === null) {
            return $this->messages;
        }
        $messages = [];
        foreach ($this->messages as $message) {
            if ($message->getType() === $type) {
... (34 lines truncated)
</file>

<file path="application/datavalueobjects/SimpleSurveyValues.php">
<?php
namespace LimeSurvey\Datavalueobjects;
class SimpleSurveyValues
{
    public $baseLanguage;
    public $title;
    public $surveyGroupId;
    public $admin = 'inherit';
    public $adminEmail = 'inherit';
}
</file>

<file path="application/datavalueobjects/SwitchOption.php">
<?php
namespace LimeSurvey\Datavalueobjects;
class SwitchOption
{
    public $text;
    public $value;
    public function __construct($text, $value)
    {
        $this->text = $text;
        $this->value = $value;
    }
}
</file>

<file path="application/datavalueobjects/ThemeFileCategory.php">
<?php
namespace LimeSurvey\Datavalueobjects;
class ThemeFileCategory
{
    public $name;
    public $title;
    public $path;
    public $pathPrefix;
    public function __construct($name, $title, $path, $pathPrefix)
    {
        $this->name = $name;
        $this->title = $title;
        $this->path = $path;
        $this->pathPrefix = $pathPrefix;
    }
}
</file>

<file path="application/datavalueobjects/ThemeFileInfo.php">
<?php
namespace LimeSurvey\Datavalueobjects;
class ThemeFileInfo
{
    public $realPath;
    public $virtualPath;
    public $category;
    public function __construct($realPath, $virtualPath, $category)
    {
        $this->realPath = $realPath;
        $this->virtualPath = $virtualPath;
        $this->category = $category;
    }
}
</file>

<file path="application/datavalueobjects/TypedMessage.php">
<?php
namespace LimeSurvey\Datavalueobjects;
class TypedMessage
{
    private $type;
    private $message;
    public function __construct($message, $type = '')
    {
        $this->message = $message;
        $this->type = $type;
    }
    public function getType(): string
    {
        return $this->type;
    }
    public function setType(string $type): void
    {
        $this->type = $type;
    }
    public function getMessage(): string
    {
        return $this->message;
    }
    public function setMessage(string $message): void
    {
        $this->message = $message;
    }
}
</file>

<file path="application/errors/error_404.php">
<html>
<head>
<title>404 Page Not Found</title>
<style type="text/css">
body {
background-color:
margin:             40px;
font-family:        Lucida Grande, Verdana, Sans-serif;
font-size:          12px;
color:
}
border:
background-color:
padding:            20px 20px 12px 20px;
}
h1 {
font-weight:        normal;
font-size:          14px;
color:
margin:             0 0 4px 0;
}
</style>
</head>
<body>
    <div id="content">
        <h1><?php echo $heading; ?></h1>
        <?php echo $message; ?>
    </div>
</body>
</html>
... (1 lines truncated)
</file>

<file path="application/errors/error_db.php">
<html>
<head>
<title>Database Error</title>
<style type="text/css">
body {
background-color:
margin:             40px;
font-family:        Lucida Grande, Verdana, Sans-serif;
font-size:          12px;
color:
}
border:
background-color:
padding:            20px 20px 12px 20px;
}
h1 {
font-weight:        normal;
font-size:          14px;
color:
margin:             0 0 4px 0;
}
</style>
</head>
<body>
    <div id="content">
        <h1><?php echo $heading; ?></h1>
        <?php echo $message; ?>
    </div>
</body>
</html>
... (1 lines truncated)
</file>

<file path="application/errors/error_general.php">
<html>
<head>
<title>Error</title>
<style type="text/css">
body {
background-color:
margin:             40px;
font-family:        Lucida Grande, Verdana, Sans-serif;
font-size:          12px;
color:
}
border:
background-color:
padding:            20px 20px 12px 20px;
}
h1 {
font-weight:        normal;
font-size:          14px;
color:
margin:             0 0 4px 0;
}
</style>
</head>
<body>
    <div id="content">
        <h1><?php echo $heading; ?></h1>
        <?php echo $message; ?>
    </div>
</body>
</html>
... (1 lines truncated)
</file>

<file path="application/errors/error_php.php">
<div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;">
<h4>A PHP Error was encountered</h4>
<p>Severity: <?php echo $severity; ?></p>
<p>Message:  <?php echo $message; ?></p>
<p>Filename: <?php echo $filepath; ?></p>
<p>Line Number: <?php echo $line; ?></p>
</div>
</file>

<file path="application/errors/index.html">
<html>
<head>
	<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
</file>

<file path="application/exceptions/CPDBException.php">
<?php
namespace LimeSurvey\Exceptions;
use Exception;
class CPDBException extends Exception
{
}
</file>

<file path="application/extensions/AccordionWidget/views/accordion.php">
<div class="accordion <?=$class?>" id="<?= $id ?>">
    <?php foreach ($items as $item) : ?>
    <div class="accordion-item" style="<?=$item['style']?>">
        <h2 class="accordion-header" id="<?=$item['id']?>">
            <button
                class="accordion-button <?= $item['open'] ? '' : 'collapsed' ?>"
                type="button"
                data-bs-toggle="collapse"
                data-bs-target="#<?=$item['id']?>-body"
                aria-expanded="<?= $item['open'] ? 'true' : 'false' ?>"
                aria-controls="<?=$item['id']?>">
                <?=gT($item['title'])?>
            </button>
        </h2>
        <div
            id="<?=$item['id']?>-body"
            class="accordion-collapse collapse <?= $item['open'] ? 'show' : '' ?>"
            aria-labelledby="<?=$item['id']?>"
           >
            <div class="accordion-body">
                <?=$item['content']?>
            </div>
        </div>
    </div>
    <?php endforeach; ?>
</div>
</file>

<file path="application/extensions/AccordionWidget/AccordionWidget.php">
<?php
class AccordionWidget extends CWidget
{
    public $id = null;
    public $items = [];
    public $class = null;
    public function run()
    {
        $this->render('accordion', [
            'id' => $this->id ?? 'accordion_' . bin2hex(random_bytes(2)),
            'items' => $this->normaliseItems($this->items),
            'class' => $this->class
        ]);
    }
    public function normaliseItems($items)
    {
        return array_map(function ($item) {
            return [
                'id' => $item['id'] ?? $this->id . '_item_' . bin2hex(random_bytes(2)),
                'title' => $item['title'] ?? null,
                'content' => $item['content'] ?? null,
                'open' => $item['open'] ?? true,
                'style' => $item['style'] ?? ''
            ];
        }, $items);
    }
}
</file>

<file path="application/extensions/admin/BoxesWidget/views/box.php">
<?php
    include_once './application/extensions/admin/BoxesWidget/BoxesWidget.php';
?>
<?php if (!empty($items)) : ?>
    <?php foreach ($items as $item) : ?>
        <?php if ($item['type'] == BoxesWidget::TYPE_PRODUCT) : ?>
            <div class="box-widget-card align-middle d-inline-block"
                 data-url="<?php echo $item['link'] ?>"
                 role="link"
                 tabindex="0">
                <div class="box-widget-card-body">
                    <div class="box-widget-card-header">
                        <div class="box-widget-card-title">
                            <?php
                            $surveyls_title = "";
                            $defaultlanguage = $item['survey']->defaultlanguage;
                            if (isset($defaultlanguage)) {
                                $surveyls_title = $defaultlanguage->surveyls_title;
                            }
                            ?>
                            <?php echo viewHelper::filterScript($surveyls_title); ?>
                        </div>
                    </div>
                    <div class="box-widget-card-text">
                        <div class="box-widget-card-date">
                            <?= $item['survey']->getLastModifiedDate() ?>
                        </div>
                        <div class="box-widget-card-status">
                            <?= $item['survey']->getRunning() ?>
                        </div>
... (74 lines truncated)
</file>

<file path="application/extensions/admin/BoxesWidget/views/boxes.php">
<?php
?>
<div>
    <?php if ($this->searchBox) : ?>
        <?php $this->controller->widget('ext.admin.SearchBoxWidget.SearchBoxWidget', [
            'model'      => new Survey('search'),
            'onlyfilter' => true,
            'switch'     => $this->switch
        ]);
        ?>
    <?php endif; ?>
        <div class="row">
            <div class="box-widget p-0">
                <div class="box-widget-list">
                    <?php $this->render('box', ['items' => $items]); ?>
                </div>
                <div class="box-widget-loadmore">
                    <a href="#" id="load-more" data-page="1" data-limit="<?= $limit ?>" data-max-count="<?= $itemsCount ?>">
                        <?= gT('Load more...') ?>
                    </a>
                </div>
            </div>
        </div>
</div>
</file>

<file path="application/extensions/admin/BoxesWidget/BoxesWidget.php">
<?php
class BoxesWidget extends CWidget
{
    const TYPE_PRODUCT = 0;
    const TYPE_PRODUCT_GROUP = 1;
    const TYPE_LINK = 2;
    const TYPE_PLACEHOLDER = 3;
    public array $items = [];
    public int $limit = 5;
    public bool $searchBox = true;
    public bool $switch = false;
    public function init(): void
    {
        $this->registerClientScript();
    }
    public function registerClientScript(): void
    {
        App()->getClientScript()->registerScriptFile(
            App()->getAssetManager()->publish(dirname(__FILE__) . '/assets/boxes-widget.js'),
            CClientScript::POS_END
        );
    }
    public function run()
    {
        $boxes = [];
        $itemsCount = 0;
        foreach ($this->items as $item) {
            $item = (object)$item;
            if (isset($item->type) && $item->type == self::TYPE_LINK) {
                $boxes[] = [
... (101 lines truncated)
</file>

<file path="application/extensions/admin/grid/BarActionsWidget/views/action_list.php">
<?php
?>
<div id="<?= 'action-list-' . $id; ?>" class="action-list">
    <?php foreach ($items as $item) : ?>
        <a href="<?= $item['enabledCondition'] ? $item['url'] : '#' ?>"
           class="<?= $item['enabledCondition'] ? '' : 'disabled' ?>"
            <?php if ($item['enabledCondition']) : ?>
                data-bs-toggle="tooltip"
                data-bs-original-title="<?= $item['title'] ?>"
            <?php endif; ?>
        >
            <i class="<?= $item['iconClass'] ?>"></i>
        </a>
    <?php endforeach; ?>
</div>
</file>

<file path="application/extensions/admin/grid/BarActionsWidget/BarActionsWidget.php">
<?php
Yii::import('zii.widgets.grid.CGridView');
class BarActionsWidget extends CWidget
{
    private static $id = 1;
    public $items = [];
    public function run(): void
    {
        self::$id++;
        $this->render('action_list', [
            'items' => $this->items,
            'id' => self::$id
        ]);
    }
}
</file>

<file path="application/extensions/admin/grid/ColumnFilterWidget/views/columns_filter.php">
<?php
?>
<!-- Modal -->
<div class="modal fade" id="<?= $modalId ?>" tabindex="-1" role="dialog" data-target="<?= $ajaxUpdate ?>" aria-labelledby="<?= $modalId ?>-label" aria-modal="true">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <form
                class="pjax"
                method="POST"
                data-filtered-columns=<?php echo json_encode($filteredColumns) ?>>
                <?php
                Yii::app()->getController()->renderPartial(
                    '/layouts/partial_modals/modal_header',
                    ['modalTitle' => gT('Select columns'), 'modalTitleId' => $modalId . '-label']
                );
                ?>
                <div class="modal-body">
                    <div class="<?= $modalId ?>-checkbox-buttons">
                        <button role="button" type="button" id="<?= $modalId ?>-selectall" class="btn btn-outline-secondary">
                            <span class="ri-check-fill"></span>
                            &nbsp;
                            <?php eT("Select all"); ?>
                        </button>
                        <button role="button" type="button" id="<?= $modalId ?>-clear" class="btn btn-outline-secondary">
                            <span class="ri-delete-bin-fill text-danger"></span>
                            &nbsp;
                            <?php eT("Clear selection"); ?>
                        </button>
                    </div>
                    <div class="mb-3 responses-multiselect-checkboxes">
... (32 lines truncated)
</file>

<file path="application/extensions/admin/grid/ColumnFilterWidget/ColumnFilterWidget.php">
<?php
Yii::import('zii.widgets.grid.CGridView');
class ColumnFilterWidget extends CWidget
{
    public $filteredColumns = [];
    public $filterableColumns = [];
    public $columnsData;
    public $modalId;
    public $model;
    public $ajaxUpdate;
    public function init(): void
    {
        $this->registerClientScript();
    }
    public function run(): void
    {
        $this->renderActions();
    }
    public function renderActions(): void
    {
        $this->render('columns_filter', [
            'model' => $this->model,
            'modalId' => $this->modalId,
            'filterableColumns' => $this->filterableColumns,
            'filteredColumns' => $this->filteredColumns,
            'columnsData' => $this->columnsData,
            'ajaxUpdate' => $this->ajaxUpdate
        ]);
    }
    public function registerClientScript(): void
... (10 lines truncated)
</file>

<file path="application/extensions/admin/grid/FloatingActionsWidget/actions/AttributeListMassiveActions.php">
<?php
namespace actions;
class AttributeListMassiveActions
{
    public static function getActions(): array
    {
        $buttons = [];
        if (\Permission::model()->hasGlobalPermission('participantpanel', 'delete')) {
            $buttons[] = [
                'type'          => 'action',
                'action'        => 'delete',
                'url'           => \App()->createUrl('/admin/participants/sa/deleteAttributes'),
                'iconClasses'   => 'ri-delete-bin-fill text-danger',
                'text'          => \gT('Delete'),
                'grid-reload'   => 'yes',
                'actionType'    => 'modal',
                'modalType'     => 'cancel-delete',
                'keepopen'      => 'no',
                'sModalTitle'   => \gT('Delete'),
                'htmlModalBody' => \gT('Do you really want to delete this attribute?'),
                'aCustomDatas'  => [],
            ];
        }
        return $buttons;
    }
}
</file>

<file path="application/extensions/admin/grid/FloatingActionsWidget/actions/FailedEmailMassiveActions.php">
<?php
namespace actions;
class FailedEmailMassiveActions
{
    public static function getActions(int $surveyId, array $permissions): array
    {
        $actions = [];
        if (!empty($permissions['update'])) {
            $actions[] = [
                'type'          => 'action',
                'action'        => 'resend',
                'url'           => \Yii::app()->createUrl('failedEmail/resend/', ['surveyid' => $surveyId]),
                'iconClasses'   => 'ri-loop-right-line',
                'text'          => gT('Resend emails'),
                'grid-reload'   => 'yes',
                'actionType'    => 'modal',
                'modalType'     => 'cancel-resend',
                'keepopen'      => 'yes',
                'sModalTitle'   => gT('Resend selected emails'),
                'htmlModalBody' => \Yii::app()->getController()->renderPartial(
                    '/failedEmail/partials/modal/resend_body',
                    [],
                    true
                ),
                'aCustomDatas'  => [
                    ['name' => 'surveyid', 'value' => $surveyId],
                ],
            ];
        }
        if (!empty($permissions['update']) && !empty($permissions['delete'])) {
... (25 lines truncated)
</file>

<file path="application/extensions/admin/grid/FloatingActionsWidget/actions/ParticipantListMassiveActions.php">
<?php
namespace actions;
class ParticipantListMassiveActions
{
    public static function getActions(array $permissions): array
    {
        $actions = [
            [
                'type' => 'action',
                'action' => 'batchEdit',
                'url' => \App()->createUrl('/admin/participants/sa/batchEdit/'),
                'iconClasses' => 'ri-pencil-line',
                'text' => gT('Batch edit'),
                'grid-reload' => 'yes',
                'actionType' => 'modal',
                'modalType' => 'cancel-save',
                'keepopen' => 'yes',
                'sModalTitle' => gT('Batch edit the participants'),
                'htmlModalBody' => \Yii::app()->getController()->renderPartial(
                    '/admin/participants/massive_actions/_update',
                    [],
                    true
                ),
            ],
            [
                'type' => 'action',
                'action' => 'export',
                'url' => '#',
                'iconClasses' => 'ri-download-line',
                'text' => gT('Export'),
... (62 lines truncated)
</file>

<file path="application/extensions/admin/grid/FloatingActionsWidget/actions/QuestionListMassiveActions.php">
<?php
namespace actions;
use Yii;
class QuestionListMassiveActions
{
    public static function getActions($model, $oSurvey): array
    {
        $actions = [];
        $surveyId  = $oSurvey->sid;
        $hasUpdate = \Permission::model()->hasSurveyPermission($surveyId, 'surveycontent', 'update');
        $hasDelete = \Permission::model()->hasSurveyPermission($surveyId, 'surveycontent', 'delete');
        if (!$oSurvey->isActive && $hasUpdate) {
            $actions[] = [
                'type' => 'action',
                'action' => 'set-group-position',
                'url' => App()->createUrl('questionAdministration/setMultipleQuestionGroup/'),
                'iconClasses' => 'ri-folder-settings-line',
                'text' => gT('Set question group and position'),
                'grid-reload' => 'yes',
                'actionType' => 'modal',
                'modalType' => 'cancel-apply',
                'keepopen' => 'no',
                'yes' => gT('Apply'),
                'no' => gT('Cancel'),
                'sModalTitle' => gT('Set question group'),
                'htmlModalBody' => Yii::app()->getController()->renderPartial(
                    '/admin/survey/Question/massive_actions/_set_question_group_position',
                    ['model' => $model, 'oSurvey' => $oSurvey],
                    true
                ),
... (122 lines truncated)
</file>

<file path="application/extensions/admin/grid/FloatingActionsWidget/actions/QuestionThemeMassiveActions.php">
<?php
namespace actions;
use Permission;
class QuestionThemeMassiveActions
{
    public static function getActions(): array
    {
        $actions = [];
        if (!Permission::model()->hasGlobalPermission('templates', 'delete')) {
            return $actions;
        }
        $actions[] = [
            'type'          => 'action',
            'action'        => 'Uninstall',
            'url'           => App()->createUrl('themeOptions/uninstallMultiple/'),
            'iconClasses'   => 'ri-delete-bin-fill',
            'text'          => gT('Uninstall'),
            'grid-reload'   => 'yes',
            'actionType'    => 'modal',
            'modalType'     => 'cancel-apply',
            'keepopen'      => 'yes',
            'showSelected'  => 'yes',
            'selectedUrl'   => App()->createUrl('themeOptions/selectedItems/'),
            'sModalTitle'   => gT('Uninstall themes'),
            'htmlModalBody' => gT('Are you sure you want to uninstall the selected themes?'),
        ];
        return $actions;
    }
}
</file>

<file path="application/extensions/admin/grid/FloatingActionsWidget/actions/QuotaListMassiveActions.php">
<?php
namespace actions;
use LimeSurvey\Models\Services\Quotas;
class QuotaListMassiveActions
{
    public static function getActions(int $surveyId, \Quota $oQuota, array $aQuotaLanguageSettings): array
    {
        $buttons = [];
        if (\Permission::model()->hasSurveyPermission($surveyId, 'quotas', 'update')) {
            $buttons[] = [
                'type'          => 'action',
                'action'        => Quotas::MASSIVE_ACTION_ACTIVATE,
                'url'           => \App()->createUrl('quotas/massiveAction', ['action' => Quotas::MASSIVE_ACTION_ACTIVATE, 'surveyid' => $surveyId]),
                'iconClasses'   => 'ri-play-fill',
                'text'          => \gT('Activate'),
                'grid-reload'   => 'yes',
                'actionType'    => 'modal',
                'modalType'     => 'cancel-apply',
                'keepopen'      => 'no',
                'sModalTitle'   => \gT('Activate quotas'),
                'htmlModalBody' => \gT('Are you sure you want to activate all selected quotas?'),
            ];
            $buttons[] = [
                'type'          => 'action',
                'action'        => Quotas::MASSIVE_ACTION_DEACTIVATE,
                'url'           => \App()->createUrl('quotas/massiveAction', ['action' => Quotas::MASSIVE_ACTION_DEACTIVATE, 'surveyid' => $surveyId]),
                'iconClasses'   => 'ri-stop-fill',
                'text'          => \gT('Deactivate'),
                'grid-reload'   => 'yes',
                'actionType'    => 'modal',
... (47 lines truncated)
</file>

<file path="application/extensions/admin/grid/FloatingActionsWidget/actions/ResponseListMassiveActions.php">
<?php
namespace actions;
class ResponseListMassiveActions
{
    public static function getActions(int $surveyId): array
    {
        $buttons = [];
        if (\Permission::model()->hasSurveyPermission($surveyId, 'responses', 'read')) {
            $buttons[] = [
                'type'               => 'action',
                'action'             => 'export',
                'url'                => \App()->createUrl('admin/export/sa/exportresults/', ['surveyId' => $surveyId]),
                'iconClasses'        => 'ri-download-line',
                'text'               => \gT('Export'),
                'aLinkSpecificDatas' => [
                    'input-name'      => 'responseIds',
                    'input-separator' => ',',
                    'target'          => '_self',
                ],
                'actionType'         => 'redirect',
            ];
            $buttons[] = [
                'type'        => 'action',
                'action'      => 'downloadZip',
                'url'         => \App()->createUrl('responses/downloadfiles/', ['surveyId' => $surveyId, 'responseIds' => '']),
                'iconClasses' => 'ri-download-line',
                'text'        => \gT('Download files'),
                'grid-reload' => 'no',
                'actionType'  => 'window-location-href',
            ];
... (41 lines truncated)
</file>

<file path="application/extensions/admin/grid/FloatingActionsWidget/actions/SurveyListMassiveActions.php">
<?php
namespace actions;
use Yii;
class SurveyListMassiveActions
{
    public static function getActions(): array
    {
        return [
            [
                'type' => 'action',
                'action' => 'updateTheme',
                'url' => App()->createUrl('/surveyAdministration/changeMultipleTheme/'),
                'iconClasses' => 'ri-paint-fill',
                'text' => gT('Set survey theme'),
                'grid-reload' => 'no',
                'actionType' => 'modal',
                'modalType' => 'cancel-apply',
                'showSelected' => 'yes',
                'selectedUrl' => App()->createUrl('/surveyAdministration/renderItemsSelected/'),
                'keepopen' => 'yes',
                'sModalTitle' => gT('Apply survey theme'),
                'htmlModalBody' => Yii::app()->getController()->renderFile(
                    dirname(__FILE__) . '/../../../survey/ListSurveysWidget/views/massive_actions/_select_survey_theme.php',
                    [],
                    true
                ),
            ],
            [
                'type' => 'action',
                'action' => 'updateSurveygroup',
... (108 lines truncated)
</file>

<file path="application/extensions/admin/grid/FloatingActionsWidget/actions/SurveyMenuEntriesMassiveActions.php">
<?php
namespace actions;
class SurveyMenuEntriesMassiveActions
{
    public static function getActions(): array
    {
        $buttons = [];
        if (\Permission::model()->hasGlobalPermission('settings', 'update')) {
            $buttons[] = [
                'type' => 'action',
                'action' => 'batchEdit',
                'url' => \App()->createUrl('/admin/menuentries/sa/batchEdit/'),
                'iconClasses' => 'ri-pencil-line',
                'text' => \gT('Batch edit'),
                'grid-reload' => 'yes',
                'actionType' => 'modal',
                'modalType' => 'cancel-save',
                'keepopen' => 'yes',
                'yes' => \gT('Save'),
                'no' => \gT('Cancel'),
                'sModalTitle' => \gT('Batch edit the menu entries'),
                'htmlModalBody' => \Yii::app()->getController()->renderPartial(
                    './surveymenu_entries/massive_action/_update',
                    [],
                    true
                ),
            ];
        }
        if (\Permission::model()->hasGlobalPermission('settings', 'delete')) {
            $buttons[] = [
... (19 lines truncated)
</file>

<file path="application/extensions/admin/grid/FloatingActionsWidget/actions/SurveyMenuListMassiveActions.php">
<?php
namespace actions;
class SurveyMenuListMassiveActions
{
    public static function getActions(): array
    {
        $buttons = [];
        if (\Permission::model()->hasGlobalPermission('settings', 'update')) {
            $buttons[] = [
                'type' => 'action',
                'action' => 'batchEdit',
                'url' => \App()->createUrl('/admin/menus/sa/batchEdit/'),
                'iconClasses' => 'ri-pencil-line',
                'text' => \gT('Batch edit'),
                'grid-reload' => 'yes',
                'actionType' => 'modal',
                'modalType' => 'cancel-save',
                'keepopen' => 'yes',
                'yes' => \gT('Save'),
                'no' => \gT('Cancel'),
                'sModalTitle' => \gT('Batch edit the menus'),
                'htmlModalBody' => \Yii::app()->getController()->renderPartial(
                    './surveymenu/massive_action/_update',
                    [],
                    true
                ),
            ];
        }
        if (\Permission::model()->hasGlobalPermission('settings', 'delete')) {
            $buttons[] = [
... (19 lines truncated)
</file>

<file path="application/extensions/admin/grid/FloatingActionsWidget/actions/SurveyThemeMassiveActions.php">
<?php
namespace actions;
use Permission;
class SurveyThemeMassiveActions
{
    public static function getActions(): array
    {
        $actions = [];
        if (Permission::model()->hasGlobalPermission('templates', 'update')) {
            $actions[] = [
                'type'          => 'action',
                'action'        => 'reset',
                'url'           => App()->createUrl('themeOptions/resetMultiple/'),
                'iconClasses'   => 'ri-refresh-line',
                'text'          => gT('Reset'),
                'grid-reload'   => 'yes',
                'actionType'    => 'modal',
                'modalType'     => 'cancel-apply',
                'keepopen'      => 'yes',
                'showSelected'  => 'yes',
                'selectedUrl'   => App()->createUrl('themeOptions/selectedItems/'),
                'yes'           => gT('Reset'),
                'no'            => gT('Cancel'),
                'sModalTitle'   => gT('Reset themes'),
                'htmlModalBody' => gT('Are you sure you want to reset the selected themes?'),
            ];
        }
        if (Permission::model()->hasGlobalPermission('templates', 'delete')) {
            $actions[] = [
                'type'          => 'action',
... (19 lines truncated)
</file>

<file path="application/extensions/admin/grid/FloatingActionsWidget/actions/TokenListMassiveActions.php">
<?php
namespace actions;
class TokenListMassiveActions
{
    public static function getActions(int $surveyId): array
    {
        $buttons = [];
        if (\Permission::model()->hasSurveyPermission($surveyId, 'tokens', 'update')) {
            $aLanguageCodes = \Survey::model()->findByPk($surveyId)->getAllLanguages();
            $aLanguages = [];
            foreach ($aLanguageCodes as $code) {
                $aLanguages[$code] = getLanguageNameFromCode($code, false);
            }
            $buttons[] = [
                'type'           => 'action',
                'action'         => 'edit',
                'url'            => \App()->createUrl('/admin/tokens/sa/editMultiple/'),
                'iconClasses'    => 'ri-pencil-fill',
                'text'           => \gT('Batch-edit'),
                'grid-reload'    => 'yes',
                'actionType'     => 'modal',
                'largeModalView' => true,
                'modalType'      => 'cancel-save',
                'keepopen'       => 'yes',
                'sModalTitle'    => \gT('Batch-edit participants'),
                'htmlModalBody'  => \Yii::app()->getController()->renderFile(
                    \Yii::app()->getBasePath() . '/views/admin/token/massive_actions/_update.php',
                    [
                        'dateformatdetails' => getDateFormatData(\Yii::app()->session['dateformat']),
                        'aLanguages'        => $aLanguages,
... (83 lines truncated)
</file>

<file path="application/extensions/admin/grid/FloatingActionsWidget/actions/UserManagementMassiveActions.php">
<?php
namespace actions;
class UserManagementMassiveActions
{
    public static function getActions(): array
    {
        $canUsersUpdate = \Permission::model()->hasGlobalPermission('users', 'update');
        $canUsersDelete = \Permission::model()->hasGlobalPermission('users', 'delete');
        $aActions = [];
        if ($canUsersUpdate) {
            $aActions[] = [
                'type'          => 'action',
                'action'        => 'resendlogindata',
                'url'           => \App()->createUrl('userManagement/batchSendAndResetLoginData'),
                'iconClasses'   => 'ri-refresh-line',
                'text'          => gT('Resend login data'),
                'grid-reload'   => 'yes',
                'actionType'    => 'modal',
                'modalType'     => 'cancel-resend',
                'keepopen'      => 'yes',
                'showSelected'  => 'yes',
                'selectedUrl'   => \App()->createUrl('userManagement/renderSelectedItems/'),
                'sModalTitle'   => gT('Resend login data'),
                'htmlModalBody' => gT('Are you sure you want to reset and resend selected users login data?'),
            ];
            $aActions[] = [
                'type'              => 'action',
                'action'            => 'batchPermissions',
                'url'               => \App()->createUrl('userManagement/batchPermissions'),
                'iconClasses'       => 'ri-lock-2-line',
... (114 lines truncated)
</file>

<file path="application/extensions/admin/grid/FloatingActionsWidget/actions/UserRoleListMassiveActions.php">
<?php
namespace actions;
class UserRoleListMassiveActions
{
    public static function getActions(): array
    {
        return [
            [
                'type'               => 'action',
                'action'             => 'batchExport',
                'url'                => \App()->createUrl('userRole/batchExport'),
                'iconClasses'        => 'ri-download-line',
                'text'               => \gT('Bulk export roles'),
                'grid-reload'        => 'no',
                'actionType'         => 'redirect',
                'aLinkSpecificDatas' => [
                    'input-name'      => 'sItems',
                    'input-separator' => ',',
                    'target'          => '_self',
                ],
            ],
            [
                'type'          => 'action',
                'action'        => 'delete',
                'url'           => \App()->createUrl('userRole/batchDelete'),
                'iconClasses'   => 'ri-delete-bin-fill',
                'btnClass'      => 'floating-delete-button',
                'text'          => \gT('Delete'),
                'grid-reload'   => 'yes',
                'actionType'    => 'modal',
... (9 lines truncated)
</file>

<file path="application/extensions/admin/grid/FloatingActionsWidget/views/floating_bar.php">
<?php
$gridId = CHtml::encode($this->gridId);
$pk     = CHtml::encode($this->pk);
$selectAllUrl = $this->selectAllUrl ? CHtml::encode($this->selectAllUrl) : '';
?>
<!-- FloatingActionsWidget: bar for grid "<?= $gridId ?>" -->
<div
    id="floating-actions-bar-<?= $gridId ?>"
    class="floating-actions-bar"
    data-grid-id="<?= $gridId ?>"
    data-pk="<?= $pk ?>"
    <?php if ($selectAllUrl): ?>data-select-all-url="<?= $selectAllUrl ?>"<?php endif; ?>
    role="toolbar"
    aria-label="<?= gT('Actions for selected items') ?>"
>
    <!-- Selected-item counter -->
    <span class="reg-12" aria-live="polite" aria-atomic="true">
        <span class="floating-actions-count-number">0</span>&nbsp;<?= gT('selected') ?>
    </span>
    <div class="floating-actions-separator" role="separator" aria-hidden="true"></div>
    <?php if ($selectAllUrl || $this->lsSelectAllEnabled): ?>
        <!-- Separator before "Select all" -->
        <!-- Select all button -->
        <button
            type="button"
            class="floating-actions-btn floating-actions-select-all"
            title="<?= gT('Select all') ?>"
        >
            <i class="ri-check-line"></i>
            <?= gT('Select all') ?>
... (90 lines truncated)
</file>

<file path="application/extensions/admin/grid/FloatingActionsWidget/FloatingActionsWidget.php">
<?php
class FloatingActionsWidget extends CWidget
{
    public $pk;
    public $gridId;
    public $aActions = [];
    public $selectAllUrl;
    public $lsSelectAllEnabled = false;
    private const MODAL_VIEW_NAMES = [
        'yes-no',
        'empty',
        'yes-no-lg',
        'empty-lg',
        'cancel-apply',
        'cancel-change',
        'cancel-resend',
        'cancel-add',
        'cancel-save',
        'cancel-delete',
        'cancel-export',
    ];
    private const MASSIVE_MODALS_DIR = __DIR__ . '/../MassiveActionsWidget/views/modals/';
    public function run(): void
    {
        $this->render('floating_bar');
        $this->renderAllModals();
        Yii::app()->getClientScript()->registerScriptFile(
            Yii::app()->getAssetManager()->publish(dirname(__FILE__) . '/assets/floatingActions.js'),
            CClientScript::POS_END
        );
... (87 lines truncated)
</file>

<file path="application/extensions/admin/grid/GridActionsWidget/views/action_dropdown.php">
<?php
?>
<div id="<?= 'dropdown_' . $id; ?>" class="dropdown ls-action_dropdown">
    <button class="ls-dropdown-toggle" aria-label="<?= gT('Action Menu'); ?>" data-bs-toggle="dropdown" type="button"
            aria-expanded="false">
        <i class="ri-more-fill"></i>
    </button>
    <ul id="<?= 'dropdownmenu_' . $id; ?>" class="dropdown-menu">
        <?php foreach ($dropdownItems as $dropdownItem): ?>
            <?php $enabledCondition = $dropdownItem['enabledCondition'] ?? true ?>
            <?php
            if (isset($dropdownItem['submenu']) && $dropdownItem['submenu']) { ?>
                <li class="has-submenu">
                <a href="#" class="dropdown-item d-flex justify-content-between align-items-center"
                   data-bs-toggle="dropdown-submenu" role="button" aria-expanded="false">
                    <?= CHtml::encode($dropdownItem['title']) ?>
                </a>
                <ul class="dropdown-submenu">
                    <?php
                    foreach ($dropdownItem['submenu_items'] as $subItem) { ?>
                        <li>
                            <?php
                            $this->render(
                                'dropdown_item',
                                [
                                    'tooltip' => $subItem['tooltip'] ?? '',
                                    'title' => $subItem['title'],
                                    'linkId' => $subItem['linkId'] ?? '',
                                    'linkClass' => $subItem['linkClass'] ?? '',
                                    'url' => $subItem['url'] ?? '#',
... (32 lines truncated)
</file>

<file path="application/extensions/admin/grid/GridActionsWidget/views/dropdown_item.php">
<?php
?>
<div data-bs-toggle="tooltip" title="<?= $tooltip ?? '' ?>">
    <a <?= !empty($linkId) ? 'id="' . $linkId . '"' : '' ?>
       class="dropdown-item <?= $enabledCondition ? "" : "disabled" ?> <?= $linkClass ?? '' ?>"
       href="<?= $url ?? '?>"
       role="button"
       <?= !$enabledCondition ? 'aria-disabled="true" tabindex="-1"' : '' ?>
        <?php if (isset($linkAttributes) && is_array($linkAttributes)) : ?>
            <?php foreach ($linkAttributes as $attribute => $value) : ?>
                <?= "$attribute='$value'" ?>
            <?php endforeach; ?>
        <?php endif; ?>>
        <?php if (isset($iconClass)) : ?>
            <i class="<?= $iconClass ?>"></i>
        <?php endif; ?>
        <?= $title ?>
    </a>
</div>
</file>

<file path="application/extensions/admin/grid/GridActionsWidget/GridActionsWidget.php">
<?php
Yii::import('zii.widgets.grid.CGridView');
class GridActionsWidget extends CWidget
{
    private static $id = 1;
    public $dropdownItems = [];
    public function init(): void
    {
        $this->registerClientScript();
    }
    public function run(): void
    {
        self::$id++;
        $this->renderActions();
    }
    public function renderActions(): void
    {
        $this->render('action_dropdown', [
            'dropdownItems' => $this->dropdownItems,
            'id' => self::$id
        ]);
    }
    public function registerClientScript(): void
    {
        App()->getClientScript()->registerScriptFile(
            App()->getAssetManager()->publish(dirname(__FILE__) . '/assets/action_dropdown.js'),
            CClientScript::POS_END
        );
        App()->clientScript->registerScriptFile(
            App()->getAssetManager()->publish(dirname(__FILE__, 2) . '/assets/rowLink.js'),
... (5 lines truncated)
</file>

<file path="application/extensions/admin/grid/MassiveActionsWidget/views/modals/_cancel_base.php">
<?php
?>
<!-- Modal confirmation for <?php echo $aAction['action']; ?> -->
<div id="<?php echo CHtml::encode($massiveModalDomId); ?>"
     class="modal fade"
     role="dialog"
     aria-modal="true"
     aria-labelledby="<?php echo CHtml::encode($massiveModalTitleId . ' ' . $massiveModalDialogSrId); ?>"
     data-keepopen="<?php echo $aAction['keepopen']; ?>"
     data-grid-reload="<?php echo $aAction['grid-reload'] ?? 'no'; ?>"
     data-show-selected="<?php echo $showSelected; ?>"
     data-selected-url="<?php echo $selectedUrl; ?>"
>
    <div class="modal-dialog modal-dialog-scrollable <?php echo $largeModalView; ?>" role="document">
        <!-- Modal content-->
        <div class="modal-content" style="text-align:left; color:#000">
            <?php
            Yii::app()->getController()->renderPartial(
                '/layouts/partial_modals/modal_header',
                [
                    'modalTitle'   => $aAction['sModalTitle'],
                    'modalTitleId' => $massiveModalTitleId,
                ]
            );
            ?>
            <div class="modal-body">
                <div class="modal-body-text"><?php echo $aAction['htmlModalBody']; ?></div>
                <!-- shows list of selected items in the modal-->
                <div class="selected-items-list"></div>
                <?php if (isset($aAction['aCustomDatas'])) : ?>
... (31 lines truncated)
</file>

<file path="application/extensions/admin/grid/MassiveActionsWidget/views/modals/cancel-add.php">
<?php
$footerPartial = '/layouts/partial_modals/modal_footer_canceladd';
include __DIR__ . '/_cancel_base.php';
</file>

<file path="application/extensions/admin/grid/MassiveActionsWidget/views/modals/cancel-apply.php">
<?php
$footerPartial = '/layouts/partial_modals/modal_footer_cancelapply';
include __DIR__ . '/_cancel_base.php';
</file>

<file path="application/extensions/admin/grid/MassiveActionsWidget/views/modals/cancel-change.php">
<?php
$footerPartial = '/layouts/partial_modals/modal_footer_cancelchange';
include __DIR__ . '/_cancel_base.php';
</file>

<file path="application/extensions/admin/grid/MassiveActionsWidget/views/modals/cancel-delete.php">
<?php
$footerPartial = '/layouts/partial_modals/modal_footer_canceldelete';
include __DIR__ . '/_cancel_base.php';
</file>

<file path="application/extensions/admin/grid/MassiveActionsWidget/views/modals/cancel-export.php">
<?php
$footerPartial = '/layouts/partial_modals/modal_footer_cancelexport';
include __DIR__ . '/_cancel_base.php';
</file>

<file path="application/extensions/admin/grid/MassiveActionsWidget/views/modals/cancel-resend.php">
<?php
$footerPartial = '/layouts/partial_modals/modal_footer_cancelresend';
include __DIR__ . '/_cancel_base.php';
</file>

<file path="application/extensions/admin/grid/MassiveActionsWidget/views/modals/cancel-save.php">
<?php
$footerPartial = '/layouts/partial_modals/modal_footer_cancelsave';
include __DIR__ . '/_cancel_base.php';
</file>

<file path="application/extensions/admin/grid/MassiveActionsWidget/views/modals/empty-lg.php">
<?php
?>
<!-- Modal confirmation for <?php echo $aAction['action']; ?> -->
<div id="<?php echo CHtml::encode($massiveModalDomId); ?>"
     class="modal fade"
     role="dialog"
     aria-modal="true"
     aria-labelledby="<?php echo CHtml::encode($massiveModalTitleId . ' ' . $massiveModalDialogSrId); ?>"
>
    <div class="modal-dialog modal-lg" role="document">
        <!-- Modal content-->
        <div class="modal-content">
            <?php
            Yii::app()->getController()->renderPartial(
                '/layouts/partial_modals/modal_header',
                [
                    'modalTitle'   => $aAction['sModalTitle'],
                    'modalTitleId' => $massiveModalTitleId,
                ]
            );
            ?>
            <div class="modal-body">
                <?php echo $aAction['htmlModalBody']; ?>
            </div>
            <div class="modal-footer modal-footer-buttons">
                <?php foreach ($aAction['htmlFooterButtons'] as $buttonHtml) : ?>
                    <?php echo $buttonHtml; ?>
                <?php endforeach; ?>
            </div>
        </div>
... (3 lines truncated)
</file>

<file path="application/extensions/admin/grid/MassiveActionsWidget/views/modals/empty.php">
<?php
?>
<!-- Modal confirmation for <?php echo $aAction['action']; ?> -->
<div id="<?php echo CHtml::encode($massiveModalDomId); ?>"
     class="modal fade"
     role="dialog"
     aria-modal="true"
     aria-labelledby="<?php echo CHtml::encode($massiveModalTitleId . ' ' . $massiveModalDialogSrId); ?>"
>
    <div class="modal-dialog" role="document">
        <!-- Modal content-->
        <div class="modal-content">
            <?php
            Yii::app()->getController()->renderPartial(
                '/layouts/partial_modals/modal_header',
                [
                    'modalTitle'   => $aAction['sModalTitle'],
                    'modalTitleId' => $massiveModalTitleId,
                ]
            );
            ?>
            <div class="modal-body">
                <div class="modal-body-text"><?php echo $aAction['htmlModalBody']; ?></div>
            </div>
            <div class="modal-footer modal-footer-buttons">
                <?php foreach ($aAction['htmlFooterButtons'] as $buttonHtml) : ?>
                    <?php echo $buttonHtml; ?>
                <?php endforeach; ?>
            </div>
        </div>
... (3 lines truncated)
</file>

<file path="application/extensions/admin/grid/MassiveActionsWidget/views/modals/first-select.php">
<?php
$firstSelectTitleId  = 'error-first-select-' . $this->gridid . '-title';
$firstSelectDialogSrId = $firstSelectTitleId . '-dialogsr';
?>
<!-- Modal error if no item selected -->
<div id="error-first-select<?php echo CHtml::encode($this->gridid); ?>"
     class="modal fade"
     role="dialog"
     aria-modal="true"
     aria-labelledby="<?php echo CHtml::encode($firstSelectTitleId . ' ' . $firstSelectDialogSrId); ?>"
>
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <?php
            Yii::app()->getController()->renderPartial(
                '/layouts/partial_modals/modal_header',
                [
                    'modalTitle'   => gT('Error'),
                    'modalTitleId' => $firstSelectTitleId,
                ]
            );
            ?>
            <div class="modal-body">
                <?php eT('Please select at least one item'); ?>
            </div>
            <div class="modal-footer modal-footer-buttons">
                <button type="button" class="btn btn-primary" data-bs-dismiss="modal">
                    <?php eT("OK"); ?>
                </button>
            </div>
... (5 lines truncated)
</file>

<file path="application/extensions/admin/grid/MassiveActionsWidget/views/modals/unknown_modal_type.php">
<?php
?>
<!-- Modal for unknown modal type error -->
<div id="<?php echo CHtml::encode($massiveModalDomId); ?>"
     class="modal fade"
     role="dialog"
     aria-modal="true"
     aria-labelledby="<?php echo CHtml::encode($massiveModalTitleId . ' ' . $massiveModalDialogSrId); ?>"
     data-keepopen="<?php echo $aAction['keepopen']; ?>"
>
    <div class="modal-dialog" role="document">
        <!-- Modal content-->
        <div class="modal-content">
            <?php
            Yii::app()->getController()->renderPartial(
                '/layouts/partial_modals/modal_header',
                [
                    'modalTitle'   => gT('Error'),
                    'modalTitleId' => $massiveModalTitleId,
                ]
            );
            ?>
            <div class="modal-body">
                Unknown modal view type in Massive Actions Widget!
            </div>
            <div class="modal-footer modal-footer-buttons">
                <button type="button" class="btn btn-danger" data-bs-dismiss="modal">
                    <span class="ri-forbid-2-line"></span>
                    &nbsp;
                    <?php eT("Close"); ?>
... (6 lines truncated)
</file>

<file path="application/extensions/admin/grid/MassiveActionsWidget/views/modals/yes-no-lg.php">
<?php
?>
<!-- Modal confirmation for <?php echo $aAction['action']; ?> -->
<div id="<?php echo CHtml::encode($massiveModalDomId); ?>"
     class="modal fade"
     role="dialog"
     aria-modal="true"
     aria-labelledby="<?php echo CHtml::encode($massiveModalTitleId . ' ' . $massiveModalDialogSrId); ?>"
     data-keepopen="<?php echo $aAction['keepopen']; ?>"
     data-show-selected="<?php echo $showSelected; ?>"
     data-selected-url="<?php echo $selectedUrl; ?>"
>
    <div class="modal-dialog modal-lg" role="document">
        <!-- Modal content-->
        <div class="modal-content">
            <?php
            Yii::app()->getController()->renderPartial(
                '/layouts/partial_modals/modal_header',
                [
                    'modalTitle'   => $aAction['sModalTitle'],
                    'modalTitleId' => $massiveModalTitleId,
                ]
            );
            ?>
            <div class="modal-body">
                <div class="modal-body-text"><?php echo $aAction['htmlModalBody']; ?></div>
                <!-- shows list of selected items in the modal-->
                <div class="selected-items-list"></div>
                <?php if (isset($aAction['aCustomDatas'])) : ?>
                    <div class="custom-modal-datas d-none">
... (39 lines truncated)
</file>

<file path="application/extensions/admin/grid/MassiveActionsWidget/views/modals/yes-no.php">
<?php
?>
<!-- Modal confirmation for <?php echo $aAction['action']; ?> -->
<div id="<?php echo CHtml::encode($massiveModalDomId); ?>"
     class="modal fade"
     role="dialog"
     aria-modal="true"
     aria-labelledby="<?php echo CHtml::encode($massiveModalTitleId . ' ' . $massiveModalDialogSrId); ?>"
     data-keepopen="<?php echo $aAction['keepopen']; ?>"
     data-show-selected="<?php echo $showSelected; ?>"
     data-selected-url="<?php echo $selectedUrl; ?>"
>
    <div class="modal-dialog" role="document">
        <!-- Modal content-->
        <div class="modal-content">
            <?php
            Yii::app()->getController()->renderPartial(
                '/layouts/partial_modals/modal_header',
                [
                    'modalTitle'   => $aAction['sModalTitle'],
                    'modalTitleId' => $massiveModalTitleId,
                ]
            );
            ?>
            <div class="modal-body">
                <div class="modal-body-text"><?php echo $aAction['htmlModalBody']; ?></div>
                <!-- shows list of selected items in the modal-->
                <div class="selected-items-list"></div>
                <?php if (isset($aAction['aCustomDatas'])) : ?>
                    <div class="custom-modal-datas d-none">
... (39 lines truncated)
</file>

<file path="application/extensions/admin/grid/MassiveActionsWidget/views/_selected_items.php">
<?php
if (!isset($tableLabels)) {
    $tableLabels = array('ID','Title','Status');
}
?>
<hr>
<table class="table table-striped">
    <caption class="visually-hidden"><?php echo isset($caption) ? $caption : gT('Selected items'); ?></caption>
    <thead>
        <?php foreach ($tableLabels as $label) :?>
        <th><?php echo $label?></th>
        <?php endforeach;?>
    </thead>
    <tbody>
        <?php foreach ($aResults as $iSid => $result) :?>
            <tr>
                <td>
                    <?php echo CHtml::encode($iSid);?>
                </td>
                <td>
                    <?php echo CHtml::encode($result['title']);?>
                </td>
                <?php if ($result['result']) :?>
                    <td class="text-success">
                        <?php eT('Selected'); ?>
                    </td>
                <?php else : ?>
                    <td class="text-danger">
                        <?php echo CHtml::encode($result['error']) ; ?>
                    </td>
... (6 lines truncated)
</file>

<file path="application/extensions/admin/grid/MassiveActionsWidget/views/listOfActions.php">
<?php
?>
<!-- List of actions -->
<ul class="dropdown-menu listActions" role="menu" aria-labelledby="<?php echo $this->dropupId; ?>-button">
    <?php foreach ($this->aActions as $key => $aAction) :?>
        <?php
        switch ($aAction['type']) :
            case 'separator':
                ?>
                <!-- Separator -->
                <li role="separator" class="dropdown-divider"></li>
                <?php
                break;?>
            <?php case 'dropdown-header':
                ?>
            <!-- Header -->
            <li class="dropdown-header" role="presentation"><?php echo $aAction['text'];?></li>
                <?php
                      break;?>
            <?php case 'action':
                ?>
            <!-- Action -->
            <li role="none"
                <?php if (!empty($aAction['disabled'])) : ?>
                    class='disabled'
                <?php endif;?>
            >
                <a href="#"
                   role="menuitem"
                   class="dropdown-item"
... (47 lines truncated)
</file>

<file path="application/extensions/admin/grid/MassiveActionsWidget/views/selector.php">
<?php
$listOfActions = $this->render('listOfActions', get_defined_vars(), true);
?>
<!-- Massive actions widget : selector view -->
<div class="float-start dropup listActions" data-pk="<?php echo $this->pk;?>" data-grid-id="<?php echo $this->gridid;?>" id="<?php echo $this->dropupId;?>">
    <!-- Drop Up button selector -->
    <?php
    $this->widget('ext.ButtonWidget.ButtonWidget', [
    'name' => '',
    'id' => '',
    'text' => $this->dropUpText,
    'icon' => '',
    'isDropDown' => true,
    'dropDownIcon' => 'ri-arrow-down-s-fill',
    'dropDownContent' => $listOfActions,
    'htmlOptions' => [
    'class' => 'btn btn-outline-secondary btntooltip disabled massiveAction',
    'disabled' => 'disabled',
    ],
    ]); ?>
</div>
<?php App()->getClientScript()->registerScript("ListQuestions-run-pagination", "
    var gridId = '" . $this->gridid . "';
", LSYii_ClientScript::POS_BEGIN); ?>
<!-- End of Massive actions widget : selector view -->
</file>

<file path="application/extensions/admin/grid/MassiveActionsWidget/MassiveActionsWidget.php">
<?php
class massiveActionsWidget extends CWidget
{
    private const NAME_OF_MODEL_VIEWS = [
        'yes-no',
        'empty',
        'yes-no-lg',
        'empty-lg',
        'cancel-apply',
        'cancel-change',
        'cancel-resend',
        'cancel-add',
        'cancel-save',
        'cancel-delete',
        'cancel-export',
    ];
    public $pk;
    public $gridid;
    public $dropupId      = 'dropupId';
    public $dropUpText    = '';         // The wanted text for the dropup button
    public $aActions;                   // Array of actions
    public function run()
    {
        // Render the selector
        $this->render('selector');
        foreach ($this->aActions as $key => $aAction) {
            if (isset($aAction['actionType']) && $aAction['actionType'] === 'modal') {
                $massiveModalDomId      = 'massive-actions-modal-' . $this->gridid . '-' . $aAction['action'] . '-' . $key;
                $massiveModalTitleId    = $massiveModalDomId . '-title';
                $massiveModalDialogSrId = $massiveModalTitleId . '-dialogsr';
... (43 lines truncated)
</file>

<file path="application/extensions/admin/grid/MassiveActionsWidget/README.md">
# Massive Action Widget

 This widget is designed to be used with grid views. For now, in LimeSurvey core, it is used in the footer of the grids.
 It generates a dropup button with massive actions, and the modal associated to each action (if needed).

 When using it, you should defined each element of the list, and the modal associated to it (if needed).

## Usage Example:

### Widget:
```php
    $this->widget('ext.admin.grid.MassiveActionsWidget.MassiveActionsWidget', array(
        'pk'          => 'id',                                                  // The primary key identifier in the grid (for checkboxes)
        'gridid'      => 'question-grid',                                       // The grid id
        'dropupId'    => 'muhListActions',                                      // The dropup button id (optional)
        'dropUpText'  => gT('Selected item(s)...'),                         // The dropup text button

        // The array containing the of actions and modals definition
        'aActions'    => array(                                                   
            ...
        ),
```

This will generate a dropup button of this kind :
```html
    <button class="btn btn-outline-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
      Selected items(s)...    <span class="caret"></span>
    </button>
    <ul class="dropdown-menu listActions" aria-labelledby="muhListActions">
        ...
... (207 lines truncated)
</file>

<file path="application/extensions/admin/grid/views/template.php">
<?php
$countSpan = "<span class='grid-selection-count'>0</span>";
?>
<div id="bottom-scroller" class="content-right scrolling-wrapper">
    {items}
</div>
<?php if ($this->lsSelectAllEnabled) : ?>
<!-- "Select all" settings, also used when the selection bar is replaced by the floating actions bar -->
<div class="grid-select-all-config d-none"
     data-total-count="<?= (int) $this->dataProvider->getTotalItemCount() ?>"
     data-select-all-disable-threshold="<?= (int) $this->lsSelectAllDisableThreshold ?>"
     data-select-all-warning-message="<?= CHtml::encode(gT('Individual deselection is unavailable when more than {threshold} entries are selected. Reduce the selection below {threshold} to enable this feature.')) ?>"></div>
<?php endif; ?>
<?php if ($showSelectionBar ?? true): ?>
<div class="grid-selection-bar"
     data-grid-id="<?= CHtml::encode($this->id) ?>"
     style="display:none;">
    <span class="grid-selection-count-text">
        <?= sprintf(gT('%s selected'), $countSpan) ?>
    </span>
    <span class="grid-selection-bar__divider" aria-hidden="true"></span>
    <?php if ($this->lsSelectAllEnabled) : ?>
    <button type="button" class="grid-selection-bar__select-all grid-select-all grid-selection-action">
        <?= gT('Select all') ?>
    </button>
    <?php endif; ?>
    <button type="button" class="grid-selection-bar__deselect grid-deselect-all grid-selection-action">
        <?= gT('Deselect all') ?>
    </button>
    <button type="button" class="grid-selection-bar__close grid-deselect-all grid-selection-action" aria-label="<?= gT('Deselect all') ?>">
... (23 lines truncated)
</file>

<file path="application/extensions/admin/grid/CLSGridView.php">
<?php
Yii::import('zii.widgets.grid.CGridView');
class CLSGridView extends TbGridView
{
    public $massiveActionTemplate = '';
    /**
     * An array of Javascript functions that will be passed to afterAjaxUpdate
     * @var array
     */
    public array $lsAfterAjaxUpdate;
    /**
     * An array of columns that should be selectable for display
     * @var array
     */
    public array $lsAdditionalColumns = [];
    /**
     * An array of columns that is selected for display
     * @var array
     */
    public array $lsAdditionalColumnsSelected = [];
    /**
     * When true, the selection bar offers a "Select all" button that selects the
     * whole result set; massive actions then post a selectAll flag plus the grid filters.
     * @var bool
     */
    public bool $lsSelectAllEnabled = false;
    /**
     * Maximum number of selected rows that still allows individual deselection
     * after using the cross-page "Select all" action.
     * @var int
... (326 lines truncated)
</file>

<file path="application/extensions/admin/grid/CLSYiiPager.php">
<?php
class CLSYiiPager extends CLinkPager
{
    public $nextPageLabel = '&rsaquo;';
    public $prevPageLabel = '&lsaquo;';
    public $firstPageLabel = '&laquo;';
    public $lastPageLabel = '&raquo;';
    public function init()
    {
        $this->header = '';
        if (!isset($this->htmlOptions['id'])) {
            $this->htmlOptions['id'] = $this->getId();
        }
        if (!isset($this->htmlOptions['class'])) {
            $this->htmlOptions['class'] = 'pagination';
        }
        $this->maxButtonCount = 5;
        $this->hiddenPageCssClass = 'disabled';
    }
    protected function createPageButtons()
    {
        if (($pageCount = $this->getPageCount()) <= 1) {
            return array();
        }
        list($beginPage, $endPage) = $this->getPageRange();
        $currentPage = $this->getCurrentPage(false);
        $buttons = array();
        if ($this->firstPageLabel !== false) {
            $buttons[] = $this->createPageButton($this->firstPageLabel, 0, $this->firstPageCssClass, $currentPage <= 0, false);
        }
... (73 lines truncated)
</file>

<file path="application/extensions/admin/PreviewModalWidget/views/grouped_select_modal.php">
<?php
?>
<?php ?>
<input id="<?= $this->widgetsJsName ?>" name="<?= $this->widgetsJsName ?>" value="<?= $this->value ?>" type="hidden"/>
<div class="modal fade previewModalWidget" tabindex="-1" role="dialog" id="selector__<?= $this->widgetsJsName ?>-modal">
    <div class="modal-dialog modal-lg" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title"><?= gT($this->modalTitle) ?></h5>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-4 ls-ba">
                        <div class="accordion" id="accordion_<?= $this->widgetsJsName ?>" role="tablist"
                             aria-multiselectable="true">
                            <?php foreach ($this->groupStructureArray as $sGroupTitle => $aGroupArray) { ?>
                                <div class="accordion-item">
                                    <h2 class="accordion-header" role="tab" id="heading_<?= $sGroupTitle ?>">
                                        <button
                                            role="button"
                                            type="button"
                                            class="accordion-button collapsed"
                                            data-bs-toggle="collapse"
                                            data-bs-parent="#accordion_<?= $this->widgetsJsName ?>"
                                            href="#collapsible_<?= $sGroupTitle ?>"
                                            aria-expanded="true"
                                            aria-controls="collapse-question"
                                        >
                                            <?= $aGroupArray[$this->groupTitleKey] ?>
... (64 lines truncated)
</file>

<file path="application/extensions/admin/PreviewModalWidget/views/open_modal_button.php">
<!-- The button -->
<div id="trigger_<?=$this->widgetsJsName?>_button" class="gap-2">
    <button
        type="button"
        class="btn btn-block <?= implode(" ", $this->buttonClasses) ?>"
        data-bs-target="#selector__<?=$this->widgetsJsName?>-modal"
        data-bs-toggle="modal"
        aria-haspopup="true"
        aria-expanded="false"
        <?php
        if ($this->survey_active) {
            echo 'disabled';
        }
        ?>
        >
        <?php if ($this->iconPosition === 'front') : ?>
            <i class="ri-folder-line"></i>&nbsp;&nbsp;
        <?php endif; ?>
        <span class="buttontext" id="selector__<?=$this->widgetsJsName?>--buttonText">
            <?= $this->currentSelected ?>
            <?php if (YII_DEBUG) :?>
                <em class="small">
                  <?= gT($this->debugKeyCheck)?> <?=$this->value?>
                </em>
            <?php  endif;?>
        </span>
        <?php if ($this->iconPosition === 'back') : ?>
            &nbsp;&nbsp;&nbsp;
            <i class="ri-folder-line"></i>
        <?php endif; ?>
... (3 lines truncated)
</file>

<file path="application/extensions/admin/PreviewModalWidget/views/select_modal.php">
<?php
?>
<?php ?>
<input id="<?= $this->widgetsJsName ?>" name="<?= $this->widgetsJsName ?>" value="<?= $this->value ?>" type="hidden"/>
<?php ?>
<div class="modal fade previewModalWidget" data-bs-backdrop="false" tabindex="-1" id="selector__<?= $this->widgetsJsName ?>-modal">
    <div class="modal-dialog modal-lg" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h2 class="modal-title h5"><?= gT($this->modalTitle) ?></h2>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-4 ls-ba">
                        <div class="ls-space padding all-0">
                            <div class="list-group ls-space margin all-0" role="list">
                                <?php foreach ($this->itemsArray as $sItemKey => $aItemContent) { ?>
                                    <a href="#"
                                       class="list-group-item selector__Item--select-<?= $this->widgetsJsName ?> <?= @$aItemContent['htmlclasses'] ?>"
                                       data-selector="<?= !empty($aItemContent['class']) ? $aItemContent['class'] : $sItemKey ?>"
                                       data-key="<?= $sItemKey ?>"
                                       data-item-value='<?= json_encode([
                                           "key"       => $sItemKey,
                                           "title"     => htmlentities((string) $aItemContent['title']),
                                           "itemArray" => $aItemContent
                                       ]); ?>'
                                        <?= @$aItemContent['extraAttributes'] ?>
                                    >
                                        <?= $aItemContent['title'] ?>
... (33 lines truncated)
</file>

<file path="application/extensions/admin/PreviewModalWidget/views/simple_grouped_select.php">
<?php
$disable = '';
if ($this->survey_active) {
    $disable = 'disabled';
}
?>
<select id="<?=$this->widgetsJsName?>" name="<?=$this->widgetsJsName?>" class="form-select" <?=$disable?>>
    <?php
    foreach ($this->groupStructureArray as $sGroupTitle => $aGroupArray) {
        echo sprintf("<optgroup label='%s'>", $aGroupArray[$this->groupTitleKey]);
        foreach ($aGroupArray[$this->groupItemsKey] as $aItemContent) {
            $selected = $this->value == $aItemContent['type'] && $this->theme == $aItemContent['name'] ? 'selected' : '';
            if (YII_DEBUG) {
                echo sprintf("<option value='%s' data-theme='%s' %s>%s (%s)</option>", $aItemContent['type'], $aItemContent['name'], $selected, $aItemContent['title'], $aItemContent['type']);
            } else {
                echo sprintf("<option value='%s' data-theme='%s' %s>%s</option>", $aItemContent['type'], $aItemContent['name'], $selected, $aItemContent['title']);
            }
        }
        echo "</optgroup>";
    }
    ?>
</select>
</file>

<file path="application/extensions/admin/PreviewModalWidget/views/simple_select.php">
<?php
$disable = '';
if ($this->survey_active) {
    $disable = 'disabled';
}
?>
<select id="<?=$this->widgetsJsName?>" name="<?=$this->widgetsJsName?>" class="form-select" <?= $disable?> >
    <?php
    foreach ($this->itemArray as $sItemKey => $aItemContent) {
        $selected = $this->value == $sItemKey ? 'selected' : '';
        if (YII_DEBUG) {
            echo sprintf("<option value='%s' %s>%s (%s)</option>", $sItemKey, $selected, $aItemContent['title'], $sItemKey);
        } else {
            echo sprintf("<option value='%s' %s>%s</option>", $sItemKey, $selected, $aItemContent['title']);
        }
    }
    ?>
</select>
</file>

<file path="application/extensions/admin/PreviewModalWidget/PreviewModalWidget.php">
<?php
class PreviewModalWidget extends CWidget
{
    public $widgetsJsName = "";
    /**
     * The title the widgets modal will have
     * @var string
     */
    public $modalTitle = "Select please";
    public $groupTitleKey = "title";
    public $groupItemsKey = "items";
    public $debugKeyCheck = "Key: ";
    public $previewWindowTitle = "";
    /**
     * Either a group or an items array must be given
     * @var array
     */
    public $groupStructureArray = [];
    /** @var array */
    public $itemsArray = [];
    /**
     * There should be a value set
     * @var mixed
     */
    public $value = null;
    /**
     * QuestionTheme name
     * @var string
     */
    public $theme = '';
... (101 lines truncated)
</file>

<file path="application/extensions/admin/SearchBoxWidget/views/searchBox.php">
<?php
?>
<!-- Search Box -->
<!-- Begin Form -->
<div class="row">
    <div class="survey-actionbar col-12">
        <?php $form = $this->beginWidget('CActiveForm', ['action' => $this->formUrl, 'method' => 'get', 'id' => 'survey-search']); ?>
        <div class="d-flex align-items-baseline">
            <!-- select state -->
            <p id="survey_search_all_surveys" class="survey-actionbar-title"><?php eT('All surveys'); ?></p>
            <?php if ($this->onlyfilter) : ?>
                <div class="survey-actionbar-filters">
                    <div class="survey-actionbar-item">
                        <select name="active" id='survey_active' class="form-select survey-actionbar-formfield" aria-labelledby="survey_search_all_surveys">
                            <option value="" <?= empty(App()->request->getQuery('active')) ? "selected" : '' ?>>
                                <?= gT('Status') ?>
                            </option>
                            <option value="Y" <?= App()->request->getQuery('active') === "Y" ? "selected" : '' ?>>
                                <?= gT('Active') ?>
                            </option>
                            <option value="R" <?= App()->request->getQuery('active') === "R" ? "selected" : '' ?>>
                                <?= gT('Running') ?>
                            </option>
                            <option value="N" <?= App()->request->getQuery('active') === "N" ? "selected" : '' ?>>
                                <?= gT('Inactive') ?>
                            </option>
                            <option value="E" <?= App()->request->getQuery('active') === "E" ? "selected" : '' ?>>
                                <?= gT('Expired') ?>
                            </option>
                            <option value="S" <?= App()->request->getQuery('active') === "S" ? "selected" : '' ?>>
... (78 lines truncated)
</file>

<file path="application/extensions/admin/SearchBoxWidget/SearchBoxWidget.php">
<?php
class SearchBoxWidget extends CWidget
{
    public string $formUrl = 'dashboard/view';
    public CActiveRecord $model;
    public bool $onlyfilter = false;
    public ?string $viewtype = '';
    /**
     * @var bool $switch If true, the view type selection is saved to user settings.
     */
    public bool $switch = false;
    /**
     * Runs the widget, rendering the appropriate view based on the viewtype and switch properties.
     * It determines the viewtype from the query parameters, user settings, or defaults.
     *
     * @throws CException If an error occurs during rendering.
     */
    public function run()
    {
        $this->formUrl = $this->getFormUrl();
        if (App()->request->getQuery('viewtype')) {
            $this->viewtype = App()->request->getQuery('viewtype');
        } elseif (SettingsUser::getUserSettingValue('welcome_page_widget')) {
            $this->viewtype = SettingsUser::getUserSettingValue('welcome_page_widget');
        } else {
            $this->viewtype = 'list-widget';
        }
        if (!empty($this->viewtype) && $this->switch) {
            SettingsUser::setUserSetting('welcome_page_widget', $this->viewtype);
        }
... (23 lines truncated)
</file>

<file path="application/extensions/admin/survey/LanguagesWidget/LanguagesWidget.php">
<?php
class LanguagesWidget extends WhSelect2
{
    public function run()
    {
        $this->registerSorter();
        parent::run();
    }
    private function registerSorter()
    {
        $this->pluginOptions['selectionAdapter'] = new CJavaScriptExpression('$.fn.select2.amd.require("select2/selection/languagesWidgetSelectionAdapter")');
        $this->pluginOptions['dataAdapter'] = new CJavaScriptExpression('$.fn.select2.amd.require("select2/data/languagesWidgetDataAdapter")');
        $this->pluginOptions['messages'] = [
            'cannotRemoveBaseLanguage' => gT("You cannot delete the base language. Please select a different language as base language, first."),
            'removeLanguageConfirmation' => gT("Are you sure, you want to delete this language? This will remove all survey content of this language permanently."),
            'delete' => gT("Delete"),
            'cancel' => gT("Cancel"),
            'remove' => gT("Remove"),
        ];
    }
    public function registerClientScript()
    {
        $path = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'assets';
        $scriptUrl = Yii::app()->getAssetManager()->publish($path . '/js/LanguagesWidget.js');
        $cssUrl = Yii::app()->getAssetManager()->publish($path . '/css/LanguagesWidget.css');
        Yii::app()->getClientScript()->registerScriptFile($scriptUrl, LSYii_ClientScript::POS_BEGIN);
        Yii::app()->getClientScript()->registerCssFile($cssUrl);
        parent::registerClientScript();
    }
}
... (1 lines truncated)
</file>

<file path="application/extensions/admin/survey/ListSurveysWidget/views/massive_actions/_action_results.php">
<?php
if (!isset($tableLabels)) {
    $tableLabels = array(gT('ID'), gT('Title'), gT('Status'));
}
?>
<?php if (isset($additionalMessage)) :?>
    <?php echo $additionalMessage?>
<?php endif;?>
<table class="table table-striped">
    <caption class="massive-action-results-caption visually-hidden"><?php
        if (isset($tableCaption) && $tableCaption !== '') {
            echo CHtml::encode($tableCaption);
        }
    ?></caption>
    <thead>
        <?php foreach ($tableLabels as $label) :?>
            <th><?php echo $label?></th>
        <?php endforeach;?>
    </thead>
    <tbody>
        <?php foreach ($aResults as $iSid => $result) :?>
            <tr>
                <td>
                    <?php echo $iSid;?>
                </td>
                <td>
                    <?php echo CHtml::encode($result['title']);?>
                </td>
                <?php if ($result['result']) :?>
                    <td class="text-success">
... (18 lines truncated)
</file>

<file path="application/extensions/admin/survey/ListSurveysWidget/views/massive_actions/_change_survey_group.php">
<?php
?>
<?php $form = $this->beginWidget('CActiveForm', array('id' => 'survey-group',)); ?>
<div id='change-surveygroup-modal' >
    <label class="form-label" for='surveygroupid'><?php  eT("Survey group:"); ?></label>
    <div class="mb-3">
        <select id='surveygroupid' class="form-select custom-data"  name='surveygroupid' >
            <?php
                $aSurveyGroupList = SurveysGroups::getSurveyGroupsList();
            foreach ($aSurveyGroupList as $iGsid => $sGroupTitle) { ?>
                    <option value='<?=$iGsid?>'>
                        <?php echo CHtml::encode($sGroupTitle); ?>
                    </option>
            <?php } ?>
        </select>
    </div>
    <?= gT('This will update the survey group for all selected surveys.') . ' ' . gT('Continue?'); ?>
</div>
<?php $this->endWidget(); ?>
</file>

<file path="application/extensions/admin/survey/ListSurveysWidget/views/massive_actions/_expiry_dialog.php">
<?php
$dateFormatDetails = getDateFormatData(Yii::app()->session['dateformat']);
?>
<?php
$form = $this->beginWidget('CActiveForm', array('id' => 'survey-expiry',)); ?>
<div id='publication'>
    <div class="row">
        <!-- Expiry date/time -->
        <div class="mb-3">
            <label class="col-md-6 form-label" for='expires'><?php
                eT("Expiry date/time:"); ?></label>
            <div class='col-md-6'>
                <?php
                $widget = Yii::app()->getController()->widget('ext.DateTimePickerWidget.DateTimePicker', array(
                    'name' => 'datepickerInputField',
                    'id' => 'expiryPicker',
                    'pluginOptions' => array(
                        'format' => $dateFormatDetails['jsdate'] . " HH:mm",
                        'allowInputToggle' => true,
                        'showClear' => true,
                        'theme' => 'light',
                        'locale' => convertLStoDateTimePickerLocale(Yii::app()->session['adminlang'])
                    )
                ));
                ?>
                <input class="form-control custom-data" name="expires" id="expires" type="hidden" value="">
                <script type="text/javascript">
                    $(function () {
                        <?= $widget->getConfigScript('expiryPicker'); ?>
                        document.getElementById("expiryPicker_datetimepicker").addEventListener("change.td", function(){
... (11 lines truncated)
</file>

<file path="application/extensions/admin/survey/ListSurveysWidget/views/massive_actions/_export_archive_results.php">
<?php
?>
<table class="table table-striped">
    <thead>
        <th><?php eT('Survey ID');?></th>
        <th><?php eT('Survey title');?></th>
        <th><?php eT('Status');?></th>
    </thead>
    <tbody>
        <?php foreach ($aResults as $iSid => $result) :?>
            <tr>
                <td>
                    <?php echo $iSid;?>
                </td>
                <td>
                    <?php echo $result['title'];?>
                </td>
                <?php if ($result['result']) :?>
                    <td class="text-success">
                        <?php eT('Exported'); ?>
                    </td>
                <?php else : ?>
                    <td class="text-danger">
                        <?php echo $result['error'] ; ?>
                    </td>
                <?php endif;?>
            </tr>
        <?php endforeach;?>
    </tbody>
</table>
... (14 lines truncated)
</file>

<file path="application/extensions/admin/survey/ListSurveysWidget/views/massive_actions/_select_survey_theme.php">
<?php
?>
<?php $form = $this->beginWidget('CActiveForm', array('id' => 'survey-theme',)); ?>
<div id='select-theme-modal' >
    <label class="form-label" for='theme'><?php  eT("Survey theme:"); ?></label>
    <div class="mb-3">
        <select id='theme' class="form-select custom-data"  name='theme' >
            <?php
                $athemeList = Template::getTemplateList();
            foreach ($athemeList as $themeName => $folder) {
                if (Permission::model()->hasGlobalPermission('themes', 'read') || Permission::model()->hasTemplatePermission($themeName)) { ?>
                        <option value='<?php echo $themeName; ?>'>
                            <?php echo $themeName; ?>
                        </option>
                <?php }
            }
            ?>
        </select>
    </div>
    <p><?= gT('This will update the survey theme for all selected active surveys.') . ' ' . gT('Continue?'); ?></p>
</div>
<?php $this->endWidget(); ?>
</file>

<file path="application/extensions/admin/survey/ListSurveysWidget/views/massive_actions/_selector.php">
<?php
?>
<!-- Set hidden url for ajax post in listActions JS.   -->
<!-- Rendering massive action widget -->
<?php
    $this->widget('ext.admin.grid.MassiveActionsWidget.MassiveActionsWidget', array(
            'pk'          => 'sid',
            'gridid'      => 'survey-grid',
            'dropupId'    => 'surveyListActions',
            'dropUpText'  => gT('Edit selected surveys'),
            'aActions'    => array(
                array(
                    'type'        => 'action',
                    'action'      => 'delete',
                    'url'         => App()->createUrl('/surveyAdministration/deleteMultiple/'),
                    'iconClasses' => 'ri-delete-bin-fill text-danger',
                    'text'        =>  gT('Delete'),
                    'grid-reload' => 'yes',
                    'actionType'    => 'modal',
                    'modalType'     => 'cancel-delete',
                    'keepopen'      => 'yes',
                    'showSelected'  => 'yes',
                    'selectedUrl'   => App()->createUrl('/surveyAdministration/renderItemsSelected/'),
                    'sModalTitle'   => gT('Delete surveys'),
                    'htmlModalBody' => gT('Are you sure you want to delete all those surveys?'),
                ),
                array(
                    'type'  => 'separator',
                ),
                array(
... (97 lines truncated)
</file>

<file path="application/extensions/admin/survey/ListSurveysWidget/views/listSurveys.php">
<?php
?>
<!-- Grid -->
<div class="row">
    <div class="col-12">
        <?php
        $floatingActions = \actions\SurveyListMassiveActions::getActions();
        $this->widget('ext.admin.grid.FloatingActionsWidget.FloatingActionsWidget', [
            'pk'           => 'sid',
            'gridId'       => 'survey-grid',
            'aActions'     => $floatingActions,
            'selectAllUrl' => Yii::app()->createUrl('surveyAdministration/getAllSurveyIds'),
        ]);
        ?>
        <?php
        $surveyGrid = $this->widget('application.extensions.admin.grid.CLSGridView', [
            'dataProvider'          => $this->model->search(),
            'id'                    => 'survey-grid',
            'lsCaption'               => gT('List of surveys'),
            'emptyText'             => gT('No surveys found.'),
            'lsPageSizeCurrentValue'  => $this->pageSize,
            'ajaxUpdate'            => 'survey-grid',
            'lsAfterAjaxUpdate'     => [
                'window.LS.doToolTip();',
                'LS.restoreFocusAfterSort("survey-grid");',
            ],
            'lsRowLink'               =>
                'Yii::app()->createUrl("surveyAdministration/view/",array("iSurveyID"=>$data->sid))',
            'lsShowSelectionBar'      => false,
            'columns'               => $this->model->getColumns(),
... (6 lines truncated)
</file>

<file path="application/extensions/admin/survey/ListSurveysWidget/ListSurveysWidget.php">
<?php
class ListSurveysWidget extends CWidget
{
    public $model;
    public $bRenderFooter    = true;
    public $bRenderSearchBox = true;
    public $pageSize;
    public $template;
    public bool $switch = false;
    public function run()
    {
        if (isset($_GET['Survey']['searched_value'])) {
            $this->model->searched_value = $_GET['Survey']['searched_value'];
        }
        $this->model->active = "";
        if (isset($_GET['active']) && !empty($_GET['active'])) {
            $this->model->active = $_GET['active'];
        }
        if (empty($this->model->gsid) && App()->getRequest()->getQuery('gsid')) {
            $this->model->gsid = (int)App()->getRequest()->getQuery('gsid');
        }
        if (App()->getRequest()->getQuery('pageSize')) {
            $size = (int)App()->getRequest()->getQuery('pageSize');
            App()->user->setState('pageSize', $size);
        }
        $this->pageSize = App()->user->getState('pageSize', App()->params['defaultPageSize']);
        require_once Yii::getPathOfAlias('application.extensions.admin.grid.FloatingActionsWidget.actions.SurveyListMassiveActions') . '.php';
        $this->controller->widget('ext.admin.SearchBoxWidget.SearchBoxWidget', [
            'model' => new Survey('search'),
            'switch' => $this->switch
... (12 lines truncated)
</file>

<file path="application/extensions/admin/survey/ListSurveysWidget/README.md">
# List Survey Widget

 This widget display the survey list, its search box and its footer.
 It has various parameters:

 - $model            : the survey search model
 - $bRenderFooter    : set if the footer should the footer be rendered
 - $bRenderSearchBox : set if the search boxes should be rendered
 - $formUrl          : url of the action for the search action (default: surveyAdministration/listsurveys/)

## Usage Example:

```php
$this->widget('ext.admin.survey.ListSurveysWidget.ListSurveysWidget', array(                        
            'model'            => new Survey('search'),
            'bRenderFooter'    => false,
            'bRenderSearchBox' => false,
        ));
```
</file>

<file path="application/extensions/admin/survey/question/PositionWidget/views/ajax_form_group.php">
<?php
?>
<!-- PositionWidget : ajax_form_group -->
<input
    type="hidden"
    id="question_position_container"
    data-gid="<?php echo $this->oQuestionGroup->gid; ?>"
    data-url="<?php echo App()->createUrl($this->reloadAction);?>"
    data-classes="<?php echo $this->classes;?>"
    data-group-selector-id = "<?php echo $this->dataGroupSelectorId; ?>"
/>
<!-- PositionWidget : end of ajax_form_group -->
</file>

<file path="application/extensions/admin/survey/question/PositionWidget/views/form_group.php">
<?php
?>
<!-- PositionWidget : form_group -->
<div id='PositionWidget' class='mb-3'>
    <label class="form-label" for='pos'><?php eT("Position:"); ?></label>
    <div>
        <select class='form-select <?php echo $this->classes;?>' name='questionposition' id='questionposition'>
            <option value=''><?php eT("At end"); ?></option>
            <option value='0'><?php eT("At beginning"); ?></option>
            <?php foreach ($aQuestions as $oq) : ?>
                <option value='<?php echo $oq->attributes['question_order'] + 1; ?>'><?php eT("After"); ?>: <?php echo $oq->attributes['title']; ?></option>
            <?php endforeach; ?>
        </select>
    </div>
</div>
<!-- end of PositionWidget : form_group -->
</file>

<file path="application/extensions/admin/survey/question/PositionWidget/views/no_group.php">
<div id='Position' class='mb-3'>
    <label class="col-md-4 form-label" for='pos'><?php eT("Position:"); ?></label>
    <div class="col-md-8 text-error">
        <?php eT('No group found!'); ?>
    </div>
</div>
</file>

<file path="application/extensions/admin/survey/question/PositionWidget/views/unknown_view.php">
<div id='Position' class='mb-3'>
    <label class="col-md-4 form-label" for='pos'><?php eT("Position:"); ?></label>
    <div class="col-md-8 text-error">
        <?php eT('Unknown view!'); ?>
    </div>
</div>
</file>

<file path="application/extensions/admin/survey/question/PositionWidget/PositionWidget.php">
<?php
class PositionWidget extends CWidget
{
    public $display             = 'form_group';
    public $oQuestionGroup      = '';                                               // Which question group the position is related to
    public $oSurvey             = '';
    public $reloadAction        = 'questionAdministration/ajaxLoadPositionWidget';
    public $dataGroupSelectorId = 'gid';
    public $classes             = '';
    public function run()
    {
        // We first check if a question group object has been provided
        if (is_a($this->oQuestionGroup, 'QuestionGroup') || is_a($this->oSurvey, 'Survey')) {
            if (!is_a($this->oQuestionGroup, 'QuestionGroup')) {
                $aGroups              = $this->oSurvey->groups;
                if (count($aGroups) > 0) {
                    $this->oQuestionGroup = $aGroups[0];
                } else {
                    return;
                }
            }
            $aQuestions = $this->oQuestionGroup->questions;
            if ($this->isView($this->display)) {
                $this->render($this->display, array('aQuestions' => $aQuestions));
                if ($this->display == 'ajax_form_group') {
                    Yii::app()->getClientScript()->registerScriptFile(App()->getAssetManager()->publish(dirname(__FILE__) . '/assets/reload_position.js'));
                }
            } else {
                return $this->render('unkown_view');
            }
... (10 lines truncated)
</file>

<file path="application/extensions/admin/survey/question/PositionWidget/README.md">
# Question Position Widget

 This widget display a position selection for a question inside a group. It's used for now in "add new question".
 It has two modes :

 - static mode (display = form_group) : just render a select with "At end", "At Bengining", "After question..." for each question of the group
   this mode imply that the group can't be change in the same view that the widget

 - ajax mode (display = ajax_form_group): In ajax mode, the widget will first render an hidden input where is called.
    This hidden input contains the necessary datas to generate a static position selector.
    Then it will register some js, that will insert after this hidden input a static position selector based on the datas of the hidden input.
    If the question group selector change, it will update the datas of the hidden input, and regenerate a new position selector


## Usage Example:

```php
$this->widget('ext.admin.survey.question.PositionWidget.PositionWidget', array(
            'display'               => 'ajax_form_group',
            'oQuestionGroup'        => $oQuestionGroup,
            'reloadAction'          => 'questionEditor/actionAjaxLoadPositionWidget',
            'dataGroupSelectorId'   => $gid,
    ));
```


## Parameters

| Parameter  |  accepted value | default value | comment |
| ---------  | --------------- | ------------- | ------- |
... (5 lines truncated)
</file>

<file path="application/extensions/admin/survey/SurveySidemenuWidget/views/sidebarIconsItem.php">
<?php
$class = $class ?? '';
$dataTarget = $dataTarget ?? '';
$disabled = $disabled ?? false;
$onClick = $onClick ?? '';
$tooltip = $tooltip ?? '';
$tooltipDisabled = $tooltipDisabled ?? '';
$activePanel = $activePanel ?? false;
$iconClass = $iconClass ?? '';
if ($disabled) {
    $onClick = '';
    $tooltip = $tooltipDisabled;
    $class .= ' disabled';
}
?>
<div class="sidebar-icons-item">
    <div class="sidebar-icon <?= $class ?>" <?= $dataTarget ? 'data-target="' . $dataTarget . '"' : '' ?> <?= $onClick ? 'onclick="' . $onClick . '"' : '' ?>>
        <div data-bs-toggle="tooltip"
             title="<?= $tooltip ?>"
             data-bs-offset="0, 20"
             data-bs-placement="right">
            <i class="<?= $iconClass ?> btn btn-g-800 btn-icon <?= $activePanel ? 'active' : ''?>"></i>
        </div>
    </div>
</div>
</file>

<file path="application/extensions/admin/survey/SurveySidemenuWidget/views/sidemenu.php">
<?php
$this->render('sideMenuLogo');
$hasSurveySecurityPermission = Permission::model()->hasSurveyPermission($sid, 'surveysecurity', 'read');
$hasTranslationsPermission = Permission::model()->hasSurveyPermission($sid, 'translations', 'read');
?>
<div class="sidebar-container">
<div id="left-sidebar" class="fade sidebar sidebar-left show">
    <div class="d-flex">
        <div class="sidebar-icons-container">
            <?php
            $sidebarIcons = [
                [
                    'onClick' => "window.location='" . App()->createUrl(
                        'editorLink/index',
                        ['route' => 'survey/' . $sid]
                    ) . "'",
                    'tooltip' => gT('Survey structure'),
                    'iconClass' => 'ri-bar-chart-horizontal-line'
                ],
            ];
            if ($settingsUrl = $this->getPanelUrl('settings')) {
                $sidebarIcons[] = [
                    'dataTarget' => '#survey-settings-panel',
                    'onClick' => "window.location='" . $settingsUrl . "'",
                    'tooltip' => gT('Survey settings'),
                    'activePanel' => $this->activePanel == 'survey-settings-panel',
                    'iconClass' => 'ri-settings-3-fill'
                ];
            }
            if ($presentationUrl = $this->getPanelUrl('presentation')) {
... (221 lines truncated)
</file>

<file path="application/extensions/admin/survey/SurveySidemenuWidget/views/sideMenuLogo.php">
<div class="side-menu-logo col-1 d-none">
    <a class="navbar-brand navbar-brand" href="<?php App()->request->getBaseUrl(); ?>">
        <img class="d-inline-block align-bottom" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJgAAACkCAYAAABreuf3AAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAABF8SURBVHgB7Z0/dFNXEsYHmcLbgJ2KLYJFl25Nx1aIDipMl1SIbrci7tJhd7sVuNpNhamSVEC1SYWoNqkwXTpkaLJV7FRJAez3ySOfh3iS3p+5c++T3u8cHcmSrD9P35uZO3fu3DPS0jJBF+Bq7e3bt5tnzpxZw+0N/o3b3ffv33f1aWt6meRofOl0OrtnpGVpgY4okM13795t4vovvM27JV84hYEQh7jcGQ6Hg1ZgSwQtE8S0JSdi6smJmMyAqI5g4fZguR5AXEej+6RlYaGFgqD6ciIoCquWZZoFxDVQqzX84H5pWSggqh5EdVVOBLUpgcm6w9zHpaXxqKhu4mZfAlqpLHnuMPd50tJIMpbqS3ES1Zhp7jD3udLSGMYxFX7cm7AePXFG3eE2dPWk8P9IS/LEcIE57M5zh3m0AksYCguW6l4MazWmjDvM/X9pSQp1g3flxFp1JRIM4tUd7ksNWoElQkZY7kF7Dhwd7pR1h3m0AotMSsJSd7g7LadV6TWlJQqJCYs5rd3Xr18/EGNagUXg008/ZarhnkSMscbgczzRIL62O8x9fTFGZ+hHZ2TVkceiksKocMy8KR6z95EAXLx4cQdX9/RPnhn8MkMcWF6er6ysUHsHsiSwigHf+z4uW5IGZkH8PIK5SBzTTRzQx5kCtUkougPEIU8huMGiWjucbDzRUhgZjoP4bc+TO2gMpmcuRTZ3Vp9fHmJ7tChi0+z7Q0kjzgoWxM99b3EAZzG/2N0S/7KPA/L0zZs3hee8UkFHh2OrFZ26mfja7y9OTMRlRWHMttsUq5aa1bLIxNf+HOIIfoAtCOYhLlXikX0uIkhRaAlaraCph1KfRZzRuOzZjOB/HkkJjYMZiOuxpGG1XFIPZYiSaDUQGYkuNHyNuxCXe+A8BbfUQxmiZfKNREbchaaf/eEyJUyrsiKROALr6+tP5WT51AWpDvNtW+fPn187Pj5+LoHRQJ4uMfiCigLQan0Bcf0siRJ9LpIBsloyix9sNOpEemNfApCKS0zdamVJYrLbWGTE1G3qKPG+nBQBxibJWGsayVRTBBAZf4Da2WtdDR3dJWpe606ZBRcpkFS5TgCRkQOc8beqWLNUUhCajb/VFKuVpSMJwQOIA3mNk+BiB0XyAjMJpZKgENdt/N8ziVwXj6vtw8PDa00UF0my4DCQJRtnuLfnWTOtgNiRiMSeQ7Qi2YrWUCKTk5Hm9rSJ9BTEBbZjVD6EIFoebB5Ik/2OPNl3uHld6uXJJmEjtc+RN5PJvBnExZHiVxIJph8YL8IlfisLQvI1+WrJXhhk/PM4HQBAXKyC6Es8GpV+KEojFn0YTivlMaqsjVXOnEpZTSgas6oosMiisCiB/CwatWxtwUS2h0A+ifqxkDRuXaQuJnlWsWgxOk2aR7QgqURrEbgihlltaSDqEq8ti7hIsmmKWSCFMUQK4/B9OusMi8B50TssU5IlopECI/idDpDLoovvScJkclv7soQ0VmAEidJByiLLTFIvzSr2SdwFxsYfn3zyyZCZejFARbaOm1ckLThK/GLZXOIkbgJjRh5C+A9ufonY6QKE8VSMwGt9v7a2xjnLzyQyTJzCJf4dLvEf0uIjMK2rYunLeOJ6M28usA4I+n8Q+3nLUmgK4q/Wo0SenOfOnfsXjtklHLMfpUEEF5jWsbNyYTJv1cMBO7Y6YDo5TpEF3TJlGloKdAPi+kUM0UUmtPw9XK5bn5ihCZpo1eqEmdlquJPLlkGwZvtfOCdimYLYEWOmlQ6ltHJ7HkEEphUQDwvmqTiMv2Y5H+eV7deJ6lsBXGKRdZfmxy0EQTocTsRbRRiqJTM7I/E5+tqIJAgab5n/wJl1l0VOjuRFZjpVpCtwXkj5FTijPmJiiJa/7EoANL912fqHZUihJ2dRy8vj/YzHXRLFLMhXcdVZJNHV1dk/iBGBcmTj/JZJHo/w2GGUyGNXZeqL4cgWV8mnmHMzEZi6xf9K/RU4VyxHlkRzZD2xWR3EYN60pFpH2SyR7kp1khVZ7RisYsw1E40rBmJE3bLrEFWngXqKJReT1RbYxsbG4wBVDUca9A/FiKrpCw3mbxmnUkIu6DUfMNWhVpDPPE2gkpk16+CVYqUVKvM/mZGipbjuBl7Qaz5gqkPlGIwHCl8k5Hwb3VoPMdTXYoSW+BQK+rkQRDPzQzFA52K/wXeiS1yVsJgPmKpSSWA6YvxewnMBB6prOTGOQJgDiHlzlo+075bJtE9musez4uMKviurVl5KRErHYAbpiCrsYPRmltOaE4+ZTvtEXiluHsuWpbQFQ76G84s98aVneTZqd8X/5cSPXLJv4vYpYlhfxkJ9iccqwwyukLfM25WhlMB0l7AdiYAeqB9woEzcVjYey9Rw/VsMUJdIKx+9Pg1cwLFbjRWPFRaYjug4txdruRjPxuuWyUSNxz7TygSTmJJtovA5v5HwgXwZGI8952IZcaZwDJZA74YxB5pMTLZUhRPtum1fV9IhSn6skAWL6RpzuIDP8hPOxmQ7K9P9wiXtJbYghWmfPzg/K44UsmCwXq/Ed9SYSxNXRRes7fLCfVQ5N5Ovw+yuxGdPS2QG0iD4Y7IFpgQqHSrJqBBUHJlpwTL1XdH6QMTc69Ca7vxNWl2wLiaY+V6zHtTZ/pjiGs0FLko7Se2rcY3fSyLCAYg4MVVgmpboSyRCTDSngE66XzbupF0azo2KA1MFptYrCqHq3VMhULv2mWhL9F24x0uebdFzYzCNvV5JBBZdXFkCdtLOwrzhI1zvx8gdns27E+IKUeM1F60cXQpxEf7gEBlHmOZNjnVhym7sUXeuBYuV9/Ic3aRE1WrbSXTEzW7V+6mcpB/FYMzaS5y8V/SzLRYa+Ffu2khrBVFt4/oSS43KiCv0krePLNjGxsYz76wzl8Ij8GxkW0xL4DmYjrlb9PlV3aAuOOH7jBacQJTrEogzE2/sHtwvU1BfBJzgL2YF/Rk3+KBs0K5lRDflJP106o5DhiYfBPlv377t4QuIJ3oGDqVlBOdaGY/l3E9rxdLxfVj70sJichXi6uU9jvtv42ogAfhATRHc4wHM82Vp+YCsqzRyg/MGD5wEvxQijXE284G60xQeCjbHlZaP4J5F+C2O6rhBXPpSfJqPz6NbHogxpwKL4B6TGUqnhopqp8z/zHOD89Dc50CMORUYzpab+IDiBTdtl5ZaZN0gruvOLTL4t2xjMOLUZCH++vW9X1fAfW5KIC2VmDYarIvGYUMxZGTBtFeCW1mOzo21lKSuG5yHuknT0qixi+yJE8x7LWvGvgrGbnAefxFjRgLDWXFVnGCSUFrKwNHdjvjQE2NGc5GeJbxwj0+kpTC09lrL5UHXuhBxPNkdsh7pFBbYtamJ8sAAmDV/KUBXDOkwwBcncKAas4FASuC4DcQJ5ENN9dDBC3bFidY9VmNlZcXtuMHL2ArM+gXn4FaDvkhoZn8oPnTFEMZgLvkvjb/ca8IXCJfwAr/ThhjSsX7BaSCOOJSWyiC8cLH+1rM5bhZM/Ez8QoJY2S1VIYZ0HHNgQ2mpDAJ9t/jVMhdmulfRzDfqdIbSUgfP+NVUYF3xoQ3w69HI4+dmwVrq4TwCb56LlNaCNYlGCqxlCfEUmFtBY0ttzLxNx7EUpKUGXad+XoqdwJAHcxGY56T6gtKVBuLmImEpWxdZD7fjZ1mz13HsF2pe771MNNUDdLwmoSHkrrRUxrGsaiiG0EW6xGCB20QuPBCYiwew9mgdxznCtdDNzhYclxMUhmAohrBkeihOsP+FtJRGN3DwCvJNQ6aOZxkIzK/b+ssFoydOWBc2drQ/qFeydUtaSgPrdVP8GIoh4zxYcCumIn7knJFuPNqBuic+HFnvrDJuHcC9sHsSAI5K8PqPcP2gbOvHFt++bSF2HhkL7MD6S6SyEUDTQUx026tvmxoaU0YCQ6A/ePfundQl0wH5yXDBNrGKgXdbU/xuAzFmJDAG+hcvXhxK9QnV0/1wWjdoR4QNyQZiTLaNORtsFN4EgNTpgIyrtbYRynTUevXFCf6WQbtM061po7N5H6TyfjjaSfE2D5wGlNekJRdv6xWqg89pZK9by72akTGuvC3cuPXj5HAbf9958+bNvrR8QIwdV3SzePO4ee5GDAYbAfRlemwXbAOAJjNvOxlrmEpC7HxJAnB24o12KTCL/XAKbgSwpq5gW1pGcLc778qTkA3uJjfDoiD6YugGi7Cs+0ROoq7xmTiXR4doXz6mVna15H44sxhqDLDUrjLSVooD7uEtgTgrFehW2w9n5kviwD6WJR5VIg95z1tcBAILumdBKQtWxw0WZOf169dLt8UMjutdnKwPxJmQwf2YuRbMeSOAHZzJxxCZ+8GOheYGdyQCHs2Fp1qwcVJUjPfDKQLisT7isYXfbkaDem4+GqWEKWRwf/oe0x7QfWvqBu+VwHvv49jflgUmM2KMVR+3H1pcZKrAmAOL2VaAIoO7/FIWEPUOtFxdiYTXdoor0x44Ojr6fX19/Q/46esSj+vnz5+X4+PjhdnAgZYZ4vpW4jaDYdWLSwgydxSJ3Mwrz72M8oAlfYLLdtOrL2CR70uATT/L4hF7nb7XvCfgh42+cSgEvsV4xXPbG0sYbzGJKgmIC+x6nqiF8mAxMswzeMD4oSlZf81x7UgC/dE88l6TFOquQyuWUB8x5uNecFJYEoZJaZ6YmkBNYiUVixnEmcKZfMQPO7jyLuGdB+cw76Q2UU7x48d8KGkRZZ/0UlNF3nVKJeDSuN1UihcLFG+6QteIy7UYg6SVMk9G2uInXH2Oy6qkxRoO4BZSGn1cNvE5D5Fm+UUCQyGBVaZ0svfzb3yOP+PmFUkAWPntWFa+dLkODipjoPuSPkNcBlrmbbLTm9bLMUl6FYLu6cBnF65nJ+e542RqbPbw+aKNXivVg8FVPmbqQJrFga4yf8mFxisrK+M9GI+y4huveOKFXQW1cR57czE06MrHAfvUsu/Yo291jVHr7CoJTGOMF7ETsAmxnVcBonVzzyQCHPWruIYSkUpNgHlGMGhsW6Cfkjsxz7gnRL+HIjC1lMLMR+Uu09r2KXqWPxE2aa3yHghdMToFJqKfSALUamOuX2LpKlDzYKXvlIf2nS39Xt6gIxal0hR5HB8fDzAkZyzXk+Wmi/TI08n0iKYs/iQ+x+cRxPU3SYjaAiOtyE6AFfsDx+L7yfshvAM89pUEhLEexHVDEsNEYKQV2YjPIKav8xKvSMj2JFCBIcXFQdfk+6aAmcBIKzJZVSs2mHyAswt4rC/GaGuHG6lWlwTpzZjoxLgXR3BV63kPBEi8MubqS8KYWrAxS27JVmGtnsNdDScfwP3rhiXouzGngIoSbLc1DpUxhXJrGZOxDimL7ZRSEbMIYsHG4Cz+GSftd3LSHz+J0hUnunlWrG7KguLESXvj8PDwW2kIwfeL1Iz/Zdxc+IW0WXRd6UdwOaBUQIP5y03rQhQkyJ8GS320t8UyWLNZVRZlq1H2mhBv5eG5KTytGRfzXnbcBDUm7OmRKwp8/z0pAI8Te6c1VVzEVWCELpMrW1hluQQDgNymylplMZDZ7DXRJU4SNMifBQLeHzkAgKtgzqiR6x0LsHru3LmXv/3228+TD+C7H+O7fz55P4XH0TdOwv0UM/NlcY3BpqF9xx4uYgHjrA6CiMV+HcejWn26nUqZjRXRLFgWDueRnN3jdIqcWLNFGgR0pyVembLQvbj/qcvvohQnhiQJCzYJLFpfR5tdWQxy1ySOtzZsyir1KiQpsDHqOu82cIHJR8BCrS+ykKaRhIuchrrO7+BiHkFk8CZnLkgD3acuwMh1k4tO0hYsD12pw6X5V1N2obqZxRPLdZlNpHECy6Ji66nYehKfIS5PubGYLLGosjRaYFkyq65HguPtkFNSmiRmKfRL3chz0ArqYxZGYHmMRZdZob2h1yyp4X1reSJU93akt7kafIibx5kV4QdN77boxf8BRWyS/Q0PLMYAAAAASUVORK5CYII=" height="34">
        <?= App()->getConfig("sitename"); ?>
    </a>
</div>
</file>

<file path="application/extensions/admin/survey/SurveySidemenuWidget/SideMenuActiveItemMapper.php">
<?php
class SideMenuActiveItemMapper extends WhSelect2
{
    public $menutype;
    public $surveyid;
    public $currentUrl;
    public function match($menuItemUrl, $menutype, $surveyid)
    {
        $this->surveyid = $surveyid;
        $this->menutype = strtolower($menutype);
        $this->currentUrl = App()->request->requestUri;
        $sanitizedUrl = $this->normalizeUrl($menuItemUrl);
        $normalizedCurrentUrl = $this->normalizeUrl($this->currentUrl);
        if (
            $sanitizedUrl === $normalizedCurrentUrl
            || $this->matchSubItems()
        ) {
            return true;
        }
        return false;
    }
    public function matchSubItems()
    {
        $allowedSubItems = $this->getAllowedSubItems();
        if (!array_key_exists($this->menutype, $allowedSubItems)) {
            return false;
        }
        $normalizedCurrentUrl = $this->normalizeUrl($this->currentUrl);
        $menuConfig = $allowedSubItems[$this->menutype];
        foreach ($menuConfig['urls'] as $url) {
... (49 lines truncated)
</file>

<file path="application/extensions/admin/survey/SurveySidemenuWidget/SurveySidemenuWidget.php">
<?php
include 'SideMenuActiveItemMapper.php';
class SurveySidemenuWidget extends WhSelect2
{
    public $sid;
    public $sideMenu;
    public $activePanel;
    public $allLanguages;
    public $surveyEntry;
    public function run()
    {
        $this->render('sidemenu', [
            'sid' => $this->sid,
            'sideMenu' => $this->sideMenu,
        ]);
    }
    public function init()
    {
        $this->registerClientScript();
        $this->surveyEntry = SurveymenuEntries::model();
        $this->sideMenu = $this->getSideMenu();
        $this->highlightActiveMenuItem();
        $this->activePanel = $this->getActivePanel();
        $this->allLanguages = Survey::model()->findByPk($this->sid)->allLanguages;
    }
    public function getActivePanel()
    {
        $controllerId = App()->getController()->id;
        if ($controllerId == 'quickTranslation') {
            return 'survey-quick-translation';
... (159 lines truncated)
</file>

<file path="application/extensions/admin/TextDisplaySwitch/views/default.php">
<div class="selector__toggle_<?=$this->widgetsJsName?>">
    <?=viewHelper::flatEllipsizeText($this->textToDisplay, true, $this->abbreviationSize, $this->abbreviationSign)?>
</div>
<div class="selector__toggle_<?=$this->widgetsJsName?> d-none">
    <?=$this->textToDisplay?>
</div>
<div class="selector__toggle_full_text float-end" data-bs-toggle="buttons">
    <label class="btn btn-outline-secondary btn-xs" data-target=".selector__toggle_<?=$this->widgetsJsName?>" data-set-state="full">
        <span><?=gT("Show more")?></span>
        <!-- <span class="d-none"><?=gT("Show less")?></span> -->
    </label>
</div>
</file>

<file path="application/extensions/admin/TextDisplaySwitch/views/short.php">
<div class="selector__toggle_<?=$this->widgetsJsName?>">
    <?=$this->textToDisplay?>
</div>
</file>

<file path="application/extensions/admin/TextDisplaySwitch/README.md">

</file>

<file path="application/extensions/admin/TextDisplaySwitch/TextDisplaySwitch.php">
<?php
class TextDisplaySwitch extends CWidget
{
    public $widgetsJsName = "";
    public $textToDisplay = "";
    public $abbreviationSize = 120;
    public $abbreviationSign = '...';
    public $returnHtml = false;
    public function run()
    {
        $this->widgetsJsName = preg_replace('/[^a-zA-Z0-9_-]/', '', (string) $this->widgetsJsName);
        $this->registerScripts();
        $outView = (strlen((string) $this->textToDisplay) > $this->abbreviationSize) ? 'default' : 'short';
        if ($this->returnHtml) {
            return $this->render($outView, null, true);
        }
        $this->render($outView);
    }
    private function registerScripts()
    {
        App()->getClientScript()->registerScriptFile(App()->getAssetManager()->publish(dirname(__FILE__) . '/assets/textDisplaySwitch.js'), CClientScript::POS_END);
    }
}
</file>

<file path="application/extensions/AdminFooter/views/footer.php">
<div class='footer'>
    <div style='float:left;width:110px;text-align:left;'>
        <a class='ls-link' href='http://manual.limesurvey.org'><img alt='LimeSurvey - <?php eT("Online manual"); ?>' title='LimeSurvey - <?php eT("Online manual"); ?>' src='<?php echo Yii::app()->getConfig('adminimageurl'); ?>docs.png' /></a>
    </div>
    <div style='float:right;'>
        <a class='ls-link' href='https://donate.limesurvey.org' target="_blank"><img alt='<?php printf(gT("Support this project - Donate to %s!"), "LimeSurvey"); ?>' title='<?php printf(gT("Support this project - Donate to %s!"), "LimeSurvey"); ?>' src='<?php echo Yii::app()->getConfig('adminimageurl'); ?>donate.png'/></a>
    </div>
    <div class='subtitle'><a class='subtitle ls-link' title='<?php eT("Visit our website!"); ?>' href='https://community.limesurvey.org' target='_blank'>LimeSurvey Community Edition</a><br /><?php echo $versiontitle . " " . $versionnumber . $buildtext; ?></div>
</div>
</file>

<file path="application/extensions/AdminFooter/AdminFooter.php">
<?php
class AdminFooter extends CWidget
{
    public function run()
    {
        if (empty(Yii::app()->session['loginID'])) {
            $versionnumber = "";
            $versiontitle = "";
            $buildtext = "";
        } else {
            $versionnumber = Yii::app()->getConfig("versionnumber");
            $versiontitle = gT('Version');
            $buildtext = "";
            if (Yii::app()->getConfig("buildnumber") != "") {
                $buildtext = "+" . Yii::app()->getConfig("buildnumber");
            }
        }
            $aData = array(
                'versionnumber' => $versionnumber,
                'versiontitle'  => $versiontitle,
                'buildtext'     => $buildtext
            );
            $this->render('footer', $aData);
    }
}
</file>

<file path="application/extensions/AdvancedSettingWidget/views/buttongroup.php">
<div class="btn-group" role="group"
    aria-labelledby="label-<?= CHtml::getIdByName($inputBaseName); ?>"
    <?= ($this->setting['help']) ? 'aria-describedby="help-' . CHtml::getIdByName($inputBaseName) . '"' : "" ?>
    >
    <?php foreach ($this->setting['options'] as $value => $text) : ?>
        <?php if ($this->setting['value'] == $value) : ?>
            <input
                class="btn-check"
                type="radio"
                name="<?= $inputBaseName ?>"
                id="<?= $inputBaseName . $value ?>"
                value="<?= CHtml::encode($value); ?>"
                checked
            />
            <label class="btn btn-outline-secondary" for="<?= $inputBaseName  . $value ?>">
                <?= gT($text); ?>
            </label>
        <?php else : ?>
            <input
                class="btn-check"
                type="radio"
                name="<?= $inputBaseName ?>"
                id="<?= $inputBaseName . $value ?>"
                value="<?= CHtml::encode($value); ?>"
            />
            <label class="btn btn-outline-secondary" for="<?= $inputBaseName . $value ?>">
                <?= gT($text); ?>
            </label>
        <?php endif; ?>
    <?php endforeach; ?>
... (2 lines truncated)
</file>

<file path="application/extensions/AdvancedSettingWidget/views/columns.php">
<div class="input-group col-12">
    <?php if (isset($this->setting['aFormElementOptions']['inputGroup']['prefix'])) : ?>
        <div class="input-group-text">
            <?= $this->setting['aFormElementOptions']['inputGroup']['prefix']; ?>
        </div>
    <?php endif; ?>
    <input
        type="number"
        class="form-control"
        name="<?= $inputBaseName ?>"
        id="<?= CHtml::getIdByName($inputBaseName); ?>"
        <?= ($this->setting['help']) ? 'aria-describedby="help-' . CHtml::getIdByName($inputBaseName) . '"' : "" ?>
        value="<?= CHtml::encode($this->setting['value']); ?>"
        min="1"
    />
    <?php if (isset($this->setting['aFormElementOptions']['inputGroup']['suffix'])) : ?>
        <div class="input-group-text">
            <?= $this->setting['aFormElementOptions']['inputGroup']['suffix']; ?>
        </div>
    <?php endif; ?>
</div>
</file>

<file path="application/extensions/AdvancedSettingWidget/views/float.php">
<div class="input-group col-12">
    <?php if (isset($this->setting['aFormElementOptions']['inputGroup']['prefix'])) : ?>
        <div class="input-group-addon">
            <?= $this->setting['aFormElementOptions']['inputGroup']['prefix']; ?>
        </div>
    <?php endif; ?>
    <input
        type="number"
        class="form-control"
        name="<?= $inputBaseName ?>"
        id="<?= CHtml::getIdByName($inputBaseName); ?>"
        <?= ($this->setting['help']) ? 'aria-describedby="help-' . CHtml::getIdByName($inputBaseName) . '"' : "" ?>
        value="<?= CHtml::encode($this->setting['value']); ?>"
        <?= isset($this->setting['min']) ? 'min="' . $this->setting['min'] . '"' : '' ?>
        <?= isset($this->setting['max']) ? 'max="' . $this->setting['max'] . '"' : ''  ?>
    />
    <?php if (isset($this->setting['aFormElementOptions']['inputGroup']['suffix'])) : ?>
        <div class="input-group-addon">
            <?= $this->setting['aFormElementOptions']['inputGroup']['suffix']; ?>
        </div>
    <?php endif; ?>
</div>
</file>

<file path="application/extensions/AdvancedSettingWidget/views/integer.php">
<div class="input-group col-12">
    <?php if (isset($this->setting['aFormElementOptions']['inputGroup']['prefix'])) : ?>
        <div class="input-group-text">
            <?= $this->setting['aFormElementOptions']['inputGroup']['prefix']; ?>
        </div>
    <?php endif; ?>
    <input
        type="number"
        class="form-control"
        name="<?= $inputBaseName ?>"
        id="<?= CHtml::getIdByName($inputBaseName); ?>"
        <?= ($this->setting['help']) ? 'aria-describedby="help-' . CHtml::getIdByName($inputBaseName) . '"' : "" ?>
        value="<?= CHtml::encode($this->setting['value']); ?>"
        <?= isset($this->setting['min']) ? 'min="' . $this->setting['min'] . '"' : '' ?>
        <?= isset($this->setting['max']) ? 'max="' . $this->setting['max'] . '"' : ''  ?>
    />
    <?php if (isset($this->setting['aFormElementOptions']['inputGroup']['suffix'])) : ?>
        <div class="input-group-text">
            <?= $this->setting['aFormElementOptions']['inputGroup']['suffix']; ?>
        </div>
    <?php endif; ?>
</div>
</file>

<file path="application/extensions/AdvancedSettingWidget/views/layout.php">
<?php
$labelAttr = in_array($this->setting['inputtype'], AdvancedSettingWidget::SINGLEINPUTTYPE) && !$this->setting['i18n'] ? 'for="' : 'id="label-';
$labelAttr .= CHtml::getIdByName($inputBaseName) . '"';
?>
<div class="mb-3 <?= $this->setting['hidden'] ? 'd-none' : '' ?>">
    <div class="question-option-general-setting-block">
        <div class="col-12">
            <label <?= $labelAttr ?>>
                <?= gT($this->setting['caption']) ?>
            </label>
        <!-- TODO: Object method $setting->isLocalized(). -->
        <?php if ($this->setting['i18n']) : ?>
            <i
                class="ri-earth-fil"
                data-bs-toggle="tooltip"
                title="<?= gT("This setting is localized") ?>"
            ></i>
        <?php endif; ?>
        <?php if ($this->setting['help']) : ?>
            <a
                role="button"
                data-bs-toggle="collapse"
                href="#help-<?= CHtml::getIdByName($inputBaseName); ?>"
            ><i
                class="ri-information-fill"
                data-bs-toggle="tooltip"
                data-bs-html="true"
                title="<?= CHtml::encode($this->setting['help']) ?>"
            > </i><span class="visually-hidden"><?= gT("Show help"); ?></span> </a>
            <div class="help-block collapse" id="help-<?= CHtml::getIdByName($inputBaseName); ?>" aria-expanded="false"><?= $this->setting['help']; ?></div>
... (17 lines truncated)
</file>

<file path="application/extensions/AdvancedSettingWidget/views/singleselect.php">
<select
    class="form-select"
    name="<?= $inputBaseName ?>"
    id="<?= CHtml::getIdByName($inputBaseName); ?>"
    <?= ($this->setting['help']) ? 'aria-describedby="help-' . CHtml::getIdByName($inputBaseName) . '"' : "" ?>
>
    <?php foreach ($this->setting['options'] as $value => $text) : ?>
        <?php if ($this->setting['value'] == $value) : ?>
            <option selected="selected" value="<?= CHtml::encode($value); ?>">
        <?php else : ?>
            <option value="<?= CHtml::encode($value); ?>">
        <?php endif; ?>
        <?= gT($text); ?>
        </option>
    <?php endforeach; ?>
</select>
</file>

<file path="application/extensions/AdvancedSettingWidget/views/switch.php">
<div class="inputtype--toggle-container">
    <div class="btn-group" role="group"
    aria-labelledby="label-<?= CHtml::getIdByName($inputBaseName); ?>"
    <?= ($this->setting['help']) ? 'aria-describedby="help-' . CHtml::getIdByName($inputBaseName) . '"' : "" ?>
    >
        <?php if ($this->setting['value'] == "1") : ?>
            <input
                class="btn-check"
                type="radio"
                id="advancedSettings[<?= strtolower((string) $this->setting['category']); ?>][<?= $this->setting['name']; ?>]_1"
                name="<?= $inputBaseName ?>"
                value="1"
                checked
                />
            <label
                for="advancedSettings[<?= strtolower((string) $this->setting['category']); ?>][<?= $this->setting['name']; ?>]_1"
                class="btn btn-outline-secondary"
            >
                <?= gT('On'); ?>
            </label>
            <input
                class="btn-check"
                type="radio"
                name="<?= $inputBaseName ?>"
                id="advancedSettings[<?= strtolower((string) $this->setting['category']); ?>][<?= $this->setting['name']; ?>]_0"
                value="0"
                />
            <label
                for="advancedSettings[<?= strtolower((string) $this->setting['category']); ?>][<?= $this->setting['name']; ?>]_0"
                class="btn btn-outline-secondary">
... (32 lines truncated)
</file>

<file path="application/extensions/AdvancedSettingWidget/views/text.php">
<div class="input-group col-12">
    <?php if (isset($this->setting['aFormElementOptions']['inputGroup']['prefix'])) : ?>
        <div class="input-group-text">
            <?= $this->setting['aFormElementOptions']['inputGroup']['prefix']; ?>
        </div>
    <?php endif; ?>
    <?php if ($this->setting['i18n']) : ?>
        <?php foreach ($this->survey->allLanguages as $lang) : ?>
            <div class="lang-hide lang-<?= $lang; ?> col-12">
                <input
                    type="text"
                    class="form-control"
                    name="<?= $inputBaseName; ?>[<?= $lang ?>]"
                    id="<?= CHtml::getIdByName($inputBaseName . "[" . $lang . "]"); ?>"
                    value="<?= CHtml::encode($this->setting[$lang]['value']); ?>"
                    aria-labelledby="label-<?= CHtml::getIdByName($inputBaseName); ?>"
                    <?= ($this->setting['help']) ? 'aria-describedby="help-' . CHtml::getIdByName($inputBaseName) . '"' : "" ?>
                />
            </div>
        <?php endforeach; ?>
    <?php else : ?>
      <input
          type="text"
          class="form-control"
          name="<?= $inputBaseName ?>"
          id="<?= CHtml::getIdByName($inputBaseName); ?>"
          <?= ($this->setting['help']) ? 'aria-describedby="help-' . CHtml::getIdByName($inputBaseName) . '"' : "" ?>
          value="<?= CHtml::encode($this->setting['value']); ?>"
      />
    <?php endif; ?>
... (7 lines truncated)
</file>

<file path="application/extensions/AdvancedSettingWidget/views/textarea.php">
<div class="input-group col-12">
    <?php if (isset($this->setting['aFormElementOptions']['inputGroup']['prefix'])) : ?>
        <div class="input-group-text">
            <?= $this->setting['aFormElementOptions']['inputGroup']['prefix']; ?>
        </div>
    <?php endif; ?>
    <?php if ($this->setting['i18n']) : ?>
        <?php foreach ($this->survey->allLanguages as $lang) : ?>
            <div class="lang-hide lang-<?= $lang; ?> col-12">
                <textarea
                    class="form-control"
                    name="<?= $inputBaseName; ?>[<?= $lang; ?>]"
                    id="<?= CHtml::getIdByName($inputBaseName . "[" . $lang . "]"); ?>"
                    aria-labelledby="label-<?= CHtml::getIdByName($inputBaseName); ?>"
                    <?= ($this->setting['help']) ? 'aria-describedby="help-' . CHtml::getIdByName($inputBaseName) . '"' : "" ?>
                    ><?= CHtml::encode($this->setting[$lang]['value']); ?></textarea>
            </div>
        <?php endforeach; ?>
    <?php else : ?>
        <textarea
            class="form-control"
            name="<?= $inputBaseName ?>"
            id="<?= CHtml::getIdByName($inputBaseName); ?>"
            <?= ($this->setting['help']) ? 'aria-describedby="help-' . CHtml::getIdByName($inputBaseName) . '"' : "" ?>
            ><?= CHtml::encode($this->setting['value']); ?></textarea>
    <?php endif; ?>
    <?php if (isset($this->setting['aFormElementOptions']['inputGroup']['suffix'])) : ?>
        <div class="input-group-text">
            <?= $this->setting['aFormElementOptions']['inputGroup']['suffix']; ?>
        </div>
... (3 lines truncated)
</file>

<file path="application/extensions/AdvancedSettingWidget/AdvancedSettingWidget.php">
<?php
class AdvancedSettingWidget extends CWidget
{
    public $setting;
    public $survey;
    const SINGLEINPUTTYPE = array(
        'columns',
        'integer',
        'float',
        'singleselect',
        'text',
        'textarea'
    );
    public function run()
    {
        if (isset($this->setting['expression']) && $this->setting['expression'] == 2) {
            $this->setting['aFormElementOptions']['inputGroup'] = ['prefix' => '{', 'suffix' => '}'];
        }
        $this->setting['hidden'] = !empty($this->setting['hidden']);
        $this->setting['i18n'] = !empty($this->setting['i18n']);
        $this->setting['help'] = trim((string) $this->setting['help']);
        if ($this->setting['help']) {
            $this->setting['help'] = gT($this->setting['help'], 'unescaped');
        }
        if (!empty($this->setting['options'])) {
            foreach ($this->setting['options'] as $optionValue => $optionText) {
                $this->setting['options'][$optionValue] = is_string($optionText) ? gT($optionText, 'unescaped') : $optionText;
            }
        }
        $surveyIsActive = !empty($this->survey) && $this->survey->active === 'Y';
... (19 lines truncated)
</file>

<file path="application/extensions/AlertWidget/views/alert.php">
<?php
$useFlexbox = ($tag === 'div' && $showIcon);
if (!isset($htmlOptions['class'])) {
    $htmlOptions['class'] = '';
}
if ($useFlexbox) {
    $htmlOptions['class'] .= ' d-flex align-items-start';
}
echo CHtml::openTag($tag, $htmlOptions);
if ($showIcon) {
    echo CHtml::openTag("span", ['class' => $icon . ' me-2 flex-shrink-0 align-self-center']);
    echo CHtml::closeTag("span");
}
if ($useFlexbox) {
    echo CHtml::openTag("div", ['class' => 'flex-grow-1']);
}
if ($header != '') {
    echo CHtml::openTag("span", ['class' => 'alert-header']);
    echo $header;
    echo CHtml::closeTag("span");
    echo CHtml::openTag('br');
}
echo $text;
if ($inErrorMode) {
    echo $this->render('error-summary', ['errors' => $errors]);
}
if ($useFlexbox) {
    echo CHtml::closeTag("div");
}
if ($showCloseButton) {
... (16 lines truncated)
</file>

<file path="application/extensions/AlertWidget/views/error-summary.php">
<?php
?>
<?php if (!empty($errors)) : ?>
<ul class="d-flex flex-column">
    <?php foreach ($errors as $error) : ?>
        <li><?= $error ?></li>
    <?php endforeach; ?>
</ul>
<?php endif; ?>
</file>

<file path="application/extensions/AlertWidget/AlertWidget.php">
<?php
class AlertWidget extends CWidget
{
    const DEFAULT_TIMEOUT = 4000;
    const DEFAULT_LONGER_TIMEOUT = 7000;
    public $tag = 'div';
    public $text = '';
    /** @var string the header text displayed in the alert */
    public $header = '';
    /** @var string the type of the alert ('success', 'primary', 'secondary', 'danger', 'warning', 'info', 'light', 'dark') */
    public $type = '';
    /** @var bool whether the general style is of type "filled", if not the style is "outlined" */
    public $isFilled = true;
    /** @var bool whether the icon before the text is shown */
    public $showIcon = true;
    /** @var bool whether the closeButton after the text is shown */
    public $showCloseButton = false;
    /**
     * @var array | LSActiveRecord | CActiveRecord | CModel | null $model the models whose input errors are to be displayed. This can be either
     * a single model or an array of models
     */
    public $errorSummaryModel = null;
    /** @var array html options */
    public $htmlOptions = [];
    /** @var int | null $timeout milliseconds for how long the popup styled alerts should stay (0 = forever) */
    public $timeout = null;
    /** @var string icon which is used in the alert */
    private $icon = 'ri-notification-2-line';
    public function run()
    {
... (111 lines truncated)
</file>

<file path="application/extensions/BaselineModalWidget/views/modal.php">
<?php
?>
<div id="<?= $id ?>" class="modal fade" tabindex="-1" role="dialog" <?= $modalAttr ?>>
    <div class="modal-dialog <?= $modalSize ?>" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title"><?= $modalTitle ?></h5>
                <?php if ($showCloseButton) : ?>
                    <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="<?php eT('Close'); ?>"></button>
                <?php endif; ?>
            </div>
            <div class="modal-body">
                <?= $body ?>
            </div>
            <?php if (!empty($footer)) : ?>
                <div class="modal-footer">
                    <?= $footer ?>
                </div>
            <?php endif; ?>
        </div>
    </div>
</div>
</file>

<file path="application/extensions/BaselineModalWidget/BaselineModalWidget.php">
<?php
class BaselineModalWidget extends CWidget
{
    private static int $counter = 0;
    public $id = null;
    public $modalTitle = '';
    /** @var string the modal body html */
    public $body = '';
    /** @var string the modal footer html (buttons etc.), footer is hidden when empty */
    public $footer = '';
    /** @var string extra class for the .modal-dialog element, e.g. 'modal-lg' or 'modal-sm' */
    public $modalSize = '';
    /** @var bool whether to render the header close (x) button */
    public $showCloseButton = true;
    /** @var bool if true the modal cannot be closed via keyboard/backdrop click */
    public $static = false;
    /** @var bool if true a script is registered that moves the modal to <body> */
    public $appendToBody = false;
    /**
     * @return void
     * @throws CException
     */
    public function run()
    {
        $modalAttr = '';
        if ($this->static) {
            $modalAttr = 'data-bs-keyboard="false" data-bs-backdrop="static"';
        }
        $this->render('modal', [
            'id'              => $this->getModalId(),
... (30 lines truncated)
</file>

<file path="application/extensions/bootstrap5/behaviors/TbWidget.php">
<?php
class TbWidget extends CBehavior
{
    public static $counter = 0;
    private $_assetsUrl;
    private $_clientScript;
    public function resolveId($id = null)
    {
        if ($id === null) {
            $id = $this->owner->getId();
        }
        if (isset($this->owner->htmlOptions['id'])) {
            $id = $this->owner->htmlOptions['id'];
        } else {
            $this->owner->htmlOptions['id'] = $id;
        }
        return $id;
    }
    public function copyId()
    {
        if (!isset($this->owner->htmlOptions['id'])) {
            $this->owner->htmlOptions['id'] = $this->owner->id;
        } else {
            $this->owner->id = $this->owner->htmlOptions['id'];
        }
    }
    public function publishAssets($path, $forceCopy = false)
    {
        if (!Yii::app()->hasComponent('assetManager')) {
            throw new CException('Failed to locate the asset manager component.');
... (76 lines truncated)
</file>

<file path="application/extensions/bootstrap5/helpers/TbArray.php">
<?php
class TbArray
{
    public static function getValue($key, array $array, $defaultValue = null)
    {
        return array_key_exists($key, $array) ? $array[$key] : $defaultValue;
    }
    public static function popValue($key, array &$array, $defaultValue = null)
    {
        $value = self::getValue($key, $array, $defaultValue);
        unset($array[$key]);
        return $value;
    }
    public static function defaultValue($key, $value, array &$array)
    {
        if (!isset($array[$key])) {
            $array[$key] = $value;
        }
    }
    public static function defaultValues(array $values, array &$array)
    {
        foreach ($values as $name => $value) {
            self::defaultValue($name, $value, $array);
        }
    }
    public static function removeValue($key, array &$array)
    {
        unset($array[$key]);
    }
    public static function removeValues(array $keys, array &$array)
... (47 lines truncated)
</file>

<file path="application/extensions/bootstrap5/helpers/TbHtml.php">
<?php
class TbHtml extends CHtml
{
    const TEXT_ALIGN_LEFT = 'left';
    const TEXT_ALIGN_CENTER = 'center';
    const TEXT_ALIGN_RIGHT = 'right';
    const TEXT_ALIGN_JUSTIFY = 'justify';
    const TEXT_ALIGN_NOWRAP = 'nowrap';
    const TEXT_COLOR_DEFAULT = '';
    const TEXT_COLOR_WARNING = 'warning';
    const TEXT_COLOR_ERROR = 'error';
    const TEXT_COLOR_INFO = 'info';
    const TEXT_COLOR_SUCCESS = 'success';
    const HELP_TYPE_INLINE = 'inline';
    const HELP_TYPE_BLOCK = 'block';
    const FORM_LAYOUT_VERTICAL = 'vertical';
    const FORM_LAYOUT_HORIZONTAL = 'horizontal';
    const FORM_LAYOUT_INLINE = 'inline';
    const FORM_LAYOUT_SEARCH = 'search';
    const INPUT_TYPE_TEXT = 'textField';
    const INPUT_TYPE_PASSWORD = 'passwordField';
    const INPUT_TYPE_URL = 'urlField';
    const INPUT_TYPE_EMAIL = 'emailField';
    const INPUT_TYPE_NUMBER = 'numberField';
    const INPUT_TYPE_RANGE = 'rangeField';
    const INPUT_TYPE_DATE = 'dateField';
    const INPUT_TYPE_TEXTAREA = 'textArea';
    const INPUT_TYPE_FILE = 'fileField';
    const INPUT_TYPE_RADIOBUTTON = 'radioButton';
    const INPUT_TYPE_CHECKBOX = 'checkBox';
... (3232 lines truncated)
</file>

<file path="application/extensions/bootstrap5/widgets/TbActiveForm.php">
<?php
class TbActiveForm extends CActiveForm
{
    public $layout;
    public $helpType = TbHtml::HELP_TYPE_BLOCK;
    public $errorMessageCssClass = 'error';
    public $successMessageCssClass = 'success';
    public $hideInlineErrors = false;
    public $labelWidthClass = 'col-sm-2';
    public $controlWidthClass = 'col-sm-10';
    public function init()
    {
        $this->attachBehavior('TbWidget', new TbWidget());
        $this->copyId();
        if ($this->stateful) {
            echo TbHtml::statefulFormTb($this->layout, $this->action, $this->method, $this->htmlOptions);
        } else {
            echo TbHtml::beginFormTb($this->layout, $this->action, $this->method, $this->htmlOptions);
        }
    }
    public function error(
        $model,
        $attribute,
        $htmlOptions = array(),
        $enableAjaxValidation = true,
        $enableClientValidation = true
    ) {
        if (!$this->enableAjaxValidation) {
            $enableAjaxValidation = false;
        }
... (296 lines truncated)
</file>

<file path="application/extensions/bootstrap5/widgets/TbButtonColumn.php">
<?php
Yii::import('zii.widgets.grid.CButtonColumn');
class TbButtonColumn extends CButtonColumn
{
    public $viewButtonIcon = TbHtml::ICON_EYE_OPEN;
    public $updateButtonIcon = TbHtml::ICON_PENCIL;
    public $deleteButtonIcon = TbHtml::ICON_TRASH;
    protected function initDefaultButtons()
    {
        parent::initDefaultButtons();
        if ($this->viewButtonIcon !== false && !isset($this->buttons['view']['icon'])) {
            $this->buttons['view']['icon'] = $this->viewButtonIcon;
        }
        if ($this->updateButtonIcon !== false && !isset($this->buttons['update']['icon'])) {
            $this->buttons['update']['icon'] = $this->updateButtonIcon;
        }
        if ($this->deleteButtonIcon !== false && !isset($this->buttons['delete']['icon'])) {
            $this->buttons['delete']['icon'] = $this->deleteButtonIcon;
        }
    }
    protected function renderButton($id, $button, $row, $data)
    {
        if (
            isset($button['visible']) && !$this->evaluateExpression(
                $button['visible'],
                array('row' => $row, 'data' => $data)
            )
        ) {
            return;
        }
... (27 lines truncated)
</file>

<file path="application/extensions/bootstrap5/widgets/TbDataColumn.php">
<?php
Yii::import('zii.widgets.grid.CDataColumn');
class TbDataColumn extends CDataColumn
{
    public $filterInputOptions;
    public function renderHeaderCell()
    {
        $ariaSort = $this->getAriaSortValue();
        if ($ariaSort !== null) {
            $this->headerHtmlOptions['aria-sort'] = $ariaSort;
        } else {
            unset($this->headerHtmlOptions['aria-sort']);
        }
        parent::renderHeaderCell();
    }
    protected function getAriaSortValue()
    {
        if (!$this->grid->enableSorting || !$this->sortable || $this->name === null) {
            return null;
        }
        $sort = $this->grid->dataProvider->getSort();
        if ($sort === false || $sort->resolveAttribute($this->name) === false) {
            return null;
        }
        $isDescending = $sort->getDirection($this->name);
        if ($isDescending === null) {
            return null;
        }
        return $isDescending ? 'descending' : 'ascending';
    }
... (94 lines truncated)
</file>

<file path="application/extensions/bootstrap5/widgets/TbGridView.php">
<?php
Yii::import('zii.widgets.grid.CGridView');
class TbGridView extends CGridView
{
    public $type;
    public $pager = array('class' => '\TbPager');
    public $cssFile = false;
    public $template = "{items}\n<div class=\"row-fluid\"><div class=\"span6\">{pager}</div><div class=\"span6\">{summary}</div></div>";
    public function init()
    {
        parent::init();
        $classes = array('table table-hover');
        if (isset($this->type) && !empty($this->type)) {
            if (is_string($this->type)) {
                $this->type = explode(' ', $this->type);
            }
            foreach ($this->type as $type) {
                $classes[] = 'table-' . $type;
            }
        }
        if (!empty($classes)) {
            $classes = implode(' ', $classes);
            if (isset($this->itemsCssClass)) {
                $this->itemsCssClass .= ' ' . $classes;
            } else {
                $this->itemsCssClass = $classes;
            }
        }
    }
    protected function initColumns()
... (31 lines truncated)
</file>

<file path="application/extensions/bootstrap5/widgets/TbModal.php">
<?php
class TbModal extends CWidget
{
    public $htmlOptions = array();
    public $buttonOptions = array();
    public $fade = true;
    public $size = TbHtml::MODAL_SIZE_DEFAULT;
    public $keyboard = true;
    public $show = false;
    public $backdrop = true;
    public $remote;
    public $onShow;
    public $onShown;
    public $onHide;
    public $onHidden;
    protected $events = array();
    protected $options = array();
    public $closeText = TbHtml::CLOSE_TEXT;
    public $header;
    public $content;
    public $footer;
    public function init()
    {
        $this->attachBehavior('TbWidget', new TbWidget());
        TbArray::defaultValue('id', $this->getId(), $this->htmlOptions);
        TbArray::defaultValue('role', 'dialog', $this->htmlOptions);
        TbArray::defaultValue('tabindex', '-1', $this->htmlOptions);
        TbHtml::addCssClass('modal', $this->htmlOptions);
        if ($this->fade) {
            TbHtml::addCssClass('fade', $this->htmlOptions);
... (73 lines truncated)
</file>

<file path="application/extensions/bootstrap5/README.md">
This package is a conversion of bootstrap (yiistrap) package to Bootstrap 5.
Only used classes have been converted. Others are removed.
</file>

<file path="application/extensions/BreadcrumbWidget/views/breadcrumb.php">
<?php
$breadcrumbTrail = implode(', ', array_map(function ($b) {
    return strip_tags($b['text']);
}, $breadcrumbs));
$ariaLabel = $breadcrumbTrail !== '' ? gT("Breadcrumb") . ': ' . $breadcrumbTrail : gT("Breadcrumb");
?>
<?= CHtml::tag('div', $htmlOptions) ?>
<nav aria-label="<?= CHtml::encode($ariaLabel) ?>">
    <ol class="breadcrumb ls-flex-row align-items-center align-content-flex-start <?= $extraClass ?>">
        <?php foreach ($breadcrumbs as $i => $breadcrumbArray) : ?>
            <?php
            $id = array_key_exists('id', $breadcrumbArray) ? $breadcrumbArray['id'] : '';
            $href = array_key_exists('href', $breadcrumbArray) ? $breadcrumbArray['href'] : '';
            $text = $breadcrumbArray['text'];
            $title = array_key_exists('title', $breadcrumbArray) ? $breadcrumbArray['title'] : '';
            $lastOne = count($breadcrumbs) === $i + 1;
            $textPlain = strip_tags($text);
            ?>
            <li class="breadcrumb-item <?= $lastOne ? 'active' : '' ?>" <?= $lastOne ? 'aria-current="page"' : '' ?> data-bs-toggle="tooltip"
                title="<?= CHtml::encode($breadcrumbArray['fullText']) ?>">
                <?php if ($href !== '') : ?>
                    <a id="<?= $id ?>" class="pjax animate"
                       href="<?= $href ?>"
                       <?= !empty($title) ? 'title="' . $title . '"' : '' ?>>
                        <?= $text ?>
                    </a>
                <?php else : ?>
                    <?php if ($lastOne && $textPlain !== '') : ?>
                        <span class="visually-hidden"><?= gT("Current page:") ?> </span>
                    <?php endif; ?>
... (9 lines truncated)
</file>

<file path="application/extensions/BreadcrumbWidget/BreadcrumbWidget.php">
<?php
class BreadcrumbWidget extends CWidget
{
    private const THRESHOLD = 44;
    public $breadCrumbConfigArray;
    public $htmlOptions = [];
    public function run()
    {
        $this->render('breadcrumb', [
            'breadcrumbs' => $this->getBreadcrumbsArray($this->breadCrumbConfigArray),
            'extraClass' => $this->breadCrumbConfigArray['extraClass'] ?? '',
            'htmlOptions' => $this->htmlOptions,
        ]);
    }
    public function getBreadcrumbsArray(array $breadcrumbConfigArray)
    {
        $breadcrumbs = [];
        $breadcrumbs = $this->buildSurveyBreadCrumbs($breadcrumbConfigArray, $breadcrumbs);
        $breadcrumbs = $this->buildQuestionGroupBreadCrumbs($breadcrumbConfigArray, $breadcrumbs);
        $breadcrumbs = $this->buildQuestionBreadCrumbs($breadcrumbConfigArray, $breadcrumbs);
        $breadcrumbs = $this->buildTokenBreadCrumbs($breadcrumbConfigArray, $breadcrumbs);
        $breadcrumbs = $this->buildModuleSubActionBreadCrumbs($breadcrumbConfigArray, $breadcrumbs);
        $breadcrumbs = $this->preserveOriginalBreadcrumbTexts($breadcrumbs);
        return $breadcrumbs;
    }
    private function buildSurveyBreadCrumbs(array $breadcrumbConfigArray, array $breadcrumbs)
    {
        $survey = $breadcrumbConfigArray['oSurvey'];
        $questionGroup = $breadcrumbConfigArray['oQuestionGroup'];
        $subAction = $breadcrumbConfigArray['sSubaction'];
... (158 lines truncated)
</file>

<file path="application/extensions/ButtonGroupWidget/views/buttongroup.php">
<?php
?>
<div class="btn-group <?= $htmlOptions['class'] ?? '' ?>" data-bs-toggle="tooltip"
    id="<?= $id ?>" role="group"
    <?php if ($ariaLabelledBy) : ?>
        aria-labelledby="<?= CHtml::encode($ariaLabelledBy) ?>"
    <?php elseif ($ariaLabel) : ?>
        aria-label="<?= CHtml::encode($ariaLabel) ?>"
    <?php endif; ?>
    <?php
    $skipAttributes = ['class', 'icon', 'disabled', 'id'];
    foreach ($htmlOptions as $attribute => $value) :
        if (in_array($attribute, $skipAttributes, true) || is_array($value) || is_object($value)) {
            continue;
        }
        ?>
        <?= $attribute ?>="<?= Chtml::encode($value) ?>"
    <?php endforeach; ?>
    >
    <?php $count = 1 ?>
    <?php foreach ($selectOptions as $value => $caption) : ?>
        <input type="radio" class="btn-check" name="<?= $name ?>" id="<?= $id . '_' . $count ?>" autocomplete="off"
            value="<?= $value ?>" <?= $checkedOption == $value ? 'checked' : '' ?> <?= isset($htmlOptions['disabled']) && $htmlOptions['disabled'] ? 'disabled' : '' ?>>
        <label id="<?= $id . '_' . $count ?>_label" class="btn btn-outline-secondary" for="<?= $id . '_' . $count ?>">
            <?php if (isset($htmlOptions['icon']) && isset($htmlOptions['icon'][$value])) : ?>
                <span class="<?= $htmlOptions['icon'][$value] ?>" style="margin-right: 5px;"></span>
            <?php endif; ?>
            <?= $caption ?>
        </label>
        <?php $count++ ?>
... (3 lines truncated)
</file>

<file path="application/extensions/ButtonGroupWidget/ButtonGroupWidget.php">
<?php
class ButtonGroupWidget extends CInputWidget
{
    public $selectOptions = [];
    public $ariaLabel = '';
    /** @var string id of the element labelling the btn-group, takes precedence over $ariaLabel */
    public $ariaLabelledBy = '';
    /** @var array html options */
    public $htmlOptions = [];
    /** @var array the value that is currently checked/selected */
    public $checkedOption = '';
    /** Initializes the widget */
    public function init()
    {
        $this->registerClientScript();
    }
    /** Executes the widget */
    public function run()
    {
        $this->renderButtons();
    }
    /** Renders the button group */
    public function renderButtons()
    {
        list($name, $id) = $this->resolveNameID();
        $this->render('buttongroup', [
            'ariaLabel' => $this->ariaLabel,
            'ariaLabelledBy' => $this->ariaLabelledBy,
            'name' => $name,
            'id' => $id,
... (10 lines truncated)
</file>

<file path="application/extensions/ButtonWidget/views/button.php">
<?php
$iconLeft = $icon && $iconPosition != 'right' ? '<i class="' .  $icon . '" ></i> ' : '';
$iconRight = $icon && $iconPosition == 'right' ? ' <i class="' .  $icon . '" ></i>' : '';
$dropDownIconHtml = $displayDropDownIcon ? '<span class="menu-button-divider"></span><i class="' . $dropDownIcon . '" ></i>' : '';
?>
<?php if ($link == '' || $isDropDown || array_key_exists('disabled', $htmlOptions)) : ?>
        <?= CHtml::htmlButton($iconLeft . $text . $iconRight . $dropDownIconHtml, $htmlOptions) ?>
    <?php if ($dropDownContent != '') : ?>
        <?= $dropDownContent ?>
    <?php endif; ?>
<?php else : ?>
    <?= CHtml::link($iconLeft . $text . $iconRight, $link, $htmlOptions); ?>
<?php endif;
</file>

<file path="application/extensions/ButtonWidget/ButtonWidget.php">
<?php
class ButtonWidget extends CInputWidget
{
    public $text = '';
    /** @var string name of the icon class. e.g.: ri-brush-fill */
    public $icon = '';
    /** @var string Position of the icon either left or right */
    public $iconPosition = 'left';
    public $isDropDown = false;
    public $displayDropDownIcon;
    public $dropDownIcon = 'ri-more-fill';
    public $link = '';
    /** @var string string that should contain valid html list for bootstrap dropdown button.
     * Only used when not empty and isDropDown is true
     */
    public $dropDownContent = '';
    /** @var array html options */
    public $htmlOptions = [];
    /** Initializes the widget */
    public function init()
    {
        $this->registerClientScript();
        $this->setDefaultOptions();
    }
    /** Executes the widget */
    public function run()
    {
        $this->renderButton();
    }
    /** Renders the button */
... (47 lines truncated)
</file>

<file path="application/extensions/ButtonWidget/README.md">
# Button Widget
To handle the needs of the new admin theme, we decided to introduce a widget for buttons.

With this widget you can create either normal buttons or a Bootstrap 5 dropdown-button while
being able to control icons and their position, and most important the look of the new dropdown-buttons with a divider and an additional icon.

### Options

- **text**: *string*
    
    the text displayed in the button

    ***default***: empty string

- **icon**: *string*

    name of the icon class. e.g.: ri-eye-fill

    ***default***: empty string

- **iconPosition**: *string*

    Position of the icon either left or right

    ***default***: 'left'

- **isDropDown**: *bool*

    if button should behave as dropdown true or false

... (66 lines truncated)
</file>

<file path="application/extensions/captchaExtended/fonts/readme.txt">
Fonts:

*******************************************************************************
Nimbus Sans L regular
"nimbus.ttf" - An "arial"-look-alike font. If you want to use the real Arial
font you should upload the arial-normal ttf file from your Windows system
(fonts/arial.ttf).
*******************************************************************************

License (t3lib/fonts/nimbus.ttf):

nimbus.ttf was downloaded as n019003l.ttf from
<ftp://ftp.gnome.ru/fonts/urw/release/urw-fonts-1.0.7pre18-ttf.tar.bz2>.
nimbus.sfd.gz was downladed as NimbusSansL-Regu.sfd from
<ftp://ftp.gnome.ru/fonts/sources/urw-fonts-1.0.7pre40-src.tar.bz2>

	Copyright (URW)++,Copyright 1999 by (URW)++ Design & Development;
	Cyrillic glyphs added by Valek Filippov (C) 2001-2002

	This program is free software; you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation; either version 2 of the License, or
	(at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
... (143 lines truncated)
</file>

<file path="application/extensions/captchaExtended/CaptchaExtendedAction.php">
<?php
class CaptchaExtendedAction extends CCaptchaAction
{
    const
        MODE_MATH = 'math',
        MODE_MATHVERBAL = 'mathverbal',
        MODE_DEFAULT = 'default',
        MODE_LOGICAL = 'logical',
        MODE_WORDS = 'words';
    public $regenerateOnValid = true;
    public $offset = 2;
    public $mode = self::MODE_DEFAULT;
    public $fileWords;
    public $density = 3;
    public $lines = 2;
    public $fillSections = 5;
    public function run()
    {
        if (!extension_loaded('mbstring')) {
            throw new CHttpException(500, Yii::t('main', 'Missing extension "{ext}"', array('{ext}' => 'mbstring')));
        }
        $this->fontFile = dirname(__FILE__) . '/fonts/nimbus.ttf';
        $this->mode = strtolower((string) $this->mode);
        switch ($this->mode) {
            case self::MODE_LOGICAL:
            case self::MODE_WORDS:
                $this->width = 300;
                $this->height = 50;
                break;
            case self::MODE_MATHVERBAL:
... (349 lines truncated)
</file>

<file path="application/extensions/captchaExtended/CaptchaExtendedValidator.php">
<?php
class CaptchaExtendedValidator extends CCaptchaValidator
{
    public function clientValidateAttribute($object, $attribute)
    {
        $captcha = $this->getCaptchaAction();
        if ($captcha->mode == CaptchaExtendedAction::MODE_DEFAULT) {
            return parent::clientValidateAttribute($object, $attribute);
        }
        $message = $this->message ?? Yii::t('main', 'The verification code "{attribute}" is incorrect.');
        $message = strtr($message, array(
            '{attribute}' => $object->getAttributeLabel($attribute),
        ));
        $result = $captcha->getVerifyResult();
        $result = preg_replace('/\s/', '', (string) $result);
        if (!$this->caseSensitive) {
            $result = mb_convert_case($result, MB_CASE_LOWER, 'utf-8');
        }
        $result = urlencode($result);
        $hash = $captcha->generateValidationHash($result);
        $js = "
var hash = $('body').data('{$this->captchaAction}.hash');
if(hash == null){
	hash = $hash;
}else{
	hash = hash[" . ($this->caseSensitive ? 0 : 1) . "];
}
value = value.replace(/\\s/g,'');
" . ($this->caseSensitive ? '' : 'value = value.toLowerCase();') . "
value = encodeURIComponent(value);
... (18 lines truncated)
</file>

<file path="application/extensions/captchaExtended/CHANGELOG">
Captcha Extended Change Log
===========================

Version 1.0.3 Feb 19, 2021
---------------------------
- fixed compatability issues for PHP 7.4+ (e.g. imagecolorallocate accepts only valid range 0-255)
- fixed calculation of centered position for text inside image
- added support for parameter "regenerateOnValid", default TRUE
- optimized some default settings e.g. font size, number of lines or dots density

Version 1.0.2 Sept 19, 2013
---------------------------
- bugfix: skip captcha counter incrementation if clientajax validation is turned on. Otherwise captcha code would be silently invalidated after entering as many form fields as the number of allowed captcha attempts.

Version 1.0.1 July 01, 2012
---------------------------
- fixed client-side validation that generated incorrect validation hash

Version 1.0.0 August 29, 2011
----------------------------
Initial release

Please report bugs to lubosdz AT hotmail DOT com.
</file>

<file path="application/extensions/captchaExtended/LICENSE">
Captcha Extended is free software.
That means you can freely use it for private and/or commercial purposes, 
modify the code or use it in third party application.
You are not obliged to retain any copyrights from original author.
----------------------------------
</file>

<file path="application/extensions/captchaExtended/README">
Captcha Extended
================

Captcha Extended is an extension written for Yii framework.
It enhances original captcha code delivered along with the framework.

Features
========
- supports modes: logical, words, mathverbal, math, default
- supports extended characters latin1, latin2 (utf-8) including middle- east- european and cyrillyc characters
- implements masking elements: dots density, through lines, fillSections, font color varying.

INSTALLATION
============

1) Unzip CaptchaExtended.zip files into ../protected/extensions/captchaExtended/*.*

2) Register class paths to [CaptchaExtendedAction] and [CaptchaExtendedValidator], e.g. in components/controller.php:

	public function init(){
		// register class paths for extension captcha extended
		Yii::$classMap = array_merge( Yii::$classMap, array(
			'CaptchaExtendedAction' => Yii::getPathOfAlias('ext.captchaExtended').DIRECTORY_SEPARATOR.'CaptchaExtendedAction.php',
			'CaptchaExtendedValidator' => Yii::getPathOfAlias('ext.captchaExtended').DIRECTORY_SEPARATOR.'CaptchaExtendedValidator.php'
		));
	}

3) Define action in controller, e.g. SiteController:

	public function actions(){
... (36 lines truncated)
</file>

<file path="application/extensions/captchaExtended/words.de.txt">
Nachfolgend finden Sie eine Liste sämtlicher Zeitungen mit Aktivitäten im Internet. 
Mit Hilfe der nebenstehenden Gliederung gelangen Sie von jeder Zeitungspage per Klick auf die von Ihnen gewählte Übersicht.
Falls Sie auf unserer Liste ein Blatt vermissen oder überflüssig finden, können Sie uns dies gern in Form einer E-Mail mitteilen. 
Sie können uns auch gern Ihre Erfahrungen bei diesbezüglichen "Reisen" im Netz mitteilen. 
Sagen Sie uns bitte auch Ihre Meinung zu Online-Zeitungen. Wünschen und Kritik stehen wir aufgeschlossen gegenüber.
</file>

<file path="application/extensions/captchaExtended/words.en.txt">
North Carolina and Virginia dealt with widespread power outages, flooding, deaths and damage Saturday as 
Hurricane Irene continued its northward trek along the East Coast, with Norfolk, Virginia, and the Hampton Roads 
area next in its sights.
Nearly 1 million power customers were without electricity in North Carolina and Virginia because of the storm 
Saturday afternoon, according to state and utility reports. More than a million people had evacuated from New Jersey alone.
</file>

<file path="application/extensions/captchaExtended/words.ru.txt">
Невыполнение Россией контракта на поставку Ирану получило дальнейшее развитие. 
Исламская Республика решила обратиться в международный суд. Некоторые эксперты обращают внимание и на то, 
что стали пробуксовывать и выгодные проекты в нефтегазовой сфере. 
Ситуацию для "Правды.Ру" комментируют эксперты
</file>

<file path="application/extensions/captchaExtended/words.sk.txt">
Prichádza výťah, nastúpite, stlačíte trojku, kabína sa zatrasie a zastane. Neviete, či ste sa pohli, len si utierate pot z čela.
Vysoké teploty dokážu časť výťahov vyradiť z prevádzky. „Bolo tam minimálne štyridsať stupňov, ak nie viac. Za tri minúty som bol kompletne spotený, je to taká malá saunička,“ hovorí Bratislavčan Martin. Vo výťahu bratislavského bizniscentra na Lazaretskej ulici strávil v pondelok desiatky minút, chcel sa odviesť jedno poschodie.
„Našťastie som nebol na medziposchodí, čo som ani netušil a mohol som vystúpiť. Dvere sme vypáčili násilím.“ Profesionálna záchranka prišla asi desať minút po jeho vyslobodení.
Dodávateľ výťahov limity priznáva. „Definujeme, že výťahová šachta by mala pracovať v teplotnom rozmedzí od päť stupňov do štyridsať,“ povedal Peter Ondrík zo spoločnosti Schindler.
Teplotu má zabezpečiť správca budovy. „Ak sa to nestane, môžu nastať nejaké poruchy, za to je zodpovedná stavba,“ hovorí Ondrík. Výťah by sa v extrémnej teplote mal vypnúť, nie vždy sa to podarí.
</file>

<file path="application/extensions/captchaExtended/words.txt">
We choose to do "Hello World" testing mainly to achieve our goal, i.e., to find out the minimal overhead of each framework. 
Many people complain that the "Hello World" application is meaningless because a real world application often needs to deal 
with more complex tasks, such as database queries. This is not very true. In reality, especially in a large scale Web 2.0 application, 
we often encounter scenarios that are very close to "Hello World". For example, an application may need to respond to an AJAX request 
that should return the current server timestamp; a page has a large portion of its content being cached and an application just needs to 
fetch the cached content and display it.
</file>

<file path="application/extensions/DateTimePickerWidget/views/datetimepicker.php">
<?php
?>
<div
    class='input-group date'
    id="<?= $id ?>"
    data-td-target-input='nearest'
    data-td-target-toggle='nearest'
>
    <?php
    if ($hasModel) : ?>
        <?= CHtml::activeTextField($model, $attribute, $htmlOptions) ?>
    <?php else : ?>
        <?= CHtml::textField($name, $value, $htmlOptions) ?>
    <?php endif; ?>
    <span
        class='input-group-text datepicker-icon'
        data-td-target='#<?= $id ?>'
        data-td-toggle='datetimepicker'
    >
     <span class='ri-calendar-2-fill'></span>
   </span>
</div>
</file>

<file path="application/extensions/DateTimePickerWidget/DateTimePicker.php">
<?php
class DateTimePicker extends CInputWidget
{
    public $selector;
    public $format = 'dd/MM/yyyy hh:mm:ss';
    public $mainId = '';
    /**
     * @var string name for the inputfield
     */
    public $name = '';
    /**
     * https://getdatepicker.com/6/options.html
     * @var array pluginOptions to be passed to datetimepicker plugin. Defaults are:
     *
     * - format (custom, introduced by us)
     * - allowInputToggle: false
     * - showClear: false
     * - showToday: false
     * - showClose: false
     * - sideBySide: false
     * - stepping: 1, Controls how much the minutes are changed by
     * - locale: default
     * - minDate: undefined, Prevents the user from selecting a date/time before this value
     * - maxDate: undefined, Prevents the user from selecting a date/time after this value
     *
     * Following options are not yet done, because there are not needed right now:
     * - @TODO enabledDates: undefined
     * - @TODO disabledDates: undefined
     * - @TODO enabledHours: undefined
     * - @TODO disabledHours: undefined
... (334 lines truncated)
</file>

<file path="application/extensions/DateTimePickerWidget/README.md">
LS DateTimePicker Widget
==========

This widget is based on the [Tempus Dominus datepicker](https://getdatepicker.com/) which attempts to be the successor of the
eonasdan/bootstrap-datetimepicker.

As of now we use v6.0.0-beta7 as it is semi stable and supports Bootstrap 5.
Some buggy behaviors are fixed here, though.

## Use PHP widget
The widget works similar to the old datepicker widget.

```PHP
Yii::app()->getController()->widget('ext.DateTimePickerWidget.DateTimePicker', array(
                    'name' => 'expires',
                    'id' => 'expires',
                    'value' => $oUser->expires ? date(
                        $dateformatdetails['phpdate'] . " H:i",
                        strtotime($oUser->expires)
                    ) : '',
                    'pluginOptions' => [
                        'format' => $dateformatdetails['jsdate'] . " HH:mm",
                        'allowInputToggle' => true,
                        'showClear' => true,
                        'locale' => convertLStoDateTimePickerLocale(Yii::app()->session['adminlang'])
                    ]
                ));
```
Possible plugin options can be seen in docblock of
```PHP
... (40 lines truncated)
</file>

<file path="application/extensions/FlashMessage/views/message.php">
<div id="notif-container col-12" style="position: relative; top: 70px;" >
    <?php foreach ($aMessage as $message) :?>
        <?php
        if (!isset($message['type']) || (isset($message['type']) && !in_array($message['type'], array('success','info','warning','danger','error')))) {
            $message['type'] = 'success';
        }
        if ($message['type'] == 'error') {
            $message['type'] = 'danger';
        }
        ?>
        <div class="alert alert-<?php echo $message['type'];?> alert-dismissible col-12" role="alert">
            <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
             <?php echo $message['message'];?>
        </div>
    <?php endforeach;?>
</div>
</file>

<file path="application/extensions/FlashMessage/FlashMessage.php">
<?php
class FlashMessage extends CWidget
{
    public function run()
    {
        $aMessage = array();
        $assetUrl = Yii::app()->assetManager->publish(dirname(__FILE__) . '/assets');
        if (!empty(App()->session['aFlashMessage']) && count(Yii::app()->session['aFlashMessage'])) {
            $aMessage = App()->session['aFlashMessage'];
            unset(App()->session['aFlashMessage']);
        }
        if (!empty(App()->session['flashmessage']) && Yii::app()->session['flashmessage'] != '') {
            $message = App()->session['flashmessage'];
            unset(App()->session['flashmessage']);
            if ($message) {
                $aMessage[] = array('message' => $message);
            }
        }
        foreach (Yii::app()->user->getFlashes() as $key => $message) {
            if (is_string($message)) {
                $aMessage[] = array('message' => $message,'type' => $key);
            } elseif (is_array($message) && is_string($message['message']) && isset($message['type'])) {
                $aMessage[] = array('message' => $message['message'],'type' => $message['type']);
            } elseif (is_array($message) && is_string($message['message'])) {
                $aMessage[] = array('message' => $message['message']);
            }
        }
        App()->session['arrayNotificationMessages'] = $aMessage;
    }
}
... (1 lines truncated)
</file>

<file path="application/extensions/GeneralOptionWidget/settings/ClearDefaultGeneralOption.php">
<?php
use LimeSurvey\Datavalueobjects\GeneralOption;
use LimeSurvey\Datavalueobjects\FormElement;
use LimeSurvey\Datavalueobjects\SwitchOption;
class ClearDefaultGeneralOption extends GeneralOption
{
    public function __construct()
    {
        $this->name = 'clear_default';
        $this->title = gT('Clear default values');
        $this->inputType = 'switch';
        $this->formElement = new FormElement(
            'clear_default',
            null,
            gT('Default attribute values for this question type will be cleared'),
            '',
            [
                'classes' => [],
                'options' => [
                    new SwitchOption(gT('Off'), 'N'),
                    new SwitchOption(gT('On'), 'Y'),
                ]
            ]
        );
    }
}
</file>

<file path="application/extensions/GeneralOptionWidget/settings/EncryptionGeneralOption.php">
<?php
use LimeSurvey\Datavalueobjects\GeneralOption;
use LimeSurvey\Datavalueobjects\FormElement;
use LimeSurvey\Datavalueobjects\SwitchOption;
class EncryptionGeneralOption extends GeneralOption
{
    public function __construct(Question $question)
    {
        $this-> name = 'encrypted';
        $this-> title = gT('Encrypted');
        $this->inputType = 'switch';
        $this->formElement = new FormElement(
            'encrypted',
            null,
            gT('Store the answers to this question encrypted'),
            $question->encrypted,
            [
                'classes' => [],
                'options' => [
                    new SwitchOption(gT('Off'), 'N'),
                    new SwitchOption(gT('On'), 'Y'),
                ]
            ]
        );
        $this->setDisableInActive($question->survey);
    }
}
</file>

<file path="application/extensions/GeneralOptionWidget/settings/GroupSelectorGeneralOption.php">
<?php
use LimeSurvey\Datavalueobjects\GeneralOption;
use LimeSurvey\Datavalueobjects\FormElement;
use LimeSurvey\Datavalueobjects\SwitchOption;
class GroupSelectorGeneralOption extends GeneralOption
{
    public function __construct(Question $question, array $groupOptions)
    {
        $this->name = 'gid';
        $this->title = gT('Question group');
        $this->inputType = 'questiongroup';
        $this->setDisableInActive($question->survey);
        $this->formElement = new FormElement(
            'gid',
            null,
            gT("Reassign this question to another group by selecting a new one"),
            $question->gid,
            [
                'classes' => ['form-control'],
                'options' => $groupOptions
            ]
        );
    }
    public static function make(Question $question, $language)
    {
        $groups = QuestionGroup::model()->findAllByAttributes(
            ['sid'   => $question->sid ],
            ['order' => 'group_order']
        );
        $groupOptions = [];
... (13 lines truncated)
</file>

<file path="application/extensions/GeneralOptionWidget/settings/MandatoryGeneralOption.php">
<?php
use LimeSurvey\Datavalueobjects\GeneralOption;
use LimeSurvey\Datavalueobjects\FormElement;
use LimeSurvey\Datavalueobjects\SwitchOption;
class MandatoryGeneralOption extends GeneralOption
{
    public function __construct(Question $question)
    {
        $this->name = 'mandatory';
        $this->title = gT('Mandatory');
        $this->inputType = 'buttongroup';
        $this->formElement = new FormElement(
            'mandatory',
            null,
            gT('Makes this question mandatory in your survey. Option "Soft" gives a possibility to skip a question without giving any answer.', 'unescaped'),
            $question->mandatory,
            [
                'classes' => [],
                'options' => [
                    new SwitchOption(gT('On'), 'Y'),
                    new SwitchOption(gT('Soft'), 'S'),
                    new SwitchOption(gT('Off'), 'N')
                ]
            ]
        );
    }
}
</file>

<file path="application/extensions/GeneralOptionWidget/settings/OtherGeneralOption.php">
<?php
use LimeSurvey\Datavalueobjects\GeneralOption;
use LimeSurvey\Datavalueobjects\FormElement;
use LimeSurvey\Datavalueobjects\SwitchOption;
class OtherGeneralOption extends GeneralOption
{
    public function __construct(Question $question)
    {
        $this->name = 'other';
        $this->title = gT('Other');
        $this->inputType = 'switch';
        $this->setDisableInActive($question->survey);
        $this->formElement = new FormElement(
            'other',
            null,
            gT('Activate the "other" option for your question', 'unescaped'),
            $question->other,
            [
                'classes' => [],
                'options' => [
                    new SwitchOption(gT('Off'), 'N'),
                    new SwitchOption(gT('On'), 'Y')
                ]
            ]
        );
    }
}
</file>

<file path="application/extensions/GeneralOptionWidget/settings/QuestionThemeGeneralOption.php">
<?php
use LimeSurvey\Datavalueobjects\GeneralOption;
use LimeSurvey\Datavalueobjects\FormElement;
class QuestionThemeGeneralOption extends GeneralOption
{
    public function __construct($currentSetQuestionTheme, array $options)
    {
        $this->name = 'question_template';
        $this->title = gT('Question theme');
        $this->inputType = 'questiontheme';
        $this->formElement = new FormElement(
            'question_template',
            null,
            gT("Use a customized question theme for this question"),
            $currentSetQuestionTheme,
            $options
        );
    }
    public static function make(Question $question, $questionType, $currentSetQuestionTheme)
    {
        $aQuestionTemplateList = QuestionTemplate::getQuestionTemplateList($questionType);
        $aQuestionTemplateAttributes = $question->question_theme_name;
        $aOptionsArray = [];
        foreach ($aQuestionTemplateList as $code => $value) {
            $aOptionsArray[] = [
                'value' => $code,
                'text' => $value['title']
            ];
        }
        if ($currentSetQuestionTheme == null) {
... (11 lines truncated)
</file>

<file path="application/extensions/GeneralOptionWidget/settings/RelevanceEquationGeneralOption.php">
<?php
use LimeSurvey\Datavalueobjects\GeneralOption;
use LimeSurvey\Datavalueobjects\FormElement;
class RelevanceEquationGeneralOption extends GeneralOption
{
    public function __construct(Question $question)
    {
        if (count($question->conditions) > 0) {
            $inputType = 'text';
            $help = gT("Note: If you customize & save this condition you will not be able to use the condition editor for this, anymore.", 'unescaped');
        } else {
            $inputType = 'textarea';
            $help = gT("A condition can be used to add branching logic using ExpressionScript. Either edit it directly here or use the Condition designer.", 'unescaped');
        }
        $this->name = 'relevance';
        $this->title = gT('Condition');
        $this->inputType = $inputType;
        $this->formElement = new FormElement(
            'relevance',
            null,
            $help,
            $question->relevance,
            [
                'classes' => ['form-control'],
                'attributes' => [
                    'rows' => 1,
                    'placeholder' => '1',
                    'data-has-conditions' => count($question->conditions) > 0
                ],
                'inputGroup' => [
... (8 lines truncated)
</file>

<file path="application/extensions/GeneralOptionWidget/settings/SaveAsDefaultGeneralOption.php">
<?php
use LimeSurvey\Datavalueobjects\GeneralOption;
use LimeSurvey\Datavalueobjects\FormElement;
use LimeSurvey\Datavalueobjects\SwitchOption;
class SaveAsDefaultGeneralOption extends GeneralOption
{
    public function __construct(Question $question)
    {
        $this->name = 'save_as_default';
        $this->title = gT('Save as default values');
        $this->inputType = 'switch';
        $this->setDisableInActive($question->survey);
        $this->formElement = new FormElement(
            'save_as_default',
            null,
            gT('All attribute values for this question type will be saved as default', 'unescaped'),
            'N',
            [
                'classes' => [],
                'options' => [
                    new SwitchOption(gT('Off'), 'N'),
                    new SwitchOption(gT('On'), 'Y'),
                ]
            ]
        );
    }
}
</file>

<file path="application/extensions/GeneralOptionWidget/settings/ValidationGeneralOption.php">
<?php
use LimeSurvey\Datavalueobjects\GeneralOption;
use LimeSurvey\Datavalueobjects\FormElement;
use LimeSurvey\Datavalueobjects\SwitchOption;
class ValidationGeneralOption extends GeneralOption
{
    public function __construct(Question $question)
    {
        $this->name = 'preg';
        $this->title = gT('Input validation');
        $this->inputType = 'text';
        $this->formElement = new FormElement(
            'preg',
            null,
            gT('You can add any regular expression based validation in here', 'unescaped'),
            $question->preg,
            [
                'classes' => ['form-control'],
                'inputGroup' => [
                    'prefix' => 'RegExp',
                ]
            ]
        );
    }
}
</file>

<file path="application/extensions/GeneralOptionWidget/views/buttongroup.php">
<div class="btn-group" role="group" data-bs-toggle="buttons"
    aria-labelledby="label-<?= CHtml::getIdByName($this->generalOption->name); ?>"
    <?= ($this->generalOption->formElement->help) ? 'aria-describedby="help-' . CHtml::getIdByName($this->generalOption->name) . '"' : "" ?>
    >
    <?php foreach ($this->generalOption->formElement->options['options'] as $i => $option) : ?>
        <?php if ($this->generalOption->formElement->value == $option->value) : ?>
            <input
                class="btn-check"
                type="radio"
                id="question[<?= $this->generalOption->name; ?>]_<?= $option->value; ?>"
                name="question[<?= $this->generalOption->name; ?>]"
                    value="<?= CHtml::encode($option->value); ?>"
                checked
            />
            <label
                class="btn btn-outline-secondary"
                for="question[<?= $this->generalOption->name; ?>]_<?= $option->value; ?>"
            >
                <?= $option->text; ?>
            </label>
        <?php else : ?>
            <input
                class="btn-check"
                type="radio"
                id="question[<?= $this->generalOption->name; ?>]_<?= $option->value; ?>"
                name="question[<?= $this->generalOption->name; ?>]"
                    value="<?= CHtml::encode($option->value); ?>"
            />
            <label
                class="btn btn-outline-secondary"
... (8 lines truncated)
</file>

<file path="application/extensions/GeneralOptionWidget/views/layout.php">
<?php
$labelAttr = in_array($this->generalOption->inputType, GeneralOptionWidget::SINGLEINPUTTYPE) ? 'for="' : 'id="label-';
$labelAttr .= CHtml::getIdByName($this->generalOption->name) . '"';
?>
<div class="mb-3">
    <div class="question-option-general-setting-block">
        <div class="col-12">
            <label <?= $labelAttr; ?>>
                <?= $this->generalOption->title; ?>
            </label>
        <?php if ($this->generalOption->formElement->help) : ?>
            <a
                role="button"
                data-bs-toggle="collapse"
                href="#help-<?= CHtml::getIdByName($this->generalOption->name); ?>"
            ><i
                class="ri-information-fill"
                data-bs-toggle="tooltip"
                title="<?= CHtml::encode(strip_tags((string) $this->generalOption->formElement->help)) ?>"
            > </i><span class="visually-hidden"><?= gT("Show help"); ?></span> </a>
            <div class="help-block collapse" id="help-<?= CHtml::getIdByName($this->generalOption->name); ?>" aria-expanded="false"><?= $this->generalOption->formElement->help; ?></div>
        <?php endif; ?>
        </div>
        <?= $content; ?>
    </div>
</div>
</file>

<file path="application/extensions/GeneralOptionWidget/views/questiongroup.php">
<select
    class="form-select"
    name="question[<?= $this->generalOption->name ?>]"
    id="<?= CHtml::getIdByName($this->generalOption->name) ?>"
    <?= ($this->generalOption->formElement->help) ? 'aria-describedby="help-' . CHtml::getIdByName($this->generalOption->name) . '"' : "" ?>
    <?= $this->generalOption->disabled ? 'disabled' : '' ?>
>
    <!-- TODO: Fix weird object reference. -->
    <?php foreach ($this->generalOption->formElement->options['options'] as $option) : ?>
        <?php if ($this->generalOption->formElement->value == $option->value) : ?>
            <option value="<?= CHtml::encode($option->value) ?>" selected="selected"><?= $option->text ?></option>
        <?php else : ?>
            <option value="<?= CHtml::encode($option->value) ?>"><?= $option->text ?></option>
        <?php endif; ?>
    <?php endforeach; ?>
</select>
</file>

<file path="application/extensions/GeneralOptionWidget/views/questiontheme.php">
<!-- TODO: Advanced setting or not? -->
<!-- TODO: $option should be object? -->
<?php ?>
<select
    class="form-select"
    name="advancedSettings[question_template][<?= $this->generalOption->name; ?>]"
    id="<?= CHtml::getIdByName($this->generalOption->name); ?>"
    <?= ($this->generalOption->formElement->help) ? 'aria-describedby="help-' . CHtml::getIdByName($this->generalOption->name) . '"' : "" ?>
    style="display:none"
>
    <?php foreach ($this->generalOption->formElement->options as $option) : ?>
        <?php if ($this->generalOption->formElement->value == $option['value']) : ?>
            <option value="<?= CHtml::encode($option['value']); ?>" selected="selected"><?= $option['text']; ?></option>
        <?php else : ?>
            <option value="<?= CHtml::encode($option['value']); ?>"><?= $option['text']; ?></option>
        <?php endif; ?>
    <?php endforeach; ?>
</select>
<?php
if ($this->generalOption->formElement->value == $option['value']) {
    echo ': ' . $this->generalOption->formElement->value;
}
?>
</file>

<file path="application/extensions/GeneralOptionWidget/views/switch.php">
<div class="btn-group" role="group" data-bs-toggle="buttons"
    aria-labelledby="label-<?= CHtml::getIdByName($this->generalOption->name); ?>"
    <?= ($this->generalOption->formElement->help) ? 'aria-describedby="help-' . CHtml::getIdByName($this->generalOption->name) . '"' : "" ?>
    >
    <?php if ($this->generalOption->formElement->value === 'Y') : ?>
        <input
            class="btn-check"
            type="radio"
            id="question[<?= $this->generalOption->name ?>]_Y"
            name="question[<?= $this->generalOption->name ?>]"
            value="Y"
            <?= $this->generalOption->disabled ? 'disabled' : '' ?>
            checked
        />
        <label
            class="btn btn-outline-secondary <?= $this->generalOption->disabled ? 'disabled' : '' ?>"
            for="question[<?= $this->generalOption->name ?>]_Y"
        >
            <?= gT('On') ?>
        </label>
        <input
            class="btn-check"
            type="radio"
            id="question[<?= $this->generalOption->name ?>]_N"
            name="question[<?= $this->generalOption->name ?>]"
            value="N"
            <?= $this->generalOption->disabled ? 'disabled' : '' ?>
            />
        <label
            class="btn btn-outline-secondary <?= $this->generalOption->disabled ? 'disabled' : '' ?>"
... (37 lines truncated)
</file>

<file path="application/extensions/GeneralOptionWidget/views/text.php">
<div class="input-group col-12">
    <div class="input-group-text">
        <?= $this->generalOption->formElement->options['inputGroup']['prefix']; ?>
    </div>
    <input
        type="text"
        class="form-control"
        name="question[<?= $this->generalOption->name; ?>]"
        id="<?= CHtml::getIdByName($this->generalOption->name); ?>"
        value="<?= CHtml::encode($this->generalOption->formElement->value); ?>"
        <?= ($this->generalOption->formElement->help) ? 'aria-describedby="help-' . CHtml::getIdByName($this->generalOption->name) . '"' : "" ?>
        <?php foreach ($this->generalOption->formElement->options['attributes'] as $attributeName => $attributeValue) {
            echo $attributeName . '="' . CHtml::encode($attributeValue) . '"';
        } ?>
    />
    <?php if (isset($this->generalOption->formElement->options['inputGroup']['suffix'])) : ?>
        <div class="input-group-text">
            <?= $this->generalOption->formElement->options['inputGroup']['suffix']; ?>
        </div>
    <?php endif; ?>
</div>
</file>

<file path="application/extensions/GeneralOptionWidget/views/textarea.php">
<div class="input-group col-12">
    <?php if (isset($this->generalOption->formElement->options['inputGroup']['prefix'])) : ?>
        <div class="input-group-text">
            <?= $this->generalOption->formElement->options['inputGroup']['prefix']; ?>
        </div>
    <?php endif; ?>
    <textarea
        class="form-control"
        name="question[<?= $this->generalOption->name; ?>]"
        id="<?= CHtml::getIdByName($this->generalOption->name); ?>"
        <?= ($this->generalOption->formElement->help) ? 'aria-describedby="help-' . CHtml::getIdByName($this->generalOption->name) . '"' : "" ?>
        <?= isset($this->generalOption->formElement->options['attributes']['placeholder']) ? 'placeholder="' . CHtml::encode($this->generalOption->formElement->options['attributes']['placeholder']) . '"' : "" ?>
        ><?= CHtml::encode($this->generalOption->formElement->value); ?></textarea>
    <?php if (isset($this->generalOption->formElement->options['inputGroup']['suffix'])) : ?>
        <div class="input-group-text">
            <?= $this->generalOption->formElement->options['inputGroup']['suffix']; ?>
        </div>
    <?php endif; ?>
</div>
</file>

<file path="application/extensions/GeneralOptionWidget/GeneralOptionWidget.php">
<?php
class GeneralOptionWidget extends CWidget
{
    public $generalOption;
    const SINGLEINPUTTYPE = array(
        'questiongroup',
        'questiontheme',
        'text',
        'textarea'
    );
    public function run()
    {
        if (!empty($this->generalOption->formElement->options['attributes'])) {
            unset($this->generalOption->formElement->options['attributes']['id']);
            unset($this->generalOption->formElement->options['attributes']['name']);
            unset($this->generalOption->formElement->options['attributes']['value']);
            unset($this->generalOption->formElement->options['attributes']['class']);
        } else {
            $this->generalOption->formElement->options['attributes'] = [];
        }
        $content = $this->render($this->generalOption->inputType, null, true);
        $this->render('layout', ['content' => $content]);
    }
}
</file>

<file path="application/extensions/InputWidget/views/input.php">
<?php
?>
<?php if ($isAttached) : ?>
    <?php if ($attachContent != '') : ?>
        <?= CHtml::tag('div', $wrapperHtmlOptions, CHtml::textField($name, $value, $htmlOptions) . $attachContent, true)  ?>
    <?php else : ?>
        <?= CHtml::textField($name, $value, $htmlOptions)  ?>
    <?php endif; ?>
<?php endif;
</file>

<file path="application/extensions/InputWidget/InputWidget.php">
<?php
class InputWidget extends CInputWidget
{
    public $value = '';
  /** @var bool if button should behave as dropdown true or false */
    public $isImportant = false;
  /** @var bool if the attach is displayed.   */
    public $isAttached = false;
  /** @var string string that should contain valid html list for bootstrap component.
   * Only used when not empty and isAttached is true
   */
    public $attachContent = '';
  /** @var array html options */
    public $htmlOptions = [];
  /** @var array html options */
    public $wrapperHtmlOptions = [];
    public function init()
    {
        $this->setDefaultOptions();
    }
    public function run()
    {
        $this->renderInput();
    }
  /** Renders the button */
    public function renderInput()
    {
        list($name, $id) = $this->resolveNameID();
        $this->render('input', [
        'name' => $name,
... (32 lines truncated)
</file>

<file path="application/extensions/LimeDebug/LimeDebug.php">
<?php
class LimeDebug extends CWidget
{
    public function run()
    {
        if (YII_DEBUG && in_array(getRealIPAddress(), array("127.0.0.1","::1"))) {
            $data = array(
                'session' => $_SESSION,
                'server' => $_SERVER
            );
            $json = json_encode($data, JSON_FORCE_OBJECT);
            $script = "LSdebug = $json;\n";
            $script .= "console.dir(LSdebug)\n";
            App()->getClientScript()->registerScript('LimeDebug', $script, CClientScript::POS_HEAD);
        }
    }
}
</file>

<file path="application/extensions/LimeScript/LimeScript.php">
<?php
class LimeScript extends CWidget
{
    public function run()
    {
        App()->getClientScript()->registerScriptFile(App()->getAssetManager()->publish(Yii::getPathOfAlias('ext.LimeScript.assets') . '/script.js'));
        $data = array();
        $data['baseUrl']                    = Yii::app()->getBaseUrl(true);
        $data['showScriptName']             = Yii::app()->urlManager->showScriptName;
        $data['urlFormat']                  = Yii::app()->urlManager->urlFormat;
        $data['adminImageUrl']              = Yii::app()->getConfig('adminimageurl');
        $data['csrfTokenName']              = Yii::app()->request->csrfTokenName;
        $data['csrfToken']                  = Yii::app()->request->csrfToken;
        $data['csrfTokenData']              = array(Yii::app()->request->csrfTokenName => Yii::app()->request->csrfToken);
        $data['language']                   = Yii::app()->language;
        $data['replacementFields']['path']  = App()->createUrl("limereplacementfields/index");
        $json = json_encode($data, JSON_FORCE_OBJECT);
        $script = "LS.data = $json;\n
                    // @see https://cheatsheetseries.owasp.org/cheatsheets/Cross-Site_Request_Forgery_Prevention_Cheat_Sheet.html#jquery
                    function csrfSafeMethod(method) {
                        // these HTTP methods do not require CSRF protection
                        return (/^(GET|HEAD|OPTIONS)$/.test(method));
                    }
                    // Use $.ajaxPrefilter() instead of $.ajaxSetup({beforeSend: ...}) to add the CSRF token because beforeSend is
                    // executed after the content type is determined. So, if the request had no data when beforeSend is executed,
                    // the content type is 'text/plain', which is wrong.
                    // urlencode for security (encode simple and double quote and antislash)
                    $.ajaxPrefilter(function(settings) {
                        if(!csrfSafeMethod(settings.type)) {
                            // Data could be passed as string or object, so we add the token depending on the data type
... (13 lines truncated)
</file>

<file path="application/extensions/LimeTopbarWidget/views/topbar.php">
<?php
?>
<div class="topbar sticky-top <?php if ($editorEnabled) {
    echo 'editor';
} ?>" id="pjax-content">
    <div class="container-fluid">
        <div class="row">
            <!-- Title or breadcrumb -->
            <div class="ls-breadcrumb col-12">
                <div class="align-items-center d-flex">
                    <?php
                    if ($titleBackLink !== null) {
                        echo '<a class="h1 me-1 ls-link" href="' . CHtml::encode($titleBackLink) . '" aria-label="' . gT('Back') . '">'
                            . '<i class="ri-arrow-left-s-line" aria-hidden="true"></i></a>';
                    }
                    ?>
                    <?php if (!$isBreadCrumb) : ?>
                        <h1 class="h1 mb-0"><?= $leftSide ?></h1>
                    <?php else : ?>
                        <?= $leftSide ?>
                    <?php endif; ?>
                </div>
            </div>
            <!-- middle part with buttons -->
            <div class="ls-topbar-buttons pjax col">
                <?php
                if ($middle !== null) {
                    echo $middle;
                }
                ?>
... (13 lines truncated)
</file>

<file path="application/extensions/LimeTopbarWidget/TopbarWidget.php">
<?php
class TopbarWidget extends CWidget
{
    public $leftSide = null;
    public $titleBackLink = null;
    public $isBreadCrumb = false;
    public $middle = null;
    public $rightSide = null;
    public function init()
    {
        parent::init();
        $this->registerClientScript();
        $this->renderTopbar();
    }
    protected function renderTopbar()
    {
        $this->render(
            'topbar',
            [
                'leftSide' => $this->leftSide,
                'middle' => $this->middle,
                'rightSide' => $this->rightSide,
                'isBreadCrumb' => $this->isBreadCrumb,
                'titleBackLink' => $this->titleBackLink,
                'editorEnabled' => Yii::app()->getConfig('editorEnabled') ?? false,
            ]
        );
    }
    public function registerClientScript()
    {
... (7 lines truncated)
</file>

<file path="application/extensions/OptionsModalWidget/views/modal.php">
<div class="modal fade" id="<?= $id ?>" role="dialog">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title"><?= $modalTitle ?></h5>
                <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
            </div>
            <div class="modal-body">
                <ul class="list-group">
                <?php foreach ($options as $optionData) : ?>
                    <li class="list-group-item">
                        <?php $targetAttribute = isset($optionData['target']) ? 'target="' . $optionData['target'] . '"' : '' ?>
                        <a class="<?= $optionData['linkClass'] ?> ls-link" href="<?= $optionData['href'] ?>" <?= $targetAttribute ?>><?= $optionData['text'] ?></a>
                    </li>
                <?php endforeach; ?>
                </ul>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">
                    <?= gT("Close"); ?>
                </button>
            </div>
        </div>
    </div>
</div>
</file>

<file path="application/extensions/OptionsModalWidget/OptionsModalWidget.php">
<?php
class OptionsModalWidget extends CWidget
{
    public $id = null;
    public $modalTitle = '';
    public $options = [];
    /**
     * @return void
     * @throws CException
     */
    public function run()
    {
        $this->render('modal', [
            'id' => $this->getModalId(),
            'options' => $this->normaliseOptions($this->options),
            'modalTitle' => $this->modalTitle ?? gT("Select an option")
        ]);
        $this->registerScript();
    }
    public function normaliseOptions($options)
    {
        return array_map(function ($option) {
            return [
                'key' => $option['key'] ?? 'option_' . bin2hex(random_bytes(2)),
                'linkClass' => $option['linkClass'] ?? '',
                'href' => $option['href'] ?? '#',
                'text' => $option['text'] ?? '',
                'target' => $option['target'] ?? null,
            ];
        }, $options);
... (19 lines truncated)
</file>

<file path="application/extensions/PanelBoxWidget/views/box.php">
<div class="<?php echo $sizeClass; ?> ls-flex-column ls-panelboxes-panelbox">
    <div class="card card-primary card-clickable ls-panelboxes-panelbox-inner selector__<?php echo CHtml::encode(str_replace(' ', '_', strtolower(strip_tags((string)$title)))) ?>"
         id="card-<?php echo $position; ?>"
         data-url="<?php echo CHtml::encode($url); ?>" <?php if ($external) : ?>
        data-target="_blank"
                   <?php endif; ?>>
        <div class="card-header">
            <div class="card-title"><?php echo viewHelper::filterScript(gT($title)); ?></div>
        </div>
        <div class="card-body d-flex">
            <?php echo viewHelper::filterScript(gT($description)); ?>
        </div>
        <div class="card-footer d-flex">
            <button class="btn btn-outline-secondary" role="button">
                <i class="<?php echo CHtml::encode($ico); ?>"></i>
                <?php echo viewHelper::filterScript(gT($buttontext)); ?>
            </button>
        </div>
    </div>
</div>
</file>

<file path="application/extensions/PanelBoxWidget/views/row_footer.php">
</div>
</div>
</file>

<file path="application/extensions/PanelBoxWidget/views/row_header.php">
<div class="<?php echo $containerclass; ?> ls-flex ls-panelboxes selector__lstour--mainfunctionboxes">
<div class="ls-flex ls-flex-row wrap ls-panelboxes-inner-container <?php echo $orientation; ?> " >
</file>

<file path="application/extensions/PanelBoxWidget/PanelBoxWidget.php">
<?php
class PanelBoxWidget extends CWidget
{
    public $fromDb = false;
    public $dbPosition = 1;
    public $position;
    public $url;
    public $title;
    public $ico;
    public $description;
    public $buttontext;
    public $usergroup;
    public $offset = 3;
    public $display = 'singlebox';
    public $boxesbyrow = 3;
    public $external = false;
    public $boxesincontainer = false;
    public function run()
    {
        App()->getClientScript()->registerPackage('panelboxes');
        if ($this->display == 'singlebox') {
            if ($this->fromDb) {
                $this->setValuesFromDb();
            }
            return $this->renderBox();
        } elseif ($this->display = 'allboxesinrows') {
            return $this->renderRows();
        }
    }
    public function getBoxes()
... (115 lines truncated)
</file>

<file path="application/extensions/SettingsWidget/SettingsWidget.php">
<?php
class SettingsWidget extends CWidget
{
    protected static $counter = 0;
    public $action;
    public $buttons = array();
    public $form = true;
    public $formHtmlOptions = array();
    public $fieldHtmlOptions = array();
    public $method = 'post';
    public $prefix;
    public $settings = array();
    public $title;
    public $labelWidth = 6;
    public $controlWidth = 6;
    public $additionalHtml = "";
    /**
     * Where to render the button row: 'bottom' (default, below the settings
     * list, offset to align under the controls) or 'top' (above the settings
     * list, right-aligned).
     * @var string
     */
    public $buttonsPosition = 'bottom';
    public function beginForm()
    {
        if ($this->form) {
            echo CHtml::beginForm($this->action, $this->method, $this->formHtmlOptions);
        } else {
            $this->fieldHtmlOptions = array_replace($this->formHtmlOptions, $this->fieldHtmlOptions);
        }
... (553 lines truncated)
</file>

<file path="application/extensions/SideBarWidget/views/side_bar.php">
<?php
?>
<div class="sidebar">
    <div class="sidebar-icons">
        <?php foreach ($icons as $icon) : ?>
            <div class="sidebar-icon">
                <div data-bs-toggle="tooltip"
                     title="<?= CHtml::encode($icon['title']) ?>"
                     data-bs-offset="0, 20"
                     data-bs-placement="right">
                    <a href="<?= CHtml::encode($icon['url']) ?>"
                       target="<?= $icon['external'] ? '_blank' : '' ?>"
                       class="btn btn-g-800 btn-icon <?= $icon['selected'] ? 'active' : '' ?>"
                       aria-label="<?= CHtml::encode($icon['title']) ?>"
                        <?= $icon['selected'] ? 'aria-current="page" selected' : '' ?>>
                        <i class="<?= CHtml::encode($icon['ico']); ?>" aria-hidden="true"></i>
                    </a>
                </div>
            </div>
        <?php endforeach; ?>
    </div>
    <?php
    ?>
</div>
</file>

<file path="application/extensions/SideBarWidget/SideBarWidget.php">
<?php
class SideBarWidget extends CWidget
{
    public function init(): void
    {
        $this->registerClientScript();
    }
    public function run(): void
    {
        $this->renderActions();
    }
    public function renderActions(): void
    {
        $route = App()->urlManager->parseUrl(App()->request);
        $boxes = Box::model()->findAll(['order' => 'position ASC']);
        $boxesData = [];
        foreach ($boxes as $box) {
            $boxData['position'] = $box->position;
            if (!preg_match("/^(http|https)/", $box->url)) {
                $boxData['url'] = App()->createUrl($box->url);
                $boxData['external'] = false;
            } else {
                $boxData['url'] = $box->url;
                $boxData['external'] = true;
            }
            $boxData['title'] = $box->getLocalizedTitle();
            $boxData['ico'] = $box->getIconName();
            $boxData['description'] = $box->desc;
            $boxData['selected'] = substr($route, 0, strlen($box->url)) === $box->url;
            $canSeeBox = false;
... (36 lines truncated)
</file>

<file path="application/extensions/UserPermissionsWidget/views/table.php">
<div class="table-responsive">
    <table class='table table-hover table-permissions-set'>
        <thead>
        <tr>
            <th></th>
            <th>
                <?php eT("Permission"); ?>
            </th>
            <th>
                <input type="checkbox" class="markall" name='markall'/>
                <input type='button' id='btnToggleAdvanced' value='<<' class='btn btn-outline-secondary'/>
            </th>
            <th class='extended'><?php eT("Create"); ?></th>
            <th class='extended'><?php eT("View/read"); ?></th>
            <th class='extended'><?php eT("Update"); ?></th>
            <th class='extended'><?php eT("Delete"); ?></th>
            <th class='extended'><?php eT("Import"); ?></th>
            <th class='extended'><?php eT("Export"); ?></th>
        </tr>
        </thead>
        <tbody>
        <?php foreach ($aPermissions as $sPermission => $aCurrentPermissions) : ?>
            <tr>
                <td><?= $aCurrentPermissions['description'] ?></td>
                <td><?= $aCurrentPermissions['title'] ?></td>
                <td><?php echo CHtml::checkBox("all_$sPermission", false, ['class' => 'markrow']) ?></td>
                <?php foreach ($aCurrentPermissions['current'] as $sKey => $aValues) : ?>
                    <td class='extended'>
                        <?php if ($aCurrentPermissions[$sKey] && !$aValues['forced']) {
                            echo CHtml::checkBox(
... (23 lines truncated)
</file>

<file path="application/extensions/UserPermissionsWidget/UserPermissionsWidget.php">
<?php
class UserPermissionsWidget extends CWidget
{
    public $aPermissions;
    public function run()
    {
        if (empty($this->aPermissions)) {
            return;
        }
        $this->render('table', ['aPermissions' => $this->aPermissions]);
    }
}
</file>

<file path="application/extensions/yii-jsoneditor/jsoneditor-2.3.6/docs/api.md">
# API Reference

## JSONEditor

### Constructor

#### `JSONEditor(container [, options] [, json])`

Constructs a new JSONEditor.

*Parameters:*

- `{Element} container`
  An HTML DIV element. The JSONEditor will be created inside this container
  element.
- `{Object} options`
  Optional object with options. Available options:

  - `{function} change`.
    Set a callback method triggered when the contents of the JSONEditor change.
    Called without parameters.
  - `{function} error`.
    Set a callback method triggered when an error occurs.
    Invoked with the error as first argument. The callback is only invoked
    for errors triggered by a users action.
  - `{boolean} history`.
    Enables history, adds a button Undo and Redo to the menu of the JSONEditor.
    True by default. Only applicable when `mode` is 'tree' or 'form'.
  - `{String} mode`.
    Set the editor mode. Available values: 'tree' (default), 'view', 'form',
... (162 lines truncated)
</file>

<file path="application/extensions/yii-jsoneditor/jsoneditor-2.3.6/docs/usage.md">
# Usage

### Install

with npm:

    npm install jsoneditor

with bower:

    bower install jsoneditor

download:

[http://jsoneditoronline.org/downloads/](http://jsoneditoronline.org/downloads/)

The library consists of three files: one javascript file, one css file and an
image. Both full and minified version are available.

## Load

To implement JSONEditor in a web application, load the javascript and css file
in the head of the HTML page:

```html
<link rel="stylesheet" type="text/css" href="jsoneditor/jsoneditor-min.css">
<script type="text/javascript" src="jsoneditor/jsoneditor-min.js"></script>
```

### Detailed error messages
... (108 lines truncated)
</file>

<file path="application/extensions/yii-jsoneditor/jsoneditor-2.3.6/examples/requirejs_demo/scripts/main.js">
var module = '../../../jsoneditor';
require([module], function (jsoneditor) {
  var container = document.getElementById('jsoneditor');
  var editor = new jsoneditor.JSONEditor(container);
  document.getElementById('setJSON').onclick = function () {
    var json = {
      'array': [1, 2, 3],
      'boolean': true,
      'null': null,
      'number': 123,
      'object': {'a': 'b', 'c': 'd'},
      'string': 'Hello World'
    };
    editor.set(json);
  };
  document.getElementById('getJSON').onclick = function () {
    var json = editor.get();
    alert(JSON.stringify(json, null, 2));
  };
});
</file>

<file path="application/extensions/yii-jsoneditor/jsoneditor-2.3.6/examples/requirejs_demo/scripts/require.js">
var requirejs,require,define;
(function(Y){function H(b){return"[object Function]"===L.call(b)}function I(b){return"[object Array]"===L.call(b)}function x(b,c){if(b){var d;for(d=0;d<b.length&&(!b[d]||!c(b[d],d,b));d+=1);}}function M(b,c){if(b){var d;for(d=b.length-1;-1<d&&(!b[d]||!c(b[d],d,b));d-=1);}}function r(b,c){return da.call(b,c)}function i(b,c){return r(b,c)&&b[c]}function E(b,c){for(var d in b)if(r(b,d)&&c(b[d],d))break}function Q(b,c,d,i){c&&E(c,function(c,h){if(d||!r(b,h))i&&"string"!==typeof c?(b[h]||(b[h]={}),Q(b[h],
c,d,i)):b[h]=c});return b}function t(b,c){return function(){return c.apply(b,arguments)}}function Z(b){if(!b)return b;var c=Y;x(b.split("."),function(b){c=c[b]});return c}function J(b,c,d,i){c=Error(c+"\nhttp://requirejs.org/docs/errors.html#"+b);c.requireType=b;c.requireModules=i;d&&(c.originalError=d);return c}function ea(b){function c(a,g,v){var e,n,b,c,d,j,f,h=g&&g.split("/");e=h;var l=m.map,k=l&&l["*"];if(a&&"."===a.charAt(0))if(g){e=i(m.pkgs,g)?h=[g]:h.slice(0,h.length-1);g=a=e.concat(a.split("/"));
for(e=0;g[e];e+=1)if(n=g[e],"."===n)g.splice(e,1),e-=1;else if(".."===n)if(1===e&&(".."===g[2]||".."===g[0]))break;else 0<e&&(g.splice(e-1,2),e-=2);e=i(m.pkgs,g=a[0]);a=a.join("/");e&&a===g+"/"+e.main&&(a=g)}else 0===a.indexOf("./")&&(a=a.substring(2));if(v&&(h||k)&&l){g=a.split("/");for(e=g.length;0<e;e-=1){b=g.slice(0,e).join("/");if(h)for(n=h.length;0<n;n-=1)if(v=i(l,h.slice(0,n).join("/")))if(v=i(v,b)){c=v;d=e;break}if(c)break;!j&&(k&&i(k,b))&&(j=i(k,b),f=e)}!c&&j&&(c=j,d=f);c&&(g.splice(0,d,
c),a=g.join("/"))}return a}function d(a){z&&x(document.getElementsByTagName("script"),function(g){if(g.getAttribute("data-requiremodule")===a&&g.getAttribute("data-requirecontext")===j.contextName)return g.parentNode.removeChild(g),!0})}function y(a){var g=i(m.paths,a);if(g&&I(g)&&1<g.length)return d(a),g.shift(),j.require.undef(a),j.require([a]),!0}function f(a){var g,b=a?a.indexOf("!"):-1;-1<b&&(g=a.substring(0,b),a=a.substring(b+1,a.length));return[g,a]}function h(a,g,b,e){var n,u,d=null,h=g?g.name:
null,l=a,m=!0,k="";a||(m=!1,a="_@r"+(L+=1));a=f(a);d=a[0];a=a[1];d&&(d=c(d,h,e),u=i(p,d));a&&(d?k=u&&u.normalize?u.normalize(a,function(a){return c(a,h,e)}):c(a,h,e):(k=c(a,h,e),a=f(k),d=a[0],k=a[1],b=!0,n=j.nameToUrl(k)));b=d&&!u&&!b?"_unnormalized"+(M+=1):"";return{prefix:d,name:k,parentMap:g,unnormalized:!!b,url:n,originalName:l,isDefine:m,id:(d?d+"!"+k:k)+b}}function q(a){var g=a.id,b=i(k,g);b||(b=k[g]=new j.Module(a));return b}function s(a,g,b){var e=a.id,n=i(k,e);if(r(p,e)&&(!n||n.defineEmitComplete))"defined"===
g&&b(p[e]);else q(a).on(g,b)}function C(a,g){var b=a.requireModules,e=!1;if(g)g(a);else if(x(b,function(g){if(g=i(k,g))g.error=a,g.events.error&&(e=!0,g.emit("error",a))}),!e)l.onError(a)}function w(){R.length&&(fa.apply(F,[F.length-1,0].concat(R)),R=[])}function A(a,g,b){var e=a.map.id;a.error?a.emit("error",a.error):(g[e]=!0,x(a.depMaps,function(e,c){var d=e.id,h=i(k,d);h&&(!a.depMatched[c]&&!b[d])&&(i(g,d)?(a.defineDep(c,p[d]),a.check()):A(h,g,b))}),b[e]=!0)}function B(){var a,g,b,e,n=(b=1E3*m.waitSeconds)&&
j.startTime+b<(new Date).getTime(),c=[],h=[],f=!1,l=!0;if(!T){T=!0;E(k,function(b){a=b.map;g=a.id;if(b.enabled&&(a.isDefine||h.push(b),!b.error))if(!b.inited&&n)y(g)?f=e=!0:(c.push(g),d(g));else if(!b.inited&&(b.fetched&&a.isDefine)&&(f=!0,!a.prefix))return l=!1});if(n&&c.length)return b=J("timeout","Load timeout for modules: "+c,null,c),b.contextName=j.contextName,C(b);l&&x(h,function(a){A(a,{},{})});if((!n||e)&&f)if((z||$)&&!U)U=setTimeout(function(){U=0;B()},50);T=!1}}function D(a){r(p,a[0])||
q(h(a[0],null,!0)).init(a[1],a[2])}function G(a){var a=a.currentTarget||a.srcElement,b=j.onScriptLoad;a.detachEvent&&!V?a.detachEvent("onreadystatechange",b):a.removeEventListener("load",b,!1);b=j.onScriptError;(!a.detachEvent||V)&&a.removeEventListener("error",b,!1);return{node:a,id:a&&a.getAttribute("data-requiremodule")}}function K(){var a;for(w();F.length;){a=F.shift();if(null===a[0])return C(J("mismatch","Mismatched anonymous define() module: "+a[a.length-1]));D(a)}}var T,W,j,N,U,m={waitSeconds:7,
baseUrl:"./",paths:{},pkgs:{},shim:{},map:{},config:{}},k={},X={},F=[],p={},S={},L=1,M=1;N={require:function(a){return a.require?a.require:a.require=j.makeRequire(a.map)},exports:function(a){a.usingExports=!0;if(a.map.isDefine)return a.exports?a.exports:a.exports=p[a.map.id]={}},module:function(a){return a.module?a.module:a.module={id:a.map.id,uri:a.map.url,config:function(){return m.config&&i(m.config,a.map.id)||{}},exports:p[a.map.id]}}};W=function(a){this.events=i(X,a.id)||{};this.map=a;this.shim=
i(m.shim,a.id);this.depExports=[];this.depMaps=[];this.depMatched=[];this.pluginMaps={};this.depCount=0};W.prototype={init:function(a,b,c,e){e=e||{};if(!this.inited){this.factory=b;if(c)this.on("error",c);else this.events.error&&(c=t(this,function(a){this.emit("error",a)}));this.depMaps=a&&a.slice(0);this.errback=c;this.inited=!0;this.ignore=e.ignore;e.enabled||this.enabled?this.enable():this.check()}},defineDep:function(a,b){this.depMatched[a]||(this.depMatched[a]=!0,this.depCount-=1,this.depExports[a]=
b)},fetch:function(){if(!this.fetched){this.fetched=!0;j.startTime=(new Date).getTime();var a=this.map;if(this.shim)j.makeRequire(this.map,{enableBuildCallback:!0})(this.shim.deps||[],t(this,function(){return a.prefix?this.callPlugin():this.load()}));else return a.prefix?this.callPlugin():this.load()}},load:function(){var a=this.map.url;S[a]||(S[a]=!0,j.load(this.map.id,a))},check:function(){if(this.enabled&&!this.enabling){var a,b,c=this.map.id;b=this.depExports;var e=this.exports,n=this.factory;
if(this.inited)if(this.error)this.emit("error",this.error);else{if(!this.defining){this.defining=!0;if(1>this.depCount&&!this.defined){if(H(n)){if(this.events.error)try{e=j.execCb(c,n,b,e)}catch(d){a=d}else e=j.execCb(c,n,b,e);this.map.isDefine&&((b=this.module)&&void 0!==b.exports&&b.exports!==this.exports?e=b.exports:void 0===e&&this.usingExports&&(e=this.exports));if(a)return a.requireMap=this.map,a.requireModules=[this.map.id],a.requireType="define",C(this.error=a)}else e=n;this.exports=e;if(this.map.isDefine&&
!this.ignore&&(p[c]=e,l.onResourceLoad))l.onResourceLoad(j,this.map,this.depMaps);delete k[c];this.defined=!0}this.defining=!1;this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0)}}else this.fetch()}},callPlugin:function(){var a=this.map,b=a.id,d=h(a.prefix);this.depMaps.push(d);s(d,"defined",t(this,function(e){var n,d;d=this.map.name;var v=this.map.parentMap?this.map.parentMap.name:null,f=j.makeRequire(a.parentMap,{enableBuildCallback:!0,
skipMap:!0});if(this.map.unnormalized){if(e.normalize&&(d=e.normalize(d,function(a){return c(a,v,!0)})||""),e=h(a.prefix+"!"+d,this.map.parentMap),s(e,"defined",t(this,function(a){this.init([],function(){return a},null,{enabled:!0,ignore:!0})})),d=i(k,e.id)){this.depMaps.push(e);if(this.events.error)d.on("error",t(this,function(a){this.emit("error",a)}));d.enable()}}else n=t(this,function(a){this.init([],function(){return a},null,{enabled:!0})}),n.error=t(this,function(a){this.inited=!0;this.error=
a;a.requireModules=[b];E(k,function(a){0===a.map.id.indexOf(b+"_unnormalized")&&delete k[a.map.id]});C(a)}),n.fromText=t(this,function(e,c){var d=a.name,u=h(d),v=O;c&&(e=c);v&&(O=!1);q(u);r(m.config,b)&&(m.config[d]=m.config[b]);try{l.exec(e)}catch(k){throw Error("fromText eval for "+d+" failed: "+k);}v&&(O=!0);this.depMaps.push(u);j.completeLoad(d);f([d],n)}),e.load(a.name,f,n,m)}));j.enable(d,this);this.pluginMaps[d.id]=d},enable:function(){this.enabling=this.enabled=!0;x(this.depMaps,t(this,function(a,
b){var c,e;if("string"===typeof a){a=h(a,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap);this.depMaps[b]=a;if(c=i(N,a.id)){this.depExports[b]=c(this);return}this.depCount+=1;s(a,"defined",t(this,function(a){this.defineDep(b,a);this.check()}));this.errback&&s(a,"error",this.errback)}c=a.id;e=k[c];!r(N,c)&&(e&&!e.enabled)&&j.enable(a,this)}));E(this.pluginMaps,t(this,function(a){var b=i(k,a.id);b&&!b.enabled&&j.enable(a,this)}));this.enabling=!1;this.check()},on:function(a,b){var c=
this.events[a];c||(c=this.events[a]=[]);c.push(b)},emit:function(a,b){x(this.events[a],function(a){a(b)});"error"===a&&delete this.events[a]}};j={config:m,contextName:b,registry:k,defined:p,urlFetched:S,defQueue:F,Module:W,makeModuleMap:h,nextTick:l.nextTick,configure:function(a){a.baseUrl&&"/"!==a.baseUrl.charAt(a.baseUrl.length-1)&&(a.baseUrl+="/");var b=m.pkgs,c=m.shim,e={paths:!0,config:!0,map:!0};E(a,function(a,b){e[b]?"map"===b?Q(m[b],a,!0,!0):Q(m[b],a,!0):m[b]=a});a.shim&&(E(a.shim,function(a,
b){I(a)&&(a={deps:a});if((a.exports||a.init)&&!a.exportsFn)a.exportsFn=j.makeShimExports(a);c[b]=a}),m.shim=c);a.packages&&(x(a.packages,function(a){a="string"===typeof a?{name:a}:a;b[a.name]={name:a.name,location:a.location||a.name,main:(a.main||"main").replace(ga,"").replace(aa,"")}}),m.pkgs=b);E(k,function(a,b){!a.inited&&!a.map.unnormalized&&(a.map=h(b))});if(a.deps||a.callback)j.require(a.deps||[],a.callback)},makeShimExports:function(a){return function(){var b;a.init&&(b=a.init.apply(Y,arguments));
return b||a.exports&&Z(a.exports)}},makeRequire:function(a,d){function f(e,c,u){var i,m;d.enableBuildCallback&&(c&&H(c))&&(c.__requireJsBuild=!0);if("string"===typeof e){if(H(c))return C(J("requireargs","Invalid require call"),u);if(a&&r(N,e))return N[e](k[a.id]);if(l.get)return l.get(j,e,a);i=h(e,a,!1,!0);i=i.id;return!r(p,i)?C(J("notloaded",'Module name "'+i+'" has not been loaded yet for context: '+b+(a?"":". Use require([])"))):p[i]}K();j.nextTick(function(){K();m=q(h(null,a));m.skipMap=d.skipMap;
m.init(e,c,u,{enabled:!0});B()});return f}d=d||{};Q(f,{isBrowser:z,toUrl:function(b){var d=b.lastIndexOf("."),g=null;-1!==d&&(g=b.substring(d,b.length),b=b.substring(0,d));return j.nameToUrl(c(b,a&&a.id,!0),g)},defined:function(b){return r(p,h(b,a,!1,!0).id)},specified:function(b){b=h(b,a,!1,!0).id;return r(p,b)||r(k,b)}});a||(f.undef=function(b){w();var c=h(b,a,!0),d=i(k,b);delete p[b];delete S[c.url];delete X[b];d&&(d.events.defined&&(X[b]=d.events),delete k[b])});return f},enable:function(a){i(k,
a.id)&&q(a).enable()},completeLoad:function(a){var b,c,d=i(m.shim,a)||{},h=d.exports;for(w();F.length;){c=F.shift();if(null===c[0]){c[0]=a;if(b)break;b=!0}else c[0]===a&&(b=!0);D(c)}c=i(k,a);if(!b&&!r(p,a)&&c&&!c.inited){if(m.enforceDefine&&(!h||!Z(h)))return y(a)?void 0:C(J("nodefine","No define call for "+a,null,[a]));D([a,d.deps||[],d.exportsFn])}B()},nameToUrl:function(a,b){var c,d,h,f,j,k;if(l.jsExtRegExp.test(a))f=a+(b||"");else{c=m.paths;d=m.pkgs;f=a.split("/");for(j=f.length;0<j;j-=1)if(k=
f.slice(0,j).join("/"),h=i(d,k),k=i(c,k)){I(k)&&(k=k[0]);f.splice(0,j,k);break}else if(h){c=a===h.name?h.location+"/"+h.main:h.location;f.splice(0,j,c);break}f=f.join("/");f+=b||(/\?/.test(f)?"":".js");f=("/"===f.charAt(0)||f.match(/^[\w\+\.\-]+:/)?"":m.baseUrl)+f}return m.urlArgs?f+((-1===f.indexOf("?")?"?":"&")+m.urlArgs):f},load:function(a,b){l.load(j,a,b)},execCb:function(a,b,c,d){return b.apply(d,c)},onScriptLoad:function(a){if("load"===a.type||ha.test((a.currentTarget||a.srcElement).readyState))P=
null,a=G(a),j.completeLoad(a.id)},onScriptError:function(a){var b=G(a);if(!y(b.id))return C(J("scripterror","Script error",a,[b.id]))}};j.require=j.makeRequire();return j}var l,w,A,D,s,G,P,K,ba,ca,ia=/(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,ja=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,aa=/\.js$/,ga=/^\.\//;w=Object.prototype;var L=w.toString,da=w.hasOwnProperty,fa=Array.prototype.splice,z=!!("undefined"!==typeof window&&navigator&&document),$=!z&&"undefined"!==typeof importScripts,ha=z&&
"PLAYSTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/,V="undefined"!==typeof opera&&"[object Opera]"===opera.toString(),B={},q={},R=[],O=!1;if("undefined"===typeof define){if("undefined"!==typeof requirejs){if(H(requirejs))return;q=requirejs;requirejs=void 0}"undefined"!==typeof require&&!H(require)&&(q=require,require=void 0);l=requirejs=function(b,c,d,y){var f,h="_";!I(b)&&"string"!==typeof b&&(f=b,I(c)?(b=c,c=d,d=y):b=[]);f&&f.context&&(h=f.context);(y=i(B,h))||(y=B[h]=l.s.newContext(h));
f&&y.configure(f);return y.require(b,c,d)};l.config=function(b){return l(b)};l.nextTick="undefined"!==typeof setTimeout?function(b){setTimeout(b,4)}:function(b){b()};require||(require=l);l.version="2.1.2";l.jsExtRegExp=/^\/|:|\?|\.js$/;l.isBrowser=z;w=l.s={contexts:B,newContext:ea};l({});x(["toUrl","undef","defined","specified"],function(b){l[b]=function(){var c=B._;return c.require[b].apply(c,arguments)}});if(z&&(A=w.head=document.getElementsByTagName("head")[0],D=document.getElementsByTagName("base")[0]))A=
w.head=D.parentNode;l.onError=function(b){throw b;};l.load=function(b,c,d){var i=b&&b.config||{},f;if(z)return f=i.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script"),f.type=i.scriptType||"text/javascript",f.charset="utf-8",f.async=!0,f.setAttribute("data-requirecontext",b.contextName),f.setAttribute("data-requiremodule",c),f.attachEvent&&!(f.attachEvent.toString&&0>f.attachEvent.toString().indexOf("[native code"))&&!V?(O=!0,f.attachEvent("onreadystatechange",
b.onScriptLoad)):(f.addEventListener("load",b.onScriptLoad,!1),f.addEventListener("error",b.onScriptError,!1)),f.src=d,K=f,D?A.insertBefore(f,D):A.appendChild(f),K=null,f;$&&(importScripts(d),b.completeLoad(c))};z&&M(document.getElementsByTagName("script"),function(b){A||(A=b.parentNode);if(s=b.getAttribute("data-main"))return q.baseUrl||(G=s.split("/"),ba=G.pop(),ca=G.length?G.join("/")+"/":"./",q.baseUrl=ca,s=ba),s=s.replace(aa,""),q.deps=q.deps?q.deps.concat(s):[s],!0});define=function(b,c,d){var i,
f;"string"!==typeof b&&(d=c,c=b,b=null);I(c)||(d=c,c=[]);!c.length&&H(d)&&d.length&&(d.toString().replace(ia,"").replace(ja,function(b,d){c.push(d)}),c=(1===d.length?["require"]:["require","exports","module"]).concat(c));if(O){if(!(i=K))P&&"interactive"===P.readyState||M(document.getElementsByTagName("script"),function(b){if("interactive"===b.readyState)return P=b}),i=P;i&&(b||(b=i.getAttribute("data-requiremodule")),f=B[i.getAttribute("data-requirecontext")])}(f?f.defQueue:R).push([b,c,d])};define.amd=
{jQuery:!0};l.exec=function(b){return eval(b)};l(q)}})(this);
... (1 lines truncated)
</file>

<file path="application/extensions/yii-jsoneditor/jsoneditor-2.3.6/examples/requirejs_demo/requirejs_demo.html">
<!DOCTYPE HTML>
<html>
<head>
  <style type="text/css">
    #jsoneditor {
      width: 500px;
      height: 500px;
    }
  </style>
  <script data-main="scripts/main" src="scripts/require.js"></script>
</head>
<body>
<p>
  <button id="setJSON">Set JSON</button>
  <button id="getJSON">Get JSON</button>
</p>
<div id="jsoneditor"></div>
</body>
</html>
</file>

<file path="application/extensions/yii-jsoneditor/jsoneditor-2.3.6/examples/01_basic_usage.html">
<!DOCTYPE HTML>
<html>
<head>
  <link rel="stylesheet" type="text/css" href="../jsoneditor.css">
  <script type="text/javascript" src="../jsoneditor.js"></script>
  <style type="text/css">
    #jsoneditor {
      width: 500px;
      height: 500px;
    }
  </style>
</head>
<body>
<p>
  <button id="setJSON">Set JSON</button>
  <button id="getJSON">Get JSON</button>
</p>
<div id="jsoneditor"></div>
<script type="text/javascript" >
  // create the editor
  var container = document.getElementById('jsoneditor');
  var editor = new jsoneditor.JSONEditor(container);
  // set json
  document.getElementById('setJSON').onclick = function () {
    var json = {
      'array': [1, 2, 3],
      'boolean': true,
      'null': null,
      'number': 123,
      'object': {'a': 'b', 'c': 'd'},
... (13 lines truncated)
</file>

<file path="application/extensions/yii-jsoneditor/jsoneditor-2.3.6/examples/02_viewer.html">
<!DOCTYPE HTML>
<html>
<head>
  <link rel="stylesheet" type="text/css" href="../jsoneditor.css">
  <script type="text/javascript" src="../jsoneditor.js"></script>
  <style type="text/css">
    body {
      font: 11pt arial;
    }
    #jsoneditor {
      width: 500px;
    }
  </style>
</head>
<body>
<p>
  This editor is read-only (mode='viewer').
</p>
<div id="jsoneditor"></div>
<script type="text/javascript" >
  var container = document.getElementById('jsoneditor');
  var options = {
    mode: 'view'
  };
  var json = {
    'array': [1, 2, 3],
    'boolean': true,
    'null': null,
    'number': 123,
    'object': {'a': 'b', 'c': 'd'},
... (7 lines truncated)
</file>

<file path="application/extensions/yii-jsoneditor/jsoneditor-2.3.6/examples/03_switch_mode.html">
<!DOCTYPE HTML>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
  <link rel="stylesheet" type="text/css" href="../jsoneditor.css">
  <script type="text/javascript" src="../jsoneditor.js"></script>
  <script type="text/javascript" src="../lib/ace/ace.js"></script>
  <script type="text/javascript" src="../lib/ace/mode-json.js"></script>
  <script type="text/javascript" src="../lib/ace/theme-textmate.js"></script>
  <script type="text/javascript" src="../lib/ace/theme-jsoneditor.js"></script>
  <script type="text/javascript" src="../lib/jsonlint/jsonlint.js"></script>
  <style type="text/css">
    body {
      font: 10.5pt arial;
      color: #4d4d4d;
      line-height: 150%;
      width: 500px;
    }
    code {
      background-color: #f5f5f5;
    }
    #jsoneditor {
      width: 500px;
      height: 500px;
    }
  </style>
</head>
<body>
<p>
  Switch editor mode using the mode box.
... (26 lines truncated)
</file>

<file path="application/extensions/yii-jsoneditor/jsoneditor-2.3.6/HISTORY.md">
# JSON Editor Online - History

http://jsoneditoronline.org


## 2014-01-03, version 2.3.6

- Fixed positioning issue of the action menu.


## 2013-12-09, version 2.3.5

- Fixed a positioning issue of the action menu again.
- Fixed an issue with non-breaking space characters.


## 2013-11-19, version 2.3.4

- Dropped support for IE8, cleaned up legacy code for old browsers.
- Disabled saving files using HTML5 on Firefox to prevent a Firefox bug
  blocking cut/paste functionality in editable divs after using a.download.


## 2013-10-17, version 2.3.3

- Added support for search (Ctrl+F) in the code editor Ace.
- Fixed a positioning issue of the action menu when in bootstrap modal.
  (thanks tsash).


... (267 lines truncated)
</file>

<file path="application/extensions/yii-jsoneditor/jsoneditor-2.3.6/jsoneditor-min.js">
!function(){function e(t,i,o){if(!(this instanceof e))throw new Error('JSONEditor constructor called without "new".');var n=util.getInternetExplorerVersion();if(-1!=n&&9>n)throw new Error("Unsupported browser, IE9 or newer required. Please install the newest version of your browser.");arguments.length&&this._create(t,i,o)}function t(e,i,o){if(!(this instanceof t))throw new Error('TreeEditor constructor called without "new".');this._create(e,i,o)}function i(e,t,o){if(!(this instanceof i))throw new Error('TextEditor constructor called without "new".');this._create(e,t,o)}function o(e,t){this.editor=e,this.dom={},this.expanded=!1,t&&t instanceof Object?(this.setField(t.field,t.fieldEditable),this.setValue(t.value,t.type)):(this.setField(""),this.setValue(null))}function n(e){this.editor=e,this.dom={}}function s(e,t){function i(e,t,n){n.forEach(function(n){if("separator"==n.type){var s=document.createElement("div");s.className="separator",a=document.createElement("li"),a.appendChild(s),e.appendChild(a)}else{var r={},a=document.createElement("li");e.appendChild(a);var l=document.createElement("button");if(l.className=n.className,r.button=l,n.title&&(l.title=n.title),n.click&&(l.onclick=function(){o.hide(),n.click()}),a.appendChild(l),n.submenu){var d=document.createElement("div");d.className="icon",l.appendChild(d),l.appendChild(document.createTextNode(n.text));var h;if(n.click){l.className+=" default";var c=document.createElement("button");r.buttonExpand=c,c.className="expand",c.innerHTML='<div class="expand"></div>',a.appendChild(c),n.submenuTitle&&(c.title=n.submenuTitle),h=c}else{var u=document.createElement("div");u.className="expand",l.appendChild(u),h=l}h.onclick=function(){o._onExpandItem(r),h.focus()};var p=[];r.subItems=p;var m=document.createElement("ul");r.ul=m,m.className="menu",m.style.height="0",a.appendChild(m),i(m,p,n.submenu)}else l.innerHTML='<div class="icon"></div>'+n.text;t.push(r)}})}this.dom={};var o=this,n=this.dom;this.anchor=void 0,this.items=e,this.eventListeners={},this.selection=void 0,this.visibleSubmenu=void 0,this.onClose=t?t.close:void 0;var s=document.createElement("div");s.className="jsoneditor-contextmenu",n.menu=s;var r=document.createElement("ul");r.className="menu",s.appendChild(r),n.list=r,n.items=[];var a=document.createElement("button");n.focusButton=a;var l=document.createElement("li");l.style.overflow="hidden",l.style.height="0",l.appendChild(a),r.appendChild(l),i(r,this.dom.items,e),this.maxHeight=0,e.forEach(function(t){var i=24*(e.length+(t.submenu?t.submenu.length:0));o.maxHeight=Math.max(o.maxHeight,i)})}function r(e){this.editor=e,this.clear(),this.actions={editField:{undo:function(e){e.node.updateField(e.oldValue)},redo:function(e){e.node.updateField(e.newValue)}},editValue:{undo:function(e){e.node.updateValue(e.oldValue)},redo:function(e){e.node.updateValue(e.newValue)}},appendNode:{undo:function(e){e.parent.removeChild(e.node)},redo:function(e){e.parent.appendChild(e.node)}},insertBeforeNode:{undo:function(e){e.parent.removeChild(e.node)},redo:function(e){e.parent.insertBefore(e.node,e.beforeNode)}},insertAfterNode:{undo:function(e){e.parent.removeChild(e.node)},redo:function(e){e.parent.insertAfter(e.node,e.afterNode)}},removeNode:{undo:function(e){var t=e.parent,i=t.childs[e.index]||t.append;t.insertBefore(e.node,i)},redo:function(e){e.parent.removeChild(e.node)}},duplicateNode:{undo:function(e){e.parent.removeChild(e.clone)},redo:function(e){e.parent.insertAfter(e.clone,e.node)}},changeType:{undo:function(e){e.node.changeType(e.oldType)},redo:function(e){e.node.changeType(e.newType)}},moveNode:{undo:function(e){e.startParent.moveTo(e.node,e.startIndex)},redo:function(e){e.endParent.moveTo(e.node,e.endIndex)}},sort:{undo:function(e){var t=e.node;t.hideChilds(),t.sort=e.oldSort,t.childs=e.oldChilds,t.showChilds()},redo:function(e){var t=e.node;t.hideChilds(),t.sort=e.newSort,t.childs=e.newChilds,t.showChilds()}}}}function a(e,t,i){function o(t){e.setMode(t);var i=e.dom&&e.dom.modeBox;i&&i.focus()}for(var n={code:{text:"Code",title:"Switch to code highlighter",click:function(){o("code")}},form:{text:"Form",title:"Switch to form editor",click:function(){o("form")}},text:{text:"Text",title:"Switch to plain text editor",click:function(){o("text")}},tree:{text:"Tree",title:"Switch to tree editor",click:function(){o("tree")}},view:{text:"View",title:"Switch to tree view",click:function(){o("view")}}},r=[],a=0;a<t.length;a++){var l=t[a],d=n[l];if(!d)throw new Error('Unknown mode "'+l+'"');d.className="type-modes"+(i==l?" selected":""),r.push(d)}var h=n[i];if(!h)throw new Error('Unknown mode "'+i+'"');var c=h.text,u=document.createElement("button");return u.className="modes separator",u.innerHTML=c+" &#x25BE;",u.title="Switch editor mode",u.onclick=function(){var e=new s(r);e.show(u)},u}function l(e,t){var i=this;this.editor=e,this.timeout=void 0,this.delay=200,this.lastText=void 0,this.dom={},this.dom.container=t;var o=document.createElement("table");this.dom.table=o,o.className="search",t.appendChild(o);var n=document.createElement("tbody");this.dom.tbody=n,o.appendChild(n);var s=document.createElement("tr");n.appendChild(s);var r=document.createElement("td");s.appendChild(r);var a=document.createElement("div");this.dom.results=a,a.className="results",r.appendChild(a),r=document.createElement("td"),s.appendChild(r);var l=document.createElement("div");this.dom.input=l,l.className="frame",l.title="Search fields and values",r.appendChild(l);var d=document.createElement("table");l.appendChild(d);var h=document.createElement("tbody");d.appendChild(h),s=document.createElement("tr"),h.appendChild(s);var c=document.createElement("button");c.className="refresh",r=document.createElement("td"),r.appendChild(c),s.appendChild(r);var u=document.createElement("input");this.dom.search=u,u.oninput=function(e){i._onDelayedSearch(e)},u.onchange=function(e){i._onSearch(e)},u.onkeydown=function(e){i._onKeyDown(e)},u.onkeyup=function(e){i._onKeyUp(e)},c.onclick=function(){u.select()},r=document.createElement("td"),r.appendChild(u),s.appendChild(r);var p=document.createElement("button");p.title="Next result (Enter)",p.className="next",p.onclick=function(){i.next()},r=document.createElement("td"),r.appendChild(p),s.appendChild(r);var m=document.createElement("button");m.title="Previous result (Shift+Enter)",m.className="previous",m.onclick=function(){i.previous()},r=document.createElement("td"),r.appendChild(m),s.appendChild(r)}function d(){this.locked=!1}e.modes={},e.prototype._create=function(e,t,i){this.container=e,this.options=t||{},this.json=i||{};var o=this.options.mode||"tree";this.setMode(o)},e.prototype._delete=function(){},e.prototype.set=function(e){this.json=e},e.prototype.get=function(){return this.json},e.prototype.setText=function(e){this.json=util.parse(e)},e.prototype.getText=function(){return JSON.stringify(this.json)},e.prototype.setName=function(e){this.options||(this.options={}),this.options.name=e},e.prototype.getName=function(){return this.options&&this.options.name},e.prototype.setMode=function(t){var i,o,n=this.container,s=util.extend({},this.options);s.mode=t;var r=e.modes[t];if(!r)throw new Error('Unknown mode "'+s.mode+'"');try{if("text"==r.data?(o=this.getName(),i=this.getText(),this._delete(),util.clear(this),util.extend(this,r.editor.prototype),this._create(n,s),this.setName(o),this.setText(i)):(o=this.getName(),i=this.get(),this._delete(),util.clear(this),util.extend(this,r.editor.prototype),this._create(n,s),this.setName(o),this.set(i)),"function"==typeof r.load)try{r.load.call(this)}catch(a){}}catch(a){this._onError(a)}},e.prototype._onError=function(e){if("function"==typeof this.onError&&(util.log("WARNING: JSONEditor.onError is deprecated. Use options.error instead."),this.onError(e)),!this.options||"function"!=typeof this.options.error)throw e;this.options.error(e)},t.prototype._create=function(e,t,i){if(!e)throw new Error("No container element provided.");this.container=e,this.dom={},this.highlighter=new d,this.selection=void 0,this._setOptions(t),this.options.history&&!this.mode.view&&(this.history=new r(this)),this._createFrame(),this._createTable(),this.set(i||{})},t.prototype._delete=function(){this.frame&&this.container&&this.frame.parentNode==this.container&&this.container.removeChild(this.frame)},t.prototype._setOptions=function(e){if(this.options={search:!0,history:!0,mode:"tree",name:void 0},e){for(var t in e)e.hasOwnProperty(t)&&(this.options[t]=e[t]);e.enableSearch&&(this.options.search=e.enableSearch,util.log('WARNING: Option "enableSearch" is deprecated. Use "search" instead.')),e.enableHistory&&(this.options.history=e.enableHistory,util.log('WARNING: Option "enableHistory" is deprecated. Use "history" instead.')),"editor"==e.mode&&(this.options.mode="tree",util.log('WARNING: Mode "editor" is deprecated. Use "tree" instead.')),"viewer"==e.mode&&(this.options.mode="view",util.log('WARNING: Mode "viewer" is deprecated. Use "view" instead.'))}this.mode={edit:"view"!=this.options.mode&&"form"!=this.options.mode,view:"view"==this.options.mode,form:"form"==this.options.mode}},t.focusNode=void 0,t.prototype.set=function(e,t){if(t&&(util.log('Warning: second parameter "name" is deprecated. Use setName(name) instead.'),this.options.name=t),e instanceof Function||void 0===e)this.clear();else{this.content.removeChild(this.table);var i={field:this.options.name,value:e},n=new o(this,i);this._setRoot(n);var s=!1;this.node.expand(s),this.content.appendChild(this.table)}this.history&&this.history.clear()},t.prototype.get=function(){return t.focusNode&&t.focusNode.blur(),this.node?this.node.getValue():void 0},t.prototype.getText=function(){return JSON.stringify(this.get())},t.prototype.setText=function(e){this.set(util.parse(e))},t.prototype.setName=function(e){this.options.name=e,this.node&&this.node.updateField(this.options.name)},t.prototype.getName=function(){return this.options.name},t.prototype.clear=function(){this.node&&(this.node.collapse(),this.tbody.removeChild(this.node.getDom()),delete this.node)},t.prototype._setRoot=function(e){this.clear(),this.node=e,this.tbody.appendChild(e.getDom())},t.prototype.search=function(e){var t;return this.node?(this.content.removeChild(this.table),t=this.node.search(e),this.content.appendChild(this.table)):t=[],t},t.prototype.expandAll=function(){this.node&&(this.content.removeChild(this.table),this.node.expand(),this.content.appendChild(this.table))},t.prototype.collapseAll=function(){this.node&&(this.content.removeChild(this.table),this.node.collapse(),this.content.appendChild(this.table))},t.prototype._onAction=function(e,t){if(this.history&&this.history.add(e,t),this.options.change)try{this.options.change()}catch(i){util.log("Error in change callback: ",i)}},t.prototype.startAutoScroll=function(e){var t=this,i=this.content,o=util.getAbsoluteTop(i),n=i.clientHeight,s=o+n,r=24,a=50;this.autoScrollStep=o+r>e&&i.scrollTop>0?(o+r-e)/3:e>s-r&&n+i.scrollTop<i.scrollHeight?(s-r-e)/3:void 0,this.autoScrollStep?this.autoScrollTimer||(this.autoScrollTimer=setInterval(function(){t.autoScrollStep?i.scrollTop-=t.autoScrollStep:t.stopAutoScroll()},a)):this.stopAutoScroll()},t.prototype.stopAutoScroll=function(){this.autoScrollTimer&&(clearTimeout(this.autoScrollTimer),delete this.autoScrollTimer),this.autoScrollStep&&delete this.autoScrollStep},t.prototype.setSelection=function(e){e&&("scrollTop"in e&&this.content&&(this.content.scrollTop=e.scrollTop),e.range&&util.setSelectionOffset(e.range),e.dom&&e.dom.focus())},t.prototype.getSelection=function(){return{dom:t.domFocus,scrollTop:this.content?this.content.scrollTop:0,range:util.getSelectionOffset()}},t.prototype.scrollTo=function(e,t){var i=this.content;if(i){var o=this;o.animateTimeout&&(clearTimeout(o.animateTimeout),delete o.animateTimeout),o.animateCallback&&(o.animateCallback(!1),delete o.animateCallback);var n=i.clientHeight,s=i.scrollHeight-n,r=Math.min(Math.max(e-n/4,0),s),a=function(){var e=i.scrollTop,n=r-e;Math.abs(n)>3?(i.scrollTop+=n/3,o.animateCallback=t,o.animateTimeout=setTimeout(a,50)):(t&&t(!0),i.scrollTop=r,delete o.animateTimeout,delete o.animateCallback)};a()}else t&&t(!1)},t.prototype._createFrame=function(){this.frame=document.createElement("div"),this.frame.className="jsoneditor",this.container.appendChild(this.frame);var e=this,t=function(t){e._onEvent(t)};this.frame.onclick=function(e){var i=e.target;t(e),"BUTTON"==i.nodeName&&e.preventDefault()},this.frame.oninput=t,this.frame.onchange=t,this.frame.onkeydown=t,this.frame.onkeyup=t,this.frame.oncut=t,this.frame.onpaste=t,this.frame.onmousedown=t,this.frame.onmouseup=t,this.frame.onmouseover=t,this.frame.onmouseout=t,util.addEventListener(this.frame,"focus",t,!0),util.addEventListener(this.frame,"blur",t,!0),this.frame.onfocusin=t,this.frame.onfocusout=t,this.menu=document.createElement("div"),this.menu.className="menu",this.frame.appendChild(this.menu);var i=document.createElement("button");i.className="expand-all",i.title="Expand all fields",i.onclick=function(){e.expandAll()},this.menu.appendChild(i);var o=document.createElement("button");if(o.title="Collapse all fields",o.className="collapse-all",o.onclick=function(){e.collapseAll()},this.menu.appendChild(o),this.history){var n=document.createElement("button");n.className="undo separator",n.title="Undo last action (Ctrl+Z)",n.onclick=function(){e._onUndo()},this.menu.appendChild(n),this.dom.undo=n;var s=document.createElement("button");s.className="redo",s.title="Redo (Ctrl+Shift+Z)",s.onclick=function(){e._onRedo()},this.menu.appendChild(s),this.dom.redo=s,this.history.onChange=function(){n.disabled=!e.history.canUndo(),s.disabled=!e.history.canRedo()},this.history.onChange()}if(this.options&&this.options.modes&&this.options.modes.length){var r=a(this,this.options.modes,this.options.mode);this.menu.appendChild(r),this.dom.modeBox=r}this.options.search&&(this.searchBox=new l(this,this.menu))},t.prototype._onUndo=function(){this.history&&(this.history.undo(),this.options.change&&this.options.change())},t.prototype._onRedo=function(){this.history&&(this.history.redo(),this.options.change&&this.options.change())},t.prototype._onEvent=function(e){var i=e.target;"keydown"==e.type&&this._onKeyDown(e),"focus"==e.type&&(t.domFocus=i);var n=o.getNodeFromTarget(i);n&&n.onEvent(e)},t.prototype._onKeyDown=function(e){var i=e.which||e.keyCode,o=e.ctrlKey,n=e.shiftKey,s=!1;if(9==i&&setTimeout(function(){util.selectContentEditable(t.domFocus)},0),this.searchBox)if(o&&70==i)this.searchBox.dom.search.focus(),this.searchBox.dom.search.select(),s=!0;else if(114==i||o&&71==i){var r=!0;n?this.searchBox.previous(r):this.searchBox.next(r),s=!0}this.history&&(o&&!n&&90==i?(this._onUndo(),s=!0):o&&n&&90==i&&(this._onRedo(),s=!0)),s&&(e.preventDefault(),e.stopPropagation())},t.prototype._createTable=function(){var e=document.createElement("div");e.className="outer",this.contentOuter=e,this.content=document.createElement("div"),this.content.className="tree",e.appendChild(this.content),this.table=document.createElement("table"),this.table.className="tree",this.content.appendChild(this.table);var t;this.colgroupContent=document.createElement("colgroup"),this.mode.edit&&(t=document.createElement("col"),t.width="24px",this.colgroupContent.appendChild(t)),t=document.createElement("col"),t.width="24px",this.colgroupContent.appendChild(t),t=document.createElement("col"),this.colgroupContent.appendChild(t),this.table.appendChild(this.colgroupContent),this.tbody=document.createElement("tbody"),this.table.appendChild(this.tbody),this.frame.appendChild(e)},e.modes.tree={editor:t,data:"json"},e.modes.view={editor:t,data:"json"},e.modes.form={editor:t,data:"json"},e.modes.editor={editor:t,data:"json"},e.modes.viewer={editor:t,data:"json"},i.prototype._create=function(e,t,i){t=t||{},this.options=t,this.indentation=t.indentation?Number(t.indentation):2,this.mode="code"==t.mode?"code":"text","code"==this.mode&&"undefined"==typeof ace&&(this.mode="text",util.log("WARNING: Cannot load code editor, Ace library not loaded. Falling back to plain text editor"));var o=this;this.container=e,this.dom={},this.editor=void 0,this.textarea=void 0,this.width=e.clientWidth,this.height=e.clientHeight,this.frame=document.createElement("div"),this.frame.className="jsoneditor",this.frame.onclick=function(e){e.preventDefault()},this.menu=document.createElement("div"),this.menu.className="menu",this.frame.appendChild(this.menu);var n=document.createElement("button");n.className="format",n.title="Format JSON data, with proper indentation and line feeds",this.menu.appendChild(n),n.onclick=function(){try{o.format()}catch(e){o._onError(e)}};var s=document.createElement("button");if(s.className="compact",s.title="Compact JSON data, remove all whitespaces",this.menu.appendChild(s),s.onclick=function(){try{o.compact()}catch(e){o._onError(e)}},this.options&&this.options.modes&&this.options.modes.length){var r=a(this,this.options.modes,this.options.mode);this.menu.appendChild(r),this.dom.modeBox=r}if(this.content=document.createElement("div"),this.content.className="outer",this.frame.appendChild(this.content),this.container.appendChild(this.frame),"code"==this.mode){this.editorDom=document.createElement("div"),this.editorDom.style.height="100%",this.editorDom.style.width="100%",this.content.appendChild(this.editorDom);var l=ace.edit(this.editorDom);l.setTheme("ace/theme/jsoneditor"),l.setShowPrintMargin(!1),l.setFontSize(13),l.getSession().setMode("ace/mode/json"),l.getSession().setUseSoftTabs(!0),l.getSession().setUseWrapMode(!0),this.editor=l;var d=document.createElement("a");d.appendChild(document.createTextNode("powered by ace")),d.href="http://ace.ajax.org",d.target="_blank",d.className="poweredBy",d.onclick=function(){window.open(d.href,d.target)},this.menu.appendChild(d),t.change&&l.on("change",function(){t.change()})}else{var h=document.createElement("textarea");h.className="text",h.spellcheck=!1,this.content.appendChild(h),this.textarea=h,t.change&&(null===this.textarea.oninput?this.textarea.oninput=function(){t.change()}:this.textarea.onchange=function(){t.change()})}"string"==typeof i?this.setText(i):this.set(i)},i.prototype._delete=function(){this.frame&&this.container&&this.frame.parentNode==this.container&&this.container.removeChild(this.frame)},i.prototype._onError=function(e){if("function"==typeof this.onError&&(util.log("WARNING: JSONEditor.onError is deprecated. Use options.error instead."),this.onError(e)),!this.options||"function"!=typeof this.options.error)throw e;this.options.error(e)},i.prototype.compact=function(){var e=util.parse(this.getText());this.setText(JSON.stringify(e))},i.prototype.format=function(){var e=util.parse(this.getText());this.setText(JSON.stringify(e,null,this.indentation))},i.prototype.focus=function(){this.textarea&&this.textarea.focus(),this.editor&&this.editor.focus()},i.prototype.resize=function(){if(this.editor){var e=!1;this.editor.resize(e)}},i.prototype.set=function(e){this.setText(JSON.stringify(e,null,this.indentation))},i.prototype.get=function(){return util.parse(this.getText())},i.prototype.getText=function(){return this.textarea?this.textarea.value:this.editor?this.editor.getValue():""},i.prototype.setText=function(e){this.textarea&&(this.textarea.value=e),this.editor&&this.editor.setValue(e,-1)},e.modes.text={editor:i,data:"text",load:i.prototype.format},e.modes.code={editor:i,data:"text",load:i.prototype.format},o.prototype.setParent=function(e){this.parent=e},o.prototype.setField=function(e,t){this.field=e,this.fieldEditable=1==t},o.prototype.getField=function(){return void 0===this.field&&this._getDomField(),this.field},o.prototype.setValue=function(e,t){var i,n,s=this.childs;if(s)for(;s.length;)this.removeChild(s[0]);if(this.type=this._getType(e),t&&t!=this.type){if("string"!=t||"auto"!=this.type)throw new Error('Type mismatch: cannot cast value of type "'+this.type+' to the specified type "'+t+'"');this.type=t}if("array"==this.type){this.childs=[];for(var r=0,a=e.length;a>r;r++)i=e[r],void 0===i||i instanceof Function||(n=new o(this.editor,{value:i}),this.appendChild(n));this.value=""}else if("object"==this.type){this.childs=[];for(var l in e)e.hasOwnProperty(l)&&(i=e[l],void 0===i||i instanceof Function||(n=new o(this.editor,{field:l,value:i}),this.appendChild(n)));this.value=""}else this.childs=void 0,this.value=e},o.prototype.getValue=function(){if("array"==this.type){var e=[];return this.childs.forEach(function(t){e.push(t.getValue())}),e}if("object"==this.type){var t={};return this.childs.forEach(function(e){t[e.getField()]=e.getValue()}),t}return void 0===this.value&&this._getDomValue(),this.value},o.prototype.getLevel=function(){return this.parent?this.parent.getLevel()+1:0},o.prototype.clone=function(){var e=new o(this.editor);if(e.type=this.type,e.field=this.field,e.fieldInnerText=this.fieldInnerText,e.fieldEditable=this.fieldEditable,e.value=this.value,e.valueInnerText=this.valueInnerText,e.expanded=this.expanded,this.childs){var t=[];this.childs.forEach(function(i){var o=i.clone();o.setParent(e),t.push(o)}),e.childs=t}else e.childs=void 0;return e},o.prototype.expand=function(e){this.childs&&(this.expanded=!0,this.dom.expand&&(this.dom.expand.className="expanded"),this.showChilds(),0!=e&&this.childs.forEach(function(t){t.expand(e)}))},o.prototype.collapse=function(e){this.childs&&(this.hideChilds(),0!=e&&this.childs.forEach(function(t){t.collapse(e)}),this.dom.expand&&(this.dom.expand.className="collapsed"),this.expanded=!1)},o.prototype.showChilds=function(){var e=this.childs;if(e&&this.expanded){var t=this.dom.tr,i=t?t.parentNode:void 0;if(i){var o=this.getAppend(),n=t.nextSibling;n?i.insertBefore(o,n):i.appendChild(o),this.childs.forEach(function(e){i.insertBefore(e.getDom(),o),e.showChilds()})}}},o.prototype.hide=function(){var e=this.dom.tr,t=e?e.parentNode:void 0;t&&t.removeChild(e),this.hideChilds()},o.prototype.hideChilds=function(){var e=this.childs;if(e&&this.expanded){var t=this.getAppend();t.parentNode&&t.parentNode.removeChild(t),this.childs.forEach(function(e){e.hide()})}},o.prototype.appendChild=function(e){if(this._hasChilds()){if(e.setParent(this),e.fieldEditable="object"==this.type,"array"==this.type&&(e.index=this.childs.length),this.childs.push(e),this.expanded){var t=e.getDom(),i=this.getAppend(),o=i?i.parentNode:void 0;i&&o&&o.insertBefore(t,i),e.showChilds()}this.updateDom({updateIndexes:!0}),e.updateDom({recurse:!0})}},o.prototype.moveBefore=function(e,t){if(this._hasChilds()){var i=this.dom.tr?this.dom.tr.parentNode:void 0;if(i){var o=document.createElement("tr");o.style.height=i.clientHeight+"px",i.appendChild(o)}e.parent&&e.parent.removeChild(e),t instanceof n?this.appendChild(e):this.insertBefore(e,t),i&&i.removeChild(o)}},o.prototype.moveTo=function(e,t){if(e.parent==this){var i=this.childs.indexOf(e);t>i&&t++}var o=this.childs[t]||this.append;this.moveBefore(e,o)},o.prototype.insertBefore=function(e,t){if(this._hasChilds()){if(t==this.append)e.setParent(this),e.fieldEditable="object"==this.type,this.childs.push(e);else{var i=this.childs.indexOf(t);if(-1==i)throw new Error("Node not found");e.setParent(this),e.fieldEditable="object"==this.type,this.childs.splice(i,0,e)}if(this.expanded){var o=e.getDom(),n=t.getDom(),s=n?n.parentNode:void 0;n&&s&&s.insertBefore(o,n),e.showChilds()}this.updateDom({updateIndexes:!0}),e.updateDom({recurse:!0})}},o.prototype.insertAfter=function(e,t){if(this._hasChilds()){var i=this.childs.indexOf(t),o=this.childs[i+1];o?this.insertBefore(e,o):this.appendChild(e)}},o.prototype.search=function(e){var t,i=[],o=e?e.toLowerCase():void 0;if(delete this.searchField,delete this.searchValue,void 0!=this.field){var n=String(this.field).toLowerCase();t=n.indexOf(o),-1!=t&&(this.searchField=!0,i.push({node:this,elem:"field"})),this._updateDomField()}if(this._hasChilds()){if(this.childs){var s=[];this.childs.forEach(function(t){s=s.concat(t.search(e))}),i=i.concat(s)}if(void 0!=o){var r=!1;0==s.length?this.collapse(r):this.expand(r)}}else{if(void 0!=this.value){var a=String(this.value).toLowerCase();t=a.indexOf(o),-1!=t&&(this.searchValue=!0,i.push({node:this,elem:"value"}))}this._updateDomValue()}return i},o.prototype.scrollTo=function(e){if(!this.dom.tr||!this.dom.tr.parentNode)for(var t=this.parent,i=!1;t;)t.expand(i),t=t.parent;this.dom.tr&&this.dom.tr.parentNode&&this.editor.scrollTo(this.dom.tr.offsetTop,e)},o.focusElement=void 0,o.prototype.focus=function(e){if(o.focusElement=e,this.dom.tr&&this.dom.tr.parentNode){var t=this.dom;switch(e){case"drag":t.drag?t.drag.focus():t.menu.focus();break;case"menu":t.menu.focus();break;case"expand":this._hasChilds()?t.expand.focus():t.field&&this.fieldEditable?(t.field.focus(),util.selectContentEditable(t.field)):t.value&&!this._hasChilds()?(t.value.focus(),util.selectContentEditable(t.value)):t.menu.focus();break;case"field":t.field&&this.fieldEditable?(t.field.focus(),util.selectContentEditable(t.field)):t.value&&!this._hasChilds()?(t.value.focus(),util.selectContentEditable(t.value)):this._hasChilds()?t.expand.focus():t.menu.focus();break;case"value":default:t.value&&!this._hasChilds()?(t.value.focus(),util.selectContentEditable(t.value)):t.field&&this.fieldEditable?(t.field.focus(),util.selectContentEditable(t.field)):this._hasChilds()?t.expand.focus():t.menu.focus()}}},o.select=function(e){setTimeout(function(){util.selectContentEditable(e)},0)},o.prototype.blur=function(){this._getDomValue(!1),this._getDomField(!1)},o.prototype._duplicate=function(e){var t=e.clone();return this.insertAfter(t,e),t},o.prototype.containsNode=function(e){if(this==e)return!0;var t=this.childs;if(t)for(var i=0,o=t.length;o>i;i++)if(t[i].containsNode(e))return!0;return!1},o.prototype._move=function(e,t){if(e!=t){if(e.containsNode(this))throw new Error("Cannot move a field into a child of itself");e.parent&&e.parent.removeChild(e);var i=e.clone();e.clearDom(),t?this.insertBefore(i,t):this.appendChild(i)}},o.prototype.removeChild=function(e){if(this.childs){var t=this.childs.indexOf(e);if(-1!=t){e.hide(),delete e.searchField,delete e.searchValue;var i=this.childs.splice(t,1)[0];return this.updateDom({updateIndexes:!0}),i}}return void 0},o.prototype._remove=function(e){this.removeChild(e)},o.prototype.changeType=function(e){var t=this.type;if(t!=e){if("string"!=e&&"auto"!=e||"string"!=t&&"auto"!=t){var i,o=this.dom.tr?this.dom.tr.parentNode:void 0;i=this.expanded?this.getAppend():this.getDom();var n=i&&i.parentNode?i.nextSibling:void 0;this.hide(),this.clearDom(),this.type=e,"object"==e?(this.childs||(this.childs=[]),this.childs.forEach(function(e){e.clearDom(),delete e.index,e.fieldEditable=!0,void 0==e.field&&(e.field="")}),("string"==t||"auto"==t)&&(this.expanded=!0)):"array"==e?(this.childs||(this.childs=[]),this.childs.forEach(function(e,t){e.clearDom(),e.fieldEditable=!1,e.index=t}),("string"==t||"auto"==t)&&(this.expanded=!0)):this.expanded=!1,o&&(n?o.insertBefore(this.getDom(),n):o.appendChild(this.getDom())),this.showChilds()}else this.type=e;("auto"==e||"string"==e)&&(this.value="string"==e?String(this.value):this._stringCast(String(this.value)),this.focus()),this.updateDom({updateIndexes:!0})}},o.prototype._getDomValue=function(e){if(this.dom.value&&"array"!=this.type&&"object"!=this.type&&(this.valueInnerText=util.getInnerText(this.dom.value)),void 0!=this.valueInnerText)try{var t;if("string"==this.type)t=this._unescapeHTML(this.valueInnerText);else{var i=this._unescapeHTML(this.valueInnerText);t=this._stringCast(i)}if(t!==this.value){var o=this.value;this.value=t,this.editor._onAction("editValue",{node:this,oldValue:o,newValue:t,oldSelection:this.editor.selection,newSelection:this.editor.getSelection()})}}catch(n){if(this.value=void 0,1!=e)throw n}},o.prototype._updateDomValue=function(){var e=this.dom.value;if(e){var t=this.value,i="auto"==this.type?util.type(t):this.type,o="string"==i&&util.isUrl(t),n="";n=o&&!this.editor.mode.edit?"":"string"==i?"green":"number"==i?"red":"boolean"==i?"darkorange":this._hasChilds()?"":null===t?"#004ED0":"black",e.style.color=n;var s=""==String(this.value)&&"array"!=this.type&&"object"!=this.type;if(s?util.addClassName(e,"empty"):util.removeClassName(e,"empty"),o?util.addClassName(e,"url"):util.removeClassName(e,"url"),"array"==i||"object"==i){var r=this.childs?this.childs.length:0;e.title=this.type+" containing "+r+" items"}else"string"==i&&util.isUrl(t)?this.editor.mode.edit&&(e.title="Ctrl+Click or Ctrl+Enter to open url in new window"):e.title="";this.searchValueActive?util.addClassName(e,"highlight-active"):util.removeClassName(e,"highlight-active"),this.searchValue?util.addClassName(e,"highlight"):util.removeClassName(e,"highlight"),util.stripFormatting(e)}},o.prototype._updateDomField=function(){var e=this.dom.field;if(e){var t=""==String(this.field)&&"array"!=this.parent.type;t?util.addClassName(e,"empty"):util.removeClassName(e,"empty"),this.searchFieldActive?util.addClassName(e,"highlight-active"):util.removeClassName(e,"highlight-active"),this.searchField?util.addClassName(e,"highlight"):util.removeClassName(e,"highlight"),util.stripFormatting(e)}},o.prototype._getDomField=function(e){if(this.dom.field&&this.fieldEditable&&(this.fieldInnerText=util.getInnerText(this.dom.field)),void 0!=this.fieldInnerText)try{var t=this._unescapeHTML(this.fieldInnerText);if(t!==this.field){var i=this.field;this.field=t,this.editor._onAction("editField",{node:this,oldValue:i,newValue:t,oldSelection:this.editor.selection,newSelection:this.editor.getSelection()})}}catch(o){if(this.field=void 0,1!=e)throw o}},o.prototype.clearDom=function(){this.dom={}},o.prototype.getDom=function(){var e=this.dom;if(e.tr)return e.tr;if(e.tr=document.createElement("tr"),e.tr.node=this,this.editor.mode.edit){var t=document.createElement("td");if(this.parent){var i=document.createElement("button");e.drag=i,i.className="dragarea",i.title="Drag to move this field (Alt+Shift+Arrows)",t.appendChild(i)}e.tr.appendChild(t);var o=document.createElement("td"),n=document.createElement("button");e.menu=n,n.className="contextmenu",n.title="Click to open the actions menu (Ctrl+M)",o.appendChild(e.menu),e.tr.appendChild(o)}var s=document.createElement("td");return e.tr.appendChild(s),e.tree=this._createDomTree(),s.appendChild(e.tree),this.updateDom({updateIndexes:!0}),e.tr},o.prototype._onDragStart=function(e){var t=this;this.mousemove||(this.mousemove=util.addEventListener(document,"mousemove",function(e){t._onDrag(e)})),this.mouseup||(this.mouseup=util.addEventListener(document,"mouseup",function(e){t._onDragEnd(e)})),this.editor.highlighter.lock(),this.drag={oldCursor:document.body.style.cursor,startParent:this.parent,startIndex:this.parent.childs.indexOf(this),mouseX:e.pageX,level:this.getLevel()},document.body.style.cursor="move",e.preventDefault()},o.prototype._onDrag=function(e){var t,i,s,r,a,l,d,h,c,u,p,m,f,v,g=e.pageY,y=e.pageX,x=!1;if(t=this.dom.tr,c=util.getAbsoluteTop(t),m=t.offsetHeight,c>g){i=t;do i=i.previousSibling,d=o.getNodeFromTarget(i),u=i?util.getAbsoluteTop(i):0;while(i&&u>g);d&&!d.parent&&(d=void 0),d||(l=t.parentNode.firstChild,i=l?l.nextSibling:void 0,d=o.getNodeFromTarget(i),d==this&&(d=void 0)),d&&(i=d.dom.tr,u=i?util.getAbsoluteTop(i):0,g>u+m&&(d=void 0)),d&&(d.parent.moveBefore(this,d),x=!0)}else if(a=this.expanded&&this.append?this.append.getDom():this.dom.tr,r=a?a.nextSibling:void 0){p=util.getAbsoluteTop(r),s=r;do h=o.getNodeFromTarget(s),s&&(f=s.nextSibling?util.getAbsoluteTop(s.nextSibling):0,v=s?f-p:0,1==h.parent.childs.length&&h.parent.childs[0]==this&&(c+=23)),s=s.nextSibling;while(s&&g>c+v);if(h&&h.parent){var C=y-this.drag.mouseX,b=Math.round(C/24/2),N=this.drag.level+b,E=h.getLevel();for(i=h.dom.tr.previousSibling;N>E&&i;){if(d=o.getNodeFromTarget(i),d==this||d._isChildOf(this));else{if(!(d instanceof n))break;var _=d.parent.childs;if(!(_.length>1||1==_.length&&_[0]!=this))break;h=o.getNodeFromTarget(i),E=h.getLevel()}i=i.previousSibling}a.nextSibling!=h.dom.tr&&(h.parent.moveBefore(this,h),x=!0)
}}x&&(this.drag.mouseX=y,this.drag.level=this.getLevel()),this.editor.startAutoScroll(g),e.preventDefault()},o.prototype._onDragEnd=function(e){var t={node:this,startParent:this.drag.startParent,startIndex:this.drag.startIndex,endParent:this.parent,endIndex:this.parent.childs.indexOf(this)};(t.startParent!=t.endParent||t.startIndex!=t.endIndex)&&this.editor._onAction("moveNode",t),document.body.style.cursor=this.drag.oldCursor,this.editor.highlighter.unlock(),delete this.drag,this.mousemove&&(util.removeEventListener(document,"mousemove",this.mousemove),delete this.mousemove),this.mouseup&&(util.removeEventListener(document,"mouseup",this.mouseup),delete this.mouseup),this.editor.stopAutoScroll(),e.preventDefault()},o.prototype._isChildOf=function(e){for(var t=this.parent;t;){if(t==e)return!0;t=t.parent}return!1},o.prototype._createDomField=function(){return document.createElement("div")},o.prototype.setHighlight=function(e){this.dom.tr&&(this.dom.tr.className=e?"highlight":"",this.append&&this.append.setHighlight(e),this.childs&&this.childs.forEach(function(t){t.setHighlight(e)}))},o.prototype.updateValue=function(e){this.value=e,this.updateDom()},o.prototype.updateField=function(e){this.field=e,this.updateDom()},o.prototype.updateDom=function(e){var t=this.dom.tree;t&&(t.style.marginLeft=24*this.getLevel()+"px");var i=this.dom.field;if(i){1==this.fieldEditable?(i.contentEditable=this.editor.mode.edit,i.spellcheck=!1,i.className="field"):i.className="readonly";var o;o=void 0!=this.index?this.index:void 0!=this.field?this.field:this._hasChilds()?this.type:"",i.innerHTML=this._escapeHTML(o)}var n=this.dom.value;if(n){var s=this.childs?this.childs.length:0;n.innerHTML="array"==this.type?"["+s+"]":"object"==this.type?"{"+s+"}":this._escapeHTML(this.value)}this._updateDomField(),this._updateDomValue(),e&&1==e.updateIndexes&&this._updateDomIndexes(),e&&1==e.recurse&&this.childs&&this.childs.forEach(function(t){t.updateDom(e)}),this.append&&this.append.updateDom()},o.prototype._updateDomIndexes=function(){var e=this.dom.value,t=this.childs;e&&t&&("array"==this.type?t.forEach(function(e,t){e.index=t;var i=e.dom.field;i&&(i.innerHTML=t)}):"object"==this.type&&t.forEach(function(e){void 0!=e.index&&(delete e.index,void 0==e.field&&(e.field=""))}))},o.prototype._createDomValue=function(){var e;return"array"==this.type?(e=document.createElement("div"),e.className="readonly",e.innerHTML="[...]"):"object"==this.type?(e=document.createElement("div"),e.className="readonly",e.innerHTML="{...}"):!this.editor.mode.edit&&util.isUrl(this.value)?(e=document.createElement("a"),e.className="value",e.href=this.value,e.target="_blank",e.innerHTML=this._escapeHTML(this.value)):(e=document.createElement("div"),e.contentEditable=!this.editor.mode.view,e.spellcheck=!1,e.className="value",e.innerHTML=this._escapeHTML(this.value)),e},o.prototype._createDomExpandButton=function(){var e=document.createElement("button");return this._hasChilds()?(e.className=this.expanded?"expanded":"collapsed",e.title="Click to expand/collapse this field (Ctrl+E). \nCtrl+Click to expand/collapse including all childs."):(e.className="invisible",e.title=""),e},o.prototype._createDomTree=function(){var e=this.dom,t=document.createElement("table"),i=document.createElement("tbody");t.style.borderCollapse="collapse",t.className="values",t.appendChild(i);var o=document.createElement("tr");i.appendChild(o);var n=document.createElement("td");n.className="tree",o.appendChild(n),e.expand=this._createDomExpandButton(),n.appendChild(e.expand),e.tdExpand=n;var s=document.createElement("td");s.className="tree",o.appendChild(s),e.field=this._createDomField(),s.appendChild(e.field),e.tdField=s;var r=document.createElement("td");r.className="tree",o.appendChild(r),"object"!=this.type&&"array"!=this.type&&(r.appendChild(document.createTextNode(":")),r.className="separator"),e.tdSeparator=r;var a=document.createElement("td");return a.className="tree",o.appendChild(a),e.value=this._createDomValue(),a.appendChild(e.value),e.tdValue=a,t},o.prototype.onEvent=function(e){var t,i=e.type,o=e.target||e.srcElement,n=this.dom,s=this,r=this._hasChilds();if((o==n.drag||o==n.menu)&&("mouseover"==i?this.editor.highlighter.highlight(this):"mouseout"==i&&this.editor.highlighter.unhighlight()),"mousedown"==i&&o==n.drag&&this._onDragStart(e),"click"==i&&o==n.menu){var a=s.editor.highlighter;a.highlight(s),a.lock(),util.addClassName(n.menu,"selected"),this.showContextMenu(n.menu,function(){util.removeClassName(n.menu,"selected"),a.unlock(),a.unhighlight()})}if("click"==i&&o==n.expand&&r){var l=e.ctrlKey;this._onExpand(l)}var d=n.value;if(o==d)switch(i){case"focus":t=this;break;case"blur":case"change":this._getDomValue(!0),this._updateDomValue(),this.value&&(d.innerHTML=this._escapeHTML(this.value));break;case"input":this._getDomValue(!0),this._updateDomValue();break;case"keydown":case"mousedown":this.editor.selection=this.editor.getSelection();break;case"click":e.ctrlKey&&this.editor.mode.edit&&util.isUrl(this.value)&&window.open(this.value,"_blank");break;case"keyup":this._getDomValue(!0),this._updateDomValue();break;case"cut":case"paste":setTimeout(function(){s._getDomValue(!0),s._updateDomValue()},1)}var h=n.field;if(o==h)switch(i){case"focus":t=this;break;case"blur":case"change":this._getDomField(!0),this._updateDomField(),this.field&&(h.innerHTML=this._escapeHTML(this.field));break;case"input":this._getDomField(!0),this._updateDomField();break;case"keydown":case"mousedown":this.editor.selection=this.editor.getSelection();break;case"keyup":this._getDomField(!0),this._updateDomField();break;case"cut":case"paste":setTimeout(function(){s._getDomField(!0),s._updateDomField()},1)}var c=n.tree;if(o==c.parentNode)switch(i){case"click":var u=void 0!=e.offsetX?e.offsetX<24*(this.getLevel()+1):e.pageX<util.getAbsoluteLeft(n.tdSeparator);u||r?h&&(util.setEndOfContentEditable(h),h.focus()):d&&(util.setEndOfContentEditable(d),d.focus())}if(o==n.tdExpand&&!r||o==n.tdField||o==n.tdSeparator)switch(i){case"click":h&&(util.setEndOfContentEditable(h),h.focus())}"keydown"==i&&this.onKeyDown(e)},o.prototype.onKeyDown=function(e){var t,i,s,r,a=e.which||e.keyCode,l=e.target||e.srcElement,d=e.ctrlKey,h=e.shiftKey,c=e.altKey,u=!1;if(13==a){if(l==this.dom.value)(!this.editor.mode.edit||e.ctrlKey)&&util.isUrl(this.value)&&(window.open(this.value,"_blank"),u=!0);else if(l==this.dom.expand){var p=this._hasChilds();if(p){var m=e.ctrlKey;this._onExpand(m),l.focus(),u=!0}}}else if(68==a)d&&(this._onDuplicate(),u=!0);else if(69==a)d&&(this._onExpand(h),l.focus(),u=!0);else if(77==a)d&&(this.showContextMenu(l),u=!0);else if(46==a)d&&(this._onRemove(),u=!0);else if(45==a)d&&!h?(this._onInsertBefore(),u=!0):d&&h&&(this._onInsertAfter(),u=!0);else if(35==a){if(c){var f=this._lastNode();f&&f.focus(o.focusElement||this._getElementName(l)),u=!0}}else if(36==a){if(c){var v=this._firstNode();v&&v.focus(o.focusElement||this._getElementName(l)),u=!0}}else if(37==a){if(c&&!h){var g=this._previousElement(l);g&&this.focus(this._getElementName(g)),u=!0}else if(c&&h){if(this.expanded){var y=this.getAppend();s=y?y.nextSibling:void 0}else{var x=this.getDom();s=x.nextSibling}s&&(i=o.getNodeFromTarget(s),r=s.nextSibling,N=o.getNodeFromTarget(r),i&&i instanceof n&&1!=this.parent.childs.length&&N&&N.parent&&(N.parent.moveBefore(this,N),this.focus(o.focusElement||this._getElementName(l))))}}else if(38==a)c&&!h?(t=this._previousNode(),t&&t.focus(o.focusElement||this._getElementName(l)),u=!0):c&&h&&(t=this._previousNode(),t&&t.parent&&(t.parent.moveBefore(this,t),this.focus(o.focusElement||this._getElementName(l))),u=!0);else if(39==a){if(c&&!h){var C=this._nextElement(l);C&&this.focus(this._getElementName(C)),u=!0}else if(c&&h){x=this.getDom();var b=x.previousSibling;b&&(t=o.getNodeFromTarget(b),t&&t.parent&&t instanceof n&&!t.isVisible()&&(t.parent.moveBefore(this,t),this.focus(o.focusElement||this._getElementName(l))))}}else if(40==a)if(c&&!h)i=this._nextNode(),i&&i.focus(o.focusElement||this._getElementName(l)),u=!0;else if(c&&h){i=this.expanded?this.append?this.append._nextNode():void 0:this._nextNode(),s=i?i.getDom():void 0,r=1==this.parent.childs.length?s:s?s.nextSibling:void 0;var N=o.getNodeFromTarget(r);N&&N.parent&&(N.parent.moveBefore(this,N),this.focus(o.focusElement||this._getElementName(l))),u=!0}u&&(e.preventDefault(),e.stopPropagation())},o.prototype._onExpand=function(e){if(e){var t=this.dom.tr.parentNode,i=t.parentNode,o=i.scrollTop;i.removeChild(t)}this.expanded?this.collapse(e):this.expand(e),e&&(i.appendChild(t),i.scrollTop=o)},o.prototype._onRemove=function(){this.editor.highlighter.unhighlight();var e=this.parent.childs,t=e.indexOf(this),i=this.editor.getSelection();e[t+1]?e[t+1].focus():e[t-1]?e[t-1].focus():this.parent.focus();var o=this.editor.getSelection();this.parent._remove(this),this.editor._onAction("removeNode",{node:this,parent:this.parent,index:t,oldSelection:i,newSelection:o})},o.prototype._onDuplicate=function(){var e=this.editor.getSelection(),t=this.parent._duplicate(this);t.focus();var i=this.editor.getSelection();this.editor._onAction("duplicateNode",{node:this,clone:t,parent:this.parent,oldSelection:e,newSelection:i})},o.prototype._onInsertBefore=function(e,t,i){var n=this.editor.getSelection(),s=new o(this.editor,{field:void 0!=e?e:"",value:void 0!=t?t:"",type:i});s.expand(!0),this.parent.insertBefore(s,this),this.editor.highlighter.unhighlight(),s.focus("field");var r=this.editor.getSelection();this.editor._onAction("insertBeforeNode",{node:s,beforeNode:this,parent:this.parent,oldSelection:n,newSelection:r})},o.prototype._onInsertAfter=function(e,t,i){var n=this.editor.getSelection(),s=new o(this.editor,{field:void 0!=e?e:"",value:void 0!=t?t:"",type:i});s.expand(!0),this.parent.insertAfter(s,this),this.editor.highlighter.unhighlight(),s.focus("field");var r=this.editor.getSelection();this.editor._onAction("insertAfterNode",{node:s,afterNode:this,parent:this.parent,oldSelection:n,newSelection:r})},o.prototype._onAppend=function(e,t,i){var n=this.editor.getSelection(),s=new o(this.editor,{field:void 0!=e?e:"",value:void 0!=t?t:"",type:i});s.expand(!0),this.parent.appendChild(s),this.editor.highlighter.unhighlight(),s.focus("field");var r=this.editor.getSelection();this.editor._onAction("appendNode",{node:s,parent:this.parent,oldSelection:n,newSelection:r})},o.prototype._onChangeType=function(e){var t=this.type;if(e!=t){var i=this.editor.getSelection();this.changeType(e);var o=this.editor.getSelection();this.editor._onAction("changeType",{node:this,oldType:t,newType:e,oldSelection:i,newSelection:o})}},o.prototype._onSort=function(e){if(this._hasChilds()){var t="desc"==e?-1:1,i="array"==this.type?"value":"field";this.hideChilds();var o=this.childs,n=this.sort;this.childs=this.childs.concat(),this.childs.sort(function(e,o){return e[i]>o[i]?t:e[i]<o[i]?-t:0}),this.sort=1==t?"asc":"desc",this.editor._onAction("sort",{node:this,oldChilds:o,oldSort:n,newChilds:this.childs,newSort:this.sort}),this.showChilds()}},o.prototype.getAppend=function(){return this.append||(this.append=new n(this.editor),this.append.setParent(this)),this.append.getDom()},o.getNodeFromTarget=function(e){for(;e;){if(e.node)return e.node;e=e.parentNode}return void 0},o.prototype._previousNode=function(){var e=null,t=this.getDom();if(t&&t.parentNode){var i=t;do i=i.previousSibling,e=o.getNodeFromTarget(i);while(i&&e instanceof n&&!e.isVisible())}return e},o.prototype._nextNode=function(){var e=null,t=this.getDom();if(t&&t.parentNode){var i=t;do i=i.nextSibling,e=o.getNodeFromTarget(i);while(i&&e instanceof n&&!e.isVisible())}return e},o.prototype._firstNode=function(){var e=null,t=this.getDom();if(t&&t.parentNode){var i=t.parentNode.firstChild;e=o.getNodeFromTarget(i)}return e},o.prototype._lastNode=function(){var e=null,t=this.getDom();if(t&&t.parentNode){var i=t.parentNode.lastChild;for(e=o.getNodeFromTarget(i);i&&e instanceof n&&!e.isVisible();)i=i.previousSibling,e=o.getNodeFromTarget(i)}return e},o.prototype._previousElement=function(e){var t=this.dom;switch(e){case t.value:if(this.fieldEditable)return t.field;case t.field:if(this._hasChilds())return t.expand;case t.expand:return t.menu;case t.menu:if(t.drag)return t.drag;default:return null}},o.prototype._nextElement=function(e){var t=this.dom;switch(e){case t.drag:return t.menu;case t.menu:if(this._hasChilds())return t.expand;case t.expand:if(this.fieldEditable)return t.field;case t.field:if(!this._hasChilds())return t.value;default:return null}},o.prototype._getElementName=function(e){var t=this.dom;for(var i in t)if(t.hasOwnProperty(i)&&t[i]==e)return i;return null},o.prototype._hasChilds=function(){return"array"==this.type||"object"==this.type},o.TYPE_TITLES={auto:'Field type "auto". The field type is automatically determined from the value and can be a string, number, boolean, or null.',object:'Field type "object". An object contains an unordered set of key/value pairs.',array:'Field type "array". An array contains an ordered collection of values.',string:'Field type "string". Field type is not determined from the value, but always returned as string.'},o.prototype.showContextMenu=function(e,t){var i=this,n=o.TYPE_TITLES,r=[];if(r.push({text:"Type",title:"Change the type of this field",className:"type-"+this.type,submenu:[{text:"Auto",className:"type-auto"+("auto"==this.type?" selected":""),title:n.auto,click:function(){i._onChangeType("auto")}},{text:"Array",className:"type-array"+("array"==this.type?" selected":""),title:n.array,click:function(){i._onChangeType("array")}},{text:"Object",className:"type-object"+("object"==this.type?" selected":""),title:n.object,click:function(){i._onChangeType("object")}},{text:"String",className:"type-string"+("string"==this.type?" selected":""),title:n.string,click:function(){i._onChangeType("string")}}]}),this._hasChilds()){var a="asc"==this.sort?"desc":"asc";r.push({text:"Sort",title:"Sort the childs of this "+this.type,className:"sort-"+a,click:function(){i._onSort(a)},submenu:[{text:"Ascending",className:"sort-asc",title:"Sort the childs of this "+this.type+" in ascending order",click:function(){i._onSort("asc")}},{text:"Descending",className:"sort-desc",title:"Sort the childs of this "+this.type+" in descending order",click:function(){i._onSort("desc")}}]})}if(this.parent&&this.parent._hasChilds()){r.push({type:"separator"});var l=i.parent.childs;i==l[l.length-1]&&r.push({text:"Append",title:"Append a new field with type 'auto' after this field (Ctrl+Shift+Ins)",submenuTitle:"Select the type of the field to be appended",className:"append",click:function(){i._onAppend("","","auto")},submenu:[{text:"Auto",className:"type-auto",title:n.auto,click:function(){i._onAppend("","","auto")}},{text:"Array",className:"type-array",title:n.array,click:function(){i._onAppend("",[])}},{text:"Object",className:"type-object",title:n.object,click:function(){i._onAppend("",{})}},{text:"String",className:"type-string",title:n.string,click:function(){i._onAppend("","","string")}}]}),r.push({text:"Insert",title:"Insert a new field with type 'auto' before this field (Ctrl+Ins)",submenuTitle:"Select the type of the field to be inserted",className:"insert",click:function(){i._onInsertBefore("","","auto")},submenu:[{text:"Auto",className:"type-auto",title:n.auto,click:function(){i._onInsertBefore("","","auto")}},{text:"Array",className:"type-array",title:n.array,click:function(){i._onInsertBefore("",[])}},{text:"Object",className:"type-object",title:n.object,click:function(){i._onInsertBefore("",{})}},{text:"String",className:"type-string",title:n.string,click:function(){i._onInsertBefore("","","string")}}]}),r.push({text:"Duplicate",title:"Duplicate this field (Ctrl+D)",className:"duplicate",click:function(){i._onDuplicate()}}),r.push({text:"Remove",title:"Remove this field (Ctrl+Del)",className:"remove",click:function(){i._onRemove()}})}var d=new s(r,{close:t});d.show(e)},o.prototype._getType=function(e){return e instanceof Array?"array":e instanceof Object?"object":"string"==typeof e&&"string"!=typeof this._stringCast(e)?"string":"auto"},o.prototype._stringCast=function(e){var t=e.toLowerCase(),i=Number(e),o=parseFloat(e);return""==e?"":"null"==t?null:"true"==t?!0:"false"==t?!1:isNaN(i)||isNaN(o)?e:i},o.prototype._escapeHTML=function(e){var t=String(e).replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/  /g," &nbsp;").replace(/^ /,"&nbsp;").replace(/ $/,"&nbsp;"),i=JSON.stringify(t);return i.substring(1,i.length-1)},o.prototype._unescapeHTML=function(e){var t='"'+this._escapeJSON(e)+'"',i=util.parse(t);return i.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&nbsp;|\u00A0/g," ")},o.prototype._escapeJSON=function(e){for(var t="",i=0,o=e.length;o>i;){var n=e.charAt(i);"\n"==n?t+="\\n":"\\"==n?(t+=n,i++,n=e.charAt(i),-1=='"\\/bfnrtu'.indexOf(n)&&(t+="\\"),t+=n):t+='"'==n?'\\"':n,i++}return t},n.prototype=new o,n.prototype.getDom=function(){var e=this.dom;if(e.tr)return e.tr;var t=document.createElement("tr");if(t.node=this,e.tr=t,this.editor.mode.edit){e.tdDrag=document.createElement("td");var i=document.createElement("td");e.tdMenu=i;var o=document.createElement("button");o.className="contextmenu",o.title="Click to open the actions menu (Ctrl+M)",e.menu=o,i.appendChild(e.menu)}var n=document.createElement("td"),s=document.createElement("div");return s.innerHTML="(empty)",s.className="readonly",n.appendChild(s),e.td=n,e.text=s,this.updateDom(),t},n.prototype.updateDom=function(){var e=this.dom,t=e.td;t&&(t.style.paddingLeft=24*this.getLevel()+26+"px");var i=e.text;i&&(i.innerHTML="(empty "+this.parent.type+")");var o=e.tr;this.isVisible()?e.tr.firstChild||(e.tdDrag&&o.appendChild(e.tdDrag),e.tdMenu&&o.appendChild(e.tdMenu),o.appendChild(t)):e.tr.firstChild&&(e.tdDrag&&o.removeChild(e.tdDrag),e.tdMenu&&o.removeChild(e.tdMenu),o.removeChild(t))},n.prototype.isVisible=function(){return 0==this.parent.childs.length},n.prototype.showContextMenu=function(e,t){var i=this,n=o.TYPE_TITLES,r=[{text:"Append",title:"Append a new field with type 'auto' (Ctrl+Shift+Ins)",submenuTitle:"Select the type of the field to be appended",className:"insert",click:function(){i._onAppend("","","auto")},submenu:[{text:"Auto",className:"type-auto",title:n.auto,click:function(){i._onAppend("","","auto")}},{text:"Array",className:"type-array",title:n.array,click:function(){i._onAppend("",[])}},{text:"Object",className:"type-object",title:n.object,click:function(){i._onAppend("",{})}},{text:"String",className:"type-string",title:n.string,click:function(){i._onAppend("","","string")}}]}],a=new s(r,{close:t});a.show(e)},n.prototype.onEvent=function(e){var t=e.type,i=e.target||e.srcElement,o=this.dom,n=o.menu;if(i==n&&("mouseover"==t?this.editor.highlighter.highlight(this.parent):"mouseout"==t&&this.editor.highlighter.unhighlight()),"click"==t&&i==o.menu){var s=this.editor.highlighter;s.highlight(this.parent),s.lock(),util.addClassName(o.menu,"selected"),this.showContextMenu(o.menu,function(){util.removeClassName(o.menu,"selected"),s.unlock(),s.unhighlight()})}"keydown"==t&&this.onKeyDown(e)},s.prototype._getVisibleButtons=function(){var e=[],t=this;return this.dom.items.forEach(function(i){e.push(i.button),i.buttonExpand&&e.push(i.buttonExpand),i.subItems&&i==t.expandedItem&&i.subItems.forEach(function(t){e.push(t.button),t.buttonExpand&&e.push(t.buttonExpand)})}),e},s.visibleMenu=void 0,s.prototype.show=function(e){this.hide();var t=window.innerHeight,i=window.pageYOffset||document.scrollTop||0,o=t+i,n=e.offsetHeight,r=this.maxHeight,a=util.getAbsoluteLeft(e),l=util.getAbsoluteTop(e);o>l+n+r?(this.dom.menu.style.left=a+"px",this.dom.menu.style.top=l+n+"px",this.dom.menu.style.bottom=""):(this.dom.menu.style.left=a+"px",this.dom.menu.style.top="",this.dom.menu.style.bottom=t-l+"px"),document.body.appendChild(this.dom.menu);var d=this,h=this.dom.list;this.eventListeners.mousedown=util.addEventListener(document,"mousedown",function(e){var t=e.target;t==h||d._isChildOf(t,h)||(d.hide(),e.stopPropagation(),e.preventDefault())}),this.eventListeners.mousewheel=util.addEventListener(document,"mousewheel",function(e){e.stopPropagation(),e.preventDefault()}),this.eventListeners.keydown=util.addEventListener(document,"keydown",function(e){d._onKeyDown(e)}),this.selection=util.getSelection(),this.anchor=e,setTimeout(function(){d.dom.focusButton.focus()},0),s.visibleMenu&&s.visibleMenu.hide(),s.visibleMenu=this},s.prototype.hide=function(){this.dom.menu.parentNode&&(this.dom.menu.parentNode.removeChild(this.dom.menu),this.onClose&&this.onClose());for(var e in this.eventListeners)if(this.eventListeners.hasOwnProperty(e)){var t=this.eventListeners[e];t&&util.removeEventListener(document,e,t),delete this.eventListeners[e]}s.visibleMenu==this&&(s.visibleMenu=void 0)},s.prototype._onExpandItem=function(e){var t=this,i=e==this.expandedItem,o=this.expandedItem;if(o&&(o.ul.style.height="0",o.ul.style.padding="",setTimeout(function(){t.expandedItem!=o&&(o.ul.style.display="",util.removeClassName(o.ul.parentNode,"selected"))},300),this.expandedItem=void 0),!i){var n=e.ul;n.style.display="block";{n.clientHeight}setTimeout(function(){t.expandedItem==e&&(n.style.height=24*n.childNodes.length+"px",n.style.padding="5px 10px")},0),util.addClassName(n.parentNode,"selected"),this.expandedItem=e}},s.prototype._onKeyDown=function(e){var t,i,o,n,s=e.target,r=e.which,a=!1;27==r?(this.selection&&util.setSelection(this.selection),this.anchor&&this.anchor.focus(),this.hide(),a=!0):9==r?e.shiftKey?(t=this._getVisibleButtons(),i=t.indexOf(s),0==i&&(t[t.length-1].focus(),a=!0)):(t=this._getVisibleButtons(),i=t.indexOf(s),i==t.length-1&&(t[0].focus(),a=!0)):37==r?("expand"==s.className&&(t=this._getVisibleButtons(),i=t.indexOf(s),o=t[i-1],o&&o.focus()),a=!0):38==r?(t=this._getVisibleButtons(),i=t.indexOf(s),o=t[i-1],o&&"expand"==o.className&&(o=t[i-2]),o||(o=t[t.length-1]),o&&o.focus(),a=!0):39==r?(t=this._getVisibleButtons(),i=t.indexOf(s),n=t[i+1],n&&"expand"==n.className&&n.focus(),a=!0):40==r&&(t=this._getVisibleButtons(),i=t.indexOf(s),n=t[i+1],n&&"expand"==n.className&&(n=t[i+2]),n||(n=t[0]),n&&(n.focus(),a=!0),a=!0),a&&(e.stopPropagation(),e.preventDefault())},s.prototype._isChildOf=function(e,t){for(var i=e.parentNode;i;){if(i==t)return!0;i=i.parentNode}return!1},r.prototype.onChange=function(){},r.prototype.add=function(e,t){this.index++,this.history[this.index]={action:e,params:t,timestamp:new Date},this.index<this.history.length-1&&this.history.splice(this.index+1,this.history.length-this.index-1),this.onChange()},r.prototype.clear=function(){this.history=[],this.index=-1,this.onChange()},r.prototype.canUndo=function(){return this.index>=0},r.prototype.canRedo=function(){return this.index<this.history.length-1},r.prototype.undo=function(){if(this.canUndo()){var e=this.history[this.index];if(e){var t=this.actions[e.action];t&&t.undo?(t.undo(e.params),e.params.oldSelection&&this.editor.setSelection(e.params.oldSelection)):util.log('Error: unknown action "'+e.action+'"')}this.index--,this.onChange()}},r.prototype.redo=function(){if(this.canRedo()){this.index++;var e=this.history[this.index];if(e){var t=this.actions[e.action];t&&t.redo?(t.redo(e.params),e.params.newSelection&&this.editor.setSelection(e.params.newSelection)):util.log('Error: unknown action "'+e.action+'"')}this.onChange()}},l.prototype.next=function(e){if(void 0!=this.results){var t=void 0!=this.resultIndex?this.resultIndex+1:0;t>this.results.length-1&&(t=0),this._setActiveResult(t,e)}},l.prototype.previous=function(e){if(void 0!=this.results){var t=this.results.length-1,i=void 0!=this.resultIndex?this.resultIndex-1:t;0>i&&(i=t),this._setActiveResult(i,e)}},l.prototype._setActiveResult=function(e,t){if(this.activeResult){var i=this.activeResult.node,o=this.activeResult.elem;"field"==o?delete i.searchFieldActive:delete i.searchValueActive,i.updateDom()}if(!this.results||!this.results[e])return this.resultIndex=void 0,this.activeResult=void 0,void 0;this.resultIndex=e;var n=this.results[this.resultIndex].node,s=this.results[this.resultIndex].elem;"field"==s?n.searchFieldActive=!0:n.searchValueActive=!0,this.activeResult=this.results[this.resultIndex],n.updateDom(),n.scrollTo(function(){t&&n.focus(s)})},l.prototype._clearDelay=function(){void 0!=this.timeout&&(clearTimeout(this.timeout),delete this.timeout)},l.prototype._onDelayedSearch=function(){this._clearDelay();var e=this;this.timeout=setTimeout(function(t){e._onSearch(t)},this.delay)},l.prototype._onSearch=function(e,t){this._clearDelay();var i=this.dom.search.value,o=i.length>0?i:void 0;if(o!=this.lastText||t)if(this.lastText=o,this.results=this.editor.search(o),this._setActiveResult(void 0),void 0!=o){var n=this.results.length;switch(n){case 0:this.dom.results.innerHTML="no&nbsp;results";break;case 1:this.dom.results.innerHTML="1&nbsp;result";break;default:this.dom.results.innerHTML=n+"&nbsp;results"}}else this.dom.results.innerHTML=""},l.prototype._onKeyDown=function(e){var t=e.which;27==t?(this.dom.search.value="",this._onSearch(e),e.preventDefault(),e.stopPropagation()):13==t&&(e.ctrlKey?this._onSearch(e,!0):e.shiftKey?this.previous():this.next(),e.preventDefault(),e.stopPropagation())},l.prototype._onKeyUp=function(e){var t=e.keyCode;27!=t&&13!=t&&this._onDelayedSearch(e)},d.prototype.highlight=function(e){this.locked||(this.node!=e&&(this.node&&this.node.setHighlight(!1),this.node=e,this.node.setHighlight(!0)),this._cancelUnhighlight())},d.prototype.unhighlight=function(){if(!this.locked){var e=this;this.node&&(this._cancelUnhighlight(),this.unhighlightTimer=setTimeout(function(){e.node.setHighlight(!1),e.node=void 0,e.unhighlightTimer=void 0},0))}},d.prototype._cancelUnhighlight=function(){this.unhighlightTimer&&(clearTimeout(this.unhighlightTimer),this.unhighlightTimer=void 0)},d.prototype.lock=function(){this.locked=!0},d.prototype.unlock=function(){this.locked=!1},util={},util.parse=function(e){try{return JSON.parse(e)}catch(t){throw util.validate(e),t}},util.validate=function(e){"undefined"!=typeof jsonlint?jsonlint.parse(e):JSON.parse(e)},util.extend=function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e},util.clear=function(e){for(var t in e)e.hasOwnProperty(t)&&delete e[t];return e},util.log=function(){"undefined"!=typeof console&&"function"==typeof console.log&&console.log.apply(console,arguments)},util.type=function(e){return null===e?"null":void 0===e?"undefined":e instanceof Number||"number"==typeof e?"number":e instanceof String||"string"==typeof e?"string":e instanceof Boolean||"boolean"==typeof e?"boolean":e instanceof RegExp||"regexp"==typeof e?"regexp":Array.isArray(e)?"array":"object"};var h=/^https?:\/\/\S+$/;util.isUrl=function(e){return("string"==typeof e||e instanceof String)&&h.test(e)},util.getAbsoluteLeft=function(e){var t=e.getBoundingClientRect();return t.left+window.pageXOffset||document.scrollLeft||0},util.getAbsoluteTop=function(e){var t=e.getBoundingClientRect();return t.top+window.pageYOffset||document.scrollTop||0},util.addClassName=function(e,t){var i=e.className.split(" ");-1==i.indexOf(t)&&(i.push(t),e.className=i.join(" "))},util.removeClassName=function(e,t){var i=e.className.split(" "),o=i.indexOf(t);-1!=o&&(i.splice(o,1),e.className=i.join(" "))},util.stripFormatting=function(e){for(var t=e.childNodes,i=0,o=t.length;o>i;i++){var n=t[i];n.style&&n.removeAttribute("style");var s=n.attributes;if(s)for(var r=s.length-1;r>=0;r--){var a=s[r];1==a.specified&&n.removeAttribute(a.name)}util.stripFormatting(n)}},util.setEndOfContentEditable=function(e){var t,i;document.createRange&&(t=document.createRange(),t.selectNodeContents(e),t.collapse(!1),i=window.getSelection(),i.removeAllRanges(),i.addRange(t))},util.selectContentEditable=function(e){if(e&&"DIV"==e.nodeName){var t,i;window.getSelection&&document.createRange&&(i=document.createRange(),i.selectNodeContents(e),t=window.getSelection(),t.removeAllRanges(),t.addRange(i))}},util.getSelection=function(){if(window.getSelection){var e=window.getSelection();if(e.getRangeAt&&e.rangeCount)return e.getRangeAt(0)}return null},util.setSelection=function(e){if(e&&window.getSelection){var t=window.getSelection();t.removeAllRanges(),t.addRange(e)}},util.getSelectionOffset=function(){var e=util.getSelection();return e&&"startOffset"in e&&"endOffset"in e&&e.startContainer&&e.startContainer==e.endContainer?{startOffset:e.startOffset,endOffset:e.endOffset,container:e.startContainer.parentNode}:null},util.setSelectionOffset=function(e){if(document.createRange&&window.getSelection){var t=window.getSelection();if(t){var i=document.createRange();i.setStart(e.container.firstChild,e.startOffset),i.setEnd(e.container.firstChild,e.endOffset),util.setSelection(i)}}},util.getInnerText=function(e,t){var i=void 0==t;if(i&&(t={text:"",flush:function(){var e=this.text;return this.text="",e},set:function(e){this.text=e}}),e.nodeValue)return t.flush()+e.nodeValue;if(e.hasChildNodes()){for(var o=e.childNodes,n="",s=0,r=o.length;r>s;s++){var a=o[s];if("DIV"==a.nodeName||"P"==a.nodeName){var l=o[s-1],d=l?l.nodeName:void 0;d&&"DIV"!=d&&"P"!=d&&"BR"!=d&&(n+="\n",t.flush()),n+=util.getInnerText(a,t),t.set("\n")}else"BR"==a.nodeName?(n+=t.flush(),t.set("\n")):n+=util.getInnerText(a,t)}return n}return"P"==e.nodeName&&-1!=util.getInternetExplorerVersion()?t.flush():""},util.getInternetExplorerVersion=function(){if(-1==c){var e=-1;if("Microsoft Internet Explorer"==navigator.appName){var t=navigator.userAgent,i=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})");null!=i.exec(t)&&(e=parseFloat(RegExp.$1))}c=e}return c},util.isFirefox=function(){return-1!=navigator.userAgent.indexOf("Firefox")};var c=-1;util.addEventListener=function(e,t,i,o){if(e.addEventListener)return void 0===o&&(o=!1),"mousewheel"===t&&util.isFirefox()&&(t="DOMMouseScroll"),e.addEventListener(t,i,o),i;if(e.attachEvent){var n=function(){return i.call(e,window.event)};return e.attachEvent("on"+t,n),n}},util.removeEventListener=function(e,t,i,o){e.removeEventListener?(void 0===o&&(o=!1),"mousewheel"===t&&util.isFirefox()&&(t="DOMMouseScroll"),e.removeEventListener(t,i,o)):e.detachEvent&&e.detachEvent("on"+t,i)};var u={JSONEditor:e,JSONFormatter:function(){throw new Error('JSONFormatter is deprecated. Use JSONEditor with mode "text" or "code" instead')},util:util},p=function(){for(var e=document.getElementsByTagName("script"),t=0;t<e.length;t++){var i=e[t].src;if(/(^|\/)jsoneditor([-\.]min)?.js$/.test(i)){var o=i.split("?")[0],n=o.substring(0,o.length-2)+"css",s=document.createElement("link");s.type="text/css",s.rel="stylesheet",s.href=n,document.getElementsByTagName("head")[0].appendChild(s);break}}};"undefined"!=typeof module&&"undefined"!=typeof exports&&(p(),module.exports=exports=u),"undefined"!=typeof require&&"undefined"!=typeof define?(p(),define(function(){return u})):window.jsoneditor=u}();
</file>

<file path="application/extensions/yii-jsoneditor/jsoneditor-2.3.6/jsoneditor.js">
(function () {
function JSONEditor (container, options, json) {
  if (!(this instanceof JSONEditor)) {
    throw new Error('JSONEditor constructor called without "new".');
  }
  var ieVersion = util.getInternetExplorerVersion();
  if (ieVersion != -1 && ieVersion < 9) {
    throw new Error('Unsupported browser, IE9 or newer required. ' +
        'Please install the newest version of your browser.');
  }
  if (arguments.length) {
    this._create(container, options, json);
  }
}
JSONEditor.modes = {};
JSONEditor.prototype._create = function (container, options, json) {
  this.container = container;
  this.options = options || {};
  this.json = json || {};
  var mode = this.options.mode || 'tree';
  this.setMode(mode);
};
JSONEditor.prototype._delete = function () {};
JSONEditor.prototype.set = function (json) {
  this.json = json;
};
JSONEditor.prototype.get = function () {
  return this.json;
};
JSONEditor.prototype.setText = function (jsonText) {
... (4174 lines truncated)
</file>

<file path="application/extensions/yii-jsoneditor/jsoneditor-2.3.6/LICENSE">
Apache License
                           Version 2.0, January 2004
                        http://www.apache.org/licenses/

   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

   1. Definitions.

      "License" shall mean the terms and conditions for use, reproduction,
      and distribution as defined by Sections 1 through 9 of this document.

      "Licensor" shall mean the copyright owner or entity authorized by
      the copyright owner that is granting the License.

      "Legal Entity" shall mean the union of the acting entity and all
      other entities that control, are controlled by, or are under common
      control with that entity. For the purposes of this definition,
      "control" means (i) the power, direct or indirect, to cause the
      direction or management of such entity, whether by contract or
      otherwise, or (ii) ownership of fifty percent (50%) or more of the
      outstanding shares, or (iii) beneficial ownership of such entity.

      "You" (or "Your") shall mean an individual or Legal Entity
      exercising permissions granted by this License.

      "Source" form shall mean the preferred form for making modifications,
      including but not limited to software source code, documentation
      source, and configuration files.

      "Object" form shall mean any form resulting from mechanical
... (147 lines truncated)
</file>

<file path="application/extensions/yii-jsoneditor/jsoneditor-2.3.6/NOTICE">
JSON Editor Online
http://jsoneditoronline.org

Copyright (C) 2011-2013 Jos de Jong


Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
</file>

<file path="application/extensions/yii-jsoneditor/jsoneditor-2.3.6/README.md">
# JSON Editor Online
http://jsoneditoronline.org/


### Description

JSON Editor Online is a web-based tool to view, edit, and format JSON.
It has various modes such as a tree editor, a code editor, and a plain text
editor.

The editor can be used as a component in your own web application. The library
can be loaded as CommonJS module, AMD module, or as a regular javascript file.

Supported browsers: Chrome, Firefox, Safari, Opera, Internet Explorer 9+.

### Screenshot

The web application shows two panels side by side: a code editor on the left,
and a tree editor on the right. Files and urls can be loaded via the main menu.

<a href="http://jsoneditoronline.org">
    <img alt="jsoneditor"
        src="https://raw.github.com/josdejong/jsoneditor/master/misc/screenshots/jsoneditoronline.png">
</a>


### Features

#### Tree editor
- Edit, add, move, remove, and duplicate fields and values.
... (85 lines truncated)
</file>

<file path="application/extensions/yii-jsoneditor/JsonEditor.php">
<?php
class JsonEditor extends CInputWidget
{
    protected $baseUrl;
    public $editorOptions = array(
        'mode' => 'form',
        'modes' => array('form', 'code', 'tree', 'text')
    );
    public $htmlOptions = array(
        'class' => 'jsoneditor-wrapper'
    );
    protected $libraryDir = 'jsoneditor-2.3.6';
    public function init()
    {
        $this->baseUrl = Yii::app()->assetManager->publish(__DIR__ . "/" . $this->libraryDir) . "/";
        $this->registerClientScript();
    }
    protected function registerCssFile($fileName)
    {
        App()->clientScript->registerCssFile($this->baseUrl . $fileName);
    }
    protected function registerScriptFile($fileName)
    {
        App()->clientScript->registerScriptFile($this->baseUrl . $fileName);
    }
    protected function registerClientScript()
    {
        $this->registerCssFile('jsoneditor-min.css');
        $this->registerScriptFile('jsoneditor-min.js');
        $this->registerScriptFile('lib/ace/ace.js');
... (29 lines truncated)
</file>

<file path="application/extensions/yii-jsoneditor/widget.js">
(function ($) {
	$.fn.jsonEditor = function(config) {
		var config = config || {}
		var result = this;
		this.each(function() {
			if ($(this).is("textarea"))
			{
				if (typeof $(this).data("jsonEditor") != 'undefined' )
				{
					result = $(this).data("jsonEditor");
					return false;
				}
				var textarea = $(this);
				$(this).parent();
				config.change = function() {
					textarea.val($(textarea).jsonEditor().getText());
				}
                var value = $(this).val();
                if (value == "")
                {
                    value = "{}";
                }
				$(this).data("jsonEditor", new jsoneditor.JSONEditor($(this).parent()[0], config, $.parseJSON(value)));
				textarea.hide();
				result = $(this).data("jsonEditor");
			}
		});
		return result;
	}
})(jQuery);
... (1 lines truncated)
</file>

<file path="application/extensions/yiiwheels/behaviors/WhPlugin.php">
<?php
class WhPlugin extends CBehavior
{
    public static $counter = 0;
    protected $_assetsUrl;
    protected static $_wheels;
    public function getAssetsUrl($path)
    {
        if (isset($this->_assetsUrl)) {
            return $this->_assetsUrl;
        }
        $assetsUrl = Yii::app()->assetManager->publish($path, false, -1, null);
        return $this->_assetsUrl = $assetsUrl;
    }
    public function getApi()
    {
        return $this;
    }
    public function registerPlugin($name, $selector, $options = array(), $position = CClientScript::POS_END)
    {
        $options = !empty($options) ? CJavaScript::encode($options) : '';
        $script = "jQuery('{$selector}').{$name}({$options});";
        $id = __CLASS__ . '
        Yii::app()->clientScript->registerScript($id, $script, $position);
    }
    public function registerEvents($selector, $events, $position = CClientScript::POS_END)
    {
        if (!empty($events)) {
            $script = '';
            foreach ($events as $name => $handler) {
... (18 lines truncated)
</file>

<file path="application/extensions/yiiwheels/widgets/ace/WhAceEditor.php">
<?php
Yii::import('yiistrap_fork.helpers.TbHtml');
Yii::import('yiistrap_fork.helpers.TbArray');
class WhAceEditor extends CInputWidget
{
    public $theme = 'clouds';
    public $mode = 'html';
    public $pluginOptions = array();
    public $events = array();
    public function init()
    {
        if (empty($this->theme)) {
            throw new CException(Yii::t(
                'zii',
                '"{attribute}" cannot be empty.',
                array('{attribute}' => 'theme')
            ));
        }
        if (empty($this->mode)) {
            throw new CException(Yii::t(
                'zii',
                '"{attribute}" cannot be empty.',
                array('{attribute}' => 'mode')
            ));
        }
        $this->attachBehavior('ywplugin', array('class' => 'yiiwheels.behaviors.WhPlugin'));
    }
    public function run()
    {
        $this->renderField();
... (55 lines truncated)
</file>

<file path="application/extensions/yiiwheels/widgets/box/WhBox.php">
<?php
class WhBox extends CWidget
{
    public $title = '';
    /**
     * @var string
     * The class icon to display in the header title of the box.
     * @see <http://twitter.github.com/bootstrap/base-css.html#icon>
     */
    public $headerIcon;
    /**
     * @var string
     * Box Content
     * optional, the content of this attribute is echoed as the box content
     */
    public $content = '';
    /**
     * @var array
     * box HTML additional attributes
     */
    public $htmlOptions = array();
    /**
     * @var array
     * box header HTML additional attributes
     */
    public $htmlHeaderOptions = array();
    /**
     * @var array
     * box content HTML additional attributes
     */
... (106 lines truncated)
</file>

<file path="application/extensions/yiiwheels/widgets/buttongroup/WhButtonGroup.php">
<?php
class WhButtonGroup extends CInputWidget
{
    public $selectOptions = array();
    public $htmlOptions = array();
    public function init()
    {
        $this->attachBehavior('ywplugin', array('class' => 'yiiwheels.behaviors.WhPlugin'));
        $this->registerClientScript();
    }
    public function run()
    {
        $this->renderButtons();
    }
    public function renderButtons()
    {
        list($name, $id) = $this->resolveNameID();
        $html_array = $this->htmlOptions;
        $html_array['class'] = isset($html_array['class']) ? $html_array['class'] . " btn-group" : "btn-group";
        $html_array['id'] = $name;
        $html_array['role'] = 'group';
        $html_array['aria-label'] = 'Administrator button group';
        echo CHtml::openTag('div', $html_array) . "\n";
        $i = 1;
        foreach ($this->selectOptions as $value => $caption) {
            echo CHtml::radioButton(
                $name,
                $value == $this->value,
                array(
                    'name'  => $name,
... (25 lines truncated)
</file>

<file path="application/extensions/yiiwheels/widgets/datepicker/WhDatePicker.php">
<?php
Yii::import('yiistrap_fork.helpers.TbHtml');
Yii::import('yiistrap_fork.helpers.TbArray');
class WhDatePicker extends CInputWidget
{
    public $pluginOptions = array();
    public $events = array();
    public function init()
    {
        $this->attachBehavior('ywplugin', array('class' => 'yiiwheels.behaviors.WhPlugin'));
        TbArray::defaultValue('autocomplete', 'off', $this->htmlOptions);
        TbHtml::addCssClass('grd-white', $this->htmlOptions);
        $this->initOptions();
    }
    public function initOptions()
    {
        TbArray::defaultValue('format', 'mm/dd/yyyy', $this->pluginOptions);
        TbArray::defaultValue('autoclose', true, $this->pluginOptions);
    }
    public function run()
    {
        $this->renderField();
        $this->registerClientScript();
    }
    public function renderField()
    {
        list($name, $id) = $this->resolveNameID();
        TbArray::defaultValue('id', $id, $this->htmlOptions);
        TbArray::defaultValue('name', $name, $this->htmlOptions);
        if ($this->hasModel()) {
... (24 lines truncated)
</file>

<file path="application/extensions/yiiwheels/widgets/daterangepicker/WhDateRangePicker.php">
<?php
Yii::import('yiistrap_fork.helpers.TbArray');
class WhDateRangePicker extends CInputWidget
{
    public $selector;
    public $callback;
    public $pluginOptions = array();
    public function init()
    {
        $this->attachBehavior('ywplugin', array('class' => 'yiiwheels.behaviors.WhPlugin'));
        $this->htmlOptions['id'] = TbArray::getValue('id', $this->htmlOptions, $this->getId());
    }
    public function run()
    {
        $this->renderField();
        $this->registerClientScript();
    }
    public function renderField()
    {
        if (null === $this->selector) {
            list($name, $id) = $this->resolveNameID();
            if ($this->hasModel()) {
                echo TbHtml::activeTextField($this->model, $this->attribute, $this->htmlOptions);
            } else {
                echo TbHtml::textField($name, $this->value, $this->htmlOptions);
            }
            $this->setLocaleSettings();
        }
    }
    private function setLocaleSettings()
... (40 lines truncated)
</file>

<file path="application/extensions/yiiwheels/widgets/datetimepicker/WhDateTimePicker.php">
<?php
Yii::import('yiistrap_fork.helpers.TbArray');
class WhDateTimePicker extends CInputWidget
{
    public $selector;
    public $format = 'dd/MM/yyyy hh:mm:ss';
    public $iconTime = 'icon-time';
    public $iconDate = 'icon-calendar';
    public $pluginOptions = array();
    public $events = array();
    public function init()
    {
        $this->attachBehavior('ywplugin', array('class' => 'yiiwheels.behaviors.WhPlugin'));
        $this->htmlOptions['id'] = TbArray::getValue('id', $this->htmlOptions, $this->getEscapedId());
        foreach ($this->pluginOptions as $key => $pluginOption) {
            if (is_array($pluginOption)) {
                continue;
            }
            $this->htmlOptions['data-' . $key] = $pluginOption;
        }
    }
    public function run()
    {
        $this->renderField();
        $this->registerClientScript();
    }
    public function renderField()
    {
        if (null === $this->selector) {
            $options = array();
... (36 lines truncated)
</file>

<file path="application/extensions/yiiwheels/widgets/detail/WhDetailView.php">
<?php
Yii::import('yiistrap_fork.helpers.TbHtml');
Yii::import('zii.widgets.CDetailView');
class WhDetailView extends CDetailView
{
    public $type = array(TbHtml::GRID_TYPE_STRIPED, TbHtml::GRID_TYPE_CONDENSED);
    public $cssFile = false;
    public function init()
    {
        parent::init();
        $classes = array('table');
        if (isset($this->type) && !empty($this->type)) {
            if (is_string($this->type)) {
                $this->type = explode(' ', $this->type);
            }
            $validTypes = array(
                TbHtml::GRID_TYPE_BORDERED,
                TbHtml::GRID_TYPE_CONDENSED,
                TbHtml::GRID_TYPE_STRIPED,
                TbHtml::GRID_TYPE_HOVER
            );
            foreach ($this->type as $type) {
                if (in_array($type, $validTypes)) {
                    $classes[] = 'table-' . $type;
                }
            }
        }
        TbHtml::addCssClass(implode(' ', $classes), $this->htmlOptions);
    }
}
... (1 lines truncated)
</file>

<file path="application/extensions/yiiwheels/widgets/fileupload/views/download.php">
<!-- The template to display files available for download -->
<script id="template-download" type="text/x-tmpl">
	{% for (var i=0, file; file=o.files[i]; i++) { %}
	<tr class="template-download fade">
		{% if (file.error) { %}
		<td></td>
		<td class="name"><span>{%=file.name%}</span></td>
		<td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td>
		<td class="error" colspan="2"><span class="label label-important">{%=locale.fileupload.error%}</span>
			{%=locale.fileupload.errors[file.error] || file.error%}
		</td>
		{% } else { %}
		<td class="preview">{% if (file.thumbnail_url) { %}
			<a href="{%=file.url%}" title="{%=file.name%}" rel="gallery" download="{%=file.name%}"><img
					src="{%=file.thumbnail_url%}"></a>
			{% } %}
		</td>
		<td class="name">
			<a href="{%=file.url%}" title="{%=file.name%}" rel="{%=file.thumbnail_url&&'gallery'%}"
			   download="{%=file.name%}">{%=file.name%}</a>
		</td>
		<td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td>
		<td colspan="2"></td>
		{% } %}
		<td class="delete">
			<button type="button" class="btn btn-danger" data-type="{%=file.delete_type%}" data-url="{%=file.delete_url%}">
				<i class="icon-trash icon-white"></i>
				<span>{%=locale.fileupload.destroy%}</span>
			</button>
			<input type="checkbox" name="delete" value="1">
... (5 lines truncated)
</file>

<file path="application/extensions/yiiwheels/widgets/fileupload/views/form.php">
<!-- The file upload form used as target for the file upload widget -->
<?php echo CHtml::beginForm($this->url, 'post', $this->htmlOptions); ?>
<div class="fileupload-buttonbar">
    <div class="span7">
        <!-- TODO: What should we do with that one? -->
        <!-- The fileinput-button span is used to style the file input field as button -->
        <span class="btn btn-primary fileinput-button">
            <i class="ri-add-fill icon-white"></i>
            <span>Add files...</span>
            <?php
            if ($this->hasModel()) :
                echo CHtml::activeFileField($this->model, $this->attribute, $htmlOptions) . "\n";
            else :
                    echo CHtml::fileField($name, $this->value, $htmlOptions) . "\n";
            endif;
            ?>
        </span>
        <button
            type="submit"
            class="btn btn-primary start">
            <i class="ri-upload-fill icon-white"></i>
            <span>Start upload</span>
        </button>
        <button
            type="reset"
            class="btn btn-warning cancel">
            <i class="ri-forbid-2-line icon-white"></i>
            <span>Cancel upload</span>
        </button>
        <button
... (25 lines truncated)
</file>

<file path="application/extensions/yiiwheels/widgets/fileupload/views/gallery.php">
<!-- modal-gallery is the modal dialog used for the image gallery -->
<div id="modal-gallery" class="modal modal-gallery hide fade" tabindex="-1">
    <div class="modal-header">
        <a class="btn-close" data-bs-dismiss="modal"></a>
        <h3 class="modal-title"></h3>
    </div>
    <div class="modal-body"><div class="modal-image"></div></div>
    <div class="modal-footer">
        <button
            role="button"
            class="btn btn-primary modal-next">
            Next
            <i class="ri-arrow-right-fill icon-white"></i>
        </button>
        <button
            class="btn btn-info modal-prev"
            type="button">
            <i class="ri-arrow-left-fill icon-white"></i>
             Previous
        </button>
        <button
            class="btn btn-primary modal-play modal-slideshow"
            type="button"
            data-slideshow="5000">
            <i class="icon-play icon-white"></i>
             Slideshow
        </button>
        <a class="btn modal-download" target="_blank"><i class="icon-download"></i> Download</a>
    </div>
</div>
... (1 lines truncated)
</file>

<file path="application/extensions/yiiwheels/widgets/fileupload/views/upload.php">
<!-- The template to display files available for upload -->
<script id="template-upload" type="text/x-tmpl">
	{% for (var i=0, file; file=o.files[i]; i++) { %}
	<tr class="template-upload fade">
		<td class="preview"><span class="fade"></span></td>
		<td class="name"><span>{%=file.name%}</span></td>
		<td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td>
		{% if (file.error) { %}
		<td class="error" colspan="2"><span class="label label-important">{%=locale.fileupload.error%}</span>
			{%=locale.fileupload.errors[file.error] || file.error%}
		</td>
		{% } else if (o.files.valid && !i) { %}
		<td>
			<div class="progress progress-success progress-striped active">
				<div class="bar" style="width:0%;"></div>
			</div>
		</td>
		<td class="start">{% if (!o.options.autoUpload) { %}
			<button type="button" class="btn btn-primary">
				<i class="icon-upload icon-white"></i>
				<span>{%=locale.fileupload.start%}</span>
			</button>
			{% } %}
		</td>
		{% } else { %}
		<td colspan="2"></td>
		{% } %}
		<td class="cancel">{% if (!i) { %}
			<button type="button" class="btn btn-warning">
				<i class="icon-ban-circle icon-white"></i>
... (8 lines truncated)
</file>

<file path="application/extensions/yiiwheels/widgets/fileupload/WhBasicFileUpload.php">
<?php
Yii::import('yiistrap_fork.helpers.TbArray');
class WhBasicFileUpload extends CInputWidget
{
    public $pluginOptions = array();
    public $uploadAction;
    public function init()
    {
        if ($this->uploadAction === null) {
            throw new CException(Yii::t('zii', '"uploadAction" attribute cannot be blank'));
        }
        $this->attachBehavior('ywplugin', array('class' => 'yiiwheels.behaviors.WhPlugin'));
    }
    public function run()
    {
        $this->renderField();
        $this->registerClientScript();
    }
    public function renderField()
    {
        list($name, $id) = $this->resolveNameID();
        TbArray::defaultValue('id', $id, $this->htmlOptions);
        TbArray::defaultValue('name', $name, $this->htmlOptions);
        $this->htmlOptions['data-url'] = $this->uploadAction;
        $this->pluginOptions['url']    = $this->uploadAction;
        if ($this->hasModel()) {
            echo CHtml::activeFileField($this->model, $this->attribute, $this->htmlOptions);
        } else {
            echo CHtml::fileField($name, $this->value, $this->htmlOptions);
        }
... (15 lines truncated)
</file>

<file path="application/extensions/yiiwheels/widgets/fileupload/WhFileUpload.php">
<?php
Yii::import('yiistrap_fork.helpers.TbArray');
Yii::import('zii.widgets.jui.CJuiInputWidget');
class WhFileUpload extends CJuiInputWidget
{
    public $url;
    public $multiple = true;
    public $uploadTemplate;
    public $downloadTemplate;
    public $previewImages = true;
    public $imageProcessing = true;
    public $formView = 'yiiwheels.widgets.fileupload.views.form';
    public $uploadView = 'yiiwheels.widgets.fileupload.views.upload';
    public $downloadView = 'yiiwheels.widgets.fileupload.views.download';
    public $previewImagesView = 'yiiwheels.widgets.fileupload.views.gallery';
    public function init()
    {
        $this->attachBehavior('ywplugin', array('class' => 'yiiwheels.behaviors.WhPlugin'));
        if ($this->uploadTemplate === null) {
            $this->uploadTemplate = "#template-upload";
        }
        if ($this->downloadTemplate === null) {
            $this->downloadTemplate = "#template-download";
        }
        if (!isset($this->htmlOptions['enctype'])) {
            $this->htmlOptions['enctype'] = 'multipart/form-data';
        }
        parent::init();
    }
    public function run()
... (45 lines truncated)
</file>

<file path="application/extensions/yiiwheels/widgets/formhelpers/WhCountries.php">
<?php
Yii::import('yiiwheels.widgets.formhelpers.WhDropDownInputWidget');
class WhCountries extends WhDropDownInputWidget
{
    public function init()
    {
        parent::init();
        TbHtml::addCssClass('bfh-countries', $this->htmlOptions);
        if (!isset($this->htmlOptions['data-country'])) {
            $this->htmlOptions['data-country'] = TbArray::popValue('data-value', $this->htmlOptions);
        }
        unset($this->htmlOptions['data-name'], $this->htmlOptions['data-value']);
    }
    public function run()
    {
        if (!$this->readOnly) {
            echo $this->dropDownList();
        } else {
            echo CHtml::tag('span', $this->htmlOptions, '');
        }
        $this->registerPlugin('bfhcountries');
    }
}
</file>

<file path="application/extensions/yiiwheels/widgets/formhelpers/WhDatePickerHelper.php">
<?php
Yii::import('yiiwheels.widgets.formhelpers.WhInputWidget');
class WhDatePickerHelper extends WhInputWidget
{
    public function init()
    {
        parent::init();
        TbHtml::addCssClass('bfh-datepicker', $this->htmlOptions);
    }
    public function run()
    {
        echo CHtml::tag('div', $this->htmlOptions, '');
        $this->registerPlugin('bfhdatepicker');
    }
}
</file>

<file path="application/extensions/yiiwheels/widgets/formhelpers/WhDropDownInputWidget.php">
<?php
Yii::import('yiiwheels.widgets.formhelpers.WhInputWidget');
class WhDropDownInputWidget extends WhInputWidget
{
    public $useHelperSelectBox = false;
    protected function dropDownList()
    {
        if (!$this->useHelperSelectBox) {
            return $this->hasModel()
                ? CHtml::activeDropDownList($this->model, $this->attribute, array(), $this->htmlOptions)
                : CHtml::dropDownList($this->name, $this->value, array(), $this->htmlOptions);
        } else {
            ob_start();
            ob_implicit_flush(false);
            try {
                $widget = Yii::createComponent(
                    array(
                        'class' => 'yiiwheels.widgets.formhelpers.WhSelectBox',
                        'model' => $this->model,
                        'attribute' => $this->attribute,
                        'name' => $this->name,
                        'value' => $this->value,
                        'htmlOptions' => $this->htmlOptions,
                    )
                );
                $widget->init();
                $widget->run();
            } catch (Exception $e) {
                ob_end_clean();
                throw $e;
... (6 lines truncated)
</file>

<file path="application/extensions/yiiwheels/widgets/formhelpers/WhFonts.php">
<?php
Yii::import('yiiwheels.widgets.formhelpers.WhDropDownInputWidget');
class WhFonts extends WhDropDownInputWidget
{
    public function init()
    {
        parent::init();
        TbHtml::addCssClass('bfh-fonts', $this->htmlOptions);
        if (!isset($this->htmlOptions['data-font'])) {
            $this->htmlOptions['data-font'] = TbArray::popValue('data-value', $this->htmlOptions);
        }
        unset($this->htmlOptions['data-name'], $this->htmlOptions['data-value']);
    }
    public function run()
    {
        echo $this->dropDownList();
        $this->registerPlugin('bfhfonts');
    }
}
</file>

<file path="application/extensions/yiiwheels/widgets/formhelpers/WhFontSizes.php">
<?php
Yii::import('yiiwheels.widgets.formhelpers.WhDropDownInputWidget');
class WhFontSizes extends WhDropDownInputWidget
{
    public function init()
    {
        parent::init();
        TbHtml::addCssClass('bfh-fontsizes', $this->htmlOptions);
        if (!isset($this->htmlOptions['data-fontsize'])) {
            $this->htmlOptions['data-fontsize'] = TbArray::popValue('data-value', $this->htmlOptions);
        }
        unset($this->htmlOptions['data-name'], $this->htmlOptions['data-value']);
    }
    public function run()
    {
        echo $this->dropDownList();
        $this->registerPlugin('bfhfontsize');
    }
}
</file>

<file path="application/extensions/yiiwheels/widgets/formhelpers/WhGoogleFonts.php">
<?php
Yii::import('yiiwheels.widgets.formhelpers.WhDropDownInputWidget');
class WhGoogleFonts extends WhDropDownInputWidget
{
    public function init()
    {
        parent::init();
        TbHtml::addCssClass('bfh-googlefonts', $this->htmlOptions);
        if (!isset($this->htmlOptions['data-font'])) {
            $this->htmlOptions['data-font'] = TbArray::popValue('data-value', $this->htmlOptions);
        }
        unset($this->htmlOptions['data-name'], $this->htmlOptions['data-value']);
    }
    public function run()
    {
        if (!$this->readOnly) {
            echo $this->dropDownList();
        } else {
            echo CHtml::tag('span', $this->htmlOptions, '');
        }
        $this->registerPlugin('bfhgooglefonts');
    }
}
</file>

<file path="application/extensions/yiiwheels/widgets/formhelpers/WhInputWidget.php">
<?php
Yii::import('yiistrap_fork.helpers.TbArray');
Yii::import('yiistrap_fork.helpers.TbHtml');
class WhInputWidget extends CInputWidget
{
    public $pluginOptions = array();
    public $clientEvents = array();
    public $language;
    public $languagePath;
    public $readOnly = false;
    public function init()
    {
        parent::init();
        if (!$this->hasModel() && $this->name === null) {
            throw new CException("Either 'name', or 'model' and 'attribute' properties must be specified.");
        }
        if (!isset($this->htmlOptions['id'])) {
            $this->htmlOptions['id'] = $this->hasModel()
                ? CHtml::activeId($this->model, $this->attribute)
                : $this->getId();
        }
        $this->attachBehavior('ywplugin', array('class' => 'yiiwheels.behaviors.WhPlugin'));
        $this->htmlOptions = TbArray::merge($this->asDataAttributes($this->pluginOptions), $this->htmlOptions);
        $this->pluginOptions = false;
        if ($this->hasModel()) {
            $this->htmlOptions['data-name'] = CHtml::activeId($this->model, $this->attribute);
            $this->htmlOptions['data-value'] = CHtml::value($this->model, $this->attribute);
        } else {
            $this->htmlOptions['data-name'] = $this->name;
            $this->htmlOptions['data-value'] = $this->value;
... (39 lines truncated)
</file>

<file path="application/extensions/yiiwheels/widgets/formhelpers/WhLanguages.php">
<?php
Yii::import('yiiwheels.widgets.formhelpers.WhDropDownInputWidget');
class WhLanguages extends WhDropDownInputWidget
{
    public function init()
    {
        parent::init();
        TbHtml::addCssClass('bfh-languages', $this->htmlOptions);
        if (!isset($this->htmlOptions['data-timezone'])) {
            $this->htmlOptions['data-timezone'] = TbArray::popValue('data-value', $this->htmlOptions);
        }
        unset($this->htmlOptions['data-name'], $this->htmlOptions['data-value']);
    }
    public function run()
    {
        if (!$this->readOnly) {
            echo $this->dropDownList();
        } else {
            echo CHtml::tag('span', $this->htmlOptions, '');
        }
        $this->registerPlugin('bfhtimezones');
    }
}
</file>

<file path="application/extensions/yiiwheels/widgets/formhelpers/WhPhone.php">
<?php
Yii::import('yiiwheels.widgets.formhelpers.WhInputWidget');
class WhPhone extends WhInputWidget
{
    public $format = false;
    public function init()
    {
        parent::init();
        TbHtml::addCssClass('bfh-phone', $this->htmlOptions);
        $this->htmlOptions['data-format'] = $this->format;
        unset($this->htmlOptions['data-name'], $this->htmlOptions['data-value']);
    }
    public function run()
    {
        if (!$this->readOnly) {
            echo $this->hasModel()
                ? CHtml::activeTextField($this->model, $this->attribute, $this->htmlOptions)
                : CHtml::textField($this->name, $this->value, $this->htmlOptions);
        } else {
            $this->htmlOptions['data-number'] = $this->hasModel()
                ? $this->model->{$this->attribute}
                : $this->value;
            echo CHtml::tag('span', $this->htmlOptions, '');
        }
        $this->registerPlugin('bfhphone');
    }
}
</file>

<file path="application/extensions/yiiwheels/widgets/formhelpers/WhSelectBox.php">
<?php
Yii::import('yiiwheels.widgets.formhelpers.WhInputWidget');
class WhSelectBox extends WhInputWidget
{
    public $data = array();
    public function init()
    {
        parent::init();
        TbHtml::addCssClass('bfh-selectbox', $this->htmlOptions);
    }
    public function run()
    {
        $input[] = CHtml::openTag('div', $this->htmlOptions);
        foreach ($this->data as $key => $value) {
            $input[] = CHtml::tag('div', array('data-value' => (string)$key), (string)$value);
        }
        $input[] = CHtml::closeTag('div');
        echo implode("\n", $input);
        $this->registerPlugin('bfhselectbox');
    }
}
</file>

<file path="application/extensions/yiiwheels/widgets/formhelpers/WhStates.php">
<?php
Yii::import('yiiwheels.widgets.formhelpers.WhDropDownInputWidget');
class WhStates extends WhDropDownInputWidget
{
    public $country;
    public function init()
    {
        if (empty($this->country)) {
            throw new CException('"$country" cannot be empty.');
        }
        $this->pluginOptions['country'] = $this->country;
        parent::init();
        TbHtml::addCssClass('bfh-states', $this->htmlOptions);
        if (!isset($this->htmlOptions['data-state'])) {
            $this->htmlOptions['data-state'] = TbArray::popValue('data-value', $this->htmlOptions);
        }
        unset($this->htmlOptions['data-name'], $this->htmlOptions['data-value']);
    }
    public function run()
    {
        if (!$this->readOnly) {
            echo $this->dropDownList();
        } else {
            echo CHtml::tag('span', $this->htmlOptions, '');
        }
        $this->registerPlugin('bfhstates');
    }
}
</file>

<file path="application/extensions/yiiwheels/widgets/formhelpers/WhTimePickerHelper.php">
<?php
Yii::import('yiiwheels.widgets.formhelpers.WhInputWidget');
class WhTimePickerHelper extends WhInputWidget
{
    public function init()
    {
        parent::init();
        TbHtml::addCssClass('bfh-timepicker', $this->htmlOptions);
    }
    public function run()
    {
        echo CHtml::tag('div', $this->htmlOptions, '');
        $this->registerPlugin('bfhtimepicker');
    }
}
</file>

<file path="application/extensions/yiiwheels/widgets/formhelpers/WhTimezones.php">
<?php
Yii::import('yiiwheels.widgets.formhelpers.WhDropDownInputWidget');
class WhTimezones extends WhDropDownInputWidget
{
    public $country;
    public function init()
    {
        if (empty($this->country) && !isset($this->pluginOptions['country'])) {
            throw new CException('"$country" cannot be empty.');
        }
        $this->pluginOptions['country'] = TbArray::getValue('country', $this->pluginOptions, $this->country);
        parent::init();
        TbHtml::addCssClass('bfh-timezones', $this->htmlOptions);
        unset($this->htmlOptions['data-name']);
    }
    public function run()
    {
        if (!$this->readOnly) {
            echo $this->dropDownList();
        } else {
            echo CHtml::tag('span', $this->htmlOptions, '');
        }
        $this->registerPlugin('bfhcountries');
    }
}
</file>

<file path="application/extensions/yiiwheels/widgets/google/WhVisualizationChart.php">
<?php
class WhVisualizationChart extends CWidget
{
    public $containerId;
    public $visualization;
    public $data = array();
    public $options = array();
    public $htmlOptions = array();
    public function run()
    {
        $id                      = $this->getId();
        if ($this->containerId == null) {
            $this->htmlOptions['id'] = 'div-chart' . $id;
            $this->containerId = $this->htmlOptions['id'];
            echo '<div ' . CHtml::renderAttributes($this->htmlOptions) . '></div>';
        }
        $this->registerClientScript();
    }
    public function registerClientScript()
    {
        $id        = $this->getId();
        $jsData    = CJavaScript::jsonEncode($this->data);
        $jsOptions = CJavaScript::jsonEncode($this->options);
        $script = '
			google.setOnLoadCallback(drawChart' . $id . ');
			var ' . $id . '=null;
			function drawChart' . $id . '() {
				var data = google.visualization.arrayToDataTable(' . $jsData . ');
				var options = ' . $jsOptions . ';
				' . $id . ' = new google.visualization.' . $this->visualization . '(document.getElementById("' . $this->containerId . '"));
... (13 lines truncated)
</file>

<file path="application/extensions/yiiwheels/widgets/grid/actions/WhToggleAction.php">
<?php
class WhToggleAction extends CAction
{
    public $modelName;
    public $exceptionOnNullModel = true;
    public $additionalCriteriaOnLoadModel = array();
    public $redirectRoute;
    public $yesValue = 1;
    public $noValue = 0;
    public $ajaxResponseOnSuccess = 1;
    public $ajaxResponseOnFailed = 0;
    public function run($id, $attribute)
    {
        if (Yii::app()->getRequest()->isPostRequest) {
            $model             = $this->loadModel($id);
            $model->$attribute = ($model->$attribute == $this->noValue) ? $this->yesValue : $this->noValue;
            $success           = $model->save(false, array($attribute));
            if (Yii::app()->getRequest()->isAjaxRequest) {
                echo $success ? $this->ajaxResponseOnSuccess : $this->ajaxResponseOnFailed;
                exit(0);
            }
            if ($this->redirectRoute !== null) {
                $this->getController()->redirect($this->redirectRoute);
            }
        } else {
            throw new CHttpException(Yii::t('zii', 'Invalid request'));
        }
    }
    protected function loadModel($id)
    {
... (22 lines truncated)
</file>

<file path="application/extensions/yiiwheels/widgets/grid/behaviors/WhChart.php">
<?php
class WhChart extends CBehavior
{
    public function getGrid()
    {
        return $this->getOwner();
    }
    public function renderChartControlButtons()
    {
        echo '<div class="row-fluid">';
        echo TbHtml::buttonGroup(array(
            array(
                'label' => Yii::t('zii', 'Display Grid'),
                'url' => '#',
                'htmlOptions' => array('class' => 'active ' . $this->grid->getId() . '-grid-control grid')
            ),
            array(
                'label' => Yii::t('zii', 'Display Chart'),
                'url' => '#',
                'htmlOptions' => array('class' => $this->grid->getId() . '-grid-control chart')
            ),
        ), array('toggle' => TbHtml::BUTTON_TOGGLE_RADIO, 'style' => 'margin-bottom:5px', 'class' => 'pull-right'));
        echo '</div>';
    }
    public function registerChartControlButtonsScript()
    {
        $chartId = preg_replace('[-\\ ?]', '_', 'xyzChart' . $this->grid->getId());
        $this->grid->componentsReadyScripts[] = '$(document).on("click",".' . $this->grid->getId() . '-grid-control", function(){
			if ($(this).hasClass("grid") && $("#' . $this->grid->getId() . ' #' . $chartId . '").is(":visible"))
			{
... (88 lines truncated)
</file>

<file path="application/extensions/yiiwheels/widgets/grid/behaviors/WhResponsive.php">
<?php
class WhResponsive extends CBehavior
{
    public $responsiveTable = false;
    public function writeResponsiveCss($columns, $gridId)
    {
        $cnt = 1;
        $labels = '';
        foreach ($columns as $column) {
            /** @var WhDataColumn $column */
            ob_start();
            $column->renderHeaderCell();
            $name = strip_tags(ob_get_clean());
            $labels .= "#$gridId td:nth-of-type($cnt):before { content: '{$name}'; }\n";
            $cnt++;
        }
        $css = <<<EOD
@media
	only screen and (max-width: 760px),
	(min-device-width: 768px) and (max-device-width: 1024px)  {
		/* Force table to not be like tables anymore */
		#{$gridId} table,#{$gridId} thead,#{$gridId} tbody,#{$gridId} th,#{$gridId} td,#{$gridId} tr {
			display: block;
		}
		/* Hide table headers (but not display: none;, for accessibility) */
		#{$gridId} thead tr {
			position: absolute;
			top: -9999px;
			left: -9999px;
		}
... (32 lines truncated)
</file>

<file path="application/extensions/yiiwheels/widgets/grid/operations/WhCountOfTypeOperation.php">
<?php
Yii::import('yiiwheels.widgets.grid.operations.WhOperation');
class WhCountOfTypeOperation extends WhOperation
{
    public $template = '{label}: {types}';
    public $typeTemplate = '{label}({value})';
    public $types = array();
    public function init()
    {
        if (empty($this->types)) {
            throw new CException(Yii::t(
                'zii',
                '"{attribute}" attribute must be defined',
                array('{attribute}' => 'types')
            ));
        }
        foreach ($this->types as $type) {
            if (!isset($type['label'])) {
                throw new CException(Yii::t('zii', 'The "label" of a type must be defined.'));
            }
        }
        parent::init();
    }
    public function processValue($value)
    {
        $clean = strip_tags((string) $value);
        if (array_key_exists($clean, $this->types)) {
            if (!isset($this->types[$clean]['value'])) {
                $this->types[$clean]['value'] = 0;
            }
... (19 lines truncated)
</file>

<file path="application/extensions/yiiwheels/widgets/grid/operations/WhOperation.php">
<?php
abstract class WhOperation extends CWidget
{
    public $template = '{label}: {value}';
    public $value = 0;
    public $label;
    public $column;
    public function init()
    {
        if (null == $this->column) {
            throw new CException(Yii::t(
                'zii',
                '"{attribute}" attribute must be defined',
                array('{attribute}' => 'column')
            ));
        }
        $this->attachBehavior('ywplugin', array('class' => 'yiiwheels.behaviors.WhPlugin'));
    }
    public function run()
    {
        $this->displaySummary();
    }
    abstract public function processValue($value);
    abstract public function displaySummary();
}
</file>

<file path="application/extensions/yiiwheels/widgets/grid/operations/WhPercentOfTypeEasyPieOperation.php">
<?php
Yii::import('yiiwheels.widgets.grid.operations.WhPercentOfTypeOperation');
class WhPercentOfTypeEasyPieOperation extends WhPercentOfTypeOperation
{
    public $chartCssClass = 'bootstrap-operation-easy-pie-chart';
    public $template = '<div style="clear:both">{label}: </div>{types}';
    public $typeTemplate = '<div style="float:left;text-align:center;margin:2px"><div class="{class}" data-percent="{value}">{value}%</div><div>{label}</div></div>';
    public $chartOptions = array(
        'barColor' => '#ef1e25',
        'trackColor' => '#f2f2f2',
        'scaleColor' => '#dfe0e0',
        'lineCap' => 'round',
        'lineWidth' => 5,
        'size' => 80,
        'animate' => false,
        'onStart' => 'js:$.noop',
        'onStop' => 'js:$.noop'
    );
    public function init()
    {
        $this->typeTemplate = strtr($this->typeTemplate, array('{class}' => $this->chartCssClass));
        parent::init();
    }
    public function displaySummary()
    {
        parent::displaySummary();
        $this->registerClientScripts();
    }
    protected function registerClientScripts()
    {
... (18 lines truncated)
</file>

<file path="application/extensions/yiiwheels/widgets/grid/operations/WhPercentOfTypeGooglePieOperation.php">
<?php
Yii::import('yiiwheels.widgets.grid.operations.WhPercentOfTypeOperation');
class WhPercentOfTypeGooglePieOperation extends WhPercentOfTypeOperation
{
    public $chartCssClass = 'bootstrap-operation-google-pie-chart';
    public $chartOptions = array(
        'title' => 'Google Pie Chart'
    );
    protected $data = array();
    public function displaySummary()
    {
        $this->data[] = array('Label', 'Percent');
        foreach ($this->types as $type) {
            if (!isset($type['value'])) {
                $type['value'] = 0;
            }
            $this->data[] = $this->getTotal() ? array(
                $type['label'],
                (float)number_format(($type['value'] / $this->getTotal()) * 100, 1)
            ) : 0;
        }
        $data = CJavaScript::jsonEncode($this->data);
        $options = CJavaScript::jsonEncode($this->chartOptions);
        echo "<div id='{$this->id}' class='{$this->chartCssClass}' data-data='{$data}' data-options='{$options}'></div>";
        $this->registerClientScript();
    }
    public function registerClientScript()
    {
        $chart = Yii::createComponent(
            array(
... (17 lines truncated)
</file>

<file path="application/extensions/yiiwheels/widgets/grid/operations/WhPercentOfTypeOperation.php">
<?php
Yii::import('yiiwheels.widgets.grid.operations.WhCountOfTypeOperation');
class WhPercentOfTypeOperation extends WhCountOfTypeOperation
{
    public $typeTemplate = '{label}({value}%)';
    protected $_total;
    public function displaySummary()
    {
        $typesResults = array();
        foreach ($this->types as $type) {
            if (!isset($type['value'])) {
                $type['value'] = 0;
            }
            $type['value'] = $this->getTotal() ? number_format((float)($type['value'] / $this->getTotal()) * 100, 1)
                : 0;
            $typesResults[] = strtr(
                $this->typeTemplate,
                array('{label}' => $type['label'], '{value}' => $type['value'])
            );
        }
        echo strtr($this->template, array('{label}' => $this->label, '{types}' => implode(' ', $typesResults)));
    }
    protected function getTotal()
    {
        if (null == $this->_total) {
            $this->_total = 0;
            foreach ($this->types as $type) {
                if (isset($type['value'])) {
                    $this->_total += $type['value'];
                }
... (6 lines truncated)
</file>

<file path="application/extensions/yiiwheels/widgets/grid/operations/WhSumOperation.php">
<?php
Yii::import('yiiwheels.widgets.grid.operations.WhOperation');
class WhSumOperation extends WhOperation
{
    protected $total;
    protected $supportedTypes = array('raw', 'text', 'ntext', 'number');
    public function init()
    {
        parent::init();
        if (!in_array($this->column->type, $this->supportedTypes)) {
            throw new CException(Yii::t(
                'zii',
                'Unsupported column type. Supported column types are: "{types}"',
                array(
                    '{types}' => implode(', ', $this->supportedTypes)
                )
            ));
        }
    }
    public function displaySummary()
    {
        echo strtr(
            $this->template,
            array(
                '{label}' => $this->label,
                '{value}' => $this->total === null ? '' : Yii::app()->format->format($this->total, $this->column->type)
            )
        );
    }
    /**
... (22 lines truncated)
</file>

<file path="application/extensions/yiiwheels/widgets/grid/WhGridView.php">
<?php
Yii::import('yiistrap_fork.helpers.TbHtml');
Yii::import('yiistrap_fork.widgets.TbGridView');
class WhGridView extends TbGridView
{
    public $fixedHeader = false;
    public $headerOffset = 0;
    public $template = "{summary}\n{items}\n{pager}\n{extendedSummary}";
    public $extendedSummary = array();
    public $extendedSummaryCssClass = 'extended-summary';
    public $extendedSummaryOptions = array();
    public $componentsAfterAjaxUpdate = array();
    public $componentsReadyScripts = array();
    public $chartOptions = array();
    public $responsiveTable = false;
    protected $displayExtendedSummary;
    protected $extendedSummaryTypes = array();
    protected $extendedSummaryOperations = array(
        'yiiwheels.widgets.grid.operations.WhSumOperation',
        'yiiwheels.widgets.grid.operations.WhCountOfTypeOperation',
        'yiiwheels.widgets.grid.operations.WhPercentOfTypeOperation',
        'yiiwheels.widgets.grid.operations.WhPercentOfTypeEasyPieOperation',
        'yiiwheels.widgets.grid.operations.WhPercentOfTypeGooglePieOperation'
    );
    public function init()
    {
        if (
            preg_match(
                '/extendedsummary/i',
                $this->template
... (239 lines truncated)
</file>

<file path="application/extensions/yiiwheels/widgets/grid/WhGroupGridView.php">
<?php
Yii::import('yiistrap_fork.widgets.TbGridView');
class WhGroupGridView extends TbGridView
{
    const MERGE_SIMPLE = 'simple';
    const MERGE_NESTED = 'nested';
    const MERGE_FIRSTROW = 'firstrow';
    public $mergeColumns = array();
    public $mergeType = self::MERGE_SIMPLE;
    public $mergeCellCss = 'text-align: center; vertical-align: middle';
    public $extraRowColumns = array();
    public $extraRowExpression;
    public $extraRowHtmlOptions = array();
    public $extraRowCssClass = 'extrarow';
    private $_changes;
    public function init()
    {
        parent::init();
        if (!empty($this->extraRowColumns)) {
            foreach ($this->columns as $column) {
                if ($column instanceof CDataColumn && in_array($column->name, $this->extraRowColumns)) {
                    $column->filterHtmlOptions = array('style' => 'display:none');
                    $column->filter = false;
                }
            }
        }
        if (isset($this->extraRowHtmlOptions['class']) && !empty($this->extraRowCssClass)) {
            $this->extraRowHtmlOptions['class'] .= ' ' . $this->extraRowCssClass;
        } else {
            $this->extraRowHtmlOptions['class'] = $this->extraRowCssClass;
... (190 lines truncated)
</file>

<file path="application/extensions/yiiwheels/widgets/grid/WhImageColumn.php">
<?php
Yii::import('zii.widgets.grid.CGridColumn');
class WhImageColumn extends CGridColumn
{
    public $imageOptions = array();
    public $imagePathExpression;
    public $emptyText = '';
    /**
     * @var bool $userPlaceHoldIt whether to use a bogus image from placehold.it or not. If true, will render an image
     * from placehold.it according to the size set at $placeHoldItSize. Defaults to false, now placehold.it only grants
     * access for certain amount of time. You need to ask for permission :(
     */
    public $usePlaceHoldIt = false;
    /**
     * @var bool $userPlaceKitten whether to use bogus image from placekitten.com or not. If true, will render an image
     * from placekitten.com according to the size set at $placeKittenSize. Defaults to true (what can I say? I love kitten)
     */
    public $usePlaceKitten = true;
    /**
     * @var string $placeHoldItSize the size of the image to render if $imagePathExpression is null and $userPlaceHoldIt
     * is set to true
     */
    public $placeHoldItSize = '48x48';
    public $placeKittenSize = '48/48';
    protected function renderDataCellContent($row, $data)
    {
        $content = $this->emptyText;
        if (
            $this->imagePathExpression && $imagePath = $this->evaluateExpression(
                $this->imagePathExpression,
... (17 lines truncated)
</file>

<file path="application/extensions/yiiwheels/widgets/grid/WhRelationalColumn.php">
<?php
Yii::import('yiistrap_fork.widgets.TbDataColumn');
class WhRelationalColumn extends TbDataColumn
{
    public $url;
    public $cssClass = 'wh-relational-column';
    public $cacheData = true;
    public $afterAjaxUpdate;
    public $ajaxErrorMessage = 'Error';
    public function init()
    {
        parent::init();
        if (empty($this->url)) {
            $this->url = Yii::app()->getRequest()->requestUri;
        }
        $this->attachBehavior('ywplugin', array('class' => 'yiiwheels.behaviors.WhPlugin'));
        $this->registerClientScript();
    }
    public function renderDataCell($row)
    {
        $data    = $this->grid->dataProvider->data[$row];
        $options = $this->htmlOptions;
        if ($this->cssClassExpression !== null) {
            $class = $this->evaluateExpression($this->cssClassExpression, array('row' => $row, 'data' => $data));
            if (isset($options['class'])) {
                $options['class'] .= ' ' . $class;
            } else {
                $options['class'] = $class;
            }
        }
... (108 lines truncated)
</file>

<file path="application/extensions/yiiwheels/widgets/grid/WhToggleColumn.php">
<?php
Yii::import('yiistrap_fork.helpers.TbHtml');
Yii::import('yiistrap_fork.widgets.TbDataColumn');
class WhToggleColumn extends TbDataColumn
{
    public $name;
    public $htmlOptions = array('class' => 'toggle-column');
    public $headerHtmlOptions = array('class' => 'toggle-column');
    public $footerHtmlOptions = array('class' => 'toggle-column');
    public $checkedButtonLabel;
    public $uncheckedButtonLabel;
    public $emptyButtonLabel;
    public $checkedIcon = 'fa-ok-circle';
    public $uncheckedIcon = 'fa-remove-sign';
    public $emptyIcon = 'fa-question-sign';
    public $displayText = false;
    public $sortable = true;
    public $filter;
    public $toggleAction = 'toggle';
    public $afterToggle;
    public $uniqueClassSuffix = '';
    /**
     * @var array the configuration for toggle button.
     */
    protected $toggleOptions = array();
    /**
     * Initializes the column.
     * This method registers necessary client script for the button column.
     */
    public function init()
... (89 lines truncated)
</file>

<file path="application/extensions/yiiwheels/widgets/html5editor/WhHtml5Editor.php">
<?php
Yii::import('yiistrap_fork.helpers.TbArray');
class WhHtml5Editor extends CInputWidget
{
    public $lang = 'en';
    public $htmlOptions = array();
    public $pluginOptions = array();
    public $width = '100%';
    public $height = '400px';
    public function init()
    {
        $this->attachBehavior('ywplugin', array('class' => 'yiiwheels.behaviors.WhPlugin'));
        if (!$style = TbArray::popValue('style', $this->htmlOptions, '')) {
            $this->htmlOptions['style'] = $style;
        }
        $width                      = TbArray::getValue('width', $this->htmlOptions, '100%');
        $height                     = TbArray::popValue('height', $this->htmlOptions, '450px');
        $this->htmlOptions['style'] = "width:{$width};height:{$height};" . $this->htmlOptions['style'];
    }
    public function run()
    {
        list($name, $id) = $this->resolveNameID();
        $this->htmlOptions['id'] = $id;
        $this->registerClientScript();
        if (!array_key_exists('style', $this->htmlOptions)) {
            $this->htmlOptions['style'] = "width:{$this->width};height:{$this->height};";
        }
        if ($this->hasModel()) {
            echo CHtml::activeTextArea($this->model, $this->attribute, $this->htmlOptions);
        } else {
... (40 lines truncated)
</file>

<file path="application/extensions/yiiwheels/widgets/maskinput/WhMaskInput.php">
<?php
Yii::import('yiistrap_fork.helpers.TbArray');
class WhMaskInput extends CInputWidget
{
    public $pluginOptions;
    public $mask = '';
    /**
     * Initializes the widget.
     */
    public function init()
    {
        $this->attachBehavior('ywplugin', array('class' => 'yiiwheels.behaviors.WhPlugin'));
    }
    public function run()
    {
        $this->renderField();
        $this->registerClientScript();
    }
    public function renderField()
    {
        list($name, $id) = $this->resolveNameID();
        TbArray::defaultValue('id', $id, $this->htmlOptions);
        TbArray::defaultValue('name', $name, $this->htmlOptions);
        if ($this->hasModel()) {
            echo CHtml::activeTextField($this->model, $this->attribute, $this->htmlOptions);
        } else {
            echo CHtml::textField($this->name, $this->value, $this->htmlOptions);
        }
    }
    public function registerClientScript()
... (12 lines truncated)
</file>

<file path="application/extensions/yiiwheels/widgets/maskmoney/WhMaskMoney.php">
<?php
Yii::import('yiistrap_fork.helpers.TbArray');
class WhMaskMoney extends CInputWidget
{
    public $pluginOptions;
    public function init()
    {
        $this->attachBehavior('ywplugin', array('class' => 'yiiwheels.behaviors.WhPlugin'));
    }
    public function run()
    {
        $this->renderField();
        $this->registerClientScript();
    }
    public function renderField()
    {
        list($name, $id) = $this->resolveNameID();
        TbArray::defaultValue('id', $id, $this->htmlOptions);
        TbArray::defaultValue('name', $name, $this->htmlOptions);
        if ($this->hasModel()) {
            echo CHtml::activeTextField($this->model, $this->attribute, $this->htmlOptions);
        } else {
            echo CHtml::textField($this->name, $this->value, $this->htmlOptions);
        }
    }
    public function registerClientScript()
    {
        $path      = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'assets';
        $assetsUrl = $this->getAssetsUrl($path);
        $cs = Yii::app()->getClientScript();
... (6 lines truncated)
</file>

<file path="application/extensions/yiiwheels/widgets/modal/WhModal.php">
<?php
class WhModal extends TbModal
{
    public function init()
    {
        parent::init();
        $this->attachBehavior('ywplugin', array('class' => 'yiiwheels.behaviors.WhPlugin'));
    }
    public function run()
    {
        parent::run();
        $this->registerPluginFiles();
    }
    public function registerPluginFiles()
    {
        $path = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'assets';
        $assetsUrl = $this->getAssetsUrl($path);
        $cs = Yii::app()->getClientScript();
        $cs->registerCssFile($assetsUrl . '/css/bootstrap-modal.css');
        $cs->registerScriptFile($assetsUrl . '/js/bootstrap-modal.js', CClientScript::POS_END);
        $cs->registerScriptFile($assetsUrl . '/js/bootstrap-modalmanager.js', CClientScript::POS_END);
    }
}
</file>

<file path="application/extensions/yiiwheels/widgets/multiselect/WhMultiSelect.php">
<?php
Yii::import('yiistrap_fork.helpers.TbArray');
class WhMultiSelect extends CInputWidget
{
    public $data = array();
    public $events = array();
    public $pluginOptions;
    public function init()
    {
        if (empty($this->data)) {
            throw new CException(Yii::t('zii', '"data" attribute cannot be blank'));
        }
        $this->attachBehavior('ywplugin', array('class' => 'yiiwheels.behaviors.WhPlugin'));
    }
    public function run()
    {
        $this->renderField();
        $this->registerClientScript();
    }
    public function renderField()
    {
        list($name, $id) = $this->resolveNameID();
        TbArray::defaultValue('id', $id, $this->htmlOptions);
        TbArray::defaultValue('name', $name, $this->htmlOptions);
        $this->htmlOptions['multiple'] = 'multiple';
        if ($this->hasModel()) {
            echo CHtml::activeDropDownList($this->model, $this->attribute, $this->data, $this->htmlOptions);
        } else {
            echo CHtml::dropDownList($this->name, $this->value, $this->data, $this->htmlOptions);
        }
... (13 lines truncated)
</file>

<file path="application/extensions/yiiwheels/widgets/rangeslider/WhRangeSlider.php">
<?php
Yii::import('yiistrap_fork.helpers.TbArray');
class WhRangeSlider extends CInputWidget
{
    public $type = 'range';
    public $arrows = true;
    public $minValue = 0;
    public $maxValue = 100;
    public $minDefaultValue = 0;
    public $maxDefaultValue = 100;
    public $delayOut;
    public $durationIn;
    public $durationOut;
    public $formatter;
    public $minRange = 0;
    public $maxRange = 100;
    public $step;
    public $inputType = 'text';
    public $valueLabels = 'show';
    public $wheelMode;
    public $wheelSpeed;
    public $scales;
    public $events;
    public $theme = 'iThing';
    public $pluginOptions = array();
    protected $options;
    public function init()
    {
        $this->checkOptionAttribute($this->type, array('range', 'editRange', 'dateRange'), 'type');
        $this->checkOptionAttribute($this->inputType, array('text', 'number'), 'inputType');
... (113 lines truncated)
</file>

<file path="application/extensions/yiiwheels/widgets/redactor/license.md">
WhRedactor widget
=================
The Redactor WYSIWYG widget is free software. Every part of this
project except `assets` directory is released under the terms of the following
BSD License.
license http://www.opensource.org/licenses/bsd-license.php New BSD License

Copyright ©; by 2amigos.us 2013-

Imperavi Redactor
=================

Redactor that is located at `assets` directory is not an open-source product but
a proprietary commercial copyrighted software. Yii community bought OEM license
for it so you are free to use it if you are using Yii.
</file>

<file path="application/extensions/yiiwheels/widgets/redactor/WhRedactor.php">
<?php
Yii::import('yiistrap_fork.helpers.TbArray');
class WhRedactor extends CInputWidget
{
    public $pluginOptions = array();
    public $debugMode = false;
    public function init()
    {
        $this->attachBehavior('ywplugin', array('class' => 'yiiwheels.behaviors.WhPlugin'));
        if (!$style = TbArray::popValue('style', $this->htmlOptions, '')) {
            $this->htmlOptions['style'] = $style;
        }
        $width                      = TbArray::getValue('width', $this->htmlOptions, '100%');
        $height                     = TbArray::popValue('height', $this->htmlOptions, '450px');
        $this->htmlOptions['style'] = "width:{$width};height:{$height};" . $this->htmlOptions['style'];
    }
    public function run()
    {
        $this->renderField();
        $this->registerClientScript();
    }
    public function renderField()
    {
        list($name, $id) = $this->resolveNameID();
        TbArray::defaultValue('id', $id, $this->htmlOptions);
        TbArray::defaultValue('name', $name, $this->htmlOptions);
        if ($this->hasModel()) {
            echo CHtml::activeTextArea($this->model, $this->attribute, $this->htmlOptions);
        } else {
            echo CHtml::textArea($name, $this->value, $this->htmlOptions);
... (43 lines truncated)
</file>

<file path="application/extensions/yiiwheels/widgets/select2/WhSelect2.php">
<?php
Yii::import('yiistrap_fork.helpers.TbArray');
class WhSelect2 extends CInputWidget
{
    public $data = array();
    public $events = array();
    public $asDropDownList = true;
    public $language;
    public $pluginOptions;
    public function init()
    {
        $this->attachBehavior('ywplugin', array('class' => 'yiiwheels.behaviors.WhPlugin'));
    }
    public function run()
    {
        $this->renderField();
        $this->registerClientScript();
    }
    public function renderField()
    {
        list($name, $id) = $this->resolveNameID();
        TbArray::defaultValue('id', $id, $this->htmlOptions);
        TbArray::defaultValue('name', $name, $this->htmlOptions);
        if ($this->hasModel()) {
            echo $this->asDropDownList ?
                TbHtml::activeDropDownList($this->model, $this->attribute, $this->data, $this->htmlOptions) :
                TbHtml::activeHiddenField($this->model, $this->attribute);
        } else {
            echo $this->asDropDownList ?
                TbHtml::dropDownList($this->name, $this->value, $this->data, $this->htmlOptions) :
... (25 lines truncated)
</file>

<file path="application/extensions/yiiwheels/widgets/sparklines/WhSparklines.php">
<?php
Yii::import('yiistrap_fork.helpers.TbArray');
class WhSparkLines extends CWidget
{
    public $tagName = 'div';
    public $data = array();
    public $htmlOptions = array();
    public $pluginOptions = array();
    public $debugMode = false;
    public function init()
    {
        if (empty($this->data)) {
            throw new CException(Yii::t('zii', '"data" attribute cannot be blank'));
        }
        $this->attachBehavior('ywplugin', array('class' => 'yiiwheels.behaviors.WhPlugin'));
        $this->htmlOptions['id'] = TbArray::getValue('id', $this->htmlOptions, $this->getId());
    }
    public function run()
    {
        echo CHtml::openTag($this->tagName, $this->htmlOptions);
        echo CHtml::closeTag($this->tagName);
        $this->registerClientScript();
    }
    public function registerClientScript()
    {
        $path      = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'assets';
        $assetsUrl = $this->getAssetsUrl($path);
        $cs = Yii::app()->getClientScript();
        $script = $this->debugMode
            ? 'jquery.sparkline.js'
... (10 lines truncated)
</file>

<file path="application/extensions/yiiwheels/widgets/switch/WhSwitch.php">
<?php
Yii::import('yiistrap_fork.helpers.TbArray');
Yii::import('yiistrap_fork.helpers.TbHtml');
class WhSwitch extends CInputWidget
{
    public $inputType = 'checkbox';
    public $size = 'small';
    public $onColor = 'primary';
    public $offColor = 'warning';
    public $animated = true;
    public $onLabel;
    public $offLabel;
    public $textLabel;
    public $events = array();
    public $debugMode = false;
    public function init()
    {
        if (!in_array($this->inputType, array('radio', 'checkbox'))) {
            throw new CException(Yii::t('zii', '"inputType" attribute must be of type "radio" or "checkbox"'));
        }
        if (!in_array($this->size, array('mini', 'small', 'normal', 'large'))) {
            throw new CException(Yii::t('zii', 'Unknown value for attribute "size".'));
        }
        $this->attachBehavior('ywplugin', array('class' => 'yiiwheels.behaviors.WhPlugin'));
        if (!$this->animated) {
            $this->htmlOptions['data-animate'] = 'false';
        }
        if (!isset($this->htmlOptions['uncheckValue'])) {
            $this->htmlOptions['uncheckValue'] = '0';
        }
... (33 lines truncated)
</file>

<file path="application/extensions/yiiwheels/widgets/timeago/WhTimeAgo.php">
<?php
Yii::import('yiistrap_fork.helpers.TbArray');
class WhTimeAgo extends CWidget
{
    public $tagName = 'abbr';
    public $htmlOptions = array();
    public $pluginOptions = array();
    public $language = 'en';
    public $selector;
    public $date;
    public function init()
    {
        $this->attachBehavior('ywplugin', array('class' => 'yiiwheels.behaviors.WhPlugin'));
        $this->htmlOptions['id'] = TbArray::getValue('id', $this->htmlOptions, $this->getId());
        if (!$this->selector) {
            $this->selector = '#' . TbArray::getValue('id', $this->htmlOptions);
        }
    }
    public function run()
    {
        if (null !== $this->date) {
            $this->htmlOptions['title'] = $this->date;
            echo CHtml::tag($this->tagName, $this->htmlOptions, '&nbsp;');
        }
        $this->registerClientScript();
    }
    public function registerClientScript()
    {
        $path      = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'assets';
        $assetsUrl = $this->getAssetsUrl($path);
... (9 lines truncated)
</file>

<file path="application/extensions/yiiwheels/widgets/timeago/WhTimeAgoFormatter.php">
<?php
class WhTimeAgoFormatter extends CFormatter
{
    public $locale;
    public $allowFuture = true;
    private $data;
    public function init()
    {
        if (empty($this->locale)) {
            $this->locale = Yii::app()->language;
        }
        $this->setLocale($this->locale);
        parent::init();
    }
    private function setLocale($locale)
    {
        $path = __DIR__ . DIRECTORY_SEPARATOR .
            'assets' . DIRECTORY_SEPARATOR .
            'php' . DIRECTORY_SEPARATOR .
            'locale' . DIRECTORY_SEPARATOR . $locale . '.php';
        if (!file_exists($path)) {
            $this->locale = 'en';
            $path         = __DIR__ . DIRECTORY_SEPARATOR .
                'assets' . DIRECTORY_SEPARATOR .
                'php' . DIRECTORY_SEPARATOR .
                'locale' . DIRECTORY_SEPARATOR . $this->locale . '.php';
        }
        $this->data = require_once($path);
    }
    public function formatTimeago($value)
... (64 lines truncated)
</file>

<file path="application/extensions/yiiwheels/widgets/timepicker/WhTimePicker.php">
<?php
Yii::import('yiistrap_fork.helpers.TbArray');
class WhTimePicker extends CInputWidget
{
    public $pluginOptions = array();
    public $events = array();
    public $htmlOptions = array();
    public function init()
    {
        $this->attachBehavior('ywplugin', array('class' => 'yiiwheels.behaviors.WhPlugin'));
        TbHtml::addCssClass('form-control', $this->htmlOptions);
    }
    public function run()
    {
        $this->renderField();
        $this->registerClientScript();
    }
    public function renderField()
    {
        list($name, $id) = $this->resolveNameID();
        TbArray::defaultValue('id', $id, $this->htmlOptions);
        TbArray::defaultValue('name', $name, $this->htmlOptions);
        echo '<div class="input-group">';
        echo '<div class="input-group-text"><span class="fa fa-time"></span></div>';
        if ($this->hasModel()) {
            echo CHtml::activeTextField($this->model, $this->attribute, $this->htmlOptions);
        } else {
            echo CHtml::textField($name, $this->value, $this->htmlOptions, array('style' => 'width:100%'));
        }
        echo '</div>';
... (14 lines truncated)
</file>

<file path="application/extensions/yiiwheels/widgets/typeahead/WhTypeAhead.php">
<?php
Yii::import('yiistrap_fork.helpers.TbArray');
class WhTypeAhead extends CInputWidget
{
    public $pluginOptions;
    public $debugMode = false;
    public function init()
    {
        $this->attachBehavior('ywplugin', array('class' => 'yiiwheels.behaviors.WhPlugin'));
    }
    public function run()
    {
        $this->renderField();
        $this->registerClientScript();
    }
    public function renderField()
    {
        list($name, $id) = $this->resolveNameID();
        TbArray::defaultValue('id', $id, $this->htmlOptions);
        TbArray::defaultValue('name', $name, $this->htmlOptions);
        TbHtml::addCssClass('form-control', $this->htmlOptions);
        if ($this->hasModel()) {
            echo CHtml::activeTextField($this->model, $this->attribute, $this->htmlOptions);
        } else {
            echo CHtml::textField($this->name, $this->value, $this->htmlOptions);
        }
    }
    public function registerClientScript()
    {
        $path      = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'assets';
... (12 lines truncated)
</file>

<file path="application/extensions/yiiwheels/composer.json">
{
    "name": "2amigos/yiiwheels",
    "description": "Extension library for Yiistrap, Yii Twitter's Bootstrap.",
    "keywords": ["bootstrap", "yii"],
    "type": "yii-extension",
    "license": "BSD-3-Clause",
    "authors": [
        {
            "name": "Antonio Ramirez",
            "email": "ramirez.cobos@gmail.com",
            "homepage": "http://www.ramirezcobos.com/"
        }
    ],
    "repositories": [
        {
            "type": "composer",
            "url": "http://packages.phundament.com"
        }
    ],
    "require": {
        "crisu83/yiistrap": "dev-bs3"
    },
    "require-dev": {
        "php": ">=5.3.0",
        "yiisoft/yii": ">=1.1.13"
    },
    "minimum-stability": "dev"
}
</file>

<file path="application/extensions/yiiwheels/LICENSE.txt">
Copyright (c) 2013, Antonio Ramirez
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

  Redistributions of source code must retain the above copyright notice, this
  list of conditions and the following disclaimer.

  Redistributions in binary form must reproduce the above copyright notice, this
  list of conditions and the following disclaimer in the documentation and/or
  other materials provided with the distribution.

  Neither the name of 2amigOS! Consulting Group, LLC. nor the names of its
  contributors may be used to endorse or promote products derived from
  this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</file>

<file path="application/extensions/yiiwheels/README.md">
[![2amigOS!](http://yiiwheels.2amigos.us/images/logo-navbar.png)](http://www.2amigos.us)
=========  
[![Latest Stable Version](https://poser.pugx.org/2amigos/yiiwheels/v/stable.svg)](https://packagist.org/packages/2amigos/yiiwheels) [![Total Downloads](https://poser.pugx.org/2amigos/yiiwheels/downloads.svg)](https://packagist.org/packages/2amigos/yii2-editable-widget) [![Latest Unstable Version](https://poser.pugx.org/2amigos/yiiwheels/v/unstable.svg)](https://packagist.org/packages/2amigos/yiiwheels) [![License](https://poser.pugx.org/2amigos/yiiwheels/license.svg)](https://packagist.org/packages/2amigos/yiiwheels)

Yii Wheels (or Wheels) is an extended library for the [YiiStrap](http://getyiistrap.com) extension.

Please, visit [YiiWheels](http://yiiwheels.2amigos.us) site for further documentation of its use.

> [![2amigOS!](http://www.gravatar.com/avatar/55363394d72945ff7ed312556ec041e0.png)](http://www.2amigos.us)    
<i>web development has never been so fun</i>  
[www.2amigos.us](http://www.2amigos.us)
</file>

<file path="application/extensions/yiiwheels/YiiWheels.php">
<?php
class YiiWheels extends CApplicationComponent
{
    public $htmlOptions = array();
    public $assetsJs = array();
    public $assetsCss = array();
    protected $_assetsUrl;
    public function init()
    {
        Yii::import('yiistrap_fork.widgets.*');
        Yii::import('yiiwheels.behaviors.WhPlugin');
        foreach ($this->assetsCss as $css) {
            $this->registerAssetCss($css);
        }
        foreach ($this->assetsJs as $js) {
            $this->registerAssetJs($js);
        }
    }
    public function getAssetsUrl()
    {
        if (isset($this->_assetsUrl)) {
            return $this->_assetsUrl;
        } else {
            $path      = Yii::getPathOfAlias('yiiwheels');
            $assetsUrl = Yii::app()->assetManager->publish(
                $path . DIRECTORY_SEPARATOR . 'assets',
                false,
                -1,
                false
            );
... (15 lines truncated)
</file>

<file path="application/extensions/CallbackColumn.php">
<?php
    Yii::import('zii.widgets.grid.CGridColumn');
class CallbackColumn extends CGridColumn
{
    public $label;
    public $url;
    public function renderDataCellContent($row, $data)
    {
        if (isset($this->label) && is_callable($this->label)) {
            $text = call_user_func($this->label, $data);
        } else {
            $text = $data[$this->label];
        }
        if (isset($this->url)) {
            if (is_callable($this->url)) {
                $url = call_user_func($this->url, $data);
            } else {
                $url = $this->url;
            }
            echo CHtml::link($text, $url);
        } else {
            echo $text;
        }
    }
}
</file>

<file path="application/extensions/CustomFormatter.php">
<?php
class CustomFormatter extends CFormatter
{
    public $longTextMaxLength = 125;
    public function formatLanguageList($value)
    {
        $langArr = explode(' ', trim($value));
        $expandedArr = array();
        foreach ($langArr as $lang) {
            array_push($expandedArr, getLanguageNameFromCode($lang, false));
        }
        sort($expandedArr);
        return implode(', ', $expandedArr);
    }
    public function formatLongText($value)
    {
        if (empty($value)) {
            return $value;
        }
        $originalvalue = $value = CHTML::encode($value);
        if (mb_strlen($value, 'UTF-8') > $this->longTextMaxLength) {
            $value = ellipsize($value, $this->longTextMaxLength);
        }
        $value = '<span class="longtext-content" data-bs-toggle="tooltip" data-bs-placement="left" title="' . $originalvalue . '">' . $value . '</span>';
        return $value;
    }
}
</file>

<file path="application/extensions/GridViewWidget.php">
<?php
    Yii::import('zii.widgets.grid.CGridView');
class GridViewWidget extends CGridView
{
}
</file>

<file path="application/helpers/admin/export/CsvWriter.php">
<?php
class CsvWriter extends Writer
{
    private $output;
    private $separator;
    private $hasOutputHeader;
    private $file = null;
    protected $csvFilename = '';
    /**
     * Should headers be output? For example spss and r export use more or less
     * the same output but do not need headers at all.
     *
     * @var boolean
     */
    protected $doHeaders = true;
    function __construct()
    {
        $this->output = '';
        $this->separator = ';';
        $this->hasOutputHeader = false;
    }
    public function init(SurveyObj $survey, $sLanguageCode, FormattingOptions $oOptions)
    {
        parent::init($survey, $sLanguageCode, $oOptions);
        $this->csvFilename = "results-survey" . $survey->id . ".csv";
        if ($oOptions->output == 'file') {
            $this->file = fopen($this->filename, 'w');
        }
    }
    protected function outputRecord($headers, $values, FormattingOptions $oOptions, $fieldNames = [])
... (61 lines truncated)
</file>

<file path="application/helpers/admin/export/DocWriter.php">
<?php
class DocWriter extends Writer
{
    private $output;
    private $separator;
    private $isBeginning;
    private $file = null;
    public function __construct()
    {
        $this->separator = "\t";
        $this->output = '';
        $this->isBeginning = true;
    }
    public function init(SurveyObj $survey, $sLanguageCode, FormattingOptions $oOptions)
    {
        parent::init($survey, $sLanguageCode, $oOptions);
        App()->setLanguage($sLanguageCode);
        if ($oOptions->output == 'display') {
            header("Content-Disposition: attachment; filename=results-survey" . $survey->id . ".doc");
            header("Content-type: application/vnd.ms-word");
        }
        $sOutput = '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <style>
        table {
        border-collapse:collapse;
        }
        td, th {
        border:solid black 1.0pt;
        }
        th {
... (50 lines truncated)
</file>

<file path="application/helpers/admin/export/ExcelWriter.php">
<?php
class ExcelWriter extends Writer
{
    private $workbook;
    private $currentSheet;
    private $separator;
    private $hasOutputHeader;
    private $rowCounter;
    private $forceDownload = true;
    public function __construct()
    {
        $this->separator = '~|';
        $this->hasOutputHeader = false;
        $this->rowCounter = 0;
    }
    public function init(SurveyObj $survey, $sLanguageCode, FormattingOptions $oOptions)
    {
        parent::init($survey, $sLanguageCode, $oOptions);
        $this->workbook = new XLSXWriter();
        $this->workbook->setTempDir(Yii::app()->getConfig('tempdir'));
        $worksheetName = $survey->languageSettings['surveyls_title'];
        $worksheetName = mb_substr(str_replace(array('*', ':', '/', '\\', '?', '[', ']'), array(' '), (string) $worksheetName), 0, 31, 'utf-8');
        if ($worksheetName == '') {
            $worksheetName = 'survey_' . $survey->id;
        }
        $this->currentSheet = $worksheetName;
        $this->forceDownload = !($oOptions->output == 'file');
    }
    protected function outputRecord($headers, $values, FormattingOptions $oOptions, $fieldNames = [])
    {
... (19 lines truncated)
</file>

<file path="application/helpers/admin/export/FormattingOptions.php">
<?php
class FormattingOptions
{
    public $responseMinRecord;
    public $responseMaxRecord;
    public $aResponses;
    public $selectedColumns;
    public $responseCompletionState;
    public $headingFormat;
    public $headerSpacesToUnderscores;
    public $headingTextLength;
    public $useEMCode;
    public $headCodeTextSeparator;
    public $csvFieldSeparator;
    public $csvMaskEquations = false;
    public $answerFormat;
    public $stripHtmlCode;
    public $convertY;
    public $yValue;
    public $convertN;
    public $nValue;
    public $output;
    public $format;
    public function toString()
    {
        return $this->format . ',' . $this->headingFormat . ','
        . $this->headerSpacesToUnderscores . ',' . $this->responseCompletionState
        . ',' . $this->responseMinRecord . ',' . $this->responseMaxRecord . ',' . $this->aResponses . ','
        . $this->answerFormat . ',' . $this->convertY . ',' . $this->yValue . ','
        . $this->convertN . ',' . $this->nValue . ',' . $this->csvMaskEquations . ','
... (4 lines truncated)
</file>

<file path="application/helpers/admin/export/HtmlWriter.php">
<?php
class HtmlWriter extends Writer
{
    protected $handle = null;
    protected $first = true;
    protected $groupMap = array();
    protected $options;
    protected $survey;
    protected $stack = array();
    public function init(SurveyObj $survey, $sLanguageCode, FormattingOptions $oOptions)
    {
        parent::init($survey, $sLanguageCode, $oOptions);
        $this->survey = $survey;
        if ($oOptions->output == 'display') {
            header("Content-Disposition: attachment; filename=results-survey" . $survey->id . ".html");
            header("Content-type: text/html; charset=UTF-8");
            $this->handle = fopen('php://output', 'w');
        } elseif ($oOptions->output == 'file') {
            $this->handle = fopen($this->filename, 'w');
        }
        $this->groupMap = $this->setGroupMap($survey, $oOptions);
    }
    protected function writeHeader()
    {
        $this->out('<!DOCTYPE html>');
        $this->openTag('html');
        $this->openTag('head');
        $this->tag('meta', array('charset' => 'utf-8'));
        $this->tag('style', 'td { border: 1px solid black }');
        $this->closeTag();
... (91 lines truncated)
</file>

<file path="application/helpers/admin/export/IWriter.php">
<?php
interface IWriter
{
    public function write(SurveyObj $survey, $sLanguageCode, FormattingOptions $oOptions);
    public function close();
}
</file>

<file path="application/helpers/admin/export/JsonWriter.php">
<?php
class JsonWriter extends Writer
{
    private $output;
    private $file = null;
    protected $havePrev = false;
    function __construct()
    {
        $this->output = '';
    }
    public function init(SurveyObj $survey, $sLanguageCode, FormattingOptions $oOptions)
    {
        parent::init($survey, $sLanguageCode, $oOptions);
        $sStartOutput = '{' . json_encode("responses") . ': [';
        if ($oOptions->output == 'display') {
            header("Content-Disposition: attachment; filename=results-survey" . $survey->id . ".json");
            header("Content-type: application/json");
            echo $sStartOutput;
        } elseif ($oOptions->output == 'file') {
            $this->file = fopen($this->filename, 'w');
            if ($this->file !== false) {
                fwrite($this->file, $sStartOutput);
            } else {
                safeDie('Could not open JSON file');
            }
        }
    }
    protected function outputRecord($headers, $values, FormattingOptions $oOptions, $fieldNames = [])
    {
        $uniqueHeaders = [];
... (37 lines truncated)
</file>

<file path="application/helpers/admin/export/PdfWriter.php">
<?php
class PdfWriter extends Writer
{
    private $pdf;
    private $separator;
    private $rowCounter;
    private $pdfDestination;
    private $surveyName;
    private $aGroupMap = array();
    public function init(SurveyObj $survey, $sLanguageCode, FormattingOptions $oOptions)
    {
        parent::init($survey, $sLanguageCode, $oOptions);
        if ($oOptions->output == 'file') {
            $this->pdfDestination = 'F';
        } else {
            $this->pdfDestination = 'D';
        }
        Yii::import('application.libraries.admin.pdf', true);
        Yii::import('application.helpers.pdfHelper');
        $aPdfLanguageSettings = pdfHelper::getPdfLanguageSettings($sLanguageCode);
        $this->pdf = new pdf();
        $this->surveyName = $survey->info['surveyls_title'];
        $this->pdf->initAnswerPDF($survey->info, $aPdfLanguageSettings, Yii::app()->getConfig('sitename'), $this->surveyName);
        $this->separator = "\t";
        $this->rowCounter = 0;
        $this->aGroupMap = $this->setGroupMap($survey, $oOptions);
    }
    public function outputRecord(
        $headers,
        $values,
... (40 lines truncated)
</file>

<file path="application/helpers/admin/export/SurveyDao.php">
<?php
class SurveyDao
{
    public function loadSurveyById($id, $lang = null, ?FormattingOptions $oOptions = null)
    {
        $survey = new SurveyObj();
        $intId = sanitize_int($id);
        $survey->id = $intId;
        $survey->info = getSurveyInfo($survey->id);
        $oSurvey = Survey::model()->findByPk($intId);
        $availableLanguages = $oSurvey->allLanguages;
        if (is_null($lang) || in_array($lang, $availableLanguages) === false) {
            $lang = $oSurvey->language;
        }
        App()->setLanguage($lang);
        $survey->fieldMap = createFieldMap($oSurvey, 'full', true, false, $lang);
        if ($survey->info['savetimings'] == "Y") {
            $survey->fieldMap = $survey->fieldMap + createTimingsFieldMap($intId, 'full', true, false, $lang);
        }
        if (empty($intId)) {
            safeDie("An invalid survey ID was encountered");
        }
        $survey->groups = QuestionGroup::model()->findAll(array("condition" => 'sid=' . $intId, 'order' => 'group_order'));
        $survey->questions = Question::model()->findAll(array("condition" => 'sid=' . $intId, 'order' => 'question_order'));
        $aAnswers = Answer::model()->with('answerl10ns', 'question')->findAll(array('condition' => 'question.sid=' . $intId . ' AND ' . Yii::app()->db->quoteTableName('answerl10ns') . '.language = \'' . $lang . '\'', 'order' => 'question.question_order, t.scale_id'));
        foreach ($aAnswers as $aAnswer) {
            if (!empty($oOptions->stripHtmlCode) && $oOptions->stripHtmlCode == 1) {
                $answer = stripTagsFull($aAnswer->answerl10ns[$lang]->answer);
            } else {
                $answer = $aAnswer->answerl10ns[$lang]->answer;
... (101 lines truncated)
</file>

<file path="application/helpers/admin/export/SurveyObj.php">
<?php
class SurveyObj
{
    public $id;
    public $answers = array();
    public $fieldMap;
    public $groups;
    public $info;
    public $questions;
    public $tokenFields = array();
    public $responses;
    public $languageSettings;
    public function getFullAnswer($fieldName, $answerCode, Translator $translator, $sLanguageCode)
    {
        $fullAnswer = null;
        $fieldType = $this->fieldMap[$fieldName]['type'];
        $question = $this->fieldMap[$fieldName];
        $questionId = $question['qid'];
        $answer = $answerCode;
        if ($questionId && $answerCode !== "" && !is_null($answerCode)) {
            $answers = $this->getAnswers($questionId);
            if (isset($answers[$answerCode])) {
                $answer = $answers[$answerCode];
            }
        }
        //echo "\n$fieldName: $fieldType = $answerCode";
        switch ($fieldType) {
            case Question::QT_K_MULTIPLE_NUMERICAL:
            case Question::QT_N_NUMERICAL:
                $fullAnswer = $answerCode;
... (158 lines truncated)
</file>

<file path="application/helpers/admin/export/Translator.php">
<?php
class Translator
{
    private $translations = array();
    public function translate($key, $sLanguageCode)
    {
        return gT($key, 'html', $sLanguageCode);
    }
    public function getHeaderTranslationKey($column)
    {
        if (isset($this->headerTranslationKeys[$column])) {
            return $this->headerTranslationKeys[$column];
        } else {
            return false;
        }
    }
}
</file>

<file path="application/helpers/admin/export/Writer.php">
<?php
abstract class Writer implements IWriter
{
    protected $sLanguageCode;
    protected $translator;
    public $filename;
    public $languageCode;
    public $webfilename;
    protected function translate($key, $sLanguageCode)
    {
        return $this->translator->translate($key, $sLanguageCode);
    }
    public function init(SurveyObj $oSurvey, $sLanguageCode, FormattingOptions $oOptions)
    {
        $this->languageCode = $sLanguageCode;
        $this->translator = new Translator();
        $this->filename = Yii::app()->getConfig("tempdir") . DIRECTORY_SEPARATOR . randomChars(40);
        $this->webfilename = 'results-survey' . $oSurvey->id;
    }
    public function setGroupMap(SurveyObj $survey, FormattingOptions $oOptions)
    {
        $aGroupMap = array();
        $index = 0;
        foreach ($oOptions->selectedColumns as $column) {
            if (isset($survey->fieldMap[$column])) {
                $question = $survey->fieldMap[$column];
            } else {
                $question = array('gid' => 0, 'qid' => '');
            }
            $question['index'] = $index;
... (183 lines truncated)
</file>

<file path="application/helpers/admin/activate_helper.php">
<?php
function fixNumbering($iQuestionID, $iSurveyID)
{
    Yii::app()->loadHelper("database");
    LimeExpressionManager::RevertUpgradeConditionsToRelevance($iSurveyID);
    $iQuestionID = (int) $iQuestionID;
    $iMaxQID = Question::model()->getMaxId('qid');
    $iNewQID = $iMaxQID + 1;
    $sQuery = "UPDATE {{questions}} SET qid=$iNewQID WHERE qid=$iQuestionID";
    Yii::app()->db->createCommand($sQuery)->query();
    $sQuery = "UPDATE {{questions}} SET parent_qid=$iNewQID WHERE parent_qid=$iQuestionID";
    Yii::app()->db->createCommand($sQuery)->query();
    $sQuery = "UPDATE {{conditions}} SET qid=$iNewQID WHERE qid=$iQuestionID";
    Yii::app()->db->createCommand($sQuery)->query();
    $sQuery = "UPDATE {{defaultvalues}} SET qid=$iNewQID WHERE qid=$iQuestionID";
    Yii::app()->db->createCommand($sQuery)->query();
    $sQuery = "UPDATE {{defaultvalues}} SET sqid=$iNewQID WHERE sqid=$iQuestionID";
    Yii::app()->db->createCommand($sQuery)->query();
    $sQuery = "UPDATE {{quota_members}} SET qid=$iNewQID WHERE qid=$iQuestionID";
    Yii::app()->db->createCommand($sQuery)->query();
    $sQuery = "UPDATE {{survey_url_parameters}} SET targetqid=$iNewQID WHERE targetqid=$iQuestionID";
    Yii::app()->db->createCommand($sQuery)->query();
    $sQuery = "UPDATE {{survey_url_parameters}} SET targetsqid=$iNewQID WHERE targetsqid=$iQuestionID";
    Yii::app()->db->createCommand($sQuery)->query();
    $sQuery = "SELECT cqid, cfieldname FROM {{conditions}} WHERE cqid=$iQuestionID";
    $sResult = Yii::app()->db->createCommand($sQuery)->query();
    foreach ($sResult->readAll() as $row) {
        $aSwitcher[] = array("cqid" => $row['cqid'], "cfieldname" => $row['cfieldname']);
    }
    if (isset($aSwitcher)) {
... (230 lines truncated)
</file>

<file path="application/helpers/admin/ajax_helper.php">
<?php
namespace ls\ajax;
class AjaxHelper
{
    public static function createUrl($route, array $params = array())
    {
        $params['ajax'] = 1;
        return App()->createUrl($route, $params);
    }
    public static function output($msg)
    {
        $output = new JsonOutput($msg);
        self::echoString($output);
    }
    public static function outputSuccess($msg)
    {
        $output = new JsonOutputSuccess($msg);
        self::echoString($output);
    }
    public static function outputError($msg, $code = 0)
    {
        $output = new JsonOutputError($msg, $code);
        self::echoString($output);
    }
    public static function outputNoPermission()
    {
        $output = new JsonOutputNoPermission();
        self::echoString($output);
    }
    public static function outputNotLoggedIn()
... (129 lines truncated)
</file>

<file path="application/helpers/admin/backupdb_helper.php">
<?php
function outputDatabase($sDbName = '', $bEchoOutput = true, $sFileName = null)
{
    if ($sDbName == '') {
        $sDbName = _getDbName();
    }
    $bAllowExportAllDb = (bool) Yii::app()->getConfig('allowexportalldb');
    $sOutput = _outputDBDescription($sDbName, $bAllowExportAllDb);
    if ($bEchoOutput) {
        echo $sOutput;
    }
    if (!is_null($sFileName)) {
        $oFile = fopen($sFileName, 'w');
        if ($oFile === false) {
            safeDie('Could not open output file.');
        } else {
            fwrite($oFile, (string) $sOutput);
        }
    } else {
        $oFile = null;
    }
    _outputDBData($bAllowExportAllDb, $bEchoOutput, $sFileName, $oFile);
    if (!is_null($sFileName) && $oFile !== false) {
        fclose($oFile);
    }
}
function _outputDBDescription($sDbName, $bAllowExportAllDb)
{
    $sOutput = '--' . "\n";
    $sOutput .= '-- LimeSurvey Database Dump of `' . $sDbName . '`' . "\n";
... (148 lines truncated)
</file>

<file path="application/helpers/admin/exportresults_helper.php">
<?php
Yii::import('application.helpers.admin.export.*');
class ExportSurveyResultsService
{
    protected $_exports;
    function exportResponses($iSurveyId, $sLanguageCode, $sExportPlugin, FormattingOptions $oOptions, $sFilter = '')
    {
        //Do some input validation.
        if (empty($iSurveyId)) {
            safeDie('A survey ID must be supplied.');
        }
        if (empty($sLanguageCode)) {
            safeDie('A language code must be supplied.');
        }
        if (empty($oOptions)) {
            safeDie('Formatting options must be supplied.');
        }
        if (empty($oOptions->selectedColumns)) {
            safeDie('At least one column must be selected for export.');
        }
        //echo $oOptions->toString().PHP_EOL;
        $writer = null;
        $iSurveyId = sanitize_int($iSurveyId);
        if ($oOptions->output == 'display') {
            header("Cache-Control: must-revalidate, no-store, no-cache");
        }
        $exports = $this->getExports();
        if (array_key_exists($sExportPlugin, $exports) && !empty($exports[$sExportPlugin])) {
            $event = new PluginEvent('newExport');
            $event->set('type', $sExportPlugin);
... (70 lines truncated)
</file>

<file path="application/helpers/admin/htmleditor_helper.php">
<?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
function initKcfinder()
{
    Yii::app()->session['KCFINDER'] = array();
    $sAllowedExtensions = implode(' ', array_map('trim', explode(',', (string) Yii::app()->getConfig('allowedresourcesuploads'))));
    $_SESSION['KCFINDER']['types'] = array(
        'files' => $sAllowedExtensions,
        'images' => $sAllowedExtensions
    );
    if (!empty(App()->getSession()->cookieParams['domain'])) {
        $_SESSION['KCFINDER']['cookieDomain'] = App()->getSession()->cookieParams['domain'];
    }
    if (App()->getRequest()->enableCsrfValidation && !empty(App()->getRequest()->csrfCookie['domain'])) {
        $_SESSION['KCFINDER']['cookieDomain'] = Yii::app()->getRequest()->csrfCookie['domain'];
    }
    if (
        Yii::app()->getConfig('demoMode') === false &&
            isset(Yii::app()->session['loginID']) &&
            isset(Yii::app()->session['FileManagerContext'])
    ) {
        if (
            preg_match('/^(create|edit):(question|group|answer)/', (string) Yii::app()->session['FileManagerContext']) != 0 ||
                preg_match('/^edit:survey/', (string) Yii::app()->session['FileManagerContext']) != 0 ||
                preg_match('/^edit:assessments/', (string) Yii::app()->session['FileManagerContext']) != 0 ||
                preg_match('/^edit:emailsettings/', (string) Yii::app()->session['FileManagerContext']) != 0
        ) {
            $contextarray = explode(':', (string) Yii::app()->session['FileManagerContext'], 3);
... (304 lines truncated)
</file>

<file path="application/helpers/admin/import_helper.php">
<?php
use LimeSurvey\Helpers\questionHelper;
use LimeSurvey\Models\Services\SurveyAccessModeService;
function XMLImportGroup($sFullFilePath, $iNewSID, $bTranslateLinksFields, $supportArchivedFields = true)
{
    $sBaseLanguage         = Survey::model()->findByPk($iNewSID)->language;
    $sXMLdata              = file_get_contents($sFullFilePath);
    $xml                   = simplexml_load_string($sXMLdata, 'SimpleXMLElement', LIBXML_NONET);
    if ($xml === false || $xml->LimeSurveyDocType != 'Group') {
        throw new Exception('This is not a valid LimeSurvey group structure XML file.');
    }
    $pendingInsertansUpdates = [];
    $oldNewFieldRoots = [];
    $questionTypeMap = [];
    $iDBVersion = (int) $xml->DBVersion;
    $aQIDReplacements = array();
    $aQuestionCodeReplacements = array();
    $results['defaultvalues'] = 0;
    $results['answers'] = 0;
    $results['question_attributes'] = 0;
    $results['subquestions'] = 0;
    $results['conditions'] = 0;
    $results['groups'] = 0;
    $results['importwarnings'] = [];
    $importlanguages = array();
    foreach ($xml->languages->language as $language) {
        $importlanguages[] = (string) $language;
    }
    if (!in_array($sBaseLanguage, $importlanguages)) {
        $results['fatalerror'] = gT("The languages of the imported group file must at least include the base language of this survey.");
... (4417 lines truncated)
</file>

<file path="application/helpers/admin/label_helper.php">
<?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
function updateset($lid)
{
    $newlanidarray = Yii::app()->getRequest()->getPost('languageids');
    $postlabel_name = Yii::app()->getRequest()->getPost('label_name');
    $labelset = LabelSet::model()->findByAttributes(array('lid' => $lid));
    $oldlangidsarray = explode(' ', (string) $labelset->languages);
    $addlangidsarray = array_diff($newlanidarray, $oldlangidsarray);
    $dellangidsarray = array_diff($oldlangidsarray, $newlanidarray);
    $result = Label::model()->findAllByAttributes(array('lid' => $lid), array('order' => 'code, sortorder, assessment_value'));
    if ($result) {
        foreach ($result as $row) {
                    $oldcodesarray[$row['code']] = array('sortorder' => $row['sortorder'], 'assessment_value' => $row['assessment_value']);
        }
    }
    if (isset($oldcodesarray) && count($oldcodesarray) > 0) {
        foreach ($addlangidsarray as $addedlangid) {
            foreach ($oldcodesarray as $oldcode => $olddata) {
                        $sqlvalues[] = array('lid' => $lid, 'code' => (string) $oldcode, 'sortorder' => $olddata['sortorder'], 'language' => $addedlangid, 'assessment_value' => $olddata['assessment_value']);
            }
        }
    }
    if (isset($sqlvalues)) {
        foreach ($sqlvalues as $sqlvalue) {
            $label = new Label();
            foreach ($sqlvalue as $name => $value) {
                $label->setAttribute($name, $value);
... (118 lines truncated)
</file>

<file path="application/helpers/admin/permission_helper.php">
<?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
function permissionsAsArray($globalPermissions, $customPermissions = [])
{
    $permissionsArray = [];
    foreach ($globalPermissions as $permission => $allCrud) {
        foreach ($allCrud as $crud) {
            $permissionsArray[$permission][$crud] = Permission::model()->hasGlobalPermission($permission, $crud);
        }
    }
    if ($customPermissions) {
        foreach ($customPermissions as $permission => $customPermission) {
            foreach ($customPermission as $type => $access) {
                if (in_array($type, ['create', 'read', 'update', 'delete', 'import', 'export'])) {
                    break;
                }
                $permissionsArray[$permission][$type] = $access;
            }
        }
    }
    return $permissionsArray;
}
</file>

<file path="application/helpers/admin/statistics_helper.php">
<?php
Yii::import('application.helpers.statisticschart_helper', true);
function getQuestionMapData($sField, $qsid)
{
    $aresult = SurveyDynamic::model($qsid)->findAll();
    $d = array();
    foreach ($aresult as $arow) {
        $location = explode(";", (string) $arow->$sField);
        if (count($location) >= 2) {
            $d[] = "{$location[0]} {$location[1]}";
        }
    }
    return $d;
}
function buildSelects($allfields, $surveyid, $language)
{
    $selects = array();
    $aQuestionMap = array();
    $survey = Survey::model()->findByPk($surveyid);
    $formatdata = getDateFormatData(Yii::app()->session['dateformat']);
    $fieldmap = createFieldMap($survey, "full", false, false, $language);
    foreach ($fieldmap as $field) {
        if (isset($field['qid']) && $field['qid'] != '') {
            $aQuestionMap[] = 'Q' . $field['qid'];
        }
    }
    $postvars = array();
    for (reset($_POST); $key = key($_POST); next($_POST)) {
        $postvars[] = $key;
    }
... (2934 lines truncated)
</file>

<file path="application/helpers/admin/survey_helper.php">
<?php
function getSurveyDefaultSettings()
{
    return array(
    'active' => 'N',
    'questionindex'               => 0,
    'format'                   => 'G',
    'template'                 => Yii::app()->getConfig('defaulttheme'),
    'allowsave'                => 'Y',
    'allowprev'                => 'N',
    'printanswers'             => 'N',
    'publicstatistics'         => 'N',
    'publicgraphs'             => 'N',
    'public'                   => 'Y',
    'autoredirect'             => 'N',
    'tokenlength'              => 15,
    'allowregister'            => 'N',
    'usecookie'                => 'N',
    'usecaptcha'               => 'D',
    'htmlemail'                => 'Y',
    'emailnotificationto'      => '',
    'anonymized'               => 'N',
    'datestamp'                => 'N',
    'ipaddr'                   => 'N',
    'refurl'                   => 'N',
    'savequotaexit'            => 'N',
    'tokenanswerspersistence'  => 'N',
    'alloweditaftercompletion' => 'N',
    'startdate'                => '',
    'savetimings'              => 'N',
... (9 lines truncated)
</file>

<file path="application/helpers/admin/template_helper.php">
<?php
function doreplacement($file, $data, $oTemplate = '')
{
    //Produce sample page from template file
    $aReplacements = $data['aReplacements'] ?? array();
    return (array) templatereplace(file_get_contents($file), $aReplacements, $data, 'Unspecified', false, null, array(), false, $oTemplate);
}
function getListOfFiles($wh)
{
    if ($handle = opendir($wh)) {
        while (false !== ($file = readdir($handle))) {
            if ($file != "." && $file != ".." && !is_dir($file)) {
                if (!isset($files) || !$files) {
                    $files = "$file";
                } else {
                    $files = "$file\n$files";
                }
            }
        }
        closedir($handle);
    }
    $arr = explode("\n", (string) $files);
    sort($arr);
    return $arr;
}
function mkdir_p($target)
{
    if (file_exists($target) || is_dir($target)) {
            return 2;
    }
... (64 lines truncated)
</file>

<file path="application/helpers/admin/token_helper.php">
<?php
function emailTokens($iSurveyID, $aResultTokens, $sType, $continueOnError = false)
{
    if (!in_array($sType, ['invite','remind','register','confirm'])) {
        throw new Exception('Invalid email type');
    }
    $oSurvey = Survey::model()->findByPk($iSurveyID);
    $mail = \LimeMailer::getInstance(\LimeMailer::ResetComplete);
    $mail->setSurvey($iSurveyID);
    $mail->emailType = $sType;
    $mail->replaceTokenAttributes = true;
    foreach ($aResultTokens as $index => $aTokenRow) {
        $mail = \LimeMailer::getInstance();
        $mail->setToken($aTokenRow['token']);
        $mail->index = $index;
        $mail->setTypeWithRaw($sType, $aTokenRow['language']);
        if (isset($aTokenRow['validfrom']) && trim((string) $aTokenRow['validfrom']) != '' && convertDateTimeFormat($aTokenRow['validfrom'], 'Y-m-d H:i:s', 'U') * 1 > date('U') * 1) {
            $aResult[$aTokenRow['tid']] = array(
                'name' => $aTokenRow["firstname"] . " " . $aTokenRow["lastname"],
                'email' => $aTokenRow["email"],
                'status' => 'fail',
                'warning' => null,
                'error' => 'Token not valid yet'
            );
            if ($continueOnError) {
                continue;
            } else {
                break 1;
            }
        }
... (50 lines truncated)
</file>

<file path="application/helpers/adodb/adodb-time.inc_helper.php">
<?php
define('ADODB_DATE_VERSION', 0.33);
$ADODB_DATETIME_CLASS = (PHP_VERSION >= 5.2);
if (!defined('ADODB_ALLOW_NEGATIVE_TS')) {
    define('ADODB_NO_NEGATIVE_TS', 1);
}
function adodb_date_test_date($y1, $m, $d = 13)
{
    $h = round(rand() % 24);
    $t = adodb_mktime($h, 0, 0, $m, $d, $y1);
    $rez = adodb_date('Y-n-j H:i:s', $t);
    if ($h == 0) {
        $h = '00';
    } elseif ($h < 10) {
        $h = '0' . $h;
    }
    if ("$y1-$m-$d $h:00:00" != $rez) {
        print "<b>$y1 error, expected=$y1-$m-$d $h:00:00, adodb=$rez</b><br>";
        return false;
    }
    return true;
}
function adodb_date_test_strftime($fmt)
{
    $s1 = strftime($fmt);
    $s2 = adodb_strftime($fmt);
    if ($s1 == $s2) {
        return true;
    }
    echo "error for $fmt,  strftime=$s1, adodb=$s2<br>";
... (1071 lines truncated)
</file>

<file path="application/helpers/expressions/emcache/em_cache_exception.php">
<?php
class EmCacheException extends CException
{
}
</file>

<file path="application/helpers/expressions/emcache/em_cache_helper.php">
<?php
class EmCacheHelper
{
    protected static $surveyinfo = null;
    public static function init(?array $surveyinfo = null)
    {
        if (empty($surveyinfo)) {
            throw new \InvalidArgumentException('$surveyinfo is empty, cannot initialise helper');
        }
        if (empty($surveyinfo['sid'])) {
            throw new \InvalidArgumentException('required key $surveyinfo[sid] is empty, cannot initialise helper');
        }
        if (empty($surveyinfo['active'])) {
            throw new \InvalidArgumentException('required key $surveyinfo[active] is empty, cannot initialise helper');
        }
        self::$surveyinfo = $surveyinfo;
        \Yii::app()->emcache->keyPrefix = $surveyinfo['sid'];
    }
    public static function clearInit()
    {
        if (isset(self::$surveyinfo)) {
            self::flush();
        }
        self::$surveyinfo = null;
    }
    public static function flush()
    {
        if (empty(self::$surveyinfo)) {
            throw new EmCacheException('Cannot flush emcache unless initalised');
        }
... (73 lines truncated)
</file>

<file path="application/helpers/expressions/warnings/EMWarningAssignment.php">
<?php
class EMWarningAssignment extends EMWarningBase
{
    public function __construct(array $token)
    {
        $this->token = $token;
        $this->msg = gT('Assigning a new value to a variable.', 'unescaped');
        $this->helpLink = 'https://www.limesurvey.org/manual/Expression_Manager#Using_Assignment_Operator';
    }
}
</file>

<file path="application/helpers/expressions/warnings/EMWarningBase.php">
<?php
class EMWarningBase implements EMWarningInterface
{
    public $token;
    public $msg;
    public $helpLink;
    public function getToken()
    {
        return $this->token;
    }
    public function getMessage()
    {
        return $this->msg;
    }
    public function getHelpLink()
    {
        return $this->helpLink;
    }
    public function hasHelpLink()
    {
        return !empty($this->helpLink);
    }
    public function bakeHelpLink()
    {
        if ($this->hasHelpLink()) {
            return CHtml::link(
                $this->msg,
                $this->helpLink,
                array("target" => "_blank",'class' => 'text-danger')
            );
... (6 lines truncated)
</file>

<file path="application/helpers/expressions/warnings/EMWarningHTMLBaker.php">
<?php
class EMWarningHTMLBaker
{
    public function getWarningHTML(array $warnings)
    {
        $message = "<strong>"
            . ngT(
                "This question has at least {n} warning.|This question has at least {n} warnings.",
                count($warnings),
                'html'
            )
            . "</strong>";
        $message .= "<ul class='list-unstyled small'>";
        $warningsDone = [];
        foreach ($warnings as $aWarning) {
            if (!in_array($aWarning, $warningsDone)) {
                $message .= "<li>";
                if ($aWarning->hasHelpLink()) {
                    $message .= $aWarning->bakeHelpLink();
                } else {
                    $message .= $aWarning->getMessage();
                }
                $message .= "</li>";
            }
            $warningsDone[] = $aWarning->getMessage();
        }
        $message .= "</ul>";
        return App()->getController()->widget('ext.AlertWidget.AlertWidget', [
            'text' => $message,
            'type' => 'warning',
... (4 lines truncated)
</file>

<file path="application/helpers/expressions/warnings/EMWarningInterface.php">
<?php
interface EMWarningInterface
{
    public function getToken();
    public function getMessage();
    public function getHelpLink();
    public function hasHelpLink();
    public function bakeHelpLink();
}
</file>

<file path="application/helpers/expressions/warnings/EMWarningInvalidComparison.php">
<?php
class EMWarningInvalidComparison extends EMWarningBase
{
    public function __construct(array $token)
    {
        $this->token = $token;
        $this->msg = gT("This expression uses a possibly invalid comparison. Are you sure you didn't mean to do a numerical comparison? See manual for more information.", 'unescaped');
        $this->helpLink = "https://www.limesurvey.org/manual/Expression_Manager#Warning_with_mismatch_between_number_and_string_and_alphabetic_comparison";
    }
}
</file>

<file path="application/helpers/expressions/warnings/EMWarningLaterQuestion.php">
<?php
class EMWarningLaterQuestion extends EMWarningBase
{
    public function __construct(array $token)
    {
        $this->token = $token;
        $this->msg = gT('This uses a question that comes later in the survey. Its answer may not be available yet, and changes to it on the same page may not be taken into account.', 'unescaped');
    }
}
</file>

<file path="application/helpers/expressions/warnings/EMWarningPlusOperator.php">
<?php
class EMWarningPlusOperator extends EMWarningBase
{
    public function __construct(array $token)
    {
        $this->token = $token;
        $this->msg = gT("Usage of + with numeric value, see manual about usage of sum.", 'unescaped');
        $this->helpLink = "https://www.limesurvey.org/manual/Expression_Manager#Warning_with_plus_operator_.28.2B.29";
    }
}
</file>

<file path="application/helpers/expressions/em_core_helper.php">
<?php
class ExpressionManager
{
    const RDP_REGEX_INNER_APOSTROPHE = '(?<=\\p{L}\')(?!(?:and|or|eq|ne|lt|le|gt|ge)\\b)\\p{L}';
    private $aRDP_regexpVariableAttribute = array(
        'code',
        'NAOK',
        'relevanceStatus',
        'shown',
        'valueNAOK',
        'value',
    );
    private $aRDP_regexpStaticAttribute = array(
        'qid',
        'gid',
        'question',
        'sgqa',
        'type',
        'relevance',
        'grelevance',
        'qseq',
        'gseq',
        'jsName',
        'jsName_on',
        'mandatory',
        'rowdivid',
    );
    private $RDP_ExpressionRegex;
    private $RDP_TokenType;
    private $RDP_TokenizerRegex;
... (2725 lines truncated)
</file>

<file path="application/helpers/expressions/em_manager_helper.php">
<?php
use LimeSurvey\Helpers\questionHelper;
use LimeSurvey\Models\Services\Quotas;
Yii::import('application.helpers.expressions.em_core_helper', true);
Yii::import('application.helpers.expressions.warnings.EMWarningInterface', true);
Yii::import('application.helpers.expressions.warnings.EMWarningBase', true);
Yii::import('application.helpers.expressions.warnings.EMWarningInvalidComparison', true);
Yii::import('application.helpers.expressions.warnings.EMWarningPlusOperator', true);
Yii::import('application.helpers.expressions.warnings.EMWarningAssignment', true);
Yii::import('application.helpers.expressions.warnings.EMWarningLaterQuestion', true);
Yii::import('application.helpers.expressions.warnings.EMWarningHTMLBaker', true);
Yii::app()->loadHelper('database');
Yii::app()->loadHelper('frontend');
Yii::app()->loadHelper('surveytranslator');
Yii::import("application.libraries.Date_Time_Converter");
Yii::import('application.helpers.expressions.emcache.em_cache_exception', true);
Yii::import('application.helpers.expressions.emcache.em_cache_helper', true);
define('LEM_DEBUG_TIMING', 1);
define('LEM_DEBUG_VALIDATION_SUMMARY', 2);
define('LEM_DEBUG_VALIDATION_DETAIL', 4);
define('LEM_PRETTY_PRINT_ALL_SYNTAX', 32);
class LimeExpressionManager
{
    private static $instance;
    private $em;
    private $groupRelevanceInfo;
    private $sid;
    private $debugLevel = 0;
    private $sPreviewMode = false;
    private $knownVars = [];
... (8644 lines truncated)
</file>

<file path="application/helpers/remotecontrol/remotecontrol_handle.php">
<?php
use LimeSurvey\PluginManager\PluginEvent;
class remotecontrol_handle
{
    const INVALID_SESSION_KEY = 'Invalid session key';
    const ERR_INVALID_SESSION = 'ERR_INVALID_SESSION';
    const ERR_INVALID_CREDENTIALS = 'ERR_INVALID_CREDENTIALS';
    const ERR_NO_PERMISSION = 'ERR_NO_PERMISSION';
    const ERR_INVALID_USER = 'ERR_INVALID_USER';
    const ERR_INVALID_SURVEY = 'ERR_INVALID_SURVEY';
    const ERR_INVALID_GROUP = 'ERR_INVALID_GROUP';
    const ERR_INVALID_QUESTION = 'ERR_INVALID_QUESTION';
    const ERR_INVALID_QUOTA = 'ERR_INVALID_QUOTA';
    const ERR_INVALID_TOKEN = 'ERR_INVALID_TOKEN';
    const ERR_INVALID_LANGUAGE = 'ERR_INVALID_LANGUAGE';
    const ERR_INVALID_SETTING = 'ERR_INVALID_SETTING';
    const ERR_INVALID_PARAMETERS = 'ERR_INVALID_PARAMETERS';
    const ERR_INVALID_EXTENSION = 'ERR_INVALID_EXTENSION';
    const ERR_INVALID_XML = 'ERR_INVALID_XML';
    const ERR_INVALID_COLUMNS = 'ERR_INVALID_COLUMNS';
    const ERR_SURVEY_ACTIVE = 'ERR_SURVEY_ACTIVE';
    const ERR_SURVEY_NOT_ACTIVE = 'ERR_SURVEY_NOT_ACTIVE';
    const ERR_NO_PARTICIPANT_TABLE = 'ERR_NO_PARTICIPANT_TABLE';
    const ERR_NO_RESPONSE_TABLE = 'ERR_NO_RESPONSE_TABLE';
    const ERR_CREATION_FAILED = 'ERR_CREATION_FAILED';
    const ERR_DELETION_FAILED = 'ERR_DELETION_FAILED';
    const ERR_COPY_FAILED = 'ERR_COPY_FAILED';
    const ERR_UPDATE_FAILED = 'ERR_UPDATE_FAILED';
    const ERR_NO_DATA = 'ERR_NO_DATA';
    const ERR_ALREADY_EXISTS = 'ERR_ALREADY_EXISTS';
... (2788 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_133.php">
<?php
namespace LimeSurvey\Helpers\Update;
use Exception;
class Update_133 extends DatabaseUpdateBase
{
    public function up()
    {
        addColumn('{{users}}', 'one_time_pw', 'binary');
        addColumn('{{surveys}}', 'assessments', "string(1) NOT NULL DEFAULT 'N'");
        addColumn('{{answers}}', 'assessment_value', "integer NOT NULL DEFAULT '0'");
        addColumn('{{labels}}', 'assessment_value', "integer NOT NULL DEFAULT '0'");
        $this->applyUpdates();
        $this->db->createCommand(
            "UPDATE {{surveys}} SET assessments='Y' where sid in (SELECT sid FROM {{assessments}} group by sid)"
        )->execute();
        addColumn('{{assessments}}', 'language', "string(20) NOT NULL DEFAULT 'en'");
        $this->db->createCommand(
            "UPDATE {{assessments}} SET language=(select language from {{surveys}} where sid={{assessments}}.sid)"
        )->execute();
        dropColumn('{{assessments}}', 'link');
        addColumn('{{surveys_languagesettings}}', 'surveyls_url', "string");
        addColumn('{{surveys_languagesettings}}', 'surveyls_endtext', 'text');
        $this->db->createCommand(
            "UPDATE {{surveys_languagesettings}} set surveyls_url=(select url from {{surveys}} where sid={{surveys_languagesettings}}.surveyls_survey_id)"
        )->execute();
        dropColumn('{{surveys}}', 'url');
    }
    public function applyUpdates()
    {
        switch ($this->db->driverName) {
... (44 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_134.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_134 extends DatabaseUpdateBase
{
    public function up()
    {
            addColumn('{{surveys}}', 'usetokens', "string(1) NOT NULL DEFAULT 'N'");
            addColumn('{{surveys}}', 'attributedescriptions', 'text');
            dropColumn('{{surveys}}', 'attribute1');
            dropColumn('{{surveys}}', 'attribute2');
            upgradeTokenTables134();
    }
}
</file>

<file path="application/helpers/update/updates/Update_135.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_135 extends DatabaseUpdateBase
{
    public function up()
    {
            \alterColumn('{{question_attributes}}', 'value', 'text');
    }
}
</file>

<file path="application/helpers/update/updates/Update_136.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_136 extends DatabaseUpdateBase
{
    public function up()
    {
            addColumn('{{quota}}', 'autoload_url', "integer NOT NULL DEFAULT 0");
            $aFields = array(
                'quotals_id' => 'pk',
                'quotals_quota_id' => 'integer NOT NULL DEFAULT 0',
                'quotals_language' => "string(45) NOT NULL DEFAULT 'en'",
                'quotals_name' => 'string',
                'quotals_message' => 'text NOT NULL',
                'quotals_url' => 'string',
                'quotals_urldescrip' => 'string',
            );
            $this->db->createCommand()->createTable('{{quota_languagesettings}}', $aFields);
    }
}
</file>

<file path="application/helpers/update/updates/Update_137.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_137 extends DatabaseUpdateBase
{
    public function up()
    {
            addColumn('{{surveys_languagesettings}}', 'surveyls_dateformat', "integer NOT NULL DEFAULT 1");
            addColumn('{{users}}', 'dateformat', "integer NOT NULL DEFAULT 1");
            $this->db->createCommand()->update('{{surveys}}', array('startdate' => null), "usestartdate='N'");
            $this->db->createCommand()->update('{{surveys}}', array('expires' => null), "useexpiry='N'");
            dropColumn('{{surveys}}', 'useexpiry');
            dropColumn('{{surveys}}', 'usestartdate');
    }
}
</file>

<file path="application/helpers/update/updates/Update_138.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_138 extends DatabaseUpdateBase
{
    public function up()
    {
            \alterColumn('{{quota_members}}', 'code', "string(11)");
    }
}
</file>

<file path="application/helpers/update/updates/Update_139.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_139 extends DatabaseUpdateBase
{
    public function up()
    {
            upgradeSurveyTables139();
    }
}
</file>

<file path="application/helpers/update/updates/Update_140.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_140 extends DatabaseUpdateBase
{
    public function up()
    {
            addColumn('{{surveys}}', 'emailresponseto', 'text');
    }
}
</file>

<file path="application/helpers/update/updates/Update_141.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_141 extends DatabaseUpdateBase
{
    public function up()
    {
            addColumn('{{surveys}}', 'tokenlength', 'integer NOT NULL DEFAULT 15');
    }
}
</file>

<file path="application/helpers/update/updates/Update_142.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_142 extends DatabaseUpdateBase
{
    public function up()
    {
        upgradeQuestionAttributes142();
        $this->db->createCommand()->alterColumn('{{surveys}}', 'expires', "datetime");
        $this->db->createCommand()->alterColumn('{{surveys}}', 'startdate', "datetime");
        $this->db->createCommand()->update('{{question_attributes}}', array('value' => 0), "value='false'");
        $this->db->createCommand()->update('{{question_attributes}}', array('value' => 1), "value='true'");
    }
}
</file>

<file path="application/helpers/update/updates/Update_143.php">
<?php
namespace LimeSurvey\Helpers\Update;
use SurveyThemeHelper;
use Template;
class Update_143 extends DatabaseUpdateBase
{
    public function up()
    {
        $sUserTemplateRootDir = \Yii::app()->getConfig('userthemerootdir');
        $sStandardTemplateRootDir = \Yii::app()->getConfig('standardthemerootdir');
        addColumn('{{questions}}', 'parent_qid', 'integer NOT NULL DEFAULT 0');
        addColumn('{{answers}}', 'scale_id', 'integer NOT NULL DEFAULT 0');
        addColumn('{{questions}}', 'scale_id', 'integer NOT NULL DEFAULT 0');
        addColumn('{{questions}}', 'same_default', 'integer NOT NULL DEFAULT 0');
        dropPrimaryKey('answers');
        addPrimaryKey('answers', array('qid', 'code', 'language', 'scale_id'));
        $aFields = array(
            'qid' => "integer NOT NULL DEFAULT 0",
            'scale_id' => 'integer NOT NULL DEFAULT 0',
            'sqid' => 'integer  NOT NULL DEFAULT 0',
            'language' => 'string(20) NOT NULL',
            'specialtype' => "string(20) NOT NULL DEFAULT ''",
            'defaultvalue' => 'text',
        );
        $this->db->createCommand()->createTable('{{defaultvalues}}', $aFields);
        addPrimaryKey('defaultvalues', array('qid', 'specialtype', 'language', 'scale_id', 'sqid'));
        upgradeTables143();
        dropColumn('{{answers}}', 'default_value');
        dropColumn('{{questions}}', 'lid');
        dropColumn('{{questions}}', 'lid1');
... (50 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_145.php">
<?php
namespace LimeSurvey\Helpers\Update;
use Exception;
class Update_145 extends DatabaseUpdateBase
{
    public function up()
    {
        addColumn('{{surveys}}', 'savetimings', "string(1) NULL DEFAULT 'N'");
        addColumn('{{surveys}}', 'showXquestions', "string(1) NULL DEFAULT 'Y'");
        addColumn('{{surveys}}', 'showgroupinfo', "string(1) NULL DEFAULT 'B'");
        addColumn('{{surveys}}', 'shownoanswer', "string(1) NULL DEFAULT 'Y'");
        addColumn('{{surveys}}', 'showqnumcode', "string(1) NULL DEFAULT 'X'");
        addColumn('{{surveys}}', 'bouncetime', 'integer');
        addColumn('{{surveys}}', 'bounceprocessing', "string(1) NULL DEFAULT 'N'");
        addColumn('{{surveys}}', 'bounceaccounttype', "string(4)");
        addColumn('{{surveys}}', 'bounceaccounthost', "string(200)");
        addColumn('{{surveys}}', 'bounceaccountpass', "string(100)");
        addColumn('{{surveys}}', 'bounceaccountencryption', "string(3)");
        addColumn('{{surveys}}', 'bounceaccountuser', "string(200)");
        addColumn('{{surveys}}', 'showwelcome', "string(1) DEFAULT 'Y'");
        addColumn('{{surveys}}', 'showprogress', "string(1) DEFAULT 'Y'");
        addColumn('{{surveys}}', 'allowjumps', "string(1) DEFAULT 'N'");
        addColumn('{{surveys}}', 'navigationdelay', "integer DEFAULT 0");
        addColumn('{{surveys}}', 'nokeyboard', "string(1) DEFAULT 'N'");
        addColumn('{{surveys}}', 'alloweditaftercompletion', "string(1) DEFAULT 'N'");
        $aFields = array(
            'sid' => "integer NOT NULL",
            'uid' => "integer NOT NULL",
            'permission' => 'string(20) NOT NULL',
            'create_p' => "integer NOT NULL DEFAULT 0",
... (171 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_146.php">
<?php
namespace LimeSurvey\Helpers\Update;
use Exception;
class Update_146 extends DatabaseUpdateBase
{
    public function up()
    {
        upgradeSurveyTimings146();
        try {
            setTransactionBookmark();
            $this->db->createCommand(
                "INSERT into {{survey_permissions}} (sid,uid,permission,read_p,update_p) SELECT sid,owner_id,'translations','1','1' from {{surveys}}"
            )->execute();
        } catch (\Exception $e) {
            rollBackToTransactionBookmark();
        }
    }
}
</file>

<file path="application/helpers/update/updates/Update_147.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_147 extends DatabaseUpdateBase
{
    public function up()
    {
            addColumn('{{users}}', 'templateeditormode', "string(7) NOT NULL DEFAULT 'default'");
            addColumn('{{users}}', 'questionselectormode', "string(7) NOT NULL DEFAULT 'default'");
    }
}
</file>

<file path="application/helpers/update/updates/Update_148.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_148 extends DatabaseUpdateBase
{
    public function up()
    {
        addColumn('{{users}}', 'participant_panel', "integer NOT NULL DEFAULT 0");
        $this->db->createCommand()->createTable(
            '{{participants}}',
            array(
                'participant_id' => 'string(50) NOT NULL',
                'firstname' => 'string(40) DEFAULT NULL',
                'lastname' => 'string(40) DEFAULT NULL',
                'email' => 'string(80) DEFAULT NULL',
                'language' => 'string(40) DEFAULT NULL',
                'blacklisted' => 'string(1) NOT NULL',
                'owner_uid' => "integer NOT NULL"
            )
        );
        addPrimaryKey('participants', array('participant_id'));
        $this->db->createCommand()->createTable(
            '{{participant_attribute}}',
            array(
                'participant_id' => 'string(50) NOT NULL',
                'attribute_id' => "integer NOT NULL",
                'value' => 'string(50) NOT NULL'
            )
        );
        addPrimaryKey('participant_attribute', array('participant_id', 'attribute_id'));
        $this->db->createCommand()->createTable(
... (84 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_149.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_149 extends DatabaseUpdateBase
{
    public function up()
    {
            $aFields = array(
                'id' => 'integer',
                'sid' => 'integer',
                'parameter' => 'string(50)',
                'targetqid' => 'integer',
                'targetsqid' => 'integer'
            );
            $this->db->createCommand()->createTable('{{survey_url_parameters}}', $aFields);
    }
}
</file>

<file path="application/helpers/update/updates/Update_150.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_150 extends DatabaseUpdateBase
{
    public function up()
    {
            addColumn('{{questions}}', 'relevance', 'text');
    }
}
</file>

<file path="application/helpers/update/updates/Update_151.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_151 extends DatabaseUpdateBase
{
    public function up()
    {
            addColumn('{{groups}}', 'randomization_group', "string(20) NOT NULL DEFAULT ''");
    }
}
</file>

<file path="application/helpers/update/updates/Update_152.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_152 extends DatabaseUpdateBase
{
    public function up()
    {
            $this->db->createCommand()->createIndex('question_attributes_idx3', '{{question_attributes}}', 'attribute');
    }
}
</file>

<file path="application/helpers/update/updates/Update_153.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_153 extends DatabaseUpdateBase
{
    public function up()
    {
            $this->db->createCommand()->createTable(
                '{{expression_errors}}',
                array(
                    'id' => 'pk',
                    'errortime' => 'string(50)',
                    'sid' => 'integer',
                    'gid' => 'integer',
                    'qid' => 'integer',
                    'gseq' => 'integer',
                    'qseq' => 'integer',
                    'type' => 'string(50)',
                    'eqn' => 'text',
                    'prettyprint' => 'text'
                )
            );
    }
}
</file>

<file path="application/helpers/update/updates/Update_154.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_154 extends DatabaseUpdateBase
{
    public function up()
    {
            $this->db->createCommand()->addColumn('{{groups}}', 'grelevance', "text");
    }
}
</file>

<file path="application/helpers/update/updates/Update_155.php">
<?php
namespace LimeSurvey\Helpers\Update;
use Exception;
class Update_155 extends DatabaseUpdateBase
{
    public function up()
    {
        addColumn('{{surveys}}', 'googleanalyticsstyle', "string(1)");
        addColumn('{{surveys}}', 'googleanalyticsapikey', "string(25)");
        try {
            setTransactionBookmark();
            $this->db->createCommand()->renameColumn('{{surveys}}', 'showXquestions', 'showxquestions');
        } catch (\Exception $e) {
            rollBackToTransactionBookmark();
        }
    }
}
</file>

<file path="application/helpers/update/updates/Update_156.php">
<?php
namespace LimeSurvey\Helpers\Update;
use Exception;
class Update_156 extends DatabaseUpdateBase
{
    public function up()
    {
        try {
            $this->db->createCommand()->dropTable('{{survey_url_parameters}}');
        } catch (\Exception $e) {
        }
        $this->db->createCommand()->createTable(
            '{{survey_url_parameters}}',
            array(
                'id' => 'pk',
                'sid' => 'integer NOT NULL',
                'parameter' => 'string(50) NOT NULL',
                'targetqid' => 'integer',
                'targetsqid' => 'integer'
            )
        );
        try {
            $this->db->createCommand()->dropTable('{{sessions}}');
        } catch (\Exception $e) {
        }
        if ($this->db->driverName == 'mysql') {
            $this->db->createCommand()->createTable(
                '{{sessions}}',
                array(
                    'id' => 'string(32) NOT NULL',
... (26 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_157.php">
<?php
namespace LimeSurvey\Helpers\Update;
use Exception;
class Update_157 extends DatabaseUpdateBase
{
    public function up()
    {
        try {
            setTransactionBookmark();
            $this->db->createCommand()->dropIndex('questions_idx4', '{{questions}}');
        } catch (\Exception $e) {
            rollBackToTransactionBookmark();
        }
        \alterColumn('{{answers}}', 'assessment_value', 'integer', false, '0');
        dropPrimaryKey('answers');
        \alterColumn('{{answers}}', 'scale_id', 'integer', false, '0');
        addPrimaryKey('answers', array('qid', 'code', 'language', 'scale_id'));
        \alterColumn('{{conditions}}', 'method', "string(5)", false, '');
        \alterColumn('{{participants}}', 'owner_uid', 'integer', false);
        \alterColumn('{{participant_attribute_names}}', 'visible', 'string(5)', false);
        \alterColumn('{{questions}}', 'type', "string(1)", false, 'T');
        \alterColumn('{{questions}}', 'other', "string(1)", false, 'N');
        \alterColumn('{{questions}}', 'mandatory', "string(1)");
        \alterColumn('{{questions}}', 'scale_id', 'integer', false, '0');
        \alterColumn('{{questions}}', 'parent_qid', 'integer', false, '0');
        \alterColumn('{{questions}}', 'same_default', 'integer', false, '0');
        \alterColumn('{{quota}}', 'qlimit', 'integer');
        \alterColumn('{{quota}}', 'action', 'integer');
        \alterColumn('{{quota}}', 'active', 'integer', false, '1');
        \alterColumn('{{quota}}', 'autoload_url', 'integer', false, '0');
... (282 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_158.php">
<?php
namespace LimeSurvey\Helpers\Update;
use LimeExpressionManager;
class Update_158 extends DatabaseUpdateBase
{
    public function up()
    {
    }
}
</file>

<file path="application/helpers/update/updates/Update_159.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_159 extends DatabaseUpdateBase
{
    public function up()
    {
            \alterColumn('{{failed_login_attempts}}', 'ip', "string(40)", false);
    }
}
</file>

<file path="application/helpers/update/updates/Update_160.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_160 extends DatabaseUpdateBase
{
    public function up()
    {
            alterLanguageCode('it', 'it-informal');
            alterLanguageCode('it-formal', 'it');
    }
}
</file>

<file path="application/helpers/update/updates/Update_161.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_161 extends DatabaseUpdateBase
{
    public function up()
    {
            addColumn('{{survey_links}}', 'date_invited', 'datetime NULL DEFAULT NULL');
            addColumn('{{survey_links}}', 'date_completed', 'datetime NULL DEFAULT NULL');
    }
}
</file>

<file path="application/helpers/update/updates/Update_162.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_162 extends DatabaseUpdateBase
{
    public function up()
    {
            \alterColumn('{{participant_attribute}}', 'value', "text", false);
            \alterColumn('{{participant_attribute_names_lang}}', 'attribute_name', "string(255)", false);
            \alterColumn('{{participant_attribute_values}}', 'value', "text", false);
    }
}
</file>

<file path="application/helpers/update/updates/Update_164.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_164 extends DatabaseUpdateBase
{
    public function up()
    {
            upgradeTokens148();
            upgradeSurveyTables164();
            $this->db->createCommand()->update('{{settings_global}}', array('stg_value' => 164), "stg_name='DBVersion'");
    }
}
</file>

<file path="application/helpers/update/updates/Update_165.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_165 extends DatabaseUpdateBase
{
    public function up()
    {
            $this->db->createCommand()->createTable(
                '{{plugins}}',
                array(
                    'id' => 'pk',
                    'name' => 'string NOT NULL',
                    'active' => 'boolean'
                )
            );
            $this->db->createCommand()->createTable(
                '{{plugin_settings}}',
                array(
                    'id' => 'pk',
                    'plugin_id' => 'integer NOT NULL',
                    'model' => 'string',
                    'model_id' => 'integer',
                    'key' => 'string',
                    'value' => 'text'
                )
            );
            \alterColumn('{{surveys_languagesettings}}', 'surveyls_url', "text");
    }
}
</file>

<file path="application/helpers/update/updates/Update_166.php">
<?php
namespace LimeSurvey\Helpers\Update;
use Exception;
class Update_166 extends DatabaseUpdateBase
{
    public function up()
    {
        $this->db->createCommand()->renameTable('{{survey_permissions}}', '{{permissions}}');
        dropPrimaryKey('permissions');
        alterColumn('{{permissions}}', 'permission', "string(100)", false);
        $this->db->createCommand()->renameColumn('{{permissions}}', 'sid', 'entity_id');
        alterColumn('{{permissions}}', 'entity_id', "string(100)", false);
        addColumn('{{permissions}}', 'entity', "string(50)");
        $this->db->createCommand("update {{permissions}} set entity='survey'")->query();
        addColumn('{{permissions}}', 'id', 'pk');
        try {
            setTransactionBookmark();
            $this->db->createCommand()->createIndex(
                'idxPermissions',
                '{{permissions}}',
                'entity_id,entity,permission,uid',
                true
            );
        } catch (\Exception $e) {
            rollBackToTransactionBookmark();
        }
        upgradePermissions166();
        dropColumn('{{users}}', 'create_survey');
        dropColumn('{{users}}', 'create_user');
        dropColumn('{{users}}', 'delete_user');
... (9 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_167.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_167 extends DatabaseUpdateBase
{
    public function up()
    {
            addColumn('{{surveys_languagesettings}}', 'attachments', 'text');
            addColumn('{{users}}', 'created', 'datetime');
            addColumn('{{users}}', 'modified', 'datetime');
    }
}
</file>

<file path="application/helpers/update/updates/Update_168.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_168 extends DatabaseUpdateBase
{
    public function up()
    {
            addColumn('{{participants}}', 'created', 'datetime');
            addColumn('{{participants}}', 'modified', 'datetime');
            addColumn('{{participants}}', 'created_by', 'integer');
            $this->db->createCommand('update {{participants}} set created_by=owner_uid')->query();
            \alterColumn('{{participants}}', 'created_by', "integer", false);
    }
}
</file>

<file path="application/helpers/update/updates/Update_169.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_169 extends DatabaseUpdateBase
{
    public function up()
    {
            addColumn('{{surveys}}', 'questionindex', 'integer NOT NULL DEFAULT 0');
            $this->db->createCommand("update {{surveys}} set questionindex = 0 where allowjumps <> 'Y'")->query();
            $this->db->createCommand("update {{surveys}} set questionindex = 1 where allowjumps = 'Y'")->query();
            dropColumn('{{surveys}}', 'allowjumps');
    }
}
</file>

<file path="application/helpers/update/updates/Update_170.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_170 extends DatabaseUpdateBase
{
    public function up()
    {
            $this->db->createCommand()->update(
                '{{question_attributes}}',
                array('attribute' => 'date_min'),
                "attribute='dropdown_dates_year_min'"
            );
            $this->db->createCommand()->update(
                '{{question_attributes}}',
                array('attribute' => 'date_max'),
                "attribute='dropdown_dates_year_max'"
            );
    }
}
</file>

<file path="application/helpers/update/updates/Update_171.php">
<?php
namespace LimeSurvey\Helpers\Update;
use Exception;
class Update_171 extends DatabaseUpdateBase
{
    public function up()
    {
        try {
            dropColumn('{{sessions}}', 'data');
        } catch (\Exception $e) {
        }
        switch ($this->db->driverName) {
            case 'mysql':
                addColumn('{{sessions}}', 'data', 'longbinary');
                break;
            case 'sqlsrv':
            case 'dblib':
            case 'mssql':
                addColumn('{{sessions}}', 'data', 'VARBINARY(MAX)');
                break;
            case 'pgsql':
                addColumn('{{sessions}}', 'data', 'BYTEA');
                break;
        }
    }
}
</file>

<file path="application/helpers/update/updates/Update_172.php">
<?php
namespace LimeSurvey\Helpers\Update;
use Exception;
class Update_172 extends DatabaseUpdateBase
{
    public function up()
    {
        switch ($this->db->driverName) {
            case 'pgsql':
                alterColumn('{{permissions}}', 'entity_id', "INTEGER USING (entity_id::integer)", false);
                break;
            case 'sqlsrv':
            case 'dblib':
            case 'mssql':
                try {
                    setTransactionBookmark();
                    $this->db->createCommand()->dropIndex('permissions_idx2', '{{permissions}}');
                } catch (\Exception $e) {
                    rollBackToTransactionBookmark();
                };
                try {
                    setTransactionBookmark();
                    $this->db->createCommand()->dropIndex('idxPermissions', '{{permissions}}');
                } catch (\Exception $e) {
                    rollBackToTransactionBookmark();
                };
                alterColumn('{{permissions}}', 'entity_id', "INTEGER", false);
                $this->db->createCommand()->createIndex(
                    'permissions_idx2',
                    '{{permissions}}',
... (10 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_173.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_173 extends DatabaseUpdateBase
{
    public function up()
    {
            addColumn('{{participant_attribute_names}}', 'defaultname', "string(50) NOT NULL default ''");
            upgradeCPDBAttributeDefaultNames173();
    }
}
</file>

<file path="application/helpers/update/updates/Update_174.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_174 extends DatabaseUpdateBase
{
    public function up()
    {
            \alterColumn('{{participants}}', 'email', "string(254)");
            \alterColumn('{{saved_control}}', 'email', "string(254)");
            \alterColumn('{{surveys}}', 'adminemail', "string(254)");
            \alterColumn('{{surveys}}', 'bounce_email', "string(254)");
        switch (\Yii::app()->db->driverName) {
            case 'sqlsrv':
            case 'dblib':
            case 'mssql':
                dropUniqueKeyMSSQL('email', '{{users}}');
        }
            \alterColumn('{{users}}', 'email', "string(254)");
    }
}
</file>

<file path="application/helpers/update/updates/Update_175.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_175 extends DatabaseUpdateBase
{
    public function up()
    {
        switch (\Yii::app()->db->driverName) {
            case 'pgsql':
                \alterColumn('{{plugins}}', 'active', "INTEGER USING (active::integer)", false);
                break;
            default:
                \alterColumn('{{plugins}}', 'active', "integer", false, '0');
        }
    }
}
</file>

<file path="application/helpers/update/updates/Update_176.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_176 extends DatabaseUpdateBase
{
    public function up()
    {
            upgradeTokens176();
    }
}
</file>

<file path="application/helpers/update/updates/Update_177.php">
<?php
namespace LimeSurvey\Helpers\Update;
use Plugin;
use App;
class Update_177 extends DatabaseUpdateBase
{
    public function up()
    {
        if (\Yii::app()->getConfig('auth_webserver') === true) {
            if (!class_exists('Authwebserver', false)) {
                $plugin = Plugin::model()->findByAttributes(array('name' => 'Authwebserver'));
                if (!$plugin) {
                    $plugin = new Plugin();
                    $plugin->name = 'Authwebserver';
                    $plugin->active = 1;
                    $plugin->save();
                    $plugin = App()->getPluginManager()->loadPlugin('Authwebserver', $plugin->id);
                    $aPluginSettings = $plugin->getPluginSettings(true);
                    $aDefaultSettings = array();
                    foreach ($aPluginSettings as $key => $settings) {
                        if (is_array($settings) && array_key_exists('current', $settings)) {
                            $aDefaultSettings[$key] = $settings['current'];
                        }
                    }
                    $plugin->saveSettings($aDefaultSettings);
                } else {
                    $plugin->active = 1;
                    $plugin->save();
                }
            }
... (5 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_178.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_178 extends DatabaseUpdateBase
{
    public function up()
    {
        if (\Yii::app()->db->driverName == 'mysql') {
            modifyPrimaryKey('questions', array('qid', 'language'));
        }
    }
}
</file>

<file path="application/helpers/update/updates/Update_179.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_179 extends DatabaseUpdateBase
{
    public function up()
    {
            upgradeSurveys177();
            upgradeTokenTables179();
            \alterColumn('{{participants}}', 'email', "string(254)", false);
            \alterColumn('{{participants}}', 'firstname', "string(150)", false);
            \alterColumn('{{participants}}', 'lastname', "string(150)", false);
    }
}
</file>

<file path="application/helpers/update/updates/Update_180.php">
<?php
namespace LimeSurvey\Helpers\Update;
use User;
class Update_180 extends DatabaseUpdateBase
{
    public function up()
    {
        $aUsers = User::model()->findAll();
        $aPerm = array(
            'entity_id' => 0,
            'entity' => 'global',
            'uid' => 0,
            'permission' => 'auth_db',
            'create_p' => 0,
            'read_p' => 1,
            'update_p' => 0,
            'delete_p' => 0,
            'import_p' => 0,
            'export_p' => 0
        );
        foreach ($aUsers as $oUser) {
            $permissionExists = $this->db->createCommand()->select('id')->from("{{permissions}}")->where(
                "(permission='auth_db' OR permission='superadmin') and read_p=1 and entity='global' and uid=:uid",
                [':uid' => $oUser->uid]
            )->queryScalar();
            if ($permissionExists == false) {
                $newPermission = $aPerm;
                $newPermission['uid'] = $oUser->uid;
                $this->db->createCommand()->insert("{{permissions}}", $newPermission);
            }
... (4 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_181.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_181 extends DatabaseUpdateBase
{
    public function up()
    {
        upgradeTokenTables181('utf8_bin');
        upgradeSurveyTables181('utf8_bin');
    }
}
</file>

<file path="application/helpers/update/updates/Update_183.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_183 extends DatabaseUpdateBase
{
    public function up()
    {
            upgradeSurveyTables183();
    }
}
</file>

<file path="application/helpers/update/updates/Update_184.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_184 extends DatabaseUpdateBase
{
    public function up()
    {
            fixKCFinder184();
    }
}
</file>

<file path="application/helpers/update/updates/Update_250.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_250 extends DatabaseUpdateBase
{
    public function up()
    {
            createBoxes250();
    }
}
</file>

<file path="application/helpers/update/updates/Update_251.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_251 extends DatabaseUpdateBase
{
    public function up()
    {
            upgradeBoxesTable251();
    }
}
</file>

<file path="application/helpers/update/updates/Update_252.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_252 extends DatabaseUpdateBase
{
    public function up()
    {
            \Yii::app()->db->createCommand()->addColumn('{{questions}}', 'modulename', 'string');
    }
}
</file>

<file path="application/helpers/update/updates/Update_253.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_253 extends DatabaseUpdateBase
{
    public function up()
    {
            upgradeSurveyTables253();
    }
}
</file>

<file path="application/helpers/update/updates/Update_254.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_254 extends DatabaseUpdateBase
{
    public function up()
    {
            upgradeSurveyTables254();
    }
}
</file>

<file path="application/helpers/update/updates/Update_255.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_255 extends DatabaseUpdateBase
{
    public function up()
    {
            upgradeSurveyTables255();
    }
}
</file>

<file path="application/helpers/update/updates/Update_256.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_256 extends DatabaseUpdateBase
{
    public function up()
    {
            upgradeTokenTables256();
            \alterColumn('{{participants}}', 'email', "text", false);
    }
}
</file>

<file path="application/helpers/update/updates/Update_257.php">
<?php
namespace LimeSurvey\Helpers\Update;
use Exception;
class Update_257 extends DatabaseUpdateBase
{
    public function up()
    {
        switch (\Yii::app()->db->driverName) {
            case 'pgsql':
                $sSubstringCommand = 'substr';
                break;
            default:
                $sSubstringCommand = 'substring';
        }
        $this->db->createCommand("UPDATE {{templates}} set folder={$sSubstringCommand}(folder,1,50)")->execute();
        try {
            dropPrimaryKey('templates');
        } catch (\Exception $e) {
        };
        alterColumn('{{templates}}', 'folder', "string(50)", false);
        addPrimaryKey('templates', 'folder');
        dropPrimaryKey('participant_attribute_names_lang');
        alterColumn('{{participant_attribute_names_lang}}', 'lang', "string(20)", false);
        addPrimaryKey('participant_attribute_names_lang', array('attribute_id', 'lang'));
        if (\Yii::app()->db->driverName == 'mysql') {
            fixMySQLCollations('utf8mb4', 'utf8mb4_unicode_ci');
            upgradeSurveyTables181('utf8mb4_bin');
            upgradeTokenTables181('utf8mb4_bin');
        }
    }
... (2 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_258.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_258 extends DatabaseUpdateBase
{
    public function up()
    {
            \Yii::app()->getDb()->createCommand(
                "DELETE FROM {{settings_global}} WHERE stg_name='adminimageurl'"
            )->execute();
    }
}
</file>

<file path="application/helpers/update/updates/Update_259.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_259 extends DatabaseUpdateBase
{
    public function up()
    {
            $this->db->createCommand()->createTable(
                '{{notifications}}',
                array(
                    'id' => 'pk',
                    'entity' => 'string(15) NOT NULL',
                    'entity_id' => 'integer NOT NULL',
                    'title' => 'string NOT NULL',
                    'message' => 'text NOT NULL',
                    'status' => "string(15) NOT NULL DEFAULT 'new' ",
                    'importance' => 'integer NOT NULL DEFAULT 1',
                    'display_class' => "string(31) DEFAULT 'default'",
                    'created' => 'datetime',
                    'first_read' => 'datetime'
                )
            );
            $this->db->createCommand()->createIndex(
                '{{notif_index}}',
                '{{notifications}}',
                'entity, entity_id, status',
                false
            );
    }
}
</file>

<file path="application/helpers/update/updates/Update_260.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_260 extends DatabaseUpdateBase
{
    public function up()
    {
            \alterColumn('{{participant_attribute_names}}', 'defaultname', "string(255)", false);
            \alterColumn('{{participant_attribute_names_lang}}', 'attribute_name', "string(255)", false);
    }
}
</file>

<file path="application/helpers/update/updates/Update_261.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_261 extends DatabaseUpdateBase
{
    public function up()
    {
            addColumn('{{notifications}}', 'hash', 'string(64)');
            $this->db->createCommand()->createIndex('{{notif_hash_index}}', '{{notifications}}', 'hash', false);
    }
}
</file>

<file path="application/helpers/update/updates/Update_262.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_262 extends DatabaseUpdateBase
{
    public function up()
    {
            \alterColumn('{{settings_global}}', 'stg_value', "text", false);
    }
}
</file>

<file path="application/helpers/update/updates/Update_263.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_263 extends DatabaseUpdateBase
{
    public function up()
    {
    }
}
</file>

<file path="application/helpers/update/updates/Update_290.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_290 extends DatabaseUpdateBase
{
    public function up()
    {
            $aTables = dbGetTablesLike("survey\_%");
            $oSchema = \Yii::app()->db->schema;
        foreach ($aTables as $sTableName) {
            $oTableSchema = $oSchema->getTable($sTableName);
            if (!in_array('lastpage', $oTableSchema->columnNames)) {
                continue;
            }
            if (in_array('seed', $oTableSchema->columnNames)) {
                continue;
            }
            removeMysqlZeroDate($sTableName, $oTableSchema, $this->db);
            \Yii::app()->db->createCommand()->addColumn($sTableName, 'seed', 'string(31)');
            switch (\Yii::app()->db->driverName) {
                case 'pgsql':
                    \Yii::app()->db->createCommand(
                        "UPDATE {$sTableName} SET seed = ROUND(RANDOM() * 10000000)"
                    )->execute();
                    break;
                default:
                    \Yii::app()->db->createCommand(
                        "UPDATE {$sTableName} SET seed = ROUND(RAND() * 10000000, 0)"
                    )->execute();
                    break;
            }
... (4 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_291.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_291 extends DatabaseUpdateBase
{
    public function up()
    {
            addColumn('{{plugins}}', 'version', 'string(32)');
    }
}
</file>

<file path="application/helpers/update/updates/Update_293.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_293 extends DatabaseUpdateBase
{
    public function up()
    {
    }
}
</file>

<file path="application/helpers/update/updates/Update_294.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_294 extends DatabaseUpdateBase
{
    public function up()
    {
    }
}
</file>

<file path="application/helpers/update/updates/Update_296.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_296 extends DatabaseUpdateBase
{
    public function up()
    {
    }
}
</file>

<file path="application/helpers/update/updates/Update_298.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_298 extends DatabaseUpdateBase
{
    public function up()
    {
            upgradeTemplateTables298($this->db);
    }
}
</file>

<file path="application/helpers/update/updates/Update_304.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_304 extends DatabaseUpdateBase
{
    public function up()
    {
            upgradeTemplateTables304($this->db);
    }
}
</file>

<file path="application/helpers/update/updates/Update_305.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_305 extends DatabaseUpdateBase
{
    public function up()
    {
    }
}
</file>

<file path="application/helpers/update/updates/Update_306.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_306 extends DatabaseUpdateBase
{
    public function up()
    {
            createSurveyGroupTables306($this->db);
    }
}
</file>

<file path="application/helpers/update/updates/Update_307.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_307 extends DatabaseUpdateBase
{
    public function up()
    {
        if (tableExists('{settings_user}')) {
            $this->db->createCommand()->dropTable('{{settings_user}}');
        }
            $this->db->createCommand()->createTable(
                '{{settings_user}}',
                array(
                    'id' => 'pk',
                    'uid' => 'integer NOT NULL',
                    'entity' => 'string(15)',
                    'entity_id' => 'string(31)',
                    'stg_name' => 'string(63) NOT NULL',
                    'stg_value' => 'text',
                )
            );
    }
}
</file>

<file path="application/helpers/update/updates/Update_308.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_308 extends DatabaseUpdateBase
{
    public function up()
    {
    }
}
</file>

<file path="application/helpers/update/updates/Update_309.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_309 extends DatabaseUpdateBase
{
    public function up()
    {
    }
}
</file>

<file path="application/helpers/update/updates/Update_310.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_310 extends DatabaseUpdateBase
{
    public function up()
    {
    }
}
</file>

<file path="application/helpers/update/updates/Update_311.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_311 extends DatabaseUpdateBase
{
    public function up()
    {
            addColumn('{{surveys_groups}}', 'template', "string(128) DEFAULT 'default'");
    }
}
</file>

<file path="application/helpers/update/updates/Update_312.php">
<?php
namespace LimeSurvey\Helpers\Update;
use Exception;
class Update_312 extends DatabaseUpdateBase
{
    public function up()
    {
        try {
            setTransactionBookmark();
            $this->db->createCommand()->dropColumn('{{template_configuration}}', 'packages_ltr');
        } catch (\Exception $e) {
            rollBackToTransactionBookmark();
        }
        try {
            setTransactionBookmark();
            $this->db->createCommand()->dropColumn('{{template_configuration}}', 'packages_rtl');
        } catch (\Exception $e) {
            rollBackToTransactionBookmark();
        }
        addColumn('{{template_configuration}}', 'packages_ltr', "text");
        addColumn('{{template_configuration}}', 'packages_rtl', "text");
    }
}
</file>

<file path="application/helpers/update/updates/Update_313.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_313 extends DatabaseUpdateBase
{
    public function up()
    {
    }
}
</file>

<file path="application/helpers/update/updates/Update_314.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_314 extends DatabaseUpdateBase
{
    public function up()
    {
    }
}
</file>

<file path="application/helpers/update/updates/Update_315.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_315 extends DatabaseUpdateBase
{
    public function up()
    {
            $this->db->createCommand()->update(
                '{{template_configuration}}',
                array('packages_to_load' => '["pjax"]'),
                "templates_name='default' OR templates_name='material'"
            );
    }
}
</file>

<file path="application/helpers/update/updates/Update_316.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_316 extends DatabaseUpdateBase
{
    public function up()
    {
    }
}
</file>

<file path="application/helpers/update/updates/Update_317.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_317 extends DatabaseUpdateBase
{
    public function up()
    {
            transferPasswordFieldToText($this->db);
    }
}
</file>

<file path="application/helpers/update/updates/Update_318.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_318 extends DatabaseUpdateBase
{
    public function up()
    {
    }
}
</file>

<file path="application/helpers/update/updates/Update_319.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_319 extends DatabaseUpdateBase
{
    public function up()
    {
            $this->db->createCommand()->update('{{settings_global}}', array('stg_value' => 319), "stg_name='DBVersion'");
            $table = \Yii::app()->db->schema->getTable('{{surveys_groups}}');
        if (isset($table->columns['order'])) {
            $this->db->createCommand()->renameColumn('{{surveys_groups}}', 'order', 'sortorder');
        }
            $table = \Yii::app()->db->schema->getTable('{{templates}}');
        if (isset($table->columns['extends_template_name'])) {
            $this->db->createCommand()->renameColumn('{{templates}}', 'extends_template_name', 'extends');
        }
    }
}
</file>

<file path="application/helpers/update/updates/Update_320.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_320 extends DatabaseUpdateBase
{
    public function up()
    {
    }
}
</file>

<file path="application/helpers/update/updates/Update_321.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_321 extends DatabaseUpdateBase
{
    public function up()
    {
    }
}
</file>

<file path="application/helpers/update/updates/Update_322.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_322 extends DatabaseUpdateBase
{
    public function up()
    {
            $this->db->createCommand()->createTable(
                '{{tutorials}}',
                [
                    'tid' => 'pk',
                    'name' => 'string(128)',
                    'description' => 'text',
                    'active' => 'integer DEFAULT 0',
                    'settings' => 'text',
                    'permission' => 'string(128) NOT NULL',
                    'permission_grade' => 'string(128) NOT NULL'
                ]
            );
            $this->db->createCommand()->createTable(
                '{{tutorial_entries}}',
                [
                    'teid' => 'pk',
                    'tid' => 'integer NOT NULL',
                    'title' => 'text',
                    'content' => 'text',
                    'settings' => 'text'
                ]
            );
    }
}
... (1 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_323.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_323 extends DatabaseUpdateBase
{
    public function up()
    {
            dropPrimaryKey('labels', 'lid');
            $this->db->createCommand()->addColumn('{{labels}}', 'id', 'pk');
            $this->db->createCommand()->createIndex(
                '{{idx4_labels}}',
                '{{labels}}',
                ['lid', 'sortorder', 'language'],
                false
            );
    }
}
</file>

<file path="application/helpers/update/updates/Update_324.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_324 extends DatabaseUpdateBase
{
    public function up()
    {
    }
}
</file>

<file path="application/helpers/update/updates/Update_325.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_325 extends DatabaseUpdateBase
{
    public function up()
    {
        $this->db->createCommand()->dropTable('{{templates}}');
        $this->db->createCommand()->dropTable('{{template_configuration}}');
        $this->db->createCommand()->createTable(
            '{{templates}}',
            array(
                'id' => "pk",
                'name' => "string(150) NOT NULL",
                'folder' => "string(45) NULL",
                'title' => "string(100) NOT NULL",
                'creation_date' => "datetime NULL",
                'author' => "string(150) NULL",
                'author_email' => "string(255) NULL",
                'author_url' => "string(255) NULL",
                'copyright' => "text ",
                'license' => "text ",
                'version' => "string(45) NULL",
                'api_version' => "string(45) NOT NULL",
                'view_folder' => "string(45) NOT NULL",
                'files_folder' => "string(45) NOT NULL",
                'description' => "text ",
                'last_update' => "datetime NULL",
                'owner_id' => "integer NULL",
                'extends' => "string(150)  NULL",
            )
... (229 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_326.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_326 extends DatabaseUpdateBase
{
    public function up()
    {
        $this->db->createCommand()->alterColumn('{{surveys}}', 'datecreated', 'datetime');
    }
}
</file>

<file path="application/helpers/update/updates/Update_327.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_327 extends DatabaseUpdateBase
{
    public function up()
    {
            upgrade327($this->db);
    }
}
</file>

<file path="application/helpers/update/updates/Update_328.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_328 extends DatabaseUpdateBase
{
    public function up()
    {
            upgrade328($this->db);
    }
}
</file>

<file path="application/helpers/update/updates/Update_329.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_329 extends DatabaseUpdateBase
{
    public function up()
    {
    }
}
</file>

<file path="application/helpers/update/updates/Update_330.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_330 extends DatabaseUpdateBase
{
    public function up()
    {
            upgrade330($this->db);
    }
}
</file>

<file path="application/helpers/update/updates/Update_331.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_331 extends DatabaseUpdateBase
{
    public function up()
    {
            upgrade331($this->db);
    }
}
</file>

<file path="application/helpers/update/updates/Update_332.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_332 extends DatabaseUpdateBase
{
    public function up()
    {
    }
}
</file>

<file path="application/helpers/update/updates/Update_333.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_333 extends DatabaseUpdateBase
{
    public function up()
    {
            upgrade333($this->db);
    }
}
</file>

<file path="application/helpers/update/updates/Update_334.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_334 extends DatabaseUpdateBase
{
    public function up()
    {
            $this->db->createCommand()->addColumn('{{tutorials}}', 'title', 'string(192)');
            $this->db->createCommand()->addColumn('{{tutorials}}', 'icon', 'string(64)');
    }
}
</file>

<file path="application/helpers/update/updates/Update_335.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_335 extends DatabaseUpdateBase
{
    public function up()
    {
    }
}
</file>

<file path="application/helpers/update/updates/Update_336.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_336 extends DatabaseUpdateBase
{
    public function up()
    {
    }
}
</file>

<file path="application/helpers/update/updates/Update_337.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_337 extends DatabaseUpdateBase
{
    public function up()
    {
            resetTutorials337($this->db);
    }
}
</file>

<file path="application/helpers/update/updates/Update_338.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_338 extends DatabaseUpdateBase
{
    public function up()
    {
            $rowToRemove = $this->db->createCommand()->select("position, id")->from("{{boxes}}")->where(
                'ico=:ico',
                [':ico' => 'templates']
            )->queryRow();
            $position = 6;
        if ($rowToRemove !== false) {
            $this->db->createCommand()->delete("{{boxes}}", 'id=:id', [':id' => $rowToRemove['id']]);
            $position = $rowToRemove['position'];
        }
            $this->db->createCommand()->insert(
                "{{boxes}}",
                [
                    'position' => $position,
                    'url' => 'admin/themeoptions',
                    'title' => 'Themes',
                    'ico' => 'templates',
                    'desc' => 'Themes',
                    'page' => 'welcome',
                    'usergroup' => '-2'
                ]
            );
    }
}
</file>

<file path="application/helpers/update/updates/Update_339.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_339 extends DatabaseUpdateBase
{
    public function up()
    {
    }
}
</file>

<file path="application/helpers/update/updates/Update_340.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_340 extends DatabaseUpdateBase
{
    public function up()
    {
    }
}
</file>

<file path="application/helpers/update/updates/Update_341.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_341 extends DatabaseUpdateBase
{
    public function up()
    {
            $this->db->createCommand()->truncateTable('{{tutorials}}');
            $this->db->createCommand()->truncateTable('{{tutorial_entries}}');
            $this->db->createCommand()->truncateTable('{{tutorial_entry_relation}}');
    }
}
</file>

<file path="application/helpers/update/updates/Update_342.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_342 extends DatabaseUpdateBase
{
    public function up()
    {
    }
}
</file>

<file path="application/helpers/update/updates/Update_343.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_343 extends DatabaseUpdateBase
{
    public function up()
    {
            \alterColumn('{{answers}}', 'assessment_value', 'integer', false, '0');
    }
}
</file>

<file path="application/helpers/update/updates/Update_344.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_344 extends DatabaseUpdateBase
{
    public function up()
    {
        $this->db->createCommand()->update(
            '{{templates}}',
            [
                'extends' => 'vanilla',
            ],
            "extends = '' AND name != 'vanilla'"
        );
        $vanilla = $this->db
            ->createCommand()
            ->select('*')
            ->from('{{templates}}')
            ->where('name=:name', ['name' => 'vanilla'])
            ->queryRow();
        if (empty($vanilla)) {
            $vanillaData = [
                'name' => 'vanilla',
                'folder' => 'vanilla',
                'title' => 'Vanilla Theme',
                'creation_date' => date('Y-m-d H:i:s'),
                'author' => 'Louis Gac',
                'author_email' => 'louis.gac@limesurvey.org',
                'author_url' => 'https://www.limesurvey.org/',
                'copyright' => 'Copyright (C) 2007-2026 The LimeSurvey Project Team\\r\\nAll rights reserved.',
                'license' => 'License: GNU/GPL License v2 or later, see LICENSE.php\\r\\n\\r\\nLimeSurvey is free software. This version may have been modified pursuant to the GNU General Public License, and as distributed it includes or is derivative of works licensed under the GNU General Public License or other free or open source software licenses. See COPYRIGHT.php for copyright notices and details.',
... (39 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_345.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_345 extends DatabaseUpdateBase
{
    public function up()
    {
        $fruityConf = $this->db
           ->createCommand()
           ->select('*')
           ->from('{{template_configuration}}')
           ->where('template_name=:template_name', ['template_name' => 'fruity'])
           ->queryRow();
        if ($fruityConf) {
            $this->db->createCommand()->update(
                '{{template_configuration}}',
                [
                    'files_css' => '{"add":["css/ajaxify.css","css/animate.css","css/variations/sea_green.css","css/theme.css","css/custom.css"]}',
                    'files_js' => '{"add":["scripts/theme.js","scripts/ajaxify.js","scripts/custom.js"]}',
                    'files_print_css' => '{"add":["css/print_theme.css"]}',
                    'options' => '{"ajaxmode":"off","brandlogo":"on","brandlogofile":"./files/logo.png","container":"on","backgroundimage":"off","backgroundimagefile":"./files/pattern.png","animatebody":"off","bodyanimation":"fadeInRight","bodyanimationduration":"1.0","animatequestion":"off","questionanimation":"flipInX","questionanimationduration":"1.0","animatealert":"off","alertanimation":"shake","alertanimationduration":"1.0","font":"noto","bodybackgroundcolor":"#ffffff","fontcolor":"#444444","questionbackgroundcolor":"#ffffff","questionborder":"on","questioncontainershadow":"on","checkicon":"f00c","animatecheckbox":"on","checkboxanimation":"rubberBand","checkboxanimationduration":"0.5","animateradio":"on","radioanimation":"zoomIn","radioanimationduration":"0.3","showpopups":"1", "showclearall":"off", "questionhelptextposition":"top"}',
                    'cssframework_name' => 'bootstrap',
                    'cssframework_css' => '{}',
                    'cssframework_js' => '',
                    'packages_to_load' => '{"add":["pjax","font-noto","moment"]}',
                ],
                "template_name = 'fruity'"
            );
        } else {
            $fruityConfData = [
                'template_name' => 'fruity',
... (59 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_346.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_346 extends DatabaseUpdateBase
{
    public function up()
    {
            createSurveyMenuTable($this->db);
            $this->db->createCommand()->truncateTable('{{tutorials}}');
            $this->db->createCommand()->truncateTable('{{tutorial_entries}}');
            $this->db->createCommand()->truncateTable('{{tutorial_entry_relation}}');
    }
}
</file>

<file path="application/helpers/update/updates/Update_347.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_347 extends DatabaseUpdateBase
{
    public function up()
    {
            $this->db->createCommand()->update(
                '{{surveymenu_entries}}',
                [
                    'permission' => 'surveylocale',
                ],
                'name=\'emailtemplates\''
            );
    }
}
</file>

<file path="application/helpers/update/updates/Update_348.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_348 extends DatabaseUpdateBase
{
    public function up()
    {
            $this->db->createCommand()->addColumn('{{surveys_languagesettings}}', 'surveyls_policy_notice', 'text');
            $this->db->createCommand()->addColumn('{{surveys_languagesettings}}', 'surveyls_policy_error', 'text');
            $this->db->createCommand()->addColumn(
                '{{surveys_languagesettings}}',
                'surveyls_policy_notice_label',
                'string(192)'
            );
            $this->db->createCommand()->addColumn('{{surveys}}', 'showsurveypolicynotice', 'integer DEFAULT 0');
    }
}
</file>

<file path="application/helpers/update/updates/Update_349.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_349 extends DatabaseUpdateBase
{
    public function up()
    {
            dropColumn('{{users}}', 'one_time_pw');
            addColumn('{{users}}', 'one_time_pw', 'text');
    }
}
</file>

<file path="application/helpers/update/updates/Update_350.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_350 extends DatabaseUpdateBase
{
    public function up()
    {
            $this->db->createCommand()->createTable(
                '{{asset_version}}',
                array(
                    'id' => 'pk',
                    'path' => 'text NOT NULL',
                    'version' => 'integer NOT NULL',
                )
            );
    }
}
</file>

<file path="application/helpers/update/updates/Update_351.php">
<?php
namespace LimeSurvey\Helpers\Update;
use TemplateConfiguration;
class Update_351 extends DatabaseUpdateBase
{
    public function up()
    {
        $themes = TemplateConfiguration::model()->findAll();
        foreach ($themes as $theme) {
            $theme->setGlobalOption("ajaxmode", "on");
        }
    }
}
</file>

<file path="application/helpers/update/updates/Update_352.php">
<?php
namespace LimeSurvey\Helpers\Update;
use TemplateConfiguration;
class Update_352 extends DatabaseUpdateBase
{
    public function up()
    {
        dropColumn('{{sessions}}', 'data');
        addColumn('{{sessions}}', 'data', 'binary');
        $themes = TemplateConfiguration::model()->findAll();
        foreach ($themes as $theme) {
            $theme->setGlobalOption("ajaxmode", "off");
        }
    }
}
</file>

<file path="application/helpers/update/updates/Update_353.php">
<?php
namespace LimeSurvey\Helpers\Update;
use TemplateConfiguration;
class Update_353 extends DatabaseUpdateBase
{
    public function up()
    {
        $themes = TemplateConfiguration::model()->findAll();
        foreach ($themes as $theme) {
            $theme->addOptionFromXMLToLiveTheme();
        }
    }
}
</file>

<file path="application/helpers/update/updates/Update_354.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_354 extends DatabaseUpdateBase
{
    public function up()
    {
            $surveymenuTable = \Yii::app()->db->schema->getTable('{{surveymenu}}');
        if (!isset($surveymenuTable->columns['showincollapse'])) {
            $this->db->createCommand()->addColumn('{{surveymenu}}', 'showincollapse', 'integer DEFAULT 0');
        }
            $surveymenuEntryTable = \Yii::app()->db->schema->getTable('{{surveymenu}}');
        if (!isset($surveymenuEntryTable->columns['showincollapse'])) {
            $this->db->createCommand()->addColumn('{{surveymenu_entries}}', 'showincollapse', 'integer DEFAULT 0');
        }
            $aIdMap = [];
            $aDefaultSurveyMenus = \LsDefaultDataSets::getSurveyMenuData();
            switchMSSQLIdentityInsert('surveymenu', true);
        foreach ($aDefaultSurveyMenus as $i => $aSurveymenu) {
            $this->db->createCommand()->delete('{{surveymenu}}', 'name=:name', [':name' => $aSurveymenu['name']]);
            $this->db->createCommand()->delete('{{surveymenu}}', 'id=:id', [':id' => $aSurveymenu['id']]);
            $this->db->createCommand()->insert('{{surveymenu}}', $aSurveymenu);
            $aIdMap[$aSurveymenu['name']] = $aSurveymenu['id'];
        }
            switchMSSQLIdentityInsert('surveymenu', false);
            $aDefaultSurveyMenuEntries = \LsDefaultDataSets::getSurveyMenuEntryData();
        foreach ($aDefaultSurveyMenuEntries as $i => $aSurveymenuentry) {
            $this->db->createCommand()->delete(
                '{{surveymenu_entries}}',
                'name=:name',
                [':name' => $aSurveymenuentry['name']]
... (21 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_355.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_355 extends DatabaseUpdateBase
{
    public function up()
    {
            $aIdMap = [];
            $aDefaultSurveyMenus = \LsDefaultDataSets::getSurveyMenuData();
        foreach ($aDefaultSurveyMenus as $i => $aSurveymenu) {
            $aIdMap[$aSurveymenu['name']] = $this->db->createCommand()
                ->select(['id'])
                ->from('{{surveymenu}}')
                ->where('name=:name', [':name' => $aSurveymenu['name']])
                ->queryScalar();
        }
            $aDefaultSurveyMenuEntries = \LsDefaultDataSets::getSurveyMenuEntryData();
        foreach ($aDefaultSurveyMenuEntries as $i => $aSurveymenuentry) {
            $this->db->createCommand()->delete(
                '{{surveymenu_entries}}',
                'name=:name',
                [':name' => $aSurveymenuentry['name']]
            );
            switch ($aSurveymenuentry['menu_id']) {
                case 1:
                    $aSurveymenuentry['menu_id'] = $aIdMap['settings'];
                    break;
                case 2:
                    $aSurveymenuentry['menu_id'] = $aIdMap['mainmenu'];
                    break;
                case 3:
... (11 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_356.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_356 extends DatabaseUpdateBase
{
    public function up()
    {
        switch (\Yii::app()->db->driverName) {
            case 'sqlsrv':
            case 'dblib':
            case 'mssql':
                $this->db->createCommand("UPDATE {{boxes}} SET ico = 'icon-' + ico")->execute();
                break;
            default:
                $this->db->createCommand("UPDATE {{boxes}} SET ico = CONCAT('icon-', ico)")->execute();
                break;
        }
            $labelBox = $this->db->createCommand(
                "SELECT * FROM {{boxes}} WHERE id = 5 AND position = 5 AND title = 'Label sets'"
            )->queryRow();
        if ($labelBox) {
            $this->db
                ->createCommand()
                ->update(
                    '{{boxes}}',
                    [
                        'title' => 'LimeStore',
                        'ico' => 'ri-shopping-cart-fill',
                        'desc' => 'LimeSurvey extension marketplace',
                        'url' => 'https://account.limesurvey.org/limestore'
                    ],
... (6 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_357.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_357 extends DatabaseUpdateBase
{
    public function up()
    {
            $this->db->createCommand()->renameColumn('{{surveys_groups}}', 'owner_uid', 'owner_id');
    }
}
</file>

<file path="application/helpers/update/updates/Update_358.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_358 extends DatabaseUpdateBase
{
    public function up()
    {
            dropColumn('{{sessions}}', 'data');
            addColumn('{{sessions}}', 'data', 'longbinary');
    }
}
</file>

<file path="application/helpers/update/updates/Update_359.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_359 extends DatabaseUpdateBase
{
    public function up()
    {
        alterColumn('{{notifications}}', 'message', "text", false);
        alterColumn('{{settings_user}}', 'stg_value', "text", true);
        alterColumn('{{surveys_languagesettings}}', 'surveyls_description', "text", true);
        alterColumn('{{surveys_languagesettings}}', 'surveyls_welcometext', "text", true);
        alterColumn('{{surveys_languagesettings}}', 'surveyls_endtext', "text", true);
        alterColumn('{{surveys_languagesettings}}', 'surveyls_policy_notice', "text", true);
        alterColumn('{{surveys_languagesettings}}', 'surveyls_policy_error', "text", true);
        alterColumn('{{surveys_languagesettings}}', 'surveyls_url', "text", true);
        alterColumn('{{surveys_languagesettings}}', 'surveyls_email_invite', "text", true);
        alterColumn('{{surveys_languagesettings}}', 'surveyls_email_remind', "text", true);
        alterColumn('{{surveys_languagesettings}}', 'surveyls_email_register', "text", true);
        alterColumn('{{surveys_languagesettings}}', 'surveyls_email_confirm', "text", true);
        alterColumn('{{surveys_languagesettings}}', 'surveyls_attributecaptions', "text", true);
        alterColumn('{{surveys_languagesettings}}', 'email_admin_notification', "text", true);
        alterColumn('{{surveys_languagesettings}}', 'email_admin_responses', "text", true);
        alterColumn('{{surveys_languagesettings}}', 'surveyls_numberformat', "integer", false, '0');
        alterColumn('{{user_groups}}', 'description', "text", false);
    }
}
</file>

<file path="application/helpers/update/updates/Update_360.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_360 extends DatabaseUpdateBase
{
    public function up()
    {
            $this->db->createCommand()->update(
                '{{surveymenu_entries}}',
                [
                    'permission' => 'tokens',
                ],
                'name=\'participants\''
            );
    }
}
</file>

<file path="application/helpers/update/updates/Update_363.php">
<?php
namespace LimeSurvey\Helpers\Update;
use Exception;
class Update_363 extends DatabaseUpdateBase
{
    public function up()
    {
        $aTableNames = dbGetTablesLike("tokens%");
        foreach ($aTableNames as $sTableName) {
            try {
                setTransactionBookmark();
                switch ($this->db->driverName) {
                    case 'mysql':
                    case 'mysqli':
                        $this->db->createCommand()->createIndex('idx_email', $sTableName, 'email(30)', false);
                        break;
                    case 'pgsql':
                        $this->db->createCommand()->createIndex(
                            'idx_email_' . substr((string) $sTableName, 7) . '_' . rand(1, 50000),
                            $sTableName,
                            'email',
                            false
                        );
                        break;
                }
            } catch (\Exception $e) {
                rollBackToTransactionBookmark();
            }
        }
    }
... (2 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_364.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_364 extends DatabaseUpdateBase
{
    public function up()
    {
            extendDatafields364($this->db);
    }
}
</file>

<file path="application/helpers/update/updates/Update_400.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_400 extends DatabaseUpdateBase
{
    public function up()
    {
        if ($this->db->driverName == 'mysql') {
            try {
                $this->db->createCommand(
                    "ALTER DATABASE `" . getDBConnectionStringProperty(
                        'dbname'
                    ) . "` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"
                )->execute();
            } catch (\Exception $e) {
            }
            fixMySQLConfigCharset();
        }
        if ($this->db->schema->getTable('{{question_l10ns}}')) {
            $this->db->createCommand()->dropTable('{{question_l10ns}}');
        }
        $this->db->createCommand()->createTable(
            '{{question_l10ns}}',
            array(
                'id' => "pk",
                'qid' => "integer NOT NULL",
                'question' => "mediumtext NOT NULL",
                'help' => "mediumtext",
                'language' => "string(20) NOT NULL"
            ),
            $this->options
... (222 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_401.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_401 extends DatabaseUpdateBase
{
    public function up()
    {
            $this->db->createCommand()->addColumn('{{plugins}}', 'load_error', 'int DEFAULT 0');
            $this->db->createCommand()->addColumn('{{plugins}}', 'load_error_message', 'text');
            $this->db->createCommand()->update('{{settings_global}}', array('stg_value' => 401), "stg_name='DBVersion'");
    }
}
</file>

<file path="application/helpers/update/updates/Update_402.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_402 extends DatabaseUpdateBase
{
    public function up()
    {
            $this->db->createCommand()->addColumn('{{plugins}}', 'plugin_type', "string(6) DEFAULT 'user'");
            $this->db->createCommand()->update('{{settings_global}}', array('stg_value' => 402), "stg_name='DBVersion'");
    }
}
</file>

<file path="application/helpers/update/updates/Update_403.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_403 extends DatabaseUpdateBase
{
    public function up()
    {
            upgradeTokenTables402('utf8mb4_bin');
            upgradeSurveyTables402('utf8mb4_bin');
    }
}
</file>

<file path="application/helpers/update/updates/Update_404.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_404 extends DatabaseUpdateBase
{
    public function up()
    {
            createSurveysGroupSettingsTable($this->db);
    }
}
</file>

<file path="application/helpers/update/updates/Update_405.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_405 extends DatabaseUpdateBase
{
    public function up()
    {
            $this->db->createCommand(
                "
                UPDATE
                    {{boxes}}
                SET ico = CASE
                    WHEN ico IN ('add', 'list', 'settings', 'shield', 'templates', 'label') THEN CONCAT('icon-', ico)
                    ELSE ico
                END
                "
            )->execute();
    }
}
</file>

<file path="application/helpers/update/updates/Update_406.php">
<?php
namespace LimeSurvey\Helpers\Update;
use Exception;
use Token;
class Update_406 extends DatabaseUpdateBase
{
    public function up()
    {
        $this->db->createCommand()->addColumn('{{surveys}}', 'tokenencryptionoptions', "text");
        $this->db->createCommand()->update(
            '{{surveys}}',
            array(
                'tokenencryptionoptions' => json_encode(
                    Token::getDefaultEncryptionOptions()
                )
            )
        );
        try {
            setTransactionBookmark();
            $this->db->createCommand()->dropIndex('{{idx1_participants}}', '{{participants}}');
        } catch (\Exception $e) {
            rollBackToTransactionBookmark();
        }
        try {
            setTransactionBookmark();
            $this->db->createCommand()->dropIndex('{{idx2_participants}}', '{{participants}}');
        } catch (\Exception $e) {
            rollBackToTransactionBookmark();
        }
        \alterColumn('{{participants}}', 'firstname', "text");
... (20 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_407.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_407 extends DatabaseUpdateBase
{
    public function up()
    {
        if (\Yii::app()->db->schema->getTable('{{defaultvalue_l10ns}}')) {
            $this->db->createCommand()->dropTable('{{defaultvalue_l10ns}}');
        }
        $this->db->createCommand()->createTable(
            '{{defaultvalue_l10ns}}',
            array(
                'id' => "pk",
                'dvid' => "integer NOT NULL DEFAULT '0'",
                'language' => "string(20) NOT NULL",
                'defaultvalue' => "text",
            ),
            $this->options
        );
        $this->db->createCommand()->createIndex(
            '{{idx1_defaultvalue_l10ns}}',
            '{{defaultvalue_l10ns}}',
            ['dvid', 'language'],
            true
        );
        if (\Yii::app()->db->schema->getTable('{{defaultvalues_update407}}')) {
            $this->db->createCommand()->dropTable('{{defaultvalues_update407}}');
        }
        $this->db->createCommand()->renameTable('{{defaultvalues}}', '{{defaultvalues_update407}}');
        $this->db->createCommand()->createIndex(
... (40 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_408.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_408 extends DatabaseUpdateBase
{
    public function up()
    {
            $this->db->createCommand()->update(
                '{{participant_attribute_names}}',
                array('encrypted' => 'Y'),
                "core_attribute='Y'"
            );
    }
}
</file>

<file path="application/helpers/update/updates/Update_409.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_409 extends DatabaseUpdateBase
{
    public function up()
    {
            $sEncrypted = 'N';
            $this->db->createCommand()->update(
                '{{participant_attribute_names}}',
                array('encrypted' => $sEncrypted),
                "core_attribute='Y'"
            );
    }
}
</file>

<file path="application/helpers/update/updates/Update_410.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_410 extends DatabaseUpdateBase
{
    public function up()
    {
            $this->db->createCommand()->addColumn('{{question_l10ns}}', 'script', " text NULL DEFAULT NULL");
    }
}
</file>

<file path="application/helpers/update/updates/Update_411.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_411 extends DatabaseUpdateBase
{
    public function up()
    {
            $this->db->createCommand()->addColumn('{{plugins}}', 'priority', "int NOT NULL DEFAULT 0");
    }
}
</file>

<file path="application/helpers/update/updates/Update_412.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_412 extends DatabaseUpdateBase
{
    public function up()
    {
        $sSurveyGroupQuery = "SELECT gsid  from {{surveys_groups}} order by gsid";
        $aGroups = $this->db->createCommand($sSurveyGroupQuery)->queryColumn();
        $sSurveyGroupSettingsQuery = "SELECT gsid  from {{surveys_groupsettings}} order by gsid";
        $aGroupSettings = $this->db->createCommand($sSurveyGroupSettingsQuery)->queryColumn();
        foreach ($aGroups as $group) {
            if (!array_key_exists($group, $aGroupSettings)) {
                $attributes = array(
                    'gsid' => $group,
                    'owner_id' => -1,
                    'admin' => 'inherit',
                    'adminemail' => 'inherit',
                    'anonymized' => 'I',
                    'format' => 'I',
                    'savetimings' => 'I',
                    'template' => 'inherit',
                    'datestamp' => 'I',
                    'usecookie' => 'I',
                    'allowregister' => 'I',
                    'allowsave' => 'I',
                    'autonumber_start' => 0,
                    'autoredirect' => 'I',
                    'allowprev' => 'I',
                    'printanswers' => 'I',
                    'ipaddr' => 'I',
... (31 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_413.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_413 extends DatabaseUpdateBase
{
    public function up()
    {
    }
}
</file>

<file path="application/helpers/update/updates/Update_414.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_414 extends DatabaseUpdateBase
{
    public function up()
    {
            $this->db->createCommand()->addColumn('{{users}}', 'lastLogin', "datetime NULL");
    }
}
</file>

<file path="application/helpers/update/updates/Update_415.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_415 extends DatabaseUpdateBase
{
    public function up()
    {
            $this->db->createCommand()->update(
                '{{surveymenu_entries}}',
                [
                    "menu_link" => "admin/filemanager",
                    "action" => '',
                    "template" => '',
                    "partial" => '',
                    "classes" => '',
                    "data" => '{"render": { "link": {"data": {"surveyid": ["survey","sid"]}}}}',
                ],
                'name=:name',
                [':name' => 'resources']
            );
    }
}
</file>

<file path="application/helpers/update/updates/Update_416.php">
<?php
namespace LimeSurvey\Helpers\Update;
use SettingGlobal;
use LSActiveRecord;
class Update_416 extends DatabaseUpdateBase
{
    public function up()
    {
        SettingGlobal::setSetting(
            'emailsmtppassword',
            LSActiveRecord::encryptSingle(App()->getConfig('emailsmtppassword'))
        );
        SettingGlobal::setSetting(
            'bounceaccountpass',
            LSActiveRecord::encryptSingle(App()->getConfig('bounceaccountpass'))
        );
        \alterColumn('{{surveys}}', 'bounceaccountpass', "text", true, 'NULL');
        $sSurveyQuery = "SELECT * from {{surveys}} order by sid";
        $aSurveys = $this->db->createCommand($sSurveyQuery)->queryAll();
        foreach ($aSurveys as $aSurvey) {
            if (!empty($aSurvey['bounceaccountpass'])) {
                $this->db->createCommand()->update(
                    '{{surveys}}',
                    [
                        'bounceaccountpass' => LSActiveRecord::encryptSingle(
                            $aSurvey['bounceaccountpass']
                        )
                    ],
                    "sid=" . $aSurvey['sid']
                );
... (5 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_417.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_417 extends DatabaseUpdateBase
{
    public function up()
    {
        $this->db->createCommand()->delete('{{surveymenu_entries}}', 'name=:name', [':name' => 'reorder']);
    }
}
</file>

<file path="application/helpers/update/updates/Update_418.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_418 extends DatabaseUpdateBase
{
    public function up()
    {
        $this->db->createCommand()->insert(
            "{{plugins}}",
            [
                'name' => 'PasswordRequirement',
                'plugin_type' => 'core',
                'active' => 1,
                'version' => '1.0.0',
                'load_error' => 0,
                'load_error_message' => null
            ]
        );
    }
}
</file>

<file path="application/helpers/update/updates/Update_419.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_419 extends DatabaseUpdateBase
{
    public function up()
    {
        $this->db->createCommand()->createTable(
            "{{permissiontemplates}}",
            [
                'ptid' => "pk",
                'name' => "string(127) NOT NULL",
                'description' => "text NULL",
                'renewed_last' => "datetime NULL",
                'created_at' => "datetime NOT NULL",
                'created_by' => "int NOT NULL"
            ]
        );
        $this->db->createCommand()->createIndex('{{idx1_name}}', '{{permissiontemplates}}', 'name', true);
        $this->db->createCommand()->createTable(
            '{{user_in_permissionrole}}',
            array(
                'ptid' => "integer NOT NULL",
                'uid' => "integer NOT NULL",
            ),
            $this->options
        );
        $this->db->createCommand()->addPrimaryKey(
            '{{user_in_permissionrole_pk}}',
            '{{user_in_permissionrole}}',
            ['ptid', 'uid']
... (4 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_420.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_420 extends DatabaseUpdateBase
{
    public function up()
    {
        $this->db->createCommand()->update(
            "{{surveymenu_entries}}",
            [
                'name' => "listSurveyGroups",
                'title' => gT('Group list', 'unescaped'),
                'menu_title' => gT('Group list', 'unescaped'),
                'menu_description' => gT('List question groups', 'unescaped'),
            ],
            'name=\'listQuestionGroups\''
        );
    }
}
</file>

<file path="application/helpers/update/updates/Update_421.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_421 extends DatabaseUpdateBase
{
    public function up()
    {
            $this->db->createCommand()->createTable(
                '{{question_themes}}',
                [
                    'id' => "pk",
                    'name' => "string(150) NOT NULL",
                    'visible' => "string(1) NULL",
                    'xml_path' => "string(255) NULL",
                    'image_path' => 'string(255) NULL',
                    'title' => "string(100) NOT NULL",
                    'creation_date' => "datetime NULL",
                    'author' => "string(150) NULL",
                    'author_email' => "string(255) NULL",
                    'author_url' => "string(255) NULL",
                    'copyright' => "text",
                    'license' => "text",
                    'version' => "string(45) NULL",
                    'api_version' => "string(45) NOT NULL",
                    'description' => "text",
                    'last_update' => "datetime NULL",
                    'owner_id' => "integer NULL",
                    'theme_type' => "string(150)",
                    'question_type' => "string(150) NOT NULL",
                    'core_theme' => 'boolean',
                    'extends' => "string(150) NULL",
... (14 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_422.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_422 extends DatabaseUpdateBase
{
    public function up()
    {
            $this->db->createCommand()->update(
                '{{templates}}',
                array(
                    'api_version' => "4.0",
                    'version' => "4.0",
                    'copyright' => "Copyright (C) 2007-2026 The LimeSurvey Project Team\r\nAll rights reserved."
                ),
                "name='fruity'"
            );
            $this->db->createCommand()->update(
                '{{templates}}',
                array(
                    'api_version' => "4.0",
                    'version' => "4.0",
                    'copyright' => "Copyright (C) 2007-2026 The LimeSurvey Project Team\r\nAll rights reserved."
                ),
                "name='vanilla'"
            );
            $this->db->createCommand()->update(
                '{{templates}}',
                array(
                    'api_version' => "4.0",
                    'version' => "4.0",
                    'copyright' => "Copyright (C) 2007-2026 The LimeSurvey Project Team\r\nAll rights reserved."
... (6 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_423.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_423 extends DatabaseUpdateBase
{
    public function up()
    {
            $this->db->createCommand()->update(
                '{{templates}}',
                array(
                    'api_version' => "3.0",
                    'version' => "3.0",
                    'copyright' => "Copyright (C) 2007-2026 The LimeSurvey Project Team\r\nAll rights reserved."
                ),
                "name='fruity'"
            );
            $this->db->createCommand()->update(
                '{{templates}}',
                array(
                    'api_version' => "3.0",
                    'version' => "3.0",
                    'copyright' => "Copyright (C) 2007-2026 The LimeSurvey Project Team\r\nAll rights reserved."
                ),
                "name='vanilla'"
            );
            $this->db->createCommand()->update(
                '{{templates}}',
                array(
                    'api_version' => "3.0",
                    'version' => "3.0",
                    'copyright' => "Copyright (C) 2007-2026 The LimeSurvey Project Team\r\nAll rights reserved."
... (6 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_424.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_424 extends DatabaseUpdateBase
{
    public function up()
    {
            $installedPlugins = array_map(
                function ($v) {
                    return $v['name'];
                },
                $this->db->createCommand('SELECT name FROM {{plugins}}')->queryAll()
            );
            $insertPlugin = function ($name, $active = 0) use ($installedPlugins) {
                if (!in_array($name, $installedPlugins)) {
                    $this->db->createCommand()->insert(
                        "{{plugins}}",
                        [
                            'name' => $name,
                            'plugin_type' => 'core',
                            'active' => $active,
                            'version' => '1.0.0',
                            'load_error' => 0,
                            'load_error_message' => null
                        ]
                    );
                } else {
                    $this->db->createCommand()->update(
                        "{{plugins}}",
                        [
                            'plugin_type' => 'core',
... (22 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_425.php">
<?php
namespace LimeSurvey\Helpers\Update;
use QuestionTheme;
use Throwable;
class Update_425 extends DatabaseUpdateBase
{
    public function up()
    {
        $aUserDirectory = QuestionTheme::getAllQuestionXMLPaths(false, false, true);
        if (!empty($aUserDirectory)) {
            reset($aUserDirectory);
            $aUserXMLPaths = key($aUserDirectory);
            foreach ($aUserDirectory[$aUserXMLPaths] as $sXMLDirectoryPath) {
                try {
                    $aSuccess = QuestionTheme::convertLegacyQuestionTheme($sXMLDirectoryPath);
                    if ($aSuccess['success']) {
                        $oQuestionTheme = new QuestionTheme();
                        $oQuestionTheme->importManifest($sXMLDirectoryPath, true);
                    }
                } catch (Throwable $e) {
                    continue;
                }
            }
        }
    }
}
</file>

<file path="application/helpers/update/updates/Update_426.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_426 extends DatabaseUpdateBase
{
    public function up()
    {
            $this->db->createCommand()->addColumn(
                '{{surveys_groupsettings}}',
                'ipanonymize',
                "string(1) NOT NULL DEFAULT 'N'"
            );
            $this->db->createCommand()->addColumn('{{surveys}}', 'ipanonymize', "string(1) NOT NULL DEFAULT 'N'");
            $this->db->createCommand()->update('{{surveys_groupsettings}}', array('ipanonymize' => 'I'), 'gsid<>0');
            $this->db->createCommand()->update('{{surveys_groupsettings}}', array('ipanonymize' => 'I'), 'gsid=1');
            $this->db->createCommand()->update('{{surveys}}', array('ipanonymize' => 'I'), "active='N'");
    }
}
</file>

<file path="application/helpers/update/updates/Update_427.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_427 extends DatabaseUpdateBase
{
    public function up()
    {
            $this->db->createCommand()->update(
                '{{surveymenu_entries}}',
                array(
                    'menu_link' => '',
                    'action' => 'updatesurveylocalsettings',
                    'template' => 'editLocalSettings_main_view',
                    'partial' => '/admin/survey/subview/accordion/_resources_panel'
                ),
                "name='resources'"
            );
    }
}
</file>

<file path="application/helpers/update/updates/Update_428.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_428 extends DatabaseUpdateBase
{
    public function up()
    {
            $this->db->createCommand()->update(
                '{{template_configuration}}',
                [
                    'files_css' => '{"add":["css/base.css","css/theme.css","css/custom.css","css/noTablesOnMobile.css"]}',
                ],
                "template_name = 'vanilla' AND files_css != 'inherit'"
            );
            $this->db->createCommand()->update(
                '{{template_configuration}}',
                [
                    'files_css' => '{"add":["css/base.css","css/theme.css","css/custom.css","css/noTablesOnMobile.css"]}',
                ],
                "template_name = 'bootswatch' AND files_css != 'inherit'"
            );
    }
}
</file>

<file path="application/helpers/update/updates/Update_429.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_429 extends DatabaseUpdateBase
{
    public function up()
    {
        extendDatafields429($this->db);
        $this->db->createCommand()->update(
            '{{surveymenu_entries}}',
            array(
                'menu_link' => '',
                'action' => 'updatesurveylocalesettings',
                'template' => 'editLocalSettings_main_view',
                'partial' => '/admin/survey/subview/accordion/_resources_panel',
                'getdatamethod' => 'tabResourceManagement'
            ),
            "name='resources'"
        );
    }
}
</file>

<file path="application/helpers/update/updates/Update_430.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_430 extends DatabaseUpdateBase
{
    public function up()
    {
        $plugin = $this->db->createCommand()
            ->select('*')
            ->from('{{plugins}}')
            ->where("name = :name", [':name' => 'ComfortUpdateChecker'])
            ->queryRow();
        if (empty($plugin)) {
            $this->db->createCommand()->insert(
                "{{plugins}}",
                [
                    'name' => 'ComfortUpdateChecker',
                    'plugin_type' => 'core',
                    'active' => 1,
                    'version' => '1.0.0',
                    'load_error' => 0,
                    'load_error_message' => null
                ]
            );
        }
    }
}
</file>

<file path="application/helpers/update/updates/Update_431.php">
<?php
namespace LimeSurvey\Helpers\Update;
use SurveymenuEntries;
use LsDefaultDataSets;
class Update_431 extends DatabaseUpdateBase
{
    public function up()
    {
        $this->db->createCommand()->update(
            '{{boxes}}',
            array(
                'url' => 'surveyAdministration/listsurveys',
            ),
            "url='admin/survey/sa/listsurveys'"
        );
        $this->db->createCommand()->update(
            '{{boxes}}',
            array(
                'url' => 'surveyAdministration/newSurvey',
            ),
            "url='admin/survey/sa/newSurvey'"
        );
        $this->db->createCommand()->update(
            '{{surveymenu_entries}}',
            array(
                'name' => 'listQuestionGroups',
                'menu_link' => 'questionGroupsAdministration/listquestiongroups',
            ),
            "name='listSurveyGroups'"
        );
... (104 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_432.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_432 extends DatabaseUpdateBase
{
    public function up()
    {
        $this->db->createCommand()->update(
            '{{surveymenu_entries}}',
            [
                'menu_link' => 'themeOptions/updateSurvey',
                'data' => '{"render": {"link": { "pjaxed": true, "data": {"sid": ["survey","sid"], "gsid":["survey","gsid"]}}}}'
            ],
            "name='theme_options'"
        );
    }
}
</file>

<file path="application/helpers/update/updates/Update_433.php">
<?php
namespace LimeSurvey\Helpers\Update;
use Exception;
class Update_433 extends DatabaseUpdateBase
{
    public function up()
    {
        $aTableNames = dbGetTablesLike("tokens%");
        foreach ($aTableNames as $sTableName) {
            try {
                setTransactionBookmark();
                switch ($this->db->driverName) {
                    case 'mysql':
                    case 'mysqli':
                        try {
                            setTransactionBookmark();
                            $this->db->createCommand()->createIndex('idx_email', $sTableName, 'email(30)', false);
                        } catch (\Exception $e) {
                            rollBackToTransactionBookmark();
                        }
                        break;
                    case 'pgsql':
                        try {
                            setTransactionBookmark();
                            $this->db->createCommand()->createIndex('idx_email', $sTableName, 'email', false);
                        } catch (\Exception $e) {
                            rollBackToTransactionBookmark();
                        }
                        break;
                }
... (7 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_434.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_434 extends DatabaseUpdateBase
{
    public function up()
    {
            $defaultSetting = \LsDefaultDataSets::getDefaultUserAdministrationSettings();
            $this->db->createCommand()->delete('{{settings_global}}', 'stg_name=:name', [':name' => 'sendadmincreationemail']);
            $this->db->createCommand()->delete('{{settings_global}}', 'stg_name=:name', [':name' => 'admincreationemailsubject']);
            $this->db->createCommand()->delete('{{settings_global}}', 'stg_name=:name', [':name' => 'admincreationemailtemplate']);
            $this->db->createCommand()->insert(
                '{{settings_global}}',
                [
                    "stg_name" => 'sendadmincreationemail',
                    "stg_value" => $defaultSetting['sendadmincreationemail'],
                ]
            );
            $this->db->createCommand()->insert(
                '{{settings_global}}',
                [
                    "stg_name" => 'admincreationemailsubject',
                    "stg_value" => $defaultSetting['admincreationemailsubject'],
                ]
            );
            $this->db->createCommand()->insert(
                '{{settings_global}}',
                [
                    "stg_name" => 'admincreationemailtemplate',
                    "stg_value" => $defaultSetting['admincreationemailtemplate'],
                ]
... (4 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_435.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_435 extends DatabaseUpdateBase
{
    public function up()
    {
            $defaultSurveyGroupExists = $this->db->createCommand()
            ->select('gsid')
            ->from("{{surveys_groups}}")
            ->where('gsid = 1')
            ->queryScalar();
        if ($defaultSurveyGroupExists == false) {
            $date = date("Y-m-d H:i:s");
            $this->db->createCommand()->insert('{{surveys_groups}}', array(
                'gsid'        => 1,
                'name'        => 'default',
                'title'       => 'Default',
                'description' => 'Default survey group',
                'sortorder'   => '0',
                'owner_id'   => '1',
                'created'     => $date,
                'modified'    => $date,
                'created_by'  => '1'
            ));
        }
            $this->db->createCommand()->addColumn('{{surveys_groups}}', 'alwaysavailable', "boolean NULL");
            $this->db->createCommand()->update(
                '{{surveys_groups}}',
                array(
                    'alwaysavailable' => '0',
... (12 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_436.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_436 extends DatabaseUpdateBase
{
    public function up()
    {
            $this->db->createCommand()->update('{{boxes}}', array('url' => 'themeOptions'), "url='admin/themeoptions'");
    }
}
</file>

<file path="application/helpers/update/updates/Update_437.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_437 extends DatabaseUpdateBase
{
    public function up()
    {
            $this->db->createCommand()->update(
                '{{surveymenu_entries}}',
                array(
                    'menu_link' => 'assessment/index',
                ),
                "name='assessments'"
            );
    }
}
</file>

<file path="application/helpers/update/updates/Update_438.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_438 extends DatabaseUpdateBase
{
    public function up()
    {
        $this->db->createCommand()->update(
            '{{question_attributes}}',
            array('value' => '1'),
            "attribute = 'hidden' and value = 'Y'"
        );
        $this->db->createCommand()->update(
            '{{question_attributes}}',
            array('value' => '0'),
            "attribute = 'hidden' and value = 'N'"
        );
        $this->db->createCommand()->update(
            '{{question_attributes}}',
            array('value' => '1'),
            "attribute = 'statistics_showgraph' and value = 'Y'"
        );
        $this->db->createCommand()->update(
            '{{question_attributes}}',
            array('value' => '0'),
            "attribute = 'statistics_showgraph' and value = 'N'"
        );
        $this->db->createCommand()->update(
            '{{question_attributes}}',
            array('value' => '1'),
            "attribute = 'public_statistics' and value = 'Y'"
... (209 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_439.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_439 extends DatabaseUpdateBase
{
    public function up()
    {
        if (\Yii::app()->db->driverName == 'pgsql') {
            fixPostgresSequence('questions');
            fixPostgresSequence('groups');
            fixPostgresSequence('answers');
            fixPostgresSequence('labels');
            fixPostgresSequence('defaultvalues');
        }
    }
}
</file>

<file path="application/helpers/update/updates/Update_440.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_440 extends DatabaseUpdateBase
{
    public function up()
    {
            $this->db->createCommand()->createIndex('sess_expire', '{{sessions}}', 'expire');
    }
}
</file>

<file path="application/helpers/update/updates/Update_441.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_441 extends DatabaseUpdateBase
{
    public function up()
    {
            $this->db->createCommand()->update(
                '{{settings_global}}',
                array(
                    'stg_value' => 'inline',
                ),
                "stg_name='defaulthtmleditormode' AND stg_value='wysiwyg'"
            );
            $this->db->createCommand()->update(
                '{{settings_global}}',
                array(
                    'stg_value' => 'none',
                ),
                "stg_name='defaulthtmleditormode' AND stg_value='source'"
            );
            $this->db->createCommand()->update(
                '{{users}}',
                array(
                    'htmleditormode' => 'inline',
                ),
                "htmleditormode='wysiwyg'"
            );
            $this->db->createCommand()->update(
                '{{users}}',
                array(
... (7 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_442.php">
<?php
namespace LimeSurvey\Helpers\Update;
use QuestionTheme;
class Update_442 extends DatabaseUpdateBase
{
    public function up()
    {
        $questionTheme = new QuestionTheme();
        $questionsMetaData = $questionTheme->getAllQuestionMetaData(false, false, true)['available_themes'];
        foreach ($questionsMetaData as $questionMetaData) {
            $this->db->createCommand()->update(
                '{{question_themes}}',
                ['image_path' => $questionMetaData['image_path']],
                "name = :name AND extends = :extends AND theme_type = :type",
                [
                    "name" => $questionMetaData['name'],
                    "extends" => $questionMetaData['questionType'],
                    "type" => $questionMetaData['type']
                ]
            );
        }
        $this->db->createCommand()->insert(
            "{{plugins}}",
            [
                'name' => 'TwoFactorAdminLogin',
                'plugin_type' => 'core',
                'active' => 0,
                'version' => '1.2.5',
                'load_error' => 0,
                'load_error_message' => null
... (5 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_443.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_443 extends DatabaseUpdateBase
{
    public function up()
    {
            $this->db->createCommand()->renameColumn('{{users}}', 'lastLogin', 'last_login');
    }
}
</file>

<file path="application/helpers/update/updates/Update_444.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_444 extends DatabaseUpdateBase
{
    public function up()
    {
            $deleteQuery = "DELETE FROM {{template_configuration}}
                WHERE id NOT IN (
                    SELECT id FROM (
                        SELECT MIN(id) as id
                            FROM {{template_configuration}} t
                            GROUP BY t.template_name, t.sid, t.gsid, t.uid
                    ) x
                )";
            $this->db->createCommand($deleteQuery)->execute();
    }
}
</file>

<file path="application/helpers/update/updates/Update_445.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_445 extends DatabaseUpdateBase
{
    public function up()
    {
            $table = '{{surveymenu_entries}}';
            $data_to_be_updated = [
                'data' => '{"render": {"isActive": false, "link": {"data": {"iSurveyID": ["survey","sid"]}}}}',
            ];
            $where = "name = 'activateSurvey'";
            $this->db->createCommand()->update(
                $table,
                $data_to_be_updated,
                $where
            );
            $this->db->createCommand()->update(
                '{{settings_global}}',
                array('stg_value' => 445),
                "stg_name = 'DBVersion'"
            );
    }
}
</file>

<file path="application/helpers/update/updates/Update_446.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_446 extends DatabaseUpdateBase
{
    public function up()
    {
            $this->db->createCommand()->createTable(
                '{{archived_table_settings}}',
                [
                    'id' => "pk",
                    'survey_id' => "int NOT NULL",
                    'user_id' => "int NOT NULL",
                    'tbl_name' => "string(255) NOT NULL",
                    'tbl_type' => "string(10) NOT NULL",
                    'created' => "datetime NOT NULL",
                    'properties' => "text NOT NULL",
                ],
                $this->options
            );
            upgradeArchivedTableSettings446();
            $this->db->createCommand()->update('{{settings_global}}', array('stg_value' => 446), "stg_name='DBVersion'");
    }
}
</file>

<file path="application/helpers/update/updates/Update_447.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_447 extends DatabaseUpdateBase
{
    public function up()
    {
            $this->db->createCommand()->addColumn('{{users}}', 'validation_key', 'string(38)');
            $this->db->createCommand()->addColumn('{{users}}', 'validation_key_expiration', 'datetime');
            $sqlGetAdminCreationEmailTemplat = "SELECT stg_value FROM {{settings_global}} WHERE stg_name='admincreationemailtemplate'";
            $adminCreationEmailTemplateValue = $this->db->createCommand($sqlGetAdminCreationEmailTemplat)->queryAll();
        if ($adminCreationEmailTemplateValue) {
            if ($adminCreationEmailTemplateValue[0]['stg_value'] === null || $adminCreationEmailTemplateValue[0]['stg_value'] === '') {
                // if text in admincreationemailtemplate is empty use the default from LsDafaultDataSets
                $defaultCreationEmailContent = \LsDefaultDataSets::getDefaultUserAdministrationSettings();
                $replaceValue = $defaultCreationEmailContent['admincreationemailtemplate'];
            } else {
                $replaceValue = str_replace('PASSWORD', '***', (string) $adminCreationEmailTemplateValue[0]['stg_value']);
            }
            $this->db->createCommand()->update(
                '{{settings_global}}',
                array('stg_value' => $replaceValue),
                "stg_name='admincreationemailtemplate'"
            );
        }
    }
}
</file>

<file path="application/helpers/update/updates/Update_448.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_448 extends DatabaseUpdateBase
{
    public function up()
    {
            $this->db->createCommand('UPDATE {{question_themes}} SET settings=\'{"subquestions":"1","answerscales":"2","hasdefaultvalues":"0","assessable":"1","class":"array-flexible-dual-scale"}\' WHERE name=\'arrays/dualscale\'')->execute();
    }
}
</file>

<file path="application/helpers/update/updates/Update_449.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_449 extends DatabaseUpdateBase
{
    public function up()
    {
            \alterColumn('{{surveys_groupsettings}}', 'htmlemail', 'string(1)', false, 'Y');
            \alterColumn('{{surveys}}', 'htmlemail', 'string(1)', false, 'Y');
    }
}
</file>

<file path="application/helpers/update/updates/Update_450.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_450 extends DatabaseUpdateBase
{
    public function up()
    {
            $this->db->createCommand()->addColumn('{{archived_table_settings}}', 'attributes', 'text NULL');
            $archivedTableSettings = \Yii::app()->db->createCommand("SELECT * FROM {{archived_table_settings}}")->queryAll();
        foreach ($archivedTableSettings as $archivedTableSetting) {
            if ($archivedTableSetting['tbl_type'] === 'token') {
                $this->db->createCommand()->update('{{archived_table_settings}}', ['attributes' => json_encode(['unknown'])], 'id = :id', ['id' => $archivedTableSetting['id']]);
            }
        }
        if (!empty(\Yii::app()->getConfig('encryptionkeypair'))) {
            updateEncryptedValues450($this->db);
        }
    }
}
</file>

<file path="application/helpers/update/updates/Update_451.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_451 extends DatabaseUpdateBase
{
    public function up()
    {
        if (!empty(\Yii::app()->getConfig('encryptionkeypair'))) {
            $encryptedAttributes = $this->db->createCommand()
                ->select('attribute_id')
                ->from('{{participant_attribute_names}}')
                ->where('encrypted = :encrypted AND core_attribute <> :core_attribute', ['encrypted' => 'Y', 'core_attribute' => 'Y'])
                ->queryAll();
            $nrOfAttributes = count($encryptedAttributes);
            foreach ($encryptedAttributes as $encryptedAttribute) {
                $attributes = $this->db->createCommand()
                    ->select('*')
                    ->from('{{participant_attribute}}')
                    ->where('attribute_id = :attribute_id', ['attribute_id' => $encryptedAttribute['attribute_id']])
                    ->queryAll();
                foreach ($attributes as $attribute) {
                    $attributeValue = \LSActiveRecord::decryptSingle($attribute['value']);
                    for ($i = 1; $i < $nrOfAttributes; $i++) {
                        $attributeValue = \LSActiveRecord::decryptSingleOld($attributeValue);
                    }
                    $recryptedValue = \LSActiveRecord::encryptSingle($attributeValue);
                    $updateArray['value'] = $recryptedValue;
                    $this->db->createCommand()->update(
                        '{{participant_attribute}}',
                        $updateArray,
                        'participant_id = :participant_id AND attribute_id = :attribute_id',
... (8 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_452.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_452 extends DatabaseUpdateBase
{
    public function up()
    {
        if (!empty(\Yii::app()->getConfig('encryptionkeypair'))) {
            $emailsmtppassword = $this->db->createCommand()
                ->select('*')
                ->from('{{settings_global}}')
                ->where('stg_name = :stg_name', ['stg_name' => 'emailsmtppassword'])
                ->queryRow();
            if ($emailsmtppassword && !empty($emailsmtppassword['stg_value']) && $emailsmtppassword['stg_value'] !== 'somepassword') {
                $decryptedValue = \LSActiveRecord::decryptSingleOld($emailsmtppassword['stg_value']);
                $encryptedValue = \LSActiveRecord::encryptSingle($decryptedValue);
                $this->db->createCommand()->update('{{settings_global}}', ['stg_value' => $encryptedValue ?? ''], "stg_name='emailsmtppassword'");
            }
            // update encryption for bounceaccountpass
            $bounceaccountpass = $this->db->createCommand()
                ->select('*')
                ->from('{{settings_global}}')
                ->where('stg_name = :stg_name', ['stg_name' => 'bounceaccountpass'])
                ->queryRow();
            if ($bounceaccountpass && !empty($bounceaccountpass['stg_value']) && $bounceaccountpass['stg_value'] !== 'enteredpassword') {
                $decryptedValue = \LSActiveRecord::decryptSingleOld($bounceaccountpass['stg_value']);
                $encryptedValue = \LSActiveRecord::encryptSingle($decryptedValue);
                $this->db->createCommand()->update('{{settings_global}}', ['stg_value' => $encryptedValue ?? ''], "stg_name='bounceaccountpass'");
            }
        }
    }
... (2 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_453.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_453 extends DatabaseUpdateBase
{
    public function up()
    {
            $columnSchema = $this->db->getSchema()->getTable('{{archived_table_settings}}')->getColumn('attributes');
        if ($columnSchema === null) {
            $this->db->createCommand()->addColumn('{{archived_table_settings}}', 'attributes', 'text NULL');
        }
            $archivedTableSettings = \Yii::app()->db->createCommand("SELECT * FROM {{archived_table_settings}}")->queryAll();
        foreach ($archivedTableSettings as $archivedTableSetting) {
            if ($archivedTableSetting['tbl_type'] === 'token') {
                $this->db->createCommand()->update('{{archived_table_settings}}', ['attributes' => json_encode(['unknown'])], 'id = :id', ['id' => $archivedTableSetting['id']]);
            }
        }
    }
}
</file>

<file path="application/helpers/update/updates/Update_460.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_460 extends DatabaseUpdateBase
{
    public function up()
    {
            $installedPlugins = array_map(
                function ($v) {
                    return $v['name'];
                },
                $this->db->createCommand('SELECT name FROM {{plugins}}')->queryAll()
            );
            $insertPlugin = function ($name, $active = 0) use ($installedPlugins) {
                if (!in_array($name, $installedPlugins)) {
                    $this->db->createCommand()->insert(
                        "{{plugins}}",
                        [
                            'name'               => $name,
                            'plugin_type'        => 'core',
                            'active'             => $active,
                            'version'            => '1.0.0',
                            'load_error'         => 0,
                            'load_error_message' => null
                        ]
                    );
                } else {
                    $this->db->createCommand()->update(
                        "{{plugins}}",
                        [
                            'plugin_type' => 'core',
... (10 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_470.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_470 extends DatabaseUpdateBase
{
    public function up()
    {
            $this->db->createCommand()->addColumn('{{questions}}', 'question_theme_name', 'string(150) NULL');
        switch (\Yii::app()->db->driverName) {
            case 'sqlsrv':
            case 'dblib':
            case 'mssql':
                $updateExtendedQuery = "UPDATE q SET q.question_theme_name = qt.value
                        FROM {{questions}} q
                        LEFT JOIN {{question_attributes}} qt ON qt.qid = q.qid AND qt.attribute = 'question_template'
                        WHERE qt.value IS NOT NULL AND qt.value <> 'core' AND qt.value <> ''";
                $updateCoreQuery = "UPDATE q SET q.question_theme_name = qt.name
                        FROM {{questions}} q
                        LEFT JOIN {{question_themes}} qt ON qt.question_type = q.type AND qt.core_theme = 1 AND qt.extends = ''
                        WHERE q.question_theme_name IS NULL";
                $updateUserSettingsQuery = "UPDATE su SET stg_value = qt.name
                        FROM {{settings_user}} su
                        JOIN {{settings_user}} su2 ON su2.uid = su.uid AND su2.stg_name = 'preselectquestiontype'
                        JOIN {{question_themes}} qt ON qt.question_type = su2.stg_value
                        WHERE su.stg_name = 'preselectquestiontheme' AND su.stg_value = 'core'";
                break;
            case 'pgsql':
                $updateExtendedQuery = "UPDATE {{questions}} q SET question_theme_name = qt.value
                        FROM {{questions}} q2
                        LEFT JOIN {{question_attributes}} qt ON qt.qid = q2.qid AND qt.attribute = 'question_template'
                        WHERE qt.value IS NOT NULL AND qt.value <> 'core' AND qt.value <> '' AND q.qid = q2.qid";
... (29 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_471.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_471 extends DatabaseUpdateBase
{
    public function up()
    {
        \LimeExpressionManager::UpgradeConditionsToRelevance();
        $fixedTitles = [
            '5pointchoice' => '5 point choice',
            'arrays/10point' => 'Array (10 point choice)',
            'arrays/5point' => 'Array (5 point choice)',
            'hugefreetext' => 'Huge free text',
            'multiplenumeric' => 'Multiple numerical input',
            'multipleshorttext' => 'Multiple short text',
            'numerical' => 'Numerical input',
            'shortfreetext' => 'Short free text',
            'image_select-listradio' => 'Image select list (Radio)',
            'image_select-multiplechoice' => 'Image select multiple choice',
            'ranking_advanced' => 'Ranking advanced'
        ];
        foreach ($fixedTitles as $themeName => $newTitle) {
            $this->db->createCommand()->update('{{question_themes}}', array('title' => $newTitle), "name='$themeName'");
        }
    }
}
</file>

<file path="application/helpers/update/updates/Update_472.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_472 extends DatabaseUpdateBase
{
    public function up()
    {
            $this->db->createCommand()->addColumn('{{users}}', 'last_forgot_email_password', 'datetime');
    }
}
</file>

<file path="application/helpers/update/updates/Update_473.php">
<?php
namespace LimeSurvey\Helpers\Update;
use DirectoryIterator;
class Update_473 extends DatabaseUpdateBase
{
    public function up()
    {
        $dir = new DirectoryIterator(APPPATH . DIRECTORY_SEPARATOR . 'core' . DIRECTORY_SEPARATOR . 'plugins');
        foreach ($dir as $fileinfo) {
            if (!$fileinfo->isDot()) {
                $plugin = $this->db->createCommand()
                    ->select('*')
                    ->from('{{plugins}}')
                    ->where("name = :name", [':name' => $fileinfo->getFilename()])
                    ->queryRow();
                if (!empty($plugin)) {
                    if ($plugin['plugin_type'] !== 'core') {
                        $this->db->createCommand()->update(
                            '{{plugins}}',
                            ['plugin_type' => 'core'],
                            'name = :name',
                            [':name' => $plugin['name']]
                        );
                    }
                } else {
                }
            }
        }
    }
}
... (1 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_475.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_475 extends DatabaseUpdateBase
{
    public function up()
    {
        $lids = $this->db->createCommand(
            "SELECT {{labels}}.lid AS lid
            FROM {{labels}}
            GROUP BY {{labels}}.lid
            HAVING COUNT(DISTINCT({{labels}}.code)) < COUNT({{labels}}.id)"
        )->queryAll();
        foreach ($lids as $lid) {
            $hasLanguageColumn = false;
            regenerateLabelCodes400($lid['lid'], $hasLanguageColumn);
        }
        $this->db->createCommand()->createIndex('{{idx5_labels}}', '{{labels}}', ['lid','code'], true);
    }
}
</file>

<file path="application/helpers/update/updates/Update_476.php">
<?php
namespace LimeSurvey\Helpers\Update;
use Yii;
use SurveyThemeHelper;
class Update_476 extends DatabaseUpdateBase
{
    public function up()
    {
        Yii::import('application.helpers.SurveyThemeHelper');
        $templateConfigurations = $this->db->createCommand()->select(['id', 'template_name', 'sid', 'options'])->from('{{template_configuration}}')->queryAll();
        if (!empty($templateConfigurations)) {
            foreach ($templateConfigurations as $templateConfiguration) {
                $decodedOptions = json_decode((string) $templateConfiguration['options'], true);
                if (is_array($decodedOptions)) {
                    foreach ($decodedOptions as &$value) {
                        $value = SurveyThemeHelper::sanitizePathInOption($value, $templateConfiguration['template_name'], $templateConfiguration['sid']);
                    }
                    $sanitizedOptions = json_encode($decodedOptions);
                    $this->db->createCommand()->update('{{template_configuration}}', ['options' => $sanitizedOptions], 'id=:id', [':id' => $templateConfiguration['id']]);
                }
            }
        }
    }
}
</file>

<file path="application/helpers/update/updates/Update_477.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_477 extends DatabaseUpdateBase
{
    public function up()
    {
            $this->db->createCommand()->update(
                '{{surveymenu_entries}}',
                [
                    'menu_link' => 'responses/browse',
                    'data'      => '{"render": {"isActive": true, "link": {"data": {"surveyId": ["survey", "sid"]}}}}'
                ],
                "name='responses'"
            );
    }
}
</file>

<file path="application/helpers/update/updates/Update_478.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_478 extends DatabaseUpdateBase
{
    public function up()
    {
    }
}
</file>

<file path="application/helpers/update/updates/Update_479.php">
<?php
namespace LimeSurvey\Helpers\Update;
use LsDefaultDataSets;
class Update_479 extends DatabaseUpdateBase
{
    public function up()
    {
        $baseQuestionThemeEntries = LsDefaultDataSets::getBaseQuestionThemeEntries();
        $this->db->createCommand()->update("{{question_themes}}", ['name' => 'bootstrap_buttons_multi'], "name='bootstrap_buttons' and extends='M'");
        foreach ($baseQuestionThemeEntries as $baseQuestionThemeEntry) {
            unset($baseQuestionThemeEntry['visible']);
            $this->db->createCommand()->update("{{question_themes}}", $baseQuestionThemeEntry, 'name=:themename', [':themename' => $baseQuestionThemeEntry['name']]);
        }
    }
}
</file>

<file path="application/helpers/update/updates/Update_480.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_480 extends DatabaseUpdateBase
{
    public function up()
    {
        $this->db->createCommand()->createTable(
            '{{source_message}}',
            [
                'id' => "pk",
                'category' => "string(35)",
                'message' => "text",
            ],
            $this->options
        );
        $this->db->createCommand()->createTable(
            '{{message}}',
            [
                'id' => "integer NOT NULL",
                'language' => "string(50) NOT NULL DEFAULT ''",
                'translation' => "text",
            ],
            $this->options
        );
        $this->db->createCommand()->addPrimaryKey(
            '{{message_pk}}',
            '{{message}}',
            ['id', 'language']
        );
    }
... (2 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_481.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_481 extends DatabaseUpdateBase
{
    public function up()
    {
        $this->db->createCommand()->addColumn(
            '{{failed_login_attempts}}',
            'is_frontend',
            "boolean NULL"
        );
        $this->db->createCommand()->update('{{failed_login_attempts}}', array('is_frontend' => 0));
        \alterColumn('{{failed_login_attempts}}', 'is_frontend', "boolean", false);
    }
}
</file>

<file path="application/helpers/update/updates/Update_482.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_482 extends DatabaseUpdateBase
{
    public function up()
    {
        \alterColumn('{{message}}', 'language', 'string(50)', false, '');
    }
}
</file>

<file path="application/helpers/update/updates/Update_483.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_483 extends DatabaseUpdateBase
{
    public function up()
    {
        alterColumn('{{labels}}', 'code', "string(20)", false);
    }
}
</file>

<file path="application/helpers/update/updates/Update_484.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_484 extends DatabaseUpdateBase
{
    public function up()
    {
        $comfortUpdatePlugins = $this->db->createCommand()
            ->select('*')
            ->from('{{plugins}}')
            ->where("name = :name", [':name' => 'ComfortUpdateChecker'])
            ->queryAll();
        if (count($comfortUpdatePlugins) > 1) {
            foreach ($comfortUpdatePlugins as $index => $cUPlugin) {
                if ($index > 0) {
                    $this->db->createCommand()->delete('{{plugins}}', 'id=:id', [':id' => $cUPlugin['id']]);
                }
            }
        } elseif (count($comfortUpdatePlugins) == 0) {
            $newCUPlugin = [
                'name' => 'ComfortUpdateChecker',
                'plugin_type' => 'core',
                'active' => 1,
                'version' => '1.0.0'
            ];
            $this->db->createCommand()->insert('{{plugins}}', $newCUPlugin);
        }
        if (count($comfortUpdatePlugins) > 0) {
            if ($comfortUpdatePlugins[0]['active'] == 0 || $comfortUpdatePlugins[0]['plugin_type'] !== 'core') {
                $this->db->createCommand()->update(
                    "{{plugins}}",
... (9 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_485.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_485 extends DatabaseUpdateBase
{
    public function up()
    {
        $this->db->createCommand()->update(
            '{{template_configuration}}',
            ['files_css' => '{"add":["css/base.css","css/theme.css","css/noTablesOnMobile.css","css/custom.css"]}'],
            "template_name = 'vanilla' AND files_css = :default_files_css",
            [':default_files_css' => '{"add":["css/ajaxify.css","css/theme.css","css/custom.css"]}']
        );
    }
}
</file>

<file path="application/helpers/update/updates/Update_486.php">
<?php
namespace LimeSurvey\Helpers\Update;
use LsDefaultDataSets;
class Update_486 extends DatabaseUpdateBase
{
    public function up()
    {
        $this->db->createCommand()->update(
            "{{question_themes}}",
            [
                'xml_path' => 'themes/question/bootstrap_buttons_multi/survey/questions/answer/multiplechoice',
                'image_path' => '/themes/question/bootstrap_buttons_multi/survey/questions/answer/multiplechoice/assets/bootstrap_buttons_multiplechoice.png',
            ],
            "name='bootstrap_buttons_multi'"
        );
    }
}
</file>

<file path="application/helpers/update/updates/Update_487.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_487 extends DatabaseUpdateBase
{
    public function up()
    {
        $this->db->createCommand()->update(
            '{{surveymenu_entries}}',
            [
                'permission' => 'tokens',
                'permission_grade' => 'read'
            ],
            "name='participants'"
        );
    }
}
</file>

<file path="application/helpers/update/updates/Update_488.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_488 extends DatabaseUpdateBase
{
    public function up()
    {
        $this->db->createCommand()->addColumn(
            '{{questions}}',
            'same_script',
            "integer NOT NULL DEFAULT 0"
        );
    }
}
</file>

<file path="application/helpers/update/updates/Update_489.php">
<?php
namespace LimeSurvey\Helpers\Update;
use LsDefaultDataSets;
use SurveymenuEntries;
class Update_489 extends DatabaseUpdateBase
{
    public function up()
    {
        $this->db->createCommand()->createTable(
            '{{failed_emails}}',
            [
                'id' => "pk",
                'surveyid' => "integer NOT NULL",
                'responseid' => "integer NOT NULL",
                'email_type' => "string(200) NOT NULL",
                'recipient' => "string(320) NOT NULL",
                'language' => "string(20) NOT NULL DEFAULT 'en'",
                'error_message'  => "text",
                'created' => "datetime NOT NULL",
                'status' => "string(20) NULL DEFAULT 'SEND FAILED'",
                'updated' => "datetime NULL",
                'resend_vars' => "text NOT NULL"
            ]
        );
        $aDefaultSurveyMenuEntries = LsDefaultDataSets::getSurveyMenuEntryData();
        foreach ($aDefaultSurveyMenuEntries as $aSurveymenuentry) {
            if ($aSurveymenuentry['name'] === 'failedemail') {
                $aSurveymenuentry['ordering'] = 5;
                if (SurveymenuEntries::model()->findByAttributes(['name' => $aSurveymenuentry['name']]) === null) {
                    $this->db->createCommand()->insert('{{surveymenu_entries}}', $aSurveymenuentry);
... (8 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_490.php">
<?php
namespace LimeSurvey\Helpers\Update;
use LsDefaultDataSets;
use SurveymenuEntries;
class Update_490 extends DatabaseUpdateBase
{
    public function up()
    {
        $this->db->createCommand()->update("{{surveymenu_entries}}", ['title' => 'Privacy policy settings', 'menu_title' => 'Privacy policy', 'menu_description' => 'Edit privacy policy settings'], "name='datasecurity'");
        $this->db->createCommand()->dropColumn('{{surveys}}', 'faxto');
    }
}
</file>

<file path="application/helpers/update/updates/Update_491.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_491 extends DatabaseUpdateBase
{
    public function up()
    {
        try {
            setTransactionBookmark();
            $this->db->createCommand()->dropTable('{{failed_emails}}');
        } catch (\Exception $e) {
            rollBackToTransactionBookmark();
        }
        try {
            setTransactionBookmark();
            $this->db->createCommand()->dropTable('{{failed_email}}');
        } catch (\Exception $e) {
            rollBackToTransactionBookmark();
        }
        $update = new Update_489($this->db, $this->options);
        $update->up();
        $responseidColumn = $this->db->getSchema()->getTable('{{failed_emails}}')->getColumn('responseid');
        if ($responseidColumn === null) {
            $this->db->createCommand()->addColumn(
                '{{failed_emails}}',
                'responseid',
                "integer NOT NULL"
            );
        }
        $resendVarsColumn = $this->db->getSchema()->getTable('{{failed_emails}}')->getColumn('resend_vars');
        if ($resendVarsColumn === null) {
... (9 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_492.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_492 extends DatabaseUpdateBase
{
    public function up()
    {
        $this->db->createCommand(
            "INSERT INTO {{question_attributes}} (qid, " . $this->db->quoteColumnName("attribute") . ", " . $this->db->quoteColumnName("value") . ")
             SELECT
                qa.qid,
                'answer_order' AS " . $this->db->quoteColumnName("attribute") . ",
                'random' AS " . $this->db->quoteColumnName("value") . "
             FROM {{question_attributes}} qa
             JOIN {{questions}} q ON qa.qid = q.qid
             WHERE
                " . $this->db->quoteColumnName("attribute") . " = 'random_order'
                AND " . $this->db->quoteColumnName("value") . " = '1'
                AND q.type IN ('!', 'L', 'O', 'R')"
        )->execute();
        $this->db->createCommand(
            "INSERT INTO {{question_attributes}} (qid, " . $this->db->quoteColumnName("attribute") . ", " . $this->db->quoteColumnName("value") . ")
             SELECT
                a.qid,
                'answer_order' AS " . $this->db->quoteColumnName("attribute") . ",
                'alphabetical' AS " . $this->db->quoteColumnName("value") . "
             FROM (
                SELECT *
                FROM {{question_attributes}}
                WHERE " . $this->db->quoteColumnName("attribute") . " = 'alphasort'
                    AND " . $this->db->quoteColumnName("value") . " = '1'
... (11 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_493.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_493 extends DatabaseUpdateBase
{
    public function up()
    {
        $this->db->createCommand()->update(
            '{{surveymenu_entries}}',
            array(
                'menu_link' => 'surveyPermissions/index',
            ),
            "name='surveypermissions'"
        );
    }
}
</file>

<file path="application/helpers/update/updates/Update_494.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_494 extends DatabaseUpdateBase
{
    public function up()
    {
        $this->db->createCommand()->addColumn('{{surveys_languagesettings}}', 'surveyls_alias', 'string(100)');
    }
}
</file>

<file path="application/helpers/update/updates/Update_495.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_495 extends DatabaseUpdateBase
{
    public function up()
    {
        $this->db->createCommand()->addColumn('{{users}}', 'expires', 'datetime');
    }
}
</file>

<file path="application/helpers/update/updates/Update_600.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_600 extends DatabaseUpdateBase
{
    public function up()
    {
        $this->db->createCommand()->update(
            '{{surveymenu_entries}}',
            array(
                'menu_link' => 'quotas/index',
            ),
            "name='quotas'"
        );
    }
}
</file>

<file path="application/helpers/update/updates/Update_601.php">
<?php
namespace LimeSurvey\Helpers\Update;
use Exception;
class Update_601 extends DatabaseUpdateBase
{
    public function up()
    {
        try {
            setTransactionBookmark();
            $this->db->createCommand()->addColumn('{{boxes}}', 'buttontext', 'string(255)');
        } catch (\Exception $e) {
            rollBackToTransactionBookmark();
        }
        $this->updateCreateSurvey();
        $this->updateSurveyList();
        $this->updateGlobalSettings();
        $this->updateComfortUpdate();
        $this->updateLimeStore();
        $this->updateThemes();
    }
    public function updateCreateSurvey()
    {
        $this->db->createCommand()
            ->update(
                '{{boxes}}',
                [
                    'desc' => 'Create a new survey from scratch. Or simply copy or import an existing survey.',
                    'buttontext' => 'Create survey'
                ],
                "title = 'Create survey' AND page = 'welcome'"
... (71 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_602.php">
<?php
namespace LimeSurvey\Helpers\Update;
use CException;
class Update_602 extends DatabaseUpdateBase
{
    public function up()
    {
        $this->getAllBoxIcons();
    }
    public function getAllBoxIcons()
    {
        $boxes = $this->db->createCommand()
            ->select('id,ico')
            ->from('{{boxes}}')
            ->queryAll();
        foreach ($boxes as $box) {
            if ($iconKey = array_search($box['ico'], array_column($oldIcons = $this->oldIcons(), 'icon'), false)) {
                $this->db->createCommand()
                    ->update(
                        '{{boxes}}',
                        ['ico' => (string)$oldIcons[$iconKey]['id']],
                        "ico = :icon",
                        [':icon' => $box['ico']]
                    );
            } elseif ($iconKey = array_search($box['ico'], array_column($newIcons = $this->newIcons(), 'icon'), false)) {
                $this->db->createCommand()
                    ->update(
                        '{{boxes}}',
                        ['ico' => (string)$newIcons[$iconKey]['id']],
                        "ico = :icon",
... (129 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_603.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_603 extends DatabaseUpdateBase
{
    public function up()
    {
        $this->changeAdminTheme();
    }
    public function changeAdminTheme()
    {
        $this->db->createCommand()
            ->update(
                '{{settings_global}}',
                ['stg_value' => 'Sea_Green'],
                "stg_name = :stg_name",
                [':stg_name' => 'admintheme']
            );
    }
}
</file>

<file path="application/helpers/update/updates/Update_604.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_604 extends DatabaseUpdateBase
{
    public function up()
    {
        $fixedXmlPaths = [
            'image_select-listradio' => 'themes/question/image_select-listradio/survey/questions/answer/listradio',
            'image_select-multiplechoice' => 'themes/question/image_select-multiplechoice/survey/questions/answer/multiplechoice',
        ];
        foreach ($fixedXmlPaths as $themeName => $newXmlPath) {
            $this->db->createCommand()->update('{{question_themes}}', array('xml_path' => $newXmlPath), "name='$themeName'");
        }
    }
}
</file>

<file path="application/helpers/update/updates/Update_605.php">
<?php
namespace LimeSurvey\Helpers\Update;
use Exception;
class Update_605 extends DatabaseUpdateBase
{
    public function up()
    {
        if ($this->db->driverName == 'pgsql') {
            $this->db->createCommand("CREATE INDEX IF NOT EXISTS {{idx1_quota_id}} ON {{quota_languagesettings}} (quotals_quota_id)")->execute();
            $this->db->createCommand("CREATE INDEX IF NOT EXISTS {{idx2_quota_id}} ON {{quota_members}} (quota_id)")->execute();
            return;
        }
        try {
            $this->db->createCommand()->createIndex('{{idx1_quota_id}}', '{{quota_languagesettings}}', ['quotals_quota_id']);
        } catch (\Exception $e) {
        }
        try {
            $this->db->createCommand()->createIndex('{{idx2_quota_id}}', '{{quota_members}}', ['quota_id']);
        } catch (\Exception $e) {
        }
    }
}
</file>

<file path="application/helpers/update/updates/Update_606.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_606 extends DatabaseUpdateBase
{
    public function up()
    {
        $this->db->createCommand()->update(
            "{{surveymenu_entries}}",
            [
                'data' => '{"render": {"link": {"data": {"surveyid": ["survey", "sid"]}}}}',
                'menu_icon' => 'reorder',
                'menu_icon_type' => 'fontawesome'
            ],
            "name='reorder'"
        );
    }
}
</file>

<file path="application/helpers/update/updates/Update_607.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_607 extends DatabaseUpdateBase
{
    public function up()
    {
        $columnSchema = $this->db->getSchema()->getTable('{{archived_table_settings}}')->getColumn('attributes');
        if ($columnSchema === null) {
            $this->db->createCommand()->addColumn('{{archived_table_settings}}', 'attributes', 'text NULL');
            $archivedTableSettings = \Yii::app()->db->createCommand("SELECT * FROM {{archived_table_settings}}")->queryAll();
            foreach ($archivedTableSettings as $archivedTableSetting) {
                if ($archivedTableSetting['tbl_type'] === 'token') {
                    $this->db->createCommand()->update('{{archived_table_settings}}', ['attributes' => json_encode(['unknown'])], 'id = :id', ['id' => $archivedTableSetting['id']]);
                }
            }
        }
    }
}
</file>

<file path="application/helpers/update/updates/Update_608.php">
<?php
namespace LimeSurvey\Helpers\Update;
use Exception;
class Update_608 extends DatabaseUpdateBase
{
    public function up()
    {
        $surveyThemes = $this->db->createCommand()
            ->select('*')
            ->from('{{templates}}')
            ->queryAll();
        if (empty($surveyThemes)) {
            return;
        }
        foreach ($surveyThemes as $surveyTheme) {
            $surveyThemeName = $surveyTheme['name'];
            setTransactionBookmark('beforeThemeDelete');
            try {
                if (!$this->isStandardTemplate($surveyThemeName)) {
                    $rowsDeleted = $this->db->createCommand()->delete(
                        '{{templates}}',
                        'name=:name',
                        [':name' => $surveyThemeName]
                    );
                    if ($rowsDeleted >= 1) {
                        $this->db->createCommand()->delete(
                            '{{template_configuration}}',
                            'template_name=:templateName',
                            [':templateName' => $surveyThemeName]
                        );
... (31 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_609.php">
<?php
namespace LimeSurvey\Helpers\Update;
use CException;
class Update_609 extends DatabaseUpdateBase
{
    public function up()
    {
        $this->installFruityTwentyThree();
        $this->db->createCommand()->update(
            "{{settings_global}}",
            ['stg_value' => 'fruity_twentythree'],
            "stg_name = :stg_name",
            [':stg_name' => 'defaulttheme']
        );
        $this->db->createCommand()->update(
            "{{templates}}",
            [
                'title'       => 'Bootstrap Vanilla',
                'description' => gT("A clean and simple base that can be used by developers to create their own Bootstrap based theme.")
            ],
            "name = :name",
            [':name' => 'vanilla']
        );
        $this->db->createCommand()->update(
            "{{templates}}",
            [
                'title'       => 'Fruity',
                'description' => gT("A fruity theme for a flexible use. This theme offers monochromes variations and many options for easy customizations.")
            ],
            "name = :name",
... (117 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_610.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_610 extends DatabaseUpdateBase
{
    public function up()
    {
        $table = $this->db->getSchema()->getTable('{{labelsets}}');
        if (!in_array('owner_id', $table->getColumnNames())) {
            $this->db->createCommand()->addColumn('{{labelsets}}', 'owner_id', "integer NULL");
            $this->db->createCommand()->createIndex('{{idx1_labelsets}}', '{{labelsets}}', 'owner_id', false);
            $this->db->createCommand()->createIndex('{{idx2_labelsets}}', '{{labelsets}}', ['lid','owner_id'], false);
        }
    }
}
</file>

<file path="application/helpers/update/updates/Update_611.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_611 extends DatabaseUpdateBase
{
    public function up()
    {
        $this->db->createCommand()->update(
            '{{surveymenu_entries}}',
            [
                "title" => "Overview questions & groups",
                "menu_title" => "Overview questions & groups",
                "menu_description" => "Overview of questions and groups where you can add, edit and reorder them",
            ],
            'name=:name',
            [':name' => 'listQuestions']
        );
        $this->db->createCommand()->delete(
            '{{surveymenu_entries}}',
            'name=:name',
            [':name' => 'listQuestionGroups']
        );
        $this->db->createCommand()->delete(
            '{{surveymenu_entries}}',
            'name=:name',
            [':name' => 'reorder']
        );
    }
}
</file>

<file path="application/helpers/update/updates/Update_612.php">
<?php
namespace LimeSurvey\Helpers\Update;
use CException;
class Update_612 extends DatabaseUpdateBase
{
    public function up()
    {
        $templateConfigurations = $this->db->createCommand()
            ->select('id, options')
            ->from('{{template_configuration}}')
            ->where('template_name = :template_name', [':template_name' => 'fruity_twentythree'])
            ->andWhere(['NOT IN', 'options', 'inherit'])
            ->queryAll();
        if (!empty($templateConfigurations)) {
            foreach ($templateConfigurations as $templateConfiguration) {
                if ($templateConfiguration['options'] !== 'inherit') {
                    $sOptionsJson = $templateConfiguration['options'];
                    $oOldOptions = json_decode($sOptionsJson);
                    $oOldOptions->cssframework = 'Apple';
                    $oNewOtionsJson = json_encode($oOldOptions);
                    $this->db->createCommand()->update(
                        '{{template_configuration}}',
                        ['options' => $oNewOtionsJson],
                        'id = :id',
                        [':id' => $templateConfiguration['id']]
                    );
                }
            }
        }
    }
... (2 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_613.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_613 extends DatabaseUpdateBase
{
    public function up()
    {
        $fixedIcons = [
            'overview' => 'ri-bar-chart-horizontal-line',
            'generalsettings' => 'ri-tools-line',
            'surveytexts' => 'ri-text-spacing',
            'datasecurity' => 'ri-shield-line',
            'theme_options' => 'ri-contrast-drop-fill',
            'presentation' => 'ri-slideshow-line',
            'tokens' => 'ri-body-scan-fill',
            'notification' => 'ri-notification-line',
            'publication' => 'ri-key-line',
            'surveypermissions' => 'ri-lock-password-line',
            'listQuestions' => '',
            'listQuestionGroups' => '',
            'reorder' => '',
            'participants' => '',
            'emailtemplates' => '',
            'failedemail' => '',
            'quotas' => '',
            'assessments' => '',
            'panelintegration' => '',
            'responses' => '',
            'statistics' => '',
            'resources' => '',
            'plugins' => '',
... (15 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_614.php">
<?php
namespace LimeSurvey\Helpers\Update;
use CException;
class Update_614 extends DatabaseUpdateBase
{
    public function up()
    {
        $templateConfigurations = $this->getThemes();
        if (!empty($templateConfigurations)) {
            foreach ($templateConfigurations as $templateConfiguration) {
                if ($templateConfiguration['options'] !== 'inherit') {
                    if ($templateConfiguration['template_name'] == 'vanilla') {
                        $optionsJson = $templateConfiguration['options'];
                        $oldOptions = json_decode($optionsJson);
                        if (is_object($oldOptions)) {
                            if (empty($oldOptions->animatebody)) {
                                $oldOptions->animatebody = 'off';
                            }
                            if (empty($oldOptions->fixnumauto)) {
                                $oldOptions->fixnumauto = 'enable';
                            }
                            $newOptionsJson = json_encode($oldOptions);
                            $this->templateConfigurationOptionsUpdate(
                                $templateConfiguration['id'],
                                $newOptionsJson
                            );
                        }
                    } elseif ($templateConfiguration['template_name'] == 'fruity') {
                        $optionsJson = $templateConfiguration['options'];
                        $oldOptions = json_decode($optionsJson);
... (55 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_615.php">
<?php
namespace LimeSurvey\Helpers\Update;
use CException;
class Update_615 extends DatabaseUpdateBase
{
    public function up()
    {
        $questionThemes = $this->getQuestionThemes();
        if (!empty($questionThemes)) {
            foreach ($questionThemes as $theme) {
                if (!empty($theme['settings'])) {
                    $sSettingsJson = $theme['settings'];
                    $oSettings = json_decode($sSettingsJson);
                    $oSettings->hasdefaultvalues = "1";
                    $oNewSettingsJson = json_encode($oSettings);
                    $this->db->createCommand()->update(
                        '{{question_themes}}',
                        ['settings' => $oNewSettingsJson],
                        'id = :id',
                        [':id' => $theme['id']]
                    );
                }
            }
        }
    }
    public function getQuestionThemes()
    {
        return $this->db->createCommand()
            ->select('id, name, settings')
            ->from('{{question_themes}}')
... (5 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_616.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_616 extends DatabaseUpdateBase
{
    public function up()
    {
        switch ($this->db->driverName) {
            case 'mysql':
                \alterColumn(
                    '{{failed_emails}}',
                    'resend_vars',
                    'mediumtext',
                    false
                );
                break;
        }
    }
}
</file>

<file path="application/helpers/update/updates/Update_617.php">
<?php
namespace LimeSurvey\Helpers\Update;
use CDbException;
use CException;
class Update_617 extends DatabaseUpdateBase
{
    public function up(): void
    {
        $this->deleteDuplicateTemplateConfigurationEntries();
    }
    private function deleteDuplicateTemplateConfigurationEntries(): void
    {
        $aKeepIds = $this->db->createCommand()
            ->select("MAX(id) AS maxrecordid")
            ->from("{{template_configuration}}")
            ->group(['template_name', 'sid', 'gsid', 'uid'])
            ->queryAll();
        $aKeepIds = array_column($aKeepIds, 'maxrecordid');
        $criteria = $this->db->getCommandBuilder()->createCriteria();
        $criteria->select = 'id, template_name, sid, gsid, uid';
        $criteria->addNotInCondition('id', $aKeepIds);
        $this->db->getCommandBuilder()->createDeleteCommand('{{template_configuration}}', $criteria)->execute();
    }
}
</file>

<file path="application/helpers/update/updates/Update_618.php">
<?php
namespace LimeSurvey\Helpers\Update;
use LimeSurvey\Helpers\Update\DatabaseUpdateBase;
class Update_618 extends DatabaseUpdateBase
{
    public function up()
    {
        $this->db->createCommand()->dropIndex('{{answers_idx}}', '{{answers}}');
    }
}
</file>

<file path="application/helpers/update/updates/Update_619.php">
<?php
namespace LimeSurvey\Helpers\Update;
use LimeSurvey\Helpers\Update\DatabaseUpdateBase;
class Update_619 extends DatabaseUpdateBase
{
    public function up()
    {
        $this->db->createCommand()->addColumn('{{users}}', 'user_status', 'integer DEFAULT 1');
        $this->db->createCommand("UPDATE {{users}} SET user_status=1")->execute();
    }
}
</file>

<file path="application/helpers/update/updates/Update_620.php">
<?php
namespace LimeSurvey\Helpers\Update;
use LimeSurvey\Helpers\Update\DatabaseUpdateBase;
class Update_620 extends DatabaseUpdateBase
{
    public function up()
    {
        $this->db->createCommand()
            ->update(
                '{{boxes}}',
                [
                    'desc' => 'Label sets can be used as answer options or subquestions to speed up creation of similar questions.',
                ],
                "title = 'LimeStore' AND page = 'welcome'"
            );
    }
}
</file>

<file path="application/helpers/update/updates/Update_621.php">
<?php
namespace LimeSurvey\Helpers\Update;
use LimeSurvey\Helpers\Update\DatabaseUpdateBase;
class Update_621 extends DatabaseUpdateBase
{
    public function up()
    {
        if (\Yii::app()->db->driverName == 'mysql') {
            $table = \Yii::app()->db->schema->getTable('{{users}}');
            if (isset($table->columns['user_status']) && $table->columns['user_status']->dbType != 'integer') {
                \alterColumn('{{users}}', 'user_status', "integer", false, 1);
            }
        }
    }
}
</file>

<file path="application/helpers/update/updates/Update_622.php">
<?php
namespace LimeSurvey\Helpers\Update;
use CDbException;
use CException;
class Update_622 extends DatabaseUpdateBase
{
    public function up(): void
    {
        try {
            setTransactionBookmark();
            $this->db->createCommand()->createIndex('{{answers_idx}}', '{{answers}}', ['qid', 'code', 'scale_id'], false);
        } catch (\Exception $e) {
            rollBackToTransactionBookmark();
        }
    }
}
</file>

<file path="application/helpers/update/updates/Update_623.php">
<?php
namespace LimeSurvey\Helpers\Update;
use LimeSurvey\Helpers\Update\DatabaseUpdateBase;
class Update_623 extends DatabaseUpdateBase
{
    public function up()
    {
        if (\Yii::app()->db->driverName == 'pgsql') {
            $table = \Yii::app()->db->schema->getTable('{{users}}');
            if (isset($table->columns['user_status']) && $table->columns['user_status']->dbType != 'integer') {
                $this->db->createCommand("ALTER TABLE {{users}} ALTER COLUMN user_status DROP DEFAULT;")->execute();
                $this->db->createCommand("ALTER TABLE {{users}} ALTER COLUMN user_status TYPE INT USING CASE WHEN user_status=TRUE THEN 1 ELSE 0 END;")->execute();
                $this->db->createCommand("ALTER TABLE {{users}} ALTER COLUMN user_status SET DEFAULT 1;")->execute();
            }
        }
        if (in_array(\Yii::app()->db->driverName, array('mssql', 'sqlsrv', 'dblib'))) {
            $this->db->createCommand("UPDATE {{users}} SET user_status=1")->execute();
        }
    }
}
</file>

<file path="application/helpers/update/updates/Update_624.php">
<?php
namespace LimeSurvey\Helpers\Update;
use LimeSurvey\Helpers\Update\DatabaseUpdateBase;
class Update_624 extends DatabaseUpdateBase
{
    public function up()
    {
        $createSurveyBox = \Box::model()->find("title=:title", array("title" => 'Create survey'));
        if (!empty($createSurveyBox)) {
            $createSurveyBox->delete();
        }
    }
}
</file>

<file path="application/helpers/update/updates/Update_625.php">
<?php
namespace LimeSurvey\Helpers\Update;
use LimeSurvey\Helpers\Update\DatabaseUpdateBase;
class Update_625 extends DatabaseUpdateBase
{
    public function up()
    {
        $db = $this->db->createCommand();
        $aDefaultSurveyMenuEntries = \LsDefaultDataSets::getSurveyMenuEntryData();
        foreach ($aDefaultSurveyMenuEntries as $aSurveymenuentry) {
            $menuEntryExist = $db->select("*")->from("{{surveymenu_entries}}")->where(
                'name=:name',
                [':name' => $aSurveymenuentry['name']]
            )->query()->rowCount;
            if (!$menuEntryExist) {
                $this->db->createCommand()->insert('{{surveymenu_entries}}', $aSurveymenuentry);
            }
        }
        $participantsEntry = $db->select("*")->from("{{surveymenu_entries}}")->where('name=:name', [':name' => 'participants'])->query()->rowCount;
        if ($participantsEntry) {
            $this->db->createCommand()->update(
                '{{surveymenu_entries}}',
                [ "menu_title" => "Participants"],
                'name=:name',
                [':name' => 'participants']
            );
        }
        $generalEntry = $db->select("*")->from("{{surveymenu_entries}}")->where('name=:name', [':name' => 'generalsettings'])->query()->rowCount;
        if ($generalEntry) {
            $this->db->createCommand()->update(
... (9 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_626.php">
<?php
namespace LimeSurvey\Helpers\Update;
use CException;
class Update_626 extends DatabaseUpdateBase
{
    public function up(): void
    {
        $boxes = $this->db->createCommand()
            ->select("*")
            ->from("{{boxes}}")
            ->order('position ASC')
            ->queryAll();
        if (!empty($boxes)) {
            if ($boxes[array_key_first($boxes)]['position'] === 1) {
                foreach ($boxes as $box) {
                    $this->db->createCommand()->update(
                        '{{boxes}}',
                        ['position' => $box['position'] + 1],
                        "id = '{$box['id']}'"
                    );
                }
            }
            foreach ($boxes as $box) {
                if (
                    $box['url'] === 'dashboard/view' ||
                    $box['url'] === 'surveyAdministration/listsurveys'
                ) {
                    $this->db->createCommand()
                        ->delete('{{boxes}}', 'url=:url', [':url' => $box['url']]);
                }
... (16 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_627.php">
<?php
namespace LimeSurvey\Helpers\Update;
use CException;
class Update_627 extends DatabaseUpdateBase
{
    private $iconMappings = [
        ['id' => 1 , 'icon' => 'ri-play-fill'],
        ['id' => 2 , 'icon' => 'ri-add-circle-fill'],
        ['id' => 3 , 'icon' => 'ri-chat-3-line'],
        ['id' => 4 , 'icon' => 'ri-chat-1-line'],
        ['id' => 5 , 'icon' => 'ri-git-branch-fill'],
        ['id' => 6 , 'icon' => 'ri-file-copy-line'],
        ['id' => 7 , 'icon' => 'ri-shield-user-line'],
        ['id' => 8 , 'icon' => 'ri-arrow-left-circle-fill'],
        ['id' => 9 , 'icon' => 'ri-skip-back-fill'],
        ['id' => 10, 'icon' => 'ri-skip-forward-fill'],
        ['id' => 11, 'icon' => 'ri-arrow-right-circle-fill'],
        ['id' => 12, 'icon' => 'ri-grid-line'],
        ['id' => 13, 'icon' => 'ri-settings-5-fill'],
        ['id' => 14, 'icon' => 'ri-pencil-fill'],
        ['id' => 15, 'icon' => 'ri-mail-settings-line'],
        ['id' => 17, 'icon' => 'ri-download-fill'],
        ['id' => 18, 'icon' => 'ri-superscript'],
        ['id' => 19, 'icon' => 'ri-checkbox-fill'],
        ['id' => 20, 'icon' => 'ri-list-settings-line'],
        ['id' => 21, 'icon' => 'ri-upload-fill'],
        ['id' => 22, 'icon' => 'ri-mail-send-fill'],
        ['id' => 23, 'icon' => 'ri-price-tag-3-line'],
        ['id' => 24, 'icon' => 'ri-list-unordered'],
        ['id' => 25, 'icon' => 'ri-shut-down-line'],
... (139 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_628.php">
<?php
namespace LimeSurvey\Helpers\Update;
use LimeSurvey\Helpers\Update\DatabaseUpdateBase;
class Update_628 extends DatabaseUpdateBase
{
    public function up()
    {
        $this->db->createCommand(
            "DELETE FROM {{settings_global}} WHERE " . $this->db->quoteColumnName('stg_name') . " LIKE 'last_survey_%'"
        )->execute();
        $this->db->createCommand(
            "DELETE FROM {{settings_global}} WHERE " . $this->db->quoteColumnName('stg_name') . " LIKE 'last_question_%'"
        )->execute();
    }
}
</file>

<file path="application/helpers/update/updates/Update_629.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_629 extends DatabaseUpdateBase
{
    public function up(): void
    {
        if (!tableExists('{{twoFactorUsers}}') && !tableExists('{{twofactorusers}}')) {
            return;
        }
        $this->db->createCommand()->renameTable('{{twoFactorUsers}}', '{{user_mfa_settings}}');
        $this->db->createCommand()->update(
            '{{user_mfa_settings}}',
            ['authType' => 'totp'],
            $this->db->quoteColumnName("authType") . " != 'yubi'"
        );
        $tfaUserKeys = $this->db->createCommand()
            ->select('*')
            ->from('{{user_mfa_settings}}')
            ->queryAll();
        foreach ($tfaUserKeys as $tfaUserKey) {
            if (empty($tfaUserKey['secretKey'])) {
                continue;
            }
            $encryptedSecretKey = \LSActiveRecord::encryptSingle($tfaUserKey['secretKey']);
            $this->db->createCommand()->update(
                '{{user_mfa_settings}}',
                ['secretKey' => $encryptedSecretKey],
                'uid = :uid',
                ['uid' => $tfaUserKey['uid']]
            );
... (4 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_630.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_630 extends DatabaseUpdateBase
{
    public function up()
    {
        $updates = [
            'browserdetect' => 'themes/question/browserdetect/survey/questions/answer/shortfreetext/assets/browserdetect.png',
            'inputondemand' => 'themes/question/inputondemand/survey/questions/answer/multipleshorttext/assets/inputondemand.png',
            'image_select-multiplechoice' => 'themes/question/image_select-multiplechoice/survey/questions/answer/multiplechoice/assets/image_select_multiplechoice.png',
            'ranking_advanced' => 'themes/question/ranking_advanced/survey/questions/answer/ranking/assets/advanced_ranking.png',
            'image_select-listradio' => 'themes/question/image_select-listradio/survey/questions/answer/listradio/assets/image_select_listradio.png',
        ];
        foreach ($updates as $name => $imagePath) {
            $this->db->createCommand()->update(
                '{{question_themes}}',
                ['image_path' => $imagePath],
                'name = :name',
                [':name' => $name]
            );
        }
    }
}
</file>

<file path="application/helpers/update/updates/Update_631.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_631 extends DatabaseUpdateBase
{
    public function up()
    {
    }
}
</file>

<file path="application/helpers/update/updates/Update_632.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_632 extends DatabaseUpdateBase
{
    public function up()
    {
        \alterColumn('{{surveys_groupsettings}}', 'datestamp', 'string(1)', false, 'Y');
        \alterColumn('{{surveys}}', 'datestamp', 'string(1)', false, 'Y');
    }
}
</file>

<file path="application/helpers/update/updates/Update_633.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_633 extends DatabaseUpdateBase
{
    public function up()
    {
        $this->db->createCommand()->update(
            '{{surveymenu_entries}}',
            [
                'menu_link' => 'admin/statistics/sa/simpleStatistics/',
            ],
            'name=\'statistics\''
        );
    }
}
</file>

<file path="application/helpers/update/updates/Update_634.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_634 extends DatabaseUpdateBase
{
    public function up()
    {
    }
}
</file>

<file path="application/helpers/update/updates/Update_636.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_636 extends DatabaseUpdateBase
{
    public function up()
    {
        $columnNames = \Yii::app()->db->schema->getTable('{{surveys}}')->columnNames;
        if (!in_array('access_mode', $columnNames)) {
            addColumn('{{surveys}}', 'access_mode', "string(1) DEFAULT 'O'");
            $sids = [];
            foreach (dbGetTablesLike('tokens\_%') as $table) {
                if (strpos($table, "old") === false) {
                    $split = explode("_", $table);
                    $sids[] = $split[count($split) - 1];
                }
            }
            if (count($sids)) {
                $this->db->createCommand()->update("{{surveys}}", ["access_mode" => "C"], "sid in (" . implode(",", $sids) . ")");
            }
        }
    }
}
</file>

<file path="application/helpers/update/updates/Update_637.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_637 extends DatabaseUpdateBase
{
    public function up()
    {
        $command = \Yii::app()->db->createCommand();
        $surveys = $command->select('*')->from('{{surveys}}')->queryAll();
        foreach ($surveys as $survey) {
            if (!empty($survey['attributedescriptions']) && substr($survey['attributedescriptions'], 0, 1) != '{' && substr($survey['attributedescriptions'], 0, 1) != '[') {
                $sSerialType = getSerialClass($survey['attributedescriptions']);
                if ($sSerialType == 'array') {
                    $newAttributeDescriptions = json_encode(unserialize($survey['attributedescriptions'], ["allowed_classes" => false]) ?? []);
                    $updateCommand = \Yii::app()->db->createCommand();
                    $updateCommand->update(
                        '{{surveys}}',
                        array('attributedescriptions' => $newAttributeDescriptions),
                        'sid = :sid',
                        array(':sid' => $survey['sid'])
                    );
                }
            }
        }
    }
}
</file>

<file path="application/helpers/update/updates/Update_638.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_638 extends DatabaseUpdateBase
{
    public function up()
    {
        $db = \Yii::app()->db;
        $columnNames = $db->schema->getTable('{{surveys}}')->columnNames;
        if (!in_array('lastmodified', $columnNames, true)) {
            addColumn('{{surveys}}', 'lastmodified', 'datetime NULL');
            $db->createCommand(
                'UPDATE {{surveys}} SET lastmodified = :lastmodified WHERE lastmodified IS NULL'
            )->bindValue(':lastmodified', gmdate('Y-m-d H:i:s'))->execute();
            alterColumn('{{surveys}}', 'lastmodified', 'datetime', false);
        }
    }
}
</file>

<file path="application/helpers/update/updates/Update_639.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_639 extends DatabaseUpdateBase
{
    public function up()
    {
    }
}
</file>

<file path="application/helpers/update/updates/Update_640.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_640 extends DatabaseUpdateBase
{
    public function up()
    {
        $this->db->createCommand(
            "INSERT INTO {{question_attributes}} (qid, "
            . $this->db->quoteColumnName("attribute") . ", "
            . $this->db->quoteColumnName("value") . ")
             SELECT
                qa.qid,
                'subquestion_order' AS " . $this->db->quoteColumnName("attribute") . ",
                'random' AS " . $this->db->quoteColumnName("value") . "
             FROM {{question_attributes}} qa
             JOIN {{questions}} q ON qa.qid = q.qid
             WHERE
                " . $this->db->quoteColumnName("attribute") . " = 'random_order'
                AND " . $this->db->quoteColumnName("value") . " = '1'
                AND q.type IN ('M', 'P')"
        )->execute();
        $this->db->createCommand(
            "UPDATE {{question_attributes}}
             SET " . $this->db->quoteColumnName("value") . " = 0
             WHERE " . $this->db->quoteColumnName("attribute") . " = 'random_order'
             AND " . $this->db->quoteColumnName("value") . " = '1'
             AND qid IN (
                SELECT q.qid
                FROM {{questions}} q
                WHERE q.type IN ('M', 'P')
... (5 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_641.php">
<?php
namespace LimeSurvey\Helpers\Update;
use CException;
class Update_641 extends DatabaseUpdateBase
{
    public function up()
    {
        $templateConfigurations = $this->db->createCommand()
            ->select('id, options')
            ->from('{{template_configuration}}')
            ->where('template_name = :template_name', [':template_name' => 'fruity_twentythree'])
            ->andWhere(['NOT IN', 'options', 'inherit'])
            ->queryAll();
        if (!empty($templateConfigurations)) {
            foreach ($templateConfigurations as $templateConfiguration) {
                if ($templateConfiguration['options'] !== 'inherit') {
                    $sOptionsJson = $templateConfiguration['options'];
                    $oOldOptions = json_decode($sOptionsJson);
                    $oOldOptions->cornerradius = '2';
                    $oOldOptions->bodybackgroundcolor = '#ffffff';
                    $oOldOptions->fontcolor = '#444444';
                    $oOldOptions->questionbackgroundcolor = '#ffffff';
                    $oOldOptions->checkicon = 'f00c';
                    $oNewOtionsJson = json_encode($oOldOptions);
                    $this->db->createCommand()->update(
                        '{{template_configuration}}',
                        ['options' => $oNewOtionsJson],
                        'id = :id',
                        [':id' => $templateConfiguration['id']]
                    );
... (6 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_642.php">
<?php
namespace LimeSurvey\Helpers\Update;
use CException;
class Update_642 extends DatabaseUpdateBase
{
    public function up()
    {
        $templateConfigurations = $this->db->createCommand()
            ->select('id, options')
            ->from('{{template_configuration}}')
            ->where('template_name = :template_name', [':template_name' => 'fruity_twentythree'])
            ->andWhere(['NOT IN', 'options', 'inherit'])
            ->queryAll();
        if (!empty($templateConfigurations)) {
            foreach ($templateConfigurations as $templateConfiguration) {
                if ($templateConfiguration['options'] !== 'inherit') {
                    $optionsJson = $templateConfiguration['options'];
                    $oldOptions = json_decode($optionsJson);
                    if (isset($oldOptions->checkicon) && $oldOptions->checkicon !== 'inherit') {
                        $oldOptions->checkicon = 'EB7A';
                        $newOptionsJson = json_encode($oldOptions);
                        $this->db->createCommand()->update(
                            '{{template_configuration}}',
                            ['options' => $newOptionsJson],
                            'id = :id',
                            [':id' => $templateConfiguration['id']]
                        );
                    }
                }
            }
... (4 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_643.php">
<?php
namespace LimeSurvey\Helpers\Update;
use CException;
use PDO;
class Update_643 extends DatabaseUpdateBase
{
    public function up()
    {
        $desc = $this->db->quoteColumnName('desc');
        $this->db->createCommand("UPDATE {{boxes}} SET title = :title, buttontext = :buttontext, {$desc} = :desc WHERE id = :id")
            ->execute([
                ':title' => 'Workspace',
                ':buttontext' => 'View workspace',
                ':desc' => 'View workspace',
                ':id' => 1,
            ]);
    }
}
</file>

<file path="application/helpers/update/updates/Update_644.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_644 extends DatabaseUpdateBase
{
    public function up()
    {
    }
}
</file>

<file path="application/helpers/update/updates/Update_645.php">
<?php
namespace LimeSurvey\Helpers\Update;
use CException;
class Update_645 extends DatabaseUpdateBase
{
    public function up()
    {
        $templateConfigurations = $this->db->createCommand()
            ->select('id, options')
            ->from('{{template_configuration}}')
            ->where(
                'template_name = :template_name AND LOWER(options) LIKE :optionValue',
                [
                    ':template_name' => 'fruity_twentythree',
                    ':optionValue' => '%f00c%'
                ]
            )
            ->queryAll();
        if (!empty($templateConfigurations)) {
            foreach ($templateConfigurations as $templateConfiguration) {
                $optionsJson = $templateConfiguration['options'];
                $oldOptions = json_decode($optionsJson);
                if (isset($oldOptions->checkicon) && strtolower($oldOptions->checkicon) == 'f00c') {
                    $oldOptions->checkicon = 'EB7A';
                    $newOptionsJson = json_encode($oldOptions);
                    $this->db->createCommand()->update(
                        '{{template_configuration}}',
                        ['options' => $newOptionsJson],
                        'id = :id',
                        [':id' => $templateConfiguration['id']]
... (7 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_646.php">
<?php
namespace LimeSurvey\Helpers\Update;
use CException;
class Update_646 extends DatabaseUpdateBase
{
    public function up()
    {
        $templateConfigurations = $this->db->createCommand()
            ->select('id, options')
            ->from('{{template_configuration}}')
            ->where(
                'template_name = :template_name AND options <> :optionValue',
                [
                    ':template_name' => 'fruity_twentythree',
                    ':optionValue' => 'inherit'
                ]
            )
            ->queryAll();
        if (!empty($templateConfigurations)) {
            foreach ($templateConfigurations as $templateConfiguration) {
                $optionsJson = $templateConfiguration['options'];
                $oldOptions = json_decode($optionsJson);
                if (empty($oldOptions->notables)) {
                    $oldOptions->notables = '1';
                    $newOptionsJson = json_encode($oldOptions);
                    $this->db->createCommand()->update(
                        '{{template_configuration}}',
                        ['options' => $newOptionsJson],
                        'id = :id',
                        [':id' => $templateConfiguration['id']]
... (7 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_647.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_647 extends DatabaseUpdateBase
{
    public function up()
    {
        $surveyslanguage = \Yii::app()->db->createCommand()
            ->select(['surveyls_survey_id', 'surveyls_language', 'attachments'])
            ->from('{{surveys_languagesettings}}')
            ->where("attachments <> '' AND attachments IS NOT NULL AND attachments <> :emptyarray")
            ->bindValue(":emptyarray", serialize([]))
            ->queryAll();
        foreach ($surveyslanguage as $surveylanguage) {
            if (!empty($surveylanguage['attachments']) && substr($surveylanguage['attachments'], 0, 1) != '{' && substr($surveylanguage['attachments'], 0, 1) != '[') {
                $sSerialType = getSerialClass($surveylanguage['attachments']);
                if ($sSerialType == 'array') {
                    $unserialized = unserialize($surveylanguage['attachments'], ["allowed_classes" => false]);
                    if (empty($unserialized) || !is_array($unserialized)) {
                        $newAttachments = "";
                    } else {
                        $newAttachments = json_encode($unserialized);
                        if ($newAttachments === false) {
                            /* JSON encoding failed, save as empty string */
                            $newAttachments = "";
                        }
                    }
                } else {
                    /* All other as empty string */
                    $newAttachments = "";
                }
... (12 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_648.php">
<?php
namespace LimeSurvey\Helpers\Update;
use CException;
class Update_648 extends DatabaseUpdateBase
{
    public function up()
    {
        $newdescription = "{{gT(\"Based on BootsWatch Themes:\")}}<br><a href='https://bootswatch.com/3/' target='_blank' rel='external' title='{{gT(\"Visit Bootswatch page in a new window.\")}}'>{{gT(\"Visit Bootswatch page\")}} <i class='ri-external-link-line'></i><span class='visually-hidden'>{{gT(\"(Opens in a new window)\")}}</span></a>";
        $this->db->createCommand()->update(
            "{{templates}}",
            [
                'description' => $newdescription
            ],
            "name = :name",
            [
                ':name' => 'bootswatch'
            ]
        );
        $this->db->createCommand()->update(
            "{{templates}}",
            [
                'description' => $newdescription
            ],
            "description = :olddescription",
            [
                ':olddescription' => "{{gT(\"Based on BootsWatch Themes:\")}} <br><a href='https://bootswatch.com/3/'>{{gT(\"Visit Bootswatch page\")}}</a> "
            ]
        );
    }
}
... (1 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_649.php">
<?php
namespace LimeSurvey\Helpers\Update;
use CException;
class Update_649 extends DatabaseUpdateBase
{
    public function up()
    {
        $surveysTable = \Yii::app()->db->schema->getTable('{{surveys}}');
        if (!isset($surveysTable->columns['showregisterpolicy'])) {
            $this->db->createCommand()->addColumn('{{surveys}}', 'showregisterpolicy', "string(1) NOT NULL DEFAULT 'I'");
        }
        if (!isset($surveysTable->columns['showtokenpolicy'])) {
            $this->db->createCommand()->addColumn('{{surveys}}', 'showtokenpolicy', "string(1) NOT NULL DEFAULT 'I'");
        }
        $surveysGroupsSettingsTable = \Yii::app()->db->schema->getTable('{{surveys_groupsettings}}');
        if (!isset($surveysGroupsSettingsTable->columns['showregisterpolicy'])) {
            $this->db->createCommand()->addColumn('{{surveys_groupsettings}}', 'showregisterpolicy', "string(1) NOT NULL DEFAULT 'I'");
            $this->db->createCommand()->update('{{surveys_groupsettings}}', ['showregisterpolicy' => 'N'], 'gsid=0');
        }
        if (!isset($surveysGroupsSettingsTable->columns['showtokenpolicy'])) {
            $this->db->createCommand()->addColumn('{{surveys_groupsettings}}', 'showtokenpolicy', "string(1) NOT NULL DEFAULT 'I'");
            $this->db->createCommand()->update('{{surveys_groupsettings}}', ['showtokenpolicy' => 'N'], 'gsid=0');
        }
    }
}
</file>

<file path="application/helpers/update/updates/Update_650.php">
<?php
namespace LimeSurvey\Helpers\Update;
use CException;
class Update_650 extends DatabaseUpdateBase
{
    public function up()
    {
        $rows = $this->db->createCommand()
            ->select('sid, attributedescriptions')
            ->from('{{surveys}}')
            ->where("attributedescriptions IS NOT NULL AND attributedescriptions != :empty", [':empty' => ''])
            ->queryAll();
        foreach ($rows as $row) {
            $raw = $row['attributedescriptions'];
            $decoded = json_decode($raw, true);
            if (!is_array($decoded)) {
                continue;
            }
            $modified = false;
            foreach ($decoded as $key => &$attributes) {
                if (!preg_match('/^attribute_\d+$/', $key)) {
                    continue;
                }
                if (!is_array($attributes)) {
                    continue;
                }
                if (count($attributes) <= 1 && array_key_exists('encrypted', $attributes)) {
                    continue;
                }
                if (!array_key_exists('type', $attributes)) {
... (21 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_651.php">
<?php
namespace LimeSurvey\Helpers\Update;
use CException;
use Yii;
class Update_651 extends DatabaseUpdateBase
{
    public function up()
    {
        if (in_array(Yii::app()->db->getDriverName(), ['mssql', 'sqlsrv', 'dblib'])) {
            $questionArchives = $this->db->createCommand(
                "
                    SELECT CONCAT('alter table ', TABLE_NAME, ' ADD CONSTRAINT pk_', TABLE_NAME, ' PRIMARY KEY (qid)') AS alter_command
                    FROM information_schema.tables
                    WHERE TABLE_CATALOG = db_name() AND TABLE_NAME LIKE '%old_questions%';
                "
            )->query();
            foreach ($questionArchives as $questionArchive) {
                $this->db->createCommand($questionArchive['alter_command'])->execute();
            }
        }
    }
}
</file>

<file path="application/helpers/update/updates/Update_700.php">
<?php
namespace LimeSurvey\Helpers\Update;
use Yii;
class Update_700 extends DatabaseUpdateBase
{
    protected $scriptMapping;
    protected $questionCodes = [];
    protected $insertansProcessedSids = [];
    protected function dbQuoteFields($fields): string
    {
        if (is_string($fields)) {
            if (strpos($fields, ',') !== false) {
                $fields = explode(',', $fields);
            } else {
                $fields = [$fields];
            }
        }
        if (is_array($fields) && count($fields) > 0) {
            $driver = App()->db->getDriverName();
            switch ($driver) {
                case 'mysql':
                case 'mysqli':
                    $fields = array_map(function ($f) {
                        return '`' . trim($f) . '`';
                    }, $fields);
                    break;
                case 'dblib':
                case 'mssql':
                case 'sqlsrv':
                    $fields = array_map(function ($f) {
... (2078 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_701.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_701 extends DatabaseUpdateBase
{
    public function up()
    {
        $this->db->createCommand()->insert(
            "{{plugins}}",
            [
                'name' => 'ReactEditor',
                'plugin_type' => 'core',
                'active' => 1,
                'version' => '1.0.0',
                'load_error' => 0,
                'load_error_message' => null,
                'priority' => 0,
            ]
        );
        $command = $this->db->createCommand()
            ->select('id')
            ->from('{{plugins}}')
            ->where('name = :name', [':name' => 'LimeSurveyProfessional']);
        if ($command->queryRow()) {
            $this->db->createCommand()->update(
                '{{plugins}}',
                ['priority' => 1],
                'name = :name',
                [':name' => 'LimeSurveyProfessional']
            );
        }
... (3 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_702.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_702 extends DatabaseUpdateBase
{
    public function up()
    {
        dropColumn('{{surveys}}', 'nokeyboard');
        dropColumn('{{surveys_groupsettings}}', 'nokeyboard');
    }
}
</file>

<file path="application/helpers/update/updates/Update_703.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_703 extends DatabaseUpdateBase
{
    public function up()
    {
        $db = \Yii::app()->db;
        $rankingThemes = $db->createCommand(
            "SELECT id, settings FROM {{question_themes}} WHERE question_type = :question_type"
        )->queryAll(true, [':question_type' => 'R']);
        foreach ($rankingThemes as $row) {
            $settings = json_decode($row['settings'] ?? '{}', true);
            if (!is_array($settings)) {
                $settings = [];
            }
            $settings['subquestions'] = "1";
            $settings['answerscales'] = "0";
            $db->createCommand()->update(
                '{{question_themes}}',
                ['settings' => json_encode($settings)],
                'id = :id',
                [':id' => $row['id']]
            );
        }
    }
}
</file>

<file path="application/helpers/update/updates/Update_704.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_704 extends DatabaseUpdateBase
{
    public function up()
    {
    }
}
</file>

<file path="application/helpers/update/updates/Update_705.php">
<?php
namespace LimeSurvey\Helpers\Update;
use CDbExpression;
use LimeSurvey\PluginManager\PluginManager;
class Update_705 extends DatabaseUpdateBase
{
    public function up()
    {
        $exists = $this->db->createCommand()
            ->select('COUNT(*)')
            ->from('{{plugins}}')
            ->where('priority = 0 AND name NOT IN (:re, :eqh)', [
                ':re' => 'ReactEditor',
                ':eqh' => 'expressionQuestionHelp',
            ])
            ->queryScalar();
        if ($exists > 0) {
            $this->db->createCommand()->update(
                '{{plugins}}',
                ['priority' => new CDbExpression('priority + 1')],
                'name NOT IN (:re, :lsp)',
                [
                    ':re' => 'ReactEditor',
                    ':lsp' => 'LimeSurveyProfessional',
                ]
            );
        }
        $this->db->createCommand()->update(
            '{{plugins}}',
            ['priority' => 0],
... (9 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_706.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_706 extends DatabaseUpdateBase
{
    public function up()
    {
        $this->convertEmptyEmailsToNull();
        $this->deduplicateEmails();
        $this->dropOldEmailIndex();
        $this->createUniqueEmailIndex();
    }
    private function convertEmptyEmailsToNull()
    {
        $this->db->createCommand()
            ->setText("UPDATE {{users}} SET email = NULL WHERE email = ''")
            ->execute();
    }
    private function deduplicateEmails()
    {
        $duplicates = $this->db->createCommand()
            ->setText("SELECT email FROM {{users}} WHERE email IS NOT NULL GROUP BY email HAVING COUNT(*) > 1")
            ->queryColumn();
        foreach ($duplicates as $dupEmail) {
            $rows = $this->db->createCommand()
                ->setText("SELECT uid FROM {{users}} WHERE email = :email ORDER BY uid ASC")
                ->bindValue(':email', $dupEmail)
                ->queryColumn();
            array_shift($rows);
            foreach ($rows as $uid) {
                $candidate = $this->buildUniqueEmail($dupEmail, $uid);
... (72 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_707.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_707 extends DatabaseUpdateBase
{
    public function up()
    {
        $this->db->createCommand()
            ->update(
                '{{plugins}}',
                [
                    'active' => 0
                ],
                "plugin_type <> 'core'"
            );
    }
}
</file>

<file path="application/helpers/update/updates/Update_708.php">
<?php
namespace LimeSurvey\Helpers\Update;
use CException;
class Update_708 extends DatabaseUpdateBase
{
    public function up()
    {
        $this->db->createCommand()->update(
            '{{question_themes}}',
            ['title' => 'Array (Yes/Uncertain/No)'],
            'name = :name AND title = :oldTitle',
            [
                ':name' => 'arrays/yesnouncertain',
                ':oldTitle' => 'Array (Yes/No/Uncertain)',
            ]
        );
        $this->db->createCommand()->update(
            '{{question_themes}}',
            ['description' => 'Array (Yes/Uncertain/No) question type configuration'],
            'name = :name AND description = :oldDescription',
            [
                ':name' => 'arrays/yesnouncertain',
                ':oldDescription' => 'Array (Yes/No/Uncertain) question type configuration',
            ]
        );
    }
}
</file>

<file path="application/helpers/update/updates/Update_709.php">
<?php
namespace LimeSurvey\Helpers\Update;
use CException;
use Yii;
class Update_709 extends DatabaseUpdateBase
{
    protected function alterMySQL(int $sid, int $parent_qid, array $cols)
    {
        addColumn("{{responses_" . $sid . "}}", "Q{$parent_qid}", "JSON");
        $alterElements = [];
        $quotedCols = [];
        foreach ($cols as $col) {
            $quotedCol = $this->db->quoteColumnName($col);
            $quotedCols[] = $quotedCol;
            $alterElements[] = "CASE WHEN LENGTH({$quotedCol}) > 0 THEN JSON_QUOTE({$quotedCol}) ELSE NULL END";
        }
        $concatWs = "CONCAT_WS(',', " . implode(',', $alterElements) . ")";
        $allNullCheck = "COALESCE(" . implode(',', $quotedCols) . ") IS NULL";
        $updateCommand = "UPDATE {{responses_" . $sid . "}} SET Q{$parent_qid} = CASE WHEN {$allNullCheck} THEN NULL ELSE CONCAT('[', {$concatWs}, ']') END";
        $this->db->createCommand($updateCommand)->execute();
        foreach ($cols as $col) {
            dropColumn("{{responses_" . $sid . "}}", $col);
        }
    }
    protected function alterSQLServer(int $sid, int $parent_qid, array $cols)
    {
        addColumn("{{responses_" . $sid . "}}", "Q{$parent_qid}", "json");
        $alterElements = [];
        $quotedCols = [];
        foreach ($cols as $col) {
... (146 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_710.php">
<?php
namespace LimeSurvey\Helpers\Update;
use CException;
class Update_710 extends DatabaseUpdateBase
{
    public function up()
    {
        if ($this->db->getDriverName() !== 'pgsql') {
            return;
        }
        \fixPostgresSequence();
    }
}
</file>

<file path="application/helpers/update/updates/Update_711.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_711 extends DatabaseUpdateBase
{
    public function up()
    {
    }
}
</file>

<file path="application/helpers/update/updates/Update_712.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_712 extends DatabaseUpdateBase
{
    public function up()
    {
        addColumn('{{surveys}}', 'preselectnoanswer', "string(1) NULL DEFAULT 'I'");
        addColumn('{{surveys_groupsettings}}', 'preselectnoanswer', "string(1) NULL DEFAULT 'I'");
        $this->db->createCommand()->update(
            '{{surveys_groupsettings}}',
            ['preselectnoanswer' => 'Y'],
            'gsid = :gsid',
            [':gsid' => 0]
        );
    }
}
</file>

<file path="application/helpers/update/updates/Update_713.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_713 extends DatabaseUpdateBase
{
    public function up()
    {
        $this->db->createCommand()->update(
            '{{plugins}}',
            ['plugin_type' => 'user'],
            'plugin_type IS NULL'
        );
    }
}
</file>

<file path="application/helpers/update/updates/Update_714.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_714 extends DatabaseUpdateBase
{
    private const CRUD_COLUMNS = ['create_p', 'read_p', 'update_p', 'delete_p', 'import_p', 'export_p'];
    private const KNOWN_INDEX_NAMES = ['idx1_permissions', 'idxPermissions', 'permissions_idx2'];
    public function up()
    {
        $this->mergeDuplicatePermissions();
        $this->dropExistingPermissionsIndexes();
        $this->createUniquePermissionsIndex();
    }
    private function mergeDuplicatePermissions()
    {
        $duplicateGroups = $this->db->createCommand()
            ->select('entity_id, entity, permission, uid')
            ->from('{{permissions}}')
            ->group('entity_id, entity, permission, uid')
            ->having('COUNT(*) > 1')
            ->queryAll();
        foreach ($duplicateGroups as $group) {
            $rows = $this->db->createCommand()
                ->select('*')
                ->from('{{permissions}}')
                ->where('entity_id = :entity_id AND entity = :entity AND permission = :permission AND uid = :uid', [
                    ':entity_id'  => $group['entity_id'],
                    ':entity'     => $group['entity'],
                    ':permission' => $group['permission'],
                    ':uid'        => $group['uid'],
                ])
... (47 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_715.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_715 extends DatabaseUpdateBase
{
    public function up()
    {
        $command = \Yii::app()->db->createCommand();
        $activeSurveyIds = $command->select('sid')
            ->from('{{surveys}}')
            ->where("active='Y'")
            ->queryColumn();
        foreach ($activeSurveyIds as $surveyId) {
            $responseTableName = "{{responses_" . $surveyId . "}}";
            if (!tableExists($responseTableName)) {
                continue;
            }
            try {
                setTransactionBookmark();
                \Yii::app()->db->createCommand()->addColumn(
                    $responseTableName,
                    'quota_exit',
                    'integer'
                );
            } catch (\Exception $e) {
                rollBackToTransactionBookmark();
            }
        }
        $surveysTable = $this->db->schema->getTable('{{surveys}}');
        if (!isset($surveysTable->columns['savequotaexit'])) {
            try {
... (22 lines truncated)
</file>

<file path="application/helpers/update/updates/Update_716.php">
<?php
namespace LimeSurvey\Helpers\Update;
class Update_716 extends DatabaseUpdateBase
{
    public function up()
    {
        $this->db->createCommand()->addColumn('{{users}}', 'session_token', 'string(64) NULL');
    }
}
</file>

<file path="application/helpers/update/updates/Update_717.php">
<?php
namespace LimeSurvey\Helpers\Update;
use TemplateConfiguration;
class Update_717 extends DatabaseUpdateBase
{
    public function up()
    {
        $themes = TemplateConfiguration::model()->findAllByAttributes([
            'template_name' => 'fruity_twentythree',
        ]);
        foreach ($themes as $theme) {
            $theme->addOptionFromXMLToLiveTheme();
        }
    }
}
</file>

<file path="application/helpers/update/DatabaseUpdateBase.php">
<?php
namespace LimeSurvey\Helpers\Update;
use CDbConnection;
use Exception;
use Throwable;
abstract class DatabaseUpdateBase
{
    protected $db;
    protected $newVersion;
    protected $options;
    public function __construct(CDbConnection $connection, $options)
    {
        $this->db = $connection;
        $this->newVersion = $this->getVersion();
        $this->options = $options;
    }
    public function safeUp()
    {
        $transaction = $this->db->beginTransaction();
        try {
            $this->up();
            $this->updateVersion();
            $transaction->commit();
        } catch (Throwable $e) {
            $transaction->rollback();
            throw $e;
        }
    }
    private function updateVersion()
    {
... (21 lines truncated)
</file>

<file path="application/helpers/update/README.md">
Folders in updates/ are sorted __semantically__. The separate update classes in each folder are sorted __alphabetically__.

5.10 is higher than 5.2 semantically.

`update_447.php` is higher than `update_446.php` alphabetically.

`update_20211010.php` is higher than `update_20211009.php` alphabetically.

ISO standard date can be sorted alphabetically.

At each major and minor release, a new folder must be created in this folder with the new version number (omitting patch version, which is assumed to be zero).
</file>

<file path="application/helpers/update/update_helper.php">
<?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
function CheckForDBUpgrades($subaction = null)
{
    $dbversionnumber = Yii::app()->getConfig('dbversionnumber');
    $currentDBVersion = Yii::app()->getConfig('DBVersion');
    if (intval($dbversionnumber) > intval($currentDBVersion)) {
        Yii::app()->loadHelper('update.updatedb');
        if (isset($subaction) && $subaction == "yes") {
            $header = Yii::app()->getController()->getAdminHeader(false, true);
            $header = preg_replace('/<###begin###>/', '', (string) $header);
            echo $header;
            $result = db_upgrade_all(intval($currentDBVersion));
            if ($result) {
                $data =
                '<div class="jumbotron message-box">' .
                    '<h2 class="">' . gT('Success') . '</h2>' .
                    '<p class="lead">' .
                        sprintf(gT("Database has been successfully upgraded to version %s"), $dbversionnumber) .
                    '</p>' .
                    '<p>' .
                        '<a href="' . Yii::app()->getController()->createUrl("/admin") . '">' . gT("Back to main menu") . '</a>' .
                    '</p>' .
                    '</div>';
            } else {
                $msg = '';
                foreach (yii::app()->user->getflashes() as $key => $message) {
                    $msg .= App()->getController()->widget('ext.AlertWidget.AlertWidget', [
... (36 lines truncated)
</file>

<file path="application/helpers/update/updatedb_helper.php">
<?PHP
use LimeSurvey\Helpers\Update\DatabaseUpdateBase;
function flushWebFileCache()
{
    if (Yii::app()->cache instanceof CFileCache) {
        return;
    }
    try {
        $fileCache = new CFileCache();
        $fileCache->init();
        $fileCache->flush();
    } catch (\Throwable $t) {
        Yii::log('Failed to flush the file cache: ' . $t->getMessage(), 'error', 'application.db.update');
    }
}
function db_upgrade_all($iOldDBVersion, $bSilent = false)
{
    $aCriticalDBVersions = array(310, 400, 450, 600, 700);
    $aAllUpdates         = range($iOldDBVersion + 1, Yii::app()->getConfig('dbversionnumber'));
    if ($bSilent && (count(array_intersect($aCriticalDBVersions, $aAllUpdates)) > 0)) {
        return false;
    }
    if ($iOldDBVersion < 132) {
        return false;
    }
    try {
        $oDbConnection = Yii::app()->getDb();
        $requirement = \LimeSurvey\Helpers\DbVersionHelper::getRequirement(
            $oDbConnection->getDriverName(),
            $oDbConnection->getServerVersion()
... (2851 lines truncated)
</file>

<file path="application/helpers/ClassFactory.php">
<?php
class ClassFactory
{
    protected static $map = array();
    protected static $registered = false;
    public static function autoload(string $className)
    {
        foreach (self::$map as $prefix => $baseClass) {
            if (strpos($className, (string) $prefix) === 0) {
                self::createClass($baseClass, $className);
                return true;
            }
        }
        return false;
    }
    public static function createClass($baseClass, $className)
    {
        $code = "class $className extends $baseClass {}";
        return eval($code);
    }
    public static function registerClass($prefix, $baseClass)
    {
        self::$map[$prefix] = $baseClass;
        if (!self::$registered) {
            self::$registered = spl_autoload_register(array(get_class(new static()), 'autoload'), true, true);
        }
    }
}
</file>

<file path="application/helpers/common_helper.php">
<?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
Yii::import('application.helpers.sanitize_helper', true);
function gT($sToTranslate, $sEscapeMode = 'html', $sLanguage = null)
{
    if (($sToTranslate == '')) {
        return '';
    }
    return quoteText(Yii::t('', $sToTranslate, array(), null, $sLanguage), $sEscapeMode);
}
/**
 * As gT(), but echoes directly
 *
 * @param string $sToTranslate
 * @param string $sEscapeMode
 * @return void
 */
function eT($sToTranslate, $sEscapeMode = 'html')
{
    echo gT($sToTranslate, $sEscapeMode);
}
function ngT($sTextToTranslate, $iCount, $sEscapeMode = 'html')
{
    return quoteText(Yii::t('', $sTextToTranslate, $iCount), $sEscapeMode);
}
/**
 * Translation helper function for plural forms which outputs right away
 * @param string $sToTranslate
... (4415 lines truncated)
</file>

<file path="application/helpers/ConfigMergeHelper.php">
<?php
namespace LimeSurvey\Helpers;
class ConfigMergeHelper
{
    const REPLACED_PARAMS = ['pageSizeOptions', 'pageSizeOptionsTokens'];
    public static function merge(array $internalConfig, array $userConfig): array
    {
        $result = \CMap::mergeArray($internalConfig, $userConfig);
        foreach (self::REPLACED_PARAMS as $param) {
            if (isset($userConfig['params'][$param]) && is_array($userConfig['params'][$param])) {
                $result['params'][$param] = $userConfig['params'][$param];
            }
        }
        return $result;
    }
}
</file>

<file path="application/helpers/database_helper.php">
<?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
function dbRandom()
{
    $driver = Yii::app()->db->getDriverName();
    switch ($driver) {
        case 'dblib':
        case 'mssql':
        case 'sqlsrv':
            $srandom = 'NEWID()';
            break;
        case 'pgsql':
            $srandom = 'RANDOM()';
            break;
        case 'mysql':
        case 'mysqli':
            $srandom = 'RAND()';
            break;
        default:
            $srandom = 0 + lcg_value() * (abs(1));
            break;
    }
    return $srandom;
}
function dbSelectTablesLike($table)
{
    switch (Yii::app()->db->getDriverName()) {
        case 'mysqli':
... (54 lines truncated)
</file>

<file path="application/helpers/DbVersionHelper.php">
<?php
namespace LimeSurvey\Helpers;
class DbVersionHelper
{
    public const MINIMUM_MARIADB_VERSION = '10.3.38';
    public const MINIMUM_MYSQL_VERSION = '8.0.0';
    public const MINIMUM_PGSQL_VERSION = '14';
    public const MINIMUM_MSSQL_VERSION = '15.0';
    public const MINIMUM_MSSQL_LABEL = '2019';
    public static function getRequirement($driverName, $serverVersion)
    {
        $driverName = strtolower((string)$driverName);
        $isMariaDb = stripos((string)$serverVersion, 'mariadb') !== false;
        $cleanVersion = preg_replace('/^5\.5\.5-/', '', (string)$serverVersion);
        // Accept both multi-segment ("10.3.38") and single-segment ("14") versions.
        $currentVersion = preg_match('/\d+(\.\d+)*/', $cleanVersion, $matches) ? $matches[0] : '';
        if (in_array($driverName, ['mysql', 'mysqli'])) {
            if ($isMariaDb) {
                return self::buildRequirement('MariaDB', self::MINIMUM_MARIADB_VERSION, $currentVersion);
            }
            return self::buildRequirement('MySQL', self::MINIMUM_MYSQL_VERSION, $currentVersion);
        }
        if ($driverName === 'pgsql') {
            return self::buildRequirement('PostgreSQL', self::MINIMUM_PGSQL_VERSION, $currentVersion);
        }
        if (in_array($driverName, ['sqlsrv', 'dblib', 'mssql'])) {
            return self::buildRequirement('Microsoft SQL Server', self::MINIMUM_MSSQL_VERSION, $currentVersion, self::MINIMUM_MSSQL_LABEL);
        }
        return [
            'type' => $driverName,
... (23 lines truncated)
</file>

<file path="application/helpers/export_helper.php">
<?php
function stripTagsFull($string, $removeOther = true)
{
    $string = flattenText($string, false, true);
    if ($removeOther) {
        $string = str_replace('-oth-', '', $string);
    }
    //The backslashes must be escaped twice, once for php, and again for the regexp
    $string = str_replace("'|\\\\'", "&apos;", $string);
    return (string) $string;
}
/**
 * Returns true if passed $value is numeric
 *
 * @param $value
 * @return bool
 */
function isNumericExtended(string $value)
{
    if (empty($value)) {
        return true;
    }
    $eng_or_world = preg_match(
        '/^[+-]?' . // start marker and sign prefix
            '(((([0-9]+)|([0-9]{1,4}(,[0-9]{3,4})+)))?(\\.[0-9])?([0-9]*)|' . // american
            '((([0-9]+)|([0-9]{1,4}(\\.[0-9]{3,4})+)))?(,[0-9])?([0-9]*))' . // world
            '(e[0-9]+)?' . // exponent
            '$/', // end marker
        $value
    ) == 1;
... (2830 lines truncated)
</file>

<file path="application/helpers/frontend_helper.php">
<?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
require_once(Yii::app()->basePath . '/libraries/MersenneTwister.php');
use LimeSurvey\PluginManager\PluginEvent;
use LimeSurvey\Models\Services\SurveyAccessModeService;
function loadanswers()
{
    Yii::trace('start', 'survey.loadanswers');
    global $surveyid;
    global $thisstep;
    global $clienttoken;
    $scid = Yii::app()->request->getQuery('scid');
    if (Yii::app()->request->getParam('loadall') === "reload") {
        $sLoadName = Yii::app()->request->getParam('loadname');
        $sLoadPass = Yii::app()->request->getParam('loadpass');
        $oCriteria = new CDbCriteria();
        if (isset($scid)) {
            $oCriteria->addCondition("saved_control.scid=:scid");
            $aParams[':scid'] = $scid;
        }
        $oCriteria->addCondition("saved_control.identifier=:identifier");
        $aParams[':identifier'] = $sLoadName;
        $oCriteria->params = $aParams;
        $oResponses = SurveyDynamic::model($surveyid)->with('saved_control')->find($oCriteria);
    } elseif (isset($_SESSION['responses_' . $surveyid]['srid'])) {
        $oResponses = SurveyDynamic::model($surveyid)->findByPk($_SESSION['responses_' . $surveyid]['srid']);
    } else {
        return false;
... (1443 lines truncated)
</file>

<file path="application/helpers/globals.php">
<?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
function App()
{
    $app = Yii::app();
    return $app;
}
function traceVar($variable, $depth = 10)
{
    $msg = CVarDumper::dumpAsString($variable, $depth, false);
    $fullTrace = debug_backtrace();
    $trace = array_shift($fullTrace);
    if (isset($trace['file'], $trace['line']) && strpos($trace['file'], (string) YII_PATH) !== 0) {
        $msg = $trace['file'] . ' (' . $trace['line'] . "):\n" . $msg;
    }
    Yii::log($msg, 'trace', 'vardump');
}
</file>

<file path="application/helpers/Hash.php">
<?php
class Hash
{
    public static function get(array $data, $path)
    {
        if (empty($data)) {
            return null;
        }
        if (is_string($path) || is_numeric($path)) {
            $parts = explode('.', $path);
        } else {
            $parts = $path;
        }
        foreach ($parts as $key) {
            if (is_array($data) && isset($data[$key])) {
                $data = & $data[$key];
            } else {
                return null;
            }
        }
        return $data;
    }
    public static function extract(array $data, $path)
    {
        if (empty($path)) {
            return $data;
        }
        if (!preg_match('/[{\[]/', $path)) {
            return (array) self::get($data, $path);
        }
... (620 lines truncated)
</file>

<file path="application/helpers/index.html">
<html>
<head>
	<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
</file>

<file path="application/helpers/LayoutHelper.php">
<?php
use LimeSurvey\Menu\Menu;
use LimeSurvey\Menu\MenuItem;
class LayoutHelper
{
    public function showHeaders(array $aData, bool $sendHTTPHeader = true)
    {
        if (!isset($aData['display']['header']) || $aData['display']['header'] !== false) {
            if ($sendHTTPHeader) {
                header("Content-type: text/html; charset=UTF-8");
            }
            $this->getAdminHeader(false, false, $aData);
        }
    }
    public function getAdminHeader(bool $meta = false, bool $return = false, array $pageData = [])
    {
        if (empty(Yii::app()->session['adminlang'])) {
            Yii::app()->session["adminlang"] = Yii::app()->getConfig("defaultlang");
        }
        $aData = array();
        $aData['adminlang'] = Yii::app()->language;
        $aData['languageRTL'] = "";
        $aData['styleRTL'] = "";
        Yii::app()->loadHelper("surveytranslator");
        if (getLanguageRTL(Yii::app()->language)) {
            $aData['languageRTL'] = " dir=\"rtl\" ";
            $aData['bIsRTL'] = true;
        } else {
            $aData['languageRTL'] = " dir=\"ltr\" ";
            $aData['bIsRTL'] = false;
... (325 lines truncated)
</file>

<file path="application/helpers/ldap_helper.php">
<?php
function ldap_getCnx($server_id = null)
{
    $ldap_server = Yii::app()->getConfig('ldap_server');
    if (is_null($server_id) || empty($ldap_server[$server_id])) {
        return false;
    }
    if ($ldap_server[$server_id]['encrypt'] == 'ldaps') {
        $ds = ldap_connect("ldaps://" . "{$ldap_server[$server_id]['server']}:{$ldap_server[$server_id]['port']}");
    } else {
        $ds = ldap_connect("ldap://" . "{$ldap_server[$server_id]['server']}:{$ldap_server[$server_id]['port']}");
    }
    if ($ds === false) {
        return false;
    }
    if ($ldap_server[$server_id]['protoversion'] == 'ldapv3') {
        ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
    }
    if ($ldap_server[$server_id]['encrypt'] == 'start-tls') {
        ldap_start_tls($ds);
    }
    if (!$ldap_server[$server_id]['referrals']) {
        ldap_set_option($ds, LDAP_OPT_REFERRALS, 0);
    }
    return $ds;
}
function ldap_bindCnx($ds, $server_id = null)
{
    $ldap_server = Yii::app()->getConfig('ldap_server');
    if (!$ds || is_null($server_id)) {
... (222 lines truncated)
</file>

<file path="application/helpers/pdfHelper.php">
<?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
class pdfHelper
{
    public static function getPdfLanguageSettings($language)
    {
        Yii::import('application.libraries.admin.pdf', true);
        Yii::import('application.helpers.surveytranslator_helper', true);
        $pdffont = Yii::app()->getConfig('pdfdefaultfont');
        if ($pdffont == 'auto') {
            $pdffont = PDF_FONT_NAME_DATA;
        }
        $pdfcorefont = array("freesans", "dejavusans", "courier", "helvetica", "freemono", "symbol", "times", "zapfdingbats");
        if (in_array($pdffont, $pdfcorefont)) {
            $alternatepdffontfile = Yii::app()->getConfig('alternatepdffontfile');
            if (array_key_exists($language, $alternatepdffontfile)) {
                $pdffont = $alternatepdffontfile[$language];
            }
        }
        $pdffontsize = Yii::app()->getConfig('pdffontsize');
        if ($pdffontsize == 'auto') {
            $pdffontsize = PDF_FONT_SIZE_MAIN;
        }
        $lg = array();
        $lg['a_meta_charset'] = 'UTF-8';
        if (getLanguageRTL($language)) {
            $lg['a_meta_dir'] = 'rtl';
        } else {
... (8 lines truncated)
</file>

<file path="application/helpers/qanda_helper.php">
<?php
define('CHECKED', ' checked="checked"');
define('SELECTED', ' selected="selected"');
function setNoAnswerMode($thissurvey)
{
    define('SHOW_NO_ANSWER', $thissurvey['shownoanswer'] == 'N' ? 0 : 1);
    define('PRESELECT_NO_ANSWER', ($thissurvey['preselectnoanswer'] ?? 'Y') === 'Y' ? 1 : 0);
}
function retrieveAnswers($ia)
{
    global $thissurvey;
    if (EmCacheHelper::cacheQanda($ia, $_SESSION['responses_' . $thissurvey['sid']])) {
        $cacheKey = 'retrieveAnswers_' . sha1(implode('_', $ia));
        $value = EmCacheHelper::get($cacheKey);
        if ($value !== false) {
            return $value;
        }
    }
    $display    = $ia[7];
    $qid        = $ia[0];
    $qtitle     = $ia[3];
    $inputnames = [];
    $answer     = ""; //Create the question/answer html
    $number     = $ia[9] ?? ''; // Previously in limesurvey, it was virtually impossible to control how the start of questions were formatted. // this is an attempt to allow users (or rather system admins) some control over how the starting text is formatted.
    $aQuestionAttributes = QuestionAttribute::model()->getQuestionAttributes($ia[0]);
    $question_text = array(
        'all'                 => ''              // All has been added for backwards compatibility with templates that use question_start.pstpl (now redundant)
        ,'text'               => $qtitle
        ,'code'               => $ia[2]
        ,'number'             => $number
... (288 lines truncated)
</file>

<file path="application/helpers/questionHelper.php">
<?php
namespace LimeSurvey\Helpers;
use QuestionAttribute;
use QuestionTheme;
use Yii;
use Question;
class questionHelper
{
    protected static $attributes;
    public static function getAttributesDefinitions()
    {
        if (self::$attributes) {
            return self::$attributes;
        }
        self::$attributes = array();
        self::$attributes["alphasort"] = array(
        "types" => Question::QT_EXCLAMATION_LIST_DROPDOWN . Question::QT_L_LIST . Question::QT_O_LIST_WITH_COMMENT,
        'category' => gT('Display'),
        'sortorder' => 100,
        'inputtype' => 'switch',
        'options' => array(
            0 => gT('No'),
            1 => gT('Yes')
        ),
        'default' => 0,
        "help" => gT("Sort the answer options alphabetically"),
        "caption" => gT('Sort answers alphabetically'));
        self::$attributes["answer_width"] = array(
        "types" => Question::QT_A_ARRAY_5_POINT . Question::QT_B_ARRAY_10_CHOICE_QUESTIONS . Question::QT_C_ARRAY_YES_UNCERTAIN_NO . Question::QT_E_ARRAY_INC_SAME_DEC . Question::QT_F_ARRAY . Question::QT_1_ARRAY_DUAL . Question::QT_COLON_ARRAY_NUMBERS . Question::QT_SEMICOLON_ARRAY_TEXT,
            'category' => gT('Display'),
... (1399 lines truncated)
</file>

<file path="application/helpers/questionIndexHelper.php">
<?php
namespace LimeSurvey\Helpers;
use Yii;
use LimeExpressionManager;
class questionIndexHelper
{
    private static $instance = null;
    private $iSurveyId;
    private $indexType;
    private $surveyFormat;
    private $indexItems;
    private function __construct($iSurveyId)
    {
        $this->iSurveyId = $iSurveyId;
        $oSurvey = \Survey::model()->findByPk($this->iSurveyId);
        if ($oSurvey) {
            $this->indexType = $oSurvey->aOptions['questionindex'];
            $this->surveyFormat = $oSurvey->aOptions['format'];
        } else {
            $this->indexType = 0;
            $this->surveyFormat = null;
        }
    }
    public static function getInstance()
    {
        if (empty(self::$instance)) {
            self::$instance = new questionIndexHelper(LimeExpressionManager::getLEMsurveyId());
        }
        return self::$instance;
    }
... (119 lines truncated)
</file>

<file path="application/helpers/replacements_helper.php">
<?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
function templatereplace($line, $replacements = array(), &$redata = array(), $debugSrc = null, $anonymized = null, $questionNum = null, $registerdata = array(), $bStaticReplacement = false, $oTemplate = '')
{
    $allowedvars = array(
        'assessments',
        'captchapath',
        'clienttoken',
        'completed',
        'errormsg',
        'groupdescription',
        'groupname',
        'imageurl',
        'languagechanger',
        'loadname',
        'move',
        'navigator',
        'moveprevbutton',
        'movenextbutton',
        'percentcomplete',
        's_lang',
        'sitelogo',
        'templatedir',
        'thissurvey',
        'token',
        'totalBoilerplatequestions',
        'questionindex',
        'questionindexmenu',
... (333 lines truncated)
</file>

<file path="application/helpers/sanitize_helper.php">
<?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
define("PARANOID", 1);
define("SYSTEM", 4);
define("HTML", 8);
define("INT", 16);
define("FLOAT", 32);
define("LDAP", 64);
define("UTF8", 128);
$magic_quotes = (bool) @ini_get('magic_quotes_gpc');
if ($magic_quotes == true) {
    define("MAGIC_QUOTES", 1);
} else {
    define("MAGIC_QUOTES", 0);
}
function nice_addslashes($string)
{
    if (MAGIC_QUOTES) {
        return $string;
    } else {
        return addslashes((string) $string);
    }
}
function sanitize_filename($filename, $force_lowercase = true, $alphanumeric = false, $beautify = true, $directory = false)
{
    $filename = mb_ereg_replace(
        '[<>:"\\|?*]|
        [\x00-\x1F]|
... (416 lines truncated)
</file>

<file path="application/helpers/SortHelper.php">
<?php
namespace LimeSurvey\Helpers;
use Yii;
class SortHelper
{
    const SORT_REGULAR = 0;
    const SORT_NUMERIC = 1;
    const SORT_STRING = 2;
    private static $instance = null;
    private static $language = null;
    private static $collator = null;
    private function __construct($language)
    {
        self::$language = $language;
        if (class_exists('Collator')) {
            $locale = $language;
            $languageData = getLanguageData();
            if (isset($languageData[$language]['cldr'])) {
                $locale = $languageData[$language]['cldr'];
            }
            self::$collator = new \Collator($locale);
        } else {
            Yii::log(
                "For better alphabetical ordering : you need php-intl.",
                'warning',
                'application.helpers.sorthelper.construct'
            );
        }
    }
    public static function getInstance($language)
... (49 lines truncated)
</file>

<file path="application/helpers/statisticschart_helper.php">
<?php
function createChart($iQuestionID, $iSurveyID, $type, $lbl, $gdata, $grawdata, $cache, $sLanguageCode, $sQuestionType)
{
    if (substr($iSurveyID, 0, 1) == "T") {
        $iSurveyID = substr($iSurveyID, 1);
    }
    static $bErrorGenerate = false;
    if ($bErrorGenerate) {
        return false;
    }
    $rootdir = Yii::app()->getConfig("rootdir");
    $chartfontfile = Yii::app()->getConfig("chartfontfile");
    $chartfontsize = Yii::app()->getConfig("chartfontsize");
    $alternatechartfontfile = Yii::app()->getConfig("alternatechartfontfile");
    $cachefilename = "";
    $adminThemePath = AdminTheme::getInstance()->path;
    /* Set the fonts for the chart */
    if ($chartfontfile == 'auto') {
        // Tested with ar,be,el,fa,hu,he,is,lt,mt,sr, and en (english)
        // Not working for hi, si, zh, th, ko, ja : see $config['alternatechartfontfile'] to add some specific language font
        $chartfontfile = 'DejaVuSans.ttf';
        if (array_key_exists($sLanguageCode, $alternatechartfontfile)) {
            $neededfontfile = $alternatechartfontfile[$sLanguageCode];
            if (is_file($rootdir . "/assets/fonts/" . $neededfontfile)) {
                $chartfontfile = $neededfontfile;
            } else {
                Yii::app()->setFlashMessage(sprintf(gT('The chart font file %s was not found in the folder %s of your LimeSurvey installation. Please copy it there to generate the charts.'), $neededfontfile, 'assets/fonts'), 'error');
                $bErrorGenerate = true; // Don't do a graph again.
                return false;
            }
... (244 lines truncated)
</file>

<file path="application/helpers/SurveyRuntimeHelper.php">
<?php
use LimeSurvey\Models\Services\Quotas;
use LimeSurvey\Models\Services\SurveyAccessModeService;
class SurveyRuntimeHelper
{
    private $param = [];
    private $previewquestion = false;
    private $previewgrp = false;
    private $preview = false;
    private $oTemplate = null;
    private $sTemplateViewPath = null;
    private $LEMsessid = null;
    private $LEMdebugLevel = 0;
    private $LEMskipReprocessing = false;
    private $aSurveyInfo = null;
    private $iSurveyid              = null;
    private $bShowEmptyGroup        = false;
    private $sSurveyMode = null;
    private $aSurveyOptions = null;
    private $sLangCode = null;
    private $aMoveResult = false;
    private $sMove = null;
    private $bInvalidLastPage = false;
    private $aStepInfo = null;
    private $backpopup              = false;
    private $popup                  = false;
    private $notvalidated;
    private $notanswered;
    private $filenotvalidated = false;
    private $completed;
... (1244 lines truncated)
</file>

<file path="application/helpers/SurveyThemeHelper.php">
<?php
use LimeSurvey\Datavalueobjects\ThemeFileCategory;
use LimeSurvey\Datavalueobjects\ThemeFileInfo;
class SurveyThemeHelper
{
    public static function getVirtualPathPrefix($virtualPath)
    {
        if (preg_match('/(image::\w+::)/', $virtualPath, $m)) {
            return $m[1];
        } else {
            return null;
        }
    }
    public static function isVirtualPath($value)
    {
        return !empty(self::getVirtualPathPrefix($value));
    }
    public static function getTemplateInFolder($folder)
    {
        $templateList = [];
        if ($folder && $handle = opendir($folder)) {
            while (false !== ($fileName = readdir($handle))) {
                if (
                    !is_file("$folder/$fileName")
                    && $fileName != "."
                    && $fileName != ".."
                    && $fileName != ".svn"
                    && $fileName != "generalfiles"
                ) {
                    $templateList[$fileName] = $folder . DIRECTORY_SEPARATOR . $fileName;
... (289 lines truncated)
</file>

<file path="application/helpers/surveytranslator_helper.php">
<?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
function getDateFormatData($iDateFormat = 0, $sLanguageCode = 'en')
{
    $aDateFormats = array(
        1 => array('phpdate' => 'd.m.Y', 'jsdate' => 'DD.MM.YYYY', 'dateformat' => gT('dd.mm.yyyy')),
        2 => array('phpdate' => 'd-m-Y', 'jsdate' => 'DD-MM-YYYY', 'dateformat' => gT('dd-mm-yyyy')),
        3 => array('phpdate' => 'Y.m.d', 'jsdate' => 'YYYY.MM.DD', 'dateformat' => gT('yyyy.mm.dd')),
        4 => array('phpdate' => 'j.n.Y', 'jsdate' => 'D.M.YYYY', 'dateformat' => gT('d.m.yyyy')),
        5 => array('phpdate' => 'd/m/Y', 'jsdate' => 'DD/MM/YYYY', 'dateformat' => gT('dd/mm/yyyy')),
        6 => array('phpdate' => 'Y-m-d', 'jsdate' => 'YYYY-MM-DD', 'dateformat' => gT('yyyy-mm-dd')),
        7 => array('phpdate' => 'Y/m/d', 'jsdate' => 'YYYY/MM/DD', 'dateformat' => gT('yyyy/mm/dd')),
        8 => array('phpdate' => 'j/n/Y', 'jsdate' => 'D/M/YYYY', 'dateformat' => gT('d/m/yyyy')),
        9 => array('phpdate' => 'm-d-Y', 'jsdate' => 'MM-DD-YYYY', 'dateformat' => gT('mm-dd-yyyy')),
        10 => array('phpdate' => 'm.d.Y', 'jsdate' => 'MM.DD.YYYY', 'dateformat' => gT('mm.dd.yyyy')),
        11 => array('phpdate' => 'm/d/Y', 'jsdate' => 'MM/DD/YYYY', 'dateformat' => gT('mm/dd/yyyy')),
        12 => array('phpdate' => 'j-n-Y', 'jsdate' => 'D-M-YYYY', 'dateformat' => gT('d-m-yyyy'))
    );
    if ($iDateFormat > 12 || $iDateFormat < 0) {
        $iDateFormat = 6;
    }
    if ($iDateFormat > 0) {
        return $aDateFormats[$iDateFormat];
    } else {
        return $aDateFormats;
    }
}
function getLanguageData($bOrderByNative = false, $sLanguageCode = 'en')
... (1038 lines truncated)
</file>

<file path="application/helpers/userstatistics_helper.php">
<?php
Yii::import('application.helpers.statisticschart_helper', true);
function getQuestionMapData($sField, $qsid)
{
    $aresult = SurveyDynamic::model($qsid)->findAll();
    $d = array();
    foreach ($aresult as $arow) {
        $location = explode(";", (string) $arow->$sField);
        if (count($location) >= 2) {
            $d[] = "{$location[0]} {$location[1]}";
        }
    }
    return $d;
}
function buildSelects($allfields, $surveyid, $language)
{
    $selects = array();
    $aQuestionMap = array();
    $survey = Survey::model()->findByPk($surveyid);
    $fieldmap = createFieldMap($survey, "full", false, false, $language);
    foreach ($fieldmap as $field) {
        if (isset($field['qid']) && $field['qid'] != '') {
                    $aQuestionMap[] = 'Q' . $field['qid'];
        }
    }
    $validColumns = array();
    $responseSchema = SurveyDynamic::model($surveyid)->getTableSchema();
    if ($responseSchema !== null) {
        foreach ($responseSchema->getColumnNames() as $columnName) {
            $validColumns[strtolower($columnName)] = $columnName;
... (1964 lines truncated)
</file>

<file path="application/helpers/viewHelper.php">
<?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
class viewHelper
{
    public static function getImageLink($imgName, $linkUrl, $linkTxt, $linkTarget = null, $linkClass = 'imagelink', $attribs = array())
    {
        if (!is_null($linkUrl) && $linkUrl != '#') {
            $linkUrl = Yii::app()->getController()->createUrl($linkUrl);
        } else {
            $linkUrl = "#";
        }
        $output = '<a href="' . $linkUrl;
        if (!empty($linkClass)) {
            $output .= '" class="' . $linkClass . '"';
        }
        if (!empty($linkTarget)) {
            $output .= ' target="' . $linkTarget . '"';
        }
        if (!empty($attribs)) {
            foreach ($attribs as $attrib => $value) {
                $output .= ' ' . $attrib . '="' . str_replace('"', '&quot;', (string) $value) . '"';
            }
        }
        $output .= '><img src="' . Yii::app()->getConfig('adminimageurl') . $imgName . '" alt="' . $linkTxt . '" title="' . $linkTxt . '"></a>';
        return $output;
    }
    public static function getIconLink($icoClasses, $linkUrl, $linkTxt, $linkTarget = null, $linkClass = 'imagelink', $attribs = array())
    {
... (238 lines truncated)
</file>

<file path="application/helpers/ZipHelper.php">
<?php
namespace LimeSurvey\Helpers;
class ZipHelper
{
    private $zip;
    public function __construct($zip = null)
    {
        $this->zip = $zip;
    }
    public function addFolder($folder, $pathInZip = '')
    {
        if (!is_dir($folder)) {
            throw new \InvalidArgumentException('The folder does not exist.');
        }
        if (!empty($pathInZip)) {
            $pathInZip = rtrim($pathInZip, '/') . '/';
        }
        $files = new \RecursiveIteratorIterator(
            new \RecursiveDirectoryIterator($folder),
            \RecursiveIteratorIterator::LEAVES_ONLY
        );
        foreach ($files as $file) {
            if (!$file->isDir()) {
                $filePath = $file->getPathname();
                $relativePath = ltrim(substr($filePath, strlen($folder)), DIRECTORY_SEPARATOR);
                $this->zip->addFile($filePath, $pathInZip . $relativePath);
            }
        }
    }
}
... (1 lines truncated)
</file>

<file path="application/libraries/admin/pdf.php">
<?php
if (!defined('K_TCPDF_EXTERNAL_CONFIG')) {
    define('K_TCPDF_EXTERNAL_CONFIG', true);
}
if (!defined('K_PATH_CACHE')) {
    define('K_PATH_CACHE', Yii::app()->getConfig('tempdir') . DIRECTORY_SEPARATOR);
}
require(APPPATH . 'config/tcpdf' . EXT);
(!defined('PDF_PAGE_FORMAT')) ? (define('PDF_PAGE_FORMAT', $tcpdf['page_format'] ?? 'A4')) : '';
/**
* page orientation (P=portrait, L=landscape)
*/
(!defined('PDF_PAGE_ORIENTATION')) ? (define('PDF_PAGE_ORIENTATION', $tcpdf['page_orientation'] ?? 'P')) : '';
/**
* document creator
*/
(!defined('PDF_CREATOR')) ? (define('PDF_CREATOR', $tcpdf['creator'] ?? 'TCPDF')) : '';
/**
* document author
*/
(!defined('PDF_AUTHOR')) ? (define('PDF_AUTHOR', $tcpdf['author'] ?? 'TCPDF')) : '';
/**
* header title
*/
(!defined('PDF_HEADER_TITLE')) ? (define('PDF_HEADER_TITLE', $tcpdf['header_title'] ?? 'TCPDF Example')) : '';
/**
* header description string
*/
(!defined('PDF_HEADER_STRING')) ? (define('PDF_HEADER_STRING', $tcpdf['header_string'] ?? "by Nicola Asuni - Tecnick.com\nwww.tcpdf.org")) : '';
/**
... (814 lines truncated)
</file>

<file path="application/libraries/admin/quexmlpdf.php">
<?php
require('pdf.php');
class quexmlpdf extends pdf
{
    const INCH_IN_MM = 25.4;
    protected $language = "en";
    protected $ppi = 300;
    protected $pageBreakOccured;
    protected $cornerBorder = 14;
    protected $cornerLength = 20;
    protected $cornerWidth = 0.5;
    protected $cornerBoxWidth = 4.57;
    protected $barcodeType = 'I25';
    protected $barcodeMarginX = 23;
    protected $barcodeY = 6;
    protected $barcodeW = 49;
    protected $barcodeH = 6;
    protected $questionnaireId = 1;
    protected $idLength = 6;
    protected $pageLength = 2;
    protected $questionTitleWidth = 14;
    protected $questionTitleSuffix = ".";
    protected $questionTextRightMargin = 40;
    protected $questionBorderBottom = 1;
    protected $helpBeforeBorderBottom = 3;
    protected $helpBeforeBorderTop = 3;
    protected $skipColumnWidth = 20;
    protected $style = "<style>
    td.questionTitle {font-weight:bold; font-size:12pt;}
    td.questionTitleSkipTo {font-weight:bold; font-size:16pt;}
... (2657 lines truncated)
</file>

<file path="application/libraries/admin/settingsstorage.php">
<?php
final class SettingsStorage extends ArrayObject
{
    protected static $_instance = null;
    public function __construct($params = array())
    {
        $defaults = array('array' => array(), 'flags' => parent::ARRAY_AS_PROPS);
        foreach ($defaults as $key => $val) {
            if (isset($params[$key]) && $params[$key] !== "") {
                $defaults[$key] = $params[$key];
            }
        }
        extract($defaults);
        parent::__construct($array, $flags);
    }
    public static function getInstance()
    {
        if (self::$_instance === null) {
            self::$_instance = new self();
        }
        return self::$_instance;
    }
    public static function get($index)
    {
        $instance = self::getInstance();
        if (!$instance->offsetExists($index)) {
            throw new Exception("No entry is registered for key '$index'");
        }
        return $instance->offsetGet($index);
    }
... (14 lines truncated)
</file>

<file path="application/libraries/Api/Authentication/AuthenticationException.php">
<?php
namespace LimeSurvey\Api\Authentication;
use LimeSurvey\Api\ApiException;
class ApiAuthenticationException extends ApiException
{
}
</file>

<file path="application/libraries/Api/Authentication/AuthenticationInterface.php">
<?php
namespace LimeSurvey\Api\Authentication;
use LimeSurvey\Api\Authentication\ApiAuthenticationException;
interface AuthenticationInterface
{
    public function login($username, $password);
    public function refresh($token);
    public function logout($token);
    public function isAuthenticated($token);
}
</file>

<file path="application/libraries/Api/Authentication/AuthenticationTokenSimple.php">
<?php
namespace LimeSurvey\Api\Authentication;
use LimeSurvey\Api\Authentication\AuthenticationInterface;
use LimeSurvey\Api\Command\V1\Exception\ExceptionInvalidUser;
use LimeSurvey\Api\Transformer\Formatter\FormatterDateTimeToJson;
use LSUserIdentity;
use PluginEvent;
use CDbCriteria;
use Session;
use Yii;
class AuthenticationTokenSimple implements AuthenticationInterface
{
    const ERROR_INVALID_SESSION_KEY = 'INVALID_SESSION_KEY';
    protected SessionUtil $sessionUtil;
    protected FormatterDateTimeToJson $formatterDateTimeToJson;
    public function __construct(
        SessionUtil $sessionUtil,
        FormatterDateTimeToJson $formatterDateTimeToJson
    ) {
        $this->sessionUtil = $sessionUtil;
        $this->formatterDateTimeToJson = $formatterDateTimeToJson;
    }
    public function login($username, $password)
    {
        $plugin = 'Authdb';
        $identity = new LSUserIdentity($username, $password);
        $identity->setPlugin($plugin);
        $event = new PluginEvent('remoteControlLogin');
        $event->set('identity', $identity);
        $event->set('plugin', $plugin);
... (81 lines truncated)
</file>

<file path="application/libraries/Api/Authentication/SessionUtil.php">
<?php
namespace LimeSurvey\Api\Authentication;
use User;
use Yii;
class SessionUtil
{
    public function jumpStartSession($username)
    {
        $oUser = User::model()->findByAttributes(
            array('users_name' => $username)
        );
        if (!$oUser) {
            return false;
        }
        $aUserData = $oUser->attributes;
        $app = Yii::app();
        $userLang = $aUserData['lang'];
        if ($userLang === 'auto' || $userLang === '' || $userLang === null) {
            $app->loadHelper('common');
            $userLang = getBrowserLanguage();
        }
        $session = array(
            'loginID' => intval($aUserData['uid']),
            'user' => $aUserData['users_name'],
            'full_name' => $aUserData['full_name'],
            'htmleditormode' => $aUserData['htmleditormode'],
            'templateeditormode' => $aUserData['templateeditormode'],
            'questionselectormode' => $aUserData['questionselectormode'],
            'dateformat' => 6,
            'adminlang' => $userLang
... (9 lines truncated)
</file>

<file path="application/libraries/Api/Command/Mixin/Accessor/AppTrait.php">
<?php
namespace LimeSurvey\Api\Command\Mixin\Accessor;
use Yii;
trait AppTrait
{
    private $app = null;
    public function getApp()
    {
        if (!$this->app) {
            $this->app = Yii::app();
        }
        return $this->app;
    }
    public function setApp($app)
    {
        $this->app = $app;
    }
}
</file>

<file path="application/libraries/Api/Command/Mixin/Accessor/QuestionGroupModelCollectionWithL10nsBySidTrait.php">
<?php
namespace LimeSurvey\Api\Command\Mixin\Accessor;
use QuestionGroup;
trait QuestionGroupModelCollectionWithL10nsBySidTrait
{
    private $questionGroupListWithL10nsBySid = null;
    public function getQuestionGroupModelCollectionWithL10nsBySid($id)
    {
        if (!$this->questionGroupListWithL10nsBySid) {
            $this->questionGroupListWithL10nsBySid = QuestionGroup::model()
                ->with('questiongroupl10ns')
                ->findAllByAttributes(array('sid' => $id));
        }
        return $this->questionGroupListWithL10nsBySid;
    }
    public function setQuestionGroupModelCollectionWithL10nsBySid($collection)
    {
        $this->questionGroupListWithL10nsBySid = $collection;
    }
}
</file>

<file path="application/libraries/Api/Command/Mixin/Accessor/QuestionGroupModelTrait.php">
<?php
namespace LimeSurvey\Api\Command\Mixin\Accessor;
use QuestionGroup;
trait QuestionGroupModelTrait
{
    private $questionGroup = null;
    public function getQuestionGroupModel($id): ?QuestionGroup
    {
        if (!$this->questionGroup) {
            $this->questionGroup =
                QuestionGroup::model()
                ->findByAttributes(array('gid' => $id));
        }
        return $this->questionGroup;
    }
    public function setQuestionGroupModel(QuestionGroup $questionGroup)
    {
        $this->questionGroup = $questionGroup;
    }
}
</file>

<file path="application/libraries/Api/Command/Mixin/Accessor/QuestionGroupModelWithL10nsByIdTrait.php">
<?php
namespace LimeSurvey\Api\Command\Mixin\Accessor;
use QuestionGroup;
trait QuestionGroupModelWithL10nsByIdTrait
{
    private $questionGroupWithL10nsById = null;
    public function getQuestionGroupModelWithL10nsById($id)
    {
        if (!$this->questionGroupWithL10nsById) {
            $this->questionGroupWithL10nsById = QuestionGroup::model()
                ->with('questiongroupl10ns')
                ->findByAttributes(array('gid' => $id));
        }
        return $this->questionGroupWithL10nsById;
    }
    public function setQuestionGroupModelWithL10nsById($questionGroup)
    {
        $this->questionGroupWithL10nsById = $questionGroup;
    }
}
</file>

<file path="application/libraries/Api/Command/Mixin/Accessor/QuestionModelTrait.php">
<?php
namespace LimeSurvey\Api\Command\Mixin\Accessor;
use Question;
trait QuestionModelTrait
{
    private $question = null;
    public function getQuestionModel($id): ?Question
    {
        if (!$this->question) {
            $this->question = Question::model()->findByPk($id);
        }
        return $this->question;
    }
    public function setQuestionModel(Question $question)
    {
        $this->question = $question;
    }
}
</file>

<file path="application/libraries/Api/Command/Mixin/Accessor/QuestionModelWithL10nsByIdAndLanguageTrait.php">
<?php
namespace LimeSurvey\Api\Command\Mixin\Accessor;
use Question;
trait QuestionModelWithL10nsByIdAndLanguageTrait
{
    private $questionWithL10nsByIdAndLanguage = null;
    public function getQuestionModelCollectionWithL10nsByIdAndLanguage($id, $language)
    {
        if (!$this->questionWithL10nsByIdAndLanguage) {
            $this->questionWithL10nsByIdAndLanguage = Question::model()->with('questionl10ns')
                ->find(
                    't.qid = :qid and questionl10ns.language = :language',
                    array(':qid' => $id, ':language' => $language)
                );
        }
        return $this->questionWithL10nsByIdAndLanguage;
    }
    public function setQuestionModelCollectionWithL10nsByIdAndLanguage($collection)
    {
        $this->questionWithL10nsByIdAndLanguage = $collection;
    }
}
</file>

<file path="application/libraries/Api/Command/Mixin/Accessor/SurveyModelTrait.php">
<?php
namespace LimeSurvey\Api\Command\Mixin\Accessor;
use Survey;
trait SurveyModelTrait
{
    private $survey = null;
    public function getSurveyModel($id): ?Survey
    {
        if (!$this->survey) {
            $this->survey = Survey::model()->findByPk($id);
        }
        return $this->survey;
    }
    public function setSurveyModel(Survey $survey)
    {
        $this->survey = $survey;
    }
}
</file>

<file path="application/libraries/Api/Command/Mixin/Auth/AuthPermissionTrait.php">
<?php
namespace LimeSurvey\Api\Command\Mixin\Auth;
use Permission;
use LimeSurvey\Api\Command\Response\{
    Response,
    Status\StatusErrorUnauthorised
};
trait AuthPermissionTrait
{
    private $permissionModel = null;
    public function setPermissionModel(Permission $permissionModel)
    {
        $this->permissionModel = $permissionModel;
    }
    protected function getPermissionModel(): Permission
    {
        if (!isset($this->permissionModel)) {
            $this->permissionModel = Permission::model();
        }
        return $this->permissionModel;
    }
    protected function hasGlobalPermission($sPermission, $sCRUD, $iUserID = null)
    {
        $result =
            $this->getPermissionModel()->hasGlobalPermission(
                $sPermission,
                $sCRUD,
                $iUserID
            );
        if ($result) {
... (28 lines truncated)
</file>

<file path="application/libraries/Api/Command/Request/Request.php">
<?php
namespace LimeSurvey\Api\Command\Request;
class Request
{
    private $data = array();
    public function __construct($data)
    {
        $this->data = $data;
        $this->data['filesGlobal'] = $_FILES;
    }
    public function getData($key = null, $defaultValue = null)
    {
        return $key && isset($this->data[$key])
            ? $this->data[$key]
            : $defaultValue;
    }
    public function setData($key, $value)
    {
        $this->data[$key] = $value;
    }
}
</file>

<file path="application/libraries/Api/Command/Response/Status/StatusError.php">
<?php
namespace LimeSurvey\Api\Command\Response\Status;
use LimeSurvey\Api\Command\Response\Status;
class StatusError extends Status
{
    public function __construct()
    {
        $this->code = 'error';
    }
}
</file>

<file path="application/libraries/Api/Command/Response/Status/StatusErrorBadRequest.php">
<?php
namespace LimeSurvey\Api\Command\Response\Status;
class StatusErrorBadRequest extends StatusError
{
    public function __construct()
    {
        $this->code = 'error_bad_request';
    }
}
</file>

<file path="application/libraries/Api/Command/Response/Status/StatusErrorForbidden.php">
<?php
namespace LimeSurvey\Api\Command\Response\Status;
class StatusErrorForbidden extends StatusError
{
    public function __construct()
    {
        $this->code = 'error_forbidden';
    }
}
</file>

<file path="application/libraries/Api/Command/Response/Status/StatusErrorNotFound.php">
<?php
namespace LimeSurvey\Api\Command\Response\Status;
class StatusErrorNotFound extends StatusError
{
    public function __construct()
    {
        $this->code = 'error_not_found';
    }
}
</file>

<file path="application/libraries/Api/Command/Response/Status/StatusErrorUnauthorised.php">
<?php
namespace LimeSurvey\Api\Command\Response\Status;
class StatusErrorUnauthorised extends StatusError
{
    public function __construct()
    {
        $this->code = 'error_unauthorised';
    }
}
</file>

<file path="application/libraries/Api/Command/Response/Status/StatusSuccess.php">
<?php
namespace LimeSurvey\Api\Command\Response\Status;
use LimeSurvey\Api\Command\Response\Status;
class StatusSuccess extends Status
{
    public function __construct()
    {
        $this->code = 'success';
    }
}
</file>

<file path="application/libraries/Api/Command/Response/Status/StatusSuccessCreated.php">
<?php
namespace LimeSurvey\Api\Command\Response\Status;
use LimeSurvey\Api\Command\Response\Status;
class StatusSuccessCreated extends Status
{
    public function __construct()
    {
        $this->code = 'success_created';
    }
}
</file>

<file path="application/libraries/Api/Command/Response/Status/StatusSuccessNoContent.php">
<?php
namespace LimeSurvey\Api\Command\Response\Status;
use LimeSurvey\Api\Command\Response\Status;
class StatusSuccessNoContent extends Status
{
    public function __construct()
    {
        $this->code = 'success_no_content';
    }
}
</file>

<file path="application/libraries/Api/Command/Response/Response.php">
<?php
namespace LimeSurvey\Api\Command\Response;
use LimeSurvey\Api\Command\Response\Status;
class Response
{
    private Status $status;
    private $data = null;
    public function __construct($data, Status $status)
    {
        $this->status = $status;
        $this->data = $data;
    }
    public function getStatus()
    {
        return $this->status;
    }
    public function getData()
    {
        return $this->data;
    }
}
</file>

<file path="application/libraries/Api/Command/Response/ResponseFactory.php">
<?php
namespace LimeSurvey\Api\Command\Response;
use LimeSurvey\Api\Command\Response\{
    Response,
    Status,
    Status\StatusSuccess,
    Status\StatusSuccessNoContent,
    Status\StatusError,
    Status\StatusErrorNotFound,
    Status\StatusErrorBadRequest,
    Status\StatusErrorUnauthorised,
    Status\StatusErrorForbidden,
};
class ResponseFactory
{
    public function makeSuccess($data = null): Response
    {
        return $this->make(
            $data,
            new StatusSuccess()
        );
    }
    public function makeSuccessNoContent(): Response
    {
        return $this->make(
            null,
            new StatusSuccessNoContent()
        );
    }
    public function makeError($data = null): Response
... (50 lines truncated)
</file>

<file path="application/libraries/Api/Command/Response/Status.php">
<?php
namespace LimeSurvey\Api\Command\Response;
abstract class Status
{
    protected $code = 'unkown';
    public function getCode()
    {
        return $this->code;
    }
}
</file>

<file path="application/libraries/Api/Command/ResponseData/ResponseDataError.php">
<?php
namespace LimeSurvey\Api\Command\ResponseData;
class ResponseDataError
{
    protected $code = null;
    protected $message = null;
    protected $data = [];
    public function __construct($code = 'unknown', $message = '', $data = [])
    {
        $this->code = $code;
        $this->message = $message;
        $this->data = $data;
    }
    /**
     * @return array
     */
    public function toArray()
    {
        return [
            'error' => [
                'code' => $this->code,
                'message' => $this->message,
                'data' => $this->data
            ]
        ];
    }
}
</file>

<file path="application/libraries/Api/Command/V1/Exception/ExceptionInvalidUser.php">
<?php
namespace LimeSurvey\Api\Command\V1\Exception;
use LimeSurvey\Api\Command\ApiCommandException;
class ExceptionInvalidUser extends ApiCommandException
{
}
</file>

<file path="application/libraries/Api/Command/V1/SurveyPatch/Response/ExceptionErrorItem.php">
<?php
namespace LimeSurvey\Api\Command\V1\SurveyPatch\Response;
use LimeSurvey\ObjectPatch\Op\OpInterface;
class ExceptionErrorItem
{
    public ?string $error;
    public int $code;
    public string $entity;
    public ?string $id;
    public string $op;
    public array $context;
    public function __construct(
        ?string $errorMessage,
        int $code,
        OpInterface $patchOpData
    ) {
        $this->error = $errorMessage;
        $this->code = $code;
        $this->entity = $patchOpData->getEntityType();
        $this->op = $patchOpData->getType()->getId();
        $this->id = $patchOpData->getEntityId();
        $this->context = $patchOpData->getContext();
    }
}
</file>

<file path="application/libraries/Api/Command/V1/SurveyPatch/Response/ExceptionErrors.php">
<?php
namespace LimeSurvey\Api\Command\V1\SurveyPatch\Response;
class ExceptionErrors
{
    private array $operationItems = [];
    public function addExceptionErrorItem(
        ExceptionErrorItem $operationItem
    ): void {
        $this->operationItems['exceptionErrors'][] = $operationItem;
    }
    public function getExceptionErrorsObject(): array
    {
        return $this->operationItems;
    }
}
</file>

<file path="application/libraries/Api/Command/V1/SurveyPatch/Response/SurveyResponse.php">
<?php
namespace LimeSurvey\Api\Command\V1\SurveyPatch\Response;
use LimeSurvey\ObjectPatch\Op\OpInterface;
use LimeSurvey\ObjectPatch\OpHandler\OpHandlerException;
class SurveyResponse
{
    private int $operationsApplied = 0;
    private bool $isValidOperation = true;
    protected TempIdMapping $tempIdMapping;
    protected ValidationErrors $validationErrors;
    protected ExceptionErrors $exceptionErrors;
    protected array $additional = [];
    public function __construct(
        TempIdMapping $tempIdMapping,
        ValidationErrors $validationErrors,
        ExceptionErrors $exceptionErrors
    ) {
        $this->tempIdMapping = $tempIdMapping;
        $this->validationErrors = $validationErrors;
        $this->exceptionErrors = $exceptionErrors;
    }
    public function handleResponse(array $response): void
    {
        $this->extractTempIdMapping($response);
        $this->extractValidationErrors($response);
        $this->extractAdditional($response);
        if ($this->isValidOperation) {
            $this->incrementOperationsApplied();
        }
    }
... (57 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/SurveyPatch/Response/TempIdMapItem.php">
<?php
namespace LimeSurvey\Api\Command\V1\SurveyPatch\Response;
class TempIdMapItem
{
    public $tempId;
    public ?int $id = null;
    public string $field = 'id';
    public function __construct(
        $tempId,
        ?int $id,
        string $field = 'id'
    ) {
        $this->tempId = $tempId;
        $this->id = $id;
        $this->field = $field;
    }
}
</file>

<file path="application/libraries/Api/Command/V1/SurveyPatch/Response/TempIdMapping.php">
<?php
namespace LimeSurvey\Api\Command\V1\SurveyPatch\Response;
use LimeSurvey\ObjectPatch\OpHandler\OpHandlerException;
class TempIdMapping
{
    private array $itemGroupNames = [
        'questionGroupsMap',
        'questionsMap',
        'subquestionsMap',
        'answersMap',
        'conditionsMap'
    ];
    private array $mapItems = [];
    public function addTempIdMapItem(
        TempIdMapItem $tempIdMapItem,
        string $itemGroupName
    ): void {
        if (!in_array($itemGroupName, $this->itemGroupNames)) {
            throw new OpHandlerException(
                sprintf(
                    'Invalid map item group name "%s"',
                    $itemGroupName
                )
            );
        }
        $this->mapItems['tempIdMapping'][$itemGroupName][] = $tempIdMapItem;
    }
    public function addTempIdMapItems($mappingItem, string $groupName)
    {
        if ($mappingItem instanceof TempIdMapItem) {
... (16 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/SurveyPatch/Response/ValidationErrorItem.php">
<?php
namespace LimeSurvey\Api\Command\V1\SurveyPatch\Response;
use LimeSurvey\ObjectPatch\Op\OpInterface;
class ValidationErrorItem
{
    public array $systemErrors = [];
    public string $error = '';
    public string $entity;
    public $id;
    public string $op;
    public array $context;
    public function __construct(
        string $error,
        array $errorMessages,
        OpInterface $patchOpData
    ) {
        $this->error = $error;
        $this->systemErrors = $errorMessages;
        $this->entity = $patchOpData->getEntityType();
        $this->op = $patchOpData->getType()->getId();
        $this->id = $patchOpData->getEntityId();
        $this->context = $patchOpData->getContext();
    }
}
</file>

<file path="application/libraries/Api/Command/V1/SurveyPatch/Response/ValidationErrors.php">
<?php
namespace LimeSurvey\Api\Command\V1\SurveyPatch\Response;
class ValidationErrors
{
    private array $validationErrorItems = [];
    public function addValidationErrorItem(
        ValidationErrorItem $operationItem
    ): void {
        $this->validationErrorItems['validationErrors'][] = $operationItem;
    }
    public function getValidationErrorsObject(): array
    {
        return $this->validationErrorItems;
    }
}
</file>

<file path="application/libraries/Api/Command/V1/SurveyPatch/Traits/OpHandlerExceptionTrait.php">
<?php
namespace LimeSurvey\Api\Command\V1\SurveyPatch\Traits;
use LimeSurvey\ObjectPatch\OpHandler\OpHandlerException;
use LimeSurvey\ObjectPatch\Op\OpInterface;
trait OpHandlerExceptionTrait
{
    private function throwNoValuesException(OpInterface $op, string $name = '')
    {
        if ($name !== '') {
            $msg = sprintf(
                'No values to update for %s in entity %s',
                $name,
                $op->getEntityType()
            );
        } else {
            $msg = sprintf(
                'No values to update for entity %s',
                $op->getEntityType()
            );
        }
        throw new OpHandlerException($msg);
    }
}
</file>

<file path="application/libraries/Api/Command/V1/SurveyPatch/Traits/OpHandlerQuestionTrait.php">
<?php
namespace LimeSurvey\Api\Command\V1\SurveyPatch\Traits;
use LimeSurvey\Api\Command\V1\SurveyPatch\Response\TempIdMapItem;
use LimeSurvey\Api\Command\V1\Transformer\Input\TransformerInputSubQuestion;
use LimeSurvey\Api\Command\V1\Transformer\Input\TransformerInputQuestionL10ns;
use LimeSurvey\ObjectPatch\Op\OpInterface;
use LimeSurvey\ObjectPatch\OpHandler\OpHandlerException;
use Question;
trait OpHandlerQuestionTrait
{
    use OpHandlerExceptionTrait;
    private function getSubQuestionNewIdMapping(
        Question $question,
        array $data,
        bool $answers = false
    ): array {
        $tempIds = [];
        $mapping = [];
        $title = $answers ? 'code' : 'title';
        $object = $answers ? 'answers' : 'subquestions';
        $idField = $answers ? 'aid' : 'qid';
        foreach ($data as $subQueDataArray) {
            foreach ($subQueDataArray as $scaleId => $subQueData) {
                if (
                    isset($subQueData['tempId'])
                    && isset($subQueData['code'])
                ) {
                    $tempIds[(int)$scaleId . ':' . $subQueData['code']] =
                        $subQueData['tempId'];
                }
... (21 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/SurveyPatch/Traits/OpHandlerSurveyTrait.php">
<?php
namespace LimeSurvey\Api\Command\V1\SurveyPatch\Traits;
use LimeSurvey\ObjectPatch\Op\OpInterface;
use LimeSurvey\ObjectPatch\OpHandler\OpHandlerException;
trait OpHandlerSurveyTrait
{
    public function getSurveyIdFromContext(OpInterface $op)
    {
        $context = $op->getContext();
        return isset($context['id']) ? (int)$context['id'] : 0;
    }
    public function extractTempId(array &$dataSet)
    {
        if (isset($dataSet['tempId'])) {
            $tempId = $dataSet['tempId'];
            unset($dataSet['tempId']);
            return $tempId;
        }
        return 0;
    }
}
</file>

<file path="application/libraries/Api/Command/V1/SurveyPatch/Traits/OpHandlerValidationTrait.php">
<?php
namespace LimeSurvey\Api\Command\V1\SurveyPatch\Traits;
use LimeSurvey\Api\Command\V1\SurveyPatch\Response\ValidationErrorItem;
use LimeSurvey\ObjectPatch\Op\OpInterface;
trait OpHandlerValidationTrait
{
    use OpHandlerSurveyTrait;
    public function getValidationReturn(
        string $error,
        array $validationData,
        OpInterface $op
    ): array {
        $validationErrors = [];
        if (!empty($validationData)) {
            $validationErrors = [
                'validationErrors' => [
                    new ValidationErrorItem(
                        $error,
                        $validationData,
                        $op
                    )
                ]
            ];
        }
        return $validationErrors;
    }
    public function validateEntityId(
        OpInterface $op,
        array $validationData
    ): array {
... (80 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/SurveyPatch/OpHandlerAnswer.php">
<?php
namespace LimeSurvey\Api\Command\V1\SurveyPatch;
use LimeSurvey\Api\Command\V1\Transformer\Input\TransformerInputAnswer;
use LimeSurvey\Api\Command\V1\SurveyPatch\Traits\{
    OpHandlerSurveyTrait,
    OpHandlerQuestionTrait,
    OpHandlerExceptionTrait,
    OpHandlerValidationTrait
};
use LimeSurvey\ObjectPatch\{
    Op\OpInterface,
    OpType\OpTypeCreate,
    OpHandler\OpHandlerException,
    OpHandler\OpHandlerInterface,
    OpType\OpTypeUpdate
};
use LimeSurvey\Models\Services\{
    QuestionAggregateService,
    QuestionAggregateService\QuestionService,
    QuestionAggregateService\AnswersService
};
class OpHandlerAnswer implements OpHandlerInterface
{
    use OpHandlerSurveyTrait;
    use OpHandlerQuestionTrait;
    use OpHandlerValidationTrait;
    protected string $entity;
    protected TransformerInputAnswer $transformer;
    protected AnswersService $answersService;
    protected QuestionService $questionService;
... (66 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/SurveyPatch/OpHandlerAnswerDelete.php">
<?php
namespace LimeSurvey\Api\Command\V1\SurveyPatch;
use LimeSurvey\Models\Services\{
    Exception\PermissionDeniedException,
    QuestionAggregateService
};
use LimeSurvey\Api\Command\V1\SurveyPatch\Traits\{
    OpHandlerValidationTrait,
    OpHandlerSurveyTrait
};
use LimeSurvey\ObjectPatch\{
    Op\OpInterface,
    OpHandler\OpHandlerInterface,
    OpType\OpTypeDelete
};
class OpHandlerAnswerDelete implements OpHandlerInterface
{
    use OpHandlerSurveyTrait;
    use OpHandlerValidationTrait;
    protected QuestionAggregateService $questionAggregateService;
    public function __construct(
        QuestionAggregateService $questionAggregateService
    ) {
        $this->questionAggregateService = $questionAggregateService;
    }
    public function canHandle(OpInterface $op): bool
    {
        $isDeleteOperation = $op->getType()->getId() === OpTypeDelete::ID;
        $isAnswerEntity = $op->getEntityType() === 'answer';
        return $isAnswerEntity && $isDeleteOperation;
... (23 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/SurveyPatch/OpHandlerImport.php">
<?php
namespace LimeSurvey\Api\Command\V1\SurveyPatch;
use LimeSurvey\ObjectPatch\{
    Op\OpInterface,
    OpHandler\OpHandlerInterface,
    OpType\OpTypeUpdate
};
use LimeSurvey\Api\Command\V1\SurveyPatch\Traits\{
    OpHandlerExceptionTrait,
    OpHandlerSurveyTrait,
    OpHandlerValidationTrait
};
use LimeSurvey\Models\Services\Exception\{
    NotFoundException,
    PermissionDeniedException
};
use LimeSurvey\Models\Services\SurveyActivate;
use Permission;
class OpHandlerImport implements OpHandlerInterface
{
    use OpHandlerExceptionTrait;
    use OpHandlerSurveyTrait;
    use OpHandlerValidationTrait;
    protected string $entity;
    protected SurveyActivate $surveyActivate;
    public function __construct(
        SurveyActivate $surveyActivate
    ) {
        $this->entity = 'importResponses';
        $this->surveyActivate = $surveyActivate;
... (21 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/SurveyPatch/OpHandlerLanguageSettingsUpdate.php">
<?php
namespace LimeSurvey\Api\Command\V1\SurveyPatch;
use DI\DependencyException;
use DI\NotFoundException;
use LimeSurvey\Api\Command\V1\SurveyPatch\Traits\{
    OpHandlerExceptionTrait,
    OpHandlerValidationTrait,
    OpHandlerSurveyTrait
};
use SurveyLanguageSetting;
use LimeSurvey\Api\Command\V1\Transformer\{
    Input\TransformerInputSurveyLanguageSettings,
};
use LimeSurvey\Api\Transformer\TransformerInterface;
use LimeSurvey\Models\Services\{
    Exception\PermissionDeniedException,
    Exception\PersistErrorException,
    SurveyAggregateService\LanguageSettings
};
use LimeSurvey\ObjectPatch\{
    Op\OpInterface,
    OpHandler\OpHandlerException,
    OpHandler\OpHandlerInterface,
    OpType\OpTypeUpdate
};
class OpHandlerLanguageSettingsUpdate implements OpHandlerInterface
{
    use OpHandlerSurveyTrait;
    use OpHandlerExceptionTrait;
    use OpHandlerValidationTrait;
... (67 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/SurveyPatch/OpHandlerQuestionAttributeUpdate.php">
<?php
namespace LimeSurvey\Api\Command\V1\SurveyPatch;
use LimeSurvey\Api\Command\V1\Transformer\Input\TransformerInputQuestionAttribute;
use LimeSurvey\Api\Command\V1\SurveyPatch\Traits\{
    OpHandlerExceptionTrait,
    OpHandlerSurveyTrait,
    OpHandlerValidationTrait};
use LimeSurvey\Models\Services\{
    Exception\NotFoundException,
    Exception\PermissionDeniedException,
    QuestionAggregateService,
    QuestionAggregateService\AttributesService,
    QuestionAggregateService\QuestionService,
    Exception\PersistErrorException};
use LimeSurvey\ObjectPatch\{
    Op\OpInterface,
    OpHandler\OpHandlerException,
    OpHandler\OpHandlerInterface,
    OpType\OpTypeUpdate
};
class OpHandlerQuestionAttributeUpdate implements OpHandlerInterface
{
    use OpHandlerSurveyTrait;
    use OpHandlerValidationTrait;
    use OpHandlerExceptionTrait;
    protected string $entity;
    protected AttributesService $attributesService;
    protected QuestionService $questionService;
    protected QuestionAggregateService $questionAggregateService;
    protected TransformerInputQuestionAttribute $transformer;
... (53 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/SurveyPatch/OpHandlerQuestionCondition.php">
<?php
namespace LimeSurvey\Api\Command\V1\SurveyPatch;
use LimeSurvey\Api\Command\V1\SurveyPatch\Traits\{
    OpHandlerExceptionTrait,
    OpHandlerSurveyTrait,
    OpHandlerValidationTrait
};
use LimeSurvey\Api\Command\V1\SurveyPatch\Response\TempIdMapItem;
use LimeSurvey\Models\Services\{
    Exception\NotFoundException,
    Exception\PermissionDeniedException,
    SurveyCondition,
    Exception\PersistErrorException
};
use LimeSurvey\ObjectPatch\{
    Op\OpInterface,
    OpHandler\OpHandlerException,
    OpHandler\OpHandlerInterface,
    OpType\OpTypeCreate,
    OpType\OpTypeUpdate,
    OpType\OpTypeDelete
};
class OpHandlerQuestionCondition implements OpHandlerInterface
{
    use OpHandlerSurveyTrait;
    use OpHandlerValidationTrait;
    use OpHandlerExceptionTrait;
    protected string $entity;
    protected SurveyCondition $surveyCondition;
    protected array $permissionMap = [];
... (311 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/SurveyPatch/OpHandlerQuestionCreate.php">
<?php
namespace LimeSurvey\Api\Command\V1\SurveyPatch;
use DI\DependencyException;
use DI\NotFoundException;
use LimeSurvey\Api\Transformer\TransformerException;
use LimeSurvey\DI;
use LimeSurvey\Api\Command\V1\Transformer\{
    Input\TransformerInputQuestionAggregate
};
use LimeSurvey\Api\Command\V1\SurveyPatch\Response\TempIdMapItem;
use LimeSurvey\Models\Services\Exception\{
    PermissionDeniedException,
    PersistErrorException
};
use LimeSurvey\Api\Command\V1\SurveyPatch\Traits\{OpHandlerSurveyTrait,
    OpHandlerExceptionTrait,
    OpHandlerQuestionTrait,
    OpHandlerValidationTrait
};
use LimeSurvey\ObjectPatch\{
    Op\OpInterface,
    OpType\OpTypeCreate,
    OpHandler\OpHandlerException,
    OpHandler\OpHandlerInterface
};
use LimeSurvey\Models\Services\QuestionAggregateService;
use Question;
use Condition;
class OpHandlerQuestionCreate implements OpHandlerInterface
{
... (114 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/SurveyPatch/OpHandlerQuestionDelete.php">
<?php
namespace LimeSurvey\Api\Command\V1\SurveyPatch;
use LimeSurvey\Models\Services\Exception\PermissionDeniedException;
use LimeSurvey\Models\Services\Exception\PersistErrorException;
use LimeSurvey\Models\Services\Exception\QuestionHasConditionsException;
use LimeSurvey\Api\Command\V1\SurveyPatch\Traits\{
    OpHandlerSurveyTrait,
    OpHandlerValidationTrait
};
use LimeSurvey\Models\Services\QuestionAggregateService;
use LimeSurvey\ObjectPatch\{
    Op\OpInterface,
    OpHandler\OpHandlerException,
    OpHandler\OpHandlerInterface,
    OpType\OpTypeDelete
};
class OpHandlerQuestionDelete implements OpHandlerInterface
{
    use OpHandlerSurveyTrait;
    use OpHandlerValidationTrait;
    protected QuestionAggregateService $questionAggregateService;
    public function __construct(
        QuestionAggregateService $questionAggregateService
    ) {
        $this->questionAggregateService = $questionAggregateService;
    }
    public function canHandle(OpInterface $op): bool
    {
        return $op->getType()->getId() === OpTypeDelete::ID
            && $op->getEntityType() === 'question';
... (22 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/SurveyPatch/OpHandlerQuestionGroup.php">
<?php
namespace LimeSurvey\Api\Command\V1\SurveyPatch;
use LimeSurvey\Api\Transformer\TransformerException;
use LimeSurvey\Api\Command\V1\SurveyPatch\{
    Traits\OpHandlerExceptionTrait,
    Traits\OpHandlerSurveyTrait,
    Traits\OpHandlerValidationTrait,
    Response\TempIdMapItem
};
use QuestionGroup;
use LimeSurvey\Models\Services\{
    QuestionGroupService,
    Exception\NotFoundException,
    Exception\PermissionDeniedException,
    Exception\PersistErrorException
};
use LimeSurvey\Api\Command\V1\Transformer\Input\{
    TransformerInputQuestionGroupAggregate
};
use LimeSurvey\ObjectPatch\{
    Op\OpInterface,
    OpHandler\OpHandlerException,
    OpHandler\OpHandlerInterface,
    OpType\OpTypeCreate,
    OpType\OpTypeDelete,
    OpType\OpTypeUpdate
};
class OpHandlerQuestionGroup implements OpHandlerInterface
{
    use OpHandlerSurveyTrait;
... (152 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/SurveyPatch/OpHandlerQuestionGroupL10n.php">
<?php
namespace LimeSurvey\Api\Command\V1\SurveyPatch;
use DI\DependencyException;
use DI\NotFoundException;
use LimeSurvey\Models\Services\{
    Exception\PermissionDeniedException,
    QuestionGroupService
};
use LimeSurvey\Api\Command\V1\SurveyPatch\Traits\{
    OpHandlerExceptionTrait,
    OpHandlerSurveyTrait,
    OpHandlerValidationTrait};
use QuestionGroupL10n;
use LimeSurvey\Api\Command\V1\Transformer\Input\TransformerInputQuestionGroupL10ns;
use LimeSurvey\ObjectPatch\{
    Op\OpInterface,
    OpType\OpTypeUpdate,
    OpHandler\OpHandlerException,
    OpHandler\OpHandlerInterface
};
class OpHandlerQuestionGroupL10n implements OpHandlerInterface
{
    use OpHandlerSurveyTrait;
    use OpHandlerValidationTrait;
    use OpHandlerExceptionTrait;
    protected string $entity;
    protected QuestionGroupL10n $model;
    protected TransformerInputQuestionGroupL10ns $transformer;
    public function __construct(
        QuestionGroupL10n $model,
... (54 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/SurveyPatch/OpHandlerQuestionGroupReorder.php">
<?php
namespace LimeSurvey\Api\Command\V1\SurveyPatch;
use LimeSurvey\Api\Command\V1\SurveyPatch\Traits\{
    OpHandlerExceptionTrait,
    OpHandlerSurveyTrait,
    OpHandlerValidationTrait
};
use LimeSurvey\Api\Command\V1\Transformer\Input\{
    TransformerInputQuestionGroupReorder
};
use QuestionGroup;
use LimeSurvey\Models\Services\{
    QuestionGroupService,
    Exception\PermissionDeniedException,
    Exception\NotFoundException
};
use LimeSurvey\ObjectPatch\{
    Op\OpInterface,
    OpHandler\OpHandlerException,
    OpHandler\OpHandlerInterface,
    OpType\OpTypeUpdate
};
class OpHandlerQuestionGroupReorder implements OpHandlerInterface
{
    use OpHandlerSurveyTrait;
    use OpHandlerExceptionTrait;
    use OpHandlerValidationTrait;
    protected string $entity;
    protected QuestionGroup $model;
    protected TransformerInputQuestionGroupReorder $transformer;
... (55 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/SurveyPatch/OpHandlerQuestionL10nUpdate.php">
<?php
namespace LimeSurvey\Api\Command\V1\SurveyPatch;
use LimeSurvey\Api\Command\V1\SurveyPatch\Traits\{
    OpHandlerSurveyTrait,
    OpHandlerExceptionTrait,
    OpHandlerValidationTrait
};
use LimeSurvey\Api\Command\V1\Transformer\Input\TransformerInputQuestionL10ns;
use LimeSurvey\Models\Services\{
    QuestionAggregateService,
    QuestionAggregateService\L10nService,
    QuestionAggregateService\QuestionService,
    Exception\PermissionDeniedException,
    Exception\NotFoundException,
    Exception\PersistErrorException
};
use LimeSurvey\ObjectPatch\{Op\OpInterface,
    OpHandler\OpHandlerException,
    OpType\OpTypeUpdate,
    OpHandler\OpHandlerInterface
};
class OpHandlerQuestionL10nUpdate implements OpHandlerInterface
{
    use OpHandlerSurveyTrait;
    use OpHandlerExceptionTrait;
    use OpHandlerValidationTrait;
    protected L10nService $l10nService;
    protected TransformerInputQuestionL10ns $transformer;
    protected QuestionAggregateService $questionAggregateService;
    protected QuestionService $questionService;
... (55 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/SurveyPatch/OpHandlerQuestionUpdate.php">
<?php
namespace LimeSurvey\Api\Command\V1\SurveyPatch;
use LimeSurvey\Api\Transformer\TransformerException;
use LimeSurvey\Models\Services\{
    Exception\NotFoundException,
    Exception\PermissionDeniedException,
    Exception\PersistErrorException,
    QuestionAggregateService
};
use LimeSurvey\Api\Command\V1\SurveyPatch\Traits\{OpHandlerSurveyTrait,
    OpHandlerExceptionTrait,
    OpHandlerValidationTrait
};
use LimeSurvey\Api\Command\V1\Transformer\Input\TransformerInputQuestion;
use LimeSurvey\ObjectPatch\{
    Op\OpInterface,
    OpHandler\OpHandlerException,
    OpHandler\OpHandlerInterface,
    OpType\OpTypeUpdate
};
class OpHandlerQuestionUpdate implements OpHandlerInterface
{
    use OpHandlerSurveyTrait;
    use OpHandlerExceptionTrait;
    use OpHandlerValidationTrait;
    protected QuestionAggregateService $questionAggregateService;
    protected TransformerInputQuestion $transformer;
    public function __construct(
        QuestionAggregateService $questionAggregateService,
        TransformerInputQuestion $transformer
... (53 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/SurveyPatch/OpHandlerSubQuestion.php">
<?php
namespace LimeSurvey\Api\Command\V1\SurveyPatch;
use LimeSurvey\Api\Command\V1\SurveyPatch\Traits\{
    OpHandlerQuestionTrait,
    OpHandlerSurveyTrait,
    OpHandlerValidationTrait
};
use LimeSurvey\Api\Command\V1\Transformer\Input\{
    TransformerInputSubQuestion
};
use LimeSurvey\Models\Services\{
    Exception\NotFoundException,
    Exception\PermissionDeniedException,
    Exception\PersistErrorException,
    QuestionAggregateService,
    QuestionAggregateService\QuestionService,
    QuestionAggregateService\SubQuestionsService
};
use LimeSurvey\ObjectPatch\{
    Op\OpInterface,
    OpHandler\OpHandlerException,
    OpHandler\OpHandlerInterface,
    OpType\OpTypeCreate,
    OpType\OpTypeUpdate
};
class OpHandlerSubQuestion implements OpHandlerInterface
{
    use OpHandlerSurveyTrait;
    use OpHandlerQuestionTrait;
    use OpHandlerValidationTrait;
... (72 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/SurveyPatch/OpHandlerSubquestionDelete.php">
<?php
namespace LimeSurvey\Api\Command\V1\SurveyPatch;
use LimeSurvey\DI;
use LimeSurvey\Api\Command\V1\SurveyPatch\Traits\{
    OpHandlerSurveyTrait,
    OpHandlerValidationTrait
};
use LimeSurvey\Models\Services\{Exception\NotFoundException,
    Exception\PermissionDeniedException,
    QuestionAggregateService,
    QuestionAggregateService\SubQuestionsService};
use LimeSurvey\ObjectPatch\{
    Op\OpInterface,
    OpHandler\OpHandlerInterface,
    OpType\OpTypeDelete
};
class OpHandlerSubquestionDelete implements OpHandlerInterface
{
    use OpHandlerSurveyTrait;
    use OpHandlerValidationTrait;
    protected SubQuestionsService $subQuestionsService;
    public function __construct(
        SubQuestionsService $subQuestionsService
    ) {
        $this->subQuestionsService = $subQuestionsService;
    }
    public function canHandle(OpInterface $op): bool
    {
        return $op->getType()->getId() === OpTypeDelete::ID
            && $op->getEntityType() === 'subquestion';
... (25 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/SurveyPatch/OpHandlerSurveyAccessMode.php">
<?php
namespace LimeSurvey\Api\Command\V1\SurveyPatch;
use LimeSurvey\ObjectPatch\{
    Op\OpInterface,
    OpHandler\OpHandlerInterface,
    OpType\OpTypeUpdate
};
use LimeSurvey\Api\Command\V1\SurveyPatch\Traits\{
    OpHandlerExceptionTrait,
    OpHandlerSurveyTrait,
    OpHandlerValidationTrait
};
use LimeSurvey\Models\Services\Exception\{
    NotFoundException,
    PermissionDeniedException
};
use LimeSurvey\Models\Services\SurveyAccessModeService;
class OpHandlerSurveyAccessMode implements OpHandlerInterface
{
    use OpHandlerExceptionTrait;
    use OpHandlerSurveyTrait;
    use OpHandlerValidationTrait;
    protected string $entity;
    protected SurveyAccessModeService $surveyAccessModeService;
    public function __construct(
        SurveyAccessModeService $surveyAccessModeService
    ) {
        $this->surveyAccessModeService = $surveyAccessModeService;
        $this->entity = 'accessMode';
    }
... (22 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/SurveyPatch/OpHandlerSurveyStatus.php">
<?php
namespace LimeSurvey\Api\Command\V1\SurveyPatch;
use LimeSurvey\ObjectPatch\{
    Op\OpInterface,
    OpHandler\OpHandlerInterface,
    OpType\OpTypeUpdate
};
use LimeSurvey\Api\Command\V1\Transformer\Input\TransformerInputSurvey;
use LimeSurvey\Models\Services\SurveyAggregateService;
use LimeSurvey\Api\Command\V1\SurveyPatch\Traits\{
    OpHandlerExceptionTrait,
    OpHandlerSurveyTrait,
    OpHandlerValidationTrait
};
use Survey;
class OpHandlerSurveyStatus implements OpHandlerInterface
{
    use OpHandlerExceptionTrait;
    use OpHandlerSurveyTrait;
    use OpHandlerValidationTrait;
    protected TransformerInputSurvey $transformer;
    protected string $action = '';
    public function __construct(TransformerInputSurvey $transformer)
    {
        $this->transformer = $transformer;
    }
    /**
     * @param OpInterface $op
     * @return bool
     */
... (46 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/SurveyPatch/OpHandlerSurveyUpdate.php">
<?php
namespace LimeSurvey\Api\Command\V1\SurveyPatch;
use DI\DependencyException;
use DI\NotFoundException;
use LimeSurvey\Api\Command\V1\SurveyPatch\Traits\{
    OpHandlerExceptionTrait,
    OpHandlerSurveyTrait,
    OpHandlerValidationTrait
};
use LimeSurvey\Api\Transformer\TransformerException;
use Survey;
use LimeSurvey\Api\Command\V1\Transformer\Input\TransformerInputSurvey;
use LimeSurvey\Models\Services\{
    Exception\PermissionDeniedException,
    Exception\PersistErrorException,
    SurveyAggregateService
};
use LimeSurvey\ObjectPatch\{
    Op\OpInterface,
    OpHandler\OpHandlerException,
    OpHandler\OpHandlerInterface,
    OpType\OpTypeUpdate
};
class OpHandlerSurveyUpdate implements OpHandlerInterface
{
    use OpHandlerExceptionTrait;
    use OpHandlerSurveyTrait;
    use OpHandlerValidationTrait;
    protected string $entity;
    protected Survey $model;
... (51 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/SurveyPatch/OpHandlerThemeSettings.php">
<?php
namespace LimeSurvey\Api\Command\V1\SurveyPatch;
use LimeSurvey\ObjectPatch\{
    Op\OpInterface,
    OpHandler\OpHandlerInterface,
    OpType\OpTypeUpdate
};
use LimeSurvey\Api\Command\V1\Transformer\Input\TransformerInputThemeSettings;
use LimeSurvey\Models\Services\SurveyThemeConfiguration;
use LimeSurvey\Api\Command\V1\SurveyPatch\Traits\{
    OpHandlerSurveyTrait,
    OpHandlerExceptionTrait,
    OpHandlerValidationTrait
};
class OpHandlerThemeSettings implements OpHandlerInterface
{
    use OpHandlerSurveyTrait;
    use OpHandlerExceptionTrait;
    use OpHandlerValidationTrait;
    protected TransformerInputThemeSettings $transformer;
    public function __construct(TransformerInputThemeSettings $transformer)
    {
        $this->transformer = $transformer;
    }
    public function canHandle(OpInterface $op): bool
    {
        $isUpdateOperation = $op->getType()->getId() === OpTypeUpdate::ID;
        $isThemeSettings = $op->getEntityType() === 'themeSettings';
        return $isUpdateOperation && $isThemeSettings;
    }
... (40 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/SurveyPatch/PatcherSurvey.php">
<?php
namespace LimeSurvey\Api\Command\V1\SurveyPatch;
use LimeSurvey\Api\Command\V1\SurveyPatch\Response\{ExceptionErrorItem,
    ExceptionErrors,
    SurveyResponse,
    TempIdMapItem,
    TempIdMapping,
    ValidationErrors};
use LimeSurvey\ObjectPatch\{
    ObjectPatchException,
    Op\OpStandard,
    OpHandler\OpHandlerException,
    Patcher
};
use Psr\Container\ContainerInterface;
use LimeSurvey\Models\Services\SurveyDetailService;
use Survey;
class PatcherSurvey extends Patcher
{
    protected SurveyResponse $surveyResponse;
    protected SurveyDetailService $surveyDetailService;
    public function __construct(
        ContainerInterface $diContainer,
        SurveyResponse $surveyResponse,
        SurveyDetailService $surveyDetailService
    ) {
        $this->surveyResponse = $surveyResponse;
        $this->surveyDetailService = $surveyDetailService;
        $classes = [
            OpHandlerSurveyUpdate::class,
... (57 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/SurveyResponses/conditions/ConditionHandlerHelperTrait.php">
<?php
namespace LimeSurvey\Libraries\Api\Command\V1\SurveyResponses\conditions;
trait ConditionHandlerHelperTrait
{
    public function sanitizeKey(string $key): string
    {
        $sanitizedKey = preg_replace('/[^a-zA-Z0-9_-]/', '', $key);
        return App()->db->quoteColumnName($sanitizedKey);
    }
    /**
     * More strict strip of a key without quotation
     * @param string $key
     * @return string
     */
    public function stripKey(string $key): string
    {
        return preg_replace('/[^a-zA-Z0-9_]/', '', $key);
    }
}
</file>

<file path="application/libraries/Api/Command/V1/SurveyResponses/conditions/ContainConditionHandler.php">
<?php
namespace LimeSurvey\Libraries\Api\Command\V1\SurveyResponses\conditions;
use CDbCriteria;
use InvalidArgumentException;
use LimeSurvey\Libraries\Api\Command\V1\SurveyResponses\HandlerInterface;
class ContainConditionHandler implements HandlerInterface
{
    use ConditionHandlerHelperTrait;
    public function canHandle(string $operation): bool
    {
        if (strtolower($operation) == 'contain') {
            return true;
        }
        return false;
    }
    public function execute($key, $value): object
    {
        if (is_array($value)) {
            throw new InvalidArgumentException('Multiple values are not supported for contain conditions.');
        }
        $value = trim($value);
        $criteria = new CDbCriteria();
        if (is_array($key)) {
            $conditions = [];
            $params = [];
            foreach ($key as $rawKey) {
                $quotedKey = $this->sanitizeKey($rawKey);
                $paramName = CDbCriteria::PARAM_PREFIX . CDbCriteria::$paramCount++;
                $conditions[] = "$quotedKey LIKE $paramName";
                $params[$paramName] = "%$value%";
... (13 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/SurveyResponses/conditions/DateRangeConditionHandler.php">
<?php
namespace LimeSurvey\Libraries\Api\Command\V1\SurveyResponses\conditions;
use InvalidArgumentException;
use LimeSurvey\Libraries\Api\Command\V1\SurveyResponses\HandlerInterface;
class DateRangeConditionHandler implements HandlerInterface
{
    use ConditionHandlerHelperTrait;
    public function canHandle(string $operation): bool
    {
        if (strtolower($operation) == 'date-range') {
            return true;
        }
        return false;
    }
    public function execute($key, $value): object
    {
        if (is_array($key)) {
            throw new InvalidArgumentException('Multiple keys are not supported for range conditions.');
        }
        if (!is_array($value) || count($value) > 2) {
            throw new InvalidArgumentException("Invalid date range sent.");
        }
        $key = $this->sanitizeKey($key);
        $range = $this->parseRange($value);
        $min = $this->validateDate($range['min']);
        $max = $this->validateDate($range['max'], true);
        $criteria = new \CDbCriteria();
        $keyStripped = $this->stripKey($key);
        if ($min === false) {
            $criteria->condition = "$key <= :{$keyStripped}Max";
... (32 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/SurveyResponses/conditions/EqualConditionHandler.php">
<?php
namespace LimeSurvey\Libraries\Api\Command\V1\SurveyResponses\conditions;
use LimeSurvey\Libraries\Api\Command\V1\SurveyResponses\HandlerInterface;
class EqualConditionHandler implements HandlerInterface
{
    use ConditionHandlerHelperTrait;
    public function canHandle(string $operation): bool
    {
        if (strtolower($operation) == 'equal') {
            return true;
        }
        return false;
    }
    public function execute($key, $value): object
    {
        $criteria = new \CDbCriteria();
        if (!is_array($key)) {
            $key = [$key];
        }
        $conditions = [];
        $params = [];
        foreach ($key as $rawKey) {
            $quotedKey = $this->sanitizeKey($rawKey);
            $strippedKey = $this->stripKey($quotedKey);
            $conditions[] = "$quotedKey = :{$strippedKey}Value";
            $params[":{$strippedKey}Value"] = $value;
        }
        $criteria->condition = implode(' OR ', $conditions);
        $criteria->params = $params;
        return $criteria;
... (3 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/SurveyResponses/conditions/GreaterThanConditionHandler.php">
<?php
namespace LimeSurvey\Libraries\Api\Command\V1\SurveyResponses\conditions;
use InvalidArgumentException;
use LimeSurvey\Libraries\Api\Command\V1\SurveyResponses\HandlerInterface;
class GreaterThanConditionHandler implements HandlerInterface
{
    use ConditionHandlerHelperTrait;
    public function canHandle(string $operation): bool
    {
        return strtolower($operation) === 'greaterthan';
    }
    public function execute($key, $value): object
    {
        if (is_array($key)) {
            throw new InvalidArgumentException('Multiple keys are not supported for greaterThan conditions.');
        }
        if (!is_numeric($value)) {
            throw new InvalidArgumentException('Invalid greaterThan value sent.');
        }
        $quotedKey = $this->sanitizeKey($key);
        $param = ':' . $this->stripKey($key) . 'GreaterThan';
        $criteria = new \CDbCriteria();
        $criteria->condition = "$quotedKey > $param";
        $criteria->params = [$param => $value + 0];
        return $criteria;
    }
}
</file>

<file path="application/libraries/Api/Command/V1/SurveyResponses/conditions/MultiSelectConditionHandler.php">
<?php
namespace LimeSurvey\Libraries\Api\Command\V1\SurveyResponses\conditions;
use CDbCriteria;
use InvalidArgumentException;
use LimeSurvey\Libraries\Api\Command\V1\SurveyResponses\HandlerInterface;
class MultiSelectConditionHandler implements HandlerInterface
{
    use ConditionHandlerHelperTrait;
    public function canHandle(string $operation): bool
    {
        if (strtolower($operation) == 'multi-select') {
            return true;
        }
        return false;
    }
    public function execute($key, $value): object
    {
        if (is_array($key)) {
            throw new InvalidArgumentException('Multiple keys are not supported for multi select conditions.');
        }
        $key = $this->sanitizeKey($key);
        $criteria = new CDbCriteria();
        if (!is_array($value)) {
            $value = [$value];
        }
        if (!empty($value)) {
            $placeholders = [];
            $params = [];
            foreach (array_values($value) as $index => $val) {
                $paramName = ":value{$index}";
... (10 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/SurveyResponses/conditions/NullConditionHandler.php">
<?php
namespace LimeSurvey\Libraries\Api\Command\V1\SurveyResponses\conditions;
use LimeSurvey\Libraries\Api\Command\V1\SurveyResponses\HandlerInterface;
class NullConditionHandler implements HandlerInterface
{
    use ConditionHandlerHelperTrait;
    public function canHandle(string $operation): bool
    {
        return true;
    }
    public function execute($key, $value): object
    {
        $criteria = new \CDbCriteria();
        if (is_array($key)) {
            return $criteria;
        }
        if (!is_array($value)) {
            $value = [$value];
        }
        $quotedKey = $this->sanitizeKey((string) $key);
        $conditions = [];
        foreach ($value as $item) {
            $item = (string) $item;
            if (!in_array($item, ['true', 'false'])) {
                continue;
            }
            $conditions[] = $quotedKey . ' IS ' . ($item === 'true' ? 'NOT ' : '') . 'NULL';
        }
        if (!empty($conditions)) {
            $criteria->condition = '(' . implode(' OR ', $conditions) . ')';
... (5 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/SurveyResponses/conditions/RangeConditionHandler.php">
<?php
namespace LimeSurvey\Libraries\Api\Command\V1\SurveyResponses\conditions;
use InvalidArgumentException;
use LimeSurvey\Libraries\Api\Command\V1\SurveyResponses\HandlerInterface;
class RangeConditionHandler implements HandlerInterface
{
    use ConditionHandlerHelperTrait;
    public function canHandle(string $operation): bool
    {
        if (strtolower($operation) == 'range') {
            return true;
        }
        return false;
    }
    public function execute($key, $value): object
    {
        if (is_array($key)) {
            throw new InvalidArgumentException('Multiple keys are not supported for range conditions.');
        }
        if (!is_array($value) || count($value) > 2) {
            throw new InvalidArgumentException("Invalid range sent.");
        }
        $key = $this->sanitizeKey($key);
        $range = $this->parseRange($value);
        $min = isset($range['min']) && is_numeric($range['min']) ? (float)$range['min'] : null;
        $max = isset($range['max']) && is_numeric($range['max']) ? (float)$range['max'] : null;
        $criteria = new \CDbCriteria();
        $keyStripped = $this->stripKey($key);
        if ($min === null) {
            $criteria->condition = "CAST($key AS UNSIGNED) <= :{$keyStripped}Max";
... (21 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/SurveyResponses/patch/OpHandlerResponsesDelete.php">
<?php
namespace LimeSurvey\Libraries\Api\Command\V1\SurveyResponses\patch;
use LimeSurvey\Models\Services\Exception\PermissionDeniedException;
use LimeSurvey\Models\Services\Exception\PersistErrorException;
use LimeSurvey\Models\Services\Exception\QuestionHasConditionsException;
use LimeSurvey\Models\Services\SurveyResponseService;
use LimeSurvey\Api\Command\V1\SurveyPatch\Traits\{
    OpHandlerValidationTrait
};
use LimeSurvey\ObjectPatch\{
    Op\OpInterface,
    OpHandler\OpHandlerInterface,
    OpType\OpTypeDelete
};
class OpHandlerResponsesDelete implements OpHandlerInterface
{
    use OpHandlerValidationTrait;
    protected SurveyResponseService $surveyResponseService;
    public function __construct(
        SurveyResponseService $surveyResponseService
    ) {
        $this->surveyResponseService = $surveyResponseService;
    }
    public function canHandle(OpInterface $op): bool
    {
        return $op->getType()->getId() === OpTypeDelete::ID
            && $op->getEntityType() === 'response';
    }
    public function handle(OpInterface $op): void
    {
... (16 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/SurveyResponses/patch/OpHandlerResponsesFileDelete.php">
<?php
namespace LimeSurvey\Libraries\Api\Command\V1\SurveyResponses\patch;
use LimeSurvey\Models\Services\Exception\NotFoundException;
use LimeSurvey\Models\Services\Exception\PermissionDeniedException;
use LimeSurvey\Models\Services\Exception\PersistErrorException;
use LimeSurvey\Models\Services\Exception\QuestionHasConditionsException;
use LimeSurvey\Models\Services\SurveyResponseService;
use LimeSurvey\Api\Command\V1\SurveyPatch\Traits\{
    OpHandlerSurveyTrait,
    OpHandlerValidationTrait
};
use LimeSurvey\Models\Services\QuestionAggregateService;
use LimeSurvey\ObjectPatch\{
    Op\OpInterface,
    OpHandler\OpHandlerException,
    OpHandler\OpHandlerInterface,
    OpType\OpTypeDelete
};
class OpHandlerResponsesFileDelete implements OpHandlerInterface
{
    use OpHandlerValidationTrait;
    protected SurveyResponseService $surveyResponseService;
    public function __construct(
        SurveyResponseService $surveyResponseService
    ) {
        $this->surveyResponseService = $surveyResponseService;
    }
    public function canHandle(OpInterface $op): bool
    {
        return $op->getType()->getId() === OpTypeDelete::ID
... (20 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/SurveyResponses/patch/OpHandlerResponsesUpdate.php">
<?php
namespace LimeSurvey\Libraries\Api\Command\V1\SurveyResponses\patch;
use LimeSurvey\Models\Services\Exception\PermissionDeniedException;
use LimeSurvey\Models\Services\Exception\PersistErrorException;
use LimeSurvey\Models\Services\Exception\QuestionHasConditionsException;
use LimeSurvey\Models\Services\SurveyResponseService;
use LimeSurvey\Api\Command\V1\SurveyPatch\Traits\{
    OpHandlerValidationTrait
};
use LimeSurvey\ObjectPatch\{Op\OpInterface,
    OpHandler\OpHandlerInterface,
    OpType\OpTypeUpdate};
class OpHandlerResponsesUpdate implements OpHandlerInterface
{
    use OpHandlerValidationTrait;
    protected SurveyResponseService $surveyResponseService;
    public function __construct(
        SurveyResponseService $surveyResponseService
    ) {
        $this->surveyResponseService = $surveyResponseService;
    }
    public function canHandle(OpInterface $op): bool
    {
        return $op->getType()->getId() === OpTypeUpdate::ID
            && $op->getEntityType() === 'response';
    }
    public function handle(OpInterface $op): void
    {
        $surveyId = $this->getSurveyIdFromContext($op);
        $responseId = $op->getEntityId();
... (15 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/SurveyResponses/FilterPatcher.php">
<?php
namespace LimeSurvey\Libraries\Api\Command\V1\SurveyResponses;
use GuzzleHttp\HandlerStack;
use LimeSurvey\Libraries\Api\Command\V1\SurveyResponses\conditions\EqualConditionHandler;
use LimeSurvey\Libraries\Api\Command\V1\SurveyResponses\conditions\ContainConditionHandler;
use LimeSurvey\Libraries\Api\Command\V1\SurveyResponses\conditions\MultiSelectConditionHandler;
use LimeSurvey\Libraries\Api\Command\V1\SurveyResponses\conditions\NullConditionHandler;
use LimeSurvey\Libraries\Api\Command\V1\SurveyResponses\conditions\RangeConditionHandler;
use LimeSurvey\Libraries\Api\Command\V1\SurveyResponses\conditions\DateRangeConditionHandler;
use LimeSurvey\Libraries\Api\Command\V1\SurveyResponses\conditions\GreaterThanConditionHandler;
class FilterPatcher
{
    private array $handlers = [];
    private array $filtersRequiredKeys = ['key', 'filterMethod', 'value'];
    private array $sortAllowedKeys = ['id', 'submitDate'];
    public function __construct()
    {
        $this->registerHandlers();
    }
    public function apply(
        array $filterParams,
        \LSDbCriteria &$criteria,
        \CSort &$sort,
        array $dataMap = array(),
        array $validColumns = array()
    ): void {
        $sort->defaultOrder = "id DESC";
        if (!empty($filterParams['sort'])) {
            $sortParams = array_intersect_key($filterParams['sort'], array_flip($this->sortAllowedKeys));
            foreach ($sortParams as $column => $order) {
... (125 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/SurveyResponses/HandlerInterface.php">
<?php
namespace LimeSurvey\Libraries\Api\Command\V1\SurveyResponses;
interface HandlerInterface
{
    public function canHandle(string $operation): bool;
    public function execute($key, $value): object;
}
</file>

<file path="application/libraries/Api/Command/V1/SurveyResponses/PatcherSurveyResponses.php">
<?php
namespace LimeSurvey\Libraries\Api\Command\V1\SurveyResponses;
use LimeSurvey\Api\Command\V1\SurveyPatch\Response\SurveyResponse;
use LimeSurvey\Libraries\Api\Command\V1\SurveyResponses\patch\OpHandlerResponsesDelete;
use LimeSurvey\Libraries\Api\Command\V1\SurveyResponses\patch\OpHandlerResponsesFileDelete;
use LimeSurvey\Libraries\Api\Command\V1\SurveyResponses\patch\OpHandlerResponsesUpdate;
use LimeSurvey\ObjectPatch\{ObjectPatchException, Op\OpStandard, OpHandler\OpHandlerException, Patcher};
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\ContainerInterface;
use Psr\Container\NotFoundExceptionInterface;
class PatcherSurveyResponses extends Patcher
{
    protected SurveyResponse $surveyResponse;
    private array $handlers = [
        OpHandlerResponsesDelete::class,
        OpHandlerResponsesUpdate::class,
        OpHandlerResponsesFileDelete::class,
    ];
    public function __construct(
        ContainerInterface $diContainer,
        SurveyResponse $surveyResponse
    ) {
        $this->surveyResponse = $surveyResponse;
        foreach ($this->handlers as $handler) {
            $this->addOpHandler(
                $diContainer->get($handler)
            );
        }
    }
    public function applyPatch($patch, $context = []): array
... (22 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/SurveyResponses/ResponseMappingTrait.php">
<?php
namespace LimeSurvey\Libraries\Api\Command\V1\SurveyResponses;
use LSActiveRecord;
trait ResponseMappingTrait
{
    protected function getQuestionFieldMap(): array
    {
        $fieldMap = $this->transformerOutputSurveyResponses->fieldMap;
        return array_filter(
            array_map(
                function ($item) {
                    if (!empty($item['qid'])) {
                        return [
                            'fieldname' => $item['fieldname'] ?? null,
                            'gid' => $item['gid'],
                            'qid' => $item['qid'],
                            'aid' => $item['aid'] ?? null,
                            'sqid' => $item['sqid'] ?? null,
                            'scaleid' => $item['scale_id'] ?? null,
                            'title' => $item['title'] ?? null,
                            'question' => $item['question'] ?? null,
                            'subquestion' => $item['subquestion'] ?? null,
                            'subquestion1' => $item['subquestion1'] ?? null,
                            'subquestion2' => $item['subquestion2'] ?? null,
                            'scale' => $item['scale'] ?? null,
                            'type' => $item['type'] ?? null,
                            'encrypted' => $item['encrypted'] ?? null,
                        ];
                    }
                    return null;
... (39 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/SurveyResponses/SortingHandler.php">
<?php
namespace LimeSurvey\Libraries\Api\Command\V1\SurveyResponses;
class SortingHandler
{
    private array $order = ['asc', 'desc'];
    public function canHandle(string $operation): bool
    {
        return in_array(strtolower($operation), $this->order);
    }
    public function execute($column, $order): \CSort
    {
        $sort     = new \CSort();
        $sort->defaultOrder = "$column $order";
        return $sort;
    }
}
</file>

<file path="application/libraries/Api/Command/V1/SurveyResponses/SurveyRequestTrait.php">
<?php
namespace LimeSurvey\Libraries\Api\Command\V1\SurveyResponses;
use LimeSurvey\Api\Command\Request\Request;
use SurveyDynamic;
trait SurveyRequestTrait
{
    protected function getSurvey(Request $request): void
    {
        $survey = $this->survey->findByPk($this->getSurveyId($request));
        if ($survey === null) {
            throw new \RuntimeException('Survey not found');
        }
        $this->survey = $survey;
    }
    protected function getSurveyId(Request $request): string
    {
        $surveyId = (string) $request->getData('_id');
        if (!is_numeric($surveyId)) {
            throw new \InvalidArgumentException("Invalid survey ID");
        }
        return $surveyId;
    }
    protected function getSurveyDynamicModel(Request $request): SurveyDynamic
    {
        return SurveyDynamic::model($this->getSurveyId($request));
    }
    protected function buildPagination(Request $request): array
    {
        $pagination = $request->getData('page');
        $paginationDefault = [
... (25 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/SurveyResponses/SurveyResponseFiles.php">
<?php
namespace LimeSurvey\Libraries\Api\Command\V1\SurveyResponses;
use LSActiveRecord;
use LSDbCriteria;
use SurveyDynamic;
class SurveyResponseFiles
{
    public function list(
        SurveyDynamic $model,
        LSDbCriteria $criteria,
        string $column,
        bool $encrypted,
        array $terms,
        int $page,
        int $pageSize
    ): array {
        $db = \Yii::app()->db;
        $criteria = clone $criteria;
        $criteria->select = ['id', $db->quoteColumnName($column)];
        $fileCountColumn = $column . '_Cfilecount';
        if ($model->getTableSchema()->getColumn($fileCountColumn) !== null) {
            $criteria->addCondition($db->quoteColumnName($fileCountColumn) . ' > 0');
        }
        $rows = $model->getCommandBuilder()
            ->createFindCommand($model->tableName(), $criteria)
            ->query();
        $offset = $page * $pageSize;
        $total = 0;
        $files = [];
        foreach ($rows as $row) {
... (97 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/Transformer/Input/TransformerInputAnswer.php">
<?php
namespace LimeSurvey\Api\Command\V1\Transformer\Input;
use LimeSurvey\Api\Transformer\Transformer;
class TransformerInputAnswer extends Transformer
{
    public function __construct(
        TransformerInputAnswerL10ns $transformerInputAnswerL10ns
    ) {
        $this->setDataMap([
            'aid' => ['required' => 'update'],
            'qid' => ['type' => 'int'],
            'oldCode' => 'oldcode',
            'code' => [
                'required' => 'create',
                'length' => ['min' => 1, 'max' => 5],
                'pattern' => '/^[[:alnum:]]*$/',
            ],
            'sortOrder' => ['key' => 'sortorder', 'type' => 'int', 'numerical'],
            'assessmentValue' => [
                'key' => 'assessment_value',
                'type' => 'int',
                'numerical'
            ],
            'scaleId' => ['key' => 'scale_id', 'type' => 'int', 'numerical'],
            'tempId' => true,
            'l10ns' => [
                'key' => 'answeroptionl10n',
                'collection' => true,
                'transformer' => $transformerInputAnswerL10ns
            ]
... (21 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/Transformer/Input/TransformerInputAnswerL10ns.php">
<?php
namespace LimeSurvey\Api\Command\V1\Transformer\Input;
use LimeSurvey\Api\Transformer\Transformer;
class TransformerInputAnswerL10ns extends Transformer
{
    public function __construct()
    {
        $this->setDataMap([
            'id' => ['type' => 'int'],
            'aid' => ['type' => 'int'],
            'answer' => ['required', 'type' => 'string'],
            'language' => [
                'required',
                'type' => 'string',
                'length' => ['min' => 2, 'max' => 20]
            ],
        ]);
    }
    public function transformAll($collection, $options = [])
    {
        $collection = parent::transformAll($collection, $options);
        $output = [];
        foreach ($collection as $l10n) {
            $lang = $l10n['language'];
            $output[$lang] =
                (
                    is_array($l10n)
                    && isset($l10n['answer'])
                ) ?
                    $l10n['answer'] : null;
... (5 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/Transformer/Input/TransformerInputAnswerL10nsCollection.php">
<?php
namespace LimeSurvey\Api\Command\V1\Transformer\Input;
use LimeSurvey\Api\Transformer\Transformer;
class TransformerInputAnswerL10nsCollection extends Transformer
{
    public function transformAll($collection, $options = [])
    {
        $data = parent::transformAll($collection, $options);
        $answers = [];
        foreach ($data as $index => $answer) {
            $scaleId = array_key_exists(
                'scale_id',
                $answer
            ) ? $answer['scale_id'] : 0;
            $index = array_key_exists(
                'aid',
                $answer
            ) ? $answer['aid'] : $index;
            $answers[$index][$scaleId] = $answer;
        }
        return $answers;
    }
}
</file>

<file path="application/libraries/Api/Command/V1/Transformer/Input/TransformerInputQuestion.php">
<?php
namespace LimeSurvey\Api\Command\V1\Transformer\Input;
use LimeSurvey\Api\Transformer\{
    Transformer,
    TransformerException};
class TransformerInputQuestion extends Transformer
{
    public function __construct()
    {
        $this->setDataMap([
            'qid' => ['type' => 'int'],
            'parentQid' => ['key' => 'parent_qid', 'type' => 'int'],
            'sid' => ['type' => 'int'],
            'type' => [
                'required' => 'create',
                'length' => ['min' => 1, 'max' => 1]
            ],
            'title' => [
                'required' => 'create',
                'length' => ['min' => 1, 'max' => 20]
            ],
            'preg' => true,
            'other' => [
                'formatter' => ['ynToBool' => ['revert' => true]],
                'range' => [true, false]
            ],
            'mandatory' => ['formatter' => ['mandatory' => ['revert' => true]]],
            'encrypted' => [
                'formatter' => ['ynToBool' => ['revert' => true]],
                'range' => [true, false]
... (61 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/Transformer/Input/TransformerInputQuestionAggregate.php">
<?php
namespace LimeSurvey\Api\Command\V1\Transformer\Input;
use LimeSurvey\Api\Transformer\Transformer;
class TransformerInputQuestionAggregate extends Transformer
{
    public function __construct(
        TransformerInputQuestion $transformer,
        TransformerInputQuestionL10ns $transformerL10n,
        TransformerInputQuestionAttribute $transformerAttribute,
        TransformerInputAnswer $transformerAnswer,
        TransformerInputSubQuestion $transformerInputSubQuestion
    ) {
        $this->setDataMap([
            'question' => [
                'required',
                'transformer' => $transformer
            ],
            'questionL10n' => [
                'key' => 'questionI10N',
                'collection' => true,
                'required',
                'transformer' => $transformerL10n
            ],
            'attributes' => [
                'key' => 'advancedSettings',
                'collection' => true,
                'transformer' => $transformerAttribute
            ],
            'answers' => [
                'key' => 'answeroptions',
... (11 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/Transformer/Input/TransformerInputQuestionAttribute.php">
<?php
namespace LimeSurvey\Api\Command\V1\Transformer\Input;
use LimeSurvey\Api\Transformer\Transformer;
class TransformerInputQuestionAttribute extends Transformer
{
    public function transformAll($collection, $options = [])
    {
        $attributes = [];
        $collection = $this->convertAttributes($collection);
        foreach ($collection as $attrName => $languages) {
            foreach ($languages as $lang => $value) {
                if ($lang !== '') {
                    $attributes[0][$attrName][$lang] = $value;
                } else {
                    $attributes[0][$attrName] = $value;
                }
            }
        }
        return $attributes;
    }
    /**
     * @param array $collection
     * @return array
     *
     */
    private function convertAttributes(array $collection)
    {
        foreach ($this->converterMap() as $attrName => $convDataArray) {
            if (array_key_exists($attrName, $collection)) {
                foreach ($convDataArray as $convData) {
... (56 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/Transformer/Input/TransformerInputQuestionGroup.php">
<?php
namespace LimeSurvey\Api\Command\V1\Transformer\Input;
use LimeSurvey\Api\Transformer\Transformer;
class TransformerInputQuestionGroup extends Transformer
{
    public function __construct()
    {
        $this->setDataMap([
            'gid' => ['type' => 'int'],
            'sid' => ['type' => 'int'],
            'sortOrder' => [
                'key' => 'group_order',
                'type' => 'int',
                'numerical'
            ],
            'randomizationGroup' => 'randomization_group',
            'gRelevance' => ['key' => 'grelevance', 'filter' => 'trim'],
            'tempId' => ['required' => 'create']
        ]);
    }
}
</file>

<file path="application/libraries/Api/Command/V1/Transformer/Input/TransformerInputQuestionGroupAggregate.php">
<?php
namespace LimeSurvey\Api\Command\V1\Transformer\Input;
use LimeSurvey\Api\Transformer\Transformer;
class TransformerInputQuestionGroupAggregate extends Transformer
{
    public function __construct(
        TransformerInputQuestionGroup $transformerQuestionGroup,
        TransformerInputQuestionGroupL10ns $transformerQuestionGroupL10ns
    ) {
        $this->setDataMap([
            'questionGroup' => [
                'transformer' => $transformerQuestionGroup,
                'required'
            ],
            'questionGroupL10n' => [
                'key' => 'questionGroupI10N',
                'collection' => true,
                'transformer' => $transformerQuestionGroupL10ns,
                'required'
            ]
        ]);
    }
}
</file>

<file path="application/libraries/Api/Command/V1/Transformer/Input/TransformerInputQuestionGroupL10ns.php">
<?php
namespace LimeSurvey\Api\Command\V1\Transformer\Input;
use LimeSurvey\Api\Transformer\Transformer;
class TransformerInputQuestionGroupL10ns extends Transformer
{
    public function __construct()
    {
        $this->setDataMap([
            'id' => ['type' => 'int'],
            'gid' => ['type' => 'int'],
            'groupName' => ['key' => 'group_name', 'required' => 'create'],
            'description' => true,
            'language' => true
        ]);
    }
}
</file>

<file path="application/libraries/Api/Command/V1/Transformer/Input/TransformerInputQuestionGroupReorder.php">
<?php
namespace LimeSurvey\Api\Command\V1\Transformer\Input;
use LimeSurvey\Api\Transformer\Transformer;
class TransformerInputQuestionGroupReorder extends Transformer
{
    public function __construct(
        TransformerInputQuestionGroup $transformerGroup,
        TransformerInputQuestion $transformerQuestion
    ) {
        $dataMap = $transformerGroup->getDataMap();
        $dataMap['sortOrder'] = [
            'key'      => 'group_order',
            'type'     => 'int',
            'numerical',
            'required' => 'update'
        ];
        $dataMap['gid'] = ['type' => 'int', 'required' => 'update'];
        $dataMapQuestions = $transformerQuestion->getDataMap();
        $dataMapQuestions['sortOrder'] = [
            'key'      => 'question_order',
            'type'     => 'int',
            'numerical',
            'required' => 'update'
        ];
        $dataMapQuestions['gid'] = [
            'type'     => 'int',
            'required' => 'update'
        ];
        $dataMapQuestions['qid'] = [
            'type'     => 'int',
... (42 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/Transformer/Input/TransformerInputQuestionL10ns.php">
<?php
namespace LimeSurvey\Api\Command\V1\Transformer\Input;
use LimeSurvey\Api\Transformer\Transformer;
class TransformerInputQuestionL10ns extends Transformer
{
    public function __construct()
    {
        $this->setDataMap([
            'id' => ['type' => 'int'],
            'qid' => ['type' => 'int'],
            'question' => ['required' => 'create'],
            'help' => true,
            'script' => true,
            'language' => true
        ]);
    }
    public function validate($data, $options = [])
    {
        if (empty($data)) {
            return ['Data can not be empty'];
        } elseif (is_scalar($data)) {
            return ['Can not be scalar'];
        }
        return parent::validate($data, $options);
    }
    public function validateAll($collection, $options = [])
    {
        if (empty($collection)) {
            return ['Collection can not be empty'];
        }
... (4 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/Transformer/Input/TransformerInputSubQuestion.php">
<?php
namespace LimeSurvey\Api\Command\V1\Transformer\Input;
use LimeSurvey\Api\Transformer\Transformer;
class TransformerInputSubQuestion extends Transformer
{
    public function __construct(
        TransformerInputQuestion $transformerInputQuestion,
        TransformerInputSubQuestionL10ns $transformerInputSubquestionL10n
    ) {
        $dataMap = $transformerInputQuestion->getDataMap();
        unset($dataMap['title']);
        $dataMap['type']['required'] = false;
        $dataMap['title'] = ['key' => 'code', 'required' => 'create'];
        $dataMap['qid'] = ['required' => 'update'];
        $dataMap['gid'] = ['type' => 'int'];
        $dataMap['tempId'] = true;
        $dataMap['l10ns'] = [
            'key' => 'subquestionl10n',
            'collection' => true,
            'required',
            'transformer' => $transformerInputSubquestionL10n
        ];
        $this->setDataMap($dataMap);
    }
    public function transformAll($collection, $options = [])
    {
        return $this->prepareSubQuestions(
            parent::transformAll($collection, $options)
        );
    }
... (26 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/Transformer/Input/TransformerInputSubQuestionAggregate.php">
<?php
namespace LimeSurvey\Api\Command\V1\Transformer\Input;
use LimeSurvey\Api\Transformer\Transformer;
class TransformerInputSubQuestionAggregate extends Transformer
{
    public function __construct(
        TransformerInputSubQuestion $transformer,
        TransformerInputQuestionL10ns $transformerL10n
    ) {
        $this->setDataMap([
            'question' => [
                'required' => 'create',
                'transformer' => $transformer
            ],
            'questionL10n' => [
                'key' => 'questionI10N',
                'collection' => true,
                'required' => 'create',
                'transformer' => $transformerL10n
            ]
        ]);
    }
}
</file>

<file path="application/libraries/Api/Command/V1/Transformer/Input/TransformerInputSubQuestionL10ns.php">
<?php
namespace LimeSurvey\Api\Command\V1\Transformer\Input;
use LimeSurvey\Api\Transformer\Transformer;
class TransformerInputSubQuestionL10ns extends Transformer
{
    public function __construct()
    {
        $this->setDataMap([
            'question' => ['required'],
        ]);
    }
    public function transform($data, $options = [])
    {
        $question = '';
        $transformed = parent::transform(
            $data,
            $options
        );
        if (is_array($transformed)) {
            $question = array_key_exists(
                'question',
                $transformed
            ) ? $transformed['question'] : '';
        }
        return $question;
    }
}
</file>

<file path="application/libraries/Api/Command/V1/Transformer/Input/TransformerInputSurvey.php">
<?php
namespace LimeSurvey\Api\Command\V1\Transformer\Input;
use LimeSurvey\Api\Transformer\Transformer;
use LimeSurvey\Models\Services\SurveyUseCaptcha;
class TransformerInputSurvey extends Transformer
{
    public function __construct()
    {
        $this->setDataMap([
            'sid' => ['type' => 'int'],
            'gsid' => ['type' => 'int'],
            'ownerId' => ['key' => 'owner_id', 'type' => 'int'],
            'active' => [
                'formatter' => ['ynToBool' => ['revert' => true]],
                'range' => [true, false]
            ],
            'language' => ['filter' => 'trim'],
            'admin' => ['length' => ['min' => 1, 'max' => 50]],
            'adminEmail' => ['key' => 'adminemail', 'filter' => 'trim'],
            'expires' => [
                'date' => true,
                'formatter' => [
                    'dateTimeToJson' => [
                        'revert' => true,
                        'clearWithEmptyString' => true
                    ]
                ]
            ],
            'startDate' => [
                'key' => 'startdate',
... (251 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/Transformer/Input/TransformerInputSurveyLanguageSettings.php">
<?php
namespace LimeSurvey\Api\Command\V1\Transformer\Input;
use LimeSurvey\Api\Transformer\Transformer;
class TransformerInputSurveyLanguageSettings extends Transformer
{
    public function __construct()
    {
        $this->setDataMap([
            'sid' => [
                'key' => 'surveyls_survey_id',
                'type' => 'int',
                'required'
            ],
            'language' => [
                'key' => 'surveyls_language',
                'type' => 'string',
                'required'
            ],
            'title' => [
                'key' => 'surveyls_title',
                'type' => 'string',
                'length' => ['min' => 0, 'max' => 200],
                'required' => 'create'
            ],
            'description' => 'surveyls_description',
            'welcomeText' => 'surveyls_welcometext',
            'endText' => 'surveyls_endtext',
            'policyNotice' => 'surveyls_policy_notice',
            'alias' => [
                'key' => 'surveyls_alias',
... (57 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/Transformer/Input/TransformerInputThemeSettings.php">
<?php
namespace LimeSurvey\Api\Command\V1\Transformer\Input;
use LimeSurvey\Api\Transformer\Transformer;
use Template;
use TemplateManifest;
class TransformerInputThemeSettings extends Transformer
{
    public function __construct()
    {
        $entity = App()->request->getParam('_entity');
        if (isset($entity) && $entity === 'survey-detail') {
            $surveyId = App()->request->getParam('_id');
            if (isset($surveyId)) {
                $surveyId = (int)$surveyId;
                $templateConfiguration = Template::getTemplateConfiguration(null, $surveyId, null, true);
                $themeCategoriesAndOptions = TemplateManifest::getOptionAttributes($templateConfiguration->path);
                $dynamicDataMap = [];
                if (isset($themeCategoriesAndOptions['optionAttributes'])) {
                    foreach ($themeCategoriesAndOptions['optionAttributes'] as $key => $attribute) {
                        $dynamicDataMap[$key] = true;
                    }
                }
            }
        }
        $dataMap = array_merge(
            [
                'templateName'             => [
                    'key'  => 'templateName',
                    'type' => 'string',
                    'required'
... (8 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/Transformer/Output/TransformerOutputAnswer.php">
<?php
namespace LimeSurvey\Api\Command\V1\Transformer\Output;
use LimeSurvey\Api\Transformer\Output\TransformerOutputActiveRecord;
class TransformerOutputAnswer extends TransformerOutputActiveRecord
{
    public function __construct()
    {
        $this->setDataMap([
            'aid' => ['type' => 'int'],
            'qid' => ['type' => 'int'],
            'code' => true,
            'sortorder' => ['key' => 'sortOrder', 'type' => 'int'],
            'assessment_value' => ['key' => 'assessmentValue', 'type' => 'int'],
            'scale_id' => ['key' => 'scaleId', 'type' => 'int']
        ]);
    }
    public function transformAll($collection, $options = [])
    {
        $collection = parent::transformAll($collection, $options);
        usort(
            $collection,
            function ($a, $b) {
                return (int)(
                    (int)$a['sortOrder'] > (int)$b['sortOrder']
                );
            }
        );
        return $collection;
    }
}
... (1 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/Transformer/Output/TransformerOutputAnswerL10ns.php">
<?php
namespace LimeSurvey\Api\Command\V1\Transformer\Output;
use LimeSurvey\Api\Transformer\Output\TransformerOutputActiveRecord;
class TransformerOutputAnswerL10ns extends TransformerOutputActiveRecord
{
    public function __construct()
    {
        $this->setDataMap([
            'id' => ['type' => 'int'],
            'aid' => ['type' => 'int'],
            'answer' => true,
            'language' => true
        ]);
    }
}
</file>

<file path="application/libraries/Api/Command/V1/Transformer/Output/TransformerOutputQuestion.php">
<?php
namespace LimeSurvey\Api\Command\V1\Transformer\Output;
use LimeSurvey\Api\Transformer\{
    Output\TransformerOutputActiveRecord
};
class TransformerOutputQuestion extends TransformerOutputActiveRecord
{
    public function __construct()
    {
        $this->setDataMap([
            'qid' => ['type' => 'int'],
            'parent_qid' => ['key' => 'parentQid', 'type' => 'int'],
            'sid' => ['type' => 'int'],
            'type' => true,
            'title' => true,
            'preg' => true,
            'other' => ['formatter' => ['ynToBool' => true]],
            'mandatory' => ['formatter' => ['mandatory' => true]],
            'encrypted' => ['formatter' => ['ynToBool' => true]],
            'question_order' => ['key' => 'sortOrder', 'type' => 'int'],
            'scale_id' => ['key' => 'scaleId', 'type' => 'int'],
            'same_default' => [
                'key' => 'sameDefault',
                'formatter' => ['intToBool' => true]
            ],
            'question_theme_name' => 'questionThemeName',
            'modulename' => 'moduleName',
            'gid' => ['type' => 'int'],
            'relevance' => true,
            'same_script' => [
... (20 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/Transformer/Output/TransformerOutputQuestionAttribute.php">
<?php
namespace LimeSurvey\Api\Command\V1\Transformer\Output;
use LimeSurvey\Api\Transformer\Output\TransformerOutputActiveRecord;
class TransformerOutputQuestionAttribute extends TransformerOutputActiveRecord
{
    public function transformAll($collection, $options = [])
    {
        $attributes = [];
        foreach ($collection as $attr) {
            if (!array_key_exists($attr->attribute, $attributes)) {
                $attributes[$attr->attribute] = [];
            }
            if (!array_key_exists($attr->language, $attributes[$attr->attribute])) {
                $attributes[$attr->attribute][$attr->language] = '';
            }
            $attributes[$attr->attribute][$attr->language] = $attr->value;
        }
        return $attributes;
    }
}
</file>

<file path="application/libraries/Api/Command/V1/Transformer/Output/TransformerOutputQuestionGroup.php">
<?php
namespace LimeSurvey\Api\Command\V1\Transformer\Output;
use LimeSurvey\Api\Transformer\Output\TransformerOutputActiveRecord;
class TransformerOutputQuestionGroup extends TransformerOutputActiveRecord
{
    public function __construct()
    {
        $this->setDataMap([
            'gid' => ['type' => 'int'],
            'sid' => ['type' => 'int'],
            'group_order' => ['key' => 'sortOrder', 'type' => 'int'],
            'randomization_group' => 'randomizationGroup',
            'grelevance' => 'gRelevance',
        ]);
    }
    public function transformAll($collection, $options = null)
    {
        $collection = parent::transformAll($collection, $options);
        usort(
            $collection,
            function ($a, $b) {
                return (int)(
                    (int)$a['sortOrder'] > (int)$b['sortOrder']
                );
            }
        );
        return $collection;
    }
}
</file>

<file path="application/libraries/Api/Command/V1/Transformer/Output/TransformerOutputQuestionGroupL10ns.php">
<?php
namespace LimeSurvey\Api\Command\V1\Transformer\Output;
use LimeSurvey\Api\Transformer\Output\TransformerOutputActiveRecord;
class TransformerOutputQuestionGroupL10ns extends TransformerOutputActiveRecord
{
    public function __construct()
    {
        $this->setDataMap([
            'id' => ['type' => 'int'],
            'gid' => ['type' => 'int'],
            'group_name' => 'groupName',
            'description' => true,
            'language' => true
        ]);
    }
}
</file>

<file path="application/libraries/Api/Command/V1/Transformer/Output/TransformerOutputQuestionL10ns.php">
<?php
namespace LimeSurvey\Api\Command\V1\Transformer\Output;
use LimeSurvey\Api\Transformer\Output\TransformerOutputActiveRecord;
class TransformerOutputQuestionL10ns extends TransformerOutputActiveRecord
{
    public function __construct()
    {
        $this->setDataMap([
            'id' => ['type' => 'int'],
            'qid' => ['type' => 'int'],
            'question' => true,
            'help' => true,
            'script' => true,
            'language' => true
        ]);
    }
}
</file>

<file path="application/libraries/Api/Command/V1/Transformer/Output/TransformerOutputSurvey.php">
<?php
namespace LimeSurvey\Api\Command\V1\Transformer\Output;
use LimeSurvey\Models\Services\SurveyUseCaptcha;
use Survey;
use LimeSurvey\Api\Transformer\{
    Output\TransformerOutputActiveRecord,
};
class TransformerOutputSurvey extends TransformerOutputActiveRecord
{
    private TransformerOutputSurveyLanguageSettings $transformerOutputSurveyLanguageSettings;
    public function __construct(
        TransformerOutputSurveyLanguageSettings $transformerOutputSurveyLanguageSettings
    ) {
        $this->transformerOutputSurveyLanguageSettings = $transformerOutputSurveyLanguageSettings;
        $this->setDataMap([
            'sid' => ['type' => 'int'],
            'gsid' => ['type' => 'int'],
            'owner_id' => ['key' => 'ownerId', 'type' => 'int'],
            'active' => ['formatter' => ['ynToBool' => true]],
            'admin' => true,
            'adminemail' => 'adminEmail',
            'language' => true,
            'expires' => [
                'formatter' => ['dateTimeToJson' => true]
            ],
            'startdate' => [
                'key' => 'startDate',
                'formatter' => ['dateTimeToJson' => true]
            ],
            'anonymized' => ['formatter' => ['ynToBool' => true]],
... (187 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/Transformer/Output/TransformerOutputSurveyDetail.php">
<?php
namespace LimeSurvey\Api\Command\V1\Transformer\Output;
use Survey;
use LimeSurvey\Models\Services\QuestionAggregateService\QuestionService;
use LimeSurvey\Models\Services\SurveyCondition;
use LimeSurvey\Models\Services\SurveyThemeConfiguration;
use LimeSurvey\Api\Transformer\Output\TransformerOutputActiveRecord;
use SurveysGroups;
use TemplateConfiguration;
class TransformerOutputSurveyDetail extends TransformerOutputActiveRecord
{
    const AFFECTED_INHERITED_SETTINGS = [
        'admin', 'adminemail', 'alloweditaftercompletion', 'allowprev', 'allowsave', 'allowregister','anonymized',
        'assessments', 'autoredirect', 'bounce_email', 'datestamp', 'emailnotificationto', 'emailresponseto',
        'format', 'googleanalyticsapikey', 'htmlemail', 'ipaddr', 'ipanonymize', 'listpublic', 'navigationdelay',
        'printanswers', 'publicgraphs', 'publicstatistics', 'questionindex', 'refurl',
        'savetimings', 'sendconfirmation', 'showgroupinfo', 'shownoanswer', 'preselectnoanswer', 'showprogress', 'showqnumcode',
        'showwelcome', 'showxquestions', 'template', 'tokenanswerspersistence', 'tokenlength', 'usecookie',
        'savequotaexit'
    ];
    private TransformerOutputSurvey $transformerSurvey;
    private TransformerOutputSurveyGroup $transformerSurveyGroup;
    private TransformerOutputQuestionGroup $transformerQuestionGroup;
    private TransformerOutputQuestionGroupL10ns $transformerQuestionGroupL10ns;
    private TransformerOutputQuestion $transformerQuestion;
    private TransformerOutputQuestionL10ns $transformerQuestionL10ns;
    private TransformerOutputQuestionAttribute $transformerQuestionAttribute;
    private TransformerOutputAnswer $transformerAnswer;
    private TransformerOutputSurveyOwner $transformerSurveyOwner;
    private QuestionService $questionService;
... (262 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/Transformer/Output/TransformerOutputSurveyGroup.php">
<?php
namespace LimeSurvey\Api\Command\V1\Transformer\Output;
use SurveysGroups;
use LimeSurvey\Api\Transformer\{
    Output\TransformerOutputActiveRecord,
};
class TransformerOutputSurveyGroup extends TransformerOutputActiveRecord
{
    public function __construct()
    {
        $this->setDataMap([
            'gsid' => ['type' => 'int'],
            'name' => true,
            'title' => true,
            'description' => true,
            'sortorder' => ['key' => 'sortOrder', 'type' => 'int'],
            'alwaysavailable' => ['key' => 'alwaysAvailable', 'type' => 'bool'],
        ]);
    }
    public function transform($data, $options = [])
    {
        if (!$data instanceof SurveysGroups) {
            return null;
        }
        return parent::transform($data);
    }
}
</file>

<file path="application/libraries/Api/Command/V1/Transformer/Output/TransformerOutputSurveyLanguageSettings.php">
<?php
namespace LimeSurvey\Api\Command\V1\Transformer\Output;
use LimeSurvey\Api\Transformer\Output\TransformerOutputActiveRecord;
class TransformerOutputSurveyLanguageSettings extends TransformerOutputActiveRecord
{
    public function __construct()
    {
        $this->setDataMap([
            'surveyls_survey_id' => ['key' => 'sid', 'type' => 'int'],
            'surveyls_language'  => 'language',
            'surveyls_title' => 'title',
            'surveyls_description' => 'description',
            'surveyls_welcometext' => 'welcomeText',
            'surveyls_endtext' => 'endText',
            'surveyls_policy_notice' => 'policyNotice',
            'surveyls_policy_error' => 'policyError',
            'surveyls_alias' => 'alias',
            'surveyls_policy_notice_label' => 'policyNoticeLabel',
            'surveyls_url' => 'url',
            'surveyls_urldescription' => 'urlDescription',
            'surveyls_dateformat' => ['key' => 'dateFormat', 'type' => 'int'],
            'surveyls_numberformat' => ['key' => 'numberFormat', 'type' => 'int'],
        ]);
    }
}
</file>

<file path="application/libraries/Api/Command/V1/Transformer/Output/TransformerOutputSurveyMenuItems.php">
<?php
namespace LimeSurvey\Api\Command\V1\Transformer\Output;
use LimeSurvey\Api\Transformer\Output\TransformerOutputActiveRecord;
class TransformerOutputSurveyMenuItems extends TransformerOutputActiveRecord
{
    public function __construct()
    {
        $this->setDataMap([
            'id' => true,
            'menu_id' => 'menuId',
            'user_id' => 'userId',
            'ordering' => true,
            'name' => true,
            'title' => true,
            'menu_title' => 'menuTitle',
            'menu_description' => 'menuDescription',
            'menu_icon' => 'menuIcon',
            'menu_class' => 'menuClass',
            'menu_link' => 'menuLink',
            'action' => true,
            'template' => true,
            'partial' => true,
            'classes' => true,
            'permission' => true,
            'permission_grade' => 'permissionGrade',
            'data' => true,
            'getdatamethod' => 'getDataMethod',
            'language' => true,
            'showincollapse' => 'showInCollapse',
            'active' => true,
... (8 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/Transformer/Output/TransformerOutputSurveyMenus.php">
<?php
namespace LimeSurvey\Api\Command\V1\Transformer\Output;
use LimeSurvey\Api\Transformer\Output\TransformerOutputActiveRecord;
class TransformerOutputSurveyMenus extends TransformerOutputActiveRecord
{
    public function __construct()
    {
        $this->setDataMap([
            'id' => true,
            'parent_id' => 'parentId',
            'user_id' => 'userId',
            'name' => true,
            'ordering' => true,
            'level' => true,
            'title' => true,
            'position' => 'position',
            'description' => 'description',
            'showincollapse' => 'showInCollapse',
            'active' => 'active',
            'created_at' => 'createdAt',
            'created_by' => 'createdBy',
            'changed_at' => 'changedAt',
            'changed_by' => 'changedBy'
        ]);
    }
}
</file>

<file path="application/libraries/Api/Command/V1/Transformer/Output/TransformerOutputSurveyOwner.php">
<?php
namespace LimeSurvey\Api\Command\V1\Transformer\Output;
use LimeSurvey\Api\Transformer\Output\TransformerOutputActiveRecord;
class TransformerOutputSurveyOwner extends TransformerOutputActiveRecord
{
    public function __construct()
    {
        $this->setDataMap([
            'uid' => true,
            'users_name' => 'name',
            'full_name' => 'fullName',
            'parent_id' => 'parentId',
            'lang' => true,
            'email' => true,
            'htmleditormode' => 'htmlEditorMode',
            'templateeditormode' => 'templateEditorMode',
            'questionselectormode' => 'questionSelectorMode',
            'dateformat' => ['key' => 'dateFormat', 'type' => 'int'],
            'last_login' => [
                'key' => 'lastLogin',
                'formatter' => ['dateTimeToJson' => ['revert' => true]]
            ],
            'created' => [
                'formatter' => ['dateTimeToJson' => ['revert' => true]]
            ],
            'modified' => [
                'formatter' => ['dateTimeToJson' => ['revert' => true]]
            ],
            'user_status' => 'userStatus',
        ]);
... (15 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/Transformer/Output/TransformerOutputSurveyResponses.php">
<?php
namespace LimeSurvey\Libraries\Api\Command\V1\Transformer\Output;
use LimeSurvey\Api\Transformer\TransformerException;
use LimeSurvey\Api\Transformer\Output\TransformerOutputActiveRecord;
use Survey;
use SurveyDynamic;
class TransformerOutputSurveyResponses extends TransformerOutputActiveRecord
{
    public array $fieldMap = [];
    public ?bool $hasTokenTable = null;
    public array $rankingFields = [];
    public function __construct()
    {
        $this->setDataMap([
            'id'            => ['type' => 'int'],
            'startlanguage' => ['key' => 'language', 'type' => 'string'],
            'seed'          => ['key' => 'seed'],
            'lastpage'      => ['key' => 'lastPage'],
            'submitdate'    => [
                'key'       => 'submitDate',
                'formatter' => ['dateTimeToJson' => true]
            ],
            'startdate'     => ['key' => 'startDate'],
            'ipaddr'        => ['key' => 'ipAddr'],
            'refurl'        => ['key' => 'refUrl'],
            'datestamp'     => ['key' => 'dateLastAction'],
            'token'         => ['key' => 'token'],
            'firstname'     => ['key' => 'firstName'],
            'lastname'      => ['key' => 'lastName'],
            'email'         => ['key' => 'email'],
... (100 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/Transformer/Output/TransformerOutputUserPermissions.php">
<?php
namespace LimeSurvey\Api\Command\V1\Transformer\Output;
use LimeSurvey\Api\Transformer\Output\TransformerOutputActiveRecord;
class TransformerOutputUserPermissions extends TransformerOutputActiveRecord
{
    public function __construct()
    {
        $this->setDataMap([
            'create_p' => ['key' => 'create', 'formatter' => ['intToBool' => true]],
            'read_p' => ['key' => 'read', 'formatter' => ['intToBool' => true]],
            'update_p' => ['key' => 'update', 'formatter' => ['intToBool' => true]],
            'delete_p' => ['key' => 'delete', 'formatter' => ['intToBool' => true]],
            'import_p' => ['key' => 'import', 'formatter' => ['intToBool' => true]],
            'export_p' => ['key' => 'export', 'formatter' => ['intToBool' => true]],
        ]);
    }
    public function transform($data, $options = [])
    {
        $permissions = ['global' => [], 'survey' => []];
        if (!empty($data)) {
            foreach ($data as $permission) {
                $permissionType = $permission['permission'];
                unset($permission['permission']);
                $permissionTransformed = parent::transform($permission, $options);
                if ($permission['entity'] === 'global') {
                    $permissions['global'][$permissionType] = $permissionTransformed;
                }
                if ($permission['entity'] === 'survey') {
                    $permissions['survey'][$permission['entity_id']][$permissionType] = $permissionTransformed;
                }
... (6 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/AuthSessionCreate.php">
<?php
namespace LimeSurvey\Api\Command\V1;
use LimeSurvey\Api\Command\V1\Exception\ExceptionInvalidUser;
use LimeSurvey\Api\Command\{
    Request\Request,
    Response\Response,
    ResponseData\ResponseDataError,
};
class AuthSessionCreate extends AuthTokenSimpleCreate
{
    public function run(Request $request)
    {
        $username = (string) $request->getData('username');
        $password = (string) $request->getData('password');
        try {
            $responseData = $this->auth->login(
                $username,
                $password
            );
            return $this->responseFactory->makeSuccess(
                $responseData['token']
            );
        } catch (ExceptionInvalidUser $e) {
            return $this->responseFactory->makeErrorUnauthorised(
                (new ResponseDataError(
                    'INVALID_USER',
                    $e->getMessage()
                ))->toArray()
            );
        }
... (3 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/AuthTokenSimpleCreate.php">
<?php
namespace LimeSurvey\Api\Command\V1;
use LimeSurvey\Api\Authentication\AuthenticationTokenSimple;
use LimeSurvey\Api\Command\V1\Exception\ExceptionInvalidUser;
use LimeSurvey\Api\Command\{
    CommandInterface,
    Request\Request,
    Response\Response,
    ResponseData\ResponseDataError,
    Response\ResponseFactory
};
class AuthTokenSimpleCreate implements CommandInterface
{
    protected AuthenticationTokenSimple $auth;
    protected ResponseFactory $responseFactory;
    public function __construct(
        AuthenticationTokenSimple $auth,
        ResponseFactory $responseFactory
    ) {
        $this->auth = $auth;
        $this->responseFactory = $responseFactory;
    }
    public function run(Request $request)
    {
        $username = (string) $request->getData('username');
        $password = (string) $request->getData('password');
        try {
            return $this->responseFactory->makeSuccess(
                $this->auth->login(
                    $username,
... (14 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/AuthTokenSimpleRefresh.php">
<?php
namespace LimeSurvey\Api\Command\V1;
use LimeSurvey\Api\Authentication\AuthenticationTokenSimple;
use LimeSurvey\Api\Command\V1\Exception\ExceptionInvalidUser;
use LimeSurvey\Api\Command\{
    CommandInterface,
    Request\Request,
    Response\Response,
    Response\ResponseFactory
};
class AuthTokenSimpleRefresh implements CommandInterface
{
    protected AuthenticationTokenSimple $auth;
    protected ResponseFactory $responseFactory;
    public function __construct(
        AuthenticationTokenSimple $auth,
        ResponseFactory $responseFactory
    ) {
        $this->auth = $auth;
        $this->responseFactory = $responseFactory;
    }
    public function run(Request $request)
    {
        $authToken = (string) $request->getData('authToken');
        try {
            return $this->responseFactory->makeSuccess(
                $this->auth->refresh(
                    $authToken
                )
            );
... (6 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/AuthTokenSimpleRelease.php">
<?php
namespace LimeSurvey\Api\Command\V1;
use LimeSurvey\Api\Authentication\AuthenticationTokenSimple;
use LimeSurvey\Api\Command\{
    CommandInterface,
    Request\Request,
    Response\Response,
    Response\ResponseFactory
};
class AuthTokenSimpleRelease implements CommandInterface
{
    protected ResponseFactory $responseFactory;
    public function __construct(
        ResponseFactory $responseFactory
    ) {
        $this->responseFactory = $responseFactory;
    }
    public function run(Request $request)
    {
        return $this->responseFactory
            ->makeSuccess('OK');
    }
}
</file>

<file path="application/libraries/Api/Command/V1/ExpressionScriptValidate.php">
<?php
namespace LimeSurvey\Api\Command\V1;
use LimeExpressionManager;
use Permission;
use Question;
use Survey;
use LimeSurvey\Api\Command\{
    CommandInterface,
    Request\Request,
    Response\Response,
    Response\ResponseFactory,
    ResponseData\ResponseDataError
};
class ExpressionScriptValidate implements CommandInterface
{
    public const ERROR_SURVEY_NOT_FOUND = 'SURVEY_NOT_FOUND';
    public const ERROR_QUESTION_NOT_FOUND = 'QUESTION_NOT_FOUND';
    protected Permission $permission;
    protected ResponseFactory $responseFactory;
    protected Survey $survey;
    protected Question $question;
    public function __construct(
        Permission $permission,
        ResponseFactory $responseFactory,
        Survey $survey,
        Question $question
    ) {
        $this->permission = $permission;
        $this->responseFactory = $responseFactory;
        $this->survey = $survey;
... (127 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/FileUpload.php">
<?php
namespace LimeSurvey\Api\Command\V1;
use LimeSurvey\Api\Command\{
    CommandInterface,
    Request\Request,
    Response\Response,
    Response\ResponseFactory,
};
use LimeSurvey\Api\Command\Mixin\Auth\AuthPermissionTrait;
use LimeSurvey\Models\Services\FileUploadService;
use LimeSurvey\Models\Services\SurveyDetailService;
class FileUpload implements CommandInterface
{
    use AuthPermissionTrait;
    protected ResponseFactory $responseFactory;
    protected FileUploadService $fileUploadService;
    protected SurveyDetailService $surveyDetailService;
    public function __construct(
        ResponseFactory $responseFactory,
        FileUploadService $fileUploadService,
        SurveyDetailService $surveyDetailService
    ) {
        $this->responseFactory = $responseFactory;
        $this->fileUploadService = $fileUploadService;
        $this->surveyDetailService = $surveyDetailService;
    }
    public function run(Request $request)
    {
        try {
            $surveyId = (int)$request->getData('_id');
... (15 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/I18n.php">
<?php
namespace LimeSurvey\Api\Command\V1;
use LimeSurvey\Models\Services\TranslationMoToJson;
use Permission;
use LimeSurvey\Api\Command\{
    CommandInterface,
    Request\Request,
    Response\Response,
    Response\ResponseFactory
};
use LimeSurvey\Api\Command\Mixin\Auth\AuthPermissionTrait;
class I18n implements CommandInterface
{
    use AuthPermissionTrait;
    protected ResponseFactory $responseFactory;
    protected Permission $permission;
    public function __construct(
        ResponseFactory $responseFactory,
        Permission $permission
    ) {
        $this->responseFactory = $responseFactory;
        $this->permission = $permission;
    }
    public function run(Request $request)
    {
        $data = [];
        $lang = (string)$request->getData('_id', 'en');
        App()->setLanguage($lang);
        $transLateService = new TranslationMoToJson($lang);
        $translations = $transLateService->translateMoToJson();
... (10 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/I18nMissing.php">
<?php
namespace LimeSurvey\Libraries\Api\Command\V1;
use LimeSurvey\Models\Services\TranslationMoToJson;
use Permission;
use LimeSurvey\Api\Command\{
    CommandInterface,
    Request\Request,
    Response\Response,
    Response\ResponseFactory
};
use LimeSurvey\Api\Command\Mixin\Auth\AuthPermissionTrait;
class I18nMissing implements CommandInterface
{
    use AuthPermissionTrait;
    protected ResponseFactory $responseFactory;
    protected Permission $permission;
    public function __construct(
        ResponseFactory $responseFactory,
        Permission $permission
    ) {
        $this->responseFactory = $responseFactory;
        $this->permission = $permission;
    }
    public function run(Request $request)
    {
        $keys = $request->getData('keys');
        if (empty($keys) || !is_array($keys)) {
            return $this->responseFactory
                ->makeError('Missing or invalid translation keys');
        }
... (69 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/I18nRefreshLanguages.php">
<?php
namespace LimeSurvey\Libraries\Api\Command\V1;
use LimeSurvey\Models\Services\TranslationMoToJson;
use Permission;
use LimeSurvey\Api\Command\{
    CommandInterface,
    Request\Request,
    Response\Response,
    Response\ResponseFactory
};
use LimeSurvey\Api\Command\Mixin\Auth\AuthPermissionTrait;
class I18nRefreshLanguages implements CommandInterface
{
    use AuthPermissionTrait;
    protected ResponseFactory $responseFactory;
    protected Permission $permission;
    public function __construct(
        ResponseFactory $responseFactory,
        Permission $permission
    ) {
        $this->responseFactory = $responseFactory;
        $this->permission = $permission;
    }
    public function run(Request $request)
    {
        $lang = (string)$request->getData('_id', 'en');
        App()->setLanguage($lang);
        $data =  getLanguageData();
        return $this->responseFactory
            ->makeSuccess($data);
... (3 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/SiteSettings.php">
<?php
namespace LimeSurvey\Api\Command\V1;
use Yii;
use LimeSurvey\Api\Command\{
    CommandInterface,
    Request\Request,
    Response\Response,
    Response\ResponseFactory
};
class SiteSettings implements CommandInterface
{
    protected ResponseFactory $responseFactory;
    public function __construct(ResponseFactory $responseFactory)
    {
        $this->responseFactory = $responseFactory;
    }
    public function run(Request $request)
    {
        return $this->responseFactory
            ->makeSuccess([
                'siteName' => Yii::app()->getConfig('sitename'),
                'timezone' => date_default_timezone_get(),
                'languages' => getLanguageData(),
                'dateFormats' => getDateFormatData(),
                'maximumFileUploadSize' => getMaximumFileUploadSize(),
            ]);
    }
}
</file>

<file path="application/libraries/Api/Command/V1/Statistics.php">
<?php
namespace LimeSurvey\Libraries\Api\Command\V1;
use CDbException;
use InvalidArgumentException;
use LimeSurvey\Models\Services\Exception\NotFoundException;
use LimeSurvey\Models\Services\SurveyStatistics\StatisticsResponseFilters;
use LimeSurvey\Models\Services\SurveyStatistics\StatisticsService;
use Permission;
use LimeSurvey\Api\Command\V1\Transformer\Output\TransformerOutputSurvey;
use LimeSurvey\Api\Command\{
    CommandInterface,
    Request\Request,
    Response\Response,
    Response\ResponseFactory
};
use LimeSurvey\Api\Command\Mixin\Auth\AuthPermissionTrait;
use DI\FactoryInterface;
use Yii;
class Statistics implements CommandInterface
{
    use AuthPermissionTrait;
    private const DEFAULT_PAGE_SIZE = 15;
    private const MAX_PAGE_SIZE = 100;
    protected Permission $permission;
    protected TransformerOutputSurvey $transformerOutputSurvey;
    protected ResponseFactory $responseFactory;
    protected StatisticsService $statisticsService;
    protected StatisticsResponseFilters $filters;
    public function __construct(
        TransformerOutputSurvey $transformerOutputSurvey,
... (78 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/StatisticsOverview.php">
<?php
namespace LimeSurvey\Libraries\Api\Command\V1;
use CDbException;
use InvalidArgumentException;
use LimeSurvey\Api\Transformer\TransformerException;
use LimeSurvey\DI;
use LimeSurvey\Libraries\Api\Command\V1\SurveyResponses\FilterPatcher;
use LimeSurvey\Libraries\Api\Command\V1\Transformer\Output\TransformerOutputSurveyResponses;
use LimeSurvey\Models\Services\SurveyStatistics\Charts\DailyActivity\DailyActivityStatistics;
use LimeSurvey\Models\Services\SurveyStatistics\Charts\SurveyOverview\SurveyOverviewStatistics;
use LimeSurvey\Models\Services\SurveyStatistics\StatisticsService;
use Permission;
use LimeSurvey\Api\Command\{
    CommandInterface,
    Request\Request,
    Response\Response,
    Response\ResponseFactory
};
use LimeSurvey\Api\Command\Mixin\Auth\AuthPermissionTrait;
use Survey;
use SurveyDynamic;
class StatisticsOverview implements CommandInterface
{
    use AuthPermissionTrait;
    protected Permission $permission;
    protected Survey $survey;
    protected ResponseFactory $responseFactory;
    protected StatisticsService $statisticsService;
    protected FilterPatcher $responseFilterPatcher;
    protected TransformerOutputSurveyResponses $transformerOutputSurveyResponses;
... (67 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/SurveyArchive.php">
<?php
namespace LimeSurvey\Api\Command\V1;
use CHttpSession;
use Survey;
use Token;
use LimeSurvey\Api\Command\{
    CommandInterface,
    Request\Request,
    Response\Response,
    Response\ResponseFactory,
    ResponseData\ResponseDataError
};
use LimeSurvey\Api\Command\Mixin\Auth\AuthPermissionTrait;
class SurveyArchive implements CommandInterface
{
    use AuthPermissionTrait;
    protected CHttpSession $session;
    protected ResponseFactory $responseFactory;
    protected Survey $survey;
    public function __construct(
        CHttpSession $session,
        ResponseFactory $responseFactory,
        Survey $survey
    ) {
        $this->session = $session;
        $this->responseFactory = $responseFactory;
        $this->survey = $survey;
    }
    protected function processData(Survey $survey, array $rawData): array
    {
... (86 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/SurveyDetail.php">
<?php
namespace LimeSurvey\Api\Command\V1;
use Permission;
use Survey;
use LimeSurvey\Api\Command\V1\Transformer\Output\TransformerOutputSurveyDetail;
use LimeSurvey\Api\Command\{
    CommandInterface,
    Request\Request,
    Response\Response,
    ResponseData\ResponseDataError,
    Response\ResponseFactory
};
use LimeSurvey\Api\Command\Mixin\Auth\AuthPermissionTrait;
use LimeSurvey\Models\Services\SurveyDetailService;
class SurveyDetail implements CommandInterface
{
    use AuthPermissionTrait;
    protected Survey $survey;
    protected TransformerOutputSurveyDetail $transformerOutputSurveyDetail;
    protected ResponseFactory $responseFactory;
    protected Permission $permission;
    protected SurveyDetailService $surveyDetailService;
    protected string $lastLoaded;
    public function __construct(
        Survey $survey,
        TransformerOutputSurveyDetail $transformerOutputSurveyDetail,
        ResponseFactory $responseFactory,
        Permission $permission,
        SurveyDetailService $surveyDetailService
    ) {
... (73 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/SurveyGroupList.php">
<?php
namespace LimeSurvey\Api\Command\V1;
use SurveysGroups;
use LimeSurvey\Api\Command\V1\Transformer\Output\TransformerOutputSurveyGroup;
use LimeSurvey\Api\Command\{
    CommandInterface,
    Request\Request,
    Response\Response,
    Response\ResponseFactory
};
use LimeSurvey\Api\Command\Mixin\Auth\AuthPermissionTrait;
class SurveyGroupList implements CommandInterface
{
    use AuthPermissionTrait;
    protected SurveysGroups $surveyGroup;
    protected TransformerOutputSurveyGroup $transformerOutputSurveyGroup;
    protected ResponseFactory $responseFactory;
    public function __construct(
        SurveysGroups $surveyGroup,
        TransformerOutputSurveyGroup $transformerOutputSurveyGroup,
        ResponseFactory $responseFactory
    ) {
        $this->surveyGroup = $surveyGroup;
        $this->transformerOutputSurveyGroup = $transformerOutputSurveyGroup;
        $this->responseFactory = $responseFactory;
    }
    public function run(Request $request)
    {
        $dataProvider = $this->surveyGroup->search();
        $data = $this->transformerOutputSurveyGroup
... (6 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/SurveyGroups.php">
<?php
namespace LimeSurvey\Api\Command\V1;
use SurveysGroups;
use LimeSurvey\Api\Command\V1\Transformer\Output\TransformerOutputSurveyGroup;
use LimeSurvey\Api\Command\{
    CommandInterface,
    Request\Request,
    Response\Response,
    Response\ResponseFactory
};
use LimeSurvey\Api\Command\Mixin\Auth\AuthPermissionTrait;
class SurveyGroups implements CommandInterface
{
    use AuthPermissionTrait;
    protected SurveysGroups $surveyGroup;
    protected TransformerOutputSurveyGroup $transformerOutputSurveyGroup;
    protected ResponseFactory $responseFactory;
    public function __construct(
        SurveysGroups $surveyGroup,
        TransformerOutputSurveyGroup $transformerOutputSurveyGroup,
        ResponseFactory $responseFactory
    ) {
        $this->surveyGroup = $surveyGroup;
        $this->transformerOutputSurveyGroup = $transformerOutputSurveyGroup;
        $this->responseFactory = $responseFactory;
    }
    public function run(Request $request)
    {
        $dataProvider = $this->surveyGroup->search();
        $data = $this->transformerOutputSurveyGroup
... (6 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/SurveyImport.php">
<?php
namespace LimeSurvey\Api\Command\V1;
use LimeSurvey\Api\Command\{
    CommandInterface,
    Request\Request,
    Response\Response,
    Response\ResponseFactory
};
use LimeSurvey\Api\Command\ResponseData\ResponseDataError;
use LimeSurvey\Models\Services\UploadValidator;
class SurveyImport implements CommandInterface
{
    private const ALLOWED_EXTENSIONS = ['lss', 'lsa', 'txt', 'tsv'];
    private const GROUP_STRATEGIES = ['default', 'from_survey'];
    protected ResponseFactory $responseFactory;
    public function __construct(ResponseFactory $responseFactory)
    {
        $this->responseFactory = $responseFactory;
    }
    public function run(Request $request): Response
    {
        if (!\Permission::model()->hasGlobalPermission('surveys', 'create')) {
            return $this->responseFactory->makeErrorForbidden(
                $this->error('SURVEY_IMPORT_FORBIDDEN', gT('Access denied!'))
            );
        }
        $files = $request->getData('filesGlobal', []);
        $validator = new UploadValidator($_POST, $files);
        $uploadError = $validator->getError('file');
        if ($uploadError !== null) {
... (101 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/SurveyList.php">
<?php
namespace LimeSurvey\Api\Command\V1;
use Survey;
use LimeSurvey\Api\Command\V1\Transformer\Output\TransformerOutputSurvey;
use LimeSurvey\Api\Command\{
    CommandInterface,
    Request\Request,
    Response\Response,
    Response\ResponseFactory
};
use LimeSurvey\Api\Command\Mixin\Auth\AuthPermissionTrait;
use DI\FactoryInterface;
class SurveyList implements CommandInterface
{
    use AuthPermissionTrait;
    protected Survey $survey;
    protected TransformerOutputSurvey $transformerOutputSurvey;
    protected ResponseFactory $responseFactory;
    public function __construct(
        TransformerOutputSurvey $transformerOutputSurvey,
        FactoryInterface $diFactory,
        ResponseFactory $responseFactory
    ) {
        $this->survey = $diFactory->make(
            Survey::class,
            ['scenario' => 'search']
        );
        $this->transformerOutputSurvey = $transformerOutputSurvey;
        $this->responseFactory = $responseFactory;
    }
... (16 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/SurveyLogic.php">
<?php
namespace LimeSurvey\Api\Command\V1;
use LimeExpressionManager;
use LSYii_Validators;
use Permission;
use Survey;
use Yii;
use LimeSurvey\Api\Command\{
    CommandInterface,
    Request\Request,
    Response\Response,
    Response\ResponseFactory,
    ResponseData\ResponseDataError
};
use LimeSurvey\Api\Command\Mixin\Auth\AuthPermissionTrait;
class SurveyLogic implements CommandInterface
{
    use AuthPermissionTrait;
    public const ERROR_SURVEY_NOT_FOUND = 'SURVEY_NOT_FOUND';
    protected Permission $permission;
    protected ResponseFactory $responseFactory;
    protected Survey $survey;
    public function __construct(
        Permission $permission,
        ResponseFactory $responseFactory,
        Survey $survey
    ) {
        $this->permission = $permission;
        $this->responseFactory = $responseFactory;
        $this->survey = $survey;
... (55 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/SurveyPatch.php">
<?php
namespace LimeSurvey\Api\Command\V1;
use LimeSurvey\Api\Command\V1\SurveyPatch\PatcherSurvey;
use LimeSurvey\Api\Command\{
    CommandInterface,
    Request\Request,
    Response\Response,
    Response\ResponseFactory
};
use LimeSurvey\Api\Command\Mixin\Auth\AuthPermissionTrait;
use LimeSurvey\ObjectPatch\ObjectPatchException;
use DI\FactoryInterface;
class SurveyPatch implements CommandInterface
{
    use AuthPermissionTrait;
    protected FactoryInterface $diFactory;
    protected ResponseFactory $responseFactory;
    public function __construct(
        FactoryInterface $diFactory,
        ResponseFactory $responseFactory
    ) {
        $this->diFactory = $diFactory;
        $this->responseFactory = $responseFactory;
    }
    public function run(Request $request)
    {
        $id = (string) $request->getData('_id');
        $patch = $request->getData('patch');
        $patcher = $this->diFactory->make(
            PatcherSurvey::class
... (13 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/SurveyQuestionsFieldname.php">
<?php
namespace LimeSurvey\Api\Command\V1;
use LimeSurvey\Api\Command\CommandInterface;
use LimeSurvey\Api\Command\Request\Request;
use LimeSurvey\Api\Command\Response\Response;
use LimeSurvey\Api\Command\Response\ResponseFactory;
use LSYii_Application;
use Permission;
use Survey;
class SurveyQuestionsFieldname implements CommandInterface
{
    protected Permission $permission;
    protected LSYii_Application $app;
    protected ResponseFactory $responseFactory;
    public function __construct(
        LSYii_Application $app,
        Permission $permission,
        ResponseFactory $responseFactory
    ) {
        $this->app = $app;
        $this->permission = $permission;
        $this->responseFactory = $responseFactory;
    }
    public function run(Request $request): Response
    {
        $surveyId = (string) $request->getData('_id');
        if (!$this->permission->hasSurveyPermission($surveyId, 'fieldnames')) {
            return $this->responseFactory->makeErrorUnauthorised();
        }
        $survey = Survey::model()->findByPk($surveyId);
... (38 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/SurveyResponses.php">
<?php
namespace LimeSurvey\Libraries\Api\Command\V1;
use CDbException;
use LimeSurvey\Api\Transformer\TransformerException;
use LimeSurvey\Libraries\Api\Command\V1\SurveyResponses\FilterPatcher;
use LimeSurvey\Libraries\Api\Command\V1\SurveyResponses\ResponseMappingTrait;
use LimeSurvey\Libraries\Api\Command\V1\SurveyResponses\SurveyResponseFiles;
use LimeSurvey\Libraries\Api\Command\V1\SurveyResponses\SurveyRequestTrait;
use LimeSurvey\Models\Services\Exception\PermissionDeniedException;
use LimeSurvey\Models\Services\SurveyAnswerCache;
use Permission;
use Survey;
use LimeSurvey\Api\Command\{CommandInterface,
    Request\Request,
    Response\Response,
    Response\ResponseFactory
};
use LimeSurvey\Api\Command\Mixin\Auth\AuthPermissionTrait;
use LimeSurvey\Libraries\Api\Command\V1\Transformer\Output\TransformerOutputSurveyResponses;
class SurveyResponses implements CommandInterface
{
    use AuthPermissionTrait;
    use ResponseMappingTrait;
    use SurveyRequestTrait;
    private const FIXED_OUTPUT_COLUMNS = [
        'id',
        'submitdate',
        'startdate',
        'datestamp',
        'startlanguage',
... (257 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/SurveyResponsesExport.php">
<?php
namespace LimeSurvey\Libraries\Api\Command\V1;
use Exception;
use InvalidArgumentException;
use LimeSurvey\Api\Command\CommandInterface;
use LimeSurvey\Api\Command\Request\Request;
use LimeSurvey\Api\Command\Response\Response;
use LimeSurvey\Api\Command\Response\ResponseFactory;
use LimeSurvey\Api\Transformer\TransformerException;
use LimeSurvey\Models\Services\Exception\PermissionDeniedException;
use LimeSurvey\Models\Services\ExportSurveyResultsService;
use LimeSurvey\Api\Command\Mixin\Auth\AuthPermissionTrait;
use Permission;
use RuntimeException;
use Survey;
use Yii;
class SurveyResponsesExport implements CommandInterface
{
    use AuthPermissionTrait;
    protected Survey $survey;
    protected $surveyModel;
    protected ResponseFactory $responseFactory;
    protected Permission $permission;
    protected ExportSurveyResultsService $exportSurvey;
    private array $allowedFormats = [
        'csv', 'html', 'pdf', 'excel', 'word', 'json', 'spss', 'stata', 'r_syntax', 'r_data',
    ];
    private array $legacyFormatMap = [
        'pdf' => 'pdf',
        'excel' => 'xls',
... (205 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/SurveyResponsesPatch.php">
<?php
namespace LimeSurvey\Libraries\Api\Command\V1;
use DI\FactoryInterface;
use LimeSurvey\Libraries\Api\Command\V1\SurveyResponses\PatcherSurveyResponses;
use LimeSurvey\ObjectPatch\ObjectPatchException;
use LimeSurvey\Api\Command\{CommandInterface,
    Request\Request,
    Response\Response,
    Response\ResponseFactory};
class SurveyResponsesPatch implements CommandInterface
{
    protected FactoryInterface $diFactory;
    protected ResponseFactory $responseFactory;
    public function __construct(
        FactoryInterface $diFactory,
        ResponseFactory $responseFactory
    ) {
        $this->diFactory = $diFactory;
        $this->responseFactory = $responseFactory;
    }
    public function run(Request $request)
    {
        $id = (string) $request->getData('_id');
        $patch = $request->getData('patch');
        $patcher = $this->diFactory->make(
            PatcherSurveyResponses::class
        );
        try {
            $returnedData = $patcher->applyPatch($patch, ['id' => $id]);
        } catch (ObjectPatchException $e) {
... (9 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/SurveyStatisticsGlance.php">
<?php
namespace LimeSurvey\Libraries\Api\Command\V1;
use LimeSurvey\Libraries\Api\Command\V1\SurveyResponses\FilterPatcher;
use LimeSurvey\Models\Services\SurveyStatistics\Charts\SurveyOverview\SurveyOverviewStatistics;
use LimeSurvey\Models\Services\SurveyStatistics\StatisticsService;
use Permission;
use Survey;
use LimeSurvey\Api\Command\{CommandInterface,
    Request\Request,
    Response\Response,
    Response\ResponseFactory
};
use LimeSurvey\Api\Command\Mixin\Auth\AuthPermissionTrait;
class SurveyStatisticsGlance implements CommandInterface
{
    use AuthPermissionTrait;
    protected Survey $survey;
    protected Permission $permission;
    protected ResponseFactory $responseFactory;
    protected FilterPatcher $responseFilterPatcher;
    protected StatisticsService $statisticsService;
    private int $surveyId = 0;
    private $language = '';
    /**
     * Constructor
     *
     * @param Permission $permission
     * @param FilterPatcher $responseFilterPatcher
     * @param ResponseFactory $responseFactory
     */
... (44 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/SurveyTemplate.php">
<?php
namespace LimeSurvey\Api\Command\V1;
use CHttpSession;
use Survey;
use SurveyLanguageSetting;
use LimeSurvey\Api\Command\{
    CommandInterface,
    Request\Request,
    Response\Response,
    Response\ResponseFactory,
    ResponseData\ResponseDataError
};
use LimeSurvey\Api\Command\Mixin\Auth\AuthPermissionTrait;
class SurveyTemplate implements CommandInterface
{
    use AuthPermissionTrait;
    protected CHttpSession $session;
    protected ResponseFactory $responseFactory;
    protected Survey $survey;
    protected SurveyLanguageSetting $surveyLanguageSetting;
    public function __construct(
        ResponseFactory $responseFactory,
        CHttpSession $session,
        Survey $survey,
        SurveyLanguageSetting $surveyLanguageSetting
    ) {
        $this->responseFactory = $responseFactory;
        $this->session = $session;
        $this->survey = $survey;
        $this->surveyLanguageSetting = $surveyLanguageSetting;
... (89 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/UserDetail.php">
<?php
namespace LimeSurvey\Libraries\Api\Command\V1;
use LimeSurvey\Api\Command\CommandInterface;
use LimeSurvey\Api\Command\Mixin\Auth\AuthPermissionTrait;
use LimeSurvey\Api\Command\Request\Request;
use LimeSurvey\Api\Command\Response\Response;
use LimeSurvey\Api\Command\Response\ResponseFactory;
use LimeSurvey\Api\Command\ResponseData\ResponseDataError;
use LimeSurvey\Api\Command\V1\Transformer\Output\TransformerOutputSurveyOwner;
use LimeSurvey\Api\Transformer\TransformerException;
use Permission;
use User;
class UserDetail implements CommandInterface
{
    use AuthPermissionTrait;
    protected TransformerOutputSurveyOwner $transformerOutputSurveyOwner;
    protected ResponseFactory $responseFactory;
    protected Permission $permission;
    protected User $modelUser;
    public function __construct(
        TransformerOutputSurveyOwner $transformerOutputSurveyOwner,
        ResponseFactory $responseFactory,
        Permission $permission,
        User $modelUser
    ) {
        $this->transformerOutputSurveyOwner = $transformerOutputSurveyOwner;
        $this->responseFactory = $responseFactory;
        $this->permission = $permission;
        $this->modelUser = $modelUser;
    }
... (24 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/UserList.php">
<?php
namespace LimeSurvey\Api\Command\V1;
use User;
use Permission;
use LimeSurvey\Api\Command\V1\Transformer\Output\TransformerOutputSurveyOwner;
use LimeSurvey\Api\Command\{
    CommandInterface,
    Request\Request,
    Response\Response,
    Response\ResponseFactory
};
use LimeSurvey\Api\Command\Mixin\Auth\AuthPermissionTrait;
class UserList implements CommandInterface
{
    use AuthPermissionTrait;
    protected User $user;
    protected Permission $permission;
    protected TransformerOutputSurveyOwner $transformerOutputSurveyOwner;
    protected ResponseFactory $responseFactory;
    public function __construct(
        User $user,
        Permission $permission,
        TransformerOutputSurveyOwner $transformerOutputSurveyOwner,
        ResponseFactory $responseFactory
    ) {
        $this->user = $user;
        $this->permission = $permission;
        $this->transformerOutputSurveyOwner = $transformerOutputSurveyOwner;
        $this->responseFactory = $responseFactory;
    }
... (15 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/UserPermission.php">
<?php
namespace LimeSurvey\Api\Command\V1;
use Permission;
use LimeSurvey\Api\Command\{CommandInterface,
    Request\Request,
    Response\Response,
    Response\ResponseFactory};
use LimeSurvey\Api\Command\V1\Transformer\Output\TransformerOutputUserPermissions;
use LimeSurvey\Api\Command\Mixin\Auth\AuthPermissionTrait;
class UserPermission implements CommandInterface
{
    use AuthPermissionTrait;
    protected Permission $permission;
    protected TransformerOutputUserPermissions $transformOutputUserPermissions;
    protected ResponseFactory $responseFactory;
    public function __construct(
        Permission $permission,
        TransformerOutputUserPermissions $transformOutputUserPermissions,
        ResponseFactory $responseFactory
    ) {
        $this->permission = $permission;
        $this->transformOutputUserPermissions = $transformOutputUserPermissions;
        $this->responseFactory = $responseFactory;
    }
    public function run(Request $request)
    {
        $userId = App()->user->getId();
        $permissions = $this->permission->getPermissions($userId);
        $responseData = $this->transformOutputUserPermissions->transform($permissions);
        $surveyId = (int) $request->getData('surveyId');
... (21 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/UserSettingGetValue.php">
<?php
namespace LimeSurvey\Libraries\Api\Command\V1;
use LimeSurvey\Api\Command\CommandInterface;
use LimeSurvey\Api\Command\Mixin\Auth\AuthPermissionTrait;
use LimeSurvey\Api\Command\Request\Request;
use LimeSurvey\Api\Command\Response\Response;
use LimeSurvey\Api\Command\Response\ResponseFactory;
use LimeSurvey\Api\Command\ResponseData\ResponseDataError;
use SettingsUser;
class UserSettingGetValue implements CommandInterface
{
    use AuthPermissionTrait;
    protected ResponseFactory $responseFactory;
    protected SettingsUser $modelSettingsUser;
    public function __construct(
        ResponseFactory $responseFactory,
        SettingsUser $modelSettingsUser
    ) {
        $this->responseFactory = $responseFactory;
        $this->modelSettingsUser = $modelSettingsUser;
    }
    public function run(Request $request)
    {
        $settingName = (string)$request->getData('_id');
        $settingUser = $this->modelSettingsUser::getUserSettingValue(
            $settingName
        );
        if (!isset($settingUser)) {
            return $this->responseFactory->makeErrorNotFound(
                (new ResponseDataError(
... (10 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/UserSettingSetValue.php">
<?php
namespace LimeSurvey\Libraries\Api\Command\V1;
use LimeSurvey\Api\Command\CommandInterface;
use LimeSurvey\Api\Command\Mixin\Auth\AuthPermissionTrait;
use LimeSurvey\Api\Command\Request\Request;
use LimeSurvey\Api\Command\Response\Response;
use LimeSurvey\Api\Command\Response\ResponseFactory;
use LimeSurvey\Api\Command\ResponseData\ResponseDataError;
use SettingsUser;
class UserSettingSetValue implements CommandInterface
{
    use AuthPermissionTrait;
    protected ResponseFactory $responseFactory;
    protected SettingsUser $modelSettingsUser;
    public function __construct(
        ResponseFactory $responseFactory,
        SettingsUser $modelSettingsUser
    ) {
        $this->responseFactory = $responseFactory;
        $this->modelSettingsUser = $modelSettingsUser;
    }
    public function run(Request $request)
    {
        $settingName = (string)$request->getData('settingName');
        $settingValue = (string)$request->getData('settingValue');
        $settingsUser = $this->modelSettingsUser::setUserSetting(
            $settingName,
            $settingValue
        );
        if (!$settingsUser) {
... (12 lines truncated)
</file>

<file path="application/libraries/Api/Command/V1/VersionInfo.php">
<?php
namespace LimeSurvey\Api\Command\V1;
use LimeSurvey\Api\Command\{
    CommandInterface,
    Request\Request,
    Response\Response,
    Response\ResponseFactory
};
class VersionInfo implements CommandInterface
{
    protected ResponseFactory $responseFactory;
    public function __construct(ResponseFactory $responseFactory)
    {
        $this->responseFactory = $responseFactory;
    }
    public function run(Request $request)
    {
        $installationDBVersion = (int) App()->getConfig('DBVersion');
        $dBVersion = App()->getConfig('dbversionnumber');
        return $this->responseFactory
            ->makeSuccess([
                'dbVersion' => $dBVersion,
                'assetsVersionNumber' => App()->getConfig('assetsversionnumber'),
                'needsDbUpdate' => $installationDBVersion < $dBVersion,
            ]);
    }
}
</file>

<file path="application/libraries/Api/Command/ApiCommandException.php">
<?php
namespace LimeSurvey\Api\Command;
use LimeSurvey\Api\ApiException;
class ApiCommandException extends ApiException
{
}
</file>

<file path="application/libraries/Api/Command/CommandInterface.php">
<?php
namespace LimeSurvey\Api\Command;
use LimeSurvey\Api\Command\{
    Request\Request,
    Response\Response
};
interface CommandInterface
{
    public function run(Request $request);
}
</file>

<file path="application/libraries/Api/Command/Exception.php">
<?php
namespace LimeSurvey\Api\Command;
class Exception extends \LimeSurvey\Api\ApiException
{
}
</file>

<file path="application/libraries/Api/Command/Options.php">
<?php
namespace LimeSurvey\Api\Command;
use LimeSurvey\Api\Command\{
    Request\Request,
    Response\Response,
    Response\ResponseFactory
};
class Options implements CommandInterface
{
    protected ResponseFactory $responseFactory;
    public function __construct(
        ResponseFactory $responseFactory
    ) {
        $this->responseFactory = $responseFactory;
    }
    public function run(Request $request)
    {
        return $this->responseFactory->makeSuccessNoContent();
    }
}
</file>

<file path="application/libraries/Api/Rest/Endpoint/EndpointFactory.php">
<?php
namespace LimeSurvey\Api\Rest\Endpoint;
use CHttpRequest;
use Yii;
use DI\FactoryInterface;
use LimeSurvey\Api\{
    Command\Options,
    Rest\Endpoint,
    Rest\RestConfig,
    ApiException
};
class EndpointFactory
{
    protected FactoryInterface $diFactory;
    protected RestConfig $restConfig;
    public function __construct(FactoryInterface $diFactory, RestConfig $restConfig)
    {
        $this->diFactory = $diFactory;
        $this->restConfig = $restConfig;
    }
    public function create(CHttpRequest $request)
    {
        $endpointConfig = $this->getEndpointConfig($request);
        return $this->diFactory->make(Endpoint::class, [
            'config' => $endpointConfig,
            'commandParams' => $this->getCommandParams(
                $endpointConfig,
                $request
            )
        ]);
... (137 lines truncated)
</file>

<file path="application/libraries/Api/Rest/Renderer/RendererBasic.php">
<?php
namespace LimeSurvey\Api\Rest\Renderer;
use CJSON;
use CWebLogRoute;
use Exception;
use Yii;
use LSYii_Application;
use LimeSurvey\Api\Rest\Renderer\RendererInterface;
use LimeSurvey\Api\Command\Response\{
    Response,
    Status
};
class RendererBasic implements RendererInterface
{
    public function returnResponse(Response $response)
    {
        $this->renderJSON(
            $response->getData(),
            $this->getHttpResponseCode($response->getStatus())
        );
    }
    public function returnException(Exception $exception)
    {
        $error = [];
        $error['code'] = get_class($exception);
        if (YII_DEBUG) {
            $error['message'] = $exception->getMessage();
            $error['file'] = $exception->getFile();
            $error['line'] = $exception->getLine();
            $error['stacktrace'] = $exception->getTraceAsString();
... (54 lines truncated)
</file>

<file path="application/libraries/Api/Rest/Renderer/RendererInterface.php">
<?php
namespace LimeSurvey\Api\Rest\Renderer;
use LimeSurvey\Api\Command\Response\Response;
use Exception;
interface RendererInterface
{
    public function returnResponse(Response $response);
    public function returnException(Exception $exception);
}
</file>

<file path="application/libraries/Api/Rest/V1/SchemaFactory/SchemaFactoryAnswer.php">
<?php
namespace LimeSurvey\Api\Rest\V1\SchemaFactory;
use GoldSpecDigital\ObjectOrientedOAS\Objects\Schema;
class SchemaFactoryAnswer
{
    public function make(): Schema
    {
        return Schema::create()
            ->title('Answer')
            ->description('Answer')
            ->type(Schema::TYPE_OBJECT)
            ->properties(
                Schema::integer('aid')->default(null),
                Schema::integer('qid')->default(null),
                Schema::string('code')->default(null),
                Schema::integer('sortOrder')->default(null),
                Schema::integer('assessmentValue')->default(null),
                Schema::integer('scaleId')->default(null)
            );
    }
}
</file>

<file path="application/libraries/Api/Rest/V1/SchemaFactory/SchemaFactoryAuthToken.php">
<?php
namespace LimeSurvey\Api\Rest\V1\SchemaFactory;
use GoldSpecDigital\ObjectOrientedOAS\Objects\Schema;
class SchemaFactoryAuthToken
{
    public function make(): Schema
    {
        return Schema::string()
            ->example('%7&!T%EYd@PnDB49MRfwQ!KjX48J^3x6rDhyB6DK');
    }
}
</file>

<file path="application/libraries/Api/Rest/V1/SchemaFactory/SchemaFactoryError.php">
<?php
namespace LimeSurvey\Api\Rest\V1\SchemaFactory;
use GoldSpecDigital\ObjectOrientedOAS\Objects\Schema;
class SchemaFactoryError
{
    public function make(): Schema
    {
        return Schema::create()
            ->title('Error')
            ->description('Error')
            ->type(Schema::TYPE_OBJECT)
            ->properties(
                Schema::object('error')->properties(
                    Schema::string('code'),
                    Schema::string('message'),
                    Schema::object('data'),
                )
            );
    }
}
</file>

<file path="application/libraries/Api/Rest/V1/SchemaFactory/SchemaFactoryExpressionScriptValidation.php">
<?php
namespace LimeSurvey\Api\Rest\V1\SchemaFactory;
use GoldSpecDigital\ObjectOrientedOAS\Contracts\SchemaContract;
use GoldSpecDigital\ObjectOrientedOAS\Objects\Schema;
class SchemaFactoryExpressionScriptValidation
{
    public function make(SchemaContract ...$properties): Schema
    {
        $diagnosticSchema = Schema::object()
            ->properties(
                Schema::integer('from')->default(0),
                Schema::integer('to')->default(0),
                Schema::string('severity'),
                Schema::string('message')
            );
        return Schema::create()
            ->title('Expression Script validation')
            ->description('Expression Manager validation diagnostics')
            ->type(Schema::TYPE_OBJECT)
            ->properties(
                Schema::boolean('valid'),
                Schema::array('diagnostics')->items($diagnosticSchema),
                ...$properties
            );
    }
}
</file>

<file path="application/libraries/Api/Rest/V1/SchemaFactory/SchemaFactoryExpressionScriptValidationRequest.php">
<?php
namespace LimeSurvey\Api\Rest\V1\SchemaFactory;
use GoldSpecDigital\ObjectOrientedOAS\Contracts\SchemaContract;
use GoldSpecDigital\ObjectOrientedOAS\Objects\Schema;
class SchemaFactoryExpressionScriptValidationRequest
{
    public function make(SchemaContract ...$properties): Schema
    {
        return Schema::create()
            ->title('Expression Script validation request')
            ->description('Expression and question context to validate')
            ->type(Schema::TYPE_OBJECT)
            ->required('expression', 'questionId')
            ->properties(
                Schema::string('expression'),
                Schema::integer('questionId'),
                ...$properties
            );
    }
}
</file>

<file path="application/libraries/Api/Rest/V1/SchemaFactory/SchemaFactoryI18n.php">
<?php
namespace LimeSurvey\Libraries\Api\Rest\V1\SchemaFactory;
use GoldSpecDigital\ObjectOrientedOAS\Objects\Schema;
use GoldSpecDigital\ObjectOrientedOAS\Contracts\SchemaContract;
class SchemaFactoryI18n
{
    public function make(SchemaContract ...$properties): Schema
    {
        return Schema::create()
            ->title('I18nTranslationsAndLanguages')
            ->description('Internationalization Translations and Languages')
            ->type(Schema::TYPE_ARRAY)
            ->items(
                Schema::object()->properties(
                    Schema::object('translations')
                        ->additionalProperties(Schema::string()),
                    Schema::object('languages')
                        ->additionalProperties(
                            Schema::object()->properties(
                                Schema::string('description'),
                                Schema::string('nativedescription'),
                                Schema::boolean('rtl'),
                                Schema::integer('dateformat'),
                                Schema::integer('radixpoint'),
                                Schema::string('momentjs')
                            )
                        )
                )
            );
    }
... (2 lines truncated)
</file>

<file path="application/libraries/Api/Rest/V1/SchemaFactory/SchemaFactoryI18nMissingTranslations.php">
<?php
namespace LimeSurvey\Api\Rest\V1\SchemaFactory;
use GoldSpecDigital\ObjectOrientedOAS\Objects\{
    Schema,
    AllOf
};
class SchemaFactoryI18nMissingTranslations
{
    public function make(): Schema
    {
        $props = [
            Schema::array('keys')
                ->items(Schema::string())
                ->description('Array of missing translation strings')
                ->example(['missingTranslationString1', 'missingTranslationString2'])
        ];
        return Schema::create()
            ->title('I18n Missing Translations')
            ->description('Schema for missing translations')
            ->type(Schema::TYPE_OBJECT)
            ->properties(...$props);
    }
}
</file>

<file path="application/libraries/Api/Rest/V1/SchemaFactory/SchemaFactoryI18nMissingTranslationsResponse.php">
<?php
namespace LimeSurvey\Api\Rest\V1\SchemaFactory;
use GoldSpecDigital\ObjectOrientedOAS\Objects\Schema;
use GoldSpecDigital\ObjectOrientedOAS\Contracts\SchemaContract;
class SchemaFactoryI18nMissingTranslationsResponse
{
    public function make(SchemaContract ...$properties): Schema
    {
        return Schema::create()
            ->title('I18nMissingTranslations')
            ->description('Schema for saving missing translations')
            ->type(Schema::TYPE_OBJECT)
            ->properties(
                Schema::string('message')
                    ->description('Success message with the saved key')
                    ->example('Translation key saved: key')
            );
    }
}
</file>

<file path="application/libraries/Api/Rest/V1/SchemaFactory/SchemaFactoryI18nRefreshLanguages.php">
<?php
namespace LimeSurvey\Api\Rest\V1\SchemaFactory;
use GoldSpecDigital\ObjectOrientedOAS\Objects\Schema;
use GoldSpecDigital\ObjectOrientedOAS\Contracts\SchemaContract;
class SchemaFactoryI18NRefreshLanguages
{
    public function make(SchemaContract ...$properties): Schema
    {
        return Schema::create()
            ->title('I18nTranslations')
            ->description('Internationalization Translations')
            ->type(Schema::TYPE_OBJECT)
            ->additionalProperties(
                Schema::object()
                    ->properties(
                        Schema::string('description'),
                        Schema::string('nativedescription'),
                        Schema::boolean('rtl'),
                        Schema::integer('dateformat'),
                        Schema::integer('radixpoint'),
                        Schema::string('momentjs')
                    )
            );
    }
}
</file>

<file path="application/libraries/Api/Rest/V1/SchemaFactory/SchemaFactoryPermission.php">
<?php
namespace LimeSurvey\Api\Rest\V1\SchemaFactory;
use GoldSpecDigital\ObjectOrientedOAS\Objects\Schema;
use GoldSpecDigital\ObjectOrientedOAS\Contracts\SchemaContract;
class SchemaFactoryPermission
{
    public function make(SchemaContract ...$properties): Schema
    {
        return Schema::create()->title('Permission')
            ->description('Permission')
            ->type(Schema::TYPE_OBJECT)
            ->properties(
                Schema::boolean('create'),
                Schema::boolean('read'),
                Schema::boolean('update'),
                Schema::boolean('delete'),
                Schema::boolean('import'),
                Schema::boolean('export'),
            );
    }
}
</file>

<file path="application/libraries/Api/Rest/V1/SchemaFactory/SchemaFactoryQuestion.php">
<?php
namespace LimeSurvey\Api\Rest\V1\SchemaFactory;
use GoldSpecDigital\ObjectOrientedOAS\Objects\Schema;
use GoldSpecDigital\ObjectOrientedOAS\Contracts\SchemaContract;
class SchemaFactoryQuestion
{
    public function make(SchemaContract ...$properties): Schema
    {
        return Schema::create()
            ->title('Question')
            ->description('Question')
            ->type(Schema::TYPE_OBJECT)
            ->properties(
                Schema::integer('qid')->default(null),
                Schema::integer('parentQid')->default(0),
                Schema::integer('sid')->default(null),
                Schema::string('type')->default(null),
                Schema::string('title')->default(null),
                Schema::string('preg')->default(null),
                Schema::boolean('other')->default(null),
                Schema::boolean('mandatory')->default(null),
                Schema::boolean('encrypted')->default(null),
                Schema::integer('sortOrder')->default(0),
                Schema::integer('scaleId')->default(null),
                Schema::boolean('sameDefault')->default(null),
                Schema::boolean('mandatory')->default(null),
                Schema::string('questionThemeName')->default(null),
                Schema::string('moduleName')->default(null),
                Schema::integer('gid')->default(0),
                Schema::string('relevance')->default(null),
... (12 lines truncated)
</file>

<file path="application/libraries/Api/Rest/V1/SchemaFactory/SchemaFactoryQuestionAttribute.php">
<?php
namespace LimeSurvey\Api\Rest\V1\SchemaFactory;
use GoldSpecDigital\ObjectOrientedOAS\Objects\Schema;
class SchemaFactoryQuestionAttribute
{
    public function make($key = ''): Schema
    {
        return Schema::create($key)
            ->title('Question Attribute')
            ->description('Question Attribute')
            ->type(Schema::TYPE_OBJECT)
            ->properties(
                Schema::integer('qaid')->default(null),
                Schema::integer('attribute')->default(0),
                Schema::string('value')->default(null),
                Schema::string('language')->default('')
            );
    }
}
</file>

<file path="application/libraries/Api/Rest/V1/SchemaFactory/SchemaFactoryQuestionAttributes.php">
<?php
namespace LimeSurvey\Api\Rest\V1\SchemaFactory;
use GoldSpecDigital\ObjectOrientedOAS\Objects\Schema;
class SchemaFactoryQuestionAttributes
{
    public function make($key = '_attributeName'): Schema
    {
        return Schema::create($key)
            ->title('Question Attributes')
            ->description('Question Attributes')
            ->type(Schema::TYPE_OBJECT)
            ->properties(
                Schema::integer('qid'),
                (new SchemaFactoryQuestionAttribute())->make('_lang'),
                (new SchemaFactoryQuestionAttribute())->make('')
            );
    }
}
</file>

<file path="application/libraries/Api/Rest/V1/SchemaFactory/SchemaFactoryQuestionGroup.php">
<?php
namespace LimeSurvey\Api\Rest\V1\SchemaFactory;
use GoldSpecDigital\ObjectOrientedOAS\Objects\Schema;
use GoldSpecDigital\ObjectOrientedOAS\Contracts\SchemaContract;
class SchemaFactoryQuestionGroup
{
    public function make(SchemaContract ...$properties): Schema
    {
        return Schema::create()
            ->title('Question Group')
            ->description('Question Group')
            ->type(Schema::TYPE_OBJECT)
            ->properties(
                Schema::integer('gid')->default(null),
                Schema::integer('sid')->default(null),
                Schema::integer('groupOrder')->default(null),
                Schema::string('randomizationGroup')->default(null),
                Schema::string('gRelevance')->default(null),
                Schema::create('l10ns')
                    ->additionalProperties(
                        (new SchemaFactoryQuestionGroupL10ns())->make()
                    ),
                ...$properties
            );
    }
}
</file>

<file path="application/libraries/Api/Rest/V1/SchemaFactory/SchemaFactoryQuestionGroupL10ns.php">
<?php
namespace LimeSurvey\Api\Rest\V1\SchemaFactory;
use GoldSpecDigital\ObjectOrientedOAS\Objects\Schema;
class SchemaFactoryQuestionGroupL10ns
{
    public function make(): Schema
    {
        return Schema::create('$language')->properties(
            Schema::integer('id')->default(null),
            Schema::integer('gid')->default(null),
            Schema::integer('group_order')->default(null),
            Schema::string('groupName')->default(null),
            Schema::string('description')->default(null),
            Schema::string('language')->default(null)
        );
    }
}
</file>

<file path="application/libraries/Api/Rest/V1/SchemaFactory/SchemaFactoryQuestionL10ns.php">
<?php
namespace LimeSurvey\Api\Rest\V1\SchemaFactory;
use GoldSpecDigital\ObjectOrientedOAS\Objects\Schema;
class SchemaFactoryQuestionL10ns
{
    public function make(): Schema
    {
        return Schema::create('$language')->properties(
            Schema::integer('id')->default(null),
            Schema::integer('qid')->default(null),
            Schema::string('question')->default(null),
            Schema::string('script')->default(null),
            Schema::string('language')->default(null)
        );
    }
}
</file>

<file path="application/libraries/Api/Rest/V1/SchemaFactory/SchemaFactorySiteSettings.php">
<?php
namespace LimeSurvey\Api\Rest\V1\SchemaFactory;
use GoldSpecDigital\ObjectOrientedOAS\Objects\Schema;
use GoldSpecDigital\ObjectOrientedOAS\Contracts\SchemaContract;
class SchemaFactorySiteSettings
{
    public function make(SchemaContract ...$properties): Schema
    {
        return Schema::create()->title('Site Settings')
            ->description('Site Settings')
            ->type(Schema::TYPE_OBJECT)
            ->properties(
                Schema::string('siteName')->default(null),
                Schema::string('timezone')->default(null),
                Schema::integer('maximumFileUploadSize')->default(null),
            );
    }
}
</file>

<file path="application/libraries/Api/Rest/V1/SchemaFactory/SchemaFactorySurvey.php">
<?php
namespace LimeSurvey\Api\Rest\V1\SchemaFactory;
use GoldSpecDigital\ObjectOrientedOAS\Objects\Schema;
use GoldSpecDigital\ObjectOrientedOAS\Contracts\SchemaContract;
class SchemaFactorySurvey
{
    public function make(SchemaContract ...$properties): Schema
    {
        $schemaSurveyLanguageSettings = (new SchemaFactorySurveyLanguageSettings())->make();
        $schemaSurveyDefaultLanguage = Schema::object('defaultlanguage')
            ->properties(...$schemaSurveyLanguageSettings->properties);
        return Schema::create()
            ->title('Survey')
            ->description('Survey')
            ->type(Schema::TYPE_OBJECT)
            ->properties(
                Schema::integer('sid')->default(null),
                Schema::integer('gsid')->default(null),
                Schema::boolean('active')->default(false),
                Schema::boolean('expires')->default(null),
                Schema::boolean('startDate')->default(null),
                Schema::boolean('anonymized')->default(null),
                Schema::boolean('saveTimings')->default(null),
                Schema::boolean('datestamp')->default(null),
                Schema::boolean('useCookie')->default(null),
                Schema::boolean('allowRegister')->default(null),
                Schema::boolean('htmlEmail')->default(null),
                Schema::boolean('allowSave')->default(null),
                Schema::integer('autoNumberStart')->default(0),
                Schema::boolean('autoRedirect')->default(null),
... (46 lines truncated)
</file>

<file path="application/libraries/Api/Rest/V1/SchemaFactory/SchemaFactorySurveyArchive.php">
<?php
namespace LimeSurvey\Api\Rest\V1\SchemaFactory;
use GoldSpecDigital\ObjectOrientedOAS\Objects\Schema;
use GoldSpecDigital\ObjectOrientedOAS\Contracts\SchemaContract;
class SchemaFactorySurveyArchive
{
    public function make(SchemaContract ...$properties): Schema
    {
        return Schema::create()
            ->title('Survey')
            ->description('Survey')
            ->type(Schema::TYPE_OBJECT)
            ->properties(
                Schema::integer('timestamp'),
                Schema::integer('count')->default(0),
                Schema::boolean('newformat'),
                Schema::array('types'),
                Schema::boolean('hastokens'),
                ...$properties
            );
    }
}
</file>

<file path="application/libraries/Api/Rest/V1/SchemaFactory/SchemaFactorySurveyDetail.php">
<?php
namespace LimeSurvey\Api\Rest\V1\SchemaFactory;
use GoldSpecDigital\ObjectOrientedOAS\Objects\Schema;
use GoldSpecDigital\ObjectOrientedOAS\Objects\AllOf;
class SchemaFactorySurveyDetail
{
    public function make(): Schema
    {
        $questionAttributeSchemas = (new SchemaFactoryQuestionAttributes())->make();
        $answerSchema = (new SchemaFactoryAnswer())->make();
        $answersSchema = Schema::array('answers')->items(
            AllOf::create()->schemas(
                $answerSchema
            )
        );
        $questionSchema = (new SchemaFactoryQuestion())->make(
            $answersSchema,
            Schema::object('attributes')->properties(
                $questionAttributeSchemas
            )
        );
        $questionsSchema = Schema::array('questions')->items(
            $questionSchema
        );
        $questionGroupSchema = (new SchemaFactoryQuestionGroup())->make(
            $questionsSchema
        );
        $surveySchema = AllOf::create('survey')->schemas(
            (new SchemaFactorySurvey())->make(
                Schema::array('languages')->items(
... (19 lines truncated)
</file>

<file path="application/libraries/Api/Rest/V1/SchemaFactory/SchemaFactorySurveyGroup.php">
<?php
namespace LimeSurvey\Api\Rest\V1\SchemaFactory;
use GoldSpecDigital\ObjectOrientedOAS\Objects\Schema;
use GoldSpecDigital\ObjectOrientedOAS\Contracts\SchemaContract;
class SchemaFactorySurveyGroup
{
    public function make(SchemaContract ...$properties): Schema
    {
        return Schema::create()->title('Survey Group')
            ->description('Survey Group')
            ->type(Schema::TYPE_OBJECT)
            ->properties(
                Schema::integer('gsid')->default(null),
                Schema::string('name')->default(null),
                Schema::string('description')->default(null),
                Schema::string('title')->default(null),
                Schema::integer('sortOrder')->default(null),
                Schema::boolean('alwaysAvailable')->default(null),
            );
    }
}
</file>

<file path="application/libraries/Api/Rest/V1/SchemaFactory/SchemaFactorySurveyGroupList.php">
<?php
namespace LimeSurvey\Api\Rest\V1\SchemaFactory;
use GoldSpecDigital\ObjectOrientedOAS\Objects\Schema;
use GoldSpecDigital\ObjectOrientedOAS\Objects\AllOf;
class SchemaFactorySurveyGroupList
{
    public function make(): Schema
    {
        return Schema::create()
            ->title('Survey Group List')
            ->description('Survey Group List')
            ->type(Schema::TYPE_OBJECT)
            ->properties(
                Schema::array('surveyGroups')->items(
                    AllOf::create()->schemas(
                        (new SchemaFactorySurveyGroup())->make()
                    )
                )
            );
    }
}
</file>

<file path="application/libraries/Api/Rest/V1/SchemaFactory/SchemaFactorySurveyGroups.php">
<?php
namespace LimeSurvey\Api\Rest\V1\SchemaFactory;
use GoldSpecDigital\ObjectOrientedOAS\Objects\AllOf;
use GoldSpecDigital\ObjectOrientedOAS\Objects\Schema;
use GoldSpecDigital\ObjectOrientedOAS\Contracts\SchemaContract;
class SchemaFactorySurveyGroups
{
    public function make(SchemaContract ...$properties): Schema
    {
        return Schema::create()
            ->title('Survey groups')
            ->description('Survey groups')
            ->type(Schema::TYPE_OBJECT)
            ->properties(
                Schema::array('surveyGroups')->items(
                    AllOf::create()->schemas(
                        (new SchemaFactorySurveyGroup())->make()
                    )
                )
            );
    }
}
</file>

<file path="application/libraries/Api/Rest/V1/SchemaFactory/SchemaFactorySurveyLanguageSettings.php">
<?php
namespace LimeSurvey\Api\Rest\V1\SchemaFactory;
use GoldSpecDigital\ObjectOrientedOAS\Objects\Schema;
class SchemaFactorySurveyLanguageSettings
{
    public function make(): Schema
    {
        return Schema::create()
            ->title('Survey Language Settings')
            ->description('Survey Language Settings')
            ->type(Schema::TYPE_OBJECT)
            ->properties(
                Schema::integer('sid')->default(null),
                Schema::string('language')->default(null),
                Schema::string('title')->default(null),
                Schema::string('description')->default(null),
                Schema::string('welcomeText')->default(null),
                Schema::string('endText')->default(null),
                Schema::string('policyNotice')->default(null),
                Schema::string('policyError')->default(null),
                Schema::string('policyNoticeLabel')->default(null),
                Schema::string('url')->default(null),
                Schema::string('urlDescription')->default(null),
                Schema::integer('dateFormat')->default(null),
                Schema::integer('numberFormat')->default(null)
            );
    }
}
</file>

<file path="application/libraries/Api/Rest/V1/SchemaFactory/SchemaFactorySurveyList.php">
<?php
namespace LimeSurvey\Api\Rest\V1\SchemaFactory;
use GoldSpecDigital\ObjectOrientedOAS\Objects\Schema;
use GoldSpecDigital\ObjectOrientedOAS\Objects\AllOf;
class SchemaFactorySurveyList
{
    public function make(): Schema
    {
        return Schema::create()
            ->title('Survey List')
            ->description('Survey List')
            ->type(Schema::TYPE_OBJECT)
            ->properties(
                Schema::array('surveys')->items(
                    AllOf::create()->schemas(
                        (new SchemaFactorySurvey())->make()
                    )
                )
            );
    }
}
</file>

<file path="application/libraries/Api/Rest/V1/SchemaFactory/SchemaFactorySurveyLogic.php">
<?php
namespace LimeSurvey\Api\Rest\V1\SchemaFactory;
use GoldSpecDigital\ObjectOrientedOAS\Objects\Schema;
use GoldSpecDigital\ObjectOrientedOAS\Contracts\SchemaContract;
class SchemaFactorySurveyLogic
{
    public function make(SchemaContract ...$properties): Schema
    {
        $surveyLogicSchema = Schema::object('surveyLogic')
            ->properties(
                Schema::string('html')->description('Rendered survey logic overview HTML'),
                Schema::integer('errors')->default(0)->description('Total number of logic errors found')
            );
        return Schema::create()
            ->title('Survey Logic')
            ->description('Survey logic overview')
            ->type(Schema::TYPE_OBJECT)
            ->properties(
                $surveyLogicSchema,
                ...$properties
            );
    }
}
</file>

<file path="application/libraries/Api/Rest/V1/SchemaFactory/SchemaFactorySurveyPatch.php">
<?php
namespace LimeSurvey\Api\Rest\V1\SchemaFactory;
use GoldSpecDigital\ObjectOrientedOAS\Objects\{
    Schema,
    AllOf,
    AnyOf
};
class SchemaFactorySurveyPatch
{
    public function make(): Schema
    {
        $props = [
            Schema::array('patch')->items(
                AllOf::create()->schemas(
                    Schema::object()
                    ->properties(
                        Schema::string('entity')->enum(
                            'survey',
                            'languageSetting',
                            'questionGroup',
                            'questionGroupL10n',
                            'question',
                            'questionL10n',
                            'questionAnswer',
                            'questionAttribute'
                        ),
                        Schema::string('op')->enum(
                            'update',
                            'delete',
                            'create'
... (19 lines truncated)
</file>

<file path="application/libraries/Api/Rest/V1/SchemaFactory/SchemaFactorySurveyQuestionsFieldname.php">
<?php
namespace LimeSurvey\Api\Rest\V1\SchemaFactory;
use GoldSpecDigital\ObjectOrientedOAS\Objects\Schema;
class SchemaFactorySurveyQuestionsFieldname
{
    public function make(): Schema
    {
        $questionItemSchema = Schema::object()
            ->properties(
                Schema::string('fieldname'),
                Schema::integer('sid'),
                Schema::integer('gid'),
                Schema::integer('qid'),
                Schema::integer('sqid')->nullable(),
                Schema::string('aid')->nullable(),
                Schema::string('title'),
                Schema::integer('scale_id')->nullable(),
            );
        return Schema::create()
            ->title('Survey questions Fieldname')
            ->description('Survey questions with their fieldname and properties')
            ->type(Schema::TYPE_OBJECT)
            ->properties(
                Schema::object()->additionalProperties(
                    Schema::array()->items($questionItemSchema)
                )
            );
    }
}
</file>

<file path="application/libraries/Api/Rest/V1/SchemaFactory/SchemaFactorySurveyResponses.php">
<?php
namespace LimeSurvey\Api\Rest\V1\SchemaFactory;
use GoldSpecDigital\ObjectOrientedOAS\Objects\Schema;
class SchemaFactorySurveyResponses
{
    public function make(): Schema
    {
        $surveyQuestionSchema = Schema::object()
            ->properties(
                Schema::integer('gid')->example(696),
                Schema::integer('qid')->example(14781),
                Schema::string('aid')->example(''),
                Schema::integer('sqid')->nullable()->example(null)
            );
        $responseSchema = (new SchemaFactorySurveySingleResponse())->make();
        $paginationSchema = Schema::object('pagination')
            ->properties(
                Schema::integer('pageSize')->example(15),
                Schema::integer('currentPage')->example(0),
                Schema::integer('totalItems')->example(3),
                Schema::integer('totalPages')->example(1)
            );
        $metaSchema = Schema::object('_meta')
            ->properties(
                $paginationSchema,
                Schema::array('filters')->items(Schema::object()),
                Schema::array('sort')->items(Schema::object())
            );
        return Schema::create()
            ->title('Survey Responses')
... (36 lines truncated)
</file>

<file path="application/libraries/Api/Rest/V1/SchemaFactory/SchemaFactorySurveyResponsesExport.php">
<?php
namespace LimeSurvey\Libraries\Api\Rest\V1\SchemaFactory;
use GoldSpecDigital\ObjectOrientedOAS\Objects\Schema;
class SchemaFactorySurveyResponsesExport
{
    public function make(): Schema
    {
        return Schema::create()
            ->title('Survey Responses Export')
            ->description('Survey Responses Export')
            ->type(Schema::TYPE_STRING)
            ->format(Schema::FORMAT_BINARY);
    }
}
</file>

<file path="application/libraries/Api/Rest/V1/SchemaFactory/SchemaFactorySurveyResponsesPatch.php">
<?php
namespace LimeSurvey\Api\Rest\V1\SchemaFactory;
use GoldSpecDigital\ObjectOrientedOAS\Objects\Schema;
class SchemaFactorySurveyResponsesPatch
{
    public function make(): Schema
    {
        return Schema::create()
            ->title('Survey Responses Patch Result')
            ->description('Result of applying patch operations to survey responses')
            ->type(Schema::TYPE_OBJECT)
            ->properties(
                Schema::integer('operationsApplied')
                    ->description('Number of operations successfully applied')
                    ->example(1),
                Schema::array('validationErrors')
                    ->description('List of validation errors encountered')
                    ->nullable()
                    ->items(
                        Schema::object()
                            ->properties(
                                Schema::string('entity')->example('response'),
                                Schema::string('op')->example('update'),
                                Schema::string('id')->example('12345'),
                                Schema::array('errors')
                                    ->items(
                                        Schema::object()
                                            ->properties(
                                                Schema::string('field')->example('answers.896595X696X14781.value'),
                                                Schema::string('message')->example('Value is required')
... (24 lines truncated)
</file>

<file path="application/libraries/Api/Rest/V1/SchemaFactory/SchemaFactorySurveySingleResponse.php">
<?php
namespace LimeSurvey\Api\Rest\V1\SchemaFactory;
use GoldSpecDigital\ObjectOrientedOAS\Objects\Schema;
class SchemaFactorySurveySingleResponse
{
    public function make(): Schema
    {
        $answerSchema = Schema::object()
            ->properties(
                Schema::string('key')->example('896595X696X14781'),
                Schema::string('id')->example('14781'),
                Schema::integer('gid')->example(696),
                Schema::string('sid')->example('896595'),
                Schema::string('value')->example('Long text answer'),
                Schema::integer('qid')->example(14781),
                Schema::string('aid')->example(''),
                Schema::integer('sqid')->nullable()->example(null)
            );
        return Schema::create()
            ->title('Survey Single Response')
            ->description('Survey Single Response')
            ->type(Schema::TYPE_OBJECT)
            ->properties(
                Schema::integer('id')->example(1),
                Schema::string('language')->example('en'),
                Schema::string('seed')->example('1600554114'),
                Schema::integer('lastPage')->example(1),
                Schema::string('submitDate')->format(Schema::FORMAT_DATE_TIME)->example('2025-06-12T08:19:23.000Z'),
                Schema::string('startDate')->example('2025-06-12 08:19:01'),
                Schema::string('dateLastAction')->example('2025-06-12 08:19:23'),
... (31 lines truncated)
</file>

<file path="application/libraries/Api/Rest/V1/SchemaFactory/SchemaFactorySurveyStatistics.php">
<?php
namespace LimeSurvey\Libraries\Api\Rest\V1\SchemaFactory;
use GoldSpecDigital\ObjectOrientedOAS\Objects\Schema;
use GoldSpecDigital\ObjectOrientedOAS\Contracts\SchemaContract;
class SchemaFactorySurveyStatistics
{
    public function make(SchemaContract ...$properties): Schema
    {
        $chartDataPoint = Schema::object()
            ->properties(
                Schema::string('key')->description('Unique identifier for the data point'),
                Schema::string('title')->description('Display title for the data point'),
                Schema::integer('value')->description('Numeric value/count for the data point')
            );
        $statisticsItemSchema = Schema::object()
            ->properties(
                Schema::string('title')->description('Title of the statistics item'),
                Schema::array('legend')
                    ->items(Schema::string())
                    ->description('Labels for the data points'),
                Schema::array('data')
                    ->items($chartDataPoint)
                    ->description('Statistical data points'),
                Schema::integer('total')
                    ->description('Total count if applicable')
                    ->nullable(),
                Schema::object('meta')
                    ->description('Additional metadata about the statistics')
            );
        return Schema::create()
... (12 lines truncated)
</file>

<file path="application/libraries/Api/Rest/V1/SchemaFactory/SchemaFactorySurveyStatisticsGlance.php">
<?php
namespace LimeSurvey\Api\Rest\V1\SchemaFactory;
use GoldSpecDigital\ObjectOrientedOAS\Objects\Schema;
use GoldSpecDigital\ObjectOrientedOAS\Contracts\SchemaContract;
class SchemaFactorySurveyStatisticsGlance
{
    public function make(SchemaContract ...$properties): Schema
    {
        $statisticsSchema = Schema::object('statistics')
            ->properties(
                Schema::integer('totalResponses')->default(0),
                Schema::integer('incompleteResponses')->default(0),
                Schema::string('completionRate')->default('0.00'),
                Schema::string('avgCompletionTime')->default('0.0000')
            );
        return Schema::create()
            ->title('Survey Statistics Overview')
            ->description('Survey Statistics Overview')
            ->type(Schema::TYPE_OBJECT)
            ->properties(
                $statisticsSchema,
                ...$properties
            );
    }
}
</file>

<file path="application/libraries/Api/Rest/V1/SchemaFactory/SchemaFactorySurveyStatisticsOverview.php">
<?php
namespace LimeSurvey\Api\Rest\V1\SchemaFactory;
use GoldSpecDigital\ObjectOrientedOAS\Objects\Schema;
use GoldSpecDigital\ObjectOrientedOAS\Contracts\SchemaContract;
class SchemaFactorySurveyStatisticsOverview
{
    public function make(SchemaContract ...$properties): Schema
    {
        $statisticsSchema = Schema::object('statistics')
            ->properties(
                Schema::integer('totalResponses')->default(0),
                Schema::integer('incompleteResponses')->default(0),
                Schema::string('completionRate')->default('0.00'),
                Schema::string('avgCompletionTime')->default('0.0000')
            );
        $dailyActivityItemSchema = Schema::object()
            ->properties(
                Schema::string('key')->format(Schema::FORMAT_DATE),
                Schema::string('title')->format(Schema::FORMAT_DATE),
                Schema::integer('value')->default(0)
            );
        $dailyActivitySchema = Schema::array('dailyActivity')
            ->items($dailyActivityItemSchema);
        $responsesSchema = Schema::array('responses')
            ->items((new SchemaFactorySurveySingleResponse())->make());
        $overviewSchema = Schema::object('overview')
            ->properties(
                $statisticsSchema,
                $dailyActivitySchema,
                $responsesSchema
... (12 lines truncated)
</file>

<file path="application/libraries/Api/Rest/V1/SchemaFactory/SchemaFactorySurveyTemplate.php">
<?php
namespace LimeSurvey\Api\Rest\V1\SchemaFactory;
use GoldSpecDigital\ObjectOrientedOAS\Objects\Schema;
use GoldSpecDigital\ObjectOrientedOAS\Objects\AllOf;
class SchemaFactorySurveyTemplate
{
    public function make(): Schema
    {
        $questionAttributeSchemas = (new SchemaFactoryQuestionAttributes())->make();
        $answerSchema = (new SchemaFactoryAnswer())->make();
        $answersSchema = Schema::array('answers')->items(
            AllOf::create()->schemas(
                $answerSchema
            )
        );
        $questionSchema = (new SchemaFactoryQuestion())->make(
            $answersSchema,
            Schema::object('attributes')->properties(
                $questionAttributeSchemas
            )
        );
        $questionsSchema = Schema::array('questions')->items(
            $questionSchema
        );
        $questionGroupSchema = (new SchemaFactoryQuestionGroup())->make(
            $questionsSchema
        );
        $surveySchema = AllOf::create('survey')->schemas(
            (new SchemaFactorySurvey())->make(
                Schema::array('languages')->items(
... (19 lines truncated)
</file>

<file path="application/libraries/Api/Rest/V1/SchemaFactory/SchemaFactoryUser.php">
<?php
namespace LimeSurvey\Api\Rest\V1\SchemaFactory;
use GoldSpecDigital\ObjectOrientedOAS\Objects\Schema;
use GoldSpecDigital\ObjectOrientedOAS\Contracts\SchemaContract;
class SchemaFactoryUser
{
    public function make(SchemaContract ...$properties): Schema
    {
        return Schema::create()->title('User')
            ->description('User')
            ->type(Schema::TYPE_OBJECT)
            ->properties(
                Schema::integer('uid')->default(null),
                Schema::string('name')->default(null),
                Schema::string('fullName')->default(null),
                Schema::integer('parentId')->default(null),
                Schema::string('lang')->default(null),
                Schema::string('email')->default(null),
                Schema::string('htmlEditorMode')->default(null),
                Schema::string('templateEditorMode')->default(null),
                Schema::string('questionSelectorMode')->default(null),
                Schema::integer('dateFormat')->default(null),
                Schema::string('lastLogin')->default(null),
                Schema::string('created')->default(null),
                Schema::string('modified')->default(null),
                Schema::integer('userStatus')->default(null),
            );
    }
}
</file>

<file path="application/libraries/Api/Rest/V1/SchemaFactory/SchemaFactoryUserList.php">
<?php
namespace LimeSurvey\Api\Rest\V1\SchemaFactory;
use GoldSpecDigital\ObjectOrientedOAS\Objects\Schema;
use GoldSpecDigital\ObjectOrientedOAS\Objects\AllOf;
class SchemaFactoryUserList
{
    public function make(): Schema
    {
        return Schema::create()
            ->title('User List')
            ->description('User List')
            ->type(Schema::TYPE_OBJECT)
            ->properties(
                Schema::array('users')->items(
                    AllOf::create()->schemas(
                        (new SchemaFactoryUser())->make()
                    )
                )
            );
    }
}
</file>

<file path="application/libraries/Api/Rest/V1/SchemaFactory/SchemaFactoryUserPermission.php">
<?php
namespace LimeSurvey\Api\Rest\V1\SchemaFactory;
use GoldSpecDigital\ObjectOrientedOAS\Objects\AllOf;
use GoldSpecDigital\ObjectOrientedOAS\Objects\Schema;
use GoldSpecDigital\ObjectOrientedOAS\Contracts\SchemaContract;
class SchemaFactoryUserPermission
{
    public function make(SchemaContract ...$properties): Schema
    {
        $aGlobalPermissions = [
            'participantpanel',
            'labelsets',
            'settings',
            'surveysgroups',
            'surveys',
            'templates',
            'usergroups',
            'users',
            'superadmin',
            'auth_db'
        ];
        $aSurveyPermissions = [
            'assessments',
            'quotas',
            'statistics',
            'survey',
            'surveyactivation',
            'surveycontent',
            'surveylocale',
            'surveysecurity',
... (31 lines truncated)
</file>

<file path="application/libraries/Api/Rest/V1/SchemaFactory/SchemaFactoryUserSetting.php">
<?php
namespace LimeSurvey\Api\Rest\V1\SchemaFactory;
use GoldSpecDigital\ObjectOrientedOAS\Objects\Schema;
use GoldSpecDigital\ObjectOrientedOAS\Contracts\SchemaContract;
class SchemaFactoryUserSetting
{
    public function make(SchemaContract ...$properties): Schema
    {
        return Schema::create()->title('Settings user')
            ->description('Settings user')
            ->type(Schema::TYPE_OBJECT)
            ->properties(
                Schema::string('settingName')->default(null),
            );
    }
}
</file>

<file path="application/libraries/Api/Rest/V1/SchemaFactory/SchemaFactoryVersionInfo.php">
<?php
namespace LimeSurvey\Libraries\Api\Rest\V1\SchemaFactory;
use GoldSpecDigital\ObjectOrientedOAS\Objects\Schema;
use GoldSpecDigital\ObjectOrientedOAS\Contracts\SchemaContract;
class SchemaFactoryVersionInfo
{
    public function make(SchemaContract ...$properties): Schema
    {
        return Schema::create()->title('Version Info')
            ->description('Version Info')
            ->type(Schema::TYPE_OBJECT)
            ->properties(
                Schema::string('dbVersion')->default(null),
                Schema::string('assetsVersionNumber')->default(null),
                Schema::boolean('needsDbUpdate')->default(null),
            );
    }
}
</file>

<file path="application/libraries/Api/Rest/V1/RestRendererV1.php">
<?php
namespace LimeSurvey\Api\Rest\V1;
use LimeSurvey\Api\Rest\Renderer\RendererBasic;
class RestRendererV1 extends RendererBasic
{
}
</file>

<file path="application/libraries/Api/Rest/Endpoint.php">
<?php
namespace LimeSurvey\Api\Rest;
use LimeSurvey\Api\Rest\Renderer\RendererBasic;
use LimeSurvey\Api\Command\{
    CommandInterface,
    Response\ResponseFactory,
    Request\Request
};
use LimeSurvey\Api\Authentication\{
    AuthenticationInterface,
    AuthenticationTokenSimple
};
use LimeSurvey\Api\Rest\Renderer\RendererInterface;
use Psr\Container\ContainerInterface;
class Endpoint
{
    protected $config = [];
    protected $commandParams = [];
    protected ResponseFactory $responseFactory;
    protected ContainerInterface $diContainer;
    public function __construct(
        $config,
        $commandParams,
        ResponseFactory $responseFactory,
        ContainerInterface $diContainer
    ) {
        $this->config = $config;
        $this->commandParams = $commandParams;
        $this->responseFactory = $responseFactory;
        $this->diContainer = $diContainer;
... (50 lines truncated)
</file>

<file path="application/libraries/Api/Rest/RestConfig.php">
<?php
namespace LimeSurvey\Api\Rest;
use LimeSurvey\Api\ApiConfig;
use Yii;
class RestConfig extends ApiConfig
{
    public function __construct()
    {
        $yiiRestConfig = Yii::app()->getConfig('rest');
        $this->setConfig($yiiRestConfig);
    }
}
</file>

<file path="application/libraries/Api/Transformer/Filter/Filter.php">
<?php
namespace LimeSurvey\Api\Transformer\Filter;
class Filter
{
    private string $filter = '';
    private $filterParams = [];
    public function filter($value, $config)
    {
        $this->filterParams = [];
        if (is_array($config) && !empty($config)) {
            $this->filter = strval(array_key_first($config));
            $this->filterParams = $config[$this->filter];
        } elseif (is_string($config) && !empty($config)) {
            $this->filter = $config;
        }
        $filteredValue = false;
        if (is_callable($this->filter)) {
            array_unshift($this->filterParams, $value);
            $filteredValue = call_user_func_array($this->filter, $this->filterParams);
        }
        return $filteredValue !== false ? $filteredValue : $value;
    }
}
</file>

<file path="application/libraries/Api/Transformer/Formatter/FormatterDateTimeToJson.php">
<?php
namespace LimeSurvey\Api\Transformer\Formatter;
class FormatterDateTimeToJson implements FormatterInterface
{
    public function format($value, $config = [], $options = [])
    {
        $revert = array_key_exists(
            'revert',
            $config
        ) ? $config['revert'] : false;
        return $revert
            ? $this->revert($value, $config)
            : $this->apply($value, $config);
    }
    protected function apply($value, array $config)
    {
        $inputTimezone = array_key_exists(
            'inputTimezone',
            $config
        ) ? $config['inputTimezone'] : date_default_timezone_get();
        return $this->dateFormat(
            $value,
            $inputTimezone,
            'UTC',
            'Y-m-d\TH:i:s.000\Z',
            $config
        );
    }
    protected function revert($value, array $config)
    {
... (42 lines truncated)
</file>

<file path="application/libraries/Api/Transformer/Formatter/FormatterInterface.php">
<?php
namespace LimeSurvey\Api\Transformer\Formatter;
interface FormatterInterface
{
    public function format($value, $config = [], $options = []);
}
</file>

<file path="application/libraries/Api/Transformer/Formatter/FormatterIntToBool.php">
<?php
namespace LimeSurvey\Api\Transformer\Formatter;
class FormatterIntToBool implements FormatterInterface
{
    public function format($value, $config = [], $options = [])
    {
        $revert = array_key_exists(
            'revert',
            $config
        ) ? $config['revert'] : false;
        return $revert
            ? $this->revert($value)
            : $this->apply($value);
    }
    protected function apply($value)
    {
        if ($value === null || $value === '') {
            return null;
        }
        return !is_numeric($value) && !empty($value)
            ? true
            : intval($value) > 0;
    }
    /**
     * Cast boolean to int
     *
     * Converts true'y to 1.
     * Converts false'y to 0.
     * Converts empty string to null.
     * Null is passed through unchanged.
... (11 lines truncated)
</file>

<file path="application/libraries/Api/Transformer/Formatter/FormatterMandatory.php">
<?php
namespace LimeSurvey\Api\Transformer\Formatter;
class FormatterMandatory extends FormatterYnToBool
{
    protected function apply($value)
    {
        $lowercase = is_string($value)
            ? strtolower($value)
            : $value;
        if (
            $value === null
            || $value === ''
            || !in_array($lowercase, ['y', 'n', 's'])
        ) {
            return null;
        }
        return $lowercase === 's' ? 'S' : $lowercase === 'y';
    }
    protected function revert($value, array $config = [])
    {
        if ($value !== 'S') {
            $value = parent::revert($value, $config);
        }
        return $value;
    }
}
</file>

<file path="application/libraries/Api/Transformer/Formatter/FormatterYnToBool.php">
<?php
namespace LimeSurvey\Api\Transformer\Formatter;
class FormatterYnToBool implements FormatterInterface
{
    public function format($value, $config = [], $options = [])
    {
        $revert = array_key_exists(
            'revert',
            $config
        ) ? $config['revert'] : false;
        return $revert
            ? $this->revert($value, $config)
            : $this->apply($value);
    }
    protected function apply($value)
    {
        $lowercase = is_string($value)
            ? strtolower($value)
            : $value;
        if (
            $value === null
            || $value === ''
            || !in_array($lowercase, ['y', 'n'])
        ) {
            return null;
        }
        return $lowercase === 'y';
    }
    protected function revert($value, array $config = [])
    {
... (14 lines truncated)
</file>

<file path="application/libraries/Api/Transformer/Output/TransformerOutputActiveRecord.php">
<?php
namespace LimeSurvey\Api\Transformer\Output;
use CActiveRecord;
use LimeSurvey\Api\Transformer\Transformer;
abstract class TransformerOutputActiveRecord extends Transformer
{
    public function transform($data, $options = [])
    {
        $options = $options ?? [];
        return parent::transform(
            $data instanceof CActiveRecord
            ? $data->attributes
            : $data,
            $options
        );
    }
}
</file>

<file path="application/libraries/Api/Transformer/Registry/Registry.php">
<?php
namespace LimeSurvey\Api\Transformer\Registry;
use LimeSurvey\Api\Transformer\{
    Filter\Filter,
    Formatter\FormatterDateTimeToJson,
    Formatter\FormatterIntToBool,
    Formatter\FormatterMandatory,
    Formatter\FormatterYnToBool,
    Validator\ValidatorDate,
    Validator\ValidatorEmpty,
    Validator\ValidatorLength,
    Validator\ValidatorNull,
    Validator\ValidatorNumerical,
    Validator\ValidatorRange,
    Validator\ValidatorRegex,
    Validator\ValidatorRequired,
};
class Registry
{
    private array $validators;
    private array $formatters;
    private array $filters;
    public function __construct()
    {
        $this->validators = [];
        $this->formatters = [];
        $this->filters = [];
        $this->initDefault();
    }
    public function setValidator($key, $value): void
... (54 lines truncated)
</file>

<file path="application/libraries/Api/Transformer/Validator/ValidatorDate.php">
<?php
namespace LimeSurvey\Api\Transformer\Validator;
class ValidatorDate implements ValidatorInterface
{
    private string $name = 'date';
    public function validate($key, $value, $config, $data, $options = [])
    {
        $config[$this->name] = $this->normaliseConfigValue($config);
        $messages = [];
        if ($config[$this->name] !== false && !empty($value)) {
            $complete = '^\d{4}-\d{2}-\d{2}(T|\s)\d{2}:\d{2}:\d{2}(\.\d+)?Z?$';
            $noSec = '^\d{4}-\d{2}-\d{2}(T|\s)\d{2}:\d{2}$';
            $noTime = '^\d{4}-\d{2}-\d{2}$';
            $regex = "/($complete)|($noSec)|($noTime)/";
            $regexValidator = new ValidatorRegex();
            $result = $regexValidator->validateByPattern($regex, $value);
            if (is_string($result)) {
                $messages[] = $result;
            }
        }
        return empty($messages) ? true : $messages;
    }
    public function normaliseConfigValue($config)
    {
        $key = array_search($this->name, $config, true);
        if (is_int($key)) {
            $config[$this->name] = true;
        }
        return $config[$this->name] ?? false;
    }
... (2 lines truncated)
</file>

<file path="application/libraries/Api/Transformer/Validator/ValidatorEmpty.php">
<?php
namespace LimeSurvey\Api\Transformer\Validator;
class ValidatorEmpty implements ValidatorInterface
{
    private string $name = 'empty';
    public function validate($key, $value, $config, $data, $options = [])
    {
        $config[$this->name] = $this->normaliseConfigValue($config);
        $messages = [];
        if (empty($value) && $config[$this->name] === false) {
            $messages[] = $key . ' cannot be empty';
        }
        return empty($messages) ? true : $messages;
    }
    public function normaliseConfigValue($config)
    {
        return !isset($config[$this->name]) || $config[$this->name];
    }
}
</file>

<file path="application/libraries/Api/Transformer/Validator/ValidatorInterface.php">
<?php
namespace LimeSurvey\Api\Transformer\Validator;
interface ValidatorInterface
{
    public function validate($key, $value, $config, $data, $options = []);
}
</file>

<file path="application/libraries/Api/Transformer/Validator/ValidatorLength.php">
<?php
namespace LimeSurvey\Api\Transformer\Validator;
class ValidatorLength implements ValidatorInterface
{
    private string $name = 'length';
    public function validate($key, $value, $config, $data, $options = [])
    {
        $config[$this->name] = $this->normaliseConfigValue($config);
        $messages = [];
        if (is_array($config[$this->name])) {
            $length = $this->getLengthOfValue($value, $config);
            $min = $this->getMin($config);
            $max = $this->getMax($config, $length);
            if ($length < $min || $length > $max) {
                $messages[] = $key . ' length must be between ' . $min .
                    ' and ' . $max . '.';
            }
        }
        return empty($messages) ? true : $messages;
    }
    private function getLengthOfValue($value, $config)
    {
        return is_string($value) ? strlen($value) : $this->getMin($config);
    }
    private function getMin($config)
    {
        return is_array($config[$this->name]) && array_key_exists(
            'min',
            $config[$this->name]
        ) ? (int)$config[$this->name]['min'] : 0;
... (14 lines truncated)
</file>

<file path="application/libraries/Api/Transformer/Validator/ValidatorNull.php">
<?php
namespace LimeSurvey\Api\Transformer\Validator;
class ValidatorNull implements ValidatorInterface
{
    private string $name = 'null';
    public function validate($key, $value, $config, $data, $options = [])
    {
        $config[$this->name] = $this->normaliseConfigValue($config);
        $messages = [];
        if ($value === null && $config[$this->name] === false) {
            $messages[] = $key . ' cannot be null';
        }
        return empty($messages) ? true : $messages;
    }
    public function normaliseConfigValue($config)
    {
        return !isset($config[$this->name]) || $config[$this->name];
    }
}
</file>

<file path="application/libraries/Api/Transformer/Validator/ValidatorNumerical.php">
<?php
namespace LimeSurvey\Api\Transformer\Validator;
class ValidatorNumerical implements ValidatorInterface
{
    private string $name = 'numerical';
    public function validate($key, $value, $config, $data, $options = [])
    {
        $config[$this->name] = $this->normaliseConfigValue($config);
        $messages = [];
        $validate = ($config[$this->name] == true
                || is_array($config[$this->name]))
            && $value !== null;
        if ($validate) {
            if (is_numeric($value)) {
                $min = $this->getMin($config);
                $max = $this->getMax($config);
                $minValid = $min === false || $value >= $min;
                $maxValid = $max === false || $value <= $max;
                if (!$minValid && !$maxValid) {
                    $messages[] = $key . ' must be between ' . $min . ' and ' .
                        $max . '.';
                } elseif (!$minValid) {
                    $messages[] = $key . ' must be higher than ' . $min . '.';
                } elseif (!$maxValid) {
                    $messages[] = $key . ' must be lower than ' . $max . '.';
                }
            } else {
                $messages[] = $key . ' must be numeric.';
            }
        }
... (26 lines truncated)
</file>

<file path="application/libraries/Api/Transformer/Validator/ValidatorRange.php">
<?php
namespace LimeSurvey\Api\Transformer\Validator;
class ValidatorRange implements ValidatorInterface
{
    private string $name = 'range';
    public function validate($key, $value, $config, $data, $options = [])
    {
        $config[$this->name] = $this->normaliseConfigValue($config);
        $messages = [];
        if ($config[$this->name] !== false && !empty($value)) {
            $range = $this->getRange($config);
            if (!empty($range)) {
                if (!in_array($value, $range, true)) {
                    $messages[] = $value . ' is not in the list.';
                }
            }
        }
        return empty($messages) ? true : $messages;
    }
    private function getRange($config)
    {
        return is_array($config[$this->name]) ? $config[$this->name] : [];
    }
    public function normaliseConfigValue($config)
    {
        return $config[$this->name] ?? false;
    }
}
</file>

<file path="application/libraries/Api/Transformer/Validator/ValidatorRegex.php">
<?php
namespace LimeSurvey\Api\Transformer\Validator;
class ValidatorRegex implements ValidatorInterface
{
    private string $name = 'pattern';
    public function validate($key, $value, $config, $data, $options = [])
    {
        $messages = [];
        $config[$this->name] = $this->normaliseConfigValue($config);
        if ($config[$this->name] !== false && !empty($value)) {
            $result = $this->validateByPattern($config[$this->name], $value);
            if (is_string($result)) {
                $messages[] = $result;
            }
        }
        return empty($messages) ? true : $messages;
    }
    public function validateByPattern($pattern, $value)
    {
        if ($pattern === '') {
            return "Invalid pattern provided for validation.";
        }
        $matched = true;
        $match = preg_match($pattern, $value);
        if ($match !== 1) {
            $matched = $value . " doesn't match expected pattern.";
        }
        return $matched;
    }
    public function normaliseConfigValue($config)
... (5 lines truncated)
</file>

<file path="application/libraries/Api/Transformer/Validator/ValidatorRequired.php">
<?php
namespace LimeSurvey\Api\Transformer\Validator;
class ValidatorRequired implements ValidatorInterface
{
    private string $name = 'required';
    public function validate($key, $value, $config, $data, $options = [])
    {
        $config[$this->name] = $this->normaliseConfigValue($config, $options);
        $messages = [];
        if (
            $config[$this->name]
            && !array_key_exists($key, $data)
        ) {
            $messages[] = $key . ' is required';
        }
        return empty($messages) ? true : $messages;
    }
    public function normaliseConfigValue($config, $options = [])
    {
        $key = array_search($this->name, $config, true);
        if (is_int($key)) {
            $config[$this->name] = true;
        }
        if (isset($config[$this->name])) {
            if (
                isset($options['operation'])
                && (
                    is_string($config[$this->name])
                    || is_array($config[$this->name])
                )
... (23 lines truncated)
</file>

<file path="application/libraries/Api/Transformer/Transformer.php">
<?php
namespace LimeSurvey\Api\Transformer;
use LimeSurvey\Api\Transformer\Filter\Filter;
use LimeSurvey\Api\Transformer\Formatter\FormatterInterface;
use LimeSurvey\Api\Transformer\Registry\Registry;
use LimeSurvey\Api\Transformer\Validator\ValidatorInterface;
use LimeSurvey\Api\Transformer\Validator\ValidatorRequired;
class Transformer implements TransformerInterface
{
    protected $dataMap = [];
    protected $defaultConfig = [];
    public $registry;
    public function transform($data, $options = [])
    {
        $data = $data ?? [];
        $options = $options ?? [];
        $dataMap = $this->getDataMap();
        $output = null;
        foreach ($dataMap as $key => $config) {
            if (!$config) {
                continue;
            }
            $config = $this->normaliseConfig(
                $config,
                $key,
                $options
            );
            $valueIsSet = array_key_exists($key, $data);
            $value = $data[$key] ?? null;
            if (is_null($value) && isset($config['default'])) {
... (228 lines truncated)
</file>

<file path="application/libraries/Api/Transformer/TransformerException.php">
<?php
namespace LimeSurvey\Api\Transformer;
use LimeSurvey\Api\ApiException;
class TransformerException extends ApiException
{
}
</file>

<file path="application/libraries/Api/Transformer/TransformerInterface.php">
<?php
namespace LimeSurvey\Api\Transformer;
interface TransformerInterface
{
    public function transform($data, $options = []);
    public function transformAll($collection, $options = []);
    public function validate($data, $options = []);
    public function validateAll($collection, $options = []);
}
</file>

<file path="application/libraries/Api/ApiConfig.php">
<?php
namespace LimeSurvey\Api;
class ApiConfig
{
    private $config = [];
    public function __construct(&$config = [])
    {
        $this->config = &$config;
    }
    public function &getConfig()
    {
        return $this->config;
    }
    public function setConfig(&$config)
    {
        $this->config = &$config;
    }
    public function setPath($path, $value)
    {
        $pathElements = explode('.', $path);
        $field = array_pop($pathElements);
        $parent = &$this->getPath(
            implode('.', $pathElements),
            true
        );
        $parent[$field] = $value;
    }
    public function &getPath($path, $createParents = false)
    {
        $result = &$this->pathReducer(
... (28 lines truncated)
</file>

<file path="application/libraries/Api/ApiException.php">
<?php
namespace LimeSurvey\Api;
class ApiException extends \Exception
{
}
</file>

<file path="application/libraries/ExtensionInstaller/ExtensionInstaller.php">
<?php
namespace LimeSurvey\ExtensionInstaller;
use Exception;
use InvalidArgumentException;
use ExtensionConfig;
abstract class ExtensionInstaller
{
    protected $fileFetcher;
    public function setFileFetcher(FileFetcher $fileFetcher)
    {
        $this->fileFetcher = $fileFetcher;
    }
    public function fetchFiles()
    {
        if (empty($this->fileFetcher)) {
            throw new InvalidArgumentException('fileFetcher is not set');
        }
        $this->fileFetcher->fetch();
    }
    public function getConfig()
    {
        if ($this->fileFetcher) {
            return $this->fileFetcher->getConfig();
        } else {
            return null;
        }
    }
    abstract public function install();
    abstract public function update();
    abstract public function uninstall();
... (8 lines truncated)
</file>

<file path="application/libraries/ExtensionInstaller/ExtensionUpdater.php">
<?php
namespace LimeSurvey\ExtensionInstaller;
use Exception;
use ExtensionConfig;
use Yii;
abstract class ExtensionUpdater
{
    protected $model = null;
    protected $useStable = true;
    protected $useUnstable = false;
    public function __construct($model)
    {
        $this->model = $model;
    }
    public function setUseUnstable()
    {
        $this->useUnstable = true;
    }
    public function versionHigherThan($newVersion)
    {
        return version_compare($newVersion, $this->getCurrentVersion(), '>');
    }
    public function versionIsStable($version)
    {
        if (empty($version)) {
            return false;
        }
        $suffixes = [
            'alpha',
            'beta',
... (126 lines truncated)
</file>

<file path="application/libraries/ExtensionInstaller/ExtensionUpdaterServiceLocator.php">
<?php
namespace LimeSurvey\ExtensionInstaller;
class ExtensionUpdaterServiceLocator
{
    protected $updaters = [];
    public function init()
    {
        $this->addUpdaterType(
            'plugin',
            function () {
                return PluginUpdater::createUpdaters();
            }
        );
        $this->addUpdaterType(
            'theme',
            function () {
                return ThemeUpdater::createUpdaters();
            }
        );
    }
    public function addUpdaterType(string $name, callable $creator)
    {
        if (isset($this->updaters[$name])) {
            throw new \Exception("Extension installer with name $name already exists");
        }
        $this->updaters[$name] = $creator;
    }
    public function getUpdater(string $name)
    {
        if (isset($this->updaters[$name])) {
... (23 lines truncated)
</file>

<file path="application/libraries/ExtensionInstaller/FileFetcher.php">
<?php
namespace LimeSurvey\ExtensionInstaller;
use Exception;
use ExtensionConfig;
abstract class FileFetcher
{
    abstract public function setSource($source);
    abstract public function fetch();
    abstract public function move($destdir);
    abstract public function getConfig();
    abstract public function abort();
}
</file>

<file path="application/libraries/ExtensionInstaller/FileFetcherUploadZip.php">
<?php
namespace LimeSurvey\ExtensionInstaller;
use Exception;
use InvalidArgumentException;
use ExtensionConfig;
use RecursiveDirectoryIterator;
use RecursiveIteratorIterator;
class FileFetcherUploadZip extends FileFetcher
{
    protected $filterName;
    public function setSource($source)
    {
    }
    public function fetch()
    {
        $this->checkFileSizeError();
        $this->abort();
        $this->extractZipFile($this->getTempdir());
    }
    public function move($destdir)
    {
        if (empty($destdir)) {
            throw new InvalidArgumentException('Missing destdir argument');
        }
        $tempdir = $this->getTempdir();
        if (empty($tempdir)) {
            throw new Exception(gT('Temporary folder cannot be determined.'));
        }
        if (!file_exists($tempdir)) {
            throw new Exception(gT('Temporary folder does not exist.'));
... (135 lines truncated)
</file>

<file path="application/libraries/ExtensionInstaller/GitVersionFetcher.php">
<?php
namespace LimeSurvey\ExtensionInstaller;
class GitVersionFetcher extends VersionFetcher
{
    public function getLatestVersion()
    {
        return 'todo';
    }
    public function getLatestSecurityVersion()
    {
        return 'todo';
    }
}
</file>

<file path="application/libraries/ExtensionInstaller/PluginInstaller.php">
<?php
namespace LimeSurvey\ExtensionInstaller;
use Exception;
use InvalidArgumentException;
use LimeSurvey\PluginManager\PluginManager;
class PluginInstaller extends ExtensionInstaller
{
    protected $pluginType;
    public function install()
    {
        if (empty($this->fileFetcher)) {
            throw new InvalidArgumentException('fileFetcher is not set');
        }
        if (!$this->isWhitelisted()) {
            throw new Exception('The plugin is not in the plugin allowlist.');
        }
        $config = $this->getConfig();
        $pluginManager = App()->getPluginManager();
        $destdir = $pluginManager->getPluginFolder($config, $this->pluginType);
        if ($this->fileFetcher->move($destdir)) {
            [$result, $errorMessage] = $pluginManager->installUploadedPlugin($destdir);
            if (!$result) {
                throw new Exception($errorMessage);
            }
            $this->fileFetcher->abort();
        } else {
            throw new Exception('Could not move files.');
        }
    }
    public function update()
... (42 lines truncated)
</file>

<file path="application/libraries/ExtensionInstaller/PluginUpdater.php">
<?php
namespace LimeSurvey\ExtensionInstaller;
use Exception;
use ExtensionConfig;
class PluginUpdater extends ExtensionUpdater
{
    public static function createUpdaters(): array
    {
        $plugins = \Plugin::model()->findAll();
        $updaters = [];
        $errors   = [];
        foreach ($plugins as $plugin) {
            try {
                $updaters[] = new PluginUpdater($plugin);
            } catch (Exception $ex) {
                $errors[] = $ex->getMessage();
            }
        }
        return [$updaters, $errors];
    }
    public function getExtensionName()
    {
        return $this->model->name;
    }
    public function getExtensionType()
    {
        return 'p';
    }
    public function getExtensionConfig()
    {
... (8 lines truncated)
</file>

<file path="application/libraries/ExtensionInstaller/QuestionThemeInstaller.php">
<?php
namespace LimeSurvey\ExtensionInstaller;
use Exception;
use Throwable;
use ExtensionConfig;
use QuestionTheme;
use RecursiveDirectoryIterator;
use RecursiveIteratorIterator;
class QuestionThemeInstaller extends ExtensionInstaller
{
    public function getConfig()
    {
        assert(!empty($this->fileFetcher), 'File fetcher must be set');
        return $this->fileFetcher->getConfig();
    }
    public function install()
    {
        $extConfig = $this->getConfig();
        $questionThemeName = $extConfig->getName();
        if (!$this->validateQuestionThemeName($questionThemeName)) {
            throw new Exception(gT('Invalid question theme name in config.xml'));
        }
        $destdir = App()->getConfig('userquestionthemerootdir') . DIRECTORY_SEPARATOR . $questionThemeName;
        if ($this->fileFetcher->move($destdir)) {
            $questionTheme = new QuestionTheme();
            $xmlFolder = $this->getXmlFolder($destdir);
            if (empty($xmlFolder)) {
                throw new Exception('Found no xml folder for question theme');
            }
            $questionTheme->importManifest($xmlFolder, false, true);
... (55 lines truncated)
</file>

<file path="application/libraries/ExtensionInstaller/README.md">
Extension installer library documentation
-----------------------------------------
</file>

<file path="application/libraries/ExtensionInstaller/RESTVersionFetcher.php">
<?php
namespace LimeSurvey\ExtensionInstaller;
class RESTVersionFetcher extends VersionFetcher
{
    protected $curlResult = null;
    public function getLatestVersion()
    {
        if (empty($this->curlResult)) {
            $this->fetchCurl();
        }
        if (empty($this->curlResult->version)) {
            throw new \Exception('Found no version field in curl result');
        }
        return $this->curlResult->version;
    }
    public function getLatestSecurityVersion()
    {
        if (empty($this->curlResult)) {
            $this->fetchCurl();
        }
        if (empty($this->curlResult->last_security_version)) {
            return '0.0.0';
        }
        return $this->curlResult->last_security_version;
    }
    protected function fetchCurl()
    {
        if (empty($this->source)) {
            throw new \Exception('Missing source');
        }
... (23 lines truncated)
</file>

<file path="application/libraries/ExtensionInstaller/ThemeUpdater.php">
<?php
namespace LimeSurvey\ExtensionInstaller;
class ThemeUpdater extends ExtensionUpdater
{
    public static function createUpdaters()
    {
        $themes = \Template::model()->findAll();
        $updaters = [];
        $errors   = [];
        foreach ($themes as $theme) {
            try {
                $updaters[] = new ThemeUpdater($theme);
            } catch (\Exception $ex) {
                $errors[] = $ex->getMessage();
            }
        }
        return [$updaters, $errors];
    }
    public function getExtensionName()
    {
        return $this->model->name;
    }
    public function getCurrentVersion()
    {
        return $this->model->version;
    }
    public function getExtensionType()
    {
        return 't';
    }
... (22 lines truncated)
</file>

<file path="application/libraries/ExtensionInstaller/VersionFetcher.php">
<?php
namespace LimeSurvey\ExtensionInstaller;
use SimpleXMLElement;
use Exception;
abstract class VersionFetcher
{
    protected $updaterXml;
    protected $source;
    protected $stable;
    protected $extensionName;
    protected $extensionType;
    public function __construct(SimpleXMLElement $updaterXml)
    {
        $this->updaterXml = $updaterXml;
        $this->setSource((string) $updaterXml->source);
        $this->setStable((string) $updaterXml->stable === '1');
    }
    public function setSource(string $source)
    {
        $this->source = $source;
    }
    public function setStable(bool $stable)
    {
        $this->stable = $stable;
    }
    public function setExtensionName(string $name)
    {
        $this->extensionName = $name;
    }
    public function setExtensionType(string $type)
... (15 lines truncated)
</file>

<file path="application/libraries/ExtensionInstaller/VersionFetcherServiceLocator.php">
<?php
namespace LimeSurvey\ExtensionInstaller;
use SimpleXMLElement;
use Exception;
class VersionFetcherServiceLocator
{
    protected $versionFetcherCreators;
    public function init()
    {
        $this->addVersionFetcherType(
            'rest',
            function (SimpleXMLElement $updaterXml) {
                $vf = new RESTVersionFetcher($updaterXml);
                return $vf;
            }
        );
        $this->addVersionFetcherType(
            'git',
            function (SimpleXMLElement $updaterXml) {
                return new GitVersionFetcher($updaterXml);
            }
        );
    }
    public function createVersionFetcher(SimpleXMLElement $updaterXml)
    {
        $this->validateXml($updaterXml);
        $type = (string) $updaterXml->type;
        if (isset($this->versionFetcherCreators[$type])) {
            $versionFetcher =  $this->versionFetcherCreators[$type]($updaterXml);
            return $versionFetcher;
... (25 lines truncated)
</file>

<file path="application/libraries/FormExtension/Inputs/BaseInput.php">
<?php
namespace LimeSurvey\Libraries\FormExtension\Inputs;
use CHttpRequest;
use CDbConnection;
use InvalidArgumentException;
class BaseInput implements InputInterface
{
    private $saveFunction;
    private $loadFunction;
    private $conditionFunction;
    private $id;
    private $name;
    private $label;
    private $help;
    private $tooltip;
    private $disabled = false;
    public function __construct(array $options)
    {
        if (empty($options['name'])) {
            throw new InvalidArgumentException("Input is missing mandatory name option");
        }
        $this->name = $options['name'];
        $this->id = $options['id'] ?? null;
        $this->label = $options['label'] ?? null;
        $this->help = $options['help'] ?? null;
        $this->tooltip = $options['tooltip'] ?? null;
        $this->disabled = $options['disabled'] ?? false;
        $this->saveFunction = $options['save'] ?? null;
        $this->loadFunction = $options['load'] ?? null;
        $this->conditionFunction = $options['condition'] ?? null;
... (49 lines truncated)
</file>

<file path="application/libraries/FormExtension/Inputs/CheckboxInput.php">
<?php
namespace LimeSurvey\Libraries\FormExtension\Inputs;
class CheckboxInput extends BaseInput
{
}
</file>

<file path="application/libraries/FormExtension/Inputs/DefaultBaseRenderer.php">
<?php
namespace LimeSurvey\Libraries\FormExtension\Inputs;
use InvalidArgumentException;
class DefaultBaseRenderer
{
    public function run($input): string
    {
        switch (true) {
            case $input instanceof RawHtmlInput:
                return $input->getHtml();
            default:
                $c = get_class($input);
                throw new InvalidArgumentException("DefaultBaseRenderer has no support for class $c");
        }
    }
    protected function bakeTooltip($text)
    {
        if ($text) {
            return [sprintf("title='%s'", $text), "data-bs-toggle='tooltip'"];
        } else {
            return ['', ''];
        }
    }
}
</file>

<file path="application/libraries/FormExtension/Inputs/FileInput.php">
<?php
namespace LimeSurvey\Libraries\FormExtension\Inputs;
class FileInput extends BaseInput
{
    private $accept = [];
    public function __construct(array $options)
    {
        parent::__construct($options);
        $this->accept = $options['accept'] ?? [];
    }
    public function getAccept(): array
    {
        return $this->accept;
    }
    public function getAcceptHtml(): string
    {
        return !empty($this->accept)
            ? 'accept="' . implode(',', $this->accept) . '"'
            : '';
    }
}
</file>

<file path="application/libraries/FormExtension/Inputs/GlobalSettingsRenderer.php">
<?php
namespace LimeSurvey\Libraries\FormExtension\Inputs;
class GlobalSettingsRenderer extends DefaultBaseRenderer
{
    public function run($input): string
    {
        switch (true) {
            case $input instanceof FileInput:
                $id = $input->getId() ? 'id="' . $input->getId() . '"' : '';
                $disabled = $input->isDisabled() ? "disabled" : '';
                [$tooltipText, $tooltipTrigger] = $this->bakeTooltip($input->getTooltip());
                $helpDiv = $this->bakeHelpDiv($input->getHelp());
                return <<<HTML
<div class="row ls-space margin top-10">
    <div class="form-group col-xs-12">
        <label class="col-sm-12 control-label">{$input->getLabel()}</label>
        <div class="col-sm-12">
            <input
                class="form-control"
                {$id} {$input->getAcceptHtml()} {$disabled} {$tooltipTrigger} {$tooltipText}
                name="{$input->getName()}"
                type="file"
            />
        </div>
        {$helpDiv}
    </div>
</div>
HTML;
            case $input instanceof TextInput:
                $disabled = $input->isDisabled() ? "disabled" : "";
... (32 lines truncated)
</file>

<file path="application/libraries/FormExtension/Inputs/InputInterface.php">
<?php
namespace LimeSurvey\Libraries\FormExtension\Inputs;
interface InputInterface
{
}
</file>

<file path="application/libraries/FormExtension/Inputs/RawHtmlInput.php">
<?php
namespace LimeSurvey\Libraries\FormExtension\Inputs;
class RawHtmlInput
{
    private $html;
    public function __construct(string $html)
    {
        $this->html = $html;
    }
    public function getHtml(): string
    {
        return $this->html;
    }
}
</file>

<file path="application/libraries/FormExtension/Inputs/TextInput.php">
<?php
namespace LimeSurvey\Libraries\FormExtension\Inputs;
class TextInput extends BaseInput
{
}
</file>

<file path="application/libraries/FormExtension/FormExtensionService.php">
<?php
namespace LimeSurvey\Libraries\FormExtension;
use Exception;
use InvalidArgumentException;
use CHttpRequest;
use Yii;
class FormExtensionService
{
    private $inputs = [];
    public function init(): void
    {
    }
    public function add(string $position, $input): void
    {
        if ($this->validatePosition($position)) {
            if (empty($this->inputs[$position])) {
                $this->inputs[$position] = [];
            }
            $this->inputs[$position][] = $input;
        } else {
            throw new InvalidArgumentException('Position is not supported: ' . $position);
        }
    }
    public function applySave(string $position, CHttpRequest $request): bool
    {
        $db = Yii::app()->db;
        $inputs = $this->getAllForPosition($position);
        $success = true;
        foreach ($inputs as $input) {
            try {
... (33 lines truncated)
</file>

<file path="application/libraries/FormExtension/FormExtensionWidget.php">
<?php
namespace LimeSurvey\Libraries\FormExtension;
class FormExtensionWidget
{
    public static function render(array $inputs, $renderer): string
    {
        return array_reduce(
            $inputs,
            function ($html, $i) use ($renderer) {
                return $html . $renderer->run($i);
            },
            ''
        );
    }
}
</file>

<file path="application/libraries/FormExtension/README.md">
Service locator to deal with global form extensions, using plugins (but not events - see examples below).
</file>

<file path="application/libraries/FormExtension/SaveFailedException.php">
<?php
namespace LimeSurvey\Libraries\FormExtension;
use Exception;
class SaveFailedException extends Exception
{
}
</file>

<file path="application/libraries/MenuObjects/views/_extraMenu.php">
<?php
use LimeSurvey\Menu\Menu;
use LimeSurvey\Menu\MenuButton;
foreach ($extraMenus as $menu) : ?>
    <?php
    $menuId = $menu->getId();
    $menuLabel = $menu->getLabel();
    $menuIconClass = $menu->getIconClass();
    $menuHref = $menu->getHref();
    $idAttr = ($menu->getId()) ? 'id="' . $menuId . '"' : '';
    $ariaLabelledBy = $idAttr ? 'aria-labelledby="' . $menuId . '"' : '';
    $sectionFilter = (($middleSection && $menu->isInMiddleSection()) || (!$middleSection && !$menu->isInMiddleSection()));
    $prependedFilter = (($prependedMenu && $menu->isPrepended()) || (!$prependedMenu && !$menu->isPrepended()));
    /** @var Menu $menu */
    if ($sectionFilter && $prependedFilter) : ?>
        <li class="dropdown nav-item extra-menu-dropdown">
            <?php
            if ($menu->isDropDown()) : ?>
                <?php if ($menu->isDropDownButton()) { ?>
                    <button type="button"
                            <?= $idAttr ?>
                            class="dropdown-toggle <?= $menu->getDropDownButtonClass() ?>"
                            data-bs-toggle="dropdown"
                            aria-expanded="false"
                            aria-haspopup="true"
                            aria-label="<?= $menuLabel ?>">
                        <i class="<?= $menuIconClass ?>" aria-hidden="true"></i>
                    </button>
                    <?php
                } else { ?>
... (96 lines truncated)
</file>

<file path="application/libraries/MenuObjects/ExtendedMenuInterface.php">
<?php
namespace LimeSurvey\Menu;
interface ExtendedMenuInterface extends MenuMinimalInterface
{
    public function getId();
    public function isDropDownButton();
    public function getDropDownButtonClass();
    public function getIconClass();
    public function getOnClick();
    public function getTooltip();
    public function isInMiddleSection();
    public function isPrepended();
    public function isButton();
}
</file>

<file path="application/libraries/MenuObjects/ExtendedMenuItemInterface.php">
<?php
namespace LimeSurvey\Libraries\MenuObjects;
use LimeSurvey\Menu\MenuItemInterface;
interface ExtendedMenuItemInterface extends MenuItemInterface
{
    public function isModal();
    public function getModalId();
    public function getItemClass();
}
</file>

<file path="application/libraries/MenuObjects/Menu.php">
<?php
namespace LimeSurvey\Menu;
class Menu implements ExtendedMenuInterface
{
    protected $id = "";
    /**
     * If true, render this menu as a dropdown.
     * @var bool
     */
    protected $isDropDown = false;
    /**
     * If true, render this menu as a dropdown button.
     * @var bool
     */
    protected $isDropDownButton = false;
    /**
     * @var string
     */
    protected $dropDownButtonClass = "btn btn-primary";
    protected $label = "Missing label";
    protected $href = "#";
    protected $menuItems = [];
    protected $iconClass = "";
    /**
     * @var string
     */
    protected $onClick = "";
    /**
     * @var string
     */
... (96 lines truncated)
</file>

<file path="application/libraries/MenuObjects/MenuButton.php">
<?php
namespace LimeSurvey\Menu;
class MenuButton extends Menu implements MenuButtonInterface
{
    protected $buttonId;
    protected $buttonClass = "btn btn-primary";
    protected $openInNewTab = false;
    public function __construct($options)
    {
        parent::__construct($options);
        $this->isDropDown = false;
        if (isset($options['buttonId'])) {
            $this->buttonId = $options['buttonId'];
        }
        if (isset($options['buttonClass'])) {
            $this->buttonClass = $options['buttonClass'];
        }
        if (isset($options['openInNewTab'])) {
            $this->openInNewTab = $options['openInNewTab'];
        }
    }
    public function getLabel()
    {
        $label = $this->label;
        if ($this->iconClass !== '') {
            $label = "<i class='" . $this->iconClass . "'></i>&nbsp;" . $this->label;
        }
        return $label;
    }
    public function getButtonId()
... (17 lines truncated)
</file>

<file path="application/libraries/MenuObjects/MenuButtonInterface.php">
<?php
namespace LimeSurvey\Menu;
interface MenuButtonInterface
{
    public function getButtonId();
    public function getButtonClass();
    public function getOpenInNewTab();
}
</file>

<file path="application/libraries/MenuObjects/MenuInterface.php">
<?php
namespace LimeSurvey\Menu;
class_alias(MenuMinimalInterface::class, 'LimeSurvey\Menu\MenuInterface');
</file>

<file path="application/libraries/MenuObjects/MenuItem.php">
<?php
namespace LimeSurvey\Menu;
use LimeSurvey\Libraries\MenuObjects\ExtendedMenuItemInterface;
class MenuItem implements ExtendedMenuItemInterface
{
    protected $isDivider = false;
    protected $isSmallText = false;
    protected $href = "#";
    protected $label = "Missing label";
    protected $iconClass = "";
    /** @var string */
    protected $id = null;
    /** @var string */
    protected $itemClass = "";
    protected $isModal = false;
    protected $modalId = null;
    public function __construct($options)
    {
        if (isset($options['isDivider'])) {
            $this->isDivider = $options['isDivider'];
        }
        if (isset($options['isSmallText'])) {
            $this->isSmallText = $options['isSmallText'];
        }
        if (isset($options['label'])) {
            $this->label = $options['label'];
        }
        if (isset($options['href'])) {
            $this->href = $options['href'];
        }
... (58 lines truncated)
</file>

<file path="application/libraries/MenuObjects/MenuItemInterface.php">
<?php
namespace LimeSurvey\Menu;
interface MenuItemInterface
{
    public function getHref();
    public function getLabel();
    public function getIconClass();
    public function isDivider();
    public function isSmallText();
}
</file>

<file path="application/libraries/MenuObjects/MenuMinimalInterface.php">
<?php
namespace LimeSurvey\Menu;
interface MenuMinimalInterface
{
    public function isDropDown();
    public function getLabel();
    public function getHref();
    public function getMenuItems();
}
</file>

<file path="application/libraries/ObjectPatch/Op/OpInterface.php">
<?php
namespace LimeSurvey\ObjectPatch\Op;
use LimeSurvey\ObjectPatch\OpType\OpTypeInterface;
interface OpInterface
{
    public function getEntityType();
    public function getEntityId();
    public function getType(): OpTypeInterface;
    public function getProps();
    public function getContext();
}
</file>

<file path="application/libraries/ObjectPatch/Op/OpStandard.php">
<?php
namespace LimeSurvey\ObjectPatch\Op;
use LimeSurvey\ObjectPatch\ObjectPatchException;
use LimeSurvey\ObjectPatch\OpType\OpTypeInterface;
use LimeSurvey\ObjectPatch\OpType\OpType;
class OpStandard implements OpInterface
{
    private $entityType = null;
    private $type = null;
    private $entityId = null;
    private $props = null;
    private $context = null;
    public function __construct($entityType, OpTypeInterface $type, $entityId, $props, $context)
    {
        $this->entityType = $entityType;
        $this->type = $type;
        $this->entityId = $entityId;
        $this->props = $props;
        $this->context = $context;
    }
    public function getEntityType()
    {
        return $this->entityType;
    }
    public function getEntityId()
    {
        return $this->entityId;
    }
    public function getType(): OpTypeInterface
    {
... (23 lines truncated)
</file>

<file path="application/libraries/ObjectPatch/OpHandler/OpHandlerActiveRecordUpdate.php">
<?php
namespace LimeSurvey\ObjectPatch\OpHandler;
use CModel;
use LimeSurvey\Api\Transformer\TransformerInterface;
use LimeSurvey\ObjectPatch\{
    OpHandler\OpHandlerInterface,
    OpHandler\OpHandlerException,
    Op\OpInterface,
    OpType\OpTypeUpdate
};
class OpHandlerActiveRecordUpdate implements OpHandlerInterface
{
    protected $entity = null;
    protected $model = null;
    protected $transformer = null;
    public function __construct($entity, CModel $model, ?TransformerInterface $transformer = null)
    {
        $this->entity = $entity;
        $this->model = $model;
        $this->transformer = $transformer;
    }
    public function canHandle(OpInterface $op): bool
    {
        return $op->getEntityType() == $this->entity
            && $op->getType()->getId() == OpTypeUpdate::ID;
    }
    public function handle(OpInterface $op)
    {
        $record = is_array($op->getEntityId())
            ? $this->model->findByAttributes(
... (42 lines truncated)
</file>

<file path="application/libraries/ObjectPatch/OpHandler/OpHandlerException.php">
<?php
namespace LimeSurvey\ObjectPatch\OpHandler;
use LimeSurvey\ObjectPatch\ObjectPatchException;
class OpHandlerException extends ObjectPatchException
{
}
</file>

<file path="application/libraries/ObjectPatch/OpHandler/OpHandlerInterface.php">
<?php
namespace LimeSurvey\ObjectPatch\OpHandler;
use LimeSurvey\ObjectPatch\Op\OpInterface;
interface OpHandlerInterface
{
    public function canHandle(OpInterface $op): bool;
    public function handle(OpInterface $op);
    public function validateOperation(OpInterface $op): array;
}
</file>

<file path="application/libraries/ObjectPatch/OpType/OpType.php">
<?php
namespace LimeSurvey\ObjectPatch\OpType;
use LimeSurvey\ObjectPatch\ObjectPatchException;
abstract class OpType implements OpTypeInterface
{
    private const ID = '';
    public function getId()
    {
        return static::ID;
    }
    public function __toString()
    {
        return static::getId();
    }
    /**
     * Factory
     *
     * @throws ObjectPatchException
     */
    public static function factory($type): OpTypeInterface
    {
        $validTypes = ['create', 'update', 'delete'];
        if (!in_array($type, $validTypes)) {
            throw new ObjectPatchException(sprintf(
                'Invalid operation type "%s"',
                $type
            ));
        }
        $class = __NAMESPACE__ . '\OpType' . ucfirst($type);
        return new $class();
... (3 lines truncated)
</file>

<file path="application/libraries/ObjectPatch/OpType/OpTypeCreate.php">
<?php
namespace LimeSurvey\ObjectPatch\OpType;
class OpTypeCreate extends OpType
{
    const ID = 'create';
}
</file>

<file path="application/libraries/ObjectPatch/OpType/OpTypeDelete.php">
<?php
namespace LimeSurvey\ObjectPatch\OpType;
class OpTypeDelete extends OpType
{
    const ID = 'delete';
}
</file>

<file path="application/libraries/ObjectPatch/OpType/OpTypeInterface.php">
<?php
namespace LimeSurvey\ObjectPatch\OpType;
interface OpTypeInterface
{
    public function getId();
}
</file>

<file path="application/libraries/ObjectPatch/OpType/OpTypeUpdate.php">
<?php
namespace LimeSurvey\ObjectPatch\OpType;
class OpTypeUpdate extends OpType
{
    const ID = 'update';
}
</file>

<file path="application/libraries/ObjectPatch/ObjectPatchException.php">
<?php
namespace LimeSurvey\ObjectPatch;
class ObjectPatchException extends \Exception
{
}
</file>

<file path="application/libraries/ObjectPatch/Patcher.php">
<?php
namespace LimeSurvey\ObjectPatch;
use LimeSurvey\ObjectPatch\Op\OpInterface;
use LimeSurvey\ObjectPatch\Op\OpStandard;
use LimeSurvey\ObjectPatch\OpHandler\OpHandlerInterface;
class Patcher
{
    private $opHandlers = [];
    public function applyPatch($patch, $context = []): array
    {
        $returnedData = [];
        $operationsApplied = 0;
        if (is_array($patch) && !empty($patch)) {
            foreach ($patch as $patchOpData) {
                $op = OpStandard::factory(
                    $patchOpData['entity'] ?? null,
                    $patchOpData['op'] ?? null,
                    $patchOpData['id'] ?? null,
                    $patchOpData['props'] ?? null,
                    $context ?? null
                );
                $returnedData[] = $this->handleOp($op);
                $operationsApplied++;
            }
        }
        return ['operationsApplied' => $operationsApplied, $returnedData];
    }
    public function addOpHandler(OpHandlerInterface $opHandler): void
    {
        $this->opHandlers[] = $opHandler;
... (33 lines truncated)
</file>

<file path="application/libraries/PluginManager/Storage/DbStorage.php">
<?php
namespace LimeSurvey\PluginManager;
use PluginSetting;
class DbStorage implements iPluginStorage
{
    public function __construct()
    {
    }
    public function get(iPlugin $plugin, $key = null, $model = null, $id = null, $default = null, $language = null)
    {
        $functionName = 'get' . ucfirst((string)$model);
        if ($model == null || !method_exists($this, $functionName)) {
            return $this->getGeneric($plugin, $key, $model, $id, $default);
        } else {
            return $this->$functionName($plugin, $key, $model, $id, $default, $language);
        }
    }
    protected function getGeneric(iPlugin $plugin, $key, $model, $id, $default)
    {
        $attributes = array(
            'plugin_id' => $plugin->getId(),
            'model'     => $model,
            'model_id'  => $id,
        );
        if ($key != null) {
            $attributes['key'] = $key;
        }
        $records = \PluginSetting::model()->findAllByAttributes($attributes);
        if (count($records) > 1) {
            foreach ($records as $record) {
... (40 lines truncated)
</file>

<file path="application/libraries/PluginManager/Storage/DummyStorage.php">
<?php
namespace LimeSurvey\PluginManager;
class DummyStorage implements iPluginStorage
{
    public function get($plugin, $key = null, $model = null, $id = null, $default = null, $language = null)
    {
        return false;
    }
    public function set($plugin, $key, $data, $model = 'NULL', $id = 'NULL', $language = 'NULL')
    {
        echo "DummyStorage::set('" . get_class($plugin) . "', '$key', " . serialize($data) . ", '$model', '$id', '$language')<br>";
        return false;
    }
    public function __construct()
    {
    }
}
</file>

<file path="application/libraries/PluginManager/Storage/iPluginStorage.php">
<?php
namespace LimeSurvey\PluginManager;
interface iPluginStorage
{
    public function get(iPlugin $plugin, $key = null, $model = null, $id = null, $default = null, $language = null);
    public function set(iPlugin $plugin, $key, $data, $model = null, $id = null, $language = null);
    public function __construct();
}
</file>

<file path="application/libraries/PluginManager/AuthPluginBase.php">
<?php
namespace LimeSurvey\PluginManager;
use User;
use LSAuthResult;
use LimeSurvey\PluginManager\PluginEvent;
abstract class AuthPluginBase extends PluginBase
{
    const ERROR_NONE = 0;
    const ERROR_NOT_ADDED = 5;
    const ERROR_USERNAME_INVALID = 10;
    const ERROR_PASSWORD_INVALID = 20;
    const ERROR_AUTH_METHOD_INVALID = 30;
    const ERROR_IP_LOCKED_OUT = 98;
    const ERROR_UNKNOWN_HANDLER = 99;
    const ERROR_UNKNOWN_IDENTITY = 100;
    const ERROR_INVALID_EMAIL = 110;
    const ERROR_ALREADY_EXISTING_USER = 120;
    const ERROR_LDAP_CONNECTION = 130;
    const ERROR_LDAP_MODE = 135;
    const ERROR_LDAP_NO_EMAIL = 140;
    const ERROR_LDAP_NO_FULLNAME = 150;
    const ERROR_LDAP_NO_BIND = 160;
    const ERROR_LDAP_NO_SEARCH_RESULT = 170;
    const LDAP_INVALID_PASSWORD_TEXT = "INVALID_PASSWORD-LDAP_USER";
    protected $_username = null;
    protected $_password = null;
    protected function getPassword()
    {
        return $this->_password;
    }
... (74 lines truncated)
</file>

<file path="application/libraries/PluginManager/EmailPluginBase.php">
<?php
namespace LimeSurvey\PluginManager;
use LimeMailer;
use LimeSurvey\Datavalueobjects\EmailPluginInfo;
abstract class EmailPluginBase extends PluginBase
{
    abstract protected function getDisplayName();
    protected function isCurrentEmailPlugin()
    {
        if (LimeMailer::MethodPlugin !== \Yii::app()->getConfig('emailmethod')) {
            return false;
        }
        return get_class($this) == \Yii::app()->getConfig('emailplugin');
    }
    protected function getEmailPluginInfo()
    {
        return new EmailPluginInfo($this->getId(), $this->getDisplayName(), get_class($this));
    }
}
</file>

<file path="application/libraries/PluginManager/EventDocumentor.php">
<?php
$basePath = dirname(dirname(dirname(__FILE__)));
$i = new RecursiveDirectoryIterator($basePath);
$i2 = new RecursiveIteratorIterator($i);
$events = array();
foreach ($i2 as $file) {
    if (substr((string) $file->getFileName(), -3, 3) == 'php') {
        scanFile($file->getPathname());
    }
}
$events = array_unique($events);
sort($events);
print_r($events);
function scanFile($fileName)
{
    global $events;
    $contents = file_get_contents($fileName);
    $regex = '/(.*)new[[:space:]]+PluginEvent[[:space:]]*\([[:space:]]*[\'"]+(.*)[\'"]+/';
    $count = preg_match_all($regex, $contents, $matches);
    if ($count > 0) {
        $events = array_merge($events, $matches[2]);
    }
}
</file>

<file path="application/libraries/PluginManager/index.php">
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title></title>
    </head>
    <body>
        <?php
        ?>
    </body>
</html>
</file>

<file path="application/libraries/PluginManager/iPlugin.php">
<?php
namespace LimeSurvey\PluginManager;
interface iPlugin
{
    public function __construct(PluginManager $manager, $id);
    public static function getDescription();
    public function getEvent();
    public function getId();
    public function getPluginSettings($getValues = true);
    public static function getName();
    public function getStore();
    public function saveSettings($settings);
    public function setEvent(PluginEvent $event);
}
</file>

<file path="application/libraries/PluginManager/LimesurveyApi.php">
<?php
namespace LimeSurvey\PluginManager;
use Yii;
use User;
use PluginDynamic;
use SurveyDynamic;
use Template;
use InvalidArgumentException;
use Exception;
class LimesurveyApi
{
    public function getConfigKey($key, $defaultValue = false)
    {
        return App()->getConfig($key, $defaultValue);
    }
    protected function getTableName(iPlugin $plugin, $tableName)
    {
        return App()->getDb()->tablePrefix . strtolower($plugin->getName()) . "_$tableName";
    }
    public function setFlash($message, $key = 'api')
    {
        \Yii::app()->user->setFlash($key, $message);
    }
    public function createTable($plugin, $sTableName, $aColumns, $sOptions = null)
    {
        if (null !== $sTableName = $this->getTableName($plugin, $sTableName)) {
            return App()->getDb()->createCommand()->createTable($sTableName, $aColumns, $sOptions);
        }
        return false;
    }
... (331 lines truncated)
</file>

<file path="application/libraries/PluginManager/PluginBase.php">
<?php
namespace LimeSurvey\PluginManager;
use LSActiveRecord;
abstract class PluginBase implements iPlugin
{
    protected $api = null;
    protected $event = null;
    protected $id = null;
    protected $storage = 'DummyStorage';
    protected static $description = 'Base plugin object';
    protected static $name = 'PluginBase';
    private $store = null;
    protected $settings = [];
    protected $pluginManager;
    public $config = null;
    public $allowedPublicMethods = null;
    protected $encryptedSettings = [];
    public function __construct(PluginManager $manager, $id)
    {
        $this->pluginManager = $manager;
        $this->id = $id;
        $this->api = $manager->getAPI();
        $this->setLocaleComponent();
    }
    protected function setLocaleComponent()
    {
        $dir = $this->getDir();
        if ($dir) {
            $basePath = $dir . DIRECTORY_SEPARATOR . 'locale';
        } else {
... (308 lines truncated)
</file>

<file path="application/libraries/PluginManager/PluginEvent.php">
<?php
namespace LimeSurvey\PluginManager;
use Yii;
use Hash;
Yii::import('application.helpers.Hash');
class PluginEvent
{
    protected $_event = '';
    /**
     * This array holds the content blocks that plugins generate, idexed by plugin name
     *
     * @var array of PluginEventContent
     */
    protected $_content = array();
    /**
     * The class who fired the event, or null when not set
     *
     * @var object
     */
    protected $_sender = null;
    /**
     * When true it prevents delegating the event to other plugins.
     *
     * @var boolean
     */
    protected $_stop = false;
    /**
     * Internal storage for event data. Can be used to communicate between sender
     * and plugin or between different plugins handling the event.
     *
... (127 lines truncated)
</file>

<file path="application/libraries/PluginManager/PluginEventContent.php">
<?php
namespace LimeSurvey\PluginManager;
class PluginEventContent
{
    const APPEND = 'append';
    const PREPEND = 'prepend';
    protected $_content = null;
    protected $_cssClass = array('pluginblock' => 'pluginblock');
    protected $_cssId = '';
    /**
     * @param string $content
     * @param string $cssClass
     * @param string $id
     */
    public function __construct($content = null, $cssClass = null, $id = null)
    {
        $this->setContent($content);
        $this->setCssClass($cssClass);
        $this->setCssId($id);
    }
    /**
     * Add a css class to use for this content
     *
     * @param string $cssClass
     * @return PluginEventContent
     */
    public function addCssClass($cssClass)
    {
        if (!empty($cssClass)) {
            $this->_cssClass[$cssClass] = array($cssClass);
... (70 lines truncated)
</file>

<file path="application/libraries/PluginManager/PluginManager.php">
<?php
namespace LimeSurvey\PluginManager;
use Yii;
use Plugin;
use ExtensionConfig;
class PluginManager extends \CApplicationComponent
{
    public $api;
    protected $guidToQuestion = [];
    protected $plugins = [];
    public $pluginDirs = [
        'user' => 'webroot.plugins',
        'core' => 'application.core.plugins',
        'upload' => 'uploaddir.plugins'
    ];
    protected $stores = [];
    protected $subscriptions = [];
    public $shutdownObject;
    public function init()
    {
        $this->shutdownObject = new PluginManagerShutdownFunction();
        register_shutdown_function($this->shutdownObject);
        \Yii::setPathOfAlias('uploaddir', Yii::app()->getConfig('uploaddir'));
        parent::init();
        if (!is_object($this->api)) {
            $class = $this->api;
            $this->api = new $class();
        }
        if (Yii::app()->getComponent('pluginManager', false) === null) {
            Yii::app()->setComponent('pluginManager', $this);
... (488 lines truncated)
</file>

<file path="application/libraries/PluginManager/PluginManagerShutdownFunction.php">
<?php
namespace LimeSurvey\PluginManager;
class PluginManagerShutdownFunction
{
    protected $enabled = false;
    protected $currentPluginName;
    public function enable()
    {
        $this->enabled = true;
    }
    public function disable()
    {
        $this->currentPluginName = null;
        $this->enabled = false;
    }
    public function isEnabled()
    {
        return $this->enabled;
    }
    public function setPluginName($name)
    {
        $this->currentPluginName = $name;
    }
    public function __invoke()
    {
        if (!$this->enabled) {
            return;
        }
        $error = error_get_last();
        if (empty($error)) {
... (52 lines truncated)
</file>

<file path="application/libraries/PluginManager/SmtpOAuthPluginBase.php">
<?php
namespace LimeSurvey\PluginManager;
use League\OAuth2\Client\Grant\RefreshToken;
use League\OAuth2\Client\Provider\Exception\IdentityProviderException;
use PHPMailer\PHPMailer\OAuth;
abstract class SmtpOAuthPluginBase extends EmailPluginBase
{
    const SETUP_STATUS_VALID_REFRESH_TOKEN = 1;
    const SETUP_STATUS_REQUIREMENT_UNMET = 2;
    const SETUP_STATUS_INCOMPLETE_CREDENTIALS = 3;
    const SETUP_STATUS_MISSING_REFRESH_TOKEN = 4;
    const SETUP_STATUS_INVALID_REFRESH_TOKEN = 5;
    protected $credentialAttributes = [];
    protected function getRedirectUri()
    {
        return $this->api->createUrl('smtpOAuth/receiveOAuthResponse', []);
    }
    abstract protected function getProvider($credentials);
    protected function haveCredentialsChanged($oldCredentials, $newCredentials)
    {
        foreach ($this->credentialAttributes as $attribute) {
            if ($oldCredentials[$attribute] != $newCredentials[$attribute]) {
                return true;
            }
        }
        return false;
    }
    protected function clearRefreshToken()
    {
        $this->set('refreshToken', null);
... (243 lines truncated)
</file>

<file path="application/libraries/Spreadsheet/ExcelCellFormat.php">
<?php
namespace LimeSurvey\Libraries\Spreadsheet;
class ExcelCellFormat
{
    private $bold = false;
    private $numberFormat = null;
    public function __construct(array $properties = [])
    {
        if (!empty($properties['Bold'])) {
            $this->bold = true;
        }
    }
    public function setNumFormat($format)
    {
        $this->numberFormat = $format;
    }
    public function isBold()
    {
        return $this->bold;
    }
    public function getNumFormat()
    {
        return $this->numberFormat;
    }
}
</file>

<file path="application/libraries/Spreadsheet/ExcelWorkbookWriter.php">
<?php
namespace LimeSurvey\Libraries\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
class ExcelWorkbookWriter
{
    public const MIME_TYPE = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
    private $spreadsheet;
    private $filename;
    private $downloadName = null;
    private $firstSheetUsed = false;
    public function __construct($filename = null)
    {
        $this->spreadsheet = new Spreadsheet();
        $this->filename = $filename;
    }
    public function send($filename)
    {
        $this->downloadName = $this->ensureXlsxExtension($filename);
    }
    public function addWorksheet($name)
    {
        if ($this->firstSheetUsed) {
            $sheet = $this->spreadsheet->createSheet();
        } else {
            $sheet = $this->spreadsheet->getActiveSheet();
            $this->firstSheetUsed = true;
        }
        $sheet->setTitle($this->sanitizeTitle((string)$name));
        return new ExcelWorksheetWriter($sheet);
... (41 lines truncated)
</file>

<file path="application/libraries/Spreadsheet/ExcelWorksheetWriter.php">
<?php
namespace LimeSurvey\Libraries\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Cell\Coordinate;
use PhpOffice\PhpSpreadsheet\Cell\DataType;
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
class ExcelWorksheetWriter
{
    private $sheet;
    public function __construct(Worksheet $sheet)
    {
        $this->sheet = $sheet;
    }
    public function setColumn($firstColumn, $lastColumn, $width)
    {
        for ($column = (int)$firstColumn; $column <= (int)$lastColumn; $column++) {
            $letter = Coordinate::stringFromColumnIndex($column + 1);
            $this->sheet->getColumnDimension($letter)->setWidth((float)$width);
        }
    }
    public function write($row, $column, $value, $format = null)
    {
        $coordinate = [(int)$column + 1, (int)$row + 1];
        $this->sheet->setCellValueExplicit($coordinate, (string)$value, DataType::TYPE_STRING);
        $this->applyFormat($row, $column, $format);
    }
    public function writeNumber($row, $column, $value, $format = null)
    {
        $coordinate = [(int)$column + 1, (int)$row + 1];
        $this->sheet->setCellValueExplicit($coordinate, (float)$value, DataType::TYPE_NUMERIC);
        $this->applyFormat($row, $column, $format);
... (18 lines truncated)
</file>

<file path="application/libraries/Yii/Application/AppErrorHandler.php">
<?php
namespace LimeSurvey\Yii\Application;
use Yii;
use CWebApplication;
use CHttpException;
use LSUserException;
class AppErrorHandler
{
    public function onException($dbVersion, $event)
    {
        if (!Yii::app() instanceof CWebApplication) {
            return;
        }
        if (defined('PHP_ENV') && PHP_ENV == 'test') {
            die($event->exception->getMessage());
        }
        if (!$dbVersion) {
            return;
        }
        if ($dbVersion < 200) {
            return;
        }
        if (Yii::app()->getRequest()->isRestRequest()) {
            $this->handleRestException($event);
        } else {
            $this->handleWebException($event);
        }
    }
    public function onError($dbVersion, $event)
    {
... (115 lines truncated)
</file>

<file path="application/libraries/BigData.php">
<?php
class BigData
{
    public static function json_echo($json, $options = 0)
    {
        $hasStream = array_reduce($json, array('BigData', 'hasStream'), false);
        if (!$hasStream) {
            echo json_encode($json, $options);
        } else {
            self::json_echo_data($json, ($options & JSON_FORCE_OBJECT) == JSON_FORCE_OBJECT);
        }
    }
    protected static function hasStream($result, $item)
    {
        if ($result === true) {
            return true;
        } elseif (is_array($item)) {
            return array_reduce($item, array('BigData', 'hasStream'), false);
        }
        elseif (self::isStream($item)) {
            return true;
        } else {
            return false;
        }
    }
    protected static function isStream($item)
    {
        return is_object($item) && get_class($item) == 'BigFile';
    }
    protected static function isAssociative($array)
... (158 lines truncated)
</file>

<file path="application/libraries/Date_Time_Converter.php">
<?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
class Date_Time_Converter
{
    public $date_time_stamp;
    public $date_time;
    public $date_time_mask;
    public $seconds;
    public $minutes;
    public $hours;
    public $days;
    public $months;
    public $years;
    public $ampm;
    public function __construct($sDate, $sFormat)
    {
        require_once(APPPATH . '/helpers/adodb/adodb-time.inc_helper.php');
        $this->_default_date_time_units();
        $this->date_time = $sDate;
        $this->date_time_mask = $sFormat;
        $this->date_time_stamp = $this->_date_to_timestamp($sDate, $sFormat);
    }
    public function __destruct()
    {
        unset($this->date_time_stamp);
        unset($this->date_time);
        unset($this->date_time_mask);
        unset($this->seconds);
... (229 lines truncated)
</file>

<file path="application/libraries/DI.php">
<?php
namespace LimeSurvey;
use ArchivedTableSettings;
use DI\ContainerBuilder;
use CActiveRecord;
use LSYii_Application;
use LimeSurvey\PluginManager\PluginManager;
use CHttpSession;
use CDbConnection;
class DI
{
    private static $container = null;
    public static function getContainer()
    {
        if (!static::$container) {
            static::$container = static::makeContainer();
        }
        return static::$container;
    }
    public static function makeContainer()
    {
        $builder = new ContainerBuilder();
        $builder->useAttributes(true);
        $builder->addDefinitions([
            LSYii_Application::class => function () {
                return App();
            },
            PluginManager::class => function () {
                return App()->getPluginManager();
            },
... (14 lines truncated)
</file>

<file path="application/libraries/index.html">
<html>
<head>
	<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
</file>

<file path="application/libraries/jsonRPCClient.php">
<?php
class jsonRPCClient
{
    private $debug;
    private $url;
    private $id;
    private $notification = false;
    public function __construct($url, $debug = false)
    {
        $this->url = $url;
        empty($debug) ? $this->debug = false : $this->debug = true;
        $this->id = 1;
    }
    public function setRPCNotification($notification)
    {
        empty($notification) ?
                            $this->notification = false
                            :
                            $this->notification = true;
    }
    public function __call($method, $params)
    {
        if (!is_scalar($method)) {
            throw new Exception('Method name has no scalar value');
        }
        if (is_array($params)) {
            $params = array_values($params);
        } else {
            throw new Exception('Params must be given as array');
        }
... (54 lines truncated)
</file>

<file path="application/libraries/jsonRPCServer.php">
<?php
class jsonRPCServer
{
    public static function handle($object)
    {
        if (
            $_SERVER['REQUEST_METHOD'] != 'POST' ||
            empty($_SERVER['CONTENT_TYPE']) ||
            $_SERVER['CONTENT_TYPE'] != 'application/json'
        ) {
            return false;
        }
        $request = json_decode(file_get_contents('php://input'), true);
        try {
            if ($result = @call_user_func_array(array($object, sanitize_alphanumeric($request['method'])), $request['params'])) {
                $response = array(
                                    'id' => $request['id'],
                                    'result' => $result,
                                    'error' => null
                                    );
            } else {
                $response = array(
                                    'id' => $request['id'],
                                    'result' => null,
                                    'error' => 'unknown method or incorrect parameters'
                                    );
            }
        } catch (Exception $e) {
            $response = array(
                                'id' => $request['id'],
... (12 lines truncated)
</file>

<file path="application/libraries/LSjsonRPCServer.php">
<?php
    Yii::import('application.libraries.BigData', true);
    Yii::import('application.libraries.jsonRPCServer');
class LSjsonRPCServer extends jsonRPCServer
{
    public static function handle($object)
    {
        if (
            $_SERVER['REQUEST_METHOD'] != 'POST' ||
            empty($_SERVER['CONTENT_TYPE']) ||
            strpos((string) $_SERVER['CONTENT_TYPE'], "application/json") === false
        ) {
            return false;
        }
        $request = json_decode(file_get_contents('php://input'), true);
        if (is_null($request)) {
            $response = array(
                                'id' => null,
                                'result' => null,
                                'error' => sprintf('unable to decode malformed json')
                                );
        } else {
            try {
                $result = @call_user_func_array(array($object, $request['method']), $request['params']);
                if ($result !== false) {
                    $response = array(
                                        'id' => $request['id'],
                                        'result' => $result,
                                        'error' => null
                                        );
... (23 lines truncated)
</file>

<file path="application/libraries/LSZend_XmlRpc_Response_Http.php">
<?php
    Yii::import('application.libraries.BigData', true);
class LSZend_XmlRpc_Response_Http extends Zend_XmlRpc_Response_Http
{
    public function printXml()
    {
        echo '<methodResponse>';
        echo '<params>';
        echo '<param>';
        echo '<value>';
        BigData::xmlrpc_echo($this->_return);
        echo '</value>';
        echo '</param>';
        echo '</params>';
        echo '</methodResponse>';
    }
}
</file>

<file path="application/libraries/MersenneTwister.php">
<?php
namespace ls\mersenne;
function setSeed($surveyid, $survey = null)
{
    if (isset($_SESSION['responses_' . $surveyid]['srid'])) {
        $oResponse = \Response::model($surveyid)->findByPk($_SESSION['responses_' . $surveyid]['srid']);
        $seed = $oResponse->seed;
        if (empty($seed)) {
            $seed = mt_rand();
            $oResponse->seed = $seed;
            $oResponse->save();
        }
    } else {
        $seed = mt_rand();
        if (!$survey) {
            $survey = \Survey::model()->findByPk($surveyid);
        }
        if ($survey->getIsActive()) {
            $table = \Yii::app()->db->schema->getTable('{{responses_' . $surveyid . '}}');
            if (isset($table->columns['seed'])) {
                $_SESSION['responses_' . $surveyid]['startingValues']['seed'] = $seed;
            }
        }
    }
    MersenneTwister::init($seed);
}
function shuffle(array $arr)
{
    $mt = MersenneTwister::getInstance();
    return $mt->shuffle($arr);
... (76 lines truncated)
</file>

<file path="application/libraries/Save.php">
<?php
class Save
{
    public $aSaveErrors = array();
    public $saveData = null;
    function getSaveFormDatas($iSurveyId)
    {
        $thisstep    = $_SESSION['responses_' . $iSurveyId]['step'] ?? 0;
        $clienttoken = $_SESSION['responses_' . $iSurveyId]['token'] ?? '';
        $survey = Survey::model()->findByPk($iSurveyId);
        $aSaveForm['aErrors'] = $this->aSaveErrors;
        $this->launchSaveFormEvent($iSurveyId);
        $aSaveForm['aCaptcha']['show'] = false;
        if ($survey->isCaptchaEnabled('saveandloadscreen')) {
            $aSaveForm['aCaptcha']['show'] = true;
            $aSaveForm['aCaptcha']['sImageUrl'] = Yii::app()->getController()->createUrl('/verification/image', array('sid' => $iSurveyId));
        }
        $aSaveForm['sHiddenField'] = CHtml::hiddenField('thisstep', $thisstep);
        $aSaveForm['sHiddenField'] .= CHtml::hiddenField('savesubmit', 'save');
        if ($clienttoken) {
            $aSaveForm['sHiddenField'] .= CHtml::hiddenField('token', $clienttoken);
        }
        return $aSaveForm;
    }
    function saveSurvey()
    {
        global $surveyid, $thissurvey, $errormsg, $publicurl, $sitename, $clienttoken, $thisstep;
        $survey = Survey::model()->findByPk($surveyid);
        $aSaveForm  = array();
        $this->saveData = array(
... (155 lines truncated)
</file>

<file path="application/libraries/simpletester.php">
<?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
$libraryDir = APPPATH . 'libraries/simpletest';
if (!is_dir($libraryDir)) {
    exit("Simpletest must be located in \"$libraryDir\"");
}
require_once($libraryDir . '/unit_tester.php');
require_once($libraryDir . '/mock_objects.php');
require_once($libraryDir . '/reporter.php');
class SimpleTester
{
    public $Reporter = 'MinimalReporter';
    private $testDir;
    private $testTitle;
    private $fileExtension;
    public function __construct($params)
    {
        $ci =& get_instance();
        if (isset($params['runFromIPs']) && strpos((string) $params['runFromIPs'], $ci->input->server('SERVER_ADDR') === false)) {
            $params['noautorun'] = true;
        }
        $header = 'CONTENT_TYPE';
        if (!empty($_SERVER[$header])) {
            $ajaxContentTypes = array('application/x-www-form-urlencoded', 'multipart/form-data');
            foreach ($ajaxContentTypes as $ajaxContentType) {
                if (false !== stripos((string) $_SERVER[$header], $ajaxContentType)) {
                    $params['noautorun'] = true;
                    break;
... (120 lines truncated)
</file>

<file path="application/libraries/Zip.php">
<?php
namespace LimeSurvey;
class Zip extends \ZipArchive
{
    protected $opened = false;
    public function open($filename, $flags = 0, $checkZipBomb = true)
    {
        $result = parent::open($filename, $flags);
        $this->opened = ($result === true);
        if ($result === true && $checkZipBomb && $this->isZipBomb()) {
            throw new \Exception("Unzipped file is bigger than upload_max_filesize or post_max_size");
        }
        return $result;
    }
    public function close(): bool
    {
        $result = parent::close();
        $this->opened = false;
        return $result;
    }
    public function isZipBomb()
    {
        if (!$this->opened) {
            return false;
        }
        $totalSize = 0;
        for ($i = 0; $i < $this->numFiles; $i++) {
            $fileStats = $this->statIndex($i);
            $totalSize += $fileStats['size'];
        }
... (4 lines truncated)
</file>

<file path="application/models/behaviors/PluginEventBehavior.php">
<?php
use LimeSurvey\PluginManager\PluginEvent;
class PluginEventBehavior extends CModelBehavior
{
    public function events()
    {
        return array_merge(
            parent::events(),
            array(
                'onAfterDelete'  => 'afterDelete',
                'onAfterSave'    => 'afterSave',
                'onBeforeDelete' => 'beforeDelete',
                'onBeforeSave'   => 'beforeSave',
            )
        );
    }
    public function afterDelete(CEvent $event)
    {
        $this->dispatchPluginModelEvent('after' . get_class($this->owner) . 'Delete');
        $this->dispatchDynamic('after', 'Delete');
        $this->dispatchPluginModelEvent('afterModelDelete');
    }
    public function afterSave(CEvent $event)
    {
        $pluginManager = App()->getPluginManager();
        if ($pluginManager->shutdownObject->isEnabled()) {
            return;
        }
        $this->dispatchPluginModelEvent('after' . get_class($this->owner) . 'Save');
        $this->dispatchDynamic('after', 'Save');
... (45 lines truncated)
</file>

<file path="application/models/Interfaces/PermissionInterface.php">
<?php
interface PermissionInterface
{
    public const SINGLE_PERMISSIONS =
        [
        'create',
        'read',
        'update',
        'delete',
        'import',
        'export'
        ];
    public function getOwnerId();
    public static function getPermissionData();
    public static function getMinimalPermissionRead();
    public function hasPermission($sPermission, $sCRUD = 'read', $iUserID = null);
    public function getPrimaryKey();
}
</file>

<file path="application/models/services/EditorService/EditorConfig.php">
<?php
namespace LimeSurvey\Models\Services\EditorService;
class EditorConfig
{
    private bool $isQuestionEditorEnabled;
    public function __construct(bool $isQuestionEditorEnabled = true)
    {
        $this->isQuestionEditorEnabled = $isQuestionEditorEnabled;
    }
    public function initAppConfig()
    {
        App()->setConfig('editorEnabled', $this->getIsEditorEnabled());
    }
    public function getIsEditorEnabled()
    {
        $result = false;
        if ($this->isBackendAccess()) {
            if ($this->isQuestionEditorEnabled) {
                $surveyId = EditorRequestHelper::findSurveyId();
                if (!$surveyId) {
                    $result = true;
                } else {
                    $survey = \Survey::model()->findByPk($surveyId);
                    if ($survey && $survey->getIsEditorCompatible()) {
                        $result = true;
                    }
                }
            }
        }
        return $result;
... (7 lines truncated)
</file>

<file path="application/models/services/EditorService/EditorRedirector.php">
<?php
namespace LimeSurvey\Models\Services\EditorService;
use SettingsUser;
use Yii;
class EditorRedirector
{
    private $routingMap = [
        'surveyAdministration/view' => 'survey/$surveyId',
        'surveyAdministration/rendersidemenulink/subaction/generalsettings/surveyid/' => 'survey/$surveyId/settings/generalsettings',
        'questionAdministration/view' => 'survey/$surveyId/?question=$questionId',
        'questionAdministration/edit' => 'survey/$surveyId/?question=$questionId',
        'questionAdministration/create' => 'survey/$surveyId/structure',
        'questionGroupsAdministration/add' => 'survey/$surveyId/structure',
        'questionGroupsAdministration/view' => 'survey/$surveyId?group=$questionGroupId',
        'questionGroupsAdministration/edit' => 'survey/$surveyId?group=$questionGroupId',
        'admin/statistics/sa/simpleStatistics/surveyid/' => 'responses/$surveyId',
    ];
    public function handleRedirect()
    {
        $isEditorEnabled = App()->getConfig('editorEnabled');
        if ($isEditorEnabled) {
            $path = Yii::app()->request->getPathInfo();
            foreach ($this->routingMap as $source => $destination) {
                if ($path == $source || strpos($path, $source) === 0) {
                    $surveyId = EditorRequestHelper::findSurveyId();
                    if ($surveyId !== null || strpos($destination, '$surveyId') === false) {
                        $this->redirectToEditorRoute($destination);
                    }
                    break;
                }
... (42 lines truncated)
</file>

<file path="application/models/services/EditorService/EditorRequestHelper.php">
<?php
namespace LimeSurvey\Models\Services\EditorService;
use CHttpRequest;
use Yii;
class EditorRequestHelper
{
    public static function findSurveyId(?CHttpRequest $request = null)
    {
        $request = $request ? $request : Yii::app()->request;
        $possibleSurveyIdValues = [
            $request->getParam('sid'),
            $request->getParam('surveyId'),
            $request->getParam('surveyid'),
            $request->getParam('iSurveyId'),
            $request->getParam('isurveyid'),
            $request->getParam('iSurveyID')
        ];
        $surveyId = null;
        foreach ($possibleSurveyIdValues as $value) {
            $sanitizedValue = sanitize_int($value);
            if ($sanitizedValue == '0' || !empty($sanitizedValue)) {
                $surveyId = $sanitizedValue;
                break;
            }
        }
        return $surveyId;
    }
    public static function findQuestionId(?CHttpRequest $request = null)
    {
        $request = $request ? $request : Yii::app()->request;
... (33 lines truncated)
</file>

<file path="application/models/services/Exception/BadRequestException.php">
<?php
namespace LimeSurvey\Models\Services\Exception;
use LimeSurvey\Models\Services\Exception;
use Throwable;
class BadRequestException extends Exception
{
    public function __construct(
        $message = "",
        $code = 400,
        ?Throwable $previous = null
    ) {
        parent::__construct($message, $code, $previous);
    }
}
</file>

<file path="application/models/services/Exception/NotFoundException.php">
<?php
namespace LimeSurvey\Models\Services\Exception;
use LimeSurvey\Models\Services\Exception;
use Throwable;
class NotFoundException extends Exception
{
    public function __construct(
        $message = "",
        $code = 404,
        ?Throwable $previous = null
    ) {
        parent::__construct($message, $code, $previous);
    }
}
</file>

<file path="application/models/services/Exception/PermissionDeniedException.php">
<?php
namespace LimeSurvey\Models\Services\Exception;
use LimeSurvey\Models\Services\Exception;
use Throwable;
class PermissionDeniedException extends Exception
{
    public function __construct(
        $message = "",
        $code = 403,
        ?Throwable $previous = null
    ) {
        parent::__construct($message, $code, $previous);
    }
}
</file>

<file path="application/models/services/Exception/PersistErrorException.php">
<?php
namespace LimeSurvey\Models\Services\Exception;
use LimeSurvey\Models\Services\Exception;
use Throwable;
class PersistErrorException extends Exception
{
    public function __construct(
        $message = "",
        $code = 500,
        ?Throwable $previous = null
    ) {
        parent::__construct($message, $code, $previous);
    }
}
</file>

<file path="application/models/services/Exception/QuestionHasConditionsException.php">
<?php
namespace LimeSurvey\Models\Services\Exception;
class QuestionHasConditionsException extends PersistErrorException
{
}
</file>

<file path="application/models/services/Export/CsvExportWriter.php">
<?php
namespace LimeSurvey\Models\Services\Export;
use RuntimeException;
class CsvExportWriter implements ExportWriterInterface
{
    use ExportHeadingTrait;
    private $handle = null;
    private ?string $filePath = null;
    private string $filename = '';
    /** @var array Metadata from init */
    private array $metadata = [];
    /** @var int Response count for chunked writing */
    private int $responseCount = 0;
    /** @var bool Whether headers have been written */
    private bool $headersWritten = false;
    /** @var array Active metadata columns from fieldMap */
    private array $metaColumns = [];
    /** @var string Field separator character */
    private string $separator = ',';
    /**
     * Export survey responses to CSV format.
     *
     * Can generate content in-memory or write to a file depending on outputMode.
     *
     * @param array $responses The survey responses data
     * @param array $surveyQuestions The survey questions field map
     * @param array $metadata Additional metadata (survey ID, language, outputMode, etc.)
     * @return array Export result with content/filePath and metadata
     * @throws RuntimeException If content cannot be generated or file cannot be created
     * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
... (146 lines truncated)
</file>

<file path="application/models/services/Export/ExportAnswerFormatter.php">
<?php
namespace LimeSurvey\Models\Services\Export;
use LimeSurvey\Models\Services\SurveyAnswerCache;
use Question;
use QuestionAttribute;
class ExportAnswerFormatter
{
    private const ANSWER_CODE_MAPS = [
        Question::QT_Y_YES_NO_RADIO => ['Y' => 'Yes', 'N' => 'No'],
        Question::QT_G_GENDER => ['M' => 'Male', 'F' => 'Female'],
        Question::QT_C_ARRAY_YES_UNCERTAIN_NO => ['Y' => 'Yes', 'N' => 'No', 'U' => 'Uncertain'],
        Question::QT_E_ARRAY_INC_SAME_DEC => ['I' => 'Increase', 'S' => 'Same', 'D' => 'Decrease'],
    ];
    private const RAW_FALLBACK_TYPES = [
        Question::QT_C_ARRAY_YES_UNCERTAIN_NO,
        Question::QT_E_ARRAY_INC_SAME_DEC,
    ];
    private $answerCache;
    public function __construct(SurveyAnswerCache $answerCache)
    {
        $this->answerCache = $answerCache;
    }
    public function loadAnswers($surveyId, $language)
    {
        $this->answerCache->load($surveyId, $language);
    }
    public function formatFullAnswer($value, $type, $fieldKey, $qid = null)
    {
        if ($type === null) {
            return $value;
... (134 lines truncated)
</file>

<file path="application/models/services/Export/ExportHeadingTrait.php">
<?php
namespace LimeSurvey\Models\Services\Export;
trait ExportHeadingTrait
{
    private function buildQuestionHeading(array $question): string
    {
        $questionText = $this->cleanHeadingText($question['question'] ?? '');
        $hasSubQuestion = isset($question['aid']) && $question['aid'] !== '';
        if ($hasSubQuestion) {
            $subHeadingParts = [];
            if (!empty($question['subquestion'])) {
                $subHeadingParts[] = '[' . $this->cleanHeadingText($question['subquestion']) . ']';
            }
            if (!empty($question['subquestion1'])) {
                $subHeadingParts[] = '[' . $this->cleanHeadingText($question['subquestion1']) . ']';
            }
            if (!empty($question['subquestion2'])) {
                $subHeadingParts[] = '[' . $this->cleanHeadingText($question['subquestion2']) . ']';
            }
            if (!empty($subHeadingParts)) {
                $questionText .= ' ' . implode('', $subHeadingParts);
            }
        }
        if (!empty($question['scale'])) {
            $questionText .= ' [' . $this->cleanHeadingText($question['scale']) . ']';
        }
        $questionText = trim($questionText);
        if ($questionText === '') {
            $questionText = $question['title'] ?? "Q{$question['qid']}";
        }
... (8 lines truncated)
</file>

<file path="application/models/services/Export/ExportWriterInterface.php">
<?php
namespace LimeSurvey\Models\Services\Export;
interface ExportWriterInterface
{
    public function export(array $responses, array $surveyQuestions, array $metadata): array;
    public function init(array $surveyQuestions, array $metadata): void;
    public function writeChunk(array $responses, array $surveyQuestions): void;
    public function finalize(): array;
    public function getFileExtension(): string;
    public function getMimeType(): string;
}
</file>

<file path="application/models/services/Export/HtmlExportWriter.php">
<?php
namespace LimeSurvey\Models\Services\Export;
use RuntimeException;
class HtmlExportWriter implements ExportWriterInterface
{
    use ExportHeadingTrait;
    private $handle = null;
    private ?string $filePath = null;
    private string $filename = '';
    /** @var array Metadata from init */
    private array $metadata = [];
    /** @var int Response count */
    private int $responseCount = 0;
    /** @var array Active metadata columns from fieldMap */
    private array $metaColumns = [];
    /**
     * Export survey responses to HTML format.
     *
     * @param array $responses The survey responses data
     * @param array $surveyQuestions The survey questions field map
     * @param array $metadata Additional metadata (survey ID, language, outputMode, etc.)
     * @return array Export result with content/filePath and metadata
     * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
     */
    #[\Override]
    public function export(array $responses, array $surveyQuestions, array $metadata): array
    {
        $this->init($surveyQuestions, $metadata);
        $this->writeChunk($responses, $surveyQuestions);
        return $this->finalize();
... (150 lines truncated)
</file>

<file path="application/models/services/Proxy/ProxyExpressionManager.php">
<?php
namespace LimeSurvey\Models\Services\Proxy;
use Survey;
use QuestionGroup;
use LimeExpressionManager;
use EmCacheHelper;
class ProxyExpressionManager
{
    private Survey $modelSurvey;
    private QuestionGroup $modelQuestionGroup;
    public function __construct(Survey $modelSurvey, QuestionGroup $modelQuestionGroup)
    {
        $this->modelSurvey = $modelSurvey;
        $this->modelQuestionGroup = $modelQuestionGroup;
    }
    public function reset($surveyId)
    {
        $survey = $this->modelSurvey->findByPk($surveyId);
        LimeExpressionManager::SetDirtyFlag();
        LimeExpressionManager::UpgradeConditionsToRelevance(
            $surveyId
        );
        LimeExpressionManager::SetPreviewMode('database');
        LimeExpressionManager::StartSurvey(
            $surveyId,
            'survey',
            $survey->attributes,
            true
        );
        LimeExpressionManager::StartProcessingPage(
... (31 lines truncated)
</file>

<file path="application/models/services/Proxy/ProxyQuestion.php">
<?php
namespace LimeSurvey\Models\Services\Proxy;
use Question;
class ProxyQuestion
{
    public static function getHighestQuestionOrderNumberInGroup($questionGroupId)
    {
        return Question::getHighestQuestionOrderNumberInGroup($questionGroupId);
    }
    public static function getMaxQuestionOrder($gid)
    {
        return getMaxQuestionOrder($gid);
    }
}
</file>

<file path="application/models/services/Proxy/ProxyQuestionGroup.php">
<?php
namespace LimeSurvey\Models\Services\Proxy;
use QuestionGroup;
class ProxyQuestionGroup
{
    public function deleteQuestionGroupWithDependency(int $questionGroupId, int $surveyId)
    {
        return QuestionGroup::deleteWithDependency($questionGroupId, $surveyId);
    }
}
</file>

<file path="application/models/services/Proxy/ProxySettingsUser.php">
<?php
namespace LimeSurvey\Models\Services\Proxy;
use SettingsUser;
class ProxySettingsUser
{
    public function getUserSettingValue(
        $stg_name,
        $uid = null,
        $entity = null,
        $entity_id = null,
        $default = null
    ) {
        return SettingsUser::getUserSettingValue(
            $stg_name,
            $uid,
            $entity,
            $entity_id,
            $default
        );
    }
    public static function setUserSetting($stg_name, $stg_value, $uid = null, $entity = null, $entity_id = null)
    {
        return SettingsUser::setUserSetting(
            $stg_name,
            $stg_value,
            $uid,
            $entity,
            $entity_id
        );
    }
... (11 lines truncated)
</file>

<file path="application/models/services/QuestionAggregateService/AnswersService.php">
<?php
namespace LimeSurvey\Models\Services\QuestionAggregateService;
use DI\DependencyException;
use Question;
use Answer;
use AnswerL10n;
use LimeSurvey\DI;
use LimeSurvey\Models\Services\Exception\{
    BadRequestException,
    PersistErrorException,
    NotFoundException,
    PermissionDeniedException
};
class AnswersService
{
    use ValidateTrait;
    private Answer $modelAnswer;
    private AnswerL10n $modelAnswerL10n;
    public function __construct(
        Answer $modelAnswer,
        AnswerL10n $modelAnswerL10n
    ) {
        $this->modelAnswer = $modelAnswer;
        $this->modelAnswerL10n = $modelAnswerL10n;
    }
    public function save(Question $question, $answerOptions)
    {
        if ($question->questionType->answerscales > 0) {
            $this->storeAnswerOptions(
                $question,
... (100 lines truncated)
</file>

<file path="application/models/services/QuestionAggregateService/AttributesService.php">
<?php
namespace LimeSurvey\Models\Services\QuestionAggregateService;
use LimeSurvey\Models\Services\QuestionAttributeHelper;
use Question;
use QuestionAttribute;
use LimeSurvey\Models\Services\Exception\PersistErrorException;
use Survey;
class AttributesService
{
    private QuestionAttribute $modelQuestionAttribute;
    private QuestionAttributeHelper $questionAttributeHelper;
    private Survey $modelSurvey;
    public function __construct(
        QuestionAttribute $modelQuestionAttribute,
        QuestionAttributeHelper $questionAttributeHelper,
        Survey $modelSurvey
    ) {
        $this->modelQuestionAttribute = $modelQuestionAttribute;
        $this->questionAttributeHelper = $questionAttributeHelper;
        $this->modelSurvey = $modelSurvey;
    }
    public function saveAdvanced($question, $dataSet)
    {
        foreach ($dataSet as $category => $categorySettings) {
            if ($category === 'debug') {
                continue;
            }
            $this->save($question, $categorySettings);
        }
        if (!$question->save()) {
... (155 lines truncated)
</file>

<file path="application/models/services/QuestionAggregateService/DeleteService.php">
<?php
namespace LimeSurvey\Models\Services\QuestionAggregateService;
use Answer;
use AnswerL10n;
use CDbCriteria;
use Condition;
use Question;
use QuestionL10n;
use LimeSurvey\Models\Services\{
    Proxy\ProxyExpressionManager,
    Exception\NotFoundException,
    Exception\PersistErrorException,
    Exception\QuestionHasConditionsException
};
class DeleteService
{
    private Question $modelQuestion;
    private QuestionL10n $modelQuestionL10n;
    private Condition $modelCondition;
    private ProxyExpressionManager $proxyExpressionManager;
    public function __construct(
        Question $modelQuestion,
        QuestionL10n $modelQuestionL10n,
        Condition $modelCondition,
        ProxyExpressionManager $proxyExpressionManager
    ) {
        $this->modelQuestion = $modelQuestion;
        $this->modelQuestionL10n = $modelQuestionL10n;
        $this->modelCondition = $modelCondition;
        $this->proxyExpressionManager = $proxyExpressionManager;
... (49 lines truncated)
</file>

<file path="application/models/services/QuestionAggregateService/L10nService.php">
<?php
namespace LimeSurvey\Models\Services\QuestionAggregateService;
use QuestionL10n;
use LimeSurvey\DI;
use LimeSurvey\Models\Services\Exception\{
    PersistErrorException,
    NotFoundException
};
class L10nService
{
    private QuestionL10n $modelQuestionL10n;
    public function __construct(
        QuestionL10n $modelQuestionL10n
    ) {
        $this->modelQuestionL10n = $modelQuestionL10n;
    }
    public function save($questionId, $data, $createIfNotExists = true)
    {
        foreach ($data as $language => $l10nBlock) {
            $language = !empty($l10nBlock['language'])
                ? $l10nBlock['language']
                : $language;
            $l10n = $this->modelQuestionL10n
                ->findByAttributes([
                    'qid' => $questionId,
                    'language' => $language
                ]);
            if (empty($l10n)) {
                if ($createIfNotExists) {
                    $l10n = DI::getContainer()
... (33 lines truncated)
</file>

<file path="application/models/services/QuestionAggregateService/QuestionService.php">
<?php
namespace LimeSurvey\Models\Services\QuestionAggregateService;
use Question;
use QuestionAttribute;
use Survey;
use Answer;
use AnswerL10n;
use LimeExpressionManager;
use Condition;
use LSYii_Application;
use LimeSurvey\DI;
use LimeSurvey\Models\Services\{
    QuestionAttributeHelper,
    Proxy\ProxySettingsUser,
    Proxy\ProxyQuestion,
    Exception\PersistErrorException,
    Exception\NotFoundException,
    Exception\PermissionDeniedException
};
class QuestionService
{
    private Question $modelQuestion;
    private Survey $modelSurvey;
    private Condition $modelCondition;
    private L10nService $l10nService;
    private QuestionAttributeHelper $questionAttributeHelper;
    private ProxySettingsUser $proxySettingsUser;
    private ProxyQuestion $proxyQuestion;
    private LSYii_Application $yiiApp;
    public function __construct(
... (299 lines truncated)
</file>

<file path="application/models/services/QuestionAggregateService/SaveService.php">
<?php
namespace LimeSurvey\Models\Services\QuestionAggregateService;
use Question;
use LimeSurvey\Models\Services\{
    QuestionAggregateService\QuestionService,
    QuestionAggregateService\L10nService,
    QuestionAggregateService\AttributesService,
    QuestionAggregateService\AnswersService,
    QuestionAggregateService\SubQuestionsService,
    Proxy\ProxyExpressionManager,
    Exception\PersistErrorException,
    Exception\NotFoundException,
    Exception\PermissionDeniedException
};
class SaveService
{
    private QuestionService $questionService;
    private L10nService $l10nService;
    private AttributesService $attributesService;
    private AnswersService $answersService;
    private SubQuestionsService $subQuestionsService;
    private ProxyExpressionManager $proxyExpressionManager;
    public function __construct(
        QuestionService $questionService,
        L10nService $l10nService,
        AttributesService $attributesService,
        AnswersService $answersService,
        SubQuestionsService $subQuestionsService,
        ProxyExpressionManager $proxyExpressionManager
    ) {
... (69 lines truncated)
</file>

<file path="application/models/services/QuestionAggregateService/SubQuestionsService.php">
<?php
namespace LimeSurvey\Models\Services\QuestionAggregateService;
use Permission;
use Question;
use Survey;
use LimeSurvey\DI;
use LimeSurvey\Models\Services\Exception\{
    PersistErrorException,
    NotFoundException,
    PermissionDeniedException,
    BadRequestException
};
class SubQuestionsService
{
    use ValidateTrait;
    private L10nService $l10nService;
    private Question $modelQuestion;
    private Survey $modelSurvey;
    private Permission $modelPermission;
    public function __construct(
        L10nService $l10nService,
        Question $modelQuestion,
        Survey $modelSurvey,
        Permission $modelPermission
    ) {
        $this->l10nService = $l10nService;
        $this->modelQuestion = $modelQuestion;
        $this->modelSurvey = $modelSurvey;
        $this->modelPermission = $modelPermission;
    }
... (145 lines truncated)
</file>

<file path="application/models/services/QuestionAggregateService/ValidateTrait.php">
<?php
namespace LimeSurvey\Models\Services\QuestionAggregateService;
use LimeSurvey\Models\Services\{
    Exception\PersistErrorException,
};
trait ValidateTrait
{
    public function validateCodes($requestDataArray)
    {
        $codes = [];
        foreach ($requestDataArray as $dataArray) {
            foreach ($dataArray as $scaleId => $data) {
                if (!isset($codes[$scaleId])) {
                    $codes[$scaleId] = [];
                }
                if (
                    isset($data['code'])
                    && isset($codes[$scaleId])
                    && in_array(
                        $data['code'],
                        $codes[$scaleId]
                    )
                ) {
                    throw new PersistErrorException(
                        'Subquestion/Answer codes must be unique'
                    );
                }
                if (isset($data['code'])) {
                    $codes[$scaleId][] = $data['code'];
                }
... (5 lines truncated)
</file>

<file path="application/models/services/QuestionOrderingService/QuestionOrderingService.php">
<?php
namespace LimeSurvey\Models\Services\QuestionOrderingService;
use Question;
use Yii;
use LimeSurvey\Helpers\SortHelper;
use LimeSurvey\Models\Services\QuestionOrderingService\SortingStrategy;
use LimeSurvey\Models\Services\QuestionOrderingService\RandomizerHelper;
class QuestionOrderingService
{
    private $sortingStrategy;
    private $randomizerHelper;
    public function __construct()
    {
        $this->sortingStrategy = new SortingStrategy();
        $this->randomizerHelper = new RandomizerHelper();
    }
    public function getOrderedAnswers(
        Question $question,
        $scaleId = null,
        $language = null
    ) {
        $answerOptions = [
            0 => []
        ];
        foreach ($question->answers as $answer) {
            if ($scaleId !== null && $answer->scale_id != $scaleId) {
                continue;
            }
            $answerOptions[$answer->scale_id][] = $answer;
        }
... (113 lines truncated)
</file>

<file path="application/models/services/QuestionOrderingService/RandomizerHelper.php">
<?php
namespace LimeSurvey\Models\Services\QuestionOrderingService;
use Question;
use Survey;
class RandomizerHelper
{
    public function initialize(int $surveyId, $survey = null): void
    {
        require_once(App()->basePath . '/libraries/MersenneTwister.php');
        \ls\mersenne\setSeed($surveyId, $survey);
    }
    public function applyRandomSorting(array $groupedItems, Question $question, string $context)
    {
        if ($context === 'subquestions') {
            return $this->applyRandomSortingToSubquestions($groupedItems, $question);
        }
        $keepCodes = $this->getKeepCodes($question);
        return $this->applyRandomSortingToAnswers($groupedItems, $keepCodes);
    }
    public function applyRandomSortingToSubquestions(
        array $groupedSubquestions,
        Question $question,
        $survey = null
    ) {
        $this->initialize($question->sid, $survey);
        return $this->applyRandomSortingToSubquestionGroups(
            $groupedSubquestions,
            $this->getKeepCodes($question)
        );
    }
... (100 lines truncated)
</file>

<file path="application/models/services/QuestionOrderingService/SortingStrategy.php">
<?php
namespace LimeSurvey\Models\Services\QuestionOrderingService;
use Question;
class SortingStrategy
{
    public function determine(Question $question, string $context = 'answers'): string
    {
        if ($this->shouldOrderRandomly($question, $context)) {
            return 'random';
        }
        if ($this->shouldOrderAlphabetically($question, $context)) {
            return 'alphabetical';
        }
        return 'normal';
    }
    private function shouldOrderRandomly(Question $question, string $context = 'answers'): bool
    {
        if ($context === 'answers') {
            return ($question->getQuestionAttribute('random_order') == 1
                    && $this->answersRandomizable($question))
                || $question->getQuestionAttribute('answer_order') === 'random';
        }
        return $question->getQuestionAttribute('random_order') == 1
            || $question->getQuestionAttribute('subquestion_order') === 'random';
    }
    private function shouldOrderAlphabetically(Question $question, string $context = 'answers'): bool
    {
        if ($context === 'answers') {
            $orderAttribute = $question->getQuestionAttribute('answer_order');
        } else {
... (13 lines truncated)
</file>

<file path="application/models/services/SurveyAggregateService/GeneralSettings.php">
<?php
namespace LimeSurvey\Models\Services\SurveyAggregateService;
use Survey;
use Permission;
use LSYii_Application;
use PluginEvent;
use CHttpSession;
use LimeSurvey\PluginManager\PluginManager;
use LimeSurvey\Models\Services\Exception\{
    PersistErrorException,
    NotFoundException,
    PermissionDeniedException
};
use User;
use LimeSurvey\Models\Services\SurveyAccessModeService;
class GeneralSettings
{
    private Permission $modelPermission;
    private Survey $modelSurvey;
    private LSYii_Application $yiiApp;
    private CHttpSession $session;
    private PluginManager $pluginManager;
    private LanguageConsistency $languageConsistency;
    private User $modelUser;
    private SurveyAccessModeService $surveyAccessModeService;
    private $restMode = false;
    public const FIELD_TYPE_YN = 'yesorno';
    public const FIELD_TYPE_DATETIME = 'datetime';
    public const FIELD_TYPE_GAKEY = 'gakey';
    public const FIELD_TYPE_USE_CAPTCHA = 'use_captcha';
... (431 lines truncated)
</file>

<file path="application/models/services/SurveyAggregateService/LanguageConsistency.php">
<?php
namespace LimeSurvey\Models\Services\SurveyAggregateService;
use Survey;
use LSYii_Application;
use SurveyLanguageSetting;
use CDbCriteria;
class LanguageConsistency
{
    private SurveyLanguageSetting $modelSurveyLanguageSetting;
    private LSYii_Application $yiiApp;
    public function __construct(
        SurveyLanguageSetting $modelSurveyLanguageSetting,
        LSYii_Application $yiiApp
    ) {
        $this->modelSurveyLanguageSetting = $modelSurveyLanguageSetting;
        $this->yiiApp = $yiiApp;
    }
    public function update(Survey $survey, $initBaseLanguage)
    {
        $surveyTitle = $survey
            ->languagesettings[$initBaseLanguage]
            ->surveyls_title;
        $aAvailableLanguages = $survey->getAllLanguages();
        foreach ($aAvailableLanguages as $sLang) {
            if ($sLang) {
                $this->updateLanguage(
                    $survey,
                    $sLang,
                    $surveyTitle
                );
... (61 lines truncated)
</file>

<file path="application/models/services/SurveyAggregateService/LanguageSettings.php">
<?php
namespace LimeSurvey\Models\Services\SurveyAggregateService;
use Survey;
use Permission;
use SurveyLanguageSetting;
use LimeSurvey\Models\Services\Exception\{
    PersistErrorException,
    NotFoundException,
    PermissionDeniedException
};
class LanguageSettings
{
    private ?Permission $modelPermission;
    private ?Survey $modelSurvey;
    private ?SurveyLanguageSetting $modelSurveyLanguageSetting;
    private $inputFields = [
        'surveyls_url',
        'surveyls_urldescription',
        'surveyls_title',
        'surveyls_alias',
        'surveyls_description',
        'surveyls_welcometext',
        'surveyls_endtext',
        'surveyls_policy_notice',
        'surveyls_policy_error',
        'surveyls_policy_notice_label',
        'surveyls_dateformat',
        'surveyls_numberformat'
    ];
    public function __construct(
... (105 lines truncated)
</file>

<file path="application/models/services/SurveyAggregateService/TemplateConfiguration.php">
<?php
namespace LimeSurvey\Models\Services\SurveyAggregateService;
class TemplateConfiguration
{
    public function update($surveyId)
    {
        \TemplateConfiguration::checkAndcreateSurveyConfig(
            $surveyId
        );
    }
}
</file>

<file path="application/models/services/SurveyAggregateService/UrlParams.php">
<?php
namespace LimeSurvey\Models\Services\SurveyAggregateService;
use SurveyURLParameter;
use LimeSurvey\Models\Services\Exception\{
    PersistErrorException,
    NotFoundException,
    PermissionDeniedException
};
class UrlParams
{
    private SurveyURLParameter $modelSurveyUrlParameter;
    public function __construct(SurveyURLParameter $modelSurveyUrlParameter)
    {
        $this->modelSurveyUrlParameter = $modelSurveyUrlParameter;
    }
    public function update($surveyId, $params)
    {
        $params = is_array($params) && !empty($params)
            ? $params
            : [];
        $this->modelSurveyUrlParameter
            ->deleteAllByAttributes(
                array('sid' => $surveyId)
            );
        foreach ($params as $param) {
            $param['parameter'] = trim((string) $param['parameter']);
            if (!SurveyURLParameter::isValidParameterName($param['parameter'])) {
                continue;
            }
            $param['targetqid'] = $param['qid'];
... (31 lines truncated)
</file>

<file path="application/models/services/SurveyStatistics/Charts/DailyActivity/DailyActivityStatistics.php">
<?php
namespace LimeSurvey\Models\Services\SurveyStatistics\Charts\DailyActivity;
use DateInterval;
use DatePeriod;
use DateTime;
use LimeSurvey\Models\Services\SurveyStatistics\Charts\StatisticsChartDTO;
use LimeSurvey\Models\Services\SurveyStatistics\Charts\StatisticsChartInterface;
use LimeSurvey\Models\Services\SurveyStatistics\StatisticsResponseFilters;
use Yii;
class DailyActivityStatistics implements StatisticsChartInterface
{
    private $filters = null;
    public function run(int $surveyId, string $language = 'en'): StatisticsChartDTO
    {
        [$startDate, $endDate] = $this->getDateRange();
        $countsByDate = $this->fetchCounts($surveyId, $startDate);
        [$legend, $dataItems, $total] = $this->buildSeries($countsByDate, $startDate, $endDate);
        return new StatisticsChartDTO(
            "Daily responses (last 30 days)",
            $legend,
            $dataItems,
            $total,
            ['period' => 'last_30_days']
        );
    }
    public function setFilters(StatisticsResponseFilters $filters): void
    {
        $this->filters = $filters;
    }
    private function getDateRange(): array
... (64 lines truncated)
</file>

<file path="application/models/services/SurveyStatistics/Charts/Questions/Processors/AbstractQuestionProcessor.php">
<?php
namespace LimeSurvey\Models\Services\SurveyStatistics\Charts\Questions\Processors;
use InvalidArgumentException;
use Question;
abstract class AbstractQuestionProcessor
{
    protected string $rt = '';
    /** @var array Current question data */
    protected array $question = [];
    /** @var int Survey ID for the current context */
    protected int $surveyId = 0;
    /** @var array Answer list for the question (if applicable) */
    protected array $answers = [];
    /** @var ResponseAggregateBatch Shared aggregate batch for the current run */
    protected ResponseAggregateBatch $batch;
    /** @var array List of question types which contain no answer option */
    protected array $noAnswerTypes = [
        Question::QT_L_LIST,
        Question::QT_EXCLAMATION_LIST_DROPDOWN,
        Question::QT_O_LIST_WITH_COMMENT,
        Question::QT_Y_YES_NO_RADIO,
        Question::QT_G_GENDER,
        Question::QT_5_POINT_CHOICE,
        Question::QT_A_ARRAY_5_POINT,
        Question::QT_B_ARRAY_10_CHOICE_QUESTIONS,
        Question::QT_C_ARRAY_YES_UNCERTAIN_NO,
        Question::QT_E_ARRAY_INC_SAME_DEC,
        Question::QT_F_ARRAY,
        Question::QT_H_ARRAY_COLUMN,
        Question::QT_1_ARRAY_DUAL,
... (104 lines truncated)
</file>

<file path="application/models/services/SurveyStatistics/Charts/Questions/Processors/ArrayNumbersProcessor.php">
<?php
namespace LimeSurvey\Models\Services\SurveyStatistics\Charts\Questions\Processors;
class ArrayNumbersProcessor extends AbstractQuestionProcessor
{
    public function rt(): void
    {
        $this->rt = 'Q' . $this->question['qid'];
    }
    public function process()
    {
        $this->rt();
        $groups = [];
        foreach ($this->question['subQuestions'] as $subQuestion) {
            $groups[$subQuestion['scale_id']][] = $subQuestion['qid'];
        }
        $rowQids = $groups[0] ?? [];
        $columnQids = $groups[1] ?? [];
        $data = [];
        $questionFields = [];
        foreach ($rowQids as $rowQid) {
            $row = $this->question['subQuestions'][$rowQid];
            $segments = [];
            $rowFields = [];
            foreach ($columnQids as $columnQid) {
                $column = $this->question['subQuestions'][$columnQid];
                $field = $this->rt . '_S' . $row['qid'] . '_S' . $column['qid'];
                $rowFields[] = $field;
                $segments[] = [
                    'key' => (string)$column['qid'],
                    'title' => $column['question'],
... (60 lines truncated)
</file>

<file path="application/models/services/SurveyStatistics/Charts/Questions/Processors/ArrayTextProcessor.php">
<?php
namespace LimeSurvey\Models\Services\SurveyStatistics\Charts\Questions\Processors;
class ArrayTextProcessor extends AbstractQuestionProcessor
{
    public function process()
    {
        return [
            'title' => $this->question['question'],
            'legend' => [],
            'data' => [],
        ];
    }
}
</file>

<file path="application/models/services/SurveyStatistics/Charts/Questions/Processors/DualScaleProcessor.php">
<?php
namespace LimeSurvey\Models\Services\SurveyStatistics\Charts\Questions\Processors;
class DualScaleProcessor extends AbstractQuestionProcessor
{
    public function rt(): void
    {
        $this->rt = 'Q' . $this->question['qid'];
    }
    public function process()
    {
        $this->rt();
        $scaleName = [
            0 => flattenText($this->question['attributes']['dualscale_headerA'] ?? 'Scale A', false, true),
            1 => flattenText($this->question['attributes']['dualscale_headerB'] ?? 'Scale B', false, true),
        ];
        $answersByScale = [0 => [], 1 => []];
        foreach ($this->answers ?? [] as $ans) {
            $answersByScale[(int)$ans['scale_id']][] = $ans;
        }
        $data = [];
        foreach ($this->question['subQuestions'] as $subQuestion) {
            foreach ([0, 1] as $scaleId) {
                $field = $this->rt . "_S" . $subQuestion['qid'] . '#' . $scaleId;
                $segments = [];
                foreach ($answersByScale[$scaleId] as $ans) {
                    $code = (string)$ans['code'];
                    $segments[] = [
                        'key' => $code,
                        'title' => (string)$ans['answer'],
                        'value' => $this->read($this->batch->countValue($field, $code)),
... (39 lines truncated)
</file>

<file path="application/models/services/SurveyStatistics/Charts/Questions/Processors/FileUploadProcessor.php">
<?php
namespace LimeSurvey\Models\Services\SurveyStatistics\Charts\Questions\Processors;
class FileUploadProcessor extends AbstractQuestionProcessor
{
    public function process()
    {
        return [
            'title' => $this->question['question'],
            'legend' => [],
            'data' => [],
        ];
    }
}
</file>

<file path="application/models/services/SurveyStatistics/Charts/Questions/Processors/MultipleChoiceProcessor.php">
<?php
namespace LimeSurvey\Models\Services\SurveyStatistics\Charts\Questions\Processors;
use Question;
class MultipleChoiceProcessor extends AbstractQuestionProcessor
{
    public function rt(): void
    {
        $this->rt = 'Q' . $this->question['qid'];
    }
    public function process()
    {
        $legend = [];
        $dataItems = [];
        $fieldNames = [];
        foreach ($this->question['subQuestions'] ?? [] as $subQuestion) {
            $fieldNames[] = $this->rt . '_S' . $subQuestion['qid'];
        }
        $hasOther = $this->question['other'] === Question::QT_Y_YES_NO_RADIO;
        if ($hasOther) {
            $fieldNames[] = $this->rt . '_Cother';
        }
        $counts = $this->batchGetResponseCounts($fieldNames);
        foreach ($this->question['subQuestions'] ?? [] as $subQuestion) {
            $field = $this->rt . "_S" . $subQuestion['qid'];
            $legend[] = $subQuestion['question'];
            $dataItems[] = [
                'key' => $subQuestion['title'],
                'title' => $subQuestion['question'],
                'value' => $counts[$field],
                'field' => $field,
... (15 lines truncated)
</file>

<file path="application/models/services/SurveyStatistics/Charts/Questions/Processors/MultipleNumericalProcessor.php">
<?php
namespace LimeSurvey\Models\Services\SurveyStatistics\Charts\Questions\Processors;
class MultipleNumericalProcessor extends AbstractQuestionProcessor
{
    public function process()
    {
        return [
            'title' => $this->question['question'],
            'legend' => [],
            'data' => [],
        ];
    }
}
</file>

<file path="application/models/services/SurveyStatistics/Charts/Questions/Processors/NumericalProcessor.php">
<?php
namespace LimeSurvey\Models\Services\SurveyStatistics\Charts\Questions\Processors;
class NumericalProcessor extends AbstractQuestionProcessor
{
    public function process()
    {
        $this->rt();
        $field = $this->rt;
        $answered = $this->read($this->batch->countNonEmpty($field, true));
        return [
            'title' => $this->question['question'],
            'legend' => [],
            'data' => [
                [
                    'key' => $this->question['title'],
                    'title' => $this->question['question'],
                    'value' => $answered,
                    'stats' => $this->statsOf($field),
                ],
            ],
            'total' => $answered,
        ];
    }
    private function statsOf(string $field): callable
    {
        $countAlias = $this->batch->countNonEmpty($field, true);
        $sumAlias = $this->batch->sumValues($field, true);
        $sumSquaresAlias = $this->batch->sumSquares($field, true);
        $medianAlias = $this->batch->medianValue($field, true);
        $minAlias = $this->batch->minValue($field, true);
... (22 lines truncated)
</file>

<file path="application/models/services/SurveyStatistics/Charts/Questions/Processors/RankingProcessor.php">
<?php
namespace LimeSurvey\Models\Services\SurveyStatistics\Charts\Questions\Processors;
class RankingProcessor extends AbstractQuestionProcessor
{
    public function rt(): void
    {
        $this->rt = $this->question['type'] . 'Q' . $this->question['qid'];
    }
    public function process()
    {
        $this->rt();
        $subQuestions = $this->question['subQuestions'];
        $column = substr($this->rt, 1);
        $rankCount = count($subQuestions);
        $maxSubquestions = (int)($this->question['attributes']['max_subquestions'] ?? 0);
        if ($maxSubquestions > 0 && $maxSubquestions < $rankCount) {
            $rankCount = $maxSubquestions;
        }
        $legend = [];
        $dataItems = [];
        foreach ($subQuestions as $subQuestion) {
            $code = (string)$subQuestion['title'];
            $ranks = [];
            for ($rank = 1; $rank <= $rankCount; $rank++) {
                $ranks[] = [
                    'position' => $rank,
                    'value' => $this->read(
                        $this->batch->countJsonArrayValue($column, $rank - 1, $code)
                    ),
                ];
... (23 lines truncated)
</file>

<file path="application/models/services/SurveyStatistics/Charts/Questions/Processors/ResponseAggregateBatch.php">
<?php
namespace LimeSurvey\Models\Services\SurveyStatistics\Charts\Questions\Processors;
use CDbConnection;
use LimeSurvey\Models\Services\SurveyStatistics\StatisticsResponseFilters;
use SurveyDynamic;
final class ResponseAggregateBatch
{
    public const MAX_EXPRESSIONS_PER_QUERY = 1500;
    private const MAX_MEDIANS_PER_QUERY = 100;
    private const KIND_VALUE = 'value';
    private const KIND_JSON_ELEMENT = 'jsonElement';
    private const KIND_BLANK = 'blank';
    private const KIND_NON_EMPTY = 'nonEmpty';
    private const KIND_ANY_NON_EMPTY = 'anyNonEmpty';
    private const KIND_NUMERIC = 'numeric';
    private const KIND_TOTAL = 'total';
    private const KIND_SUM = 'sum';
    private const KIND_SUM_SQUARES = 'sumSquares';
    private const KIND_MIN = 'min';
    private const KIND_MAX = 'max';
    private const NUMERIC_PATTERN = '^-?[0-9]*\.?[0-9]+$';
    private const FIELD_SEPARATOR = "\x1E";
    private int $surveyId;
    private $filters;
    private array $requests = [];
    private array $medianRequests = [];
    private array $aliasIndex = [];
    private array $results = [];
    private bool $executed = false;
    public function __construct(int $surveyId, ?StatisticsResponseFilters $filters = null)
... (363 lines truncated)
</file>

<file path="application/models/services/SurveyStatistics/Charts/Questions/Processors/SingleOptionMultipleChartsProcessor.php">
<?php
namespace LimeSurvey\Models\Services\SurveyStatistics\Charts\Questions\Processors;
use Question;
class SingleOptionMultipleChartsProcessor extends AbstractQuestionProcessor
{
    public function process()
    {
        return $this->buildChartDataByType();
    }
    private function buildChartDataByType(): array
    {
        switch ($this->question['type']) {
            case Question::QT_A_ARRAY_5_POINT:
                [$codes, $labels] = $this->numericScale(5);
                return $this->buildStackedChart($codes, $labels);
            case Question::QT_B_ARRAY_10_CHOICE_QUESTIONS:
                [$codes, $labels] = $this->numericScale(10);
                return $this->buildStackedChart($codes, $labels);
            case Question::QT_C_ARRAY_YES_UNCERTAIN_NO:
                return $this->buildStackedChart(['Y', 'U', 'N'], ['Yes', 'Uncertain', 'No']);
            case Question::QT_E_ARRAY_INC_SAME_DEC:
                return $this->buildStackedChart(['I', 'S', 'D'], ['Increase', 'Same', 'Decrease']);
            case Question::QT_F_ARRAY:
            case Question::QT_H_ARRAY_COLUMN:
                [$codes, $labels] = $this->answerScale();
                return $this->buildStackedChart($codes, $labels);
            default:
                return [];
        }
    }
... (48 lines truncated)
</file>

<file path="application/models/services/SurveyStatistics/Charts/Questions/Processors/SingleOptionProcessor.php">
<?php
namespace LimeSurvey\Models\Services\SurveyStatistics\Charts\Questions\Processors;
use Question;
use RuntimeException;
use Survey;
class SingleOptionProcessor extends AbstractQuestionProcessor
{
    private const SPECIAL_TYPES = [
        Question::QT_G_GENDER,
        Question::QT_Y_YES_NO_RADIO,
        Question::QT_I_LANGUAGE,
        Question::QT_5_POINT_CHOICE
    ];
    public function rt(): void
    {
        $this->rt = 'Q' . $this->question['qid'];
    }
    public function process(): array
    {
        $this->rt();
        $chart = $this->buildChartDataByType();
        $legend = $chart['legend'];
        $title = $chart['title'];
        $dataItems = $chart['data'];
        $this->addSpecialOptions($legend, $dataItems);
        return [
            'title' => $title,
            'legend' => $legend,
            'data' => $dataItems,
        ];
... (99 lines truncated)
</file>

<file path="application/models/services/SurveyStatistics/Charts/Questions/Processors/TextProcessor.php">
<?php
namespace LimeSurvey\Models\Services\SurveyStatistics\Charts\Questions\Processors;
class TextProcessor extends AbstractQuestionProcessor
{
    public function rt(): void
    {
        $this->rt = 'Q' . $this->question['qid'];
    }
    public function process()
    {
        $this->rt();
        $totalResponses = $this->getTotalCount();
        $answered = $this->countFieldResponses($this->rt);
        $legend = ['Answer', 'NoAnswer'];
        $dataItems = [
            ['key' => 'Answer', 'title' => 'Answer', 'value' => $answered],
            [
                'key' => 'NoAnswer',
                'title' => 'No answer',
                'value' => fn(): int => $totalResponses() - $answered(),
            ],
        ];
        return [
            'title' => $this->question['question'],
            'legend' => $legend,
            'data' => $dataItems,
        ];
    }
}
</file>

<file path="application/models/services/SurveyStatistics/Charts/Questions/QuestionStatistics.php">
<?php
namespace LimeSurvey\Models\Services\SurveyStatistics\Charts\Questions;
use CDbCommand;
use Exception;
use InvalidArgumentException;
use LimeSurvey\Models\Services\SurveyStatistics\Charts\StatisticsChartDTO;
use LimeSurvey\Models\Services\SurveyStatistics\Charts\StatisticsChartInterface;
use LimeSurvey\Models\Services\SurveyStatistics\StatisticsResponseFilters;
use LimeSurvey\Models\Services\SurveyStatistics\Charts\Questions\Processors\{ArrayNumbersProcessor,
    ArrayTextProcessor,
    FileUploadProcessor,
    MultipleChoiceProcessor,
    MultipleNumericalProcessor,
    NumericalProcessor,
    ResponseAggregateBatch,
    SingleOptionMultipleChartsProcessor,
    TextProcessor,
    RankingProcessor,
    SingleOptionProcessor,
    DualScaleProcessor};
use Question;
use QuestionType;
use Yii;
class QuestionStatistics implements StatisticsChartInterface
{
    private array $factories;
    private int $surveyId;
    private string $language;
    private array $output = [];
    private $filters = null;
... (321 lines truncated)
</file>

<file path="application/models/services/SurveyStatistics/Charts/SurveyOverview/SurveyOverviewStatistics.php">
<?php
namespace LimeSurvey\Models\Services\SurveyStatistics\Charts\SurveyOverview;
use CDbExpression;
use CDbTableSchema;
use InvalidArgumentException;
use LimeSurvey\Models\Services\SurveyStatistics\Charts\StatisticsChartDTO;
use LimeSurvey\Models\Services\SurveyStatistics\Charts\StatisticsChartInterface;
use LimeSurvey\Models\Services\SurveyStatistics\StatisticsResponseFilters;
use Yii;
class SurveyOverviewStatistics implements StatisticsChartInterface
{
    private $surveyId = 0;
    public function run(int $surveyId, string $language = 'en'): StatisticsChartDTO
    {
        $this->surveyId = $surveyId;
        $rows = $this->fetchStatisticsOverview();
        $data = [
            'completionRate' => round($rows['completionrate'] ?? 0, 2),
            'totalResponses' => (int)$rows['totalresponses'],
            'incompleteResponses' => (int)$rows['incompleteresponses'],
            'avgCompletionTime' => $rows['avgcompletiontime'] ? round($rows['avgcompletiontime'], 2) : null,
        ];
        return new StatisticsChartDTO(
            'Survey Overview',
            [
                'Total Responses',
                'Incomplete Responses',
                'Completion Rate (%)',
                'Avg. Completion Time (s)',
            ],
... (45 lines truncated)
</file>

<file path="application/models/services/SurveyStatistics/Charts/StatisticsChartDTO.php">
<?php
namespace LimeSurvey\Models\Services\SurveyStatistics\Charts;
class StatisticsChartDTO
{
    private string $title;
    private array $legend;
    private array $data;
    private $total;
    private array $meta;
    public function __construct(string $title, array $legend, array $data, $total = null, array $meta = [])
    {
        $this->title = $title;
        $this->legend = $legend;
        $this->data = $data;
        $this->total = $total;
        $this->meta = $meta;
    }
    public function getMeta(): array
    {
        return $this->meta;
    }
    public function setMeta(array $meta): void
    {
        $this->meta = $meta;
    }
    public function toArray(): array
    {
        $object = [
            'title' => $this->title,
            'legend' => $this->legend,
... (12 lines truncated)
</file>

<file path="application/models/services/SurveyStatistics/Charts/StatisticsChartInterface.php">
<?php
namespace LimeSurvey\Models\Services\SurveyStatistics\Charts;
use LimeSurvey\Models\Services\SurveyStatistics\StatisticsResponseFilters;
interface StatisticsChartInterface
{
    public function setFilters(StatisticsResponseFilters $filters): void;
    public function run(int $surveyId, string $language = 'en');
}
</file>

<file path="application/models/services/SurveyStatistics/StatisticsResponseFilters.php">
<?php
namespace LimeSurvey\Models\Services\SurveyStatistics;
use InvalidArgumentException;
class StatisticsResponseFilters
{
    public const MAX_SEARCH_TERMS = 10;
    public const MAX_SEARCH_TERM_LENGTH = 250;
    private $minId = null;
    private $maxId = null;
    private $completed = null;
    private $searchTerms = [];
    public function setMinId(?int $minId): self
    {
        if ($minId !== null && $minId < 0) {
            throw new InvalidArgumentException('Min ID cannot be negative');
        }
        if ($minId !== null && $this->maxId !== null && $minId > $this->maxId) {
            throw new InvalidArgumentException('Min ID cannot be greater than Max ID');
        }
        $this->minId = $minId;
        return $this;
    }
    public function setMaxId(?int $maxId): self
    {
        if ($maxId !== null && $maxId < 0) {
            throw new InvalidArgumentException('Max ID cannot be negative');
        }
        if ($maxId !== null && $this->minId !== null && $maxId < $this->minId) {
            throw new InvalidArgumentException('Max ID cannot be less than Min ID');
        }
... (54 lines truncated)
</file>

<file path="application/models/services/SurveyStatistics/StatisticsService.php">
<?php
namespace LimeSurvey\Models\Services\SurveyStatistics;
use InvalidArgumentException;
use LimeSurvey\Models\Services\Exception\NotFoundException;
use LimeSurvey\Models\Services\SurveyStatistics\Charts\DailyActivity\DailyActivityStatistics;
use LimeSurvey\Models\Services\SurveyStatistics\Charts\Questions\QuestionStatistics;
use LimeSurvey\Models\Services\SurveyStatistics\Charts\StatisticsChartDTO;
use LimeSurvey\Models\Services\SurveyStatistics\Charts\StatisticsChartInterface;
use LimeSurvey\Models\Services\SurveyStatistics\Charts\SurveyOverview\SurveyOverviewStatistics;
use RuntimeException;
use Survey;
class StatisticsService
{
    private $surveyId;
    private ?Survey $survey = null;
    private string $language;
    private array $charts;
    private array $output = [];
    private StatisticsResponseFilters $filters;
    private ?array $pagination = null;
    private ?array $paginationMeta = null;
    public function __construct()
    {
        $this->charts = [
            QuestionStatistics::class,
        ];
    }
    public function setSurvey($surveyId, ?string $language = null): self
    {
        if (!is_numeric($surveyId) || $surveyId < 1) {
... (94 lines truncated)
</file>

<file path="application/models/services/CopyQuestion.php">
<?php
namespace LimeSurvey\Models\Services;
use CException;
use LimeSurvey\Datavalueobjects\CopyQuestionValues;
class CopyQuestion
{
    private $copyQuestionValues;
    private $newQuestion;
    private $mappedSubquestionIds = [];
    private array $copyOptions = [];
    private array $copyErrors = [];
    public function __construct($copyQuestionValues, $copyOptions)
    {
        $this->copyQuestionValues = $copyQuestionValues;
        $this->newQuestion = null;
        $this->copyOptions = $copyOptions;
    }
    public function copyQuestion($surveyId = null)
    {
        $copySuccessful = $this->createNewCopiedQuestion(
            $this->copyQuestionValues->getQuestionCode(),
            $this->copyQuestionValues->getQuestionGroupId(),
            $this->copyQuestionValues->getQuestiontoCopy(),
            $surveyId
        );
        if ($copySuccessful) {
            $this->copyQuestionLanguages(
                $this->copyQuestionValues->getQuestiontoCopy(),
                $this->copyQuestionValues->getQuestionL10nData(),
                $surveyId
... (248 lines truncated)
</file>

<file path="application/models/services/CopyQuestionGroup.php">
<?php
namespace LimeSurvey\Models\Services;
use QuestionGroup;
use QuestionGroupL10n;
class CopyQuestionGroup
{
    private $questionGroup;
    private $surveyId;
    public function __construct($questionGroup, $surveyId)
    {
        $this->questionGroup = $questionGroup;
        $this->surveyId = $surveyId;
    }
    public function copyQuestionGroup($adaptLinks)
    {
        $newQuestionGroup = new QuestionGroup();
        $newQuestionGroup->attributes = $this->questionGroup->attributes;
        if ($this->surveyId != null) {
            $newQuestionGroup->sid = $this->surveyId;
        }
        if (!$newQuestionGroup->save()) {
            throw new \Exception('Failed to copy question group');
        } else {
            $questionGroupLanguages = QuestionGroupL10n::model()->findAllByAttributes(['gid' => $this->questionGroup->gid]);
            foreach ($questionGroupLanguages as $questionGroupLanguage) {
                $newQuestionGroupLanguage = new QuestionGroupL10n();
                $newQuestionGroupLanguage->attributes = $questionGroupLanguage->attributes;
                if ($adaptLinks) {
                    $newQuestionGroupLanguage->description = translateLinks(
                        'survey',
... (13 lines truncated)
</file>

<file path="application/models/services/CopySurvey.php">
<?php
namespace LimeSurvey\Models\Services;
use App;
use Assessment;
use CDbCriteria;
use Condition;
use DefaultValue;
use DefaultValueL10n;
use LimeSurvey\Datavalueobjects\CopyQuestionValues;
use LimeSurvey\Models\Services\Exception\PersistErrorException;
use PluginSetting;
use Question;
use QuestionGroup;
use QuestionL10n;
use Survey;
use Permission;
use SurveyLanguageSetting;
use SurveysGroupsettings;
use SurveyURLParameter;
use Template;
use TemplateConfiguration;
use Yii;
use Answer;
class CopySurvey
{
    private $newSurveyId;
    private $options;
    private $sourceSurvey;
    public function __construct($sourceSurvey, $options, $newSurveyId = null)
    {
... (588 lines truncated)
</file>

<file path="application/models/services/CopySurveyOptions.php">
<?php
namespace LimeSurvey\Models\Services;
class CopySurveyOptions
{
    private bool $resourcesAndLinks;
    private bool $answerOptions;
    private bool $conditions;
    private bool $quotas;
    private bool $urlParameters;
    private bool $permissions;
    private bool $resetStartAndEndDate;
    private bool $resetResponseStartId;
    private ?string $newTitle = null;
    public function __construct()
    {
        $this->resourcesAndLinks = true;
        $this->answerOptions = true;
        $this->conditions = true;
        $this->quotas = true;
        $this->urlParameters = true;
        $this->permissions = true;
        $this->resetStartAndEndDate = false;
        $this->resetResponseStartId = false;
    }
    public function isResourcesAndLinks(): bool
    {
        return $this->resourcesAndLinks;
    }
    public function setResourcesAndLinks(bool $resourcesAndLinks): void
    {
... (68 lines truncated)
</file>

<file path="application/models/services/CopySurveyQuotas.php">
<?php
namespace LimeSurvey\Models\Services;
use Quota;
use QuotaLanguageSetting;
use QuotaMember;
use Survey;
class CopySurveyQuotas
{
    private Survey $sourceSurvey;
    private Survey $destinationSurvey;
    public function __construct(Survey $sourceSurvey, Survey $destinationSurvey)
    {
        $this->sourceSurvey = $sourceSurvey;
        $this->destinationSurvey = $destinationSurvey;
    }
    public function copyQuotas($mappingQuestionIds, $adaptLinks = false)
    {
        $surveyQuotas = Quota::model()->findAllByAttributes(['sid' => $this->sourceSurvey->sid]);
        $cnt = 0;
        foreach ($surveyQuotas as $quota) {
            $newQuota = new Quota();
            $newQuota->attributes = $quota->attributes;
            $newQuota->sid = $this->destinationSurvey->sid;
            if ($newQuota->save()) {
                $cnt++;
                $surveyQuotasLanguages = QuotaLanguageSetting::model()->findAllByAttributes(['quotals_quota_id' => $quota->id]);
                if (!empty($surveyQuotasLanguages)) {
                    foreach ($surveyQuotasLanguages as $quotaLanguage) {
                        $newQuotaLanguage = new QuotaLanguageSetting();
                        $newQuotaLanguage->attributes = $quotaLanguage->attributes;
... (31 lines truncated)
</file>

<file path="application/models/services/CopySurveyResources.php">
<?php
namespace LimeSurvey\Models\Services;
class CopySurveyResources
{
    private $copiedFilesInfo = [];
    private $errorFilesInfo = [];
    public function copyResources($sourceSurveyId, $targetSurveyId)
    {
        $sourceSurveyId = (int) $sourceSurveyId;
        $targetSurveyId = (int) $targetSurveyId;
        $sourceDir = \Yii::app()->getConfig('uploaddir') . "/surveys/{$sourceSurveyId}/";
        $targetDir = \Yii::app()->getConfig('uploaddir') . "/surveys/{$targetSurveyId}/";
        if (is_dir($sourceDir)) {
            $this->copyDirectory($sourceDir, $targetDir);
        }
        return $this->getResult();
    }
    private function copyDirectory($sourceDir, $targetDir)
    {
        if (is_dir($sourceDir)) {
            $directory = opendir($sourceDir);
            if (!$directory) {
                $this->addError($sourceDir, gT("Could not open source directory - maybe a permission problem?"));
                return;
            }
            if (!$this->checkTargetDir($targetDir)) {
                return;
            }
            while ($direntry = readdir($directory)) {
                if ($direntry !== "." && $direntry !== "..") {
... (43 lines truncated)
</file>

<file path="application/models/services/CopySurveyResult.php">
<?php
namespace LimeSurvey\Models\Services;
use Survey;
class CopySurveyResult
{
    private $copiedSurvey = null;
    private $cntSurveys = 1;
    private $cntSurveyLanguages = 1;
    private $cntQuestionGroups = 0;
    private $cntQuestions = 0;
    private $cntQuestionAttributes = 0;
    private $cntAnswerOptions = 0;
    private $cntSubquestions = 0;
    private $cntDefaultAnswers = 0;
    private $cntAssessments = 0;
    private $cntQuotas = 0;
    private $cntUrlParameters = 0;
    private $cntQuotaMembers = 0;
    private $cntQuotaLanguageSettings = 0;
    private $warnings = [];
    private $errors = [];
    public function getCopiedSurvey()
    {
        return $this->copiedSurvey;
    }
    public function setCopiedSurvey($copiedSurvey)
    {
        $this->copiedSurvey = $copiedSurvey;
    }
    public function getCntSurveys(): int
... (121 lines truncated)
</file>

<file path="application/models/services/CoreQuestionAttributeProvider.php">
<?php
namespace LimeSurvey\Models\Services;
class CoreQuestionAttributeProvider extends QuestionAttributeProvider
{
    public function getDefinitions($options = [])
    {
        $questionType = self::getQuestionType($options);
        if (empty($questionType)) {
            return [];
        }
        $advancedOnly = !empty($options['advancedOnly']);
        return $this->getQuestionAttributes($questionType, $advancedOnly);
    }
    protected function getQuestionAttributes($questionType, $advancedOnly = false)
    {
        $xmlFilePath = \QuestionTheme::getQuestionXMLPathForBaseType($questionType);
        if ($advancedOnly) {
            $generalAttributes = [];
        } else {
            $generalAttributes = $this->getGeneralAttibutesFromXml($xmlFilePath);
        }
        $advancedAttributes = $this->getAdvancedAttributesFromXml($xmlFilePath);
        $attributes = array_merge($generalAttributes, $advancedAttributes);
        return $attributes;
    }
    protected function getGeneralAttibutesFromXml($xmlFilePath)
    {
        $attributes = [];
        if (file_exists($xmlFilePath)) {
            $extensionConfig = \ExtensionConfig::loadFromFileCached($xmlFilePath);
... (55 lines truncated)
</file>

<file path="application/models/services/CreateSurvey.php">
<?php
namespace LimeSurvey\Models\Services;
use Survey;
use SurveyLanguageSetting;
use Permission;
use LimeSurvey\Datavalueobjects\SimpleSurveyValues;
class CreateSurvey
{
    const ATTEMPTS_CREATE_SURVEY_ID = 50;
    const STRING_VALUE_FOR_NO_FALSE = 'N';
    const STRING_VALUE_FOR_YES_TRUE = 'Y';
    const STRING_SHORT_VALUE_INHERIT = 'I';
    const INTEGER_VALUE_FOR_INHERIT = -1;
    const DEFAULT_DATE_FORMAT = 1;
    private $survey;
    private $newLanguageSettings;
    private $simpleSurveyValues;
    public function __construct($survey, $newLanguageSettings)
    {
        $this->survey = $survey;
        $this->newLanguageSettings = $newLanguageSettings;
    }
    public function createSimple($simpleSurveyValues, $userID, $permissionModel, $overrideAdministrator = true)
    {
        $this->simpleSurveyValues = $simpleSurveyValues;
        $this->survey->gsid = $simpleSurveyValues->surveyGroupId;
        try {
            $this->createSurveyId();
            $this->setBaseLanguage();
            $this->initialiseSurveyAttributes($overrideAdministrator);
... (112 lines truncated)
</file>

<file path="application/models/services/EditorService.php">
<?php
namespace LimeSurvey\Models\Services;
use LimeSurvey\Models\Services\EditorService\EditorConfig;
use LimeSurvey\Models\Services\EditorService\EditorRedirector;
use LimeSurvey\Models\Services\EditorService\EditorRequestHelper;
use SettingsUser;
class EditorService
{
    private static ?self $instance = null;
    public bool $editorStatus;
    public bool $editorAllowed;
    private function __construct(bool $editorStatus = true, bool $editorAllowed = true)
    {
        $this->editorStatus = $editorStatus;
        $this->editorAllowed = $editorAllowed;
    }
    public static function init(bool $editorStatus = true, bool $editorAllowed = true): self
    {
        if (self::$instance !== null) {
            return self::$instance;
        }
        return self::$instance = new self($editorStatus, $editorAllowed);
    }
    public static function initEditorApp()
    {
        $editorConfig = new EditorConfig((self::$instance->editorStatus && self::$instance->editorAllowed) ?? false);
        $editorConfig->initAppConfig();
        $editorRedirector = new EditorRedirector();
        $editorRedirector->handleRedirect();
    }
... (46 lines truncated)
</file>

<file path="application/models/services/Exception.php">
<?php
namespace LimeSurvey\Models\Services;
use LSActiveRecord;
class Exception extends \Exception
{
    private $errorModel = null;
    public function setErrorModel(LSActiveRecord $errorModel)
    {
        $this->errorModel = $errorModel;
    }
    public function getErrorModel()
    {
        return $this->errorModel;
    }
}
</file>

<file path="application/models/services/ExportSurveyResultsService.php">
<?php
namespace LimeSurvey\Models\Services;
use CDbException;
use InvalidArgumentException;
use LimeSurvey\Libraries\Api\Command\V1\SurveyResponses\FilterPatcher;
use LimeSurvey\Libraries\Api\Command\V1\SurveyResponses\ResponseMappingTrait;
use LimeSurvey\Libraries\Api\Command\V1\Transformer\Output\TransformerOutputSurveyResponses;
use LimeSurvey\Models\Services\Export\ExportAnswerFormatter;
use LimeSurvey\Models\Services\Export\ExportWriterInterface;
use LimeSurvey\Models\Services\Export\CsvExportWriter;
use LimeSurvey\Models\Services\Export\HtmlExportWriter;
use LimeSurvey\Models\Services\SurveyAnswerCache;
use RuntimeException;
use Survey;
use SurveyDynamic;
use Yii;
class ExportSurveyResultsService
{
    use ResponseMappingTrait;
    private const META_COLUMN_MAP = [
        'id'            => ['key' => 'id',             'header' => 'Response ID'],
        'submitdate'    => ['key' => 'submitDate',     'header' => 'Date submitted'],
        'lastpage'      => ['key' => 'lastPage',       'header' => 'Last page'],
        'startlanguage' => ['key' => 'language',       'header' => 'Start language'],
        'seed'          => ['key' => 'seed',            'header' => 'Seed'],
        'token'         => ['key' => 'token',           'header' => 'Token'],
        'startdate'     => ['key' => 'startDate',      'header' => 'Date started'],
        'datestamp'     => ['key' => 'dateLastAction',  'header' => 'Date last action'],
        'ipaddr'        => ['key' => 'ipAddr',         'header' => 'IP address'],
        'refurl'        => ['key' => 'refUrl',         'header' => 'Referrer URL'],
... (386 lines truncated)
</file>

<file path="application/models/services/FileUploadService.php">
<?php
namespace LimeSurvey\Models\Services;
use LimeSurvey\Models\Services\Exception\PermissionDeniedException;
use LSYii_ImageValidator;
use Permission;
class FileUploadService
{
    private UploadValidator $uploadValidator;
    private Permission $modelPermission;
    public function __construct(UploadValidator $uploadValidator, Permission $modelPermission)
    {
        $this->uploadValidator = $uploadValidator;
        $this->modelPermission = $modelPermission;
    }
    public function storeSurveyImage($surveyId, array $fileInfoArray)
    {
        $this->checkUpdatePermission($surveyId);
        $returnedData = ['success' => false];
        if (empty($fileInfoArray)) {
            $returnedData['uploadResultMessage'] = gT('No file uploaded');
            return $returnedData;
        }
        $surveyId = $this->convertSurveyIdWhenUniqUploadDir($surveyId);
        $destinationDir = $this->getSurveyUploadDirectory($surveyId);
        $validationError = $this->validateFileUpload($surveyId, $fileInfoArray, $destinationDir);
        if ($validationError !== null) {
            $returnedData['uploadResultMessage'] = $validationError;
            return $returnedData;
        }
        $returnedData = $this->saveFileInDirectory(
... (251 lines truncated)
</file>

<file path="application/models/services/FilterImportedResources.php">
<?php
namespace LimeSurvey\Models\Services;
class FilterImportedResources
{
    public function filterImportedResources($extractdir, $destdir)
    {
        $aErrorFilesInfo = [];
        $aImportedFilesInfo = [];
        if (!is_dir($extractdir)) {
            return [[], []];
        }
        $directory = opendir($extractdir);
        if (!$directory) {
            $aErrorFilesInfo[] = [
                "filename" => '',
                "status"   => gT("Extracted files not found - maybe a permission problem?")
            ];
            return [$aImportedFilesInfo, $aErrorFilesInfo];
        }
        return $this->copyDirectory($directory, $extractdir, $destdir);
    }
    /**
     * Copy $directory to $destdir and return [$aImportedFilesInfo, $aErrorFilesInfo]
     * @param resource $directory
     * @param string $extractdir
     * @param string $destdir
     *
     * @return array An array of failed and imported files/directories
     */
    private function copyDirectory($directory, $extractdir, $destdir): array
... (48 lines truncated)
</file>

<file path="application/models/services/GroupHelper.php">
<?php
namespace LimeSurvey\Models\Services;
class GroupHelper
{
    public function reorderGroup($iSurveyID, $orgdata)
    {
        $result = array();
        $grouporder = 1;
        foreach ($orgdata as $ID => $parent) {
            if ($parent == 'root' && substr_compare($ID, 'g', 0, 1) === 0) {
                \QuestionGroup::model()->updateAll(
                    array('group_order' => $grouporder),
                    'gid=:gid',
                    array(':gid' => (int) substr($ID, 1))
                );
                $grouporder++;
            } elseif (substr_compare($ID, 'q', 0, 1) === 0) {
                $qid = (int) substr($ID, 1);
                $gid = (int) substr((string) $parent, 1);
                if (!isset($aQuestionOrder[$gid])) {
                    $aQuestionOrder[$gid] = 1;
                }
                $oQuestion = \Question::model()->findByPk($qid);
                $oldGid = $oQuestion->gid;
                $oQuestion->gid = $gid;
                $oQuestion->question_order = $aQuestionOrder[$gid];
                if ($oQuestion->save(true)) {
                    if ($oldGid != $gid) {
                        fixMovedQuestionConditions($qid, $oldGid, $gid, $iSurveyID);
                    }
... (25 lines truncated)
</file>

<file path="application/models/services/HiddenQuestionAttributeProvider.php">
<?php
namespace LimeSurvey\Models\Services;
class HiddenQuestionAttributeProvider extends QuestionAttributeProvider
{
    public function getDefinitions($options = [])
    {
        $questionType = self::getQuestionType($options);
        if (empty($questionType)) {
            return [];
        }
        return $this->getHiddenAttributes($questionType);
    }
    protected function getHiddenAttributes($questionType)
    {
        $attributes = [];
        $unallowedQuestionTypes = [];
        $hiddenAttributes = ['image'];
        if (!in_array($questionType, $unallowedQuestionTypes)) {
            foreach ($hiddenAttributes as $hiddenAttribute) {
                $attributes[$hiddenAttribute] = self::getBaseDefinition();
                $attributes[$hiddenAttribute]['name'] = $hiddenAttribute;
            }
        }
        return $attributes;
    }
}
</file>

<file path="application/models/services/IpAddressAnonymizer.php">
<?php
namespace LimeSurvey\Models\Services;
class IpAddressAnonymizer
{
    private $ipAddress;
    public function __construct($ipAddress)
    {
        $this->ipAddress = $ipAddress;
    }
    public function isIpv4()
    {
        if ($this->ipAddress === '') {
            $result = false;
        } else {
            $result = (bool)filter_var($this->ipAddress, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4);
        }
        return $result;
    }
    /**
     * Checks if ip is a valid ipv6
     *
     * @return boolean true if ipv6 is valid, false otherwise
     */
    public function isIpv6()
    {
        if ($this->ipAddress === '') {
            $result = false;
        } else {
            $result = (bool)filter_var($this->ipAddress, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6);
        }
... (52 lines truncated)
</file>

<file path="application/models/services/ParticipantAttributeService.php">
<?php
namespace LimeSurvey\Models\Services;
use CHtml;
use CHttpException;
use ParticipantAttributeName;
use ParticipantAttributeNameLang;
use ParticipantAttributeValue;
class ParticipantAttributeService
{
    private ParticipantAttributeName $modelParticipantAttributeName;
    private ParticipantAttributeNameLang $modelParticipantAttributeLang;
    private ParticipantAttributeValue $modelParticipantAttributeValue;
    private $attributeTypes = null;
    public function __construct(
        ParticipantAttributeName $modelParticipantAttributeName,
        ParticipantAttributeNameLang $modelParticipantAttributeLang,
        ParticipantAttributeValue $modelParticipantAttributeValue
    ) {
        $this->modelParticipantAttributeName = $modelParticipantAttributeName;
        $this->modelParticipantAttributeLang = $modelParticipantAttributeLang;
        $this->modelParticipantAttributeValue = $modelParticipantAttributeValue;
    }
    public function saveParticipantAttribute(
        array $attributeData,
        string $attributeName
    ): int {
        $attributeData = $this->normalizeAttributeDataset($attributeData);
        $attributeId = $this->saveParticipantAttributeName(
            $attributeData,
            $attributeName
... (199 lines truncated)
</file>

<file path="application/models/services/ParticipantBlacklistHandler.php">
<?php
namespace LimeSurvey\Models\Services;
use InvalidArgumentException;
use LimeSurvey\Datavalueobjects\BlacklistResult;
class ParticipantBlacklistHandler
{
    public function addToBlacklist($token)
    {
        $participant = $this->getCentralParticipantFromToken($token);
        if (empty($participant)) {
            return new BlacklistResult(false, gT("No CPDB participant found."));
        }
        if ($participant->blacklisted != "Y") {
            $participant->blacklisted = 'Y';
            $participant->save();
            $result = new BlacklistResult(true, gT("You have been removed from the central participant list for this site."));
            if (\Yii::app()->getConfig('deleteblacklisted') == "Y") {
                $surveyIds = $this->removeParticipantFromAllSurveys($participant);
            } elseif (\Yii::app()->getConfig('blacklistallsurveys') == "Y") {
                $surveyIds = $this->optoutParticipantFromAllSurveys($participant);
            }
            if (!empty($surveyIds)) {
                $result->appendMessage(sprintf(gT("You were also removed from %d surveys on this site."), count($surveyIds)));
            }
            return $result;
        } else {
            return new BlacklistResult(true, gT("You have already been removed from the central participant list for this site."));
        }
    }
    public function removeFromBlacklist($token)
... (61 lines truncated)
</file>

<file path="application/models/services/PasswordManagement.php">
<?php
namespace LimeSurvey\Models\Services;
use DateTime;
class PasswordManagement
{
    const MIN_PASSWORD_LENGTH = 8;
    const EMAIL_TYPE_REGISTRATION = 'registration';
    const EMAIL_TYPE_RESET_PW = 'resetPassword';
    const MIN_TIME_NEXT_FORGOT_PW_EMAIL = 5;
    private $user;
    public function __construct(\User $user)
    {
        $this->user = $user;
    }
    public function getAdminCreationEmailReplacements()
    {
        $loginUrl = \Yii::app()->createValidatedAbsoluteUrl(
            'admin/authentication/sa/newPassword',
            ['param' => $this->user->validation_key]
        );
        if ($loginUrl === false) {
            return false;
        }
        return [
            'SITENAME' => (string) \Yii::app()->getConfig("sitename"),
            'SITEADMINEMAIL' => (string) \Yii::app()->getConfig("siteadminemail"),
            'FULLNAME' => (string) $this->user->full_name,
            'USERNAME' => (string) $this->user->users_name,
            'LOGINURL' => $loginUrl,
        ];
... (199 lines truncated)
</file>

<file path="application/models/services/PermissionManager.php">
<?php
namespace LimeSurvey\Models\Services;
use LSHttpRequest;
use LSWebUser;
use LSYii_Application;
use Permission;
use PermissionInterface;
use App;
use CHtml;
use LimeSurvey\PluginManager\PluginEvent;
class PermissionManager
{
    private $request;
    private $user;
    private $model;
    private $app;
    public function __construct(
        LSHttpRequest $request,
        LSWebUser $user,
        PermissionInterface $model,
        LSYii_Application $app
    ) {
        $this->request = $request;
        $this->user = $user;
        $this->model = $model;
        $this->app = $app;
    }
    public function getPermissionData($userId = null)
    {
        $aObjectPermissions = $this->model::getPermissionData();
... (142 lines truncated)
</file>

<file path="application/models/services/PluginQuestionAttributeProvider.php">
<?php
namespace LimeSurvey\Models\Services;
class PluginQuestionAttributeProvider extends QuestionAttributeProvider
{
    public function getDefinitions($options = [])
    {
        $questionType = self::getQuestionType($options);
        if (empty($questionType)) {
            return [];
        }
        return $this->getAttributesFromPlugin($questionType);
    }
    protected function getAttributesFromPlugin($questionType)
    {
        $event = new \LimeSurvey\PluginManager\PluginEvent('newQuestionAttributes');
        $result = App()->getPluginManager()->dispatchEvent($event);
        $allPluginAttributes = (array) $result->get('questionAttributes');
        if (empty($allPluginAttributes)) {
            return [];
        }
        $questionAttributeHelper = new QuestionAttributeHelper();
        $questionTypeAttributes = $questionAttributeHelper->filterAttributesByQuestionType($allPluginAttributes, $questionType);
        $questionTypeAttributes = $questionAttributeHelper->fillMissingCategory($questionTypeAttributes, gT('Plugin'));
        return $questionTypeAttributes;
    }
}
</file>

<file path="application/models/services/QuestionAggregateService.php">
<?php
namespace LimeSurvey\Models\Services;
use Permission;
use Question;
use Survey;
use CDbConnection;
use LimeSurvey\Models\Services\{
    QuestionAggregateService\SaveService,
    QuestionAggregateService\DeleteService,
    Exception\PersistErrorException,
    Exception\NotFoundException,
    Exception\PermissionDeniedException
};
class QuestionAggregateService
{
    private SaveService $saveService;
    private DeleteService $deleteService;
    private Permission $modelPermission;
    private Survey $modelSurvey;
    private CDbConnection $yiiDb;
    public function __construct(
        SaveService $saveService,
        DeleteService $deleteService,
        Permission $modelPermission,
        Survey $modelSurvey,
        CDbConnection $yiiDb
    ) {
        $this->saveService = $saveService;
        $this->deleteService = $deleteService;
        $this->modelPermission = $modelPermission;
... (81 lines truncated)
</file>

<file path="application/models/services/QuestionAttributeFetcher.php">
<?php
namespace LimeSurvey\Models\Services;
class QuestionAttributeFetcher
{
    private $question;
    private $options = [];
    private $providers = [];
    public function __construct($providers = null)
    {
        if (is_null($providers)) {
            $providers = [
                new CoreQuestionAttributeProvider(),
                new ThemeQuestionAttributeProvider(),
                new PluginQuestionAttributeProvider(),
                new HiddenQuestionAttributeProvider(),
            ];
        }
        $this->providers = $providers;
    }
    public function fetch()
    {
        if (empty($this->question)) {
            throw new \InvalidArgumentException(gT("No question specified."));
        }
        $questionAttributeHelper = new QuestionAttributeHelper();
        $allAttributes = [];
        foreach ($this->providers as $provider) {
            $options = array_merge($this->options, ['question' => $this->question]);
            $attributes = $provider->getDefinitions($options);
            $sanitizedAttributes = $questionAttributeHelper->sanitizeQuestionAttributes($attributes);
... (59 lines truncated)
</file>

<file path="application/models/services/QuestionAttributeHelper.php">
<?php
namespace LimeSurvey\Models\Services;
class QuestionAttributeHelper
{
    private const USER_DEFAULTS_SETTING_PREFIX = 'question_default_values_';
    public function mergeQuestionAttributes($baseAttributes, $extendedAttributes)
    {
        $attributes = $baseAttributes;
        foreach ($extendedAttributes as $attribute) {
            if (!isset($attribute['name'])) {
                continue;
            }
            $attributeName = $attribute['name'];
            $inputType = $attribute['inputtype'];
            if (empty($inputType)) {
                unset($attributes[$attributeName]);
            } else {
                $customAttribute = array_merge(
                    \QuestionAttribute::getDefaultSettings(),
                    $attribute
                );
                $attributes[$attributeName] = $customAttribute;
            }
        }
        return $attributes;
    }
    public function sanitizeQuestionAttributes($attributes)
    {
        $sanitizedAttributes = [];
        foreach ($attributes as $key => $attribute) {
... (181 lines truncated)
</file>

<file path="application/models/services/QuestionAttributeProvider.php">
<?php
namespace LimeSurvey\Models\Services;
abstract class QuestionAttributeProvider
{
    abstract public function getDefinitions($options = []);
    protected static function getBaseDefinition()
    {
        return [
            "name" => null,
            "caption" => '',
            "inputtype" => "text",
            "options" => null,
            "category" => gT("Attribute"),
            "default" => '',
            "help" => '',
            "value" => '',
            "sortorder" => 1000,
            "i18n" => false,
            "readonly" => false,
            "readonly_when_active" => false,
            "expression" => null,
        ];
    }
    /**
     * Extracts the question type from the $options.
     * If it's not explicitly set, it tries to use a question object.
     *
     * @param array<string,mixed> $options
     *
     * @return
... (13 lines truncated)
</file>

<file path="application/models/services/QuestionGroupService.php">
<?php
namespace LimeSurvey\Models\Services;
use LSYii_Application;
use Survey;
use Permission;
use Question;
use QuestionGroup;
use QuestionGroupL10n;
use Exception;
use LimeSurvey\Models\Services\{
    Proxy\ProxyExpressionManager,
    Proxy\ProxyQuestionGroup,
    Exception\PersistErrorException,
    Exception\NotFoundException,
    Exception\PermissionDeniedException
};
class QuestionGroupService
{
    private Permission $modelPermission;
    private Survey $modelSurvey;
    private Question $modelQuestion;
    private QuestionGroup $modelQuestionGroup;
    private QuestionGroupL10n $modelQuestionGroupL10n;
    private ProxyExpressionManager $proxyExpressionManager;
    private ProxyQuestionGroup $proxyQuestionGroup;
    private LSYii_Application $yiiApp;
    public function __construct(
        Permission $modelPermission,
        Survey $modelSurvey,
        Question $modelQuestion,
... (367 lines truncated)
</file>

<file path="application/models/services/QuickTranslation.php">
<?php
namespace LimeSurvey\Models\Services;
use Answer;
use AnswerL10n;
use Question;
use QuestionGroup;
use QuestionGroupL10n;
use QuestionL10n;
use Survey;
use SurveyLanguageSetting;
class QuickTranslation
{
    private $survey;
    private static $translateFields = [
        'title' =>
        [
            'type' => 1,
            'dbColumn' => 'surveyls_title',
            'id1' => '',
            'id2' => '',
            'gid' => false,
            'qid' => false,
            'HTMLeditorType' => "title",
            'HTMLeditorDisplay' => "Inline",
            'associated' => "description"
        ],
        'description' =>
        [
            'type' => 1,
            'dbColumn' => 'surveyls_description',
... (502 lines truncated)
</file>

<file path="application/models/services/Quotas.php">
<?php
namespace LimeSurvey\Models\Services;
use CHtml;
use LimeSurvey\PluginManager\PluginEvent;
use LimeSurvey\PluginManager\PluginEventContent;
use QuestionAttribute;
use Quota;
use Response;
use Survey;
class Quotas
{
    const MASSIVE_ACTION_ACTIVATE = 'activate';
    const MASSIVE_ACTION_DEACTIVATE = 'deactivate';
    const MASSIVE_ACTION_DELETE = 'delete';
    const MASSIVE_ACTION_CHANGE_LANGUAGE_SETTINGS = 'changeLanguageSettings';
    private $survey;
    public function __construct(\Survey $survey)
    {
        $this->survey = $survey;
    }
    public function getQuotaStructure()
    {
        $totalquotas = 0;
        $totalcompleted = 0;
        if (!empty($this->survey->quotas)) {
            $aQuotaItems = array();
            foreach ($this->survey->quotas as $oQuota) {
                $totalquotas += $oQuota->qlimit;
                $totalcompleted += $oQuota->completeCount;
                foreach ($oQuota->quotaMembers as $oQuotaMember) {
... (491 lines truncated)
</file>

<file path="application/models/services/README.md">
# README

The newly added service classes are expected to have a higher quality than older code in LimeSurvey. Especially:

* PSR-12 compliant
* Don't use Hungarian notation, but instead proper docblocks and @var annotations that can be checked by Psalm
* All methods are expected to be testable with unit-tests, which means that all dependencies should be injected _or_ side-effects isolated in small, mockable methods
* Don't use static methods unless you can prove that they don't need to be mocked. Maybe a separate function outside a class would be better?
* MessDetector might be used to enforce maximum class and method length
* A [dependency injection container](https://www.yiiframework.com/doc/guide/2.0/en/concept-di-container) will be used to coordinate dependencies in the future

For more information, please read the [code quality guide](https://manual.limesurvey.org/Code_quality_guide).

Discussions about code quality guidelines can be had on the forum.
</file>

<file path="application/models/services/SurveyAccessModeService.php">
<?php
namespace LimeSurvey\Models\Services;
use Permission;
use Survey;
use Token;
use LimeExpressionManager;
use LSYii_Application;
use ArchivedTableSettings;
use LimeSurvey\Models\Services\Exception\{
    PersistErrorException,
    NotFoundException,
    PermissionDeniedException
};
class SurveyAccessModeService
{
    protected Permission $permission;
    protected Survey $survey;
    protected LSYii_Application $app;
    protected bool $test;
    protected string $tokenTableAction;
    public static $ACCESS_TYPE_OPEN = 'O';
    public static $ACCESS_TYPE_CLOSED = 'C';
    public static $ACTION_KEEP = 'K';
    public static $ACTION_ARCHIVE = 'A';
    public static $ACTION_DROP = 'D';
    public static $TOKEN_TABLE_CREATED = 'CREATED';
    public static $TOKEN_TABLE_DROPPED = 'DROPPED';
    public static $TOKEN_TABLE_ARCHIVED = 'ARCHIVED';
    public static $TOKEN_TABLE_NO_ACTION = 'NO ACTION';
    protected static $supportedAccessModes = null;
... (131 lines truncated)
</file>

<file path="application/models/services/SurveyActivate.php">
<?php
namespace LimeSurvey\Models\Services;
use CException;
use LimeSurvey\Models\Services\Exception\PermissionDeniedException;
use LSYii_Application;
use Permission;
use Survey;
use SurveyActivator;
use LimeSurvey\Models\Services\SurveyAccessModeService;
class SurveyActivate
{
    private Survey $survey;
    private Permission $permission;
    private SurveyActivator $surveyActivator;
    private LSYii_Application $app;
    private SurveyAccessModeService $surveyAccessModeService;
    public function __construct(
        Survey $survey,
        Permission $permission,
        SurveyActivator $surveyActivator,
        LSYii_Application $app,
        SurveyAccessModeService $surveyAccessModeService
    ) {
        $this->survey = $survey;
        $this->permission = $permission;
        $this->surveyActivator = $surveyActivator;
        $this->app = $app;
        $this->surveyAccessModeService = $surveyAccessModeService;
    }
    public function activate(int $surveyId, array $params = [], bool $force = false): array
... (114 lines truncated)
</file>

<file path="application/models/services/SurveyAggregateService.php">
<?php
namespace LimeSurvey\Models\Services;
use Permission;
use LimeSurvey\Models\Services\SurveyAggregateService\{
    LanguageSettings,
    GeneralSettings,
    UrlParams,
    TemplateConfiguration
};
use LimeSurvey\Models\Services\Proxy\ProxyExpressionManager;
use LimeSurvey\Models\Services\Exception\{
    PersistErrorException,
    NotFoundException,
    PermissionDeniedException
};
class SurveyAggregateService
{
    private LanguageSettings $languageSettings;
    private GeneralSettings $generalSettings;
    private UrlParams $urlParams;
    private ProxyExpressionManager $proxyExpressionManager;
    private TemplateConfiguration $templateConfiguration;
    private Permission $modelPermission;
    private $restMode = false;
    private SurveyActivate $surveyActivate;
    private SurveyDeactivate $surveyDeactivate;
    public function __construct(
        LanguageSettings $languageSettings,
        GeneralSettings $generalSettings,
        UrlParams $urlParams,
... (73 lines truncated)
</file>

<file path="application/models/services/SurveyAnswerCache.php">
<?php
namespace LimeSurvey\Models\Services;
use Answer;
class SurveyAnswerCache
{
    private $labels = [];
    private $aids = [];
    private $loaded = false;
    public function load($surveyId, $language)
    {
        $this->labels = [];
        $this->aids = [];
        $answers = Answer::model()->with('answerl10ns', 'question')->findAll([
            'condition' => 'question.sid = :sid AND '
                . \Yii::app()->db->quoteTableName('answerl10ns')
                . '.language = :lang',
            'params' => [':sid' => $surveyId, ':lang' => $language],
            'order' => 'question.question_order, t.scale_id',
        ]);
        foreach ($answers as $answer) {
            $qid = $answer->question->qid;
            $this->aids[$qid][$answer->scale_id][$answer->code] = $answer->aid;
            if (isset($answer->answerl10ns[$language])) {
                $this->labels[$qid][$answer->scale_id][$answer->code]
                    = $answer->answerl10ns[$language]->answer;
            }
        }
        foreach (\Question::getRankingItemTexts($surveyId, $language) as $rankingQid => $itemTexts) {
            foreach ($itemTexts as $code => $text) {
                $this->labels[$rankingQid][0][$code] = $text;
... (28 lines truncated)
</file>

<file path="application/models/services/SurveyCondition.php">
<?php
namespace LimeSurvey\Models\Services;
use LimeSurvey\Models\Services\Exception\PermissionDeniedException;
use LSYii_Application;
use Permission;
use Survey;
use Response;
class SurveyCondition
{
    private LSYii_Application $app;
    private Permission $permission;
    private Survey $survey;
    protected int $iSurveyID;
    protected bool $tokenTableExists;
    protected array $tokenFieldsAndNames;
    protected string $language;
    protected const X = 'X';
    protected $processedSurveys = [];
    public function __construct(
        LSYii_Application $app,
        Permission $permission,
        Survey $survey
    ) {
        $this->app = $app;
        $this->permission = $permission;
        $this->survey = $survey;
    }
    public function setISurveyID(int $iSurveyID)
    {
        $this->iSurveyID = $iSurveyID;
... (1212 lines truncated)
</file>

<file path="application/models/services/SurveyDeactivate.php">
<?php
namespace LimeSurvey\Models\Services;
use LimeSurvey\Models\Services\Exception\PermissionDeniedException;
use LSYii_Application;
use Permission;
use Survey;
use SurveyDeactivator;
use ArchivedTableSettings;
use SurveyLink;
use SavedControl;
use Response;
class SurveyDeactivate
{
    private Survey $survey;
    private Permission $permission;
    private SurveyDeactivator $surveyDeactivator;
    private LSYii_Application $app;
    private ArchivedTableSettings $archivedTokenSettings;
    private ArchivedTableSettings $archivedTimingsSettings;
    private ArchivedTableSettings $archivedResponseSettings;
    private SurveyLink $surveyLink;
    private SavedControl $savedControl;
    public function setArchivedResponseSettings(ArchivedTableSettings $archivedResponseSettings)
    {
        $this->archivedResponseSettings = $archivedResponseSettings;
    }
    public function setArchivedTokenSettings(ArchivedTableSettings $archivedTokenSettings)
    {
        $this->archivedTokenSettings = $archivedTokenSettings;
    }
... (185 lines truncated)
</file>

<file path="application/models/services/SurveyDetailService.php">
<?php
namespace LimeSurvey\Models\Services;
use Survey;
class SurveyDetailService
{
    private const CACHE_KEY_PREFIX = 'survey_detail_';
    private const CACHE_DURATION = 3600;
    public function getCache(int $surveyId, bool $clearCache = false)
    {
        if ($clearCache) {
            $this->removeCache($surveyId);
        }
        $cache = App()->cache->get(self::CACHE_KEY_PREFIX . $surveyId);
        if (empty($cache) || !is_string($cache)) {
            return false;
        }
        return json_decode($cache, true);
    }
    public function saveCache(int $surveyId, array $content)
    {
        App()->cache->set(self::CACHE_KEY_PREFIX . $surveyId, json_encode($content), self::CACHE_DURATION);
    }
    public function removeCache(int $surveyId)
    {
        App()->cache->delete(self::CACHE_KEY_PREFIX . $surveyId);
    }
    public function getSurveyFromEntityMap($entityMap)
    {
        $supportedKeys = [
            'sid' => ['survey', 'accessMode', 'surveyStatus', 'question', 'subquestion', 'questionGroup', 'questionGroupReorder'],
... (28 lines truncated)
</file>

<file path="application/models/services/SurveyIntegrity.php">
<?php
namespace LimeSurvey\Models\Services;
use App;
use CDbCriteria;
use Survey;
use SurveyLanguageSetting;
use TemplateConfiguration;
class SurveyIntegrity
{
    private $survey;
    public function __construct(
        Survey $survey
    ) {
        $this->survey = $survey;
    }
    public function fixSurveyLanguageSetting()
    {
        foreach ($this->survey->additionalLanguages as $sLang) {
            if ($sLang) {
                $oLanguageSettings = SurveyLanguageSetting::model()->find(
                    'surveyls_survey_id=:surveyid AND surveyls_language=:langname',
                    array(':surveyid' => $this->survey->sid, ':langname' => $sLang)
                );
                if (!$oLanguageSettings) {
                    $oLanguageSettings = new SurveyLanguageSetting();
                    $languagedetails = getLanguageDetails($sLang);
                    $oLanguageSettings->surveyls_survey_id = $this->survey->sid;
                    $oLanguageSettings->surveyls_language = $sLang;
                    $oLanguageSettings->surveyls_title = ''; // Not in default model ?
                    $oLanguageSettings->surveyls_dateformat = $languagedetails['dateformat'];
... (21 lines truncated)
</file>

<file path="application/models/services/SurveyPermissions.php">
<?php
namespace LimeSurvey\Models\Services;
use CActiveDataProvider;
use CSort;
use Yii;
class SurveyPermissions
{
    private $survey;
    private $userControlSameGroupPolicy;
    public function __construct(\Survey $survey, $userControlSameGroupPolicy)
    {
        $this->survey = $survey;
        $this->userControlSameGroupPolicy = $userControlSameGroupPolicy;
    }
    public function getUsersSurveyPermissions()
    {
        $userPermissionCriteria = $this->getUserPermissionCriteria();
        return \Permission::model()->findAll($userPermissionCriteria);
    }
    public function getUsersSurveyPermissionsDataProvider(): CActiveDataProvider
    {
        $pageSize = App()->user->getState('pageSize', App()->params['defaultPageSize']);
        $userPermissionCriteria = $this->getUserPermissionCriteria();
        $dataProvider = new CActiveDataProvider('Permission', [
            'criteria' => $userPermissionCriteria,
            'pagination' => array(
                'pageSize' => $pageSize,
            ),
        ]);
        return $dataProvider;
... (259 lines truncated)
</file>

<file path="application/models/services/SurveyResponseService.php">
<?php
namespace LimeSurvey\Models\Services;
use CDbConnection;
use CDbException;
use CException;
use LimeSurvey\Models\Services\{Exception\NotFoundException,
    Exception\PermissionDeniedException,
    Exception\PersistErrorException,
    Exception\QuestionHasConditionsException,
    QuestionAggregateService\DeleteService,
    QuestionAggregateService\SaveService};
use Permission;
class SurveyResponseService
{
    protected CDbConnection $yiiDb;
    protected Permission $permission;
    public function __construct(CDbConnection $yiiDb, Permission $permission)
    {
        $this->yiiDb = $yiiDb;
        $this->permission = $permission;
    }
    public function deleteResponse($surveyId, $rid): void
    {
        if (!$this->permission->hasSurveyPermission($surveyId, 'responses', 'delete')) {
            throw new PermissionDeniedException('Not enough permission for this action.');
        }
        try {
            $responseModel = \Response::model($surveyId);
        } catch (\Exception $e) {
            throw new NotFoundException('Survey not found');
... (69 lines truncated)
</file>

<file path="application/models/services/SurveysGroupCreator.php">
<?php
namespace LimeSurvey\Models\Services;
use CHtml;
use LimeSurvey\Datavalueobjects\TypedMessage;
use LSHttpRequest;
use LSWebUser;
use SurveysGroups;
use SurveysGroupsettings;
class SurveysGroupCreator
{
    private $request;
    private $user;
    private $surveysGroup;
    private $surveysGroupsettings;
    private $messages = [];
    public function __construct(
        LSHttpRequest $request,
        LSWebUser $user,
        SurveysGroups $surveysGroup,
        SurveysGroupsettings $surveysGroupsettings
    ) {
        $this->request = $request;
        $this->user = $user;
        $this->surveysGroup = $surveysGroup;
        $this->surveysGroupsettings = $surveysGroupsettings;
    }
    public function save()
    {
        $this->surveysGroup->attributes = $this->request->getPost('SurveysGroups');
        $this->surveysGroup->created_by = $this->user->id;
... (29 lines truncated)
</file>

<file path="application/models/services/SurveyThemeConfiguration.php">
<?php
namespace LimeSurvey\Models\Services;
use LimeSurvey\Models\Services\Exception\NotFoundException;
use LimeSurvey\Models\Services\Exception\PermissionDeniedException;
use Permission;
use Template;
use TemplateConfiguration;
use TemplateManifest;
class SurveyThemeConfiguration
{
    private const DEFAULT_CORNER_RADIUS = '2';
    private Permission $permission;
    public function __construct(
        Permission $permission
    ) {
        $this->permission = $permission;
    }
    public function getThemeViewData(?string $surveyTemplate, ?object $surveyOptions = null): array
    {
        $defaultTheme = \App()->getConfig('defaulttheme');
        $inheritedThemeName = $surveyOptions->template ?? $defaultTheme;
        $templateName = ($surveyTemplate === 'inherit')
            ? ($surveyOptions->template ?? $defaultTheme)
            : ($surveyTemplate ?? $defaultTheme);
        $themeConf = TemplateConfiguration::getInstanceFromTemplateName($templateName);
        $aTemplateList = $this->getAvailableTemplates(null, $templateName);
        return [
            'themeConf'          => $themeConf,
            'inheritedThemeName' => $inheritedThemeName,
            'aTemplateList'      => $aTemplateList,
... (294 lines truncated)
</file>

<file path="application/models/services/SurveyUseCaptcha.php">
<?php
namespace LimeSurvey\Models\Services;
use Survey;
class SurveyUseCaptcha
{
    const USE_CAPTCHA = ['A', 'B', 'C', 'D', 'X', 'R', 'S', 'N', 'E', 'F', 'G',
        'H', 'I', 'J', 'K', 'L', 'M', 'O', 'P', 'T', 'U', '1', '2', '3', '4', '5', '6'];
    const SURVEY_ACCESS_YES = ['A', 'B', 'C', 'X', 'F', 'H', 'K', 'O', 'T'];
    const SURVEY_ACCESS_NO = ['P', 'U', '3', '5', '6', 'D', 'R', 'S', 'N'];
    const SURVEY_ACCESS_INHERIT = ['E', 'G', 'I', 'J', 'L', 'M', '1', '2', '4'];
    const REGISTRATION_YES = ['A', 'B', 'D', 'R', 'F', 'G', 'I', 'M', 'U'];
    const REGISTRATION_NO = ['L', 'T', '2', '4', '5', 'C', 'X', 'S', 'N'];
    const REGISTRATION_INHERIT = ['E', 'H', 'J', 'K', 'O', 'P', '1', '3', '6'];
    const SAVE_LOAD_YES = ['A', 'C', 'D', 'S', 'G', 'H', 'J', 'L', 'P'];
    const SAVE_LOAD_NO = ['M', 'O', '1', '4', '6', 'B', 'X', 'R', 'N'];
    const SAVE_LOAD_INHERIT = ['E', 'F', 'I', 'K', 'T', 'U', '2', '3', '5'];
    private $survey;
    public function __construct($surveyId = null, ?Survey $survey = null)
    {
        if ($survey === null) {
            $this->survey = Survey::model()->findByPk($surveyId);
        } else {
            $this->survey = $survey;
        }
    }
    public function convertSurveyAccessToUseCaptcha(bool $value, string $mode)
    {
        $accessRegistrationSaveload = $this->convertUseCaptchaFromDB($this->survey->usecaptcha);
        $convertedValue = $value ? 'Y' : 'N';
        switch ($mode) {
... (142 lines truncated)
</file>

<file path="application/models/services/ThemeQuestionAttributeProvider.php">
<?php
namespace LimeSurvey\Models\Services;
class ThemeQuestionAttributeProvider extends QuestionAttributeProvider
{
    public function getDefinitions($options = [])
    {
        $questionTheme = self::getQuestionTheme($options);
        if (empty($questionTheme) || $questionTheme == \Question::DEFAULT_QUESTION_THEME) {
            return [];
        }
        $questionType = self::getQuestionType($options);
        if (empty($questionType)) {
            return [];
        }
        return $this->getAttributesFromQuestionTheme($questionTheme, $questionType);
    }
    protected function getAttributesFromQuestionTheme($questionThemeName, $questionType)
    {
        $attributes = array();
        $questionTheme = \QuestionTheme::model()->findByAttributes([], 'name = :name AND extends = :extends', ['name' => $questionThemeName, 'extends' => $questionType]);
        if ($questionTheme !== null) {
            $xmlFilePath = $questionTheme->getXmlPath() . '/config.xml';
            $extensionConfig = \ExtensionConfig::loadFromFileCached($xmlFilePath);
        }
        if (!empty($extensionConfig)) {
            $xmlAttributes = $extensionConfig->getNodeAsArray('attributes');
            if (!empty($xmlAttributes['attribute']['name'])) {
                $xmlAttributes['attribute'] = array($xmlAttributes['attribute']);
            }
            foreach ($xmlAttributes['attribute'] as $attribute) {
... (39 lines truncated)
</file>

<file path="application/models/services/TranslationMoToJson.php">
<?php
namespace LimeSurvey\Models\Services;
use CGettextMessageSource;
use LSGettextMoFile;
use Yii;
class TranslationMoToJson
{
    private string $language;
    public function __construct($language)
    {
        $this->language = $language;
    }
    public function translateMoToJson(bool $translateToJson = false)
    {
        $pathApplication = Yii::app()->getConfig('rootdir');
        $pathToLanguageFiles = $pathApplication . DIRECTORY_SEPARATOR . "locale"
            . DIRECTORY_SEPARATOR . $this->language . DIRECTORY_SEPARATOR
            . $this->language . '.mo';
        if (!file_exists($pathToLanguageFiles)) {
            return [
                'error' => 'Translation file not found.',
                'path' => $pathToLanguageFiles
            ];
        }
        $file = new LSGettextMoFile(false);
        try {
            $messagesGettext = $file->load($pathToLanguageFiles, '');
            foreach ($messagesGettext as $original => $translation) {
                // if original contains ":" in the end, make an extra entry without the ":"
                if (str_ends_with($original, ':')) {
... (19 lines truncated)
</file>

<file path="application/models/services/UploadValidator.php">
<?php
namespace LimeSurvey\Models\Services;
class UploadValidator
{
    private $post;
    private $files;
    public function __construct($post = null, $files = null)
    {
        $this->post = is_null($post) ? $_POST : $post;
        $this->files = is_null($files) ? $_FILES : $files;
    }
    public function getError($fileName, $customMaxSize = null)
    {
        if (is_null($customMaxSize)) {
            $maximumSize = getMaximumFileUploadSize();
        } else {
            $maximumSize = min((int) $customMaxSize, getMaximumFileUploadSize());
        }
        if (empty($this->post) && empty($this->files)) {
            return sprintf(
                gT("No file was uploaded or the request exceeded %01.2f MB."),
                convertPHPSizeToBytes(ini_get('post_max_size')) / 1024 / 1024
            );
        }
        if (!isset($this->files[$fileName])) {
            return gT("File not found.");
        }
        $fileSize = $this->files[$fileName]['size'];
        if ($fileSize > $maximumSize || $this->files[$fileName]['error'] == 1 || $this->files[$fileName]['error'] == 2) {
            return sprintf(
... (35 lines truncated)
</file>

<file path="application/models/services/UserManager.php">
<?php
namespace LimeSurvey\Models\Services;
use LSWebUser;
use Permission;
use Permissiontemplates;
use User;
use LimeSurvey\Datavalueobjects\OperationResult;
use LimeSurvey\Datavalueobjects\TypedMessage;
class UserManager
{
    private $managingUser;
    private $targetUser;
    public function __construct(
        ?LSWebUser $managingUser = null,
        ?User $targetUser = null
    ) {
        $this->managingUser = $managingUser;
        $this->targetUser = $targetUser;
    }
    public function canAssignPermissions()
    {
        if (empty($this->managingUser) || empty($this->targetUser)) {
            return false;
        }
        if (
            Permission::model()->hasGlobalPermission('superadmin', 'read', $this->managingUser->id)
            || (
                Permission::model()->hasGlobalPermission('users', 'update', $this->managingUser->id)
                && $this->targetUser->parent_id == $this->managingUser->id
            )
... (136 lines truncated)
</file>

<file path="application/models/services/ZipExtractor.php">
<?php
namespace LimeSurvey\Models\Services;
class ZipExtractor
{
    private $zip;
    private $filterCallback;
    private $skippedFiles = [];
    private $extractResult = [];
    private $extractStatus;
    public function __construct($filename = null)
    {
        if (!empty($filename)) {
            $this->openFile($filename);
        }
    }
    public function openFile($filename)
    {
        $this->zip = new \ZipArchive();
        $this->zip->open($filename);
    }
    public function setFilterCallback($filterCallback)
    {
        $this->filterCallback = $filterCallback;
    }
    public function extractTo($folder)
    {
        $files = $this->getFilesList($folder);
        $result = $this->zip->extractTo($folder, array_keys($files));
        $this->extractStatus = $this->zip->getStatusString();
        if ($result !== false) {
... (45 lines truncated)
</file>

<file path="application/models/Traits/PermissionTrait.php">
<?php
trait PermissionTrait
{
    public function getOwnerId()
    {
        return null;
    }
    public static function getPermissionData()
    {
        return array();
    }
    public static function getMinimalPermissionRead()
    {
        return null;
    }
    public function hasPermission( $sPermission, $sCRUD = 'read', $iUserID = null)
    {
        if (empty($iUserID)) {
            $iUserID = \Permission::model()->getUserId();
        }
        if (\Permission::model()->hasGlobalPermission('superadmin', $sCRUD, $iUserID)) {
            return true;
        }
        return false;
    }
}
</file>

<file path="application/models/AdminTheme.php">
<?php
class AdminTheme extends CFormModel
{
    public $name;
    public $path;
    public $sTemplateUrl;
    public $config;
    public static $use_asset_manager;
    private static $instance;
    public static function getAdminThemeList()
    {
        $sStandardTemplateRootDir  = Yii::app()->getConfig("styledir");
        $sUserTemplateDir          = Yii::app()->getConfig('uploaddir') . DIRECTORY_SEPARATOR . 'admintheme';
        $aStandardThemeObjects     = self::getThemeList($sStandardTemplateRootDir);
        $aUserThemeObjects         = self::getThemeList($sUserTemplateDir);
        $aListOfThemeObjects       = array_merge($aStandardThemeObjects, $aUserThemeObjects);
        ksort($aListOfThemeObjects);
        return $aListOfThemeObjects;
    }
    public function setAdminTheme()
    {
        $sAdminThemeName           = App()->getConfig('admintheme');
        $sStandardTemplateRootDir  = App()->getConfig("styledir");
        $sUserTemplateDir          = App()->getConfig('uploaddir') . DIRECTORY_SEPARATOR . 'admintheme';
        if ($this->isStandardAdminTheme($sAdminThemeName)) {
            $sTemplateDir = $sStandardTemplateRootDir;
            $sTemplateUrl = Yii::app()->getConfig('styleurl') . $sAdminThemeName;
        } else {
            $sTemplateDir = $sUserTemplateDir;
            $sTemplateUrl = Yii::app()->getConfig('uploadurl') . DIRECTORY_SEPARATOR . 'admintheme' . DIRECTORY_SEPARATOR . $sAdminThemeName;
... (164 lines truncated)
</file>

<file path="application/models/Answer.php">
<?php
class Answer extends LSActiveRecord
{
    private $oldCode;
    private $oldQid;
    private $oldScaleId;
    public static function model($className = __CLASS__)
    {
        $model = parent::model($className);
        return $model;
    }
    public function tableName()
    {
        return '{{answers}}';
    }
    public function primaryKey()
    {
        return 'aid';
    }
    public function relations()
    {
        $alias = $this->getTableAlias();
        return array(
            'question' => array(self::BELONGS_TO, 'Question', '',
                'on' => "$alias.qid = question.qid",
            ),
            'group' => array(self::BELONGS_TO, 'QuestionGroup', '', 'through' => 'question',
                'on' => 'question.gid = ' . Yii::app()->db->quoteTableName('group') . '.gid'
            ),
            'answerl10ns' => array(self::HAS_MANY, 'AnswerL10n', 'aid', 'together' => true),
... (123 lines truncated)
</file>

<file path="application/models/AnswerL10n.php">
<?php
class AnswerL10n extends LSActiveRecord
{
    public function tableName()
    {
        return '{{answer_l10ns}}';
    }
    public function primaryKey()
    {
        return 'id';
    }
    public function defaultScope()
    {
        return array('index' => 'language');
    }
    public static function model($className = __CLASS__)
    {
        $model = parent::model($className);
        return $model;
    }
    public function relations()
    {
        return [];
    }
    public function rules()
    {
        return [
            ['aid,language','required'],
            ['aid','numerical','integerOnly' => true],
            ['answer', 'LSYii_Validators'],
... (15 lines truncated)
</file>

<file path="application/models/ArchivedTableSettings.php">
<?php
class ArchivedTableSettings extends LSActiveRecord
{
    public function tableName(): string
    {
        return '{{archived_table_settings}}';
    }
    public function rules(): array
    {
        return [
            ['survey_id, user_id, tbl_name, tbl_type, created', 'required'],
            ['survey_id, user_id', 'numerical', 'integerOnly' => true],
            ['tbl_name', 'length', 'max' => 255],
            ['tbl_type', 'length', 'max' => 10],
            ['id, survey_id, user_id, tbl_name, tbl_type, created, properties', 'safe', 'on' => 'search'],
        ];
    }
    public function relations(): array
    {
        return [
        ];
    }
    public function attributeLabels(): array
    {
        return [
            'id'         => 'ID',
            'survey_id'  => 'Survey',
            'user_id'    => 'User',
            'tbl_name'   => 'Tbl Name',
            'tbl_type'   => 'Tbl Type',
... (27 lines truncated)
</file>

<file path="application/models/Assessment.php">
<?php
class Assessment extends LSActiveRecord
{
    public function init()
    {
        parent::init();
        if ($this->isNewRecord) {
            if (empty($this->scope)) {
                $this->scope = '0';
            }
        }
    }
    public static function model($className = __CLASS__)
    {
        $model = parent::model($className);
        return $model;
    }
    public function rules()
    {
        return array(
            array('name,message', 'LSYii_Validators'),
            array('scope', 'in', 'range' => array('G', 'T'))
        );
    }
    public function tableName()
    {
        return '{{assessments}}';
    }
    public function primaryKey()
    {
... (170 lines truncated)
</file>

<file path="application/models/AssetVersion.php">
<?php
class AssetVersion extends LSActiveRecord
{
    public static function model($className = __CLASS__)
    {
        return parent::model($className);
    }
    public function init()
    {
        $this->path = "";
        $this->version = 0;
    }
    /** @inheritdoc */
    public function tableName()
    {
        return '{{asset_version}}';
    }
    /** @inheritdoc */
    public function rules()
    {
        return array(
            array('path', 'required'),
            array('path', 'unique'),
            array('version', 'required'),
            array('version', 'numerical', 'integerOnly' => true),
        );
    }
    /**
     * get current assetVersion
     * @param string $path
... (37 lines truncated)
</file>

<file path="application/models/Box.php">
<?php
class Box extends CActiveRecord
{
    public function tableName()
    {
        return '{{boxes}}';
    }
    public function rules()
    {
        return array(
            array('url, title, ico, position, desc, page', 'required'),
            array('url', 'match', 'pattern' => '/(http:\/\/)?[a-zA-Z]([a-zA-Z0-9-_?&"\'=]\/?)*/'),
            array('url', 'LSYii_Validators', 'isUrl' => true),
            array('position', 'numerical', 'integerOnly' => true),
            array('position', 'unique', 'message' => gT('Position {value} already exists.')),
            array('usergroup', 'numerical', 'integerOnly' => true, 'min' => -3),
            array('ico', 'match', 'pattern' => '/^[A-Za-z0-9_ \-]+$/u','message' => gT('Icon name must be a simple class name (alphanumeric, space, minus and underscore).')),
            array('title', 'LSYii_Validators'),
            array('id, position, url, title, ico, desc, page, usergroup', 'safe', 'on' => 'search'),
        );
    }
    public function relations()
    {
        return array(
        );
    }
    public function attributeLabels()
    {
        return array(
            'id' => 'ID',
... (200 lines truncated)
</file>

<file path="application/models/Condition.php">
<?php
class Condition extends LSActiveRecord
{
    public static function model($className = __CLASS__)
    {
        $model = parent::model($className);
        return $model;
    }
    public function tableName()
    {
        return '{{conditions}}';
    }
    public function primaryKey()
    {
        return 'cid';
    }
    public function relations()
    {
        $alias = $this->getTableAlias();
        return array(
            'questions' => array(self::HAS_ONE, 'Question', '',
                'on' => "$alias.cqid = questions.qid",
            ),
        );
    }
    public function deleteRecords($condition = false)
    {
        $criteria = new CDbCriteria();
        if ($condition != false) {
            if (is_array($condition)) {
... (224 lines truncated)
</file>

<file path="application/models/DataIntegrityChecker.php">
<?php
class DataIntegrityChecker
{
    public function __construct()
    {
        Yii::app()->loadHelper('database');
        Yii::app()->loadHelper('surveytranslator');
    }
    public function applyAutomaticFixes()
    {
        $aDelete = $this->checkintegrity();
        $aData = array(
            'messages' => array(),
            'warnings' => array(),
        );
        if (isset($aDelete['orphanuserpermissions']) || isset($aDelete['orphansurveypermissions'])) {
            $aData = $this->deleteOrphanPermissions($aData);
        }
        if (isset($aDelete['surveyswithoutsurveygroup'])) {
            $aData = $this->moveSurveysToDefaultSurveyGroup($aDelete['surveyswithoutsurveygroup'], $aData);
        }
        if (isset($aDelete['orphansurveygroupsettings'])) {
            $aData = $this->deleteOrphanSurveyGroupSettings($aData);
        }
        if (isset($aDelete['surveyswithoutresponsetable'])) {
            $aData = $this->deactivateSurveysWithoutResponseTable($aDelete['surveyswithoutresponsetable'], $aData);
        }
        if (isset($aDelete['orphanresponsetables'])) {
            $aData = $this->archiveOrphanResponseTables($aDelete['orphanresponsetables'], $aData);
        }
... (1119 lines truncated)
</file>

<file path="application/models/DefaultValue.php">
<?php
class DefaultValue extends LSActiveRecord
{
    public $specialtype = '';
    public $scale_id = '';
    public $sqid = 0;
    /**
     * @inheritdoc
     * @return DefaultValue
     */
    public static function model($className = __CLASS__)
    {
        /** @var self $model */
        $model = parent::model($className);
        return $model;
    }
    /** @inheritdoc */
    public function tableName()
    {
        return '{{defaultvalues}}';
    }
    /** @inheritdoc */
    public function primaryKey()
    {
        return array('dvid');
    }
    public function relations()
    {
        return array(
            'question' => array(self::HAS_ONE, 'Question', "qid"),
... (12 lines truncated)
</file>

<file path="application/models/DefaultValueL10n.php">
<?php
class DefaultValueL10n extends LSActiveRecord
{
    public $maxsortorder;
    public function tableName()
    {
        return '{{defaultvalue_l10ns}}';
    }
    public function primaryKey()
    {
        return 'id';
    }
    public static function model($className = __CLASS__)
    {
        $model = parent::model($className);
        return $model;
    }
    public function rules()
    {
        return array(
            array('dvid', 'numerical', 'integerOnly' => true),
            array('defaultvalue', 'LSYii_Validators'),
            array('language', 'length', 'min' => 2, 'max' => 20),
        );
    }
    public function relations()
    {
        $alias = $this->getTableAlias();
        return array(
            'defaultvalue' => array(self::BELONGS_TO, 'defaultvalue', '', 'on' => "$alias.dvid = defaultvalue.dvid"),
... (8 lines truncated)
</file>

<file path="application/models/Dynamic.php">
<?php
abstract class Dynamic extends LSActiveRecord
{
    protected $dynamicId;
    public function __construct($scenario = 'insert')
    {
        list(,$this->dynamicId) = explode('_', get_class($this));
        parent::__construct($scenario);
    }
    public static function model($className = null)
    {
        if (!isset($className)) {
            $className = get_called_class();
        } elseif (is_numeric($className)) {
            $className = get_called_class() . '_' . $className;
        }
        $model = parent::model($className);
        return $model;
    }
    public static function create($id, $scenario = 'insert')
    {
        $className = get_called_class() . '_' . $id;
        return new $className($scenario);
    }
    public function getDynamicId()
    {
        return $this->dynamicId;
    }
}
</file>

<file path="application/models/ExpressionError.php">
<?php
class ExpressionError extends LSActiveRecord
{
    public static function model($className = __CLASS__)
    {
        $model = parent::model($className);
        return $model;
    }
    public function tableName()
    {
        return '{{expression_errors}}';
    }
    public function primaryKey()
    {
        return 'scid';
    }
}
</file>

<file path="application/models/ExtensionConfig.php">
<?php
class ExtensionConfig
{
    public $xml;
    private static $loadedConfigs = [];
    public function __construct(SimpleXMLElement $xml)
    {
        $this->xml = $xml;
    }
    public function validate()
    {
        $tags = [
            'metadata' => [
                'name',
                'description',
                'author',
                'license',
                'version',
                'type'
            ],
            'compatibility' => [],
        ];
        foreach ($tags as $key => $value) {
            if (!isset($this->xml->$key)) {
                throw new Exception(
                    sprintf(
                        gT('Missing tag %s in extension config.xml'),
                        $key
                    )
                );
... (140 lines truncated)
</file>

<file path="application/models/ExtensionUpdateInfo.php">
<?php
class ExtensionUpdateInfo
{
    protected $extensionType;
    protected $versions;
    protected $isSecurityUpdate;
    public function __construct($type, $versions, $security = false)
    {
        $this->extensionType    = $type;
        $this->versions          = $versions;
        $this->isSecurityUpdate = $security;
    }
    public function versionIsSecurityUpdate()
    {
        return $this->isSecurityUpdate;
    }
}
</file>

<file path="application/models/FailedEmail.php">
<?php
class FailedEmail extends LSActiveRecord
{
    public const STATE_SUCCESS = 'SEND SUCCESS';
    public const STATE_FAILED = 'SEND FAILED';
    public function tableName(): string
    {
        return '{{failed_emails}}';
    }
    public function rules(): array
    {
        return [
            ['id, surveyid, responseid, email_type, recipient, error_message, created, resend_vars', 'required'],
            ['email_type', 'length', 'max' => 200],
            ['recipient', 'length', 'max' => 320],
            ['status', 'length', 'max' => 20],
            ['language', 'length', 'max' => 20],
            ['created, updated', 'safe'],
            ['id, responseid, email_type, recipient, language, created, error_message, status, updated', 'safe', 'on' => 'search'],
        ];
    }
    public function relations(): array
    {
        return [
            'survey' => array(self::HAS_ONE, 'Survey', ['sid' => 'surveyid']),
        ];
    }
    public function attributeLabels(): array
    {
        return [
... (187 lines truncated)
</file>

<file path="application/models/FailedLoginAttempt.php">
<?php
class FailedLoginAttempt extends LSActiveRecord
{
    public const TYPE_LOGIN = 'login';
    public const TYPE_TOKEN = 'token';
    public static function model($className = __CLASS__)
    {
        $model = parent::model($className);
        return $model;
    }
    public function primaryKey()
    {
        return 'id';
    }
    public function tableName()
    {
        return '{{failed_login_attempts}}';
    }
    public function deleteAttempts(string $attemptType = 'login')
    {
        $ip = substr(getRealIPAddress(), 0, 40);
        if (Yii::app()->getConfig('DBVersion') <= 480) {
            $this->deleteAllByAttributes(array('ip' => $ip));
        } else {
            $this->deleteAllByAttributes(array('ip' => $ip, 'is_frontend' => ($attemptType === FailedLoginAttempt::TYPE_TOKEN)));
        }
    }
    public function isLockedOut(string $attemptType): bool
    {
        $isLockedOut = false;
... (105 lines truncated)
</file>

<file path="application/models/index.html">
<html>
<head>
    <title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
</file>

<file path="application/models/InstallerConfigForm.php">
<?php
class InstallerConfigForm extends CFormModel
{
    public const ENGINE_TYPE_MYISAM = 'MYISAM';
    public const ENGINE_TYPE_INNODB = 'INNODB';
    public const DB_TYPE_MYSQL = 'mysql';
    public const DB_TYPE_MYSQLI = 'mysqli';
    public const DB_TYPE_SQLSRV = 'sqlsrv';
    public const DB_TYPE_MSSQL = 'mssql';
    public const DB_TYPE_DBLIB = 'dblib';
    public const DB_TYPE_PGSQL = 'pgsql';
    public const DB_TYPE_ODBC = 'odbc';
    public const MINIMUM_MEMORY_LIMIT = 128;
    public const RECOMMENDED_MAX_INPUT_VARS = 5000;
    public const RECOMMENDED_POST_MAX_SIZE = 32;
    public const RECOMMENDED_UPLOAD_MAX_FILESIZE = 32;
    public const MINIMUM_PHP_VERSION = '8.1.29';
    public $dbtype;
    public $dblocation = 'localhost';
    public $dbport;
    public $dbname;
    public $useDbName = true;
    public $dbuser;
    public $dbpwd;
    public $dbprefix = 'lime_';
    public $dbengine;
    public $mssqlTrustServerCertificate = false;
    public $db_names = array(
        self::DB_TYPE_MYSQL => 'MySQL',
        self::DB_TYPE_MYSQLI => 'MySQL (newer driver)',
... (504 lines truncated)
</file>

<file path="application/models/Label.php">
<?php
class Label extends LSActiveRecord
{
    public $maxsortorder;
    public function tableName()
    {
        return '{{labels}}';
    }
    public function primaryKey()
    {
        return 'id';
    }
    public static function model($className = __CLASS__)
    {
        $model = parent::model($className);
        return $model;
    }
    public function rules()
    {
        return array(
            array('lid', 'numerical', 'integerOnly' => true),
            array('code', 'unique', 'caseSensitive' => true, 'criteria' => array(
                            'condition' => 'lid = :lid',
                            'params' => array(':lid' => $this->lid)
                    ),
                    'message' => '{attribute} "{value}" is already in use.'),
            array(
                'code',
                'match',
                'pattern' => '/^[[:alnum:]]*$/',
... (27 lines truncated)
</file>

<file path="application/models/LabelL10n.php">
<?php
class LabelL10n extends LSActiveRecord
{
    public $maxsortorder;
    public function tableName()
    {
        return '{{label_l10ns}}';
    }
    public function primaryKey()
    {
        return 'id';
    }
    public static function model($className = __CLASS__)
    {
        $model = parent::model($className);
        return $model;
    }
    public function rules()
    {
        return array(
            array('label_id', 'numerical', 'integerOnly' => true),
            array('title', 'LSYii_Validators'),
            array('language', 'length', 'min' => 2, 'max' => 20),
        );
    }
    public function relations()
    {
        return array(
            'label' => array(self::BELONGS_TO, 'Label', 'label_id')
        );
... (7 lines truncated)
</file>

<file path="application/models/LabelSet.php">
<?php
class LabelSet extends LSActiveRecord implements PermissionInterface
{
    use PermissionTrait;
    public function tableName()
    {
        return '{{labelsets}}';
    }
    public function primaryKey()
    {
        return 'lid';
    }
    public static function model($className = __CLASS__)
    {
        $model = parent::model($className);
        return $model;
    }
    public function rules()
    {
        return array(
            array('owner_id', 'numerical', 'integerOnly' => true),
            array('label_name', 'required'),
            array('label_name', 'filter', 'filter' => array(self::class, 'sanitizeAttribute')),
            array('label_name', 'length', 'min' => 1, 'max' => 100),
            array('label_name', 'LSYii_Validators'),
            array('languages', 'required'),
            array('languages', 'LSYii_Validators', 'isLanguageMulti' => true),
        );
    }
    public function relations()
... (158 lines truncated)
</file>

<file path="application/models/LSActiveRecord.php">
<?php
class LSActiveRecord extends CActiveRecord
{
    protected $xssFilterAttributes = [];
    public $bEncryption = false;
    private $loadedAttributes = [];
    protected function afterFind()
    {
        parent::afterFind();
        $this->loadedAttributes = $this->getAttributes();
    }
    public function isAttributeModifiedFromStored($name)
    {
        if ($this->getIsNewRecord()) {
            return true;
        }
        if (!array_key_exists($name, $this->loadedAttributes)) {
            return true;
        }
        return (string) $this->loadedAttributes[$name] !== (string) $this->$name;
    }
    public function behaviors()
    {
        $aBehaviors = [];
        $sCreateFieldName = ($this->hasAttribute('created') ? 'created' : null);
        $sUpdateFieldName = ($this->hasAttribute('modified') ? 'modified' : null);
        $sDriverName = Yii::app()->db->getDriverName();
        $aBehaviors['CTimestampBehavior'] = [
            'class'               => 'zii.behaviors.CTimestampBehavior',
            'createAttribute'     => $sCreateFieldName,
... (284 lines truncated)
</file>

<file path="application/models/MapTutorialUsers.php">
<?php
class MapTutorialUsers extends CActiveRecord
{
    public function tableName()
    {
        return '{{map_tutorial_users}}';
    }
    public function rules()
    {
        return array(
            array('tid', 'required'),
            array('tid, uid, taken', 'numerical', 'integerOnly' => true),
            array('tid, uid, taken', 'safe', 'on' => 'search'),
        );
    }
    public function relations()
    {
        return array(
        );
    }
    public function attributeLabels()
    {
        return array(
            'tid' => 'Tid',
            'uid' => 'Uid',
            'taken' => 'Taken',
        );
    }
    public function search()
    {
... (15 lines truncated)
</file>

<file path="application/models/Notification.php">
<?php
class Notification extends LSActiveRecord
{
    const NORMAL_IMPORTANCE   = 1;
    const NAG_ONCE_IMPORTANCE = 2;
    const HIGH_IMPORTANCE     = 3;
    public function __construct($options = null)
    {
        if (is_string($options) || is_null($options)) {
            parent::__construct($options);
            return;
        } else {
            parent::__construct();
        }
        $options = $this->checkShortcuts($options);
        $this->checkMandatoryFields($options, array(
            'entity',
            'entity_id',
            'title',
            'message',
        ));
        if ($options['entity'] != 'survey' && $options['entity'] != 'user') {
            throw new InvalidArgumentException('Invalid entity: ' . $options['entity']);
        }
        if (!isset($options['display_class'])) {
            $options['display_class'] = 'default';
        }
        if (!isset($options['importance'])) {
            $options['importance'] = self::NORMAL_IMPORTANCE;
        }
... (197 lines truncated)
</file>

<file path="application/models/Participant.php">
<?php
use LimeSurvey\Exceptions\CPDBException;
class Participant extends LSActiveRecord
{
    public $extraCondition;
    public $countActiveSurveys;
    public $id;
    protected static $sid = 0;
    public static function model($className = __CLASS__)
    {
        $model = parent::model($className);
        return $model;
    }
    public function tableName()
    {
        return '{{participants}}';
    }
    public function rules()
    {
        return array(
            array('participant_id, blacklisted, owner_uid', 'required'),
            array('owner_uid', 'numerical', 'integerOnly' => true),
            array('participant_id', 'length', 'max' => 50),
            array('firstname, lastname', 'length', 'max' => 150),
            array('language', 'length', 'max' => 40),
            array('firstname, lastname, language', 'LSYii_Validators'),
            array('email', 'length', 'max' => 254),
            array('email', 'LSYii_FilterValidator', 'filter' => 'trim', 'skipOnEmpty' => true, 'except' => 'search'),
            array('email', 'LSYii_EmailIDNAValidator', 'allowEmpty' => true, 'allowMultiple' => true, 'except' => 'search'),
            array('blacklisted', 'length', 'max' => 1),
... (1884 lines truncated)
</file>

<file path="application/models/ParticipantAttribute.php">
<?php
class ParticipantAttribute extends LSActiveRecord
{
    public static function model($className = __CLASS__)
    {
        $model = parent::model($className);
        return $model;
    }
    public function tableName()
    {
        return '{{participant_attribute}}';
    }
    public function primaryKey()
    {
        return array('participant_id', 'attribute_id');
    }
    public function relations()
    {
        return array(
            'participant' => array(self::HAS_ONE, 'Participant', 'participant_id'),
            'participant_attribute_name' => array(self::BELONGS_TO, 'ParticipantAttributeName', 'attribute_id')
        );
    }
    public function getAttributeInfo($participantid)
    {
        $model = self::model()->with('participant_attribute_name')->findAllByAttributes(array('participant_id' => $participantid));
        return $model;
    }
    public function updateParticipantAttributeValue($data)
    {
... (34 lines truncated)
</file>

<file path="application/models/ParticipantAttributeName.php">
<?php
class ParticipantAttributeName extends LSActiveRecord
{
    public function primaryKey()
    {
        return 'attribute_id';
    }
    public static function model($className = __CLASS__)
    {
        $model = parent::model($className);
        return $model;
    }
    public function tableName()
    {
        return '{{participant_attribute_names}}';
    }
    public function rules()
    {
        return array(
            array('core_attribute', 'default', 'value' => 'N'),
            array('defaultname', 'LSYii_FilterValidator', 'filter' => 'strip_tags', 'skipOnEmpty' => true),
            array('attribute_type, visible, encrypted, core_attribute', 'required'),
            array('attribute_type', 'length', 'max' => 4),
            array('visible, encrypted, core_attribute', 'length', 'max' => 5),
            array('attribute_id, attribute_type, visible, encrypted, core_attribute', 'safe', 'on' => 'search'),
        );
    }
    public function relations()
    {
        return array(
... (651 lines truncated)
</file>

<file path="application/models/ParticipantAttributeNameLang.php">
<?php
class ParticipantAttributeNameLang extends LSActiveRecord
{
    public function primaryKey()
    {
        return array('attribute_id', 'lang');
    }
    public static function model($className = __CLASS__)
    {
        $model = parent::model($className);
        return $model;
    }
    public function tableName()
    {
        return '{{participant_attribute_names_lang}}';
    }
    public function rules()
    {
        return array(
            array('attribute_name', 'LSYii_FilterValidator', 'filter' => 'strip_tags', 'skipOnEmpty' => true),
            array('attribute_id, attribute_name, lang', 'safe', 'on' => 'search'),
        );
    }
    public function relations()
    {
        return array(
            'participant_attribute_name' => array(self::BELONGS_TO, 'ParticipantAttributeName', 'attribute_id')
        );
    }
}
... (1 lines truncated)
</file>

<file path="application/models/ParticipantAttributeValue.php">
<?php
class ParticipantAttributeValue extends LSActiveRecord
{
    public function tableName()
    {
        return '{{participant_attribute_values}}';
    }
    public function primaryKey()
    {
        return 'value_id';
    }
    public static function model($className = __CLASS__)
    {
        $model = parent::model($className);
        return $model;
    }
    public function rules()
    {
        return array(
            ['attribute_id', 'required'],
            ['value', 'LSYii_FilterValidator', 'filter' => 'strip_tags', 'skipOnEmpty' => true],
            ['value_id, attribute_id, value', 'safe', 'on' => 'search'],
        );
    }
    public function relations()
    {
        return array(
            'participant_attribute_name' => array(self::BELONGS_TO, 'ParticipantAttributeName', 'attribute_id')
        );
    }
... (2 lines truncated)
</file>

<file path="application/models/ParticipantShare.php">
<?php
use ls\ajax\AjaxHelper;
class ParticipantShare extends LSActiveRecord
{
    public $ownerName;
    public static function model($className = __CLASS__)
    {
        $model = parent::model($className);
        return $model;
    }
    public function tableName()
    {
        return '{{participant_shares}}';
    }
    public function rules()
    {
        return array(
            array('participant_id, share_uid, date_added, can_edit', 'required'),
            array('share_uid', 'numerical', 'integerOnly' => true),
            array('participant_id', 'length', 'max' => 50),
            array('can_edit', 'length', 'max' => 5),
            array('participant_id, participant.firstname, participant.lastname, participant.email, share_uid, date_added, can_edit', 'safe', 'on' => 'search'),
        );
    }
    public function relations()
    {
        return array(
            'participant' => array(self::HAS_ONE, 'Participant', array('participant_id' => 'participant_id')),
            'shared_by' => array(self::HAS_ONE, 'User', array('uid' => 'share_uid')),
            'surveylinks' => array(self::HAS_ONE, 'SurveyLink', 'participant_id'),
... (304 lines truncated)
</file>

<file path="application/models/Permission.php">
<?php
class Permission extends LSActiveRecord
{
    protected static $aGlobalBasePermissions;
    protected static $aCachedSurveyPermissions = [];
    public function tableName()
    {
        return '{{permissions}}';
    }
    public static function model($className = __CLASS__)
    {
        $model = parent::model($className);
        return $model;
    }
    public function rules()
    {
        return array(
            array('entity, entity_id, uid, permission', 'required'),
            array('entity', 'length', 'max' => 50),
            array('entity',  'LSYii_FilterValidator', 'filter' => 'strtolower', 'skipOnEmpty' => true),
            array('permission', 'length', 'max' => 100),
            array('create_p, read_p, update_p, delete_p, import_p, export_p', 'default', 'value' => 0),
            array('create_p, read_p, update_p, delete_p, import_p, export_p', 'numerical', 'integerOnly' => true),
        );
    }
    public function relations()
    {
        return [
            'user' => array(self::BELONGS_TO, 'User', 'uid'),
        ];
... (607 lines truncated)
</file>

<file path="application/models/Permissiontemplates.php">
<?php
class Permissiontemplates extends CActiveRecord
{
    public function tableName()
    {
        return '{{permissiontemplates}}';
    }
    public function rules()
    {
        return array(
            array('name, description, renewed_last, created_at, created_by', 'required'),
            array('created_by', 'numerical', 'integerOnly' => true),
            array('name', 'length', 'max' => 192),
            array('ptid, name, description, renewed_last, created_at, created_by', 'safe', 'on' => 'search'),
        );
    }
    public function relations()
    {
        return array(
            'connectedusers' => array(self::HAS_MANY, 'UserInPermissionrole', ['ptid']),
        );
    }
    public function attributeLabels(): array
    {
        return [
            'ptid' => 'ID',
            'name' => gT('Name'),
            'description' => gT('Description'),
            'renewed_last' => gT('Last renewed'),
            'created_at' => gT('Created at'),
... (266 lines truncated)
</file>

<file path="application/models/Plugin.php">
<?php
class Plugin extends LSActiveRecord
{
    public $load_error;
    public $plugin_type;
    public function init()
    {
    }
    public static function model($className = __CLASS__)
    {
        $model = parent::model($className);
        return $model;
    }
    public function tableName()
    {
        return '{{plugins}}';
    }
    public function setLoadError(array $error)
    {
        if (!function_exists('gT')) {
            \Yii::app()->loadHelper('common');
        }
        $sql = "UPDATE {{plugins}} SET load_error = 1, load_error_message = :error_message WHERE id = :id";
        $params = [
            ':error_message' => $error['message'] . ' ' . $error['file'],
            ':id' => $this->id
        ];
        $rowNumber = \Yii::app()->db->createCommand($sql)->bindValues($params)->execute();
        $message = sprintf(
            "Plugin %s (%s) deactivated with error “%s” at file %s",
... (315 lines truncated)
</file>

<file path="application/models/PluginDynamic.php">
<?php
class PluginDynamic extends LSActiveRecord
{
    private static $models = array();
    private $md;
    protected $tableName;
    public function __construct($sTableName = null, $scenario = 'insert')
    {
        if (!isset($sTableName)) {
            throw new Exception('sTableName missing.');
        }
        $this->tableName = $sTableName;
        parent::__construct($scenario);
    }
    protected function instantiate($attributes = null)
    {
        $class = get_class($this);
        $model = new $class($this->tableName(), null);
        return $model;
    }
    public static function model($className = null)
    {
        if (isset($className)) {
            if (!isset(self::$models[$className])) {
                $model = self::$models[$className] = new PluginDynamic($className, null);
                $model->md = new CActiveRecordMetaData($model);
                $model->attachBehaviors($model->behaviors());
            }
            return self::$models[$className];
        }
... (17 lines truncated)
</file>

<file path="application/models/PluginSetting.php">
<?php
class PluginSetting extends CActiveRecord
{
    public static function model($className = __CLASS__)
    {
        $model = parent::model($className);
        return $model;
    }
    public function tableName()
    {
        return '{{plugin_settings}}';
    }
    public function rules()
    {
        return array(
            array('plugin_id', 'numerical', 'integerOnly' => true),
            array('model', 'length', 'max' => 255, 'allowEmpty' => true),
            array('model_id', 'numerical', 'integerOnly' => true, 'allowEmpty' => true),
            array('key', 'length', 'max' => 255),
        );
    }
}
</file>

<file path="application/models/Question.php">
<?php
use LimeSurvey\Helpers\questionHelper;
class Question extends LSActiveRecord
{
    const QT_1_ARRAY_DUAL = '1';
    const QT_5_POINT_CHOICE = '5';
    const QT_A_ARRAY_5_POINT = 'A';
    const QT_B_ARRAY_10_CHOICE_QUESTIONS = 'B';
    const QT_C_ARRAY_YES_UNCERTAIN_NO = 'C';
    const QT_D_DATE = 'D';
    const QT_E_ARRAY_INC_SAME_DEC = 'E';
    const QT_F_ARRAY = 'F';
    const QT_G_GENDER = 'G';
    const QT_H_ARRAY_COLUMN = 'H';
    const QT_I_LANGUAGE = 'I';
    const QT_K_MULTIPLE_NUMERICAL = 'K';
    const QT_L_LIST = 'L';
    const QT_M_MULTIPLE_CHOICE = 'M';
    const QT_N_NUMERICAL = 'N';
    const QT_O_LIST_WITH_COMMENT = 'O';
    const QT_P_MULTIPLE_CHOICE_WITH_COMMENTS = 'P';
    const QT_Q_MULTIPLE_SHORT_TEXT = 'Q';
    const QT_R_RANKING = 'R';
    const QT_S_SHORT_FREE_TEXT = 'S';
    const QT_T_LONG_FREE_TEXT = 'T';
    const QT_U_HUGE_FREE_TEXT = 'U';
    const QT_X_TEXT_DISPLAY = 'X';
    const QT_Y_YES_NO_RADIO = 'Y';
    const QT_EXCLAMATION_LIST_DROPDOWN = '!';
    const QT_VERTICAL_FILE_UPLOAD = '|';
... (1173 lines truncated)
</file>

<file path="application/models/QuestionAttribute.php">
<?php
use LimeSurvey\Models\Services\QuestionAttributeHelper;
class QuestionAttribute extends LSActiveRecord
{
    public const DATE_LIMIT_PATTERN = '/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])([ T]([01][0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9])?)?$/D';
    protected static $questionAttributesSettings = array();
    protected $xssFilterAttributes = ['value'];
    public static function model($className = __CLASS__)
    {
        $model = parent::model($className);
        return $model;
    }
    public function tableName()
    {
        return '{{question_attributes}}';
    }
    public function primaryKey()
    {
        return 'qaid';
    }
    public function relations()
    {
        return array(
            'qid' => array(self::BELONGS_TO, 'Question', 'qid', 'together' => true),
        );
    }
    public function defaultScope()
    {
        return array('index' => 'attribute');
    }
... (413 lines truncated)
</file>

<file path="application/models/QuestionBaseDataSet.php">
<?php
use LimeSurvey\Datavalueobjects\GeneralOption;
use LimeSurvey\Datavalueobjects\SwitchOption;
use LimeSurvey\Datavalueobjects\FormElement;
abstract class QuestionBaseDataSet extends StaticModel
{
    private $iQuestionId;
    private $sQuestionType;
    private $sLanguage;
    private $oQuestion;
    public function __construct($iQuestionId)
    {
        $this->iQuestionId = $iQuestionId;
        $this->oQuestion = Question::model()->findByPk($iQuestionId);
    }
    public function getGeneralSettingsArray($iQuestionID = null, $sQuestionType = null, $sLanguage = null, $questionThemeName = null)
    {
        Yii::import('ext.GeneralOptionWidget.settings.*');
        if ($iQuestionID != null) {
            $this->oQuestion = Question::model()->findByPk($iQuestionID);
        } else {
            $iSurveyId = Yii::app()->request->getParam('sid') ??
                Yii::app()->request->getParam('surveyid') ??
                Yii::app()->request->getParam('surveyId');
            $this->oQuestion = $oQuestion = QuestionCreate::create($iSurveyId, $sQuestionType);
        }
        $this->sQuestionType = $sQuestionType == null ? $this->oQuestion->type : $sQuestionType;
        $this->sLanguage = $sLanguage == null ? $this->oQuestion->survey->language : $sLanguage;
        $generalOptions = [
            'gid'             => GroupSelectorGeneralOption::make($this->oQuestion, $this->sLanguage),
... (29 lines truncated)
</file>

<file path="application/models/QuestionBaseRenderer.php">
<?php
abstract class QuestionBaseRenderer extends StaticModel
{
    public $oQuestion;
    public $sSGQA;
    public $sHtml;
    public $bRenderDirect;
    public $bPreview;
    public $sCoreClass;
    public $checkconditionFunction = "checkconditions";
    protected $aFieldArray;
    protected $aQuestionAttributes;
    protected $aSurveySessionArray;
    protected $mSessionValue;
    protected $sLanguage;
    protected $aSubQuestions = [];
    protected $aAnswerOptions = [];
    protected $aPackages = [];
    protected $aScripts = [];
    protected $aScriptFiles = [];
    protected $aStyles = [];
    protected $questionOrderingService;
    public function __construct($aFieldArray, $bRenderDirect = false)
    {
        $this->aFieldArray = $aFieldArray;
        $this->sSGQA = $this->aFieldArray[1];
        $this->oQuestion = Question::model()->findByPk($aFieldArray[0]);
        $this->bRenderDirect = $bRenderDirect;
        $this->sLanguage = $this->setDefaultIfEmpty(@$aFieldArray['language'], @$_SESSION['responses_' . $this->oQuestion->sid]['s_lang']);
        if (!$this->sLanguage) {
... (350 lines truncated)
</file>

<file path="application/models/QuestionCreate.php">
<?php
class QuestionCreate extends Question
{
    public static function create($iSurveyId, $type = null, $themeName = null)
    {
        $oSurvey = Survey::model()->findByPk($iSurveyId);
        if (empty($oSurvey)) {
            throw new Exception('Found no survey with id ' . json_encode($iSurveyId));
        }
        $gid = (int)Yii::app()->request->getParam('gid', 0);
        if ($gid == 0) {
            $gid = (int) SettingsUser::getUserSettingValue('last_question_gid', null, 'Survey', $iSurveyId, 0);
        }
        $groupIds = array_map(function ($group) {
            return $group->gid;
        }, $oSurvey->groups);
        if ($gid == 0 || !in_array($gid, $groupIds)) {
            $gid = array_values($oSurvey->groups)[0]->gid;
        }
        if (isset($type) && !empty($type)) {
            $questionType = $type;
        } else {
            $questionType = SettingsUser::getUserSettingValue('preselectquestiontype', null, null, null, Yii::app()->getConfig('preselectquestiontype'));
        }
        if (isset($themeName) && !empty($themeName)) {
            $questionThemeName = $themeName;
        } else {
            $questionThemeName = SettingsUser::getUserSettingValue('preselectquestiontheme', null, null, null, Yii::app()->getConfig('preselectquestiontheme'));
        }
        if (empty($questionThemeName)) {
... (87 lines truncated)
</file>

<file path="application/models/QuestionGroup.php">
<?php
use LimeSurvey\Models\Services\Exception\{
    NotFoundException,
    BadRequestException
};
class QuestionGroup extends LSActiveRecord
{
    public $aQuestions;
    public $group_name;
    public $language;
    public $description;
    public static function model($className = __CLASS__)
    {
        $model = parent::model($className);
        return $model;
    }
    public function tableName()
    {
        return '{{groups}}';
    }
    public function primaryKey()
    {
        return 'gid';
    }
    public function rules()
    {
        return [
            ['group_order', 'numerical', 'integerOnly' => true, 'allowEmpty' => true],
            ['grelevance', 'LSYii_FilterValidator', 'filter' => 'trim', 'skipOnEmpty' => true],
            ['randomization_group', 'safe']
... (317 lines truncated)
</file>

<file path="application/models/QuestionGroupL10n.php">
<?php
class QuestionGroupL10n extends LSActiveRecord
{
    public function tableName()
    {
        return '{{group_l10ns}}';
    }
    public function primaryKey()
    {
        return 'id';
    }
    public static function model($className = __CLASS__)
    {
        $model = parent::model($className);
        return $model;
    }
    public function relations()
    {
        $alias = $this->getTableAlias();
        return array(
            'group' => array(self::BELONGS_TO, QuestionGroup::class, '', 'on' => "$alias.gid = group.gid"),
        );
    }
    public function defaultScope()
    {
        return array('index' => 'language');
    }
    public function rules()
    {
        return array(
... (19 lines truncated)
</file>

<file path="application/models/QuestionL10n.php">
<?php
class QuestionL10n extends LSActiveRecord
{
    public function tableName()
    {
        return '{{question_l10ns}}';
    }
    public function primaryKey()
    {
        return 'id';
    }
    public static function model($className = __CLASS__)
    {
        $model = parent::model($className);
        return $model;
    }
    public function relations()
    {
        return array(
        );
    }
    public function defaultScope()
    {
        return array('index' => 'language');
    }
    public function rules()
    {
        $rules = array(
            ['qid,language', 'required'],
            ['qid', 'numerical', 'integerOnly' => true],
... (22 lines truncated)
</file>

<file path="application/models/QuestionTemplate.php">
<?php
class QuestionTemplate extends CFormModel
{
    public $oQuestion;
    public $bHasTemplate;
    public $sTemplateFolderName;
    public $aViews;
    public $oConfig;
    public $bHasCustomAttributes;
    public $aCustomAttributes;
    private $sTemplatePath;
    private $sTemplateUrl;
    private $sTemplateQuestionPath;
    private $bHasConfigFile;
    private $xmlFile;
    private $bLoadCoreJs;
    private $bLoadCoreCss;
    private $bLoadCorePackage;
    private static $instance;
    public static function getNewInstance($oQuestion)
    {
        self::$instance = new QuestionTemplate();
        self::$instance->oQuestion = $oQuestion;
        self::$instance->aViews    = array();
        self::$instance->getQuestionTemplateFolderName();
        self::$instance->setConfig();
        return self::$instance;
    }
    public static function getInstance($oQuestion = null)
    {
... (290 lines truncated)
</file>

<file path="application/models/QuestionTheme.php">
<?php
use LimeSurvey\Helpers\questionHelper;
class QuestionTheme extends LSActiveRecord
{
    const THEME_TYPE_CORE = 'coreQuestion';
    const THEME_TYPE_CUSTOM = 'customCoreTheme';
    const THEME_TYPE_USER = 'customUserTheme';
    public function tableName()
    {
        return '{{question_themes}}';
    }
    public function rules()
    {
        return array(
            [
                'name',
                'unique',
                'caseSensitive' => false,
                'criteria'      => [
                    'condition' => 'extends=:extends',
                    'params'    => [
                        ':extends' => $this->extends
                    ]
                ],
            ],
            array('name, title, api_version, question_type', 'required'),
            array('owner_id', 'numerical', 'integerOnly' => true),
            array('core_theme', 'boolean'),
            array('name, author, theme_type, question_type, extends, group', 'length', 'max' => 150),
            array('visible', 'length', 'max' => 1),
... (722 lines truncated)
</file>

<file path="application/models/QuestionType.php">
<?php
class QuestionType extends StaticModel
{
    const QT_1_ARRAY_DUAL = '1';
    const QT_5_POINT_CHOICE = '5';
    const QT_A_ARRAY_5_POINT = 'A';
    const QT_B_ARRAY_10_POINT = 'B';
    const QT_C_ARRAY_YES_UNCERTAIN_NO = 'C';
    const QT_D_DATE = 'D';
    const QT_E_ARRAY_INC_SAME_DEC = 'E';
    const QT_F_ARRAY = 'F';
    const QT_G_GENDER = 'G';
    const QT_H_ARRAY_COLUMN = 'H';
    const QT_I_LANGUAGE = 'I';
    const QT_K_MULTIPLE_NUMERICAL = 'K';
    const QT_L_LIST = 'L';
    const QT_M_MULTIPLE_CHOICE = 'M';
    const QT_N_NUMERICAL = 'N';
    const QT_O_LIST_WITH_COMMENT = 'O';
    const QT_P_MULTIPLE_CHOICE_WITH_COMMENTS = 'P';
    const QT_Q_MULTIPLE_SHORT_TEXT = 'Q';
    const QT_R_RANKING = 'R';
    const QT_S_SHORT_FREE_TEXT = 'S';
    const QT_T_LONG_FREE_TEXT = 'T';
    const QT_U_HUGE_FREE_TEXT = 'U';
    const QT_X_TEXT_DISPLAY = 'X';
    const QT_Y_YES_NO_RADIO = 'Y';
    const QT_EXCLAMATION_LIST_DROPDOWN = '!';
    const QT_VERTICAL_FILE_UPLOAD = '|';
    const QT_ASTERISK_EQUATION = '*';
... (442 lines truncated)
</file>

<file path="application/models/Quota.php">
<?php
class Quota extends LSActiveRecord
{
    public const TERMINATE_VISIBLE_QUOTA_QUESTIONS = 1;
    public const SOFT_TERMINATE_VISIBLE_QUOTA_QUESTIONS = 2;
    public const TERMINATE_VISIBLE_AND_HIDDEN_QUOTA_QUESTIONS = 3;
    public const TERMINATE_ALL_PAGES = 4;
    public $active = 1;
    public $action = self::TERMINATE_VISIBLE_QUOTA_QUESTIONS;
    public static function model($className = __CLASS__)
    {
        return parent::model($className);
    }
    public function tableName()
    {
        return '{{quota}}';
    }
    public function primaryKey()
    {
        return 'id';
    }
    public function relations()
    {
        return array(
            'survey' => array(self::BELONGS_TO, 'Survey', 'sid'),
            'languagesettings' => array(self::HAS_MANY, 'QuotaLanguageSetting', 'quotals_quota_id', 'index' => 'quotals_language'),
            'quotaMembers' => array(self::HAS_MANY, 'QuotaMember', 'quota_id'),
        );
    }
    public function rules()
... (170 lines truncated)
</file>

<file path="application/models/QuotaLanguageSetting.php">
<?php
class QuotaLanguageSetting extends LSActiveRecord
{
    public static function model($className = __CLASS__)
    {
        $model = parent::model($className);
        return $model;
    }
    public function tableName()
    {
        return '{{quota_languagesettings}}';
    }
    public function primaryKey()
    {
        return 'quotals_id';
    }
    public function relations()
    {
        return array(
            'quota' => array(self::BELONGS_TO, 'Quota', 'quotals_quota_id'),
        );
    }
    public function rules()
    {
        return array(
            array('quotals_message', 'required'),
            array('quotals_name', 'LSYii_Validators'),
            array('quotals_message', 'LSYii_Validators'),
            array('quotals_url', 'LSYii_Validators', 'isUrl' => true),
            array('quotals_urldescrip', 'LSYii_Validators'),
... (16 lines truncated)
</file>

<file path="application/models/QuotaMember.php">
<?php
class QuotaMember extends LSActiveRecord
{
    public static function model($className = __CLASS__)
    {
        $model = parent::model($className);
        return $model;
    }
    public function rules()
    {
        return array(
            array('code', 'required', 'on' => array('create')),
            array('code', 'length', 'max' => 11)
        );
    }
    public function relations()
    {
        return array(
            'survey' => array(self::BELONGS_TO, 'Survey', 'sid'),
            'question' => array(self::BELONGS_TO, 'Question', 'qid'),
            'quota' => array(self::BELONGS_TO, 'Quota', 'quota_id'),
        );
    }
    public function tableName()
    {
        return '{{quota_members}}';
    }
    public function primaryKey()
    {
        return 'id';
... (52 lines truncated)
</file>

<file path="application/models/Response.php">
<?php
abstract class Response extends Dynamic
{
    public function beforeDelete()
    {
        if (parent::beforeDelete()) {
            $this->deleteFiles();
            $this->deleteTimings();
            return true;
        }
        return false;
    }
    public static function model($className = null)
    {
        $model = parent::model($className);
        return $model;
    }
    public static function create($id, $scenario = 'insert')
    {
        return parent::create($id, $scenario);
    }
    public function primaryKey()
    {
        return 'id';
    }
    public function getFiles($qid = null)
    {
        $survey = Survey::model()->findByPk($this->dynamicId);
        $criteria = new CDbCriteria();
        $criteria->compare('sid', $this->dynamicId);
... (187 lines truncated)
</file>

<file path="application/models/SavedControl.php">
<?php
class SavedControl extends LSActiveRecord
{
    public function init()
    {
        $this->ip = "";
    }
    /** @inheritdoc */
    public function tableName()
    {
        return '{{saved_control}}';
    }
    /** @inheritdoc */
    public function primaryKey()
    {
        return 'scid';
    }
    /**
     * @inheritdoc
     * @return CActiveRecord
     */
    public static function model($className = __CLASS__)
    {
        return parent::model($className);
    }
    public function getAllRecords($condition = false)
    {
        if ($condition != false) {
            $this->db->where($condition);
        }
... (106 lines truncated)
</file>

<file path="application/models/Session.php">
<?php
class Session extends CActiveRecord
{
    private $dataBackup = null;
    public function init()
    {
        $this->attachEventHandler("onBeforeSave", array($this, 'fixDataType'));
        $this->attachEventHandler("onAfterSave", array($this, 'resetDataType'));
    }
    public static function model($className = __CLASS__)
    {
        $model = parent::model($className);
        return $model;
    }
    public function tableName()
    {
        return '{{sessions}}';
    }
    public function primaryKey()
    {
        return 'id';
    }
    public function afterFind()
    {
        $sDatabasetype = Yii::app()->db->getDriverName();
        if (gettype($this->data) == 'resource') {
            $this->data = stream_get_contents($this->data, -1, 0);
        }
        return parent::afterFind();
    }
... (25 lines truncated)
</file>

<file path="application/models/SettingGlobal.php">
<?php
class SettingGlobal extends LSActiveRecord
{
    const DBVERSION_NUMBER = 'DBVersion';
    private $disableByDb = array(
        'versionnumber',
        'dbversionnumber',
        'updatable',
        'debug',
        'debugsql',
        'forcedsuperadmin',
        'defaultfixedtheme',
        'demoMode',
        'ssl_emergency_override',
        'ssl_disable_alert',
        'filterxsshtml_forcedall',
        'filterxsshtml_allowforcedsuperadmin',
        'filterxsshtml_enablescript',
    );
    public static function model($className = __CLASS__)
    {
        return parent::model($className);
    }
    public function tableName()
    {
        return '{{settings_global}}';
    }
    public function primaryKey()
    {
        return 'stg_name';
... (73 lines truncated)
</file>

<file path="application/models/SettingsUser.php">
<?php
class SettingsUser extends LSActiveRecord
{
    const ENTITY_SURVEY = 100;
    const ENTITY_SURVEYGROUP = 90;
    const ENTITY_THEME = 80;
    const ENTITY_EDITOR = 70;
    const ENTITY_PLUGIN = 50;
    public function tableName()
    {
        return '{{settings_user}}';
    }
    public function rules()
    {
        return array(
            array('uid, stg_name', 'required'),
            array('uid', 'numerical', 'integerOnly' => true),
            array('entity', 'length', 'max' => 15),
            array('entity_id', 'length', 'max' => 31),
            array('stg_name', 'length', 'max' => 63),
            array('stg_value', 'safe'),
            array('uid, entity, entity_id, stg_name, stg_value', 'safe', 'on' => 'search'),
        );
    }
    public function relations()
    {
        return array(
            'user' =>  array(self::HAS_ONE, 'User', 'uid')
        );
    }
... (114 lines truncated)
</file>

<file path="application/models/Survey.php">
<?php
use LimeSurvey\Models\Services\SurveyUseCaptcha;
use LimeSurvey\PluginManager\PluginEvent;
class Survey extends LSActiveRecord implements PermissionInterface
{
    use PermissionTrait;
    protected static array $findByPkCache = [];
    public $oOptions;
    public $oOptionLabels;
    public $aOptions = array();
    public $showInherited = 1;
    public $searched_value;
    public $showsurveypolicynotice = 0;
    public $bShowRealOptionValues = true;
    private $sSurveyUrl;
    public function init()
    {
        if ($this->scenario == 'search') {
            $this->gsid = null;
            return;
        }
        if ($this->isNewRecord) {
            $this->setAttributeDefaults();
        }
        $this->attachEventHandler("onAfterFind", array($this, 'afterFindSurvey'));
        $this->attachEventHandler("onAfterSave", array($this, 'unsetFromStaticPkCache'));
    }
    public function unsetFromStaticPkCache()
    {
        unset(self::$findByPkCache[$this->sid]);
... (1741 lines truncated)
</file>

<file path="application/models/SurveyActivator.php">
<?php
class SurveyActivator
{
    protected $survey;
    protected $tableDefinition = [];
    protected $timingsTableDefinition = [];
    protected $error;
    protected $createSurveyDir = false;
    public $isSimulation = false;
    public function __construct($survey = null)
    {
        $this->survey = $survey;
    }
    public function setSurvey(Survey $survey)
    {
        $this->survey = $survey;
        return $this;
    }
    public function activate()
    {
        EmCacheHelper::init(['sid' => $this->survey->sid, 'active' => 'Y']);
        EmCacheHelper::flush();
        $event = new PluginEvent('beforeSurveyActivate');
        $event->set('surveyId', $this->survey->primaryKey);
        $event->set('simulate', $this->isSimulation);
        App()->getPluginManager()->dispatchEvent($event);
        $this->setMySQLDefaultEngine(Yii::app()->getConfig('mysqlEngine'));
        if (!$this->showEventMessages($event)) {
            return ['error' => 'plugin'];
        }
... (334 lines truncated)
</file>

<file path="application/models/SurveyDeactivator.php">
<?php
class SurveyDeactivator
{
    protected $survey;
    protected $tableDefinition = [];
    protected $timingsTableDefinition = [];
    protected $error;
    public function __construct($survey = null)
    {
        $this->survey = $survey;
    }
    public function setSurvey(Survey $survey)
    {
        $this->survey = $survey;
        return $this;
    }
    public function beforeDeactivate()
    {
        EmCacheHelper::init(['sid' => $this->survey->sid, 'active' => 'Y']);
        EmCacheHelper::flush();
        $beforeSurveyDeactivate = new PluginEvent('beforeSurveyDeactivate');
        $beforeSurveyDeactivate->set('surveyId', $this->survey->sid);
        App()->getPluginManager()->dispatchEvent($beforeSurveyDeactivate);
        return $beforeSurveyDeactivate;
    }
    public function afterDeactivate()
    {
        $event = new PluginEvent('afterSurveyDeactivate');
        $event->set('surveyId', $this->survey->sid);
        App()->getPluginManager()->dispatchEvent($event);
... (4 lines truncated)
</file>

<file path="application/models/SurveyDynamic.php">
<?php
class SurveyDynamic extends LSActiveRecord
{
    public $completed_filter;
    public $firstname_filter;
    public $lastname_filter;
    public $email_filter;
    public $lastpage;
    protected static $sid = 0;
    protected static $survey;
    protected $bHaveToken;
    public static function model($sid = null)
    {
        $refresh = false;
        $survey = Yii::app()->db->createCommand()
            ->select('{{surveys.sid}}')
            ->from('{{surveys}}')
            ->where('{{surveys.sid}} = :sid', array(':sid' => $sid))
            ->queryRow();
        if ($survey) {
            self::sid($survey['sid']);
            $refresh = true;
        }
        $model = parent::model(__CLASS__);
        if ($refresh === true) {
            $model->refreshMetaData();
        }
        return $model;
    }
    public static function sid($sid)
... (796 lines truncated)
</file>

<file path="application/models/SurveyLanguageSetting.php">
<?php
class SurveyLanguageSetting extends LSActiveRecord
{
    private $oldSurveyId;
    private $oldAlias;
    public $surveyls_language = "";
    public $surveyls_title = "";
    public $surveyls_description = "";
    public $surveyls_welcometext = "";
    public $surveyls_endtext = "";
    public $surveyls_policy_notice = "";
    public $surveyls_policy_notice_label = "";
    public $surveyls_url = "";
    public $surveyls_urldescription = "";
    /** @inheritdoc */
    public function tableName()
    {
        return '{{surveys_languagesettings}}';
    }
    /** @inheritdoc */
    public function primaryKey()
    {
        return array('surveyls_survey_id', 'surveyls_language');
    }
    /**
     * @inheritdoc
     * @return SurveyLanguageSetting
     */
    public static function model($className = __CLASS__)
    {
... (302 lines truncated)
</file>

<file path="application/models/SurveyLight.php">
<?php
class SurveyLight extends Survey
{
    public function afterFindSurvey()
    {
    }
}
</file>

<file path="application/models/SurveyLink.php">
<?php
class SurveyLink extends LSActiveRecord
{
    public static function model($className = __CLASS__)
    {
        $model = parent::model($className);
        return $model;
    }
    public function tableName()
    {
        return '{{survey_links}}';
    }
    public function primaryKey()
    {
        return array('participant_id', 'token_id', 'survey_id');
    }
    public function relations()
    {
        return array(
            'participant' => array(self::HAS_ONE, Participant::class, 'participant_id'),
            'survey' => array(self::HAS_ONE, 'Survey', array('sid' => 'survey_id'))
        );
    }
    public function getLinkInfo($participantId)
    {
        return self::model()->findAllByAttributes(array('participant_id' => $participantId));
    }
    public function rebuildLinksFromTokenTable($iSurveyId)
    {
        $this->deleteLinksBySurvey($iSurveyId);
... (149 lines truncated)
</file>

<file path="application/models/Surveymenu.php">
<?php
class Surveymenu extends LSActiveRecord
{
    public function tableName()
    {
        return '{{surveymenu}}';
    }
    public function rules()
    {
        return array(
            array('changed_at, name', 'required'),
            array('name', 'unique'),
            array('ordering, level, changed_by, created_by', 'numerical', 'integerOnly' => true),
            array('parent_id, survey_id, user_id', 'default', 'value' => null),
            array('title, position', 'length', 'max' => 255),
            array('name', 'length', 'max' => 128),
            array('description, created_at', 'safe'),
            array('id, parent_id, survey_id, user_id, ordering, level, position, name, title, description, changed_at, changed_by, created_at, created_by', 'safe', 'on' => 'search'),
        );
    }
    public function relations()
    {
        return array(
            'surveymenuEntries' => array(self::HAS_MANY, 'SurveymenuEntries', 'menu_id'),
            'survey' => array(self::BELONGS_TO, 'Survey', ['survey_id' => 'sid']),
            'user' => array(self::BELONGS_TO, 'User', 'user_id'),
            'parent' => array(self::BELONGS_TO, 'Surveymenu', 'parent_id'),
        );
    }
    public static function staticAddMenu($menuArray)
... (424 lines truncated)
</file>

<file path="application/models/SurveymenuEntries.php">
<?php
class SurveymenuEntries extends LSActiveRecord
{
    public function tableName()
    {
        return '{{surveymenu_entries}}';
    }
    public function rules()
    {
        return array(
            array('title, menu_title, changed_at', 'required'),
            array('menu_id', 'required'),
            array('menu_id, user_id, ordering, changed_by, created_by', 'numerical', 'integerOnly' => true),
            array('menu_icon_type', 'in', 'range' => array_keys($this->getMenuIconTypeOptions()), 'allowEmpty' => true),
            array('title, menu_title, menu_icon,  menu_class, menu_link, action, template, partial, permission, permission_grade, classes, getdatamethod', 'length', 'max' => 255),
            array('name', 'unique'),
            array('name, menu_description, language, data, created_at', 'safe'),
            array('id, menu_id, user_id, ordering, title, name, menu_title, menu_description, menu_icon, menu_icon_type, menu_class, menu_link, action, template, partial, language, permission, permission_grade, classes, data, getdatamethod, changed_at, changed_by, created_at, created_by', 'safe', 'on' => 'search'),
        );
    }
    public function relations()
    {
        return array(
            'menu' => array(self::BELONGS_TO, 'Surveymenu', 'menu_id', 'together' => true),
            'user' => array(self::BELONGS_TO, 'User', 'user_id'),
        );
    }
    public static function staticAddMenuEntry($menuId, $menuEntryArray)
    {
        $oSurveymenuEntries = new SurveymenuEntries();
... (464 lines truncated)
</file>

<file path="application/models/SurveymenuEntryData.php">
<?php
class SurveymenuEntryData extends CFormModel
{
    public $rawData = null;
    public $render = null;
    public $link = "surveyAdministration/rendersidemenulink";
    public $linkData  = array();
    public $linkExternal = false;
    public $surveyid  = 0;
    public $menuEntry = null;
    public $placeholder = false;
    public $pjaxed = true;
    public $isActive  = null;
    public function apply($menuEntry, $surveyid = null)
    {
        $this->surveyid = $surveyid;
        $this->menuEntry = $menuEntry;
        $oData = json_decode(stripcslashes((string)$this->menuEntry->data));
        $jsonError = json_last_error();
        if ($jsonError) {
            $this->rawData = [];
        } else {
            $this->rawData = $oData;
            $this->parseDataAttribute();
        }
        $this->parseLink();
    }
    public function createOptionJson($addSurveyID = false, $addQuestionGroupId = false, $addQuestionId = false)
    {
        $dataArray = array();
... (103 lines truncated)
</file>

<file path="application/models/SurveysGroups.php">
<?php
class SurveysGroups extends LSActiveRecord implements PermissionInterface
{
    use PermissionTrait;
    public $alwaysavailable = 0;
    public function tableName()
    {
        return '{{surveys_groups}}';
    }
    public function primaryKey()
    {
        return 'gsid';
    }
    protected function afterFind()
    {
        parent::afterFind();
        if ($this->gsid == 1) {
            $this->alwaysavailable = 1;
        }
    }
    public function rules()
    {
        return array(
            array('name, sortorder, created_by, title', 'required'),
            array('sortorder, owner_id, parent_id, created_by', 'numerical', 'integerOnly' => true),
            array('name', 'length', 'max' => 45),
            array('name', 'match', 'pattern' => '/^[A-Za-z0-9_\.]+$/u','message' => gT('Group code can contain only alphanumeric character, underscore or dot. Spaces are not allowed.')),
            array('title', 'length', 'max' => 100),
            array('alwaysavailable', 'boolean'),
            array('description, created, modified', 'safe'),
... (349 lines truncated)
</file>

<file path="application/models/SurveysGroupsettings.php">
<?php
class SurveysGroupsettings extends LSActiveRecord
{
    public $oOptions;
    public $oOptionLabels;
    public $aOptions = array();
    protected $optionAttributes = array();
    protected $optionAttributesInteger  = array('owner_id', 'tokenlength', 'questionindex', 'navigationdelay');
    protected $optionAttributesChar     = array('anonymized', 'savetimings', 'datestamp', 'usecookie', 'allowregister', 'allowsave', 'autoredirect', 'allowprev', 'printanswers',
                                                'ipaddr','ipanonymize', 'refurl', 'publicstatistics', 'publicgraphs', 'listpublic', 'htmlemail', 'sendconfirmation', 'tokenanswerspersistence',
                                                'assessments', 'showxquestions', 'showgroupinfo', 'shownoanswer', 'preselectnoanswer', 'showqnumcode', 'showwelcome', 'showprogress',
                                                'alloweditaftercompletion', 'savequotaexit', 'showregisterpolicy', 'showtokenpolicy');
    protected $optionAttributesText     = array('admin', 'adminemail', 'template', 'bounce_email', 'emailresponseto', 'emailnotificationto');
    public $showInherited = 1;
    public $active;
    public $additional_languages;
    private static $aSurveysGroupSettings = [];
    public function tableName()
    {
        return '{{surveys_groupsettings}}';
    }
    public function rules()
    {
        $validator = new LSYii_Validators();
        return array(
            array('autonumber_start, showsurveypolicynotice, tokenlength, questionindex, navigationdelay, owner_id', 'numerical', 'integerOnly' => true),
            array('tokenlength', 'in', 'range' => Survey::getValidTokenLengths(), 'skipOnError' => true, 'message' => Survey::getInvalidTokenLengthMessage()),
            array('showregisterpolicy', 'in', 'range' => array('Y', 'N', 'I'), 'allowEmpty' => false),
            array('showtokenpolicy', 'in', 'range' => array('Y', 'N', 'I'), 'allowEmpty' => false),
            array('admin', 'length', 'max' => 50),
... (350 lines truncated)
</file>

<file path="application/models/SurveysInGroup.php">
<?php
class SurveysInGroup extends SurveysGroups implements PermissionInterface
{
    use PermissionTrait;
    public static function model($className = __CLASS__)
    {
        $model = parent::model($className);
        return $model;
    }
    public static function getPermissionData()
    {
        $aPermission = array(
            'surveys' => array(
                'create' => false,
                'read' => true,
                'update' => true,
                'delete' => true,
                'import' => false,
                'export' => true,
                'title' => gT("Surveys in this group"),
                'description' => gT("Permission to access surveys in this group. To see a survey in the list the read/view permission must be given."),
                'img' => ' ri-file-edit-line',
            ),
        );
        return $aPermission;
    }
    public function getOwnerId()
    {
        if (!App()->getConfig('ownerManageAllSurveysInGroup')) {
            return null;
... (16 lines truncated)
</file>

<file path="application/models/SurveyTimingDynamic.php">
<?php
class SurveyTimingDynamic extends LSActiveRecord
{
    protected static $sid = 0;
    public static function model($sid = null)
    {
        $refresh = false;
        $survey = Survey::model()->findByPk($sid);
        if ($survey) {
            $refresh = self::$sid !== $survey->sid;
            self::sid($survey->sid);
        }
        $model = parent::model(__CLASS__);
        if ($refresh === true) {
            $model->refreshMetaData();
        }
        return $model;
    }
    public static function sid($sid)
    {
        self::$sid = (int) $sid;
    }
    public function primaryKey()
    {
        return 'id';
    }
    public function relations()
    {
        return array(
        'id' => array(self::BELONGS_TO, 'SurveyDynamic', 'id'),
... (122 lines truncated)
</file>

<file path="application/models/SurveyURLParameter.php">
<?php
class SurveyURLParameter extends LSActiveRecord
{
    public $searched_value = null;
    public function rules()
    {
        return  [
            ['sid', 'required'],
            ['sid', 'numerical', 'integerOnly' => true],
            ['parameter', 'required'],
            ['targetqid', 'numerical', 'integerOnly' => true],
            ['targetsqid', 'numerical', 'integerOnly' => true, 'allowEmpty' => true],
        ];
    }
    public static function model($className = __CLASS__)
    {
        $model = parent::model($className);
        return $model;
    }
    public static function isValidParameterName(string $parameterName): bool
    {
        return preg_match('/^[a-zA-Z_][a-zA-Z0-9_-]*$/', $parameterName) === 1
            && !in_array($parameterName, ['sid', 'newtest', 'token', 'lang'], true);
    }
    public function primaryKey()
    {
        return 'id';
    }
    public function tableName()
    {
... (140 lines truncated)
</file>

<file path="application/models/Template.php">
<?php
class Template extends LSActiveRecord
{
    public static $aAllTemplatesDir = null;
    public static $aTemplatesFileFolder = null;
    public static $aNamesFiltered = null;
    private static $instance;
    public static $sTemplateNameIllegalChars = "#$%^&*()+=[]';,./{}|:<>?~";
    public function tableName()
    {
        return '{{templates}}';
    }
    public function rules()
    {
        return array(
            array('name', 'checkTemplateName'),
            array('title, creation_date', 'required'),
            array('owner_id', 'numerical', 'integerOnly' => true),
            array('name, author, extends', 'length', 'max' => 150),
            array('folder, version, api_version, view_folder, files_folder', 'length', 'max' => 45),
            array('title', 'length', 'max' => 100),
            array('author_email, author_url', 'length', 'max' => 255),
            array('copyright, license, description, last_update', 'safe'),
            array('name, folder, title, creation_date, author, author_email, author_url, copyright, license, version, api_version, view_folder, files_folder, description, last_update, owner_id, extends', 'safe', 'on' => 'search'),
        );
    }
    public function checkTemplateName($attributes, $params)
    {
        Template::validateTemplateName($this->name);
        return true;
... (416 lines truncated)
</file>

<file path="application/models/TemplateConfig.php">
<?php
class TemplateConfig extends CActiveRecord
{
    public $sTemplateName = '';
    /** @var string $sPackageName Name of the asset package of this template*/
    public $sPackageName;
    /** @var  string $path Path of this template */
    public $path;
    /** @var string $sTemplateurl Url to reach the framework */
    public $sTemplateurl;
    /** @var  string $viewPath Path of the views files (twig template) */
    public $viewPath;
    /** @var  string $filesPath Path of the tmeplate's files */
    public $filesPath;
    public $cssFramework;
    public $isStandard;
    public $config;
    public $oMotherTemplate;
    public $oOptions;
    public $oOptionAttributes;
    protected $depends = array();
    protected $apiVersion;
    protected $iSurveyId = '';
    /** @var string $hasConfigFile Does it has a config.xml file? */
    protected $hasConfigFile = ''; //
    /** @var string[] $packages Array of package dependencies defined in config.xml*/
    protected $packages;
    /** @var string $xmlFile What xml config file does it use? (config/minimal) */
    protected $xmlFile;
    /** @var array $aCssFrameworkReplacement Css Framework Replacement */
... (882 lines truncated)
</file>

<file path="application/models/TemplateConfiguration.php">
<?php
class TemplateConfiguration extends TemplateConfig
{
    public $oParentTemplate;
    public $bUseMagicInherit = false;
    public $bJustCreated = false;
    public $sPreviewImgTag;
    public static $aInstancesFromTemplateName;
    public static $aPreparedToRender;
    private $bTemplateCheckResult;
    private $sTypeIcon;
    private $aFilesTo;
    private $aFrameworkAssetsToReplace;
    private $aReplacements;
    private $Ofiles;
    public $generalFilesPath;
    public $showpopups;
    public $template_type;
    public $template_extends;
    public $template_description;
    public function tableName()
    {
        return '{{template_configuration}}';
    }
    public function rules()
    {
        return array(
            array('template_name', 'required'),
            array('id, sid, gsid', 'numerical', 'integerOnly' => true),
            array('template_name', 'filter', 'filter' => function ($value) {
... (1181 lines truncated)
</file>

<file path="application/models/TemplateManifest.php">
<?php
class TemplateManifest extends TemplateConfiguration
{
    public $templateEditor;
    public $sPreviewImgTag;
    public function actualizeLastUpdate()
    {
        $config = simplexml_load_file(realpath($this->xmlFile));
        $config->metadata->lastUpdate = date("Y-m-d H:i:s");
        $config->asXML(realpath($this->xmlFile));
        touch($this->path);
    }
    public function getValidScreenFiles($sType = "view", $sScreen = null)
    {
        $aScreenFiles = array();
        if (empty($this->templateEditor)) {
            return array();
        }
        $filesFromXML = (is_null($sScreen)) ? (array) $this->templateEditor->screens->xpath('//file') : $this->templateEditor->screens->xpath('//' . $sScreen . '/file');
        foreach ($filesFromXML as $file) {
            if ($file->attributes()->type == $sType) {
                $file = trim(str_replace(["\r", "\n"], '', $file));
                $aScreenFiles[] = $file;
            }
        }
        $oEvent = new PluginEvent('getValidScreenFiles');
        $oEvent->set('type', $sType);
        $oEvent->set('screen', $sScreen);
        App()->getPluginManager()->dispatchEvent($oEvent);
        $aScreenFiles = array_values(array_diff($aScreenFiles, (array) $oEvent->get('remove')));
... (1038 lines truncated)
</file>

<file path="application/models/Timing.php">
<?php
class Timing extends LSActiveRecord
{
    private static $models = array();
    private $md;
    protected $surveyId;
    protected $survey;
    public function __construct($iSurveyId, $scenario = null)
    {
        if (is_null($scenario)) {
            $scenario = 'insert';
        }
        $survey = Survey::model()->findByPk($iSurveyId);
        if ($survey) {
            $this->surveyId = $iSurveyId;
            $this->survey = $survey;
            parent::__construct($scenario);
        }
    }
    protected function instantiate($attributes)
    {
        $class = get_class($this);
        $model = new $class($this->surveyId, null);
        return $model;
    }
    public static function model($iSurveyId = null)
    {
        if (is_numeric($iSurveyId)) {
            if (!isset(self::$models[$iSurveyId])) {
                $model = self::$models[$iSurveyId] = new self($iSurveyId, null);
... (32 lines truncated)
</file>

<file path="application/models/Token.php">
<?php
use LimeSurvey\PluginManager\PluginEvent;
abstract class Token extends Dynamic
{
    const MIN_LENGTH = 5;
    const MAX_LENGTH = 36;
    const DEFAULT_LENGTH = 15;
    public function init()
    {
        $this->usesleft = 1;
        $this->completed = "N";
        $this->emailstatus = "OK";
    }
    public function primaryKey()
    {
        return 'tid';
    }
    public function attributeLabels()
    {
        $labels = array(
            'tid' => gT('Access code ID'),
            'partcipant_id' => gT('Participant ID'),
            'firstname' => gT('First name'),
            'lastname' => gT('Last name'),
            'email' => gT('Email address'),
            'emailstatus' => gT('Email status'),
            'token' => gT('Access code'),
            'language' => gT('Language code'),
            'blacklisted' => gT('Blocklisted'),
            'sent' => gT('Invitation sent date'),
... (338 lines truncated)
</file>

<file path="application/models/TokenDynamic.php">
<?php
class TokenDynamic extends LSActiveRecord
{
    protected static $sid = 0;
    public $emailstatus;
    public static function model($sid = null)
    {
        $refresh = false;
        if (!is_null($sid)) {
            self::sid($sid);
            $refresh = true;
        }
        $model = parent::model(__CLASS__);
        if ($refresh === true) {
            $model->refreshMetaData();
        }
        return $model;
    }
    public static function sid($sid)
    {
        self::$sid = (int) $sid;
    }
    public function tableName()
    {
        return '{{tokens_' . self::$sid . '}}';
    }
    public function primaryKey()
    {
        return 'tid';
    }
... (831 lines truncated)
</file>

<file path="application/models/TokenEmptyGridFilter.php">
<?php
class TokenEmptyGridFilter extends CFormModel
{
    private $attributeValues = array();
    private $attributeNamesList = array();
    public function __construct(array $attributeNames)
    {
        $this->attributeNamesList = $attributeNames;
        foreach ($attributeNames as $name) {
            $this->attributeValues[$name] = null;
        }
        parent::__construct();
    }
    public function attributeNames()
    {
        return $this->attributeNamesList;
    }
    public function rules()
    {
        if (empty($this->attributeNamesList)) {
            return array();
        }
        return array(
            array(implode(',', $this->attributeNamesList), 'safe'),
        );
    }
    public function __get($name)
    {
        if (array_key_exists($name, $this->attributeValues)) {
            return $this->attributeValues[$name];
... (20 lines truncated)
</file>

<file path="application/models/Tutorial.php">
<?php
class Tutorial extends LSActiveRecord
{
    public function tableName()
    {
        return '{{tutorials}}';
    }
    public function rules()
    {
        return array(
            array('name, description, active, permission, permission_grade', 'required'),
            array('active', 'numerical', 'integerOnly' => true),
            array('name, permission, permission_grade', 'length', 'max' => 128),
            array('title', 'length', 'max' => 192),
            array('icon', 'length', 'max' => 64),
            array('tid, name, description, active, permission, permission_grade', 'safe', 'on' => 'search'),
        );
    }
    public function relations()
    {
        return array(
            'tutorialEntryRelation' => array(self::HAS_MANY, 'TutorialEntryRelation', 'tid', 'together' => true),
        );
    }
    public function attributeLabels()
    {
        return array(
            'tid' => 'Tutorial ID',
            'name' => 'Name',
            'title' => 'Title',
... (124 lines truncated)
</file>

<file path="application/models/TutorialEntry.php">
<?php
class TutorialEntry extends LSActiveRecord
{
    public function tableName()
    {
        return '{{tutorial_entries}}';
    }
    public function rules()
    {
        return array(
            array('title, content, settings', 'required'),
            array('teid, title, content, settings', 'safe', 'on' => 'search'),
        );
    }
    public function relations()
    {
        return array(
            'tutorialEntryRelation' => array(self::HAS_MANY, 'TutorialEntryRelation', 'teid'),
        );
    }
    public function attributeLabels()
    {
        return array(
            'teid' => gT('Tutorial entry ID'),
            'title' => gT('Title'),
            'content' => gT('Content'),
            'settings' => gT('Settings'),
        );
    }
    public function getColumns()
... (50 lines truncated)
</file>

<file path="application/models/TutorialEntryRelation.php">
<?php
class TutorialEntryRelation extends LSActiveRecord
{
    public function tableName()
    {
        return '{{tutorial_entry_relation}}';
    }
    public function rules()
    {
        return array(
            array('teid, tid', 'required'),
            array('teid, tid, uid, sid', 'numerical', 'integerOnly' => true),
            array('teid, tid, uid, sid', 'safe', 'on' => 'search'),
        );
    }
    public function relations()
    {
        return array(
            'tutorials' => array(self::HAS_ONE, 'Tutorial', 'tid', 'together' => true),
            'tutorialEntry' => array(self::HAS_ONE, 'TutorialEntry', 'teid', 'order' => 'ordering ASC', 'together' => true),
        );
    }
    public function attributeLabels()
    {
        return array(
            'teid' => 'Tutorial Entry ID',
            'tid' => 'Tutorial ID',
            'uid' => 'User ID',
            'sid' => 'Survey ID',
        );
... (19 lines truncated)
</file>

<file path="application/models/UniqueNotification.php">
<?php
class UniqueNotification extends Notification
{
    protected $markAsNew = true;
    protected $setNormalImportance = true;
    public function __construct($options = null)
    {
        parent::__construct($options);
        if (isset($options['markAsNew'])) {
            $this->markAsNew = $options['markAsNew'];
        }
        if (isset($options['setNormalImportance'])) {
            $this->setNormalImportance = $options['setNormalImportance'];
        }
    }
    public function save($runValidation = true, $attributes = null)
    {
        $toHash = $this->entity . $this->entity_id . $this->title . $this->message;
        $this->hash = hash('sha256', $toHash);
        $duplicate = self::model()->findByAttributes(array(
            'hash' => $this->hash
        ));
        if (empty($duplicate)) {
            parent::save($runValidation, $attributes);
        } else {
            if ($this->markAsNew) {
                $duplicate->status = 'new';
            }
            if ($this->setNormalImportance) {
                $duplicate->importance = self::NORMAL_IMPORTANCE;
... (17 lines truncated)
</file>

<file path="application/models/UpdateForm.php">
<?php
class UpdateForm extends CFormModel
{
    public $build;
    public $view;
    private $proxy_host_name;
    private $proxy_host_port;
    private $tempdir;
    private $rootdir;
    private $publicdir;
    private $path_cookie;
    public function init()
    {
        $this->build = Yii::app()->getConfig("buildnumber");
        $this->proxy_host_name = Yii::app()->getConfig("proxy_host_name", "");
        $this->proxy_host_port = Yii::app()->getConfig("proxy_host_port", 80);
        $this->tempdir = Yii::app()->getConfig("tempdir");
        $this->rootdir = Yii::app()->getConfig("rootdir");
        $this->publicdir = Yii::app()->getConfig("publicdir");
        $this->path_cookie = $this->tempdir . DIRECTORY_SEPARATOR . 'comfort_updater_cookie.txt';
    }
    public function getUpdateInfo($crosscheck = "1")
    {
        if (Yii::app()->getConfig("updatable")) {
            if ($this->build != '') {
                $crosscheck = (int) $crosscheck;
                $getters = '/index.php?r=updates/updateinfo&currentbuild=' . $this->build . '&id=' . md5((string) Yii::app()->getConfig('SessionName')) . '&crosscheck=' . $crosscheck;
                $content = $this->performRequest($getters);
            } else {
                $content = new stdClass();
... (712 lines truncated)
</file>

<file path="application/models/User.php">
<?php
use LimeSurvey\Models\Services\UserManager;
class User extends LSActiveRecord
{
    public const MAX_EXPIRATION_TIME_IN_HOURS = 48;
    private const MAX_EXPIRATION_TIME_IN_DAYS = 2;
    private const MAX_VALIDATION_KEY_LENGTH = 38;
    public $lang = 'auto';
    public $searched_value;
    public $search_parentUserName;
    public static function model($className = __CLASS__)
    {
        $model = parent::model($className);
        return $model;
    }
    public function tableName()
    {
        return '{{users}}';
    }
    public function primaryKey()
    {
        return 'uid';
    }
    public function relations()
    {
        return array(
            'permissions' => array(self::HAS_MANY, 'Permission', 'uid'),
            'parentUser' => array(self::HAS_ONE, 'User', array('uid' => 'parent_id')),
            'settings' => array(self::HAS_MANY, 'SettingsUser', 'uid'),
            'groups' => array(self::MANY_MANY, 'UserGroup', '{{user_in_groups}}(uid,ugid)'),
... (936 lines truncated)
</file>

<file path="application/models/UserGroup.php">
<?php
class UserGroup extends LSActiveRecord
{
    public $member_count = null;
    public static function model($className = __CLASS__)
    {
        $model = parent::model($className);
        return $model;
    }
    public function tableName()
    {
        return '{{user_groups}}';
    }
    public function primaryKey()
    {
        return 'ugid';
    }
    public function rules()
    {
        return array(
            array('name', 'required'),
            array('ugid, owner_id', 'numerical', 'integerOnly' => true),
            array('name', 'unique', 'message' => gT("Failed to add group! Group already exists.")),
            array(
                'name',
                'length',
                'min' => 1,
                'max' => 20,
                'tooShort' => gT("Name can not be empty."),
                'tooLong' => gT('Failed to add group! Group name length more than 20 characters.')
... (348 lines truncated)
</file>

<file path="application/models/UserInGroup.php">
<?php
class UserInGroup extends LSActiveRecord
{
    public static function model($className = __CLASS__)
    {
        return parent::model($className);
    }
    public function tableName()
    {
        return '{{user_in_groups}}';
    }
    public function primaryKey()
    {
        return array('ugid', 'uid');
    }
    public function rules()
    {
        return array(
            array('uid, ugid', 'required'),
            array('uid, ugid', 'numerical', 'integerOnly' => true),
        );
    }
    public function relations()
    {
        return array(
            'users' => array(self::BELONGS_TO, 'User', 'uid'),
            'group' => array(self::BELONGS_TO, 'UserGroup', 'ugid'),
        );
    }
    public function join($fields, $from, $condition = false, $join = false, $order = false)
... (24 lines truncated)
</file>

<file path="application/models/UserInPermissionrole.php">
<?php
class UserInPermissionrole extends CActiveRecord
{
    public function tableName()
    {
        return '{{user_in_permissionrole}}';
    }
    public function rules()
    {
        return array(
            array('ptid, uid', 'required'),
            array('ptid, uid', 'numerical', 'integerOnly' => true),
            array('ptid, uid', 'safe', 'on' => 'search'),
        );
    }
    public function relations()
    {
        return array(
            'role' => array(self::BELONGS_TO, 'Permissiontemplates', ['ptid']),
            'user' => array(self::BELONGS_TO, 'User', 'uid'),
        );
    }
    public function attributeLabels()
    {
        return array(
            'ptid' => 'Ptid',
            'uid' => 'Uid',
            'name' => gT('Name'),
            'description' => gT('Description')
        );
... (24 lines truncated)
</file>

<file path="application/models/UserParser.php">
<?php
class UserParser
{
    public static function getDataFromCSV($FILES)
    {
        $sRandomFileName = randomChars(20);
        $sFilePath = Yii::app()->getConfig('tempdir') . DIRECTORY_SEPARATOR . $sRandomFileName;
        $aPathinfo = pathinfo((string) $FILES['the_file']['name']);
        $sExtension = $aPathinfo['extension'];
        $bMoveFileResult = false;
        if ($_FILES['the_file']['error'] == 1 || $_FILES['the_file']['error'] == 2) {
            Yii::app()->setFlashMessage(sprintf(gT("Sorry, this file is too large. Only files up to %01.2f MB are allowed."), getMaximumFileUploadSize() / 1024 / 1024), 'error');
            Yii::app()->getController()->redirect(array('/userManagement/index'));
            Yii::app()->end();
        } elseif (strtolower($sExtension) == 'csv') {
            $bMoveFileResult = @move_uploaded_file($_FILES['the_file']['tmp_name'], $sFilePath);
        } else {
            Yii::app()->setFlashMessage(gT("This is not a .csv file."), 'error');
            Yii::app()->getController()->redirect(array('/userManagement/index'));
            Yii::app()->end();
        }
        if ($bMoveFileResult === false) {
            Yii::app()->setFlashMessage(gT("An error occurred uploading your file. This may be caused by incorrect permissions for the application /tmp folder."), 'error');
            Yii::app()->getController()->redirect(array('/userManagement/index'));
            Yii::app()->end();
            return;
        }
        $delimiter =  self::detectCsvDelimiter($sFilePath);
        $oCSVFile = fopen($sFilePath, 'r');
        if ($oCSVFile === false) {
... (65 lines truncated)
</file>

<file path="application/views/admin/authentication/ajaxLogin.php">
<!-- Same HTML as login.php, but adapted for Ajax modal login -->
<div class="row text-center">
    <div id="panel-1">
        <!-- Header -->
        <div class="d-flex justify-content-center">
          <img alt="logo" id="profile-img" class="profile-img-card img-fluid" src="<?php echo LOGO_URL;?>" />
        </div>
        <!-- Action Name -->
        <div class="row login-title login-content">
            <div class="col-12">
                <h3><?php eT("Log in");?></h3>
                <p class='text-muted'><?php eT('You\'ve been logged out due to inactivity. Please log in again.'); ?></p>
            </div>
        </div>
        <!-- Form -->
        <?php echo CHtml::form(array('admin/authentication/sa/login'), 'post', array('id' => 'loginform', 'name' => 'loginform'));?>
            <div class="row login-content login-content-form">
                <div class="col-md-6 offset-md-3">
                    <?php
                        $pluginNames = array_keys($pluginContent);
                    if (!isset($defaultAuth)) {
                        $defaultAuth = reset($pluginNames);
                    }
                    if (count($pluginContent) > 1) {
                        $selectedAuth = App()->getRequest()->getParam('authMethod', $defaultAuth);
                        if (!in_array($selectedAuth, $pluginNames)) {
                            $selectedAuth = $defaultAuth;
                        }
                        ?>
                   <label for='authMethod'><?php eT("Authentication method"); ?></label>
... (111 lines truncated)
</file>

<file path="application/views/admin/authentication/error.php">
<div class="jumbotron message-box">
        <h2><?php echo $errormsg; ?></h2>
        <p class="lead"><?php echo $maxattempts; ?></p>
        <p><?php echo eT($sMessage); ?></p>
        <p>
            <a class="btn btn-lg btn-primary" href="<?php echo $this->createUrl("admin/"); ?>" role="button"><?php eT("OK"); ?></a>
            <a class="btn btn-lg btn-outline-secondary"  href='<?php echo $this->createUrl("/admin/authentication/sa/login"); ?>'><?php eT("Try again"); ?></a><br />
            <a class="btn btn-lg btn-outline-secondary"  href='<?php echo $this->createUrl("/admin/authentication/sa/forgotpassword"); ?>'><?php eT("Forgot your password?"); ?></a><br />
        </p>
</div>
</file>

<file path="application/views/admin/authentication/forgotpassword.php">
<?php
?>
<noscript>If you see this you have probably JavaScript deactivated. LimeSurvey does not work without Javascript being
    activated in the browser!
</noscript>
<div class="login">
    <div class="row main-body">
        <div class="col-12 col-xl col-right">
            <div class="login-panel">
                <h1><?php eT("Administration"); ?></h1>
                <p><?php eT("Recover your password"); ?></p>
                <!-- Form -->
                <?php
                echo CHtml::form(
                    array("admin/authentication/sa/forgotpassword"),
                    'post',
                    array('id' => 'forgotpassword', 'name' => 'forgotpassword')
                ); ?>
                <div class="row login-content login-content-form">
                    <div class="col-12">
                        <?php
                        $this->widget('ext.AlertWidget.AlertWidget', [
                            'text' =>  gT('To receive a new password by email you have to enter your user name and original email address.'),
                            'type' => 'info',
                        ]);
                        ?>
                        <span>
                            <label for="user"><?php
                                                eT('Username'); ?></label>
                            <input name="user" id="user" type="text" size="40" maxlength="64" class="form-control ls-important-field" value="" />
... (28 lines truncated)
</file>

<file path="application/views/admin/authentication/login.php">
<?php
echo viewHelper::getViewTestTag('login');
?>
<noscript>If you see this you have probably JavaScript deactivated. LimeSurvey does not work without Javascript being activated in the browser!
</noscript>
<div class="login">
    <div class="row main-body">
        <div class="col-12 col-xl col-right">
            <div class="login-panel">
                <h1><?php eT("Administration"); ?></h1>
                <p><?php eT("Log in"); ?></p>
                <!-- Form -->
                <?php
                echo CHtml::form(['admin/authentication/sa/login'], 'post', ['id' => 'loginform', 'name' => 'loginform']); ?>
                <div class="row login-content login-content-form">
                    <div class="col-12">
                        <?php
                        $pluginNames = array_keys($pluginContent);
                        if (!isset($defaultAuth)) {
                            $defaultAuth = reset($pluginNames);
                        }
                        if (count($pluginContent) > 1) {
                            $selectedAuth = App()->getRequest()->getParam('authMethod', $defaultAuth);
                            if (!in_array($selectedAuth, $pluginNames)) {
                                $selectedAuth = $defaultAuth;
                            }
                            ?>
                            <label for='authMethod'><?php
                                                    eT("Authentication method"); ?></label>
                            <?php
... (104 lines truncated)
</file>

<file path="application/views/admin/authentication/message.php">
<!--@TODO is this view even used?-->
<div class="container-fluid welcome">
    <div class="row text-center">
        <div class="col-xxl-3 offset-xl-4 col-md-6 offset-md-3">
            <div class="card card-primary login-panel" id="panel-1">
                <div class="container-fluid">
                    <!-- Header -->
                    <div class="card-body">
                        <div class="d-flex justify-content-center">
                            <img alt='logo' id="profile-img" class="profile-img-card img-fluid mx-auto" src="<?php echo LOGO_URL; ?>"/>
                        </div>
                    </div>
                    <!-- Action Name -->
                    <div class="row login-title login-content">
                        <div class="col-12">
                            <h3><?php
                                eT('Recover your password'); ?></h3>
                        </div>
                    </div>
                    <!-- Form -->
                    <?php
                    echo CHtml::form(
                        ["admin/authentication/sa/forgotpassword"],
                        'post',
                        ['id' => 'forgotpassword', 'name' => 'forgotpassword']
                    ); ?>
                    <div class="row login-content login-content-form">
                        <div class="col-12">
                            <?php
                            $this->widget('ext.AlertWidget.AlertWidget', [
... (23 lines truncated)
</file>

<file path="application/views/admin/authentication/newPassword.php">
<?php
echo viewHelper::getViewTestTag('login');
?>
<noscript>If you see this you have probably JavaScript deactivated. LimeSurvey does not work without Javascript being
    activated in the browser!
</noscript>
<div class="login">
    <div class="row main-body">
        <div class="col-12 col-xl col-right">
            <div class="login-panel">
                <h1><?php eT("Administration"); ?></h1>
                <p><?php eT("Set password"); ?></p>
                <?php
                if ($errorExists) { ?>
                    <span class="text-danger"><?= $errorMsg ?></span><br><br>
                    <?php
                } else {
                    ?>
                    <!-- Form -->
                    <?php
                    echo CHtml::form(
                        ['admin/authentication/sa/newPassword'],
                        'post',
                        ['id' => 'loginform', 'name' => 'loginform']
                    ); ?>
                    <div class="row login-content login-content-form">
                        <div class="col-12">
                            <?php
                            ?>
                            <span>
... (53 lines truncated)
</file>

<file path="application/views/admin/authentication/sidebar.php">
<div class="sidebar-l col-12 col-xl-4 order-md-first">
    <div class="box-left">
        <div class="logo">
            <a class="logo-alt-1" href="/">&nbsp;</a>
        </div>
        <div class="box-pattern">
            <div class="decor-1">&nbsp;</div>
            <div class="decor-2">&nbsp;</div>
        </div>
    </div>
</div>
</file>

<file path="application/views/admin/checkintegrity/check_view.php">
<?php
echo viewHelper::getViewTestTag('checkIntegrity');
?>
<div class="row">
    <div class="col-12">
        <div class="jumbotron message-box">
            <h2><?php eT("Data consistency check"); ?></h2>
            <p class="lead"><?php eT("Checks for orphaned or inconsistent data (questions, groups, conditions, quotas, sort orders, old survey/participant list tables with no records, ...) and fixes it automatically."); ?>
             <br><?php eT("Run it again if new errors keep appearing."); ?></p>
            <?php if (!empty($consistencyCheckRan)) { ?>
                <?php if (empty($consistencyCheckMessages) && empty($consistencyCheckWarnings)) { ?>
                    <?php
                    $this->widget('ext.AlertWidget.AlertWidget', [
                        'text' => gT("No errors were found."),
                        'type' => 'success',
                    ]);
                    ?>
                <?php } else { ?>
                    <?php
                    $this->widget('ext.AlertWidget.AlertWidget', [
                        'text' => gT("Errors were found and fixed automatically. See the log of fixes below for details."),
                        'type' => 'info',
                    ]);
                    ?>
                    <?php if (!empty($consistencyCheckWarnings)) { ?>
                        <?php
                        $warningList = '<ul>';
                        foreach ($consistencyCheckWarnings as $warning) {
                            $warningList .= '<li>' . $warning . '</li>';
                        }
... (162 lines truncated)
</file>

<file path="application/views/admin/checkintegrity/fix_view.php">
<div class="pagetitle h3"><?php eT("Check data integrity");?></div>
<div class="row" style="margin-bottom: 100px">
    <div class="col-12">
        <div class="jumbotron message-box">
                <h2><?php eT("Data consistency check"); ?></h2>
                <p class="lead"><?php eT("If errors are showing up you might have to execute this script repeatedly."); ?></p>
                <?php if (!empty($errors)) { ?>
                    <?php
                    $errorList = '<ul>';
                    foreach ($errors as $error) {
                        $errorList .= '<li>' . $error . '</li>';
                    }
                    $errorList .= '</ul>';
                    $this->widget('ext.AlertWidget.AlertWidget', [
                        'header' => gT('Error'),
                        'text' => $errorList,
                        'type' => 'danger',
                    ]);
                    ?>
                <?php } ?>
                <?php if (!empty($warnings)) { ?>
                    <?php
                    $warningList = '<ul>';
                    foreach ($warnings as $warning) {
                        $warningList .= '<li>' . $warning . '</li>';
                    }
                    $warningList .= '</ul>';
                    $this->widget('ext.AlertWidget.AlertWidget', [
                        'header' => gT('Warning'),
                        'text' => $warningList,
... (25 lines truncated)
</file>

<file path="application/views/admin/conditions/includes/condition.php">
<?php if ($andOrOr) : ?>
    <h4 class='condition-and-or-or my-2'><span class='badge'> <?php echo $andOrOr; ?> </span></h4>
<?php endif; ?>
<?php echo TbHtml::form(
    $formAction,
    'post',
    array(
        'id' => "conditionaction" . $row['cid'],
        'name' => "conditionaction" . $row['cid']
    )
); ?>
    <table class='table conditions-table'>
        <tr class='active'>
            <?php if ($subaction == "copyconditionsform" || $subaction == "copyconditions") : ?>
                <td></td>
                <td class='scenariotd'>
                    <input
                        type='checkbox'
                        name='aConditionFromScenario<?php echo $scenarionr['scenario']; ?>'
                        id='cbox<?php echo $row['cid']; ?>'
                        value='<?php echo $row['cid']; ?>'
                        checked='checked'
                    />
                </td>
            <?php endif; ?>
            <td class='col-lg-4 questionnamecol'>
                <span><?php echo CHtml::encode($name); ?></span>
            </td>
            <td class='col-lg-2 operatornametd'>
                <span><?php echo $method[trim((string) $row['method'])]; ?> </span>
... (12 lines truncated)
</file>

<file path="application/views/admin/conditions/includes/conditions_edit.php">
<a
    class="btn btn-outline-secondary"
    data-bs-target="#confirmation-modal"
    data-bs-toggle="tooltip"
    data-title="<?php eT("Delete condition"); ?>"
    data-message="<?php eT("Are you sure you want to delete this condition?"); ?>"
    onclick="$.fn.bsconfirm('<?php eT("Are you sure you want to delete this condition?"); ?>', {'confirm_ok': '<?=gT("Delete")?>', 'confirm_cancel': '<?=gT("Cancel")?>'}, function() {
            $('#editModeTargetVal<?php echo $rows['cid']; ?>').remove();
            $('?>').remove();
            document.getElementById('conditionaction<?php echo $rows['cid']; ?>').submit();
        });"
    >
    <span class="ri-delete-bin-fill text-danger"></span>
</a>
<a
    class="btn btn-outline-secondary"
    data-bs-toggle="tooltip"
    data-title="<?php eT("Edit condition"); ?>"
    onclick='document.getElementById("subaction<?php echo $rows['cid']; ?>").value="editthiscondition"; document.getElementById("conditionaction<?php echo $rows['cid']; ?>").submit();'
>
    <span class="ri-pencil-fill"></span>
</a>
<input type='hidden' name='subaction' id='subaction<?php echo $rows['cid']; ?>' value='delete' />
<input type='hidden' name='cid' value='<?php echo $rows['cid']; ?>' />
<input type='hidden' name='scenario' value='<?php echo $rows['scenario']; ?>' />
<!-- <input type='hidden' id='cquestions{$rows['cid']}'  name='cquestions' value='{$rows['cfieldname']}' /> -->
<input type='hidden' name='method' value='<?php echo $rows['method']; ?>' />
<input type='hidden' name='sid' value='<?php echo $surveyid; ?>' />
<input type='hidden' name='gid' value='<?php echo $gid; ?>' />
<input type='hidden' name='qid' value='<?php echo $qid; ?>' />
... (1 lines truncated)
</file>

<file path="application/views/admin/conditions/includes/conditions_scenario.php">
<?php if ($subaction == "copyconditionsform" || $subaction == "copyconditions") : ?>
    <input type='checkbox' id='scenarioCbx<?php echo $scenarionr['scenario']; ?>' checked='checked'/>
    <script type='text/javascript'>
        $(document).ready(function () {
            $('#scenarioCbx<?php echo $scenarionr['scenario']; ?>').checkgroup({
                groupName: 'aConditionFromScenario<?php echo $scenarionr['scenario']; ?>'
            });
        });
    </script>
<?php endif; ?>
<div class='card card-primary mb-4'>
    <div class='card-header '>
        <div class='row mb-4'>
            <div class='col-md-4'>
            <!-- Scenario header -->
            <?php if ($showScenarioText == 'normal') : ?>
                <h5 class="card-title">Scenario <?php echo $scenarionr['scenario']; ?></h5>
            <?php elseif ($showScenarioText == 'withOr') : ?>
                <h5 class="card-title"><?php eT('OR'); ?> Scenario <?php echo $scenarionr['scenario']; ?></h5>
            <?php else : ?>
                <h5 class="card-title"><?php eT('Default scenario'); ?></h5>
            <?php endif; ?>
            </div>
            <div class='col-md-8'>
                <div class="text-end">
                <!-- Small form to change scenario number -->
                <?php echo CHtml::form(array("/admin/conditions/sa/index/subaction/updatescenario/surveyid/{$surveyid}/gid/{$gid}/qid/{$qid}/"), 'post', array('style' => 'display: none','id' => 'editscenario' . $scenarionr['scenario']));?>
                    <label>
                        <?php eT("New scenario number:"); ?>&nbsp;
                        <input type='text' name='newscenarionum' size='3' value='<?php echo $scenarionr['scenario']; ?>' required/>
... (57 lines truncated)
</file>

<file path="application/views/admin/conditions/includes/copyform.php">
<?php echo CHtml::form($url, 'post', array('id' => "copyconditions",'name' => "copyconditions")); ?>
    <h3><?php eT("Copy conditions"); ?></h3>
    <?php if (count($conditionsList)) : ?>
        <script type='text/javascript'>
            $(document).ready(function () {
        });
        </script>
        <div class='conditioncopy-tbl-row'>
            <div class='condition-tbl-left'><?php eT("Copy the selected conditions to:"); ?></div>
            <div class='condition-tbl-right'>
                <select class='form-select' name='copyconditionsto[]' id='copytomultiselect'  multiple='multiple' >
                    <?php foreach ($pquestions as $pq) : ?>
                        <option value='<?php echo $pq['fieldname']; ?>'><?php echo $pq['text']; ?></option>
                    <?php endforeach; ?>
                </select>
            </div>
        </div>
        <div class='condition-tbl-full'>
            <br/>
            <input class='btn btn-outline-secondary' type='submit' id='copy-conditions-btn' value='<?php eT("Copy conditions"); ?>' onclick="prepareCopyconditions(); return true;" disabled />
            <input type='hidden' name='subaction' value='copyconditions' />
            <input type='hidden' name='sid' value='<?php echo $iSurveyID; ?>' />
            <input type='hidden' name='gid' value='<?php echo $gid; ?>' />
            <input type='hidden' name='qid' value='<?php echo $qid; ?>' />
        </div>
    <?php else : ?>
        <div class='messagebox ui-corner-all'>
            <div class='partialheader'>
                <?php eT("There are no existing conditions in this survey."); ?>
            </div>
... (22 lines truncated)
</file>

<file path="application/views/admin/conditions/includes/form_editconditions_header.php">
<?php
?>
<hr class="ls-space margin top-35 bottom-25"/>
<?php echo CHtml::form(array("/admin/conditions/sa/index/subaction/{$subaction}/surveyid/{$iSurveyID}/gid/{$gid}/qid/{$qid}/"), 'post', array('id' => "editconditions",'name' => "editconditions", 'class' => 'form'));?>
    <div class="row ">
    <!-- Form  editconditions -->
        <div class='col-12 h4'>
            <u><?php echo $title;?></u>
        </div>
    </div>
    <!-- Scenario selection -->
    <div class="row ">
        <!-- Condition -->
        <div class='mb-3'>
            <label class='form-label col-12'><?php eT('Scenario'); ?></label>
            <div class='add-scenario-column col-12  ls-space padding bottom-15'>
                <input class='form-control' type='number' name='scenario' id='scenario' value='<?php echo CHtml::encode($addConditionToScenarioNr ? $addConditionToScenarioNr : '1'); ?>' <?php if ($showScenario) :
                    ?> style='display: none;' <?php
                                                                                               endif;?>/>
                <?php if ($showScenario) :?>
                    <div id="defaultscenarioshow" class="col-12">
                        <span>
                            <?php eT("Default scenario"); ?>
                        </span>
                        &nbsp;
                        <button class='btn btn-outline-secondary' onclick="scenarioaddbtnOnClickAction(); return false;" >
                            <span class='ri-add-circle-fill'></span>&nbsp;<?php eT('Add scenario'); ?>
                        </button>
                    </div>
                <?php endif;?>
... (197 lines truncated)
</file>

<file path="application/views/admin/conditions/includes/navigator.php">
<div class="row row-cols-lg-auto g-1 align-items-center mb-3 float-end">
    <div class="col-12">
        <label for='questionNav' class="text-nowrap col-form-label col-form-label-sm"><?php eT("Move to question:");?></label>
    </div>
    <div class="col-12">
        <select id='questionNav' class="form-select">
            <optgroup class='activesurveyselect' label='<?php eT("Before"); ?>' >
                <?php foreach ($theserows as $row) : ?>
                    <option value='<?php echo $row['value']; ?>'>
                        <?php echo $row['text']; ?>
                    </option>
                <?php endforeach; ?>
            </optgroup>
            <optgroup class='activesurveyselect' label='<?php eT("Current"); ?>' >
                <option value='<?php echo $currentValue; ?>' selected='selected'>
                    <?php echo $currentText; ?>
                </option>
            </optgroup>
            <optgroup class='activesurveyselect' label='<?php eT("After"); ?>' >
                <?php foreach ($postrows as $row) : ?>
                    <option value='<?php echo $row['value']; ?>'>
                        <?php echo $row['text']; ?>
                    </option>
                <?php endforeach; ?>
            </optgroup>
        </select>
        <a href="#" id="selector__hiddenNavigation" class="d-none pjax">hidden</a>
    </div>
</div>
<?php
... (9 lines truncated)
</file>

<file path="application/views/admin/conditions/includes/quickAddConditionForm.php">
<?php echo CHtml::form(array("/admin/conditions/sa/index/subaction/{$subaction}/surveyid/{$iSurveyID}/gid/{$gid}/qid/{$qid}/"), 'post', array('id' => "quick-add-conditions-form",'name' => "quick-add-conditions-form", 'class' => 'form '));?>
    <div class="row">
    <!-- Form quick-add condition -->
        <div class='mb-3 row'>
            <div class='col-md-2'></div>
            <div class='col-md-10'>
            </div>
        </div>
        <!-- Condition -->
        <div class='mb-3 row'>
            <label class='form-label col-md-2'><?php eT('Scenario'); ?></label>
            <div class='col-md-4 add-scenario-column'>
                <input class='form-control' type='number' name='quick-add-scenario' id='quick-add-scenario' value='1' />
            </div>
        </div>
    </div>
    <div class="row ls-space margin top-10 bottom-5">
        <div class='mb-3 row'>
            <label class='form-label col-md-2'><?php eT("Question"); ?></label>
            <div class='col-md-10'>
                <ul class='nav nav-tabs'>
                    <li role='presentation' class='nav-item src-tab'>
                        <a class="nav-link active" href='#QUICKADD-SRCPREVQUEST' aria-controls='SRCPREVQUEST' role='tab' data-bs-toggle='tab'><?php eT('Previous questions'); ?></a>
                    </li>
                    <li role='presentation' class='nav-item src-tab'>
                        <a class="nav-link" href='#QUICKADD-SRCTOKENATTRS' aria-controls='SRCTOKENATTRS' role='tab' data-bs-toggle='tab'><?php eT('Survey participant attributes'); ?></a>
                    </li>
                </ul>
            </div>
        </div>
... (166 lines truncated)
</file>

<file path="application/views/admin/conditions/partial/topbarBtns/leftSideButtons.php">
<?php
$surveyid = $aData['surveyid'];
$gid = $aData['gid'];
$qid = $aData['qid'];
$currentMode = $aData['currentMode'];
$buttonClass = 'btn btn-outline-secondary pjax ';
$this->widget(
    'ext.ButtonWidget.ButtonWidget',
    [
        'name' => 'show_conditions',
        'text' => gT("Show conditions for this question"),
        'icon' => 'ri-information-line',
        'link' => Yii::App()->createUrl("/admin/conditions/sa/index/subaction/conditions/surveyid/$surveyid/gid/$gid/qid/$qid"),
        'htmlOptions' => [
            'class' => 'btn btn-outline-secondary',
            'role' => 'button',
        ],
    ]
);
$this->widget(
    'ext.ButtonWidget.ButtonWidget',
    [
        'name' => 'edit_conditions',
        'text' => gT("Add and edit conditions"),
        'icon' => 'ri-git-pull-request-line_add',
        'link' => Yii::App()->createUrl("admin/conditions/sa/index/subaction/editconditionsform/surveyid/$surveyid/gid/$gid/qid/$qid"),
        'htmlOptions' => [
            'class' => 'btn btn-outline-secondary',
            'role' => 'button',
        ],
... (36 lines truncated)
</file>

<file path="application/views/admin/conditions/partial/topbarBtns/rightSideButtons.php">
<?php
Yii::app()->getController()->renderPartial(
    '/surveyAdministration/partial/topbar/surveyTopbarRight_view',
    [
        'showBackButton' => $aData['showBackButton'],
        'returnUrl' => $aData['returnUrl']
    ]
);
?>
    </div> <!-- closing the topbar col-md-auto -->
</div> <!-- closing the topbar row -->
<div class="row">
    <div class="col-md-12">
        <?= $aData['questionNavOptions']; ?> <!-- HTML is in views/admin/conditions/includes/navigator.php -->
</file>

<file path="application/views/admin/conditions/conditionshead_view.php">
<div class='side-body'>
    <div class="pagetitle h1 pt-3 pb-2">
        <?php eT("Conditions designer"); ?>
        <?php if ($scenariocount > 0) : ?>
            <?php
            $this->widget('ext.ButtonWidget.ButtonWidget', [
                'name' => 'delete-all-conditions',
                'id' => 'delete-all-conditions',
                'text' => gT('Delete all conditions'),
                'icon' => 'ri-delete-bin-fill',
                'htmlOptions' => [
                    'class' => 'btn btn-danger float-end condition-header-button',
                    'data-bs-toggle' => 'modal',
                    'data-bs-target' => '#confirmation-modal',
                    'data-message' => gT('Are you sure you want to delete all conditions for this question?', 'js'),
                    'data-onclick' => '(function() { document.getElementById("deleteallconditions").submit(); })',
                    'onclick' => 'return false;',
                ],
            ]); ?>
        <?php endif; ?>
        <?php if ($scenariocount > 1) : ?>
            <?php
            $this->widget('ext.ButtonWidget.ButtonWidget', [
                'name' => 'renumber-scenario',
                'id' => 'renumber-scenario',
                'text' => gT('Renumber scenarios'),
                'icon' => 'ri-list-ordered',
                'htmlOptions' => [
                    'class' => 'btn btn-outline-secondary float-end condition-header-button',
                    'data-bs-toggle' => 'modal',
... (41 lines truncated)
</file>

<file path="application/views/admin/conditions/conditionslist_view.php">
<?php echo $conditionsoutput;?>
<p class="lead">
    <?php eT("Only show question"); ?>
    <strong><?php echo ' ' . $sCurrentQuestionText;?></strong>
    <?php eT('if:');?>
</p>
<?php echo CHtml::form(array("/admin/conditions/sa/index/subaction/deleteallconditions/surveyid/{$surveyid}/gid/{$gid}/qid/{$qid}/"), 'post', array('style' => 'margin-bottom:0;','id' => 'deleteallconditions','name' => 'deleteallconditions'));?>
    <input type='hidden' name='qid' value='<?php echo $qid;?>' />
    <input type='hidden' name='gid' value='<?php echo $gid;?>' />
    <input type='hidden' name='sid' value='<?php echo $surveyid;?>' />
    <input type='hidden' id='toplevelsubaction' name='subaction' value='deleteallconditions' />
</form>
</file>

<file path="application/views/admin/conditions/customized_conditions.php">
<?php
?>
<div class="row">
    <div class="col-12">
        <?php
        $this->widget('ext.AlertWidget.AlertWidget', [
            'text' => gT("Note: This question uses a customized condition. If you create a condition using this editor the current customized condition will be overwritten."),
            'type' => 'warning',
        ]);
        ?>
    </div>
</div>
</file>

<file path="application/views/admin/conditions/deleteAllConditions.php">
<p>
    <?php eT("You are about to delete all conditions on this survey's questions"); ?><?php echo " ($iSurveyID)."; ?>
</p>
<p>
    <?php eT("We recommend that before you proceed, you export the entire survey from the main administration screen."); ?>
</p>
<p>
    <?php eT("Continue?"); ?>
</p>
<?php echo CHtml::beginForm(array("admin/conditions/sa/index/",'subaction' => 'resetsurveylogic','surveyid' => $iSurveyID)); ?>
<button
    class='btn btn-danger'
    type = "submit"
    name = "ok"
    value="Y";
>
    <?php eT('Yes'); ?>
</button>
<a
    class='btn btn-cancel'
    href="<?php echo $this->createUrl("surveyAdministration/view/surveyid/$iSurveyID"); ?>"
>
    <?php eT('Cancel'); ?>
</a>
</file>

<file path="application/views/admin/conditions/no_condition.php">
<?php
?>
<div class="row">
    <div class="col-xl-4">
        <?php echo eT("This question is always shown.");?>
    </div>
</div>
</file>

<file path="application/views/admin/database/database_view.php">
<?php
if (isset($uqresult)) {?>
<script type="text/javascript">alert("<?php eT("Question could not be updated", 'js'); ?>")</script><br />
    <?php
}
if (isset($result)) { // Checked
    ?>
<script type="text/javascript">alert("<?php eT("Failed to update answers", 'js') . " - " . $query; ?>")</script><br />
    <?php
}
if (isset($invalidCode) && $invalidCode == 1) {
    ?>
<script type="text/javascript">alert("<?php eT("Answers with a code of 0 (zero) or blank code are not allowed, and will not be saved", 'js'); ?>")</script><br />
    <?php
}
if (isset($duplicateCode) && $duplicateCode == 1) {
    ?>
<script type="text/javascript">alert("<?php eT("Duplicate codes found, these entries won't be updated", 'js'); ?>")</script><br />
    <?php
}
if (isset($aresult)) {
    ?>
<script type="text/javascript">alert("<?php eT("Failed to delete answer", 'js') . " - " . $query; ?>")</script><br />
    <?php
}
if (isset($strlen) && $strlen < 1) {
    ?>
<script type="text/javascript">alert("<?php eT("The question could not be added. You must enter at least enter a question code.", 'js'); ?>")</script><br />
    <?php
}
... (45 lines truncated)
</file>

<file path="application/views/admin/databaseupdate/db.php">
<?php
foreach (Yii::app()->user->getFlashes() as $key => $message) {
    echo '<div class="flash-' . $key . '">' . $message . "</div>\n";
}
?>
<?php echo $output;
</file>

<file path="application/views/admin/databaseupdate/verify.php">
<div class="jumbotron message-box">
    <h2 class=""><?php eT('Database upgrade'); ?></h2>
    <p class="lead"><?php eT('Make sure to make a database backup before proceeding.'); ?></p>
    <p class="lead"><?php eT('Please verify the following information before continuing with the database upgrade:'); ?></p>
    <div class="row">
        <div class="offset-lg-4 col-lg-4">
            <table class="table table-striped">
                <tr><th><?php eT('Database type:'); ?></th><td><?php echo  Yii::app()->db->getDriverName(); ?></td></tr>
                <tr><th><?php eT('Database name:'); ?></th><td><?php
                echo  getDBConnectionStringProperty('dbname') . getDBConnectionStringProperty('Database')  ; ?></td></tr>
                <tr><th><?php eT('Table prefix:'); ?></th><td><?php echo Yii::app()->db->tablePrefix; ?></td></tr>
                <tr><th><?php eT('Site name:'); ?></th><td><?php echo Yii::app()->getConfig("sitename"); ?></td></tr>
                <tr><th><?php eT('Root URL:'); ?></th><td><?php echo Yii::app()->getController()->createUrl('/'); ?></td></tr>
                <tr><th><?php eT('Current database version:'); ?></th><td><?php echo Yii::app()->getConfig('DBVersion'); ?></td></tr>
                <tr><th><?php eT('Target database version:'); ?></th><td><?php echo Yii::app()->getConfig('dbversionnumber'); ?></td></tr>
            </table>
        </div>
    </div>
    <?php if ((int) Yii::app()->getConfig('DBVersion') < 132) { ?>
        <?php
        $message = '<strong>' . gT("Error:") . '</strong>' . gT("You will not be able to update because your previous LimeSurvey version is too old.") .
                '<br>' .
                 gT("Please first update to Version 2.6.4 or any later 2.x version before you update to Version 3.x.");
        App()->getController()->widget('ext.AlertWidget.AlertWidget', [
            'text' => $message,
            'type' => 'danger',
        ])
        ?>
    <?php } elseif (isDatabaseUpdateLockHeld()) { ?>
        <?php
... (21 lines truncated)
</file>

<file path="application/views/admin/dataentry/includes/editdata/edit.php">
<p><input type='submit' class="btn btn-outline-secondary d-none" value='<?php eT("Save"); ?>' />
 <input type='hidden' name='id' value='<?php echo $id; ?>' />
 <input type='hidden' name='sid' value='<?php echo $surveyid; ?>' />
 <input type='hidden' name='subaction' value='update' />
 <input type='hidden' name='language' value='<?php echo $sDataEntryLanguage; ?>' /></p>
</div></div></div>
</file>

<file path="application/views/admin/dataentry/includes/editdata/editdata.php">
<script type='text/javascript'>
    <!--
    function saveshow(value) {
        if (document.getElementById(value).checked == true) {
            document.getElementById("closerecord").checked = false;
            document.getElementById("closerecord").disabled = true;
            document.getElementById("saveoptions").style.display = "";
        } else {
            document.getElementById("saveoptions").style.display = "none";
            document.getElementById("closerecord").disabled = false;
        }
    }
    -->
</script>
<table>
    <tr>
        <td align='left'>
            <input type='checkbox' class='checkboxbtn' name='closerecord' id='closerecord' />
            <label for='closerecord'>".gT("Finalize response submission")."</label>
        </td>
    </tr>
    <!-- Store in UTC for database. All DB timestamps are stored as UTC. -->
    <input type='hidden' name='closedate' value='<?php echo gmdate("Y-m-d H:i"); ?>' />
    <tr>
        <td align='left'>
            <input type='checkbox' class='checkboxbtn' name='save' id='save' onclick='saveshow(this.id)' />
            <label for='save'><?php eT("Save for further completion by survey user"); ?></label>
        </td>
    </tr>
</table>
... (28 lines truncated)
</file>

<file path="application/views/admin/dataentry/active_html_view.php">
<?php
$yii = Yii::app();
if ($thissurvey['active'] == "Y") { ?>
                <script type='text/javascript'>
                      <!--
                        function saveshow(value)
                            {
                            if (document.getElementById(value).checked == true)
                                {
                                document.getElementById("closerecord").checked=false;
                                document.getElementById("closerecord").disabled=true;
                                document.getElementById("saveoptions").style.display="";
                                }
                            else
                                {
                                document.getElementById("saveoptions").style.display="none";
                                 document.getElementById("closerecord").disabled=false;
                                }
                            }
                      </script>
                <tr>
                <td colspan='3' align='center'>
                <table><tr><td align='left'>
                <div class="checkbox">
                    <input type='checkbox' class='checkboxbtn' name='closerecord' id='closerecord' checked='checked'/><label for='closerecord'><?php eT("Finalize response submission"); ?></label></td></tr>
                    <input type='hidden' name='closedate' value='<?php echo gmdate("Y-m-d H:i:s"); ?>' />
                </div>
                <?php if ($thissurvey['allowsave'] == "Y") { ?>
                    <tr><td align='left'>
                        <div class="checkbox">
... (91 lines truncated)
</file>

<file path="application/views/admin/dataentry/caption_view.php">
<!--
    dataentry/caption_view.php
-->
<div class="side-body">
    <h3><?php eT("Data entry"); ?></h3>
    <div class="row">
        <div class="col-12 content-right">
            <!-- Survey name and description -->
            <div class="jumbotron ">
            <h2><?php echo stripJavaScript($thissurvey['name']); ?></h2>
            <p><?php echo flattenText($thissurvey['description'], true); ?></p>
            </div>
        <?php echo CHtml::form(array("admin/dataentry/sa/insert"), 'post', array('name' => 'addsurvey', 'id' => 'addsurvey', 'enctype' => 'multipart/form-data'));?>
            <?php if (count(Survey::model()->findByPk($surveyid)->additionalLanguages) > 0) :?>
                <div class="col-3">
                    <?php echo $langlistbox; ?>
                </div>
            <?php endif; ?>
            <table class='data-entry-tbl table'>
                <tr class='data-entry-separator'>
                    <td colspan='3'></td>
                </tr>
            <?php if ($survey->hasTokensTable) {
                ?>
                <tr>
                <td valign='top' width='1%'></td>
                <td valign='top' align='right' width='30%'><font color='red'>*</font>
                    <strong><?php echo gT("Access code", 'html', $sDataEntryLanguage); ?>:</strong>
                </td>
                <td valign='top'  align='left' style='padding-left: 20px'>
... (59 lines truncated)
</file>

<file path="application/views/admin/dataentry/content_view.php">
<?php
echo viewHelper::getViewTestTag('dataEntryView');
?>
<!-- content_view.php -->
<!-- explanation -->
<?php if (!empty($explanation)) : ?>
    <tr class ='data-entry-explanation text-info'><td class='data-entry-small-text' colspan='3' align='left'><?php echo $explanation; ?></td></tr>
<?php endif; ?>
<!-- questions -->
<tr class='<?php echo $bgc; ?>'>
    <!-- question title -->
    <td class='data-entry-small-text' valign='top' width='1%'>
        <?php echo $deqrow['title']; ?>
    </td>
    <!-- question text -->
    <td valign='top' align='right' width='30%'>
        <!-- mandatory -->
        <?php if ($deqrow['mandatory'] == "Y") :?>
            <span class="text-danger">*</span>
        <?php endif; ?>
        <!-- question text -->
        <strong>
            <?php echo $deqrow->questionl10ns[$sDataEntryLanguage]->question;   ?>
        </strong>
    </td>
    <!-- Answers -->
    <td valign='top'  align='left' style='padding-left: 20px'>
        <?php switch ($deqrow['type']) {
            case Question::QT_5_POINT_CHOICE:
                ?>
... (715 lines truncated)
</file>

<file path="application/views/admin/dataentry/dataentry_header_view.php">
<div class="side-body">
    <h3>
    <?php eT("Data entry"); ?> -
    <?php
    if ($subaction == "edit") {
            echo sprintf(gT("Editing response (ID %s)"), $id);
    } else {
            echo sprintf(gT("Viewing response (ID %s)"), $id);
    }
    ?>
    </h3>
        <div class="row">
            <div class="col-12 content-right">
                <?php echo CHtml::form(
                    ["admin/dataentry/sa/update"],
                    'post',
                    [
                        'name' => 'editresponse',
                        'id' => 'editresponse',
                        'data-trigger-validation' => 'true',
                    ]
                ); ?>
                   <table id='responsedetail' class="table" width='99%' align='center'>
</file>

<file path="application/views/admin/dataentry/delete.php">
<div class="col-12 list-surveys">
    <div class="row">
        <div class="col-12 content-right">
            <div class="jumbotron message-box <?php if (isset($errormsg) && $errormsg) {
                echo 'message-box-error';
                                              }?>">
                <h2><?php printf(gT("Response deleted (ID: %s)"), $id); ?></h2>
                <p>
                    <input
                        class="btn btn-lg btn-outline-secondary"
                        type='submit'
                        value='<?php eT("Browse responses"); ?>'
                        onclick="window.open('<?php echo $this->createUrl(
                            "/responses/browse/",
                            ['surveyId' => $surveyid]
                        ); ?>', '_top');" />
                </p>
            </div>
        </div>
    </div>
</div>
</file>

<file path="application/views/admin/dataentry/edit.php">
<?php
include('includes/editdata/' . $part . '.php');
</file>

<file path="application/views/admin/dataentry/import_result.php">
<div class="row">
    <div class="col-md-11 offset-md-1 content-right">
        <!-- Message box from super admin -->
        <div class="card card-body bg-light message-box <?php echo isset($class) ? $class : ""; ?>">
            <div class="h2"><?php eT("Responses import summary"); ?></div>
            <dl>
            <?php if ($imported) {?>
                <dt class='success text-success h2'><?php eT("Success"); ?></dt>
                <dd> <?php echo sprintf(gT("%s old response(s) were successfully imported."), $imported); ?></dd>
                <?php if (!is_null($iRecordCountT)) { ?>
                    <dd> <?php echo sprintf(gT("%s old response(s) and according %s timings were successfully imported."), $imported, $iRecordCountT); ?></dd>
                <?php } ?>
            <?php } ?>
            <?php if (count($aWarnings) || $skipped) {?>
                <dt class='warning text-warning h2'><?php eT("Warning"); ?></dt>
                <?php if ($skipped) { ?>
                    <dd><?php echo sprintf(gT("%s responses already exist."), $skipped); ?></dd>
                <?php } ?>
                <?php foreach ($aWarnings as $srid => $sWarning) { ?>
                    <dd><strong><?php echo sprintf(gT("Error on response ID %s"), $srid); ?></strong>
                        <div><?php echo $sWarning ?></div>
                    </dd>
                <?php }?>
            <?php } ?>
            </dl>
            <a class='limebutton btn btn-outline-secondary' href='<?php echo $this->createUrl("responses/browse/", ['surveyId' => $iSurveyId]); ?>'><?php eT("Browse responses") ?></a>
        </div>
    </div>
</div>
</file>

<file path="application/views/admin/dataentry/import.php">
<?php
?>
<div class="side-body">
    <h3><?php eT("Import responses from an archived response table"); ?></h3>
    <div class="row">
        <div class="col-12 content-right">
            <?php
            $this->widget('ext.SettingsWidget.SettingsWidget', [
                'settings' => $settings,
                'method'   => 'post',
                'buttons'  => [
                    gT('Import responses') => [
                        'name'  => 'ok',
                        'class' => ['d-none']
                    ],
                    gT('Cancel')           => [
                        'type'  => 'link',
                        'class' => ['d-none'],
                        'href'  => App()->createUrl('admin/pluginmanager/sa/index')
                    ]
                ]
            ]);
            App()->getClientScript()->registerScript(
                'ImportInsertMethodSwitcher',
                "$('#preserveIDs').on('change', function () {
                    $('.setting[data-name=\"insertmethod\"]').toggleClass('d-none', !this.checked);
                }).trigger('change');",
                LSYii_ClientScript::POS_POSTSCRIPT
            );
            $message = gT("Please be aware that tables including encryption should not be restored if they have been created in LimeSurvey 4 before version 4.6.1");
... (29 lines truncated)
</file>

<file path="application/views/admin/dataentry/insert.php">
<div class='side-body'>
<div class="col-12 list-surveys">
    <div class="row">
        <div class="col-12 content-right">
    <div class="jumbotron message-box <?php if ($errormsg) {
        echo 'message-box-error';
                                      }?>">
        <?php if ($errormsg) : ?>
                <h2 class="danger"><?php eT("Try again"); ?></h2>
                <p>
                    <?php
                    foreach ($dataentrymsgs as $msg) {
                        echo $msg . "<br />\n";
                    }
                    ?>
                </p>
                <p>
                    <?php echo $errormsg; ?>
                </p>
                <p>
                    <input type='submit' class="btn btn-lg  btn-outline-secondary" value='<?php eT("Add another record"); ?>' onclick="window.open('<?php echo $this->createUrl('/admin/dataentry/sa/view/surveyid/' . $surveyid . '/lang/' . $lang); ?>', '_top')" />
                    <br /><br />
                    <input type='submit' class="btn btn-lg  btn-outline-secondary" value='<?php eT("Return to survey administration"); ?>' onclick="window.open('<?php echo $this->createUrl('surveyAdministration/view/surveyid/' . $surveyid); ?>', '_top')" />
                    <br /><br />
                </p>
                <p>
                    <?php if (isset($save)) : ?>
                        <input type='submit' class="btn btn-lg btn-outline-secondary" value='<?php eT("Browse saved responses"); ?>' onclick="window.open('<?php echo $this->createUrl('/admin/saved/sa/view/surveyid/' . $surveyid . '/all'); ?>', '_top')" />
                        <br /><br />
                    <?php endif; ?>
... (35 lines truncated)
</file>

<file path="application/views/admin/dataentry/iteratesurvey.php">
<div class="side-body">
<h3><?php eT("Iterate survey");?></h3>
<?php if ($success) {?>
<p style='width:100%;'>
<font class='successtitle'><?php eT("Success");?></font><br />
    <?php eT("Responses and participants have been re-opened.");?><br />
<?php } else { ?>
<div class='messagebox ui-corner-all'><div class='header ui-widget-header'><?php eT("Important instructions");?></div>
<br/><?php eT("Click on the following button if you want to");?>:<br />
<ol>
<li><?php eT("Delete all incomplete responses that correspond to a participant for which a completed response is already recorded");?></li>
<li><?php eT("Reset completed responses to the incomplete state");?></li>
<li><?php eT("Reset all your participants to the 'not used' state");?></li>
</ol><br />
    <?php echo CHtml::form(array("admin/dataentry/sa/iteratesurvey/unfinalizeanswers/true/surveyid/" . $surveyid), 'post');?>
<input
    class='btn btn-danger'
    type='submit'
    onclick="return confirm('<?php eT("Are you really sure you want to delete incomplete responses and reset the completed state of both, response and participant?", "js");?>')" value='<?php eT("Reset answers and participants completed state");?>' />
</form>
</div>
<?php }?>
</div>
</file>

<file path="application/views/admin/dataentry/vvimport_result.php">
<div class="row">
    <div class="col-md-11 offset-md-1 content-right">
        <!-- Message box from super admin -->
        <div class="jumbotron message-box <?php echo isset($class) ? $class : ""; ?>">
            <div class="h2"><?php echo $title;?></div>
            <dl>
            <?php if (isset($aResult['success']) && is_array($aResult['success'])) {?>
                <dt class='success'><?php eT("Success"); ?></dt>
                <?php foreach ($aResult['success'] as $sSucces) { ?>
                    <dd><?php echo $sSucces ?></dd>
                <?php }?>
            <?php } ?>
            <?php if (isset($aResult['errors']) && is_array($aResult['errors'])) {?>
                <dt class='error'><?php eT("Error"); ?></dt>
                <?php foreach ($aResult['errors'] as $sError) { ?>
                    <dd><?php echo $sError ?></dd>
                <?php }?>
            <?php } ?>
            <?php if (isset($aResult['warnings']) && is_array($aResult['warnings'])) {?>
                <dt class='warning'><?php eT("Warning"); ?></dt>
                <?php foreach ($aResult['warnings'] as $sWarning) { ?>
                    <dd><?php echo $sWarning ?></dd>
                <?php }?>
            <?php } ?>
            </dl>
            <?php ?>
            <?php if (isset($aUrls) && count($aUrls)) {?>
                <?php foreach ($aUrls as $url) { ?>
                    <a class='limebutton submit' href='<?php echo $url['link'] ?>'><?php echo $url['text'] ?></a>
                <?php } ?>
... (7 lines truncated)
</file>

<file path="application/views/admin/dataentry/vvimport.php">
<div class="side-body">
<?php echo CHtml::form(array('admin/dataentry/sa/vvimport/surveyid/' . $surveyid), 'post', array('enctype' => 'multipart/form-data', 'id' => 'vvexport',  'class' => ''));?>
    <?php if ($tableExists) :?>
        <div class="row">
        <div class="col-12">
            <div class="col-lg-6 text-start">
                <h4>
                    <?php  eT("Import a VV response data file"); ?>
                </h4>
            </div>
        </div>
        <h3></h3>
    </div>
    <?php endif;?>
        <div class="row">
            <div class="col-12 content-right">
<?php
if ($tableExists) {
    ?>
    <div class="card card-primary" id="panel-1">
        <div class="card-header ">
            <div class="">
            <?php eT("General");?>
            </div>
        </div>
        <div class="card-body">
            <div class="mb-3">
                <label for="csv_vv_file" class=" form-label">
                <?php printf(gT("Response data file (*.csv,*.vv,*.txt) (maximum size: %d MB):"), getMaximumFileUploadSize() / 1024 / 1024); ?>
                </label>
... (125 lines truncated)
</file>

<file path="application/views/admin/dumpdb/dumpdb_view.php">
<?php
echo viewHelper::getViewTestTag('dumpdb');
?>
<?php if (!$htmlContent) { ?>
    <div class="row">
        <div class="col-12">
            <!-- Data redundancy check -->
            <div class="jumbotron message-box">
                <h2><?php eT("Database size check"); ?></h2>
                <p class="lead">
                    <?php eT("This check evaluates the database size to determine if an immediate download is possible or if a manual backup is necessary."); ?>
                </p>
                <p>
                    <?php echo "DB Size: MB " . $dbSize; ?>
                    <?php if ($downloadable) { ?>
                        <?php
                        $this->widget('ext.AlertWidget.AlertWidget', [
                            'text' => gT("Your database can be downloaded now!"),
                            'type' => 'success',
                        ]);
                        ?>
                        <?php echo CHtml::form(["admin/dumpdb", "sa" => 'outPutDatabase'], 'post'); ?>
                        <button
                            type='submit'
                            value='Y'
                            name='ok'
                            class="btn btn-info">
                            <?php eT("Yes - download now!"); ?>
                        </button>
                        </form>
... (16 lines truncated)
</file>

<file path="application/views/admin/editor/_activateEditorItem.php">
<?php
?>
    <li>
        <a id="feature-preview-button" class="dropdown-item" href="#" onclick="$('#activate_editor').modal('show');">
            <?php eT("Editor version"); ?>
        </a>
    </li>
</file>

<file path="application/views/admin/emailtemplates/email_language_tab.php">
<?php
$tabs = emailtemplates::getTabTypeArray($surveyid);
?>
<div id="tab-<?= CHtml::encode($grouplang) ?>" class="tab-pane fade <?= CHtml::encode($active) ?>" role="tabpanel" aria-labelledby="tab-lang-<?= CHtml::encode($grouplang) ?>">
    <ul class="nav nav-tabs" role="tablist">
        <?php $count = 0;
        $state = 'active'; ?>
        <?php foreach ($tabs as $tab => $details): ?>
            <?php $tabId = 'tab-' . CHtml::encode($grouplang) . '-' . CHtml::encode($tab) . '-tab'; ?>
            <li role="presentation" class="nav-item">
                <a class="nav-link <?= $state ?>" id="<?= $tabId ?>" role="tab" aria-selected="<?= $state === 'active' ? 'true' : 'false' ?>"
                   aria-controls="tab-<?= $grouplang ?>-<?= $tab ?>" data-bs-toggle="tab" href="#tab-<?= $grouplang ?>-<?= $tab ?>">
                    <?= $details['title'] ?>
                    <?php if (!empty(array_filter(array_column($esrow->attachments[$tab] ?? [], 'error')))): ?>
                        <i class="ri-error-warning-fill text-danger" aria-hidden="true"></i>
                        <span class="visually-hidden"><?= gT("Missing attachment files") ?></span>
                    <?php endif; ?>
                </a>
            </li>
            <?php if ($count == 0) {
                $state = '';
                $count++;
            } ?>
        <?php endforeach; ?>
    </ul>
    <div class="tab-content tabsinner" id='tabsinner-<?php echo $grouplang; ?>'>
        <?php
        $count = 0;
        $active = 'show active';
        foreach ($tabs as $tab => $details) {
... (10 lines truncated)
</file>

<file path="application/views/admin/emailtemplates/email_language_template_tab.php">
<?php
$script = [];
$hideAttacehemtTable = true;
$attachmentsHaveErrors = false;
if (isset($esrow->attachments[$tab])) {
    foreach ($esrow->attachments[$tab] as $attachment) {
        $script[] = sprintf(
            "prepEmailTemplates.addAttachment($('#attachments-%s-%s'), %s, %s, %s, %s);",
            $grouplang,
            $tab,
            json_encode($attachment['url']),
            json_encode($attachment['relevance']),
            json_encode($attachment['size']),
            json_encode($attachment['error'] ?? '')
        );
        if (!empty($attachment['error'])) {
            $attachmentsHaveErrors = true;
        }
    }
    $hideAttacehemtTable = false;
}
?>
<div id='<?= "tab-" . $grouplang . "-" . $tab ?>'
     class="tab-pane fade in <?= $active ?>"
     role="tabpanel"
     aria-labelledby="<?= "tab-" . $grouplang . "-" . $tab . "-tab" ?>">
    <?php if ($attachmentsHaveErrors): ?>
        <div class="row">
            <div class='col-sm-12'>
                <div class="alert alert-danger">
... (149 lines truncated)
</file>

<file path="application/views/admin/emailtemplates/emailtemplates_view.php">
<?php
$count = 0;
echo viewHelper::getViewTestTag('surveyEmailTemplates');
App()->getClientScript()->registerScript(
    "EmailTemplateViews_variables",
    "
var sReplaceTextConfirmation='" . gT("This will replace the existing text. Continue?", "js") . "';
var sKCFinderLanguage='" . sTranslateLangCode2CK(App()->language) . "';
var LS = LS || {};  // namespace
    LS.lang = LS.lang || {};  // object holding translations
    LS.lang['Remove attachment'] = '" . gT("Remove attachment") . "';
    LS.lang['Edit condition'] = '" . gT("Edit condition") . "';
",
    LSYii_ClientScript::POS_BEGIN
);
?>
<div class="side-body">
    <h1 class="h3"  ><?php eT("Edit email templates"); ?></h1>
    <?php if (!$ishtml): ?>
        <?php $this->widget('ext.AlertWidget.AlertWidget', [
            'text' => gT("The HTML editor is not available because the option 'Use HTML format for participant emails' is disabled for this survey. All email templates, including the admin notifications, are therefore edited and sent as plain text.") . ' '
                . CHtml::link(
                    gT("Change this in the participant settings."),
                    App()->createUrl('surveyAdministration/rendersidemenulink', ['surveyid' => $surveyid, 'subaction' => 'tokens']),
                    ['class' => 'alert-link']
                ),
            'type' => 'info',
        ]); ?>
    <?php endif; ?>
    <?php if (!empty($missingAttachments)): ?>
... (99 lines truncated)
</file>

<file path="application/views/admin/export/exportresult_panels/_columns-control.php">
<!-- Column control -->
<div class="card mb-4" id="panel-6">
    <div class="card-header ">
        <div class="">
            <?php eT("Columns"); ?>
        </div>
    </div>
    <div class="card-body">
        <input type='hidden' name='sid' value='<?php echo $surveyid; ?>'/>
        <?php if ($SingleResponse) : ?>
            <input type='hidden' name='response_id' value="<?php echo $SingleResponse; ?>"/>
        <?php endif; ?>
        <label for='colselect' class="col-md-12 form-label">
            <?php eT("Select columns:"); ?>
        </label>
        <div class="col-md-12">
            <?php
            echo CHtml::listBox('colselect[]', array_keys($aFields), $aFields, ['multiple' => 'multiple', 'size' => '20', 'options' => $aFieldsOptions, 'class' => 'form-control']);
            ?>
        </div>
        <div class="col-md-12 text-center">
            <strong id='columncount'>&nbsp;</strong>
        </div>
        <?php if (count($aFields) + 20 > (int)ini_get('max_input_vars')) : ?>
            <div class="col-md-12">
                <?php
                $message = gT("The number of fields in your survey exceeds the maximum numbers of fields you can export.") .
                    '<br/>' .
                    sprintf(
                        gT("If data is missing in the exported file, please contact your system administrator to raise the setting max_input_vars to at least %s."),
... (12 lines truncated)
</file>

<file path="application/views/admin/export/exportresult_panels/_format.php">
<!-- Format -->
<div class="card mb-4" id="panel-export-format">
    <div class="card-header">
        <?php eT("Format"); ?>
    </div>
    <div class="card-body">
        <div class="mb-3">
            <!-- Format -->
            <label for='export_format' class="col-md-6 form-label">
                <?php eT("Export format:"); ?>
            </label>
            <div class="row">
                <?php foreach ($exports as $key => $info) : ?>
                    <?php if (!empty($info['label'])) : ?>
                        <div class="col-4">
                            <div class="form-check form-check-inline">
                                <input class="form-check-input" type="radio" name="type" id="<?= $key; ?>"
                                       value="<?= $key; ?>" <?= $info['label'] == $defaultexport ? 'checked' : '' ?>>
                                <label class="form-check-label" for="<?= $key ?>">
                                    <?php echo $info['label']; ?>
                                </label>
                            </div>
                        </div>
                    <?php endif; ?>
                <?php endforeach; ?>
            </div>
            <label for="csvfieldseparator" class="form-label">
                <?php eT("CSV field separator:"); ?>
            </label>
            <?php echo CHtml::dropDownList('csvfieldseparator', null, $aCsvFieldSeparator, ['class' => 'form-select w-auto']); ?>
... (4 lines truncated)
</file>

<file path="application/views/admin/export/exportresult_panels/_general.php">
<!-- General -->
<div class="card mb-4" id="panel-various">
    <div class="card-header ">
        <?php eT("General"); ?>
    </div>
    <div class="card-body">
        <div class="mb-3 row">
            <label for='completionstate' class="form-label">
                <?php eT("Completion state:"); ?>
            </label>
            <div class="">
                <select name='completionstate' id='completionstate' class='form-select'>
                    <option value='complete' <?php echo $selecthide; ?>>
                        <?php eT("Completed responses only"); ?>
                    </option>
                    <option value='all' <?php echo $selectshow; ?>>
                        <?php eT("All responses"); ?>
                    </option>
                    <option value='incomplete' <?php echo $selectinc; ?>>
                        <?php eT("Incomplete responses only"); ?>
                    </option>
                </select>
            </div>
        </div>
        <div class="mb-3 row">
            <label for='exportlang' class="form-label">
                <?php eT("Export language:"); ?>
            </label>
            <div class=''>
                <?php echo CHtml::dropDownList('exportlang', null, $aLanguages, ['class' => 'form-select']); ?>
... (5 lines truncated)
</file>

<file path="application/views/admin/export/exportresult_panels/_headings.php">
<!-- Heading -->
<div class="card mb-4" id="panel-4">
  <div class="card-header ">
      <?php eT("Headings");?>
  </div>
  <div class="card-body">
    <!-- Headers -->
    <div class="mb-3 row">
        <label class="col-md-12 form-label" for=''>
        <?php eT("Export questions as:"); ?>
      </label>
      <div class="btn-group col-md-12">
        <?php foreach ($headexports as $type => $headexport) :?>
            <input
                class="btn-check"
                value="<?= $type; ?>"
                id="headstyle-<?= $type; ?>"
                type="radio"
                name="headstyle" <?php if ($headexport[ 'checked'] == 'checked') {
                    echo 'checked';
                                 } ?>
            />
            <label class="btn btn-outline-secondary" for="headstyle-<?= $type; ?>">
                <?= $headexport['label'];?>
            </label>
        <?php endforeach; ?>
      </div>
    </div>
    <!-- Strip HTML -->
    <div class="mb-3 row">
... (81 lines truncated)
</file>

<file path="application/views/admin/export/exportresult_panels/_range.php">
<!-- Range -->
<div class="card mb-4 <?= $SingleResponse ? 'd-none' : ''?>" id="panel-2">
    <div class="card-header ">
        <div class="">
            <?php eT("Range"); ?>
        </div>
    </div>
    <div class="card-body">
        <div class="mb-3">
            <!-- From -->
            <label for='export_from' class=" form-label">
                <?php eT("From response ID:"); ?>
            </label>
            <div class="">
                <?php printf(
                    '<input min="%s" max="%s" step="1" type="number" value="%s" name="export_from" id="export_from" class="form-control" />',
                    $min_datasets,
                    $max_datasets,
                    $min_datasets
                ) ?>
            </div>
            <!-- To -->
            <label for='export_to' class=" form-label">
                <?php eT("To response ID:"); ?>
            </label>
            <div class="">
                <?php printf(
                    '<input min="%s" max="%s" step="1" type="number" value="%s" name="export_to" id="export_to" class="form-control" />',
                    $min_datasets,
                    $max_datasets,
... (7 lines truncated)
</file>

<file path="application/views/admin/export/exportresult_panels/_responses.php">
<div class="card mb-4" id="panel-5">
    <div class="card-header ">
        <div class="">
            <?php eT("Responses");?>
        </div>
    </div>
    <div class="card-body">
        <div class='mb-3'>
            <label class="col-md-12 form-label" for=''>
                <?php eT("Export responses as:"); ?>
            </label>
            <!-- Answer codes / Full answers -->
            <div class="btn-group">
                <input class="btn-check" name="answers" value="short" type="radio" id="answers-short" autocomplete="off" />
                <label class="btn btn-outline-secondary" for="answers-short">
                    <?php eT("Answer codes");?>
                </label>
                <input class="btn-check" name="answers" value="long" type="radio" id="answers-long" autocomplete="off" checked />
                <label class="btn btn-outline-secondary" for="answers-long">
                    <?php eT("Full answers");?>
                </label>
            </div>
        </div>
        <!-- Responses  -->
        <div class="mb-3">
            <?= CHTML::checkBox('converty', false, ['value' => 'Y', 'id' => 'converty']) ?>
            <?= ' ' . CHTML::label(gT("Convert Y to:"), 'converty', ['class' => 'form-label']) ?>
            <?= CHTML::textField('convertyto', '1', ['id' => 'convertyto', 'size' => '3', 'maxlength' => '1', 'class' => 'form-control']) ?>
        </div>
        <div class="mb-3">
... (11 lines truncated)
</file>

<file path="application/views/admin/export/exportresult_panels/_single-value.php">
<?php
?>
<div class="card mb-4 <?= $SingleResponse ? 'd-none' : '' ?>" id="panel-2">
  <div class="card-header ">
    <?php eT("Selection");?>
  </div>
  <div class="card-body">
    <div class="mb-3">
        <!-- From -->
        <label for='export_ids' class="col-md-2 form-label">
          <?php eT("Selected answers"); ?>
        </label>
        <div class="col-md-6">
          <input
             name="responses_id" id="responses_id"
            type="text" readonly class="form-control"
            value="<?= CHtml::encode($responseIds); ?>"
          />
        </div>
        <div class="col-md-2">
          <a
            href="<?php echo Yii::app()->getController()->createUrl("admin/export/sa/exportresults", array('surveyid' => $surveyid)); ?>"
            class="btn btn-outline-secondary"  role="button"
          >
            <?php eT("Reset");?>
          </a>
        </div>
    </div>
  </div>
</div>
... (1 lines truncated)
</file>

<file path="application/views/admin/export/exportresult_panels/_token-control.php">
<?php
$attrfieldnames = getTokenFieldsAndNames($surveyid, true);
?>
<div class="card mb-4" id="panel-7">
    <div class="card-header ">
        <div class="">
            <?php eT("Participant control"); ?>
        </div>
    </div>
    <div class="card-body">
        <?php
        $this->widget('ext.AlertWidget.AlertWidget', [
            'text' => gT('Your survey can export associated participant data with each response. Select any additional fields you would like to export.'),
            'type' => 'info',
        ]);
        ?>
        <label for='attribute_select' class="form-label">
            <?php eT("Choose participant fields:"); ?>
        </label>
        <select name='attribute_select[]' multiple size='20' class="form-select" id="attribute_select">
            <option value='first_name' id='first_name'>
                <?php eT("First name"); ?>
            </option>
            <option value='last_name' id='last_name'>
                <?php eT("Last name"); ?>
            </option>
            <option value='email_address' id='email_address'>
                <?php eT("Email address"); ?>
            </option>
            <?php
... (8 lines truncated)
</file>

<file path="application/views/admin/export/generatestats/simplestats/_statisticsoutput_answer.php">
<?php
?>
<?php
</file>

<file path="application/views/admin/export/generatestats/simplestats/_statisticsoutput_arithmetic.php">
<?php
?>
<tr>
    <td align='center'>
        <?php eT("Arithmetic mean"); ?>
    </td>
    <td>
        &nbsp;
    </td>
    <td align='center'>
        <?php echo $am; ?>
    </td>
    <td>
        &nbsp;
    </td>
</tr>
<tr>
    <td align='center'>
        <?php eT("Standard deviation"); ?>
    </td>
    <td>
        &nbsp;
    </td>
    <td align='center'>
        <?php echo $stddev; ?>
    </td>
    <td>
        &nbsp;
    </td>
</tr>
... (1 lines truncated)
</file>

<file path="application/views/admin/export/generatestats/simplestats/_statisticsoutput_graphs.php">
<?php
?>
<!-- _statisticsoutput_graphs -->
    <?php if (count($labels) < 70) : ?>
        <!-- Charts -->
        <div class="row custom custom-padding bottom-20">
            <div class="col-md-12 vcenter chartjs-container" id="chartjs-container-<?php echo $qqid; ?>"
                data-chartname="<?php echo $sChartname; // The name of the jschart object ?>"
                data-qid="<?php echo $qqid; // the question id ?>"
                data-type="<?php echo $charttype; // the chart start type (bar, donut, etc.) ?>"
                data-color="<?php echo $color; // the background color for bar, etc. ?>"
            >
            <?php
            ?>
                <canvas class="canvas-chart " id="chartjs-<?php echo $qqid; ?>" width="400" height="300<?php // echo $iCanvaHeight;?>"
                    data-color="<?php echo $color; // the background color for bar, etc. ?>"></canvas>
            </div>
        </div>
        <div class="row">
            <!-- legends -->
            <div class="legend col-md-12 vcenter">
                <?php foreach ($fullLabels as $i => $label) : ?>
                    <?php $colorindex = $color + $i; ?>
                    <div class="row" style="margin-bottom: 10px;">
                        <div class="col-md-1">
                            <span style="background-color:rgba(<?php echo $COLORS_FOR_SURVEY[$colorindex];?>,0.6); display: block;    width: 20px;    height: 20px;    border-radius: 5px; margin: 0px; padding: 0px;">
                            </span>
                        </div>
                        <div class="col-md-10">
                            <?php echo $label; ?>
... (29 lines truncated)
</file>

<file path="application/views/admin/export/generatestats/simplestats/_statisticsoutput_header.php">
<?php
?>
<!-- _statisticsoutput_header -->
    <div class="col-md-12 col-lg-6 col-xl-4 printable" style="margin-top: 2em;margin-bottom: 2em;">
        <h4><?php echo $outputs['qquestion'];?><?= !empty($outputs['subquestionText']) ? " [{$outputs['subquestionText']}]" : "" ?></h4>
<!-- end of _statisticsoutput_header -->
</file>

<file path="application/views/admin/export/generatestats/simplestats/_statisticsoutput_nograph.php">
<?php
?>
<div class="row">
    <div class="col-md-12">
        <?php
        $this->widget('ext.AlertWidget.AlertWidget', [
        'text' => gT("No simple graph for this question type"),
        'type' => 'warning',
        'htmlOptions' => ['class' => 'no-simple-graph']
        ]);
        ?>
    </div>
</div>
</file>

<file path="application/views/admin/export/generatestats/_header.php">
<?php
?>
<!-- Message Box -->
<div style="clear: both; margin-bottom: 10px;" class="d-print-none"></div>
<div class="jumbotron message-box">
    <h2><?php eT("Results"); ?></h2>
    <p><?php eT("Number of records in this query:") ?>&nbsp;<?php echo $results; ?></p>
    <p><?php eT("Total records in survey:"); ?>&nbsp;<?php echo $total; ?></p>
    <?php if ($total) : ?>
        <p><?php eT("Percentage of total:"); ?>&nbsp;<?php echo $percent; ?>%</p>
    <?php endif; ?>
    <?php if ($browse) : ?>
        <a href='<?php echo App()->createUrl('responses/browse/', ['surveyId' => $surveyid]) ?>'
           class='btn btn-outline-secondary d-print-none statistics-browse'>
            <?php eT("Browse"); ?>
        </a>
    <?php endif; ?>
</div>
<input type="hidden" id="showGraphOnPageLoad"/>
</file>

<file path="application/views/admin/export/generatestats/_statisticsoutput_answer.php">
<?php
?>
<!-- _statisticsoutput_answer -->
<tr>
    <td align='right' ><?php echo $label[$i]; ?></td>
    <td align='center' ><?php echo $grawdata[$i]; ?></td>
    <?php if ($bNAgData) : ?>
        <td  align='right' >
            <?php echo sprintf("%01.2f", $gdata[$i]); ?>%
        </td>
        <?php if ($bNAgDataExtraLine) : ?>
            <?php echo $bNAgDataExtraLine; ?>
        <?php endif;?>
        <?php if ($showAggregatedPercentage) :?>
            <td  align='right' colspan="2">
                <?php if ($aggregatedPercentage !== false) { ?>
                    <?php echo sprintf("%01.2f", $aggregatedPercentage); ?>%
                <?php } ?>
            </td>
        <?php elseif ($showEmptyAggregatedPercentage) :?>
            <td  align='right' colspan="2">
                &nbsp;
            </td>
        <?php endif;?>
    <?php endif; ?>
</tr>
<?php if ($bShowSumAnswer) :?>
    <tr>
        <td align='right'>
            <strong>
... (19 lines truncated)
</file>

<file path="application/views/admin/export/generatestats/_statisticsoutput_arithmetic.php">
<?php
?>
<tr><td colspan="4"><?php eT("Descriptive statistics"); ?></td></tr>
<tr>
    <td align='center'>
        <?php eT("Arithmetic mean"); ?>
    </td>
    <td>
        &nbsp;
    </td>
    <td align='center' colspan="2">
        <?php echo $am; ?>
    </td>
</tr>
<tr>
    <td align='center'>
        <?php eT("Standard deviation"); ?>
    </td>
    <td>
        &nbsp;
    </td>
    <td align='center' colspan="2">
        <?php echo $stddev; ?>
    </td>
</tr>
</file>

<file path="application/views/admin/export/generatestats/_statisticsoutput_footer.php">
<?php
 $qqid = str_replace('-', '__', (string) $qqid);
?>
statisticsData['quid'+'<?php echo $qqid; ?>'] = {
    labels : <?php echo json_encode($graph_labels); ?>,
    grawdata : <?php echo json_encode($grawdata); ?>,
    labels_percent : <?php echo json_encode($graph_labels_percent); ?>,
    grawdata_percent : <?php echo json_encode($grawdata_percent);?>
};
</file>

<file path="application/views/admin/export/generatestats/_statisticsoutput_graphs.php">
<?php
 $qqid = str_replace('-', '__', (string) $qqid);
?>
<tr>
    <td colspan='4' id='statzone_<?php echo $rt;?>'>
    <?php if (count($labels) < 70) : ?>
        <!-- Charts -->
        <div class="row">
            <div class="col-xl-8 col-12 chartjs-container text-center" id="chartjs-container-<?php echo $qqid; ?>"
                data-chartname="<?php echo $sChartname; // The name of the jschart object ?>"
                data-qid="<?php echo $qqid; // the question id ?>"
                data-type="<?php echo $charttype; // the chart start type (bar, donut, etc.) ?>"
                data-color="<?php echo $color; // the background color for bar, etc. ?>"
            >
            <?php if (array_sum($grawdata_percent) < 1) :?>
                <div class="stat-no-answer text-center" id="stat-no-answer-<?php echo $qqid; ?>" style="position: relative; top: 300px; display: none;" >
                    <?php eT('Not enough values for calculation');?>
                </div>
            <?php endif;?>
                <!-- a default width/height is provided from the server side. But it's overwritten by javascript-->
                <canvas class="canvas-chart " id="chartjs-<?php echo $qqid; ?>" width="<?php echo $canvaWidth?>" height="<?php echo $canvaHeight?>"
                    data-color="<?php echo $color; // the background color for bar, etc. ?>"></canvas>
            </div>
            <!-- legends -->
            <div class="legend legend-no-percent col-xl-4 col-12" id="legend-no-percent-<?php echo $qqid;?>">
                <?php foreach ($labels as $i => $label) : ?>
                    <?php $colorindex = $color + $i;
                    $colorindex = ($colorindex < 72) ? $colorindex : 0;?>
                    <div class="row" style="margin-bottom: 10px;">
                        <div class="col-md-1">
... (66 lines truncated)
</file>

<file path="application/views/admin/export/generatestats/_statisticsoutput_gross_total.php">
<?php
?>
<!-- _statisticsoutput_gross_total -->
    <tr>
        <td align='right'>
            <strong>
                <?php eT("Total");?>(<?php eT("gross"); ?>)
            </strong>
        </td>
        <td align='center'>
            <strong>
                <?php echo $sumallitems; ?>
            </strong>
        </td>
        <td align='right' colspan="2">
            <strong>
            <?php if ($sumallitems > 0) { ?>
                100.00%
            <?php } else { ?>
                0.00%
            <?php } ?>
            </strong>
        </td>
    </tr>
<!-- end of _statisticsoutput_gross_total -->
</file>

<file path="application/views/admin/export/generatestats/_statisticsoutput_header.php">
<?php
?>
<!-- _statisticsoutput_header -->
<div class="col-xl-<?php echo $nbcols; ?> col-md-12 ps-0 pe-3" >
<table class='table table-bordered printable' id="quid_<?php echo $outputs['parentqid'];?>">
    <thead>
        <tr class="active">
            <th colspan='4' align='center' style='text-align: center; '>
                <strong>
                    <?php echo sprintf(gT("Summary for %s"), $outputs['qtitle']); ?>
                </strong>
                <button class="float-end action_js_export_to_pdf btn btn-outline-secondary btn-sm d-print-none" data-question-id="quid_<?php echo $outputs['parentqid'];?>" data-bs-toggle="tooltip" title="<?php eT('Export this question to PDF.'); ?>" aria-label="<?php eT('Export this question to PDF.'); ?>" onclick="return false;">
                    <i class="ri-file-pdf-line" aria-hidden="true"></i>
                </button>
            </th>
        </tr>
        <tr>
            <td colspan='4' align='center' style='text-align: center; '>
                <!-- question title -->
                <?php echo $outputs['qquestion'];?>
            </td>
        </tr>
        <!-- width depend on how much items... -->
        <tr>
            <th width='' align='center' >
                <strong>
                    <?php eT("Answer");?>
                </strong>
            </th>
            <?php if ($bShowCount  = true) : ?>
... (21 lines truncated)
</file>

<file path="application/views/admin/export/statistics_subviews/_filter.php">
<?php
$colClass = 'col-lg-4 col-md-12';
if (!isset($datestamp) || $datestamp == "N") {
    $colClass = 'col-lg-6 col-md-12';
}
?>
<h4 class="h4"><?php
    eT("Filter"); ?></h4>
<div class="row">
    <div class="<?= $colClass ?>">
        <div class='mb-3'>
            <label class="form-label" for='idG'><?php
                eT("Response ID greater than:"); ?></label>
            <div class=''>
                <input class="form-control" type='number' id='idG' name='idG' size='10' value='<?php
                if (isset($_POST['idG'])) {
                    echo sanitize_int($_POST['idG']);
                } ?>' onkeypress="return window.LS.goodchars(event,'0123456789')"/>
            </div>
        </div>
    </div>
    <div class="<?= $colClass ?>">
        <div class='mb-3'>
            <label class="form-label" for='idL'><?php
                eT("Response ID less than:"); ?></label>
            <div class=''>
                <input class="form-control" type='number' id='idL' name='idL' size='10' value='<?php
                if (isset($_POST['idL'])) {
                    echo sanitize_int($_POST['idL']);
                } ?>' onkeypress="return window.LS.goodchars(event,'0123456789')"/>
... (80 lines truncated)
</file>

<file path="application/views/admin/export/statistics_subviews/_general_filters.php">
<div id='statistics_general_filter'>
    <div class="col-12">
        <!-- Data Selection -->
        <?php $this->renderPartial('/admin/export/statistics_subviews/_mainoptions', array('error' => $error, 'surveyid' => $surveyid, 'selectshow' => $selectshow, 'selecthide' => $selecthide, 'selectinc' => $selectinc, 'survlangs' => $survlangs, 'sStatisticsLanguage' => $sStatisticsLanguage)); ?>
        <!-- Output options -->
        <?php $this->renderPartial('/admin/export/statistics_subviews/_outputoptions', array()); ?>
        <!-- Filter -->
        <?php $this->renderPartial('/admin/export/statistics_subviews/_filter', array('datestamp' => $datestamp, 'dateformatdetails' => $dateformatdetails)); ?>
    </div>
</div>
<p>
    <input type='hidden' name='summary[]' value='idG' />
    <input type='hidden' name='summary[]' value='idL' />
    <input class="d-none" type='submit' value='<?php eT("View statistics"); ?>' />
    <input class="d-none" type='button' value='<?php eT("Clear"); ?>' onclick="window.open('<?php echo Yii::app()->getController()->createUrl("admin/statistics/sa/index/surveyid/$surveyid"); ?>', '_top')" />
</p>
</file>

<file path="application/views/admin/export/statistics_subviews/_mainoptions.php">
<h4 class=""><?php
    eT("Main options"); ?></h4>
<div class="row">
    <div class="col-lg-6 col-md-12">
        <div class='mb-3'>
            <label for='completionstate' class="form-label"><?php
                eT("Include:"); ?> </label>
            <div class="">
                <?php
                $this->widget('ext.ButtonGroupWidget.ButtonGroupWidget', array(
                    'name' => 'completionstate',
                    'checkedOption' => incompleteAnsFilterState(),
                    'selectOptions' => array(
                        "all" => gT("All responses", 'unescaped'),
                        "complete" => gT("Complete only", 'unescaped'),
                        "incomplete" => gT("Incomplete only", 'unescaped'),
                    )
                )); ?>
            </div>
        </div>
        <div class='mb-3'>
            <label for='outputtype' class="form-label"><?php
                eT("Output format:") ?></label>
            <div>
                <?php $this->widget('ext.ButtonGroupWidget.ButtonGroupWidget', [
                    'name'          => 'outputtype',
                    'checkedOption' => 'html',
                    'selectOptions' => [
                        'html' => gT('HTML'),
                        'pdf' => gT('PDF'),
... (76 lines truncated)
</file>

<file path="application/views/admin/export/statistics_subviews/_outputoptions.php">
<h4 class="h4"><?php
    eT("Output options"); ?></h4>
<div class="row">
    <div class="col-lg-6 col-md-12">
        <div class='mb-3'>
            <label for='showtextinline' class="form-label"><?php
                eT("Show text responses inline:") ?></label>
            <div>
                <?php $sShowtextinline = (int)Yii::app()->request->getPost('showtextinline'); ?>
                <?php $this->widget('ext.ButtonGroupWidget.ButtonGroupWidget', [
                    'name'          => 'showtextinline',
                    'checkedOption' => $sShowtextinline,
                    'selectOptions' => [
                        '1' => gT('On', 'unescaped'),
                        '0' => gT('Off', 'unescaped'),
                    ],
                    'htmlOptions'   => [
                        'class' => 'text-option-inherit'
                    ]
                ]); ?>
            </div>
        </div>
        <div class='mb-3'>
            <?php
            $sNoncompleted = (int)Yii::app()->request->getPost('noncompleted'); ?>
            <label class="form-label" id='noncompletedlbl' for='noncompleted' title='<?php
            eT(
                "Count stats for each question based only on the total number of responses for which the question was displayed or answered"
            ); ?>'><?php
                eT("Subtotals based on displayed or answered questions:"); ?></label>
... (92 lines truncated)
</file>

<file path="application/views/admin/export/statistics_subviews/_question.php">
<?php $myfield = "Q{$flt[0]}";
$niceqtext = flattenText($flt[5]); ?>
<?php
if (in_array($flt[2], [Question::QT_X_TEXT_DISPLAY,Question::QT_ASTERISK_EQUATION])) {
    return;
}
    $qidattributes = QuestionAttribute::model()->getQuestionAttributes($flt[0]);
    $specialQuestionTypes = array(Question::QT_M_MULTIPLE_CHOICE, Question::QT_P_MULTIPLE_CHOICE_WITH_COMMENTS, Question::QT_VERTICAL_FILE_UPLOAD);
if (in_array($flt[2], $specialQuestionTypes)) {
    $myfield = $flt[2] . $myfield;
}
if ($flt[2] == Question::QT_COLON_ARRAY_NUMBERS && !empty($qidattributes['input_boxes'])) {
    $myfield = $flt[2] . $myfield;
}
    $counter2 = 0;
    $encrypted = !empty($flt[6]);
    $encryptionNoticeId = 'encryption-notice-' . $flt[0];
    $textInputOptions = $encrypted ? array('aria-describedby' => $encryptionNoticeId) : array();
    $rangeInputOptions = $encrypted ? array('disabled' => true, 'aria-describedby' => $encryptionNoticeId) : array();
    $encryptionNotice = '';
if ($encrypted) {
    if (in_array($flt[2], [Question::QT_Q_MULTIPLE_SHORT_TEXT, Question::QT_T_LONG_FREE_TEXT, Question::QT_U_HUGE_FREE_TEXT, Question::QT_S_SHORT_FREE_TEXT])) {
        $encryptionNoticeText = gT("This field is encrypted and can only be searched by exact match. Please enter the exact value you are looking for.");
    } else {
        $encryptionNoticeText = gT("This field is encrypted and can't be filtered by a range of values.");
    }
    $encryptionNotice = "<div class='form-text mb-3' id='" . $encryptionNoticeId . "'><span class='ri-key-2-fill text-success' aria-hidden='true'></span> " . $encryptionNoticeText . "</div>";
}
?>
    <div class="question-filter-container grow-3 nofloat ls-space padding all-10">
... (773 lines truncated)
</file>

<file path="application/views/admin/export/statistics_subviews/_response_filter_choice.php">
<div id="filterchoices">
        <?php foreach ($aGroups as $groupKey => $aGroup) : ?>
            <div class="accordion mb-3" id="accordion_<?php echo $aGroup['gid']; ?>">
                <div class="accordion-item">
                    <h2 class="accordion-header" id="grp_<?php echo $aGroup['gid']; ?>">
                        <button
                            class="accordion-button"
                            type="button"
                            data-bs-toggle="collapse"
                            data-bs-target="#grp_body_<?php echo $aGroup['gid']; ?>"
                            aria-expanded="true"
                            aria-controls="grp_<?php echo $aGroup['gid']; ?>">
                            <?php echo flattenText($aGroup['name']); ?>
                            (<?php echo gT("Question group") . $aGroup['gid']; ?>)
                        </button>
                    </h2>
                    <div
                        id="grp_body_<?php echo $aGroup['gid']; ?>"
                        class="accordion-collapse collapse show"
                        aria-labelledby="grp_<?php echo $aGroup['gid']; ?>"
                        data-bs-parent="#accordion_<?php echo $aGroup['gid']; ?>"
                    >
                        <div class="accordion-body">
                            <!-- Questions container -->
                            <div class="mb-3">
                                <input
                                    type="checkbox"
                                    id='btn_<?php echo $aGroup['gid']; ?>'
                                    onclick="selectCheckboxes('grp_body_<?php echo $aGroup['gid']; ?>', 'summary[]', 'btn_<?php echo $aGroup['gid']; ?>');"
                                /> <?php echo gT('All'); ?>
... (29 lines truncated)
</file>

<file path="application/views/admin/export/statistics_subviews/_response_filters.php">
<!-- AUTOSCROLLING DIV CONTAINING QUESTION FILTERS -->
<div id="statisticsresponsefilters" class="statisticsfilters scrollheight_400">
    <input type='hidden' id='filterchoice_state' name='filterchoice_state' value='<?php echo $filterchoice_state; ?>' />
    <?php
        $dshresults = $dshresults ?? '';
        $dshresults2 = $dshresults2 ?? '';
    ?>
    <!-- Filter choice -->
    <?php $this->renderPartial(
        '/admin/export/statistics_subviews/_response_filter_choice',
        array(
            'filterchoice_state' => $filterchoice_state,
            'filters' => $filters,
            'aGroups' => $aGroups,
            'surveyid' => $surveyid,
            'result' => $result,
            'fresults' => $fresults,
            'summary' => $summary,
            'dateformatdetails' => $dateformatdetails,
            'oStatisticsHelper' => $oStatisticsHelper,
            'language' => $language,
            'dshresults' => $dshresults,
            'dshresults2' => $dshresults2,
        )
    );
?>
</div>
<p id='vertical_slide2'>
    <input type='submit' class="d-none" value='<?php eT("View statistics"); ?>' />
    <input type='button' class="d-none" value='<?php eT("Clear"); ?>' onclick="window.open('<?php echo Yii::app()->getController()->createUrl("admin/statistics/sa/index/surveyid/$surveyid"); ?>', '_top')" />
... (4 lines truncated)
</file>

<file path="application/views/admin/export/statistics_subviews/_statistics_output.php">
<?php if ($output == "") : ?>
    <?php
    $this->widget('ext.AlertWidget.AlertWidget', [
        'text' => gT('Please select filters and click on the "View statistics" button to generate the statistics.'),
        'type' => 'info',
        'htmlOptions' => ['id' => 'view-stats-alert-info']
    ]);
    ?>
<?php else : ?>
    <div class="row">
        <?php echo $output; ?>
    </div>
<?php endif; ?>
<div id="statsContainerLoading">
    <p><?php eT('Please wait, loading data...'); ?></p>
    <div class="preloader loading">
        <span class="slice"></span>
        <span class="slice"></span>
        <span class="slice"></span>
        <span class="slice"></span>
        <span class="slice"></span>
        <span class="slice"></span>
    </div>
</div>
</file>

<file path="application/views/admin/export/statistics_subviews/_statistics_view_scripts.php">
<?php
?>
<script type='text/javascript'>
    var statisticsData = {};
    var graphUrl="<?php echo Yii::app()->getController()->createUrl("admin/statistics/sa/graph"); ?>";
    var sStatisticsLanguage="<?php echo $sStatisticsLanguage; ?>";
    var listColumnUrl="<?php echo Yii::app()->getController()->createUrl("admin/statistics/sa/listcolumn/surveyid/" . $surveyid . "/column/"); ?>";
    var showTextInline="<?php echo $showtextinline ?>";
    var jspdfworker="<?php echo yii::app()->clientScript->getPackageBaseUrl('jspdf'); ?>";
</script>
<?php Yii::app()->getClientScript()->registerPackage('chart.js'); ?>
<script>
    var CSS_COLOR_NAMES = LS.ld.shuffle["AliceBlue","AntiqueWhite","Aqua","Aquamarine","Azure","Beige","Bisque","Black","BlanchedAlmond","Blue","BlueViolet","Brown","BurlyWood","CadetBlue","Chartreuse","Chocolate","Coral","CornflowerBlue","Cornsilk","Crimson","Cyan","DarkBlue","DarkCyan","DarkGoldenRod","DarkGray","DarkGrey","DarkGreen","DarkKhaki","DarkMagenta","DarkOliveGreen","Darkorange","DarkOrchid","DarkRed","DarkSalmon","DarkSeaGreen","DarkSlateBlue","DarkSlateGray","DarkSlateGrey","DarkTurquoise","DarkViolet","DeepPink","DeepSkyBlue","DimGray","DimGrey","DodgerBlue","FireBrick","FloralWhite","ForestGreen","Fuchsia","Gainsboro","GhostWhite","Gold","GoldenRod","Gray","Grey","Green","GreenYellow","HoneyDew","HotPink","IndianRed","Indigo","Ivory","Khaki","Lavender","LavenderBlush","LawnGreen","LemonChiffon","LightBlue","LightCoral","LightCyan","LightGoldenRodYellow","LightGray","LightGrey","LightGreen","LightPink","LightSalmon","LightSeaGreen","LightSkyBlue","LightSlateGray","LightSlateGrey","LightSteelBlue","LightYellow","Lime","LimeGreen","Linen","Magenta","Maroon","MediumAquaMarine","MediumBlue","MediumOrchid","MediumPurple","MediumSeaGreen","MediumSlateBlue","MediumSpringGreen","MediumTurquoise","MediumVioletRed","MidnightBlue","MintCream","MistyRose","Moccasin","NavajoWhite","Navy","OldLace","Olive","OliveDrab","Orange","OrangeRed","Orchid","PaleGoldenRod","PaleGreen","PaleTurquoise","PaleVioletRed","PapayaWhip","PeachPuff","Peru","Pink","Plum","PowderBlue","Purple","Red","RosyBrown","RoyalBlue","SaddleBrown","Salmon","SandyBrown","SeaGreen","SeaShell","Sienna","Silver","SkyBlue","SlateBlue","SlateGray","SlateGrey","Snow","SpringGreen","SteelBlue","Tan","Teal","Thistle","Tomato","Turquoise","Violet","Wheat","White","WhiteSmoke","Yellow","YellowGreen"];
</script>
</file>

<file path="application/views/admin/export/exportresults_view.php">
<?php
echo viewHelper::getViewTestTag('exportResults');
$scriptBegin = "var sMsgColumnCount = '" . gT("%s of %s columns selected", 'js') . "';";
App()->getClientScript()->registerScript('ExportresultsVariables', $scriptBegin, LSYii_ClientScript::POS_BEGIN);
?>
<div class='side-body'>
    <?php echo CHtml::form(array('admin/export/sa/exportresults/surveyid/' . $surveyid), 'post', array('id' => 'resultexport', 'class' => '')); ?>
    <div class="row">
        <div class="col-12">
            <div class="col-lg-6 text-start">
                <h4>
                    <?php eT("Export results"); ?>
                    <?php
                    if (App()->getRequest()->getPost('sql')) {
                        echo " - " . gT("Filtered from statistics script");
                    }
                    if ($SingleResponse) {
                        echo " - " . sprintf(gT("Single response: ID %s"), $SingleResponse);
                    }
                    ?>
                </h4>
            </div>
        </div>
        <h3></h3>
    </div>
    <div class="row">
        <div class="col-md-12 content-right">
            <div class="row">
                <div class="col-md-12 col-lg-6">
                    <?php $this->renderPartial('/admin/export/exportresult_panels/_format', ['exports' => $exports, 'defaultexport' => $defaultexport, 'aCsvFieldSeparator' => $aCsvFieldSeparator]); ?>
... (23 lines truncated)
</file>

<file path="application/views/admin/export/spss_view.php">
<?php
echo viewHelper::getViewTestTag('exportSpss');
?>
<div class='side-body'>
    <h3><?php eT("Export response data to SPSS");?></h3>
    <?php echo CHtml::form(array("admin/export/sa/exportspss/sid/{$surveyid}/"), 'post', array('id' => 'exportspss', 'class' => ''));?>
    <div class="mb-3 row">
        <label for='completionstate' class='col-md-2  form-form-label'><?php eT("Data selection:");?></label>
        <div class="col-md-10">
            <?php $this->widget('ext.ButtonGroupWidget.ButtonGroupWidget', array(
                'name' => 'completionstate',
                'checkedOption' => 'all' ,
                'selectOptions' => array(
                    "all" => gT("All responses", 'unescaped'),
                    "complete" => gT("Complete only", 'unescaped'),
                    "incomplete" => gT("Incomplete only", 'unescaped'),
                )
            ));?>
        </div>
    </div>
    <div class="mb-3 row">
        <label for='spssver'  class='col-sm-2  form-label'><?php eT("SPSS version:");?></label>
        <div class="col-md-10">
            <?php $this->widget('ext.ButtonGroupWidget.ButtonGroupWidget', array(
                'name' => 'spssver',
                'checkedOption' => $spssver ,
                'selectOptions' => array(
                    "1" => gT("Prior to 16 / PSPP", 'unescaped'),
                    "2" => gT("16 or up", 'unescaped'),
                    "3" => gT("16 or up with Python Plugin / Essentials", 'unescaped')
... (76 lines truncated)
</file>

<file path="application/views/admin/export/statistics_browse_view.php">
<?php
?>
<?php if (Permission::model()->hasSurveyPermission($surveyid, 'responses', 'read')) { ?>
    <div class='statisticscolumnid'>
        <?php
        $iconClass = ' ri-arrow-down-s-fill ';
        $disabled = true;
        if ($sortby == "id") {
            $disabled = false;
            switch ($sortmethod) {
                case "asc":
                    $iconClass = "ri-arrow-down-s-fill";
                    break;
                case "desc":
                    $image = "ri-sort-asc";
                    break;
            }
        }
        ?>
        <?php $sort = (isset($sortby) && $sortby == "id" && $sortmethod == 'asc') ? 'desc' : 'asc'; ?>
        <?php if (!$disabled) : ?>
            <a href="#" class='sortorder'  id='sortorder_<?php echo $column ?>_id_<?php echo $sort ?>_T'>
                    <span class="<?php echo $iconClass?>"></span>
            </a>
        <?php endif;?>
    </div>
<?php } ?>
<div class='statisticscolumndata'>
    <?php
    $iconClass = ' ri-arrow-down-s-fill ';
... (38 lines truncated)
</file>

<file path="application/views/admin/export/statistics_graph_view.php">
{
    "ok": <?php echo $success ?>
    <?php
    if (isset($mapdata)) {
        echo ",\"mapdata\":" . ls_json_encode($mapdata);
    }
    ?>
    <?php
    if (isset($chartdata)) {
        echo ",\"chartdata\":" . ls_json_encode($chartdata);
    }
    ?>
}
</file>

<file path="application/views/admin/export/statistics_user_view.php">
<?php
?>
<!-- Javascript variables  -->
<?php $this->renderPartial('/admin/export/statistics_subviews/_statistics_view_scripts', array('sStatisticsLanguage' => $sStatisticsLanguage, 'surveyid' => $surveyid, 'showtextinline' => $showtextinline)) ; ?>
<div id='statisticsview' class='side-body'>
    <div class="row">
        <div class="col-12">
            <div class="col-lg-3 text-start">
                <h4>
                    <span class="ri-bar-chart-fill"></span> &nbsp;&nbsp;&nbsp;
                    <?php eT("Statistics"); ?>
                </h4>
            </div>
            <div class="col-lg-9 text-end">
                <div class="mb-3">
                    <div >
                        <label for='completionstate' class="form-label"><?php eT("Include:"); ?> </label>
                        <?php
                        echo CHtml::dropDownList(
                            'completionstate',
                            incompleteAnsFilterState(),
                            array(
                                "all" => gT("All responses", 'unescaped'),
                                "complete" => gT("Complete only", 'unescaped'),
                                "incomplete" => gT("Incomplete only", 'unescaped'),
                            ),
                            array(
                                'class' => 'form-control',
                                'style' => 'display: inline;width: auto;',
                                'data-url' => App()->createUrl('/admin/statistics/sa/setIncompleteanswers/')
... (31 lines truncated)
</file>

<file path="application/views/admin/export/statistics_view.php">
<?php
echo viewHelper::getViewTestTag('statisticsIndex');
?>
<!-- Javascript variables  -->
<?php $this->renderPartial('/admin/export/statistics_subviews/_statistics_view_scripts', array('sStatisticsLanguage' => $sStatisticsLanguage, 'surveyid' => $surveyid, 'showtextinline' => $showtextinline)); ?>
<?php echo CHtml::form(array("admin/statistics/sa/index/surveyid/{$surveyid}/"), 'post', array('name' => 'generate-statistics', 'class' => '', 'id' => 'generate-statistics')); ?>
<div id='statisticsview' class='side-body'>
    <div class="h1 d-print-block d-none text-center"><?php echo flattenText($oSurvey->defaultlanguage->surveyls_title, 1); ?></div>
    <div class="row d-print-none">
        <div class="col-12">
            <div class="col-lg-3 text-start">
                <h4 class="d-print-none">
                    <span class="ri-bar-chart-fill"></span> &nbsp;&nbsp;&nbsp;
                    <?php eT("Statistics"); ?>
                </h4>
            </div>
        </div>
    </div>
<?php
    $submitted = ($filterchoice_state != '' || !empty($summary));
    $this->widget('ext.AccordionWidget.AccordionWidget', [
        'id' => 'filters',
        'class' => '',
        'items' => [
            [
                'id' => 'general-filters-item',
                'title' => gT('General filters'),
                'open' => $filterchoice_state == '' && empty($summary),
                'content' => $this->renderPartial(
                    '/admin/export/statistics_subviews/_general_filters',
... (63 lines truncated)
</file>

<file path="application/views/admin/export/vv_view.php">
<div class='side-body'>
    <?php echo CHtml::form(array("admin/export/sa/vvexport/surveyid/{$surveyid}"), 'post', array('id' => 'vvexport', 'class' => '')); ?>
    <div class="row">
        <div class="col-12">
            <div class="col-lg-6 text-start">
                <h4>
                    <?php eT("Export a VV survey file"); ?>
                </h4>
            </div>
        </div>
        <h3></h3>
    </div>
    <div class="row">
        <div class="col-md-6 content-right">
            <div class="card" id="panel-1" style="opacity: 1; top: 0px;">
                <div class="card-header ">
                    <div class="">
                        <?php eT("Export survey"); ?>
                    </div>
                </div>
                <div class="card-body">
                    <div class="row mb-3">
                        <label class="col-sm-3 col-form-label text-end" for="surveyid"><?php eT("Survey ID:"); ?></label>
                        <div class="col-sm-9">
                            <?php echo CHtml::textField('surveyid', $surveyid, array('size' => 10, 'readonly' => 'readonly', 'class' => 'form-control')); ?>
                        </div>
                    </div>
                    <div class="row mb-3">
                        <label class="col-sm-3 col-form-label text-end" for="completionstate"><?php eT("Export:"); ?></label>
                        <div class="col-sm-9">
... (79 lines truncated)
</file>

<file path="application/views/admin/expressions/partial/topbarBtns/rightSideButtons.php">
<?php
Yii::app()->getController()->renderPartial(
    '/surveyAdministration/partial/topbar/surveyTopbarRight_view',
    [
        'showBackButton' => $aData['topBar']['showBackButton'],
        'returnUrl' => $aData['topBar']['returnUrl']
    ]
);
</file>

<file path="application/views/admin/expressions/test_view.php">
<?php
echo viewHelper::getViewTestTag('expressionsTest');
?>
<table class="table table-striped ">
    <thead>
    <tr>
        <th>Test</th>
        <th>Description</th>
    </tr>
    </thead>
    <tbody>
    <tr>
        <td><a class="ls-link" href="<?php echo $this->createUrl('admin/expressions/sa/functions'); ?>">Available Functions</a></td>
        <td>Show the list of functions available within ExpressionScript Engine.</td>
    </tr>
    <tr>
        <td><a class="ls-link" href="<?php echo $this->createUrl('admin/expressions/sa/strings_with_expressions'); ?>">Unit Tests of Expressions Within Strings</a></td>
        <td>Test how ExpressionScript Engine can process strings containing one or more variable, token, or expression replacements surrounded by curly braces.</td>
    </tr>
    <tr>
        <td><a class="ls-link" href="<?php echo $this->createUrl('admin/expressions/sa/relevance'); ?>">Unit Test Dynamic Relevance Processing</a></td>
        <td>Questions and substitutions should dynamically change based upon values entered.</td>
    </tr>
    <tr>
        <td><a class="ls-link" href="<?php echo $this->createUrl('admin/expressions/sa/conditions2relevance'); ?>">Preview Conversion of Conditions to Relevance</a></td>
        <td>Shows Relevance equations for all conditions in the database, grouped by question id (and not pretty-printed)</td>
    </tr>
    <tr>
        <td><?php echo CHtml::form(array('admin/expressions/sa/upgrade_conditions2relevance'), 'post'); ?><button type="submit" class="ls-link btn btn-link">Bulk Convert Conditions to Relevance</button><?php echo CHtml::endForm(); ?></td>
        <td>Convert conditions to relevance for entire database</td>
... (52 lines truncated)
</file>

<file path="application/views/admin/expressions/validationList.php">
<div class="card">
<?php
foreach ($aExpressions as $aExpression) {
    if ($aExpression['expression'] != '') {
        echo CHtml::tag('div', array('class' => "card-header "), false);
        echo CHtml::tag('h4', [], $aExpression['title']);
        echo CHtml::closeTag('div');
        echo CHtml::tag('div', array('class' => "card-body"), false);
        echo CHtml::tag('div', [], $aExpression['expression']);
        echo CHtml::closeTag('div');
    }
}
?>
</div>
</file>

<file path="application/views/admin/globalsettings/partial/topbarBtns/rightSideButtons.php">
<?php
$this->widget(
    'ext.ButtonWidget.ButtonWidget',
    [
        'name' => 'boxes-close-button',
        'id' => 'boxes-close-button',
        'text' => gT('Close'),
        'icon' => 'ri-close-fill',
        'link' => Yii::app()->createUrl('admin/'),
        'htmlOptions' => [
            'class' => 'btn btn-outline-secondary',
        ],
    ]
);
$this->widget(
    'ext.ButtonWidget.ButtonWidget',
    [
        'name' => 'save-and-close-form-button',
        'id' => 'save-and-close-form-button',
        'text' => gT('Save and close'),
        'icon' => 'ri-checkbox-circle-fill',
        'htmlOptions' => [
            'class' => 'btn btn-outline-secondary',
            'onclick' => "$(this).addClass('disabled').attr('onclick', 'return false;');",
            'data-form-id' => 'frmglobalsettings'
        ],
    ]
);
$this->widget(
    'ext.ButtonWidget.ButtonWidget',
... (13 lines truncated)
</file>

<file path="application/views/admin/globalsettings/partial/topbarBtns_surveysettings/rightSideButtons.php">
<?php
$this->widget(
    'ext.ButtonWidget.ButtonWidget',
    [
        'name' => 'boxes-close-button',
        'id' => 'boxes-close-button',
        'text' => gT('Close'),
        'icon' => 'ri-close-fill',
        'link' => Yii::app()->createUrl('dashboard/view'),
        'htmlOptions' => [
            'class' => 'btn btn-outline-secondary',
        ],
    ]
);
$this->widget(
    'ext.ButtonWidget.ButtonWidget',
    [
        'name' => 'save-and-close-form-button',
        'id' => 'save-and-close-form-button',
        'text' => gT('Save and close'),
        'icon' => 'ri-checkbox-circle-fill',
        'htmlOptions' => [
            'class' => 'btn btn-outline-secondary',
            'onclick' => "$(this).addClass('disabled').attr('onclick', 'return false;');",
            'data-form-id' => 'survey-settings-form'
        ],
    ]
);
$this->widget(
    'ext.ButtonWidget.ButtonWidget',
... (13 lines truncated)
</file>

<file path="application/views/admin/globalsettings/_bounce.php">
<?php
?>
<div class="container">
<div class="row">
<div class="col-6">
<div class="mb-3">
    <label class=" form-label" for='siteadminbounce'><?php eT("Default site bounce email:"); ?></label>
    <div class="">
        <input class="form-control" type='email' size='50' id='siteadminbounce' name='siteadminbounce' value="<?php echo htmlspecialchars((string) Yii::app()->getConfig('siteadminbounce')); ?>" />
    </div>
</div>
<div class="mb-3">
    <label class=" form-label"  for='bounceaccounttype'><?php eT("Server type:"); ?></label>
    <div>
        <?php $this->widget('ext.ButtonGroupWidget.ButtonGroupWidget', [
            'name'          => 'bounceaccounttype',
            'ariaLabel'     => gT('Server type:'),
            'checkedOption' => Yii::app()->getConfig('bounceaccounttype'),
            'selectOptions' => [
                "off"  => gT("Off", 'unescaped'),
                "IMAP" => "IMAP",
                "POP"  => "POP3",
            ]
        ]); ?>
    </div>
</div>
<div class="mb-3">
    <label class=" form-label"  for='bounceaccounthost'><?php eT("Server name & port:"); ?></label>
    <div class="">
        <input class="form-control" type='text' size='50' id='bounceaccounthost' aria-describedby="bounce_ins" name='bounceaccounthost' value="<?php echo htmlspecialchars((string) Yii::app()->getConfig('bounceaccounthost'))?>" />
... (38 lines truncated)
</file>

<file path="application/views/admin/globalsettings/_email.php">
<?php
?>
<div class="container">
<div class="row">
    <div class="col-6">
        <div class="mb-3">
            <label class=" form-label" for='siteadminemail'><?php eT("Default site admin email:"); ?></label>
            <div class="">
                <input class="form-control" type='email' size='50' id='siteadminemail' name='siteadminemail' value="<?php echo htmlspecialchars((string) Yii::app()->getConfig('siteadminemail')); ?>"/>
            </div>
        </div>
        <div class="mb-3">
            <label class="  form-label" for='siteadminname'><?php eT("Administrator name:"); ?></label>
            <div class="">
                <input class="form-control" type='text' size='50' id='siteadminname' name='siteadminname' value="<?php echo htmlspecialchars((string) Yii::app()->getConfig('siteadminname')); ?>"/>
            </div>
        </div>
        <div class="mb-3">
            <label class="  form-label" for='emailmethod'><?php eT("Email method:"); ?></label>
            <div>
                <?php $this->widget('ext.ButtonGroupWidget.ButtonGroupWidget', [
                    'name'          => 'emailmethod',
                    'ariaLabel'     => gT('Email method:'),
                    'checkedOption' => Yii::app()->getConfig('emailmethod'),
                    'selectOptions' => [
                        LimeMailer::MethodMail => "PHP",
                        LimeMailer::MethodSmtp => "SMTP",
                        LimeMailer::MethodSendmail => "Sendmail",
                        LimeMailer::MethodQmail => "qmail",
                        LimeMailer::MethodPlugin => "Plugin",
... (131 lines truncated)
</file>

<file path="application/views/admin/globalsettings/_emailTestConfirmation.php">
<div class="modal-header">
    <h2 class="modal-title h5"><?php eT("Test email settings"); ?></h2>
    <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="<?= gT('Close') ?>"></button>
</div>
<div class="modal-body">
    <p><?php printf(gT("Test email will be sent to: %s"), "<strong>" . $testEmail . "</strong>"); ?></p>
    <div id="settingschangedwarning" class="alert alert-filled-danger" role="alert" style="display: none;">
        <?= gT("There seems to be some changes in the settings which were not saved yet. These changes will be disregarded by the test procedure."); ?>
    </div>
</div>
<div class="modal-footer">
    <a role="button" class="btn btn-primary btn-ok" href="<?php echo \Yii::app()->createUrl('admin/globalsettings', array("sa" => "sendTestEmail")); ?>">
        <span class='ri-check-fill'></span>
        &nbsp;<?php eT("Send email"); ?>
    </a>
    <button role="button" class="btn btn-outline-dark btn-ok"><?php eT("Close"); ?></button>
</div>
<script>
    var siteadminemail = $('#siteadminemail').val();
    var siteadminname = $('#siteadminname').val();
    var emailmethod = $('#emailmethod input:checked').val();
    var emailsmtphost = $('#emailsmtphost').val();
    var emailsmtpuser = $('#emailsmtpuser').val();
    var emailsmtppassword = $('#emailsmtppassword').val();
    var emailsmtpssl = $('#emailsmtpssl input:checked').val();
    if (siteadminemail != '<?= $siteadminemail ?>' ||
        siteadminname != '<?= $siteadminname ?>' ||
        emailmethod != '<?= $emailmethod ?>' ||
        emailsmtphost != '<?= $emailsmtphost ?>' ||
        emailsmtpuser != '<?= $emailsmtpuser ?>' ||
... (6 lines truncated)
</file>

<file path="application/views/admin/globalsettings/_emailTestResults.php">
<div class="pagetitle h3"><?php eT("Test email settings");?></div>
<div class="row" style="margin-bottom: 100px">
    <div class="col-12">
        <div class="jumbotron message-box <?= !$success ? 'message-box-error' : ''?>">
            <h2><?php eT("Email test result"); ?></h2>
            <p class="h4 <?= !$success ? 'text-danger' : 'text-success'?>"><?php echo $message;?></p>
            <?php if (!$success) { ?>
                <div> <?php echo $maildebug ?></div>
            <?php } ?>
            <p>
                <a class="btn btn-lg btn-primary" href='<?php echo $this->createUrl('admin/globalsettings');?>'><?php eT("Back to settings"); ?></a>
            </p>
        </div>
    </div>
</div>
</file>

<file path="application/views/admin/globalsettings/_general.php">
<?php
use LimeSurvey\Libraries\FormExtension\FormExtensionWidget;
use LimeSurvey\Libraries\FormExtension\Inputs\GlobalSettingsRenderer;
?>
<?php
$thisdefaulttheme                = Yii::app()->getConfig('defaulttheme');
$templatenames                   = array_keys(Template::getTemplateList());
$thisadmintheme                  = Yii::app()->getConfig('admintheme');
$thisdefaulthtmleditormode       = Yii::app()->getConfig('defaulthtmleditormode');
$thismaintenancemode             = !empty(Yii::app()->getConfig('maintenancemode')) ? Yii::app()->getConfig('maintenancemode') : 'off';
$thisdefaultquestionselectormode = Yii::app()->getConfig('defaultquestionselectormode');
$thisdefaultthemeteeditormode    = Yii::app()->getConfig('defaultthemeteeditormode');
$dateformatdata                  = getDateFormatData(Yii::app()->session['dateformat']);
$defaultBreadcrumbMode           = Yii::app()->getConfig('defaultBreadcrumbMode');
?>
<div class="container">
<div class="row">
    <div class="col-6">
        <!-- Global sitename -->
        <div class="mb-3">
            <label class="col-12 form-label" for='sitename'>
                <?php eT("Site name:");
                echo((Yii::app()->getConfig("demoMode") == true) ? '*' : ''); ?>
            </label>
            <div class="col-12">
                <input class="form-control" type='text' size='50' id='sitename' name='sitename' value="<?php echo htmlspecialchars((string) Yii::app()->getConfig('sitename')); ?>"/>
            </div>
        </div>
        <!-- Default Template -->
        <div class="mb-3">
... (383 lines truncated)
</file>

<file path="application/views/admin/globalsettings/_interfaces.php">
<?php
?>
<?php $RPCInterface = Yii::app()->getConfig('RPCInterface'); ?>
<div class="container">
<div class="mb-3">
    <label class=" form-label"  for='RPCInterface'><?php eT("RPC interface enabled:"); ?></label>
    <div>
        <?php $this->widget('ext.ButtonGroupWidget.ButtonGroupWidget', [
            'name'          => 'RPCInterface',
            'ariaLabel' => gT('RPC interface enabled:'),
            'checkedOption' => $RPCInterface,
            'selectOptions' => [
                "off"  => gT("Off", 'unescaped'),
                "json" => gT("JSON-RPC", 'unescaped'),
                "xml"  => gT("XML-RPC", 'unescaped')
            ]
        ]); ?>
    </div>
</div>
<div class="mb-3">
    <label class=" form-label" ><?php eT("URL:"); ?></label>
    <div class="">
        <?php echo $this->createAbsoluteUrl("admin/remotecontrol"); ?>
    </div>
</div>
<div class="mb-3">
    <label class=" form-label"  for='rpc_publish_api'><?php eT("Publish API on /admin/remotecontrol:"); ?></label>
    <div>
        <?php $this->widget('ext.ButtonGroupWidget.ButtonGroupWidget', [
            'name'          => "rpc_publish_api",
... (34 lines truncated)
</file>

<file path="application/views/admin/globalsettings/_language.php">
<?php
?>
<div class="container">
    <div class="row">
        <div class="col-6">
            <div class="mb-3">
                <label class="form-label" for='defaultlang'>
                    <?php eT("Default site language:");
                    echo ((Yii::app()->getConfig("demoMode") == true) ? '*' : ''); ?>
                </label>
                <select class="form-select"  name='defaultlang' id='defaultlang'>
                <?php
                    $actuallang = Yii::app()->getConfig('defaultlang');
                foreach (getLanguageData(true) as $langkey2 => $langname) {
                    ?>
                    <option value='<?php echo $langkey2; ?>'
                    <?php
                    if ($actuallang == $langkey2) {
                        ?> selected='selected' <?php
                    } ?>
                        ><?php echo $langname['nativedescription'] . " - " . $langname['description']; ?></option>
                    <?php
                }
                ?>
                </select>
            </div>
            <div class="mb-3">
                <label class=" form-label"  for='includedLanguages'><?php eT("Available languages:"); ?></label>
                    <table id='languageSelection' role="presentation">
                    <tr>
... (52 lines truncated)
</file>

<file path="application/views/admin/globalsettings/_overview.php">
<?php
?>
<br /><table class='table table-hover'>
    <caption class="visually-hidden">
        <?php eT("Global settings overview"); ?>
    </caption>
    <tr>
        <th ><?php eT("Users"); ?>:</th><td><?php echo $usercount; ?></td>
    </tr>
    <tr>
        <th ><?php eT("Surveys"); ?>:</th><td><?php echo $surveycount; ?></td>
    </tr>
    <tr>
        <th ><?php eT("Active surveys"); ?>:</th><td><?php echo $activesurveycount; ?></td>
    </tr>
    <tr>
        <th ><?php eT("Deactivated result tables"); ?>:</th><td><?php echo $deactivatedsurveys; ?></td>
    </tr>
    <tr>
        <th ><?php eT("Active survey participant lists"); ?>:</th><td><?php echo $activetokens; ?></td>
    </tr>
    <tr>
        <th ><?php eT("Deactivated survey participant lists"); ?>:</th><td><?php echo $deactivatedtokens; ?></td>
    </tr>
    <?php
    if (Yii::app()->getConfig('iFileUploadTotalSpaceMB') > 0) {
        $fUsed = calculateTotalFileUploadUsage();
        ?>
        <tr>
            <th ><?php eT("Used/free space for file uploads"); ?>:</th><td><?php echo sprintf('%01.2F', $fUsed); ?> MB / <?php echo sprintf('%01.2F', Yii::app()->getConfig('iFileUploadTotalSpaceMB') - $fUsed); ?> MB</td>
... (13 lines truncated)
</file>

<file path="application/views/admin/globalsettings/_presentation.php">
<?php
?>
<div class="container">
    <div class="row">
        <div class="col-6">
            <div class="mb-3">
                <label class=" form-label" for='repeatheadings'><?php eT("Repeat headings in array questions every X subquestions:"); ?></label>
                <div class="">
                    <input class="form-control" id='repeatheadings' name='repeatheadings' value='<?php echo Yii::app()->getConfig('repeatheadings'); ?>'
                           size='4' maxlength='4'/>
                </div>
            </div>
            <div class="mb-3">
                <label class=" form-label" for='pdffontsize'><?php eT("Font size of PDFs:"); ?></label>
                <div class="">
                    <input class="form-control" type='text' id='pdffontsize' name='pdffontsize'
                           value="<?php echo htmlspecialchars((string) Yii::app()->getConfig('pdffontsize')); ?>"/>
                </div>
            </div>
            <div class="mb-3">
                <label class=" form-label" for='pdflogowidth'><?php eT("Width of PDF header logo:"); ?></label>
                <div class="">
                    <input class="form-control" type='text' size='5' id='pdflogowidth' name='pdflogowidth'
                           value="<?php echo htmlspecialchars((string) Yii::app()->getConfig('pdflogowidth')); ?>"/>
                </div>
            </div>
            <div class="mb-3">
                <label class=" form-label" for='pdfheadertitle'><?php eT("PDF header title (if empty, site name will be used):"); ?></label>
                <div class="">
                    <input class="form-control" type='text' id='pdfheadertitle' size='50' maxlength='256' name='pdfheadertitle'
... (103 lines truncated)
</file>

<file path="application/views/admin/globalsettings/_security.php">
<?php
?>
<div class="container">
    <div class="row">
        <div class="col-6">
            <div class="mb-3">
                <label class=" form-label" for='surveyPreview_require_Auth'><?php eT("Survey preview only for administration users:"); ?></label>
                <div>
                    <?php $this->widget('ext.ButtonGroupWidget.ButtonGroupWidget', [
                        'name'          => 'surveyPreview_require_Auth',
                        'ariaLabel' => gT('Survey preview only for administration users:'),
                        'checkedOption' => App()->getConfig('surveyPreview_require_Auth'),
                        'selectOptions' => [
                            '1' => gT('On'),
                            '0' => gT('Off'),
                        ]
                    ]); ?>
                </div>
            </div>
            <div class="mb-3">
                <label class=" form-label" for='filterxsshtml'><?php eT("Filter HTML for XSS:");
                                                                echo ((Yii::app()->getConfig("demoMode") == true) ? '*' : ''); ?></label>
                <div>
                    <?php $this->widget('ext.ButtonGroupWidget.ButtonGroupWidget', [
                        'name'          => 'filterxsshtml',
                        'checkedOption' => App()->getConfig('filterxsshtml_forcedall') ? 1 : App()->getConfig('filterxsshtml'),
                        'ariaLabel' => gT('Filter HTML for XSS:'),
                        'selectOptions' => [
                            '1' => gT('On'),
                            '0' => gT('Off'),
... (244 lines truncated)
</file>

<file path="application/views/admin/globalsettings/_storage_ajax.php">
<?php
?>
<h2><?php eT('Overview'); ?></h2>
<table class='table table-striped table-bordered'>
    <caption class="visually-hidden">
        <?php eT("Storage overview"); ?>
    </caption>
    <tfoot>
        <tr>
            <td style='width: 70%;'><?php eT('Total storage'); ?></td>
            <td><?php echo $totalStorage; ?></td>
        </tr>
    </tfoot>
    <tbody>
        <tr>
            <td><?php eT('Survey storage'); ?></td>
            <td><?php echo $surveySize; ?></td>
        </tr>
        <tr>
            <td><?php eT('Themes storage'); ?></td>
            <td><?php echo $templateSize; ?></td>
        </tr>
        <tr>
            <td><?php eT('Label set storage'); ?></td>
            <td><?php echo $labelSize; ?></td>
        </tr>
    </tbody>
</table>
<?php if ($surveys) : ?>
    <h2><?php eT('Survey storage'); ?></h2>
... (42 lines truncated)
</file>

<file path="application/views/admin/globalsettings/_storage.php">
<?php
?>
<div class="container">
    <div class="ls-flex-column ls-space padding left-5 right-35 col-12">
        <div id='global-settings-storage' class="mb-3">
            <label class="form-label"  for='global-settings-calculate-storage'><?=gT("Recalculates the storage used by all your files in the upload folders")?></label>
            <div class="">
                <input type='hidden' name='global-settings-storage-url' value='<?php echo Yii::app()->createUrl('admin/globalsettings', array('sa' => 'getStorageData')); ?>' />
                <button id='global-settings-calculate-storage' class='btn btn-outline-secondary ' type="button" >
                    <i class="ri-settings-5-fill"></i>&nbsp;
                    <?php eT('Calculate storage');?>
</button>
                <br/>
                <span class='hint'>
                    <?php eT('Depending on the number of uploaded files, this might take some time.');?>
                </span>
            </div>
        </div>
        <div class="mb-3">
            <label class="form-label"  for='overwritefiles'><?php eT("Overwrite files with the same name when uploaded, moved or copied through the editor/file-manager?");?></label>
            <div>
                <?php $this->widget('ext.ButtonGroupWidget.ButtonGroupWidget', [
                    'name'          => 'overwritefiles',
                    'ariaLabel' => gT('Overwrite files with the same name when uploaded, moved or copied through the editor/file-manager?'),
                    'checkedOption' => App()->getConfig('overwritefiles') === 'Y' ? '1' : 0,
                    'selectOptions' => [
                        '1' => gT('On'),
                        '0' => gT('Off'),
                    ]
                ]); ?>
... (15 lines truncated)
</file>

<file path="application/views/admin/globalsettings/_updates.php">
<?php
?>
<?php $minimumUpdateStability = Yii::app()->getConfig('minimum_update_stability'); ?>
<div class="container">
    <div class="mb-3">
        <label class="form-label" for="minimum_update_stability">
            <?php eT("Minimum stability for update notifications:"); ?>
        </label>
        <div>
            <select class="form-select" id="minimum_update_stability" name="minimum_update_stability">
                <option value="alpha" <?php echo ($minimumUpdateStability === 'alpha') ? 'selected' : ''; ?>>
                    <?php eT("Alpha"); ?>
                </option>
                <option value="beta" <?php echo ($minimumUpdateStability === 'beta') ? 'selected' : ''; ?>>
                    <?php eT("Beta"); ?>
                </option>
                <option value="rc" <?php echo ($minimumUpdateStability === 'rc') ? 'selected' : ''; ?>>
                    <?php eT("Release Candidate"); ?>
                </option>
                <option value="stable" <?php echo ($minimumUpdateStability === 'stable') ? 'selected' : ''; ?>>
                    <?php eT("Stable"); ?>
                </option>
            </select>
        </div>
        <div class="form-text">
            <?php eT("Choose the minimum stability level for which update notifications should be shown. 'Alpha' will show all updates, 'Stable' will only show stable releases."); ?>
        </div>
    </div>
</div>
</file>

<file path="application/views/admin/globalsettings/_useradministration.php">
<?php
?>
<div class="container">
    <div class="row">
        <div class="col-6">
            <div class="mb-3">
                <label class="form-label" for='sendadmincreationemail'><?php eT("Send email to new user administrators:"); ?></label>
                <div>
                    <?php $this->widget('ext.ButtonGroupWidget.ButtonGroupWidget', [
                        'name'          => 'sendadmincreationemail',
                        'ariaLabel' => gT('Send email to new user administrators:'),
                        'checkedOption' => $sSendAdminCreationEmail ?? 0,
                        'selectOptions' => [
                            '1' => gT('On'),
                            '0' => gT('Off'),
                        ],
                        'htmlOptions'   => [
                            'class'        => 'custom-data',
                        ]
                    ]); ?>
                </div>
            </div>
            <div class="mb-3">
                <label class="form-label" for='admincreationemailsubject'><?php eT("Admin creation email subject"); ?>:</label>
                <br/>
                <small id="template help" class="form-text text-muted"><?php eT("Available placeholders") ?>: {SITENAME}</small>
                <input class="form-control" type='text' size='50' id='admincreationemailsubject' name='admincreationemailsubject' value="<?php echo htmlspecialchars((string) $sAdminCreationEmailSubject); ?>" />
            </div>
            <!-- admin default email template -->
            <div class="mb-3">
... (14 lines truncated)
</file>

<file path="application/views/admin/globalsettings/globalSettings_view.php">
<?php
echo viewHelper::getViewTestTag('globalsettings');
?>
<script type="text/javascript">
    var msgCantRemoveDefaultLanguage = '<?php eT("You can't remove the default language.", 'js'); ?>';
    var msgEmailPluginRequired = '<?php eT("Email method 'Plugin' requires a plugin to be selected.", 'js'); ?>';
</script>
<div class="welcome full-page-wrapper ls-space margin left-15 right-15">
    <ul class="nav nav-tabs" id="settingTabs">
        <li role="presentation" class="nav-item"><a class="nav-link active" role="tab" data-bs-toggle="tab" href='#overview'><?php eT("Overview"); ?></a></li>
        <li role="presentation" class="nav-item"><a class="nav-link" role="tab" data-bs-toggle="tab" href='#general'><?php eT("General"); ?></a></li>
        <li role="presentation" class="nav-item"><a class="nav-link" role="tab" data-bs-toggle="tab" href='#email'><?php eT("Email settings"); ?></a></li>
        <li role="presentation" class="nav-item"><a class="nav-link" role="tab" data-bs-toggle="tab" href='#bounce'><?php eT("Bounce settings"); ?></a></li>
        <li role="presentation" class="nav-item"><a class="nav-link" role="tab" data-bs-toggle="tab" href='#security'><?php eT("Security"); ?></a></li>
        <li role="presentation" class="nav-item"><a class="nav-link" role="tab" data-bs-toggle="tab" href='#useradmin'><?php eT("User administration"); ?></a></li>
        <li role="presentation" class="nav-item"><a class="nav-link" role="tab" data-bs-toggle="tab" href='#presentation'><?php eT("Presentation"); ?></a></li>
        <li role="presentation" class="nav-item"><a class="nav-link" role="tab" data-bs-toggle="tab" href='#language'><?php eT("Language"); ?></a></li>
        <li role="presentation" class="nav-item"><a class="nav-link" role="tab" data-bs-toggle="tab" href='#interfaces'><?php eT("Interfaces"); ?></a></li>
        <li role="presentation" class="nav-item"><a class="nav-link" role="tab" data-bs-toggle="tab" href='#storage'><?php eT("Storage"); ?></a></li>
    </ul>
    <?php echo CHtml::form(["admin/globalsettings"], 'post', ['class' => '', 'id' => 'frmglobalsettings', 'name' => 'frmglobalsettings', 'autocomplete' => 'off']); ?>
    <div class="tab-content">
        <div id="overview" class="tab-pane show active col-lg-6 offset-lg-1">
            <?php $this->renderPartial(
                "./globalsettings/_overview",
                [
                    'usercount'          => $usercount,
                    'surveycount'        => $surveycount,
                    'activesurveycount'  => $activesurveycount,
                    'deactivatedsurveys' => $deactivatedsurveys,
... (63 lines truncated)
</file>

<file path="application/views/admin/globalsettings/surveySettings.php">
<?php
Yii::app()->getClientScript()->registerScript(
    'GlobalSurveySettings',
    "window.GlobalSideMenuData = " . json_encode($jsData) . ";",
    LSYii_ClientScript::POS_BEGIN
);
$optionsOnOff = array(
    'Y' => gT('On', 'unescaped'),
    'N' => gT('Off', 'unescaped'),
);
?>
<div class="position-relative">
    <?php echo CHtml::form(array("admin/globalsettings/sa/surveysettings"), 'post', array('id' => 'survey-settings-form')); ?>
    <div class="d-flex flex-wrap flex-lg-nowrap" id="surveySettingsForThisGroup">
        <div class="" id="global-sidebar-container">
            <ul class="nav nav-tabs" role="tablist">
                <li class="nav-item"><a class="nav-link active" href="#sidebar" aria-controls="sidebar" role="tab" data-bs-toggle="tab" aria-selected="true"><?php eT("Settings") ?></a></li>
            </ul>
            <div class="tab-content pt-0 h-100">
                <global-sidemenu/>
             </div>
        </div>
        <div id="pjax-content" class="tab-content col-lg-12 flex-lg-shrink-1 ps-4">
            <div class="row">
                <div class="col-12">
                    <?php
                    $this->widget('ext.AlertWidget.AlertWidget', [
                        'text' => gT('All changes of global survey settings will immediately affect all related survey groups and surveys that use inherited values.'),
                        'type' => 'info',
                        'htmlOptions' => ['class' => 'controls']
... (95 lines truncated)
</file>

<file path="application/views/admin/htmleditor/modal_editor_partial.php">
<div id="htmleditor-modal" class="modal fade" role="dialog" aria-labelledby="htmleditor-modal-title" aria-modal="true" tabindex="-1">
    <div class="modal-dialog">
        <div class="modal-content">
            <?php
            Yii::app()->getController()->renderPartial(
                '/layouts/partial_modals/modal_header',
                ['modalTitle' => gT('Editor'), 'modalTitleId' => 'htmleditor-modal-title']
            );
            ?>
            <div class="modal-body">
                <textarea id='htmleditor-modal-textarea' name='htmleditor-modal-textarea' rows='5'></textarea>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-cancel" data-bs-dismiss="modal"><?php eT("Cancel"); ?></button>
                <button type="button" class="btn btn-primary" id="htmleditor-modal-save">
                    <?php eT("Confirm"); ?>
                </button>
            </div>
        </div>
    </div>
</div>
</file>

<file path="application/views/admin/htmleditor/pop_editor_view.php">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html>
    <head>
        <title><?php printf(gT('Editing %s'), CHtml::encode($sFieldText)); ?></title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta name="robots" content="noindex, nofollow" />
        <?php
            App()->getClientScript()->registerPackage('jqueryui');
            App()->getClientScript()->registerPackage('ckeditor');
            App()->getClientScript()->registerPackage('ckeditoradditions');
            App()->getClientScript()->registerCssFile(Yii::app()->getConfig('publicstyleurl') . 'jquery-ui.css');
        ?>
        <!--<script type="text/javascript" src="<?php echo Yii::app()->getConfig('sCKEditorURL') . '/ckeditor.js'; ?>"></script>-->
    </head>
    <body>
        <?php echo CHtml::form('', 'post', array('onsubmit' => 'saveChanges=true;'));?>
            <script type='text/javascript'>
                <!--
                function closeme()
                {
                    self.close();
                }
                window.onbeforeunload= function (evt) {
                    close_editor();
                    closeme();
                }
                var saveChanges = false;
                var sReplacementFieldTitle = '<?php eT('Placeholder fields', 'js');?>';
                var sReplacementFieldButton = '<?php eT('Insert/edit placeholder field', 'js');?>';
                $(document).on('ready pjax:scriptcomplete', function(){
... (74 lines truncated)
</file>

<file path="application/views/admin/htmleditor/pop_nofields_view.php">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html>
    <head>
        <title>LimeSurvey <?php eT('HTML editor'); ?></title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta name="robots" content="noindex, nofollow" />
        <?php
            App()->getClientScript()->registerPackage('jqueryui');
            App()->getClientScript()->registerCssFile(Yii::app()->getConfig('publicstyleurl') . 'jquery-ui.css');
        ?>
    </head>
    <body>
        <div class="maintitle">
            LimeSurvey <?php eT('HTML editor'); ?>
        </div>
        <hr />
        <table>
            <tr>
                <td align="center">
                    <br />
                    <span style="color:red;"><strong></strong></span>
                    <br />
                </td>
            </tr>
        </table>
        <form onsubmit="self.close()">
            <input type="submit" value="<?php eT('Close editor'); ?>" />
        </form>
    </body>
</html>
... (1 lines truncated)
</file>

<file path="application/views/admin/labels/partials/topbarBtns/leftSideButtons.php">
<?php
if ($hasPermissionCreate) {
    $this->widget(
        'ext.ButtonWidget.ButtonWidget',
        [
            'name' => 'create-import-button',
            'id' => 'create-import-button',
            'text' => gT('Create or import new label set(s)'),
            'icon' => 'icon-add',
            'link' => $this->createUrl("admin/labels/sa/newlabelset"),
            'htmlOptions' => [
                'class' => 'btn btn-outline-secondary',
                'role' => 'button'
            ],
        ]
    );
}
</file>

<file path="application/views/admin/labels/partials/topbarBtns/rightSideButtons.php">
<?php
if ($hasPermissionExport) {
    $this->widget(
        'ext.ButtonWidget.ButtonWidget',
        [
            'name' => 'exportButton',
            'id' => 'exportButton',
            'text' => gT('Export multiple label sets'),
            'icon' => 'ri-upload-2-fill',
            'link' => $this->createUrl("admin/labels/sa/exportmulti"),
            'htmlOptions' => [
                'class' => 'btn btn-outline-secondary',
                'role' => 'button'
            ],
        ]
    );
}
</file>

<file path="application/views/admin/labels/partials/topbarBtns_export/rightSideButtons.php">
<?php
$this->widget(
    'ext.ButtonWidget.ButtonWidget',
    [
        'name' => 'back-button',
        'id' => 'back-button',
        'text' => gT('Close'),
        'icon' => 'ri-close-fill',
        'link' => $this->createUrl("admin/labels/sa/view"),
        'htmlOptions' => [
            'class' => 'btn btn-outline-secondary',
            'role' => 'button'
        ],
    ]
);
$this->widget(
    'ext.ButtonWidget.ButtonWidget',
    [
        'name' => 'save-form-button',
        'id' => 'save-form-button',
        'text' => gT('Export'),
        'icon' => 'ri-check-fill',
        'htmlOptions' => [
            'class' => 'btn btn-primary',
            'role' => 'button',
            'data-form-id' => 'exportlabelset'
        ],
    ]
);
</file>

<file path="application/views/admin/labels/partials/topbarBtns_newimport/rightSideButtons.php">
<?php
$this->widget(
    'ext.ButtonWidget.ButtonWidget',
    [
        'name' => 'save-form-button',
        'id' => 'save-form-button',
        'text' => gT('Save'),
        'icon' => 'ri-check-fill',
        'htmlOptions' => [
            'class' => 'btn btn-primary',
            'role' => 'button',
            'data-form-id' => 'labelsetform'
        ],
    ]
);
</file>

<file path="application/views/admin/labels/partials/topbarBtns_singlelabelset/leftSideButtons.php">
<?php
if ($hasUpdatePermission) {
    $this->widget(
        'ext.ButtonWidget.ButtonWidget',
        [
            'name' => 'create-import-button',
            'id' => 'edit-button',
            'text' => gT('Edit label set'),
            'icon' => 'ri-pencil-fill',
            'link' => $this->createUrl("admin/labels/sa/editlabelset/lid/" . $lid),
            'htmlOptions' => [
                'class' => 'btn btn-outline-secondary',
            ],
        ]
    );
}
$this->widget(
    'ext.ButtonWidget.ButtonWidget',
    [
        'name' => 'export-button',
        'id' => 'export-button',
        'text' => gT('Export this label set'),
        'icon' => 'ri-upload-2-fill',
        'link' => $this->createUrl("admin/export/sa/dumplabel/lid/$lid"),
        'htmlOptions' => [
            'class' => 'btn btn-outline-secondary',
            'role' => 'button'
        ],
    ]
);
... (24 lines truncated)
</file>

<file path="application/views/admin/labels/partials/topbarBtns_singlelabelset/rightSideButtons.php">
<?php
$this->widget(
    'ext.ButtonWidget.ButtonWidget',
    [
        'name' => 'create-import-button',
        'id' => 'create-import-button',
        'text' => gT('Close'),
        'icon' => 'ri-close-fill',
        'link' => Yii::app()->request->getUrlReferrer(Yii::app()->createUrl('admin/labels/sa/view')),
        'htmlOptions' => [
            'class' => 'btn btn-outline-secondary',
        ],
    ]
);
$this->widget(
    'ext.ButtonWidget.ButtonWidget',
    [
        'name' => 'save-and-close-form-button',
        'id' => 'save-and-close-form-button',
        'text' => gT('Save and close'),
        'icon' => 'ri-check-fill',
        'link' => $this->createUrl("Save and close"),
        'htmlOptions' => [
            'class' => 'btn btn-outline-secondary',
            'type' => 'button',
            'data-form-id' => 'mainform',
            'onclick' => "$(this).addClass('disabled').attr('onclick', 'return false;');"
        ],
    ]
);
... (15 lines truncated)
</file>

<file path="application/views/admin/labels/_labelviewquickadd_view.php">
<div class="modal fade" tabindex="-1" role="dialog" id='quickadd'>
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <h2 class="modal-title h5"><?php eT('Enter your labels:') ?></h2>
        <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="<?php eT('Close') ?>"></button>
      </div>
      <div class="modal-body row">
          <p><?php eT('Enter one label per line. You can provide a code by separating code and label text with a semicolon or tab. For multilingual surveys you add the translation(s) on the same line separated with a semicolon or tab.') ?></p>
          <textarea id='quickaddarea' name='quickaddarea' class='tipme' title='<?php eT('Enter one label per line. You can provide a code by separating code and label text with a semicolon or tab. For multilingual surveys you add the translation(s) on the same line separated with a semicolon or tab.') ?>' rows='10' cols='100' style='width:570px;'></textarea>
      </div>
      <div class="modal-footer">
          <button id='btnqacancel' type='button' class="btn btn-cancel"  data-bs-dismiss="modal"><?php eT('Cancel') ?></button>
          <button id='btnqareplace' type='button' class="btn btn-outline-secondary"><?php eT('Replace') ?></button>
          <button role="button" id='btnqainsert' type='button' class="btn btn-primary">
            <?php eT('Add') ?>
          </button>
      </div>
    </div><!-- /.modal-content -->
  </div><!-- /.modal-dialog -->
</div><!-- /.modal -->
</file>

<file path="application/views/admin/labels/_labelviewrightcontent_view.php">
<div class="row">
  <div class="col-6 offset-3 text-center mt-4">
    <div id="accordion">
      <div class="card card-primary" id="up_resmgmt">
        <!-- Uploaded resources management -->
        <div class="card-header" id="headingOne">
          <div class="">
            <a role="button" data-bs-toggle="collapse" data-parent="#accordion" href="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
              <?php eT("Uploaded resources management"); ?>
            </a>
          </div>
        </div>
        <!-- headingOne -->
        <!-- Body -->
        <div id="collapseOne" class="panel-collapse collapse show" role="tabpanel" aria-labelledby="headingOne">
          <div class="card-body">
            <div id="upload-form-container">
              <!-- Form browselabelresources -->
              <?php echo CHtml::form(Yii::app()->baseUrl . '/assets/packages/kcfinder/browse.php?language=' . sTranslateLangCode2CK(App()->language), 'get', array('id' => 'browselabelresources','class' => 'form30','name' => 'browselabelresources','target' => '_blank')); ?>
                  <!-- Browse uploaded resources -->
                    <div class="row mb-2">
                        <div class="col-8 offset-2">
                            <?php echo CHtml::dropDownList('type', 'files', array('files' => gT('Files', 'unescaped'), 'images' => gT('Images', 'unescaped')), array('class' => 'form-select')); ?>
                        </div>
                    </div>
                <div class="row mb-2">
                    <div class="">
                      <input type='submit' class="btn btn-outline-secondary" value="<?php eT("Browse uploaded resources") ?>" />
                    </div>
                </div>
... (81 lines truncated)
</file>

<file path="application/views/admin/labels/_labelviewtabcontent_view.php">
<?php
$i = 0;
$first = true;
$sortorderids = '';
$codeids = '';
?>
<div class="tab-content">
    <?php foreach ($lslanguages as $lslanguage) : ?>
        <div id="neweditlblset<?php echo (int) $i ?>"
             class="table-responsive tab-pane lang-<?= $lslanguage ?> <?= $i === 0 ? "active show first" : "not_first" ?>"
             role="tabpanel"
             aria-labelledby="labelview-lang-tab-<?php echo (int) $i ?>">
            <input type='hidden' class='lslanguage' value='<?= $lslanguage ?>' <?= $i === 0 ? 'id="lslanguagemain"' : '' ?>/>
            <table class='answertable table table-hover'>
                <caption class="sr-only">
                    <?php echo sprintf(gT("Labels for language: %s"), getLanguageNameFromCode($lslanguage, false)) ?>
                </caption>
                <thead>
                <tr>
                    <?php if ($first) : ?>
                        <th><?php eT('Position'); ?></th>
                    <?php endif; ?>
                    <th><?php eT("Code") ?></th>
                    <th><?php eT("Assessment value") ?></th>
                    <th><?php eT("Title") ?></th>
                    <th><?php eT("Action") ?></th>
                </tr>
                </thead>
                <tbody>
                <?php $position = 0;
... (40 lines truncated)
</file>

<file path="application/views/admin/labels/editlabel_view.php">
<?php
?>
<script type="text/javascript">
    var sImageURL = '';
    var duplicatelabelcode = '<?php eT('Error: You are trying to use duplicate label codes.', 'js'); ?>';
    var otherisreserved = '<?php eT("Error: 'other' is a reserved keyword.", 'js'); ?>';
    var quickaddtitle = '<?php eT('Quick-add subquestion or answer items', 'js'); ?>';
</script>
<div class="col-12 list-surveys">
    <?= // DO NOT REMOVE This is for automated testing to validate we see that page
    viewHelper::getViewTestTag('createLabelSets') ?>
    <div class="row">
        <div class="col-12 content-right">
            <!-- Tabs -->
            <ul class="nav nav-tabs" id="edit-survey-text-element-language-selection" role="tablist" aria-label="<?= gT('Label set') ?>">
                <li class="nav-item" role="presentation">
                    <a class="nav-link active"
                       id="editlabel-tab-0"
                       href="#neweditlblset0"
                       role="tab"
                       data-bs-toggle="tab"
                       aria-controls="neweditlblset0"
                       aria-selected="true">
                        <?php echo $tabitem; ?>
                    </a>
                </li>
                <?php if ($action === "newlabelset" && Permission::model()->hasGlobalPermission('labelsets', 'import')): ?>
                    <li class="nav-item" role="presentation">
                        <a class="nav-link"
                           id="editlabel-tab-1"
... (105 lines truncated)
</file>

<file path="application/views/admin/labels/exportmulti_view.php">
<?php
?>
<script type='text/javascript'>
    var strSelectLabelset = '<?php eT('You have to select at least one label set.', 'js');?>';
</script>
<div class="col-12 list-surveys">
    <div class="row">
        <div class="col-12 content-right text-center">
            <?php echo CHtml::form(["admin/export/sa/dumplabel"], 'post', ['id' => 'exportlabelset', 'class' => '']); ?>
            <div class="mb-3 row">
                <label class="col-md-3 form-form-label" for='labelsets'>
                    <?php eT('Please choose the label sets you want to export:'); ?>
                    <br/>
                    <?php eT('(Select multiple label sets by using the Ctrl key)'); ?>
                </label>
                <div class="col-md-3">
                    <select id='labelsets' multiple='multiple' name='lids[]' size='20' class="form-select">
                        <?php if (count($labelsets) > 0) {
                            foreach ($labelsets as $lb) {
                                echo "<option value='{$lb[0]}'>{$lb[0]}: " . CHtml::encode($lb[1]) . "</option>\n";
                            }
                        } ?>
                    </select>
                </div>
                <p>
                    <br/>
                    <input type='submit' id='btnDumpLabelSets' value='<?php eT('Export selected label sets'); ?>' class="d-none"/>
                    <input type='hidden' name='action' value='dumplabel'/>
                    <?php $exportToken = 'labelExport_' . uniqid(mt_rand(), true); ?>
                    <input type="hidden" name="export_token" value="<?php echo CHtml::encode($exportToken); ?>">
... (27 lines truncated)
</file>

<file path="application/views/admin/labels/import_view.php">
<?php if (isset($aImportResults['fatalerror'])) :?>
    <div class="jumbotron message-box message-box-error">
            <h2 class="text-danger"><?php eT("Import label set(s)") ?></h2>
            <p class="lead text-danger"><?php eT("Error") ?></p>
            <p><?php echo $aImportResults['fatalerror']; ?></p>
            <p>
                <a class="btn btn-lg btn-primary" href="<?php echo $this->createUrl("admin/labels/sa/view"); ?>" role="button">
                    <?php eT("Return to label set administration"); ?>
                </a>
            </p>
    </div>
<?php else :?>
    <div class="jumbotron message-box">
            <h2 class="text-success"><?php eT("Import label set(s)") ?></h2>
            <p class="lead"><?php eT("File upload succeeded.") ?></p>
            <?php if (count($aImportResults['warnings']) > 0) : ?>
                <p  class="lead text-danger">
                    <?php eT("Warnings") ?>
                </p>
                <p>
                    <ul class="list-unstyled">
                        <?php foreach ($aImportResults['warnings'] as $warning) :?>
                            <li><?php echo $warning ?></li>
                        <?php endforeach;?>
                    </ul>
                </p>
            <?php endif;?>
            <p  class="lead text-success">
                <?php eT("Label set import summary") ?>
            </p>
... (17 lines truncated)
</file>

<file path="application/views/admin/labels/importlabelresources_view.php">
<div class="jumbotron message-box">
<h2 class="text-success"><?php eT("Import label set resources") ?></h2>
<p class="lead text-success"><?php eT("Success") ?></p>
<?php
    $ImportListHeader = '';
if (!count($aErrorFilesInfo) && count($aImportedFilesInfo)) {
    $status = gT("Success");
    $statusClass = 'successheader';
    $okfiles = count($aImportedFilesInfo);
    $errfiles = 0;
    $ImportListHeader .= "<br /><strong><u>" . gT("Imported files list:") . "</u></strong><br />\n";
    $ErrorListHeader = '';
} elseif (count($aErrorFilesInfo) && count($aImportedFilesInfo)) {
    $status = gT("Partial import");
    $statusClass = 'partialheader';
    $okfiles = count($aImportedFilesInfo);
    $errfiles = count($aErrorFilesInfo);
    $ErrorListHeader = "<br /><strong><u>" . gT("Error files list:") . "</u></strong><br />\n";
    $ImportListHeader .= "<br /><strong><u>" . gT("Imported files list:") . "</u></strong><br />\n";
} else {
    $okfiles = 0;
    $status = gT("Error");
    $statusClass = 'warningheader';
    $errfiles = count($aErrorFilesInfo);
    $ImportListHeader = '';
    $ErrorListHeader = "<br /><strong><u>" . gT("Error files list:") . "</u></strong><br />\n";
}
?>
    <p><strong><?php printf(gT("Imported resources for label ID %s"), $lid); ?></strong><br /><br /></p>
    <p class="<?php echo $statusClass ?>"><?php echo $status ?></p><br />
... (34 lines truncated)
</file>

<file path="application/views/admin/labels/labelRow.twig">
{#
 /**
 * Label row view (for Label Set editor)
 *
 * @var bool $first
 * @var string $language
 * @var string $rowId
 * @var string $code
 * @var int $assessmentValue
 * @var string $title
 * @var bool $hasLabelSetUpdatePermission
 */
#}
<tr class="labelDatas" style='white-space: nowrap;' id='row_{{ language }}_{{ rowId }}'>
    {% if not first %}
        <td>{{ code|escape }}</td>
        <td>{{ assessmentValue }}</td>
    {% else %}
        <td>
            <span class="ri-menu-fill bigIcons"></span>
        </td>

        <td>
            <input type='hidden' class='hiddencode' value='{{ code|escape }}'/>
            <input type='text' class='codeval  form-control  ' id='code_{{ rowId }}' name='code_{{ rowId }}' maxlength='20' size='20' value='{{ code|escape }}'/>
        </td>

        <td>
            <input type="number" class='assessmentval  form-control  ' id='assessmentvalue_{{ rowId }}' style='text-align: right;' name='assessmentvalue_{{ rowId }}' maxlength='5' size='6' value='{{ assessmentValue }}'/>
        </td>
... (29 lines truncated)
</file>

<file path="application/views/admin/labels/labelsets_view.php">
<?php
echo viewHelper::getViewTestTag('viewLabelSets');
?>
<?php $pageSize = Yii::app()->user->getState('pageSize', Yii::app()->params['defaultPageSize']); ?>
<div class="row">
    <div class="col-12 content-right">
        <?php
        $this->widget(
            'application.extensions.admin.grid.CLSGridView',
            [
                'dataProvider' => $model->search(),
                'id' => 'labelsets-grid',
                'emptyText' => gT('No label sets found.'),
                'ajaxUpdate' => 'labelsets-grid',
                'lsPageSizeCurrentValue' => $pageSize,
                'columns' => [
                    [
                        'header' => gT('Label set ID'),
                        'name' => 'labelset_id',
                        'value' => '$data->lid',
                        'htmlOptions' => ['class' => ''],
                    ],
                    [
                        'header' => gT('Name'),
                        'name' => 'name',
                        'value' => '$data->label_name',
                        'htmlOptions' => ['class' => ''],
                    ],
                    [
                        'header' => gT('Languages'),
... (33 lines truncated)
</file>

<file path="application/views/admin/labels/labelview_view.php">
<script type='text/javascript'>
    var duplicatelabelcode = '<?php eT('Error: You are trying to use duplicate label codes.', 'js'); ?>';
    var otherisreserved = '<?php eT("Error: 'other' is a reserved keyword.", 'js'); ?>';
</script>
<!-- quick add popup -->
<?php $this->renderPartial("./labels/_labelviewquickadd_view", []); ?>
<div class="col-12 labels">
    <h2 class="pagetitle h3">
        <?php eT("Labels") ?>
        <?php if (isset($model->label_name)) : ?>
            - <?php echo CHtml::encode($model->label_name); ?>
        <?php endif; ?>
    </h2>
    <!-- Main content -->
    <div class="col-12 content-right text-center">
        <!-- tabs -->
        <ul class="nav nav-tabs" role="tablist" aria-label="<?= gT('Languages') ?>">
            <?php foreach ($lslanguages as $i => $language) : ?>
                <li class="nav-item" role="presentation">
                    <a class="nav-link <?= $i === 0 ? 'active' : '' ?>"
                       id="labelview-lang-tab-<?= (int) $i ?>"
                       href="#neweditlblset<?= (int) $i ?>"
                       role="tab"
                       data-bs-toggle="tab"
                       aria-controls="neweditlblset<?= (int) $i ?>"
                       aria-selected="<?= $i === 0 ? 'true' : 'false' ?>">
                        <?php echo getLanguageNameFromCode($language, false); ?>
                    </a>
                </li>
            <?php endforeach; ?>
... (24 lines truncated)
</file>

<file path="application/views/admin/notification/index.php">
<?php
?>
<!-- List all notifications -->
<div class="welcome full-page-wrapper">
    <div class="pagetitle h3"><?php eT('Notifications'); ?></div>
    <?php
    $surveyGrid = $this->widget('application.extensions.admin.grid.CLSGridView', [
        'dataProvider' => $model->search(),
        'id'           => 'notification-grid',
        'emptyText'    => gT('No notifications found'),
        'htmlOptions'  => ['class' => 'table-responsive grid-view-ls'],
        'ajaxUpdate'   => 'notification-grid',
        'columns'      => [
            [
                'header' => 'ID',
                'name'   => 'id'
            ],
            [
                'header' => gT('Title'),
                'name'   => 'title'
            ],
            [
                'header' => gT('Message'),
                'name'   => 'message'
            ]
        ]
    ]);
    ?>
</div>
</file>

<file path="application/views/admin/notifications/notifications.php">
<?php
$alertTypes = ['success', 'primary', 'secondary', 'danger', 'error', 'warning', 'info', 'light', 'dark'];
?>
<div class="row">
    <div id="notif-container" class="col-12 content-right">
        <?php
        foreach ($aMessage as $message) : ?>
            <?php
            if (isset($message['type']) && in_array($message['type'], $alertTypes)) {
                $alertType = $message['type'];
                if ($alertType == 'error') {
                    $alertType = 'danger';
                }
            } else {
                $alertType = 'success';
            }
            $this->widget('ext.AlertWidget.AlertWidget', [
                    'text' => $message['message'],
                    'type' => $alertType,
                    'isFilled' => false,
                    'showCloseButton' => true,
                    'htmlOptions' => [
                        'class' => 'non-ajax-alert',
                        'tabindex' => '-1',
                    ],
                ]);
            ?>
            <?php
        endforeach; ?>
    </div>
... (2 lines truncated)
</file>

<file path="application/views/admin/participants/massive_actions/_selector_attribute.php">
<!-- Rendering massive action widget for CPDB attribute list -->
<?php
$this->widget('ext.admin.grid.MassiveActionsWidget.MassiveActionsWidget', array(
    'pk'          => 'selectedAttributeNames',
    'gridid'      => 'list_attributes',
    'dropupId'    => 'tokenListActions',
    'dropUpText'  => gT('Selected attribute(s)...'),
    'aActions'    => array(
        array(
            'type'        => 'action',
            'action'      => 'delete',
            'url'         =>  App()->createUrl('/admin/participants/sa/deleteAttributes'),
            'iconClasses' => 'ri-delete-bin-fill text-danger',
            'text'        =>  gT('Delete'),
            'grid-reload' => 'yes',
            'on-success'  => 'LS.AjaxHelper.onSuccess',
            'actionType'    => 'modal',
            'modalType'     => 'cancel-delete',
            'keepopen'      => 'no',
            'sModalTitle'   => gT('Delete'),
            'htmlModalBody' => gT('Do you really want to delete this attribute?'),
            'aCustomDatas'  => array()
        ),
    )
));
?>
</file>

<file path="application/views/admin/participants/massive_actions/_selector_share.php">
<!-- Rendering massive action widget for CPDB share panel -->
<?php
$this->widget('ext.admin.grid.MassiveActionsWidget.MassiveActionsWidget', array(
    'pk'          => 'selectedParticipantShare',
    'gridid'      => 'share_central_participants',
    'dropupId'    => 'tokenListActions',
    'dropUpText'  => gT('Selected participant share(s)...'),
    'aActions'    => array(
        array(
            'type'        => 'action',
            'action'      => 'delete',
            'url'         =>  App()->createUrl('/admin/participants/sa/deleteMultipleParticipantShare/'),
            'iconClasses' => 'ri-delete-bin-fill text-danger',
            'text'        =>  gT('Delete'),
            'grid-reload' => 'yes',
            'on-success'  => 'LS.AjaxHelper.onSuccess',
            'actionType'    => 'modal',
            'modalType'     => 'cancel-delete',
            'keepopen'      => 'no',
            'sModalTitle'   => gT('Unshare participant'),
            'htmlModalBody' => gT('Do you really want to delete the sharing of this participant?'),
            'aCustomDatas'  => array()
        ),
    )
));
?>
</file>

<file path="application/views/admin/participants/massive_actions/_selector.php">
<!-- Rendering massive action widget -->
<?php
$this->widget('ext.admin.grid.MassiveActionsWidget.MassiveActionsWidget', array(
    'pk' => 'selectedParticipant',
    'gridid' => 'list_central_participants',
    'dropupId' => 'tokenListActions',
    'dropUpText' => gT('Selected participant(s)...'),
    'aActions' => Participant::model()->permissionCheckedActionsArray(
        [
            [
                'type' => 'action',
                'action' => 'delete',
                'url' => App()->createUrl('/admin/participants/sa/deleteParticipant/'),
                'iconClasses' => 'ri-delete-bin-fill text-danger',
                'text' => gT('Delete'),
                'grid-reload' => 'yes',
                'on-success' => 'LS.AjaxHelper.onSuccess',
                'actionType' => 'modal',
                'modalType' => 'cancel-delete',
                'keepopen' => 'no',
                'sModalTitle' => gT('Delete one or more participants...'),
                'htmlModalBody' =>
                    '<p>' . gT('Please choose one option.') . '</p>' .
                    '<select name="selectedoption" class="form-select post-value">
                    <option value="po" selected>' . gT("Delete only from the central panel") . '</option>
                    <option value="ptt">' . gT("Delete from the central panel and associated surveys") . '</option>
                    <option value="ptta">' . gT("Delete from central panel, associated surveys and all associated responses") . '</option>
                </select>',
                'htmlFooterButtons' => array(
                    '<a class="btn btn-ok btn-danger"><span class="ri-delete-bin-fill"></span>&nbsp;' . gT('Delete') . '</a>',
... (56 lines truncated)
</file>

<file path="application/views/admin/participants/massive_actions/_update_results.php">
<?php
?>
<?php if (!$aResults['global']['result']) :?>
    <strong>
        <?php echo $aResults['global']['message'] ;?>
    </strong>
<?php else : ?>
    <?php unset($aResults['global']); ?>
    <table class="table table-striped">
        <thead>
            <th><?php eT('Participant ID');?></th>
            <th><?php eT('Status');?></th>
        </thead>
        <tbody>
            <?php foreach ($aResults as $sParticipantToken => $result) :?>
                <tr>
                    <td>
                        <?php echo $sParticipantToken;?>
                    </td>
                    <?php if ($result['status'] === true) :?>
                        <td class="text-success">
                            <?php echo $result['message']; ?>
                        </td>
                    <?php else : ?>
                        <td class="text-danger">
                            <?php echo $result['message']; ?>
                        </td>
                    <?php endif;?>
                </tr>
            <?php endforeach;?>
... (4 lines truncated)
</file>

<file path="application/views/admin/participants/massive_actions/_update.php">
<?php
?>
<?php
    $model = Participant::model();
?>
<form class="custom-modal-datas form form-horizontal">
	<div class="container-fluid">
        <fieldset class="mb-0" aria-labelledby="massedit-modify-legend">
            <legend id="massedit-modify-legend" class="visually-hidden">
                <?php eT("Modify"); ?>
            </legend>
            <div class="ex-form-group mb-3">
                <div class="col-md-1">
                    <span id="massedit-modify-group-label" class="form-label"><?php eT("Modify"); ?></span>
                </div>
                <div class="col-md-11"></div>
            </div>
            <?php
            if (
                Permission::model()->hasGlobalPermission('superadmin', 'read')
                || $this->user_id == Yii::app()->session['loginID']
                || (Permission::model()->hasGlobalPermission('users', 'update')
                    && $this->parent_id == Yii::app()->session['loginID']
                )
            ) {
                ?>
                <div class="ex-form-group mb-3">
                    <div class="col-md-1">
                        <input type="checkbox" id="massedit_owner_uid_modify" class="action_check_to_keep_old_value"
                               aria-labelledby="massedit-modify-group-label massedit_owner_uid_fieldlabel"/>
... (64 lines truncated)
</file>

<file path="application/views/admin/participants/modal_subviews/attributes/date.php">
<?php
$name = CHtml::encode($name);
$localizedname = CHtml::encode($localizedname);
$elementId = 'Attributes_' . $name;
$inputName = "Attributes[$name]";
?>
<div class="mb-3">
    <label class="form-label" for="<?=CHtml::encode($elementId)?>"><?php echo $localizedname; ?></label>
    <?php
    $dateFormatDetails = getDateFormatData(App()->session['dateformat']);
    App()->getController()->widget('ext.DateTimePickerWidget.DateTimePicker', [
            'name' => $inputName,
            'id' => $elementId,
            'value' => $value ?? '',
            'pluginOptions' => [
                    'format' => $dateFormatDetails['jsdate'],
                    'allowInputToggle' => true,
                    'theme' => 'light',
                    'locale' => convertLStoDateTimePickerLocale(
                        App()->session['adminlang']
                    )
            ]
    ]);
    ?>
    <script>
        $(document).ready(function() {
            var element = document.getElementById('<?= $elementId ?>');
            if (element && element.closest('.modal')) {
                initDatePicker(element, '<?= convertLStoDateTimePickerLocale(App()->session['adminlang']) ?>', '<?= $dateFormatDetails['jsdate'] ?>');
            }
... (4 lines truncated)
</file>

<file path="application/views/admin/participants/modal_subviews/attributes/dropdown.php">
<?php $selectId = 'Attributes_' . CHtml::encode($name); ?>
<label id="<?= $selectId ?>_label" class="form-label" for="<?= $selectId ?>"><?= CHtml::encode($localizedname) ?></label>
<div class='mb-3'>
    <select class="form-select" name="Attributes[<?= CHtml::encode($name) ?>]" id="<?= $selectId ?>">
        <option></option>  <!-- Nothing selected -->
        <?php foreach ($options as $option): ?>
            <option
                <?= $option['value'] == $value ? 'selected' : '' ?>
                value='<?= CHtml::encode($option['value']) ?>'
            >
                <?= CHtml::encode($option['value']) ?>
            </option>
        <?php endforeach; ?>
    </select>
</div>
</file>

<file path="application/views/admin/participants/modal_subviews/attributes/textbox.php">
<div class="mb-3">
<label class="form-label" for="Attributes[<?=CHtml::encode($name); ?>]"><?php echo CHtml::encode($localizedname); ?></label>
<input class="form-control" name="Attributes[<?=CHtml::encode($name); ?>]" id="Attributes_<?=CHtml::encode($name); ?>" type="text" maxlength="254" value="<?=CHtml::encode($value); ?>">
</div>
</file>

<file path="application/views/admin/participants/modal_subviews/_addToSurvey.php">
<?php $this->beginWidget('CActiveForm', array(
    'action' => App()->createUrl('/admin/participants/sa/attributeMap'),
    ), 'post'); ?>
    <div class="modal-header">
        <h2 class="modal-title h5" id="participant_edit_modal"><?php echo ngT('Add participant to survey|Add participants to survey', $count); ?></h2>
        <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
    </div>
    <div class="modal-body ">
        <div class='col-md-4'></div>
        <div class='col-md-8'>
            <p role="heading" aria-level="3"><?php echo ngT('Add the selected participant to survey.|Add the {n} selected participants to survey.', $count); ?></p>
        </div>
        <!-- Comma separated list -->
        <input type='hidden' name='participant_id' value='<?php echo $participant_id; ?>'/>
        <div class="row ls-space margin top-10 bottom-10">
            <div class='mb-3'>
                <label id="addToSurvey_survey_label" class='form-label col-md-4' for="addToSurvey_survey_id">
                    <?php eT('Survey'); ?>
                </label>
                <div class='col-md-8'>
                    <select name='survey_id' id="addToSurvey_survey_id" class='form-select' aria-labelledby="addToSurvey_survey_label">
                        <?php foreach ($surveys as $survey): ?>
                            <?php if ($hasGlobalPermission || Permission::model()->hasSurveyPermission($survey->sid, 'tokens', 'update')): ?>
                                <option value='<?php echo $survey->sid; ?>'><?php echo $survey->languagesettings[$survey->language]->surveyls_title; ?> (<?php echo $survey->sid; ?>)</option>
                            <?php endif; ?>
                        <?php endforeach; ?>
                    </select>
                </div>
            </div>
        </div>
... (27 lines truncated)
</file>

<file path="application/views/admin/participants/modal_subviews/_deleteParticipant.php">
<?php
Yii::app()->getController()->renderPartial(
    '/layouts/partial_modals/modal_header',
    ['modalTitle' => gT('Delete participant'), 'modalTitleId' => 'participant_edit_modal']
);
?>
<?php
$form = $this->beginWidget(
    'yiistrap_fork.widgets.TbActiveForm',
    array(
        'id' => 'deleteParticipantActiveForm',
        'action' => array('admin/participants/sa/editValueParticipantPanel'),
        'htmlOptions' => array('class' => ''), // for inset effect
    )
);
?>
<div class="modal-body ">
    <input type="hidden" name="actionTarget" value="deleteParticipant" />
    <input type="hidden" name="participant_id" value="<?php echo $model->participant_id; ?>" />
    <p><?php eT("Please choose one option."); ?></p>
    <select name='selectedoption' class="form-select" >
        <option value="po" selected><?php eT("Delete only from the central panel") ?></option>
        <option value="ptt"><?php eT("Delete from the central panel and associated surveys") ?></option>
        <option value="ptta"><?php eT("Delete from central panel, associated surveys and all associated responses") ?></option>
    </select>
</div>
<div class="modal-footer">
    <button type="button" class="btn btn-cancel" data-bs-dismiss="modal"><?php eT('Cancel') ?></button>
    <button type="button" class="btn btn-danger action_save_modal_deleteParticipant" data-bs-dismiss="modal">
        &nbsp;
... (7 lines truncated)
</file>

<file path="application/views/admin/participants/modal_subviews/_editAttribute.php">
<div class="modal-header">
    <h5 class="modal-title" id="participant_edit_modal"><?php if ($editType === 'new') : eT('Add attribute'); else: eT('Edit attribute'); endif; ?></h5>
    <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<?php
$form = $this->beginWidget(
    'yiistrap_fork.widgets.TbActiveForm',
    [
        'id'          => 'editAttributeNameActiveForm',
        'action'      => ['admin/participants/sa/editAttributeName'],
        'htmlOptions' => ['class' => ''], // for inset effect
    ]
);
?>
<div class="modal-body ">
    <input type="hidden" name="oper" value="<?= $editType ?>"/>
    <?php if ($editType === 'edit') : ?>
        <input type="hidden" id="ParticipantAttributeName_attribute_id" name="ParticipantAttributeName[attribute_id]" value="<?= $model->attribute_id ?>"/>
    <?php endif; ?>
    <fieldset>
        <legend><?= gT("Basic settings") ?></legend>
        <?php $baseControlGroupHtmlOptions = [
            'groupOptions' => ['class' => ''],
            'labelOptions' => ['class' => ''],
            'required'     => 'required'
        ]; ?>
        <?= $form->textFieldControlGroup($model, 'defaultname', $baseControlGroupHtmlOptions) ?>
        <?= $form->dropDownListControlGroup($model, 'attribute_type', $model->attributeTypeDropdownArray, array_merge($baseControlGroupHtmlOptions, ['class' => 'form-select'])) ?>
        <div class="ex-form-group mb-3" id="">
            <label class='form-label'><?php eT("Should this attribute be visible on the panel?"); ?></label>
... (238 lines truncated)
</file>

<file path="application/views/admin/participants/modal_subviews/_editParticipant.php">
<?php
if ($editType === 'add') {
    $modalTitle = gT('Add participant');
    $buttonTitle = gT('Add');
} else {
    $modalTitle = gT('Edit participant');
    $buttonTitle = gT('Save');
}
Yii::app()->getController()->renderPartial(
    '/layouts/partial_modals/modal_header',
    ['modalTitle' => $modalTitle, 'modalTitleId' => 'participant_edit_modal']
);
?>
<?php
$form = $this->beginWidget(
    'yiistrap_fork.widgets.TbActiveForm',
    [
        'id'          => 'editPartcipantActiveForm',
        'action'      => ['admin/participants/sa/editParticipant'],
        'htmlOptions' => ['class' => 'form'],
    ]
);
?>
<div class="modal-body edit-participant-modal-body ">
    <input type="hidden" name="oper" value="<?php echo $editType; ?>"/>
    <?= $form->hiddenField($model, 'participant_id') ?>
    <fieldset>
        <?php
        echo "<legend>" . gT("Basic attributes") . "</legend>";
        $baseControlGroupHtmlOptions = [
... (104 lines truncated)
</file>

<file path="application/views/admin/participants/modal_subviews/_exportCSV.php">
<div id="exportcsv" title="exportcsv" role="dialog" tabindex="-1" class="modal fade">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h2 class="modal-title h5"><?php eT("Export participants"); ?> </h2>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>
            <div class="modal-body">
                <div class="form">
                    <div class='mb-3 row'>
                        <div class="col-4">
                            <label class='form-label' id="export-csv-attributes-label" for='attributes'><?php eT('Attributes to export:');?></label>
                            <input type="checkbox" value="" id="select-all">
                            <label class="form-check-label" for="select-all">
                                <?= gT('Select all'); ?>
                            </label>
                        </div>
                        <div class='col-8' role="group" aria-labelledby="export-csv-attributes-label">
                            <?php $this->widget(
                                'yiiwheels.widgets.select2.WhSelect2',
                                array(
                                    'asDropDownList' => true,
                                    'htmlOptions' => [
                                        'multiple' => 'multiple',
                                        'id' => 'attributes',
                                        'aria-labelledby' => 'export-csv-attributes-label'
                                    ],
                                    'data' => array_combine(array_column($aAttributes, 'attribute_id'), array_column($aAttributes, 'defaultname')),
                                    'value' => null,
                                    'name' => 'attributes',
... (52 lines truncated)
</file>

<file path="application/views/admin/participants/modal_subviews/_shareParticipant.php">
<?php
Yii::app()->getController()->renderPartial(
'/layouts/partial_modals/modal_header',
['modalTitle' => gT('Share participant(s)'), 'modalTitleId' => 'participant_edit_modal']
);
?>
<?php
$form = $this->beginWidget(
    'yiistrap_fork.widgets.TbActiveForm',
    array(
        'id' => 'shareParticipantActiveForm',
        'action' => array('admin/participants/sa/shareParticipants'),
        'htmlOptions' => array('class' => 'form '),
    )
);
?>
<div class="modal-body ">
    <?php if (isset($participantIds)): ?>
        <?php foreach ($participantIds as $id): ?>
            <input type="hidden" name="participant_id[]" value="<?php echo CHtml::encode($id); ?>" />
        <?php endforeach;?>
    <?php else : ?>
        <input type="hidden" name="participant_id" value="<?php echo CHtml::encode($model->participant_id); ?>" />
    <?php endif; ?>
    <div class="row">
        <div class="col-lg-6">
            <div class='mb-3'>
                <label id="shareuser_label" class='form-label' for="shareuser">
                    <?php eT("User with whom the participants are to be shared:"); ?>
                </label>
... (41 lines truncated)
</file>

<file path="application/views/admin/participants/modal_subviews/_showParticipantSurveys.php">
<div class="modal-header">
    <h5 class="modal-title" id="participant_edit_modal"><?php eT('List active surveys'); ?></h5>
    <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<?php $form = $this->beginWidget(
    'yiistrap_fork.widgets.TbActiveForm',
    [
        'id'          => 'participantSurveysActiveForm',
        'action'      => ['admin/participants/sa/editValueParticipantPanel'],
        'htmlOptions' => ['class' => ''], // for inset effect
    ]
); ?>
<div class="modal-body ">
    <input type="hidden" name="actionTarget" value="addParticipantToSurvey"/>
    <input type="hidden" name="Participant[participant_id]" value="<?php echo $model->participant_id; ?>"/>
    <div class="container-fluid">
        <?php
        $this->widget('application.extensions.admin.grid.CLSGridView', [
            'id'              => 'list_participant_surveys',
            'dataProvider'    => $surveymodel->search(),
            'columns'         => $surveymodel->columns,
            'htmlOptions'     => ['class' => 'table-responsive grid-view-ls'],
            'lsAfterAjaxUpdate' => ['bindButtonsInsideSurveys()'],
            'ajaxType'        => 'POST',
            'summaryText'     => gT('Displaying {count} survey(s).'),
            'emptyText'       => gT("This participant is not active in any survey")
        ]);
        ?>
        <p>&nbsp;</p>
    </div>
... (6 lines truncated)
</file>

<file path="application/views/admin/participants/partial/topbarBtns/leftSideButtons.php">
<?php
if (Permission::model()->hasGlobalPermission('participantpanel', 'read')) {
    $this->widget(
        'ext.ButtonWidget.ButtonWidget',
        [
            'name' => '',
            'text' => gT('Display CPDB participants'),
            'icon' => 'ri-list-check',
            'link' => $this->createUrl("admin/participants/sa/displayParticipants"),
            'htmlOptions' => [
                'class' => 'btn btn-outline-secondary',
            ],
        ]
    );
} elseif (
    Permission::model()->hasGlobalPermission('participantpanel', 'create')
    || Permission::model()->hasGlobalPermission('participantpanel', 'import')
    || Permission::model()->hasGlobalPermission('participantpanel', 'export')
    || ParticipantShare::model()->exists('share_uid = :userid', [':userid' => App()->user->id])
) {
    $this->widget(
        'ext.ButtonWidget.ButtonWidget',
        [
            'name' => '',
            'text' => gT('Display my CPDB participants'),
            'icon' => 'ri-list-check',
            'link' => $this->createUrl("admin/participants/sa/displayParticipants"),
            'htmlOptions' => [
                'class' => 'btn btn-outline-secondary',
            ],
... (98 lines truncated)
</file>

<file path="application/views/admin/participants/partial/topbarBtns/rightSideButtons.php">
<?php
if (isset($ownsAddAttributeButton) && ($ownsAddAttributeButton)) {
    $this->widget(
        'ext.ButtonWidget.ButtonWidget',
        [
            'name' => 'addParticipantAttributeName',
            'id' => 'addParticipantAttributeName',
            'text' => gT('Add new attribute'),
            'icon' => 'ri-add-circle-fill',
            'htmlOptions' => [
                'class' => 'btn btn-outline-secondary',
            ],
        ]
    );
}
</file>

<file path="application/views/admin/participants/attributeControl_view.php">
<?php
echo viewHelper::getViewTestTag('participantsAttributeControl');
?>
<div id="pjax-content">
    <div class="row">
        <?php
        require_once Yii::getPathOfAlias('application.extensions.admin.grid.FloatingActionsWidget.actions.AttributeListMassiveActions') . '.php';
        $floatingActions = \actions\AttributeListMassiveActions::getActions();
        $this->widget('ext.admin.grid.FloatingActionsWidget.FloatingActionsWidget', [
            'pk'       => 'selectedAttributeNames',
            'gridId'   => 'list_attributes',
            'aActions' => $floatingActions,
        ]);
        $this->widget('application.extensions.admin.grid.CLSGridView', [
            'id' => 'list_attributes',
            'dataProvider' => $model->search(),
            'columns' => $model->columns,
            'filter' => $model,
            'rowHtmlOptionsExpression' => '["data-attribute_id" => $data->attribute_id]',
            'lsShowSelectionBar'         => false,
            'emptyText'                => gT('No attributes found.'),
            'lsAfterAjaxUpdate' => ['LS.CPDB.bindButtons();', 'LS.CPDB.attributePanel();'],
            'lsPageSizeCurrentValue'    => Yii::app()->user->getState('pageSizeAttributes', Yii::app()->params['defaultPageSize']),
        ]);
        ?>
    </div>
</div>
<span id="locator" data-location="attributes">&nbsp;</span>
</file>

<file path="application/views/admin/participants/attributeMap_view.php">
<script type="text/javascript">
    var redUrl = "<?php echo $this->createUrl("/admin/participants/sa/displayParticipants"); ?>";
    var surveyId = "<?php echo $survey_id ?>";
    var redirect = "<?php echo $redirect ?>";
    if(redirect == "1")
    {
        redUrl = "<?php echo $this->createUrl("/admin/tokens/sa/browse/surveyid/{$survey_id}"); ?>";
    }
    var copyUrl = "<?php echo $this->createUrl("/admin/participants/sa/addToTokenattmap"); ?>";
    // Comma separated string of participant ids
    var participant_id = "<?php echo $participant_id; ?>";
    /* SCRIPT TEXT */
    var attributesMappedText = "<?php eT("All the attributes are automatically mapped") ?>";
    var mustPairAttributeText= "<?php eT("You have to pair it with one attribute of the survey participant list") ?>";
    var onlyOneAttributeMappedText="<?php eT("Only one central attribute is mapped with participant attribute") ?>";
    var cannotAcceptTokenAttributesText="<?php eT("This list cannot accept survey participant attributes.") ?>";
</script>
<div class='header pt-2'>
    <div class='pagetitle h3'>
        <?php eT("Map your central participant attributes to existing survey participant attributes or create new ones"); ?>
    </div>
</div>
<?php
    $columncount = 0;
if (!empty($selectedcentralattribute)) {
    $columncount = $columncount + 2;
}
if (!empty($selectedtokenattribute)) {
    $columncount++;
}
... (169 lines truncated)
</file>

<file path="application/views/admin/participants/attributeMapCSV_view.php">
<div class='header pt-2'>
    <h3 class='pagetitle'><?php neT("Select which fields to import as attributes with your {n} participant.|Select which fields to import as attributes with your {n} participants.", $linecount); ?></h3>
</div>
<div class="row justify-content-start">
    <div class='col-4'>
        <div id="csvattribute" class="card card-primary h-100">
            <div class="card-header ">
                <?php eT("CSV field names "); ?>
                <div class='float-end'>
                    <span id='move-all' class='btn ri-arrow-right-fill no-padding' data-bs-toggle='tooltip' data-title='<?php eT('Move all fields to create column'); ?>'></span>
                </div>
            </div>
            <div class='card-body'>
                <p class='help-block'><?php eT("The following additional fields were found in your CSV file."); ?></p>
                <div class="csvatt droppable-csv">
                    <?php
                    foreach ($firstline as $value) {
                        echo CHtml::tag(
                            "div",
                            array(
                                'id'        => "cs_{$value}",
                                'data-name' => $value,
                                'class'     => "draggable card csv-attribute-item"
                            ),
                            '<div class="card-body">' . $value . '</div>'
                        );
                    }
                    ?>
                </div>
            </div>
... (59 lines truncated)
</file>

<file path="application/views/admin/participants/attributeMapToken_view.php">
<script type="text/javascript">
    var redUrl = "<?php echo $this->createUrl("/admin/participants/sa/displayParticipants"); ?>";
    var copyUrl = "<?php echo $this->createUrl("/admin/participants/sa/addToCentral"); ?>";
    var surveyId = "<?php echo (int) Yii::app()->request->getQuery('sid'); ?>";
    /* LANGUAGE */
    var attributesMappedText = "<?php eT("There are no unmapped attributes") ?>";
    var cannotAcceptTokenAttributesText="<?php eT("This list cannot accept survey participant attributes.") ?>";
</script>
<div class='header'>
    <h1 class="pagetitle h3" ><?php eT("Map your survey participant attributes to an existing participant attribute or create a new one"); ?></h1>
</div>
<div class="draggable-container">
    <div class='row'>
        <div class='col-md-4'>
            <div id="tokenattribute" class="card attribute-column">
                <h2 class="card-header h3"><?php eT("Unmapped survey participant attributes") ?></h2>
                <div id="tokenatt" class="tokenatt droppable">
                    <?php
                    if (!empty($tokenattribute)) {
                        foreach ($tokenattribute as $key => $value) {
                            echo "<div id='t_" . $value . "' data-name='" . $key . "' class='card token-attribute attribute-item draggable'><div title='" . gT("Drag this attribute to another column to map it to the central participants database") . "' data-name=\"$key\" class=\"card-body\">" . $key . "</div></div>";
                        }
                    }
                    ?>
                </div>
            </div>
        </div>
        <div class='col-md-4'>
            <div id="newcreated" class="card attribute-column">
                <h2 class="card-header h3"><?php eT("Participant attributes to create") ?></h2>
... (83 lines truncated)
</file>

<file path="application/views/admin/participants/blacklist_view.php">
<?php
echo viewHelper::getViewTestTag('participantsBlacklistControl');
?>
<script src="<?php echo Yii::app()->getConfig('adminscripts') . "userControl.js" ?>" type="text/javascript"></script>
<div id="pjax-content">
    <div class="row">
        <div class="col-12 list-surveys">
            <div id='usercontrol-1'>
                <?php
                if (Permission::model()->hasGlobalPermission('superadmin', 'read')) {
                    $attribute = ['class' => 'col-lg-6 offset-lg-1 '];
                    echo CHtml::beginForm($this->createUrl('/admin/participants/sa/storeBlacklistValues'), 'post', $attribute);
                    $options = ['Y' => gT('Yes', 'unescaped'), 'N' => gT('No', 'unescaped')];
                    ?>
                    <div class="row ls-space margin top-10 bottom-10">
                        <div class="mb-3">
                            <label class='form-label col-md-8'>
                                <?php eT('Blocklist all current surveys for participant once the global field is set'); ?>
                            </label>
                            <div class='col-md-3'>
                                <?php $this->widget('ext.ButtonGroupWidget.ButtonGroupWidget', [
                                    'name'          => 'blacklistallsurveys',
                                    'ariaLabel'     => gT('Blocklist all current surveys for participant once the global field is set'),
                                    'checkedOption' => $blacklistallsurveys === 'Y' ? '1' : 0,
                                    'selectOptions' => [
                                        '1' => gT('Yes'),
                                        '0' => gT('No'),
                                    ],
                                ]); ?>
                            </div>
... (113 lines truncated)
</file>

<file path="application/views/admin/participants/displayParticipants_view.php">
<?php
echo viewHelper::getViewTestTag('displayParticipants');
?>
<div id="pjax-content">
        <?php
        $hiddenFilterValues = "";
        if ($searchcondition) {
            echo "<div class='' id='ParticipantFilters'>"
                . "<div class='row'>"
                . "<div class='col-12'>"
                . gT("Active filters:")
                . "<span class=''>&nbsp;&nbsp;</span>"
                . "<button id='removeAllFilters' class='btn btn-warning btn-xs' data_url='" . App()->createUrl("admin/participants/sa/displayParticipants") . "'>" . gT("Remove filters") . "</button>"
                . "</div>"
                . "</div>";
            $i = 0;
            $iNumberOfConditions = (count($searchcondition) + 1) / 4;
            while ($i < $iNumberOfConditions) {
                $sFieldname = $searchcondition[$i * 4];
                $sOperator  = $searchcondition[($i * 4) + 1];
                switch ($sOperator) {
                    case 'equal':
                        $operator = gT('equals');
                        break;
                    case 'contains':
                    case 'beginswith':
                        $operator = gT("is like");
                        break;
                    case 'notequal':
                    case 'notcontains':
... (48 lines truncated)
</file>

<file path="application/views/admin/participants/importCSV_view.php">
<?php
echo viewHelper::getViewTestTag('importParticipants');
?>
<div id="pjax-content">
    <div class="container">
        <div class="row">
            <div class="col-12 list-surveys">
                <?php echo TbHtml::form(array("admin/participants/sa/attributeMapCSV"), 'post', array('id' => 'addsurvey', 'enctype' => 'multipart/form-data', 'accept-charset' => 'utf-8')); ?>
                <div class="row ls-space margin top-25 bottom-25">
                    <div class="col-12">
                        <div class="mb-3">
                            <label for="the_file" id="fileupload" class='form-label'>
                                <?php eT("Choose the file to upload:"); ?>
                            </label>
                            <div class="col-6">
                                <input type="file" class="form-control" name="the_file" accept='.csv'/>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row ls-space margin top-25 bottom-25">
                    <div class="col-lg-6">
                        <div class="mb-3">
                            <label for="characterset" class='form-label '>
                                <?php eT("Character set of file:"); ?>
                            </label>
                            <div class="col-12">
                                <select id="characterset" name="characterset" class="form-select">
                                    <?php
                                    foreach (aEncodingsArray() as $key => $encoding) :
... (80 lines truncated)
</file>

<file path="application/views/admin/participants/participantsPanel_view.php">
<?php
?>
<?php
App()->getClientScript()->registerScriptFile(
    App()->getConfig('adminscripts') . 'topbar.js',
    CClientScript::POS_END
);
?>
<script src="<?php echo Yii::app()->getConfig('adminscripts') . "participantpanel.js" ?>" type="text/javascript"></script>
<script type="text/javascript">
    var exporttocsvcountall = "<?php echo Yii::app()->getController()->createUrl("/admin/participants/sa/exporttocsvcountAll"); ?>";
    var exporttocsvall = "<?php echo Yii::app()->getController()->createUrl("exporttocsvAll"); ?>";
    var okBtn = "<?php eT("OK", 'js') ?>";
    var error = "<?php eT("Error", 'js') ?>";
    var exportBtn = "<?php eT("Export", 'js') ?>";
    var cancelBtn = "<?php eT("Cancel", 'js') ?>";
    var exportToCSVURL = "<?php echo Yii::app()->getController()->createUrl("admin/participants/sa/exporttocsv"); ?>";
    var openModalParticipantPanel = "<?php echo ls\ajax\AjaxHelper::createUrl("/admin/participants/sa/openModalParticipantPanel"); ?>";
    var editValueParticipantPanel = "<?php echo Yii::app()->getController()->createUrl("/admin/participants/sa/editValueParticipantPanel"); ?>";
    var deleteLanguageFromAttributeUrl = "<?php echo Yii::app()->getController()->createUrl("/admin/participants/sa/deleteLanguageFromAttribute"); ?>";
    var translate_blacklisted = "<?php echo '<i class=\"ri-arrow-go-back-line\"></i> ' . gT('Remove from blocklist?'); ?>";
    var translate_notBlacklisted = "<?php echo '<i class=\"ri-forbid-2-line\"></i> ' . gT('Add to blocklist?'); ?>";
    var datepickerConfig =     <?php
        $dateformatdetails = getDateFormatData(Yii::app()->session['dateformat']);
        echo json_encode(
            [
                'dateformatdetails'    => $dateformatdetails['dateformat'],
                'dateformatdetailsjs'  => $dateformatdetails['jsdate'],
                "initDatePickerObject" => [
                    "format"   => $dateformatdetails['jsdate'],
... (32 lines truncated)
</file>

<file path="application/views/admin/participants/sharePanel_view.php">
<?php
echo viewHelper::getViewTestTag('participantsSharePanel');
?>
<div id="pjax-content">
    <div class="col-12 list-surveys">
        <div class="row">
            <?php
                $this->widget('application.extensions.admin.grid.CLSGridView', [
                    'id' => 'share_central_participants',
                    'dataProvider' => $model->search(),
                    'columns' => $model->columns,
                    'filter' => $model,
                    'rowHtmlOptionsExpression' => '["data-participant_id" => $data->participant_id, "data-share_uid" => $data->share_uid]',
                    'massiveActionTemplate' => $massiveAction,
                    'emptyText'                => gT('No shared participants found.'),
                    'ajaxType' => 'POST',
                    'afterAjaxUpdate' => 'LS.CPDB.bindButtons',
                    'lsPageSizeCurrentValue'     => $pageSizeShareParticipantView,
                ]);
                ?>
        </div>
    </div>
    <span id="locator" data-location="sharepanel">&nbsp;</span>
</div>
</file>

<file path="application/views/admin/participants/summary_view.php">
<?php
echo viewHelper::getViewTestTag('participantsSummary');
?>
<div id="pjax-content">
    <div class="col-12 list-surveys">
        <div class="row">
            <div class="col-12 content-right table-responsive">
                <table class='ls-statisticssummary table table-hover'>
                    <caption class="visually-hidden">
                            <?php eT("Participants summary"); ?>
                    </caption>
                    <tr>
                        <th>
                            <?php eT("Total participants in central table"); ?>
                        </th>
                        <td>
                            <?php echo $totalrecords; ?>
                        </td>
                    </tr>
                    <tr>
                        <th>
                            <?php eT("Participants owned by you"); ?>
                        </th>
                        <td>
                            <?php echo $owned . ' / ' . $totalrecords; ?>
                        </td>
                    </tr>
                    <tr>
                        <th>
                            <?php eT("Participants shared with you"); ?>
... (35 lines truncated)
</file>

<file path="application/views/admin/participants/uploadSummary_view.php">
<?php
$successSummary = '';
$infoSummary = '';
$warningSummary = '';
$errorSummary = '';
$alerts = '';
if (empty($errorinupload)) {
    $successSummary .= gT('Uploaded CSV file successfully');
    if ($imported != 0) {
        $successSummary .= "<br/>" . gT('Successfully created CPDB entries');
    } else {
        $warningSummary .= gT("No new participants were created") . "<br/>";
    }
    if (!empty($recordcount)) {
        $infoSummary .= "<ul><li>" . sprintf(gT("%s records found in CSV file"), $recordcount) . "</li>";
    }
    if (!empty($mandatory)) {
        $infoSummary .= "<li>" . sprintf(gT("%s records have empty mandatory fields"), $mandatory) . "</li>";
    }
    $infoSummary .= "<li>" . sprintf(gT("%s records met minimum requirements"), $mincriteria) . "</li>";
    $infoSummary .= "<li>" . sprintf(gT("%s new participants were created"), $imported) . "</li>";
    if ($overwritten > 0) {
        $infoSummary .= "<li>" . sprintf(gT("%s records were duplicate but had attributes updated"), $overwritten) . "</li>";
    }
    if (count($duplicatelist) || count($invalidemaillist) || count($invalidattribute) || count($aInvalidFormatlist)) {
        $warningSummary .= "<div class='warningheader'>" . gT('Warnings') . "</div><ul>";
        if (count($duplicatelist) > 0) {
            $warningSummary .= "<li>" . sprintf(gT("%s were found to be duplicate entries and did not need a new participant to be created."), count($duplicatelist));
            if ($dupreason == "participant_id") {
                $warningSummary .= '<br>' . sprintf(gT("They were found to be duplicate using the participant id field"));
... (72 lines truncated)
</file>

<file path="application/views/admin/pluginmanager/partial/topbarBtns/leftSideButtons.php">
<?php
if ($showUpload) {
    $this->widget(
        'ext.ButtonWidget.ButtonWidget',
        [
            'name' => 'plugin-install-button',
            'id' => 'plugin-install-button',
            'text' => gT('Upload & install'),
            'icon' => 'ri-download-2-fill',
            'htmlOptions' => [
                'class' => 'btn btn-outline-secondary',
                'data-bs-toggle' => "modal",
                'data-bs-target' => '#installPluginZipModal',
                'title' => gT('Install plugin ZIP file')
            ],
        ]
    );
}
if ($scanFilesUrl !== null) {
    $this->widget(
        'ext.ButtonWidget.ButtonWidget',
        [
            'name' => 'plugin-scanfiles-button',
            'id' => 'plugin-scanfiles-button',
            'text' => gT('Scan files'),
            'icon' => 'ri-search-line',
            'link' => $scanFilesUrl,
            'htmlOptions' => [
                'class' => 'btn btn-outline-secondary',
                'data-bs-toggle' => 'tooltip',
... (26 lines truncated)
</file>

<file path="application/views/admin/pluginmanager/configure.php">
<?php
echo viewHelper::getViewTestTag('configurePlugin');
$activeTab = $activeTab ?? 'overview';
$isOverviewActive = $activeTab !== 'settings';
?>
<div class="plugin--configure">
    <div class="row">
        <div class="col-12">
            <ul class="nav nav-tabs" id="settingTabs" role="tablist" aria-label="<?php eT('Plugin configuration tabs'); ?>">
                <li role="presentation" class="nav-item">
                    <a id="overview-tab" class="nav-link<?= $isOverviewActive ? ' active' : '' ?>" role="tab" data-bs-toggle="tab" href='#overview' aria-selected="<?= $isOverviewActive ? 'true' : 'false' ?>" aria-controls="overview" tabindex="<?= $isOverviewActive ? '0' : '-1' ?>"><?php eT("Overview"); ?></a>
                </li>
                <li role="presentation" class="nav-item">
                    <a id="settings-tab" class="nav-link<?= $isOverviewActive ? '' : ' active' ?>" role="tab" data-bs-toggle="tab" href='#settings' aria-selected="<?= $isOverviewActive ? 'false' : 'true' ?>" aria-controls="settings" tabindex="<?= $isOverviewActive ? '-1' : '0' ?>"><?php eT("Settings"); ?></a>
                </li>
            </ul>
            <div class="tab-content">
                <div id="overview" class="tab-pane<?= $isOverviewActive ? ' show active' : '' ?>" role="tabpanel" aria-labelledby="overview-tab">
                    <?php $this->renderPartial(
                        './pluginmanager/overview',
                        [
                            'plugin' => $plugin,
                            'pluginObject' => $pluginObject,
                            'config' => $pluginObject->config,
                            'metadata' => $pluginObject->config->metadata,
                            'showactive' => true
                        ]
                    ); ?>
                </div>
                <div id="settings" class="tab-pane<?= $isOverviewActive ? '' : ' show active' ?>" role="tabpanel" aria-labelledby="settings-tab">
... (25 lines truncated)
</file>

<file path="application/views/admin/pluginmanager/index.php">
<?php
echo viewHelper::getViewTestTag('pluginManager');
$pageSize = intval(Yii::app()->user->getState('pageSize', Yii::app()->params['defaultPageSize']));
$requestedPage = Yii::app()->request->getParam('page');
$isPluginsGridAjaxRequest = Yii::app()->request->getParam('ajax') === 'plugins-grid';
if ($requestedPage !== null) {
    Yii::app()->user->setState('pluginListPage', intval($requestedPage));
} elseif ($isPluginsGridAjaxRequest) {
    Yii::app()->user->setState('pluginListPage', 1);
}
$sort               = new CSort();
$sort->attributes   = [
    'name' => [
        'asc' => 'name',
        'desc' => 'name desc',
    ],
    'description' => [
        'asc' => 'description',
        'desc' => 'description desc',
    ],
    'status' => [
        'asc' => 'active',
        'desc' => 'active desc',
        'default' => 'desc',
    ],
];
$sort->defaultOrder = [
    'name' => CSort::SORT_ASC,
];
$providerOptions = [
... (57 lines truncated)
</file>

<file path="application/views/admin/pluginmanager/overview.php">
<?php
?>
<!-- Name -->
<div class="row mb-2">
    <div class="col-md-4 text-end fw-bold"><?php eT("Name:"); ?></div>
    <div class="col-md-8"><?php echo $metadata->name; ?></div>
</div>
<!-- Description -->
<div class="row mb-2">
    <div class="col-md-4 text-end fw-bold"><?php eT("Description:"); ?></div>
    <div class="col-md-8"><?php echo $metadata->description; ?></div>
</div>
<!-- Author -->
<div class="row mb-2">
    <div class="col-md-4 text-end fw-bold"><?php eT("Author:"); ?></div>
    <div class="col-md-8"><?php echo $metadata->author; ?></div>
</div>
<!-- Email -->
<?php if (trim((string) $metadata->authorEmail) !== '') : ?>
    <div class="row mb-2">
        <div class="col-md-4 text-end fw-bold"><?php eT("Email:"); ?></div>
        <div class="col-md-8"><a href="mailto:<?php echo $metadata->authorEmail; ?>"><?php echo $metadata->authorEmail; ?></a></div>
    </div>
<?php endif; ?>
<!-- Url -->
<div class="row mb-2">
    <div class="col-md-4 text-end fw-bold"><?php eT("Web page:"); ?></div>
    <div class="col-md-8"><a href="<?php echo $metadata->authorUrl; ?>" target="_blank"><?php echo $metadata->authorUrl; ?></a></div>
</div>
<!-- Version -->
... (43 lines truncated)
</file>

<file path="application/views/admin/pluginmanager/scanFilesResult.php">
<?php
?>
<div class="row">
    <div class='col-12'>
        <?php foreach ($result as $name => $scannedPlugin) : ?>
            <div class='mb-3 col-12'>
                <label class='form-label col-md-4'>
                    <?php echo $name; ?>
                </label>
                <?php if ($scannedPlugin['load_error'] == 0 && $scannedPlugin['extensionConfig'] == null) : ?>
                    <i class='ri-forbid-2-line'></i>&nbsp;
                    <span class='text-danger'><?php eT('Missing configuration file.'); ?></span>
                <?php elseif ($scannedPlugin['isCompatible']) : ?>
                    <?php echo CHtml::beginForm($installUrl, 'post', ['style' => 'display: inline-block;']); ?>
                    <input type='hidden' name='pluginName' value='<?php echo $name; ?>'/>
                    <button href='' class='btn btn-primary' data-bs-toggle='tooltip' title='<?php eT('Install this plugin'); ?>'>
                        <i class='ri-download-fill'></i>
                        &nbsp;
                        <?php eT('Install'); ?>
                    </button>
                    <?= CHtml::endForm() ?>
                <?php elseif (
                    $scannedPlugin['load_error'] == 0
                    && $scannedPlugin['extensionConfig'] != null
                    && !$scannedPlugin['isCompatible']
) : ?>
                    <i class='ri-forbid-2-line'></i>&nbsp;
                    <span class='text-danger'><?php eT('Plugin is not compatible with your LimeSurvey version.'); ?></span>
                <?php else : ?>
                    <i class='fri-error-warning-fill'></i>&nbsp;
... (23 lines truncated)
</file>

<file path="application/views/admin/pluginmanager/uploadConfirm.php">
<h3 class='pagetitle h3'><?php eT('Confirm uploaded plugin'); ?></h3>
<?php ?>
<?php if (isset($config)) : ?>
    <?php echo CHtml::form(
        Yii::app()->getController()->createUrl(
            '/admin/pluginmanager',
            [
                'sa' => 'installUploadedPlugin'
            ]
        ),
        'post',
        ['class' => 'row']
    ); ?>
    <input type="hidden" name="isUpdate" value="<?php echo json_encode($isUpdate); ?>"/>
    <div class="mb-3">
        <?php if ($isUpdate) : ?>
            <?php
            $this->widget('ext.AlertWidget.AlertWidget', [
                'text' => gT('The following plugin will be updated. Please click "Update" to update the plugin, or "Abort" to abort.'),
                'type' => 'info',
            ]);
            ?>
        <?php else : ?>
            <?php
            $this->widget('ext.AlertWidget.AlertWidget', [
                'text' => gT('The following plugin will be installed. Please click "Install" to install the plugin, or "Abort" to abort. Aborting will remove the files from the file system.'),
                'type' => 'info',
            ]);
            ?>
        <?php endif; ?>
... (50 lines truncated)
</file>

<file path="application/views/admin/pluginmanager/uploadModal.php">
<div class="modal fade" tabindex="-1" role="dialog" id="installPluginZipModal">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title"><?php eT("Install plugin ZIP file") ?></h5>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>
            <?php echo CHtml::form(
                Yii::app()->getController()->createUrl(
                    '/admin/pluginmanager',
                    ['sa' => 'upload']
                ),
                'post',
                [
                    'id'       =>'uploadpluginzip',
                    'name'     =>'uploadpluginzip',
                    'enctype'  =>'multipart/form-data',
                    'onsubmit' =>'return window.LS.validatefilename(this,"'.gT('Please select a plugin to install!', 'js').'");'
                ]
            ); ?>
            <div class="modal-body">
                <?php
                $this->widget('ext.AlertWidget.AlertWidget', [
                    'text' => gT('Warning: Only install plugins from sources you trust!'),
                    'type' => 'warning',
                ]);
                ?>
                <input type='hidden' name='lid' value='$lid' />
                <input type='hidden' name='action' value='templateupload' />
                <div  class="mb-3">
... (23 lines truncated)
</file>

<file path="application/views/admin/remotecontrol/index_view.php">
<div class="container-fluid">
    <div id='remotecontrol' class="row">
        <div class="col-12">
        <div class="pagetitle h3"><?php echo sprintf(gT('RemoteControl is available using %s for transport and exposes the following functionality:'), $method); ?></div>
        <dl>
        <?php
        foreach ($list as $method => $info) {
            echo \CHtml::tag(
                "dt",
                array('class' => "h4"),
                \CHtml::link($method, "#definition-{$method}", array(
                    "role" => "button",
                    "data-bs-toggle" => "collapse",
                    "aria-expanded" => "false",
                    "aria-controls" => "definition-{$method}",
                ))
            );
            echo \CHtml::tag(
                "dd",
                array(
                    "class" => "collapse",
                    "id" => "definition-{$method}"
                ),
                \CHtml::tag("pre", array(), \CHtml::encode($info['description']))
            );
        }
        ?>
        </dl>
        </div>
    </div>
... (2 lines truncated)
</file>

<file path="application/views/admin/saved/savedbar_view.php">

</file>

<file path="application/views/admin/saved/savedlist_view.php">
<?php
?>
<div class='side-body'>
    <h3>
        <?php eT('Saved responses'); ?>
        <small><?php echo flattenText($sSurveyName) . ' ' . sprintf(gT('ID: %s'), $iSurveyId); ?></small>
    </h3>
    <div class="row">
        <div class="col-12 content-right">
            <?php
            $this->widget('application.extensions.admin.grid.CLSGridView', [
                    'id'           => 'saved-grid',
                    'ajaxUpdate'   => 'saved-grid',
                    'dataProvider' => $model->search(),
                    'columns'      => $model->columns,
                    'filter'       => $model,
                    'ajaxType'     => 'POST',
                    'htmlOptions'  => ['class' => 'table-responsive grid-view-ls'],
                    'emptyText'    => gT('No customizable entries found.'),
                    'lsPageSizeCurrentValue'  => $savedResponsesPageSize,
                    'lsPageSizeSelectorName'  => 'savedResponsesPageSize',
                ]);
            ?>
        </div>
    </div>
</div>
</file>

<file path="application/views/admin/super/permissions/addGroupForm.php">
<?php echo CHtml::beginForm($action, 'post', array('class' => 'form-horizontal')) ?>
<div class="row">
    <label class='col-md-2 offset-lg-2 text-end form-label' for='ugid'>
        <?php eT("User group"); ?>
    </label>
    <div class='col-md-4'>
        <?php echo CHtml::dropDownList(
            'ugid',
            '',
            CHtml::listData($oAddGroupList, 'ugid', 'name'),
            array(
                'empty' => gT("Please choose..."),
                'class' => 'form-control',
                'required' => true,
            )
        ); ?>
    </div>
    <div class='col-md-4 '>
        <?php echo CHtml::button(gT("Add group users", 'unescaped'), array('class' => 'btn btn-outline-secondary', 'type' => 'submit')); ?>
    </div>
</div>
</form>
</file>

<file path="application/views/admin/super/permissions/addUserForm.php">
<?php echo CHtml::beginForm($action, 'post', array('class' => 'form-horizontal')) ?>
<div class="row">
    <label class='col-md-2 offset-lg-2 text-end form-label' for='uid'>
        <?php eT("User"); ?>
    </label>
    <div class='col-md-4 '>
        <?php echo CHtml::dropDownList(
            'uid',
            '',
            CHtml::listData(
                $oAddUserList,
                'uid',
                'DisplayName'
            ),
            array(
                'empty' => gT("Please choose..."),
                'class' => 'form-control',
                'required' => true,
            )
        ); ?>
    </div>
    <div class='col-md-4 '>
        <?php echo CHtml::button(gT("Add user", 'unescaped'), array('class' => 'btn btn-outline-secondary', 'type' => 'submit')); ?>
    </div>
</div>
</form>
</file>

<file path="application/views/admin/super/_configuration_menu.php">
<?php
?>
<!-- Configuration -->
<?php if (
    Permission::model()->hasGlobalPermission('superadmin', 'read')
    || Permission::model()->hasGlobalPermission('templates', 'read')
    || Permission::model()->hasGlobalPermission('labelsets', 'read')
    || Permission::model()->hasGlobalPermission('labelsets', 'create')
    || Permission::model()->hasGlobalPermission('users', 'read')
    || Permission::model()->hasGlobalPermission('usergroups', 'read')
    || Permission::model()->hasGlobalPermission('participantpanel', 'read')
    || Permission::model()->hasGlobalPermission('participantpanel', 'create')
    || Permission::model()->hasGlobalPermission('participantpanel', 'update')
    || Permission::model()->hasGlobalPermission('participantpanel', 'delete')
    || Permission::model()->hasGlobalPermission('participantpanel', 'import')
    || Permission::model()->hasGlobalPermission('participantpanel', 'export')
    || ParticipantShare::model()->exists('share_uid = :userid', [':userid' => App()->user->id])
    || Permission::model()->hasGlobalPermission('settings', 'read')
) : ?>
    <li class="dropdown mega-dropdown nav-item">
        <a href="#" class="nav-link dropdown-toggle mainmenu-dropdown-toggle" data-bs-toggle="dropdown">
            <!-- <i class="ri-settings-5-fill"></i> -->
            <?php eT('Configuration'); ?>
            <span class="caret"></span>
        </a>
        <div class="dropdown-menu mega-dropdown-menu" id="mainmenu-dropdown">
            <div class="row">
                <!-- System overview -->
                <div class="mega-dropdown__column col-md-3">
                    <!-- System overview -->
... (256 lines truncated)
</file>

<file path="application/views/admin/super/_help_menu.php">
<li class="nav-item dropdown">
    <a href="#" class="nav-link dropdown-toggle" data-bs-toggle="dropdown" id="helpDropdown" aria-expanded="false" role="button">
        <!-- <i class="ri-question-fill"></i> -->
        <?php eT('Help');?>
    </a>
    <ul class="dropdown-menu larger-dropdown" aria-labelledby="helpDropdown">
        <li>
            <a href="http://manual.limesurvey.org/" target="_blank" rel="noopener noreferrer" class="dropdown-item">
                <!-- <i class="ri-question-fill"></i> -->
                <?php eT('LimeSurvey Manual');?>
                <span class="visually-hidden">(<?php eT('Link opens in a new tab'); ?>)</span>
                <i aria-hidden="true" class="ri-external-link-fill float-end"></i>
            </a>
        </li>
        <li>
            <a href="https://forums.limesurvey.org" target="_blank" rel="noopener noreferrer" class="dropdown-item">
                <span aria-hidden="true" class="fa-stack halfed">
                    <span class="ri-chat-3-fill fa-stack-1x"></span>
                    <span class="ri-group-fill fa-inverse fa-stack-1x halfed"></span>
                </span>
                <?php eT('LimeSurvey Forums');?>
                <span class="visually-hidden">(<?php eT('Link opens in a new tab'); ?>)</span>
                <i aria-hidden="true" class="ri-external-link-fill float-end"></i>
            </a>
        </li>
        <li class="dropdown-divider" role="separator" aria-hidden="true"></li>
        <li>
            <a href="https://bugs.limesurvey.org/" target="_blank" rel="noopener noreferrer" class="dropdown-item">
                <span aria-hidden="true" class="ri-bug-fill"></span>
                <?php eT('Report bugs');?>
... (15 lines truncated)
</file>

<file path="application/views/admin/super/_renderJson.php">
<?php
header('Content-type: application/json');
$this->layout = false;
echo CJavaScript::jsonEncode($data);
Yii::app()->end();
die();
</file>

<file path="application/views/admin/super/admin_notifications.php">
<?php
?>
<!-- Admin notification system -->
<?php if ($nrOfNotifications == 0) : ?>
    <li id='notification-li' class='dropdown nav-item'>
        <a aria-expanded='false' class="nav-link"
            href='#'>
            <span class='ri-notification-2-line text-read'></span>
	    <span class='visually-hidden'><?php eT('Notifications'); ?></span>
        </a>
    </li>
<?php elseif ($showLoader) : ?>
<li id='notification-li' class='dropdown nav-item' onclick='LS.updateNotificationWidget("<?php echo $updateUrl; ?>");' >
        <a id='admin-notifications-menu-button' class='nav-link dropdown-toggle' data-bs-toggle='dropdown' role='button' aria-expanded='false' aria-haspopup='true' aria-controls='notification-outer-ul' href='#'>
            <?php ?>
            <!-- <span id='notification-bell' class='ri-notification-2-fill <?php echo $bellColor; ?>'></span> -->
            <i id='notification-bell' class="ri-notification-2-line  <?php echo $bellColor; ?>"></i>
            <span class='visually-hidden'><?php eT('Notifications'); ?></span>
            <?php if ($nrOfNewNotifications) : ?>
                <span class='badge'><?php echo $nrOfNewNotifications; ?></span>
            <?php endif; ?>
            <span class='caret'></span>
        </a>
        <ul id='notification-outer-ul' class='dropdown-menu dropdown-menu-end' aria-labelledby='admin-notifications-menu-button'>
            <li>
                <a class="dropdown-item"><span class='ri-loader-2-fill remix-spin'></span><span class='visually-hidden'><?php eT('Loading notifications'); ?></span></a>
            </li>
        </ul>
    </li>
<?php else : ?>
... (64 lines truncated)
</file>

<file path="application/views/admin/super/dummy.php">
<?php
echo $content;
</file>

<file path="application/views/admin/super/footer.php">
<?php
$systemInfos = [
    gT('LimeSurvey version') => Yii::app()->getConfig('versionnumber'),
    gT('LimeSurvey build') => Yii::app()->getConfig('buildnumber') == '' ? 'github' : Yii::app()->getConfig('buildnumber'),
    gT('Operating system') => php_uname(),
    gT('PHP version') => phpversion(),
    gT('Web server name') => $_SERVER['SERVER_NAME'],
    gT('Web server software') => $_SERVER['SERVER_SOFTWARE'],
    gT('Web server info') => $_SERVER['SERVER_SIGNATURE'] ?? $_SERVER['SERVER_PROTOCOL']
];
try {
    $systemInfos[gT('Database driver')] = Yii::app()->db->driverName;
} catch (Exception $ex) {
    $systemInfos[gT('Database driver')] = $ex->getMessage();
}
try {
    $systemInfos[gT('Database driver version')] = Yii::app()->db->clientVersion;
} catch (Exception $ex) {
    $systemInfos[gT('Database driver version')] = $ex->getMessage();
}
try {
    $systemInfos[gT('Database server info')] = Yii::app()->db->serverInfo;
} catch (Exception $ex) {
    $systemInfos[gT('Database server info')] = $ex->getMessage();
}
try {
    $systemInfos[gT('Database server version')] = Yii::app()->db->serverVersion;
} catch (Exception $ex) {
    $systemInfos[gT('Database server version')] = $ex->getMessage();
}
... (189 lines truncated)
</file>

<file path="application/views/admin/super/header.php">
<?php
?>
<!DOCTYPE html>
<html lang="<?php echo htmlspecialchars(getHtmlLangAttributeValue((string) $adminlang)); ?>"<?php echo $languageRTL;?> >
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <!-- Assets load -->
    <!--
        Notice to developers :
        If you turn debug mode on, the asset manager will be off.
        If you turn degug mode off, the asset manager will be on.
        Without the asset manager, the CSS/JS files are published from their real url (eg: http:
        So, once a browser loaded once those files, it cache it, and don't load it anymore.
        Then, if you change some css/js files, final user must clean its browser cache to get the new version of the cache.
        This was the old LS behaviour, if debug mode is on, you'll have this very behaviour
        The asset manager resolve the browser cache problem. It copy the css/js files to a tmp directory before publishing it:
        http:
        For admin GUI, the asset manager works on a base of a "file by file" : each single css/js file is published as a single asset.
        So if you touch any css/js file published via the asset (updating its date of modification), the asset manager will AUTOMATICALLY create a new tmp directory:
        http:
        Then, the browser will automatically reload the file, and the final user don't need to refresh its cache.
        You should never have to delete the tmp/assets directory. You can do it to free some space on your server, but that all.
        notice: the css/js files from third party extension use the package system. It means that the asset manager will publish them on the base of the directory logic.
        So, if you update any css/js file from a third party extension, make sure that the modification date of the root directory is updated.
    -->
    <?php if (!YII_DEBUG ||  Yii::app()->getConfig('use_asset_manager')) : ?>
        <!-- Debug mode is off, so the asset manager will be used-->
    <?php else : ?>
        <!-- Debug mode is on, so the asset manager will not be used -->
... (28 lines truncated)
</file>

<file path="application/views/admin/super/help_button_dropup.php">
<div id="help-button-dropup" class="dropup">
    <button type="button" aria-label="<?php echo gT('Useful resources'); ?>" class="btn btn-black60 btn-circle" data-bs-toggle="dropdown" aria-expanded="false">
        <i class="ri-questionnaire-line remix-xl"></i>
    </button>
    <ul class="dropdown-menu">
        <li role="presentation">
            <span class="dropdown-header"><?php eT("Useful resources") ?></span>
        </li>
        <li>
            <a class="dropdown-item" href="https://help.limesurvey.org/portal/en/home" target="_blank"><?php eT("Help center") ?></a>
        </li>
        <li>
            <a class="dropdown-item" href="https://translate.limesurvey.org/projects/" target="_blank"><?php eT("Help translating") ?></a>
        </li>
        <li>
            <a class="dropdown-item" href="https://forums.limesurvey.org" target="_blank"><?php eT("Support forum") ?></a>
        </li>
        <li>
            <a class="dropdown-item" href="https://community.limesurvey.org/releases/" target="_blank"><?php eT("Release notes") ?></a>
        </li>
        <li>
            <a class="dropdown-item" href="https://www.limesurvey.org/legal-notice" target="_blank"><?php eT("Legal notice") ?></a>
        </li>
        <li>
            <a class="dropdown-item" href="mailto:info@limesurvey.org"><?php eT("Contact") ?></a>
        </li>
    </ul>
</div>
</file>

<file path="application/views/admin/super/layout_insurvey.php">
<?php
$layoutHelper = new LayoutHelper();
$this->showHeaders($aData, false);
$this->showadminmenu($aData);
echo "<!-- BEGIN LAYOUT_INSURVEY -->";
LimeExpressionManager::StartProcessingPage(false, true);
$aData['debug'] = $aData;
echo $layoutHelper->renderTopbarTemplate($aData);
echo ' <div id="pjax-file-load-container" class="ls-flex-row col-12"><div style="height:2px;width:0px;"></div></div>';
echo ' <!-- Survey page, started in SurveyCommonAction::renderWrappedTemplate() -->
    <div id="vue-apps-main-container" '
. 'class="ls-flex-row align-items-flex-begin align-content-flex-end col-12 pb-6" '
. '>';
    $layoutHelper->renderSurveySidemenu($aData);
    echo '<div '
    . 'class="ls-flex-column align-items-flex-start align-content-flex-start col-11 ls-flex-item transition-animate-width main-content-container" '
    . '>';
        echo '<div id="pjax-content" class="col-12">';
            $this->organizequestionbar($aData);
            echo '<div id="in_survey_common" '
            . 'class="container-fluid ls-flex-column col-12"'
            . '>';
                $this->updatenotification();
                $this->notifications();
                $this->listquestiongroups($aData);
                $this->listquestions($aData);
                $this->nsurveysummary($aData);
                echo $content;
            echo "</div>\n";
        echo "</div>\n";
... (15 lines truncated)
</file>

<file path="application/views/admin/super/layout_main.php">
<?php
$this->showHeaders($aData);
$this->showadminmenu($aData);
$layoutHelper = new LayoutHelper();
?>
<?php ?>
<?php if (!Yii::app()->user->isGuest) : ?>
<div id="layout_sidebar">
    <?php App()->getController()->widget('ext.SideBarWidget.SideBarWidget'); ?>
    <div class="container-40">
<?php endif; ?>
        <?= $layoutHelper->renderTopbarTemplate($aData) ?>
        <!-- BEGIN LAYOUT_MAIN -->
        <div class='container-fluid'>
            <?= $this->updatenotification() ?>
        </div>
        <?= $this->notifications() ?>
        <!--The load indicator for pjax-->
        <div id="pjax-file-load-container" class="ls-flex-row col-12">
            <div style="height:2px;width:0;"></div>
        </div>
        <?php $containerClass = !App()->user->isGuest ? 'container-fluid' : 'container-fluid ps-0' ?>
        <!-- Full page, started in SurveyCommonAction::renderWrappedTemplate() -->
        <div class="<?= $containerClass ?>" id="in_survey_common_action">
            <?= $content ?>
        </div>
<?php ?>
<?php if (!Yii::app()->user->isGuest) : ?>
    </div>
</div>
... (16 lines truncated)
</file>

<file path="application/views/admin/super/layout_minimal.php">
<?php
$this->showHeaders($aData);
echo "<!-- BEGIN LAYOUT_MAIN -->";
$this->updatenotification();
$this->notifications();
echo ' <div id="pjax-file-load-container" class="ls-flex-row col-12"><div style="height:2px;width:0px;"></div></div>';
echo '<!-- Full page, started in SurveyCommonAction::renderWrappedTemplate() -->
    <div class="container-fluid" id="in_survey_common_action">
';
echo $content;
echo '</div>';
echo "<!-- END LAYOUT_MAIN -->";
if (!isset($aData['display']['endscripts']) || $aData['display']['endscripts'] !== false) {
    Yii::app()->getController()->loadEndScripts();
}
if (!Yii::app()->user->isGuest) {
    if (!isset($aData['display']['footer']) || $aData['display']['footer'] !== false) {
        Yii::app()->getController()->getAdminFooter('http://manual.limesurvey.org', gT('LimeSurvey online manual'));
    }
} else {
    echo '</body>
        </html>';
}
</file>

<file path="application/views/admin/super/messagebox.php">
<?php
?>
<div class='side-body'>
    <div class="row">
        <div class="col-12 content-center">
            <!-- Message box from super admin -->
            <div id="admin-status-message" class="jumbotron message-box <?php echo $class ?? ""; ?>" role="status" aria-live="polite" aria-atomic="true" tabindex="-1">
                <h1 class="h2" ><?php echo $title;?></h1>
                <?php echo $message;?>
            </div>
        </div>
    </div>
</div>
</file>

<file path="application/views/admin/super/quickmenu.php">
<div id="quick-menu-container">
    <!-- TODO: Placement right won't work with right-to-left -->
    <a
        href="<?php echo $this->createUrl("surveyAdministration/view/surveyid/$surveyid"); ?>"
        data-bs-toggle="tooltip"
        data-title="<?php eT("Survey"); ?>"
        data-bs-placement="right"
    >
        <div class='quick-icon-wrapper'>
            <span class="ri-home-4-fill navbar-brand"></span>
        </div>
    </a>
    <?php foreach ($quickMenuItems as $quickMenuItem) : ?>
        <div
            class='quick-menu-item'
            data-bs-toggle="tooltip"
            data-title="<?php echo $quickMenuItem['tooltip']; ?>"
            data-button-name="<?php echo $quickMenuItem['name']; ?>"
            data-bs-placement="right"
            draggable="true"
            ondragstart="dragstart_handler(event);"
            ondragover="dragover_handler(event);"
            ondragleave="dragleave_handler(event);"
            ondrop="drop_handler(event);"
        >
            <a
                href='<?php echo $quickMenuItem['href']; ?>'
                <?php if ($quickMenuItem['openInNewTab']) : ?>
                    target='_blank'
                <?php endif; ?>
... (23 lines truncated)
</file>

<file path="application/views/admin/super/sidebody.php">
<div id="vue-side-body-app" class='side-body'>
    <?php echo $content; ?>
</div>
</file>

<file path="application/views/admin/survey/Question/massive_actions/_delete_results.php">
<?php
?>
<table class="table table-striped">
    <thead>
        <th><?php eT('Question ID');?></th>
        <th><?php eT('Question title');?></th>
        <th><?php eT('Status');?></th>
    </thead>
    <tbody>
        <?php foreach ($aResults as $iQid => $result) :?>
            <tr>
                <td>
                    <?php echo $iQid;?>
                </td>
                <td>
                    <?php echo $result['question'];?>
                </td>
                <?php if ($result['result']['status'] === true) :?>
                    <td class="text-success">
                        <?php echo $result['result']['message']; ?>
                    </td>
                <?php else : ?>
                    <td class="text-danger">
                        <?php echo $result['result']['message']; ?>
                    </td>
                <?php endif;?>
            </tr>
        <?php endforeach;?>
    </tbody>
</table>
... (1 lines truncated)
</file>

<file path="application/views/admin/survey/Question/massive_actions/_selector.php">
<?php
?>
<!-- Rendering massive action widget -->
<?php
    $aActions = [];
    $aActions[] = array(
        'type' => 'dropdown-header',
        'text' => gT("General"),
    );
    if (!$oSurvey->isActive) {
        $aActions[] = array(
            'type' => 'action',
            'action' => 'delete',
            'url' => App()->createUrl('questionAdministration/deleteMultiple/'),
            'iconClasses' => 'ri-delete-bin-fill text-danger',
            'text' => gT('Delete'),
            'grid-reload' => 'yes',
            'actionType' => 'modal',
            'modalType' => 'cancel-delete',
            'keepopen' => 'yes',
            'showSelected'  => 'yes',
            'selectedUrl'   => App()->createUrl('questionAdministration/renderItemsSelected/'),
            'sModalTitle' => gT('Delete question(s)'),
            'htmlModalBody' => gT('Deleting these questions will also delete their corresponding answer options and subquestions. Are you sure you want to continue??'),
        );
    }
    if (!$oSurvey->isActive) {
        $aActions[] = array(
            'type' => 'action',
            'action' => 'set-group-position',
... (110 lines truncated)
</file>

<file path="application/views/admin/survey/Question/massive_actions/_set_css_class.php">
<?php
?>
<form class="custom-modal-datas  form-horizontal">
    <div class="mb-3" id="CssClass">
        <label class="col-md-4 form-label"><?php eT("CSS class(es):"); ?></label>
        <div class="col-md-8">
            <input type="text" class="form-control custom-data attributes-to-update" id="cssclass" name="cssclass" value="">
        </div>
        <input type="hidden" name="sid" value="<?php echo (int) Yii::app()->request->getParam('surveyid', 0); ?>" class="custom-data"/>
        <input type="hidden" name="aValidQuestionTypes" value="15ABCDEFGHIKLMNOPQRSTUWXYZ!:;|*" class="custom-data"/>
    </div>
</form>
</file>

<file path="application/views/admin/survey/Question/massive_actions/_set_question_group_position.php">
<?php
?>
<?php eT("Set question group for those question"); ?>
<form class="custom-modal-datas  form-horizontal">
    <!-- select group -->
    <div class="mb-3">
        <label class="form-label col-md-4" for="group_gid"><?php et('Group:'); ?></label>
        <div class="col-md-8">
            <select name="group_gid" class="form-select custom-data" id="gid">
                <?php foreach ($model->survey->groups as $group) : ?>
                    <option value="<?php echo $group->gid;?>">
                        <?php echo flattenText($group->questiongroupl10ns[$model->survey->language]->group_name);?>
                    </option>
                <?php endforeach?>
            </select>
        </div>
    </div>
    <!-- Position widget -->
    <?php $this->widget('ext.admin.survey.question.PositionWidget.PositionWidget', array(
                'display' => 'ajax_form_group',
                'oSurvey' => $model->survey,
                'classes' => 'custom-data'
        ));
?>
</form>
</file>

<file path="application/views/admin/survey/Question/massive_actions/_set_questions_mandatory.php">
<?php
$surveyid = App()->request->getParam('surveyid', 0);
?>
<form class="custom-modal-datas form-horizontal">
    <div id='MandatorySelection' class="mb-3">
        <label class="col-md-4 form-label"><?php eT("Mandatory:"); ?></label>
        <div class="col-md-8">
            <?php $this->widget('ext.ButtonGroupWidget.ButtonGroupWidget', [
                'name'          => 'mandatory',
                'checkedOption' => 'N',
                'selectOptions' => [
                    "Y" => gT("Yes", 'unescaped'),
                    "S" => gT("Soft", 'unescaped'),
                    "N" => gT("No", 'unescaped')
                ],
                'htmlOptions'   => [
                    'class' => 'custom-data',
                ],
            ]); ?>
            <input type="hidden" name="sid" value="<?php echo (int)$surveyid; ?>" class="custom-data"/>
        </div>
    </div>
</form>
</file>

<file path="application/views/admin/survey/Question/massive_actions/_set_questions_other.php">
<?php
?>
<form class="custom-modal-datas form-horizontal" data-trigger-validation="true">
    <div  class="mb-3" id="OtherSelection">
        <label class="col-md-4 form-label"><?php eT("Option 'Other':"); ?></label>
        <div class="col-md-8">
            <?php $this->widget('ext.ButtonGroupWidget.ButtonGroupWidget', [
                'name'          => 'other',
                'checkedOption' => '0',
                'selectOptions' => [
                    '1' => gT('On'),
                    '0' => gT('Off'),
                ],
                'htmlOptions'   => [
                    'class'       => 'custom-data'
                ],
            ]); ?>
        </div>
        <input type="hidden" name="sid" value="<?php echo (int) Yii::app()->request->getParam('surveyid', 0); ?>" class="custom-data"/>
    </div>
</form>
</file>

<file path="application/views/admin/survey/Question/massive_actions/_set_statistics_options.php">
<?php
?>
<form class="custom-modal-datas form-horizontal">
    <!-- Public statistics -->
    <div  class="mb-3" id="PublicStatistcs">
        <label class="col-md-4 form-label" for="public_statistics"><?php eT("Show in public statistics:"); ?></label>
        <div class="col-md-8">
            <?php $this->widget('ext.ButtonGroupWidget.ButtonGroupWidget', [
                'name'          => 'public_statistics',
                'checkedOption' => '0',
                'selectOptions' => [
                    '1' => gT('On'),
                    '0' => gT('Off'),
                ],
                'htmlOptions'   => [
                    'class' => 'custom-data attributes-to-update'
                ],
            ]); ?>
        </div>
    </div>
    <!-- Display charts -->
    <div  class="mb-3" id="StatisticsShowgraph">
        <label class="col-md-4 form-label" for="statistics_showgraph"><?php eT("Display chart:"); ?></label>
        <div class="col-md-8">
            <?php $this->widget('ext.ButtonGroupWidget.ButtonGroupWidget', [
                'name'          => 'statistics_showgraph',
                'checkedOption' => '0',
                'selectOptions' => [
                    '1' => gT('On'),
                    '0' => gT('Off'),
... (25 lines truncated)
</file>

<file path="application/views/admin/survey/Question/massive_actions/_set_subquestansw_order.php">
<?php
$surveyid = App()->request->getParam('surveyid', 0);
?>
<form class="custom-modal-datas form-horizontal" data-trigger-validation="true">
    <div  class="mb-3" id="CssClass">
        <label class="col-md-4 form-label"><?php eT("Random order:"); ?></label>
        <div class="col-md-8">
            <select class="form-select custom-data attributes-to-update" id="random_order" name="random_order" required>
                <option value="" selected="selected"><?php eT('Please select an option');?></option>
                <option value="0"><?php eT('Off');?></option>
                <option value="1"><?php eT('Randomize on each page load');?></option>
            </select>
        </div>
        <input type="hidden" name="sid" value="<?php echo (int) $surveyid; ?>" class="custom-data"/>
        <input type="hidden" name="aValidQuestionTypes" value="!ABCEFHKLMOPQRWZ1:;" class="custom-data"/>
    </div>
</form>
</file>

<file path="application/views/admin/survey/Question/subquestionsAndAnswers/_subquestion.twig">
{#
/**
 * subquestion row view
 *
 * @var $row
 * @var $position
 * @var $scale_id
 * @var $activated
 * @var $first
 * @var $surveyid
 * @var $gid
 * @var $qid
 * @var $language
 * @var $title
 * @var $question
 * @var $relevance
 * @var $oldCode
 *
 * NB : !!! If you edit this view, remember to check if answer option row view need also to be updated !!!
 */
#}

<!-- subquestion row -->
<tr id='row_{{ language }}_{{ qid }}_{{ scale_id }}' class="row-container" data-common-id="{{ qid }}_{{ scale_id }}">
    {# If survey is active : no move button, code not editable #}
    {% if activated == 'Y' %}
        <!-- Move icon -->
        <td class="move-icon-disable">
            &nbsp;
        </td>
... (109 lines truncated)
</file>

<file path="application/views/admin/survey/Question/_subQuestionsAndAnwsersJsVariables.php">
<?php
$scriptVariables = [
    'langs'            => implode(';', $anslangs),
    'languagecount'    => count($anslangs),
    'cancel'           => gT('Cancel'),
    'ok'               => gT('OK'),
    'sLabelSetName'    => gT('Label set name', 'js'),
    'strNoLabelSet'    => gT('There are no label sets which match the survey default language', 'js'),
    'labelSetSuccess'  => gT('The records have been saved successfully!', 'js'),
    'labelSetFail'     => gT('Sorry, the request failed!', 'js'),
    'labelSetEmpty'    => gT('There are no labels in this set', 'js'),
    'labelSetNotFound' => gT('Label set not found', 'js'),
    'lanameurl'        => Yii::app()->createUrl('/admin/labels/sa/getAllSets'),
    'lanrestrictedurl' => Yii::app()->createUrl('/admin/labels/sa/getRestrictedSets'),
    'lasaveurl'        => Yii::app()->createUrl('/admin/labels/sa/ajaxSave'),
    'laupdateurl'      => Yii::app()->createUrl('/admin/labels/sa/ajaxUpdate'),
    'lsdetailurl'      => Yii::app()->createUrl('/questionAdministration/getLabelsetDetails'),
    'lspickurl'        => Yii::app()->createUrl('/questionAdministration/getLabelsetPicker'),
    'sCheckLabelURL'   => Yii::app()->createUrl('/questionAdministration/checkLabel'),
    'lsextraoptionsurl'     => Yii::app()->createUrl(
        'questionAdministration/ajaxLoadExtraOptions',
        [
            'questionId' => $qid
        ]
    ),
    'subquestions'     => [
        'newansweroption_text'     => gT('New subquestion', 'js'),
        'quickaddtitle'            => gT('Quick-add subquestion', 'js'),
        'strCantDeleteLastAnswer'  => gT('You cannot delete the last subquestion.', 'js'),
        'duplicatesubquestioncode' => gT('Error: You are trying to use duplicate subquestion codes.', 'js'),
... (23 lines truncated)
</file>

<file path="application/views/admin/survey/Question/yesNo_defaultvalue_widget.php">
<?php
class yesNo_defaultvalue_widget extends CWidget
{
    public $widgetOptions;
    public function init()
    {
    }
    public function run()
    {
        $questionrow = $this->widgetOptions['questionrow'];
        $langopts = $this->widgetOptions['langopts'];
        $language = $this->widgetOptions['language'];
        $defaultValues =  $this->widgetOptions['langopts'][$language][$questionrow['type']][0];
        $emfield_css = '';
        $emValue = '';
        $select = '';
        $sEmfield_css_class = '';
        // prepare variables for prefilling the form
        if (!is_null($defaultValues)) {
            $sDefaultValue = $defaultValues;
            if (($sDefaultValue == 'N') || ($sDefaultValue == 'Y') || ($sDefaultValue == '')) { //|| 'Y' || NULL)){
                $select = $defaultValues;
            } else {
                $select = 'EM';
                $emValue = $defaultValues;
            }
        }
        if ($questionrow['type'] == Question::QT_Y_YES_NO_RADIO) {
            $sElement_id = 'defaultanswerscale_0_' . $language;
            $aList = array(
... (26 lines truncated)
</file>

<file path="application/views/admin/survey/subview/accordion/_generaloptions_panel.php">
<?php
$scriptVarsNecessary = "
        var jsonUrl = '';
        var sAction = '';
        var sParameter = '';
        var sTargetQuestion = '';
        var sNoParametersDefined = '';
        var sAdminEmailAddressNeeded = '" . gT("If you are using surveys with a closed participant group or notifications emails you need to set an administrator email address.", 'js') . "'
        var sURLParameters = '';
        var sAddParam = '';
    ";
Yii::app()->getClientScript()->registerScript(
    "GeneralOption-variables",
    $scriptVarsNecessary,
    LSYii_ClientScript::POS_BEGIN
);
?>
<!-- General options -->
<?php
$yii = Yii::app();
$controller = $yii->getController();
$action = 'editsurveysettings';
$formatSelectOptions = array(
    'S' => gT('Question by question', 'unescaped'),
    'G' => gT('Group by group', 'unescaped'),
    'A' => gT('All in one', 'unescaped')
);
$bGlobalSettings = !empty($this->currentModuleAction) && $this->currentModuleAction == 'globalsettings';
if ($bShowInherited) {
    $formatSelectOptions['I'] = $oSurveyOptions->format . " ᴵ";
... (302 lines truncated)
</file>

<file path="application/views/admin/survey/subview/accordion/_integration_panel.php">
<?php
$yii = Yii::app();
$controller = $yii->getController();
$pageSize = Yii::app()->user->getState('pageSize', Yii::app()->params['defaultPageSize']);
echo viewHelper::getViewTestTag('surveyPanelIntegration');
?>
<!-- Datatable translation-data -->
<!-- Container -->
<div id='panelintegration' class="tab-pane fade show active">
        <div class="row">
            <div class="col-lg-12 ls-flex ls-flex-row">
                <div class="ls-flex-item text-start">
                    <button
                            class="btn btn-primary"
                            id="addParameterButton"
                            data-bs-toggle="modal"
                            data-bs-target="#dlgEditParameter">
                        <?= gT('Add URL parameter') ?>
                    </button>
                </div>
                <div class="ls-flex-item justify-content-end row row-cols-lg-auto g-1 align-items-center mb-3">
                    <!-- Search Box -->
                    <div class="col-12">
                        <label class="control-label text-right" for="search_query"><?= gT('Search:') ?></label>
                    </div>
                    <div class="col-12">
                        <input class="form-control" name="search_query" id="search_query" type="text">
                    </div>
                    <div class="col-12">
                        <button class="btn btn-primary" type="button" id="searchParameterButton"><?= gT('Search', 'unescaped') ?></button>
... (57 lines truncated)
</file>

<file path="application/views/admin/survey/subview/accordion/_notification_panel.php">
<?php
echo viewHelper::getViewTestTag('surveyNotificationOptions');
App()->getClientScript()->registerScript("notification-panel-variables", "
    var jsonUrl = '';
    var sAction = '';
    var sParameter = '';
    var sTargetQuestion = '';
    var sNoParametersDefined = '';
    var sAdminEmailAddressNeeded = '" . gT("If you are using token functions or notifications emails you need to set an administrator email address.", 'js') . "'
    var sURLParameters = '';
    var sAddParam = '';
", LSYii_ClientScript::POS_BEGIN);
$googleAnalyticsOptions = array(
    "N" => gT("None", 'unescaped'),
    "Y" => gT("Use settings below", 'unescaped'),
    "G" => gT("Use global settings", 'unescaped')
);
$googleAnalyticsStyleOptions = array(
    "0" => gT("Off", 'unescaped'),
    "1" => gT("Default", 'unescaped'),
    "2" => gT("Survey ID/group ID", 'unescaped')
);
?>
<!-- Notification panel -->
<div id='notification-panel'>
    <?php if ($oSurvey->isActive) : ?>
        <div class="row ls-panelboxes mb-5">
            <div class="col-12 col-lg-6 ls-flex-column">
                <div class="card card-primary ">
                    <div class="card-body d-flex">
... (243 lines truncated)
</file>

<file path="application/views/admin/survey/subview/accordion/_plugin_panel.php">
<?php
App()->getClientScript()->registerScript(
    "plugin-panel-variables",
    "
    var jsonUrl = '';
    var sAction = '';
    var sParameter = '';
    var sTargetQuestion = '';
    var sNoParametersDefined = '';
    var sAdminEmailAddressNeeded = '" . gT(
        "If you are using surveys with a closed participant group or notifications emails you need to set an administrator email address.",
        'js'
    ) . "'
    var sURLParameters = '';
    var sAddParam = '';
",
    LSYii_ClientScript::POS_BEGIN
);
if (!empty($plugin['settings'])) : ?>
    <div class="accordion p-2" id="accordion">
        <div class="accordion-item ">
            <h2 class="accordion-header"  id="heading-plugin<?php echo $id; ?>">
                <button  id="button-plugin<?php echo $id; ?>" class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#plugin<?php echo $id; ?>" aria-expanded="true" aria-controls="plugin<?php echo $id; ?>">
                    <?php printf(gT("Settings for plugin %s"), $plugin['name']); ?>
                </button>
            </h2>
            <div id="plugin<?php echo $id; ?>"  class="accordion-collapse collapse" aria-labelledby="heading-plugin<?php echo $id; ?>" data-bs-parent="#accordion">
                <div class="accordion-body">
                <?php
                    $this->widget('ext.SettingsWidget.SettingsWidget', [
... (15 lines truncated)
</file>

<file path="application/views/admin/survey/subview/accordion/_plugins_panel.php">
<?php
echo viewHelper::getViewTestTag('surveyPlugins');
?>
<?php App()->getClientScript()->registerScript("plugins-panel-variables", "
    var jsonUrl = '';
    var sAction = '';
    var sParameter = '';
    var sTargetQuestion = '';
    var sNoParametersDefined = '';
    var sAdminEmailAddressNeeded = '" . gT("If you are using token functions or notifications emails you need to set an administrator email address.", 'js') . "'
    var sURLParameters = '';
    var sAddParam = '';
", LSYii_ClientScript::POS_BEGIN);
?>
<div id="advanced-question-editor">
    <?php if (isset($pluginSettings)) :
        foreach ($pluginSettings as $id => $plugin) {
            $this->renderPartial('/admin/survey/subview/accordion/_plugin_panel', array('id' => $id,'plugin' => $plugin));
        }
    endif; ?>
</div>
</file>

<file path="application/views/admin/survey/subview/accordion/_presentation_panel.php">
<?php
echo viewHelper::getViewTestTag('surveyPresentationOptions');
App()->getClientScript()->registerScript(
    "presentation-panel-variables",
    "
    var jsonUrl = '';
    var sAction = '';
    var sParameter = '';
    var sTargetQuestion = '';
    var sNoParametersDefined = '';
    var sAdminEmailAddressNeeded = '" . gT("If you are using surveys with a closed participant group or notifications emails you need to set an administrator email address.", 'js') . "'
    var sURLParameters = '';
    var sAddParam = '';
",
    LSYii_ClientScript::POS_BEGIN
);
?>
<?php
$optionsQuestionIndex = array(
    0 => gT('Disabled', 'unescaped'),
    1 => gT('Incremental', 'unescaped'),
    2 => gT('Full', 'unescaped')
);
if ($bShowInherited) {
    $optionsQuestionIndex['-1'] = $oSurveyOptions->questionindex . " ᴵ";
}
$sEffectiveShowNoAnswer = isset($oSurvey->oOptions->shownoanswer)
    ? $oSurvey->oOptions->shownoanswer
    : $oSurvey->shownoanswer;
$bDisableNoAnswerPreselection = $sEffectiveShowNoAnswer !== 'Y';
... (412 lines truncated)
</file>

<file path="application/views/admin/survey/subview/accordion/_publication_panel.php">
<?php
echo viewHelper::getViewTestTag('surveyPublicationOptions');
 App()->getClientScript()->registerScript("publication-panel-variables", "
    var jsonUrl = '';
    var sAction = '';
    var sParameter = '';
    var sTargetQuestion = '';
    var sNoParametersDefined = '';
    var sAdminEmailAddressNeeded = '" . gT("If you are using token functions or notifications emails you need to set an administrator email address.", 'js') . "'
    var sURLParameters = '';
    var sAddParam = '';
    var expirationLowerThanStartError = '" . gT("Expiration date can't be lower than the start date") . "';
", LSYii_ClientScript::POS_BEGIN);
    ?>
<!-- Publication panel -->
<div id='publication-panel'>
    <?php if ($bShowAllOptions === true) { ?>
    <div class="row">
            <h2 class="h1"><?php eT("Publication date"); ?></h2>
            <!-- Start date/time -->
            <div class="col-lg-3 mb-3">
                <label class=" form-label" for='startdate'><?php  eT("Start date/time:"); ?></label>
                <div class=" has-feedback">
                    <?php Yii::app()->getController()->widget('ext.DateTimePickerWidget.DateTimePicker', array(
                            'name' => "startdate",
                            'id' => 'startdate',
                            'value' => ($oSurvey->startdate ? date($dateformatdetails['phpdate'] . " H:i", strtotime((string) getDateOfUTC($oSurvey->startdate))) : ''),
                            'pluginOptions' => array(
                                'format' => $dateformatdetails['jsdate'] . " HH:mm",
                                'allowInputToggle' => true,
... (130 lines truncated)
</file>

<file path="application/views/admin/survey/subview/accordion/_resources_panel.php">
<?php
echo viewHelper::getViewTestTag('surveyResources');
App()->getClientScript()->registerScript(
    "resources-panel-variables",
    "
var jsonUrl = '';
var sAction = '';
var sParameter = '';
var sTargetQuestion = '';
var sNoParametersDefined = '';
var sAdminEmailAddressNeeded = '" . gT("If you are using surveys with a closed participant group or notifications emails you need to set an administrator email address.", 'js') . "'
var sURLParameters = '';
var sAddParam = '';
",
    LSYii_ClientScript::POS_BEGIN
);
?>
<!-- resources panel -->
<div id='resources'>
    <div class="row">
        <!-- Export -->
        <div class="col-md-3">
            <?php
            echo TbHtml::dropDownList(
                'fileTypeShow',
                'fileTypeShow',
                array(
                    'files' => gT('Files', 'unescaped'),
                    'images' => gT('Images', 'unescaped')
                ),
... (40 lines truncated)
</file>

<file path="application/views/admin/survey/subview/accordion/_tokens_panel.php">
<?php
echo viewHelper::getViewTestTag('surveyParticipantTokenOptions');
App()->getClientScript()->registerScript(
    "tokens-panel-variables",
    "
    var jsonUrl = '';
    var sAction = '';
    var sParameter = '';
    var sTargetQuestion = '';
    var sNoParametersDefined = '';
    var sAdminEmailAddressNeeded = '" . gT(
        "If you are using participants or notification emails you need to set an administrator email address.",
        'js'
    ) . "'
    var sURLParameters = '';
    var sAddParam = '';
    function alertPrivacy()
    {
        if ($('#tokenanswerspersistence_opt1').is(':checked') == true) {
            const modal = new bootstrap.Modal(document.getElementById('alertPrivacy1'), {});
            modal.show();
            document.getElementById('anonymized').value = '0';
        }
        else if ($('#anonymized_1').is(':checked') == true) {
            const modal = new bootstrap.Modal(document.getElementById('alertPrivacy2'), {});
            modal.show();
        }
    }
    window.addEventListener('load', (event) => {
        document.getElementById('anonymized').addEventListener('change', (event) => {
... (247 lines truncated)
</file>

<file path="application/views/admin/survey/subview/surveydashboard/001-sharingpanel.twig">
<div class="card card-primary h-100">
    <!-- Default panel contents -->
    <div class="card-header">
        <h2 class="card-title h5">{{ gT("Share survey") }}</h2>
    </div>
    <!-- List group -->
    <ul class="list-group list-group-flush">
        <!-- Base language -->
        <li class="list-group-item p-0 border-0" id="adminsidepanel__surveysummary--mainLanguageLink">
            <div class="ls-flex-row col-12">
                <div class="col-4 card-label">
                    {{ getLanguageNameFromCode(oSurvey.language, false)}} ({{ gT("Base language") }}):
                </div>
                <div class="col-8 ls-card-grid__description">
                    {% if oSurvey.sid %} {# pseudo condition due to reverse parsing problems while generating twig admin cache via console.php twig generateAdminCache #}
                        {% set tmp_url = surveyUrls[oSurvey.language] %}
                    {% endif %}
                    <a class="ls-link" href='{{tmp_url}}' target='_blank'> {{tmp_url}} </a>
                </div>
            </div>
        </li>
        <!-- Additional languages  -->
        {% for langname in aAdditionalLanguages %}
        <li class="list-group-item p-0 border-0">
            <div class="ls-flex-row col-12">
               <div class="col-4 card-label">
                    {{ getLanguageNameFromCode(langname, false) ~ ":" }}
                </div>
                <div class="col-8 ls-card-grid__description">
                    {% if oSurvey.sid %} {# pseudo condition due to reverse parsing problems while generating twig admin cache via console.php twig generateAdminCache #}
... (217 lines truncated)
</file>

<file path="application/views/admin/survey/subview/surveydashboard/002-surveytextpanel.twig">
<!-- Survey's texts -->
<div class="card card-primary h-100">
    <!-- Default panel contents -->
    <div class="card-header">
        <h2 class="card-title h5">{{gT("Text elements")}}</h2>
        <a class="float-end btn btn-outline-secondary btn-xs pjax" data-bs-toggle="tooltip" title="{{ gT("Survey text elements") }}" href="{{ createUrl('surveyAdministration/rendersidemenulink', {'subaction': 'surveytexts', 'surveyid' : surveyid}) }}">
          <i class="ri-tools-line"></i>
        </a>
    </div>
    <!-- List group -->
    <ul class="list-group list-group-flush">
            <!-- Description -->
        <li class="list-group-item p-0 border-0">
            <div class="ls-flex-row col-12">
                <div class="col-4 card-label">
                    {{gT("Description:")}}
                </div>
                <div class="col-8 ls-card-grid__description">
                        {% if surveyTextContent.surveyls_description != '' %}
                            {{getTextDisplayWidget(surveyTextContent.surveyls_description, "description_text")}}
                        {% endif %}
                </div>
            </div>
        </li>
        <!-- Welcome -->
        <li class="list-group-item p-0 border-0">
            <div class="ls-flex-row col-12">
                <div class="col-4 card-label">
                    {{gT("Welcome:")}}
                </div>
... (65 lines truncated)
</file>

<file path="application/views/admin/survey/subview/surveydashboard/003-publicationpanel.twig">
<div class="card card-primary h-100">
    <div class="card-header">
        <h2 class="card-title h5">{{gT("Publication & access")}}</h2>
        <a class="float-end btn btn-outline-secondary btn-xs pjax" data-bs-toggle="tooltip" title="{{gT('Edit publication and access settings')}}" href="{{createUrl('surveyAdministration/rendersidemenulink', {'subaction':'publication', 'surveyid':surveyid})}}">
           <i class="ri-key-line"></i>
        </a>
    </div>
    <ul class="list-group list-group-flush">
        <!-- Start date/time -->
        <li class="list-group-item p-0 border-0">
            <div class="ls-flex-row col-12">
               <div class="col-4 card-label">
                    {{gT("Start date/time:")}}
                </div>
                <div class="col-8 ls-card-grid__description">
                    {{startdate}}
                </div>
            </div>
        </li>
        <!-- Expiration date/time -->
        <li class="list-group-item p-0 border-0">
            <div class="ls-flex-row col-12">
               <div class="col-4 card-label">
                    {{gT("Expiration date/time:")}}
                </div>
                <div class="col-8 ls-card-grid__description">
                    {{expdate}}
                </div>
            </div>
        </li>
... (14 lines truncated)
</file>

<file path="application/views/admin/survey/subview/surveydashboard/004-generalsettingspanel.twig">
<div class="card card-primary h-100">
    <div class="card-header d-flex justify-content-between align-items-center">
        <h2 class="card-title h5 mb-0">{{ gT("Survey general settings")}}</h2>
        <a class="btn btn-outline-secondary btn-xs pjax" data-bs-toggle="tooltip" title="{{gT('General survey settings')}}" aria-label="{{gT('General survey settings')}}" href="{{createUrl('surveyAdministration/rendersidemenulink', {'subaction':'generalsettings', 'surveyid':surveyid})}}">
            <i class="ri-tools-line" aria-hidden="true"></i>
        </a>
    </div>
    <ul class="list-group list-group-flush">
        <!-- Owner -->

        <li class="list-group-item p-0 border-0">
            <div class="ls-flex-row col-12">
               <div class="col-4 card-label">
                    {{gT("Owner:")}}
                </div>
                <div class="col-8 ls-card-grid__description">
                        {{ flattenText(oSurvey.aOptions['owner']['users_name'] ~ ' (' ~ oSurvey.aOptions['owner']['email'] ~ ')') }}
                </div>
            </div>
        </li>
        <!-- Administrator -->
        <li class="list-group-item p-0 border-0">
            <div class="ls-flex-row col-12">
               <div class="col-4 card-label">
                    {{gT("Administrator:")}}
                </div>
                <div class="col-8 ls-card-grid__description">
                        {{ flattenText(oSurvey.aOptions['admin'] ~ ' (' ~ oSurvey.aOptions['adminemail'] ~ ')') }}
                </div>
            </div>
... (31 lines truncated)
</file>

<file path="application/views/admin/survey/subview/surveydashboard/005-hintsandwarnings.twig">
<!-- Hints  -->
<div class="card card-primary border-left-danger h-100">
    <div class="card-header">
        <h2 class="card-title h5">{{gT("Hints and warnings")}}</h2>
    </div>
    <ul class="list-group list-group-flush">
        {% for warning in warnings %}
        <li class="list-group-item p-0 border-0">
            <div class="ls-flex-row col-12 text-warning">
                {{warning}}
            </div>
        </li>
        {% endfor %}
        {% for hint in hints %}
        <li class="list-group-item p-0 border-0">
            <div class="ls-flex-row col-12">
                {{hint}}
            </div>
        </li>
        {% endfor %}
    </ul>
</div>
</file>

<file path="application/views/admin/survey/subview/surveydashboard/006dbanalytics.twig">
<div class="card card-primary h-100">
    <div class="card-header">
        <h2 class="card-title h5">{{gT("Database usage")}}</h2>
    </div>
    <ul class="list-group list-group-flush">
        <!-- usage -->
        {% if tableusage != false %}
            {% if tableusage.dbtype == 'mysql' or tableusage.dbtype == 'mysqli' %}
                {% set column_usage = tableusage.column[0] / tableusage.column[1] * 100  %}
                {% set size_usage =  tableusage.size[0] / tableusage.size[1] * 100  %}
                <li class="list-group-item p-0 border-0">
                    <div class="ls-flex-row col-12">
                        <div class="col-4">
                            {{gT("Table column usage")}}:
                        </div>
                        <div class="col-8">
                            <div class='progressbar' style='width:{{column_usage | round}}%; height:15px;' name='{{column_usage | round(2) }}'></div>
                        </div>
                    </div>
                </li>
                <li class="list-group-item p-0 border-0">
                    <div class="ls-flex-row col-12">
                        <div class="col-4">
                            {{gT("Table size usage")}}
                        </div>
                        <div class="col-8">
                            <div class='progressbar' style='width:{{size_usage | round}}%; height:15px;' name='{{size_usage | round(2) }}'></div>
                        </div>
                    </div>
                </li>
... (23 lines truncated)
</file>

<file path="application/views/admin/survey/subview/_template_carousel.php">
<?php
 $count = 0;
 App()->getClientScript()->registerScriptFile(App()->getConfig('adminscripts') . 'jcarousel.min.js', LSYii_ClientScript::POS_BEGIN);
 App()->getClientScript()->registerScriptFile(App()->getConfig('adminscripts') . 'template.jcarousel.js', LSYii_ClientScript::POS_BEGIN);
?>
<div class="row template-caroussel">
    <div class="col-12" id='carrousel-container'>
        <div class="row">
            <div class="col-12" id="item-container"> <!-- width defined in css -->
                <h2 class="h4"><?php eT('Select your theme:'); ?></h2>
                <?php foreach ($templates as $key => $template) :?>
                    <?php if (Permission::model()->hasGlobalPermission('superadmin', 'read') || Permission::model()->hasGlobalPermission('templates', 'read') || hasTemplateManageRights(Yii::app()->session["loginID"], $key) == 1 || $oSurvey->template == htmlspecialchars((string) $key)) : ?>
                    <div class="item text-center <?php if ($key == $oSurvey->template) {
                        echo ' active ';
                                                 } else {
                                                     echo ' inactive ';
                                                 }?>" id="template-big-<?php echo $key;?>">
                        <?php echo $template['preview']; ?>
                            <h3><?php echo $key;?></h3>
                            <?php if ($key == $oSurvey->template) :?>
                                <button
                                    class="selectTemplate btn btn-outline-secondary btn-primary  disabled"
                                    data-selectedtext="<?php eT("Selected!");?>"
                                    data-unselectedtext="<?php eT('Select');?> &nbsp; <?php echo $key;?>">
                                        <?php eT('Selected!');?>
                                </button>
                            <?php else :?>
                                <button
                                    data-selectedtext="<?php eT("Selected!");?>"
                                    data-unselectedtext="<?php eT('Select');?> &nbsp; <?php echo $key;?>"
... (37 lines truncated)
</file>

<file path="application/views/admin/survey/subview/import_ressources_modal.php">
<?php
?>
  <div class="modal fade" id="importRessourcesModal" tabindex="-1" role="dialog" aria-labelledby="importRessourcesModalLabel">
    <div class="modal-dialog" role="document">
      <div class="modal-content">
        <div class="modal-header">
          <h2 class="modal-title h5" id="importRessourcesModalLabel"><?php eT("Import resources ZIP archive"); ?></h2>
          <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
        </div>
        <?php echo CHtml::form(array('surveyAdministration/importsurveyresources'), 'post', array('id' => 'importsurveyresources', 'name' => 'importsurveyresources', 'class' => 'form30', 'enctype' => 'multipart/form-data', 'onsubmit' => 'return window.LS.validatefilename(this,"' . gT('Please select a file to import!', 'js') . '");')); ?>
          <div class="modal-body">
            <input type='hidden' name='surveyid' value='<?php echo $surveyid; ?>' />
            <input type='hidden' name='action' value='importsurveyresources' />
            <div class="mb-3">
                <label class="form-label" for='the_file'><?php  eT("Select ZIP file:"); ?></label>
                <input id='the_file' class="form-control" name='the_file' type='file' />
            </div>
          </div>
          <div class="modal-footer">
            <button type="button" class="btn btn-cancel" data-bs-dismiss="modal"><?php  eT("Cancel");?></button>
            <!--TODO: Im not sure what this button does -->
            <input type='button' class="btn btn-primary" value='<?php  eT("Import"); ?>' <?php echo $ZIPimportAction; ?> />
          </div>
        </form>
    </div>
  </div>
</div>
</file>

<file path="application/views/admin/survey/subview/tab_edit_view_datasecurity.php">
<?php
if (isset($data)) {
    extract($data);
}
$count = 0;
if (isset($scripts)) {
    echo $scripts;
}
$iSurveyID = Yii::app()->request->getParam('surveyid');
Yii::app()->session['FileManagerContext'] = "edit:survey:{$iSurveyID}";
initKcfinder();
PrepareEditorScript(false, $this);
?>
<!-- security notice -->
<div class="row mb-3">
    <div class="col-lg-6">
        <label class="form-label" id="showsurveypolicynotice-label">
            <?php eT("Show privacy policy text with mandatory checkbox:"); ?>
        </label>
        <div>
            <div class="btn-group" data-bs-toggle="buttons" role="radiogroup" aria-labelledby="showsurveypolicynotice-label">
                <input class="btn-check" type="radio" id="showsurveypolicynotice_0" name="showsurveypolicynotice"
                       value="0" <?= $oSurvey->showsurveypolicynotice == 0 ? 'checked' : '' ?> autocomplete="off">
                <label for="showsurveypolicynotice_0" class="btn btn-outline-secondary">
                    <?= gT("Off"); ?>
                </label>
                <input class="btn-check" type="radio" id="showsurveypolicynotice_1" name="showsurveypolicynotice"
                       value="1" <?= $oSurvey->showsurveypolicynotice == 1 ? 'checked' : '' ?> autocomplete="off">
                <label for="showsurveypolicynotice_1" class="btn btn-outline-secondary">
                    <?= gT("Inline"); ?>
... (68 lines truncated)
</file>

<file path="application/views/admin/survey/subview/tab_edit_view.php">
<?php
if (isset($data)) {
    extract($data);
}
if (isset($scripts)) {
    echo $scripts;
    $iSurveyID = App()->request->getParam('surveyid');
    App()->session['FileManagerContext'] = "edit:survey:{$iSurveyID}";
    initKcfinder();
}
$cs = Yii::app()->getClientScript();
$cs->registerPackage('select2-bootstrap');
$adminlang = Yii::app()->session['adminlang'];
$aTabContents = $this->aData['aTabContents'];
$aTabTitles = $this->aData['aTabTitles'];
$count = 0;
PrepareEditorScript(false, $this);
?>
<!-- Text Elements Tabs -->
<ul class="nav nav-tabs" id="edit-survey-text-element-language-selection" role="tablist">
    <?php foreach ($aTabTitles as $i => $title) : ?>
        <li role="presentation" class="nav-item">
            <a class="nav-link <?= ($count === 0 || (strpos((string) $title, ' (' . gT("Base language") . ')'))) ? "active" : "" ?>"
               data-bs-toggle="tab"
               role="tab"
               href="#edittxtele-<?php echo $count;
                $count++; ?>">
                <?php echo $title; ?>
            </a>
        </li>
... (16 lines truncated)
</file>

<file path="application/views/admin/survey/topbar/topbar_view.php">
<div id="vue-topbar-container" class="container-fluid vue-general-topbar" style="width: 100%; padding: 0; margin: 0;">
    <topbar
        initialsid='<?=$sid?>'
        initialtype='<?=$topBar['type']?>'
    />
</div>
</file>

<file path="application/views/admin/survey/copySurvey_view.php">
<?php
?>
<!-- Copy Error -->
<?php if (isset($aImportResults['error']) && $aImportResults['error'] != false) : ?>
    <div class="jumbotron message-box message-box-error">
        <h2 ><?php eT("Copy survey"); ?></h2>
        <p class="lead text-danger"><?php eT("Error"); ?></p>
        <p><?php echo $aImportResults['error']; ?></p>
        <p>
        <input type='submit' class="btn btn-outline-secondary btn-large" value='<?php eT("Main admin screen"); ?>' onclick="window.open('<?php echo $this->createUrl('admin'); ?>', '_top')" />
        <?php $importerror = true; ?>
        </p>
    </div>
<?php else : ?>
<!-- Copy success -->
<div class="jumbotron message-box ">
    <h2> <?php eT("Success"); ?></h2>
    <p class="lead"><?php eT("Survey import summary"); ?></p>
    <p>
        <ul style="text-align:left;">
        <li><?php eT("Surveys:"); ?> <?php echo $aImportResults['surveys']; ?></li>
        <li><?php eT("Languages:"); ?> <?php echo $aImportResults['languages']; ?></li>
        <li><?php eT("Question groups:"); ?> <?php echo $aImportResults['groups']; ?></li>
        <li><?php eT("Questions:"); ?> <?php echo $aImportResults['questions']; ?></li>
        <li><?php eT("Answers:"); ?> <?php echo $aImportResults['answers']; ?></li>
        <?php if (isset($aImportResults['subquestions'])) { ?>
            <li><?php eT("Subquestions:"); ?> <?php echo $aImportResults['subquestions']; ?></li>
        <?php }
        if (isset($aImportResults['defaultvalues'])) { ?>
            <li><?php eT("Default answers:"); ?> <?php echo $aImportResults['defaultvalues']; ?></li>
... (35 lines truncated)
</file>

<file path="application/views/admin/survey/editDataSecurityLocalSettings_view.php">
<?php
echo viewHelper::getViewTestTag('surveyTexts');
?>
<?php App()->getClientScript()->registerScript(
    "editLocalSettings-view-variables",
    "
    var jsonUrl = '';
    var sAction = '';
    var sParameter = '';
    var sTargetQuestion = '';
    var sNoParametersDefined = '';
    var sAdminEmailAddressNeeded = '" .
        gT("If you are using surveys with a closed participant group or notifications emails you need to set an administrator email address.", 'js') . "'
    var sURLParameters = '';
    var sAddParam = '';
    ",
    LSYii_ClientScript::POS_BEGIN
); ?>
<div id="editdatasecele-<?php echo $i; ?>" class="tab-pane fade <?php if ($i == 0) {
                                                                    echo "show active";
                                                                } ?> center-box" role="tabpanel" aria-label="<?= CHtml::encode(gT('Privacy policy settings') . ' - ' . getLanguageNameFromCode($aSurveyLanguageSettings['surveyls_language'], false)) ?>">
    <div class="row mt-4">
        <div class="col-12 col-xl-6 mb-3">
            <!-- Privacy policy checkbox label -->
            <label class="form-label" for="dataseclabel_<?php echo $aSurveyLanguageSettings['surveyls_language']; ?>">
    <?php eT("Privacy policy checkbox label:"); ?>
</label>
            <?php echo CHtml::textField(
                "dataseclabel_{$aSurveyLanguageSettings['surveyls_language']}",
                $aSurveyLanguageSettings['surveyls_policy_notice_label'],
... (50 lines truncated)
</file>

<file path="application/views/admin/survey/editLocalSettings_view.php">
<?php
echo viewHelper::getViewTestTag('surveyTexts');
?>
<?php App()->getClientScript()->registerScript(
    "editLocalSettings-view-variables",
    "
    var jsonUrl = '';
    var sAction = '';
    var sParameter = '';
    var sTargetQuestion = '';
    var sNoParametersDefined = '';
    var sAdminEmailAddressNeeded = '" . gT("If you are using token functions or notifications emails you need to set an administrator email address.", 'js') . "'
    var sURLParameters = '';
    var sAddParam = '';
",
    LSYii_ClientScript::POS_BEGIN
); ?>
<div id="edittxtele-<?= $i ?>" class="tab-pane fade <?= $i == 0 ? "show active" : "" ?> center-box">
    <div class="row mb-3">
        <div class="col-lg-6">
            <!-- Survey title -->
            <label class=" question-group-title form-label" for="short_title_<?= $aSurveyLanguageSettings['surveyls_language'] ?>">
                <?php eT("Survey title:"); ?>
            </label>
            <?php echo CHtml::textField(
                "short_title_{$aSurveyLanguageSettings['surveyls_language']}",
                $aSurveyLanguageSettings['surveyls_title'],
                array(
                    'class' => 'form-control', 'size' => "80", 'maxlength' => 200,
                    'id' => "short_title_{$aSurveyLanguageSettings['surveyls_language']}"
... (147 lines truncated)
</file>

<file path="application/views/admin/survey/newSurveyBrowserMessage.php">
<script type="text/javascript">
    alert('<?php eT("To be able to upload images or other content you have to save your survey once first.");?>');
    self.close();
</script>
</file>

<file path="application/views/admin/survey/organizeGroupsAndQuestions_view.php">
<?php
App()->getClientScript()->registerPackage('jquery-nestedSortable');
App()->getClientScript()->registerScriptFile(App()->getConfig('adminscripts') . 'organize.js', LSYii_ClientScript::POS_BEGIN);
App()->getClientScript()->registerCssFile(Yii::app()->getConfig('publicstyleurl') . 'organize.css');
?>
<div id='edit-survey-text-element' class='side-body'>
    <div class='row'>
        <div class='col-md-8'>
            <?php
            $this->widget('ext.AlertWidget.AlertWidget', [
                    'header' => gT("Reordering"),
                    'text' => gT("To reorder questions/questiongroups just drag the question/group with your mouse to the desired position.") . ' ' .
                        gT("Alternatively, use the move up and move down buttons.") . ' ' .
                        ($surveyActivated ? gT("Survey is activated, you can not move a question to another group.") : "") . ' ' .
                        gT("After you are done, please click the 'Save' button to save your changes."),
                    'type' => 'info',
            ]);
            ?>
        </div>
        <div class='col-md-4'>
            <button id='organizer-collapse-all' class='btn btn-outline-secondary'><span class='ri-contract-up-down-line'></span>&nbsp;<?php eT("Collapse all"); ?></button>
            <button id='organizer-expand-all' class='btn btn-outline-secondary'><span class='ri-expand-up-down-line'></span>&nbsp;<?php eT("Expand all"); ?></button>
        </div>
    </div>
    <div class='movableList'>
        <ol class="organizer group-list list-unstyled" data-level='group' data-disableparentchange='<?= intval($surveyActivated) ?>'>
            <?php
            foreach ($aGroupsAndQuestions as $aGroupAndQuestions) { ?>
                <?php $groupName = trim(strip_tags((string) $aGroupAndQuestions['group_text'])); ?>
                <li id='list_g<?php echo $aGroupAndQuestions['gid']; ?>' class='card mjs-nestedSortable-expanded mt-2' data-level='group'>
... (53 lines truncated)
</file>

<file path="application/views/admin/survey/prepareEditorScript_view.php">
<!--<script type="text/javascript" src="<?php echo Yii::app()->getConfig('sCKEditorURL'); ?>/ckeditor.js"></script>-->
<?php
Yii::app()->getClientScript()->registerPackage('ckeditor');
Yii::app()->getClientScript()->registerPackage('ckeditoradditions');
Yii::app()->getClientScript()->registerPackage('modaleditor');
$ckeditorHandlers = "
    CKEDITOR.on('dialogDefinition', function (ev) {
        var dialogName = ev.data.name;
        var dialogDefinition = ev.data.definition;
        // Remove upload tab from Link, Image and HTML5 video dialog as it interferes with
        // CSRF protection and upload can be reached using the browse server tab
        if ( dialogName == 'link')
        {
           // remove Upload tab
           dialogDefinition.removeContents( 'upload' );
        }
        if ( dialogName == 'image' || dialogName == 'html5video')
        {
           // remove Upload tab
           dialogDefinition.removeContents( 'Upload' );
        }
    });
    ";
$ckeditorHandlers .= "CKEDITOR.on('instanceReady', function(event) {
        var textareaId = event.editor.element.getId();
        $('#'+textareaId+'_htmleditor_loader').remove();
        event.editor.dataProcessor.writer.setRules( 'br', { breakAfterOpen: 0 } );
    });
    ";
$script = "
... (78 lines truncated)
</file>

<file path="application/views/admin/survey/printablesurvey_view.php">
<?php
echo '<link rel="stylesheet" type="text/css" href="' . getTemplateURL(Yii::app()->getConfig('defaulttheme')) . '/print_template.css" />';
echo $surveydesc . "<br />";
echo $welcome . "<br /><br />";
echo $numques;
foreach ($survey_output as $key => $val) {
    if ($key == "GROUPS") {
        echo "$val<br>";
    }
}
echo $survey_output['END'] . "<br />";
echo $survey_output['SUBMIT_BY'] . "<br /><br />";
echo $survey_output['SUBMIT_TEXT'];
echo "<br />";
echo $survey_output['THANKS'];
</file>

<file path="application/views/admin/survey/queXMLSurvey_view.php">
<div class='side-body'>
    <?php echo CHtml::form(["admin/export/sa/quexml/surveyid/{$surveyid}/"], 'post'); ?>
    <h3 class="col-12">
        <?php eT("queXML PDF export"); ?>
        <button role="button" type='submit' class="btn btn-primary float-end">
            <?php eT("queXML PDF export"); ?>
        </button>
    </h3>
    <div class="mb-3 row"><label class="form-label" for='save_language'><?php eT("Language selection"); ?></label>
        <div class="">
            <select class="form-select" name='save_language'>
                <?php foreach ($slangs as $lang) {
                    if ($lang == $baselang) { ?>
                        <option value='<?php echo $lang; ?>'
                                selected='selected'><?php echo getLanguageNameFromCode($lang, false); ?></option>
                    <?php } else { ?>
                        <option value='<?php echo $lang; ?>'><?php echo getLanguageNameFromCode($lang,
                                false); ?></option>
                    <?php }
                } ?>
            </select>
        </div>
    </div>
    <div class="row">
        <div class="mb-3 col-12"><label class="form-label" for='queXMLStyle'><?php eT("Style:"); ?></label>
            <div class="">
                <textarea class="form-control" rows="10" id='queXMLStyle'
                          name='queXMLStyle'><?php echo $queXMLStyle; ?> </textarea>
            </div>
        </div>
... (184 lines truncated)
</file>

<file path="application/views/admin/survey/surveybar_addgroupquestion.php">
<?php
?>
<!-- Add a new group -->
<?php if (isset($surveybar['buttons']['newgroup'])) :?>
    <?php if ($oSurvey->isActive) : ?>
        <span class="btntooltip" data-bs-toggle="tooltip" data-bs-placement="bottom" title="<?php eT("This survey is currently active."); ?>" style="display: inline-block" data-bs-toggle="tooltip" data-bs-placement="bottom" title="<?php eT('Survey cannot be activated. Either you have no permission or there are no questions.'); ?>">
            <button type="button" class="btn btn-outline-secondary btntooltip" disabled="disabled">
                <i class="ri-add-circle-fill"></i>
                <?php eT("Add new group"); ?>
            </button>
        </span>
    <?php elseif (Permission::model()->hasSurveyPermission($oSurvey->sid, 'surveycontent', 'create')) : ?>
        <a class="btn btn-outline-secondary" href="<?php echo $this->createUrl("questionGroupsAdministration/add/surveyid/$oSurvey->sid"); ?>" role="button">
            <i class="ri-add-circle-fill"></i>
            <?php eT("Add new group"); ?>
        </a>
        <a class="btn btn-outline-secondary" href="<?php echo $this->createUrl("questionGroupsAdministration/importview/surveyid/$oSurvey->sid"); ?>" role="button">
            <span class="ri-download-2-fill"></span>
            <?php eT("Import a group"); ?>
        </a>
    <?php endif; ?>
<?php endif; ?>
<!-- Add a new question -->
<?php if (isset($surveybar['buttons']['newquestion'])) :?>
    <?php if ($oSurvey->isActive) : ?>
        <span class="btntooltip" data-bs-toggle="tooltip" data-bs-placement="bottom" title="<?php eT("This survey is currently active."); ?>" style="display: inline-block" data-bs-toggle="tooltip" data-bs-placement="bottom" title="<?php eT('Survey cannot be activated. Either you have no permission or there are no questions.'); ?>">
            <button type="button" class="btn btn-outline-secondary btntooltip" disabled="disabled">
                <i class="ri-add-circle-fill"></i>
                <?php eT("Add new question"); ?>
            </button>
... (23 lines truncated)
</file>

<file path="application/views/admin/survey/surveybar_displayexport.php">
<?php
?>
<?php
    $aExportItemsArray = [];
    $aExportItemsArray["surveystructure"] = [
        "key" => "surveystructure",
        "title" => "" . gT("Survey structure (.lss)"),
        "detailpage" => "<p>" . gT("This export will dump all the groups, questions, answers and conditions for your survey into a .LSS file (which is basically an XML file). This dump file can be used with the 'Import survey' feature when creating a new survey.", 'json') . "</p>"
        . "<p>" . gT("A survey which uses a custom theme will import fine, but the template it refers to will not exist on the new server. In that case the system will use the global default theme.", 'json') . "</p>"
        . "<p><b>" . gT("Please note: This file does not contain any collected responses.", 'json') . "</b></p>",
        "href" => $this->createUrl("admin/export/sa/survey/action/exportstructurexml/surveyid/" . $oSurvey->sid),
        "download" => true,
    ];
    if (
        $hasResponsesExportPermission
        && $hasSurveyExportPermission
        && (!$oSurvey->hasTokensTable || $hasTokensExportPermission)
    ) {
        $aExportItemsArray["surveyarchive"] = ($oSurvey->isActive)
        ? [
            "key" => "surveyarchive",
            "title" => "" . gT("Survey archive (.lsa)", 'json'),
            "detailpage" => "
            <p>" . gT("This export is intended to create a complete backup of an active survey for archival purposes.", 'json') . "</p>
            <p>" . gT("It will include the following data in a ZIP file ending with '.lsa'.", 'json') . "</p>
            <ul>
                <li>" . gT("Survey structure", 'json') . "</li>
                <li>" . gT("Response data (Attention: Doesn't include files uploaded in a file upload question. These have to be exported separately.)", 'json') . "</li>
                <li>" . gT("Survey participant data (if available)", 'json') . "</li>
                <li>" . gT("Timings (if activated)", 'json') . "</li>
... (158 lines truncated)
</file>

<file path="application/views/admin/survey/surveybar_plugins.php">
<?php
?>
<?php ?>
<?php ?>
<?php foreach ($beforeSurveyBarRender as $menu) : ?>
    <div class='btn-group'>
        <?php if ($menu->isDropDown()) : ?>
        <button class="dropdown-toggle btn btn-outline-secondary" data-bs-toggle="dropdown" href="#">
              <?php if ($menu->getIconClass()) : ?>
                  <span class="<?php echo $menu->getIconClass(); ?>"></span>&nbsp;
              <?php endif; ?>
              <?php echo $menu->getLabel(); ?>
              &nbsp;
              <span class="caret"></span>
            </button>
            <ul class="dropdown-menu" role="menu">
                <?php foreach ($menu->getMenuItems() as $menuItem) : ?>
                    <?php if ($menuItem->isDivider()) : ?>
                        <li class="dropdown-divider"></li>
                    <?php elseif ($menuItem->isSmallText()) : ?>
                        <li class="dropdown-header" role="presentation"><?php echo $menuItem->getLabel(); ?></li>
                    <?php else : ?>
                        <li>
                            <a href="<?php echo $menuItem->getHref(); ?>">
                                <!-- Spit out icon if present -->
                                <?php if ($menuItem->getIconClass() != '') : ?>
                                  <span class="<?php echo $menuItem->getIconClass(); ?>">&nbsp;</span>
                                <?php endif; ?>
                                <?php echo $menuItem->getLabel(); ?>
                            </a>
... (15 lines truncated)
</file>

<file path="application/views/admin/survey/surveybar_rightactionbuttons.php">
<?php
?>
<div class=" col-lg-4 text-end">
    <?php if (isset($surveybar['savebutton']['form'])) :?>
        <!-- Save -->
        <button class="btn btn-primary" href="#" type="button" id="save-button">
            <span class="ri-check-fill"></span>
            <?php if (isset($surveybar['savebutton']['text'])) {
                echo $surveybar['savebutton']['text'];
            } else {
                eT("Save");
            }?>
        </button>
        <?php if (isset($surveybar['importquestiongroup'])) :?>
            <?php
                $paramArray = array();
                $paramArray["surveyid"] = $surveyid;
                $saveAndNewLink = $this->createUrl("questionGroupsAdministration/add/", $paramArray);
                $saveAndAddQuestionLink = $this->createUrl("questionAdministration/view/", $paramArray);
            ?>
            <button class="btn btn-primary" id='save-and-new-question-button' href="<?php echo $saveAndAddQuestionLink ?>" type="button">
                <span class="ri-check-fill"></span>
                <?php eT("Save & add new question"); ?>
            </button>
            <button class="btn btn-primary" id='save-and-new-button' href="<?php echo $saveAndNewLink ?>" type="button">
                <span class="ri-check-fill"></span>
                <?php eT("Save & add new group"); ?>
            </button>
        <?php endif; ?>
        <?php if (isset($surveybar['importquestion'])) :?>
... (16 lines truncated)
</file>

<file path="application/views/admin/survey/surveybar_statistics.php">
<?php
?>
<div class="btn-group">
    <!-- main  dropdown header -->
    <?php if ($oSurvey->isActive) :?>
        <button type="button" class="btn btn-outline-secondary dropdown-toggle" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
            <span class="ri-exchange-funds-fill"></span>
            <?php eT("Responses"); ?><span class="caret"></span>
        </button>
    <?php else :?>
        <button type="button" data-bs-toggle="tooltip" data-bs-placement="bottom" title="<?php eT("This survey is not active - no responses are available."); ?>" class="readonly btn btn-outline-secondary">
            <span class="ri-exchange-funds-fill"></span>
            <?php eT("Responses"); ?><span class="caret"></span>
        </button>
    <?php endif; ?>
    <!-- dropdown -->
    <ul class="dropdown-menu">
        <?php if ($respstatsread && $oSurvey->isActive) :?>
            <!-- Responses & statistics -->
            <li>
                <a class="pjax" href='<?php echo $this->createUrl("responses/index/", ['surveyId' => $oSurvey->sid]);?>' >
                    <span class="ri-window-fill"></span>
                    <?php eT("Responses & statistics"); ?>
                </a>
            </li>
        <?php endif; ?>
        <?php if ($responsescreate && $oSurvey->isActive) : ?>
            <!-- Data entry screen -->
            <li>
                <a href='<?php echo $this->createUrl("admin/dataentry/sa/view/surveyid/$oSurvey->sid"); ?>' >
... (17 lines truncated)
</file>

<file path="application/views/admin/survey/surveybar_tools.php">
<?php
?>
<div class="btn-group d-none d-md-block">
    <!-- Main button dropdown -->
    <button id="ls-tools-button" type="button" class="btn btn-outline-secondary dropdown-toggle" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
        <span class="ri-tools-fill"></span>
        <?php eT('Tools'); ?><span class="caret"></span>
    </button>
    <!-- dropdown -->
    <ul class="dropdown-menu">
        <?php if ($surveydelete) : ?>
            <!-- Delete survey -->
            <li>
                <a href="#deleteSurvey_modal"
                    data-bs-toggle="modal"
                    data-bs-target="#deleteSurvey_modal"
                    onclick="deleteSurveyConfirm(<?php echo (int) $oSurvey->sid; ?>)">
                    <span class="ri-delete-bin-fill text-danger"></span>
                    <?php eT("Delete survey"); ?>
                </a>
            </li>
        <?php endif; ?>
        <?php if ($surveytranslate) : ?>
            <!-- surveytranslate -->
            <?php if ($hasadditionallanguages) : ?>
                <!-- Quick-translation -->
                <li>
                    <a href="<?php echo $this->createUrl("quicktranslation/index/surveyid/{$oSurvey->sid}"); ?>">
                        <span class="ri-global-line"></span>
                        <?php eT("Quick-translation"); ?>
... (102 lines truncated)
</file>

<file path="application/views/admin/SurveyFiles/_copymove.php">

</file>

<file path="application/views/admin/SurveyFiles/_jsVariables.php">
<script>
    window.FileManager = <?=json_encode($data)?>;
</script>
</file>

<file path="application/views/admin/SurveyFiles/_upload.php">

</file>

<file path="application/views/admin/SurveyFiles/surveyview.php">
<?php
?>
<?php $this->renderPartial("/admin/SurveyFiles/_jsVariables", ['data' => $jsData]); ?>
<div class='side-body'>
    <div class="container-fluid">
        <div id="limeSurveyFileManager"><filemanager <?=(isset($presetFolder) ? ' preset-folder="' . $presetFolder . '" ' : '')?> /></div>
    </div>
</div>
</file>

<file path="application/views/admin/SurveyFiles/view.php">
<?php
?>
<?php $this->renderPartial("/admin/SurveyFiles/_jsVariables", ['data' => $jsData]); ?>
<div class="pagetitle h3"><?php eT("File management");?></div>
<div class="row" style="margin-bottom: 100px">
    <div class="container-fluid">
        <div id="limeSurveyFileManager"><filemanager /></div>
    </div>
</div>
</file>

<file path="application/views/admin/surveymenu/massive_action/_selector.php">
<?php
?>
<!-- Rendering massive action widget -->
<?php
    $buttons = array();
if (Permission::model()->hasGlobalPermission('settings', 'update')) {
    $buttons[] = array(
        'type'        => 'action',
        'action'      => 'delete',
        'url'         =>  App()->createUrl('/admin/menus/sa/massDelete/'),
        'iconClasses' => 'ri-delete-bin-fill text-danger',
        'text'        =>  gT('Delete'),
        'grid-reload' => 'yes',
        'actionType'    => 'modal',
        'modalType'     => 'cancel-delete',
        'keepopen'      => 'no',
        'sModalTitle'   => gT('Delete menus'),
        'htmlModalBody' => gT('Are you sure you want to delete the selected menus and all related submenus and entries?'),
        'aCustomDatas'  => array(),
    );
}
if (Permission::model()->hasGlobalPermission('settings', 'update')) {
    $buttons[] = array(
        'type' => 'action',
        'action' => 'batchEdit',
        'url' => App()->createUrl('/admin/menus/sa/batchEdit/'),
        'iconClasses' => 'ri-download-fill',
        'text' => gT('Batch edit'),
        'grid-reload' => 'yes',
        'actionType' => 'modal',
... (17 lines truncated)
</file>

<file path="application/views/admin/surveymenu/massive_action/_update_results.php">
<?php
?>
<?php if (!$aResults['global']['result']) :?>
    <strong>
        <?php echo $aResults['global']['message'] ;?>
    </strong>
<?php else : ?>
    <?php unset($aResults['global']); ?>
    <table class="table table-striped">
        <caption class="visually-hidden"><?php eT('Survey menu batch edit results'); ?></caption>
        <thead>
            <th><?php eT('Survey menu entry ID');?></th>
            <th><?php eT('Status');?></th>
        </thead>
        <tbody>
            <?php foreach ($aResults as $iSurveyMenuEntryId => $result) :?>
                <tr>
                    <td>
                        <?php echo $iSurveyMenuEntryId;?>
                    </td>
                    <?php if ($result['status'] === true) :?>
                        <td class="text-success">
                            <?php echo $result['message']; ?>
                        </td>
                    <?php else : ?>
                        <td class="text-danger">
                            <?php echo $result['message']; ?>
                        </td>
                    <?php endif;?>
                </tr>
... (5 lines truncated)
</file>

<file path="application/views/admin/surveymenu/massive_action/_update.php">
<?php
?>
<?php
    $model = Surveymenu::model();
?>
<form class="custom-modal-datas form form-horizontal">
	<div class="container-fluid">
        <fieldset class="mb-0" aria-labelledby="massedit-menu-modify-legend">
            <legend id="massedit-menu-modify-legend" class="visually-hidden"><?php eT("Modify"); ?></legend>
            <div class="ex-form-group mb-3">
                <div class="col-md-1">
                    <span class="form-label"><?php eT("Modify"); ?></span>
                </div>
                <div class="col-md-11"></div>
            </div>
            <div class="ex-form-group mb-3">
                <div class="col-md-1">
                    <input
                        type="checkbox"
                        id="massedit_menu_position_modify"
                        class="action_check_to_keep_old_value"
                        aria-labelledby="massedit_menu_position_fieldlabel" />
                </div>
                <label id="massedit_menu_position_fieldlabel" class="col-md-3 form-label" for="position"><?php eT("Position:"); ?></label>
                <div class="col-md-8">
                    <?php echo TbHtml::dropDownList('position', 'lskeep', ['lskeep' => gT('Keep old value')] + $model->getPositionOptions(), ['id' => 'position', 'disabled' => 'disabled', 'class' => 'form-select custom-data selector_submitField']); ?>
                </div>
            </div>
            <div class="ex-form-group mb-3">
                <div class="col-md-1">
... (57 lines truncated)
</file>

<file path="application/views/admin/surveymenu/partial/topbarBtns/leftSideButtons.php">
<?php
$this->widget(
    'ext.ButtonWidget.ButtonWidget',
    [
        'name' => 'createnewmenu',
        'id' => 'createnewmenu',
        'text' => gT('New menu'),
        'icon' => 'icon-add',
        'htmlOptions' => [
            'class' => 'btn btn-primary tab-dependent-button',
            'data-tab' => '#surveymenues'
        ],
    ]
);
$this->widget(
    'ext.ButtonWidget.ButtonWidget',
    [
        'name' => 'createnewmenuentry',
        'id' => 'createnewmenuentry',
        'text' => gT('New menu entry'),
        'icon' => 'icon-add',
        'htmlOptions' => [
            'class' => 'btn btn-primary tab-dependent-button',
            'title' => gT('Add new menu entry'),
            'data-tab' => '#surveymenuentries',
            'style' => 'display:none;'
        ],
    ]
);
</file>

<file path="application/views/admin/surveymenu/partial/topbarBtns/rightSideButtons.php">
<?php
if ($resetPermission) {
    $this->widget(
        'ext.ButtonWidget.ButtonWidget',
        [
            'name' => 'restoreBtn',
            'id' => 'restoreBtn',
            'text' => gT('Reset'),
            'icon' => 'ri-refresh-line',
            'htmlOptions' => [
                'class' => 'btn btn-warning',
            ],
        ]
    );
}
$this->widget(
    'ext.ButtonWidget.ButtonWidget',
    [
        'name' => 'reorderentries',
        'id' => 'reorderentries',
        'text' => gT('Reorder'),
        'icon' => 'ri-refresh-line',
        'htmlOptions' => [
            'class' => 'btn btn-warning',
        ],
    ]
);
</file>

<file path="application/views/admin/surveymenu/_form.php">
<?php
?>
<?php
    $form = $this->beginWidget('TbActiveForm', array(
    'id' => 'surveymenu-form',
    'enableAjaxValidation' => false,
    'htmlOptions' => ['class' => 'form '],
    'action' => Yii::app()->getController()->createUrl('admin/menus/sa/update', ['id' => $model->id])
    ));
    $modalTitle = $model->isNewRecord ? gT('Create new survey menu') : gT('Edit survey menu');
    Yii::app()->getController()->renderPartial(
        '/layouts/partial_modals/modal_header',
        ['modalTitle' => $modalTitle]
    );
    ?>
    <div class="modal-body">
        <div class="container-fluid">
            <?php ?>
            <?php if (!$model->isNewRecord && $model->id == '1') :?>
                <?php
                $this->widget('ext.AlertWidget.AlertWidget', [
                    'header' => gT("You are editing the main menu!"),
                    'text' =>  gT("Please be very careful."),
                    'type' => 'danger',
                ]);
                ?>
            <?php endif; ?>
            <p class="note"><?php printf(gT('Fields with %s are required.'), '<span class="required">*</span>'); ?></p>
            <?php
            $this->widget('ext.AlertWidget.AlertWidget', ['errorSummaryModel' => $model]);
... (68 lines truncated)
</file>

<file path="application/views/admin/surveymenu/create.php">
<?php
$this->breadcrumbs = array(
    'Surveymenus' => array('index'),
    'Create',
);
$this->menu = array(
    array('label' => 'List Surveymenu', 'url' => array('index')),
    array('label' => 'Manage Surveymenu', 'url' => array('admin')),
);
?>
<h1>Create Surveymenu</h1>
<?php $this->renderPartial('_form', array('model' => $model)); ?>
</file>

<file path="application/views/admin/surveymenu/index.php">
<?php
$pageSize = Yii::app()->user->getState('pageSize', Yii::app()->params['defaultPageSize']);
echo viewHelper::getViewTestTag('surveyMenus');
?>
<div class="row">
    <div class="col-12">
        <!-- Tabs -->
        <ul class="nav nav-tabs" id="menueslist" role="tablist">
            <li class="nav-item">
                <a id="menueslist-tab-surveymenues" class="nav-link active" role="tab" data-bs-toggle="tab" href="#surveymenues" aria-controls="surveymenues" aria-selected="true" tabindex="0">
                    <?php eT('Survey menus'); ?>
                </a>
            </li>
            <li class="nav-item">
                <a id="menueslist-tab-surveymenuentries" class="nav-link" role="tab" data-bs-toggle="tab" href="#surveymenuentries" aria-controls="surveymenuentries" aria-selected="false" tabindex="-1">
                    <?php eT('Survey menu entries'); ?>
                </a>
            </li>
        </ul>
        <!-- Tab Content -->
        <div class="tab-content">
            <!-- Survey Menu -->
            <div id="surveymenues" class="tab-pane show active" role="tabpanel" aria-labelledby="menueslist-tab-surveymenues">
                <div class="col-12 ls-space margin top-15">
                    <div class="col-12 ls-flex-item">
                        <?php
                        require_once Yii::getPathOfAlias('application.extensions.admin.grid.FloatingActionsWidget.actions.SurveyMenuListMassiveActions') . '.php';
                        $floatingActions = \actions\SurveyMenuListMassiveActions::getActions();
                        $this->widget('ext.admin.grid.FloatingActionsWidget.FloatingActionsWidget', [
                            'pk' => 'id',
... (116 lines truncated)
</file>

<file path="application/views/admin/surveymenu/shortlist.php">
<?php
$pageSize = Yii::app()->user->getState('pageSize', Yii::app()->params['defaultPageSize']);
?>
<div class="ls-flex-column">
    <h2 class="col-12 h3 pagetitle" ><?php eT('Survey menu') ?></h2>
    <div class="ls-flex-row">
        <div class="col-12 ls-flex-item">
            <?php
            $this->widget(
                'application.extensions.admin.grid.CLSGridView',
                [
                    'dataProvider'  => $model->search(),
                    'id'            => 'surveymenu-shortlist-grid',
                    'columns'       => $model->getShortListColumns(),
                    'lsCaption'       => gT('Survey menu'),
                    'emptyText'     => gT('No customizable entries found.'),
                    'lsPageSizeCurrentValue' => $pageSize,
                   'ajaxUpdate' => 'surveymenu-shortlist-grid'
                ]
            );
            ?>
        </div>
    </div>
</div>
</file>

<file path="application/views/admin/surveymenu/update.php">
<?php
$this->breadcrumbs = array(
    'Surveymenus' => array('index'),
    $model->title => array('view','id' => $model->id),
    'Update',
);
$this->menu = array(
    array('label' => 'List Surveymenu', 'url' => array('index')),
    array('label' => 'Create Surveymenu', 'url' => array('create')),
    array('label' => 'View Surveymenu', 'url' => array('view', 'id' => $model->id)),
    array('label' => 'Manage Surveymenu', 'url' => array('admin')),
);
?>
<h1>Update Surveymenu <?php echo $model->id; ?></h1>
<?php $this->renderPartial('_form', array('model' => $model)); ?>
</file>

<file path="application/views/admin/surveymenu_entries/massive_action/_selector.php">
<?php
?>
<!-- Rendering massive action widget -->
<?php
    $buttons = array();
if (Permission::model()->hasGlobalPermission('settings', 'read')) {
    $buttons[] = array(
        'type'        => 'action',
        'action'      => 'delete',
        'url'         =>  App()->createUrl('/admin/menuentries/sa/massDelete'),
        'iconClasses' => 'ri-delete-bin-fill text-danger',
        'text'        =>  gT('Delete'),
        'grid-reload' => 'yes',
        'actionType'    => 'modal',
        'modalType'     => 'cancel-delete',
        'keepopen'      => 'no',
        'sModalTitle'   => gT('Delete menu entries'),
        'htmlModalBody' => gT('Are you sure you want to delete the selected menu entries?')
    );
}
if (Permission::model()->hasGlobalPermission('settings', 'read')) {
    $buttons[] = array(
        'type' => 'action',
        'action' => 'batchEdit',
        'url' => App()->createUrl('/admin/menuentries/sa/batchEdit'),
        'iconClasses' => 'ri-file-edit-line',
        'text' => gT('Batch edit'),
        'grid-reload' => 'yes',
        'actionType' => 'modal',
        'modalType'     => 'cancel-save',
... (16 lines truncated)
</file>

<file path="application/views/admin/surveymenu_entries/massive_action/_update_results.php">
<?php
?>
<?php if (!$aResults['global']['result']) :?>
    <strong>
        <?php echo $aResults['global']['message'] ;?>
    </strong>
<?php else : ?>
    <?php unset($aResults['global']); ?>
    <table class="table table-striped">
        <caption class="visually-hidden"><?php eT('Survey menu entry batch edit results'); ?></caption>
        <thead>
            <th><?php eT('Survey menu entry ID');?></th>
            <th><?php eT('Status');?></th>
        </thead>
        <tbody>
            <?php foreach ($aResults as $iSurveyMenuEntryId => $result) :?>
                <tr>
                    <td>
                        <?php echo $iSurveyMenuEntryId;?>
                    </td>
                    <?php if ($result['status'] === true) :?>
                        <td class="text-success">
                            <?php echo $result['message']; ?>
                        </td>
                    <?php else : ?>
                        <td class="text-danger">
                            <?php echo $result['message']; ?>
                        </td>
                    <?php endif;?>
                </tr>
... (5 lines truncated)
</file>

<file path="application/views/admin/surveymenu_entries/massive_action/_update.php">
<?php
?>
<?php
    $model = SurveymenuEntries::model();
?>
<form class="custom-modal-datas form form-horizontal">
    <div class="container-fluid">
        <fieldset class="mb-0" aria-labelledby="massedit-entries-modify-legend">
            <legend id="massedit-entries-modify-legend" class="visually-hidden"><?php eT("Modify"); ?></legend>
            <div class="ex-form-group mb-3">
                <div class="col-md-1">
                    <span class="form-label"><?php eT("Modify"); ?></span>
                </div>
                <div class="col-md-11"></div>
            </div>
            <div class="ex-form-group mb-3">
                <div class="col-md-1">
                    <input
                        type="checkbox"
                        id="massedit_entries_menu_id_modify"
                        class="action_check_to_keep_old_value"
                        aria-labelledby="massedit_entries_menu_id_fieldlabel"/>
                </div>
                <label id="massedit_entries_menu_id_fieldlabel" class="col-md-3 form-label" for="massedit_entries_menu_id"><?php eT("Menu ID:"); ?></label>
                <div class="col-md-8">
                    <?php echo TbHtml::dropDownList('menu_id', 'lskeep', (['lskeep' => gT('Keep old value')] + $model->getMenuIdOptions()), ['id' => 'massedit_entries_menu_id', 'disabled' => 'disabled', 'class' => 'form-select custom-data selector_submitField']); ?>
                </div>
            </div>
            <div class="ex-form-group mb-3">
                <div class="col-md-1">
... (83 lines truncated)
</file>

<file path="application/views/admin/surveymenu_entries/_form.php">
<?php
?>
<?php $form = $this->beginWidget('TbActiveForm', array(
    'id' => 'surveymenu-entries-form',
    'enableAjaxValidation' => false,
    'htmlOptions' => ['class' => 'form '],
    'action' => Yii::app()->getController()->createUrl('admin/menuentries/sa/update', ['id' => $model->id])
));
$modalTitle = $model->isNewRecord ? gT('Create new survey menu entry') : gT('Edit survey menu entry');
Yii::app()->getController()->renderPartial(
    '/layouts/partial_modals/modal_header',
    ['modalTitle' => $modalTitle]
);
?>
<div class="modal-body">
    <div class="container-fluid">
        <?php ?>
        <?php if (!$model->isNewRecord && $model->menu_id == '1') :?>
            <?php
            $this->widget('ext.AlertWidget.AlertWidget', [
                'text' => gT("You are editing an entry of the main menu!") . ' ' . gT("Please be very careful."),
                'type' => 'danger',
            ]);
            ?>
        <?php endif; ?>
        <p class="note"><?php echo sprintf(gT('Fields with %s are required.'), '<span class="required">*</span>'); ?></p>
        <?php
        $this->widget('ext.AlertWidget.AlertWidget', ['errorSummaryModel' => $model]);
        ?>
        <div class="ex-form-group mb-3">
... (219 lines truncated)
</file>

<file path="application/views/admin/surveymenu_entries/create.php">
<?php
$this->breadcrumbs = array(
    gT('Menu entries') => array('index'),
    gT('Create')
);
$this->menu = array(
    array('label' => gT('List menu entries'), 'url' => array('index')),
    array('label' => gT('Manage menu entries'), 'url' => array('admin')),
);
?>
<h1><?php eT('Create survey menu entries'); ?></h1>
<?php $this->renderPartial('_form', array('model' => $model)); ?>
</file>

<file path="application/views/admin/surveymenu_entries/index.php">
<?php
$pageSize = Yii::app()->user->getState('pageSize', Yii::app()->params['defaultPageSize']);
echo viewHelper::getViewTestTag('surveyMenuEntries');
?>
<div class="ls-flex-row">
    <div class="col-12 ls-flex-item">
        <?php
        require_once Yii::getPathOfAlias('application.extensions.admin.grid.FloatingActionsWidget.actions.SurveyMenuEntriesMassiveActions') . '.php';
        $floatingActions = \actions\SurveyMenuEntriesMassiveActions::getActions();
        $this->widget('ext.admin.grid.FloatingActionsWidget.FloatingActionsWidget', [
            'pk' => 'id',
            'gridId' => 'surveymenu-entries-grid',
            'aActions' => $floatingActions,
        ]);
        $this->widget('application.extensions.admin.grid.CLSGridView', [
            'dataProvider' => $model->search(),
            'id' => 'surveymenu-entries-grid',
            'lsCaption' => gT('Survey menu entries'),
            'columns' => $model->getColumns(),
            'filter' => $model,
            'emptyText' => gT('No customizable entries found.'),
            'lsPageSizeCurrentValue' => $pageSize,
            'rowHtmlOptionsExpression' => '["data-surveymenu-entry-id" => $data->id]',
            'ajaxType' => 'POST',
            'ajaxUpdate' => 'surveymenu-entries-grid',
            'lsShowSelectionBar' => false,
            'lsAfterAjaxUpdate'        => ['surveyMenuEntryFunctions();'],
        ]);
        ?>
    </div>
... (33 lines truncated)
</file>

<file path="application/views/admin/surveymenu_entries/shortlist.php">
<?php
$pageSize = Yii::app()->user->getState('pageSize', Yii::app()->params['defaultPageSize']);
?>
<div class="ls-flex-column">
    <h2 class="col-12 h3 pagetitle" ><?php eT('Menu entries') ?></h2>
    <div class="ls-flex-row">
        <div class="col-12 ls-flex-item">
            <?php
            $this->widget(
                'application.extensions.admin.grid.CLSGridView',
                [
                    'dataProvider' => $model->search(),
                    'id'           => 'surveymenu-entries-shortlist-grid',
                    'lsCaption'      => gT('Menu entries'),
                    'columns'      => $model->getShortListColumns(),
                    'emptyText'    => gT('No customizable entries found.'),
                    'lsPageSizeCurrentValue' => $pageSize,
                    'ajaxUpdate' => 'surveymenu-entries-shortlist-grid'
                ]
            );
            ?>
        </div>
    </div>
</div>
</file>

<file path="application/views/admin/surveymenu_entries/update.php">
<?php
$this->breadcrumbs = array(
    'Menu entries' => array('index'),
    $model->name => array('view','id' => $model->id),
    'Update',
);
$this->menu = array(
    array('label' => 'List SurveymenuEntries', 'url' => array('index')),
    array('label' => 'Create SurveymenuEntries', 'url' => array('create')),
    array('label' => 'View SurveymenuEntries', 'url' => array('view', 'id' => $model->id)),
    array('label' => 'Manage SurveymenuEntries', 'url' => array('admin')),
);
?>
<h1>Update SurveymenuEntries <?php echo $model->id; ?></h1>
<?php $this->renderPartial('_form', array('model' => $model)); ?>
</file>

<file path="application/views/admin/surveysgroups/_form.php">
<?php
?>
<div class="form col-lg-5">
    <?php $updateRigth = $aRigths['update'] ?>
    <?php
    $form = $this->beginWidget('TbActiveForm', array(
        'id' => 'surveys-groups-form',
        'action' => $action,
        'enableAjaxValidation' => false,
        'enableClientValidation' => $updateRigth,
    ));
    ?>
    <p role="heading" aria-level="2" class="note"><?php echo sprintf(gT('Fields with %s are required.'), '<span class="required">*</span>'); ?></p>
    <?php
    $this->widget('ext.AlertWidget.AlertWidget', ['errorSummaryModel' => $model]);
    ?>
    <?php echo $form->hiddenField($model, 'owner_id'); ?>
    <?php echo $form->hiddenField($model, 'gsid'); ?>
    <div class="mb-3">
        <?php echo $form->labelEx($model, 'name'); ?>
        <?php echo $form->textField($model, 'name', array('size' => 60, 'maxlength' => 100, 'readonly' => !$model->isNewRecord || !$updateRigth, 'aria-describedby' => CHtml::activeId($model, 'name') . '_em_')); ?>
        <?php echo $form->error($model, 'name', array('errorCssClass' => 'text-danger', 'id' => CHtml::activeId($model, 'name') . '_em_')); ?>
    </div>
    <div class="mb-3">
        <?php echo $form->labelEx($model, 'title'); ?>
        <?php echo $form->textField($model, 'title', array('size' => 60, 'maxlength' => 100, 'readonly' => !$updateRigth, 'aria-describedby' => CHtml::activeId($model, 'title') . '_em_')); ?>
        <?php echo $form->error($model, 'title', array('errorCssClass' => 'text-danger', 'id' => CHtml::activeId($model, 'title') . '_em_')); ?>
    </div>
    <div class="mb-3">
        <?php echo $form->labelEx($model, 'description'); ?>
... (39 lines truncated)
</file>

<file path="application/views/admin/surveysgroups/create.php">
<?php
echo viewHelper::getViewTestTag('createSurveyGroups');
?>
<div class="tab-content flex-lg-shrink-1 ps-4">
    <div class="col-12">
        <?php $this->renderPartial('./surveysgroups/_form', $_data_); ?>
    </div>
</div>
</file>

<file path="application/views/admin/surveysgroups/surveySettings.php">
<?php
$optionsOnOff = [
    'Y' => gT('On', 'unescaped'),
    'N' => gT('Off', 'unescaped'),
];
Yii::app()->getClientScript()->registerScript(
    'GlobalSurveySettings',
    "window.GlobalSideMenuData = " . json_encode($jsData) . ";",
    LSYii_ClientScript::POS_BEGIN
);
?>
<div class="position-relative">
    <div class="d-flex flex-wrap flex-lg-nowrap" id="surveySettingsForThisGroup">
        <div id="global-sidebar-container">
            <global-sidemenu/>
        </div>
        <div id="pjax-content" class="tab-content col-lg-10 flex-lg-shrink-1 ps-4">
            <?php if ($model->hasPermission('surveysettings', 'update')) : ?>
                <div class="row">
                    <div class="col-12">
                        <?php
                        $this->widget('ext.AlertWidget.AlertWidget', [
                            'text' => gT('All changes of survey group settings will have immediate effect on all related surveys that use inherited values.'),
                            'type' => 'info',
                            'htmlOptions' => ['class' => 'controls']
                        ]);
                        ?>
                    </div>
                </div>
            <?php endif; ?>
... (111 lines truncated)
</file>

<file path="application/views/admin/surveysgroups/update.php">
<?php
?>
<div class="row">
    <div class="col-12 list-surveys">
        <ul class="nav nav-tabs" id="surveygrouptabsystem" role="tablist">
            <?php if ($model->hasPermission('group', 'read')) : ?>
                <li class="nav-item">
                    <a class="nav-link active" href="#settingsForThisGroup" data-bs-toggle="tab">
                        <?php eT('Settings for this survey group'); ?>
                    </a>
                </li>
            <?php endif; ?>
            <li class="nav-item">
                <a class="nav-link" href="#surveysInThisGroup" data-bs-toggle="tab">
                    <?php eT('Surveys in this group'); ?>
                </a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="#templateSettingsFortThisGroup" data-bs-toggle="tab">
                    <?php eT('Themes options for this survey group'); ?>
                </a>
            </li>
        </ul>
        <div class="tab-content">
            <?php if ($model->hasPermission('group', 'read')) : ?>
                <div id="settingsForThisGroup" class="tab-pane show active">
                    <?php $this->renderPartial('./surveysgroups/_form', $_data_); ?>
                </div>
            <?php endif; ?>
            <div id="surveysInThisGroup" class="tab-pane">
... (41 lines truncated)
</file>

<file path="application/views/admin/themes/partial/topbarBtns/leftSideButtons.php">
<?php
if ($isExport) {
    $this->widget(
        'ext.ButtonWidget.ButtonWidget',
        [
            'name' => 'button-export',
            'id' => 'button-export',
            'text' => gT('Export'),
            'icon' => 'ri-upload-2-fill',
            'link' => $this->createUrl('admin/themes/sa/templatezip/templatename/' . $templatename),
            'htmlOptions' => [
                'class' => 'btn btn-outline-secondary',
                'role' => 'button'
            ],
        ]
    );
}
if ($isExtend) {
    if (is_writable(App()->getConfig('userthemerootdir'))) {
        $text1 = gT("Please enter the name for the new theme:");
        $text2 = gT("extends_") . "$templatename";
        $this->widget(
            'ext.ButtonWidget.ButtonWidget',
            [
                'name' => 'button-export',
                'id' => 'button-extend-' . $templatename,
                'text' => gT('Extend'),
                'icon' => 'icon-copy',
                'link' => '',
                'htmlOptions' => [
... (51 lines truncated)
</file>

<file path="application/views/admin/themes/importform_view.php">
<?php
?>
<div class="pagetitle h3">
    <?php eT("Upload template file") ?>
</div>
        <?php echo CHtml::form(array('admin/themes/sa/upload'), 'post', array('id' => 'importtemplate', 'name' => 'importtemplate', 'enctype' => 'multipart/form-data', 'onsubmit' => 'return window.LS.validatefilename(this,"' . gT('Please select a file to import!', 'js') . '");')); ?>
    <input type='hidden' name='lid' value='$lid'/>
    <input type='hidden' name='action' value='templateupload'/>
    <div class="mb-3">
        <label for='the_file'><?php eT("Select template ZIP file:") ?></label>
        <input id='the_file' name='the_file' type="file"/>
    </div>
    <div class="mb-3">
        <?php if (!class_exists('ZipArchive')) { ?>
            <?php eT("The ZIP library is not activated in your PHP configuration thus importing ZIP files is currently disabled.", "js") ?>
        <?php } else { ?>
            <input class="btn btn-outline-secondary" type='button' value='<?php eT("Import") ?>' onclick='if (window.LS.validatefilename(this.form,"<?php eT('Please select a file to import!', 'js') ?>")) { this.form.submit();}'/>
        <?php } ?>
    </div>
</form>
</file>

<file path="application/views/admin/themes/importuploaded_view.php">
<?php
$okfiles = 0;
$errfiles = 0;
if ($result === 'success') {
    $status = gT("Success");
    $class = '';
    $statusClass = 'text-success';
    $okfiles = count($aImportedFilesInfo);
} elseif ($result === 'partial') {
    $status = gT("Partial import");
    $class = 'message-box-warning';
    $statusClass = 'text-danger';
    $okfiles = count($aImportedFilesInfo);
    $errfiles = count($aErrorFilesInfo);
} else {
    $status = gT("Error");
    $statusClass = 'text-error';
    $class = 'message-box-error';
    $errfiles = count($aErrorFilesInfo);
}
?>
<div class="row">
    <div class="col-md-11 offset-md-1 content-right">
        <!-- Message box from super admin -->
        <div class="jumbotron message-box <?php echo $class;?>">
            <div class="h2"><?php eT("Import theme result:") ?></div>
            <p class='lead <?php echo $statusClass;?>'>
                <?php echo $status ?>
            </p>
            <p>
... (60 lines truncated)
</file>

<file path="application/views/admin/themes/templateeditor_assessments_view.php">
<table align='center'>
    <tr>
        <th><?php eT("Assessment heading") ?></th>
    </tr>
    <tr>
        <td align='center'>
            <?php eT("Assessment details") ?><br />
            <?php eT("Note that this assessment section will only show if assessment rules have been set and assessment mode is activated.") ?>
        </td>
    </tr>
</table>
</file>

<file path="application/views/admin/themes/templateeditor_completed_view.php">
<br />
<span class='success'><?php eT("Thank you!") ?></span>
<br /><br />
<?php eT("Your survey responses have been recorded.") ?>
<br /><br />
</file>

<file path="application/views/admin/themes/templateeditor_navigator_view.php">
<?php
if ($screenname != 'welcome') {
    echo App()->getController()->renderPartial("/survey/system/actionButton/movePrevious", array('value' => "moveprev",'class' => "ls-move-btn ls-move-previous-btn action--ls-button-previous"), true);
}
echo App()->getController()->renderPartial("/survey/system/actionButton/moveNext", array('value' => "movenext",'class' => "ls-move-btn ls-move-next-btn action--ls-button-submit"), true);
</file>

<file path="application/views/admin/themes/templateeditor_preview.php">
<h2 class="h4" id="preview-size-label">
    <?php eT("Preview:"); ?>
</h2>
<div class="jumbotron message-box">
    <div id="preview-size-toolbar" role="toolbar" aria-labelledby="preview-size-label">
        <button type="button" id="iphone" class="btn btn-outline-secondary preview-size-btn" aria-pressed="false" tabindex="-1"><?php eT("Mobile"); ?></button>
        <button type="button" id="x640" class="btn btn-outline-secondary preview-size-btn" aria-pressed="false" tabindex="-1">640x480</button>
        <button type="button" id="x800" class="btn btn-outline-secondary preview-size-btn" aria-pressed="false" tabindex="-1">800x600</button>
        <button type="button" id="x1024" class="btn btn-outline-secondary preview-size-btn" aria-pressed="false" tabindex="-1">1024x768</button>
        <button type="button" id="full" class="btn btn-outline-secondary preview-size-btn active" aria-pressed="true" tabindex="0"><?php eT("Full"); ?></button>
    </div>
    <br>
    <br>
    <br>
    <br>
    <div class="overflow-auto" style='width:90%; margin:0 auto;'>
        <?php if (isset($filenotwritten) && $filenotwritten == true) { ?>
            <p>
                <span
                    class='errortitle'><?php echo sprintf(gT("Please change the directory permissions of the folder %s in order to preview themes."),
                        $tempdir); ?></span>
            </p>
        <?php } else { ?>
            <p>
                <iframe id='previewiframe' title='Preview'
                        src='<?php echo $this->createUrl('admin/themes/sa/tmp/', ['id' => $time]); ?>' height='768'
                        name='previewiframe' style='width:95%;background-color: white;'>Embedded Frame
                </iframe>
            </p>
        <?php } ?>
... (3 lines truncated)
</file>

<file path="application/views/admin/themes/templateeditor_printablesurvey_quesanswer_view.php">
<ul>
    <li>
        <img src="<?php echo $templateurl ?>/files/print_img_radio.png" alt="First choice" class="input-radio" height="14" width="14"><?php eT("First choice"); ?>
    </li>
    <li>
        <img src="<?php echo  $templateurl ?>/files/print_img_radio.png" alt="Second choice" class="input-radio" height="14" width="14"><?php eT("Second choice"); ?>
    </li>
    <li>
        <img src="<?php echo  $templateurl ?>/files/print_img_radio.png" alt="Third choice" class="input-radio" height="14" width="14"><?php eT("Third choice"); ?>
    </li>
</ul>
</file>

<file path="application/views/admin/themes/templateeditor_printoutput_view.php">
<span class='printouttitle'><strong><?php printf(gT("Survey name (ID): %s (%s)"), "Test survey", "46962"); ?></strong></span><br />
<table class='printouttable' >
    <tr><th><?php eT("Question") ?></th><th><?php eT("Your answer") ?></th></tr>
    <tr>
        <td>id</td>
        <td>12</td>
    </tr>
    <tr>
        <td><?php eT("Submission date"); ?></td>
        <td>1980-01-01 00:00:00</td>
    </tr>
    <tr>
        <td><?php eT("This is a sample question text. The user was asked to enter a date."); ?></td>
        <td>2007-11-06</td>
    </tr>
    <tr>
        <td><?php eT("This is another sample question text - asking for number."); ?></td>
        <td>666</td>
    </tr>
    <tr>
        <td><?php eT("This is one last sample question text - asking for some free text."); ?></td>
        <td>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum</td>
    </tr>
</table>
</file>

<file path="application/views/admin/themes/templateeditor_question_answer_view.php">
<!-- templateeditor_question_answer_view -->
<?php
if (isset($alt)) {
    App()->getController()->renderPartial('/admin/themes/templateeditor_question_answertext_view');
} else {
    App()->getController()->renderPartial('/admin/themes/templateeditor_question_answerlist_view');
}
?>
<!-- endof templateeditor_question_answer_view -->
</file>

<file path="application/views/admin/themes/templateeditor_question_answerlist_view.php">
<?php
$sRows = "";
$sRows .= App()->twigRenderer->renderQuestion('/survey/questions/answer/listradio/columns/column_header', array(
    'bIsThemeEditor' => true,
    'iColumnWidth' => 12));
$sRows .= App()->twigRenderer->renderQuestion('/survey/questions/answer/listradio/rows/answer_row', array(
    'bIsThemeEditor' => true,
    'sDisplayStyle' => '',
    'name'          => '1234X56X79',
    'code'          => 'A1',
    'answer'        => gT('One'),
    'checkedState'  => '',
    'myfname'       => 'answer22549X14X68A1',
));
$sRows .= App()->twigRenderer->renderQuestion('/survey/questions/answer/listradio/rows/answer_row', array(
    'bIsThemeEditor' => true,
    'sDisplayStyle' => '',
    'name'          => '1234X56X79',
    'code'          => 'A2',
    'answer'        => gT('Two'),
    'checkedState'  => 'checked',
    'myfname'       => 'answer22549X14X68A2',
));
$sRows .= App()->twigRenderer->renderQuestion('/survey/questions/answer/listradio/rows/answer_row', array(
    'bIsThemeEditor' => true,
    'sDisplayStyle' => '',
    'name'          => '1234X56X79',
    'code'          => 'A3',
    'answer'        => gT('Three'),
    'checkedState'  => '',
... (24 lines truncated)
</file>

<file path="application/views/admin/themes/templateeditor_question_answertext_view.php">
<?php
echo App()->twigRenderer->renderQuestion('/survey/questions/answer/longfreetext/answer', array(
        'bIsThemeEditor'         => true,
        'extraclass'             => 'col-12',
        'coreClass'              => "ls-answers answer-item text-item",
        'withColumn'             => true,
        'kpclass'                => '',
        'name'                   => '1234X56X78',
        'basename'               => '1234X56X78',
        'drows'                  => 5,
        'dispVal'                => gT('Some text in this answer'),
        'tiwidth'                => 40,
        'maxlength'              => '',
        'inputsize'              => null,
        'placeholder'            => ''
    ));
</file>

<file path="application/views/admin/themes/templateeditor_question_meta_view.php">
<meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT" />
<meta http-equiv="Last-Modified" content="<?php echo gmdate('D, d M Y H:i:s') ?> GMT" />
<meta http-equiv="Cache-Control" content="no-store, no-cache, must-revalidate" />
</file>

<file path="application/views/admin/themes/templateeditor_register_view.php">
<input type="hidden" name="lang" value="en" id="register_lang" />
<div class='mb-3'>
    <label for='register_firstname'><?php eT("First name"); ?></label>
    <?php echo CHtml::textField('register_firstname', '', array('id' => 'register_firstname','class' => 'form-control')); ?>
</div>
<div class='mb-3'>
    <label for='register_lastname'><?php eT("Last name"); ?></label>
    <?php echo CHtml::textField('register_lastname', '', array('id' => 'register_lastname','class' => 'form-control')); ?>
</div>
<div class='mb-3'>
    <label for='register_email'><?php eT("Email address"); ?></label>
    <?php echo CHtml::textField('register_email', '', array('id' => 'register_email','class' => 'form-control')); ?>
</div>
<div class='mb-3'>
    <?php echo CHtml::submitButton(gT("Continue", 'unescaped'), array('class' => 'btn-outline-secondary btn','id' => 'register','name' => 'register')); ?>
</div>
</file>

<file path="application/views/admin/themes/templateeditorbar_view.php">
<?php
echo viewHelper::getViewTestTag('themeEditor');
?>
<script type="text/javascript">
    var adminlanguage = '<?php echo $codelanguage; ?>';
    var highlighter = '<?php echo $highlighter; ?>';
</script>
<script type='text/javascript'>
    function copyprompt(text, defvalue, copydirectory, action) {
        if (newtemplatename = window.prompt(text, defvalue)) {
            window.LS.sendPost(
                '<?php echo $this->createUrl('admin/themes/sa/template'); ?>' + action,
                false,
                {'action': 'template' + action, 'newname': newtemplatename, 'copydir': copydirectory})
        }
    }
    $(document).ready(function () {
        $("#importtemplatefile").submit(function () {
            filename = $("#upload_file").val();
            if (filename == "") {
                return false; // False click
            }
            var allowedtypes = ',<?php echo Yii::app()->getConfig('allowedthemeuploads') . ',' . Yii::app()->getConfig('allowedthemeimageformats'); ?>,';
            var lastdotpos = -1;
            var ext = '';
            if ((lastdotpos = filename.lastIndexOf('.')) < 0) {
                alert('<?php eT('This file type is not allowed to be uploaded.', 'js'); ?>');
                return false;
            } else {
                ext = ',' + filename.substr(lastdotpos + 1) + ',';
... (107 lines truncated)
</file>

<file path="application/views/admin/themes/templatesummary_view.php">
<?php
Yii::app()->getClientScript()->registerPackage('jquery-ace');
Yii::app()->getClientScript()->registerScript('editorfiletype', "editorfiletype ='" . $sEditorFileType . "';", CClientScript::POS_HEAD);
?>
<?php if (is_template_editable($templatename) == true) { ?>
    <div class="row">
        <div class="col-12">
            <div class="h1">
                <?php echo sprintf(gT("Viewing file '%s'"), $filedisplayname); ?>
            </div>
            <?php if (!is_writable($templates[$templatename])) { ?>
                <?php
                $this->widget('ext.AlertWidget.AlertWidget', [
                    'text' => gT("You can't save changes because the theme directory is not writable."),
                    'type' => 'warning',
                ]);
                ?>
            <?php } ?>
        </div>
    </div>
    <div class="row">
        <!-- Left column -->
        <div class="col-9 templateeditor">
            <?= CHtml::form(['admin/themes/sa/templatesavechanges'], 'POST', ['id' => 'editTemplate', 'name' => 'editTemplate']) ?>
            <?php
            echo CHtml::hiddenField('templatename', $templatename, ['class' => 'templatename']);
            echo CHtml::hiddenField('screenname', $screenname, ['class' => 'screenname']);
            echo CHtml::hiddenField('editfile', $editfile);
            echo CHtml::hiddenField('relativePathEditfile', $relativePathEditfile);
            echo CHtml::hiddenField('action', 'templatesavechanges');
... (257 lines truncated)
</file>

<file path="application/views/admin/token/attribute_subviews/tokenformAttributesWrapper.php">
<?php
$batchEdit = isset($batchEdit) && $batchEdit;
?>
    <div class="ex-form-group mb-3 <?= $addClass ?>">
        <?php if ($batchEdit) : ?>
            <div class="col-md-1">
                <label class="">
                    <input type="checkbox" class="action_check_to_keep_old_value"></input>
                </label>
            </div>
                <label class="col-md-3 form-label" for='massedit_<?php echo $attrName; ?>'><?php echo $attrDescription['description'] . ($attrDescription['mandatory'] == 'Y' ? '*' : '') ?>:</label>
            <div class="col-md-8">
        <?php else : ?>
            <label class="form-label" for='<?php echo $attrName; ?>'>
                <?php echo $attrDescription['description'] . ($attrDescription['mandatory'] == 'Y' ? '*' : '') ?>:
            </label>
            <div class="">
        <?php endif;?>
        <?php
        switch ($attrDescription['type']) {
            case 'DD':
                $this->renderPartial(
                    '/admin/token/attribute_subviews/tokenformSelect',
                    [
                        'attrDescription' => $attrDescription,
                        'attrName' => $attrName,
                        'inputValue' => $inputValue,
                        'batchEdit' => $batchEdit,
                    ]
                );
... (29 lines truncated)
</file>

<file path="application/views/admin/token/attribute_subviews/tokenformDateInput.php">
<?php
$batchEdit = isset($batchEdit) && $batchEdit;
$inputClass = $batchEdit ? 'custom-data selector_submitField' : '';
$inputClass .=  $attrDescription['mandatory'] == 'Y' ? ' mandatory-attribute' : '';
$elementId = ($batchEdit ? 'massedit_' : 'attribute_date_') . $attrName;
$inputValue = $batchEdit ? 'lskeep' : (!empty($inputValue) ? convertToGlobalSettingFormat($inputValue) : $inputValue);
App()->getController()->widget('ext.DateTimePickerWidget.DateTimePicker', [
    'name' => $attrName,
    'id' => $elementId,
    'value' => $inputValue ?? '',
    'htmlOptions' => [
        'disabled' => $batchEdit,
        'class' => $inputClass,
    ],
    'pluginOptions' => [
        'format' => $jsDate,
        'allowInputToggle' => true,
        'theme' => 'light',
        'locale' => convertLStoDateTimePickerLocale(
            App()->session['adminlang']
        )
    ]
]);
?>
<script>
    $(document).ready(function() {
        var element = document.getElementById('<?= $elementId ?>');
        if (element && element.closest('.modal')) {
            initDatePicker(element, '<?= convertLStoDateTimePickerLocale(App()->session['adminlang']) ?>', '<?= $jsDate ?>');
        }
... (3 lines truncated)
</file>

<file path="application/views/admin/token/attribute_subviews/tokenformSelect.php">
<?php
$batchEdit = isset($batchEdit) && $batchEdit;
$inputClass = $batchEdit ? ' custom-data selector_submitField' : '';
$inputClass .=  $attrDescription['mandatory'] == 'Y' ? ' mandatory-attribute' : '';
$id = $batchEdit ? 'massedit_' . $attrName : $attrName;
$inputValue = $batchEdit ? 'lskeep' : (isset($inputValue) ? (string)$inputValue : '');
$emptyOptionValue = $batchEdit ? 'lskeep' : '';
?>
<select
    class="form-select <?= $inputClass ?>"
    name="<?=CHtml::encode($attrName)?>"
    id="<?=CHtml::encode($id)?>"
    <?= $batchEdit ? 'disabled' : '' ?>
>
    <option value="<?= $emptyOptionValue ?>"></option>  <!-- Nothing selected -->
    <?php foreach ($attrDescription['type_options'] as $optionKey => $optionValue) : ?>
        <option
            <?php if ($optionValue == $inputValue) :
                echo 'selected';
            endif; ?>
            value='<?= CHtml::encode($optionValue); ?>'
        >
            <?php echo CHtml::encode($optionValue); ?>
        </option>
    <?php endforeach; ?>
</select>
</file>

<file path="application/views/admin/token/attribute_subviews/tokenformTextInput.php">
<?php
$batchEdit = isset($batchEdit) && $batchEdit;
$inputClass = $batchEdit ? ' custom-data selector_submitField' : '';
$inputClass .=  $attrDescription['mandatory'] == 'Y' ? ' mandatory-attribute' : '';
$id = $batchEdit ? 'massedit_' . $attrName : $attrName;
$inputValue = $batchEdit ? 'lskeep' : (isset($inputValue) ? htmlspecialchars(
    (string)$inputValue,
    ENT_QUOTES,
    'utf-8'
) : null);
?>
<input
    class='form-control <?= $inputClass ?>'
    type='text'
    size='55'
    id='<?= $id; ?>'
    name='<?= $attrName; ?>'
    value='<?= $inputValue ?>'
    <?= $batchEdit ? 'disabled' : '' ?>
/>
</file>

<file path="application/views/admin/token/massive_actions/_delete_results.php">
<?php
?>
<table class="table table-striped">
    <thead>
        <th><?php eT('Survey ID');?></th>
        <th><?php eT('Survey title');?></th>
        <th><?php eT('Status');?></th>
    </thead>
    <tbody>
        <?php foreach ($aResults as $iSid => $result) :?>
            <tr>
                <td>
                    <?php echo $iSid;?>
                </td>
                <td>
                    <?php echo $result['title'];?>
                </td>
                <?php if ($result['result']) :?>
                    <td class="text-success">
                        <?php echo 'deleted' ; ?>
                    </td>
                <?php else : ?>
                    <td class="text-danger">
                        <?php echo 'could not delete the survey' ; ?>
                    </td>
                <?php endif;?>
            </tr>
        <?php endforeach;?>
    </tbody>
</table>
... (1 lines truncated)
</file>

<file path="application/views/admin/token/massive_actions/_export_archive_results.php">
<?php
?>
<table class="table table-striped">
    <thead>
        <th><?php eT('Survey ID');?></th>
        <th><?php eT('Survey title');?></th>
        <th><?php eT('Status');?></th>
    </thead>
    <tbody>
        <?php foreach ($aResults as $iSid => $result) :?>
            <tr>
                <td>
                    <?php echo $iSid;?>
                </td>
                <td>
                    <?php echo $result['title'];?>
                </td>
                <?php if ($result['result']) :?>
                    <td class="text-success">
                        <?php echo 'Exported' ; ?>
                    </td>
                <?php else : ?>
                    <td class="text-danger">
                        <?php echo $result['error'] ; ?>
                    </td>
                <?php endif;?>
            </tr>
        <?php endforeach;?>
    </tbody>
</table>
... (7 lines truncated)
</file>

<file path="application/views/admin/token/massive_actions/_selector.php">
<?php
?>
<!-- Rendering massive action widget -->
<?php
    $this->widget('ext.admin.grid.MassiveActionsWidget.MassiveActionsWidget', array(
            'pk'          => 'tid',
            'gridid'      => 'token-grid',
            'dropupId'    => 'tokenListActions',
            'dropUpText'  => gT('Selected participant(s)...'),
            'aActions' => array(
                array(
                    'type'           => 'action',
                    'action'         => 'edit',
                    'disabled'       => !Permission::model()->hasSurveyPermission($surveyid, 'tokens', 'update'),
                    'url'            => App()->createUrl('/admin/tokens/sa/editMultiple/'),
                    'iconClasses'    => 'ri-pencil-fill',
                    'text'           => gT('Batch-edit participants'),
                    'grid-reload'    => 'yes',
                    'actionType'     => 'modal',
                    'largeModalView' => true,
                    'modalType'      => 'cancel-save',
                    'keepopen'       => 'yes',
                    'sModalTitle'    => gT('Batch-edit participants'),
                    'htmlModalBody'  => $this->renderPartial(
                        './token/massive_actions/_update',
                        array(
                            'dateformatdetails' => getDateFormatData(Yii::app()->session['dateformat']),
                            'aLanguages'        => $aLanguages
                        ),
                        true
... (73 lines truncated)
</file>

<file path="application/views/admin/token/massive_actions/_update_results.php">
<?php
?>
<?php if (!$aResults['global']['result']) :?>
    <strong>
        <?php echo $aResults['global']['message'] ;?>
    </strong>
<?php else : ?>
    <?php unset($aResults['global']); ?>
    <table class="table table-striped">
        <thead>
            <th><?php eT('Participant ID');?></th>
            <th><?php eT('Status');?></th>
        </thead>
        <tbody>
            <?php foreach ($aResults as $iTokenId => $result) :?>
                <tr>
                    <td>
                        <?php echo $iTokenId;?>
                    </td>
                    <?php if ($result['status'] === true) :?>
                        <td class="text-success">
                            <?php echo $result['message']; ?>
                        </td>
                    <?php else : ?>
                        <td class="text-danger">
                            <?php echo $result['message']; ?>
                        </td>
                    <?php endif;?>
                </tr>
            <?php endforeach;?>
... (4 lines truncated)
</file>

<file path="application/views/admin/token/massive_actions/_update.php">
<?php
$iSurveyId = (int) Yii::app()->request->getParam('surveyid');
$customAttributes = getParticipantAttributes($iSurveyId);
$aCoreTokenFields = array('validfrom', 'validuntil', 'firstname', 'lastname', 'emailstatus', 'token', 'language', 'sent', 'remindersent', 'completed', 'usesleft');
$oSurvey = Survey::model()->findByPk($iSurveyId);
$sCointainerClass = ($oSurvey->anonymized != 'Y' ?  'yes-no-date-container' : 'yes-no-container');
$locale = convertLStoDateTimePickerLocale(Yii::app()->session['adminlang']);
?>
<form class="custom-modal-datas form form-horizontal makeDisabledInputsTransparent">
    <div id='updateTokens'>
        <!-- Tabs -->
        <?php if (count($customAttributes) > 0) : ?>
            <ul class="nav nav-tabs" id="edit-survey-text-element-language-selection">
                <!-- Common  -->
                <li role="presentation" class="nav-item">
                    <a class="nav-link active" data-bs-toggle="tab" href="#massive-general" aria-expanded="true">
                        <?php eT('General'); ?>
                    </a>
                </li>
                <!-- Custom attributes -->
                <li role="presentation" class="nav-item">
                    <a class="nav-link" data-bs-toggle="tab" href="#massive-custom" aria-expanded="false">
                        <?php eT('Additional attributes'); ?>
                    </a>
                </li>
            </ul>
        <?php endif; ?>
        <!-- Tabs content-->
        <div class="tab-content">
            <div id="massive-general" class="tab-pane fade show active">
... (350 lines truncated)
</file>

<file path="application/views/admin/token/_attributeTypeModal.php">
<?php
?>
<div class="modal fade" id="attributeTypeModal" tabindex="-1" aria-labelledby="attributeTypeModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <h2 class="modal-title h5" id="attributeTypeModalLabel">
                    <?php eT('Attribute type'); ?>
                </h2>
                <button type="button" class="btn-close" data-bs-dismiss="modal"
                        aria-label="Close"></button>
            </div>
            <div class="modal-body">
                <div class="mb-3">
                    <label for="attributeTypeSelect" class="form-label"><?php eT('Select attribute type:'); ?></label>
                    <?php
                    echo CHtml::dropDownList(
                        'attributeTypeSelect',
                        'TB',
                        $attributeTypeDropdownArray,
                        array(
                                    'class' => 'form-select',
                                    'id' => 'attributeTypeSelect'
                            )
                    );
                    ?>
                </div>
                <div id="dropdownOptionsContainer" class="d-none">
                    <div class="mb-3">
                        <label class="form-label">
... (25 lines truncated)
</file>

<file path="application/views/admin/token/_bounceProcessingModal.php">
<div id="tokenBounceModal" class="modal fade" tabindex="-1" role="dialog">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title"><?php eT('Bounce processing'); ?></h5>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>
            <div class="modal-body">
                <p class="modal-body-text"></p>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-danger" data-bs-dismiss="modal">
                    <?php eT('Cancel'); ?>
                </button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div><!-- /.modal -->
</file>

<file path="application/views/admin/token/actions.php">
<?php
    $onclickAction = "if (confirm("
        . gT("Are you sure you want to delete the selected entries?", "js")
        . "\")) {"
        . convertGETtoPOST(
            $this->createUrl(
                "admin/tokens/sa/delete/$surveyid/",
                [
                    "action"   => "tokens",
                    "sid"      => $surveyid,
                    "subaction" => "delete",
                    "tokenids" => $id,
                    "limit"    => $limit,
                    "start"    => $start,
                    "order"    => $order
                ]
            )
        ) . "}";
    ?>
<a class="ui-icon ui-icon-pencil" onclick='<?=$onclickAction?>' title="<?php eT("Delete the selected entries");?>"></a>
<a class="ui-icon"></a>
</file>

<file path="application/views/admin/token/addtokenpost.php">
<?php
?>
<div class='side-body'>
    <div class="row">
        <div class="col-12 content-right">
            <!-- Success -->
            <?php if ($success) : ?>
                <div class="jumbotron message-box">
                    <h2><?php eT("Adding survey participant entry..."); ?></h2>
                    <p class="lead text-success"><?php eT("Success"); ?></p>
                    <p><?php eT("New entry was added."); ?></p>
                    <div class="container">
                        <div class="col-12 col-xl-4 offset-xl-2">
                            <input class="btn btn-large btn-block btn-outline-secondary" type='button' value='<?php eT("Browse survey participants"); ?>' onclick="window.open('<?php echo $this->createUrl("admin/tokens/sa/browse/surveyid/$surveyid"); ?>', '_top')" />
                        </div>
                        <div class="col-12 col-xl-4">
                            <input class="btn btn-large btn-block btn-outline-secondary" type='button' value='<?php eT("Add another participant"); ?>' onclick="window.open('<?php echo $this->createUrl("admin/tokens/sa/addnew/surveyid/$surveyid"); ?>', '_top')" />
                        </div>
                    </div>
                </div>
            <!-- Fail -->
            <?php else :?>
                <div class="jumbotron message-box message-box-error">
                    <h2 class="text-danger"><?php eT("Add participant entry"); ?></h2>
                    <p class="lead text-danger"><?php eT("Failed"); ?></p>
                    <?php foreach ($errors as $error) : ?>
                        <p class='lead'><?php echo $error[0]; ?></p>
                    <?php endforeach; ?>
                    <div class="container">
                        <div class="col-12 col-xl-4 offset-xl-2">
... (12 lines truncated)
</file>

<file path="application/views/admin/token/afterDeleteParticipantsTable.php">
<?php
?>
<div class="side-body">
    <div class="row welcom survey-action">
        <div class="col-12 content-right">
            <div class="card card-primary">
                <h3 class="lead"><?php eT('Survey participant list deleted'); ?></h3>
                <br /> <br />
                <p>
                    <?php eT('The survey participant list has been deleted and your survey has been switched back to open-access mode. Participants no longer require an access code to access the survey.'); ?>
                    <br /> <br />
                    <?php eT('A backup of this table has been made, which can only be accessed by your site administrator.'); ?>
                    <br />
                    <?php echo '(' . $backupTableName . ')'; ?>
                    <br /> <br />
                    <?php eT("You can switch back to closed-access mode at any time. Navigate to Settings --> Survey participants and click on the 'Switch to closed-access mode' button."); ?>
                    <br /><br />
                    <a
                        class="btn btn-outline-secondary"
                        href="<?php echo $this->createUrl("surveyAdministration/view/surveyid/{$iSurveyId}"); ?>"
                    ><?php eT('Main admin screen'); ?></a>
            </div>
        </div>
    </div>
</div>
</file>

<file path="application/views/admin/token/bounce.php">
<div class='side-body'>
    <h2 class="h3"><?php eT("Bounce settings"); ?></h2>
    <div class="row">
        <div class="col-12">
            <div id='bouncesettingsdiv'>
                <?php echo CHtml::form(array("admin/tokens/sa/bouncesettings/surveyid/$surveyid"), 'post', array('class' => 'form-core settingswidget ','id' => 'bouncesettings','name' => 'frmeditquestion')); ?>
                        <div class="settings-list">
                            <!-- Survey bounce email -->
                            <div class="mb-3 setting control-group setting-email col-3">
                                <label class="default form-label" for="bounce_email">
                                    <?php eT('Survey bounce email address'); ?>
                                </label>
                                <div class="default controls">
                                    <input class='form-control' size="50" type="email" value="<?php echo $settings['bounce_email'];?>" name="bounce_email" id="bounce_email" />
                                </div>
                            </div>
                            <!-- Bounce settings to be used -->
                            <div class="mb-3 setting control-group setting-select">
                                <label class="default form-label" for="bounceprocessing">
                                    <?php eT('Used bounce settings');?>
                                </label>
                                <div class="default controls">
                                    <?php $this->widget('ext.ButtonGroupWidget.ButtonGroupWidget', array(
                                        'name' => 'bounceprocessing',
                                        'value' => $settings['bounceprocessing'] ,
                                        'ariaLabel' => gT('Used bounce settings'),
                                        'checkedOption' => $settings['bounceprocessing'] ,
                                        'selectOptions' => array(
                                            "N" => gT("None", 'unescaped'),
                                            "L" => gT("Use settings below", 'unescaped'),
... (81 lines truncated)
</file>

<file path="application/views/admin/token/browse.php">
<?php
$aLanguageNames = [];
foreach ($aLanguages as $sCode => $sName) {
    $aLanguageNames[] = $sCode . ":" . str_replace(";", " -", (string) $sName);
}
$aLanguageNames = implode(";", $aLanguageNames);
?>
<div class='side-body'>
    <input type='hidden' id="dateFormatDetails" name='dateFormatDetails' value='<?php echo json_encode($dateformatdetails); ?>'/>
    <input type="hidden" id="locale" name="locale" value="<?= convertLStoDateTimePickerLocale(Yii::app()->session['adminlang']) ?>"/>
    <input type='hidden' name='rtl' value='<?php echo getLanguageRTL($_SESSION['adminlang']) ? '1' : '0'; ?>'/>
    <h3><?php eT("Survey participants"); ?></h3>
    <?php
    $this->widget('ext.AlertWidget.AlertWidget', [
        'tag'  => 'p',
        'text' => gT(
            "You can use operators in the search filters (eg: >, <, >=, <=, = )"
        ),
        'type' => 'info',
    ]);
    ?>
    <!-- CGridView -->
    <?php $pageSizeTokenView = Yii::app()->user->getState(
        'pageSizeTokenView',
        Yii::app()->params['defaultPageSize']
    ); ?>
    <!-- Todo : search boxes -->
    <!-- Grid -->
    <div class="row">
        <div class="content-right">
... (76 lines truncated)
</file>

<file path="application/views/admin/token/createParticipantsTable.php">
<?php
?>
<div class="side-body">
    <div class="row welcome survey-action">
        <div class="col-12 content-right">
            <?php echo CHtml::form(
                ["/admin/tokens/sa/startfromscratch/surveyId/" . $oSurvey->sid],
                'post',
                ['id' => 'startfromscratch', 'name' => 'startfromscratch']
            );
?>
            <h3 class="lead"><?php eT('Create survey participant list'); ?></h3>
            <p>
                <?php eT('Do you want to create a participant list for your survey?'); ?>
                <br />
            </p>
            <a
                class="btn btn-block btn-outline-secondary"
                href="<?php echo $this->createUrl("admin/tokens/sa/index/surveyid/{$iSurveyID}"); ?>"
            ><?php eT('Cancel'); ?></a>
            <button
                class="btn btn-primary"
                type="submit"
                name="createtable"
                value="Y"
            ><?php eT('Create') ?></button>
        </div>
    </div>
</div>
</file>

<file path="application/views/admin/token/csvimportresult.php">
<?php
?>
<div class='side-body'>
    <div class="row">
        <div class="col-12 content-right">
            <?php if (empty($aTokenListArray) || $iRecordImported == 0) :?>
                <div class="jumbotron message-box message-box-error">
                    <h2 class="text-danger">
                        <?php
                        if (empty($aTokenListArray)) {
                            eT("Failed to open the uploaded file!");
                        } else {
                            eT("Failed to create participant entries");
                        }
                        ?>
                    </h2>
            <?php else :?>
                <div class="jumbotron message-box">
                    <h2 class="text-success"><?php eT("Uploaded CSV file successfully"); ?></h2>
                    <p class='lead text-success'><?php eT("Successfully created participant entries"); ?></p>
            <?php endif;?>
                    <p>
                        <ul class="list-unstyled">
                            <li><?php printf(gT("%s records in CSV"), $iRecordCount); ?></li>
                            <li><?php printf(gT("%s records met minimum requirements"), $iRecordOk); ?></li>
                            <?php if ($iInvalidEmailCount) { ?>
                                <li><?php printf(gT("%s records with allowed invalid email"), $iInvalidEmailCount); ?></li>
                            <?php } ?>
                            <li><?php printf(gT("%s records imported"), $iRecordImported); ?></li>
                        </ul>
... (134 lines truncated)
</file>

<file path="application/views/admin/token/csvupload.php">
<?php
?>
<div class='side-body'>
    <h1 class="h3"><?php eT("Import survey participants from CSV file"); ?></h1>
    <div class="row">
        <div class="col-12 content-right">
            <?php echo CHtml::form(
                ["admin/tokens/sa/import/surveyid/{$iSurveyId}"],
                'post',
                ['id' => 'tokenimport', 'name' => 'tokenimport', 'class' => '', 'enctype' => 'multipart/form-data']
            ); ?>
            <!-- Choose the CSV file to upload -->
            <div class="mb-3">
                <label class=" form-label" for='the_file'><?php eT("Choose the CSV file to upload:"); ?></label>
                <?php echo CHtml::fileField('the_file', '', ['required' => 'required', 'accept' => '.csv', 'class' => 'form-control']); ?>
            </div>
            <!-- "Character set of the file -->
            <div class="mb-3">
                <label class=" form-label" for='csvcharset'><?php eT("Character set of the file:"); ?></label>
                <div class="">
                    <?php
                    echo CHtml::dropDownList('csvcharset', $thischaracterset, $aEncodings, ['size' => '1', 'class' => 'form-select']);
                    ?>
                </div>
            </div>
            <!-- Separator used -->
            <div class="mb-3">
                <label class=" form-label" for='separator'><?php eT("Separator used:"); ?> </label>
                <div class="">
                    <?php $this->widget('ext.ButtonGroupWidget.ButtonGroupWidget', [
... (142 lines truncated)
</file>

<file path="application/views/admin/token/deleteParticipantsTable.php">
<?php
?>
<div class="side-body">
    <div class="row welcom survey-action">
        <div class="col-12 content-right">
            <div class="card card-primary border-left-danger">
                <?php echo CHtml::form(
                    array("admin/tokens/sa/kill", 'surveyid' => $surveyid),
                    'post',
                    array('id' => 'deletetokentable', 'name' => 'deletetokentable')
                ); ?>
                <h3 class="lead"><?php eT('Delete survey participant list'); ?></h3>
                <p>
                    <?php eT('Deleting the participant list will switch the survey back to open-access mode.'); ?>
                    <br /> <br />
                    <?php eT('Access codes will no longer be required to access this survey.'); ?>
                    <br /> <br />
                    <?php eT('A backup of this table will be made if you proceed. Your site administrator will be able to access this table.'); ?>
                    <br />
                    <?php echo '(' . $backupTableName . ')'; ?>
                    <br /> <br />
                    <?php eT("You can switch back to closed-access mode at any time. Navigate to Settings --> Survey participants and click on the 'Switch to closed-access mode' button."); ?>
                    <br />
                </p>
                <a
                    class="btn btn-outline-secondary"
                    href="<?php echo $this->createUrl("admin/tokens/sa/index/surveyid/{$iSurveyId}"); ?>"
                ><?php eT('Cancel'); ?></a>
                <button
                    class="btn btn-danger"
... (12 lines truncated)
</file>

<file path="application/views/admin/token/dummytokenform.php">
<?php
?>
<div class='side-body'>
    <h3><?php eT("Create dummy participants"); ?></h3>
    <div class="row">
        <div class="col-12 content-right">
            <?php echo CHtml::form(array("admin/tokens/sa/adddummies/surveyid/{$surveyid}/subaction/add"), 'post', array('id' => 'adddummytokens', 'name' => 'adddummytokens', 'class' => 'form30 ')); ?>
            <div class="row">
                <!-- ID  -->
                <div class="mb-3 col-12">
                    <label  class=" form-label">ID:</label>
                    <div class="">
                        <p class="form-control-static"><?php eT("Auto"); ?></p>
                    </div>
                </div>
            </div>
            <div class="row">
                <!-- Number of tokens  -->
                <div class="mb-3 col-6">
                    <label  class=" form-label" for='amount'><?php eT("Number of participants:"); ?></label>
                    <div class="">
                        <input class='form-control' type='number' min='1' size='20' id='amount' name='amount' value="<?php echo intval($amount); ?>" />
                    </div>
                </div>
                <!-- Token length  -->
                <div class="mb-3 col-6">
                    <label  class=" form-label" for='tokenlen'><?php eT("Access code length"); ?>:</label>
                    <div class="">
                        <input class='form-control' type='text' size='20' id='tokenlen' name='tokenlen' value="<?php echo intval($tokenlength); ?>" />
                    </div>
... (132 lines truncated)
</file>

<file path="application/views/admin/token/emailpost.php">
<?php
if (isset($nosidebodyblock) && $nosidebodyblock === true) { ?>
    <div class='side-body'>
<?php } ?>
<div class="row" id="token-emailpost-messagebox">
    <div class="col-12 content-right">
        <div class="jumbotron message-box">
            <h2><?php if ($bEmail) {
                eT("Sending invitations...");
                } else {
                    eT("Sending reminders...");
                }?></h2>
            <div style='border: 1px solid #ccc; max-height: 80em; overflow: scroll; text-align:left; padding-left:0.5em;'>
                <?php echo $tokenoutput ?>
            </div>
            <a href='<?= Yii::app()->getController()->createUrl("/admin/tokens/sa/browse/surveyid/{$surveyid}") ?>' class="btn btn-outline-secondary custom custom-margin top-10"><?= gT("Continue") ?></a>
        </div>
    </div>
</div>
</file>

<file path="application/views/admin/token/emailwarning.php">
<div class='side-body'>
<div class="jumbotron message-box message-box-warning">
    <h2><?php eT("Warning"); ?></h2>
    <?php echo CHtml::form(array("admin/tokens/sa/email/action/{$sSubAction}/surveyid/{$surveyid}"), 'post', ['id' => 'tokenSubmitInviteForm']); ?>
        <span id="tokenSendNotice"><?php printf(ngT("There are more emails pending than can be sent in one batch. Continue sending emails by clicking below, or wait %s{n}%s second.|There are more emails pending than can be sent in one batch. Continue sending emails by clicking below, or wait %s{n}%s seconds.", Yii::app()->getConfig('sendingrate')), '<span id="tokenSendCounter">', '</span>'); ?></span>
        <br />
        <br />
        <?php echo str_replace("{EMAILCOUNT}", (string) $lefttosend, (string) gT("There are {EMAILCOUNT} emails still to be sent.")); ?>
        <br />
        <br />
        <input
            type='button'
            class="btn btn-outline-secondary"
            id="sendTokenInvitationsNow"
            value='<?php eT("Continue"); ?>' />
        <span>&nbsp;&nbsp;&nbsp;</span>
        <button
            id="cancelAutomaticSubmission"
            class="btn btn-danger"
            type="button">
            <?php eT("Cancel automatic sending"); ?>
        </button>
        <input type='hidden' name='ok' value="absolutely" />
        <input type='hidden' name='action' value="tokens" />
        <input type='hidden' name='bypassbademails' value="<?php echo (int) Yii::app()->request->getPost('bypassbademails'); ?>" />
        <?php
        if (!$bEmail) {
            if (intval(Yii::app()->request->getPost('minreminderdelay')) != 0) { ?>
                <input
                    type='hidden'
... (85 lines truncated)
</file>

<file path="application/views/admin/token/exportdialog.php">
<!-- Token export options -->
<div class='side-body'>
    <h2 class="h3"><?php eT("Survey participant export options"); ?></h2>
    <div class="row">
        <div class="col-12 content-right">
            <?php echo CHtml::form(array("admin/tokens/sa/exportdialog/surveyid/$surveyid"), 'post', array('class' => 'form-core settingswidget ','id' => 'bouncesettings','name' => 'frmeditquestion')); ?>
            <div class="row">
                <div class="settings-list col-12 col-lg-6">
                    <!--Survey status -->
                    <div class=" mb-3 control-group" data-name="tokenstatus">
                        <label class="default form-label" for="tokenstatus">
                            <?php eT('Survey status:'); ?>
                        </label>
                        <div class="default controls">
                            <select id="tokenstatus" name="tokenstatus" class="form-select">
                                <option value="0"><?php eT('All participants'); ?></option>
                                <option value="1"><?php eT('Completed'); ?></option>
                                <option value="2"><?php eT('Not completed'); ?></option>
                                <option value="3"><?php eT('Not started'); ?></option>
                                <option value="4"><?php eT('Started but not yet completed'); ?></option>
                            </select>
                        </div>
                    </div>
                    <!--Invitation status -->
                    <div class=" mb-3 control-group" data-name="invitationstatus">
                        <label class="default form-label" for="invitationstatus">
                            <?php eT('Invitation status:'); ?>
                        </label>
                        <div class="default controls">
                            <?php $this->widget('ext.ButtonGroupWidget.ButtonGroupWidget', array(
... (122 lines truncated)
</file>

<file path="application/views/admin/token/import.php">
<!-- Import.php -->
<div class='side-body'>
    <h3><?php eT("Import survey participants from CSV file"); ?></h3>
    <div class="row">
        <div class="col-12 content-right">
            <?php if (empty($sError)) : ?>
                <div class="jumbotron message-box">
                    <h2>gT("Participant file upload")</h2>
                </div>
            <?php else :?>
                <div class="jumbotron message-box message-box-error">
                    <h2>gT("Participant file upload")</h2>
                    <p class="lead text-danger"><?php gT("Error"); ?></p>
                    <p><?php echo $sError; ?></p>
                </div>
            <?php endif;?>
        </div>
    </div>
</div>
</file>

<file path="application/views/admin/token/invite.php">
<?php
?>
<div class='side-body'>
    <h1 class="h3"><?php eT("Send email invitations"); ?></h1>
    <div class="row">
        <div class="col-12 content-right">
            <?php echo PrepareEditorScript(true, $this); ?>
            <div>
                <?php if ($oSurvey->active != 'Y') : ?>
                    <div class="jumbotron message-box message-box-error">
                        <h2 class='text-danger'><?php eT('Warning!'); ?></h2>
                        <p class="lead text-danger">
                            <?php eT("This survey is not yet activated and so your participants won't be able to fill out the survey."); ?>
                        </p>
                    </div>
                <?php endif; ?>
                <?php if (count($warnings)) : ?>
                    <div class="alert alert-warning">
                        <ul class='list-unstyled'>
                        <?php foreach ($warnings as $warning) : ?>
                            <li>
                                <?= $warning ?>
                            </li>
                        <?php endforeach; ?>
                        </ul>
                    </div>
                <?php endif; ?>
                <div>
                    <?php echo CHtml::form(array("admin/tokens/sa/email/surveyid/{$oSurvey->sid}"), 'post', array('id' => 'sendinvitation', 'name' => 'sendinvitation', 'class' => '')); ?>
                    <div class="row">
... (171 lines truncated)
</file>

<file path="application/views/admin/token/ldapform.php">
<?php
?>
<div class='side-body'>
    <h3><?php eT("Import survey participants from LDAP"); ?></h3>
    <div class="row">
        <div class="col-12 content-right">
            <!-- Alert error -->
            <?php if (!empty($sError)) : ?>
                <?php
                $message = '<strong>' . gT("Error") . '</strong>: ' .  $sError;
                $this->widget('ext.AlertWidget.AlertWidget', [
                    'text' => $message,
                    'type' => 'danger',
                ]);
                ?>
            <?php endif; ?>
            <!-- LDAP module is missing -->
            <?php if (!function_exists('ldap_connect')) : ?>
                <?php
                $this->widget('ext.AlertWidget.AlertWidget', [
                    'text' => gT('Sorry, but the LDAP module is missing in your PHP configuration.'),
                    'type' => 'danger',
                ]);
                ?>
            <?php elseif (empty($ldap_queries) || !is_array($ldap_queries) || count($ldap_queries) == 0) : ?>
                <br />
                <?php
                $this->widget('ext.AlertWidget.AlertWidget', [
                    'text' => gT('LDAP is disabled or no LDAP query defined.'),
                    'type' => 'danger',
... (56 lines truncated)
</file>

<file path="application/views/admin/token/ldappost.php">
<?php
?>
<div class='side-body'>
    <div class="row">
        <div class="col-12 content-right">
            <div class="jumbotron message-box<?php echo $xz == 0 ? ' message-box-error' : ''; ?>">
                <?php if ($xz != 0) : ?>
                    <h2 class="text-success"><?php eT("Success"); ?></h2>
                <?php else : ?>
                    <h2 class="text-danger"><?php eT("Error"); ?></h2>
                <?php endif; ?>
                <p><?php echo $resultnum; ?></p>
                <p>
                    <?php eT("Results from LDAP Query."); ?><br />
                    <?php printf(gT("%s records met minimum requirements"), $xv); ?><br />
                    <?php printf(gT("%s records imported"), $xz); ?>
                </p>
                <p>
                    <?php printf(gT("%s duplicate records skipped"), $xy); ?>
                    <?php if (!empty($duplicatelist)) : ?>
                        [<a href="#duplicateslist" role="button" data-bs-toggle="collapse" aria-expanded="false" aria-controls="duplicateslist"><?php eT("List"); ?></a>]
                    <?php endif; ?>
                </p>
                <?php if (!empty($duplicatelist)) : ?>
                    <div class="collapse" id="duplicateslist">
                        <ul class="list-unstyled">
                            <?php foreach ($duplicatelist as $sDuplicate) : ?>
                                <li><?php echo CHtml::encode($sDuplicate); ?></li>
                            <?php endforeach; ?>
                        </ul>
... (21 lines truncated)
</file>

<file path="application/views/admin/token/managetokenattributes.php">
<?php
?>
<div class='side-body'>
    <h1 class="h3"><?php eT("Manage attribute fields"); ?></h1>
    <div class="row">
        <div class="col-12 content-right">
            <?php echo CHtml::form(
                array("admin/tokens/sa/updatetokenattributedescriptions/surveyid/{$surveyid}"),
                'post',
                ['id' => 'manage_token_attributes_form']
            ); ?>
            <div>
                <ul class="nav nav-tabs" role="tablist">
                    <?php $c = true; ?>
                    <?php foreach ($oSurvey->allLanguages as $sLanguage) : ?>
                        <?php $sTabTitle = getLanguageNameFromCode($sLanguage, false) . " " . (($sLanguage == $oSurvey->language) ? "(" . gT("Base language") . ")" : "") ?>
                        <?php $tabId = 'tokenattr-tab-' . CHtml::encode($sLanguage); ?>
                        <li class="nav-item" role="presentation">
                            <a class="nav-link <?= $c ? "active" : "" ?>"
                               id="<?= $tabId ?>" role="tab"
                               aria-selected="<?= $c ? 'true' : 'false' ?>"
                               data-bs-toggle="tab"
                               href="#language_<?php echo $sLanguage ?>"
                               aria-controls="language_<?php echo CHtml::encode(
                                   $sLanguage
                               ); ?>">
                                <?php $c = false; ?>
                                <?php echo $sTabTitle; ?>
                            </a>
                        </li>
... (224 lines truncated)
</file>

<file path="application/views/admin/token/remind.php">
<?php
?>
<div class='side-body'>
    <h1 class="h3"><?php eT("Send email reminder"); ?></h1>
    <div class="row">
        <div class="col-12 content-right">
            <?php echo PrepareEditorScript(true, $this); ?>
            <?php if ($thissurvey['active'] != 'Y') : ?>
                <?php if ($thissurvey[$baselang]['active'] != 'Y') : ?>
                    <div class="jumbotron message-box message-box-error">
                        <h2 class='text-danger'><?php eT('Warning!'); ?></h2>
                        <p class="lead text-danger">
                            <?php eT("This survey is not yet activated and so your participants won't be able to fill out the survey."); ?>
                        </p>
                    </div>
                <?php endif; ?>
            <?php endif; ?>
            <?php if (count($warnings)) : ?>
                <div class="alert alert-warning">
                    <ul class='list-unstyled'>
                    <?php foreach ($warnings as $warning) : ?>
                        <li>
                            <?= $warning ?>
                        </li>
                    <?php endforeach; ?>
                    </ul>
                </div>
            <?php endif; ?>
            <?php echo CHtml::form(array("admin/tokens/sa/email/action/remind/surveyid/{$surveyid}"), 'post', array('id' => 'sendreminder', 'class' => '')); ?>
            <div class="row">
... (189 lines truncated)
</file>

<file path="application/views/admin/token/surveyParticipantView.php">
<?php
echo viewHelper::getViewTestTag('surveyParticipantsIndex');
?>
<div class='side-body survey-response-page'>
    <h1> <?= gT("Survey participants") ?> </h1>
    <div class="mt-4">
        <div class="accordion">
            <div class="accordion-item">
                <h2 class="accordion-header" id="panelsStayOpen-headingOne">
                    <button class="accordion-button" type="button" data-bs-toggle="collapse" data-bs-target="#panelsStayOpen-collapseOne" aria-expanded="true" aria-controls="panelsStayOpen-collapseOne">
                        <span class="summary-title py-1"><?php eT("Summary"); ?></span>
                    </button>
                </h2>
                <div id="panelsStayOpen-collapseOne" class="accordion-collapse collapse show" aria-labelledby="panelsStayOpen-headingOne">
                    <div class="accordion-body">
                        <div class="row">
                            <div class="col-6">
                                <div class="row">
                                    <div class="col summary-detail">
                                        <?php eT("Total"); ?>
                                    </div>
                                    <div class="col">
                                        <?php echo $queries['count']; ?>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col summary-detail">
                                        <?php eT("Having an invitation sent"); ?>
                                    </div>
                                    <div class="col">
... (210 lines truncated)
</file>

<file path="application/views/admin/token/tokenform.php">
<?php
$locale = convertLStoDateTimePickerLocale(Yii::app()->session['adminlang']);
?>
<div class='<?= (!isset($ajax) || $ajax = false) ? 'col-12 side-body' : ''?>'>
    <?php if (!isset($ajax) || $ajax = false) { ?>
        <h1 class="h3">
            <?php
            if ($token_subaction == "edit") {
                eT("Edit survey participant");
            } else {
                eT("Add survey participant");
            }
            ?>
        </h1>
    <?php } ?>
    <?php
    foreach ($tokendata as $Key => $Value) {
        $$Key = $Value;
    }
    ?>
    <div id="edittoken-error-container" class="row" style="display: none;">
        <?php
        $this->widget('ext.AlertWidget.AlertWidget', [
            'text' => '<span class="alert-content"></span>',
            'type' => 'danger',
        ]);
        ?>
    </div>
    <div class="row">
        <div class="col-12 content-right">
... (508 lines truncated)
</file>

<file path="application/views/admin/token/tokenwarning.php">
<?php
?>
<div class='side-body'>
    <div class="row welcome survey-action">
        <div class="col-12 content-right">
            <div class="card card-primary border-left-danger">
                <p class="lead text-danger">
                    <strong>
                        <?php eT("Survey participants have not been initialised for this survey."); ?>
                    </strong>
                </p>
                <p>
                    <?php
                    if (Permission::model()->hasSurveyPermission($oSurvey->sid, 'surveysettings', 'update') || Permission::model()->hasSurveyPermission($oSurvey->sid, 'tokens', 'create')) {
                        eT("If you switch to closed-access mode then this survey will only be accessible to users who provide an access code either manually or by URL."); ?>
                            <br /> <br />
                            <?php eT("You can switch back to open-access mode at any time. Navigate to Settings -> Survey participants and click on the red 'Delete participant list' button in the top bar."); ?>
                        <?php ?><br /><br />
                        <br /><br />
                        <?php echo CHtml::form(array("admin/tokens/sa/index/surveyid/{$oSurvey->sid}"), 'post'); ?>
                            <button
                                type="submit"
                                class="btn btn-outline-secondary btn-lg"
                                name="createtable"
                                value="Y"><?php eT("Switch to closed-access mode"); ?>
                            </button>
                            <a
                                href="<?php echo $this->createUrl("surveyAdministration/view/surveyid/$oSurvey->sid"); ?>"
                                class="btn btn-outline-secondary btn-lg">
                                <?php eT("Continue in open-access mode"); ?>
... (51 lines truncated)
</file>

<file path="application/views/admin/tutorialentries/_form.php">
<?php
?>
<div class="form">
<?php $form = $this->beginWidget('CActiveForm', array(
    'id' => 'tutorial-entry-form',
    'enableAjaxValidation' => false,
)); ?>
    <p class="note"><?php echo sprintf(gT('Fields with %s are required.'), '<span class="required">*</span>'); ?></p>
    <?php
    $this->widget('ext.AlertWidget.AlertWidget', ['errorSummaryModel' => $model]);
    ?>
    <div class="row">
        <?php echo $form->labelEx($model, 'tid'); ?>
        <?php echo $form->textField($model, 'tid'); ?>
        <?php echo $form->error($model, 'tid'); ?>
    </div>
    <div class="row">
        <?php echo $form->labelEx($model, 'title'); ?>
        <?php echo $form->textArea($model, 'title', array('rows' => 6, 'cols' => 50)); ?>
        <?php echo $form->error($model, 'title'); ?>
    </div>
    <div class="row">
        <?php echo $form->labelEx($model, 'content'); ?>
        <?php echo $form->textArea($model, 'content', array('rows' => 6, 'cols' => 50)); ?>
        <?php echo $form->error($model, 'content'); ?>
    </div>
    <div class="row">
        <?php echo $form->labelEx($model, 'settings'); ?>
        <?php echo $form->textArea($model, 'settings', array('rows' => 6, 'cols' => 50)); ?>
        <?php echo $form->error($model, 'settings'); ?>
... (7 lines truncated)
</file>

<file path="application/views/admin/tutorialentries/_search.php">
<?php
?>
<div class="wide form">
<?php $form = $this->beginWidget('CActiveForm', array(
    'action' => Yii::app()->createUrl($this->route),
    'method' => 'get',
)); ?>
    <div class="row">
        <?php echo $form->label($model, 'teid'); ?>
        <?php echo $form->textField($model, 'teid'); ?>
    </div>
    <div class="row">
        <?php echo $form->label($model, 'tid'); ?>
        <?php echo $form->textField($model, 'tid'); ?>
    </div>
    <div class="row">
        <?php echo $form->label($model, 'title'); ?>
        <?php echo $form->textArea($model, 'title', array('rows' => 6, 'cols' => 50)); ?>
    </div>
    <div class="row">
        <?php echo $form->label($model, 'content'); ?>
        <?php echo $form->textArea($model, 'content', array('rows' => 6, 'cols' => 50)); ?>
    </div>
    <div class="row">
        <?php echo $form->label($model, 'settings'); ?>
        <?php echo $form->textArea($model, 'settings', array('rows' => 6, 'cols' => 50)); ?>
    </div>
    <div class="row buttons">
        <?php echo CHtml::submitButton('Search'); ?>
    </div>
... (3 lines truncated)
</file>

<file path="application/views/admin/tutorialentries/_view.php">
<?php
?>
<div class="view">
    <b><?php echo CHtml::encode($data->getAttributeLabel('teid')); ?>:</b>
    <?php echo CHtml::link(CHtml::encode($data->teid), array('view', 'id' => $data->teid)); ?>
    <br />
    <b><?php echo CHtml::encode($data->getAttributeLabel('tid')); ?>:</b>
    <?php echo CHtml::encode($data->tid); ?>
    <br />
    <b><?php echo CHtml::encode($data->getAttributeLabel('title')); ?>:</b>
    <?php echo CHtml::encode($data->title); ?>
    <br />
    <b><?php echo CHtml::encode($data->getAttributeLabel('content')); ?>:</b>
    <?php echo CHtml::encode($data->content); ?>
    <br />
    <b><?php echo CHtml::encode($data->getAttributeLabel('settings')); ?>:</b>
    <?php echo CHtml::encode($data->settings); ?>
    <br />
</div>
</file>

<file path="application/views/admin/tutorialentries/admin.php">
<?php
$this->breadcrumbs = array(
    'Tutorial Entries' => array('index'),
    'Manage',
);
$this->menu = array(
    array('label' => 'List TutorialEntry', 'url' => array('index')),
    array('label' => 'Create TutorialEntry', 'url' => array('create')),
);
Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$('#tutorial-entry-grid').yiiGridView('update', {
		data: $(this).serialize()
	});
	return false;
});
");
?>
<h1>Manage Tutorial Entries</h1>
<p>
You may optionally enter a comparison operator (<b>&lt;</b>, <b>&lt;=</b>, <b>&gt;</b>, <b>&gt;=</b>, <b>&lt;&gt;</b>
or <b>=</b>) at the beginning of each of your search values to specify how the comparison should be done.
</p>
<?php echo CHtml::link('Advanced Search', '#', array('class' => 'search-button')); ?>
<div class="search-form" style="display:none">
<?php $this->renderPartial('_search', array(
... (19 lines truncated)
</file>

<file path="application/views/admin/tutorialentries/create.php">
<?php
$this->breadcrumbs = array(
    'Tutorial Entries' => array('index'),
    'Create',
);
$this->menu = array(
    array('label' => 'List TutorialEntry', 'url' => array('index')),
    array('label' => 'Manage TutorialEntry', 'url' => array('admin')),
);
?>
<h1>Create TutorialEntry</h1>
<?php $this->renderPartial('_form', array('model' => $model)); ?>
</file>

<file path="application/views/admin/tutorialentries/index.php">
<?php
$pageSize = Yii::app()->user->getState('pageSize', Yii::app()->params['defaultPageSize']);
echo viewHelper::getViewTestTag('tutorialentries');
?>
<div class="ls-flex-column ls-space padding left-35 right-35">
    <div class="col-12 h1 pagetitle">
        <?php eT('Tutorial entries')?>
    </div>
    <div class="col-12">
        <a role="button" class="btn btn-primary float-end col-xs-6 col-sm-3 col-md-2" id="createnewtutorialentry">
            &nbsp;
            <?php eT('New') ?>
        </a>
        <?php if (Permission::model()->hasGlobalPermission('superadmin', 'read')) : ?>
            <a class="btn btn-danger float-end ls-space margin right-10 col-xs-6 col-sm-3 col-md-2"
               href="#restoremodal" data-bs-toggle="modal">
                <i class="ri-refresh-line"></i>&nbsp;
                <?php eT('Reset'); ?>
            </a>
        <?php endif; ?>
    </div>
    <div class="col-12 ls-space margin top-15">
        <div class="col-12 ls-flex-item">
            <?php $this->widget('application.extensions.admin.grid.CLSGridView', [
                'dataProvider'             => $model->search(),
                'id'                       => 'tutorial-grid',
                'columns'                  => $model->getColumns(),
                'filter'                   => $model,
                'emptyText'                => gT('No customizable entries found.'),
                'lsPageSizeCurrentValue'     => $pageSize,
... (11 lines truncated)
</file>

<file path="application/views/admin/tutorialentries/update.php">
<?php
$this->breadcrumbs = array(
    'Tutorial Entries' => array('index'),
    $model->title => array('view','id' => $model->teid),
    'Update',
);
$this->menu = array(
    array('label' => 'List TutorialEntry', 'url' => array('index')),
    array('label' => 'Create TutorialEntry', 'url' => array('create')),
    array('label' => 'View TutorialEntry', 'url' => array('view', 'id' => $model->teid)),
    array('label' => 'Manage TutorialEntry', 'url' => array('admin')),
);
?>
<h1>Update TutorialEntry <?php echo $model->teid; ?></h1>
<?php $this->renderPartial('_form', array('model' => $model)); ?>
</file>

<file path="application/views/admin/tutorialentries/view.php">
<?php
$this->breadcrumbs = array(
    'Tutorial Entries' => array('index'),
    $model->title,
);
$this->menu = array(
    array('label' => 'List TutorialEntry', 'url' => array('index')),
    array('label' => 'Create TutorialEntry', 'url' => array('create')),
    array('label' => 'Update TutorialEntry', 'url' => array('update', 'id' => $model->teid)),
    array('label' => 'Delete TutorialEntry', 'url' => '#', 'linkOptions' => array('submit' => array('delete','id' => $model->teid),'confirm' => 'Are you sure you want to delete this item?')),
    array('label' => 'Manage TutorialEntry', 'url' => array('admin')),
);
?>
<h1>View TutorialEntry ?></h1>
<?php $this->widget('zii.widgets.CDetailView', array(
    'data' => $model,
    'attributes' => array(
        'teid',
        'tid',
        'title',
        'content',
        'settings',
    ),
)); ?>
</file>

<file path="application/views/admin/tutorials/_form.php">
<?php
?>
<div class="form">
<?php $form = $this->beginWidget('TbActiveForm', array(
    'id' => 'tutorials-form',
    'enableAjaxValidation' => false,
)); ?>
    <p class="note"><?php echo sprintf(gT('Fields with %s are required.'), '<span class="required">*</span>'); ?></p>
    <?php
    $this->widget('ext.AlertWidget.AlertWidget', ['errorSummaryModel' => $model]);
    ?>
    <div class="row">
        <?php echo $form->labelEx($model, 'name'); ?>
        <?php echo $form->textField($model, 'name', array('size' => 60,'maxlength' => 128)); ?>
        <?php echo $form->error($model, 'name'); ?>
    </div>
    <div class="row">
        <?php echo $form->labelEx($model, 'description'); ?>
        <?php echo $form->textArea($model, 'description', array('rows' => 6, 'cols' => 50)); ?>
        <?php echo $form->error($model, 'description'); ?>
    </div>
    <div class="row">
        <?php echo $form->labelEx($model, 'active'); ?>
        <?php echo $form->textField($model, 'active'); ?>
        <?php echo $form->error($model, 'active'); ?>
    </div>
    <div class="row">
        <?php echo $form->labelEx($model, 'permission'); ?>
        <?php echo $form->textField($model, 'permission', array('size' => 60,'maxlength' => 128)); ?>
        <?php echo $form->error($model, 'permission'); ?>
... (12 lines truncated)
</file>

<file path="application/views/admin/tutorials/_search.php">
<?php
?>
<div class="wide form">
<?php $form = $this->beginWidget('CActiveForm', array(
    'action' => Yii::app()->createUrl($this->route),
    'method' => 'get',
)); ?>
    <div class="row">
        <?php echo $form->label($model, 'tid'); ?>
        <?php echo $form->textField($model, 'tid'); ?>
    </div>
    <div class="row">
        <?php echo $form->label($model, 'name'); ?>
        <?php echo $form->textField($model, 'name', array('size' => 60,'maxlength' => 128)); ?>
    </div>
    <div class="row">
        <?php echo $form->label($model, 'description'); ?>
        <?php echo $form->textArea($model, 'description', array('rows' => 6, 'cols' => 50)); ?>
    </div>
    <div class="row">
        <?php echo $form->label($model, 'active'); ?>
        <?php echo $form->textField($model, 'active'); ?>
    </div>
    <div class="row">
        <?php echo $form->label($model, 'permission'); ?>
        <?php echo $form->textField($model, 'permission', array('size' => 60,'maxlength' => 128)); ?>
    </div>
    <div class="row">
        <?php echo $form->label($model, 'permission_grade'); ?>
        <?php echo $form->textField($model, 'permission_grade', array('size' => 60,'maxlength' => 128)); ?>
... (7 lines truncated)
</file>

<file path="application/views/admin/tutorials/_view.php">
<?php
?>
<div class="view">
    <b><?php echo CHtml::encode($data->getAttributeLabel('tid')); ?>:</b>
    <?php echo CHtml::link(CHtml::encode($data->tid), array('view', 'id' => $data->tid)); ?>
    <br />
    <b><?php echo CHtml::encode($data->getAttributeLabel('name')); ?>:</b>
    <?php echo CHtml::encode($data->name); ?>
    <br />
    <b><?php echo CHtml::encode($data->getAttributeLabel('description')); ?>:</b>
    <?php echo CHtml::encode($data->description); ?>
    <br />
    <b><?php echo CHtml::encode($data->getAttributeLabel('active')); ?>:</b>
    <?php echo CHtml::encode($data->active); ?>
    <br />
    <b><?php echo CHtml::encode($data->getAttributeLabel('permission')); ?>:</b>
    <?php echo CHtml::encode($data->permission); ?>
    <br />
    <b><?php echo CHtml::encode($data->getAttributeLabel('permission_grade')); ?>:</b>
    <?php echo CHtml::encode($data->permission_grade); ?>
    <br />
</div>
</file>

<file path="application/views/admin/tutorials/admin.php">
<?php
$this->breadcrumbs = array(
    'Tutorial' => array('index'),
    'Manage',
);
$this->menu = array(
    array('label' => 'List Tutorial', 'url' => array('index')),
    array('label' => 'Create Tutorial', 'url' => array('create')),
);
Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$('#tutorials-grid').yiiGridView('update', {
		data: $(this).serialize()
	});
	return false;
});
");
?>
<h1>Manage Tutorial</h1>
<p>
You may optionally enter a comparison operator (<b>&lt;</b>, <b>&lt;=</b>, <b>&gt;</b>, <b>&gt;=</b>, <b>&lt;&gt;</b>
or <b>=</b>) at the beginning of each of your search values to specify how the comparison should be done.
</p>
<?php echo CHtml::link('Advanced Search', '#', array('class' => 'search-button')); ?>
<div class="search-form" style="display:none">
<?php $this->renderPartial('_search', array(
... (20 lines truncated)
</file>

<file path="application/views/admin/tutorials/create.php">
<?php
?>
<div class="container">
    <h1 class="pagetitle">Create Tutorial</h1>
    <div class="col-12 jumbotron well">
        <h3><?=gT("We will soon add the functionality to create your own tutorials and download them from our store.")?></h3>
    </div>
    <?php ?>
</div>
</file>

<file path="application/views/admin/tutorials/index.php">
<?php
$pageSize = Yii::app()->user->getState('pageSize', Yii::app()->params['defaultPageSize']);
echo viewHelper::getViewTestTag('tutorials');
?>
<div class="ls-flex-column ls-space padding left-35 right-35">
    <div class="col-12 h1 pagetitle">
        <?php eT('Tutorials')?>
    </div>
    <div class="col-12 jumbotron well">
        <h3><?=gT("We will soon add the functionality to create your own tutorials and download them from our store.")?></h3>
    </div>
    <div class="col-12 ls-space margin top-15">
        <div class="col-12 ls-flex-item">
            <?php $this->widget('application.extensions.admin.grid.CLSGridView', [
                'dataProvider'             => $model->search(),
                'id'                       => 'tutorial-grid',
                'columns'                  => $model->getColumns(),
                'filter'                   => $model,
                'emptyText'                => gT('No customizable entries found.'),
                'lsPageSizeCurrentValue'     => $pageSize,
                'rowHtmlOptionsExpression' => '["data-tutorial-id" => $data->tid]',
                'htmlOptions'              => ['class' => 'table-responsive grid-view-ls'],
                'ajaxType'                 => 'POST',
                'ajaxUpdate'               => 'tutorial-grid',
                'lsAfterAjaxUpdate'        => ['bindAction'],
            ]);
            ?>
        </div>
    </div>
</div>
... (1 lines truncated)
</file>

<file path="application/views/admin/tutorials/update.php">
<?php
?>
<div class="container">
    <h1 class="pagetitle">Update Tutorial <?php echo $model->tid; ?></h1>
    <?php $this->renderPartial('/admin/tutorials/_form', array('model' => $model)); ?>
</div>
</file>

<file path="application/views/admin/tutorials/view.php">
<?php
$this->breadcrumbs = array(
    'Tutorial' => array('index'),
    $model->name,
);
$this->menu = array(
    array('label' => 'List Tutorial', 'url' => array('index')),
    array('label' => 'Create Tutorial', 'url' => array('create')),
    array('label' => 'Update Tutorial', 'url' => array('update', 'id' => $model->tid)),
    array('label' => 'Delete Tutorial', 'url' => '#', 'linkOptions' => array('submit' => array('delete','id' => $model->tid),'confirm' => 'Are you sure you want to delete this item?')),
    array('label' => 'Manage Tutorial', 'url' => array('admin')),
);
?>
<h1>View Tutorial ?></h1>
<?php $this->widget('zii.widgets.CDetailView', array(
    'data' => $model,
    'attributes' => array(
        'tid',
        'name',
        'description',
        'active',
        'permission',
        'permission_grade',
    ),
)); ?>
</file>

<file path="application/views/admin/update/check_updates/update_buttons/_updatesavailable_error.php">
<?php
?>
<?php
if (isset($serverAnswer->html)) {
    if ($serverAnswer->html != "") {
        echo $serverAnswer->html;
    }
}
    $bError = true;
switch ($serverAnswer->error) {
    case 'php_curl_not_loaded':
        $sTile = gT('Error!');
        $sHeader = gT('PHP curl library not installed');
        $sMessage = gT(
            "It seems that your server doesn't support PHP CURL Library. Please install it before proceeding to ComfortUpdate."
        );
        break;
    case 'no_server_answer':
        $sTile = gT('Error!');
        $sHeader = gT('No server answer!');
        $sMessage = gT(
            "It seems that the ComfortUpdate server is not responding. Please try again in few minutes or contact the LimeSurvey team."
        );
        break;
    case 'no_update_available_for_your_version':
        $bError = false;
        $sTile = gT('Up to date!');
        $sHeader = gT('No update available for your version.');
        $sMessage = gT('Your version is up to date!');
        break;
... (49 lines truncated)
</file>

<file path="application/views/admin/update/check_updates/update_buttons/_updatesavailable.php">
<?php
?>
<?php
if (isset($updateInfos->html)) {
    if ($updateInfos->html != "") {
        echo $updateInfos->html;
    }
    // And we unset this html message for the loop on update versions don't crush on it
    unset($updateInfos->html);
}
?>
<?php if (isset($updateInfos->alert)) : // First we check if the server provided a specific alert message ?>
    <?php if ($updateInfos->alert != "") :?>
        <!-- Alert from server -->
        <?php
        $this->widget('ext.AlertWidget.AlertWidget', [
            'text' => $updateInfos->alert,
            'type' => 'warning',
        ]);
        ?>
    <?php endif; ?>
<?php endif; ?>
<div>
    <strong id="ls-updates"><?php echo gT('The following LimeSurvey updates are available:');?></strong>
</div>
<br/>
<br/>
<table aria-describedby="ls-updates" class="items table w-75 m-auto">
    <!-- header -->
    <thead>
... (85 lines truncated)
</file>

<file path="application/views/admin/update/manage/manage_key.php">
<div class="col-12 list-surveys" id="comfortUpdateGeneralWrap">
    <div class="pagetitle h3">
        <span id="comfortUpdateIcon" class="ri-shield-check-fill text-success"></span>
        <?php eT('ComfortUpdate'); ?>
        <?php if (YII_DEBUG) : ?>
            <small>
                Server:
                <em class="text-primary">
                    <?= Yii::app()->getConfig("comfort_update_server_url"); ?>
                </em>
            </small>
        <?php endif; ?>
    </div>
    <table aria-label="<?= gT('Your update key:') ?>" class="items table w-75 m-auto">
        <!-- header -->
        <thead>
        <tr>
            <th>
                <?php eT('Your update key:'); ?>
            </th>
            <th>
                <?php eT('Valid until:'); ?>
            </th>
            <th>
                <?php eT('Remaining updates:'); ?>
            </th>
            <th>
            </th>
        </tr>
        </thead>
... (60 lines truncated)
</file>

<file path="application/views/admin/update/manage/subscribe.php">
<?php
?>
<div class="col-12 list-surveys" id="comfortUpdateGeneralWrap">
    <div class="pagetitle h3">
        <span id="comfortUpdateIcon" class="ri-shield-check-fill text-primary"></span>
        <?php eT("Subscribe to ComfortUpdate!"); ?>
    </div>
    <div class="container">
        <br/>
        <p>
            <?php eT('The LimeSurvey ComfortUpdate is a great feature to easily update to the latest version of LimeSurvey. To use it you will need an update key.'); ?></p>
        <p>
            <?php
            $aopen = '<a class="ls-link" href="https://account.limesurvey.org/component/limeservice/?task=trialkey.createfreekey" target="_blank">';
            $aclose = '</a>';
            ?>
            <?php echo sprintf(gT("You can get a free trial update key from %syour account on the limesurvey.org website%s."), $aopen, $aclose); ?>
            <?php
            $aopen = '<a class="ls-link" href="https://account.limesurvey.org/sign-up">';
            $aclose = '</a>';
            ?><br>
            <?php echo sprintf(gT("If you don't have an account on limesurvey.org, please %sregister first%s."), $aopen, $aclose); ?></p>
        <?php
        echo CHtml::beginForm(App()->createUrl('/admin/update/sa/manageSubmitkey'), 'post', ["id" => ""]);
        ?>
        <div class="mb-3">
            <?php
            echo CHtml::label(gT('Enter your update key:'), 'inputKey', ['class' => 'col-md-2']);
            ?>
            <div class='col-md-2'>
... (22 lines truncated)
</file>

<file path="application/views/admin/update/partials/topbarBtns/rightSideButtons.php">
<?php
$this->widget(
    'ext.ButtonWidget.ButtonWidget',
    [
        'name' => 'back-button',
        'id' => 'back-button',
        'text' => gT('Manage your key'),
        'icon' => 'ri-key-2-fill',
        'link' => $this->createUrl('admin/update/sa/managekey/'),
        'htmlOptions' => [
            'class' => 'btn btn-outline-secondary',
        ],
    ]
);
</file>

<file path="application/views/admin/update/partials/topbarBtns_subscribe/rightSideButtons.php">
<?php
$this->widget(
    'ext.ButtonWidget.ButtonWidget',
    [
        'name' => 'back-button',
        'id' => 'back-button',
        'text' => gT('Close'),
        'icon' => 'ri-close-fill',
        'link' => $this->createUrl("dashboard/view"),
        'htmlOptions' => [
            'class' => 'btn btn-outline-secondary',
            'role' => 'button'
        ],
    ]
);
</file>

<file path="application/views/admin/update/updater/steps/textaeras/_existingfiles.php">
<?php
?>
<?php if (count($existingfiles) > 0) : ?>
    <br/><br/>
    <?php eT('The following files would be added by the update but already exist. This is unusual and may result from an earlier update attempt.'); ?>
    <br />
    <?php eT('These files will be backed up and then replaced by the update procedure.');?>
    <br />
<textarea readonly="readonly" style="background-color: #FFF; width: 800px; height: 150px; font-family: Monospace; font-size: 11px;">
    <?php
    sort($existingfiles);
    foreach ($existingfiles as $existingfile) {
        echo htmlspecialchars((string) $existingfile['file']) . "\n";
    }
    ?>
</textarea>
<?php endif;?>
</file>

<file path="application/views/admin/update/updater/steps/textaeras/_modifiedfiles.php">
<?php
?>
<?php
if (count($modifiedfiles) > 0) : ?>
    <p>
        <br/><br/>
        <?php eT('The following files will be modified or deleted but were already modified by someone else.');?>
        <br/>
        <?php eT('These files will be backed up and then replaced by the update procedure.');?>
    </p>
    <textarea readonly="readonly" style="background-color: #FFF; width: 800px; height: 150px; font-family: Monospace; font-size: 11px;"><?php
        sort($modifiedfiles);
    foreach ($modifiedfiles as $modifiedfile) {
        echo htmlspecialchars((string) $modifiedfile['file']) . "\n";
    }?></textarea>
<?php endif;?>
</file>

<file path="application/views/admin/update/updater/steps/textaeras/_readonlyfiles.php">
<?php
?>
<?php if (count($readonlyfiles) > 0) :?>
    <span class="text-danger">
        <?php eT('Warning: The following files/directories need to be updated but their permissions are set to read-only.'); ?>
        <br />
        <?php eT('You must set according write permissions on these files before you can proceed. If you are unsure what to do please contact your system administrator for advice.'); ?><br />
    </span>
<textarea readonly="readonly" style="background-color: #FFF; width: 800px; height: 150px; font-family: Monospace; font-size: 11px;">
    <?php foreach ($readonlyfiles as $readonlyfile) :?>
        <?php echo trim(htmlspecialchars((string) $readonlyfile)) . "\n"; ?>
    <?php endforeach;?>
</textarea>
<?php  else :?>
    <p class="success text-start">
        <?php eT("All files in local directories are writable."); ?>
    </p>
<?php  endif;?>
</file>

<file path="application/views/admin/update/updater/steps/_backup.php">
<?php
$downloadString = gT('Download file');
?>
<h3 class="maintitle"><?php eT('Creating file backup')?></h3>
<?php
if (isset($dbBackupInfos->html)) {
    echo $dbBackupInfos->html;
}
?>
<div class="updater-background">
    <div class="row">
        <div class="col-12">
            <strong><?php echo sprintf(gT("File backup created: %s"), ''); ?></strong>
            <br/>
            <?php echo $tempdir . DIRECTORY_SEPARATOR . 'LimeSurvey_files_backup_' . $basefilename . '.zip'; ?><br/>
            <a class="btn btn-primary mt-2"
               href="<?php echo Yii::app()->getBaseUrl(true);?>/tmp/LimeSurvey_files_backup_<?= $basefilename;?>.zip"
               title="<?= $downloadString ?>">
                <?= $downloadString ?>
            </a>
        </div>
    </div>
    <?php if ($dbBackupInfos->result) :?>
        <div class="row">
            <div class="col-12">
                <strong><?php eT('DB backup created:'); ?></strong>
                <br/>
                <?php echo $dbBackupInfos->message; ?>
                <br/>
                <a class="btn btn-primary mt-2"
... (66 lines truncated)
</file>

<file path="application/views/admin/update/updater/steps/_change_log.php">
<?php
?>
<h3 class="maintitle"><?php eT('Change log'); ?></h3>
<div class="row">
    <div class="col-12">
<?php if ($html_from_server != "") :?>
    <div>
        <?php echo $html_from_server;?>
    </div>
<?php endif;?>
<?php
$changelog = "";
$currentVersion = Yii::app()->getConfig("versionnumber") . " Build " . Yii::app()->getConfig("buildnumber");
foreach (array_reverse($changelogs->changelogentries) as $changelogentry) {
    if (trim((string) $changelogentry->changelog) != '') {
          $tempfromversion = $changelogentry->versionnumber;
          $tempfrombuild = $changelogentry->build;
          $changelog .= "Changes in {$changelogentry->versionnumber} Build {$changelogentry->build} from {$currentVersion} --- Legend: + New feature, # Updated feature, - Bug fix\n";
          $changelog .= $changelogentry->changelog . "\n";
          $currentVersion = "{$changelogentry->versionnumber} Build {$changelogentry->build}";
    }
}
?>
<textarea class="updater-changelog form-control" readonly="readonly" rows="20">
<?php
echo $changelog;
?>
</textarea>
    </div>
</div>
... (26 lines truncated)
</file>

<file path="application/views/admin/update/updater/steps/_check_local_errors.php">
<?php
?>
<?php
        $urlNew = Yii::app()->createUrl("admin/update", array("update" => 'checkLocalErrors', 'destinationBuild' => $destinationBuild, 'access_token' => $access_token));
        $errors = false;
?>
<h3 class="maintitle"><?php eT('Checking basic requirements...'); ?></h3>
<?php
if (isset($localChecks->html)) {
    echo $localChecks->html;
}
?>
<div class="row">
    <div class="col-12">
        <table class="table">
            <thead>
                <tr>
                    <th class="col-md-10"><?php eT('Available space in directory:');?></th>
                    <th class="col-md-1"  style="text-align: right"></th>
                    <th class="col-md-1"  style="text-align: right"></th>
                </tr>
            </thead>
            <tbody>
                <?php foreach ($localChecks->files as $file) :?>
                    <?php if ($file->freespace !== 'pass') : ?>
                        <tr>
                            <td><?php echo $file->name;?></td>
                            <td></td>
                            <?php if ($file->freespace) : ?>
                                <td><span class="ri-check-fill text-success" alt="right"></span></td>
... (186 lines truncated)
</file>

<file path="application/views/admin/update/updater/steps/_fileSystem.php">
<?php
?>
<?php $urlNew = Yii::app()->createUrl("admin/update", array("update" => 'checkFiles', 'destinationBuild' => $destinationBuild, 'access_token' => $access_token)); ?>
<h3 class="maintitle"><?php eT('Checking existing LimeSurvey files...'); ?></h3>
<?php if ($html_from_server != "") :?>
    <div>
        <?php echo $html_from_server;?>
    </div>
<?php endif;?>
<div class="updater-background">
    <?php $this->renderPartial("./update/updater/steps/textaeras/_readonlyfiles", array("readonlyfiles" => $readonlyfiles));?>
    <?php $this->renderPartial("./update/updater/steps/textaeras/_existingfiles", array("existingfiles" => $existingfiles));?>
    <?php $this->renderPartial("./update/updater/steps/textaeras/_modifiedfiles", array("modifiedfiles" => $modifiedfiles));?>
    <?php if (count($readonlyfiles) > 0) :?>
            <br />
        <div class="col-12 mt-2">
            <?php
            $url = Yii::app()->createUrl('/admin/update');
            echo CHtml::beginForm($url, 'post');
            echo CHtml::hiddenField('destinationBuild', $destinationBuild);
            echo CHtml::hiddenField('access_token', $access_token);
            echo CHtml::hiddenField('update', 'checkFiles');
            echo '<a class="btn btn-cancel me-1" href="' . Yii::app()->createUrl("admin/update") .
                '" role="button" aria-disabled="false">' .
                gT("Cancel") .
                '</a>&nbsp;';
            echo CHtml::submitButton(gT('Check again', 'unescaped'), array("class" => "btn btn-outline-secondary"));
            echo CHtml::endForm();
            ?>
        </div>
... (21 lines truncated)
</file>

<file path="application/views/admin/update/updater/steps/_final.php">
<?php
?>
<h3 class="maintitle"><?php eT('Update complete!'); ?></h3>
<div class="updater-background">
    <div class="row">
        <div class="col-12">
            <?php
            $message = gT('The update is now complete!') . '</br>' .
                gT("If necessary the database will be updated in a final step.") . '</br>' .
                gT('However, it is important that you clear your browser cache now. After that please click the button below.');
            $this->widget('ext.AlertWidget.AlertWidget', [
                'header' => sprintf(gT('Buildnumber was successfully updated to %s.'), $destinationBuild),
                'text' => $message,
                'type' => 'success',
            ]);
            ?>
        </div>
    </div>
    <div class="row">
        <div class="col-12 mt-2">
          <a id="backToMainMenu"
             class="btn btn-primary"
             href="<?= Yii::app()->createUrl("admin/authentication/sa/logout"); ?>"
             role="button"
             aria-disabled="false">
              <?php eT('Finish'); ?>
          </a>
        </div>
    </div>
</div>
... (4 lines truncated)
</file>

<file path="application/views/admin/update/updater/steps/_old_step4b.php">
<?php
?>
<div class="header ui-widget-header">
<?php echo sprintf(gT('ComfortUpdate step %s'), '4');?>
</div><div class="updater-background"><br />
<?php
if (!isset(Yii::app()->session['updateinfo'])) {
    eT('On requesting the update information from limesurvey.org there has been an error:') . '<br />';
    if ($updateinfo['error'] == 1) {
        eT('Your update key is invalid and was removed. ') . '<br />';
    } else {
        eT('On requesting the update information from limesurvey.org there has been an error:') . '<br />';
    }
}
if ($new_files) {
    eT('New files were successfully installed.');
} else {
    eT('There was a problem downloading the update file. Please try to restart the update process.');
}
?>
<br>
<?php
if (!$downloaderror) {
    echo sprintf(gT('Buildnumber was successfully updated to %s.'), Yii::app()->session['updateinfo']['toversion']) . '<br />';
    eT('The update is now complete!'); ?> <br /> <?php
    eT('As a last step you should clear your browser cache now.');?> <br /> <?php
}
echo "<p><button onclick=\"window.open('" . Yii::app()->getController()->createUrl("admin/globalsettings") . "', '_top')\" >" . gT('Back to main menu'); ?>
</button></p>
</div>
... (1 lines truncated)
</file>

<file path="application/views/admin/update/updater/steps/_updater_updated.php">
<?php
?>
<?php
    $urlContinue = Yii::app()->createUrl("admin/update", array("update" => 'welcome', 'destinationBuild' => $destinationBuild));
?>
<h3 class="maintitle"><?php eT("ComfortUpdate needs to be updated");?></h3>
<div class="updater-background">
    <p class="success">
        <?php eT("ComfortUpdate has been updated!");?>
    </p>
    <p>
        <?php eT("You can now continue updating your LimeSurvey Installation.");?>
    </p>
</div>
<a id="backToMainMenu" class="btn btn-outline-secondary" href="<?php echo Yii::app()->createUrl("admin/authentication/sa/logout"); ?>" role="button" aria-disabled="false">
    <?php eT('Click this button to log out.'); ?>
</a>
</file>

<file path="application/views/admin/update/updater/welcome/_error_files_update_updater.php">
<?php
?>
<h2 class="text-danger"><?php eT("Write error!"); ?></h2>
<?php
if (isset($serverAnswer->html)) {
    echo $serverAnswer->html;
}
?>
<p>
    <strong><?php eT("Those files/directories are not writable:")?></strong>
    <br/>
    <?php foreach ($localChecks->readOnly as $readonly) :?>
        <?php echo $readonly . "<br/>";?>
    <?php endforeach; ?>
    <br/>
    <a class="btn btn-cancel" href="<?php echo Yii::app()->createUrl("admin/update"); ?>" role="button" aria-disabled="false">
        <?php eT("Cancel"); ?>
    </a>
</p>
</file>

<file path="application/views/admin/update/updater/welcome/_key_updated.php">
<!-- First we show the welcome message -->
<?php
    $urlContinue = Yii::app()->createUrl("admin/update", array("update" => 'welcome', 'destinationBuild' => $_POST["destinationBuild"]));
?>
<h3 class="maintitle"><?php eT("Key update");?></h3>
<?php
if (isset($serverAnswer->html)) {
    echo $serverAnswer->html;
}
?>
<div>
    <p><br><?php eT('Your key has been updated and validated! You can now use ComfortUpdate.'); ?></p>
</div>
<a class="btn btn-outline-secondary" href="<?php echo $urlContinue;?>" role="button" aria-disabled="false">
    <?php eT("Continue"); ?>
</a>
</file>

<file path="application/views/admin/update/updater/welcome/_subscribe.php">
<?php
?>
<h3 class="maintitle"><?php eT("Subscribe to ComfortUpdate!");?></h3>
<?php
if (isset($serverAnswer->html)) {
    echo $serverAnswer->html;
}
?>
<div class="updater-background">
    <br/>
    <p>
    <?php eT('The LimeSurvey ComfortUpdate is a great feature to easily update to the latest version of LimeSurvey. To use it you will need an update key.');?></p><p>
        <?php
        $aopen  = '<a href="https://account.limesurvey.org/component/limeservice/?task=trialkey.createfreekey" target="_blank">';
        $aclose = '</a>';
        ?>
        <?php echo sprintf(gT("You can get a free trial update key from %syour account on the limesurvey.org website%s."), $aopen, $aclose); ?>
        <?php
        $aopen  = '<a href="https://account.limesurvey.org/sign-up">';
        $aclose = '</a>';
        ?><br>
    <?php echo sprintf(gT("If you don't have an account on limesurvey.org, please %sregister first%s."), $aopen, $aclose);?></p>
    <?php
    $url = Yii::app()->createUrl('/admin/update/sa/submitkey');
    echo CHtml::beginForm($url, 'post', array("id" => "submitKeyForm"));
    echo CHtml::hiddenField('destinationBuild', Yii::app()->request->getParam('destinationBuild', ''));?>
    <div class="mb-3">
        <?php
        echo CHtml::label(gT('Enter your update key:'), 'inputKey', array('class' => 'col-md-2'));
        ?>
... (20 lines truncated)
</file>

<file path="application/views/admin/update/updater/welcome/_updater_update.php">
<?php
?>
<h3 class="maintitle"><?php eT("ComfortUpdate needs to be updated");?></h3>
<?php
if (isset($serverAnswer->html)) {
    echo $serverAnswer->html;
}
?>
<div class="updater-background">
    <?php eT("Before you proceed to the LimeSurvey update, we must first update ComfortUpdate itself.");?>
    <br/>
    <?php eT("At the end of the process we'll proceed to the LimeSurvey update.");?>
</div>
<!-- The form launching the update of the updater. -->
<?php echo CHtml::beginForm(Yii::app()->getController()->createUrl('admin/update/sa/updateUpdater'), 'post', array('id' => 'launchUpdateUpdaterForm')); ?>
    <?php  echo CHtml::hiddenField('destinationBuild', $serverAnswer->destinationBuild); ?>
    <a class="btn btn-cancel" href="<?php echo Yii::app()->createUrl("admin/update"); ?>" role="button" aria-disabled="false">
        <?php eT("Cancel"); ?>
    </a>
    <?php echo CHtml::submitButton(gT("Continue", 'unescaped'), array('class' => "ajax_button btn btn-outline-secondary",)); ?>
<?php echo CHtml::endForm(); ?>
<!-- this javascript code manage the step changing. It will catch the form submission, then load the comfortupdate for the required build -->
<script type="text/javascript" src="<?php echo Yii::app()->baseUrl; ?>/assets/scripts/admin/comfortupdate/comfortUpdateNextStep.js"></script>
<script>
    $('#launchUpdateUpdaterForm').comfortUpdateNextStep({'step': 0});
</script>
</file>

<file path="application/views/admin/update/updater/welcome/_welcome.php">
<?php
?>
<?php $urlNew = Yii::app()->createUrl("admin/update", array("update" => 'newKey', 'destinationBuild' => $serverAnswer->destinationBuild)); ?>
<h3 class="maintitle"><?php eT('Welcome to the LimeSurvey ComfortUpdate!');?></h3>
<?php
if (isset($serverAnswer->html)) {
    if ($serverAnswer->html != 'update_unstable') {
        echo $serverAnswer->html;
    }
}
?>
<!-- Welcome Message -->
<div class="row">
    <div id="welcomeMessage" class="col-12 col-xl-6">
        <?php
            echo gT('The LimeSurvey ComfortUpdate is an easy procedure to quickly update to the latest version of LimeSurvey.') . '<br /><br />';
            echo '<ul><li>' . gT('The following steps will be done by this update:') . '</li>';
            echo '<li>' . gT('Your LimeSurvey installation is checked if the update can be run successfully.') . '</li>';
            echo '<li>' . gT('New files will be downloaded and installed.') . '</li>';
            echo '<li>' . gT('If necessary the database will be updated in a final step.') . '</li></ul>';
        ?>
    </div>
    <!-- The key information-->
    <div class="col-xl-6 d-md-none d-lg-block">
        <div class="card card-primary">
            <div class="card-header">
                <?php eT('ComfortUpdate key information'); ?>
            </div>
            <div class="card-body">
            <?php
... (73 lines truncated)
</file>

<file path="application/views/admin/update/updater/_error.php">
<?php
$urlNew = Yii::app()->createUrl("admin/update", array("update" => 'newKey', 'destinationBuild' => $_REQUEST['destinationBuild']));
$buttons = 0;
switch ($errorObject->error) {
    case 'no_server_answer':
        $title = gT('No server answer!');
        $message = gT("We couldn't reach the server or the server didn't provide any answer. Please try again in few minutes.");
        break;
    case 'db_error':
        $title = gT('Database error!');
        $message = gT("ComfortUpdate encountered an error while trying to get data from your database.");
        break;
    case 'unzip_error':
        $title = gT('Unzip error!');
        $message = gT("ComfortUpdate couldn't unzip the update file (or the updater update file)");
        break;
    case 'zip_update_not_found':
        $title = gT('Zip file not found!');
        $message = gT("ComfortUpdate couldn't find the update file on your local system (or the updater update file)");
        break;
    case 'cant_zip_backup':
        $title = gT('Zip error!');
        $message = gT("ComfortUpdate could not zip the files for your backup");
        break;
    case 'error_while_processing_download':
        $title = gT('Download error!');
        $message = gT("ComfortUpdate could not download the update!");
        break;
    case 'out_of_updates':
        $title = gT("Your update key has exceeded the maximum number of updates!");
... (121 lines truncated)
</file>

<file path="application/views/admin/update/updater/_progress.php">
<?php
?>
<div id="progressContainer">
    <h3 class="maintitle"><?php eT("Progress"); ?></h3>
    <ol>
        <li id ="step0Updt" class="on">
            <span id="welcome"><?php eT("Welcome"); ?></span>
            <span id="newKey" style="display : none;"><?php eT("New key"); ?></span>
        </li>
        <li id="step1Updt" class="off">
            <?php eT("Pre-installation check"); ?>
        </li>
        <li id="step2Updt" class="off">
            <?php eT("Change log"); ?>
        </li>
        <li id="step3Updt" class="off">
            <?php eT("File system"); ?>
        </li>
        <li id="step4Updt" class="off">
            <?php eT("Backup"); ?>
        </li>
        <li id="step5Updt" class="off">
            <?php eT("End"); ?>
        </li>
    </ol>
</div>
</file>

<file path="application/views/admin/update/updater/_right_container.php">
<?php
?>
    <!-- the ajax loader -->
    <div id="ajaxContainerLoading" >
        <p><?php eT('Please wait, loading data...');?></p>
        <i class="ri-loader-2-fill remix-3x remix-spin lsLoadingStateIndicator"></i>
    </div>
    <!-- Here come the different steps content. Content is loaded by the ajax request (see ./steps for html views)  -->
    <div id="updaterContainer">
        <!-- content loaded by ajax -->
    </div>
</file>

<file path="application/views/admin/update/updater/_updater.php">
<?php
?>
<div id="updaterLayout" style="display: none;" class="row">
    <div class="col-md-3">
        <?php
            $this->renderPartial("./update/updater/_progress");
        ?>
    </div>
    <div class="col-md-9">
        <?php
             $this->renderPartial("./update/updater/_right_container");
        ?>
    </div>
</div>
</file>

<file path="application/views/admin/update/_ajaxVariables.php">
<?php
$p = new CHtmlPurifier();
?>
<script>
    var csrf_token_name = "<?php echo sanitize_paranoid_string(Yii::app()->request->csrfTokenName);?>";
    var csrf_token = "<?php echo htmlspecialchars((string) Yii::app()->request->csrfToken);?>";
</script>
<?php if (isset($_REQUEST['update'])) :?>
    <?php echo CHtml::hiddenField('update_step', $p->purify($_REQUEST['update']), array('id' => 'update_step'));?>
<?php else :?>
    <?php echo CHtml::hiddenField('update_step', '', array('id' => 'update_step'));?>
<?php endif;?>
<?php if (isset($_REQUEST['destinationBuild'])) :?>
    <?php echo CHtml::hiddenField('destinationBuildForAjax', (int)$_REQUEST['destinationBuild'], array('id' => 'destinationBuildForAjax'));?>
<?php endif;?>
<?php if (isset($_REQUEST['access_token'])) :?>
    <?php echo CHtml::hiddenField('access_tokenForAjax', $p->purify($_REQUEST['access_token']), array('id' => 'access_tokenForAjax'));?>
<?php endif;?>
 <input id="updatebothbranchdatas" type="hidden" data-url="<?php echo Yii::app()->createUrl("admin/update/sa/getbothbuttons"); ?>"/>
 <input id="updatestrablebranchdatas" type="hidden" data-url="<?php echo Yii::app()->createUrl("admin/update/sa/getstablebutton"); ?>"/>
 <input id="newkeyurl" type="hidden" data-url="<?php echo Yii::app()->createUrl("admin/update/sa/getnewkey"); ?>"/>
 <input id="filesystemurl" type="hidden" data-url="<?php echo Yii::app()->createUrl("admin/update/sa/fileSystem"); ?>"/>
 <input id="checklocalerrorsurl" type="hidden" data-url="<?php echo Yii::app()->createUrl("admin/update/sa/checkLocalErrors"); ?>"/>
 <input id="welcomeurl" type="hidden" data-url="<?php echo Yii::app()->createUrl("admin/update/sa/getwelcome"); ?>"/>
<input id="localerrormsg" type="hidden" data-message="<?php echo eT('You have an error inside your local installation of LimeSurvey. See:');?>" />
</file>

<file path="application/views/admin/update/_update_notification.php">
<?php
?>
<?php
    $urlUpdate = Yii::app()->createUrl("admin/update");
    $urlUpdateNotificationState = Yii::app()->createUrl("admin/update/sa/notificationstate");
?>
<?php if (Yii::app()->session['notificationstate'] == 1) :?>
    <div class="col-12" id="update-container">
        <?php if ($security_update_available) :?>
            <?php
            $this->widget('ext.AlertWidget.AlertWidget', [
                'text' => '<strong>' . gT("Security update!") . '</strong> ' . gT("A security update is available.") . ' <a class="ls-link" href="' . $urlUpdate . '"> ' . gT('Click here to use ComfortUpdate.') . '</a>',
                'type' => 'warning',
                'showCloseButton' => true,
                'htmlOptions' => ['id' => 'update-alert', 'data-url-notification-state' => $urlUpdateNotificationState]
            ]);
            ?>
        <?php elseif (Yii::app()->session['unstable_update']) :?>
            <?php
            $labelMap = ['alpha' => gT('Alpha'), 'beta' => gT('Beta'), 'rc' => gT('Release Candidate')];
            $labelNames = [];
            foreach ($stability_labels as $label) {
                if (isset($labelMap[$label])) {
                    $labelNames[] = $labelMap[$label];
                }
            }
            $stabilityText = !empty($labelNames) ? implode(', ', $labelNames) : gT('unstable');
            $this->widget('ext.AlertWidget.AlertWidget', [
                'text' => '<strong>' . sprintf(gT('New %s update available:'), $stabilityText) . '</strong> <a href="' . $urlUpdate . '"> ' . gT('Click here to use ComfortUpdate or to download it.') . ' <strong>' . gT("You don't need an update key.") . '</strong></a>',
                'type' => 'info',
... (17 lines truncated)
</file>

<file path="application/views/admin/update/_updateContainer.php">
<?php
echo viewHelper::getViewTestTag('update');
?>
<!-- this view contain the input provinding to the js the information about which content to load : check buttons or comfortupdate -->
<?php
$this->renderPartial("./update/_ajaxVariables");
?>
<div class="col-12 list-surveys" id="comfortUpdateGeneralWrap">
    <div class="pagetitle h3">
        <span id="comfortUpdateIcon" class="ri-shield-check-fill text-success"></span>
        <?php if (YII_DEBUG) : ?>
            <small>
                Server:
                <em class="text-primary">
                    <?= Yii::app()->getConfig("comfort_update_server_url"); ?>
                </em>
            </small>
        <?php endif; ?>
    </div>
    <div class="row">
        <div class="col-12 content-right">
            <div id="updaterWrap">
                <div id="preUpdaterContainer">
                    <!-- The check buttons : render by ajax only if no step is required by url or post -->
                    <?php ?>
                    <?php
                    if ($serverAnswer->result) {
                        unset($serverAnswer->result);
                        $this->renderPartial('./update/check_updates/update_buttons/_updatesavailable', ['updateInfos' => $serverAnswer]);
                    } else {
... (11 lines truncated)
</file>

<file path="application/views/admin/user/deluser.php">
<div class='header'><?php eT("Delete user"); ?></div>
<div class='messagebox'>
    <?php echo CHtml::form(array("admin/user/sa/deluser"), 'post', array('name' => 'deluserform', 'id' => 'deluserform')); ?>
        <?php eT("Transfer the surveys of this user to: "); ?>
        <select name='transfer_surveys_to'>
            <?php
            if (count($users) > 0) {
                foreach ($users as $user) {
                    $intUid = $user['uid'];
                    $sUsersName = $user['users_name'];
                    $selected = '';
                    if ($intUid == $current_user) {
                        $selected = ' selected="selected"';
                    }
                    if ($postuserid != $intUid) {
                        ?>
                        <option value="<?php echo $intUid; ?>" <?php echo $selected; ?>> <?php echo $sUsersName; ?></option>;
                        <?php
                    }
                }
            }
            ?>
        </select>
        <input type="hidden" name="uid" value="<?php echo $postuserid; ?>" />
        <input type="hidden" name="user" value="<?php echo $postuser; ?>" />
        <input type="hidden" name="action" value="finaldeluser" />
        <input type="submit" value="<?php eT("Delete user"); ?>" />
    </form>
</div>
</file>

<file path="application/views/admin/user/mboxwithredirect.php">
<div class="jumbotron message-box">
    <h2><?php echo $title; ?></h2>
    <p class="lead <?php echo $classMsg; ?>"><?php echo $message; ?></p>
    <p><?php echo $extra; ?></p>
    <p>
        <?php echo CHtml::form($url, 'post'); ?>
        <input type="submit" class="btn btn-outline-secondary" value="<?php echo $urlText; ?>"/>
        <?php
        if (!empty($hiddenVars)) {
            foreach ($hiddenVars as $key => $value) {
                ?>
                <input type="hidden" name="<?php echo $key; ?>" value="<?php echo $value; ?>">
                <?php
            }
        }
        ?>
        <?php echo CHtml::endForm(); ?>
    </p>
</div>
</file>

<file path="application/views/admin/user/modifyuser.php">
<?php
echo viewHelper::getViewTestTag('modifyUser');
?>
<div class="pagetitle h3">
<?php eT("Editing user");?>
</div>
<div class="container">
    <div class="row" style="margin-bottom: 100px">
      <div class="col-12 content-right">
        <?php $form = $this->beginWidget('TbActiveForm', array(
                'id'    => 'moduserform',
                'action' => array("admin/user/sa/moduser"),
                'enableAjaxValidation' => false,
            )); ?>
                <div class="mb-3">
                    <label for="user" class=" form-label">
                        <?php eT("Username");?>
                    </label>
                    <div class="">
                        <?php echo $form->textField($oUser, 'users_name', array('readonly' => 'readonly'));?>
                    </div>
                    <div class="">
                        <span class='text-info'><?php eT("The user name cannot be changed."); ?></span>
                    </div>
                </div>
                <div class="mb-3">
                    <label for="email" class=" form-label">
                        <?php eT("Email");?>
                    </label>
                    <div class="">
... (34 lines truncated)
</file>

<file path="application/views/admin/user/personalsettings.php">
<?php
echo viewHelper::getViewTestTag('personalsettings');
$aQuestionTypeGroups = [];
if (App()->session['questionselectormode'] !== 'default') {
    $selectormodeclass = App()->session['questionselectormode'];
} else {
    $selectormodeclass = App()->getConfig('defaultquestionselectormode');
}
foreach ($aQuestionTypeList as $questionTheme) {
    $htmlReadyGroup = str_replace(' ', '_', strtolower((string) $questionTheme->group));
    if (!isset($aQuestionTypeGroups[$htmlReadyGroup])) {
        $aQuestionTypeGroups[$htmlReadyGroup] = [
            'questionGroupName' => $questionTheme->group
        ];
    }
    $imageName = $questionTheme->question_type;
    if ($imageName == ":") {
        $imageName = "COLON";
    } else {
        if ($imageName == "|") {
            $imageName = "PIPE";
        } else {
            if ($imageName == "*") {
                $imageName = "EQUATION";
            }
        }
    }
    $questionTypeData = [];
    $questionTypeData['type'] = $questionTheme->question_type;
    $questionTypeData['name'] = $questionTheme->name;
... (500 lines truncated)
</file>

<file path="application/views/admin/user/setuserpermissions.php">
<?php
echo viewHelper::getViewTestTag('setUserPermissions');
?>
<!-- set user permissions -->
<div class="pagetitle h3"><?php printf(gT("Edit user permissions for user %s"), "<em>" . \CHtml::encode($oUser->users_name) . "</em>"); ?></div>
<div class="row" style="margin-bottom: 100px">
    <div class="col-xl-10 offset-xl-1">
        <!-- Form -->
        <?php echo CHtml::form(array("admin/user/sa/savepermissions"), 'post', array('id' => 'savepermissions'));?>
            <table class='userpermissions activecell table table-striped'>
                <thead>
                    <tr>
                        <th></th>
                        <th><?php eT("Permission");?></th>
                        <th><input type='button' class="btn btn-outline-secondary btn-sm" id='btnToggleAdvanced' value='<<' /></th>
                        <th class='extended'><?php eT("Create");?></th>
                        <th class='extended'><?php eT("View/read");?></th>
                        <th class='extended'><?php eT("Update");?></th>
                        <th class='extended'><?php eT("Delete");?></th>
                        <th class='extended'><?php eT("Import");?></th>
                        <th class='extended'><?php eT("Export");?></th>
                    </tr>
               </thead>
                <!-- Permissions -->
                <?php foreach ($aBasePermissions as $sPermissionKey => $aCRUDPermissions) : ?>
                    <tr>
                        <!-- Icon -->
                        <td>
                            <i class="<?php echo $aCRUDPermissions['img']; ?> text-success"></i>
                            <?php echo $aCRUDPermissions['description'];?>
... (48 lines truncated)
</file>

<file path="application/views/admin/user/setusertemplates.php">
<div class="pagetitle h3"><?php printf(gT('Edit theme permissions for user %s'), "<em>" . \CHtml::encode($oUser->users_name) . "</em>");?></div>
<div class="row">
    <div class="col-12">
        <p><?php eT("If the user doesn't have global view/read global permission for themes, please select the themes he should be able to use for surveys."); ?></p>
    </div>
</div>
<div class="row" style="margin-bottom: 100px">
    <div class="col-xl-6 offset-xl-3 content-right">
        <?php echo CHtml::form(array("admin/user/sa/usertemplates"), 'post', array('name' => 'modtemplaterightsform', 'id' => 'modtemplaterightsform')); ?>
        <table id="user-template-permissions" class="table table-striped activecell" style="margin:0 auto;">
            <thead>
                <tr>
                    <th>
                        <?php eT('Theme name');?>
                    </th>
                    <th>
                        <?php eT('Available for surveys');?>
                    </th>
                </tr>
                <tr>
                    <th>
                        <?php eT('All themes');?>
                    </th>
                    <th>
                        <?php $this->widget('ext.ButtonGroupWidget.ButtonGroupWidget', [
                            'name'          => 'alltemplates',
                            'checkedOption' => 0,
                            'selectOptions' => [
                                '1' => gT('On'),
                                '0' => gT('Off'),
... (40 lines truncated)
</file>

<file path="application/views/admin/endScripts_view.php">
<?php
</file>

<file path="application/views/admin/error_view.php">
<div class="jumbotron message-box message-box-error">
        <h2><?php echo $sHeading; ?></h2>
        <p class="lead"><?php eT('Error'); ?></p>
        <p><?php echo eT($sMessage); ?></p>
        <p><a class="btn btn-lg btn-primary" href="<?php echo $this->createUrl("admin/"); ?>" role="button"><?php eT("OK"); ?></a></p>
</div>
</file>

<file path="application/views/admin/index.php">
<?php
$this->getAdminHeader(Yii::app()->session['metaHeader']);
$this->_showadminmenu();
$this->getAdminFooter("http://manual.limesurvey.org", gT("LimeSurvey online manual"));
</file>

<file path="application/views/assessment/assessments_delete.php">
<?php
?>
<div id="assesements-delete" class="modal fade" role="dialog">
    <div class="modal-dialog">
        <div class="modal-content">
            <?php echo CHtml::form(array("assessment/delete/surveyid/$surveyid"), 'post', array('class' => 'form','id' => 'assessmentsdeleteform','name' => 'assessmentsdeleteform', 'role' => 'form'));?>
            <?php
            Yii::app()->getController()->renderPartial(
                '/layouts/partial_modals/modal_header',
                ['modalTitle' => gT('Delete assessment rule')]
            );
            ?>
                <div class="modal-body">
                    <!-- delete params -->
                    <div>
                        <input type='hidden' name='sid' value='<?php echo $surveyid;?>' />
                        <input type='hidden' name='id' value='' />
                    </div>
                    <p class='modal-body-text'><?php eT("Do you really want to delete this assessment rule?"); ?></p>
                </div>
                <div class="modal-footer modal-footer-buttons">
                    <button type="button" class="btn btn-cancel" data-bs-dismiss="modal"><?php eT('Cancel'); ?></button>
                    <button type="button" class="btn btn-danger" id="selector__assessements-delete-modal">
                        <?php eT("Delete")?>
                    </button>
                </div>
            </form>
        </div>
    </div>
</div>
... (1 lines truncated)
</file>

<file path="application/views/assessment/assessments_edit.php">
<?php
?>
<div id="assesements-edit-add" class="modal fade" role="dialog" data-bs-focus="false">
    <div class="modal-dialog">
        <div class="modal-content">
            <?php echo CHtml::form(["/assessment/insertUpdate/surveyid/$surveyid"], 'post', ['class' => 'form', 'id' => 'assessmentsform', 'name' => 'assessmentsform', 'role' => 'form']); ?>
            <?php
            Yii::app()->getController()->renderPartial(
                '/layouts/partial_modals/modal_header',
                ['modalTitle' => gT('Add assessment rule')]
            );
            ?>
            <div class="modal-body">
                <!-- Scope, Total, Group -->
                <div class='row'>
                    <div class='mb-3 col-12 row'>
                        <label class='form-label col-md-2' id='scope-label'>
                            <?php eT("Scope:"); ?>
                        </label>
                        <div class='col-md-10 ls-flex wrap'>
                            <div class="btn-group" role="group" aria-labelledby="scope-label">
                                <input class='btn-check' type='radio' id='radiototal' name='scope' value='T' checked='checked'/>
                                <label class='btn btn-outline-secondary' for="radiototal"><?php eT("Total"); ?></label>
                                <input class='btn-check' type='radio' id='radiogroup' name='scope' value='G'/>
                                <label class='btn btn-outline-secondary' for="radiogroup"><?php eT("Group"); ?></label>
                            </div>
                        </div>
                    </div>
                    <!-- Question group -->
                    <div class='mb-3 col-12 row'>
... (112 lines truncated)
</file>

<file path="application/views/assessment/assessments_view.php">
<?php
$pageSize = intval(Yii::app()->user->getState('pageSize', Yii::app()->params['defaultPageSize']));
?>
  <div class="side-body">
    <?=viewHelper::getViewTestTag('surveyAssessments');?>
      <h1 class="page-title h3" ><?=gT("Assessments")?></h1>
        <?php
            $messageLink = gT("Assessment mode for this survey is not activated.") . '<br/>'
                . gT("If you want to activate it, click here:") . '<br/>'
                . '<a role="button" class="btn btn-primary" href="'
                . $this->createUrl('/assessment/activate', ['surveyid' => $surveyid])
                . '">' . gT('Activate assessements') . '</a>';
        if (!Assessment::isAssessmentActive($surveyid)) {
            ?>
          <div class="row text-center">
            <div class="jumbotron message-box warningheader col-md-12 col-lg-6 offset-lg-3">
              <h2><?= gT("Assessment mode not activated"); ?></h2>
              <?php echo $messageLink; ?>
            </div>
          </div>
            <?php
        } else {
            ?>
            <h2><?php eT("Assessment rules");?></h2>
            <div class="row">
                <a href="#" id="loadEditUrl_forModalView" data-editurl="<?=$this->createUrl("assessment/edit/", ["surveyid" => $surveyid]);?>"></a>
                <?php
                    $this->widget('ext.admin.grid.CLSGridView', array(//done
                        'dataProvider' => $model->search(),
                        'id' => 'assessments-grid',
... (47 lines truncated)
</file>

<file path="application/views/dashboard/welcome.php">
<?php
echo viewHelper::getViewTestTag('index');
?>
<?php
gT('Create survey');
gT('Create a new survey');
gT('List surveys');
gT('List available surveys');
gT('Global settings');
gT('Edit global settings');
gT('ComfortUpdate');
gT('Stay safe and up to date');
gT('Label sets');
gT('Edit label sets');
gT('Themes');
?>
<!-- Welcome view -->
<div class="welcome">
    <!-- Logo & Presentation -->
    <?php if ($bShowLogo && $oldDashboard) : ?>
        <div class="jumbotron" id="welcome-jumbotron">
            <img alt="logo" src="<?php echo LOGO_URL; ?>" id="lime-logo" class="profile-img-card img-fluid" />
            <p class="d-xs-none"><?php echo PRESENTATION;
            ?></p>
        </div>
    <?php endif; ?>
    <!-- Extra banner after logo-->
    <?= $belowLogoHtml ?>
    <!-- Message when first start -->
    <?php if ($countSurveyList == 0  && Permission::model()->hasGlobalPermission('surveys', 'create')) : ?>
... (139 lines truncated)
</file>

<file path="application/views/failedEmail/notification_message/_notification_message.php">
<?php
?>
<p>
    <?= nl2br((string) gT("Dear survey administrator, \nThere were one or more notification emails that failed to be sent. Please check the 'Failed email notifications' section in the survey(s) listed below.", 'unescaped')) ?>
</p>
<ul>
    <?php
    foreach ($failedEmailSurveyTitles as $surveyId => $surveyTitle) : ?>
        <li>
            <?= CHtml::link(
                sprintf(gT("%s (ID: %s)"), $surveyTitle, $surveyId),
                Yii::app()->createUrl("failedEmail/index/", ['surveyid' => $surveyId])
            ) ?>
        </li>
        <?php
    endforeach; ?>
</ul>
</file>

<file path="application/views/failedEmail/partials/modal/delete_form.php">
<?php
?>
<?= App()->getController()->renderPartial('/layouts/partial_modals/modal_header', ['modalTitle' => gT('Delete failed email notifications')]) ?>
<?= CHtml::form(['/failedEmail/delete/', 'surveyid' => $surveyId, 'item' => $id], 'post', ['id' => 'failedemail-action-modal--form']) ?>
<div class="modal-body">
    <p><?= gT('Are you sure you want to delete the selected notifications?') ?></p>
</div>
<div class="modal-footer modal-footer-buttons">
    <button id="exitForm" class="btn btn-cancel  "><?= gT('Cancel') ?></button>
    <button class="btn btn-danger" id="submitForm"><?= gT('Delete') ?></button>
</div>
<?= CHtml::endForm() ?>
</file>

<file path="application/views/failedEmail/partials/modal/delete_result_body.php">
<?php
 ?>
<div class="container-center">
    <div class="row">
        <div id="failedemail-action-modal--deleteresult" class="col-sm-12">
            <p><?= sprintf(gT('Sucessfully deleted email notifications: %s'), $deletedCount) ?></p>
        </div>
    </div>
</div>
</file>

<file path="application/views/failedEmail/partials/modal/delete_result.php">
<?php
 ?>
<div class="modal-header">
    <div class="modal-title h4">
        <?= gT('Deleted email notifications') ?>
    </div>
</div>
<div class="modal-body">
    <?= $this->renderPartial('./partials/modal/delete_result_body', [
        'deletedCount' => $deletedCount
    ]) ?>
</div>
<div class="modal-footer modal-footer-buttons">
    <button id="exitForm" class="btn btn-outline-secondary"><?= gT('Close') ?></button>
</div>
</file>

<file path="application/views/failedEmail/partials/modal/email_content.php">
<?php
 ?>
<?= App()->getController()->renderPartial('/layouts/partial_modals/modal_header', ['modalTitle' => gT('Email content')]) ?>
<div id="failedemail-action-modal--emailcontent" class="modal-body">
    <?= $failedEmail->getRawMailBody() ?>
</div>
<div class="modal-footer modal-footer-buttons">
    <button id="exitForm" class="btn btn-cancel  "><?= gT('Close') ?></button>
</div>
</file>

<file path="application/views/failedEmail/partials/modal/email_error.php">
<?php
 ?>
<?= App()->getController()->renderPartial('/layouts/partial_modals/modal_header', ['modalTitle' => gT('Error message')]) ?>
<div id="failedemail-action-modal--emailerror" class="modal-body">
    <?= $failedEmail->error_message ?>
</div>
<div class="modal-footer modal-footer-buttons">
    <button id="exitForm" class="btn btn-cancel  "><?= gT('Close') ?></button>
</div>
</file>

<file path="application/views/failedEmail/partials/modal/resend_body.php">
<?php
?>
<label class="control-label" for="deleteAfterResend"><?= gT('Delete email(s) from list after sending was successful') ?></label>
<div>
    <input class="custom-data" type="checkbox" name="deleteAfterResend" id="deleteAfterResend" checked/>
</div>
</file>

<file path="application/views/failedEmail/partials/modal/resend_form.php">
<?php
?>
<?= App()->getController()->renderPartial('/layouts/partial_modals/modal_header', ['modalTitle' => gT('Resend')]) ?>
<?= CHtml::form(['/failedEmail/resend/', 'surveyid' => $surveyId, 'item' => $id], 'post', ['id' => 'failedemail-action-modal--form']) ?>
<div class="modal-body">
    <?= $this->renderPartial('./partials/modal/resend_body', [], false) ?>
</div>
<div class="modal-footer modal-footer-buttons">
    <button id="exitForm" class="btn btn-cancel  "><?= gT('Cancel') ?></button>
    <button class="btn btn-primary" id="submitForm"><?= gT('Resend') ?></button>
</div>
<?= CHtml::endForm() ?>
</file>

<file path="application/views/failedEmail/partials/modal/resend_result_body.php">
<?php
 ?>
<div class="container-center">
    <div class="row">
        <div id="failedemail-action-modal--resendresult" class="col-sm-12">
            <p><?= sprintf(gT('Sucessfull emails: %s'), $successfullEmailCount) ?></p>
            <p><?= sprintf(gT('Failed emails: %s'), $failedEmailCount) ?></p>
        </div>
    </div>
</div>
</file>

<file path="application/views/failedEmail/partials/modal/resend_result.php">
<?php
 ?>
<div class="modal-header">
    <div class="modal-title h4">
        <?= gT('Email send result') ?>
    </div>
</div>
<div class="modal-body">
    <?= $this->renderPartial('./partials/modal/resend_result_body', [
        'successfullEmailCount' => $successfullEmailCount,
        'failedEmailCount'      => $failedEmailCount
    ]) ?>
</div>
<div class="modal-footer modal-footer-buttons">
    <button id="exitForm" class="btn btn-outline-secondary"><?= gT('Close') ?></button>
</div>
</file>

<file path="application/views/failedEmail/failedEmail_index.php">
<?php
require_once Yii::getPathOfAlias('application.extensions.admin.grid.FloatingActionsWidget.actions.FailedEmailMassiveActions') . '.php';
?>
<?= viewHelper::getViewTestTag('surveyFailedEmail') ?>
    <div class='side-body'>
        <h3><?php eT("Failed email notifications"); ?></h3>
        <?php
        $this->widget('ext.AlertWidget.AlertWidget', [
            'text' => gT("Please note that failed email notifications will be automatically deleted after 30 days."),
            'type' => 'info',
        ]);
        ?>
        <!-- Grid -->
        <div class="row">
            <div class="content-right">
                <?php
                $this->widget('ext.admin.grid.FloatingActionsWidget.FloatingActionsWidget', [
                    'pk'       => 'id',
                    'gridId'   => 'failedemail-grid',
                    'aActions' => \actions\FailedEmailMassiveActions::getActions($surveyId, $permissions),
                ]);
                $this->widget('application.extensions.admin.grid.CLSGridView', [
                    'dataProvider' => $failedEmailModel->search(),
                    'filter' => $failedEmailModel,
                    'id' => 'failedemail-grid',
                    'emptyText' => gT('No failed email notifications found'),
                    'lsShowSelectionBar' => false,
                    'lsPageSizeCurrentValue'  => $pageSize,
                    'lsPageSizeOptions'       => App()->params['pageSizeOptionsTokens'],
                    'htmlOptions' => ['class' => 'table-responsive grid-view-ls'],
... (17 lines truncated)
</file>

<file path="application/views/homepageSettings/partial/topbarBtns/leftSideButtons.php">
<?php
$this->widget(
    'ext.ButtonWidget.ButtonWidget',
    [
        'name' => 'create-box-button',
        'id' => 'create-box-button',
        'text' => gT('Create box'),
        'icon' => 'icon-add',
        'link' => $this->createUrl('homepageSettings/createBox/'),
        'htmlOptions' => [
            'class' => 'btn btn-primary',
        ],
    ]
);
</file>

<file path="application/views/homepageSettings/partial/topbarBtns/rightSideButtons.php">
<?php
$this->widget(
    'ext.ButtonWidget.ButtonWidget',
    [
        'name' => 'reset-button',
        'id' => 'reset-button',
        'text' => gT('Reset'),
        'icon' => 'ri-refresh-line',
        'htmlOptions' => [
            'class' => 'btn btn-warning',
            'data-bs-toggle' => "modal",
            'data-bs-target' => '#confirmation-modal',
            'data-btnclass' => 'btn-primary',
            'data-btntext' => gT('OK'),
            'data-post-url' => $this->createUrl('homepageSettings/resetAllBoxes/'),
            'data-title' => gT("Please confirm"),
            'data-message' => gT('This will delete all current boxes to restore the default ones. Are you sure you want to continue?'),
        ],
    ]
);
</file>

<file path="application/views/homepageSettings/_form.php">
<?php
?>
<div class="container">
    <?php $form = $this->beginWidget(
        'TbActiveForm',
        array(
            'id' => 'boxes-form',
            'enableAjaxValidation' => false
        )
    ); ?>
    <?php
    $this->widget('ext.AlertWidget.AlertWidget', ['errorSummaryModel' => $model]);
    ?>
    <div class="mb-3">
        <label class='form-label '><?php echo $form->labelEx($model, 'position'); ?></label>
        <div class=''>
            <?php echo $form->numberField($model, 'position', array('class' => 'form-control')); ?>
        </div>
        <?php if ($form->error($model, 'position')) : ?>
            <div class=" text-danger">
                <?php echo $form->error($model, 'position'); ?>
            </div>
        <?php endif; ?>
    </div>
    <div class="mb-3">
        <label class='form-label '><?php echo $form->labelEx($model, 'url'); ?></label>
        <div class=''>
            <?php echo $form->textField($model, 'url', array('class' => 'form-control')); ?>
        </div>
        <?php if ($form->error($model, 'url')) : ?>
... (95 lines truncated)
</file>

<file path="application/views/homepageSettings/create.php">
<?php
echo viewHelper::getViewTestTag('createNewBox');
?>
<div class="col-12 list-surveys">
    <?php $this->renderPartial(
        '_form',
        [
            'model' => $model,
            'icons_length' => $model->icons_length,
            'icons' => $model->icons,
            'action' => 'create',
        ]
    ); ?>
</div>
</file>

<file path="application/views/homepageSettings/index.php">
<?php
echo viewHelper::getViewTestTag('homepageSettings');
App()->getClientScript()->registerScript(
    'HomepageSettingsBSSwitcher',
    LSYii_ClientScript::POS_POSTSCRIPT
);
?>
<div class="row">
    <div class="col-12 list-surveys">
        <!-- Tabs -->
        <ul class="nav nav-tabs" id="boxeslist">
            <li class="nav-item">
                <a class="nav-link active" href='#boxes' data-bs-toggle="tab">
                    <?php eT('Buttons') ?>
                </a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href='#boxsettings' data-bs-toggle="tab">
                    <?php eT('Settings'); ?>
                </a>
            </li>
        </ul>
        <div class="tab-content">
            <!-- Boxes -->
            <div id="boxes" class="tab-pane fade show active">
                <?php $this->widget(
                    'application.extensions.admin.grid.CLSGridView',
                    [
                        'id' => 'boxes-grid',
                        'dataProvider' => $dataProviderBox->search(),
... (158 lines truncated)
</file>

<file path="application/views/homepageSettings/update.php">
<?php
?>
<div class="col-12 list-surveys">
    <?php $this->renderPartial(
        '_form',
        array(
            'model' => $model,
            'icons_length' => $model->icons_length,
            'icons' => $model->icons,
            'action' => 'update',
        )
    ); ?>
</div>
</file>

<file path="application/views/installer/dbconfig_view.php">
<?php
Yii::app()->clientScript->registerScript('dbType', "
$( document ).ready(function() {
    checkDbType();
    checkDbEngine();
});
$('#InstallerConfigForm_dbtype').change(function(){
    checkDbType();
});
$('#InstallerConfigForm_dbengine').change(function(){
    checkDbEngine();
});
function checkDbType(){
    var dbType = $('#InstallerConfigForm_dbtype').val();
    if(dbType == '" . InstallerConfigForm::DB_TYPE_MYSQL . "' || dbType == '" . InstallerConfigForm::DB_TYPE_MYSQLI . "') {
        $('#InstallerConfigForm_dbengine_row').show();
    } else {
        $('#InstallerConfigForm_dbengine_row').hide();
    }
    if(dbType == '" . InstallerConfigForm::DB_TYPE_SQLSRV . "' || dbType == '" . InstallerConfigForm::DB_TYPE_MSSQL . "') {
        $('#InstallerConfigForm_mssqlTrustServerCertificate_row').show();
    } else {
        $('#InstallerConfigForm_mssqlTrustServerCertificate_row').hide();
    }
}
function checkDbEngine(){
    if($('#InstallerConfigForm_dbengine').val() == '" . InstallerConfigForm::ENGINE_TYPE_INNODB . "') {
        $('#innodb-warning').addClass('d-flex');
        $('#innodb-warning').removeClass('d-none');
    } else {
... (80 lines truncated)
</file>

<file path="application/views/installer/license_view.php">
<div class="row">
    <div class="col-lg-3">
        <?php $this->renderPartial('/installer/sidebar_view', compact('progressValue', 'classesForStep')); ?>
    </div>
    <div class="col-lg-9">
        <?php
            echo CHtml::tag('h2', array(), $title);
            echo CHtml::tag('p', array(), $descp);
        ?>
        <iframe src="<?php echo $this->createUrl('installer/viewlicense'); ?>" style="height: 268px; width: 100%; border-width: 0px; background-color:#f7f8ff;"> </iframe>
        <?php echo CHtml::form(array("installer/license"), 'post', array('name' => 'formcheck')); ?>
            <div class="row navigator">
            <div class="col-lg-4">
                <input id="ls-previous" class="btn btn-outline-secondary" type="button" value="<?php eT("Previous"); ?>" onclick="javascript: window.open('<?php echo $this->createUrl("installer/install/welcome"); ?>', '_top')" />
            </div>
            <div class="col-lg-4"></div>
            <div class="col-lg-4">
                <input id="ls-accept-license" class="btn btn-outline-secondary" type="submit" value="<?php eT('I accept'); ?>" />
            </div>
            </div>
        </form>
    </div>
</div>
</file>

<file path="application/views/installer/nodatabase_view.php">
<?php
$this->widget('ext.AlertWidget.AlertWidget', [
    'text' => '<strong>' . gT("Database doesn't exist!") . '</strong>',
    'type' => 'warning',
]);
?>
<?php eT("The database you specified does not exist:"); ?>
<br /><br />
<strong><?= $model->dbname; ?></strong><br /><br />
<?php eT("LimeSurvey can attempt to create this database for you.")?><br /><br />
</file>

<file path="application/views/installer/optconfig_view.php">
<div class="row">
    <div class="col-lg-3">
        <?php $this->renderPartial('/installer/sidebar_view', compact('progressValue', 'classesForStep')); ?>
    </div>
    <div class="col-lg-9">
    <h2><?php echo $title; ?></h2>
    <legend><?php echo $descp; ?></legend>
    <?php if (isset($confirmation)) : ?>
        <?php
        $this->widget('ext.AlertWidget.AlertWidget', [
            'text' => $confirmation,
            'type' => 'success',
        ]);
        ?>
    <?php endif; ?>
        <?php
        $this->widget('ext.AlertWidget.AlertWidget', ['errorSummaryModel' => $model]);
        ?>
    <?php echo CHtml::beginForm($this->createUrl('installer/optional'), 'post', array('class' => '')); ?>
    <div class='mb-3'>
        <div class='col-12'>
            <i class='ri-information-fill'></i><?php eT("You can leave these settings blank and change them later"); ?>
        </div>
    </div>
    <?php
        $rows = array();
        $rows[] = array(
            'label' => CHtml::activeLabelEx($model, 'adminLoginName', array('class' => 'form-label ', 'label' => gT("Administrator username"), 'autofocus' => 'autofocus')),
            'description' => gT("This will be the username of the administrator user and used for logging in."),
            'control' => CHtml::activeTextField($model, 'adminLoginName', array('class' => 'form-control', 'required' => true))
... (57 lines truncated)
</file>

<file path="application/views/installer/populatedb_view.php">
<?php
?>
<div class="row">
    <div class="col-lg-3">
        <?php $this->renderPartial('/installer/sidebar_view', compact('progressValue', 'classesForStep')); ?>
    </div>
    <div class="col-lg-9">
        <h2><?php echo $title; ?></h2>
            <legend><?php eT('Database creation'); ?></legend>
                <?php if (!$model->dbExists) :?>
                    <?php  $this->renderPartial('/installer/nodatabase_view', ['model' => $model]);?>
                <?php endif;?>
                <?php if (isset($adminoutputText)) {
                    echo $adminoutputText;
                } ?>
            <div class="row">
                <div class="col-lg-4" >
                    <input class="btn btn-outline-secondary" type="button" value="<?php eT('Previous'); ?>" onclick="javascript: window.open('<?php echo $this->createUrl("installer/database"); ?>', '_top')" />
                </div>
                <div class="col-lg-4" style="text-align: center;">
                </div>
                <div class="col-lg-4" style="text-align: right;">
                    <?php
                    if (isset($next)) {
                        echo CHtml::form(array($next['action']), 'post');
                        echo CHtml::submitButton($next['label'], array(
                            'name' => $next['name'],
                            'class' => 'btn btn-outline-secondary'
                        ));
                        echo CHtml::endForm();
... (4 lines truncated)
</file>

<file path="application/views/installer/precheck_view.php">
<?php
$iconOk = "<span class='ri-check-fill text-success'></span>";
$iconFail = "<span class='ri-error-warning-fill text-danger'></span>";
?>
<div class="row">
    <div class="col-lg-3">
        <?php $this->renderPartial('/installer/sidebar_view', compact('progressValue', 'classesForStep')); ?>
    </div>
    <div class="col-lg-9">
        <?php if (empty($next) && empty($cookiesAllowed)) : ?>
            <div class="alert alert-warning" role="alert">
                <?= gT("Cookies seem to be disabled. Please use the \"Check again\" button instead of refreshing the page."); ?>
            </div>
        <?php endif; ?>
        <h2><?php echo $title; ?></h2>
        <p><?php echo $descp; ?></p>
        <legend><?php eT("Minimum requirements"); ?></legend>
        <table class='table-striped table'>
            <thead>
                <tr>
                       <th>&nbsp;</th>
                       <th class='text-center'><?php eT("Required"); ?></th>
                       <th class='text-center'><?php eT("Current"); ?></th>
                </tr>
            </thead>
            <tbody>
                <tr>
                       <td><?php eT("PHP version"); ?></td>
                       <td><?= $model::MINIMUM_PHP_VERSION?></td>
                       <td>
... (209 lines truncated)
</file>

<file path="application/views/installer/redirectmessage_view.php">
<div class="row">
    <div class="col-lg-3">
        <?php $this->renderPartial('/installer/sidebar_view', compact('progressValue', 'classesForStep')); ?>
    </div>
    <div class="col-lg-9">
        <h2><?php echo $title; ?></h2>
        <legend><?php eT("Database exists"); ?></legend>
        <?php
        $this->widget('ext.AlertWidget.AlertWidget', [
            'text' => $noticeMessage,
            'type' => 'success',
        ]);
        ?>
        <p><?php echo $text; ?></p>
    </div>
</div>
</file>

<file path="application/views/installer/sidebar_view.php">
<?php
?>
<h2 class="maintitle"><?php eT("Progress"); ?></h2>
<p><?php printf(gT("%s%% completed"), $progressValue); ?></p>
<?php
    echo TbHtml::animatedProgressBar($progressValue);
?>
<ol class="mt-3">
    <li class="<?php echo $classesForStep[0]; ?>">
        <?php eT("Welcome"); ?>
    </li>
    <li class="<?php echo $classesForStep[1]; ?>">
        <?php eT("License"); ?>
    </li>
    <li class="<?php echo $classesForStep[2]; ?>">
        <?php eT("Pre-installation check"); ?>
    </li>
    <li class="<?php echo $classesForStep[3]; ?>">
        <?php eT("Configuration"); ?>
    </li>
    <li class="<?php echo $classesForStep[4]; ?>">
        <?php eT("Database settings"); ?>
    </li>
    <li class="<?php echo $classesForStep[5]; ?>">
        <?php eT("Administrator settings"); ?>
    </li>
</ol>
</file>

<file path="application/views/installer/success_view.php">
<div class="row">
    <div class="col-lg-3">
        <?php $this->renderPartial('/installer/sidebar_view', compact('progressValue', 'classesForStep')); ?>
    </div>
    <div class="col-md-6">
        <h2><?php echo $title; ?></h2>
        <?php
        $this->widget('ext.AlertWidget.AlertWidget', [
            'text' => $descp,
            'type' => 'success',
        ]);
        ?>
        <legend> <?php eT("Administrator credentials"); ?></legend>
        <?php eT("Username:"); ?> <?php echo $user; ?> <br />
        <?php eT("Password:"); ?> <?php echo $pwd; ?>
        <div style="text-align: center">
            <a id="ls-administration" href="<?php echo $this->createUrl("/admin"); ?>" class="btn btn-outline-secondary btn btn-outline-secondary-default btn btn-outline-secondary-lg"><?php eT("Administration")?></a>
        </div>
    </div>
    <div class="col-md-3">
        <div class="thumbnail" style="padding: 1em;">
            <img class="rounded mx-auto d-block m-3" style="width: 50%;" src="<?php echo Yii::app()->baseUrl; ?>/installer/images/comfortupdate-logo.png" alt="ComfortUpdate Logo">
            <div class="caption">
                <h3><?= gT("ComfortUpdate"); ?></h3>
                <p>
                    <?= gT("Subscribe to ComfortUpdate to get access to:"); ?>
                    <ul>
                        <li><?= gT("Easy updates"); ?></li>
                        <li><?= gT("Technical support"); ?>*</li>
                        <li><?= gT("Legacy and LTS versions"); ?></li>
... (12 lines truncated)
</file>

<file path="application/views/installer/welcome_view.php">
<div class="row">
    <div class="col-lg-3">
        <?php $this->renderPartial('/installer/sidebar_view', compact('progressValue', 'classesForStep')); ?>
    </div>
    <div class="col-md-6">
        <h2><?php echo $title; ?></h2>
        <?php echo CHtml::form(array("installer/welcome"), 'post', array('class' => 'form-vertical')); ?>
            <legend><?php eT('Language selection'); ?></legend>
            <div class="row">
                <div class='mb-3'>
                    <div class="span6 col-12">
                        <?php
                            echo CHtml::label(gT('Please select your preferred language:'), 'installerLang', array('class' => 'form-label'));
                        ?>
                        <br/><br/>
                    </div>
                    <div class="col-md-6">
                        <?php
                            echo CHtml::dropDownList('installerLang', 'en', $languages, array('id' => 'installerLang', 'class' => 'form-select', 'encode' => false));
                        ?>
                        <br/><br/>
                    </div>
                </div>
            </div>
            <?php
            echo CHtml::tag('p', array(), gT('Your preferred language will be used through out the installation process.'));
            ?>
            <div class="row navigator">
                <div class="col-lg-8"></div>
                <div class="col-lg-4">
... (29 lines truncated)
</file>

<file path="application/views/layouts/partial_modals/modal_footer_canceladd.php">
<?php
?>
<div class="modal-footer modal-footer-buttons">
    <button type="button" class="btn btn-cancel" data-bs-dismiss="modal">
        <?php
        eT("Cancel"); ?>
    </button>
    <button type="button" class="btn btn-primary btn-ok">
        <?php eT("Add"); ?>
    </button>
</div>
</file>

<file path="application/views/layouts/partial_modals/modal_footer_cancelapply.php">
<?php
?>
<div class="modal-footer modal-footer-buttons">
    <button type="button" class="btn btn-cancel" data-bs-dismiss="modal">
        <?php
        eT("Cancel"); ?>
    </button>
    <button type="button" class="btn btn-primary btn-ok">
        <?php eT("Apply"); ?>
    </button>
</div>
</file>

<file path="application/views/layouts/partial_modals/modal_footer_cancelchange.php">
<?php
?>
<div class="modal-footer modal-footer-buttons">
    <button type="button" class="btn btn-cancel" data-bs-dismiss="modal">
        <?php
        eT("Cancel"); ?>
    </button>
    <button type="button" class="btn btn-primary btn-ok">
        <?php eT("Change"); ?>
    </button>
</div>
</file>

<file path="application/views/layouts/partial_modals/modal_footer_canceldelete.php">
<?php
?>
<div class="modal-footer modal-footer-buttons">
    <button type="button" class="btn btn-cancel" data-bs-dismiss="modal">
        <?php eT("Cancel"); ?>
    </button>
    <button type="button" class="btn btn-danger btn-ok">
        <?php eT("Delete"); ?>
    </button>
</div>
</file>

<file path="application/views/layouts/partial_modals/modal_footer_cancelexport.php">
<?php
?>
<div class="modal-footer modal-footer-buttons">
    <button type="button" class="btn btn-cancel" data-bs-dismiss="modal">
        <?php
        eT("Cancel"); ?>
    </button>
    <button type="button" class="btn btn-primary btn-ok">
        <?php eT("Export"); ?>
    </button>
</div>
</file>

<file path="application/views/layouts/partial_modals/modal_footer_cancelresend.php">
<?php
?>
<div class="modal-footer modal-footer-buttons">
    <button type="button" class="btn btn-cancel" data-bs-dismiss="modal">
        <?php
        eT("Cancel"); ?>
    </button>
    <button type="button" class="btn btn-primary btn-ok">
        <?php eT("Resend"); ?>
    </button>
</div>
</file>

<file path="application/views/layouts/partial_modals/modal_footer_cancelsave.php">
<?php
?>
<div class="modal-footer modal-footer-buttons">
    <button type="button" class="btn btn-cancel" data-bs-dismiss="modal">
        <?php eT("Cancel"); ?>
    </button>
    <button type="button" class="btn btn-primary btn-ok">
        <?php eT("Save"); ?>
    </button>
</div>
</file>

<file path="application/views/layouts/partial_modals/modal_header.php">
<?php
$modalTitleId = isset($modalTitleId) ? $modalTitleId : null;
$modalDialogSrId = !empty($modalTitleId) ? $modalTitleId . '-dialogsr' : null;
?>
<div class="modal-header">
    <h2 class="modal-title h1"<?= !empty($modalTitleId) ? ' id="' . CHtml::encode($modalTitleId) . '"' : '' ?>>
        <?php echo $modalTitle; ?>
    </h2>
    <?php if (!empty($modalTitleId) && !empty($modalDialogSrId)) : ?>
        <span class="visually-hidden" id="<?= CHtml::encode($modalDialogSrId) ?>"><?= gT('Dialog') ?></span>
    <?php endif; ?>
    <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="<?= gT('Close') ?>"></button>
</div>
</file>

<file path="application/views/layouts/partial_topbar/right_close_saveclose_save.php">
<?php
$isReturnBtn = $isReturnBtn ?? false;
if ($isCloseBtn) {
    $this->widget(
        'ext.ButtonWidget.ButtonWidget',
        [
            'name' => 'close-button',
            'id' => 'close-button',
            'text' => gT('Close'),
            'icon' => 'ri-close-fill',
            'link' => $backUrl ?? Yii::app()->createUrl('dashboard/view'),
            'htmlOptions' => [
                'class' => 'btn btn-outline-secondary',
            ],
        ]
    );
}
if ($isSaveAndCloseBtn) {
    $this->widget(
        'ext.ButtonWidget.ButtonWidget',
        [
            'name' => 'save-and-close-form-button',
            'id' => 'save-and-close-form-button',
            'text' => gT('Save and close'),
            'icon' => '',
            'htmlOptions' => [
                'class' => 'btn btn-outline-secondary',
                'data-form-id' => $formIdSaveClose ?? '',
                'type' => 'submit',
                'role' => 'button'
... (22 lines truncated)
</file>

<file path="application/views/layouts/adminmenu.php">
<?php
?>
<?php
    App()->getClientScript()->registerScriptFile(Yii::app()->getConfig('adminscripts') . 'surveysettings.js', LSYii_ClientScript::POS_BEGIN);
?>
<!-- admin menu bar -->
<nav class="navbar navbar-expand-md">
    <div class="container-fluid">
        <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#small-screens-menus"
            aria-controls="small-screens-menus" aria-expanded="false">
            <span class="navbar-toggler-icon"></span>
        </button>
        <a class="navbar-brand" href="<?php echo $this->createUrl("/admin/"); ?>">
            <img src="<?= Yii::app()->baseUrl ?>/assets/images/logo-icon-white.png" height="34"
                class="d-inline-block align-bottom" alt="">
            <?= $sitename ?>
        </a>
        <!-- Only on xs screens -->
        <div class="collapse navbar-collapse " id="small-screens-menus">
            <ul class="nav navbar-nav">
                <!-- active surveys -->
                <?php if ($activesurveyscount > 0): ?>
                    <li class="nav-item">
                        <a class="nav-link"
                            href="<?php echo $this->createUrl('surveyAdministration/listsurveys/active/Y'); ?>">
                            <?php eT("Active surveys"); ?> <span class="badge"><?php echo $activesurveyscount ?></span>
                        </a>
                    </li>
                <?php endif; ?>
                <!-- List surveys -->
... (99 lines truncated)
</file>

<file path="application/views/layouts/bare.php">
<?php
    echo $content;
</file>

<file path="application/views/layouts/header.php">
<?php
?>
<!DOCTYPE html>
<html lang="<?php echo htmlspecialchars(getHtmlLangAttributeValue((string) $adminlang)); ?>"<?php echo $languageRTL;?> >
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <!-- Assets load -->
    <!--
        Notice to developers :
        If you turn debug mode on, the asset manager will be off.
        If you turn degug mode off, the asset manager will be on.
        Without the asset manager, the CSS/JS files are published from their real url (eg: http:
        So, once a browser loaded once those files, it cache it, and don't load it anymore.
        Then, if you change some css/js files, final user must clean its browser cache to get the new version of the cache.
        This was the old LS behaviour, if debug mode is on, you'll have this very behaviour
        The asset manager resolve the browser cache problem. It copy the css/js files to a tmp directory before publishing it:
        http:
        For admin GUI, the asset manager works on a base of a "file by file" : each single css/js file is published as a single asset.
        So if you touch any css/js file published via the asset (updating its date of modification), the asset manager will AUTOMATICALLY create a new tmp directory:
        http:
        Then, the browser will automatically reload the file, and the final user don't need to refresh its cache.
        You should never have to delete the tmp/assets directory. You can do it to free some space on your server, but that all.
        notice: the css/js files from third party extension use the package system. It means that the asset manager will publish them on the base of the directory logic.
        So, if you update any css/js file from a third party extension, make sure that the modification date of the root directory is updated.
    -->
    <?php
    ?>
    <?php if (!YII_DEBUG ||  Yii::app()->getConfig('use_asset_manager')) : ?>
        <!-- Debug mode is off, so the asset manager will be used-->
... (30 lines truncated)
</file>

<file path="application/views/layouts/installer.php">
<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <meta name="author" content=""/>
    <link rel="shortcut icon" href="<?php echo Yii::app()->getConfig('styleurl'); ?>favicon.ico" type="image/x-icon"/>
    <link rel="icon" href="<?php echo Yii::app()->getConfig('styleurl'); ?>favicon.ico" type="image/x-icon"/>
    <?php
    $script = "$(function() {
        $('.on').animate({
                    color: '#0B55C4'
                }, 1000 );
        $('.demo').find('a:first').button().end().
            find('a:eq(1)').button().end().
            find('a:eq(2)').button();
        });";
    App()->getClientScript()->registerScript('installer', $script);
    ?>
    <link rel="icon" href="<?php echo Yii::app()->baseUrl; ?>/images/favicon.ico"/>
    <title><?php eT("LimeSurvey installer"); ?></title>
</head>
<body>
<div class="container">
    <div class="row">
        <div class="col-12" style='padding-top:20px'>
            <h1 class="pagetitle"><?php eT("LimeSurvey installer"); ?></h1>
        </div>
    </div>
    <?php echo $content; ?>
    <div class="row m-3 mt-5">
... (8 lines truncated)
</file>

<file path="application/views/layouts/layout_questioneditor.php">
<?php
Yii::import('application.helpers.common_helper', true);
$aData = App()->getController()->aData;
$layoutHelper = new LayoutHelper();
$layoutHelper->showHeaders($aData, false);
$layoutHelper->showadminmenu($aData);
echo "<!-- BEGIN LAYOUT_INSURVEY -->";
LimeExpressionManager::StartProcessingPage(false, true);
$aData['debug'] = $aData;
echo $layoutHelper->renderTopbarTemplate($aData);
echo ' <div id="pjax-file-load-container" class="ls-flex-row col-12"><div style="height:2px;width:0px;"></div></div>';
echo ' <!-- Survey page, started in SurveyCommonAction::renderWrappedTemplate() -->
        <div id="vue-apps-main-container" '
    . 'class="ls-flex-row align-items-flex-begin align-content-flex-end col-12 container-fluid pb-6" '
    . '>';
$layoutHelper->renderSurveySidemenu($aData);
echo '<div '
    . 'class="ls-flex-column align-items-flex-start align-content-flex-start col-11 ls-flex-item transition-animate-width main-content-container" '
    . '>';
echo '<div id="pjax-content" class="col-12 mb-5">';
echo '<div id="in_survey_common" '
    . 'class="container-fluid pe-0 ls-flex-column col-12"'
    . '>';
$layoutHelper->updatenotification();
$layoutHelper->notifications();
echo $content;
echo "</div>\n";
echo "</div>\n";
echo "</div>\n";
echo "</div>\n";
... (13 lines truncated)
</file>

<file path="application/views/layouts/main.php">
<?php
Yii::import('application.helpers.common_helper', true);
$aData = Yii::app()->getController()->aData;
$layoutHelper = new LayoutHelper();
$layoutHelper->showHeaders($aData);
$layoutHelper->showadminmenu($aData);
echo "<!-- BEGIN LAYOUT MAIN (refactored controllers-->";
echo "<div id='layout_sidebar'>";
App()->getController()->widget('ext.SideBarWidget.SideBarWidget');
echo "<div class='container-40'>";
echo $layoutHelper->renderTopbarTemplate($aData);
echo "<div class='container-fluid'>";
$layoutHelper->updatenotification();
echo "</div>";
$layoutHelper->notifications();
echo ' <div id="pjax-file-load-container" class="ls-flex-row col-12"><div style="height:2px;width:0px;"></div></div>';
echo '<!-- Full page, started in SurveyCommonAction::renderWrappedTemplate() -->
      <div class="container-fluid" id="in_survey_common_action">';
echo $content;
echo '</div>';
echo '</div>';
echo '</div>';
if (!isset($aData['display']['endscripts']) || $aData['display']['endscripts'] !== false) {
    $layoutHelper->loadEndScripts();
}
if (!Yii::app()->user->isGuest) {
    if (!isset($aData['display']['footer']) || $aData['display']['footer'] !== false) {
        $layoutHelper->getAdminFooter('http://manual.limesurvey.org');
    }
} else {
... (4 lines truncated)
</file>

<file path="application/views/layouts/messagebox.php">
<?php
?>
<div class='side-body'>
    <div class="row">
        <div class="col-12 content-center">
            <!-- Message box from super admin -->
            <div id="admin-status-message" class="jumbotron message-box <?php echo $class ?? ""; ?>" role="status" aria-live="polite" aria-atomic="true" tabindex="-1">
                <div class="h2"><?php echo $title;?></div>
                <?php echo $message;?>
            </div>
        </div>
    </div>
</div>
</file>

<file path="application/views/layouts/sidemenu.php">
<?php
?>
<?php
    $getQuestionsUrl = $this->createUrl("/surveyAdministration/getAjaxQuestionGroupArray/", ["surveyid" => $surveyid]);
    $getMenuUrl = $this->createUrl("/surveyAdministration/getAjaxMenuArray/", ["surveyid" => $surveyid]);
    $createQuestionGroupLink = $this->createUrl('/questionGroupsAdministration/add/', ["surveyid" => $surveyid]);
    $createQuestionLink =  $this->createUrl('questionAdministration/create/', ["surveyid" => $surveyid]);
    $unlockLockOrganizerUrl = $this->createUrl("admin/user/sa/togglesetting/", ['surveyid' => $surveyid]);
    $updateOrderLink =  $this->createUrl("questionGroupsAdministration/updateOrder/", ["surveyid" =>  $surveyid]);
    $createPermission = Permission::model()->hasSurveyPermission($surveyid, 'surveycontent', 'create');
if ($activated || !$createPermission) {
    $createQuestionGroupLink = "";
    $createQuestionLink = "";
}
    $menuObjectArray =  [
        "side" => [],
        "collapsed" => [],
        "top" => [],
        "bottom" => [],
    ];
    foreach ($menuObjectArray as $position => $arr) {
        $menuObjectArray[$position] = Survey::model()->findByPk($surveyid)->getSurveyMenus($position);
    }
    Yii::app()->getClientScript()->registerScript(
        'SideBarGlobalObject',
        '
        window.SideMenuData = {
            getQuestionsUrl: "' . $getQuestionsUrl . '",
            getMenuUrl: "' . $getMenuUrl . '",
            createQuestionGroupLink: "' . $createQuestionGroupLink . '",
... (42 lines truncated)
</file>

<file path="application/views/layouts/survey.php">
<?php
include_once("public.php");
</file>

<file path="application/views/layouts/template_title_btn_bar.php">
<?php
?>
<div class="menubar ">
    <div class="container-fluid">
        <div class="row">
            <div class="col-12">
                <div class="h1">
                    <!-- here it can be a simple text or a breadcrumg -->
                    <h1><?php eT($pageTitle) ?></h1>
                </div>
            </div>
            <!-- here starts the topbar with the buttons -->
            <!-- survey administration itself uses the widget TopbarWidget and all other pages not -->
        </div>
    </div>
</div>
</file>

<file path="application/views/layouts/title_bar.php">
<?php
if (!isset($oQuestion)) {
    $oQuestion = isset($qid) ? @Question::model()->find('qid=:qid', ['qid' => $qid]) : null;
}
if (!isset($oQuestionGroup)) {
    $oQuestionGroup = isset($gid) ? @QuestionGroup::model()->find('gid=:gid', ['gid' => $gid]) : null;
}
$breadcrumbMode = SettingsUser::getUserSettingValue('breadcrumbMode');
if (empty($breadcrumbMode) || $breadcrumbMode == 'default') {
    $breadcrumbMode = Yii::app()->getConfig('defaultBreadcrumbMode');
}
App()->getController()->widget('ext.BreadcrumbWidget.BreadcrumbWidget', [
    'breadCrumbConfigArray' => [
        'oSurvey' => $oSurvey ?? Survey::model()->findByPk((int)$surveyid),
        'oQuestion' => $oQuestion,
        'oQuestionGroup' => $oQuestionGroup,
        'sSubaction' => $subaction ?? null,
        'sSimpleSubaction' => $title_bar['subaction'] ?? null,
        'module_subaction' => $title_bar['module_subaction'] ?? null,
        'module_subaction_url' => $title_bar['module_subaction_url'] ?? null,
        'module_current_action' => $title_bar['module_current_action'] ?? null,
        'token' => $title_bar['token'] ?? null,
        'active' => $title_bar['active'] ?? null,
        'title' => $title_bar['title'] ?? ' ',
        'extraClass' => "title-bar-breadcrumb",
        'mode' => $breadcrumbMode,
    ],
    'htmlOptions' => [
        'id' => 'breadcrumb-container',
        'class' => "ls-ba",
... (3 lines truncated)
</file>

<file path="application/views/layouts/with_sidebar.php">
<?php
Yii::import('application.helpers.common_helper', true);
$aData = App()->getController()->aData;
$layoutHelper = new LayoutHelper();
$layoutHelper->showHeaders($aData);
$layoutHelper->showadminmenu($aData);
?>
<!-- BEGIN LAYOUT MAIN (refactored controllers) -->
<?= $layoutHelper->renderTopbarTemplate($aData) ?>
<div class='container-fluid'>
    <?= $layoutHelper->updatenotification() ?>
</div>
<?= $layoutHelper->notifications() ?>
<!-- The load indicator for pjax -->
<div id="pjax-file-load-container" class="ls-flex-row col-12">
    <div style="height:2px;width:0;"></div>
</div>
<!-- Full page, started in SurveyCommonAction::renderWrappedTemplate() -->
<div id="layout_sidebar">
    <?php App()->getController()->widget('ext.SideBarWidget.SideBarWidget'); ?>
    <div class="container-40" id="in_survey_common_action">
        <?= $content ?>
    </div>
</div>
<!-- Footer-->
<?php if (!isset($aData['display']['endscripts']) || $aData['display']['endscripts'] !== false) {
    $layoutHelper->loadEndScripts();
} ?>
<?php if (!App()->user->isGuest) : ?>
    <?php if (!isset($aData['display']['footer']) || $aData['display']['footer'] !== false) : ?>
... (7 lines truncated)
</file>

<file path="application/views/limereplacementfields/limeReplacementFields_view.php">
<script language="javascript">
    function Ok()
    {
        var sValue = document.getElementById('cquestions').value ;
        FCKLimeReplacementFieldss.Add( sValue ) ;
        return true ;
    }
</script>
<div class="mb-3">
    <?php
    if (count($replFields) > 0 || isset($cquestions)) {
        $InsertansUnsupportedtypes = Yii::app()->getConfig('InsertansUnsupportedtypes');
        ?>
        <select name='cquestions' id='cquestions' size='14' style='width:390px' ondblclick="$('.cke_dialog_ui_button_ok').children().click();" class='form-select'>
            <?php
            $noselection = false;
    } else {
        eT("No replacement variable available for this field");
        $noselection = true;
    }
    if (count($replFields) > 0) {
        ?>
            <optgroup label='<?php eT("Standard fields");?>'>
            <?php
            foreach ($replFields as $stdfield => $stdfieldvalue) {
                ?>
                    <option value='<?php echo htmlspecialchars($stdfield, ENT_QUOTES, 'UTF-8');?>' title='<?php echo htmlspecialchars($stdfieldvalue, ENT_QUOTES, 'UTF-8');?>'><?php echo htmlspecialchars($stdfieldvalue, ENT_QUOTES, 'UTF-8');?></option>
                    <?php
            }
            ?>
... (70 lines truncated)
</file>

<file path="application/views/questionAdministration/partial/topbarBtns/copyQuestionTopbarRight_view.php">
<!-- Close -->
<?php
$this->widget(
    'ext.ButtonWidget.ButtonWidget',
    [
        'name' => 'close-button',
        'text' => gT('Close'),
        'icon' => 'ri-close-fill',
        'link' => $closeUrl,
        'htmlOptions' => [
            'class' => 'btn btn-outline-secondary',
        ],
    ]
);
?>
<!-- Save and close -->
<?php
$this->widget(
    'ext.ButtonWidget.ButtonWidget',
    [
        'id' => 'save-and-close-button-copy-question',
        'name' => 'save-and-close-button-copy-question',
        'text' => gT('Save and close'),
        'icon' => 'ri-check-fill',
        'htmlOptions' => [
            'class' => 'btn btn-primary',
        ],
    ]
);
?>
... (35 lines truncated)
</file>

<file path="application/views/questionAdministration/partial/topbarBtns/editQuestionTopbarLeft_view.php">
<?php if ($oQuestion->qid !== 0) : ?>
    <?php
    $this->renderPartial(
        '/surveyAdministration/partial/topbar/previewOrRunButton_view',
        [
            'survey' => $oSurvey,
            'surveyLanguages' => $surveyLanguages,
        ]
    );
    ?>
    <?php if ($hasSurveyContentUpdatePermission) : ?>
        <?php
        $this->renderPartial('/questionGroupsAdministration/partial/topbarBtns/previewGroupButton_view', get_defined_vars());
        $this->renderPartial('partial/topbarBtns/previewQuestionButton_view', get_defined_vars());
        ?>
    <?php endif; ?>
<?php else : ?>
    <!-- Import -->
    <?php if ($hasSurveyContentCreatePermission) :?>
        <?php if ($oSurvey->active != 'Y') : ?>
            <?php
            $this->widget(
                'ext.ButtonWidget.ButtonWidget',
                [
                    'id' => 'import-button',
                    'name' => 'import-button',
                    'text' => gT('Import question'),
                    'icon' => 'ri-download-2-fill icon',
                    'link' => Yii::App()->createUrl("questionAdministration/importView", ["surveyid" => $surveyid, "groupid" => $gid]),
                    'htmlOptions' => [
... (28 lines truncated)
</file>

<file path="application/views/questionAdministration/partial/topbarBtns/editQuestionTopbarRight_view.php">
<?php
 ?>
<!-- Close -->
<?php if (!empty($showCloseButton)) : ?>
    <?php if (!empty($oQuestion->qid)) : ?>
        <?php
        $this->widget(
            'ext.ButtonWidget.ButtonWidget',
            [
                'name' => 'close-button',
                'text' => gT("Close"),
                'icon' => 'ri-close-fill',
                'link' => '#',
                'htmlOptions' => [
                    'class' => 'btn btn-outline-secondary',
                    'role' => 'button',
                    'onclick' => "LS.questionEditor.showOverview(); return false;",
                ],
            ]
        );
        ?>
    <?php else : ?>
        <?php
        $this->widget(
            'ext.ButtonWidget.ButtonWidget',
            [
                'name' => 'close-button',
                'text' => gT("Close"),
                'icon' => 'ri-close-fill',
                'link' => $closeUrl,
... (50 lines truncated)
</file>

<file path="application/views/questionAdministration/partial/topbarBtns/importQuestionTopbarRight_view.php">
<!-- Import -->
<?php
$this->widget(
    'ext.ButtonWidget.ButtonWidget',
    [
        'id' => 'save-button',
        'name' => 'save-button',
        'text' => gT('Import'),
        'icon' => 'ri-download-fill',
        'htmlOptions' => [
                'class' => 'btn btn-primary',
        ],
    ]
);
?>
</file>

<file path="application/views/questionAdministration/partial/topbarBtns/listquestiongroupsTopbarLeft_view.php">
<?php
if ($oSurvey->isActive) : ?>
    <span class="btntooltip d-inline-block" data-bs-toggle="tooltip" data-bs-placement="bottom"
          title="<?php eT("This survey is currently active."); ?>">
        <?php
        $this->widget(
            'ext.ButtonWidget.ButtonWidget',
            [
                'name' => 'add-new-group-button',
                'text' => gT('Add new group'),
                'icon' => 'ri-add-circle-fill',
                'htmlOptions' => [
                    'class' => 'btn btn-outline-secondary btntooltip',
                    'disabled' => 'disabled',
                ],
            ]
        );
        $this->widget(
            'ext.ButtonWidget.ButtonWidget',
            [
                'name' => 'import-group-button',
                'text' => gT('Import group'),
                'icon' => 'ri-download-2-fill',
                'htmlOptions' => [
                    'class' => 'btn btn-outline-secondary btntooltip',
                    'disabled' => 'disabled',
                ],
            ]
        );
        ?>
... (34 lines truncated)
</file>

<file path="application/views/questionAdministration/partial/topbarBtns/listquestionsTopbarLeft_view.php">
<?php if ($oSurvey->isActive) : ?>
    <span class="btntooltip" data-bs-toggle="tooltip" data-bs-placement="bottom" title="<?php eT("This survey is currently active."); ?>" style="display: inline-block">
        <?php
        $this->widget(
            'ext.ButtonWidget.ButtonWidget',
            [
                'name' => 'add-question-button',
                'text' => gT('Add new question'),
                'icon' => 'ri-add-circle-fill',
                'htmlOptions' => [
                    'class' => 'btn btn-outline-secondary btntooltip',
                    'disabled' => 'disabled'
                ],
            ]
        );
        $this->widget(
            'ext.ButtonWidget.ButtonWidget',
            [
                'name' => 'import-question-button',
                'text' => gT('Import a question'),
                'icon' => 'ri-download-2-fill',
                'htmlOptions' => [
                    'class' => 'btn btn-outline-secondary btntooltip',
                    'disabled' => 'disabled'
                ],
            ]
        );
        ?>
    </span>
<?php elseif ($hasSurveyContentCreatePermission) : ?>
... (59 lines truncated)
</file>

<file path="application/views/questionAdministration/partial/topbarBtns/previewQuestionButton_view.php">
<?php if ($hasSurveyContentUpdatePermission) : ?>
    <?php
    $languagesDropDownItems = '';
    if (count($surveyLanguages) > 1) {
        $languagesDropDownItems = '<ul class="dropdown-menu" style="min-width : 252px;">';
        $languagesDropDownItems .= $this->renderPartial(
            '/surveyAdministration/partial/topbar/languagesDropdownItems',
            [
                'surveyLanguages' => $surveyLanguages,
                'type' => "question",
                'sid' => $surveyid,
                'gid' => $gid,
                'qid' => $qid
            ],
            true
        );
        $languagesDropDownItems .= '</ul>';
    }
    ?>
    <!-- Preview question -->
    <?php
    $this->widget('ext.ButtonWidget.ButtonWidget', [
        'name' => 'ls-preview-question',
        'id' => 'ls-preview-question',
        'text' => gT('Preview question'),
        'icon' => 'ri-eye-fill',
        'isDropDown' => count($surveyLanguages) > 1,
        'dropDownContent' => $languagesDropDownItems,
        'link' => Yii::App()->createUrl("survey/index/action/previewquestion/sid/$surveyid/gid/$gid/qid/$qid"),
        'htmlOptions' => [
... (7 lines truncated)
</file>

<file path="application/views/questionAdministration/partial/topbarBtns/questionSummaryTopbarRight_view.php">
<?php
$this->renderPartial('/questionAdministration/partial/topbarBtns/questionTopbarRight_view', get_defined_vars());
</file>

<file path="application/views/questionAdministration/partial/topbarBtns/questionToolsDropdownItems.php">
<?php if ($hasSurveyContentUpdatePermission) :?>
    <!-- Conditions -->
    <li>
        <a class="dropdown-item" id="conditions_button" href="<?php echo Yii::App()->createUrl("admin/conditions/sa/index/subaction/editconditionsform/surveyid/$surveyid/gid/$gid/qid/$qid"); ?>">
            <span class="ri-git-branch-fill icon"></span>
            <?php eT("Condition designer"); ?>
        </a>
    </li>
<?php endif;?>
<?php if ($hasSurveyContentUpdatePermission && $hasdefaultvalues > 0) :?>
    <!-- Default Values -->
    <li>
        <a class="dropdown-item" id="default_value_button" href="<?php echo Yii::App()->createUrl("questionAdministration/editdefaultvalues/surveyid/$surveyid/gid/$gid/qid/$qid"); ?>">
            <span class="ri-grid-line"></span>
            <?php eT("Edit default answers"); ?>
        </a>
    </li>
<?php endif;?>
<?php if ($hasSurveyContentExportPermission) :?>
    <!-- Export -->
    <li>
        <a class="dropdown-item" href="<?php echo Yii::App()->createUrl("admin/export/sa/question/surveyid/$surveyid/gid/$gid/qid/{$qid}");?>">
            <span class="ri-download-fill"></span>
            <?php eT("Export"); ?>
        </a>
    </li>
<?php endif; ?>
<?php if ($hasSurveyContentCreatePermission && ($oSurvey->active != 'Y')) :?>
    <!-- Copy -->
    <li>
... (57 lines truncated)
</file>

<file path="application/views/questionAdministration/partial/topbarBtns/questionToolsDropdownMenu.php">
<?php if ($hasSurveyContentUpdatePermission || $hasSurveyContentExportPermission || ($hasSurveyContentCreatePermission && ($oSurvey->active != 'Y')) || $hasSurveyContentReadPermission || !empty($showDeleteButton)) : ?>
    <ul class="dropdown-menu">
        <?php echo $this->renderPartial(
            '/questionAdministration/partial/topbarBtns/questionToolsDropdownItems',
            get_defined_vars(),
            true
        ); ?>
    </ul>
<?php endif; ?>
</file>

<file path="application/views/questionAdministration/partial/topbarBtns/questionTopbar_view.php">
<?php
$aData = get_defined_vars();
$leftSideContentSummary = $this->renderPartial('/questionAdministration/partial/topbarBtns/questionTopbarLeft_view', get_defined_vars(), true);
$leftSideContentEditor = $this->renderPartial('/questionAdministration/partial/topbarBtns/editQuestionTopbarLeft_view', get_defined_vars(), true);
$rightSideContent = $this->renderPartial('/questionAdministration/partial/topbarBtns/editQuestionTopbarRight_view', get_defined_vars(), true);
$rightSideContentSummary = $this->renderPartial('/questionAdministration/partial/topbarBtns/questionSummaryTopbarRight_view', get_defined_vars(), true);
App()->getClientScript()->registerScriptFile(
    App()->getConfig('adminscripts') . 'topbar.js',
    CClientScript::POS_END
);
?>
<!-- Question Top Bar -->
<div class="topbar sticky-top" id="pjax-content">
    <div class="container-fluid">
            <?php if ($oQuestion->qid !== 0) : ?>
                <div id="question-summary-topbar"
                     class='row' <?= empty($tabOverviewEditor) || $tabOverviewEditor === 'editor' ? 'style="display: none;"' : "" ?>>
                    <!-- Title or breadcrumb -->
                    <div class="ls-breadcrumb col-12">
                        <h1 role="presentation"><?= $breadcrumb ?></h1>
                    </div>
                    <!-- Left Side -->
                    <div class="ls-topbar-buttons col">
                        <?= $leftSideContentSummary ?>
                    </div>
                    <div class="ls-topbar-buttons col-md-auto float-end text-end">
                        <?= $rightSideContentSummary ?>
                    </div>
                </div>
            <?php endif; ?>
... (18 lines truncated)
</file>

<file path="application/views/questionAdministration/partial/topbarBtns/questionTopbarLeft_view.php">
<?php if ($showToolsMenu) : ?>
    <?php $toolsDropDownItems = $this->renderPartial(
        '/questionAdministration/partial/topbarBtns/questionToolsDropdownMenu',
        get_defined_vars(),
        true
    ); ?>
    <!-- Tools  -->
    <!-- Main button dropdown -->
    <?php
    $this->widget('ext.ButtonWidget.ButtonWidget', [
        'name' => 'ls-question-view-button',
        'id' => 'ls-question-view-button',
        'text' => gT('Tools'),
        'isDropDown' => true,
        'dropDownContent' => $toolsDropDownItems,
        'htmlOptions' => [
            'class' => 'btn btn-outline-secondary',
        ],
    ]); ?>
<?php endif;?>
<?php
    $this->renderPartial(
        '/surveyAdministration/partial/topbar/previewOrRunButton_view',
        [
            'survey' => $oSurvey,
            'surveyLanguages' => $surveyLanguages,
        ]
    );
    $this->renderPartial('/questionGroupsAdministration/partial/topbarBtns/previewGroupButton_view', get_defined_vars());
    $this->renderPartial('partial/topbarBtns/previewQuestionButton_view', get_defined_vars());
... (2 lines truncated)
</file>

<file path="application/views/questionAdministration/partial/topbarBtns/questionTopbarRight_view.php">
<?php
?>
<!-- Edit button -->
<?php
if ($hasSurveyContentUpdatePermission) {
    $this->widget(
        'ext.ButtonWidget.ButtonWidget',
        [
            'id' => 'questionEditorButton',
            'name' => 'questionEditorButton',
            'text' => gT('Edit'),
            'icon' => 'ri-pencil-fill',
            'link' => '#',
            'htmlOptions' => [
                'class' => 'btn btn-primary pjax',
                'onclick' => "LS.questionEditor.showEditor(); return false;",
                'role' => 'button',
            ],
        ]
    );
}
</file>

<file path="application/views/questionAdministration/partial/groupView.php">
<?php
?>
<?php $pageSize = Yii::app()->user->getState('pageSize', Yii::app()->params['defaultPageSize']); ?>
<div class='side-body'>
    <div class="row">
        <div class="">
            <?php echo $this->renderPartial(
                'partial/topbarBtns/listquestiongroupsTopbarLeft_view',
                [
                    'oSurvey' => $oSurvey,
                    'hasSurveyContentCreatePermission' => $hasSurveyContentCreatePermission
                ],
                true
            );
            ?>
            <div class="mt-4">
                <?php App()->getController()->renderPartial(
                    '/admin/survey/surveybar_addgroupquestion',
                    [
                        'surveybar' => $surveybar,
                        'oSurvey' => $oSurvey,
                        'surveyHasGroup' => isset($oSurvey->groups) ? $oSurvey->groups : false
                    ]
                ); ?>
            </div>
            <!-- Search Box -->
            <?php $form = $this->beginWidget('TbActiveForm', array(
                'action' => App()->createUrl(
                    'questionAdministration/listquestions',
                    [
... (125 lines truncated)
</file>

<file path="application/views/questionAdministration/partial/questionView.php">
<?php
require_once Yii::getPathOfAlias('application.extensions.admin.grid.FloatingActionsWidget.actions.QuestionListMassiveActions') . '.php';
$pageSize = App()->user->getState('pageSize', App()->params['defaultPageSize']);
?>
<div class="col-12 content-right">
    <?php echo $this->renderPartial(
        'partial/topbarBtns/listquestionsTopbarLeft_view',
        [
                    'oSurvey' => $oSurvey,
                    'hasSurveyContentCreatePermission' => $hasSurveyContentCreatePermission
                ],
        true
    );
?>
    <!-- Search Box -->
    <div class="row mt-4">
        <div class="col-12 ls-flex ls-flex-row">
            <div class="ls-flex-item text-start">
                <?php App()->getController()->renderPartial(
                    '/admin/survey/surveybar_addgroupquestion',
                    [
                        'surveybar' => $surveybar,
                        'oSurvey' => $oSurvey,
                        'surveyHasGroup' => isset($surveyHasGroup) ? $surveyHasGroup : false
                    ]
                ); ?>
            </div>
            <!-- Begin Form -->
            <?php
            $form = $this->beginWidget('CActiveForm', array(
... (96 lines truncated)
</file>

<file path="application/views/questionAdministration/_copyQuestionTabsLanguages.php">
<?php
?>
<div class="row">
   <div class="col-6">
    <!-- Question code -->
    <?php $this->renderPartial(
        "questionCode",
        [
            'question' => $oQuestion,
            'newTitle' => $oQuestion->title . "Copy",
            'newQid' => true
        ]
    ); ?>
   </div>
</div>
<div class="row">
    <div class="col-12">
        <!-- Text elements -->
        <?php $this->renderPartial(
            "textElements",
            [
                'oSurvey'         => $oSurvey,
                'question'        => $oQuestion,
                'showScriptField' => false,
            ]
        ); ?>
    </div>
</div>
<div id='questionactioncopy' class='extra-action'>
    <button role="button" type='submit' class="btn btn-primary saveandreturn d-none" name="redirection" value="edit">
... (5 lines truncated)
</file>

<file path="application/views/questionAdministration/_jsVariables.php">
<script>
    window.QuestionEditData = <?=json_encode($data)?>;
    window.aStructureArray = <?=json_encode($aStructureArray)?>;
    window.aQuestionTypes = <?=json_encode($aQuestionTypes)?>;
</script>
</file>

<file path="application/views/questionAdministration/advancedSettings.php">
<div id="advanced-options-container">
<?php foreach ($advancedSettings as $category => $settings) : ?>
    <div class="accordion-item panel-advancedquestionsettings border-top-0 rounded-0" id="<?= CHtml::getIdByName($category); ?>">
        <h2 class="accordion-header" id="<?= CHtml::getIdByName($category); ?>-heading">
            <button
                class="selector--questionEdit-collapse accordion-button collapsed rounded-0"
                id="button-collapse-<?= CHtml::getIdByName($category); ?>"
                role="button"
                type="button"
                data-bs-toggle="collapse"
                data-bs-target="#collapse-<?= CHtml::getIdByName($category); ?>"
                data-bs-parent="#accordion"
                href="#collapse-<?= CHtml::getIdByName($category); ?>"
                aria-expanded="false"
                aria-controls="collapse-<?= CHtml::getIdByName($category); ?>"
            >
                <?= gT($category); ?>
            </button>
        </h2>
        <div
            id="collapse-<?= CHtml::getIdByName($category); ?>"
            class="accordion-collapse collapse"
            data-bs-parent="#accordion"
            role="tabpanel"
            aria-labelledby="<?= CHtml::getIdByName($category); ?>-heading"
        >
            <div class="accordion-body">
                <?php foreach ($settings as $setting) : ?>
                    <?php $this->widget(
                        'ext.AdvancedSettingWidget.AdvancedSettingWidget',
... (9 lines truncated)
</file>

<file path="application/views/questionAdministration/answerOptionRow.twig">
{#
 /**
 * Answer option row view
 *
 * @var bool $first
 * @var bool $assessmentvisible
 * @var int $scale_id
 * @var Question $question
 * @var string $language
 * @var Answer $answerOption
 * @var AnswerL10n $answerl10ns
 *
 * NB: If you edit this view, remember to check if subquestion row view need also to be updated.
 */
#}

<tr
    class='row-container'
    id='row_{{ language }}_{{ answerOption.aid }}_{{ scale_id }}'
    data-common-id="{{ answerOption.aid }}_{{ scale_id }}"
>

    {# If survey is not activated and first language #}
    {% if first %}
        <!-- Move icon -->
        <td
          style="text-align: center;"
        >
            <span
              class="ri-menu-fill bigIcons move-icon"
... (124 lines truncated)
</file>

<file path="application/views/questionAdministration/answerOptions.twig">
<input type='hidden' name='answeroptions_sortorder' value='' />
<input type='hidden' id='answeroptions_deletedqids' name='answeroptions_deletedqids' value='' />

{% set first=true %}
{% set scale_id = 0 %}

<!-- Loop all language, and then hide all but the current selected one with JS. -->
{% for lang in allLanguages %}
    <div class="lang-hide lang-{{ lang }} {{ first ? 'base-lang' : 'extra-lang' }}">
        {% for scale_id in range(0, scalecount - 1) %}

            {% set position = 1 %}
            {%  if scalecount > 1 %}
                <div class='header ui-widget-header' style='margin-top:5px;'>
                    <i>{{ sprintf(gT("Answer scale %s"), scale_id + 1) }}</i>
                </div>
            {% endif %}

            <!-- Answer options table -->
            <div class="answeroptions-table-wrapper" style="max-height: 500px;">
                <table
                    class='answertable answeroptions-table table table-responsive'
                    id='answeroptions_{{lang}}_{{scale_id}}'
                    data-scaleid='{{ scale_id }}'
                    data-input-data-id='add-answer-option-input-javascript-datas'
                >

                    <!-- Headers -->
                    <thead>
                        <tr>
... (123 lines truncated)
</file>

<file path="application/views/questionAdministration/copyQuestionForm.php">
<?php
?>
<div id='edit-question-body' class='side-body'>
    <?= $jsVariablesHtml; ?>
    <!-- Page Title-->
    <div class="pagetitle h1">
        <?php
        eT("Copy question");
        ?>
    </div>
    <div id="copy-question" class="row">
        <!-- Form for the whole page-->
        <?php echo CHtml::form(
            array("questionAdministration/copyQuestion"),
            'post',
            array('class' => 'form30 ', 'id' => 'form_copy_question', 'name' => 'frmeditquestion')
        ); ?>
        <?php
        ?>
        <input type="hidden" name="sid" value="<?= $oSurvey->sid; ?>" />
        <input
                type='submit'
                style="display:none"
                class="btn navbar-btn button white btn-primary"
                id = 'submit-copy-question'
                name="savecopy"
                value='<?php eT("Copy question"); ?>'
        />
        <!-- The tabs & tab-fanes -->
        <div class="row">
... (116 lines truncated)
</file>

<file path="application/views/questionAdministration/create.php">
<?php
?>
<style>
    .scoped-unset-pointer-events {
        pointer-events: none;
    }
</style>
<!-- NB: These must be inside
<?php echo $jsVariablesHtml; ?>
<?= $modalsHtml; ?>
<?php $visibilityEditor = true; ?>
<?php $visibilityOverview = false; ?>
<?php
$questionTheme = !empty($oQuestion->questionTheme) ? $oQuestion->questionTheme : QuestionTheme::getDummyInstance($oQuestion->type);
?>
<!-- Create form for question -->
<div class="side-body">
    <?php if ($oQuestion->qid !== 0) : ?>
        <?php
        if ($this->aData['tabOverviewEditor'] === 'overview') {
            $visibilityOverview = true;
            $visibilityEditor   = false;
        } else {
            $visibilityOverview = false;
            $visibilityEditor   = true;
        }
        ?>
    <?php endif; ?>
    <?php echo CHtml::form(
        ['questionAdministration/saveQuestionData'],
... (101 lines truncated)
</file>

<file path="application/views/questionAdministration/editdefaultvalues.php">
<?php
?>
    <div id='edit-question-body' class='side-body'>
        <div class="pagetitle h1">
            <?php eT('Edit default answer values') ?>
        </div>
        <div class="row">
            <div class="col-xl-8 content-right">
                <?php echo CHtml::form(["admin/database/index"], 'post', ['class' => '', 'id' => 'frmdefaultvalues', 'name' => 'frmdefaultvalues']); ?>
                <ul class="nav nav-tabs">
                    <?php foreach ($oSurvey->allLanguages as $i => $language) : ?>
                        <li class="nav-item" role="presentation">
                            <a class="nav-link <?= ($i == 0) ? "active" : "" ?>" data-bs-toggle="tab" href='#df_<?php echo $language ?>'><?php echo getLanguageNameFromCode($language, false) ?></a>
                        </li>
                    <?php endforeach; ?>
                </ul>
                <div class="tab-content">
                    <?php foreach ($oSurvey->allLanguages as $i => $language) : ?>
                        <div id='df_<?php echo $language ?>' class="tab-pane fade <?php echo $i == 0 ? 'show active' : '' ?> ps-3">
                            <?php if ((int)$questionMetaData->answerscales > 0) : ?>
                                <?php for ($scale_id = 0; $scale_id < (int)$questionMetaData->answerscales; $scale_id++) : ?>
                                    <?php $opts = $langopts[$language][$questionrow['type']][$scale_id]; ?>
                                    <div class="mb-3 col-12">
                                        <label class=" form-label" for='defaultanswerscale_<?php echo "{$scale_id}_{$language}" ?>'>
                                            <?php (int)$questionMetaData->answerscales > 1
                                                ? printf(gT('Default answer for scale %s:'), $scale_id)
                                                : printf(gT('Default answer value:'), $scale_id) ?>
                                        </label>
                                        <div class="col-12">
                                            <select class='form-select' name='defaultanswerscale_<?php echo "{$scale_id}_{$language}" ?>'
... (161 lines truncated)
</file>

<file path="application/views/questionAdministration/extraOptions.php">
<div class="col-12" id="extra-options-container">
    <?php $tabCount = 0; ?>
    <!-- Subquestions and Answers tabs -->
    <ul class="nav nav-tabs" role="tablist">
        <?php if ($question->questionType->subquestions > 0) : ?>
            <li class="nav-item" role="presentation">
                <a class="nav-link <?= (++$tabCount == 1) ? "active" : "" ?>"
                    href="#subquestions"
                    aria-controls="subquestions"
                    role="tab"
                    data-bs-toggle="tab"
                >
                    <?= gT('Subquestions'); ?>
                </a>
            </li>
        <?php endif; ?>
        <?php if ($question->questionType->answerscales > 0) : ?>
            <li class="nav-item" role="presentation">
                <a class="nav-link <?= (++$tabCount == 1) ? "active" : "" ?>"
                    href="#answeroptions"
                    aria-controls="answeroptions"
                    role="tab"
                    data-bs-toggle="tab"
                >
                    <?= gT('Answer options'); ?>
                </a>
            </li>
        <?php endif; ?>
    </ul>
    <?php $tabCount = 0; ?>
... (44 lines truncated)
</file>

<file path="application/views/questionAdministration/generalSettings.php">
<?php
?>
<div class="accordion-item question-option-general-container" id="general-settings">
    <h2 class="accordion-header" id="general-setting-heading">
        <button
            id="button-collapse-General"
            class="accordion-button selector--questionEdit-collapse"
            type="button"
            role="button"
            data-bs-toggle="collapse"
            data-bs-parent="#accordion"
            href="#collapse-question"
            aria-expanded="true"
            aria-controls="collapse-question"
        >
            <?= gT('General settings'); ?>
        </button>
    </h2>
    <div
        id="collapse-question"
        class="accordion-collapse collapse show"
        role="tabpanel"
        data-bs-parent="#accordion"
        aria-labelledby="general-setting-heading"
    >
        <div class="accordion-body collapse show">
        <!-- Question code -->
            <div class="mb-3">
                <?php $this->renderPartial(
                    "questionCode",
... (28 lines truncated)
</file>

<file path="application/views/questionAdministration/import.php">
<?php
$isGroupImport = !isset($gid);
$header = $isGroupImport ? gT("Import question group") : gT("Import question");
$headerSummary = $isGroupImport ? gT("Import question group summary") : gT("Import question summary");
$headerComplete = $isGroupImport ? gT("Question group import is complete.") : gT("Question import is complete.");
?>
<div class='side-body'>
    <div class="row">
        <div class="col-12 content-right">
            <div class="jumbotron message-box">
                <h1 class="text-info"><?= $header ?></h1>
                <p class="lead text-info"><?php eT("Success") ?></p>
                <p>
                    <?php eT("File upload succeeded.") ?>
                </p>
                <?php
                $result = '<ul class="list-unstyled">';
                if ($isGroupImport) {
                    $result .= '<li>' . gT("Question groups:") . ' ' . $aImportResults['groups'] . '</li>';
                }
                $result .= '<li>' . gT("Questions:") . ' ' . $aImportResults['questions'] . '</li>' .
                    '<li>' . gT("Subquestions:") . ' ' . $aImportResults['subquestions'] . '</li>' .
                    '<li>' . gT("Answers:") . ' ' . $aImportResults['answers'] . '</li>';
                if ($isGroupImport) {
                    $result .= '<li>' . gT("Conditions:") . ' ' . $aImportResults['conditions'] . '</li>';
                }
                if (strtolower($sExtension) == 'csv') {
                    $result .= '<li>' . gT("Label sets:") . ' ' . $aImportResults['labelsets'] . ' (' . $aImportResults['labels'] . ')' . '</li>';
                }
                $result .= '<li>' . gT("Question attributes:") . ' ' . $aImportResults['question_attributes'] . '</li>' .
... (45 lines truncated)
</file>

<file path="application/views/questionAdministration/importQuestion.php">
<?php
?>
<div id='edit-question-body' class='side-body'>
    <div class="pagetitle h1"><?php eT("Import a question"); ?></div>
    <div class="row">
        <div class="col-6">
            <?php echo CHtml::form(
                ["questionAdministration/import"],
                'post',
                [
                    'id'       => 'importquestion',
                    'class'    => '',
                    'name'     => 'importquestion',
                    'enctype'  => 'multipart/form-data',
                    'onsubmit' => "return window.LS.validatefilename(this, '" . gT("Please select a file to import!", 'js') . "');"
                ]
            ); ?>
            <div class="mb-3">
                <label class="form-label" for='the_file'><?php eT("Select question file (*.lsq):");
                    echo '<br>' . sprintf(gT("(Maximum file size: %01.2f MB)"), getMaximumFileUploadSize() / 1024 / 1024); ?>
                </label>
                <input name='the_file' id='the_file' class="form-control" type="file" required="required" accept=".lsq"/>
            </div>
            <div class="mb-3">
                <label class=" form-label" for='gid'><?php eT("Destination question group:"); ?></label>
                <div class="">
                    <select name='gid' id='gid' class="form-select">
                        <?php echo getGroupList3($gid, $sid); ?>
                    </select>
                </div>
... (49 lines truncated)
</file>

<file path="application/views/questionAdministration/languageselector.php">
<div <?= count($oSurvey->allLanguages) == 1 ? 'style="display:none"' : '';?>>
    <div class="button-toolbar">
        <div class="btn-group" role="group" data-bs-toggle="buttons">
            <button id="language-dropdown" type="button" class="btn btn-outline-secondary dropdown-toggle" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                <span id="language-dropdown-text"><?= getLanguageNameFromCode($oSurvey->language, false); ?></span> <span class="caret"></span>
            </button>
            <ul class="dropdown-menu dropdown-menu-right">
                <?php foreach ($oSurvey->allLanguages as $lang) : ?>
                    <li class="<?= $lang === $oSurvey->language ? ' active' : '' ?>">
                        <a href="?>">
                            <?= getLanguageNameFromCode($lang, false); ?>
                        </a>
                    </li>
                <?php endforeach; ?>
            </ul>
        </div>
    </div>
</div>
</file>

<file path="application/views/questionAdministration/listquestions.php">
<?php
echo viewHelper::getViewTestTag('surveyListQuestions');
$baseLanguage = $oSurvey->language;
?>
<div class='side-body'>
    <h1><?php eT("Survey organizer"); ?></h1>
    <ul class="nav nav-tabs  mt-4" role="tablist">
        <li id='overviewTab' class="nav-item"><a class="nav-link active" href="#questions" aria-controls="questions" role="tab" data-bs-toggle="tab"><?php eT('Questions'); ?></a></li>
        <li id='overviewTab' class="nav-item"><a class="nav-link" href="#groups" aria-controls="groups" role="tab" data-bs-toggle="tab"><?php eT('Groups'); ?></a></li>
        <li id='overviewTab' class='nav-item'><a class="nav-link" href="#reorder" aria-controls="reorder" role="tab" data-bs-toggle="tab"><?php eT('Reorder'); ?></a></li>
    </ul>
    <div class="tab-content p-4 h-100">
        <div id="questions" class="tab-pane show fade active row">
            <?php $this->renderPartial('partial/questionView', [
                'oSurvey' => $oSurvey,
                'surveybar' => $surveybar,
                'questionModel' => $questionModel,
                'hasSurveyContentCreatePermission' => $hasSurveyContentCreatePermission,
            ]) ?>
        </div>
        <div id="groups" class="tab-pane row">
            <?php $this->renderPartial(
                'partial/groupView',
                [
                'oSurvey' => $oSurvey,
                'groupModel' => $groupModel,
                'surveybar' => $surveybar,
                'hasSurveyContentCreatePermission' => $hasSurveyContentCreatePermission,
                ]
            ) ?>
... (27 lines truncated)
</file>

<file path="application/views/questionAdministration/modals.twig">
{#
/**
 * Render the modals for subquestions/answers label sets, quick add, save as label set
 */
#}

<!-- quickaddModal -->
<div class="modal fade labelsets-update" id="quickaddModal" tabindex="-1" role="dialog" aria-labelledby="quickaddModal">
    <div class="modal-dialog modal-lg" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title">{{ gT('Quick-add labels') }}</h5>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>

            <div class="modal-body">
                <p>
                    {{ gT('Enter one label per line. You can provide a code by separating code and label text with a semicolon or tab. For multilingual surveys you add the translation(s) on the same line separated with a semicolon or tab.') }}
                </p>
                <textarea id='quickaddarea' class='tipme form-control' title='' cols='100' rows='10'></textarea>
            </div>
            <div class="modal-footer">
                <button class='btn btn-cancel' id='btnqacancel' type='button'  data-bs-dismiss="modal">{{ gT('Cancel') }}</button>
                <button class='btn btn-outline-secondary' id='btnqareplace' type='button'>
                    {{ gT('Replace') }}
                </button>
                <button class='btn btn-primary' id='btnqainsert' type='button'>
                    {{ gT('Add') }}
                </button>
            </div>
... (132 lines truncated)
</file>

<file path="application/views/questionAdministration/questionCode.php">
<?php
$generalSettingsView = $generalSettingsView ?? false;
$class = !$generalSettingsView ? 'mb-4 col-12 scoped-responsive-fix-height' : '';
?>
<div class="<?= $class ?>">
    <label for="questionCode"><?= gT('Code'); ?></label>
    <i class="ri-information-fill"
        data-bs-toggle="tooltip"
        title="<?= gT("The question code is used for quick identification of this question and must be unique. It is especially useful if you wish to use the LimeSurvey assessments feature and/or the ExpressionScript."); ?>"
        ></i>
    <div class="scoped-keep-in-line">
        <input
                text="text"
                class="form-control ls-important-field"
                id="questionCode"
                name="question[title]"
                value="<?= !empty($newTitle) ? $newTitle : $question->title; ?>"
                required="true"
                maxlength="20"
                pattern="<?= empty($question->title) ?  "^[a-zA-Z][a-zA-Z0-9]*$" : "^([a-zA-Z][a-zA-Z0-9]*|" . $question->title . ")$"; // Old survey with bad question code still allowed ?>"
                data-qid="<?= (empty($question->qid) || !empty($newQid)) ? 0 : $question->qid; ?>"
        />
        <!--
        <type-counter
            :countable="currentQuestionCode.length"
            :max-value="this.maxQuestionCodeLength"
            :valid="inputValid"
        />
        -->
    </div>
... (3 lines truncated)
</file>

<file path="application/views/questionAdministration/questionSummary.php">
<?php
?>
<div id="question-overview"<?= empty($visibilityOverview) ? ' style="display:none;"' : '' ?>>
    <?php
    if ($question->qid !== 0) : ?>
            <!-- Question summary -->
            <div class="pagetitle">
                <h1 aria-describedby="question-summary-meta"><?php eT('Question summary'); ?></h1>
                <small id="question-summary-meta" class="pagetitle__description"><em><?= $question->title; ?> (ID: <?= (int)$question->qid; ?>)</em></small>
            </div>
            <?php
            $this->renderPartial(
                "summary",
                [
                    'question' => $question,
                    'questionTheme' => $questionTheme,
                    'answersCount' => count($question->answers),
                    'subquestionsCount' => count($question->subquestions),
                    'advancedSettings' => $advancedSettings
                ]
            ); ?>
    <?php endif; ?>
</div>
</file>

<file path="application/views/questionAdministration/subquestionRow.twig">
{#[
/**
 * subquestion row view
 *
 * @var $position ??? Question order?
 * @var $scale_id
 * @var $activated
 * @var $first
 * @var $subquestion
 * @var $subquestionl10n
 *
 * NB : !!! If you edit this view, remember to check if answer option row view need also to be updated !!!
 */
#}

<!-- subquestion row -->
<tr id='row_{{ language }}_{{ subquestion.qid }}_{{ scale_id }}' class="row-container" data-common-id="{{ subquestion.qid }}_{{ scale_id }}">
    {# If survey is active : no move button, code not editable #}
    {% if activated == 'Y' %}
        <!-- Move icon -->
        <td class="move-icon-disable">
            &nbsp;
        </td>

        <!-- Code (title) -->
        <td class="code-title" style="vertical-align: middle;">
            <input
                type='text'
                class="code form-control input"
                id='subquestions[{{ subquestion.qid }}][{{ scale_id }}][code]'
... (136 lines truncated)
</file>

<file path="application/views/questionAdministration/subquestions.twig">
<input type='hidden' name='subquestions_sortorder' value='' />
<input type='hidden' id='subquestions_deletedqids' name='subquestions_deletedqids' value='' />

{% set first = true %}
{% set scale_id = 0 %}
{# TODO: Add question type attribute to indicate if the type supports relevance on subquestions #}
{% set supportsRelevance = question.questionType.code != 'H' %}

<!-- Loop all language, and then hide all but the current selected one with JS. -->
{% for lang in allLanguages %}
    <div class="lang-hide lang-{{ lang }} {{ first ? 'base-lang' : 'extra-lang' }}">
        {% for scale_id in range(0, scalecount - 1) %}
            {% set anscount = subquestions|length %}
            {# TODO : check the rendering of XSCALES / Y SCALES #}

            {% set position=0 %}
            {% if scalecount > 1 %}
                {% if scale_id==0 %}
                    <div class='header ui-widget-header'>
                        <i>{{ gT("Y-scale") }}</i>
                    </div>
                {% else %}
                    <div class='header ui-widget-header'>
                        <i>{{ gT("X-scale") }}</i>
                    </div>
                {% endif %}
            {% endif %}

            <!-- Subquestions table -->
            <!-- NB: Both questions and answer options uses class "answertable". -->
... (117 lines truncated)
</file>

<file path="application/views/questionAdministration/summary.php">
<?php  ?>
<div class="summary-table">
    <!-- Summary Table -->
        <!-- Question -->
        <div class="row">
            <div class="col-2">
                <strong>
                    <?php eT("Question:"); ?>
                </strong>
            </div>
            <div class="col-10"><strong>
                <?php
                    templatereplace(
                        $question->questionl10ns[$question->survey->language]->question,
                        array('QID' => $question->qid),
                        $aReplacementData,
                        'Unspecified',
                        false,
                        $question->qid
                    );
                    echo viewHelper::stripTagsEM(LimeExpressionManager::GetLastPrettyPrintExpression());
                    ?></strong>
            </div>
        </div>
        <!-- Question Group -->
        <div class="row">
            <div class="col-2">
                <strong>
                    <?php eT('Question group:');?>&nbsp;&nbsp;&nbsp;
                </strong>
... (218 lines truncated)
</file>

<file path="application/views/questionAdministration/textElements.php">
<!-- Text element tabs -->
<ul class="nav nav-tabs me-auto" role="tablist">
    <li class="nav-item" role="presentation">
        <a class="nav-link active" href="#question-tab" aria-controls="question-tab" role="tab" data-bs-toggle="tab">
            <?= gT('Question'); ?>
        </a>
    </li>
    <li class="nav-item" role="presentation">
        <a class="nav-link" href="#question-help-tab" aria-controls="question-help-tab" role="tab" data-bs-toggle="tab">
            <?= gT('Help'); ?>
        </a>
    </li>
    <?php if ($showScriptField) : ?>
        <li class="nav-item" role="presentation">
            <a class="nav-link" href="#script-field-tab" aria-controls="script-field-tab" role="tab" data-bs-toggle="tab">
                <?= gT('Script'); ?>
            </a>
        </li>
    <?php endif; ?>
    <li class="nav-item ms-auto">
        <!-- Language selector -->
        <?php
        $this->renderPartial(
            "languageselector",
            ['oSurvey' => $oSurvey]
        ); ?>
    </li>
</ul>
<div class="tab-content bg-white ps-2 pe-2">
    <!-- Question text tab content -->
... (138 lines truncated)
</file>

<file path="application/views/questionAdministration/typeSelector.php">
<?php
$generalSettingsUrl = $this->createUrl(
    'questionAdministration/getGeneralSettingsHTML',
    ['surveyId' => $question->sid, 'questionId' => $question->qid]
);
$advancedSettingsUrl = $this->createUrl(
    'questionAdministration/getAdvancedSettingsHTML',
    ['surveyId' => $question->sid, 'questionId' => $question->qid]
);
$extraOptionsUrl = $this->createUrl(
    'questionAdministration/getExtraOptionsHTML',
    ['surveyId' => $question->sid, 'questionId' => $question->qid]
);
$renderType = isset($selectormodeclass) && $selectormodeclass == "none" ? "group-simple" : "group-modal";
$viewType = $renderType == 'group-modal' ? 'grouped_select_modal' : 'simple_grouped_select';
$oQuestionSelector = $this->beginWidget(
    'ext.admin.PreviewModalWidget.PreviewModalWidget',
    [
        'widgetsJsName' => "questionTypeSelector",
        'renderType'    => $renderType,
        'modalTitle'    => gT("Select question type"),
        'groupTitleKey' => "questionGroupName",
        'groupItemsKey' => "questionTypes",
        'debugKeyCheck' => gT("Type:") . " ",
        'previewWindowTitle' => "",
        'groupStructureArray' => $aQuestionTypeGroups,
        'survey_active' => $question->survey->active == 'Y',
        'value' => $question->type,
        'theme' => $questionTheme->name,
        'debug' => YII_DEBUG,
... (26 lines truncated)
</file>

<file path="application/views/questionGroupsAdministration/partial/topbarBtns/addGroupTopbarLeft_view.php">
<?php
$this->widget(
    'ext.ButtonWidget.ButtonWidget',
    [
        'name' => 'import-group',
        'id' => 'import-group',
        'text' => gT("Import group"),
        'icon' => 'ri-download-fill',
        'link' => Yii::App()->createUrl("questionGroupsAdministration/importview/surveyid/" . $surveyid),
        'htmlOptions' => [
            'class' => 'btn btn-outline-secondary',
            'role' => 'button'
        ],
    ]
);
</file>

<file path="application/views/questionGroupsAdministration/partial/topbarBtns/addGroupTopbarRight_view.php">
<?php
$this->widget(
    'ext.ButtonWidget.ButtonWidget',
    [
        'name' => 'save-button',
        'id' => 'save-button',
        'text' => gT("Save"),
        'icon' => 'ri-check-fill',
        'link' => '',
        'htmlOptions' => [
            'class' => 'btn btn-primary float-end',
            'type' => 'button'
        ],
    ]
);
$this->widget(
    'ext.ButtonWidget.ButtonWidget',
    [
        'name' => 'back-button',
        'id' => 'back-button',
        'text' => gT("Group list"),
        'icon' => 'ri-arrow-left-s-line',
        'link' => $backUrl,
        'htmlOptions' => [
            'class' => 'btn btn-outline-secondary',
        ],
    ]
);
$this->widget(
    'ext.ButtonWidget.ButtonWidget',
... (27 lines truncated)
</file>

<file path="application/views/questionGroupsAdministration/partial/topbarBtns/editGroupTopbarLeft_view.php">
<?php
$this->renderPartial(
    '/surveyAdministration/partial/topbar/previewOrRunButton_view',
    [
        'survey' => $oSurvey,
        'surveyLanguages' => $surveyLanguages,
    ]
);
$this->renderPartial('partial/topbarBtns/previewGroupButton_view', get_defined_vars());
</file>

<file path="application/views/questionGroupsAdministration/partial/topbarBtns/editGroupTopbarRight_view.php">
<!-- Close -->
<?php
if (!empty($closeBtnUrl)) {
    $this->widget(
        'ext.ButtonWidget.ButtonWidget',
        [
            'name' => 'close-button',
            'id' => 'close-button',
            'text' => gT('Close'),
            'icon' => 'ri-close-fill',
            'link' => $closeBtnUrl,
            'htmlOptions' => [
                'class' => 'btn btn-danger',
            ],
        ]
    );
}
?>
<!-- White Close button -->
<?php
if (!empty($showWhiteCloseButton)) {
    $this->widget(
        'ext.ButtonWidget.ButtonWidget',
        [
            'name' => 'close-button',
            'id' => 'close-button',
            'text' => gT('Close'),
            'icon' => 'ri-close-fill',
            'link' => $closeUrl,
            'htmlOptions' => [
... (38 lines truncated)
</file>

<file path="application/views/questionGroupsAdministration/partial/topbarBtns/groupToolsDropdownItems.php">
<?php if($hasSurveyContentReadPermission): ?>
    <!-- Check survey logic -->
    <li>
        <a class="pjax dropdown-item" href="<?php echo Yii::App()->createUrl("admin/expressions/sa/survey_logic_file/sid/{$surveyid}/gid/{$gid}/"); ?>">
            <span class="ri-checkbox-fill"></span>
            <?php eT("Check logic"); ?>
        </a>
    </li>
<?php endif; ?>
<?php if($hasSurveyContentExportPermission):?>
    <!-- Export -->
    <li>
        <a class="dropdown-item" href="<?php echo Yii::App()->createUrl("admin/export/sa/group/surveyid/$surveyid/gid/$gid");?>">
            <span class="ri-download-fill"></span>
            <?php eT("Export"); ?>
        </a>
    </li>
<?php endif; ?>
<?php if($hasSurveyContentDeletePermission):?>
    <!-- Delete -->
    <?php if( $oSurvey->active != "Y" ):?>
        <?php if(is_null($condarray)):?>
            <?php ?>
            <li>
                <a class="dropdown-item" href="#" onclick="return false;"
                    data-bs-toggle="modal"
                    data-bs-target="#confirmation-modal"
                    data-onclick='(function() { <?php echo convertGETtoPOST(
                        Yii::app()->createUrl(
                            "questionGroupsAdministration/delete/",
... (34 lines truncated)
</file>

<file path="application/views/questionGroupsAdministration/partial/topbarBtns/groupTopbarLeft_view.php">
<?php if ($showToolsMenu) {
    $toolsDropDownItems = $this->renderPartial(
        '/surveyAdministration/partial/topbar/surveyToolsDropdownItems',
        get_defined_vars(),
        true
    ); ?>
    <!-- Tools  -->
    <!-- Main button dropdown -->
    <?php
    $this->widget('ext.ButtonWidget.ButtonWidget', [
        'name' => 'ls-tools-button',
        'id' => 'ls-tools-button',
        'text' => gT('Tools'),
        'isDropDown' => true,
        'dropDownContent' => $toolsDropDownItems,
        'htmlOptions' => [
            'class' => 'btn btn-outline-secondary',
        ],
    ]); ?>
<?php } ?>
<?php
$this->renderPartial(
    '/surveyAdministration/partial/topbar/previewOrRunButton_view',
    [
        'survey' => $oSurvey,
        'surveyLanguages' => $surveyLanguages,
    ]
);
$this->renderPartial('partial/topbarBtns/previewGroupButton_view', get_defined_vars());
?>
... (1 lines truncated)
</file>

<file path="application/views/questionGroupsAdministration/partial/topbarBtns/groupTopbarRight_view.php">
<!-- Edit button -->
<?php
if ($hasSurveyContentUpdatePermission) {
    $this->widget(
        'ext.ButtonWidget.ButtonWidget',
        [
            'name' => 'edit-button',
            'id' => 'edit-button',
            'text' => gT('Edit'),
            'icon' => 'ri-pencil-fill',
            'link' => Yii::App()->createUrl("questionGroupsAdministration/edit/surveyid/{$surveyid}/gid/{$gid}/"),
            'htmlOptions' => [
                'class' => 'btn btn-primary pjax',
            ],
        ]
    );
}
?>
</file>

<file path="application/views/questionGroupsAdministration/partial/topbarBtns/importGroupTopbarRight_view.php">
<?php
$this->widget(
    'ext.ButtonWidget.ButtonWidget',
    [
        'name' => 'save-button',
        'id' => 'save-button',
        'text' => gT("Import"),
        'icon' => 'ri-download-fill',
        'link' => '',
        'htmlOptions' => [
            'class' => 'btn btn-primary',
            'type' => 'button'
        ],
    ]
);
</file>

<file path="application/views/questionGroupsAdministration/partial/topbarBtns/listquestiongroupsTopbarLeft_view.php">
<?php
if ($oSurvey->isActive) : ?>
    <span class="btntooltip d-inline-block" data-bs-toggle="tooltip" data-bs-placement="bottom"
          title="<?php eT("This survey is currently active."); ?>">
        <?php
        $this->widget(
            'ext.ButtonWidget.ButtonWidget',
            [
                'name' => 'add-new-group-button',
                'text' => gT('Add new group'),
                'icon' => 'ri-add-circle-fill',
                'htmlOptions' => [
                    'class' => 'btn btn-outline-secondary btntooltip',
                    'disabled' => 'disabled',
                ],
            ]
        );
        $this->widget(
            'ext.ButtonWidget.ButtonWidget',
            [
                'name' => 'import-group-button',
                'text' => gT('Import group'),
                'icon' => 'ri-download-2-fill',
                'htmlOptions' => [
                    'class' => 'btn btn-outline-secondary btntooltip',
                    'disabled' => 'disabled',
                ],
            ]
        );
        ?>
... (34 lines truncated)
</file>

<file path="application/views/questionGroupsAdministration/partial/topbarBtns/previewGroupButton_view.php">
<?php if ($hasSurveyContentUpdatePermission) : ?>
    <?php
    $languagesDropDownItems = '';
    if (count($surveyLanguages) > 1) {
        $languagesDropDownItems = '<ul class="dropdown-menu" style="min-width : 252px;">';
        $languagesDropDownItems .= $this->renderPartial(
            '/surveyAdministration/partial/topbar/languagesDropdownItems',
            [
                'surveyLanguages' => $surveyLanguages,
                'type' => 'questionGroup',
                'sid' => $surveyid,
                'gid' => $gid,
            ],
            true
        );
        $languagesDropDownItems .= '</ul>';
    }
    ?>
<!-- Preview group -->
    <?php
    $this->widget('ext.ButtonWidget.ButtonWidget', [
        'name' => 'ls-group-preview-button',
        'id' => 'ls-group-preview-button',
        'text' => gT('Preview question group'),
        'icon' => 'ri-eye-fill',
        'isDropDown' => count($surveyLanguages) > 1,
        'dropDownContent' => $languagesDropDownItems,
        'link' => Yii::App()->createUrl("survey/index/action/previewgroup/sid/$surveyid/gid/$gid/"),
        'htmlOptions' => [
            'class' => 'btn btn-secondary btntooltip',
... (6 lines truncated)
</file>

<file path="application/views/questionGroupsAdministration/_jsVariables.php">
<script>
    window.QuestionGroupEditData = <?=json_encode($data)?>;
</script>
</file>

<file path="application/views/questionGroupsAdministration/addGroup_view.php">
<?php
echo viewHelper::getViewTestTag('addQuestionGroup');
?>
<!-- addGroup -->
<script type='text/javascript'>
    var sEnterTitle = '<?php eT('Error: You have to enter a group title for each language.', 'js'); ?>';
</script>
<?php echo PrepareEditorScript(false, $this);
$active = 1; ?>
<div id='edit-survey-text-element' class='side-body'>
    <div class="pagetitle">
        <h1><?php eT("Add question group"); ?></h1>
    </div>
    <div class="row">
        <div class="col-12">
            <!-- Tabs -->
            <ul class="nav nav-tabs">
                <?php foreach ($grplangs as $grouplang) : ?>
                    <li role="presentation" class="nav-item">
                        <a class="nav-link <?php if ($active) {
                            echo 'active';
                            $active = 0;
                                           } ?>" role="tab" data-bs-toggle="tab" href="#<?php echo $grouplang; ?>">
                            <?= getLanguageNameFromCode($grouplang, false) . " " . (($grouplang == $baselang) ? "(" . gT("Base language") . ")" : "") ?>
                        </a>
                    </li>
                <?php endforeach; ?>
            </ul>
            <!-- form -->
            <?php echo CHtml::form(
... (74 lines truncated)
</file>

<file path="application/views/questionGroupsAdministration/editGroup_view.php">
<?php
echo PrepareEditorScript(false, $this);
$count = 0;
?>
<div id='edit-group' class='side-body'>
    <div class="row">
        <div class="col-12 content-right">
            <div class="pagetitle h1"><?php eT("Edit group"); ?></div>
            <ul class="nav nav-tabs" id="edit-group-language-selection">
                <?php foreach ($tabtitles as $i => $eachtitle) : ?>
                    <li role="presentation" class="nav-item">
                        <a class="nav-link <?php if ($count == 0) {
                            echo "active";
                            $count++;
                                           } ?>" role="tab" data-bs-toggle="tab" href="#editgrp_<?php echo $i; ?>">
                            <?php echo $eachtitle; ?>
                        </a>
                    </li>
                <?php endforeach; ?>
            </ul>
        </div>
        <?php echo CHtml::form(array("questionGroupsAdministration/saveQuestionGroupData/sid/{$surveyid}"), 'post', array('id' => 'frmeditgroup', 'name' => 'frmeditgroup', 'class' => 'form30 ')); ?>
        <input type="hidden" name="questionGroup[gid]" id="questionGroup[gid]"
               value="<?= $oQuestionGroup['gid'] ?>">
        <input type="hidden" name="questionGroup[sid]" id="questionGroup[sid]"
               value="<?= $oQuestionGroup['sid'] ?>">
        <input type="hidden" name="questionGroup[group_order]" id="questionGroup[group_order]"
               value="<?= $oQuestionGroup['group_order'] ?>">
        <div class="tab-content bg-white ps-2 pe-2">
            <?php foreach ($tabtitles as $i => $eachtitle) : ?>
... (53 lines truncated)
</file>

<file path="application/views/questionGroupsAdministration/group_view.php">
<?php
?>
<div class='side-body'>
    <div class="pagetitle h1"><?php eT('Group summary'); ?></div>
    <div id="groupdetails" class="summary-table">
        <div class="row">
            <div class="col-2"><strong>
                    <?php
                    eT("Title"); ?>:</strong></div>
            <div class="col-10">
                <strong>
                <?= $grow['group_name']; ?> (<?= $grow['gid']; ?>)
                </strong>
            </div>
        </div>
        <div class="row">
            <div class="col-2"><strong>
                    <?php eT("Description:"); ?></strong>
            </div>
            <div class="col-10">
                <?php
                if (trim((string) $grow['description']) != '') {
                    templatereplace($grow['description']);
                    echo LimeExpressionManager::GetLastPrettyPrintExpression();
                }
                ?>
            </div>
        </div>
        <?php
        if (trim((string) $grow['grelevance']) != '') { ?>
... (57 lines truncated)
</file>

<file path="application/views/questionGroupsAdministration/importGroup_view.php">
<?php
echo viewHelper::getViewTestTag('importQuestionGroup');
?>
<div id='edit-survey-text-element' class='side-body'>
    <div class="pagetitle h1"><?php eT("Import question group"); ?></div>
    <div class="row">
        <div class="col-6">
            <!-- form -->
            <?php echo CHtml::form(array("questionGroupsAdministration/import"), 'post', array(
                'id' => 'importgroup',
                'name' => 'importgroup',
                'class' => 'form30 ',
                'enctype' => 'multipart/form-data',
                'onsubmit' => 'return window.LS.validatefilename(this,"' . gT('Please select a file to import!', 'js') . '");'
            )); ?>
                <!-- Select question group file -->
                <div class="mb-3">
                    <label for='the_file' class=" form-label"><?php eT("Select question group file (*.lsg):");
                    echo '<br>' . sprintf(gT("(Maximum file size: %01.2f MB)"), getMaximumFileUploadSize() / 1024 / 1024);
                    ?></label>
                        <div class="">
                           <input id='the_file' class="form-control" name="the_file" type="file" accept='.lsg' />
                        </div>
                </div>
                <!-- Convert resource links -->
                <div class="mb-3">
                    <label for='translinksfields' class="form-label"><?php eT("Convert resource links?"); ?></label>
                    <div>
                        <?php $this->widget('ext.ButtonGroupWidget.ButtonGroupWidget', [
                            'name'          => 'translinksfields',
... (16 lines truncated)
</file>

<file path="application/views/quickTranslation/index.php">
<?php
?>
<div class="side-body">
    <h2 class="h3"><span class="ri-global-line text-success" ></span>&nbsp;&nbsp;<?php eT("Translate survey"); ?></h2>
    <div class="row">
        <div class="col-lg-12 content-right">
            <?php
            echo CHtml::form(
                ["quickTranslation/index",'surveyid' => $survey->sid],
                'get',
                ['id' => 'translatemenu', 'class' => 'form-inline']
            );
            ?>
            <!-- select box for languages 'class' => 'form-group' -->
            <div class="row row-cols-lg-auto g-1 align-items-center mb-3">
                <div class="col-12">
                <?php
                echo CHtml::tag('label', array('for' => 'translationlanguage', 'class' => 'text-nowrap col col-form-label col-form-label-sm'), gT("Translate to") . ":");
                ?>
                </div>
                <div class="col-12">
                    <?php
                    echo CHtml::openTag(
                        'select',
                        array(
                        'id' => 'translationlanguage',
                        'name' => 'lang',
                        'class' => 'form-select',
                        'onchange' => "$(this).closest('form').submit();"
                        )
... (39 lines truncated)
</file>

<file path="application/views/quickTranslation/translateFieldData.php">
<?php
$translateoutput = "<tr>";
$value1 = (!empty($amTypeOptions["id1"])) ? $rowfrom[$amTypeOptions["id1"]] : "";
$value2 = (!empty($amTypeOptions["id2"])) ? $rowfrom[$amTypeOptions["id2"]] : "";
$iScaleID = (!empty($amTypeOptions["scaleid"])) ? $rowfrom[$amTypeOptions["scaleid"]] : "";
// Display text in original language
// Display text in foreign language. Save a copy in type_oldvalue_i to identify changes before db update
if ($type == 'answer') {
    $translateoutput .= "<td class='col-sm-2'>" . htmlspecialchars($rowfrom['question_title'] . " / " . $rowfrom['code']) . " (" . $rowfrom['aid'] . ") </td>";
}
if ($type == 'question_help' || $type == 'question') {
    $translateoutput .= "<td class='col-sm-2'>" . htmlspecialchars((string) $rowfrom['title']) . " ({$rowfrom['qid']}) </td>";
} elseif ($type == 'subquestion') {
    $translateoutput .= "<td class='col-sm-2'>" . htmlspecialchars((string) $rowfrom['parent']['title']) . " ({$rowfrom['parent']['qid']}) </td>";
}
$translateoutput .= "<td class='_from_ col-sm-5' id='" . $type . "_from_" . $j . "'>"
    . showJavaScript($textfrom)
    . "</td>";
$translateoutput .= "<td class='col-sm-5'>";
$translateoutput .= CHtml::hiddenField("{$type}_id1_{$j}", $value1);
$translateoutput .= CHtml::hiddenField("{$type}_id2_{$j}", $value2);
if (is_numeric($iScaleID)) {
    $translateoutput .= CHtml::hiddenField("{$type}_scaleid_{$j}", $iScaleID);
}
$translateoutput .= CHtml::hiddenField("{$type}_oldvalue_{$j}", $textto);
$translateoutput .= '<div class="row">';
$cols = 73;
if ($amTypeOptions['HTMLeditorDisplay'] === 'Modal') {
    $translateoutput .= '<div class="col-sm-10">';
    if ($type == 'question_help' || $type == 'question' || $type == 'subquestion' || $type == 'answer') {
... (32 lines truncated)
</file>

<file path="application/views/quickTranslation/translateformheader_view.php">
<?php
extract($viewData ?? []);
?>
<div id="translationloading" style="width: 100%; font-weight: bold; color: #000; text-align: center;">
    <br/>
    <?php eT("Loading translations..."); ?><br/><br/>
</div>
<?php echo CHtml::form(array("quickTranslation/index/surveyid/{$surveyid}/lang/{$tolang}"), 'post', array('name' => 'translateform', 'id' => 'translateform')); ?>
<input type='hidden' name='sid' value='<?php echo $surveyid; ?>'/>
<input type='hidden' name='action' value='translate'/>
<input type='hidden' name='actionvalue' value='translateSave'/>
<input type='hidden' name='tolang' value='<?php echo $tolang; ?>'/>
<input type='hidden' name='baselang' value='<?php echo $baselang; ?>'/>
<script type="text/javascript">
    sGoogleApiError = "<?php eT("There was an error using the Google API.");?>";
    sDetailedError = "<?php eT("Error message: %s");?>";
    translateJsonUrl = "<?php echo $this->createUrl("quickTranslation/ajaxtranslategoogleapi", ['surveyid' => $surveyid]); ?>";
</script>
<div id="translationtabs">
    <ul class="nav nav-tabs" id="quick-translation-tabs" role="tablist" aria-label="<?php echo gT('Translation sections'); ?>">
        <?php for ($i = 0, $len = count($tab_names ?? []); $i < $len; $i++) {
            $tabName = $tab_names[$i];
            $tabId = 'quick-translation-tab-' . $tabName;
            $panelId = 'tab-' . $tabName;
            $isActive = ($i === 0);
            ?>
            <li class="nav-item" role="presentation">
                <a class="nav-link <?php echo $isActive ? 'active' : ''; ?>"
                   id="<?php echo $tabId; ?>"
                   data-bs-toggle="tab"
... (37 lines truncated)
</file>

<file path="application/views/quickTranslation/translatetabs_view.php">
<?php
$captionId = 'translation-table-caption-' . $type;
?>
<div id='tab-<?php echo $type; ?>' class='tab-pane fade <?php if ($activeTab) {
    echo "show active";
             } ?>' role="tabpanel" aria-labelledby="quick-translation-tab-<?php echo $type; ?>">
    <?php
    Yii::app()->loadHelper('admin.htmleditor');
    echo PrepareEditorScript(true, Yii::app()->getController());
    ?>
    <div class='translate'>
        <?php if (App()->getConfig('googletranslateapikey')) { ?>
            <input type='button' class='auto-trans btn btn-outline-secondary' value='<?php eT("Auto Translate"); ?>'
                   id='auto-trans-tab-<?php echo $type; ?>'/>
            <img src='<?php echo Yii::app()->getConfig("adminimageurl"); ?>/ajax-loader.gif' style='display: none'
                 class='ajax-loader' alt='<?php eT("Loading..."); ?>'/>
        <?php } ?>
        <?php
        $threeRows = ($type == 'question' || $type == 'subquestion' || $type == 'answer');
        ?>
        <table class='table table-striped' aria-labelledby="<?php echo $captionId; ?>">
            <caption class="visually-hidden" id="<?php echo $captionId; ?>">
                <?php printf(gT('Translation table for %s: from %s to %s'), $tabTitle, $baselangdesc, $tolangdesc); ?>
            </caption>
            <thead>
            <tr>
            <?php
            if ($type == 'answer') { ?>
                <th scope="col" class="col-lg-2 text-strong"> <?= gT('QCode / Answer Code / ID') ?> </th>
                <?php
... (45 lines truncated)
</file>

<file path="application/views/quotas/_form_langsetting.php">
<?php
?>
<?php
$this->widget('ext.AlertWidget.AlertWidget', ['errorSummaryModel' => $oQuotaLanguageSetting]);
?>
<!-- Quota message -->
<div class="mb-3">
    <?php echo $form->labelEx($oQuotaLanguageSetting, '[' . $language . ']quotals_message', array('class' => 'form-label')); ?>
    <div class=''>
        <?php
        $htmlOptions = array('class' => 'form-control custom-data');
        $attribute = '[' . $language . ']quotals_message';
        $action = $this->action->id;
        CHtml::resolveNameID($oQuotaLanguageSetting, $attribute, $htmlOptions);
        echo CHtml::activeTextArea($oQuotaLanguageSetting, $attribute, $htmlOptions);
        echo getEditor(
            'quota_message',
            $htmlOptions['id'],
            "[" . gT("Quota message:", "js") . "](" . $language . ")",
            $oQuota->sid,
            '',
            '',
            $action
        );
        ?>
    <?php echo $form->error($oQuotaLanguageSetting, '[' . $language . ']quotals_message'); ?>
    </div>
</div>
<!-- URL -->
<div class="mb-3">
... (15 lines truncated)
</file>

<file path="application/views/quotas/_form_langsettings.php">
<?php
?>
<?php PrepareEditorScript(true, $this); ?>
<div class="row">
    <div class="col-12 border-start border-2 border-secondary">
        <!-- Language tabs -->
        <ul class="nav nav-tabs" role="tablist">
            <?php foreach ($oQuota->survey->getAllLanguages() as $lang) : ?>
                <li class="nav-item" role="presentation">
                    <a class="nav-link <?= ($lang == $oQuota->survey->language) ? 'active' : null ?>" role="tab"
                        aria-selected="<?= ($lang == $oQuota->survey->language) ? 'true' : 'false' ?>"
                       data-bs-toggle="tab" href="#edittxtele<?php echo $lang ?>">
                        <?php echo getLanguageNameFromCode($lang, false); ?>
                        <?php echo($lang == $oQuota->survey->language ? '(' . gT("Base language") . ')' : null); ?>
                    </a>
                </li>
            <?php endforeach ?>
        </ul>
        <div class='tab-content'>
            <?php foreach ($oQuota->survey->getAllLanguages() as $language) {
                echo CHtml::tag(
                    'div',
                    [
                        'id'    => 'edittxtele' . $language,
                        'class' => 'tab-pane fade' . " " . ($language == $oQuota->survey->language ? 'show active ' : ''),
                    ],
                    $this->renderPartial(
                        '_form_langsetting',
                        [
                            'form'                  => $form,
... (12 lines truncated)
</file>

<file path="application/views/quotas/_form.php">
<?php
?>
<?php $form = $this->beginWidget('CActiveForm', ['id' => 'editquota',]); ?>
<?php $this->widget('ext.AlertWidget.AlertWidget', ['errorSummaryModel' => $oQuota]); ?>
<div class="row">
    <div class="col-xl-4">
        <?php echo $form->hiddenField($oQuota, 'id'); ?>
        <div class="mb-3">
            <?php echo $form->labelEx($oQuota, 'name', ['class' => 'form-label ']); ?>
            <div class=''>
                <?php echo $form->textField($oQuota, 'name', ['class' => 'form-control']); ?>
                <?php echo $form->error($oQuota, 'name'); ?>
            </div>
        </div>
        <div class="mb-3">
            <?php echo $form->labelEx($oQuota, 'qlimit', ['class' => 'form-label ']); ?>
            <div class=''>
                <?php echo $form->textField($oQuota, 'qlimit', ['class' => 'form-control']); ?>
                <?php echo $form->error($oQuota, 'qlimit'); ?>
            </div>
        </div>
        <div class="mb-3">
            <?php echo $form->labelEx($oQuota, 'action', ['class' => 'form-label ']); ?>
            <div class=''>
                <?php echo $form->dropDownList(
                    $oQuota,
                    'action',
                    [
                        Quota::TERMINATE_VISIBLE_QUOTA_QUESTIONS            => gT("Terminate after related visible question was submitted", 'unescaped'),
                        Quota::TERMINATE_VISIBLE_AND_HIDDEN_QUOTA_QUESTIONS => gT("Terminate after related visible and hidden questions were submitted", 'unescaped'),
... (55 lines truncated)
</file>

<file path="application/views/quotas/_newanswer_equation.php">
<?php
?>
<div class='row'>
    <h2><?php echo sprintf(gT("New answer for quota '%s'"), CHtml::encode($oQuota->name));?></h2>
    <p class="lead"><?php eT("Set equation value");?></p>
    <div class='mb-3'>
        <div class='col-md-5 offset-md-4'>
            <input type="text" class='form-control' name="quota_anscode" />
        </div>
    </div>
</div>
</file>

<file path="application/views/quotas/editquota_view.php">
<?php
?>
<div class='side-body'>
    <div class="row">
        <div class="col-12 content-right">
            <h3>
                <?php eT("Edit quota");?>
            </h3>
            <?php $this->renderPartial(
                '/quotas/_form',
                array(
                    'oQuota' => $oQuota,
                    'aQuotaLanguageSettings' => $aQuotaLanguageSettings,
                )
            )?>
        </div>
    </div>
</div>
</file>

<file path="application/views/quotas/index.php">
<?php
extract($quotasData);
echo viewHelper::getViewTestTag('surveyQuotas');
?>
<div class='side-body'>
    <div class="row">
        <div class="col-12 content-right">
            <h1 class="h3">
                <?php eT("Survey quotas");?>
            </h1>
            <?php
            if ($oDataProvider->itemCount > 0) {
                require_once Yii::getPathOfAlias('application.extensions.admin.grid.FloatingActionsWidget.actions.QuotaListMassiveActions') . '.php';
                $floatingActions = \actions\QuotaListMassiveActions::getActions(
                    (int) $oSurvey->getPrimaryKey(),
                    $oQuota,
                    $aQuotaLanguageSettings
                );
                $this->widget('ext.admin.grid.FloatingActionsWidget.FloatingActionsWidget', [
                    'pk'       => 'id',
                    'gridId'   => 'quota-grid',
                    'aActions' => $floatingActions,
                ]);
            }
            ?>
            <?php if ($oDataProvider->itemCount > 0) :?>
            <!-- Grid -->
            <div class="row">
                <div class="col-12 content-right">
                    <?php $this->widget('application.extensions.admin.grid.CLSGridView', [
... (87 lines truncated)
</file>

<file path="application/views/quotas/newanswer_view.php">
<?php
?>
<div class='side-body'>
    <div class="row">
        <div class="col-xl-8 content-right">
            <h3>
                <?php eT("Survey quota");?>: <?php eT("Add answer");?>
            </h3>
            <div class="jumbotron message-box">
                <div class='row'>
                    <h2><?php echo sprintf(gT("New answer for quota '%s'"), CHtml::encode($oQuota->name));?></h2>
                    <p class="lead">
                        <?php eT("Select question");?>:
                    </p>
                    <?php echo CHtml::form(array("quotas/newanswer/surveyid/{$oQuota->sid}/sSubaction/new_answer_two"), 'post', array('class' => '')); ?>
                        <div class='mb-3'>
                            <div class='col-md-5 offset-md-4'>
                                <select class='form-select' name="quota_qid" size="15">
                                    <?php foreach ($oQuota->survey->quotableQuestions as $questionlisting) { ?>
                                        <option value="<?php echo $questionlisting['qid'];?>">
                                            <?php echo $questionlisting['title'];?>: <?php echo strip_tags(substr((string) $questionlisting->questionl10ns[$sBaseLang]->question, 0, 40));?>
                                        </option>
                                    <?php } ?>
                                </select>
                            </div>
                        </div>
                        <div class='mb-3'>
                            <div class='col-md-5 offset-md-4'>
                                <input name="submit" type="submit" class="submit btn btn-outline-secondary" value="<?php eT("Next");?>" />
                            </div>
... (12 lines truncated)
</file>

<file path="application/views/quotas/newanswererror_view.php">
<?php
?>
<div class="jumbotron message-box message-box-error">
        <h2><?php eT("Add answer");?>: <?php eT("Question selection");?></h2>
        <p class="lead"><?php eT("Sorry, there are no supported question types in this survey.");?></p>
        <p>
            <input  class="btn btn-lg btn-primary" type="submit" onclick="window.open('<?php echo $this->createUrl("quotas/index/surveyid/$surveyid");?>', '_top')" value="<?php eT("Continue");?>"/>
        </p>
</div>
</file>

<file path="application/views/quotas/newanswertwo_view.php">
<?php
?>
<div class='side-body'>
    <div class="row">
        <div class="col-12 content-right">
            <h3>
                <?php eT("Survey quota");?>: <?php eT("Add answer");?>
            </h3>
            <div class="jumbotron message-box">
                <div class='row'>
            <?php if ($isAllAnswersSelected) { ?>
                    <h2><?php eT("All answers are already selected in this quota.");?></h2>
                    <p>
                        <input class="btn btn-lg btn-primary" type="submit" onclick="window.open('<?php echo $this->createUrl("quotas/index/surveyid/{$oQuota->sid}");?>', '_top')" value="<?php eT("Continue");?>"/>
                    </p>
            <?php } else {
                echo CHtml::form(
                    array("quotas/insertQuotaAnswer/surveyid/{$oQuota->sid}"),
                    'post',
                    array('#' => 'quota_' . sanitize_int($_POST['quota_id']), 'class' => '')
                );
                if ($oQuestion->type == '*') {
                    $this->renderPartial(
                        '_newanswer_equation',
                        ['oQuota' => $oQuota,'oQuestion' => $oQuestion]
                    );
                } else { ?>
                        <h2><?php echo sprintf(gT("New answer for quota '%s'"), CHtml::encode($oQuota->name));?></h2>
                        <p class="lead"><?php eT("Select answer:");?></p>
                        <div class='mb-3'>
... (37 lines truncated)
</file>

<file path="application/views/quotas/newquota_view.php">
<?php
echo viewHelper::getViewTestTag('addQuota');
?>
<div class='side-body'>
    <div class="row">
        <div class="col-12 content-right">
            <h1 class="h3">
                <?php eT("New quota");?>
            </h1>
            <?php $this->renderPartial(
                '/quotas/_form',
                array(
                    'oQuota' => $oQuota,
                    'aQuotaLanguageSettings' => $aQuotaLanguageSettings,
                )
            )?>
        </div>
    </div>
</div>
</file>

<file path="application/views/quotas/viewquotas_massive_langsettings_form.php">
<?php
?>
<?php $form = $this->beginWidget('CActiveForm', array('id' => 'edit-quota-ls',)); ?>
<?php
$this->widget('ext.AlertWidget.AlertWidget', ['errorSummaryModel' => $aQuotaLanguageSettings]);
?>
<?php $this->renderPartial(
    '_form_langsettings',
    array(
        'form' => $form,
        'oQuota' => $oQuota,
        'aQuotaLanguageSettings' => $aQuotaLanguageSettings,
    )
);?>
&nbsp;
<?php $this->endWidget(); ?>
</file>

<file path="application/views/quotas/viewquotas_massive_selector.php">
<?php
?>
<?php $this->widget('ext.admin.grid.MassiveActionsWidget.MassiveActionsWidget', array(
    'pk'          => 'id',
    'gridid'      => 'quota-grid',
    'dropUpText'  => gT('Selected quota(s)...'),
    'aActions'    => array(
        array(
            'type'        => 'action',
            'action'      => 'activate',
            'url'         => App()->createUrl('/quotas/massiveAction/action/activate', ['surveyid' => $oSurvey->sid]),
            'iconClasses' => 'ri-play-fill text-success',
            'text'        =>  gT("Activate"),
            'grid-reload' => 'yes',
            'actionType'  => 'modal',
            'modalType'   => 'cancel-apply',
            'keepopen'    => 'yes',
            'sModalTitle'   => gT('Activate quotas'),
            'htmlModalBody' => gT('Are you sure you want to activate all selected quotas?'),
        ),
        array(
            'type'        => 'action',
            'action'      => 'deactivate',
            'url'         => App()->createUrl('/quotas/massiveAction/action/deactivate', ['surveyid' => $oSurvey->sid]),
            'iconClasses' => 'ri-pause-fill',
            'text'        =>  gT("Deactivate"),
            'grid-reload' => 'yes',
            'actionType'  => 'modal',
            'modalType'   => 'cancel-apply',
            'keepopen'    => 'yes',
... (45 lines truncated)
</file>

<file path="application/views/quotas/viewquotas_quota_members_actions.php">
<?php
?>
<?php if (Permission::model()->hasSurveyPermission($oSurvey->getPrimaryKey(), 'quotas', 'update')) { ?>
    <?php echo CHtml::beginForm(array("quotas/deleteAnswer/surveyid/{$oSurvey->getPrimaryKey()}"), 'post', array('style' => 'display:inline-block')); ?>
    <input name="submit" type="submit" class="btn btn-outline-secondary" value="<?php eT("Remove");?>" />
    <input type="hidden" name="sid" value="<?php echo $oSurvey->getPrimaryKey();?>" />
    <input type="hidden" name="action" value="quotas" />
    <input type="hidden" name="quota_member_id" value="<?php echo $oQuotaMember->getPrimaryKey();?>" />
    <input type="hidden" name="quota_qid" value="<?php echo $oQuotaMember->qid;?>" />
    <input type="hidden" name="quota_anscode" value="<?php echo $oQuotaMember->code;?>" />
    <input type="hidden" name="subaction" value="quota_delans" />
<?php } ?>
</form>
</file>

<file path="application/views/quotas/viewquotas_quota_members_item.php">
<?php
if ($oQuotaMember->question) :
    ?>
<tr class="<?php echo !$data['valid'] ? "bg-warning text-danger" : ""; ?>"><!-- because lime-admin-colors.css force tr:nth-child(2n+1) td color, must add text-danger -->
    <td data-bs-toggle="tooltip"  data-container="body"
        title="<?php echo CHtml::encode(viewHelper::flatEllipsizeText(
            $oQuotaMember->question->questionl10ns[$sBaseLang]->question,
            true,
            60,
            '...',
            0.6
        )); ?>">
        <?php echo $oQuotaMember->question->title?>
    </td>
    <td>
        <?php echo viewHelper::flatEllipsizeText($data['answer_title'], true, 80, '...', 0.6); ?>
    </td>
    <td class="text-end">
        <?php $this->renderPartial(
            'viewquotas_quota_members_actions',
            array(
                'oSurvey' => $oQuotaMember->survey,
                'oQuota' => $oQuotaMember->quota,
                'oQuotaMember' => $data['oQuotaMember'],
            )
        );
        ?>
    </td>
</tr>
<?php endif;?>
... (1 lines truncated)
</file>

<file path="application/views/quotas/viewquotas_quota_members.php">
<?php
$quotaActions = [
    Quota::TERMINATE_VISIBLE_QUOTA_QUESTIONS => [
        'description' => gT("Terminate after related visible question was submitted"),
        'icon'        => 'ri-error-warning-fill'
    ],
    Quota::TERMINATE_VISIBLE_AND_HIDDEN_QUOTA_QUESTIONS => [
        'description' => gT("Terminate after related visible and hidden questions were submitted"),
        'icon'        => 'ri-error-warning-fill'
    ],
    Quota::TERMINATE_ALL_PAGES => [
        'description' => gT("Terminate after all page submissions"),
        'icon'        => 'ri-error-warning-fill'
    ],
    Quota::SOFT_TERMINATE_VISIBLE_QUOTA_QUESTIONS => [
        'description' => gT("Soft terminate after related visible question was submitted, answer will be editable"),
        'icon'        => 'ri-alert-fill'
    ],
];
$tooltip = $quotaActions[$oQuota->action]['description'] ?? gT("Unknown action");
$icon = $quotaActions[$oQuota->action]['icon'] ?? '';
?>
<?php /*echo "<pre>".print_r($oQuota->mainLanguagesetting->attributes,true)."</pre>";*/ ?>
<div class="card card-primary <?= ($oQuota->active == 1 ? 'border-left-success' : 'inactive border-left-warning') ?>">
    <div class="card-header ">
        <div class="float-end small">
            <span><span class="<?= $icon ?>"></span> <?= $tooltip ?></span>
            <?php if ($oQuota->autoload_url == 1) :?>
                <span><span class=" ri-external-link-fill"></span> <?php echo gT('Autoload URL:') . ' ' . htmlentities((string) $oQuota->mainLanguagesetting->quotals_url);?></span>
            <?php endif;?>
... (37 lines truncated)
</file>

<file path="application/views/quotas/viewquotasempty_view.php">
<tr>
    <td colspan="6"><?php eT("No quotas have been set for this survey");?></td>
</tr>
</file>

<file path="application/views/responses/massive_actions/_selector.php">
<?php
?>
<!-- Rendering massive action widget -->
<?php
$buttons = [];
$surveyId = intval(App()->getRequest()->getQuery('surveyId'));
$selectAllCapNote = '';
if (!empty($selectAllMaxCount) && $numTotalAnswers > $selectAllMaxCount) {
    $selectAllCapNote = '<div class="select-all-cap-note mt-2" style="display:none;">'
        . $this->widget('ext.AlertWidget.AlertWidget', [
            'tag'  => 'p',
            'text' => sprintf(
                gT('"Select all" is limited to the first %s responses in one action.'),
                (int) $selectAllMaxCount
            ),
            'type' => 'info',
        ], true)
        . '</div>';
}
if (Permission::model()->hasSurveyPermission($surveyId, 'responses', 'delete')) {
    $buttons[] = [
        'type'        => 'action',
        'action'      => 'delete',
        'url'         =>  App()->createUrl("responses/delete/", ['surveyId' => $surveyId]),
        'iconClasses' => 'ri-delete-bin-fill text-danger',
        'text'        =>  gT('Delete'),
        'grid-reload' => 'yes',
        'actionType'    => 'modal',
        'modalType'     => 'cancel-delete',
        'keepopen'      => 'no',
... (62 lines truncated)
</file>

<file path="application/views/responses/modal_subviews/filterColumns.php">
<?php
?>
<!-- Button trigger modal -->
<button role="button" type="button" class="btn btn-outline-secondary" data-bs-toggle="modal" data-bs-target="#responses-column-filter-modal" id="responses-column-filter-button">
    <span class="ri-layout-column-fill"></span>
</button>
<!-- Modal -->
<div class="modal fade" id="responses-column-filter-modal" tabindex="-1" role="dialog" aria-labelledby="responses-column-filter-label">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <form action="<?= App()->createUrl('responses/setfilteredcolumns/', ['surveyId' => $surveyId]) ?>" class="pjax" method="POST" data-filtered-columns=<?php echo json_encode($filteredColumns) ?>>
                <?php
                Yii::app()->getController()->renderPartial(
                    '/layouts/partial_modals/modal_header',
                    ['modalTitle' => gT('Select columns')]
                );
                ?>
                <div class="modal-body">
                    <div class="responses-column-filter-modal-checkbox-buttons">
                        <button role="button" type="button" id="responses-column-filter-modal-selectall" class="btn btn-outline-secondary">
                            <span class="ri-check-fill"></span>
                            &nbsp;
                            <?php eT("Select all"); ?>
                        </button>
                        <button role="button" type="button" id="responses-column-filter-modal-clear" class="btn btn-outline-secondary">
                            <span class="ri-delete-bin-fill text-danger"></span>
                            &nbsp;
                            <?php eT("Clear selection"); ?>
                        </button>
                    </div>
... (24 lines truncated)
</file>

<file path="application/views/responses/partial/topbarBtns/leftSideButtons.php">
<?php
if ($hasResponsesCreatePermission) {
    $this->widget(
        'ext.ButtonWidget.ButtonWidget',
        [
            'name' => 'response-dataentry',
            'id' => 'response-dataentry',
            'text' => gT('Data entry'),
            'icon' => 'ri-keyboard-box-line',
            'link' => Yii::App()->createUrl("admin/dataentry/sa/view/surveyid/$oSurvey->sid"),
            'htmlOptions' => [
                'class' => 'btn btn-outline-secondary',
                'role' => 'button'
            ],
        ]
    );
}
if ($hasResponsesExportPermission) {
    $exportDropdownItems = $this->renderPartial(
        '/responses/partial/topbarBtns/responsesExportDropdownItems',
        get_defined_vars(),
        true
    );
    $this->widget('ext.ButtonWidget.ButtonWidget', [
        'name' => 'ls-tools-button',
        'id' => 'ls-tools-button',
        'text' => gT('Export'),
        'icon' => 'ri-upload-2-fill',
        'isDropDown' => true,
        'dropDownContent' => $exportDropdownItems,
... (102 lines truncated)
</file>

<file path="application/views/responses/partial/topbarBtns/responsesExportDropdownItems.php">
<ul class="dropdown-menu">
    <!-- Export results to application -->
    <li>
        <a class="dropdown-item"
           href='<?php echo Yii::App()->createUrl("admin/export/sa/exportresults/surveyid/$oSurvey->sid"); ?>'>
            <?php eT("Export responses"); ?>
        </a>
    </li>
    <!-- Export results to a SPSS/PASW command file -->
    <li>
        <a class="dropdown-item"
           href='<?php echo Yii::App()->createUrl("admin/export/sa/exportspss/sid/$oSurvey->sid"); ?>'>
            <?php eT("Export responses to SPSS"); ?>
        </a>
    </li>
    <!-- Export a VV survey file -->
    <li>
        <a class="dropdown-item"
           href='<?php echo Yii::App()->createUrl("admin/export/sa/vvexport/surveyid/$oSurvey->sid"); ?>'>
            <?php eT("Export a VV survey file"); ?>
        </a>
    </li>
</ul>
</file>

<file path="application/views/responses/partial/topbarBtns/responsesImportDropdownItems.php">
<ul class="dropdown-menu">
    <!-- Import responses from an archived response table -->
    <li>
        <a class="dropdown-item"
           href='<?php echo Yii::App()->createUrl("admin/dataentry/sa/import/surveyid/$oSurvey->sid"); ?>'
           role="button">
            <?php eT("Import responses from an archived response table"); ?>
        </a>
    </li>
    <!-- Import a VV survey file -->
    <li>
        <a class="dropdown-item"
           href='<?php echo Yii::App()->createUrl("admin/dataentry/sa/vvimport/surveyid/$oSurvey->sid"); ?>'
           role="button">
            <?php eT("Import a VV survey file"); ?>
        </a>
    </li>
</ul>
</file>

<file path="application/views/responses/partial/topbarBtns/responseViewTopbarRight_view.php">
<?php
if ($exist) {
    if ($hasResponsesUpdatePermission && isset($rlanguage)) {
        $this->widget(
            'ext.ButtonWidget.ButtonWidget',
            [
                'name' => 'boxes-close-button',
                'id' => 'boxes-close-button',
                'text' => gT('Edit this entry'),
                'icon' => 'ri-pencil-fill text-success',
                'link' => Yii::App()->createUrl("admin/dataentry/sa/editdata/subaction/edit/surveyid/{$surveyid}/id/{$id}/lang/$rlanguage"),
                'htmlOptions' => [
                    'class' => 'btn btn-outline-secondary',
                ],
            ]
        );
    }
    ?>
    <?php if ($hasResponsesDeletePermission && isset($rlanguage)) {
        $confirmQuestion = gT("Are you sure you want to delete this entry?", "js");
        $deleteLink = convertGETtoPOST(Yii::App()->createUrl(
            "admin/dataentry/sa/delete/",
            ['id' => $id, 'sid' => $surveyid]
        ));
        $this->widget(
            'ext.ButtonWidget.ButtonWidget',
            [
                'name' => 'boxes-close-button',
                'id' => 'boxes-close-button',
                'text' => gT('Delete this entry'),
... (90 lines truncated)
</file>

<file path="application/views/responses/partial/topbarBtns/rightSideButtons.php">
<?php
if ($hasResponsesDeletePermission) {
    $dataText = gT('Enter a list of response IDs that are to be deleted, separated by comma.');
    $dataText .= '<br/>';
    $dataText .= gT('Please note that if you delete an incomplete response during a running survey, the participant will not be able to complete it.');
    $this->widget(
        'ext.ButtonWidget.ButtonWidget',
        [
        'name' => 'response-batch-deletion',
        'id' => 'response-batch-deletion',
        'text' => gT('Batch deletion'),
        'icon' => 'ri-delete-bin-fill text-danger',
        'link' => Yii::App()->createUrl("responses/delete/", ["surveyId" => $oSurvey->sid]),
        'htmlOptions' => [
        'class' => 'btn btn-outline-secondary selector--ConfirmModal',
        'role' => 'button',
        'data-post' => "{}",
        'data-show-text-area' => 'true',
        'data-use-ajax' => 'true',
        'data-grid-id' => 'responses-grid',
        'data-grid-reload' => 'true',
        'data-button-no' => gT('Cancel'),
        'data-button-yes' => gT('Delete'),
        'data-button-type' => 'btn-danger',
        'data-close-button-type' => 'btn-cancel',
        'data-text' => $dataText,
        'title' => gT('Batch deletion'),
        ],
        ]
    );
... (2 lines truncated)
</file>

<file path="application/views/responses/partial/notSubmittedResponseListTable.php">
<?php
$this->widget(
    'application.extensions.admin.grid.CLSGridView',
    [
        'id'           => 'saved-grid',
        'ajaxUpdate'   => 'saved-grid',
        'dataProvider' => $model->search(),
        'columns'      => $model->columns,
        'filter'       => $model,
        'ajaxType'     => 'POST',
        'htmlOptions'  => ['class' => 'table-responsive grid-view-ls'],
        'emptyText'    => gT('No customizable entries found.'),
        'lsPageSizeCurrentValue'  => $savedResponsesPageSize,
        'lsPageSizeSelectorName'  => 'savedResponsesPageSize',
    ]
);
</file>

<file path="application/views/responses/partial/responseListTable.php">
<?php
echo viewHelper::getViewTestTag('surveyResponsesBrowse');
?>
<!-- for filter columns with datepicker-->
<div style="display: none;">
    <?php
    $datePickerWidget = App()->getController()->widget(
        'ext.DateTimePickerWidget.DateTimePicker',
        [
            'name'          => "no",
            'id'            => "no_listResponses",
            'pluginOptions' => [
                'format'           => $dateformatdetails['jsdate'],
                'allowInputToggle' => true,
                'showClear'        => true,
                'locale'           => convertLStoDateTimePickerLocale(App()->session['adminlang'])
            ]
        ]
    );
    $datePickerWidgetConfig = str_replace('"', '', json_encode($datePickerWidget->getTempusConfigString()));
    $datePickerWidgetConfig = str_replace('\n', '', $datePickerWidgetConfig);
    ?>
</div>
<div class='side-body'>
    <!-- Display mode -->
    <form action="<?= App()->createUrl('/responses/browse/', ['surveyId' => $surveyid]) ?>" class="pjax text-end" method="POST"
          id="change-display-mode-form">
        <div class="mb-3">
            <label for="display-mode">
                <?php eT('Display mode:'); ?>
... (287 lines truncated)
</file>

<file path="application/views/responses/partial/responseSummary.php">
<div class="accordion">
  <div class="accordion-item">
    <h2 class="accordion-header" id="panelsStayOpen-headingOne">
      <button class="accordion-button" type="button" data-bs-toggle="collapse" data-bs-target="#panelsStayOpen-collapseOne" aria-expanded="true" aria-controls="panelsStayOpen-collapseOne">
        <span class="summary-title py-1"><?php eT("Response summary"); ?></span>
      </button>
    </h2>
    <div id="panelsStayOpen-collapseOne" class="accordion-collapse collapse show" aria-labelledby="panelsStayOpen-headingOne">
      <div class="accordion-body">
        <div class="row">
          <div class="col-12 content-right">
            <div class="row">
              <div class="col summary-detail">
                <?php eT("Full responses"); ?>
              </div>
              <div class="col">
                <?php echo $num_completed_answers; ?>
              </div>
              <div class="col">
              </div>
            </div>
            <div class="row">
              <div class="col summary-detail">
                <?php eT("Incomplete responses"); ?>
              </div>
              <div class="col">
                <?php echo ($num_total_answers - $num_completed_answers); ?>
              </div>
              <div class="col">
              </div>
... (18 lines truncated)
</file>

<file path="application/views/responses/browseidrow_view.php">
<?php
?>
<div class='side-body'>
    <h3><?php echo sprintf(gT("View response ID %d"), $id); ?></h3>
    <div class="row">
        <div class="col-12 content-right">
            <?php echo CHtml::form(["responses/browse/", ['surveyId' => $surveyid]], 'post', ['id' => 'resulttableform']); ?>
            <input id='downloadfile' name='downloadfile' value='' type='hidden'>
            <input id='sid' name='sid' value='<?php echo $surveyid; ?>' type='hidden'>
            <input id='subaction' name='subaction' value='all' type='hidden'>
            <?php echo CHtml::endForm() ?>
            <table class='detailbrowsetable table table-striped'>
                <?php foreach ($answers as $answer) : ?>
                    <?php if (
                    !isset($fnames[$answer['i']]['type']) ||
                        (isset($fnames[$answer['i']]['type']) && $fnames[$answer['i']]['type'] !== '|') ||
                        (isset($fnames[$answer['i']]['type']) && $fnames[$answer['i']]['type'] === '|' && $answer['answervalue'] !== '')
) : ?>
                        <tr <?php echo $inserthighlight; ?>>
                            <th>
                                <?php if (isset($fnames[$answer['i']]['code'])) { ?>
                                    [<strong class="qcode"><?php echo $fnames[$answer['i']]['code']; ?></strong>]
                                <?php } ?>
                                <?php echo strip_tags((string) stripJavaScript($fnames[$answer['i']][1])); ?></th>
                            <td>
                                <?php
                                echo $answer['answervalue']; ?>
                            </td>
                        </tr>
                    <?php endif; ?>
... (6 lines truncated)
</file>

<file path="application/views/responses/browseindex_view.php">
<?php
echo viewHelper::getViewTestTag('surveyResponsesBrowse');
?>
<div class='side-body survey-response-page'>
    <h1> <?= gT("Survey responses") ?> </h1>
    <div class="mt-4">
        <?php echo $this->renderPartial(
            'partial/responseSummary',
            [
                'num_completed_answers' => $num_completed_answers,
                'num_total_answers' => $num_total_answers,
                'num_total_answers' => $num_total_answers,
            ],
            true
        );
            ?>
    </div>
    <h2 class="summary-title mt-4 pb-2 mb-3"><?php eT("Response summary"); ?></h2>
    <ul class="nav nav-tabs mt-2 " role="tablist">
        <li class="nav-item"><a class="nav-link active" href="#allResponses" aria-controls="allResponses" role="tab" data-bs-toggle="tab"><?php eT('All responses'); ?></a></li>
        <li class="nav-item"><a class="nav-link" href="#notSubmittedResponses" aria-controls="notSubmittedResponses" role="tab" data-bs-toggle="tab"><?php eT('Saved but not submitted responses'); ?></a></li>
    </ul>
    <div class="tab-content p-4 h-100">
        <div id="allResponses" class="tab-pane show fade active row">
            <?php echo $this->renderPartial(
                'partial/responseListTable',
                [
                    'surveyid' => $surveyid,
                    'dateformatdetails' => $dateformatdetails,
                    'model' => $model,
... (26 lines truncated)
</file>

<file path="application/views/responses/browsetimerow_view.php">
<?php
?>
<div class='side-body'>
    <h3><?php eT('Time statistics'); ?></h3>
    <script type='text/javascript'>
        var strdeleteconfirm = '<?php eT('Do you really want to delete this response?', 'js'); ?>';
        var strDeleteAllConfirm = '<?php eT('Do you really want to delete all marked responses?', 'js'); ?>';
    </script>
    <?php
    $this->widget('application.extensions.admin.grid.CLSGridView', [
            'dataProvider' => $model->search($surveyId, $language),
            'id' => 'time-grid',
            'emptyText' => gT('No surveys found.'),
            'ajaxUpdate' => 'time-grid',
            'lsAfterAjaxUpdate' => ['window.LS.doToolTip();'],
            'lsPageSizeCurrentValue' => $pageSize,
            'columns' => $columns
        ]);
    ?>
    <?php if ($statistics['count']) { ?>
        <div class="header ui-widget-header"><?php eT('Interview time'); ?></div>
        <table class="ls-statisticssummary">
            <tr>
                <th><?php eT('Average interview time:'); ?></th>
                <td title=""><?php printf(gT("%s min. %s sec."), $statistics['avgmin'], $statistics['avgsec']) ?></td>
            </tr>
            <tr>
                <th><?php eT('Median:'); ?></th>
                <td><?php printf(gT("%s min. %s sec."), $statistics['allmin'], $statistics['allsec']) ?> </td>
            </tr>
... (11 lines truncated)
</file>

<file path="application/views/smtpOAuth/redirectToAuth.php">
<div class="card">
    <div class="card-body">
        <h5 class="card-title"><?= sprintf(gT("Authenticate with %s"), $providerName) ?></h5>
        <p class="card-text">
            <?php if (!empty($description)) : ?>
                <?= $description ?>
            <?php else : ?>
                <?= gT("Please click the button below to authenticate with your account.") ?>
            <?php endif; ?>
        </p>
        <button type="button" id="get-token" class="btn btn-primary">Get token</button>
    </div>
</div>
<script>
    $(document).on('click', '#get-token', () => {
        const width = <?= $width ?? 600 ?>;
        const height = <?= $height ?? 700 ?>;
        const left = (window.screen.width - width) / 2 + window.screen.availLeft;
        const top = (window.screen.height - height) / 2 + window.screen.availTop;
        window.open('<?= $providerUrl ?>', 'lime_oauth', 'width=' + width + ',height=' + height + ',left=' + left + ',top=' + top + 'location=0,menubar=0,status=0,toolbar=0');
    });
    window.addEventListener('message', function(event) {
        if (event.data == 'REFRESH') {
            window.location.replace('<?= $redirectUrl ?>');
        }
    });
</script>
</file>

<file path="application/views/smtpOAuth/responseReceived.php">
<!DOCTYPE html>
<html>
    <body>
        <script>
            window.opener.postMessage("REFRESH");
            window.close();
        </script>
    </body>
</html>
</file>

<file path="application/views/survey/questions/answer/5pointchoice/rows/item_row.twig">
{#
/**
 * 5 point choice Html : item row
 *
 * @var $name
 * @var $value
 * @var $id
 * @var $labelText
 * @var $itemExtraClass
 * @var $checkedState
 * @var $checkconditionFunction
 */
#}

<!-- item_row -->
<li id="javatbd{{name}}_C{{value}}" class="answer-item radio-item {{itemExtraClass}}">
    <input
        type="radio"
        name="{{name}}"
        id="answer{{id}}"
        value="{{value}}"
        {{checkedState}}
    />
    <label for="answer{{id}}" class="control-label radio-label">{{labelText}}</label>
</li>
<!-- end of item_row -->
</file>

<file path="application/views/survey/questions/answer/5pointchoice/answer.twig">
{#
/**
 * 5 point choice Html
 *
 * @var $sRows         : the rows, generated with the view item_row.php
 * @var $slider_rating : slider rating display in question attribute
 *
 * @var $id
 * @var $sliderId  $ia[0];
 * @var $name'                   => $ia[1],
 * @var $sessionValue
 */
#}

<!-- 5 point choice -->
<!-- answer -->

<ul class="{{coreClass}} list-unstyled list-group list-group-horizontal" role="radiogroup" aria-labelledby="ls-question-text-{{name}}">
    {% for aRow in aRows %}
        {% include './survey/questions/answer/5pointchoice/rows/item_row.twig' with aRow %}
    {% endfor %}
</ul>

{#/* Value for expression manager javascript (use id) ; no need to submit */#}
<input type="hidden" name="java{{name}}" id="java{{name}}" disabled value={{sessionValue}} />
</file>

<file path="application/views/survey/questions/answer/5pointchoice/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>5pointchoice</name>
        <type>question_theme</type>
        <title>5 point choice</title>
        <creationDate>09/08/2018</creationDate>
        <author>LimeSurvey GmbH</author>
        <authorEmail>info@limesurvey.org</authorEmail>
        <authorUrl>http://www.limesurvey.org</authorUrl>
        <copyright>Copyright (C) 2005 - 2018 LimeSurvey Gmbh, Inc. All rights reserved.</copyright>
        <license>GNU General Public License version 2 or later</license>
        <version>1.0</version>
        <apiVersion>1</apiVersion>
        <description>5 point choice question type configuration</description>
        <questionType>5</questionType>
        <group>Single choice questions</group>
        <subquestions>0</subquestions>
        <answerscales>0</answerscales>
        <hasdefaultvalues>1</hasdefaultvalues>
        <assessable>0</assessable>
        <class>choice-5-pt-radio</class>
    </metadata>
    <compatibility>
        <version>4.0</version>
        <version>5.0</version>
        <version>6.0</version>
        <version>7.0</version>
    </compatibility>
    <files>
... (272 lines truncated)
</file>

<file path="application/views/survey/questions/answer/arrays/10point/columns/col.twig">
{#
/**
 * Array 10pointchoice, column
 *
 * @var $odd_even
 * @var $cellwidth
 */
#}

<!-- col -->
<col class="{{ odd_even }}" style='width: {{ cellwidth }}%;' />
<!-- end of col -->
</file>

<file path="application/views/survey/questions/answer/arrays/10point/rows/cells/answer_td_input.twig">
{#
/**
 * Array 5 point choice
 * @var $i
 * @var $myfname
 * @var $CHECKED
 * @var $checkconditionFunction
 * @var $value
 */
#}

<!-- answer_td_input -->
<td class="answer_cell_{{ i }}{% if i=="" %} noanswer-item{% endif %} answer-item radio-item">
    <input
        type="radio"
        name="{{ myfname }}"
        id="answer{{ myfname }}-{{ i }}"
        aria-labelledby="answer{{ basename }}-{{ i }}"
        value="{{ value }}"
        {{ CHECKED }}
     />
    <label for="answer{{ myfname }}-{{ i }}"  class="ls-label-xs-visibility" aria-hidden="true">
        {{ processString(labelText) }}
    </label>
</td>
<!-- end of answer_td_input -->
</file>

<file path="application/views/survey/questions/answer/arrays/10point/rows/cells/header_answer.twig">
{#
/**
 * Array header : answer or sub question
 * @var $class
 * @var $content
 * @var $basename
 * @var $code
 */
#}
<th class="{{ class }}" id="answer{{ basename }}-{{ code }}" role="columnheader">
    {{ content }}
</th>
</file>

<file path="application/views/survey/questions/answer/arrays/10point/rows/cells/header_information.twig">
{#
/**
 * Array header : informationnal item
 * @var $class
 * @var $content
 */
#}

{{ doRender('/survey/questions/answer/global/table/cell/head_information', ({'class':class,'content':content})) }}
</file>

<file path="application/views/survey/questions/answer/arrays/10point/rows/answer_row.twig">
{#
/**
 * Generate a row for the table
 *
 * @var $answer_tds        : the cells of each row, generated with the view rows/cells/*.php
 * @var $myfname
 * @var $answerwidth
 * @var $answertext
 * @var $value
 */
#}

<!-- answer_row -->
<tr id="javatbd{{ myfname }}" class="answers-list radio-list mb-3 {% if odd %}ls-odd{% else %}ls-even{% endif %} {% if error %} ls-error-mandatory has-error{% endif %}"  {{ sDisplayStyle }}  role="radiogroup"  aria-labelledby="answertext{{ myfname }}">
    <th id="answertext{{ myfname }}" class="answertext control-label{% if answerwidth==0 %} visually-hidden{% endif %}">
        {{ processString(answertext) }}

        {# Value for expression manager javascript (use id) ; no need to submit #}
        {{ C.Html.hiddenField("java"~myfname,value,({
            'id' : "java"~myfname,
            'disabled' : true,
        }))
        }}
    </th>

        {# defined in rows/cells #}
        {{ answer_tds }}

</tr>
<!-- end of answer_row -->
... (1 lines truncated)
</file>

<file path="application/views/survey/questions/answer/arrays/10point/answer.twig">
{#
/**
 * array 10 point choice Html
 *
 * @var $sColumns   : the columns, generated with the view columns/col.php
 * @var $sHeaders   : the headers, generated with the view rows/cell/thead.php
 * @var $sRows      : the rows, generated with the view rows/answer_row.php
 * @var $extraclass
 * @var $answerwidth
 */
#}
<!-- Array 10 point choice -->

<!-- answer -->
<div class="ls-table-wrapper" aria-labelledby="ls-question-text-{{ basename }}">
    <table class="{{ coreClass }} table table-bordered table-hover table-10-point-array">
        <!-- Columns -->
        <colgroup class="col-responses">
            <col class="col-answers" style='width: {{ answerwidth }}%;' />
                {# columns/col.php #}
                {{ sColumns }}
        </colgroup>
        <thead>
            <tr class="ls-heading">
                    {# rows/cell/thead.php #}
                    {{ sHeaders }}
            </tr>
        </thead>
        <tbody>
                {# rows/answer_row.php #}
... (6 lines truncated)
</file>

<file path="application/views/survey/questions/answer/arrays/10point/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>arrays/10point</name>
        <type>question_theme</type>
        <title>Array (10 point choice)</title>
        <creationDate>09/08/2018</creationDate>
        <author>LimeSurvey GmbH</author>
        <authorEmail>info@limesurvey.org</authorEmail>
        <authorUrl>http://www.limesurvey.org</authorUrl>
        <copyright>Copyright (C) 2005 - 2018 LimeSurvey Gmbh, Inc. All rights reserved.</copyright>
        <license>GNU General Public License version 2 or later</license>
        <version>1.0</version>
        <apiVersion>1</apiVersion>
        <description>Array (10 point choice) question type configuration</description>
        <questionType>B</questionType>
        <group>Arrays</group>
        <subquestions>1</subquestions>
        <answerscales>0</answerscales>
        <hasdefaultvalues>0</hasdefaultvalues>
        <assessable>1</assessable>
        <class>array-10-pt</class>
    </metadata>
    <compatibility>
        <version>4.0</version>
        <version>5.0</version>
        <version>6.0</version>
        <version>7.0</version>
    </compatibility>
    <files>
... (378 lines truncated)
</file>

<file path="application/views/survey/questions/answer/arrays/5point/columns/col.twig">
{#
/**
 * Array 5pointchoice, column
 *
 * @var $cellwidth
 */
#}

<!-- col.twig -->
<col class="{# TODO: alternation #}" style='width: {{ cellwidth }}%;' />
<!-- end of col.twig -->
</file>

<file path="application/views/survey/questions/answer/arrays/5point/rows/cells/answer_td_answertext.twig">
{#
/**
 * Array 5 point choice
 *
 * @var $answerwidth
 * @var $answertext2
 */
#}

<!-- answer_td_answertext -->
<td class="answertextright information-item">{{ processString(answertext2) }}</td>
<!-- endof answer_td_answertext -->
</file>

<file path="application/views/survey/questions/answer/arrays/5point/rows/cells/answer_td_input.twig">
{#
/**
 * array 5 point choice
 * @var $i
 * @var $myfname
 * @var $CHECKED
 * @var $checkconditionFunction
 * @var $value
 */
#}

<!-- td_input -->
<td class="answer_cell_{{ i }}{% if i=="" %} noanswer-item{% endif %} answer-item radio-item">
    <input
        type="radio"
        name="{{ myfname }}"
        id="answer{{ myfname }}-{{ i }}"
        aria-labelledby="answer{{ basename }}-{{ i }}"
        value="{{ value }}"
        {{ CHECKED }}
     />
    <label for="answer{{ myfname }}-{{ i }}" class="ls-label-xs-visibility" aria-hidden="true">
        {{ processString(labelText) }}
    </label>
</td>
<!-- end of td_input -->
</file>

<file path="application/views/survey/questions/answer/arrays/5point/rows/cells/header_answer.twig">
{#
/**
 * Array header : answer or sub question
 * @var $class
 * @var $content
 * @var $basename
 * @var $code
 */
#}
<th class="{{ class }}" id="answer{{ basename }}-{{ code }}" role="columnheader">
    {{ content }}
</th>
</file>

<file path="application/views/survey/questions/answer/arrays/5point/rows/cells/header_information.twig">
{#
/**
 * Array header : informationnal item
 * @var $class
 * @var $content
 */
#}

{{ doRender('/survey/questions/answer/global/table/cell/head_information', ({'class':class,'content':content})) }}
</file>

<file path="application/views/survey/questions/answer/arrays/5point/rows/answer_row.twig">
{#
/**
 * Generate a row for the table
 *
 * @var $answer_tds        : the cells of each row, generated with the view rows/cells/*.php
 * @var $myfname
 * @var $answerwidth
 * @var $answertext
 * @var $value
 * @var $odd
 * @var $error
 */
#}

<!-- answer_row -->
<tr id="javatbd{{ myfname }}" class="answers-list radio-list mb-3 {% if odd %}ls-odd{% else %}ls-even{% endif %}{% if error %} ls-error-mandatory has-error{% endif %}" {{ sDisplayStyle }}  role="radiogroup"  aria-labelledby="answertext{{ myfname }}">
    <th id="answertext{{ myfname }}" class="answertext control-label{% if answerwidth==0 %} d-none visually-hidden{% endif %}}">
        {{ processString(answertext) }}

        {# Value for expression manager javascript (use id) ; no need to submit #}
        {{ C.Html.hiddenField("java"~myfname,value,({
            'id' : "java"~myfname,
            'disabled' : true,
        }))
        }}
    </th>
            {# defined in rows/cells/ #}
        {{ answer_tds }}

</tr>
... (2 lines truncated)
</file>

<file path="application/views/survey/questions/answer/arrays/5point/answer.twig">
{#
/**
 * array 5 point choice Html : Header
 *
 * @var $sColumns   : the columns, generated with the view columns/col.php
 * @var $sHeaders   : the headers, generated with the view rows/cell/thead.php
 * @var $sRows      : the rows, generated with the view rows/answer_row.php
 * @var $extraclass
 */
#}
<!-- Array 5 point choice -->

<!-- answer -->
<div class="ls-table-wrapper" role="group" aria-labelledby="ls-question-text-{{ basename }}">
    <table class="{{ coreClass }} table table-bordered table-hover table-5-point-array" role="group" aria-labelledby="ls-question-text-{{ basename }}">
        <!-- Columns -->
        <colgroup class="col-responses">
            <col class="col-answers" style='width: {{ answerwidth }}%;' />
                {# columns/col.php #}
                {{ sColumns }}
        </colgroup>
        <!-- Table headers -->
        <thead>
            <tr class="ls-heading"><!-- same class for repeat heading too -->
                    {# rows/cell/thead.php #}
                    {{ sHeaders }}
            </tr>
        </thead>
        <!-- Table Body -->
        <tbody>
... (10 lines truncated)
</file>

<file path="application/views/survey/questions/answer/arrays/5point/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>arrays/5point</name>
        <type>question_theme</type>
        <title>Array (5 point choice)</title>
        <creationDate>09/08/2018</creationDate>
        <author>LimeSurvey GmbH</author>
        <authorEmail>info@limesurvey.org</authorEmail>
        <authorUrl>http://www.limesurvey.org</authorUrl>
        <copyright>Copyright (C) 2005 - 2018 LimeSurvey Gmbh, Inc. All rights reserved.</copyright>
        <license>GNU General Public License version 2 or later</license>
        <version>1.0</version>
        <apiVersion>1</apiVersion>
        <description>Array (5 point choice) question type configuration</description>
        <questionType>A</questionType>
        <group>Arrays</group>
        <subquestions>1</subquestions>
        <answerscales>0</answerscales>
        <hasdefaultvalues>0</hasdefaultvalues>
        <assessable>1</assessable>
        <class>array-5-pt</class>
    </metadata>
    <compatibility>
        <version>4.0</version>
        <version>5.0</version>
        <version>6.0</version>
        <version>7.0</version>
    </compatibility>
    <files>
... (378 lines truncated)
</file>

<file path="application/views/survey/questions/answer/arrays/array/dropdown/rows/answer_row.twig">
{#
/**
 * @var $myfname
 * @var $answertext
 * @var $value
 * @var $error
 * @var $checkconditions
 * @var $options
 * @var $thRight
 * @var $tdRight
 * @var $right_exists
 * @var $answertextright
 */
#}
<tr id="javatbd{{ myfname }}" class="question-item answer-item ls-dropdown-item {% if odd %} ls-odd {% else %} ls-even{% endif %}{% if error %} ls-error-mandatory has-error{% endif %}" >
    <th class="answertext control-label{% if answerwidth==0 %} visually-hidden{% endif %}">
        <label for="answer{{ myfname }}">
            {{ processString(answertext) }}
        </label>
        
        {# Value for expression manager javascript (use id) ; no need to submit #}
        {{ C.Html.hiddenField("java"~myfname,value,({
            'id' : "java"~myfname,
            'disabled' : true,
        }))
        }}
    </th>
    <td>
        <select class="form-select" name="{{ myfname }}" id="answer{{ myfname }}">
            {% for option in options %}
... (11 lines truncated)
</file>

<file path="application/views/survey/questions/answer/arrays/array/dropdown/answer.twig">
{#
/**
 * array array, dropdown, Html
 *
 * @var $sRows      : the rows, generated with the view rows/answer_row.php
 *
 * @var $extraclass

 *
 */
#}
<!-- Array -->
<!-- answer -->
<div class="ls-table-wrapper" role="group" aria-labelledby="ls-question-text-{{ basename }}">
    <table class="{{ coreClass }} table table-bordered table-hover table-array-dropdown">
        <colgroup class="col-responses">
            <col class="col-answers" style='width: {{ answerwidth }}%;' />
            <col class="odd" style='width: {{ columnswidth }}%;' />
            {% if right_exists %}
                <col class="col-answersright" style='width: {{ answerwidth }}%;' />
            {% endif %}
        </colgroup>
        <tbody>
                {# rows/answer_row.php #}
                {{ sRows }}
                {% for aRow in aRows %}
                    {% include 'survey/questions/answer/arrays/array/dropdown/rows/answer_row.twig' with aRow %}
                {% endfor %}
        </tbody>
    </table>
... (3 lines truncated)
</file>

<file path="application/views/survey/questions/answer/arrays/array/dropdown/empty.twig">
<!-- empty -->
<p class="error">
    {{ gT("Error: There are no answer options for this question and/or they don't exist in this language.") }}
</p>
</file>

<file path="application/views/survey/questions/answer/arrays/array/no_dropdown/columns/col.twig">
{#
/**
 * Array, column
 *
 * @var $class
 * @var $cellwidth
 */
#}

<!-- col -->
<col class="{{ class }}" style='width: {{ cellwidth }}%'/>
<!-- end of col -->
</file>

<file path="application/views/survey/questions/answer/arrays/array/no_dropdown/rows/cells/answer_td.twig">
{#
/**
 * Array, no drop down
 * @var $label
 * @var $ld
 * @var $myfname
 * @var $ld
 * @var $CHECKED
 * @var $checkconditionFunction
 */
#}

<!-- answer_td -->
<td class="answer_cell_{{ ld }}{% if ld=="" %} noanswer-item{% endif %} answer-item radio-item">
    <input
        type="radio"
        name="{{ myfname }}"
        value="{{ ld }}"
        id="answer{{ myfname }}-{{ ld }}"
        aria-labelledby="answer{{ basename }}-{{ ld }}"
        {{ checked }}
    />
    <label for="answer{{ myfname }}-{{ ld }}" class="ls-label-xs-visibility" aria-hidden="true">
        {{ processString(label) }}
    </label>
</td>
<!-- end of answer_td -->
</file>

<file path="application/views/survey/questions/answer/arrays/array/no_dropdown/rows/cells/header_answer.twig">
{#
/**
 * Array header : answer or sub question
 * @var $class
 * @var $content
 * @var $basename
 * @var $code
 * @var $isrepeat
 * @var $oAnswer
 */
#}
<th class="{{ class }}" {% if not isrepeat %} id="answer{{ basename }}-{{ code }}" role="columnheader" {% endif %}>
    {{ processString(content) }}
</th>
</file>

<file path="application/views/survey/questions/answer/arrays/array/no_dropdown/rows/cells/header_information.twig">
{#
/**
 * Array header : informationnal item
 * @var $class
 * @var $content
 */
#}
<td class="{{ class }}">
    {{ processString(content) }}
</td>
</file>

<file path="application/views/survey/questions/answer/arrays/array/no_dropdown/rows/answer_row.twig">
{#
/**
 * Generate a row for the table
 *
 * @var $answer_tds      : the cells of each row, generated with the view rows/cells/*.php
 * @var $myfname
 * @var $answertext
 * @var $value
 * @var $right_exists
 * @var $answertextright
 */
#}

<!-- answer_row -->
<tr id="javatbd{{ myfname }}" class="answers-list radio-list {% if odd %} ls-odd{% else %} ls-even{% endif %}{% if error %} ls-error-mandatory has-error{% endif %}" role="radiogroup"  aria-labelledby="answertext{{ myfname }}">
    <th id="answertext{{ myfname }}" class="answertext control-label{% if answerwidth==0 %} visually-hidden{% endif %}">
        {{ processString(answertext) }}
        
        {# Value for expression manager javascript (use id) ; no need to submit #}
        {{ C.Html.hiddenField("java"~myfname,value,({
            'id' : "java"~myfname,
            'disabled' : true,
        }))
        }}
    </th>

        {% for aAnswerColumn in aAnswerColumns %}
            {% include 'survey/questions/answer/arrays/array/no_dropdown/rows/cells/answer_td.twig' with aAnswerColumn %}
        {% endfor %}
        {# Defined in answer_td view #}
... (13 lines truncated)
</file>

<file path="application/views/survey/questions/answer/arrays/array/no_dropdown/rows/repeat_header.twig">
{#
/**
 * This view is used to repeat the headers of the table (question advanced attribute)
 *
 * @var $sHeaders
 */
#}
<!-- repeat_header no drop down -->
</tbody>
<tbody>
    <tr class="ls-heading ls-heading-repeat " aria-hidden="true">
        {{ sHeaders }}
    </tr>
<!-- end of repeat_header -->
</file>

<file path="application/views/survey/questions/answer/arrays/array/no_dropdown/answer.twig">
{#
/**
 * array array, no dropdown, Html
 *
 * @var $sColumns   : the columns, generated with the view columns/col.php
 * @var $sHeaders   : the headers, generated with the view rows/cell/thead.php
 * @var $sRows      : the rows, generated with the view rows/answer_row.php
 *
 * @var $extraclass

 *
 */
#}
<!-- Array -->

<!-- answer -->
<div class="ls-table-wrapper" role="group" aria-labelledby="ls-question-text-{{ basename }}">
    <table class="{{ coreClass }} table table-bordered table-hover table-array-radio" >
        <colgroup class="col-responses">
            <col class="col-answers"  style='width: {{ answerwidth }}%;' />
            {# columns/col.php #}
            {% for aColumn in aColumns %}
                <col class="{{ aColumn.class }}" style='width: {{ aColumn.cellwidth }}%'/>
            {% endfor %}
        </colgroup>
        <thead>
            <tr class="ls-heading ls-header">
                {{sHeaders}}
            </tr>
        </thead>
... (16 lines truncated)
</file>

<file path="application/views/survey/questions/answer/arrays/array/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>arrays/array</name>
        <type>question_theme</type>
        <title>Array</title>
        <creationDate>09/08/2018</creationDate>
        <author>LimeSurvey GmbH</author>
        <authorEmail>info@limesurvey.org</authorEmail>
        <authorUrl>http://www.limesurvey.org</authorUrl>
        <copyright>Copyright (C) 2005 - 2018 LimeSurvey Gmbh, Inc. All rights reserved.</copyright>
        <license>GNU General Public License version 2 or later</license>
        <version>1.0</version>
        <apiVersion>1</apiVersion>
        <description>Array question type configuration</description>
        <questionType>F</questionType>
        <group>Arrays</group>
        <subquestions>1</subquestions>
        <answerscales>1</answerscales>
        <hasdefaultvalues>0</hasdefaultvalues>
        <assessable>1</assessable>
        <class>array-flexible-row</class>
    </metadata>
    <compatibility>
        <version>4.0</version>
        <version>5.0</version>
        <version>6.0</version>
        <version>7.0</version>
    </compatibility>
    <files>
... (445 lines truncated)
</file>

<file path="application/views/survey/questions/answer/arrays/column/answer.twig">
{#

/**
 * Array by column
 *
 * @var $anscount
 * @var $cellwidth
 */
 #}
 <!-- Array by column -->

 <!-- answer -->
 <div class="ls-table-wrapper" role="group" aria-labelledby="ls-question-text-{{ basename }}">
    <table class="{{ coreClass }} table table-bordered table-col-hover">
        <colgroup>
            <col class="col-answers" style='width: {{ answerwidth }}%;' />
            {# A <col> is not exposed in the accessibility tree, so no ARIA here:
               the subquestion (column) is instead named on each radio through
               aria-labelledby, together with the answer option (row). #}
            {% for i, question in aQuestions %}
                <col
                    class="answers-list radio-list {% if i % 2 %}ls-odd{% else %}ls-even{% endif %} {% if question.errormandatory %} ls-error-mandatory has-error{% endif %}"
                    style='width: {{ cellwidth }}%;'
                    >
            {% endfor %}
        </colgroup>
        <thead>
            <tr class='ls-heading'><!-- unsure for ls-heading class here -->
                <td></td>
                {% for i, question in aQuestions %}
... (50 lines truncated)
</file>

<file path="application/views/survey/questions/answer/arrays/column/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>arrays/column</name>
        <type>question_theme</type>
        <title>Array by column</title>
        <creationDate>09/08/2018</creationDate>
        <author>LimeSurvey GmbH</author>
        <authorEmail>info@limesurvey.org</authorEmail>
        <authorUrl>http://www.limesurvey.org</authorUrl>
        <copyright>Copyright (C) 2005 - 2018 LimeSurvey Gmbh, Inc. All rights reserved.</copyright>
        <license>GNU General Public License version 2 or later</license>
        <version>1.0</version>
        <apiVersion>1</apiVersion>
        <description>Array by column question type configuration</description>
        <questionType>H</questionType>
        <group>Arrays</group>
        <subquestions>1</subquestions>
        <answerscales>1</answerscales>
        <hasdefaultvalues>0</hasdefaultvalues>
        <assessable>1</assessable>
        <class>array-flexible-column</class>
    </metadata>
    <compatibility>
        <version>4.0</version>
        <version>5.0</version>
        <version>6.0</version>
        <version>7.0</version>
    </compatibility>
    <files>
... (326 lines truncated)
</file>

<file path="application/views/survey/questions/answer/arrays/dualscale/answer_dropdown.twig">
{#
/**
 * Dual-scale array with dropdown representation

 * @var $answerwidth
 * @var $cellwidth
 * @var $ddprefix
 * @var $ddsuffix
 */

#}

<!-- answer -->
 <div class="ls-table-wrapper" role="group" aria-labelledby="ls-question-text-{{ basename }}">
    <table class="{{ coreClass }} table table-bordered table-hover">

    <!-- Column groups -->
    <colgroup>
        <col class="answertext" style='width:{{ answerwidth }}%;' />
        <col class="dsheader" style='width:{{ (100 - answerwidth - separatorwidth)/2 }}%;'  {% if leftheader %} role='group' aria-labelledby="left-header-{{ basename }}" {% endif %}/>
        <col class="ddarrayseparator" style='width:{{ separatorwidth }}%'/>
        <col class="dsheader" style='width:{{ (100 - answerwidth - separatorwidth)/2 }}%;' {% if leftheader %} role='group' aria-labelledby="right-header-{{ basename }}" {% endif %}/>
    </colgroup>
    <!-- Header -->
    {% if leftheader != '' or rightheader !='' %}
        <thead>
            <tr class="ls-heading">
                <td></td>
                <th class='left-header' id='left-header-{{ basename }}'>{{ processString(leftheader) }}</th>
                <td></td>
... (130 lines truncated)
</file>

<file path="application/views/survey/questions/answer/arrays/dualscale/answer_header.twig">
{#

/**
 * Header row for dual-scale array
 * @var $labelans0 - Labels for answers
 * @var $labelans1
 * @var $shownoanswer
 * @var $rightexists
 * @var $class - Extra class, like 'repeat headers'
 */

#}
<tr class="ls-heading ls-header" >
    {{ doRender(
        '/survey/questions/answer/arrays/dualscale/content_header',
        ({
            'basename'     : basename,
            'labelans0'    : labelans0,
            'labelans1'    : labelans1,
            'shownoanswer' : shownoanswer,
            'rightexists'  : rightexists,
            'leftheader'   : leftheader,
            'rightheader'  : rightheader,
            'repeat'       : false
        })
    ) }}
</tr>
</file>

<file path="application/views/survey/questions/answer/arrays/dualscale/answer.twig">
{#

/**
 * Array dual-scale, no dropdown

 * @var answerwidth
 */

#}

<!-- answer -->
 <div class="ls-table-wrapper" role="group" aria-labelledby="ls-question-text-{{ basename }}">
    {% if labelans0|length == 0 %}
    <div class="alert alert-warning" role="alert">
        {{ gT("Warning:") }} {{ gT("You need to add answer options to this question!") }}<br>
        {{ gT("This question cannot be properly displayed.") }}
    </div>
    {% endif %}
    <table class="{{ coreClass }} table table-bordered table-hover">
        <col class="col-answers" style='width: {{ answerwidth }}%;' >
        {% if leftheader != '' or rightheader !='' %}
            <col style='width: 0%;'  class="d-none"> <!-- see https://bugs.limesurvey.org/view.php?id=11863 -->
        {% endif %}
        <colgroup class="col-responses group-1">
            {% for ld in labelans0 %}
                <col style='width: {{ cellwidth }}%;' >
            {% endfor %}
        </colgroup>
        {% if labelans1|length > 1 %}
            <col class="separator" style="width: {{ separatorwidth }}%">
... (206 lines truncated)
</file>

<file path="application/views/survey/questions/answer/arrays/dualscale/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>arrays/dualscale</name>
        <type>question_theme</type>
        <title>Array dual scale</title>
        <creationDate>09/08/2018</creationDate>
        <author>LimeSurvey GmbH</author>
        <authorEmail>info@limesurvey.org</authorEmail>
        <authorUrl>http://www.limesurvey.org</authorUrl>
        <copyright>Copyright (C) 2005 - 2018 LimeSurvey Gmbh, Inc. All rights reserved.</copyright>
        <license>GNU General Public License version 2 or later</license>
        <version>1.0</version>
        <apiVersion>1</apiVersion>
        <description>Array dual scale question type configuration</description>
        <questionType>1</questionType>
        <group>Arrays</group>
        <subquestions>1</subquestions>
        <answerscales>2</answerscales>
        <hasdefaultvalues>0</hasdefaultvalues>
        <assessable>1</assessable>
        <class>array-flexible-duel-scale</class>
    </metadata>
    <compatibility>
        <version>4.0</version>
        <version>5.0</version>
        <version>6.0</version>
        <version>7.0</version>
    </compatibility>
    <files>
... (457 lines truncated)
</file>

<file path="application/views/survey/questions/answer/arrays/dualscale/content_header.twig">
{#

/**
 * Header row for dual-scale array
 * @var $labelans0 - Labels for answers
 * @var $labelans1
 * @var $shownoanswer
 * @var $rightexists
 */
#}
<td></td>
{% if leftheader != '' or rightheader !='' %}
    <td class="d-none"></td>
{% endif %}
{% for code, ld in labelans0 %}
    <th class='answer-text'{% if not repeat %} id="answer{{ basename }}_0-{{ code }}" role="columnheader" {% endif %}>{{ processString(ld) }}</th>
{% endfor %}
{% if labelans1|length > 0 %}
    <td class="header_separator">
        {% if shownoanswer %}
            <div class="ls-js-hidden">{{ gT('No answer') }}</div>
        {% endif %}</td>  <!-- Separator : and No answer for accessibility for first colgroup -->
    {% if leftheader != '' or rightheader !='' %}
        <td class="d-none"></td>
    {% endif %}
    {% for code, ld in labelans1 %}
        <th class='answer-text'{% if not repeat %} id="answer{{ basename }}_1-{{ code }}" role="columnheader" {% endif %}>{{ processString(ld) }}</th>
    {% endfor %}
{% endif %}
{% if shownoanswer or rightexists %}
... (6 lines truncated)
</file>

<file path="application/views/survey/questions/answer/arrays/dualscale/repeat_header.twig">
{#

/**
 * Header row for dual-scale array
 * @var $labelans0 - Labels for answers
 * @var $labelans1
 * @var $shownoanswer
 * @var $rightexists
 * @var $class - Extra class, like 'repeat headers'
 */

#}
<!-- repeat_header -->
</tbody>
<tbody>
<tr class="ls-heading ls-heading-repeat " aria-hidden="true">
    {{ doRender(
        '/survey/questions/answer/arrays/dualscale/content_header',
        ({
            'basename'     : basename,
            'labelans0'    : labelans0,
            'labelans1'    : labelans1,
            'shownoanswer' : shownoanswer,
            'rightexists'  : rightexists,
            'leftheader'   : leftheader,
            'rightheader'  : rightheader,
            'repeat'       : true
        })
    ) }}
</tr>
... (2 lines truncated)
</file>

<file path="application/views/survey/questions/answer/arrays/increasesamedecrease/columns/col.twig">
{#
/**
 * Array increasesamedecrease, column
 *
 * @var $odd_even
 * @var $cellwidth
 */
#}

<!-- col.twig -->
<col class="{{ odd_even }}" style='width: {{ cellwidth }}%;' />
<!-- end of col.twig -->
</file>

<file path="application/views/survey/questions/answer/arrays/increasesamedecrease/rows/cells/thead.twig">
{#
/**
 * @var $no_answer
 */
#}

<!-- thead -->
<td></td>
<th class="answer-text" id="answer{{ basename }}-I" role="columnheader">{{ gT("Increase") }}</th>
<th class="answer-text" id="answer{{ basename }}-S" role="columnheader">{{ gT("Same") }}</th>
<th class="answer-text" id="answer{{ basename }}-D" role="columnheader">{{ gT("Decrease") }}</th>
{% if no_answer %}
    <th class="answer-text noanswer-text"  id="answer{{ basename }}-" role="columnheader">{{ gT("No answer") }}</th>
{% endif %}
<!-- end of  thead -->
</file>

<file path="application/views/survey/questions/answer/arrays/increasesamedecrease/rows/answer_row.twig">
{#

 * Array, Increase Same Decrease
 *
 * @var $basename
 * @var $myfname
 * @var $sDisplayStyle
 * @var $answertext
 * @var $Ichecked
 * @var $Schecked
 * @var $Dchecked

 * @var $Uchecked
 * @var $Nchecked
 * @var $NAchecked
 * @var $value
 * @var $checkconditionFunction
 * @var $no_answer
 * @var $error
 #}

<!-- answer_row -->
<tr id="javatbd{{ myfname }}" class="row-inc-same-dec answers-list radio-list {% if odd %}ls-odd{% else %}ls-even{% endif %} {% if error %} ls-error-mandatory has-error{%endif %}" role="radiogroup"  aria-labelledby="answertext{{ myfname }}">
    <!-- Answer text /  Errors -->
    <th id="answertext{{ myfname }}" class="answertext control-label{% if answerwidth==0 %} visually-hidden{% endif %}" role="rowheader">
        {{ processString(answertext) }}
        {# Value for expression manager javascript (use id) ; no need to submit #}
        {{ C.Html.hiddenField("java"~myfname,value,({
            'id' : "java"~myfname,
            'disabled' : true,
... (68 lines truncated)
</file>

<file path="application/views/survey/questions/answer/arrays/increasesamedecrease/answer.twig">
{#
/**
 * array increasesamedecrease Html
 *
 * @var $sColumns   : the columns, generated with the view columns/col.php
 * @var $sHeaders   : the headers, generated with the view rows/cell/thead.php
 * @var $sRows      : the rows, generated with the view rows/answer_row.php
 * @var $answerwidth
 * @var $anscount
 * @var $extraclass
 *
 */
#}

<!-- Array  increasesamedecrease -->

<!-- answer -->
<div role="group" aria-labelledby="ls-question-text-{{ basename }}">
    <table class="{{ coreClass }} table table-bordered table-hover">
        <colgroup class="col-responses">
            <col class="col-answers"  style='width: {{ answerwidth }}%;'  />
                {# columns/col.php #}
                {{ sColumns }}
        </colgroup>
        <thead>
            <tr class="ls-heading ls-header">
                    {# rows/cell/thead.php #}
                    {{ sHeaders }}
            </tr>
        </thead>
... (15 lines truncated)
</file>

<file path="application/views/survey/questions/answer/arrays/increasesamedecrease/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>arrays/increasesamedecrease</name>
        <type>question_theme</type>
        <title>Array (Increase/Same/Decrease)</title>
        <creationDate>09/08/2018</creationDate>
        <author>LimeSurvey GmbH</author>
        <authorEmail>info@limesurvey.org</authorEmail>
        <authorUrl>http://www.limesurvey.org</authorUrl>
        <copyright>Copyright (C) 2005 - 2018 LimeSurvey Gmbh, Inc. All rights reserved.</copyright>
        <license>GNU General Public License version 2 or later</license>
        <version>1.0</version>
        <apiVersion>1</apiVersion>
        <description>Array (Increase/Same/Decrease) question type configuration</description>
        <questionType>E</questionType>
        <group>Arrays</group>
        <subquestions>1</subquestions>
        <answerscales>0</answerscales>
        <hasdefaultvalues>0</hasdefaultvalues>
        <assessable>1</assessable>
        <class>array-increase-same-decrease</class>
    </metadata>
    <compatibility>
        <version>4.0</version>
        <version>5.0</version>
        <version>6.0</version>
        <version>7.0</version>
    </compatibility>
    <files>
... (409 lines truncated)
</file>

<file path="application/views/survey/questions/answer/arrays/multiflexi/rows/cells/answer_td_checkboxes.twig">
{#
 * Cell when checkbox layout is used in advanced question attribute
 *
 * @var $dataTitle
 * @var $ld
 * @var $answertypeclass
 * @var $value $myvalue : 1 VS 0 or '' : OK to use it as boolean directly
 * @var $myfname2
 * @var $setmyvalue
 * @var $checkconditionFunction
 * @var $extraclass
#}
<!-- answer_td_checkboxes -->
<td class="answer_cell_S{{ qid }} question-item answer-item {{ answertypeclass }}-item checkbox-item">
    <!-- Used by EM , don't update id *-->
    {{ C.Html.hiddenField("java"~myfname2, C.Html.encode( value ),({
        'id' : "answer"~myfname2,
        'disabled' : true,
        }))
    }}
    {{ C.Html.checkBox(myfname2,value,({
        'class' : extraclass,
        'id' : "cbox"~myfname2,
        'value' : "1",
        'aria-labelledby' : "answertext" ~ basename ~ "_" ~ dataCode,
    }))
    }}
    <label for="cbox{{ myfname2 }}" class="ls-label-xs-visibility" aria-hidden="true">{{ processString(dataTitle) }}</label>
</td>
<!-- end of answer_td_checkboxes -->
... (1 lines truncated)
</file>

<file path="application/views/survey/questions/answer/arrays/multiflexi/rows/cells/answer_td.twig">
{#
/**
 * Cell when checkbox layout is not used in advanced question attribute
 *
 * @var $dataTitle
 * @var $ld
 * @var $answertypeclass
 * @var $extraclass
 * @var $myfname2
 * @var $answertext
 * @var $error
 * @var $myfname2_java_value
 * @var $inputboxlayout
 * @var $checkconditionFunction
 * @var $minvalue
 * @var $maxvalue
 * @var $reverse
 * @var $value
 * @var $sSeparator
 * @var $maxlength
 */
#}

<!-- answer_td -->
<td class="answer_cell_{{ ld }} answer-item {{ answertypeclass }} {{ extraclass }}{% if error %} has-error{% endif %}">
        {# Value for expression manager javascript ; no need to submit #}
        {{ C.Html.hiddenField("java"~myfname2,value,({
            'id' : "java"~myfname2,
            'disabled' : true,
        }))
... (39 lines truncated)
</file>

<file path="application/views/survey/questions/answer/arrays/multiflexi/rows/answer_row.twig">
{#
/**
 * Generate a row for the table
 *
 * @var $answer_tds      : the cells of each row, generated with the view rows/cells/*.php
 * @var $sDisplayStyle
 * @var $useAnswerWidth
 * @var $answerwidth
 * @var $myfname
 * @var $error
 * @var $row_value
 * @var $answertext
 * @var $answertextright
 * @var $rightTd
 */
#}

<!-- answer_row -->
<tr id="javatbd{{ myfname }}" class="{{ coreRowClass }} {% if odd %}ls-odd{% else %}ls-even{% endif %}{% if error %} ls-error-mandatory{% endif %} {% if error and layout=="checkbox" %} has-error{% endif %}" role="group" aria-labelledby="answertext{{ myfname }}">
    <th
        id="answertext{{ myfname }}"
        class="answertext control-label{% if error and layout!="checkbox" %} text-danger" {% endif %}{% if answerwidth==0 %} visually-hidden{% endif %}",
        role="rowheader"
    >
        {{ processString(answertext) }}
        {# Value for expression manager javascript ? Used ? #}
        {{ C.Html.hiddenField("java"~myfname,row_value,({
            'id' : "java"~myfname,
            'disabled' : true,
        }))
... (11 lines truncated)
</file>

<file path="application/views/survey/questions/answer/arrays/multiflexi/rows/repeat_header.twig">
{#
/**
 * This view is used to repeat the headers of the table (question advanced attribute)
 *
 * @var $labelans
 * @var $right_exists
 * @var $cellwidth
 * @var $answerwidth
 * @var $textAlignment
 */
#}

<!-- repeat_header -->
</tbody>

<tbody>
    <tr class="ls-heading ls-heading-repeat " aria-hidden="true">
        <td></td>
        {% for ld in labelans %}
            <th>
                {{ processString(ld) }}
            </th>
        {% endfor %}

        {% if right_exists %}
            <td></td>
        {% endif %}
    </tr>
<!-- end of repeat header -->
</file>

<file path="application/views/survey/questions/answer/arrays/multiflexi/answer.twig">
{#
/**
 * Global container for the answer
 *
 * @var $sRows           : the rows, generated with the view rows/answer_row.php
 * @var $answertypeclass
 * @var $extraclass
 * @var $answerwidth
 * @var $labelans
 * @var $cellwidth
 * @var $right_exists
 * @var $textAlignment
 *
 */
#}
<!-- answer -->
<div  role="group" aria-labelledby="ls-question-text-{{ basename }}">
    <table class="{{ coreClass }} {{ extraclass }} table table-bordered table-hover">

        <colgroup class="col-responses">
            <col class="answertext" style='width: {{ answerwidth }}%;'/>

            {% for i, ld in labelans %}
                <col class="{# // TODO: array2 alternation #}" style='width: {{ cellwidth }}%;'/> 
            {% endfor %}

            {% if right_exists %}
                <col class="answertextright {# TODO: array2 alternation #}" style='width: {{ answerwidth }}%;' />
            {% endif %}
        </colgroup>
... (23 lines truncated)
</file>

<file path="application/views/survey/questions/answer/arrays/multiflexi/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>arrays/multiflexi</name>
        <type>question_theme</type>
        <title>Array (Numbers)</title>
        <creationDate>09/08/2018</creationDate>
        <author>LimeSurvey GmbH</author>
        <authorEmail>info@limesurvey.org</authorEmail>
        <authorUrl>http://www.limesurvey.org</authorUrl>
        <copyright>Copyright (C) 2005 - 2018 LimeSurvey Gmbh, Inc. All rights reserved.</copyright>
        <license>GNU General Public License version 2 or later</license>
        <version>1.0</version>
        <apiVersion>1</apiVersion>
        <description>Array (Numbers) question type configuration</description>
        <questionType>:</questionType>
        <group>Arrays</group>
        <subquestions>2</subquestions>
        <answerscales>0</answerscales>
        <hasdefaultvalues>0</hasdefaultvalues>
        <assessable>1</assessable>
        <class>array-multi-flexi</class>
    </metadata>
    <compatibility>
        <version>4.0</version>
        <version>5.0</version>
        <version>6.0</version>
        <version>7.0</version>
    </compatibility>
    <files>
... (582 lines truncated)
</file>

<file path="application/views/survey/questions/answer/arrays/multiflexi/empty_error.twig">
<p class="error">
    {{ gT("Error: There are no answer options for this question and/or they don't exist in this language.") }}   
</p>
</file>

<file path="application/views/survey/questions/answer/arrays/multiflexi/translations.php">
<?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
gT('Semicolon-separated list of row subquestion codes that keep their original database position when subquestions (rows) are randomized');
</file>

<file path="application/views/survey/questions/answer/arrays/texts/columns/col_total.twig">
{#
/**
 * Optional td item for total, grand total, etc
 * [[COL_CODE]] are replaced by code of subquestion Scale X
 * [[COL_NAME]] are replaced by text of subquestion Scale X
 * @var $basename
 * @var $inputsize
 * @var $empty
 */
#}
<!-- col_total -->
<td class="total information-item">
    {% if empty %}
        &nbsp;
    {% else %}
        <label for="totals{{ basename }}total_[[COL_CODE]]" class="ls-label-xs-visibility">[[COL_NAME]]</label>
        <input
            type="text"
            id="totals{{ basename }}total_[[COL_CODE]]"
            aria-labelledby="answertext{{ basename }}_[[COL_CODE]]"
            size="{{ inputsize }}"
            value="" disabled="disabled" class="disabled form-control"  data-number='1' />
    {% endif %}
</td>
</file>

<file path="application/views/survey/questions/answer/arrays/texts/rows/cells/answer_td.twig">
{#
 * Answer cell
 *
 * @var $ld
 * @var $myfname2
 * @var $labelText $labelans[$thiskey]
 * @var $maxlength
 * @var $inputwidth
 * @var $value
 * @var $placeholder
#}

<!-- answer_td -->
<td class="answer_cell_{{ ld }} answer-item text-item{% if error %} has-error{% endif %}">
    <label class="ls-label-xs-visibility" for="answer{{ myfname2 }}" aria-hidden="true">
        {{ processString(labelText) }}
    </label>
    {# Value for expression manager javascript (use id) ; no need to submit #}
    {{ C.Html.textField(myfname2,value,({
        'id' : "answer"~myfname2,
        'aria-labelledby' : "answertext" ~ basename ~ "_" ~ ld,
        'class' : "form-control",
        'size' : (inputsize ? inputsize : null),
        'maxlength' : (maxlength ? maxlength : null),
        'placeholder' : flatString(processString(placeholder,1),1),
        'data-number' : isNumber,
        'data-integer' : isInteger,
    }))
    }}
    {# Value for expression manager is needed here ? Unsure (20170518) #}
... (8 lines truncated)
</file>

<file path="application/views/survey/questions/answer/arrays/texts/rows/cells/td_grand_total.twig">
{#
/**
 * Cell for Grand Total
 *
 * @var $empty
 */
#}

<!-- td_grand_total -->
{% if empty %}
    <td>&nbsp;</td>

{% else %}
    <td class="total grand information-item">
        <label for="totals{{ basename }}total_total" class="ls-label-xs-visibility" aria-hidden="true">{{ gT("Grand total") }}</label>
        <input
            type="text"
            id="totals{{ basename }}total_total"
            aria-labelledby="totals{{ basename }}_total"
            {% if inputsize %}size="{{ inputsize }}" {% endif %}
            value="" disabled="disabled" class="disabled form-control" data-number='1'
        />
    </td>
{% endif %}
<!-- end of td_grand_total -->
</file>

<file path="application/views/survey/questions/answer/arrays/texts/rows/cells/td_total.twig">
{#
/**
 * Cell for total
 * [[ROW_CODE]] are replaced by code of subquestion Scale Y
 * [[ROW_NAME]] are replaced by text of subquestion Scale Y
 * @var $basename
 * @var $inputsize
 * @var $empty
 *
 */
#}
<!-- td_total -->
<td class="total information-item">
    {% if empty %}
        &nbsp;
    {% else %}
        <label for="totals{{ basename }}[[ROW_CODE]]_total" class="ls-label-xs-visibility" aria-hidden="true">{{ gT("Total") }}</label>
        <input
            type="text"
            id="totals{{ basename }}[[ROW_CODE]]_total"
            aria-labelledby="totals{{ basename }}_total"
            {% if inputsize %}size="{{ inputsize }}"{% endif %}
            value="" disabled="disabled" class="disabled form-control total"  data-number='1'
        />
    {% endif %}
</td>
<!-- end of td_total -->
</file>

<file path="application/views/survey/questions/answer/arrays/texts/rows/cells/thead.twig">
{#
/**
 * @var $totalText
 * @var $classes
 */
#}
<!-- thead -->
<th class="total {{ classes }}" id="totals{{ basename }}_total" role="columnheader">
    {{ totalText }}
</th>
<!-- end of thead -->
</file>

<file path="application/views/survey/questions/answer/arrays/texts/rows/answer_row.twig">
{#
/**
 * Generate a row for the table
 *
 * @var $answer_tds  : the cells of each row, generated with the view rows/cells/*.php
 * @var $myfname
 * @var $error
 * @var $answertext
 * @var $value
 * @var $rightTd
 * @var $rightTdEmpty
 * @var answerwidth
 * @var $formatedRowTotal
 */
#}

<!-- answer_row -->
<tr id="javatbd{{ myfname }}" class="{{ coreRowClass }} {% if odd %}ls-odd{% else %}ls-even{% endif %}{% if error %} ls-mandatory-error{% endif %}" role="group" aria-labelledby="answertext{{ myfname }}">
    <th
        id="answertext{{ myfname }}"
        class="answertext control-label{% if error %} text-danger{% endif %}{% if answerwidth==0 %} visually-hidden{% endif %}"
        role="rowheader"
    >
        {{ processString(answertext) }}
        {# Value for expression manager javascript : here ?  #}
        {{ C.Html.hiddenField("java"~myfname,value,({
            'id' : "java"~myfname,
            'disabled' : true,
        }))
        }}
... (20 lines truncated)
</file>

<file path="application/views/survey/questions/answer/arrays/texts/rows/repeat_header.twig">
{#
/**
 * This view is used to repeat the headers of the table (question advanced attribute)
 *
 * @var $answerwidth
 * @var $labelans
 * @var $right_exists
 */
#}
</tbody>

<tbody>
    <tr class="ls-heading ls-heading-repeat " aria-hidden="true">
        <td></td>
        {% for i, ld in labelans %}
            <th>
                {{ processString(ld) }}
            </th>
        {% endfor %}

        {% if right_exists %}
            <td></td>
        {% endif %}

        {{ col_head }} {# What is it ? #}
    </tr>
</file>

<file path="application/views/survey/questions/answer/arrays/texts/answer.twig">
{#
/**
 * Global container for the answer
 *
 * @var $q_table_id_HTML
 * @var $classes
 * @var $extraclass
 * @var $num_class
 * @var $totals_class
 * @var $answerwidth
 * @var $cellwidth
 * @var $labelans
 * @var $right_exists
 * @var $showGrandTotal
 * @var $showtotals,
 * @var $row_head,
 * @var $total,
 * @var $q_table_id
 * @var $radix
 * @var $name
 * @var $sRows
 */
#}

<!-- Multi Text -->

<!-- answer -->
<div role="group" aria-labelledby="ls-question-text-{{ basename }}">
    <table {{ q_table_id_HTML }} class="{{ coreClass }} {{ extraclass }} table table-bordered table-hover {{ totals_class }}" aria-labelledby="ls-question-text-{{ basename }}">
        <colgroup class="col-responses">
... (59 lines truncated)
</file>

<file path="application/views/survey/questions/answer/arrays/texts/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>arrays/texts</name>
        <type>question_theme</type>
        <title>Array (Texts)</title>
        <creationDate>09/08/2018</creationDate>
        <author>LimeSurvey GmbH</author>
        <authorEmail>info@limesurvey.org</authorEmail>
        <authorUrl>http://www.limesurvey.org</authorUrl>
        <copyright>Copyright (C) 2005 - 2018 LimeSurvey Gmbh, Inc. All rights reserved.</copyright>
        <license>GNU General Public License version 2 or later</license>
        <version>1.0</version>
        <apiVersion>1</apiVersion>
        <description>Array (Texts) question type configuration</description>
        <questionType>;</questionType>
        <group>Arrays</group>
        <subquestions>2</subquestions>
        <answerscales>0</answerscales>
        <hasdefaultvalues>0</hasdefaultvalues>
        <assessable>0</assessable>
        <class>array-multi-flexi-text</class>
    </metadata>
    <compatibility>
        <version>4.0</version>
        <version>5.0</version>
        <version>6.0</version>
        <version>7.0</version>
    </compatibility>
    <files>
... (485 lines truncated)
</file>

<file path="application/views/survey/questions/answer/arrays/texts/empty_error.twig">
<p class="error">
    {{ gT("Error: There are no answer options for this question and/or they don't exist in this language.") }}
</p>
</file>

<file path="application/views/survey/questions/answer/arrays/yesnouncertain/columns/col.twig">
{#
/**
 * Array yesnouncertain, column
 *
 * @var $odd_even
 * @var $cellwidth
 */
#}
<!-- col -->
<col class="{{ odd_even }} {% if no_answer is not empty %}col-no-answer{% endif %}" style='width: {{ cellwidth }}%;' />
<!-- end of col -->
</file>

<file path="application/views/survey/questions/answer/arrays/yesnouncertain/rows/cells/thead.twig">
{#
/**
 * @var $no_answer
 */
#}

<!-- thead -->
<td></td>
<th class="answer-text" id="answer{{ basename }}-Y" role="columnheader">{{ gT('Yes') }}</th>
<th class="answer-text" id="answer{{ basename }}-U" role="columnheader">{{ gT('Uncertain') }}</th>
<th class="answer-text" id="answer{{ basename }}-N" role="columnheader">{{ gT('No') }}</th>
{% if no_answer %}
    <th class="answer-text noanswer-text" id="answer{{ basename }}-" role="columnheader">{{ gT('No answer') }}</th>
{% endif %}
<!-- end of  thead -->
</file>

<file path="application/views/survey/questions/answer/arrays/yesnouncertain/rows/answer_row.twig">
{#
/**
 * Generate a row for the table
 *
 * @var $basename
 * @var $myfname
 * @var $sDisplayStyle
 * @var $answertext
 * @var $Ychecked
 * @var $Uchecked
 * @var $Nchecked
 * @var $NAchecked
 * @var $value
 * @var $checkconditionFunction
 * @var $no_answer
 * @var $error
 */
#}

<!-- answer_row -->
<tr id="javatbd{{ myfname }}" class="answers-list radio-list {% if odd %}ls-odd {% else %}ls-even{% endif %} {% if error %} has-error{% endif %}" role="radiogroup" aria-labelledby="answertext{{ myfname }}">
    <!-- Answer text /  Errors -->
    <th class="answertext control-label{% if error %} error-mandatory{% endif %}{% if answerwidth==0 %} visually-hidden{% endif %}" id="answertext{{ myfname }}">
        {{ processString(answertext) }}
        {# Value for expression manager javascript (use id) ; no need to submit #}
        {{ C.Html.hiddenField("java"~myfname,value,({
            'id' : "java"~myfname,
            'disabled' : true,
        }))
        }}
... (66 lines truncated)
</file>

<file path="application/views/survey/questions/answer/arrays/yesnouncertain/answer.twig">
{#
/**
 * yesnouncertain Html
 *
 * @var $sColumns   : the columns, generated with the view columns/col.php
 * @var $sHeaders   : the headers, generated with the view rows/cell/thead.php
 * @var $sRows      : the rows, generated with the view rows/answer_row.php
 * @var $anscount
 * @var $extraclass
 * @var $answerwidth
 *
 */
#}
<!-- Yes/Uncertain/No-->
<!-- answer -->
<div  role="group" aria-labelledby="ls-question-text-{{ basename }}">
    <table class="{{ coreClass }} table table-bordered table-hover">
        <colgroup class="col-responses">
            <col class="col-answers"  style='width: {{ answerwidth }}%;' />
                {# columns/col.twig #}
                {{ sColumns }}
        </colgroup>
        <thead>
            <tr class="ls-heading">
                    {# rows/cell/thead.twig #}
                    {{ sHeaders }}
            </tr>
        </thead>
        <tbody>
            {% if anscount==0 %}
... (13 lines truncated)
</file>

<file path="application/views/survey/questions/answer/arrays/yesnouncertain/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>arrays/yesnouncertain</name>
        <type>question_theme</type>
        <title>Array (Yes/Uncertain/No)</title>
        <creationDate>09/08/2018</creationDate>
        <author>LimeSurvey GmbH</author>
        <authorEmail>info@limesurvey.org</authorEmail>
        <authorUrl>http://www.limesurvey.org</authorUrl>
        <copyright>Copyright (C) 2005 - 2018 LimeSurvey Gmbh, Inc. All rights reserved.</copyright>
        <license>GNU General Public License version 2 or later</license>
        <version>1.0</version>
        <apiVersion>1</apiVersion>
        <description>Array (Yes/Uncertain/No) question type configuration</description>
        <questionType>C</questionType>
        <group>Arrays</group>
        <subquestions>1</subquestions>
        <answerscales>0</answerscales>
        <hasdefaultvalues>0</hasdefaultvalues>
        <assessable>1</assessable>
        <class>array-yes-uncertain-no</class>
    </metadata>
    <compatibility>
        <version>4.0</version>
        <version>5.0</version>
        <version>6.0</version>
        <version>7.0</version>
    </compatibility>
    <files>
... (409 lines truncated)
</file>

<file path="application/views/survey/questions/answer/boilerplate/answer.twig">
{#
/**
 * Boilerplate Html
 * @var $name
 */
#}
<!-- boilerplate -->
<!-- Did we need really something ? Why not return an empty string ? -->
<!-- answer -->
{{ sTimer }}

<input class="{{ coreClass }} boilerplate d-none" type="hidden" name="{{ name }}" id="answer{{ name }}" value="" />
<!-- end of answer -->
</file>

<file path="application/views/survey/questions/answer/boilerplate/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>boilerplate</name>
        <type>question_theme</type>
        <title>Text display</title>
        <creationDate>09/08/2018</creationDate>
        <author>LimeSurvey GmbH</author>
        <authorEmail>info@limesurvey.org</authorEmail>
        <authorUrl>http://www.limesurvey.org</authorUrl>
        <copyright>Copyright (C) 2005 - 2018 LimeSurvey Gmbh, Inc. All rights reserved.</copyright>
        <license>GNU General Public License version 2 or later</license>
        <version>1.0</version>
        <apiVersion>1</apiVersion>
        <description>Text display question type configuration</description>
        <questionType>X</questionType>
        <group>Mask questions</group>
        <subquestions>0</subquestions>
        <answerscales>0</answerscales>
        <hasdefaultvalues>0</hasdefaultvalues>
        <assessable>0</assessable>
        <class>boilerplate</class>
    </metadata>
    <compatibility>
        <version>4.0</version>
        <version>5.0</version>
        <version>6.0</version>
        <version>7.0</version>
    </compatibility>
    <files>
... (425 lines truncated)
</file>

<file path="application/views/survey/questions/answer/date/dropdown/rows/datepart.twig">
<div class="col-12">
    <span class="">{{ datepart }}</span>
</div>
</file>

<file path="application/views/survey/questions/answer/date/dropdown/rows/day.twig">
{#
/**
 * Day dropdown Html
 * @var $dayId
 * @var $currentdate
 */
#}

<!-- day -->
<div class="col-12">
    <label for="day{{ dayId }}" class="visually-hidden control-label">
        {{ gT('Day') }}
    </label>
    <select id="day{{ dayId }}" name="day{{ dayId }}" class="form-select day">
        <option value="">{{ gT('Day') }}</option>
        {% for i in 1..31 %}
            <option value="{{ sprintf('%02d', i) }}"{% if i == intval(currentday) %} selected{% endif %}>
                {{ sprintf('%02d', i) }}
            </option>
        {% endfor %}
    </select>
</div>
<!-- end of day -->
</file>

<file path="application/views/survey/questions/answer/date/dropdown/rows/hour.twig">
{#
/**
 * Hour dropdown Html
 * @var $hourId
 * @var $currenthour
 * @var $datepart
 */
#}
<!-- hour -->
<div class="col-12">
    <label for="hour{{ hourId }}" class="visually-hidden control-label">
        {{ gT('Hour') }}
    </label>
    <select id="hour{{ hourId }}" name="hour{{ hourId }}" class="hour form-select">
        <option value="">{{ gT('Hour') }}</option>
        {% for i in 0..23 %}
            {# currenthour are sent as padded integer ( '00','01'), i is integer, need testing !== '' and intval #}
            <option
                value="{{ i }}"{% if (currenthour is not same as('') and i == intval(currenthour)) %} selected{% endif %}>
                {% if (datepart=='H') %}
                    {{ sprintf('%02d', i) }}
                {% else %}
                    {{ i }}
                {% endif %}
            </option>
        {% endfor %}
    </select>
</div>
<!-- end of hour -->
</file>

<file path="application/views/survey/questions/answer/date/dropdown/rows/minute.twig">
{#
/**
 * Minute dropdown Html
 * @var $minuteId
 * @var $currentminute
 * @var $dropdown_dates_minute_step
 * @var $datepart
 */
#}

<!-- minute -->
<div class="col-12">
    <label for="minute{{ minuteId }}" class="visually-hidden control-label">
        {{ gT('Minute') }}
    </label>
    <select id="minute{{ minuteId }}" name="minute{{ minuteId }}" class="minute form-select">
        <option value="">
            {{ gT('Minute') }}
        </option>
        {% for i in 0..59 %}
            {% if i is divisible by(dropdown_dates_minute_step) %}
                {# currentminute are sent as padded integer ( '00','01'), i is integer, need testing !== '' and intval #}
                <option
                    value="{{ i }}"{% if (currentminute is not same as('') and i == intval(currentminute)) %} selected{% endif %}>
                    {% if datepart is same as('i') %}
                        {{ sprintf('%02d', i) }}
                    {% else %}
                        {{ i }}
                    {% endif %}
                </option>
... (6 lines truncated)
</file>

<file path="application/views/survey/questions/answer/date/dropdown/rows/month.twig">
{#
/**
 * Month dropdown Html
 * @var $monthId
 * @var $currentmonth
 * @var $montharray
 */
#}

<!-- month -->
<div class="col-12">
    <label for="month{{ monthId }}" class="visually-hidden control-label">
        {{ gT('Month') }}
    </label>
    <select id="month{{ monthId }}" name="month{{ monthId }}" class="month form-select">
        <option value="">
            {{ gT('Month') }}
        </option>
        {% for i in 1..12 %}
            <option value="{{ sprintf('%02d', i) }}"{% if i == intval(currentmonth) %} selected{% endif %}>
                {{ montharray[(i-1)] }}
            </option>
        {% endfor %}
    </select>
</div>
<!-- end of month -->
</file>

<file path="application/views/survey/questions/answer/date/dropdown/rows/year.twig">
{#
/**
 * Year dropdown Html
 * @var $yearId
 * @var $currentyear
 * @var $yearmax
 * @var $reverse
 * @var $yearmin
 * @var $step
 */
#}

<!-- year -->
<div class="col-12">
    <label for="year{{ yearId }}" class="visually-hidden control-label">
        {{ gT('Year') }}
    </label>
    <select id="year{{ yearId }}" name="year{{ yearId }}" class="year form-select">
        <option value="">
            {{ gT('Year') }}
        </option>
        {% for i in yearmin..(yearmax) %}
            {% if loop.index is divisible by(step) %}
                <option value="{{ i }}"{% if i == intval(currentyear) %} selected{% endif %}>
                    {{ i }}
                </option>
            {% endif %}
        {% endfor %}
    </select>
</div>
... (2 lines truncated)
</file>

<file path="application/views/survey/questions/answer/date/dropdown/answer.twig">
{#
/**
 * Date Html, dropdown style
 *
 * @var $sRows      : the rows, generated with the view rows/*.php
 *
 * @var $name
 * @var $dateoutput
 * @var $checkconditionFunction
 * @var $dateformatdetails
 * @var $dateformat
 */ #}


<!-- Date, dropdown layout -->

<!-- answer -->
<div class="{{ coreClass }} ls-no-js-hidden mb-3 row row-cols-sm-auto g-1 align-items-center" role="group"
     aria-labelledby="ls-question-text-{{ name }}">
    {# // rows/*.php #}
    {{ sRows }}
</div>
<!-- answer fo nojs action and real value sent -->
<div class="row">
    <div class='{{ coreClass }} ls-js-hidden mb-3 col-3'>
        <label for='answer{{ name }}' class='visually-hidden control-label'>
            {{ sprintf(gT('Date in the format: %s'), dateformatdetails) }}
        </label>
        <div id="answer{{ name }}_datetimepicker" class="input-group answer-item date-timepicker-group"
             data-basename="{{ name }}"><!-- data-basename used in js function -->
... (14 lines truncated)
</file>

<file path="application/views/survey/questions/answer/date/selector/answer.twig">
{#
/**
 * Date Html, selector style :
 * @var $name
 * @var $coreClass
 * @var $dateoutput
 * @var $mindate
 * @var $maxdate
 * @var $dateformatdetails
 * @var $dateformatdetailsjs
 * @var $hidetip
 * @var $dateTimeWidget // by passing that over here the tempus dominus datepicker is automatically loaded
 */
#}

<!-- Date, selector layout -->

<!-- answer -->
<div class='{{ coreClass }} mb-3 row g-1 align-items-center'>
    <div class="col-12 col-sm-auto">
        <label for='answer{{ name }}' class='visually-hidden control-label'>
            {{ sprintf(gT('Date format: %s'), dateformatdetails) }}
        </label>
        <div id="answer{{ name }}_datetimepicker" class="input-group answer-item date-timepicker-group"
             data-basename="{{ name }}"><!-- data-basename used in js function -->
            {{ C.Html.textField(name,dateoutput,{
                'id' : "answer" ~ name,
                'class' : "form-control date-control date",
                'aria-describedby' : "ls-question-text-" ~ name,
            }) }}
... (21 lines truncated)
</file>

<file path="application/views/survey/questions/answer/date/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>date</name>
        <type>question_theme</type>
        <title>Date/Time</title>
        <creationDate>09/08/2018</creationDate>
        <author>LimeSurvey GmbH</author>
        <authorEmail>info@limesurvey.org</authorEmail>
        <authorUrl>http://www.limesurvey.org</authorUrl>
        <copyright>Copyright (C) 2005 - 2018 LimeSurvey Gmbh, Inc. All rights reserved.</copyright>
        <license>GNU General Public License version 2 or later</license>
        <version>1.0</version>
        <apiVersion>1</apiVersion>
        <description>Date/Time question type configuration</description>
        <questionType>D</questionType>
        <group>Mask questions</group>
        <subquestions>0</subquestions>
        <answerscales>0</answerscales>
        <hasdefaultvalues>1</hasdefaultvalues>
        <assessable>0</assessable>
        <class>date</class>
    </metadata>
    <compatibility>
        <version>4.0</version>
        <version>5.0</version>
        <version>6.0</version>
        <version>7.0</version>
    </compatibility>
    <files>
... (344 lines truncated)
</file>

<file path="application/views/survey/questions/answer/date/translations.php">
<?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
gT('Minimum date, valid date in YYYY-MM-DD format or any English textual datetime description. Expression Managed can be used (only with YYYY-MM-DD format). For dropdown : only the year is restricted if date use variable not in same page.');
gT('Maximum date, valid date in any English textual datetime description (YYYY-MM-DD for example). Expression Managed can be used (only with YYYY-MM-DD format) value. For dropdown : only the year is restricted if date use variable not in same page.');
</file>

<file path="application/views/survey/questions/answer/dummy/answer.twig">
{#
/**
 * Boilerplate Html
 * @var $name
 */
#}
<!-- boilerplate -->
<!-- Did we need really something ? Why not return an empty string ? -->
<!-- answer -->
<div class="{{ coreClass }} dummyQuestion" type="hidden" name="{{ name }}" id="answer{{ name }}" value="" >
    {{ content | json_encode }}
</div>
<!-- end of answer -->
</file>

<file path="application/views/survey/questions/answer/equation/answer.twig">
{#
/**
 * Equation Html
 * @var $name
 * @var $sValue
 * @var $sEquation
 */
#}

<!-- Equation -->

<!-- answer -->
<div class='{{ coreClass }} d-none'>
    <input type="hidden" name="{{ name }}" id="java{{ name }}" value="{{ sValue }}">
    <div class='{{ insideClass }}'>
        {{ sEquation }}
    </div>
</div>
<!-- end of answer -->
</file>

<file path="application/views/survey/questions/answer/equation/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>equation</name>
        <type>question_theme</type>
        <title>Equation</title>
        <creationDate>09/08/2018</creationDate>
        <author>LimeSurvey GmbH</author>
        <authorEmail>info@limesurvey.org</authorEmail>
        <authorUrl>http://www.limesurvey.org</authorUrl>
        <copyright>Copyright (C) 2005 - 2018 LimeSurvey Gmbh, Inc. All rights reserved.</copyright>
        <license>GNU General Public License version 2 or later</license>
        <version>1.0</version>
        <apiVersion>1</apiVersion>
        <description>Equation question type configuration</description>
        <questionType>*</questionType>
        <group>Mask questions</group>
        <subquestions>0</subquestions>
        <answerscales>0</answerscales>
        <hasdefaultvalues>0</hasdefaultvalues>
        <assessable>0</assessable>
        <class>equation</class>
    </metadata>
    <compatibility>
        <version>4.0</version>
        <version>5.0</version>
        <version>6.0</version>
        <version>7.0</version>
    </compatibility>
    <files>
... (252 lines truncated)
</file>

<file path="application/views/survey/questions/answer/file_upload/answer.twig">
{#<?php
/**
 * File upload question Html
 * @var $fileid
 * @var $value
 * @var $filecountvalue
 */
?>#}

<!-- File Upload  -->

<!--answer -->
<div class="{{ coreClass }}">
    <div class='upload-button'>
        <a role="button"
           id='upload_{{ fileid }}'
           class='btn btn-primary upload'
           href='{{ uploadurl }}'
           data-bs-toggle="modal"
           data-bs-target="#file-upload-modal-{{ fileid }}"
           data-showtitle="{{ showTitle }}"
           data-showcomment="{{ showComment }}"
           data-fieldname="{{ basename }}"
        >
            <span class='fa fa-upload ri-upload-fill'></span>
            &nbsp;
            {{ uploadButtonLabel }}
        </a>
    </div>
    <input type='hidden' id='java{{ fileid }}' name='{{ fileid }}' value='{{ value|escape("html_attr") }}' />
... (122 lines truncated)
</file>

<file path="application/views/survey/questions/answer/file_upload/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>file_upload</name>
        <type>question_theme</type>
        <title>File upload</title>
        <creationDate>09/08/2018</creationDate>
        <author>LimeSurvey GmbH</author>
        <authorEmail>info@limesurvey.org</authorEmail>
        <authorUrl>http://www.limesurvey.org</authorUrl>
        <copyright>Copyright (C) 2005 - 2018 LimeSurvey Gmbh, Inc. All rights reserved.</copyright>
        <license>GNU General Public License version 2 or later</license>
        <version>1.0</version>
        <apiVersion>1</apiVersion>
        <description>File upload question type configuration</description>
        <questionType>|</questionType>
        <group>Mask questions</group>
        <subquestions>0</subquestions>
        <answerscales>0</answerscales>
        <hasdefaultvalues>0</hasdefaultvalues>
        <assessable>0</assessable>
        <class>upload-files</class>
    </metadata>
    <compatibility>
        <version>4.0</version>
        <version>5.0</version>
        <version>6.0</version>
        <version>7.0</version>
    </compatibility>
    <files>
... (284 lines truncated)
</file>

<file path="application/views/survey/questions/answer/file_upload/modal-container.twig">
{#
/**
 * File upload question: content of the upload modal (loaded by UploaderController)
 * Can be overridden in a survey theme or question theme.
 * @var string fn The field name
 * @var integer qid The question id
 * @var integer|string minfiles Minimum number of files
 * @var integer|string maxfiles Maximum number of files
 * @var array qidattributes The question attributes
 * @var string preview The preview flag
 */
#}
<div class="model-container clearfix">
    <div id="notice" class="text-center"></div>
    <input type="hidden" id="ia_{{ fn }}"                value="{{ fn }}" />
    <input type="hidden" id="{{ fn }}_minfiles"          value="{{ minfiles }}" />
    <input type="hidden" id="{{ fn }}_maxfiles"          value="{{ maxfiles }}" />
    <input type="hidden" id="{{ fn }}_maxfilesize"       value="{{ qidattributes.max_filesize }}" />
    <input type="hidden" id="{{ fn }}_allowed_filetypes" value="{{ qidattributes.allowed_filetypes|escape('html_attr') }}" />
    <input type="hidden" id="preview"                    value="{{ preview|escape('html_attr') }}" />
    <input type="hidden" id="{{ fn }}_show_comment"      value="{{ qidattributes.show_comment|escape('html_attr') }}" />
    <input type="hidden" id="{{ fn }}_show_title"        value="{{ qidattributes.show_title|escape('html_attr') }}" />
    <input type="hidden" id="{{ fn }}_licount"           value="0" />
    <input type="hidden" id="{{ fn }}_Cfilecount"        value="0" />

    <!-- The upload button -->
    <div class="upload-div">
        <button id="button_{{ qid }}" class="btn btn-outline-secondary" type="button" >{{ gT("Select file") }}</button>
    </div>
    <p class="alert alert-info uploadmsg">{{ sprintf(gT("You can upload %s under %s KB each."), qidattributes.allowed_filetypes|escape, qidattributes.max_filesize) }}</p>
... (4 lines truncated)
</file>

<file path="application/views/survey/questions/answer/file_upload/translations.php">
<?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
gT('Minimum number of files');
gT('The participant cannot upload a single file larger than this size');
gT('Maximum number of files');
</file>

<file path="application/views/survey/questions/answer/gender/buttons/answer.twig">
{#
/**
 * Gender question, button item Html
 *
 * @var $name
 * @var $checkconditionFunction
 * @var $fChecked
 * @var $mChecked
 * @var $naChecked
 * @var $value
 */
#}

<!--Gender question, buttons display -->
<!-- answer -->
<div class="ls-answers answers-list gender-button btn-group btn-group-justified" role="radiogroup" aria-labelledby="ls-question-text-{{ basename }}">
    <!-- Female -->

    <input type="radio" class="btn-check ls-button-radio" name="{{ name }}" id="answer{{ name }}F" value="F" {{ fChecked }}>
        <label class="btn btn-primary mb-3 answer-item ls-button-label" id="javatbd{{ name }}_CF" for="answer{{ name }}F">
        <span class="fa fa-venus ri-women-line ls-icon" aria-hidden="true"></span> {{ gT('Female') }}
    </label>

    <!-- Male -->
    <input type="radio" class="btn-check ls-button-radio" name="{{ name }}" id="answer{{ name }}M" value="M" {{ mChecked }}>
        <label class="btn btn-primary mb-3 answer-item ls-button-label" id="javatbd{{ name }}_CM" for="answer{{ name }}M">
        <span class="fa fa-mars ri-men-line ls-icon" aria-hidden="true"></span> {{ gT('Male') }}
    </label>

<!-- No answer -->
... (14 lines truncated)
</file>

<file path="application/views/survey/questions/answer/gender/radio/answer.twig">
{#
/**
 * Gender question, radio item Html
 *
 * @var $name
 * @var $checkconditionFunction
 * @var $fChecked
 * @var $mChecked
 * @var $naChecked
 * @var $value
 */
#}

<!--Gender question, radio display -->

<!-- answer -->
<ul class="ls-answers answers-list gender-button radio-list list-group list-group-horizontal" role="radiogroup" aria-labelledby="ls-question-text-{{ basename }}" >
    <!-- Female -->
    <li id='javatbd{{ name }}_CF' class="answer-item radio-item">
        <input
            type="radio"
            name="{{ name }}"
            id="answer{{ name }}F"
            value="F"
            {{ fChecked }}
        />
        <label for="answer{{ name }}F" class="control-label radio-label">
            {{ gT('Female') }}
        </label>
    </li>
... (36 lines truncated)
</file>

<file path="application/views/survey/questions/answer/gender/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>gender</name>
        <type>question_theme</type>
        <title>Gender</title>
        <creationDate>09/08/2018</creationDate>
        <author>LimeSurvey GmbH</author>
        <authorEmail>info@limesurvey.org</authorEmail>
        <authorUrl>http://www.limesurvey.org</authorUrl>
        <copyright>Copyright (C) 2005 - 2018 LimeSurvey Gmbh, Inc. All rights reserved.</copyright>
        <license>GNU General Public License version 2 or later</license>
        <version>1.0</version>
        <apiVersion>1</apiVersion>
        <description>Gender question type configuration</description>
        <questionType>G</questionType>
        <group>Mask questions</group>
        <subquestions>0</subquestions>
        <answerscales>0</answerscales>
        <hasdefaultvalues>1</hasdefaultvalues>
        <assessable>0</assessable>
        <class>gender</class>
    </metadata>
    <compatibility>
        <version>4.0</version>
        <version>5.0</version>
        <version>6.0</version>
        <version>7.0</version>
    </compatibility>
    <files>
... (274 lines truncated)
</file>

<file path="application/views/survey/questions/answer/global/table/cell/head_header.twig">
{#
/**
 * Array header : answer or sub question
 * @var $class
 * @var $content
 */
#}

<!-- thead -->
<th class="{{ class }}">
    {{ processString(content) }}
</th>
<!-- end of thead -->
</file>

<file path="application/views/survey/questions/answer/global/table/cell/head_information.twig">
{#
/**
 * Array header : informationnal item
 * @var $class
 * @var $content
 */
#}

<!-- thead -->
<td class="{{ class }}">{{ processString(content) }}</td>
<!-- end of thead -->
</file>

<file path="application/views/survey/questions/answer/hugefreetext/answer.twig">
{# 
/**
 * Lon free text question, item Html
 *
 * @var extraclass
 * @var name
 * @var drows
 * @var tiwidth
 * @var maxlength
 * @var checkconditionFunction
 * @var dispVal
 * @var placeholder
 */
 #}
<!-- Long free text -->

<!-- answer -->
{% if withColumn %}
<div class='{{ coreClass }} row'>
    <div class="{{ extraclass }}">
{% else %}
<div class='{{ coreClass }} {{ extraclass }}'>
{%  endif %}
    <textarea
        class="form-control"
        name="{{ name }}"
        id="answer{{ name }}"
        placeholder="{{ flatString(processString(placeholder,1),1) }}"
        rows="{{ drows }}"
        {% if inputsize %} cols="{{ inputsize }}" {% endif %}
... (12 lines truncated)
</file>

<file path="application/views/survey/questions/answer/hugefreetext/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>hugefreetext</name>
        <type>question_theme</type>
        <title>Huge free text</title>
        <creationDate>28/08/2019</creationDate>
        <author>LimeSurvey GmbH</author>
        <authorEmail>info@limesurvey.org</authorEmail>
        <authorUrl>http://www.limesurvey.org</authorUrl>
        <copyright>Copyright (C) 2005 - 2018 LimeSurvey Gmbh, Inc. All rights reserved.</copyright>
        <license>GNU General Public License version 2 or later</license>
        <version>1.0</version>
        <apiVersion>1</apiVersion>
        <description>Huge free text question type configuration</description>
        <questionType>U</questionType>
        <group>Text questions</group>
        <subquestions>0</subquestions>
        <answerscales>0</answerscales>
        <hasdefaultvalues>1</hasdefaultvalues>
        <assessable>0</assessable>
        <class>text-huge</class>
    </metadata>
    <compatibility>
        <version>4.0</version>
        <version>5.0</version>
        <version>6.0</version>
        <version>7.0</version>
    </compatibility>
    <files>
... (556 lines truncated)
</file>

<file path="application/views/survey/questions/answer/language/answer.twig">
{#
/**
 * Language HTML
 * @var $name
 * @var $checkconditionFunction
 * @var $answerlangs
 * @var $sLang
 */
#}
<!-- Language -->

<!-- answer -->
<div class='row row-cols-lg-auto g-1 align-items-center'>
    <div class="{{ coreClass }} mb-3 col-3">
        <label for='answer{{ name }}' class='visually-hidden control-label'>
            {{ gT('Choose your language') }}
        </label>

        <select
            name="{{ name }}"
            id="answer{{ name }}"
            class="languagesurvey form-control form-select"
            aria-describedby="ls-question-text-{{ name }}"
        >
            {% for ansrow in answerlangs %}
                <option value="{{ ansrow }}" {% if sLang == ansrow %} SELECTED {% endif %}>
                    {% set aLanguage=getLanguageNameFromCode(ansrow, true) %}
                    {{ aLanguage[1] }}
                </option>
            {% endfor %}
... (13 lines truncated)
</file>

<file path="application/views/survey/questions/answer/language/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>language</name>
        <type>question_theme</type>
        <title>Language switch</title>
        <creationDate>09/08/2018</creationDate>
        <author>LimeSurvey GmbH</author>
        <authorEmail>info@limesurvey.org</authorEmail>
        <authorUrl>http://www.limesurvey.org</authorUrl>
        <copyright>Copyright (C) 2005 - 2018 LimeSurvey Gmbh, Inc. All rights reserved.</copyright>
        <license>GNU General Public License version 2 or later</license>
        <version>1.0</version>
        <apiVersion>1</apiVersion>
        <description>Language switch question type configuration</description>
        <questionType>I</questionType>
        <group>Mask questions</group>
        <subquestions>0</subquestions>
        <answerscales>0</answerscales>
        <hasdefaultvalues>0</hasdefaultvalues>
        <assessable>0</assessable>
        <class>language</class>
    </metadata>
    <compatibility>
        <version>4.0</version>
        <version>5.0</version>
        <version>6.0</version>
        <version>7.0</version>
    </compatibility>
    <files>
... (161 lines truncated)
</file>

<file path="application/views/survey/questions/answer/list_dropdown/rows/optgroup.twig">
{#
/**
 * List DropDown Option group header Html
 * @var $sOptGroupOptions   the current options for this group, generated with the view rows/options.php
 *
 * @var $categoryname
 */
#}

<!-- optgroup -->
<optgroup class="dropdowncategory" label="{{ flattenText(categoryname) }}">
        {# rows/option.php #}
        {{ sOptGroupOptions }}
</optgroup>
<!-- end of optgroup -->
</file>

<file path="application/views/survey/questions/answer/list_dropdown/rows/option.twig">
{#
/**
 * List DropDown Option Html
 * @var $value          $ansrow['code'];
 * @var $opt_select
 * @var $answer         flattenText($_prefix.$ansrow['answer'])."
 * @var $classes
 */
#}

<!-- option -->
<option value='{{ value }}' {{ opt_select }} {% if classes is not empty %} class="{{ classes }}" {% endif %} >
    {{ flatString(processString(answer,1),1) }}
</option>
<!-- end of option -->
</file>

<file path="application/views/survey/questions/answer/list_dropdown/rows/othertext.twig">
{#
/**
 * List DropDown, Other Option
 *
 * @var $name           $ia[1]
 * @var $display
 * @var $value
 * @var $checkconditionFunction
 */
#}
<div class="col-auto">
    <label for="othertext{{ name }}" class="visually-hidden">
        {{ processString(label) }}
    </label>
</div>
<div class="text-item other-text-item col-auto">
{{ C.Html.textField(name~"_Cother",value,({
    'id' : "othertext"~name,
    'class':"form-control",
    'aria-labelledby' : "answer"~name~"-oth-",
}))
}}
</div>
<script>
if( $("#answer{{ name }}").val() != "-oth-" ){
    $("#othertext{{ name }}").hide();
}
$(document).on("change","#answer{{ name }}", function(){
    if($("#answer{{ name }}").val() != "-oth-"){
        $("#othertext{{ name }}").hide();
... (9 lines truncated)
</file>

<file path="application/views/survey/questions/answer/list_dropdown/answer.twig">
{#
/**
 * List DropDown select Html
 *
 * @var $sOptions         : the select options, generated with the view item_options.php
 * @var $sOther           : the other input field, generated with the view item_noanswer.php
 *
 * @var $name
 * @var $dropdownSize
 * @var $checkconditionFunction
 * @var $select_show_hide
 *
 */
#}

<!-- List Dropdown -->

<!-- answer-->
<div class="mb-3 row g-1 align-items-center {{ coreClass }}">
    <div class="col-auto">
        <select
                class="form-select form-control list-question-select"
                name="{{ name }}"
                id="answer{{ name }}"
                {% if dropdownSize %} size={{ dropdownSize }} {% endif %}
                aria-labelledby="ls-question-text-{{ basename }}"
        >
                {# rows/option.php #}
                {{ sOptions }}
        </select>
... (13 lines truncated)
</file>

<file path="application/views/survey/questions/answer/list_dropdown/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>list_dropdown</name>
        <type>question_theme</type>
        <title>List (Dropdown)</title>
        <creationDate>09/08/2018</creationDate>
        <author>LimeSurvey GmbH</author>
        <authorEmail>info@limesurvey.org</authorEmail>
        <authorUrl>http://www.limesurvey.org</authorUrl>
        <copyright>Copyright (C) 2005 - 2018 LimeSurvey Gmbh, Inc. All rights reserved.</copyright>
        <license>GNU General Public License version 2 or later</license>
        <version>1.0</version>
        <apiVersion>1</apiVersion>
        <description>List (dropdown) question type configuration</description>
        <questionType>!</questionType>
        <group>Single choice questions</group>
        <subquestions>0</subquestions>
        <other>1</other>
        <answerscales>1</answerscales>
        <hasdefaultvalues>1</hasdefaultvalues>
        <assessable>1</assessable>
        <class>list-dropdown</class>
    </metadata>
    <compatibility>
        <version>4.0</version>
        <version>5.0</version>
        <version>6.0</version>
        <version>7.0</version>
    </compatibility>
... (689 lines truncated)
</file>

<file path="application/views/survey/questions/answer/list_dropdown/translations.php">
<?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
gT('Semicolon-separated list of answer codes that keep their original database position when answers are randomized');
gT('Order - like 3)');
gT("Position for 'Other:' option");
gT("Indicates where the 'Other' option should be placed");
gT('After specific answer option');
gT("Before 'No Answer'");
gT("Answer code for 'After specific answer option'");
gT("The code of the answer option after which the 'Other:' option will be placed if the position is set to 'After specific answer option'");
</file>

<file path="application/views/survey/questions/answer/list_with_comment/dropdown/rows/option.twig">
{#
/**
 * List with comment, dropdown style, item Html
 * @var $value          $ansrow['code']
 * @var $check_ans      $check_ans
 * @var $option_text    $ansrow['answer']
 * @var $classes
 */
#}
    <option class="{% if classes is not empty %} {{ classes }}  {% endif %}" value="{{ value }}" {{ check_ans }}>
        {{ flatString(processString(option_text,1),1) }}
    </option>
</file>

<file path="application/views/survey/questions/answer/list_with_comment/dropdown/answer.twig">
{#
/**
 * List with comment, dropdown layout, Html
 *
 * @var $sOptions         : the select options, generated with the view rows/option.php
 *
 * @var $name
 * @var $id
 * @var $checkconditionFunction
 * @var $show_noanswer
 * @var $label_text
 * @var $tarows
 * @var $maxoptionsize
 * @var $has_comment_saved
 * @var $comment_saved      htmlspecialchars( $_SESSION['responses_'.Yii::app()->getConfig('surveyID')][$fname2])
 * @var $value     $_SESSION['responses_'.Yii::app()->getConfig('surveyID')][$ia[1]] /// SHOULD BE CALL VALUE
 * @var sgq : basename for input
 * @todo : control if dropdown need labelledby or if labelledby in group is OK. Think automatic system return needed ...
 */
#}

<div class="ls-answers row" role="group" aria-labelledby="ls-question-text-{{ basename }}">

    <div class="answer-item  col-md-6 col-12">
        <!-- This need a label :/ -->
        <select
            class="form-select select form-control list-question-select"
            name="{{ name }}"
            id="{{ id }}"
        >
... (27 lines truncated)
</file>

<file path="application/views/survey/questions/answer/list_with_comment/list/rows/answer_row.twig">
{#
/**
 * List with comment, list layout, Html
 *
 * @var $name
 * @var $id
 * @var $aid
 * @var $value
 * @var $check_ans
 * @var $checkconditionFunction
 * @var $labeltext
 * @var $li_classes
 */
#}
<!-- answer_row -->
<li id='javatbd{{ name }}_S{{ aid }}' class="{{ li_classes }}">
    <input
        type="radio"
        name="{{ name }}"
        id="{{ id }}"
        value="{{ value }}"
        {{ check_ans }}
        onclick="{{ checkconditionFunction }}"
    />
    <label for="{{ id }}" class="radio-label control-label">{{ processString(labeltext) }}</label>
</li>
<!-- end of answer_row -->
</file>

<file path="application/views/survey/questions/answer/list_with_comment/list/answer.twig">
{#
/**
 * List with comment, list style, Html
 *
 * @var $sRows         : the list of radio, generated with the view answer_row.php
 *
 * @var $id
 * @var $hint_comment
 * @var $name
 * @var $tarows
 * @var $has_comment_saved
 * @var $comment_saved
 * @var $java_name
 * @var $java_id
 * @var $java_value
 */
#}
<!-- List with comment, list style, -->

<!-- answer -->
<div class="{{ coreClass }} row" role="group" aria-labelledby="ls-question-text-{{ basename }}">
    <div class="answers-list radio-list col-md-6 col-12">
        <ul class="list-unstyled" role="radiogroup">
                {# rows/row.php #}
                {{ sRows }}
        </ul>
        {# Value for expression manager javascript (use id) ; no need to submit #}
        {{ C.Html.hiddenField(java_name,java_value,({
            'id' : java_id,
            'disabled' : true,
... (20 lines truncated)
</file>

<file path="application/views/survey/questions/answer/list_with_comment/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>list_with_comment</name>
        <type>question_theme</type>
        <title>List with comment</title>
        <creationDate>09/08/2018</creationDate>
        <author>LimeSurvey GmbH</author>
        <authorEmail>info@limesurvey.org</authorEmail>
        <authorUrl>http://www.limesurvey.org</authorUrl>
        <copyright>Copyright (C) 2005 - 2018 LimeSurvey Gmbh, Inc. All rights reserved.</copyright>
        <license>GNU General Public License version 2 or later</license>
        <version>1.0</version>
        <apiVersion>1</apiVersion>
        <description>List with comment question type configuration</description>
        <questionType>O</questionType>
        <group>Single choice questions</group>
        <subquestions>0</subquestions>
        <answerscales>1</answerscales>
        <hasdefaultvalues>1</hasdefaultvalues>
        <assessable>1</assessable>
        <class>list-with-comment</class>
    </metadata>
    <compatibility>
        <version>4.0</version>
        <version>5.0</version>
        <version>6.0</version>
        <version>7.0</version>
    </compatibility>
    <files>
... (343 lines truncated)
</file>

<file path="application/views/survey/questions/answer/list_with_comment/translations.php">
<?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
gT('Semicolon-separated list of answer codes that keep their original database position when answers are randomized');
</file>

<file path="application/views/survey/questions/answer/listradio/columns/column_footer.twig">
{# @deprecated 5.X.Y #}
</file>

<file path="application/views/survey/questions/answer/listradio/columns/column_header.twig">
{# @deprecated 6.0.1 #}
</file>

<file path="application/views/survey/questions/answer/listradio/rows/answer_row_noanswer.twig">
{#
/**
 * List radio Html : item 'no answer' row
 *
 * @var $name   $ia[1]
 * @var $check_ans
 * @var $checkconditionFunction
 */
#}

<!-- answer_row_noanswer -->
<li id='javatbd{{ name }}' class="mb-3 answer-item radio-item no-anwser-item">
    <input
    type="radio"
    name="{{ name }}"
    id="answer{{ name }}"
    value=""
    {{ check_ans }}
    aria-labelledby="ls-question-text-{{ name }} answer-label-{{ name }}-noanswer"
    onclick="if (document.getElementById('answer{{ name }}othertext') != null) document.getElementById('answer{{ name }}othertext').value='';{{ checkconditionFunction }}(this.value, this.name, this.type)"
    />
    <label id="answer-label-{{ name }}-noanswer" for="answer{{ name }}" class="control-label radio-label">
        {{ gT('No answer') }}
    </label>
</li>
<!-- endof answer_row_noanswer -->
</file>

<file path="application/views/survey/questions/answer/listradio/rows/answer_row_other.twig">
{#
/**
 * List radio Html : item 'other' row
 *
 * @var $name
 * @var $answer_other
 * @var $sDisplayStyle
 * @var $sDisable
 * @var $myfname
 * @var $othertext
 * @var $otherTextRight
 * @var $otherItemExtraClass
 * @var $checkedState
 * @var $sValue
 * @var $checkconditionFunction
 * @var $otherInputSize
 * @var $otherMaxLength
 */
#}

<!-- answer_row_other -->
<li id='javatbd{{ myfname }}' class='row answer-item radio-text-item radio-item d-flex {{ otherItemExtraClass }}' role='group' {{ sDisplayStyle }} >
        <!-- Checkbox + label -->
        <div class="othertext-label-checkox-container  col-auto">
            <input
            type="radio"
            value="-oth-"
            name="{{ name }}"
            id="SOTH{{ name }}"
            {{ checkedState }}
... (39 lines truncated)
</file>

<file path="application/views/survey/questions/answer/listradio/rows/answer_row.twig">
{#
/**
 * Multiple Choice Html : item row
 *
 * @var $name
 * @var $code
 * @var $answer
 * @var $checkedState
 * @var $myfname
 */
#}

<!-- answer_row -->
<li id='javatbd{{ myfname }}' class='answer-item radio-item' {{ sDisplayStyle }} >
    <input
        type="radio"
        value="{{ code }}"
        name="{{ name }}"
        id="answer{{ name }}{{ code }}"
        {{ checkedState }}
        aria-labelledby="ls-question-text-{{ name }} answer-label-{{ name }}{{ code }}"
        onclick="if (document.getElementById('answer{{ name }}othertext') != null) document.getElementById('answer{{ name }}othertext').value='';checkconditions(this.value, this.name, this.type)"
     />
    <label id="answer-label-{{ name }}{{ code }}" for="answer{{ name }}{{ code }}" class="control-label radio-label">
        {{ processString(answer) }}
    </label>
</li>
<!-- end of answer_row -->
</file>

<file path="application/views/survey/questions/answer/listradio/answer.twig">
{#
/**
 * List Radio Html
 *
 * @var $name
 * @var $value
 */
#}

<!-- List Radio -->

<!-- answer -->
{{ sTimer }}
<ul class="{{ coreClass }} list-unstyled {% if iNbCols > 1 %} ls-column-count-{{iNbCols}}{% endif %}" role="radiogroup" aria-labelledby="ls-question-text-{{ name }}"{% if iNbCols > 1 %} data-column-count={{iNbCols}}{% endif %}>
    {# rows/answer_row.php #}
    {{ sRows }}
</ul>
{# Value for expression manager javascript (use id) ; no need to submit #}
{{ C.Html.hiddenField("java"~name,value,({
    'id' : "java"~name,
    'disabled' : true,
}))
}}
<!-- end of answer -->
</file>

<file path="application/views/survey/questions/answer/listradio/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>listradio</name>
        <type>question_theme</type>
        <title>List (Radio)</title>
        <creationDate>09/08/2018</creationDate>
        <author>LimeSurvey GmbH</author>
        <authorEmail>info@limesurvey.org</authorEmail>
        <authorUrl>http://www.limesurvey.org</authorUrl>
        <copyright>Copyright (C) 2005 - 2018 LimeSurvey Gmbh, Inc. All rights reserved.</copyright>
        <license>GNU General Public License version 2 or later</license>
        <version>1.0</version>
        <apiVersion>1</apiVersion>
        <description>List (radio) question type configuration</description>
        <questionType>L</questionType>
        <group>Single choice questions</group>
        <subquestions>0</subquestions>
        <other>1</other>
        <answerscales>1</answerscales>
        <hasdefaultvalues>1</hasdefaultvalues>
        <assessable>1</assessable>
        <class>list-radio</class>
    </metadata>
    <compatibility>
        <version>4.0</version>
        <version>5.0</version>
        <version>6.0</version>
        <version>7.0</version>
    </compatibility>
... (751 lines truncated)
</file>

<file path="application/views/survey/questions/answer/listradio/translations.php">
<?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
gT('Semicolon-separated list of answer codes that keep their original database position when answers are randomized');
gT("Set the size of the 'Other:' input. The input will be displayed approximately this size in width.");
gT("'Other:' text input box size");
gT("Maximum characters allowed for 'Other:' option");
gT("'Other:' option maximum characters");
gT('The answer options will be distributed across the number of columns set here. Any number up from 1 can be entered, but we only support systems up to 16.');
gT("Position for 'Other:' option");
gT("Indicates where the 'Other' option should be placed");
gT('After specific answer option');
gT("Before 'No Answer'");
gT("Answer code for 'After specific answer option'");
gT("The code of the answer option after which the 'Other:' option will be placed if the position is set to 'After specific answer option'");
</file>

<file path="application/views/survey/questions/answer/longfreetext/answer.twig">
{# 
/**
 * Lon free text question, item Html
 *
 * @var extraclass
 * @var name
 * @var drows
 * @var tiwidth
 * @var maxlength
 * @var checkconditionFunction
 * @var dispVal
 * @var placeholder
 */
 #}
<!-- Long free text -->

<!-- answer -->
{% if withColumn %}
<div class='{{ coreClass }} row'>
    <div class="{{ extraclass }}">
{% else %}
<div class='{{ coreClass }} {{ extraclass }}'>
{%  endif %}
    <textarea
        class="form-control"
        name="{{ name }}"
        id="answer{{ name }}"
        placeholder="{{ flatString(processString(placeholder,1),1) }}"
        rows="{{ drows }}"
        {% if inputsize %} cols="{{ inputsize }}" {% endif %}
... (12 lines truncated)
</file>

<file path="application/views/survey/questions/answer/longfreetext/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>longfreetext</name>
        <type>question_theme</type>
        <title>Long free text</title>
        <creationDate>09/08/2018</creationDate>
        <author>LimeSurvey GmbH</author>
        <authorEmail>info@limesurvey.org</authorEmail>
        <authorUrl>http://www.limesurvey.org</authorUrl>
        <copyright>Copyright (C) 2005 - 2018 LimeSurvey Gmbh, Inc. All rights reserved.</copyright>
        <license>GNU General Public License version 2 or later</license>
        <version>1.0</version>
        <apiVersion>1</apiVersion>
        <description>Long free text question type configuration</description>
        <questionType>T</questionType>
        <group>Text questions</group>
        <subquestions>0</subquestions>
        <answerscales>0</answerscales>
        <hasdefaultvalues>1</hasdefaultvalues>
        <assessable>0</assessable>
        <class>text-long</class>
    </metadata>
    <compatibility>
        <version>4.0</version>
        <version>5.0</version>
        <version>6.0</version>
        <version>7.0</version>
    </compatibility>
    <files>
... (556 lines truncated)
</file>

<file path="application/views/survey/questions/answer/multiplechoice/rows/answer_row_other.twig">
{#
/**
 * Multiple Choice Html : item 'other' row
 *
 * @var $sDisable
 * @var $myfname
 * @var $othertext
 * @var $othertextRight
 * @var $otherItemExtraClass
 * @var $checkedState
 * @var $sValue
 * @var $oth_checkconditionFunction
 * @var $checkconditionFunction
 * @var $sValueHidden
 * @var $wrapper
 * @var $otherInputSize
 * @var $otherMaxLength
 */
#}

<!-- answer_row_other -->
<li id='javatbd{{ myfname }}' class='question-item answer-item checkbox-text-item {{ relevanceClass }} {{ otherItemExtraClass }}'>
    <div class="row">
        <div class="col-auto d-flex">
            <!-- Checkbox + label -->
            <div class="checkbox-item othertext-label-checkox-container">
                <!-- checkbox -->
                <input
                    class="other-checkbox"
                    type="checkbox"
... (72 lines truncated)
</file>

<file path="application/views/survey/questions/answer/multiplechoice/rows/answer_row.twig">
{#

!!!! BECAREFUL: ONLY FOR TESTING !!!!!
!!!! DON'T START TO TRANSLATE ALL VIEWS BASED ON THIS MODEL !!!!!

!!!! IT WILL PROBABLY FIRST NEED TO CHANGE  THE TWIG TEMPLATE SYNTAX TO AVOID CONFLICT WITH EXPRESSION MANAGER !!!!

/**
 * Multiple Choice Html : item row
 *
 * @var hiddenfield
 * @var name
 * @var title
 * @var question
 * @var checkedState
 * @var sCheckconditionFunction
 * @var myfname
 * @var sValue
 */
#}
<!-- answer_row -->
<li id='javatbd{{ myfname }}' class='question-item answer-item checkbox-item {{ relevanceClass }}'>
    <div class="row">
        <div class="col-auto">
            <input
                type="checkbox"
                name="{{ myfname }}"
                id="answer{{ myfname }}"
                {{ checkedState }}
                value="Y"
... (13 lines truncated)
</file>

<file path="application/views/survey/questions/answer/multiplechoice/answer.twig">
{# 
/**
 * Multiple Choice question item Html
 *
 * @var $sRows      : the rows, generated with the views rows/answer_row*.php
 *
 * @var $name
 * @var $anscount
 * @var $othertext
 */
 #}
<!-- Multiple Choice -->

<!-- answer -->
<input type="hidden" name="MULTI{{name}}" value="{{anscount}}" />
<ul class="list-unstyled {{coreClass}} {% if iNbCols > 1 %} ls-column-count-{{iNbCols}}{% endif %}"{% if iNbCols > 1 %} data-column-count={{iNbCols}}{% endif %}>
    {% for aRow in aRows %}
        {% set rowTemplate = aRow.other ? './survey/questions/answer/multiplechoice/rows/answer_row_other.twig' : './survey/questions/answer/multiplechoice/rows/answer_row.twig' %}
        <!-- Row {{loop.index}} -->
        {% include rowTemplate with aRow %}
    {% endfor %}
</ul>
</file>

<file path="application/views/survey/questions/answer/multiplechoice/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>multiplechoice</name>
        <type>question_theme</type>
        <title>Multiple choice</title>
        <creationDate>09/08/2018</creationDate>
        <author>LimeSurvey GmbH</author>
        <authorEmail>info@limesurvey.org</authorEmail>
        <authorUrl>http://www.limesurvey.org</authorUrl>
        <copyright>Copyright (C) 2005 - 2018 LimeSurvey Gmbh, Inc. All rights reserved.</copyright>
        <license>GNU General Public License version 2 or later</license>
        <version>1.0</version>
        <apiVersion>1</apiVersion>
        <description>Multiple choice question type configuration</description>
        <questionType>M</questionType>
        <group>Multiple choice questions</group>
        <subquestions>1</subquestions>
        <other>1</other>
        <answerscales>0</answerscales>
        <hasdefaultvalues>1</hasdefaultvalues>
        <assessable>1</assessable>
        <class>multiple-opt</class>
    </metadata>
    <compatibility>
        <version>4.0</version>
        <version>5.0</version>
        <version>6.0</version>
        <version>7.0</version>
    </compatibility>
... (555 lines truncated)
</file>

<file path="application/views/survey/questions/answer/multiplechoice/translations.php">
<?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
gT("Set the size of the 'Other:' input. The input will be displayed approximately this size in width.");
gT("'Other:' text input box size");
gT("Maximum characters allowed for 'Other:' option");
gT("'Other:' option maximum characters");
gT('Semicolon-separated list of subquestion codes that keep their original database position when subquestions are randomized');
gT('The answer options will be distributed across the number of columns set here. Any number up from 1 can be entered, but we only support systems up to 16.');
gT("Position for 'Other:' option");
gT("Indicates where the 'Other' option should be placed");
gT('After specific subquestion');
gT("Subquestion title for 'After specific subquestion'");
gT("The title of the subquestion after which the 'Other:' option will be placed if the position is set to 'After specific subquestion'");
</file>

<file path="application/views/survey/questions/answer/multiplechoice_with_comments/rows/answer_row_other.twig">
{#
/**
 * Multiple choice with comments question, item Html
 * @var $liclasses
 * @var $liid
 * @var $title
 * @var $sDisplayStyle
 * @var $name                       $myfname
 * @var $id                         answer$myfname
 * @var $value                       Y
 * @var $classes                    ''
 * @var $checked                    ''
 * @var $checkconditionFunction     $checkconditionFunction(this.value, this.name, this.type);
 * @var $checkconditionFunctionComment
 * @var $labeltext                  $ansrow['question']
 * @var $javaname                   java$myfname
 * @var $javavalue                  ''
 * @var $checked                    if (isset($_SESSION['responses_'.Yii::app()->getConfig('surveyID')][$myfname]))  ...
 * @var $inputCommentId             'answer'.$myfname2
 * @var $commentLabelText           gT('Make a comment on your choice here:') }}
 * @var $inputCommentName           $myfname2
 * @var $inputCOmmentValue          if (isset($_SESSION['responses_'.Yii::app()->getConfig('surveyID')][$myfname2])) {$answer_main .= htmlspecialchars($_SESSION['responses_'.Yii::app()->getConfig('surveyID')][$myfname2],ENT_QUOTES);}
 * @var $otherInputSize
 * @var $otherMaxLength
 */
#}
<!-- answer_row -->
<li id="javatbd{{ name }}" class='checkbox-text-item mb-1 other-item clearfix {{ otherItemExtraClass }}'>
    <div class="row multipleco-other-row">
        <div class="col-md-{{ sLabelWidth }} col-12 multipleco-other-label-col">
... (46 lines truncated)
</file>

<file path="application/views/survey/questions/answer/multiplechoice_with_comments/rows/answer_row.twig">
{#
/**
 * Multiple choice with comments question, item Html
 * @var $liclasses
 * @var $liid
 * @var $title
 * @var $sDisplayStyle
 * @var $name                       $myfname
 * @var $id                         answer$myfname
 * @var $value                       Y
 * @var $classes                    ''
 * @var $checked                    ''
 * @var $checkconditionFunction     $checkconditionFunction(this.value, this.name, this.type);
 * @var $checkconditionFunctionComment
 * @var $labeltext                  $ansrow['question']
 * @var $javaname                   java$myfname
 * @var $javavalue                  ''
 * @var $checked                    if (isset($_SESSION['responses_'.Yii::app()->getConfig('surveyID')][$myfname]))  ...
 * @var $inputCommentId             'answer'.$myfname2
 * @var $commentLabelText           gT('Make a comment on your choice here:') }}
 * @var $inputCommentName           $myfname2
 * @var $inputCOmmentValue          if (isset($_SESSION['responses_'.Yii::app()->getConfig('surveyID')][$myfname2])) {$answer_main .= htmlspecialchars($_SESSION['responses_'.Yii::app()->getConfig('surveyID')][$myfname2],ENT_QUOTES);}
 */
#}
<!-- answer_row -->
<li id="javatbd{{ name }}" class='checkbox-text-item mb-1' role='group'>
    <!-- Checkbox + label -->
    <div class="row">
        <div class="col-md-{{ sLabelWidth }} col-12 form-check mb-2">
            <div class="checkbox-item answer-item">
... (35 lines truncated)
</file>

<file path="application/views/survey/questions/answer/multiplechoice_with_comments/answer.twig">
{#
/**
 * Multiple Choice with Comment question item Html
 *
 * @var $sRows      : the rows, generated with the views rows/answer_row.php
 *
 * @var $name
 * @var $value
 */
#}
<!-- Multiple Choice with comment-->

<!-- answer -->
<input type='hidden' name='{{ name }}' value='{{ value }}' />
<ul class="{{ coreClass }} list-unstyled" role="group" aria-labelledby="ls-question-text-{{ basename }}">
        {% for aRow in aRows %}
                {% set rowTemplate = aRow.other ? './survey/questions/answer/multiplechoice_with_comments/rows/answer_row_other.twig' : './survey/questions/answer/multiplechoice_with_comments/rows/answer_row.twig' %}
                {% include rowTemplate with aRow %}
        {% endfor %}
</ul>
<!-- end of answer -->
</file>

<file path="application/views/survey/questions/answer/multiplechoice_with_comments/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>multiplechoice_with_comments</name>
        <type>question_theme</type>
        <title>Multiple choice with comments</title>
        <creationDate>09/08/2018</creationDate>
        <author>LimeSurvey GmbH</author>
        <authorEmail>info@limesurvey.org</authorEmail>
        <authorUrl>http://www.limesurvey.org</authorUrl>
        <copyright>Copyright (C) 2005 - 2018 LimeSurvey Gmbh, Inc. All rights reserved.</copyright>
        <license>GNU General Public License version 2 or later</license>
        <version>1.0</version>
        <apiVersion>1</apiVersion>
        <description>Multiple choice with comments question type configuration</description>
        <questionType>P</questionType>
        <group>Multiple choice questions</group>
        <subquestions>1</subquestions>
        <other>1</other>
        <answerscales>0</answerscales>
        <hasdefaultvalues>1</hasdefaultvalues>
        <assessable>1</assessable>
        <class>multiple-opt-comments</class>
    </metadata>
    <compatibility>
        <version>4.0</version>
        <version>5.0</version>
        <version>6.0</version>
        <version>7.0</version>
    </compatibility>
... (748 lines truncated)
</file>

<file path="application/views/survey/questions/answer/multiplechoice_with_comments/translations.php">
<?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
gT("Set the size of the 'Other:' input. The input will be displayed approximately this size in width.");
gT("'Other:' text input box size");
gT("Maximum characters allowed for 'Other:' option");
gT("'Other:' option maximum characters");
gT('Semicolon-separated list of subquestion codes that keep their original database position when subquestions are randomized');
gT('Use JavaScript function to remove text and uncheck checkbox (or use ExpressionScript Engine only).');
gT("Position for 'Other:' option");
gT("Indicates where the 'Other' option should be placed");
gT('After specific subquestion');
gT("Subquestion title for 'After specific subquestion'");
gT("The title of the subquestion after which the 'Other:' option will be placed if the position is set to 'After specific subquestion'");
</file>

<file path="application/views/survey/questions/answer/multiplenumeric/rows/input/answer_row.twig">
{# /**
 * Multiple short texts question, item input text Html
 * @var $tip
 * @var $alert
 * @var $maxlength
 * @var $tiwidth
 * @var $extraclass
 * @var $sDisplayStyle
 * @var $prefix
 * @var $myfname
 * @var $labelText
 * @var $suffix
 * @var $rows
 * @var $checkconditionFunction
 * @var $dispVal
 */ #}

<!-- answer_row -->

<li id='javatbd{{ myfname }}' class="question-item answer-item numeric-item align-items-center text-item row mb-3{{ extraclass }}{% if alert %} ls-error-mandatory has-error {% endif %}" {{ sDisplayStyle }}>
    <!--  color code missing mandatory questions red -->
    <label class="control-label col-12 col-md-{{ sLabelWidth }}{% if sLabelWidth == 0 %} d-none{% endif %}" for="answer{{myfname}}">
        {{ processString(labelText) }}
    </label>

    <div class="col-12 col-md-{{ sInputContainerWidth }}">
        {% if prefix or suffix %}
            <div class="ls-input-group">
        {% endif %}
            {% if prefix %}
... (26 lines truncated)
</file>

<file path="application/views/survey/questions/answer/multiplenumeric/rows/sliders/answer_row.twig">
{#
/**
 * Multiple short texts question, item input text Html
 * @var $tip
 * @var $alert
 * @var $maxlength
 * @var $tiwidth
 * @var $extraclass
 * @var $sDisplayStyle
 * @var $prefix
 * @var $myfname
 * @var $labelText
 * @var $prefix
 * @var $rows
 * @var $checkconditionFunction
 * @var $dispVal
 * @var $suffix
 * @var $sUnformattedValue
 * @var $slider_min
 * @var $slider_max
 * @var $slider_step
 * @var $slider_default
 * @var $slider_orientation
 * @var $slider_handle
 * @var $slider_reset
 * @var $slider_reversed
 * @var $sSeparator
 */
#}

... (53 lines truncated)
</file>

<file path="application/views/survey/questions/answer/multiplenumeric/rows/sliders/horizontal_slider.twig">
<div class="row ls-slider-answer-row">
    <div class="col-12 col-md-auto flex-grow-1">
        <div class="row">
            {% if slider_showminmax %}
                <div class='col-6 col-md-auto help-block slider-min-block'>
                    {{ slider_reversed == 'false' ? slider_min : slider_max }}
                </div>
            {% endif %}
            <div role="none" class="slider-container slider-{{ slider_orientation }} ls-input-group col-8 col-md-8 flex-grow-1" id="answer{{ myfname }}slid-container">
                {{ C.Html.textField( myfname ~ 'slid', dispVal ,{
                    'class': 'form-control answer-item numeric-item d-none',
                    'id' : "answer" ~ myfname ~ "slid",
                }) }}
                {{ C.Html.textField( myfname, dispVal ,{
                    'class': 'form-control answer-item numeric-item ls-js-hidden slider-untouched',
                    'id' : "answer" ~ myfname,
                    'aria-labelledby' : 'label-' ~ myfname
                }) }}
            </div>
            {% if slider_showminmax %}
                <div class='col-6 col-md-auto help-block slider-max-block'>
                    {{ slider_reversed == 'false' ? slider_max : slider_min }}
                </div>
            {% endif %}
            {% if sliderleft is not empty %}
                <div class='col-6 slider-left'>
                    {{ processString(sliderleft) }}
                </div>
            {% endif %}
            {% if sliderright is not empty %}
... (15 lines truncated)
</file>

<file path="application/views/survey/questions/answer/multiplenumeric/rows/sliders/vertical_slider.twig">
<div class="row ls-slider-answer-row">
    {% if sliderleft is not empty and sliderright is not empty %}
        <div class='col-auto'>
            <div class="h-100 d-flex flex-column justify-content-between">
                {% if sliderleft is not empty %}
                    <div class="slider-left">
                        {{ sliderleft }}
                    </div>
                {% endif %}
                {% if sliderright is not empty %}
                    <div class="slider-right">
                        {{ sliderright }}
                    </div>
                {% endif %}
            </div>
        </div>
    {% endif %}
    {% if slider_showminmax %}
        <div class="col-auto">
            <div class="h-100 d-flex flex-column justify-content-between">
                <div class='col-auto help-block slider-min-block'> {{ slider_reversed == 'false' ? slider_min : slider_max }}</div>
                <div class='col-auto help-block slider-max-block'> {{ slider_reversed == 'false' ? slider_max : slider_min }}</div>
            </div>
        </div>
    {% endif %}
    <div class="slider-container slider-{{ slider_orientation }} ls-input-group col-6 col-md-5 flex-grow-1" id="answer{{ myfname }}slid-container">
        {{ C.Html.textField( myfname ~ 'slid', dispVal ,{
            'class': 'form-control answer-item numeric-item d-none',
            'id' : "answer" ~ myfname ~ "slid",
        }) }}
... (16 lines truncated)
</file>

<file path="application/views/survey/questions/answer/multiplenumeric/rows/dynamic_slider.twig">
{# /**
 * Multiple numeric : dynamic row (remaining + total)
 * @var $id
 * @var $sumRemainingEqn
 * @var $sumEqn
 * @var $sLabelWidth
 * @var $sInputContainerWidth
 * @var $prefix
 * @var $suffix
 */ #}

{% if sumRemainingEqn %}
    <li class="row mb-3 ls-group-remaining">
        <div class="col-12 col-md-{{ sInputContainerWidth }} offset-md-{{ sLabelWidth }} px-md-5">
            {{ gT('Remaining') }}:
            {% if prefix %}
                <span class="prefix-text prefix"><!-- Suffix prefix are not shown inline, but only in the slider: completely different concept : set hidden -->
                    {{ processString(prefix) }}
                </span>
            {% endif %}
            <span id="remainingvalue_{{ id }}" class="form-control-static numeric dynamic-remaining" data-number="1"><!-- alternative class : form-control : display like an input:text -->
                {{ sumRemainingEqn }}
            </span>
            {% if suffix %}
                <span class="suffix-text suffix">
                   {{ processString(suffix) }}
                </span>
            {% endif %}
        </div>
    </li>
... (13 lines truncated)
</file>

<file path="application/views/survey/questions/answer/multiplenumeric/rows/dynamic.twig">
{#
/**
 * Multiple numerci : dynamic row (remaining + total)
 * @var $id
 * @var $sumRemainingEqn
 * @var $sumEqn
 * @var $sLabelWidth
 * @var $sInputContainerWidth
 * @var $prefix
 * @var $suffix
 */
#}
{% if sumRemainingEqn %}
    <li class="mb-3 ls-group-remaining ls-group-dynamic row">
        <div class="control-label col-12 col-md-{{sLabelWidth}}{% if sLabelWidth == 0 %} d-none{% endif %}">
            {{ gT('Remaining') }}:
        </div>
        <div class="ls-input-group col-12 col-md-{{sInputContainerWidth}}">
            {% if prefix %}
                <div class="ls-input-group-extra prefix-text prefix">
                    {{ processString(prefix) }}
                </div>
            {% endif %}
            <div id="remainingvalue_{{id}}" class="form-control-static numeric dynamic-remaining" data-number="1">
            <!-- alternative class : form-control : display like an input:text -->
                {{ sumRemainingEqn }}
            </div>
            {% if suffix  %}
                <div class="ls-input-group-extra suffix-text suffix">
                    {{ processString(suffix) }}
... (35 lines truncated)
</file>

<file path="application/views/survey/questions/answer/multiplenumeric/answer_input.twig">
{#/**
 * Multiple Numerical question Html for input boxes.
 *
 * @var $sRows      : the rows, generated with the views rows/answer_row.php
 *
 * @var $prefixclass
 * @var $equals_num_value
 * @var $id
 * @var $prefix
 * @var $sumRemainingEqn
 * @var $displaytotal
 * @var $sumEqn
 * @var $prefix
 */
#}
<!-- Multiple Numerical -->

<!-- answer -->
<ul class='{{coreClass}} list-unstyled  form-horizontal' role="group" aria-describedby="ls-question-text-{{basename}}">
    {% block rows %}
    {#} rows/answer_row.php #}
    {{sRows}}
    {% endblock %}

    {% block dynamic %}
        {{ include("/survey/questions/answer/multiplenumeric/rows/dynamic.twig", {
            'id' : id,
            'sumRemainingEqn' : sumRemainingEqn,
            'sumEqn' : sumEqn,
            'sLabelWidth' : sLabelWidth,
... (8 lines truncated)
</file>

<file path="application/views/survey/questions/answer/multiplenumeric/answer.twig">
{# /**
 * Multiple Numerical question Html for slider.
 *
 * @var $sRows      : the rows, generated with the views rows/answer_row.php
 *
 * @var $prefixclass
 * @var $equals_num_value
 * @var $id
 * @var $prefix
 * @var $sumRemainingEqn
 * @var $displaytotal
 * @var $sumEqn
 * @var $prefix
 */ #}

<!-- Multiple Numerical with slider -->
<!-- answer -->
<ul class='{{coreClass}} list-unstyled form-horizontal' role="group" aria-labelledby="ls-question-text-{{basename}}">
    {% block rows %}
        {% if aRows is empty %}
            {% include '/survey/questions/answer/multiplenumeric/empty.twig' %}
        {% else %}
            {% for aRow in aRows %}
                {% include rowTemplate with aRow %}
            {% endfor %}
        {% endif %}
    {% endblock %}
    {% block dynamic %}
        {{ 
            include(dynamicTemplate|default("/survey/questions/answer/multiplenumeric/rows/dynamic.twig"), 
... (14 lines truncated)
</file>

<file path="application/views/survey/questions/answer/multiplenumeric/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>multiplenumeric</name>
        <type>question_theme</type>
        <title>Multiple numerical input</title>
        <creationDate>09/08/2018</creationDate>
        <author>LimeSurvey GmbH</author>
        <authorEmail>info@limesurvey.org</authorEmail>
        <authorUrl>http://www.limesurvey.org</authorUrl>
        <copyright>Copyright (C) 2005 - 2018 LimeSurvey Gmbh, Inc. All rights reserved.</copyright>
        <license>GNU General Public License version 2 or later</license>
        <version>1.0</version>
        <apiVersion>1</apiVersion>
        <description>Multiple numerical input question type configuration</description>
        <questionType>K</questionType>
        <group>Mask questions</group>
        <subquestions>1</subquestions>
        <answerscales>0</answerscales>
        <hasdefaultvalues>1</hasdefaultvalues>
        <assessable>1</assessable>
        <class>numeric-multi</class>
    </metadata>
    <compatibility>
        <version>4.0</version>
        <version>5.0</version>
        <version>6.0</version>
        <version>7.0</version>
    </compatibility>
    <files>
... (950 lines truncated)
</file>

<file path="application/views/survey/questions/answer/multiplenumeric/empty.twig">
<!-- empty -->
<li class="alert alert-danger">
    {{ gT('Error: This question has no answers.') }}
</li>
</file>

<file path="application/views/survey/questions/answer/multiplenumeric/translations.php">
<?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
gT('Semicolon-separated list of subquestion codes that keep their original database position when subquestions are randomized');
gT('You can use Expression manager, but this must be a number before showing the page else set to 0. If minimum value is not set, this value is used.');
gT('You can use Expression manager, but this must be a number before showing the page else set to 100. If maximum value is not set, this value is used.');
gT('You can use Expression manager, but this must be a number before showing the page else set to 1.');
gT('Slider start as this value. You can use Expression manager, but this must be a number before showing the page.');
gT('Label wrapper width');
</file>

<file path="application/views/survey/questions/answer/multipleshorttext/rows/answer_row_inputtext.twig">
{#
/**
* Multiple short texts question, item input text Html

* @var $question
* @var $alert
* @var $extraclass
* @var $sDisplayStyle
* @var $myfname
* @var $tiwidth
* @var $prefix
* @var $suffix
* @var $maxlength
* @var $dispVal
* @var $checkconditionFunction
* @var $placeholder
*/
#}

<!--answer_row_inputtext -->
<li id="javatbd{{ myfname }}" class="row question-item answer-item text-item mb-3{% if alert %} ls-error-mandatory has-error{% endif %}{{ extraclass }}" {{ sDisplayStyle }} >
    <label class="control-label col-12 col-md-{{ sLabelWidth }}{% if sLabelWidth == 0 %} d-none{% endif %}" for="answer{{ myfname }}">
        {{ processString(question) }}
    </label>
    <div class="col-12 col-md-{{ sInputContainerWidth }}">

        {% if prefix != '' or suffix != '' %}
        <div class="ls-input-group">
            {% endif %}
            {% if prefix != '' %}
... (27 lines truncated)
</file>

<file path="application/views/survey/questions/answer/multipleshorttext/rows/answer_row_textarea.twig">
{#
/**
 * Multiple short texts question, item text area Html
 * @var $extraclass
 * @var $sDisplayStyle
 * @var $prefix
 * @var $myfname
 * @var $labelText                  $ansrow['question']
 * @var $prefix
 * @var $rows                       $drows.' '.$maxlength
 * @var $checkconditionFunction     $checkconditionFunction.'(this.value, this.name, this.type)'
 * @var $dispVal
 * @var $suffix
 * @var $placeholder
 */
#}
<!-- answer_row_textarea -->
<!-- Multiple short texts question, item text area Html -->
<!-- question attribute "display_rows" is set -> we need a textarea to be able to show several rows -->
<li id="javatbd{{ myfname }}" class="question-item answer-item text-item mb-3 row {% if alert %} ls-error-mandatory has-error{% endif %}{{ extraclass }}" {{ sDisplayStyle }}>
        <!--  color code missing mandatory questions red -->
        <label class="control-label col-12 col-md-{{ sLabelWidth }} {% if sLabelWidth==0 %}d-none{% endif %}" for="answer{{ myfname }}">
            {{ processString(question) }}
        </label>


    <div class="col-12 col-md-{{ sInputContainerWidth }}">
        {% if prefix != '' or suffix != '' %}
            <div class="ls-input-group">
        {% endif %}
... (27 lines truncated)
</file>

<file path="application/views/survey/questions/answer/multipleshorttext/answer.twig">
{#
/**
 * Multiple short text question Html
 *
 * @var $sRows      : the rows, generated with the views rows/answer_row*.php
 *
 */
#}
<!-- Multiple Shor Text -->

<!-- answer -->
<ul class="{{ coreClass }} list-unstyled form-horizontal" role="group" aria-labelledby="ls-question-text-{{ basename }} ls-question-validation-{{ basename }}">
    {% if aRows is empty %}
        {% include 'survey/questions/answer/multipleshorttext/empty.twig' %}
    {% else %}
        {% for aRow in aRows %}
            {% set rowTemplate = (aRow.textarea ? 'survey/questions/answer/multipleshorttext/rows/answer_row_textarea.twig' : 'survey/questions/answer/multipleshorttext/rows/answer_row_inputtext.twig') %}
            {% include rowTemplate with aRow %}
        {% endfor %}
    {% endif %}

</ul>
<!-- end of answer -->
</file>

<file path="application/views/survey/questions/answer/multipleshorttext/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>multipleshorttext</name>
        <type>question_theme</type>
        <title>Multiple short text</title>
        <creationDate>09/08/2018</creationDate>
        <author>LimeSurvey GmbH</author>
        <authorEmail>info@limesurvey.org</authorEmail>
        <authorUrl>http://www.limesurvey.org</authorUrl>
        <copyright>Copyright (C) 2005 - 2018 LimeSurvey Gmbh, Inc. All rights reserved.</copyright>
        <license>GNU General Public License version 2 or later</license>
        <version>1.0</version>
        <apiVersion>1</apiVersion>
        <description>Multiple short text question type configuration</description>
        <questionType>Q</questionType>
        <group>Text questions</group>
        <subquestions>1</subquestions>
        <answerscales>0</answerscales>
        <hasdefaultvalues>1</hasdefaultvalues>
        <assessable>0</assessable>
        <class>multiple-short-txt</class>
    </metadata>
    <compatibility>
        <version>4.0</version>
        <version>5.0</version>
        <version>6.0</version>
        <version>7.0</version>
    </compatibility>
    <files>
... (577 lines truncated)
</file>

<file path="application/views/survey/questions/answer/multipleshorttext/empty.twig">
<!-- empty -->
<li class="alert alert-danger">
    {{ gT('Error: This question has no answers.') }}
</li>
</file>

<file path="application/views/survey/questions/answer/multipleshorttext/translations.php">
<?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
gT('Semicolon-separated list of subquestion codes that keep their original database position when subquestions are randomized');
gT('Label wrapper width');
</file>

<file path="application/views/survey/questions/answer/numerical/answer.twig">
{#
/**
 * Numerical Html
 *
 * @var $extraclass
 * @var $id          $ia[1]
 * @var $prefix
 * @var $answertypeclass
 * @var $tiwidth
 * @var $fValue
 * @var $checkconditionFunction
 * @var $integeronly
 * @var $maxlength
 * @var $suffix
 * @var $placeholder
 */
#}
<!-- Numerical -->

<!-- answer -->
{% if withColumn %}
<div class='{{ coreClass }} row'>
    <div class="{{ extraclass }}">
{% else %}
<div class='{{ coreClass }} {{ extraclass }}'>
{% endif %}
    {% if prefix != '' or suffix != '' %}
        <div class="ls-input-group">
    {% endif %} 
    <!-- Prefix -->
... (33 lines truncated)
</file>

<file path="application/views/survey/questions/answer/numerical/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>numerical</name>
        <type>question_theme</type>
        <title>Numerical input</title>
        <creationDate>09/08/2018</creationDate>
        <author>LimeSurvey GmbH</author>
        <authorEmail>info@limesurvey.org</authorEmail>
        <authorUrl>http://www.limesurvey.org</authorUrl>
        <copyright>Copyright (C) 2005 - 2018 LimeSurvey Gmbh, Inc. All rights reserved.</copyright>
        <license>GNU General Public License version 2 or later</license>
        <version>1.0</version>
        <apiVersion>1</apiVersion>
        <description>Numerical input question type configuration</description>
        <questionType>N</questionType>
        <group>Mask questions</group>
        <subquestions>0</subquestions>
        <answerscales>0</answerscales>
        <hasdefaultvalues>1</hasdefaultvalues>
        <assessable>0</assessable>
        <class>numeric</class>
    </metadata>
    <compatibility>
        <version>4.0</version>
        <version>5.0</version>
        <version>6.0</version>
        <version>7.0</version>
    </compatibility>
    <files>
... (447 lines truncated)
</file>

<file path="application/views/survey/questions/answer/ranking/rows/answer_row.twig">
{# <?php
/**
 * Ranking question, item Html
 * @var $value
 * @var $selected
 * @var $classes
 * @var $id
 * @var $optiontext
 */
?> #}

<li class="select-item mb-3">
    <label for="answer{{myfname}}" class="control-label col-md-4">
        {{ processString(labeltext) }}
    </label>
    <div class="col-md-8">
        <select  class='form-select' name="{{myfname}}" id="answer{{myfname}}">
            {% for option in options %}
                <option value="{{ option.value }}" {{ option.selected }} class='{{option.classes}}'>
                    {{ flatString(processString(option.optiontext,1)) }}
                </option>
            {% endfor %}
        </select>
        <!-- Hidden form: maybe can be replaced with ranking.js -->
        <input type="hidden" id="java{{myfname}}" disabled="disabled" value="{{thisvalue}}"/>
    </div>
</li>
</file>

<file path="application/views/survey/questions/answer/ranking/answer.twig">
{#
!!!! BECAREFUL: ONLY FOR TESTING !!!!!
!!!! DON'T START TO TRANSLATE ALL VIEWS BASED ON THIS MODEL !!!!!

!!!! IT WILL PROBABLY FIRST NEED TO CHANGE  THE TWIG TEMPLATE SYNTAX TO AVOID CONFLICT WITH EXPRESSION MANAGER !!!!

/**
 * Ranking question, item list header Html
 *
 * @var $sOptions         : the select options, generated with the view answer_row.php
 *
 * @var $name
 * @var $myfname
 * @var $labeltext
 * @var $rankId
 * @var $rankingName
 * @var $max_answers
 * @var $min_answers
 * @var $qid
 * @var $choice_title
 * @var $rank_title
 * @var $rank_help
 * @var $showpopups
 * @var $samechoiceheight
 * @var $samelistheight
 **** Additional attributes:
 * @var question_template_attribute.show_handle
 * @var question_template_attribute.only_pull
 * @var question_template_attribute.visualize
 */
... (56 lines truncated)
</file>

<file path="application/views/survey/questions/answer/ranking/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>ranking</name>
        <type>question_theme</type>
        <title>Ranking</title>
        <creationDate>09/08/2018</creationDate>
        <author>LimeSurvey GmbH</author>
        <authorEmail>info@limesurvey.org</authorEmail>
        <authorUrl>http://www.limesurvey.org</authorUrl>
        <copyright>Copyright (C) 2005 - 2018 LimeSurvey Gmbh, Inc. All rights reserved.</copyright>
        <license>GNU General Public License version 2 or later</license>
        <version>1.0</version>
        <apiVersion>1</apiVersion>
        <description>Ranking question type configuration</description>
        <questionType>R</questionType>
        <group>Mask questions</group>
        <subquestions>1</subquestions>
        <answerscales>0</answerscales>
        <hasdefaultvalues>0</hasdefaultvalues>
        <assessable>1</assessable>
        <class>ranking</class>
    </metadata>
    <compatibility>
        <version>4.0</version>
        <version>5.0</version>
        <version>6.0</version>
        <version>7.0</version>
    </compatibility>
    <files>
... (468 lines truncated)
</file>

<file path="application/views/survey/questions/answer/ranking/translations.php">
<?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
gT('Limit the number of possible answers fixed by number of columns in database');
gT('Semicolon-separated list of answer codes that keep their original database position when answers are randomized');
gT('Force each answer option to have the same height');
gT('Force the choice list and the rank list to have the same height');
gT('Replace choice header (default: "Available items")');
gT('Replace rank header (default: "Your ranking")');
</file>

<file path="application/views/survey/questions/answer/shortfreetext/location_mapservice/item_100.twig">
{#
/**
 * Shortfreetext, location map service style, item 100 Html
 *
 * @var $extraclass
 * @var $name                        $ia[1]
 * @var $value                       $_SESSION['responses_'.Yii::app()->getConfig('surveyID')][$ia[1]] }}
 * @var $strBuild
 * @var $checkconditionFunction      $checkconditionFunction(this.value, this.name, this.type)
 * @var $location_mapservice         $aQuestionAttributes['location_mapservice']
 * @var $location_mapheight          $aQuestionAttributes['location_mapheight']
 * @var $questionHelp
 * @var $question_text_help          $question_text['help']
 * @var $location_value          $currentLatLong[0], $currentLatLong[1] />
 * @var $currentLat          $currentLatLong[0]
 * @var $currentLong     $currentLatLong[1]
 */
#}

<div class="{{ coreClass }} {{ extraclass }} row" role="group" aria-labelledby="ls-question-text-{{ basename }}">

    <div class="geoname_search col-12 " >
        <div class="input-group">
            <div class="input-group-text search-icon">
                <span class="fa fa-search ri-search-line"></span>
            </div>
                <input
                    id="searchbox_{{ name }}"
                    placeholder="{{ gT("Search (3 characters minimum)") }}"
                    class="form-control ls-geoloc-search"
... (86 lines truncated)
</file>

<file path="application/views/survey/questions/answer/shortfreetext/location_mapservice/item.twig">
{#
/**
 * Shortfreetext, location map service style, item Html
 *
 * @var $freeTextId                  answer{$ia[1]}
 * @var $extraclass
 * @var $name                        $ia[1]
 * @var $value                       $_SESSION['responses_'.Yii::app()->getConfig('surveyID')][$ia[1]]}
 * @var $currentLocation
 * @var $strBuild
 * @var $checkconditionFunction      $checkconditionFunction(this.value, this.name, this.type)
 * @var $location_mapservice         $aQuestionAttributes['location_mapservice']
 * @var $location_mapzoom            $aQuestionAttributes['location_mapzoom']
 * @var $location_mapheight          $aQuestionAttributes['location_mapheight']
 * @var $questionHelp
 * @var $question_text_help          $question_text['help']
 */
#}

{{ registerScript('MAP_VARS_'~basename,  
    " var zoom = zoom || [];
    zoom['"~name~"'] = "~location_mapzoom~";"
    , "POS_END") }}


<div class="row {{ coreClass }} {{ extraclass }}" role="group" aria-labelledby="ls-question-text-{{ basename }}">
    <!-- Input Text Location -->
    <div class="col-12" >
            <input
                class="text location"
... (46 lines truncated)
</file>

<file path="application/views/survey/questions/answer/shortfreetext/text/item.twig">
{#
/**
 * Shortfreetext, input text style, item Html
 *
 * $extraclass
 * $name        $ia[1]
 * $prefix
 * $suffix
 * $tiwidth
 * $dispVal
 * $placeholder
 * $maxlength
 * $checkconditionFunction
 */
#}

<!-- answer -->
{% if withColumn %}
<div class='{{ coreClass }} row'>
    <div class="{{ extraclass }}">
{% else %}
<div class='{{ coreClass }} {{ extraclass }}'>
{% endif %}
    {% if prefix != '' or suffix != '' %}
        <div class="ls-input-group">
    {% endif %}
        <!-- Prefix -->
        {% if prefix != '' %}
            <div class='ls-input-group-extra prefix-text prefix'>{{ processString(prefix) }}</div>
        {% endif %}
... (32 lines truncated)
</file>

<file path="application/views/survey/questions/answer/shortfreetext/textarea/item.twig">
{#
/**
 * Shortfreetext, textarea style, item Html
 *
 * @var $freeTextId                 answer{$ia[1]}
 * @var $extraclass
 * @var $labelText                  gT('Your answer')
 * @var $name                       $ia[1]
 * @var $drows
 * @var $tiwidth
 * @var $checkconditionFunction      $checkconditionFunction.'(this.value, this.name, this.type)
 * @var $dispVal
 * @var $placeholder
 */
#}

<!-- Short free text, textarea item -->

<!-- answer -->
{% if withColumn %}
<div class='{{ coreClass }} row'>
    <div class="{{ extraclass }}">
{% else %}
<div class='{{ coreClass }} {{ extraclass }}'>
{% endif %}
        {% if prefix != '' or suffix != '' %}
            <div class="ls-input-group">
        {% endif %}
            <!-- Prefix -->
            {% if prefix!= '' %}
... (30 lines truncated)
</file>

<file path="application/views/survey/questions/answer/shortfreetext/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>shortfreetext</name>
        <type>question_theme</type>
        <title>Short free text</title>
        <creationDate>09/08/2018</creationDate>
        <author>LimeSurvey GmbH</author>
        <authorEmail>info@limesurvey.org</authorEmail>
        <authorUrl>http://www.limesurvey.org</authorUrl>
        <copyright>Copyright (C) 2005 - 2018 LimeSurvey Gmbh, Inc. All rights reserved.</copyright>
        <license>GNU General Public License version 2 or later</license>
        <version>1.0</version>
        <apiVersion>1</apiVersion>
        <description>Short free text question type configuration</description>
        <questionType>S</questionType>
        <group>Text questions</group>
        <subquestions>0</subquestions>
        <answerscales>0</answerscales>
        <hasdefaultvalues>1</hasdefaultvalues>
        <assessable>0</assessable>
        <class>text-short</class>
    </metadata>
    <compatibility>
        <version>4.0</version>
        <version>5.0</version>
        <version>6.0</version>
        <version>7.0</version>
    </compatibility>
    <files>
... (831 lines truncated)
</file>

<file path="application/views/survey/questions/answer/shortfreetext/translations.php">
<?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
gT('Default coordinates of the map when the page first loads. Format: latitude [space] longitude');
gT('Set the size to the input or textarea, the input will be displayed with approximately this size in width.');
</file>

<file path="application/views/survey/questions/answer/yesno/buttons/item.twig">
{#
/**
 * Yes / No Question, buttons item Html
 *
 * @var $name                           $ia[1]
 * @var $yChecked
 * @var $nChecked
 * @var $naChecked
 * @var $noAnswer
 * @var $value                          $_SESSION['responses_'.Yii::app()->getConfig('surveyID')][$name]
 */
#}

<div class="ls-answers answers-list yesno-button btn-group btn-group-justified" role="radiogroup" aria-labelledby="ls-question-text-{{ basename }}">
    <!-- Yes -->
    <input type="radio" class="btn-check ls-button-radio" name="{{ name }}" id="answer{{ name }}Y" value="Y" {{ yChecked }}>
    <label class="btn btn-primary mb-3 answer-item ls-button-label" id="javatbd{{ name }}_CY" for="answer{{ name }}Y">
        <span class="fa fa-check ls-icon ri-checkbox-circle-line" aria-hidden="true"></span> {{ gT('Yes') }}
    </label>
    <!-- No -->
    <input type="radio" class="btn-check ls-button-radio" name="{{ name }}" id="answer{{ name }}N" value="N" {{ nChecked }}>
    <label class="btn btn-primary mb-3 answer-item ls-button-label" id="javatbd{{ name }}_CN" for="answer{{ name }}N">
        <span class="fa fa-ban ri-close-circle-line ls-icon" aria-hidden="true"></span> {{ gT('No') }}
    </label>
    <!-- No answer -->
    {% if noAnswer %}
        <input type="radio" class="btn-check ls-button-radio" name="{{ name }}" id="answer{{ name }}" value="" {{ naChecked }}>
        <label class="btn btn-primary mb-3 answer-item ls-button-label" id="javatbd{{ name }}" for="answer{{ name }}">
            <span class="fa fa-circle-thin ri-checkbox-blank-circle-line ls-icon" aria-hidden="true"></span> {{ gT('No answer') }}
        </label>
... (9 lines truncated)
</file>

<file path="application/views/survey/questions/answer/yesno/radio/item.twig">
{#
/**
 * Yes / No Question, radio item Html
 *
 * @var $name                           $ia[1]
 * @var $yChecked
 * @var $nChecked
 * @var $naChecked
 * @var $noAnswer
 * @var $value                          $_SESSION['responses_'.Yii::app()->getConfig('surveyID')][$name]
 */
#}

<ul class="ls-answers answers-list yesno-button radio-list list-group list-group-horizontal" role="radiogroup" aria-labelledby="ls-question-text-{{ basename }}">
    <!-- Yes -->
    <li id="javatbd{{ name }}_CY" class="answer-item radio-item">
        <input
                type="radio"
                name="{{ name }}"
                id="answer{{ name }}Y"
                value="Y"
                {{ yChecked }}
        />
        <label for="answer{{ name }}Y" class="control-label answer-text">
            {{ gT('Yes') }}
        </label>
    </li>

    <!-- No -->
    <li id="javatbd{{ name }}_CN" class="answer-item radio-item">
... (34 lines truncated)
</file>

<file path="application/views/survey/questions/answer/yesno/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>yesno</name>
        <type>question_theme</type>
        <title>Yes/No</title>
        <creationDate>09/08/2018</creationDate>
        <author>LimeSurvey GmbH</author>
        <authorEmail>info@limesurvey.org</authorEmail>
        <authorUrl>http://www.limesurvey.org</authorUrl>
        <copyright>Copyright (C) 2005 - 2018 LimeSurvey Gmbh, Inc. All rights reserved.</copyright>
        <license>GNU General Public License version 2 or later</license>
        <version>1.0</version>
        <apiVersion>1</apiVersion>
        <description>Yes/No question type configuration</description>
        <questionType>Y</questionType>
        <group>Mask questions</group>
        <subquestions>0</subquestions>
        <answerscales>0</answerscales>
        <hasdefaultvalues>1</hasdefaultvalues>
        <assessable>0</assessable>
        <class>yes-no</class>
    </metadata>
    <compatibility>
        <version>4.0</version>
        <version>5.0</version>
        <version>6.0</version>
        <version>7.0</version>
    </compatibility>
    <files>
... (274 lines truncated)
</file>

<file path="application/views/survey/questions/question_help/asterisk.twig">
{#
/**
 * This file render the asterisk for mandatory questions
 */
#}
<!-- Add a visual information + just Mandatory string for aria : can be improved -->
<div class="asterisk float-start">
  <small class="text-danger fa fa-asterisk ri-asterisk small" aria-hidden='true'></small>
  <span class="visually-hidden text-danger">{{ gT("(This question is mandatory)") }}</span>
</div>
</file>

<file path="application/views/survey/questions/question_help/em_tip.twig">
{#
/**
 * Question tips. For now, called from em_manager_helper::_ValidateQuestion
 * @var qid
 * @var coreId : need to be the id of the tag (part of the API)
 * @var coreClass : need to be in class (part of the API)
 * @var vclass : the tip type (default, max, min …)
 * @var vtip : string to show
 * @var qInfo : from ExpressionManager
 */
#}
{% if not hideTip %}
<div id='{{ coreId }}' class='ls-question-message {{ coreClass }}'>
   {{ vtip }}
</div>
{% endif %}
</file>

<file path="application/views/survey/questions/question_help/error_tip.twig">
{#
/**
 * Question error tips. For now, called from em_manager_helper::_ValidateQuestion and used for real error (db issue for example)
 * @var $qid
 * @var coreId : need to be the id of the tag (part of the API)
 * @var coreClass : need to be in class (part of the API)
 * @var $vclass
 * @var $vtip
 */
#}
<div id='{{ coreId }}' class='ls-question-message text-danger {{ coreClass }}'>
    <span class='fa fa-exclamation-circle ri-error-warning-fill' aria-hidden="true"></span>
    {{ vtip }}
</div>
</file>

<file path="application/views/survey/questions/question_help/help.twig">
{#
/**
 * This file render the help message when validating
 * @var $message
 */
#}
<div class="ls-questionhelp {{ classes }}" role="alert" {% if id %} id="{{ id }}" {% endif %} >
    {{ message }}
</div>
</file>

<file path="application/views/survey/questions/question_help/mandatory_tip.twig">
{#
/**
 * render the error text when user submit a page without filling a mandatory question
 * @var sMandatoryText : string
 * @var part : part of mandatory (ranking, multiple etc …)
 * @var qInfo : from ExpressionManager
 */
#}
<div class='ls-question-mandatory ls-question-mandatory-{{part}} text-danger ' role='alert'>
    <span class='fa fa-exclamation-circle ri-error-warning-fill' aria-hidden="true"></span>
    {{ sMandatoryText }}
</div>
</file>

<file path="application/views/survey/questions/question_help/questionhelp.php">
<?php
?>
<!-- views/survey/system/questionhelp -->
<div class="ls-questionhelp">
    <?php echo $questionHelp; ?>
</div>
</file>

<file path="application/views/survey/questions/question_help/softmandatory_input.twig">
{#
/**
 * Inoput part for soft mandatory
 * @var qInfo : array, see LimeExpressionManager::
 * @var sCheckboxLabel : core label
#}
<div class='ls-softmandatory-input'>
    <label for='mandSoft_{{ qInfo.qseq }}'>{{ gT("Continue without answering to this question.") }}</label>
    <input type='hidden' id='mandSoft_{{ qInfo.qseq }}_N' name='mandSoft[{{ qInfo.qseq }}]' value='N'>
    <input type='checkbox' id='mandSoft_{{ qInfo.qseq }}' name='mandSoft[{{ qInfo.qseq }}]' class="ls-mandSoft-checkbox" value='Y' {% if qInfo.mandSoftForced %} checked {%endif %} >
</div>
</file>

<file path="application/views/survey/questions/question_timer/timer_content.twig">
{#
 * This file render the content of the timed question
 * @var iQid
 * @var time_limit_message_style
 * @var time_limit_message
 * @var time_limit_warning_style
 * @var time_limit_warning_message
 * @var time_limit_warning_2_style
 * @var time_limit_warning_2_message
 * @var time_limit_timer_style
 * @var
#}
<div id='LS_question{{ iQid }}_Timer' class='{{ time_limit_timer_class }} alert alert-info' style='{{ time_limit_timer_style|escape("html_attr") }}'>
</div>
<div id='LS_question{{ iQid }}_warning' class='{{ time_limit_warning_class }} alert alert-warning' style='{{ time_limit_warning_style|escape("html_attr") }}'>
    {{ time_limit_warning_message }}
</div>
<div id='LS_question{{ iQid }}_warning_2' class='{{ time_limit_warning_2_class}} alert alert-warning' style='{{ time_limit_warning_2_style|escape("html_attr") }}'>
    {{ time_limit_warning_2_message }}
</div>
<div id='question{{ iQid }}_timer' class='{{ time_limit_message_class}} alert alert-danger' style='{{ time_limit_message_style|escape("html_attr") }}'>
    {{ time_limit_message }}
</div>
</file>

<file path="application/views/survey/questions/question_timer/timer_header.twig">
{#
 * This file render the headers of the div containing the timer
 * @var $timersessionname
 * @var $timersessionname
 * @var $time_limit
 */
#}
<div class="timer_header">
</file>

<file path="application/views/survey/questions/question_timer/timer_javascript.twig">
{#
 * This file render the javascript for the timer
 * TODO : replace all php statement by JavaScript on hidden html input
 * @var $iAction
#}
<!-- Some var for timer script, no need to post -->
<input
    type='hidden'
    name='timerquestion'
    value='{{ timersessionname }}'
    disabled
/>
<input
    type='hidden'
    name='{{ timersessionname }}'
    id='{{ timersessionname }}'
    value='{{ time_limit }}'
    disabled
/>
<input
    type='hidden'
    name='action-{{ timersessionname }}'
    id='action-{{ timersessionname }}'
    value='{{ intval(iAction) }}'
    disabled
/>
<input
    type='hidden'
    name='disablenext-{{ timersessionname }}'
    id='disablenext-{{ timersessionname }}'
... (21 lines truncated)
</file>

<file path="application/views/survey/questions/question_timer/timer.twig">
{#
 * This file render the timer : not needed anymore, could be rendered directly in timer_content
 * @var iQid
 * @var sWarnId
#}
<div style='display: inline' id='LS_question{{ iQid}} _Warning{{ sWarnId }}'>
</div>
</file>

<file path="application/views/survey/system/actionButton/moveNext.php">
<?php
?>
<!-- views/survey/system/actionButton/moveNext -->
<?php
    echo CHtml::htmlButton(gT("Next"), array(
        'type' => 'submit',
        'value' => $value,
        'name' => 'move',
        'class' => "$class btn btn-lg btn-primary",
        'accesskey' => 'n'
    ));
    ?>
<!-- end of views/survey/system/actionButton/moveNext -->
</file>

<file path="application/views/survey/system/actionButton/movePrevious.php">
<?php
?>
<!-- views/survey/system/actionButton/moveSubmit -->
<?php
    echo CHtml::htmlButton(gT("Previous"), array(
        'type' => 'submit',
        'value' => $value,
        'name' => 'move',
        'class' => "$class btn btn-lg btn-outline-secondary",
        'accesskey' => 'p'
    ));
    ?>
<!-- end of views/survey/system/actionButton/moveSubmit -->
</file>

<file path="application/views/survey/system/actionButton/moveSubmit.php">
<?php
?>
<!-- views/survey/system/actionButton/moveSubmit -->
<?php
    echo CHtml::htmlButton(gT("Submit"), array(
        'type' => 'submit',
        'value' => $value,
        'name' => 'move',
        'class' => "$class btn btn-lg btn-primary",
        'accesskey' => 'l'
    ));
    ?>
<!-- end of views/survey/system/actionButton/moveSubmit -->
</file>

<file path="application/views/survey/system/LanguageChanger/LanguageChanger.php">
<?php
?>
<!-- Must be included only one time (else : multiple id) -->
<!-- views/survey/system/LanguageChanger -->
    <div class="row row-cols-lg-auto g-1 form-change-lang <?php echo $sClass ?>" >
        <label class="col-form-label fw-bold">
            <span class="form-label"><?php eT("Language:");?></span>
        </label>
        <div class="col-12">
            <?php echo CHtml::dropDownList('lang', $sSelected, $aListLang, array('id' => false,'class' => "form-select",'data-targeturl' => $targetUrl));?>
        </div>
        <div class="col-12">
            <!-- for no js functionality use LanguageChangerForm: @see makeLanguageChangerSurvey -->
            <?php
               echo CHtml::htmlButton(gT("Change language"), array('type' => 'submit','value' => 'changelang','name' => 'move','class' => "btn btn-outline-secondary ls-js-hidden"));
            ?>
        </div>
    </div>
<!-- end of  views/survey/system/LanguageChanger -->
<?php
App()->getClientScript()->registerScript("activateLanguageChanger", "activateLanguageChanger();\n", CClientScript::POS_END);
?>
</file>

<file path="application/views/survey/system/LanguageChanger/LanguageChangerForm.php">
<?php
?>
<!-- Must be included only one time (else : multiple id) -->
<!-- views/survey/system/LanguageChanger -->
<form method="get" class="ls-languagechanger-form">
    <?php
    App()->getController()->renderPartial("/survey/system/LanguageChanger/LanguageChanger", array(
        'sSelected' => $sSelected ,
        'aListLang' => $aListLang ,
        'sClass'    => $sClass    ,
        'targetUrl' => $targetUrl,
    ));
    ?>
</form>
<!-- end of  views/survey/system/LanguageChanger -->
</file>

<file path="application/views/survey/system/print_survey/header.php">
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<script type="text/javascript" src="<?php echo Yii::app()->getConfig('adminscripts');?>printablesurvey.js"></script>
</file>

<file path="application/views/survey/system/privacy/heading.php">
<?php
?>
<?php
echo gT("This survey is anonymous.");
</file>

<file path="application/views/survey/system/privacy/message.php">
<?php
?>
<p class="ls-privacy-body"><?php echo gT("The record of your survey responses does not contain any identifying information about you, unless a specific survey question explicitly asked for it."); ?><p>
<p class="ls-privacy-body"><?php echo gT("If you used an identifying access code to access this survey, please rest assured that this code will not be stored together with your responses. It is managed in a separate database and will only be updated to indicate whether you did (or did not) complete this survey. There is no way of matching identification access codes with survey responses."); ?>
</file>

<file path="application/views/survey/system/display.php">
<?php
    echo $content;
</file>

<file path="application/views/survey/system/errorAlert.php">
<?php
?>
<?php if (count($aErrors) > 1) : ?>
<ul class='<?php echo $class ?? "" ?> alert alert-danger list-unstyled' role='alert'>
    <?php foreach ($aErrors as $key => $error) : ?>
    <li><?php echo $error; ?></li>
    <?php endforeach; ?>
</ul>
<?php else : ?>
<p class='<?php echo isset($class) ? $class . " " : "" ?> alert alert-danger' role='alert'>
    <?php echo reset($aErrors); ?>
</p>
<?php endif; ?>
</file>

<file path="application/views/survey/system/errorWarning.php">
<?php
?>
<?php if (count($aErrors) > 1) : ?>
<ul class='<?php echo $class ?? "" ?> text-danger list-unstyled inherit-sizes' role='alert'>
    <?php foreach ($aErrors as $key => $error) : ?>
    <li><?php echo $error; ?></li>
    <?php endforeach; ?>
</ul>
<?php else : ?>
<p class='<?php echo $class ?? "" ?> text-danger inherit-sizes' role='alert'>
    <?php echo reset($aErrors); ?>
</p>
<?php endif; ?>
</file>

<file path="application/views/survey/system/message.php">
<?php
?>
<?php foreach ($aMessage as $key => $message) : ?>
<p class="message-<?php echo $key; ?>"><?php echo $message; ?></p>
<?php endforeach; ?>
</file>

<file path="application/views/survey/system/no-javascript.php">
<?php
?>
<div class='alert alert-danger ls-js-hidden warningjs' data-type='checkjavascript'>
    <?php echo gT("Caution: JavaScript execution is disabled in your browser or for this website. You may not be able to answer all questions in this survey. Please, verify your browser parameters."); ?>
</div>
</file>

<file path="application/views/survey/system/required.php">
<?php
?>
<small class="text-danger asterisk ri-star-fill float-start small" aria-hidden='true'></small><span class="visually-hidden text-danger asterisk"> (<?php echo gT("Mandatory"); ?>)</span>
</file>

<file path="application/views/survey/system/url.php">
<?php
$type = $type ?? '-default';
$coreClass = isset($coreClass) ? $type : '';
$description = $description ?? $url;
?>
<div class="url-wrapper url-wrapper-<?php echo $type; ?>">
    <a href="<?php echo $url; ?>" class="<?php echo $coreClass; ?>"><?php echo $description; ?></a>
</div>
</file>

<file path="application/views/surveyAdministration/partial/topbar/_modalSurveyActivation.php">
<?php
?>
<div id="surveyactivation-modal" class="modal fade" role="dialog">
    <div class="modal-dialog">
        <!-- Modal content-->
        <div class="modal-content">
            <?php
            App()->getController()->renderPartial(
                '/layouts/partial_modals/modal_header',
                ['modalTitle' => gT('Activate survey')]
            );
            ?>
            <div class="modal-body" id="modal-body-activate">
            </div>
            <div class="modal-footer">
                <?php
                App()->getController()->renderPartial(
                    '/surveyAdministration/surveyActivation/_activateFooterBtns',
                    []
                );
                ?>
            </div>
        </div>
    </div>
</div>
</file>

<file path="application/views/surveyAdministration/partial/topbar/languagesDropdownItems.php">
<?php
?>
<?php
    $allLanguageOptions = [];
foreach ($surveyLanguages as $languageCode => $languageName) {
    switch ($type) {
        case 'questionGroup':
            $link = Yii::App()->createUrl("survey/index/action/previewgroup/sid/{$sid}/gid/{$gid}/lang/" . $languageCode);
            break;
        case 'question':
            $link = Yii::App()->createUrl("survey/index/action/previewquestion/sid/{$sid}/gid/{$gid}/qid/{$qid}/lang/{$languageCode}");
            break;
        default:
            $link = Yii::App()->createUrl("survey/index", array('sid' => $sid,'newtest' => "Y",'lang' => $languageCode));
    }
    $allLanguageOptions[$languageCode] = [
        'href' => $link,
        'text' => $languageName,
        'target' => '_blank'
    ];
}
?>
<?php if (count($allLanguageOptions) <= 5) : ?>
    <?php foreach ($allLanguageOptions as $languageCode => $languageData) : ?>
        <li>
            <a class="dropdown-item" target="_blank" href="<?= $languageData['href'] ?>" >
                <?= $languageData['text'] ?>
            </a>
        </li>
    <?php endforeach; ?>
... (21 lines truncated)
</file>

<file path="application/views/surveyAdministration/partial/topbar/previewOrRunButton_view.php">
<!-- test/execute survey -->
<?php
$notActive = $survey->active == 'N';
$isExpired = !$notActive && $survey->getIsDateExpired();
if (!isset($id)) {
    $id = $notActive ? 'ls-preview-button' : 'ls-run-button';
}
if (!isset($name)) {
    $name = $notActive ? 'ls-preview-button' : 'ls-run-button';
}
$languagesDropDownItems = '';
if (!$isExpired && count($surveyLanguages) > 1) {
    $languagesDropDownItems = '<ul class="dropdown-menu" style="min-width : 252px;">';
    $languagesDropDownItems .= $this->renderPartial(
        '/surveyAdministration/partial/topbar/languagesDropdownItems',
        [
            'surveyLanguages' => $surveyLanguages,
            'type' => 'survey',
            'sid' => $survey->sid
        ],
        true
    );
    $languagesDropDownItems .= '</ul>';
}
if ($isExpired) {
    $expiredTooltip = sprintf(
        gT('This survey expired on %s and thus cannot be executed.'),
        convertToGlobalSettingFormat(dateShift($survey->expires, "Y-m-d H:i:s"))
    );
}
... (31 lines truncated)
</file>

<file path="application/views/surveyAdministration/partial/topbar/surveyToolsDropdownItems.php">
<?php
?>
<ul class="dropdown-menu">
    <?php if ($hasDeletePermission) : ?>
        <!-- Delete survey -->
        <li>
            <a class="dropdown-item"
                href="#deleteSurvey_modal"
                data-bs-toggle="modal"
                data-bs-target="#deleteSurvey_modal"
                onclick="deleteSurveyConfirm(<?php echo (int) $sid; ?>)">
                <span class="ri-delete-bin-fill text-danger"></span>
                <?php eT("Delete survey"); ?>
            </a>
        </li>
    <?php endif; ?>
    <?php if ($hasSurveyTranslatePermission) : ?>
        <!-- surveytranslate -->
        <?php if ($hasAdditionalLanguages) : ?>
            <!-- Quick-translation -->
            <li>
                <a class="dropdown-item"
                    href="<?= App()->createUrl("quickTranslation/index/surveyid/{$oSurvey->sid}"); ?>">
                    <span class="ri-global-line"></span>
                    <?php eT("Quick-translation"); ?>
                </a>
            </li>
        <?php else : ?>
            <!-- Quick-translation disabled -->
            <li class="disabled">
... (135 lines truncated)
</file>

<file path="application/views/surveyAdministration/partial/topbar/surveyTopbarLeft_view.php">
<?php
App()->getClientScript()->registerScriptFile(
    App()->getConfig('adminscripts') . 'activatesurvey.js',
    LSYii_ClientScript::POS_BEGIN
);
?>
<?php if ($showToolsMenu) {
    $toolsDropDownItems = $this->renderPartial(
        '/surveyAdministration/partial/topbar/surveyToolsDropdownItems',
        get_defined_vars(),
        true
    ); ?>
    <!-- Tools  -->
    <!-- Main button dropdown -->
    <?php
    $this->widget('ext.ButtonWidget.ButtonWidget', [
        'name' => 'ls-tools-button',
        'id' => 'ls-tools-button',
        'text' => gT('Tools'),
        'isDropDown' => true,
        'dropDownContent' => $toolsDropDownItems,
        'htmlOptions' => [
            'class' => 'btn btn-outline-secondary',
        ],
    ]); ?>
<?php } ?>
<!-- survey activation -->
<?php
if (!$editorEnabled) {
    ?>
... (116 lines truncated)
</file>

<file path="application/views/surveyAdministration/partial/topbar/surveyTopbarRight_view.php">
<?php
?>
<!-- White Close button -->
<?php
if (!empty($showWhiteCloseButton)) {
    $this->widget(
        'ext.ButtonWidget.ButtonWidget',
        [
            'name' => 'close_button',
            'text' => gT('Close'),
            'icon' => 'ri-close-fill',
            'link' => $closeUrl,
            'htmlOptions' => [
                'class' => 'btn btn-outline-secondary',
                'role' => 'button'
            ],
        ]
    );
}
?>
<!-- Save and Close -->
<?php
if (!empty($showSaveAndCloseButton)) {
    $this->widget(
        'ext.ButtonWidget.ButtonWidget',
        [
            'name' => 'save-and-close-button',
            'id' => 'save-and-close-button',
            'text' => gT('Save and close'),
            'icon' => 'ri-checkbox-circle-fill',
... (105 lines truncated)
</file>

<file path="application/views/surveyAdministration/partial/topbar_quotas/rightSideButtons.php">
<?php
$linkQuickCsv = Yii::App()->createUrl("quotas/quickCSVReport/surveyid/$surveyid");
$this->widget(
    'ext.ButtonWidget.ButtonWidget',
    [
        'name' => 'quota-quick-csv',
        'id' => 'quota-quick-csv',
        'text' => gT('Quick CSV report'),
        'icon' => '',
        'link' => '',
        'htmlOptions' => [
            'class' => 'btn btn-outline-secondary',
            'onClick' => "window.open('$linkQuickCsv', '_top')"
        ],
    ]
);
$this->widget(
    'ext.ButtonWidget.ButtonWidget',
    [
        'name' => 'quota-add',
        'id' => 'quota-add',
        'text' => gT('Add new quota'),
        'icon' => '',
        'link' => Yii::App()->createUrl("quotas/AddNewQuota/surveyid/$surveyid"),
        'htmlOptions' => [
            'class' => 'btn btn-outline-secondary',
        ],
    ]
);
</file>

<file path="application/views/surveyAdministration/partial/topbar_statistics/rightSideButtons.php">
<?php
if (isset($expertstats) && $expertstats === true) {
    $this->widget(
        'ext.ButtonWidget.ButtonWidget',
        [
            'name' => 'expert-mode',
            'id' => 'expert-mode',
            'text' => gT("Expert mode"),
            'icon' => 'ri-bar-chart-fill',
            'link' => Yii::app()->createUrl('/admin/statistics/sa/index/surveyid/' . $surveyid),
            'htmlOptions' => [
                'class' => 'btn btn-info',
            ],
        ]
    );
} else {
    $this->widget(
        'ext.ButtonWidget.ButtonWidget',
        [
            'name' => 'simple-mode',
            'id' => 'simple-mode',
            'text' => gT("Simple mode"),
            'icon' => 'ri-bar-chart-fill',
            'link' => App()->getConfig('editorEnabled')
                ? Yii::app()->createUrl(
                    'editorLink/index',
                    ['route' => 'responses/' . $surveyid . '/results/statistics']
                )
                : Yii::app()->createUrl('/admin/statistics/sa/simpleStatistics/surveyid/' . $surveyid),
            'htmlOptions' => [
... (49 lines truncated)
</file>

<file path="application/views/surveyAdministration/partial/topbar_tokens/leftSideButtons.php">
<?php
if ($hasTokensCreatePermission || $hasTokensImportPermission) {
    $createDropdownItems = $this->renderPartial(
        '/surveyAdministration/partial/topbar_tokens/tokensCreateDropdownItems',
        get_defined_vars(),
        true
    );
    ?>
    <?php $this->widget('ext.ButtonWidget.ButtonWidget', [
        'name' => 'ls-create-token-button',
        'id' => 'ls-create-token-button',
        'text' => gT('Add...'),
        'icon' => 'ri-add-circle-fill',
        'isDropDown' => true,
        'dropDownContent' => $createDropdownItems,
        'htmlOptions' => [
            'class' => 'btn btn-outline-secondary',
        ],
    ]);
    ?>
    <?php
}
if ($hasTokensUpdatePermission || $hasSurveySettingsUpdatePermission) {
    $this->widget(
        'ext.ButtonWidget.ButtonWidget',
        [
            'name' => 'tokens-manage-attributes',
            'id' => 'tokens-manage-attributes',
            'text' => gT('Manage attributes'),
            'icon' => 'ri-server-fill',
... (74 lines truncated)
</file>

<file path="application/views/surveyAdministration/partial/topbar_tokens/rightSideButtons.php">
<?php
if ($tokenexists) {
    if (!empty($showDelButton) && ($hasSurveySettingsUpdatePermission || $hasTokensDeletePermission)) {
        $this->widget(
            'ext.ButtonWidget.ButtonWidget',
            [
                'name' => 'delete-token-table',
                'id' => 'delete-token-table',
                'text' => gT('Delete participant list'),
                'icon' => '',
                'link' => Yii::App()->createUrl("admin/tokens/sa/kill/surveyid/$oSurvey->sid"),
                'htmlOptions' => [
                    'class' => 'btn btn-danger',
                    'role' => 'button'
                ],
            ]
        );
    }
    $this->renderPartial('/surveyAdministration/partial/topbar/surveyTopbarRight_view', get_defined_vars());
    if (!empty($showDownloadButton)) {
        $this->widget(
            'ext.ButtonWidget.ButtonWidget',
            [
                'name' => 'export-button',
                'id' => 'export-button',
                'text' => gT('Download CSV file'),
                'icon' => 'ri-download-fill',
                'htmlOptions' => [
                    'class' => 'btn btn-primary',
                    'role' => 'button',
... (37 lines truncated)
</file>

<file path="application/views/surveyAdministration/partial/topbar_tokens/tokensCreateDropdownItems.php">
<!-- Add new token entry" -->
<ul class="dropdown-menu" role="menu" aria-label="<?php echo gT('Add participants'); ?>">
    <?php if ($hasTokensCreatePermission) : ?>
        <li role="none">
            <a class="pjax dropdown-item" role="menuitem" href="<?php echo Yii::App()->createUrl("admin/tokens/sa/addnew/surveyid/$oSurvey->sid"); ?>" >
                <span class="ri-add-circle-fill" aria-hidden="true"></span>
                <?php eT("Add participant"); ?>
            </a>
        </li>
        <!-- Create dummy tokens -->
        <li role="none">
            <a class="pjax dropdown-item" role="menuitem" href="<?php echo Yii::App()->createUrl("admin/tokens/sa/adddummies/surveyid/$oSurvey->sid"); ?>" >
                <span class="ri-add-box-fill" aria-hidden="true"></span>
                <?php eT("Create dummy participants"); ?>
            </a>
        </li>
    <?php endif; ?>
    <?php if ($hasTokensCreatePermission && $hasTokensImportPermission) : ?>
        <li role="presentation" class="dropdown-divider" aria-hidden="true"></li>
    <?php endif; ?>
    <!-- Import tokens -->
    <?php if ($hasTokensImportPermission) : ?>
        <li role="presentation">
            <h6 class="dropdown-header"><?php eT("Import participants from:"); ?></h6>
        </li>
        <!-- from CSV file -->
        <li role="none">
            <a class="pjax dropdown-item" role="menuitem" href="<?php echo Yii::App()->createUrl("admin/tokens/sa/import/surveyid/$oSurvey->sid") ?>" >
                <span class="ri-download-2-fill" aria-hidden="true"></span>
                <?php eT("CSV file"); ?>
... (14 lines truncated)
</file>

<file path="application/views/surveyAdministration/partial/topbar_tokens/tokensInvRemDropdownItems.php">
<!-- Invite & remind menu -->
<ul class="dropdown-menu" role="menu" aria-labelledby="ls-inv-rem-button">
    <?php if ($hasTokensUpdatePermission) : ?>
        <!-- Send email invitation -->
        <li role="none">
            <a class="pjax dropdown-item" role="menuitem" href="<?php echo Yii::App()->createUrl("admin/tokens/sa/email/surveyid/$oSurvey->sid"); ?>" >
                <span class="ri-mail-send-fill" aria-hidden="true"></span>
                <?php eT("Send email invitation"); ?>
            </a>
        </li>
        <!-- Send email reminder -->
        <li role="none">
            <a class="pjax dropdown-item" role="menuitem" href="<?php echo Yii::App()->createUrl("admin/tokens/sa/email/action/remind/surveyid/$oSurvey->sid"); ?>" >
                <span class="ri-mail-volume-fill" aria-hidden="true"></span>
                <?php eT("Send email reminder"); ?>
            </a>
        </li>
        <!-- Edit email template -->
        <li role="none">
            <a class="pjax dropdown-item" role="menuitem" href="<?php echo Yii::App()->createUrl("admin/emailtemplates/sa/index/surveyid/$oSurvey->sid"); ?>" >
                <span class="ri-mail-line" aria-hidden="true"></span>
                <?php eT("Edit email templates"); ?>
            </a>
        </li>
    <?php endif; ?>
    <li role="presentation" class="dropdown-divider" aria-hidden="true"></li>
    <!-- Bounce processing -->
    <?php if ($hasTokensUpdatePermission) :?>
        <?php if ($oSurvey->bounceprocessing == 'L' || ($oSurvey->bounceprocessing == 'G' && App()->getConfig('bounceaccounttype') != 'off')) :?>
            <?php if (function_exists('imap_open')) :?>
... (35 lines truncated)
</file>

<file path="application/views/surveyAdministration/partial/topbarBtns/leftSideButtons.php">
<?php
if (Permission::model()->hasGlobalPermission('surveysgroups', 'create')) {
    $this->widget(
        'ext.ButtonWidget.ButtonWidget',
        [
            'name' => 'ls-question-tools-button',
            'id' => 'ls-question-tools-button',
            'text' => gT('Create survey group'),
            'icon' => 'ri-add-circle-fill',
            'link' => $this->createUrl("admin/surveysgroups/sa/create"),
            'htmlOptions' => [
                'class' => 'btn btn-primary tab-dependent-button d-none',
                'data-tab' => '#surveygroups'
            ],
        ]
    );
}
</file>

<file path="application/views/surveyAdministration/partial/topbarBtns_create_survey/rightSideButtons.php">
<?php
$this->widget(
    'ext.ButtonWidget.ButtonWidget',
    [
        'name' => 'close-button',
        'id' => 'close-button',
        'text' => gT('Close'),
        'icon' => 'ri-close-fill',
        'link' => $this->createUrl('dashboard/view'),
        'htmlOptions' => [
            'class' => 'btn btn-outline-secondary',
            'role' => 'button'
        ],
    ]
);
$this->widget(
    'ext.ButtonWidget.ButtonWidget',
    [
        'name' => 'save-form-button',
        'id' => 'save-form-button',
        'text' => gT('Save'),
        'icon' => 'ri-check-fill',
        'htmlOptions' => [
            'class' => 'btn btn-primary',
            'data-form-id' => 'addnewsurvey',
            'role' => 'button',
            'onclick' => "$(this).addClass('disabled').attr('onclick', 'return false;');"
        ],
    ]
);
... (1 lines truncated)
</file>

<file path="application/views/surveyAdministration/partial/_modalActivateSuccess.php">
<?php
?>
<div id="" class="modal fade" role="dialog">
    <div class="modal-dialog">
        <!-- Modal content-->
        <div class="modal-content">
            <?php
            App()->getController()->renderPartial(
                '/layouts/partial_modals/modal_header',
                ['modalTitle' => gT('Congrats! Your survey has been activated.')]
            );
            ?>
            <div class="modal-body" id="modal-body-activate">
                <div class="row">
                    <p><?php et('Want to share your survey right away?');?></p>
                    <a href="<?php App()->getController()->createUrl('/surveyAdministration/view', ['surveyid' => $surveyId])?>">
                        <?= gT('Sharing options ') ?><i class="ri-arrow-right-line"></i>
                    </a>
                </div>
                <div class="row">
                    <p><?php et('Statistics and responses are now accessible.');?></p>
                    <a href="<?php App()->getController()->createUrl('responses/browse', ['surveyId' => $surveyId])?>">
                        <?= gT('See all responses and statistics') ?><i class="ri-arrow-right-line"></i>
                    </a>
                </div>
                <div class="row">
                    <p><?php et('By default, surveys are activated in open-access mode and participants do not need an invitation code.');?></p>
                </div>
            </div>
            <div class="modal-footer">
... (6 lines truncated)
</file>

<file path="application/views/surveyAdministration/partial/_modalCopySurvey.php">
<?php
?>
<div id="copySurvey_modal" class="modal fade" role="dialog" aria-modal="true" aria-labelledby="copySurveyModalTitle">
    <div class="modal-dialog import-modal">
        <!-- Modal content-->
        <div class="modal-content">
            <?php
            App()->getController()->renderPartial(
                '/layouts/partial_modals/modal_header',
                ['modalTitle' => gT('Copy survey'), 'modalTitleId' => 'copySurveyModalTitle']
            );
            ?>
            <?php echo CHtml::form(
                ['surveyAdministration/copy'],
            ) ?>
            <div class="modal-body" id="modal-body-copy-survey">
                <div class="row mb-3">
                    <p class="form-label"><?= gT("Select the options for copying your survey."); ?></p>
                </div>
                    <div class="row mb-3">
                        <!-- Source survey -->
                        <label class="form-label" for='surveyIdToCopy'><?= gT("Source survey:"); ?> </label>
                        <select id='surveyIdToCopy' name='surveyIdToCopy' class="form-select w-100"></select>
                    </div>
                    <div class="mb-3">
                        <!-- New survey title -->
                        <label  class="form-label" for='copysurveytitle'><?php eT("New survey title:"); ?> </label>
                        <input type='text' id='copysurveytitle' name='copysurveytitle' value='' class="form-control" aria-describedby="copysurveytitleHelp"/>
                        <p class="form-control-static" id="copysurveytitleHelp">
                            <span class='reg12'><?php echo  gT('Optional - Leave this field empty to assign a new title with "... - Copy" automatically.'); ?> </span>
... (86 lines truncated)
</file>

<file path="application/views/surveyAdministration/partial/_modalDeleteSurvey.php">
<div id="deleteSurvey_modal" class="modal fade" role="dialog">
    <div class="modal-dialog">
        <!-- Modal content-->
        <div class="modal-content">
            <?php
            App()->getController()->renderPartial(
                '/layouts/partial_modals/modal_header',
                ['modalTitle' => gT('Delete survey')]
            );
            ?>
            <?php echo CHtml::beginForm(
                ['surveyAdministration/delete'],
                'post',
                ['id' => 'deleteSurveyForm']
            ) ?>
            <input type="hidden" id="deleteSurveyId" name="iSurveyID" value="" />
            <div class="modal-body">
                <p role="heading" aria-level="3" class="fw-bold">
                    <?php eT("You are about to delete this survey"); ?> (<?php eT("ID"); ?>: <span id="deleteSurveyIdDisplay"></span>)
                </p>
                <p>
                    <?php eT("This process will delete this survey, and all related groups, questions answers and conditions."); ?><br />
                    <?php eT("It will also delete any resources/files that have been uploaded for this survey."); ?><br />
                    <?php eT("We recommend that before you delete this survey you export the entire survey from the main administration screen."); ?>
                </p>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary text-light" data-bs-dismiss="modal">
                    <?php eT("Cancel"); ?>
                </button>
... (15 lines truncated)
</file>

<file path="application/views/surveyAdministration/partial/_modalImportSurvey.php">
<?php
?>
<div id="importSurvey_modal" class="modal fade" role="dialog">
    <div class="modal-dialog">
        <!-- Modal content-->
        <div class="modal-content">
            <?php
            echo CHtml::form(
                array('surveyAdministration/import'),
                'post',
                array(
                    'id' => 'importsurvey',
                    'name' => 'importsurvey',
                    'class' => '',
                    'enctype' => 'multipart/form-data',
                    'data-error-file-required' => gT('No file selected'),
                )
            ); ?>
            <?php
            App()->getController()->renderPartial(
                '/layouts/partial_modals/modal_header',
                ['modalTitle' => gT('Import survey')]
            );
            ?>
            <div class="modal-body" id="modal-body-import-survey">
                <div class="row">
                    <div class="mb-3">
                        <label class='form-label ' >
                            <?php printf(
                                gT(
... (73 lines truncated)
</file>

<file path="application/views/surveyAdministration/surveyActivation/_activateFooterBtns.php">
<button type="button" class="btn btn-cancel" data-bs-dismiss="modal"><?php eT("Cancel"); ?></button>
<button id="saveactivateBtn" type="button" class="btn btn-primary" onclick="activateWithOptions()">
    <?php eT("Save and activate"); ?>
</button>
</file>

<file path="application/views/surveyAdministration/surveyActivation/_activateSurveyCheckFailed.php">
<?php
App()->getClientScript()->registerScriptFile(
    '/application/views/surveyAdministration/javascript/fix-solvable-errors.js',
    LSYii_ClientScript::POS_BEGIN
);
?>
<p class="lead text-danger"><strong><?php eT("Error"); ?> !</strong></p>
<p class="lead text-danger"><strong><?php eT("Survey does not pass consistency check"); ?></strong></p>
<p>
    <?php eT("The following problems have been found:"); ?>
</p>
<ul class="list-unstyled">
    <?php
    if (isset($failedcheck) && $failedcheck) {
        foreach ($failedcheck as $fc) { ?>
            <li> Question qid-<?php echo $fc[0]; ?> ("<a
                    href='<?php echo App()->getController()->createUrl(
                        'questionAdministration/view/surveyid/' . $surveyid . '/gid/' . $fc[3] . '/qid/' . $fc[0]
                    ); ?>'><?php echo $fc[1]; ?></a>")<?php echo $fc[2]; ?>
            </li>
        <?php }
    }
    if (isset($failedgroupcheck) && $failedgroupcheck) {
        foreach ($failedgroupcheck as $fg) { ?>
            <li> Group gid-<?php echo $fg[0]; ?> ("<a
                    href='<?php echo Yii::app()->getController()->createUrl(
                        'questionGroupsAdministration/view/surveyid/' . $surveyid . '/gid/' . $fg[0]
                    ); ?>'><?php echo flattenText($fg[1]); ?></a>")<?php echo $fg[2]; ?>
            </li>
        <?php }
... (12 lines truncated)
</file>

<file path="application/views/surveyAdministration/surveyActivation/_activateSurveyOptions.php">
<?php
$optionsOnOff = ['Y' => gT('On'), 'N' => gT('Off')];
?>
<div class="row">
    <div class='col-md-12'>
        <h2><?php eT("Please keep in mind:"); ?></h2>
        <h2><?php eT("Once a survey has been activated you can no longer add or delete questions, question groups or subquestions.") ?> </h2>
        <p>
            <?php eT("Editing questions, question groups or subquestions is still possible. The following settings cannot be changed once a survey has been activated.", 'unescaped'); ?>
        </p>
    </div>
</div>
<?php if ($oSurvey->getIsDateExpired()) : ?>
    <div class="row">
        <div class='col-md-12'>
            <?php
            $this->widget('ext.AlertWidget.AlertWidget', [
                'text' => gT('Note: This survey has a past expiration date configured and is currently not available to participants. Please remember to update/remove the expiration date in the survey settings after activation.'),
                'type' => 'info',
                'htmlOptions' => ['class' => 'controls']
            ]);
            ?>
        </div>
    </div>
<?php endif; ?>
<?php echo CHtml::form(
    ["surveyAdministration/activate/"],
    'post',
    array('class' => 'form-horizontal')
); ?>
... (164 lines truncated)
</file>

<file path="application/views/surveyAdministration/surveyActivation/_activation_error.php">
<?php
?>
<div id="pjax-content" class="ls-flex-column align-items-flex-start align-content-center col-11 ls-flex-item transition-animate-width">
    <div class="ls-flex-column fill col-12 overflow-enabled">
        <div class="row col-12">
            <h3 class="pagetitle"><?php eT('Survey activation error'); ?></h3>
            <?php if (App()->getConfig('debug')) : ?>
                <p><?php eT('Database error!'); ?></p>
                <pre>
                    <?php echo $result['error']; ?>
                </pre>
            <?php elseif ($result['error'] == 'surveytablecreation' && !App()->getConfig('debug')) :
                $this->widget('ext.AlertWidget.AlertWidget', [
                    'header' => gT("The survey response table could not be created."),
                    'text' => gT("Usually this is caused by having too many (sub-)questions in your survey. Please try removing questions from your survey."),
                    'type' => 'warning',
                ]);
                ?>
            <?php else : ?>
                <?php
                $this->widget('ext.AlertWidget.AlertWidget', [
                    'text' => gT("Timings table could not be created."),
                    'type' => 'warning',
                ]);
                ?>
            <?php endif; ?>
        </div>
    </div>
</div>
</file>

<file path="application/views/surveyAdministration/surveyActivation/_activation_feedback.php">
<?php
?>
<div class='side-body'>
    <div class="row welcome survey-action">
        <div class="col-12 content-right">
            <div class="card card-primary h-100">
                <h3>
                    <?php eT('Activate survey'); ?> (<?php echo $survey->currentLanguageSettings->surveyls_title; ?>)
                </h3>
                <p class='lead'>
                    <?php eT("Your survey has been activated and the responses and statistics section is now available."); ?>
                </p>
                    <?php if ($warning) : ?>
                        <strong class='text-danger'>
                            <?php eT("The required directory for saving the uploaded files couldn't be created. Please check file permissions on the /upload/surveys directory."); ?>
                        </strong>
                    <?php endif; ?>
                    <?php if ($allowregister && !tableExists('tokens_' . $iSurveyID)) : ?>
                        <p>
                            <?php eT("This survey allows public registration. A survey participant list must also be created."); ?>
                            <br/>
                            <br/>
                            <input
                                type="submit"
                                class="btn btn-outline-secondary btn-lg limebutton"
                                value="<?php eT("Initialize participant list"); ?>"
                                onclick='<?php echo $onclickAction; ?>'
                            />
                        </p>
                    <?php else : ?>
... (48 lines truncated)
</file>

<file path="application/views/surveyAdministration/surveyActivation/_failedFooterBtn.php">
<button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">
    <?php eT("Return to survey administration"); ?>
</button>
</file>

<file path="application/views/surveyAdministration/surveyActivation/_feedbackOpenAccess.php">
<?php
?>
<div class="row">
    <div class="col-12">
        <div class="card card-primary border-left-success h-100">
            <div class="card-header">
                <h5 class="card-title">
                    <?php et('Congrats! Your survey has been activated successfully in open-access mode.');?>
                </h5>
            </div>
            <div class="card-body d-flex">
                <ul class="list-unstyled">
                    <li>
                <?php et('Statistics and responses are now accessible.'); ?>
                <a href="<?= Yii::app()->createUrl('responses/browse', ['surveyId' => $surveyId])?>"><?= gT('See all responses and statistics')?></a>
                    </li>
                <?php
                et("By default, surveys are activated in open-access mode and participants don't need an invitation code. ");
                ?>
                </ul>
            </div>
        </div>
    </div>
</div>
</file>

<file path="application/views/surveyAdministration/_inherit_sub_footer.php">
<div class="row sub_footer">
    <div class="col-12 mt-5 mb-3">
        <div class="sub_footer_border"></div>
    </div>
    <div class="col-lg-6 col-12 d-flex ls-footer-label">
        <i class="ri-information-line me-2"></i>
        <p class="me-1">ᴵ</p>
        <div>
            <?= sprintf(
                gT("Inherited settings come from your %sglobal settings%s or %ssurvey group%s. Click %shere%s for more information about inherited settings."),
                '<a class="ls-link" href="' . $this->createUrl('/admin/globalsettings') . '" target="_blank">',
                '</a>',
                '<a class="ls-link" href="' . $this->createUrl('/surveyAdministration/listsurveys') . '" target="_blank">',
                '</a>',
                '<a class="ls-link" href="https://www.limesurvey.org/manual/Survey_settings_inheritance" target="_blank">',
                '</a>'
            ); ?>
        </div>
    </div>
</div>
</file>

<file path="application/views/surveyAdministration/_user_management_sub_footer.php">
<div class="row sub_footer">
  <div class="col-12 mt-5 mb-3">
    <div style="border-top:1px solid #1E1E1E"></div>
  </div>
  <div class="col-lg-6 col-12 d-flex ls-footer-label">
    <i class="ri-information-line me-2"></i>
    <p class="me-1">ᴵ</p>
    <div>
      <?= sprintf(gT("Go to %sglobal user management%s for general user management (add/edit/delete general users). %sIf you don't have permission please contact your administrator.%s"), '<a href="' . $this->createUrl('userManagement/index') . '" target="_blank">', '</a>', '<br>', '</br>'); ?>
    </div>
  </div>
</div>
</file>

<file path="application/views/surveyAdministration/activateSurvey.php">
<?php
?>
<div class='side-body'>
    <h3>
        <?php eT('Activate survey'); ?> (<?php echo $oSurvey->currentLanguageSettings->surveyls_title; ?>)
    </h3>
    <div class="row">
        <div class="col-12 col-xl-10">
            <div class="card card-primary h-100">
                <?php
                if ((isset($failedcheck) && $failedcheck) || (isset($failedgroupcheck) && $failedgroupcheck)) {
                    $this->renderPartial('_activateSurveyCheckFailed', [
                        'failedcheck' => $failedcheck,
                        'failedgroupcheck' => $failedgroupcheck,
                        'surveyid' => $oSurvey->sid
                    ]);
                } else {
                    $this->renderPartial('_activateSurveyOptions', [
                        'aSurveysettings' => $aSurveysettings,
                        'oSurvey' => $oSurvey
                    ]);
                }
                ?>
            </div>
        </div>
    </div>
</div>
</file>

<file path="application/views/surveyAdministration/addPanelIntegrationParameter_view.php">
<?php
?>
<div id="dlgEditParameter" class="modal fade" role="dialog" tabindex="-1" aria-modal="true"
     aria-labelledby="dlgEditParameterTitle"
     data-save-url='<?= Yii::app()->createUrl("surveyAdministration/saveUrlParam") ?>'
>
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <h2 id="dlgEditParameterTitle" class="modal-title h5"><?php eT("Add URL parameter"); ?></h2>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>
            <div class="modal-body">
                <div class='mb-3 row'>
                    <div id="parameterError"></div>
                    <label class='form-label' for='paramname'><?php eT('Parameter name:'); ?></label>
                    <div class=''>
                        <input class="form-control" name="paramname" id="paramname" type="text" size="20">
                    </div>
                </div>
                <div class='mb-3 row'>
                    <label class='form-label' for='targetquestion'>
                        <?php eT('Target (sub-)question:'); ?>
                    </label>
                    <div class=''>
                        <select class='form-select' name='targetquestion' id='targetquestion' size='1'>
                            <option value=''><?php eT('(No target question)'); ?></option>
                            <?php foreach ($questions as $question) : ?>
                                <option value='<?php echo $question['qid'] . '-' . $question['sqid']; ?>'>
                                    <?= $question['title'] . ': ' .
... (39 lines truncated)
</file>

<file path="application/views/surveyAdministration/afterDeactivateSurvey_view.php">
<?php
?>
<div class="row ">
    <div class="col-8 content-right">
        <div class="card card-primary border-left-success">
            <div class="card-header ">
                <h2>
                    <?php printf(gT("Your survey (%d) was deactivated."), $surveyid); ?>
                </h2>
            </div>
            <div class="card-body d-flex">
                <ul>
                    <li><?php eT("Responses are no longer available in LimeSurvey."); ?></li>
                    <li><?php printf(gT("The responses table has been renamed to: %s"), "<b>" . $sNewSurveyTableName . "</b>"); ?></li>
                    <?php if (isset($toldtable) && $toldtable) { ?>
                    <li><?php printf(gT("The participant list associated with this survey has been renamed to: %s "), $tnewtable);?></li>
                    <?php } ?>
                    <?php if (isset($sNewTimingsTableName)) { ?>
                        <li><?php printf(gT("The response timings table has been renamed to: %s"), $sNewTimingsTableName);?></li>
                    <?php }?>
                    <li><?php eT("You should note the name(s) of the table(s) in case you need to access this information later."); ?>
                        <br>
                        <?php eT("If you deactivated this survey in error, it is possible to restore this data easily if you do not make any changes to the survey structure."); ?>
                    </li>
                </ul>
            </div>
            <div class="card-footer d-flex">
                    <a href="<?php echo Yii::app()->createUrl('surveyAdministration/view/surveyid/' . $surveyid); ?>"
                       class="btn btn-outline-secondary ">
                        <?php eT('Close'); ?>
... (6 lines truncated)
</file>

<file path="application/views/surveyAdministration/copySurveyResult_view.php">
<?php
use LimeSurvey\Models\Services\CopySurveyResult;
?>
<!-- Import Failed -->
<?php if ($copyResults->getErrors()) {?>
    <div class="jumbotron message-box message-box-error">
        <h2 class="danger"><?php eT("Copy survey");?></h2>
        <p class="lead text-danger">
            <?php eT("Error"); ?>
        </p>
        <!-- error message -->
        <p>
        <?php
        foreach ($copyResults->getErrors() as $sErrorMessage) {
            echo CHtml::encode($sErrorMessage);
        } ?>
        </p>
        <!-- buttons -->
        <p>
            <input type='submit' class="btn btn-outline-secondary btn-large" value='<?php eT("Main Admin Screen"); ?>' onclick="window.open('<?php echo $this->createUrl('admin/'); ?>', '_top')" />
        </p>
    </div>
<!-- Success -->
<?php } else {?>
    <div class="jumbotron message-box">
        <h2 class="text-success"><?php eT("Success"); ?></h2>
        <p class="lead"><?php eT("Survey copy summary"); ?></p>
        <!-- Copy results-->
        <div class="row justify-content-center">
            <div class="col-lg-2">
... (53 lines truncated)
</file>

<file path="application/views/surveyAdministration/deactivateSurvey_view.php">
<div class='side-body'>
<?php if (isset($step1)) {
    $this->renderPartial('stopSurvey_view', [
        'surveyid' => $surveyid,
        'dbprefix' => $dbprefix,
        'date'     => $date,
        'sNewSurveyTableName' => $sNewSurveyTableName ?? null
    ]);
} elseif (isset($nostep)) { ?>
<?php } else { ?>
    <?php
    $this->renderPartial('afterDeactivateSurvey_view', [
        'surveyid' => $surveyid,
        'toldtable' => $toldtable ?? null,
        'tnewtable' => $tnewtable ?? null,
        'sNewSurveyTableName' => $sNewSurveyTableName ?? null
    ]);
} ?>
    </div>
</file>

<file path="application/views/surveyAdministration/deleteSurvey_view.php">
<?php
?>
<div class='side-body'>
    <div class="row">
        <div class="col-12 content-right">
        <br/>
        <div class="jumbotron message-box">
                <h2><?php eT("Delete survey"); ?></h2>
                <p class="lead"><?php eT("Warning"); ?></p>
                <p>
                    <strong><?php eT("You are about to delete this survey"); ?> (<?php echo $surveyid; ?>)</strong><br /><br />
                    <?php eT("This process will delete this survey, and all related groups, questions answers and conditions."); ?><br /><br />
                    <?php eT("It will also delete any resources/files that have been uploaded for this survey."); ?><br /><br />
                    <?php eT("We recommend that before you delete this survey you export the entire survey from the main administration screen."); ?>
                    <?php if ($survey->hasResponsesTable) :?>
                        <span class="text-danger"><?php eT("This survey is active and a responses table exists. If you delete this survey, these responses (and files) will be deleted. We recommend that you export the responses before deleting this survey."); ?></span><br /><br />
                    <?php endif; ?>
                    <?php if ($survey->hasTokensTable) : ?>
                        <span class="text-danger"><?php eT("This survey has an associated participant list. If you delete this survey this participant list will be deleted. We recommend that you export or backup these participants before deleting this survey."); ?><br /><br />
                    <?php endif; ?>
                    <?php if (!empty($survey->getArchivedTableNames())) : ?>
                        <span class="text-danger"><?php eT("This survey has archived responses, timings or participant lists from previous activations. If you delete this survey, these will be deleted as well."); ?></span><br /><br />
                    <?php endif; ?>
                </p>
                <p>
                    <?php echo CHtml::beginForm($this->createUrl("surveyAdministration/delete/surveyid/{$surveyid}"), 'post');?>
                        <input type='hidden' name='delete' value='yes'>
                        <input type='submit'  class="btn btn-lg btn-warning" value='<?php eT("Delete survey"); ?>'>
                        <input type='button'  class="btn btn-lg btn-cancel" value='<?php eT("Cancel"); ?>' onclick="window.open('<?php echo Yii::app()->createUrl("surveyAdministration/view/surveyid/$surveyid"); ?>', '_top')" />
                    <?php echo CHtml::endForm(); ?>
... (6 lines truncated)
</file>

<file path="application/views/surveyAdministration/editLocalSettings_main_view.php">
<?php
$templateData['oSurvey']         = $oSurvey;
$templateData['oSurveyOptions']  = $oSurvey->oOptionLabels;
$templateData['bShowInherited']  = $oSurvey->showInherited;
$templateData['bShowAllOptions'] = true;
$templateData['optionsOnOff']    = $optionsOnOff;
echo viewHelper::getViewTestTag('surveyGeneralSettings');
Yii::app()->getClientScript()->registerScript(
    "editLocalSettings_formid_" . $entryData['name'],
    "
var formId = '" . $entryData['name'] . "';
",
    LSYii_ClientScript::POS_BEGIN
);
$count = 0;
if (isset($scripts)) {
    echo $scripts;
}
?>
<!-- START editLocalSettings -->
<div class="row">
    <div class="col-12">
        <!-- <h3 class="pagetitle"><?php eT($entryData['title']); ?></h3> -->
        <!-- <h1 class="mt-3 mb-2"><?php eT($entryData['title']); ?></h1> -->
        <!-- Edition container -->
        <!-- Form -->
        <?php
        if (empty($templateData['noform']) || $templateData['noform'] !== true) {
            echo CHtml::form(["admin/database/index/" . $entryData['action']], 'post', ['id' => $entryData['name'], 'name' => $entryData['name'], 'class' => ' form30']);
        }
... (61 lines truncated)
</file>

<file path="application/views/surveyAdministration/importSurvey_view.php">
<?php
?>
<!-- Import Failed because of page reload -->
<?php if (!isset($bFailed)) :?>
    <div class="jumbotron message-box message-box-error">
        <h2 class="danger"><?php echo gT("Import survey data"); ?></h2>
        <p class="lead text-danger">
            <?php eT("Error"); ?>
        </p>
        <!-- error message -->
        <p>
        <?php echo eT('Import failed because of page reload.'); ?>
        </p>
        <!-- buttons -->
        <p>
            <input type='submit' class="btn btn-outline-secondary btn-large" value='<?php eT("Main admin screen"); ?>' onclick="window.open('<?php echo $this->createUrl('admin/'); ?>', '_top')" />
        </p>
    </div>
<!-- Import Failed -->
<?php elseif ($bFailed) :?>
    <div class="jumbotron message-box message-box-error">
        <h2 class="danger"><?php echo $sHeader;?></h2>
        <p class="lead text-danger">
            <?php eT("Error"); ?>
        </p>
        <!-- error message -->
        <p>
        <?php echo $sErrorMessage; ?>
        </p>
        <!-- buttons -->
... (166 lines truncated)
</file>

<file path="application/views/surveyAdministration/importSurveyResources_view.php">
<?php
if (!count($aErrorFilesInfo) && count($aImportedFilesInfo)) : ?>
    <div class='side-body'>
        <div class="row welcome survey-action">
            <div class="col-12 content-right">
                <div class="jumbotron message-box">
                    <h2><?php eT("Import survey resources"); ?></h2>
                    <p class="lead text-success">
                        <?php eT("Success"); ?>
                    </p>
                    <p>
                        <?php eT("Resources import summary"); ?>
                    </p>
                    <p>
                        <?php eT("Total imported files"); ?>: <?php echo count($aImportedFilesInfo); ?><br/>
                    </p>
                    <p>
                        <strong><?php eT("Imported files list:"); ?></strong>
                    </p>
                    <p>
                        <ul>
                            <?php
                            foreach ($aImportedFilesInfo as $entry) {
                                echo CHtml::tag('li', [], sprintf(gT("File: %s"), CHtml::encode($entry["filename"])));
                            }
                            ?>
                        </ul>
                    </p>
                    <p>
                        <input class="btn btn-outline-secondary btn-lg" type='submit' value='<?php eT("Back"); ?>' onclick="window.open('<?php echo $this->createUrl('surveyAdministration/rendersidemenulink/', ['surveyid' => $surveyid, 'subaction' => 'resources']); ?>', '_top')"/>
... (91 lines truncated)
</file>

<file path="application/views/surveyAdministration/listSurveys_view.php">
<?php
echo viewHelper::getViewTestTag('listSurveys');
?>
<div class="ls-space list-surveys">
    <ul class="nav nav-tabs" id="surveysystem" role="tablist">
        <li class="nav-item"><a class="nav-link active" href="#surveys" aria-controls="surveys" role="tab" data-bs-toggle="tab"><?php eT('Survey list'); ?></a></li>
        <li class="nav-item"><a class="nav-link" href="#surveygroups" aria-controls="surveygroups" role="tab" data-bs-toggle="tab"><?php eT('Survey groups'); ?></a></li>
    </ul>
    <div class="tab-content">
        <div id="surveys" class="tab-pane show active">
            <!-- Survey List widget -->
            <?php $this->widget('ext.admin.survey.ListSurveysWidget.ListSurveysWidget', array(
                        'pageSize' => Yii::app()->user->getState('pageSize', Yii::app()->params['defaultPageSize']),
                        'model' => $model,
                ));
                                                                                                                                    ?>
        </div>
        <div id="surveygroups" class="tab-pane">
            <div class="pagetitle h3 ls-space margin top-25"><?php eT('Survey groups'); ?></div>
            <div class="row">
                <div class="col-12 content-right">
                    <?php
                    $this->widget('application.extensions.admin.grid.CLSGridView', [
                        'id'               => 'surveygroups--gridview',
                        'dataProvider'     => $groupModel->search(),
                        'lsAfterAjaxUpdate'          => [],
                        'columns'          => $groupModel->columns,
                        'lsRowLink' => 'App()->createUrl("admin/surveysgroups/sa/update/",array("id"=>$data->gsid))',
                        'lsPageSizeCurrentValue'     => Yii::app()->user->getState('pageSizeTemplateView', Yii::app()->params['defaultPageSize']),
                    ]);
... (26 lines truncated)
</file>

<file path="application/views/surveyAdministration/newSurvey_view.php">
<?php
echo viewHelper::getViewTestTag('createSurvey');
?>
<!-- new survey view -->
<?php
extract($arrayed_data, EXTR_OVERWRITE);
$active = Yii::app()->request->getParam('tab', 'create');
?>
<script type="text/javascript">
    standardthemerooturl = '<?php echo Yii::app()->getConfig('standardthemerooturl');?>';
    templaterooturl = '<?php echo Yii::app()->getConfig('userthemerooturl');?>';
</script>
<div class="row">
    <div class="col-12">
        <!-- tabs -->
        <?php $this->renderPartial('tab_survey_view', $data); ?>
        <!-- tabs content -->
        <div class="tab-content">
            <!-- General Tab (contains accrodion) -->
            <div id="general" class="tab-pane fade <?= $active === 'create' ? 'show active' : '' ?>">
                <?php $this->renderPartial('tabCreate_view', ['data' => $data]); ?>
            </div>
        </div>
    </div>
</div>
</file>

<file path="application/views/surveyAdministration/sidebody.php">
<?php
?>
<style>
        transition: max-width 1s;
        transform: translate(0, 98px);
    }
        max-width: 50%;
        height: 60vh;
    }
        transition: height 1s;
        height: 77%;
        text-align: left;
        color:
    }
        height: 90%;
    }
        height: 100%;
        overflow-y: hidden;
    }
        display: none;
    }
    .btn.btn-collapse {
        border: 1px solid
    }
    .btn.btn-collapse:hover {
        color:
    }
        height: 100%;
        width: 100%;
    }
... (63 lines truncated)
</file>

<file path="application/views/surveyAdministration/stopSurvey_view.php">
<?php
?>
<div class='side-body stop-survey-body'>
    <div class="row">
        <div class="col-6 content-right">
            <h2>
                <?php printf(gT("You want to stop your survey %s?"), "<em>$surveyid</em>"); ?>
            </h2>
            <p>
                <?php eT("There are two ways to stop a survey. Please decide below:"); ?>
            </p>
            <div class="help-block">
                <?php
                App()->getController()->widget('ext.AlertWidget.AlertWidget', [
                    'text' => gT("Attention: Please read the following carefully before stopping your survey."),
                    'type' => 'warning',
                ]);
                ?>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-12 col-sm-6 col-xl-5">
            <div class="card card-primary h-100">
                <div class="card-header ">
                    <i class="ri-skip-forward-fill fs-4"></i>
                    <h5 class="card-title"><?php eT("Expiration"); ?></h5>
                </div>
                <div class="card-body px-0 d-flex">
                    <ul>
... (99 lines truncated)
</file>

<file path="application/views/surveyAdministration/surveySummary_view.php">
<?php
$count = 0;
if (!isset($iSurveyID)) {
    $iSurveyID = $oSurvey->sid;
}
echo viewHelper::getViewTestTag('surveySummary');
$count         = 0;
$surveyid      = $oSurvey->sid;
$templateModel = Template::model()->findByPk($oSurvey->oOptions->template);
$surveylocale  = Permission::model()->hasSurveyPermission($iSurveyID, 'surveylocale', 'read');
$surveysettings = Permission::model()->hasSurveyPermission($iSurveyID, 'surveysettings', 'read');
$respstatsread  = Permission::model()->hasSurveyPermission($iSurveyID, 'responses', 'read')
    || Permission::model()->hasSurveyPermission($iSurveyID, 'statistics', 'read')
    || Permission::model()->hasSurveyPermission($iSurveyID, 'responses', 'export');
?>
<!-- START surveySummary -->
<!-- <div class="row">
    <div class="col-12">
        <div class="h3 pagetitle">
            <?php eT('Survey summary'); ?> :
            <?php echo flattenText($oSurvey->currentLanguageSettings->surveyls_title) . " (" . gT("ID") . " " . $oSurvey->sid . ")"; ?>
        </div>
    </div>
</div> -->
<div class="ls-card-grid">
<?php
if (isset($surveyActivationFeedback)) {
    $this->renderPartial('/surveyAdministration/surveyActivation/_feedbackOpenAccess', ['surveyId' => $iSurveyID]);
}
?>
... (22 lines truncated)
</file>

<file path="application/views/surveyAdministration/tab_survey_view.php">
<?php
App()->getClientScript()->registerScript("tab-survey-view-variables", "
    var jsonUrl = '';
    var sAction = '';
    var sParameter = '';
    var sTargetQuestion = '';
    var sNoParametersDefined = '';
    var sAdminEmailAddressNeeded = '" . gT("If you are using token functions or notifications emails you need to set an administrator email address.", 'js') . "'
    var sURLParameters = '';
    var sAddParam = '';
", LSYii_ClientScript::POS_BEGIN);
$activeTab = Yii::app()->request->getParam('tab', 'create');
switch ($activeTab) {
    case 'create':
        $activeForm = 'addnewsurvey';
        $label = '<i class="ri-check-fill"></i>&nbsp;' . gT("Save");
        break;
    case 'copy':
        $activeForm = 'copysurveyform';
        $label = '<i class="ri-file-copy-line"></i>&nbsp;' . gT('Copy');
        break;
}
App()->getClientScript()->registerScript("tab-survey-view-tab-switch-conditions", "
    $('#save-form-button').attr('data-form-id', '" . $activeForm . "');
    $('#save-form-button').html('" . $label . "');
    $('#create-import-copy-survey>li>a').on('show.bs.tab', function(e){
        $('#save-form-button').attr('data-form-id', e.target.getAttribute('data-form-id'));
        // NB: button-title is equal to tab title except for 'Create' -> 'Save'
        $('#save-form-button').html($(e.target).data('button-title'));
    });
... (34 lines truncated)
</file>

<file path="application/views/surveyAdministration/tabCreate_view.php">
<?php
?>
<?php
extract($data);
Yii::app()->loadHelper('admin.htmleditor');
$cs = Yii::app()->getClientScript();
$cs->registerPackage('select2-bootstrap');
App()->getClientScript()->registerScript("tabCreate-view-variables", "
    var jsonUrl = '';
    var sAction = '';
    var sParameter = '';
    var sTargetQuestion = '';
    var sNoParametersDefined = '';
    var sAdminEmailAddressNeeded = '" . gT("If you are using surveys with a closed participant group or notifications emails you need to set an administrator email address.", 'js') . "'
    var sURLParameters = '';
    var sAddParam = '';
    var standardthemerooturl='" . Yii::app()->getConfig('standardthemerooturl') . "';
    var templaterooturl='" . Yii::app()->getConfig('userthemerooturl') . "';
    var formId = 'addnewsurvey';
", LSYii_ClientScript::POS_BEGIN);
?>
<!-- Form submitted by save button menu bar -->
<?php echo CHtml::form(array('surveyAdministration/insert'), 'post', array('id' => 'addnewsurvey', 'name' => 'addnewsurvey', 'class' => '')); ?>
<!-- Submit button, needs to be the first item for the script to take it -->
<button role="button" class="btn btn-primary btn-primary d-none" type="submit" name="save" id="create_survey_save_and_send" value='insertsurvey'>
    <?php eT("Finish & save"); ?>
</button>
<div class="ls-flex-row align-items-center align-content-center">
    <div class="grow-10 ls-space padding left-10 right-10">
        <div>
... (167 lines truncated)
</file>

<file path="application/views/surveyAdministration/tabImport_view.php">
<?php
?>
<!--<div class="ls-flex-row wrap align-content-center align-items-center">-->
<div class="ls-flex-row">
    <div class="grow-10 ls-space padding left-10 right-10">
        <div class="">
            <!-- tab import survey -->
            <!-- import form -->
            <?php echo CHtml::form(array('surveyAdministration/import'), 'post', array('id' => 'importsurvey', 'name' => 'importsurvey', 'class' => '', 'enctype' => 'multipart/form-data', 'onsubmit' => 'return window.LS.validatefilename(this,"' . gT('Please select a file to import!', 'js') . '");')); ?>
            <div class="row">
                <!-- Select file -->
                <div class="mb-3 col-4">
                    <label class='form-label ' for='the_file'>
                        <?php printf(gT("Select survey structure file (*.lss, *.txt) or survey archive (*.lsa) (maximum file size: %01.2f MB)"), getMaximumFileUploadSize() / 1024 / 1024); ?>
                    </label>
                    <div>
                        <input id='the_file' name="the_file" class="form-control" type="file" accept='.lss,.lsa,.tsv,.txt' onchange="$('#import-submit').attr('disabled', false).attr('data-bs-toggle', false);" required />
                    </div>
                </div>
            <!-- Survey group to use -->
            <div class='form-group col-4'>
                <label class='control-label ' for='surveysgroup'><?php  eT("Survey group:"); ?> </label>
                <div class=''>
                    <?php $this->widget('yiiwheels.widgets.select2.WhSelect2', [
                        'asDropDownList' => true,
                        'htmlOptions' => [],
                        'data' => [
                            'default' => gT("Import to default survey group"),
                            'from_survey' => gT("Keep the survey group from the imported file"),
                        ],
... (47 lines truncated)
</file>

<file path="application/views/surveyPermissions/partial/editpermission.php">
<?php
Yii::app()->getController()->renderPartial(
    '/layouts/partial_modals/modal_header',
    ['modalTitle' => gT("Edit permissions")]
);
?>
<?php  echo CHtml::form(array("surveyPermissions/savePermissions/surveyid/{$surveyid}")); ?>
    <div class="modal-body selector--edit-permissions-container">
        <table id='UserManagement--userpermissions-table' class='activecell table table-striped'>
            <thead>
                <tr>
                    <th></th>
                    <th><?php eT("Permission"); ?></th>
                    <th><?php eT("General"); ?></th>
                    <th><?php eT("Create"); ?></th>
                    <th><?php eT("View/read"); ?></th>
                    <th><?php eT("Update"); ?></th>
                    <th><?php eT("Delete"); ?></th>
                    <th><?php eT("Import"); ?></th>
                    <th><?php eT("Export"); ?></th>
                </tr>
            </thead>
        <!-- Permissions -->
        <?php $hasIndeterminate = false; ?>
        <tbody>
            <?php foreach ($aPermissions as $sPermission => $aCurrentPermissions) : ?>
                <tr>
                    <td>
                        <i class="<?php echo $aCurrentPermissions['img'] ?> text-success"></i>
                        <?= $aCurrentPermissions['description'] ?>
... (56 lines truncated)
</file>

<file path="application/views/surveyPermissions/_overview_table.php">
<?php
?>
<table class='surveysecurity table table-striped table-hover'>
    <thead>
    <tr>
        <th> <?= gT("Action") ?> </th>
        <th> <?= gT("Username") ?> </th>
        <th> <?= gT("User group") ?> </th>
        <th> <?= gT("Full name") ?> </th>
        <?php foreach ($basePermissions as $sPermission => $aSubPermissions) {
            echo "<th>" . $aSubPermissions['title'] . "</th>\n";
        } ?>
    </tr>
    </thead>
    <tbody>
    <?php
    foreach ($tableContent as $content) {
        ?>
        <tr>
            <td class='text-center button-column'>
                <div class="icon-btn-row">
                    <?php if (Permission::model()->hasSurveyPermission($surveyid, 'surveysecurity', 'update')) { ?>
                        <a class="btn btn-outline-secondary btn-sm"
                           href="<?php echo Yii::app()->createUrl("surveyPermissions/settingsPermissions/", [
                               'surveyid' => $surveyid,
                               'action' => 'user',
                               'id' => $content->uid
                           ]); ?>" data-bs-toggle='tooltip' title="<?= gT("Edit permissions") ?>">
                            <span class='ri-pencil-fill text-success'></span>
                        </a>
... (52 lines truncated)
</file>

<file path="application/views/surveyPermissions/index.php">
<?php
?>
<div id='edit-permission' class='side-body position-relative  ls-settings-wrapper"'>
    <?php echo viewHelper::getViewTestTag('surveyPermissions'); ?>
    <h1><?= gT("Survey permissions") ?></h1>
    <div class="row pt-2 pb-2 align-items-center">
        <div class="col-12 align-items-center">
            <?php
            if ($userCreatePermission) {
                echo CHtml::form(
                    ["surveyPermissions/adduser/surveyid/{$surveyid}"],
                    'post',
                    ['class' => "form44"]
                ); ?>
                <?php
                $showUserListHint = $userListFilteredByGroup && count($userList) === 0;
                $userListHint = gT("Only users who share a user group with you, or who were created by you, can be added. An administrator can change this with the global setting 'Group member can only see own group'.", 'unescaped');
                ?>
                <div class="row justify-content-md-end mb-2">
                    <div class='col-1 text-end text-nowrap'>
                        <?php if ($showUserListHint) : ?>
                            <button type='button' class='btn btn-link p-0 align-baseline'
                                data-bs-toggle='tooltip'
                                title='<?= CHtml::encode($userListHint) ?>'
                                aria-label='<?= CHtml::encode($userListHint) ?>'>
                                <i class='ri-information-line' aria-hidden='true'></i>
                            </button>
                        <?php endif; ?>
                        <label class='control-label' for='uidselect'>
                            <?= gT("User") ?>:
... (145 lines truncated)
</file>

<file path="application/views/surveyPermissions/settingsPermission.php">
<?php
?>
<div id='edit-permission' class='side-body'>
    <h3>
        <?php
        if ($isUserGroup) {
            echo sprintf(gT("Edit survey permissions for user group %s"), "<em>" . \CHtml::encode($name) . "</em>");
        } else {
            echo sprintf(gT("Edit survey permissions for user %s"), "<em>" . \CHtml::encode($name) . "</em>");
        }
        ?>
    </h3>
    <div class="row" id="trigger-save-button">
        <div class="col-lg-12 content-right">
            <?php echo CHtml::form(
                array("surveyPermissions/savePermissions/surveyid/{$surveyid}")
            );
            echo App()->getController()->widget(
                'ext.UserPermissionsWidget.UserPermissionsWidget',
                ['aPermissions' => $aPermissions],
                true
            );?>
            <input class='btn btn-outline-secondary d-none'  type='submit' value='<?=gT("Save Now") ?>' />
            <?php
            if ($isUserGroup) { ?>
                    <input type='hidden' name='ugid' value="<?= $id?>" />
                    <input type='hidden' name='action' value='usergroup' />
                <?php
            } else {?>
                    <input type='hidden' name='uid' value="<?= $id?>" />
... (8 lines truncated)
</file>

<file path="application/views/surveys/display.php">
<?php
    echo $content;
</file>

<file path="application/views/SurveysGroupsPermission/subviews/addGroupForm.php">
<?php
    $this->renderPartial(
        '/admin/super/permissions/addGroupForm',
        array(
            'action' => array("surveysGroupsPermission/addUserGroup", 'id' => $model->gsid),
            'oAddGroupList' => $oAddGroupList
        )
    );
</file>

<file path="application/views/SurveysGroupsPermission/subviews/addUserForm.php">
<?php
    $this->renderPartial(
        '/admin/super/permissions/addUserForm',
        array(
            'action' => array("surveysGroupsPermission/addUser", 'id' => $model->gsid),
            'oAddUserList' => $oAddUserList
        )
    );
</file>

<file path="application/views/SurveysGroupsPermission/subviews/addUserGroupResult.php">
<div class="jumbotron">
    <h2 class="pagetitle h3"><?php eT('Add user group');?></h2>
    <?php if ($result['warning']) : ?>
        <?php
        $this->widget('ext.AlertWidget.AlertWidget', [
        'text' => $result['warning'],
        'type' => 'warning',
        ]);
        ?>
    <?php endif ?>
    <?php if ($result['success']) : ?>
        <?php
        $this->widget('ext.AlertWidget.AlertWidget', [
            'text' => $result['success'],
            'type' => 'success',
        ]);
        ?>
    <?php endif ?>
    <?php if ($result['error']) : ?>
        <?php
        $this->widget('ext.AlertWidget.AlertWidget', [
            'text' => $result['error'],
            'type' => 'error',
        ]);
        ?>
    <?php endif ?>
    <p><?php
        echo CHtml::link(
            gT("Set the permission for this user group on this group."),
            array( "surveysGroupsPermission/viewUserGroup", 'id' => $model->gsid, 'to' => $ugid),
... (5 lines truncated)
</file>

<file path="application/views/SurveysGroupsPermission/subviews/addUserResult.php">
<div class="jumbotron">
    <h2 class="pagetitle h3"><?php eT('Add user');?></h2>
    <?php if ($result['warning']) : ?>
        <?php
        $this->widget('ext.AlertWidget.AlertWidget', [
            'text' => $result['warning'],
            'type' => 'warning',
        ]);
        ?>
    <?php endif ?>
    <?php if ($result['success']) : ?>
        <?php
        $this->widget('ext.AlertWidget.AlertWidget', [
            'text' => $result['success'],
            'type' => 'success',
        ]);
        ?>
    <?php endif ?>
    <?php if ($result['error']) : ?>
        <?php
        $this->widget('ext.AlertWidget.AlertWidget', ['errorSummaryModel' => $result['error']]);
        ?>
    <?php endif ?>
    <p><?php
        echo CHtml::link(
            gT("Set the permission for this user on this group."),
            array( "surveysGroupsPermission/viewUser", 'id' => $model->gsid, 'to' => $uid),
            array('class' => 'btn btn-outline-secondary')
        );
        ?> </p>
... (2 lines truncated)
</file>

<file path="application/views/SurveysGroupsPermission/subviews/currentUsersList.php">
<?php if (!empty($oExistingUsers)) : ?>
    <h3 class="pagetitle h2"><?php eT('Current permissions:') ?></h3>
    <div class="table-responsive">
        <table class='table table-hover'>
            <thead>
            <tr>
                <th><?= eT("Action") ?></th>
                <th><?= eT("Username") ?></th>
                <th><?= eT("Full name") ?></th>
                <?php foreach ($aDefinitionPermissions as $sPermission => $aPermission) : ?>
                    <th><?= $aPermission['title'] ?></th>
                <?php endforeach; ?>
            </tr>
            </thead>
            <tbody>
            <?php foreach ($oExistingUsers as $oUser) : ?>
                <tr>
                    <td>
                        <div class="icon-btn-row">
                            <?php if ($model->hasPermission('permission', 'update')) : ?>
                                <a href="<?= $this->createUrl("surveysGroupsPermission/viewUser", ['id' => $model->gsid, 'to' => $oUser->uid]); ?>" class="btn btn-outline-secondary btn-sm" role="button">
                            <span class="ri-pencil-fill text-success" aria-hidden="true" title="<?= gT("Edit permissions") ?>"><span>
                            <span class="visually-hidden"><?= gT("Edit permissions") ?></span>
                                </a>
                            <?php endif; ?>
                            <?php if ($model->hasPermission('permission', 'delete')) : ?>
                                <?php $deleteUrl = App()->createUrl(
                                    "surveysGroupsPermission/deleteUser",
                                    [
                                        'id'  => $model->gsid,
... (34 lines truncated)
</file>

<file path="application/views/SurveysGroupsPermission/subviews/deleteUserResult.php">
<div class="jumbotron">
    <h2 class="pagetitle h3"><?= gT('Delete user');?></h2>
    <?php
    $this->widget('ext.AlertWidget.AlertWidget', [
        'text' => sprintf(gT("User permissions deleted for: %s"), CHtml::encode($oUser->users_name)),
        'type' => 'success',
    ]);
    ?>
    <p><?php
        echo CHtml::link(
            gT("Continue"),
            array( "surveysGroupsPermission/index", 'id' => $model->gsid),
            array('class' => 'btn btn-outline-secondary')
        );
        ?> </p>
</div>
</file>

<file path="application/views/SurveysGroupsPermission/subviews/setPermissionForm.php">
<?php
    echo CHtml::beginForm(
        array( "surveysGroupsPermission/save", 'id' => $model->gsid),
        'post',
        array('class' => 'setPermissionsForm', 'id' => 'permissionsSave')
    ); ?>
    <h2 class="pagetitle h3"><?php if ($type == 'user') {
        printf(gT("Set permission for user: %s"), "<em>" . CHtml::encode($oUser->users_name) . "</em>");
                             } else {
                                 printf(gT("Set permission for user group: %s"), "<em>" . CHtml::encode($oUserGroup->name) . "</em>");
                             } ?></h2>
    <?php $this->widget(
        'ext.UserPermissionsWidget.UserPermissionsWidget',
        ['aPermissions' => $aPermissions]
    ); ?>
    <!-- Hidden inputs -->
    <?php
    if ($type == 'user') {
        echo CHtml::hiddenField('uid', $oUser->uid);
    } else {
        echo CHtml::hiddenField('ugid', $oUserGroup->ugid);
        echo CHtml::hiddenField('type', 'group');
    }
        echo CHtml::htmlButton(
            gT("Save"),
            array(
                'type' => 'submit',
                'name' => 'save',
                'value' => 'save',
                'class' => 'd-none'
... (5 lines truncated)
</file>

<file path="application/views/SurveysGroupsPermission/subviews/viewCurrents.php">
<div class="well">
    <p><?= gT("Users listed here can see groups in lists, and view group descriptions & settings. This is the minimal permission - you have to use the delete action to remove this permission.") ?></p>
    <p><?= gT("This survey group is shown for users with any permission to the survey group, user with any permission to one survey inside this group, or if this group was configured to be available.") ?></p>
</div>
<?php if (!empty($oExistingUsers)) {
    $this->renderPartial(
        '/SurveysGroupsPermission/subviews/currentUsersList',
        array(
            'model' => $model,
            'aDefinitionPermissions' => $aDefinitionPermissions,
            'oExistingUsers' => $oExistingUsers,
            'aCurrentsUserRights' => $aCurrentsUserRights,
        )
    );
} ?>
<?php if ($model->hasPermission('permission', 'create')) : ?>
    <h2 class="pagetitle h3"><?php eT('Add permissions:'); ?></h2>
    <?php if (!empty($oAddUserList)) {
        $this->renderPartial('/SurveysGroupsPermission/subviews/addUserForm', array('model' => $model, 'oAddUserList' => $oAddUserList));
    } ?>
    <?php if (!empty($oAddGroupList)) {
        $this->renderPartial('/SurveysGroupsPermission/subviews/addGroupForm', array('model' => $model, 'oAddGroupList' => $oAddGroupList));
    } ?>
<?php endif; ?>
</file>

<file path="application/views/SurveysGroupsPermission/index.php">
<div class="row">
    <div class="col-12 list-surveys">
        <?php
        $this->renderPartial('/SurveysGroupsPermission/subviews/' . $subview, $aPermissionData);
        ?>
    </div>
</div>
</file>

<file path="application/views/themeOptions/partial/topbarBtns/leftSideButtons.php">
<?php
if ($canImport) {
    $this->widget(
        'ext.ButtonWidget.ButtonWidget',
        [
            'name' => 'uploadandinstall',
            'id' => 'uploadandinstall',
            'text' => gT('Upload & install'),
            'icon' => 'ri-download-2-fill',
            'htmlOptions' => [
                'class' => 'btn btn-outline-secondary',
                'data-bs-target' => '#importSurveyModal',
                'data-bs-toggle' => 'modal',
                'role' => 'button',
            ],
        ]
    );
} else { ?>
<span class="btntooltip" data-bs-toggle="tooltip" data-bs-placement="bottom"
      title="<?php echo $importErrorMessage; ?>"
      style="display: inline-block">
    <?php
    $this->widget(
        'ext.ButtonWidget.ButtonWidget',
        [
            'name' => 'uploadandinstall',
            'id' => 'uploadandinstall',
            'text' => gT('Upload & install'),
            'icon' => 'icon-download-2-fill',
            'htmlOptions' => [
... (8 lines truncated)
</file>

<file path="application/views/themeOptions/_selector.php">
<?php
?>
<!-- Rendering massive action widget -->
<?php
    $this->widget('ext.admin.grid.MassiveActionsWidget.MassiveActionsWidget', array(
        'pk'          => $pk,
        'gridid'      => $gridID,
        'dropupId'    => $dropupID,
        'dropUpText'  => gT('Selected theme(s)...'),
        'aActions'    => array(
            array(
                'type' => 'action',
                'action' => 'reset',
                'url' => App()->createUrl('themeOptions/resetMultiple/'),
                'iconClasses' => 'ri-refresh-line',
                'text' => gT('Reset'),
                'grid-reload' => 'yes',
                'actionType'    => 'modal',
                'modalType'     => 'cancel-apply',
                'keepopen'      => 'yes',
                'showSelected'  => 'yes',
                'selectedUrl'   => App()->createUrl('themeOptions/selectedItems/'),
                'yes'           => gT('Reset'),
                'no'            => gT('Cancel'),
                'sModalTitle'   => gT('Reset themes'),
                'htmlModalBody' => gT('Are you sure you want to reset the selected themes?'),
            ),
            array(
                'type'        => 'action',
                'action'      => 'Uninstall',
... (16 lines truncated)
</file>

<file path="application/views/themeOptions/advanced.php">
<div role="tabpanel" class="tab-pane <?php echo Yii::app()->getConfig('debug') > 1 ? '' : 'd-none'; ?>" id="advanced">
    <?php
    $this->widget('ext.AlertWidget.AlertWidget', [
    'text' => gT('All fields below (except CSS framework name) must be either a valid JSON array or the string "inherit".'),
    'type' => 'info',
    ]);
    $this->widget('ext.AlertWidget.AlertWidget', [
        'text' => '<strong>' . gT('Warning') . '</strong> ' . gT("Don't touch the values below unless you know what you're doing."),
        'type' => 'warning',
    ]);
    ?>
    <div class="row ls-space margin bottom-15">
        <div class="row mb-3">
            <div class="col-4">
                <label>
                    <?php printf(gT("Upload an image (maximum size: %d MB):"), getMaximumFileUploadSize() / 1024 / 1024); ?>
                </label>
            </div>
            <div class="col-8">
                <?php ?>
                <span id="fileselector">
                    <label class="btn btn-outline-secondary" for="upload_image">
                        <input class="d-none" id="upload_image" name="upload_image" type="file">
                        <i class="ri-upload-fill ls-space margin right-10"></i><?php eT("Upload"); ?>
                    </label>
                </span>
            </div>
        </div>
        <div class="row">
            <div class="col-12">
... (76 lines truncated)
</file>

<file path="application/views/themeOptions/availablethemelist.php">
<?php
$aQuestionThemes = $oQuestionTheme->getAvailableQuestionThemes();
?>
<?php if (!empty($aQuestionThemes['available_themes'])) : ?>
    <h3><?php eT('Available question themes:'); ?></h3>
    <div class="row">
        <div class="col-sm-12 content-right">
            <div id="templates_no_db" >
                <table class="items table table-hover">
                    <thead>
                        <tr>
                            <th><?php eT('Preview'); ?></th>
                            <th><?php eT('Folder'); ?></th>
                            <th><?php eT('Description'); ?></th>
                            <th><?php eT('Type'); ?></th>
                            <th><?php eT('Extends'); ?></th>
                            <th></th>
                        </tr>
                    </thead>
                    <tbody>
                    <?php foreach ($aQuestionThemes['available_themes'] as $oTheme) : ?>
                        <tr class="odd">
                            <td class="col-lg-1">preview</td>
                            <td class="col-lg-2"><?php echo CHtml::encode($oTheme->name); ?></td>
                            <td class="col-lg-3"><?php echo CHtml::encode($oTheme->description); ?></td>
                            <td class="col-lg-2"><?php eT('XML themes'); ?></td>
                            <td class="col-lg-2"><?php echo $oTheme->extends; ?></td>
                            <td class="col-lg-1"><?php echo $oTheme->manifestbuttons; ?></td>
                        </tr>
                    <?php endforeach; ?>
... (33 lines truncated)
</file>

<file path="application/views/themeOptions/import_modal.php">
<?php
$fileMaxSizeHintId = $importModal . '-file-max-size-hint';
?>
<div class="modal fade" tabindex="-1" role="dialog" id="<?php echo $importModal;?>">
    <div class="modal-dialog">
        <div class="modal-content">
            <?php echo CHtml::form(
                array('admin/themes/sa/upload'),
                'post',
                array(
                            'id' => $importTemplate,
                            'name' => $importTemplate,
                            'enctype' => 'multipart/form-data',
                            'onsubmit' => 'return window.LS.validatefilename(this,"' . gT('Please select a file to import!', 'js') . '");'
                    )
            ); ?>
            <?php
            Yii::app()->getController()->renderPartial(
                '/layouts/partial_modals/modal_header',
                ['modalTitle' => gT("Upload and install theme file")]
            );
            ?>
                <div class="modal-body">
                    <input type='hidden' name='lid' value='$lid' />
                    <input type='hidden' name='action' value='templateupload' />
                    <?php if (isset($themeType)) : ?>
                        <input type='hidden' name='theme' value='<?php echo $themeType; ?>'/>
                    <?php endif; ?>
                    <div class="mb-3">
                        <label for='the_file' class="form-label">
... (30 lines truncated)
</file>

<file path="application/views/themeOptions/index.php">
<?php
echo viewHelper::getViewTestTag('templateOptions');
?>
<div class="list-themes">
    <ul class="nav nav-tabs" id="themelist" role="tablist">
        <li class="nav-item" role="presentation">
            <a class="nav-link active" id="surveythemes-tab" href="#surveythemes" data-bs-toggle="tab" role="tab" aria-controls="surveythemes" aria-selected="true">
                <?php eT('Survey themes'); ?>
            </a>
        </li>
        <li class="nav-item" role="presentation">
            <a class="nav-link" id="adminthemes-tab" href="#adminthemes" data-bs-toggle="tab" role="tab" aria-controls="adminthemes" aria-selected="false">
                <?php eT('Admin themes'); ?>
            </a>
        </li>
        <li class="nav-item" role="presentation">
            <a class="nav-link" id="questionthemes-tab" href="#questionthemes" data-bs-toggle="tab" role="tab" aria-controls="questionthemes" aria-selected="false">
                <?php eT('Question themes'); ?>
            </a>
        </li>
    </ul>
    <div class="tab-content" id="themelistContent">
        <div id="surveythemes" class="tab-pane active" role="tabpanel" aria-labelledby="surveythemes-tab">
            <div class="list-surveys">
                <h2 class="h3"><?= gT('Installed survey themes:') ?></h2>
                <?php $this->renderPartial('./surveythemelist', [
                        'oSurveyTheme' => $oSurveyTheme,
                        'pageSize'     => $pageSize
                    ]); ?>
                <!-- Available Themes -->
... (292 lines truncated)
</file>

<file path="application/views/themeOptions/installedthemelist.php">
<?php
?>
<?php
require_once Yii::getPathOfAlias('application.extensions.admin.grid.FloatingActionsWidget.actions.QuestionThemeMassiveActions') . '.php';
$aFloatingActions = \actions\QuestionThemeMassiveActions::getActions();
$this->widget('application.extensions.admin.grid.CLSGridView', [
    'dataProvider'          => $oQuestionTheme->search(),
    'filter'                => $oQuestionTheme,
    'id'                    => 'questionthemes-grid',
    'lsCaption'             => gT('Question themes'),
    'lsPageSizeCurrentValue'  => $pageSize,
    'columns'               => [
        [
            'id'             => 'questionId',
            'class'          => 'CCheckBoxColumn',
            'selectableRows' => '100',
            'checkBoxHtmlOptions' => ['class' => 'massiveActionsCheckbox'],
        ],
        [
            'header'      => gT('Name'),
            'name'        => 'name',
            'value'       => '$data->name',
            'htmlOptions' => ['class' => 'col-lg-2'],
        ],
        [
            'header'      => gT('Description'),
            'name'        => 'description',
            'value'       => '$data->description',
            'htmlOptions' => ['class' => 'col-lg-3'],
        ],
... (44 lines truncated)
</file>

<file path="application/views/themeOptions/options_core.php">
<?php
$bInherit = (!empty($aTemplateConfiguration['sid']) || !empty($aTemplateConfiguration['gsid']));
$dropdown_options['font'] = ($bInherit ? '<option value="inherit">' . gT("Inherit") . ' [' . gT(
    "Inherited value:"
) . ' ' . (isset($oParentOptions['font']) ? $oParentOptions['font'] : '') . ']</option>' : '');
/** @var string The html for image file dropdown options */
$imageOptions = '';
$optgroup = '';
foreach ($aTemplateConfiguration['imageFileList'] as $image) {
    if ($image['group'] != $optgroup) {
        if ($optgroup != '') {
            $imageOptions .= '</optgroup>';
        }
        $imageOptions .= '<optgroup label="' . $image['group'] . '">';
        $optgroup = $image['group'];
    }
    $imageOptions .= '<option data-lightbox-src="' . $image['preview'] . '" value="' . $image['filepath'] . '">' . $image['filename'] . '</option>';
}
foreach ($aOptionAttributes['optionAttributes'] as $attributeName => &$attribute) {
    if ($attribute['type'] == 'imagefile') {
        if (!isset($oParentOptions[$attributeName])) {
            continue;
        }
        if (isset($aTemplateConfiguration['imageFileList'][$oParentOptions[$attributeName]])) {
            $image = $aTemplateConfiguration['imageFileList'][$oParentOptions[$attributeName]];
            $attribute['preview'] = $image['preview'];
            $attribute['filename'] = $image['filename'];
        } else {
            $attribute['preview'] = '';
            $attribute['filename'] = '';
... (361 lines truncated)
</file>

<file path="application/views/themeOptions/surveythemelist.php">
<?php
require_once Yii::getPathOfAlias('application.extensions.admin.grid.FloatingActionsWidget.actions.SurveyThemeMassiveActions') . '.php';
$aFloatingActions = \actions\SurveyThemeMassiveActions::getActions();
$this->widget(
    'application.extensions.admin.grid.CLSGridView',
    [
        'dataProvider' => $oSurveyTheme->searchGrid(),
        'filter' => $oSurveyTheme,
        'id' => 'themeoptions-grid',
        'lsCaption' => gT('Survey themes'),
        'lsPageSizeCurrentValue'  => $pageSize,
        'columns' => [
            [
                'id' => 'id',
                'class' => 'CCheckBoxColumn',
                'selectableRows' => '100',
            ],
            [
                'header' => gT('Preview'),
                'name' => 'preview',
                'value' => '$data->preview',
                'type' => 'raw',
                'htmlOptions' => ['class' => 'col-lg-1'],
                'filter' => false,
            ],
            [
                'header' => gT('Name'),
                'name' => 'template_name',
                'value' => '"<strong>".CHtml::encode($data->template->title)."</strong>" ."<br>" .CHtml::encode($data->template_name)',
                'htmlOptions' => ['class' => 'col-lg-2'],
... (59 lines truncated)
</file>

<file path="application/views/themeOptions/surveythememenu.php">
<?php
if (Permission::model()->hasGlobalPermission('templates', 'import')) {
     $this->renderPartial(
         './import_modal',
         [
            'importModal' => $importModal,
            'importTemplate' => $importTemplate,
            'themeType' => $themeType
         ]
     );
}
</file>

<file path="application/views/themeOptions/theme_buttons.php">
<?php
$this->widget('ext.ButtonGroupWidget.ButtonGroupWidget', [
    'name' => 'toggle_question_theme' . $id,
    'id' => 'toggle_question_theme' . $id,
    'checkedOption' => $buttons['visibility_button']['visible'],
    'selectOptions' => [
        '1' => gT('On'),
        '0' => gT('Off'),
    ],
    'htmlOptions' => [
        'class' => 'toggle_question_theme',
        'data-url' => $buttons['visibility_button']['url']
    ]
]);
</file>

<file path="application/views/themeOptions/update.php">
<?php
echo viewHelper::getViewTestTag('surveyTemplateOptionsUpdate');
?>
<?php if (empty($model->sid)) : ?>
<div class="">
<?php else : ?>
    <div class="col-12 side-body ls-settings-wrapper" id="theme-option-sidebody">
<?php endif; ?>
    <!-- Using bootstrap tabs to differ between just the options and advanced direct settings -->
    <div class="row">
        <div class="col-12">
            <!-- Nav tabs -->
            <ul class="nav nav-tabs" id="theme-options-tabs" role="tablist">
                <?php if ($aOptionAttributes['optionsPage'] === 'core') : ?>
                    <?php foreach ($aOptionAttributes['categories'] as $key => $category) : ?>
                        <li role="presentation" class="nav-item">
                            <button class="nav-link <?php echo $key == 0 ? 'active' : 'tab_action_hide_on_inherit'; ?>" data-bs-target="#category-<?php echo $key; ?>"
                                    aria-controls="category-<?php echo $key; ?>" role="tab" data-bs-toggle="tab" aria-selected="<?php echo $key == 0 ? 'true' : 'false'; ?>">
                                <?php eT($category); ?>
                            </button>
                        </li>
                    <?php endforeach; ?>
                <?php else : ?>
                    <li role="presentation" class="nav-item">
                        <button class="nav-link active" data-bs-target="#simple" aria-controls="home" role="tab" data-bs-toggle="tab" aria-selected="true">
                            <?php eT('Simple options') ?>
                        </button>
                    </li>
                <?php endif; ?>
                <li role="presentation" class="nav-item">
... (77 lines truncated)
</file>

<file path="application/views/userGroup/partial/topbarBtns/leftSideButtons.php">
<?php
$this->widget(
    'ext.ButtonWidget.ButtonWidget',
    [
        'name' => 'createnewmenuentry',
        'id' => 'createnewmenuentry',
        'text' => gT('Add user group'),
        'icon' => 'ri-user-add-line',
        'link' => $this->createUrl("userGroup/addGroup"),
        'htmlOptions' => [
            'class' => 'btn btn-primary',
        ],
    ]
);
</file>

<file path="application/views/userGroup/partial/topbarBtns/rightSideButtons.php">
<?php
if ($addGroupSave) {
    $this->widget(
        'ext.ButtonWidget.ButtonWidget',
        [
            'name' => 'save-form-button',
            'id' => 'save-form-button',
            'text' => gT('Save'),
            'icon' => 'ri-check-fill',
            'htmlOptions' => [
                'class' => 'btn btn-primary',
                'data-form-id' => 'usergroupform',
                'type' => 'submit',
                'role' => 'button'
            ],
        ]
    );
}
</file>

<file path="application/views/userGroup/partial/topbarBtns_mail/rightSideButtons.php">
<?php
$this->widget(
    'ext.ButtonWidget.ButtonWidget',
    [
        'name' => 'reset-form-button',
        'id' => 'reset-form-button',
        'text' => gT('Reset'),
        'icon' => 'ri-refresh-line',
        'htmlOptions' => [
            'class' => 'btn btn-warning',
            'role' => 'button',
            'type' => 'reset',
            'form' => 'mailusergroup'
        ],
    ]
);
$this->widget(
    'ext.ButtonWidget.ButtonWidget',
    [
        'name' => 'reset-form-button',
        'id' => 'save-form-button',
        'text' => gT('Send'),
        'icon' => 'ri-mail-fill',
        'htmlOptions' => [
            'class' => 'btn btn-primary',
            'type' => 'submit',
            'data-form-id' => 'mailusergroup'
        ],
    ]
);
... (1 lines truncated)
</file>

<file path="application/views/userGroup/partial/topbarBtns_manageGroup/leftSideButtons.php">
<?php
if ($hasPermission) {
    $this->widget(
        'ext.ButtonWidget.ButtonWidget',
        [
            'name' => 'group-mail-button',
            'id' => 'group-mail-button',
            'text' => gT('Mail to all members'),
            'icon' => 'ri-mail-send-fill',
            'link' => $this->createUrl("userGroup/mailToAllUsersInGroup/ugid/" . $userGroupId),
            'htmlOptions' => [
                'class' => 'btn btn-outline-secondary',
            ],
        ]
    );
}
if ($hasPermission) {
    $this->widget(
        'ext.ButtonWidget.ButtonWidget',
        [
            'name' => 'group-edit-button',
            'id' => 'group-edit-button',
            'text' => gT('Edit current user group'),
            'icon' => 'ri-pencil-fill',
            'link' => $this->createUrl("userGroup/edit/ugid/" . $userGroupId),
            'htmlOptions' => [
                'class' => 'btn btn-outline-secondary',
            ],
        ]
    );
... (25 lines truncated)
</file>

<file path="application/views/userGroup/_addUserDropdown.php">
<?php
?>
<?php
if (!empty($useradddialog)) {
    ?>
    <?php echo CHtml::form(["userGroup/AddUserToGroup"], 'post'); ?>
    <table class='users'>
        <tbody>
        <tr>
            <td>
                <div class="row">
                    <div class="col-xl-8">
                        <?php echo CHtml::dropDownList('uid', '-1', $addableUsers, ['class' => "form-select col-xl-4"]); ?>
                        <input name='ugid' type='hidden' value='<?php echo $ugid; ?>'/>
                    </div>
                    <div class="col-xl-4">
                        <input type='submit' value='<?php eT("Add user"); ?>' class="btn btn-outline-secondary"/>
                    </div>
                </div>
            </td>
        </tr>
        </tbody>
    </table>
    <?php echo CHtml::endForm() ?>
    <?php
}
?>
</file>

<file path="application/views/userGroup/addUserGroup_view.php">
<div class="col-12 list-surveys">
    <div class="row">
        <div class="col-lg-8 offset-lg-2 content-right">
            <?php echo CHtml::form(array("userGroup/addGroup"), 'post', array('class' => '', 'id' => 'usergroupform')); ?>
                <!-- Name -->
                <div class="mb-3 col-12">
                    <label for='group_name' class="form-label">
                        <?php eT("Name:"); ?>
                    </label>
                    <div class="default controls">
                        <input type='text' size='50' maxlength='20' id='group_name' name='group_name' required="required" autofocus="autofocus" class="form-control"/>
                    </div>
                </div>
                <!-- Description -->
                <div class="mb-3 col-12">
                    <label for='group_description' class="form-label">
                        <?php eT("Description:"); ?>
                    </label>
                    <div class="default controls">
                        <textarea cols='50' rows='4' id='group_description' name='group_description'  class="form-control"></textarea>
                    </div>
                </div>
                <!-- Buttons -->
                <p>
                    <input type='submit' value='<?php eT("Add group"); ?>' class="d-none" />
                    <input type='hidden' name='action' value='saveusergroup'  />
                </p>
            </form>
        </div>
    </div>
... (2 lines truncated)
</file>

<file path="application/views/userGroup/editUserGroup_view.php">
<?php
?>
<div class="col-12 list-surveys">
    <div class="row">
        <?php echo CHtml::form(array("userGroup/edit/ugid/{$ugid}"), 'post', array('class' => 'col-lg-6 offset-lg-3', 'id' => 'usergroupform', 'name' => 'usergroupform')); ?>
            <div class="mb-3">
                <label class="form-label" for='name'><?php eT("Name:"); ?></label>
                <input type='text' size='50' maxlength='20' id='name' name='name' value="<?php echo htmlspecialchars((string) $model['name'], ENT_QUOTES, 'UTF-8'); ?>" class="form-control" />
            </div>
            <div class="mb-3">
                <label class="form-label " for='description'><?php eT("Description:"); ?></label>
                <textarea cols='50' rows='4' id='description' name='description' class="form-control"><?php echo htmlspecialchars((string) $model['description'], ENT_QUOTES, 'UTF-8'); ?></textarea>
            </div>
            <input type='submit' value='<?php eT("Update user group"); ?>' class="d-none" />
            <input type='hidden' name='action' value='editusergroupindb' />
            <input type='hidden' name='owner_id' value='<?php echo Yii::app()->session['loginID']; ?>' />
            <input type='hidden' name='ugid' value='<?php echo $ugid; ?>' />
        <?php echo CHtml::endForm() ?>
    </div>
</div>
</file>

<file path="application/views/userGroup/mailUserGroup_view.php">
<?php
?>
<div class="col-12 list-surveys">
    <div class="row">
        <?php echo CHtml::form(
            ["userGroup/MailToAllUsersInGroup/ugid/{$ugid}"],
            'post',
            ['class' => 'col-lg-6 offset-lg-3', 'id' => 'mailusergroup', 'name' => 'mailusergroup']
        ); ?>
        <div class="mb-3">
            <label class="form-label" for='subject'><?php eT("Subject:"); ?></label>
            <input class="form-control" type='text' id='subject' size='50' name='subject' value='' />
        </div>
        <div class="mb-3">
            <label class="form-label" for='body'><?php eT("Message:"); ?></label>
            <textarea cols='50' rows='4' id='body' name='body' class="form-control"></textarea>
        </div>
        <div class="form-check">
            <input class="form-check-input" id='copymail' name='copymail' type='checkbox' value='1'/>
            <label class="form-check-label" for='copymail'><?php eT("Send me a copy"); ?></label>
        </div>
        <input type='hidden' name='action' value='mailsendusergroup'/>
        <input type='hidden' name='ugid' value='<?php echo $ugid; ?>'/>
        <?php echo CHtml::endForm() ?>
    </div>
</div>
</file>

<file path="application/views/userGroup/usergroups_view.php">
<?php
?>
<div class="col-12">
    <h2 class="h4"><?php
    if (!Permission::model()->hasGlobalPermission('superadmin', 'read')) {
        eT('My user groups');
    }
    ?>
    </h2>
    <div class="row">
        <div class="col-12">
            <?php
            $this->widget(
                'application.extensions.admin.grid.CLSGridView',
                [
                    'id' => 'usergroups-grid-mine',
                    'lsCaption' => gT('My user groups'),
                    'dataProvider' => $model->searchMine(true),
                    'columns' => $model->getManagementButtons(),
                    'emptyText' => gT('No user groups found.'),
                    'ajaxUpdate' => 'usergroups-grid-mine',
                    'lsPageSizeCurrentValue' => $pageSize,
                ]
            );
            ?>
        </div>
</div>
    <h2 class="h4"><?php
    if (!Permission::model()->hasGlobalPermission('superadmin', 'read')) {
        eT('Groups to which I belong');
... (26 lines truncated)
</file>

<file path="application/views/userGroup/viewUserGroup_view.php">
<?php
$dataProvider = $model->searchUserGroupMembers($ugid);
?>
<div class="col-12 list-surveys">
    <div class="row">
        <div class="col-12 content-right">
            <h2 class="h4"><?php eT("Group members"); ?></h2>
            <?php if (isset($groupfound)) : ?>
                <strong><?php eT("Group description: "); ?></strong>
                <?php echo htmlspecialchars($usergroupdescription); ?>
            <?php endif; ?>
            <br/><br/>
            <?php if (isset($headercfg)) : ?>
                <?php if ($headercfg["type"] === "success") : ?>
                    <?php
                    $this->widget('ext.AlertWidget.AlertWidget', [
                        'text' => $headercfg["message"],
                        'type' => 'success',
                    ]);
                    ?>
                <?php else : ?>
                    <?php
                    $this->widget('ext.AlertWidget.AlertWidget', [
                        'text' => $headercfg["message"],
                        'type' => 'warning',
                    ]);
                    ?>
                <?php endif; ?>
            <?php endif; ?>
            <br/><br/>
... (54 lines truncated)
</file>

<file path="application/views/userManagement/massiveAction/_addtousergroup.php">
<?php
$aUsergoups = UserGroup::model()->findAll();
?>
<div class="selector--edit-usergroup-container">
    <div class="form">
        <?php if ($aUsergoups) : ?>
            <div class="mb-3">
                <label for="addtousergroup"><?= gT("Select user group to add users to") ?></label>
                <select class="form-select select post-value" name="addtousergroup" id="addtousergroup" required>
                    <?php foreach ($aUsergoups as $oUsergroup) {
                        if (
                            Permission::model()->hasGlobalPermission('usergroups', 'update')
                            || $oUsergroup->requestEditGroup($oUsergroup->ugid, Yii::app()->session['loginID'])
                        ) {
                            echo "<option value='" . $oUsergroup->ugid . "'>" . $oUsergroup->name . "</option>";
                        }
                    } ?>
                </select>
            </div>
        <?php else : ?>
            <?php
            echo "<p>" . gT("No user groups found.") . "</p>";
            echo CHtml::link('<i class="ri-add-circle-fill"></i> ' . gT('Add new user group'), array('userGroup/addGroup'), array('class' => 'btn btn-outline-secondary'));
            ?>
        <?php endif; ?>
    </div>
</div>
</file>

<file path="application/views/userManagement/massiveAction/_selector.php">
<!-- Rendering massive action widget -->
<?php
$aActionsArray = array(
    'pk'          => 'uid',
    'gridid'      => 'usermanagement--identity-gridPanel',
    'dropupId'    => 'usermanagement--actions',
    'dropUpText'  => gT('Selected user(s)...'),
    'aActions'    => array(
        array(
            'type'          => 'action',
            'action'        => 'delete',
            'url'           =>  App()->createUrl('userManagement/deleteMultiple'),
            'iconClasses'   => 'ri-delete-bin-fill text-danger',
            'text'          =>  gT('Delete'),
            'grid-reload'   => 'yes',
            'actionType'    => 'modal',
            'modalType'     => 'cancel-delete',
            'keepopen'      => 'yes',
            'showSelected'  => 'yes',
            'selectedUrl'   => App()->createUrl('userManagement/renderSelectedItems/'),
            'sModalTitle'   => gT('Delete user'),
            'htmlModalBody' => gT('Are you sure you want to delete the selected user?'),
        ),
        array(
            'type'          => 'action',
            'action'        => 'resendlogindata',
            'url'           =>  App()->createUrl('userManagement/batchSendAndResetLoginData'),
            'iconClasses'   => 'text-success ri-refresh-line',
            'text'          =>  gT('Resend login data'),
            'grid-reload'   => 'yes',
... (97 lines truncated)
</file>

<file path="application/views/userManagement/massiveAction/_updateexpires.php">
<?php
$dateFormatDetails = getDateFormatData(Yii::app()->session['dateformat']);
?>
<div class="selector--edit-status-container">
    <div class="form">
        <div class="mb-3">
            <label for="batchExpiresPicker"><?php eT("Expires:"); ?></label>
            <div class='col-md-6'>
                <?php
                $widget = Yii::app()->getController()->widget('ext.DateTimePickerWidget.DateTimePicker', array(
                    'name' => 'batchExpiresPicker',
                    'id' => 'batchExpiresPicker',
                    'pluginOptions' => array(
                        'format' => $dateFormatDetails['jsdate'] . " HH:mm",
                        'allowInputToggle' => true,
                        'showClear' => true,
                        'theme' => 'light',
                        'locale' => convertLStoDateTimePickerLocale(Yii::app()->session['adminlang'])
                    )
                ));
                ?>
                <input class="form-control custom-data" name="batchExpires" id="batchExpires" type="hidden" value="">
                <script type="text/javascript">
                    $(function () {
                        <?= $widget->getConfigScript('batchExpiresPicker'); ?>
                        document.getElementById("batchExpiresPicker_datetimepicker").addEventListener("change.td", function(){
                            document.getElementById("batchExpires").value = document.getElementById("batchExpiresPicker").value;
                        });
                    });
                </script>
... (5 lines truncated)
</file>

<file path="application/views/userManagement/massiveAction/_updatepermissions.php">
<?php
$aBasePermissions = Permission::model()->getGlobalBasePermissions();
if (!Permission::model()->hasGlobalPermission('superadmin', 'read')) {
    Yii::app()->session['flashmessage'] = gT("Note: You can only give limited permissions to other users because your own permissions are limited, too.");
    $aFilteredPermissions = array();
    foreach ($aBasePermissions as $PermissionName => $aPermission) {
        foreach ($aPermission as $sPermissionKey => &$sPermissionValue) {
            if ($sPermissionKey != 'title' && $sPermissionKey != 'img' && !Permission::model()->hasGlobalPermission($PermissionName, $sPermissionKey)) {
                $sPermissionValue = false;
            }
        }
        if ($aPermission['create'] || $aPermission['read'] || $aPermission['update'] || $aPermission['delete'] || $aPermission['import'] || $aPermission['export']) {
            $aFilteredPermissions[$PermissionName] = $aPermission;
        }
    }
    $aBasePermissions = $aFilteredPermissions;
}
?>
<div class="selector--edit-permissions-container">
    <table id='UserManagement--userpermissions-table' class='activecell table table-striped'>
        <caption class="visually-hidden"><?php eT('Edit permissions'); ?></caption>
        <thead>
            <tr>
                <th></th>
                <th><?php eT("Permission"); ?></th>
                <th><?php eT("General"); ?></th>
                <th><?php eT("Create"); ?></th>
                <th><?php eT("View/read"); ?></th>
                <th><?php eT("Update"); ?></th>
                <th><?php eT("Delete"); ?></th>
... (50 lines truncated)
</file>

<file path="application/views/userManagement/massiveAction/_updaterole.php">
<?php
    $aPermissiontemplates = (new \LimeSurvey\Models\Services\UserManager(App()->user))->getAssignableRoles();
?>
<div class="selector--edit-role-container">
    <div class="form">
        <?php
        $this->widget('ext.AlertWidget.AlertWidget', [
            'text' => gT("Careful: Applying a role to the user will overwrite any individual permissions given to the user!"),
            'type' => 'info',
        ]);
        ?>
        <div class="mb-3">
            <label for="roleselector"><?= gT("Select role to apply to users") ?></label>
            <select class="form-select select post-value" name="roleselector" id="roleselector" multiple>
                <?php foreach ($aPermissiontemplates as $oPermissiontemplate) {
                    echo CHtml::tag('option', ['value' => $oPermissiontemplate->ptid], CHtml::encode($oPermissiontemplate->name));
                } ?>
            </select>
        </div>
    </div>
</div>
</file>

<file path="application/views/userManagement/massiveAction/_updatestatus.php">
<div class="selector--edit-status-container">
    <div class="form">
        <div class="mb-3">
            <label for="status_selector"><?php  eT("Status:"); ?></label>
            <select class="form-select select post-value" name="status_selector" id="status_selector">
                <option value='activate'><?php eT("Active"); ?></option>
                <option value='deactivate'><?php eT("Inactive"); ?></option>
            </select>
        </div>
    </div>
</div>
</file>

<file path="application/views/userManagement/partial/mjmltemplate/usernotification.html">
<!doctype html><html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office"><head><title><mj-raw><?=$surveyapplicationname?></mj-raw></title><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1"><style type="text/css">#outlook a { padding:0; }
          .ReadMsgBody { width:100%; }
          .ExternalClass { width:100%; }
          .ExternalClass * { line-height:100%; }
          body { margin:0;padding:0;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%; }
          table, td { border-collapse:collapse;mso-table-lspace:0pt;mso-table-rspace:0pt; }
          img { border:0;height:auto;line-height:100%; outline:none;text-decoration:none;-ms-interpolation-mode:bicubic; }
          p { display:block;margin:13px 0; }</style><style type="text/css">@media only screen and (max-width:480px) {
            @-ms-viewport { width:320px; }
            @viewport { width:320px; }
          }</style>
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet" type="text/css"><style type="text/css">@import url(https://fonts.googleapis.com/css?family=Open+Sans);</style><style type="text/css">@media only screen and (min-width:480px) {
        .mj-column-px-540 { width:540px !important; max-width: 540px; }
.mj-column-per-100 { width:100% !important; max-width: 100%; }
.mj-column-per-50 { width:50% !important; max-width: 50%; }
      }</style><style type="text/css">@media only screen and (max-width:480px) {
      table.full-width-mobile { width: 100% !important; }
      td.full-width-mobile { width: auto !important; }
    }</style></head><body style="background-color:#ffffff;"><div style="background-color:#ffffff;"><table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="width:100%;"><tbody><tr><td><div style="Margin:0px auto;max-width:1920px;"><table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="width:100%;"><tbody><tr><td style="direction:ltr;font-size:0px;padding:20px 0;text-align:center;vertical-align:top;"><div style="Margin:0px auto;max-width:1920px;"><table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="width:100%;"><tbody><tr><td style="direction:ltr;font-size:0px;padding:20px 0;text-align:center;vertical-align:top;"><div class="mj-column-px-540 outlook-group-fix" style="font-size:13px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;"><table border="0" cellpadding="0" cellspacing="0" role="presentation" style="vertical-align:top;" width="100%"><tr><td align="center" style="font-size:0px;padding:10px 25px;word-break:break-word;"><table border="0" cellpadding="0" cellspacing="0" role="presentation" style="border-collapse:collapse;border-spacing:0px;"><tbody><tr><td style="width:320px;"><img height="auto" src="<?=$mainLogoFile?>" style="border:0;display:block;outline:none;text-decoration:none;height:auto;width:100%;" width="320"></td></tr></tbody></table></td></tr></table></div></td></tr></tbody></table></div><table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="background:#dfeadd;background-color:#dfeadd;width:100%;"><tbody><tr><td><div style="Margin:0px auto;max-width:1920px;"><table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="width:100%;"><tbody><tr><td style="direction:ltr;font-size:0px;padding:20px 0;text-align:center;vertical-align:top;"><div class="mj-column-px-540 outlook-group-fix" style="font-size:13px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;"><table border="0" cellpadding="0" cellspacing="0" role="presentation" style="vertical-align:top;" width="100%"><tr><td align="center" style="font-size:0px;padding:10px 25px;word-break:break-word;"><div style="font-family:Open Sans;font-size:18px;line-height:1.8;text-align:center;color:#000000;"><mj-raw> <?=$emailMessage?> </mj-raw></div></td></tr></table></div></td></tr></tbody></table></div></td></tr></tbody></table><table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="background:#dfeadd;background-color:#dfeadd;width:100%;"><tbody><tr><td><div style="Margin:0px auto;max-width:1920px;"><table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="width:100%;"><tbody><tr><td style="direction:ltr;font-size:0px;padding:20px 0;text-align:center;vertical-align:top;"><div class="mj-column-px-540 outlook-group-fix" style="font-size:13px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;"><table border="0" cellpadding="0" cellspacing="0" role="presentation" style="vertical-align:top;" width="100%"><tr><td align="center" style="font-size:0px;padding:10px 25px;word-break:break-word;"><div style="font-family:Open Sans;font-size:18px;line-height:1.8;text-align:center;color:#000000;"><mj-raw> <?=$credentialsText?> </mj-raw></div></td></tr></table></div></td></tr></tbody></table></div></td></tr></tbody></table><table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="background:#ffffff;background-color:#ffffff;width:100%;"><tbody><tr><td><div style="Margin:0px auto;max-width:1920px;"><table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="width:100%;"><tbody><tr><td style="direction:ltr;font-size:0px;padding:20px 0;text-align:center;vertical-align:top;"><div class="mj-column-per-100 outlook-group-fix" style="font-size:13px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;"><table border="0" cellpadding="0" cellspacing="0" role="presentation" style="vertical-align:top;" width="100%"><tr><td align="center" style="font-size:0px;padding:10px 25px;word-break:break-word;"><div style="font-family:Open Sans;font-size:18px;line-height:1.8;text-align:center;color:#000000;"><mj-raw> <?=gT("Your username:")?> </mj-raw></div></td></tr><tr><td align="center" style="font-size:0px;padding:10px 25px;word-break:break-word;"><div style="font-family:Open Sans;font-size:18px;font-weight:700;line-height:1.8;text-align:center;color:#000000;"><mj-raw> <?=$username?> </mj-raw></div></td></tr></table></div></td></tr></tbody></table></div></td></tr></tbody></table><table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="background:#ffffff;background-color:#ffffff;width:100%;"><tbody><tr><td><div style="Margin:0px auto;max-width:1920px;"><table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="width:100%;"><tbody><tr><td style="direction:ltr;font-size:0px;padding:20px 0;text-align:center;vertical-align:top;"><div class="mj-column-per-50 outlook-group-fix" style="font-size:13px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;"><table border="0" cellpadding="0" cellspacing="0" role="presentation" style="vertical-align:top;" width="100%"><tr><td align="center" style="font-size:0px;padding:10px 25px;word-break:break-word;"><div style="font-family:Open Sans;font-size:18px;line-height:1.8;text-align:center;color:#000000;"><mj-raw> <?=gT("Your password:")?> </mj-raw></div></td></tr><tr><td align="center" style="font-size:0px;padding:10px 25px;word-break:break-word;"><div style="font-family:Open Sans;font-size:18px;font-weight:700;line-height:1.8;text-align:center;color:#000000;"><mj-raw> <?=$password?> </mj-raw></div></td></tr></table></div> <div class="mj-column-per-50 outlook-group-fix" style="font-size:13px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;"><table border="0" cellpadding="0" cellspacing="0" role="presentation" style="vertical-align:top;" width="100%"><tr><td align="center" style="font-size:0px;padding:10px 25px;word-break:break-word;"><div style="font-family:Open Sans;font-size:18px;line-height:1.8;text-align:center;color:#000000;"><mj-raw> <?=gT("Please contact your LimeSurvey administrator for your password")?> </mj-raw></div></td></tr></table></div> </td></tr></tbody></table></div></td></tr></tbody></table> <table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="background:#ffffff;background-color:#ffffff;width:100%;"><tbody><tr><td><div style="Margin:0px auto;max-width:1920px;"><table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="width:100%;"><tbody><tr><td style="direction:ltr;font-size:0px;padding:20px 0;text-align:center;vertical-align:top;"><div class="mj-column-px-540 outlook-group-fix" style="font-size:13px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;"><table border="0" cellpadding="0" cellspacing="0" role="presentation" style="vertical-align:top;" width="100%"><tr><td align="center" vertical-align="middle" style="font-size:0px;padding:10px 25px;word-break:break-word;"><table border="0" cellpadding="0" cellspacing="0" role="presentation" style="border-collapse:separate;width:320px;line-height:100%;"><tr><td align="center" bgcolor="#169100" role="presentation" style="border:none;border-radius:3px;cursor:auto;padding:10px 25px;background:#169100;" valign="middle"><a href="<?=$linkToAdminpanel?>" style="background:#169100;color:#ffffff;font-family:Open Sans;font-size:18px;font-weight:normal;line-height:1.8;Margin:0;text-decoration:none;text-transform:none;" target="_blank">Login now</a></td></tr></table></td></tr></table></div></td></tr></tbody></table></div></td></tr></tbody></table><table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="background:#dfeadd;background-color:#dfeadd;width:100%;"><tbody><tr><td><div style="Margin:0px auto;max-width:1920px;"><table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="width:100%;"><tbody><tr><td style="direction:ltr;font-size:0px;padding:20px 0;text-align:center;vertical-align:top;"><div class="mj-column-px-540 outlook-group-fix" style="font-size:13px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;"><table border="0" cellpadding="0" cellspacing="0" role="presentation" style="vertical-align:top;" width="100%"><tr><td align="center" style="font-size:0px;padding:10px 25px;word-break:break-word;"><div style="font-family:Open Sans;font-size:18px;line-height:1.8;text-align:center;color:#000000;"><mj-raw> <?=sprintf(gT('If you have any questions regarding this mail please do not hesitate to contact the site administrator at %s. Thank you!'), Yii::app()->getConfig("siteadminemail"))?> </mj-raw></div></td></tr></table></div></td></tr></tbody></table></div></td></tr></tbody></table><div style="Margin:0px auto;max-width:1920px;"><table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="width:100%;"><tbody><tr><td style="direction:ltr;font-size:0px;padding:20px 0;text-align:center;vertical-align:top;"><div class="mj-column-per-100 outlook-group-fix" style="font-size:13px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;"><table border="0" cellpadding="0" cellspacing="0" role="presentation" style="vertical-align:top;" width="100%"><tr><td style="font-size:0px;padding:10px 25px;word-break:break-word;"><p style="border-top:dashed 1px lightgrey;font-size:1;margin:0px auto;width:100%;"></p>
</td></tr></table></div></td></tr></tbody></table></div><table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="background:#ffffff;background-color:#ffffff;width:100%;"><tbody><tr><td><div style="Margin:0px auto;max-width:1920px;"><table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="width:100%;"><tbody><tr><td style="direction:ltr;font-size:0px;padding:20px 0;text-align:center;vertical-align:top;"><div class="mj-column-px-540 outlook-group-fix" style="font-size:13px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;"><table border="0" cellpadding="0" cellspacing="0" role="presentation" style="vertical-align:top;" width="100%"><tr><td align="center" style="font-size:0px;padding:10px 25px;word-break:break-word;"><div style="font-family:Open Sans;font-size:18px;line-height:1.8;text-align:center;color:#000000;">If the button above is not working, please copy this link into the address line of your browser</div></td></tr><tr><td align="center" style="font-size:0px;padding:10px 25px;word-break:break-word;"><div style="font-family:Open Sans;font-size:18px;line-height:1.8;text-align:center;color:#000000;"><a class="regular-text" href="<?=$linkToAdminpanel?>"><mj-raw><?=$linkToAdminpanel?></mj-raw></a></div></td></tr></table></div></td></tr></tbody></table></div></td></tr></tbody></table></td></tr></tbody></table></div></td></tr></tbody></table></div></body></html>
</file>

<file path="application/views/userManagement/partial/mjmltemplate/usernotification.mjml">
<mjml>
  <mj-head>
    <mj-font name="Open Sans" href="https://fonts.googleapis.com/css?family=Open+Sans"></mj-font>
    <mj-title> <mj-raw><?=$surveyapplicationname?></mj-raw></mj-title>
    <mj-attributes>
      <mj-all font-family="Open Sans" font-size="18px" line-height="1.8"></mj-all>
    </mj-attributes>
  </mj-head>
  <mj-body width="1920px" background-color="#fff">
    <mj-wrapper full-width="full-width">
      <mj-section>
        <mj-column width="540px">
          <mj-image width="320px" src="<?=$mainLogoFile?>"></mj-image>
        </mj-column>
      </mj-section>
      <mj-raw>
        <!-- Welcome message -->
      </mj-raw>
      <mj-section full-width="full-width" background-color="#dfeadd">
        <mj-column width="540px">
          <mj-text align="center"><mj-raw>
              <?=$emailMessage?>
            </mj-raw>
          </mj-text>
        </mj-column>
      </mj-section>
      <mj-raw>
        <!-- Login Credentials -->
      </mj-raw>
      <mj-section full-width="full-width" background-color="#dfeadd">
... (105 lines truncated)
</file>

<file path="application/views/userManagement/partial/topbarBtns/dropDownItemsExport.php">
<ul class="dropdown-menu">
    <li>
        <?= CHtml::link(
            gT("CSV"),
            App()->createUrl(
                "userManagement/exportUser",
                ["outputFormat" => "csv"]
            ),
            [
                "class" => "dropdown-item",
                "aria-label" => gT("Export users as CSV", "unescaped")
            ]
        ); ?>
    </li>
    <li>
        <?= CHtml::link(
            gT("JSON"),
            App()->createUrl(
                "userManagement/exportUser",
                ["outputFormat" => "json"]
            ),
            [
                "class" => "dropdown-item",
                "aria-label" => gT("Export users as JSON", "unescaped")
            ]
        ); ?>
    </li>
</ul>
</file>

<file path="application/views/userManagement/partial/topbarBtns/dropDownItemsImport.php">
<?php
?>
<ul class="dropdown-menu">
    <li>
        <a
                role="button"
                data-href="<?= $this->createUrl(
                    "userManagement/renderUserImport",
                    ["importFormat" => "csv"]
                ) ?>"
                class="dropdown-item UserManagement--action--openmodal"
                data-bs-toggle="modal"
                href="#"> <?php eT("Import (CSV)") ?>
        </a>
    </li>
    <li>
        <a role="button"
           data-href="<?= App()->createUrl(
               "userManagement/renderUserImport",
               ["importFormat" => "json"]
           ) ?>"
           data-bs-toggle="modal"
           class="dropdown-item UserManagement--action--openmodal"
           href="#">
            <?php eT("Import (JSON)"); ?>
        </a>
    </li>
</ul>
</file>

<file path="application/views/userManagement/partial/topbarBtns/leftSideButtons.php">
<?php
if (Permission::model()->hasGlobalPermission('users', 'create')) {
    $userHtmlOptions = [
        'class' => 'btn btn-primary UserManagement--action--openmodal',
        'data-bs-toggle' => 'modal',
        'data-href' => $this->createUrl("userManagement/addEditUser")
    ];
    $this->widget(
        'ext.ButtonWidget.ButtonWidget',
        [
            'name' => 'add-user-button',
            'id' => 'add-user-button',
            'text' => gT('Add user'),
            'icon' => 'ri-user-add-line',
            'htmlOptions' => $userHtmlOptions,
        ]
    );
    $dropdownItemsImp = $this->renderPartial('/userManagement/partial/topbarBtns/dropDownItemsImport', [], true);
    ?>
    <?php
    $this->widget('ext.ButtonWidget.ButtonWidget', [
        'name' => 'import-users-button',
        'id' => 'import-users-button',
        'text' => gT('Import'),
        'icon' => 'ri-download-2-fill',
        'isDropDown' => true,
        'dropDownContent' => $dropdownItemsImp,
        'htmlOptions' => [
            'class' => 'btn btn-outline-secondary',
        ],
... (19 lines truncated)
</file>

<file path="application/views/userManagement/partial/addedituser.php">
<?php
$modalTitle = $oUser->isNewRecord ? gT('Add user') : gT('Edit user');
$buttonTitle = $oUser->isNewRecord ? gT('Add') : gT('Save');
Yii::app()->getController()->renderPartial(
    '/layouts/partial_modals/modal_header',
    ['modalTitle' => $modalTitle]
);
?>
<?php  ?>
<?php $form = $this->beginWidget('TbActiveForm', [
    'id'                     => 'UserManagement--modalform',
    'action'                 => App()->createUrl('userManagement/applyedit'),
    'enableAjaxValidation'   => false,
    'enableClientValidation' => false,
]); ?>
<div class="modal-body">
    <?= $form->hiddenField($oUser, 'uid', ['uid' => 'User_Form_users_id']) ?>
    <div class="mb-3 d-none" id="UserManagement--errors" role="alert" aria-live="assertive" aria-atomic="true" tabindex="-1">
    </div>
    <p class="note"><?php echo sprintf(gT('Fields with %s are required.'), '<span class="required">*</span>'); ?></p>
    <div class="mb-3">
        <?php echo $form->labelEx($oUser, 'users_name', ['for' => 'User_Form_users_name']); ?>
        <?php if ($oUser->isNewRecord) : ?>
            <?= $form->textField($oUser, 'users_name', ['id' => 'User_Form_users_name', 'required' => 'required']) ?>
        <?php else : ?>
            <input class="form-control" type="text" value="<?= CHtml::encode($oUser->users_name) ?>" disabled="true"/>
        <?php endif; ?>
        <?php echo $form->error($oUser, 'users_name'); ?>
    </div>
    <div class="mb-3">
... (110 lines truncated)
</file>

<file path="application/views/userManagement/partial/addrole.php">
<?php
Yii::app()->getController()->renderPartial(
    '/layouts/partial_modals/modal_header',
    ['modalTitle' => gT('Edit user roles')]
);
?>
<?php $form = $this->beginWidget('TbActiveForm', array(
    'id' => 'UserManagement--modalform',
    'action' => App()->createUrl('userManagement/SaveRole'),
    'enableAjaxValidation' => false,
    'enableClientValidation' => false,
));?>
<div class="modal-body selector--edit-role-container">
    <div class="form">
        <div class="row ls-space margin top-5 bottom-5 d-none" id="UserManagement--errors" role="alert" aria-live="assertive" aria-atomic="true" tabindex="-1">
        </div>
        <input type="hidden" name="userid" value="<?= $oUser->uid ?>"/>
        <?php
        if ($hasIndividualPermissions) {
            $this->widget('ext.AlertWidget.AlertWidget', [
                'text'        => gT("This user has individual permissions. If you assign a role, all of them will be removed and replaced by the permissions of the role."),
                'type'        => 'warning',
                'htmlOptions' => ['class' => 'col-12']
            ]);
        }
        if (!empty($aLockedRoles)) {
            $this->widget('ext.AlertWidget.AlertWidget', [
                'text'        => sprintf(
                    gT("This user also has the following roles, which you are not allowed to change: %s"),
                    CHtml::encode(implode(', ', $aLockedRoles))
... (34 lines truncated)
</file>

<file path="application/views/userManagement/partial/confirmuseractivation.php">
<?php
if ($action == 'activate') {
    Yii::app()->getController()->renderPartial(
        '/layouts/partial_modals/modal_header',
        ['modalTitle' => gT('Activate user')]
    );
} else {
    Yii::app()->getController()->renderPartial(
        '/layouts/partial_modals/modal_header',
        ['modalTitle' => gT('Deactivate user')]
    );
}
?>
<div class="modal-body">
    <?php if ($action == 'activate') : ?>
        <p class='modal-body-text'><?= gT('Do you want to activate this user?'); ?></p>
    <?php else : ?>
        <p class='modal-body-text'><?= gT('Do you want to deactivate this user?'); ?></p>
    <?php endif; ?>
</div>
<div class="modal-footer">
    <?=TbHtml::formTb(null, App()->createUrl('userManagement/userActivateDeactivate'), 'post', ["id" => "UserManagement--modalform"])?>
        <input type="hidden" name="userid" value="<?= $userId ?>" />
        <input type="hidden" name="action" value="<?= CHtml::encode($action) ?>" />
        <button type="button"  class="btn btn-cancel" data-bs-dismiss="modal">&nbsp;<?php eT("Cancel"); ?></button>
        <button class="btn btn-primary">&nbsp;<?php eT("Save"); ?></button>
    <?php echo TbHtml::endForm() ?>
</div>
</file>

<file path="application/views/userManagement/partial/confirmuserdelete.php">
<?php
Yii::app()->getController()->renderPartial(
    '/layouts/partial_modals/modal_header',
    ['modalTitle' => gT('Delete user')]
);
?>
<div class="modal-body">
    <p class='modal-body-text'><?php eT('Do you want to delete this user?'); ?></p>
</div>
<div class="modal-footer">
    <?=TbHtml::formTb(null, App()->createUrl('userManagement/deleteUser'), 'post', ["id" => "UserManagement--modalform"])?>
        <input type="hidden" name="userid" value="<?= $userId ?>" />
        <button type="button"  class="btn btn-cancel" data-bs-dismiss="modal">&nbsp;<?php eT("Cancel"); ?></button>
        <button class="btn btn-danger" id="submitForm">&nbsp;<?php eT("Delete"); ?></button>
    </form>
</div>
</file>

<file path="application/views/userManagement/partial/editpermissions.php">
<?php
Yii::app()->getController()->renderPartial(
    '/layouts/partial_modals/modal_header',
    ['modalTitle' => gT("Edit permissions")]
);
?>
<?= TbHtml::formTb(null, App()->createUrl('userManagement/saveUserPermissions'), 'post', ["id" => "UserManagement--modalform"]) ?>
<div class="modal-body overflow-scroll selector--edit-permissions-container">
    <div class="row ls-space margin top-5 bottom-5 d-none" id="UserManagement--errors" role="alert" aria-live="assertive" aria-atomic="true" tabindex="-1">
    </div>
    <input type='hidden' name='userid' value='<?php echo (isset($oUser) ? $oUser->uid : ''); ?>' />
    <table id='UserManagement--userpermissions-table' class='activecell table table-striped'>
        <thead>
            <tr>
                <th></th>
                <th><?php eT("Permission"); ?></th>
                <th><?php eT("General"); ?></th>
                <th><?php eT("Create"); ?></th>
                <th><?php eT("View/read"); ?></th>
                <th><?php eT("Update"); ?></th>
                <th><?php eT("Delete"); ?></th>
                <th><?php eT("Import"); ?></th>
                <th><?php eT("Export"); ?></th>
            </tr>
        </thead>
        <!-- Permissions -->
        <?php foreach ($aBasePermissions as $sPermissionKey => $aCRUDPermissions) : ?>
            <tr>
                <!-- Icon -->
                <td>
... (64 lines truncated)
</file>

<file path="application/views/userManagement/partial/edittemplatepermissions.php">
<?php
Yii::app()->getController()->renderPartial(
    '/layouts/partial_modals/modal_header',
    ['modalTitle' => gT('Theme permissions')]
);
?>
<?= TbHtml::form(
    array("userManagement/saveThemePermissions"),
    'post',
    array('name' => 'UserManagement--modalform', 'id' => 'UserManagement--modalform')
); ?>
<div class="modal-body">
    <div class="container">
        <div class="row ls-space margin top-5 bottom-5 d-none" id="UserManagement--errors" role="alert" aria-live="assertive" aria-atomic="true" tabindex="-1">
        </div>
        <input type="hidden" name="userid" value="<?php echo $oUser->uid; ?>"/>
        <div class="mb-3">
            <button id="UserManagement--action-userthemepermissions-select-all" class="btn btn-outline-secondary">
                <?php eT('Select all'); ?>
            </button>
            <button id="UserManagement--action-userthemepermissions-select-none" class="btn btn-outline-secondary">
                <?php eT('Select none'); ?>
            </button>
        </div>
        <table class="table">
            <caption class="visually-hidden"><?php eT('Theme permissions'); ?></caption>
            <tr>
                <th><?php eT('Theme name'); ?></th>
                <th><?php eT('Access'); ?></th>
            </tr>
... (29 lines truncated)
</file>

<file path="application/views/userManagement/partial/error.php">
<?php
?>
<div class="modal-header">
    <h5 class="modal-title"><?= gT('Error') ?></h5>
</div>
<div class="modal-body">
    <div class="row selector--animated_row">
        <div class="col-12 text-center">
            <div class="cross_mark">
                <div class="sa-icon sa-error animate">
                    <span class="sa-line sa-tip animateerrorTip"></span>
                    <span class="sa-line sa-long animateerrorLong"></span>
                    <div class="sa-placeholder"></div>
                    <div class="sa-fix"></div>
                </div>
            </div>
        </div>
    </div>
    <div class="row ls-space margin top-15 bottom-15">
        <div class="col-12">
            <?php foreach ($errors as $error) {
                echo "<pre>" . print_r($error, true) . "</pre>";
            }
            ?>
        </div>
    </div>
</div>
<div class="modal-footer">
    <?php if (!isset($noButton)) : ?>
        <button id="exitForm" class="btn btn-cancel" data-bs-dismiss="modal">
... (5 lines truncated)
</file>

<file path="application/views/userManagement/partial/importuser.php">
<?php
?>
<?php
Yii::app()->getController()->renderPartial(
    '/layouts/partial_modals/modal_header',
    ['modalTitle' => gT('Import users')]
);
?>
<?= TbHtml::formTb(
    null,
    App()->createUrl('userManagement/importUsers', ['importFormat' => $importFormat]),
    'post',
    ["id" => "UserManagement--modalform--import", 'enctype' => 'multipart/form-data']
) ?>
<div class="modal-body">
    <?php
    $this->widget('ext.AlertWidget.AlertWidget', [
        'text' => $note,
        'type' => 'info',
    ]);
    ?>
    <div class="mb-3">
        <input type="checkbox" name="overwrite" value="overwrite" id="overwrite">
        <label class="form-check-label" for="overwrite">
            <?= eT("Overwrite existing users"); ?>
        </label>
        <small id="overwrite-help" class="form-text"><?= eT("Duplicates are identified by username and/or email"); ?></small>
    </div>
    <div class="mb-3">
        <label class="form-label" for="the_file"><?= sprintf(gT('Select %s file:', 'js'), $importFormat); ?> </label>
... (13 lines truncated)
</file>

<file path="application/views/userManagement/partial/json.php">
<?php
header("Content-Type: application/json");
echo json_encode($data);
</file>

<file path="application/views/userManagement/partial/permissionsuccess.php">
<?php
?>
<div class="modal-header">
    <h5 class="modal-title"><?= gT('Saved successfully') ?></h5>
</div>
<div class="modal-body">
    <div class="row">
        <div class="col-12 text-center">
            <div class="check_mark">
                <div class="sa-icon sa-success animate">
                    <span class="sa-line sa-tip animateSuccessTip"></span>
                    <span class="sa-line sa-long animateSuccessLong"></span>
                    <div class="sa-placeholder"></div>
                    <div class="sa-fix"></div>
                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-12">
            <ul class="list-group">
                <?php foreach ($results as $type => $result) { ?>
                    <?php  ?>
                    <li class="list-group-item">
                        <?php if (is_array($result)) { ?>
                            <?= ($result['descriptionData']['title'] ?? $type) ?> :
                            <?php
                            if (isset($result['success'])) {
                                echo($result['success'] ? 'OK' : 'error');
                            } else {
... (21 lines truncated)
</file>

<file path="application/views/userManagement/partial/showuser.php">
<?php
Yii::app()->getController()->renderPartial(
    '/layouts/partial_modals/modal_header',
    ['modalTitle' => gT('User details')]
);
?>
<div class="modal-body">
    <table class="table table-striped">
        <caption class="visually-hidden"><?=gT('User details')?></caption>
        <tr>
            <td><?=gT('User groups:')?></td>
            <td><?=CHTml::encode(join(', ', $usergroups))?></td>
        </tr>
        <?php if ($oUser->parentUser) : ?>
            <tr>
                <td><?=gT('Created by:')?></td>
                <td><?=CHTml::encode($oUser->parentUser['full_name'])?></td>
            </tr>
        <?php endif; ?>
        <tr>
            <td><?=gT('Surveys owned:')?></td>
            <td><?=$oUser->surveysCreated?></td>
        </tr>
        <tr>
            <td><?=gT('Last login:')?></td>
            <td><?=$oUser->lastloginFormatted?></td>
        </tr>
    </table>
</div>
<div class="modal-footer modal-footer-buttons">
... (5 lines truncated)
</file>

<file path="application/views/userManagement/partial/success.php">
<?php
Yii::app()->getController()->renderPartial(
    '/layouts/partial_modals/modal_header',
    ['modalTitle' => gT('Saved successfully')]
);
?>
<div class="modal-body">
    <div class="row selector--animated_row">
        <div class="col-12 text-center">
            <div class="check_mark">
                <div class="sa-icon sa-success animate">
                    <span class="sa-line sa-tip animateSuccessTip"></span>
                    <span class="sa-line sa-long animateSuccessLong"></span>
                    <div class="sa-placeholder"></div>
                    <div class="sa-fix"></div>
                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-12 text-center">
            <?php if (isset($sMessage)) : ?>
                <?= $sMessage ?>
            <?php endif; ?>
            <?php if (isset($sDebug) && Yii::app()->getConfig('debug') > 0) : ?>
                <?= $sDebug ?>
            <?php endif; ?>
        </div>
    </div>
</div>
... (6 lines truncated)
</file>

<file path="application/views/userManagement/partial/transfersurveys.php">
<div class="modal-header">
    <h5 class="modal-title"><?php eT("Delete user"); ?></h5>
    <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
</div>
<div class="modal-body">
    <?= TbHtml::formTb(
        null,
        App()->createUrl('userManagement/deleteUser'),
        'post',
        ["id" => "UserManagement--modalform"]
    ) ?>
    <div class="row ls-space margin top-5">
        <label for="transfer_surveys_to"><?php eT("Transfer the surveys of this user to: "); ?></label>
        <select id='transfer_surveys_to' name='transfer_surveys_to' class='form-select'>
            <?php
            if (count($users) > 0) {
                foreach ($users as $user) {
                    $intUid = $user['uid'];
                    $sUsersName = $user['users_name'];
                    $selected = '';
                    if ($intUid == $current_user) {
                        $selected = ' selected="selected"';
                    }
                    if ($postuserid != $intUid) {
                        ?>
                        <option
                            value="<?php echo $intUid; ?>" <?php echo $selected; ?>> <?php echo $sUsersName; ?></option>;
                        <?php
                    }
                }
... (17 lines truncated)
</file>

<file path="application/views/userManagement/partial/usernotificationemail.php">
<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
<head><title><mj-raw><?= $surveyapplicationname ?></mj-raw></title><!--[if !mso]><!-- -->
    <meta http-equiv="X-UA-Compatible" content="IE=edge"><!--<![endif]-->
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <style type="text/css">
            padding: 0;
        }
        .ReadMsgBody {
            width: 100%;
        }
        .ExternalClass {
            width: 100%;
        }
        .ExternalClass * {
            line-height: 100%;
        }
        body {
            margin: 0;
            padding: 0;
            -webkit-text-size-adjust: 100%;
            -ms-text-size-adjust: 100%;
        }
        table, td {
            border-collapse: collapse;
            mso-table-lspace: 0pt;
            mso-table-rspace: 0pt;
        }
        img {
... (453 lines truncated)
</file>

<file path="application/views/userManagement/index.php">
<?php
echo viewHelper::getViewTestTag('usersIndex');
?>
<?php if (!Permission::model()->hasGlobalPermission('users', 'read')) : ?>
    <div class="row">
        <div class="col-12">
            <h2><?= gT("We are sorry but you don't have permissions to do this.") ?></h2>
        </div>
    </div>
    <?php App()->end(); ?>
<?php endif; ?>
    <?php
    $this->widget(
        'application.extensions.admin.grid.CLSGridView',
        [
            'id' => 'usermanagement--identity-gridPanel',
            'ajaxUpdate' => 'usermanagement--identity-gridPanel',
            'dataProvider' => $model->search(),
            'columns' => $model->getManagementColums(),
            'lsAdditionalColumns' => $model->getAdditionalColumns(),
            'lsShowSelectionBar' => false,
            'lsCaption' => gT('User management'),
            'lsAfterAjaxUpdate' => [
                'LS.UserManagement.bindButtons();',
                'showDeactivatedUserTooltip();'
            ],
            'filter' => $model,
            'lsPageSizeCurrentValue' => $pageSize,
        ]
    );
... (45 lines truncated)
</file>

<file path="application/views/userRole/massiveAction/_selector.php">
<!-- Rendering massive action widget -->
<?php
$aActionsArray = array(
    'pk'          => 'selectedRole',
    'gridid'      => 'RoleControl--identity-gridPanel',
    'dropupId'    => 'RoleControl--actions',
    'dropUpText'  => gT('Selected role(s)...'),
    'aActions'    => array(
        array(
            'type'        => 'action',
            'action'      => 'delete',
            'url'         =>  App()->createUrl('userRole/batchDelete'),
            'iconClasses' => 'ri-delete-bin-fill text-danger',
            'text'        =>  gT('Delete'),
            'grid-reload' => 'yes',
            'actionType'    => 'modal',
            'modalType'     => 'cancel-delete',
            'keepopen'      => 'yes',
            'sModalTitle'   => gT('Delete roles'),
            'htmlModalBody' => gT('Are you sure you want to delete the selected role(s)?'),
        ),
        array(
            'type' => 'action',
            'action' => 'batchExport',
            'url' => App()->createUrl('userRole/batchExport/sItems') . '/',
            'iconClasses' => 'ri-upload-2-fill',
            'text' => gT('Bulk export roles'),
            'grid-reload' => 'no',
            'actionType'    => 'window-location-href',
        ),
... (4 lines truncated)
</file>

<file path="application/views/userRole/massiveAction/_updatepermissions.php">
<?php
$aBasePermissions = Permission::model()->getGlobalBasePermissions();
if (!Permission::model()->hasGlobalPermission('superadmin', 'read')) {
    Yii::app()->session['flashmessage'] = gT("Note: You can only give limited permissions to other users because your own permissions are limited, too.");
    $aFilteredPermissions = array();
    foreach ($aBasePermissions as $PermissionName => $aPermission) {
        foreach ($aPermission as $sPermissionKey => &$sPermissionValue) {
            if ($sPermissionKey != 'title' && $sPermissionKey != 'img' && !Permission::model()->hasGlobalPermission($PermissionName, $sPermissionKey)) {
                $sPermissionValue = false;
            }
        }
        if ($aPermission['create'] || $aPermission['read'] || $aPermission['update'] || $aPermission['delete'] || $aPermission['import'] || $aPermission['export']) {
            $aFilteredPermissions[$PermissionName] = $aPermission;
        }
    }
    $aBasePermissions = $aFilteredPermissions;
}
?>
<div class="modal-header">
    <h5 class="modal-title"><?php eT("Edit permissions"); ?></h5>
</div>
<div class="modal-body selector--edit-permissions-container">
    <table id='UserManagement--userpermissions-table' class='activecell table table-striped'>
        <thead>
            <tr>
                <th></th>
                <th><?php eT("Permission"); ?></th>
                <th><?php eT("General"); ?></th>
                <th><?php eT("Create"); ?></th>
                <th><?php eT("View/read"); ?></th>
... (52 lines truncated)
</file>

<file path="application/views/userRole/massiveAction/_updaterole.php">
<?php
    $aPermissiontemplates = Permissiontemplates::model()->findAll();
?>
<div class="modal-header">
    <h5 class="modal-title"><?php eT("Apply role to user");?></h5>
</div>
<div class="modal-body selector--edit-role-container">
    <div class="form">
        <?php
        $this->widget('ext.AlertWidget.AlertWidget', [
            'text' => gT("Careful: Applying a role to the user will overwrite any individual permissions given to the user!"),
            'type' => 'info',
        ]);
        ?>
        <div class="mb-3">
            <label for="roleselector"><?= gT("Select role to apply to users") ?></label>
            <select class="form-select select post-value" name="roleselector" id="roleselector" multiple>
                <?php foreach ($aPermissiontemplates as $oPermissiontemplate) {
                    echo "<option value='" . $oPermissiontemplate->ptid . "'>" . $oPermissiontemplate->name . "</option>";
                } ?>
            </select>
        </div>
    </div>
</div>
</file>

<file path="application/views/userRole/partials/topbarBtns/leftSideButtons.php">
<?php
$this->widget(
    'ext.ButtonWidget.ButtonWidget',
    [
        'name' => 'save-form-button',
        'id' => 'open-add-role-form-button',
        'text' => gT('Add user role'),
        'icon' => 'ri-user-add-line',
        'htmlOptions' => [
            'class' => 'btn btn-primary RoleControl--action--openmodal',
            'data-href' => App()->createUrl("userRole/editRoleModal"),
            'data-bs-toggle' => 'modal',
            'title' => gT('Add a new user role')
        ],
    ]
);
$this->widget(
    'ext.ButtonWidget.ButtonWidget',
    [
        'name' => 'save-form-button',
        'id' => 'import-roles-button',
        'text' => gT('Import (XML)'),
        'icon' => 'ri-download-2-fill',
        'htmlOptions' => [
            'class' => 'btn btn-outline-secondary RoleControl--action--openmodal',
            'data-href' => App()->createUrl("userRole/showImportXML"),
            'data-bs-toggle' => 'modal',
            'title' => gT('Import user role from XML')
        ],
    ]
... (2 lines truncated)
</file>

<file path="application/views/userRole/partials/_form.php">
<?php
if ($model->isNewRecord) {
    $modalTitle =  gT('Create user role');
    $buttonTitle = gT('Create');
} else {
    $modalTitle = sprintf(gT("Edit user role '%s'"), $model->name);
    $buttonTitle = gT('Save');
}
Yii::app()->getController()->renderPartial(
    '/layouts/partial_modals/modal_header',
    ['modalTitle' => $modalTitle]
);
?>
<?php $form = $this->beginWidget('TbActiveForm', array(
    'id' => 'RoleControl--modalform',
    'action' => App()->createUrl('userRole/applyEdit'),
    'enableAjaxValidation' => false,
)); ?>
<div class="modal-body">
    <div class="container">
            <div class="mb-3" id="RoleControl--errors">
            </div>
            <?php echo $form->hiddenField($model, 'ptid'); ?>
            <?php
            $nameFieldId = 'RoleControl_modalform_name';
            $nameLabelId = 'RoleControl_modalform_name_label';
            $descFieldId = 'RoleControl_modalform_description';
            $descLabelId = 'RoleControl_modalform_description_label';
            ?>
            <div class="mb-3">
... (63 lines truncated)
</file>

<file path="application/views/userRole/partials/_import.php">
<?php
Yii::app()->getController()->renderPartial(
    '/layouts/partial_modals/modal_header',
    ['modalTitle' => gT('Import role')]
);
?>
<?= TbHtml::formTb(
    null,
    App()->createUrl('userRole/importXML'),
    'post',
    ["id" => "RoleControl--modalform-import", 'enctype' => 'multipart/form-data']
) ?>
<div class="modal-body">
    <div class="mb-3" id="RoleControl--errors">
    </div>
    <div class="mb-3">
        <label class="form-label" for="the_file"><?= gT('Select role-XML file') ?></label>
        <input type="file" name="the_file" id="the_file" class="form-control"/>
    </div>
</div>
<div class="modal-footer modal-footer-buttons" style="margin-top: 15px; ">
    <button class="btn btn-cancel" id="exitForm" data-bs-dismiss="modal">
        <?= gT('Cancel') ?>
    </button>
    <button class="btn btn-primary" id="submitForm">
        <?= gT('Import') ?>
    </button>
</div>
</form>
</file>

<file path="application/views/userRole/partials/_permissions.php">
<?php
Yii::app()->getController()->renderPartial(
    '/layouts/partial_modals/modal_header',
    ['modalTitle' => gT('Edit permissions')]
);
?>
<?= TbHtml::formTb(
    null,
    App()->createUrl('userRole/savePermissions'),
    'post',
    ["id" => "RoleControl--modalform"]
) ?>
<div class="modal-body selector--edit-permissions-container">
    <input type='hidden' name='ptid' value='<?php echo (isset($oModel) ? $oModel->ptid : ''); ?>' />
    <table id='RoleControl--permissions-table' class='activecell table table-striped'>
        <thead>
            <tr>
                <th></th>
                <th><?php
                    eT("Permission"); ?></th>
                <th><?php
                    eT("All"); ?></th>
                <th><?php
                    eT("Create"); ?></th>
                <th><?php
                    eT("View/read"); ?></th>
                <th><?php
                    eT("Update"); ?></th>
                <th><?php
                    eT("Delete"); ?></th>
... (89 lines truncated)
</file>

<file path="application/views/userRole/partials/_view.php">
<?php
?>
<div class="modal-header">
    <h5 class="modal-title" id="modalTitle-addedit"><?= sprintf(gT('User role %s'), CHtml::encode($oModel->name)); ?></h5>
    <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
    <div class="row">
        <div class="col-12">
            <div class="card">
                <div class="col-12 card-body">
                    <?= CHtml::encode($oModel->description) ?>
                </div>
            </div>
        </div>
    </div>
    <br/>
    <div class="row">
        <div class="col-4">
            <?= gT('Users assigned to this role') ?>
        </div>
        <div class="col-8">
            <ul class="list-group">
                <?php foreach ($oModel->connectedUserobjects as $oUser) {
                    echo sprintf(
                        '<li class="list-group-item">%s - %s (%s)</li>',
                        $oUser->uid,
                        $oUser->full_name,
                        $oUser->users_name
                    );
... (11 lines truncated)
</file>

<file path="application/views/userRole/partials/error.php">
<?php
?>
<div class="modal-header">
    <h5 class="modal-title"><?= gT('Error') ?></h5>
    <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
    <div class="row selector--animated_row">
        <div class="col-12 text-center">
            <div class="cross_mark">
                <div class="sa-icon sa-error animate">
                    <span class="sa-line sa-tip animateerrorTip"></span>
                    <span class="sa-line sa-long animateerrorLong"></span>
                    <div class="sa-placeholder"></div>
                    <div class="sa-fix"></div>
                </div>
            </div>
        </div>
    </div>
    <div class="row ls-space margin top-15 bottom-15">
        <?php foreach ($errors as $error) {
            echo "<pre>" . print_r($error, true) . "</pre>";
        }
        ?>
    </div>
</div>
<div class="modal-footer">
    <?php if (!isset($noButton)) : ?>
        <button id="exitForm" class="btn btn-cancel" data-bs-dismiss="modal">
            <?= gT('Close') ?>
... (4 lines truncated)
</file>

<file path="application/views/userRole/partials/success.php">
<div class="modal-header">
    <h5 class="modal-title"><?= gT('Saved successfully') ?></h5>
    <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
    <div class="row selector--animated_row">
        <div class="col-12 text-center">
            <div class="check_mark">
                <div class="sa-icon sa-success animate">
                    <span class="sa-line sa-tip animateSuccessTip"></span>
                    <span class="sa-line sa-long animateSuccessLong"></span>
                    <div class="sa-placeholder"></div>
                    <div class="sa-fix"></div>
                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-12 text-center">
            <?php if (isset($sMessage)) : ?>
                <?= $sMessage ?>
            <?php endif; ?>
            <?php if (isset($sDebug) && Yii::app()->getConfig('debug') > 0) : ?>
                <?= $sDebug ?>
            <?php endif; ?>
        </div>
    </div>
</div>
<div class="modal-footer">
    <?php if (!isset($noButton)) : ?>
... (6 lines truncated)
</file>

<file path="application/views/userRole/edit.php">
<?php
?>
<div class="ls-flex-column ls-space padding left-35 right-35">
    <div class="col-12 h1 pagetitle">
        <?php if ($model->isNewRecord) {
            echo gT('Create user role');
        } else {
            echo sprintf(gT('Update user role %s'), CHtml::encode($model->name));
        }?>
    </div>
    <div class="col-12 ls-space margin top-15">
        <?php $this->renderPartial('permissiontemplates/partials/_form', array('model' => $model)); ?>
    </div>
</div>
</file>

<file path="application/views/userRole/index.php">
<?php
$pageSize = Yii::app()->user->getState('pageSize', Yii::app()->params['defaultPageSize']);
echo viewHelper::getViewTestTag('roles');
?>
<?php ?>
<div class="col-12">
    <div class="row">
        <div class="col-12">
            <?php
            require_once Yii::getPathOfAlias('application.extensions.admin.grid.FloatingActionsWidget.actions.UserRoleListMassiveActions') . '.php';
            $floatingActions = \actions\UserRoleListMassiveActions::getActions();
            $this->widget('ext.admin.grid.FloatingActionsWidget.FloatingActionsWidget', [
                'pk'       => 'selectedRole',
                'gridId'   => 'RoleControl--identity-gridPanel',
                'aActions' => $floatingActions,
            ]);
            $this->widget(
                'application.extensions.admin.grid.CLSGridView',
                [
                    'id' => 'RoleControl--identity-gridPanel',
                    'lsCaption' => gT('User roles'),
                    'htmlOptions' => ['class' => 'table-responsive grid-view-ls'],
                    'dataProvider' => $model->search(),
                    'columns' => $model->columns,
                    'filter' => $model,
                    'lsShowSelectionBar' => false,
                    'ajaxType' => 'POST',
                    'ajaxUpdate' => 'RoleControl--identity-gridPanel',
                    'afterAjaxUpdate' => 'LS.RoleControl.bindButtons',
                    'lsPageSizeCurrentValue' => $pageSize,
... (13 lines truncated)
</file>

<file path="application/views/index.html">
<html>
<head>
	<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
</file>

<file path="application/views/opt_view.php">
<div id="wrapper"><p id="optoutmessage">
<?php
    echo $html;
?>
</p></div>
</file>

<file path="application/views/statistics_user_view.php">
<script type='text/javascript'>
    var graphUrl = "<?php echo Yii::app()->getController()->createUrl("admin/statistics/sa/graph"); ?>";
</script>
<div class="container public-stats">
    <div class="row">
        <div class="col-12">
            <div id='statsContainer'>
                <div id='statsHeader'>
                    <h2 class='statsSurveyTitle public-stats__title'><?php echo $thisSurveyTitle; ?></h2>
                    <div class='statsNumRecords public-stats__num-records'><?php echo gT("Total records in survey") . " : $totalrecords"; ?></div>
                </div>
                <div class="public-stats__content">
                    <?php if (isset($statisticsoutput) && $statisticsoutput) {
                        echo $statisticsoutput;
                    } ?>
                </div>
            </div>
            <input type='hidden' class='hidemenubutton'/>
        </div>
    </div>
</div>
</file>

<file path="application/views/survey_view.php">
<?php
echo $display;
</file>

<file path="application/.htaccess">
<IfVersion < 2.4>
    Order Allow,Deny
    Deny from all
</IfVersion>
<IfVersion >= 2.4>
    Require all denied
    <IfModule mod_access_compat.c>
        Order Allow,Deny
        Deny from all
    </IfModule>
</IfVersion>
</file>

<file path="application/index.html">
<html>
<head>
	<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
</file>

<file path="docs/demosurveys/ls205_array_filter_tests.lss">
<?xml version="1.0" encoding="UTF-8"?>
<document>
 <LimeSurveyDocType>Survey</LimeSurveyDocType>
 <DBVersion>177</DBVersion>
 <languages>
  <language>en</language>
 </languages>
 <answers>
  <fields>
   <fieldname>qid</fieldname>
   <fieldname>code</fieldname>
   <fieldname>answer</fieldname>
   <fieldname>sortorder</fieldname>
   <fieldname>assessment_value</fieldname>
   <fieldname>language</fieldname>
   <fieldname>scale_id</fieldname>
  </fields>
  <rows>
   <row>
    <qid><![CDATA[441]]></qid>
    <code><![CDATA[sq1]]></code>
    <answer><![CDATA[1st subquestion]]></answer>
    <sortorder><![CDATA[1]]></sortorder>
    <assessment_value><![CDATA[0]]></assessment_value>
    <language><![CDATA[en]]></language>
    <scale_id><![CDATA[0]]></scale_id>
   </row>
   <row>
    <qid><![CDATA[441]]></qid>
    <code><![CDATA[sq2]]></code>
... (14995 lines truncated)
</file>

<file path="docs/demosurveys/ls205_cascading_array_filter_exclude.lss">
<?xml version="1.0" encoding="UTF-8"?>
<document>
 <LimeSurveyDocType>Survey</LimeSurveyDocType>
 <DBVersion>177</DBVersion>
 <languages>
  <language>en</language>
 </languages>
 <groups>
  <fields>
   <fieldname>gid</fieldname>
   <fieldname>sid</fieldname>
   <fieldname>group_name</fieldname>
   <fieldname>group_order</fieldname>
   <fieldname>description</fieldname>
   <fieldname>language</fieldname>
   <fieldname>randomization_group</fieldname>
   <fieldname>grelevance</fieldname>
  </fields>
  <rows>
   <row>
    <gid><![CDATA[21]]></gid>
    <sid><![CDATA[57165]]></sid>
    <group_name><![CDATA[shape1]]></group_name>
    <group_order><![CDATA[0]]></group_order>
    <description/>
    <language><![CDATA[en]]></language>
    <randomization_group/>
    <grelevance><![CDATA[1]]></grelevance>
   </row>
   <row>
... (901 lines truncated)
</file>

<file path="docs/demosurveys/ls205_cascading_array_filter.lss">
<?xml version="1.0" encoding="UTF-8"?>
<document>
 <LimeSurveyDocType>Survey</LimeSurveyDocType>
 <DBVersion>177</DBVersion>
 <languages>
  <language>en</language>
 </languages>
 <answers>
  <fields>
   <fieldname>qid</fieldname>
   <fieldname>code</fieldname>
   <fieldname>answer</fieldname>
   <fieldname>sortorder</fieldname>
   <fieldname>assessment_value</fieldname>
   <fieldname>language</fieldname>
   <fieldname>scale_id</fieldname>
  </fields>
  <rows>
   <row>
    <qid><![CDATA[1153]]></qid>
    <code><![CDATA[I]]></code>
    <answer><![CDATA[Product I]]></answer>
    <sortorder><![CDATA[9]]></sortorder>
    <assessment_value><![CDATA[1]]></assessment_value>
    <language><![CDATA[en]]></language>
    <scale_id><![CDATA[0]]></scale_id>
   </row>
   <row>
    <qid><![CDATA[1153]]></qid>
    <code><![CDATA[J]]></code>
... (2256 lines truncated)
</file>

<file path="docs/demosurveys/ls205_comma_as_radix_separator.lss">
<?xml version="1.0" encoding="UTF-8"?>
<document>
 <LimeSurveyDocType>Survey</LimeSurveyDocType>
 <DBVersion>177</DBVersion>
 <languages>
  <language>en</language>
 </languages>
 <answers>
  <fields>
   <fieldname>qid</fieldname>
   <fieldname>code</fieldname>
   <fieldname>answer</fieldname>
   <fieldname>sortorder</fieldname>
   <fieldname>assessment_value</fieldname>
   <fieldname>language</fieldname>
   <fieldname>scale_id</fieldname>
  </fields>
  <rows>
   <row>
    <qid><![CDATA[1217]]></qid>
    <code><![CDATA[A]]></code>
    <answer><![CDATA[A]]></answer>
    <sortorder><![CDATA[1]]></sortorder>
    <assessment_value><![CDATA[1]]></assessment_value>
    <language><![CDATA[en]]></language>
    <scale_id><![CDATA[0]]></scale_id>
   </row>
   <row>
    <qid><![CDATA[1217]]></qid>
    <code><![CDATA[B]]></code>
... (2001 lines truncated)
</file>

<file path="docs/demosurveys/ls205_countifop_sumifop.lss">
<?xml version="1.0" encoding="UTF-8"?>
<document>
 <LimeSurveyDocType>Survey</LimeSurveyDocType>
 <DBVersion>177</DBVersion>
 <languages>
  <language>en</language>
 </languages>
 <groups>
  <fields>
   <fieldname>gid</fieldname>
   <fieldname>sid</fieldname>
   <fieldname>group_name</fieldname>
   <fieldname>group_order</fieldname>
   <fieldname>description</fieldname>
   <fieldname>language</fieldname>
   <fieldname>randomization_group</fieldname>
   <fieldname>grelevance</fieldname>
  </fields>
  <rows>
   <row>
    <gid><![CDATA[28]]></gid>
    <sid><![CDATA[41614]]></sid>
    <group_name><![CDATA[G1]]></group_name>
    <group_order><![CDATA[0]]></group_order>
    <description/>
    <language><![CDATA[en]]></language>
    <randomization_group/>
    <grelevance/>
   </row>
   <row>
... (897 lines truncated)
</file>

<file path="docs/demosurveys/ls205_em_tailoring.lss">
<?xml version="1.0" encoding="UTF-8"?>
<document>
 <LimeSurveyDocType>Survey</LimeSurveyDocType>
 <DBVersion>177</DBVersion>
 <languages>
  <language>en</language>
 </languages>
 <answers>
  <fields>
   <fieldname>qid</fieldname>
   <fieldname>code</fieldname>
   <fieldname>answer</fieldname>
   <fieldname>sortorder</fieldname>
   <fieldname>assessment_value</fieldname>
   <fieldname>language</fieldname>
   <fieldname>scale_id</fieldname>
  </fields>
  <rows>
   <row>
    <qid><![CDATA[2885]]></qid>
    <code><![CDATA[cult]]></code>
    <answer><![CDATA[Cultural Events]]></answer>
    <sortorder><![CDATA[2]]></sortorder>
    <assessment_value><![CDATA[1]]></assessment_value>
    <language><![CDATA[en]]></language>
    <scale_id><![CDATA[0]]></scale_id>
   </row>
   <row>
    <qid><![CDATA[2885]]></qid>
    <code><![CDATA[pol]]></code>
... (3680 lines truncated)
</file>

<file path="docs/demosurveys/ls205_em_validation_q.lss">
<?xml version="1.0" encoding="UTF-8"?>
<document>
 <LimeSurveyDocType>Survey</LimeSurveyDocType>
 <DBVersion>177</DBVersion>
 <languages>
  <language>en</language>
 </languages>
 <answers>
  <fields>
   <fieldname>qid</fieldname>
   <fieldname>code</fieldname>
   <fieldname>answer</fieldname>
   <fieldname>sortorder</fieldname>
   <fieldname>assessment_value</fieldname>
   <fieldname>language</fieldname>
   <fieldname>scale_id</fieldname>
  </fields>
  <rows>
   <row>
    <qid><![CDATA[1429]]></qid>
    <code><![CDATA[1]]></code>
    <answer><![CDATA[1]]></answer>
    <sortorder><![CDATA[1]]></sortorder>
    <assessment_value><![CDATA[1]]></assessment_value>
    <language><![CDATA[en]]></language>
    <scale_id><![CDATA[0]]></scale_id>
   </row>
   <row>
    <qid><![CDATA[1429]]></qid>
    <code><![CDATA[2]]></code>
... (1798 lines truncated)
</file>

<file path="docs/demosurveys/ls205_group_relevance.lss">
<?xml version="1.0" encoding="UTF-8"?>
<document>
 <LimeSurveyDocType>Survey</LimeSurveyDocType>
 <DBVersion>177</DBVersion>
 <languages>
  <language>en</language>
 </languages>
 <answers>
  <fields>
   <fieldname>qid</fieldname>
   <fieldname>code</fieldname>
   <fieldname>answer</fieldname>
   <fieldname>sortorder</fieldname>
   <fieldname>assessment_value</fieldname>
   <fieldname>language</fieldname>
   <fieldname>scale_id</fieldname>
  </fields>
  <rows>
   <row>
    <qid><![CDATA[3271]]></qid>
    <code><![CDATA[1]]></code>
    <answer><![CDATA[Spouse]]></answer>
    <sortorder><![CDATA[1]]></sortorder>
    <assessment_value><![CDATA[1]]></assessment_value>
    <language><![CDATA[en]]></language>
    <scale_id><![CDATA[0]]></scale_id>
   </row>
   <row>
    <qid><![CDATA[3271]]></qid>
    <code><![CDATA[10]]></code>
... (4308 lines truncated)
</file>

<file path="docs/demosurveys/ls205_maximum_chars_feature.lss">
<?xml version="1.0" encoding="UTF-8"?>
<document>
 <LimeSurveyDocType>Survey</LimeSurveyDocType>
 <DBVersion>177</DBVersion>
 <languages>
  <language>en</language>
 </languages>
 <groups>
  <fields>
   <fieldname>gid</fieldname>
   <fieldname>sid</fieldname>
   <fieldname>group_name</fieldname>
   <fieldname>group_order</fieldname>
   <fieldname>description</fieldname>
   <fieldname>language</fieldname>
   <fieldname>randomization_group</fieldname>
   <fieldname>grelevance</fieldname>
  </fields>
  <rows>
   <row>
    <gid><![CDATA[49]]></gid>
    <sid><![CDATA[21157]]></sid>
    <group_name><![CDATA[G1]]></group_name>
    <group_order><![CDATA[0]]></group_order>
    <description/>
    <language><![CDATA[en]]></language>
    <randomization_group/>
    <grelevance/>
   </row>
  </rows>
... (1709 lines truncated)
</file>

<file path="docs/demosurveys/ls205_plurals_test.lss">
<?xml version="1.0" encoding="UTF-8"?>
<document>
 <LimeSurveyDocType>Survey</LimeSurveyDocType>
 <DBVersion>177</DBVersion>
 <languages>
  <language>en</language>
 </languages>
 <defaultvalues>
  <fields>
   <fieldname>qid</fieldname>
   <fieldname>scale_id</fieldname>
   <fieldname>sqid</fieldname>
   <fieldname>language</fieldname>
   <fieldname>specialtype</fieldname>
   <fieldname>defaultvalue</fieldname>
  </fields>
  <rows>
   <row>
    <qid><![CDATA[3299]]></qid>
    <scale_id><![CDATA[0]]></scale_id>
    <sqid><![CDATA[3309]]></sqid>
    <language><![CDATA[en]]></language>
    <specialtype/>
    <defaultvalue><![CDATA[Y]]></defaultvalue>
   </row>
   <row>
    <qid><![CDATA[3299]]></qid>
    <scale_id><![CDATA[0]]></scale_id>
    <sqid><![CDATA[3307]]></sqid>
    <language><![CDATA[en]]></language>
... (2238 lines truncated)
</file>

<file path="docs/demosurveys/ls205_randomization_group_test.lss">
<?xml version="1.0" encoding="UTF-8"?>
<document>
 <LimeSurveyDocType>Survey</LimeSurveyDocType>
 <DBVersion>177</DBVersion>
 <languages>
  <language>fr</language>
  <language>en</language>
 </languages>
 <answers>
  <fields>
   <fieldname>qid</fieldname>
   <fieldname>code</fieldname>
   <fieldname>answer</fieldname>
   <fieldname>sortorder</fieldname>
   <fieldname>assessment_value</fieldname>
   <fieldname>language</fieldname>
   <fieldname>scale_id</fieldname>
  </fields>
  <rows>
   <row>
    <qid><![CDATA[1526]]></qid>
    <code><![CDATA[A1]]></code>
    <answer><![CDATA[Some example answer option]]></answer>
    <sortorder><![CDATA[1]]></sortorder>
    <assessment_value><![CDATA[0]]></assessment_value>
    <language><![CDATA[en]]></language>
    <scale_id><![CDATA[0]]></scale_id>
   </row>
   <row>
    <qid><![CDATA[1526]]></qid>
... (3016 lines truncated)
</file>

<file path="docs/demosurveys/ls205_sample_survey_english.lss">
<?xml version="1.0" encoding="UTF-8"?>
<document>
 <LimeSurveyDocType>Survey</LimeSurveyDocType>
 <DBVersion>177</DBVersion>
 <languages>
  <language>en</language>
 </languages>
 <answers>
  <fields>
   <fieldname>qid</fieldname>
   <fieldname>code</fieldname>
   <fieldname>answer</fieldname>
   <fieldname>sortorder</fieldname>
   <fieldname>assessment_value</fieldname>
   <fieldname>language</fieldname>
   <fieldname>scale_id</fieldname>
  </fields>
  <rows>
   <row>
    <qid><![CDATA[21]]></qid>
    <code><![CDATA[1]]></code>
    <answer><![CDATA[Reading]]></answer>
    <sortorder><![CDATA[1]]></sortorder>
    <assessment_value><![CDATA[1]]></assessment_value>
    <language><![CDATA[en]]></language>
    <scale_id><![CDATA[0]]></scale_id>
   </row>
   <row>
    <qid><![CDATA[21]]></qid>
    <code><![CDATA[2]]></code>
... (18378 lines truncated)
</file>

<file path="docs/demosurveys/ls205_self_and_that.lss">
<?xml version="1.0" encoding="UTF-8"?>
<document>
 <LimeSurveyDocType>Survey</LimeSurveyDocType>
 <DBVersion>177</DBVersion>
 <languages>
  <language>en</language>
 </languages>
 <groups>
  <fields>
   <fieldname>gid</fieldname>
   <fieldname>sid</fieldname>
   <fieldname>group_name</fieldname>
   <fieldname>group_order</fieldname>
   <fieldname>description</fieldname>
   <fieldname>language</fieldname>
   <fieldname>randomization_group</fieldname>
   <fieldname>grelevance</fieldname>
  </fields>
  <rows>
   <row>
    <gid><![CDATA[1]]></gid>
    <sid><![CDATA[12947]]></sid>
    <group_name><![CDATA[G1]]></group_name>
    <group_order><![CDATA[0]]></group_order>
    <description><![CDATA[<i>self.suffix</i> is internally expanded to a comma-separated list of all variable names for the current question.  Thus, it is useful for functions that take a variable number of arguments, like sum(), count(), min(), max(), and implode().<br/>
<i>that.suffix</i> is also expanded.]]></description>
    <language><![CDATA[en]]></language>
    <randomization_group/>
    <grelevance/>
   </row>
... (1007 lines truncated)
</file>

<file path="docs/demosurveys/ls205_subquestion_relevance.lss">
<?xml version="1.0" encoding="UTF-8"?>
<document>
 <LimeSurveyDocType>Survey</LimeSurveyDocType>
 <DBVersion>177</DBVersion>
 <languages>
  <language>en</language>
 </languages>
 <groups>
  <fields>
   <fieldname>gid</fieldname>
   <fieldname>sid</fieldname>
   <fieldname>group_name</fieldname>
   <fieldname>group_order</fieldname>
   <fieldname>description</fieldname>
   <fieldname>language</fieldname>
   <fieldname>randomization_group</fieldname>
   <fieldname>grelevance</fieldname>
  </fields>
  <rows>
   <row>
    <gid><![CDATA[2]]></gid>
    <sid><![CDATA[36161]]></sid>
    <group_name><![CDATA[G1]]></group_name>
    <group_order><![CDATA[0]]></group_order>
    <description/>
    <language><![CDATA[en]]></language>
    <randomization_group/>
    <grelevance/>
   </row>
  </rows>
... (1306 lines truncated)
</file>

<file path="docs/demosurveys/ls205_test_em_sq_validation.lss">
<?xml version="1.0" encoding="UTF-8"?>
<document>
 <LimeSurveyDocType>Survey</LimeSurveyDocType>
 <DBVersion>177</DBVersion>
 <languages>
  <language>en</language>
 </languages>
 <groups>
  <fields>
   <fieldname>gid</fieldname>
   <fieldname>sid</fieldname>
   <fieldname>group_name</fieldname>
   <fieldname>group_order</fieldname>
   <fieldname>description</fieldname>
   <fieldname>language</fieldname>
   <fieldname>randomization_group</fieldname>
   <fieldname>grelevance</fieldname>
  </fields>
  <rows>
   <row>
    <gid><![CDATA[3]]></gid>
    <sid><![CDATA[16175]]></sid>
    <group_name><![CDATA[SQ]]></group_name>
    <group_order><![CDATA[0]]></group_order>
    <description><![CDATA[Demos using em_validation_sq]]></description>
    <language><![CDATA[en]]></language>
    <randomization_group/>
    <grelevance/>
   </row>
   <row>
... (3772 lines truncated)
</file>

<file path="docs/demosurveys/ls205_validation_tests.lss">
<?xml version="1.0" encoding="UTF-8"?>
<document>
 <LimeSurveyDocType>Survey</LimeSurveyDocType>
 <DBVersion>177</DBVersion>
 <languages>
  <language>en</language>
 </languages>
 <answers>
  <fields>
   <fieldname>qid</fieldname>
   <fieldname>code</fieldname>
   <fieldname>answer</fieldname>
   <fieldname>sortorder</fieldname>
   <fieldname>assessment_value</fieldname>
   <fieldname>language</fieldname>
   <fieldname>scale_id</fieldname>
  </fields>
  <rows>
   <row>
    <qid><![CDATA[122]]></qid>
    <code><![CDATA[3]]></code>
    <answer><![CDATA[High]]></answer>
    <sortorder><![CDATA[3]]></sortorder>
    <assessment_value><![CDATA[1]]></assessment_value>
    <language><![CDATA[en]]></language>
    <scale_id><![CDATA[0]]></scale_id>
   </row>
   <row>
    <qid><![CDATA[122]]></qid>
    <code><![CDATA[3]]></code>
... (6390 lines truncated)
</file>

<file path="docs/demosurveys/ls206_em_subquestion_relevance.lss">
<?xml version="1.0" encoding="UTF-8"?>
<document>
 <LimeSurveyDocType>Survey</LimeSurveyDocType>
 <DBVersion>177</DBVersion>
 <languages>
  <language>en</language>
 </languages>
 <answers>
  <fields>
   <fieldname>qid</fieldname>
   <fieldname>code</fieldname>
   <fieldname>answer</fieldname>
   <fieldname>sortorder</fieldname>
   <fieldname>assessment_value</fieldname>
   <fieldname>language</fieldname>
   <fieldname>scale_id</fieldname>
  </fields>
  <rows>
   <row>
    <qid><![CDATA[20362]]></qid>
    <code><![CDATA[1]]></code>
    <answer><![CDATA[Yes]]></answer>
    <sortorder><![CDATA[1]]></sortorder>
    <assessment_value><![CDATA[1]]></assessment_value>
    <language><![CDATA[en]]></language>
    <scale_id><![CDATA[0]]></scale_id>
   </row>
   <row>
    <qid><![CDATA[20362]]></qid>
    <code><![CDATA[0]]></code>
... (3903 lines truncated)
</file>

<file path="docs/demosurveys/ls5_EM_question_attributes.lss">
<?xml version="1.0" encoding="UTF-8"?>
<document>
 <LimeSurveyDocType>Survey</LimeSurveyDocType>
 <DBVersion>495</DBVersion>
 <languages>
  <language>en</language>
 </languages>
 <answers>
  <fields>
   <fieldname>aid</fieldname>
   <fieldname>qid</fieldname>
   <fieldname>code</fieldname>
   <fieldname>sortorder</fieldname>
   <fieldname>assessment_value</fieldname>
   <fieldname>scale_id</fieldname>
  </fields>
  <rows>
   <row>
    <aid><![CDATA[233]]></aid>
    <qid><![CDATA[1217]]></qid>
    <code><![CDATA[AO01]]></code>
    <sortorder><![CDATA[0]]></sortorder>
    <assessment_value><![CDATA[0]]></assessment_value>
    <scale_id><![CDATA[0]]></scale_id>
   </row>
   <row>
    <aid><![CDATA[241]]></aid>
    <qid><![CDATA[1227]]></qid>
    <code><![CDATA[A]]></code>
    <sortorder><![CDATA[0]]></sortorder>
... (15894 lines truncated)
</file>

<file path="docs/demosurveys/ls5_sample_survey_multilingual_fr_de_en_it.lss">
<?xml version="1.0" encoding="UTF-8"?>
<document>
 <LimeSurveyDocType>Survey</LimeSurveyDocType>
 <DBVersion>495</DBVersion>
 <languages>
  <language>fr</language>
  <language>it</language>
  <language>de-informal</language>
  <language>en</language>
 </languages>
 <answers>
  <fields>
   <fieldname>aid</fieldname>
   <fieldname>qid</fieldname>
   <fieldname>code</fieldname>
   <fieldname>sortorder</fieldname>
   <fieldname>assessment_value</fieldname>
   <fieldname>scale_id</fieldname>
  </fields>
  <rows>
   <row>
    <aid><![CDATA[299]]></aid>
    <qid><![CDATA[1569]]></qid>
    <code><![CDATA[AO01]]></code>
    <sortorder><![CDATA[0]]></sortorder>
    <assessment_value><![CDATA[0]]></assessment_value>
    <scale_id><![CDATA[0]]></scale_id>
   </row>
   <row>
    <aid><![CDATA[311]]></aid>
... (15594 lines truncated)
</file>

<file path="docs/demosurveys/ls6_sample_survey_multilingual_fr_de_en_it_ru.lss">
<?xml version="1.0" encoding="UTF-8"?>
<document>
 <LimeSurveyDocType>Survey</LimeSurveyDocType>
 <DBVersion>498</DBVersion>
 <languages>
  <language>fr</language>
  <language>de-informal</language>
  <language>it</language>
  <language>ru</language>
  <language>en</language>
 </languages>
 <answers>
  <fields>
   <fieldname>aid</fieldname>
   <fieldname>qid</fieldname>
   <fieldname>code</fieldname>
   <fieldname>sortorder</fieldname>
   <fieldname>assessment_value</fieldname>
   <fieldname>scale_id</fieldname>
  </fields>
  <rows>
   <row>
    <aid><![CDATA[87926]]></aid>
    <qid><![CDATA[22844]]></qid>
    <code><![CDATA[A11]]></code>
    <sortorder><![CDATA[0]]></sortorder>
    <assessment_value><![CDATA[1]]></assessment_value>
    <scale_id><![CDATA[0]]></scale_id>
   </row>
   <row>
... (26376 lines truncated)
</file>

<file path="docs/demosurveys/ls7_EM_question_attributes_multilang.lss">
<?xml version="1.0" encoding="UTF-8"?>
<document>
 <LimeSurveyDocType>Survey</LimeSurveyDocType>
 <DBVersion>703</DBVersion>
 <languages>
  <language>de</language>
  <language>en</language>
 </languages>
 <answers>
  <fields>
   <fieldname>aid</fieldname>
   <fieldname>qid</fieldname>
   <fieldname>code</fieldname>
   <fieldname>sortorder</fieldname>
   <fieldname>assessment_value</fieldname>
   <fieldname>scale_id</fieldname>
  </fields>
  <rows>
   <row>
    <aid><![CDATA[291]]></aid>
    <qid><![CDATA[816]]></qid>
    <code><![CDATA[AO01]]></code>
    <sortorder><![CDATA[0]]></sortorder>
    <assessment_value><![CDATA[0]]></assessment_value>
    <scale_id><![CDATA[0]]></scale_id>
   </row>
   <row>
    <aid><![CDATA[292]]></aid>
    <qid><![CDATA[819]]></qid>
    <code><![CDATA[AO01]]></code>
... (22000 lines truncated)
</file>

<file path="docs/demosurveys/ls7_Samplesurvey_en_de.lss">
<?xml version="1.0" encoding="UTF-8"?>
<document>
 <LimeSurveyDocType>Survey</LimeSurveyDocType>
 <DBVersion>703</DBVersion>
 <languages>
  <language>de</language>
  <language>en</language>
 </languages>
 <answers>
  <fields>
   <fieldname>aid</fieldname>
   <fieldname>qid</fieldname>
   <fieldname>code</fieldname>
   <fieldname>sortorder</fieldname>
   <fieldname>assessment_value</fieldname>
   <fieldname>scale_id</fieldname>
  </fields>
  <rows>
   <row>
    <aid><![CDATA[342]]></aid>
    <qid><![CDATA[1175]]></qid>
    <code><![CDATA[AO01]]></code>
    <sortorder><![CDATA[0]]></sortorder>
    <assessment_value><![CDATA[0]]></assessment_value>
    <scale_id><![CDATA[0]]></scale_id>
   </row>
   <row>
    <aid><![CDATA[343]]></aid>
    <qid><![CDATA[1174]]></qid>
    <code><![CDATA[AO01]]></code>
... (13080 lines truncated)
</file>

<file path="docs/open-api/v1.json">
{
    "openapi": "3.0.2",
    "info": {
        "title": "LimeSurvey V1",
        "description": "LimeSurvey V1 REST API",
        "version": "1"
    },
    "paths": {
        "\/rest\/v1\/survey-responses\/{_id}": {
            "post": {
                "tags": [
                    "Survey"
                ],
                "summary": "Survey responses",
                "operationId": "post.survey-responses.id",
                "parameters": [
                    {
                        "name": "_id",
                        "in": "path"
                    },
                    {
                        "name": "filters",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
... (6996 lines truncated)
</file>

<file path="docs/swagger/index.html">
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <title>Swagger UI</title>
    <link rel="stylesheet" type="text/css" href="./swagger-ui.css" />
    <link rel="stylesheet" type="text/css" href="index.css" />
    <link rel="icon" type="image/png" href="./favicon-32x32.png" sizes="32x32" />
    <link rel="icon" type="image/png" href="./favicon-16x16.png" sizes="16x16" />
  </head>
  <body>
    <div id="swagger-ui"></div>
    <script src="./swagger-ui-bundle.js" charset="UTF-8"> </script>
    <script src="./swagger-ui-standalone-preset.js" charset="UTF-8"> </script>
    <script src="./swagger-initializer.js" charset="UTF-8"> </script>
  </body>
</html>
</file>

<file path="docs/swagger/oauth2-redirect.html">
<!doctype html>
<html lang="en-US">
<head>
    <title>Swagger UI: OAuth2 Redirect</title>
</head>
<body>
<script>
    'use strict';
    function run () {
        var oauth2 = window.opener.swaggerUIRedirectOauth2;
        var sentState = oauth2.state;
        var redirectUrl = oauth2.redirectUrl;
        var isValid, qp, arr;
        if (/code|token|error/.test(window.location.hash)) {
            qp = window.location.hash.substring(1).replace('?', '&');
        } else {
            qp = location.search.substring(1);
        }
        arr = qp.split("&");
        arr.forEach(function (v,i,_arr) { _arr[i] = '"' + v.replace('=', '":"') + '"';});
        qp = qp ? JSON.parse('{' + arr.join() + '}',
                function (key, value) {
                    return key === "" ? value : decodeURIComponent(value);
                }
        ) : {};
        isValid = qp.state === sentState;
        if ((
          oauth2.auth.schema.get("flow") === "accessCode" ||
          oauth2.auth.schema.get("flow") === "authorizationCode" ||
          oauth2.auth.schema.get("flow") === "authorization_code"
... (43 lines truncated)
</file>

<file path="docs/swagger/swagger-initializer.js">
window.onload = function() {
  window.ui = SwaggerUIBundle({
    urls: [
        { name: 'v1.0.0', url: "/docs/open-api/v1.json" }
    ],
    dom_id: '#swagger-ui',
    deepLinking: true,
    presets: [
      SwaggerUIBundle.presets.apis,
      SwaggerUIStandalonePreset
    ],
    plugins: [
      SwaggerUIBundle.plugins.DownloadUrl
    ],
    layout: "StandaloneLayout"
  });
};
</file>

<file path="docs/swagger/swagger-ui-bundle.js">
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.SwaggerUIBundle=t():e.SwaggerUIBundle=t()}(this,(function(){return(()=>{var e={17967:(e,t)=>{"use strict";t.N=void 0;var r=/^([^\w]*)(javascript|data|vbscript)/im,n=/&#(\w+)(^\w|;)?/g,o=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,a=/^([^:]+):/gm,i=[".","/"];t.N=function(e){var t,s=(t=e||"",t.replace(n,(function(e,t){return String.fromCharCode(t)}))).replace(o,"").trim();if(!s)return"about:blank";if(function(e){return i.indexOf(e[0])>-1}(s))return s;var l=s.match(a);if(!l)return s;var u=l[0];return r.test(u)?"about:blank":s}},53795:(e,t,r)=>{"use strict";r.d(t,{Z:()=>P});var n=r(23101),o=r.n(n),a=r(61125),i=r.n(a),s=r(11882),l=r.n(s),u=r(97606),c=r.n(u),p=r(67294),f=r(43393);function h(e){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},h(e)}function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function m(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function g(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function v(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function y(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?v(r,!0).forEach((function(t){g(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):v(r).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function b(e){return b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},b(e)}function w(e,t){return w=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},w(e,t)}function E(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}var x={};function _(e,t,r){return function(e){return null==e}(e)?r:function(e){return null!==e&&"object"===h(e)&&"function"==typeof e.get&&"function"==typeof e.has}(e)?e.has(t)?e.get(t):r:hasOwnProperty.call(e,t)?e[t]:r}function S(e,t,r){for(var n=0;n!==t.length;)if((e=_(e,t[n++],x))===x)return r;return e}function A(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=k(t,r),o=e||Object.keys(y({},r,{},t));return o.every(n)}function k(e,t){return function(r){if("string"==typeof r)return(0,f.is)(t[r],e[r]);if(Array.isArray(r))return(0,f.is)(S(t,r),S(e,r));throw new TypeError("Invalid key: expected Array or string: "+r)}}var C=function(e){function t(){return d(this,t),E(this,b(t).apply(this,arguments))}var r,n,o;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&w(e,t)}(t,e),r=t,n=[{key:"shouldComponentUpdate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return!A(this.updateOnProps,this.props,e,"updateOnProps")||!A(this.updateOnStates,this.state,t,"updateOnStates")}}],n&&m(r.prototype,n),o&&m(r,o),t}(p.Component);const O=C;var j=r(23930),I=r.n(j),N=r(45697),T=r.n(N);class P extends O{constructor(){super(...arguments),i()(this,"getModelName",(e=>-1!==l()(e).call(e,"#/definitions/")?e.replace(/^.*#\/definitions\//,""):-1!==l()(e).call(e,"#/components/schemas/")?e.replace(/^.*#\/components\/schemas\//,""):void 0)),i()(this,"getRefSchema",(e=>{let{specSelectors:t}=this.props;return t.findDefinition(e)}))}render(){let{getComponent:e,getConfigs:t,specSelectors:n,schema:a,required:i,name:s,isRef:l,specPath:u,displayName:c,includeReadOnly:f,includeWriteOnly:h}=this.props;const d=e("ObjectModel"),m=e("ArrayModel"),g=e("PrimitiveModel");let v="object",y=a&&a.get("$$ref");if(!s&&y&&(s=this.getModelName(y)),!a&&y&&(a=this.getRefSchema(s)),!a)return p.createElement("span",{className:"model model-title"},p.createElement("span",{className:"model-title__text"},c||s),p.createElement("img",{src:r(2517),height:"20px",width:"20px"}));const b=n.isOAS3()&&a.get("deprecated");switch(l=void 0!==l?l:!!y,v=a&&a.get("type")||v,v){case"object":return p.createElement(d,o()({className:"object"},this.props,{specPath:u,getConfigs:t,schema:a,name:s,deprecated:b,isRef:l,includeReadOnly:f,includeWriteOnly:h}));case"array":return p.createElement(m,o()({className:"array"},this.props,{getConfigs:t,schema:a,name:s,deprecated:b,required:i,includeReadOnly:f,includeWriteOnly:h}));default:return p.createElement(g,o()({},this.props,{getComponent:e,getConfigs:t,schema:a,name:s,deprecated:b,required:i}))}}}i()(P,"propTypes",{schema:c()(I()).isRequired,getComponent:T().func.isRequired,getConfigs:T().func.isRequired,specSelectors:T().object.isRequired,name:T().string,displayName:T().string,isRef:T().bool,required:T().bool,expandDepth:T().number,depth:T().number,specPath:I().list.isRequired,includeReadOnly:T().bool,includeWriteOnly:T().bool})},5623:(e,t,r)=>{"use strict";r.d(t,{Z:()=>f});var n=r(61125),o=r.n(n),a=r(28222),i=r.n(a),s=r(67294),l=r(84564),u=r.n(l),c=r(90242),p=r(27504);class f extends s.Component{constructor(e,t){super(e,t),o()(this,"getDefinitionUrl",(()=>{let{specSelectors:e}=this.props;return new(u())(e.url(),p.Z.location).toString()}));let{getConfigs:r}=e,{validatorUrl:n}=r();this.state={url:this.getDefinitionUrl(),validatorUrl:void 0===n?"https://validator.swagger.io/validator":n}}UNSAFE_componentWillReceiveProps(e){let{getConfigs:t}=e,{validatorUrl:r}=t();this.setState({url:this.getDefinitionUrl(),validatorUrl:void 0===r?"https://validator.swagger.io/validator":r})}render(){let{getConfigs:e}=this.props,{spec:t}=e(),r=(0,c.Nm)(this.state.validatorUrl);return"object"==typeof t&&i()(t).length?null:this.state.url&&(0,c.hW)(this.state.validatorUrl)&&(0,c.hW)(this.state.url)?s.createElement("span",{className:"float-right"},s.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:`${r}/debug?url=${encodeURIComponent(this.state.url)}`},s.createElement(h,{src:`${r}?url=${encodeURIComponent(this.state.url)}`,alt:"Online validator badge"}))):null}}class h extends s.Component{constructor(e){super(e),this.state={loaded:!1,error:!1}}componentDidMount(){const e=new Image;e.onload=()=>{this.setState({loaded:!0})},e.onerror=()=>{this.setState({error:!0})},e.src=this.props.src}UNSAFE_componentWillReceiveProps(e){if(e.src!==this.props.src){const t=new Image;t.onload=()=>{this.setState({loaded:!0})},t.onerror=()=>{this.setState({error:!0})},t.src=e.src}}render(){return this.state.error?s.createElement("img",{alt:"Error"}):this.state.loaded?s.createElement("img",{src:this.props.src,alt:this.props.alt}):null}}},86019:(e,t,r)=>{"use strict";r.d(t,{Z:()=>me,s:()=>ge});var n=r(67294),o=r(89927);function a(e,t){if(Array.prototype.indexOf)return e.indexOf(t);for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}function i(e,t){for(var r=e.length-1;r>=0;r--)!0===t(e[r])&&e.splice(r,1)}function s(e){throw new Error("Unhandled case for value: '"+e+"'")}var l=function(){function e(e){void 0===e&&(e={}),this.tagName="",this.attrs={},this.innerHTML="",this.whitespaceRegex=/\s+/,this.tagName=e.tagName||"",this.attrs=e.attrs||{},this.innerHTML=e.innerHtml||e.innerHTML||""}return e.prototype.setTagName=function(e){return this.tagName=e,this},e.prototype.getTagName=function(){return this.tagName||""},e.prototype.setAttr=function(e,t){return this.getAttrs()[e]=t,this},e.prototype.getAttr=function(e){return this.getAttrs()[e]},e.prototype.setAttrs=function(e){return Object.assign(this.getAttrs(),e),this},e.prototype.getAttrs=function(){return this.attrs||(this.attrs={})},e.prototype.setClass=function(e){return this.setAttr("class",e)},e.prototype.addClass=function(e){for(var t,r=this.getClass(),n=this.whitespaceRegex,o=r?r.split(n):[],i=e.split(n);t=i.shift();)-1===a(o,t)&&o.push(t);return this.getAttrs().class=o.join(" "),this},e.prototype.removeClass=function(e){for(var t,r=this.getClass(),n=this.whitespaceRegex,o=r?r.split(n):[],i=e.split(n);o.length&&(t=i.shift());){var s=a(o,t);-1!==s&&o.splice(s,1)}return this.getAttrs().class=o.join(" "),this},e.prototype.getClass=function(){return this.getAttrs().class||""},e.prototype.hasClass=function(e){return-1!==(" "+this.getClass()+" ").indexOf(" "+e+" ")},e.prototype.setInnerHTML=function(e){return this.innerHTML=e,this},e.prototype.setInnerHtml=function(e){return this.setInnerHTML(e)},e.prototype.getInnerHTML=function(){return this.innerHTML||""},e.prototype.getInnerHtml=function(){return this.getInnerHTML()},e.prototype.toAnchorString=function(){var e=this.getTagName(),t=this.buildAttrsStr();return["<",e,t=t?" "+t:"",">",this.getInnerHtml(),"</",e,">"].join("")},e.prototype.buildAttrsStr=function(){if(!this.attrs)return"";var e=this.getAttrs(),t=[];for(var r in e)e.hasOwnProperty(r)&&t.push(r+'="'+e[r]+'"');return t.join(" ")},e}();var u=function(){function e(e){void 0===e&&(e={}),this.newWindow=!1,this.truncate={},this.className="",this.newWindow=e.newWindow||!1,this.truncate=e.truncate||{},this.className=e.className||""}return e.prototype.build=function(e){return new l({tagName:"a",attrs:this.createAttrs(e),innerHtml:this.processAnchorText(e.getAnchorText())})},e.prototype.createAttrs=function(e){var t={href:e.getAnchorHref()},r=this.createCssClass(e);return r&&(t.class=r),this.newWindow&&(t.target="_blank",t.rel="noopener noreferrer"),this.truncate&&this.truncate.length&&this.truncate.length<e.getAnchorText().length&&(t.title=e.getAnchorHref()),t},e.prototype.createCssClass=function(e){var t=this.className;if(t){for(var r=[t],n=e.getCssClassSuffixes(),o=0,a=n.length;o<a;o++)r.push(t+"-"+n[o]);return r.join(" ")}return""},e.prototype.processAnchorText=function(e){return e=this.doTruncate(e)},e.prototype.doTruncate=function(e){var t=this.truncate;if(!t||!t.length)return e;var r=t.length,n=t.location;return"smart"===n?function(e,t,r){var n,o;null==r?(r="&hellip;",o=3,n=8):(o=r.length,n=r.length);var a=function(e){var t="";return e.scheme&&e.host&&(t+=e.scheme+":
</file>

<file path="docs/swagger/swagger-ui-es-bundle-core.js">
import*as e from"react-immutable-pure-component";import*as t from"remarkable/linkify";import*as r from"dompurify";import*as a from"zenscroll";import*as n from"lodash/reduce";import*as l from"@babel/runtime-corejs3/core-js-stable/instance/repeat";import*as s from"@babel/runtime-corejs3/core-js-stable/instance/fill";import*as o from"lodash/zipObject";import*as i from"randexp";import*as u from"lodash/isEmpty";import*as c from"@babel/runtime-corejs3/core-js-stable/promise";import*as d from"@babel/runtime-corejs3/core-js-stable/date/now";import*as p from"lodash/isString";import*as f from"lodash/debounce";import*as h from"lodash/set";import*as m from"swagger-client/es/resolver";import*as g from"swagger-client/es/execute";import*as y from"swagger-client/es/http";import*as v from"swagger-client/es/subtree-resolver";import*as E from"react-dom";import*as b from"react-redux";import*as S from"lodash/omit";import*as _ from"lodash/identity";import*as w from"react-syntax-highlighter/dist/esm/light";import*as C from"react-syntax-highlighter/dist/esm/languages/hljs/javascript";import*as x from"react-syntax-highlighter/dist/esm/languages/hljs/json";import*as A from"react-syntax-highlighter/dist/esm/languages/hljs/xml";import*as I from"react-syntax-highlighter/dist/esm/languages/hljs/bash";import*as R from"react-syntax-highlighter/dist/esm/languages/hljs/yaml";import*as T from"react-syntax-highlighter/dist/esm/languages/hljs/http";import*as N from"react-syntax-highlighter/dist/esm/languages/hljs/powershell";import*as O from"react-syntax-highlighter/dist/esm/styles/hljs/agate";import*as k from"react-syntax-highlighter/dist/esm/styles/hljs/arta";import*as P from"react-syntax-highlighter/dist/esm/styles/hljs/monokai";import*as M from"react-syntax-highlighter/dist/esm/styles/hljs/nord";import*as j from"react-syntax-highlighter/dist/esm/styles/hljs/obsidian";import*as L from"react-syntax-highlighter/dist/esm/styles/hljs/tomorrow-night";import*as B from"@braintree/sanitize-url";import*as q from"lodash/camelCase";import*as D from"lodash/upperFirst";import*as U from"lodash/find";import*as V from"lodash/some";import*as z from"lodash/eq";import*as F from"css.escape";import*as $ from"@babel/runtime-corejs3/core-js-stable/instance/find-index";import*as J from"@babel/runtime-corejs3/core-js-stable/array/from";import*as W from"@babel/runtime-corejs3/core-js-stable/array/is-array";import*as H from"@babel/runtime-corejs3/core-js-stable/instance/bind";import*as K from"@babel/runtime-corejs3/core-js-stable/instance/concat";import*as G from"@babel/runtime-corejs3/core-js-stable/instance/entries";import*as Z from"@babel/runtime-corejs3/core-js-stable/instance/every";import*as Y from"@babel/runtime-corejs3/core-js-stable/instance/filter";import*as X from"@babel/runtime-corejs3/core-js-stable/instance/find";import*as Q from"@babel/runtime-corejs3/core-js-stable/instance/for-each";import*as ee from"@babel/runtime-corejs3/core-js-stable/instance/includes";import*as te from"@babel/runtime-corejs3/core-js-stable/instance/index-of";import*as re from"@babel/runtime-corejs3/core-js-stable/instance/keys";import*as ae from"@babel/runtime-corejs3/core-js-stable/instance/map";import*as ne from"@babel/runtime-corejs3/core-js-stable/instance/reduce";import*as le from"@babel/runtime-corejs3/core-js-stable/instance/slice";import*as se from"@babel/runtime-corejs3/core-js-stable/instance/some";import*as oe from"@babel/runtime-corejs3/core-js-stable/instance/sort";import*as ie from"@babel/runtime-corejs3/core-js-stable/instance/starts-with";import*as ue from"@babel/runtime-corejs3/core-js-stable/instance/trim";import*as ce from"@babel/runtime-corejs3/core-js-stable/json/stringify";import*as de from"@babel/runtime-corejs3/core-js-stable/map";import*as pe from"@babel/runtime-corejs3/core-js-stable/object/assign";import*as fe from"@babel/runtime-corejs3/core-js-stable/object/keys";import*as he from"@babel/runtime-corejs3/core-js-stable/object/values";import*as me from"@babel/runtime-corejs3/core-js-stable/set-timeout";import*as ge from"@babel/runtime-corejs3/core-js-stable/url";import*as ye from"@babel/runtime-corejs3/helpers/defineProperty";import*as ve from"@babel/runtime-corejs3/helpers/extends";import*as Ee from"base64-js";import*as be from"classnames";import*as Se from"ieee754";import*as _e from"immutable";import*as we from"js-yaml";import*as Ce from"lodash/get";import*as xe from"lodash/isFunction";import*as Ae from"lodash/memoize";import*as Ie from"prop-types";import*as Re from"react";import*as Te from"react-copy-to-clipboard";import*as Ne from"react-immutable-proptypes";import*as Oe from"redux";import*as ke from"remarkable";import*as Pe from"reselect";import*as Me from"serialize-error";import*as je from"swagger-client/es/helpers";import*as Le from"url-parse";import*as Be from"@babel/runtime-corejs3/core-js-stable/instance/last-index-of";import*as qe from"redux-immutable";import*as De from"lodash/merge";import*as Ue from"lodash/toString";import*as Ve from"@babel/runtime-corejs3/core-js-stable/instance/splice";import*as ze from"js-file-download";import*as Fe from"@babel/runtime-corejs3/core-js-stable/instance/values";import*as $e from"xml-but-prettier";import*as Je from"lodash/toLower";import*as We from"react-debounce-input";var He={1543:(t,r,a)=>{a.d(r,{Z:()=>p});var n=a(863),l=a(775),s=a(8818),o=a(2565),i=a(810);const u=(e=>{var t={};return a.d(t,e),t})({default:()=>e.default});var c=a(9569),d=a(5053);class p extends u.default{constructor(){super(...arguments),(0,l.default)(this,"getModelName",(e=>-1!==(0,s.default)(e).call(e,"#/definitions/")?e.replace(/^.*#\/definitions\//,""):-1!==(0,s.default)(e).call(e,"#/components/schemas/")?e.replace(/^.*#\/components\/schemas\//,""):void 0)),(0,l.default)(this,"getRefSchema",(e=>{let{specSelectors:t}=this.props;return t.findDefinition(e)}))}render(){let{getComponent:e,getConfigs:t,specSelectors:r,schema:l,required:s,name:o,isRef:u,specPath:c,displayName:d,includeReadOnly:p,includeWriteOnly:f}=this.props;const h=e("ObjectModel"),m=e("ArrayModel"),g=e("PrimitiveModel");let y="object",v=l&&l.get("$$ref");if(!o&&v&&(o=this.getModelName(v)),!l&&v&&(l=this.getRefSchema(o)),!l)return i.default.createElement("span",{className:"model model-title"},i.default.createElement("span",{className:"model-title__text"},d||o),i.default.createElement("img",{src:a(2517),height:"20px",width:"20px"}));const E=r.isOAS3()&&l.get("deprecated");switch(u=void 0!==u?u:!!v,y=l&&l.get("type")||y,y){case"object":return i.default.createElement(h,(0,n.default)({className:"object"},this.props,{specPath:c,getConfigs:t,schema:l,name:o,deprecated:E,isRef:u,includeReadOnly:p,includeWriteOnly:f}));case"array":return i.default.createElement(m,(0,n.default)({className:"array"},this.props,{getConfigs:t,schema:l,name:o,deprecated:E,required:s,includeReadOnly:p,includeWriteOnly:f}));default:return i.default.createElement(g,(0,n.default)({},this.props,{getComponent:e,getConfigs:t,schema:l,name:o,deprecated:E,required:s}))}}}(0,l.default)(p,"propTypes",{schema:(0,o.default)(c.default).isRequired,getComponent:d.default.func.isRequired,getConfigs:d.default.func.isRequired,specSelectors:d.default.object.isRequired,name:d.default.string,displayName:d.default.string,isRef:d.default.bool,required:d.default.bool,expandDepth:d.default.number,depth:d.default.number,specPath:c.default.list.isRequired,includeReadOnly:d.default.bool,includeWriteOnly:d.default.bool})},5623:(e,t,r)=>{r.d(t,{Z:()=>u});var a=r(775),n=r(2740),l=r(810),s=r(8900),o=(r(5053),r(6298)),i=r(7504);class u extends l.default.Component{constructor(e,t){super(e,t),(0,a.default)(this,"getDefinitionUrl",(()=>{let{specSelectors:e}=this.props;return new s.default(e.url(),i.Z.location).toString()}));let{getConfigs:r}=e,{validatorUrl:n}=r();this.state={url:this.getDefinitionUrl(),validatorUrl:void 0===n?"https://validator.swagger.io/validator":n}}UNSAFE_componentWillReceiveProps(e){let{getConfigs:t}=e,{validatorUrl:r}=t();this.setState({url:this.getDefinitionUrl(),validatorUrl:void 0===r?"https://validator.swagger.io/validator":r})}render(){let{getConfigs:e}=this.props,{spec:t}=e(),r=(0,o.Nm)(this.state.validatorUrl);return"object"==typeof t&&(0,n.default)(t).length?null:this.state.url&&(0,o.hW)(this.state.validatorUrl)&&(0,o.hW)(this.state.url)?l.default.createElement("span",{className:"float-right"},l.default.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:`${r}/debug?url=${encodeURIComponent(this.state.url)}`},l.default.createElement(c,{src:`${r}?url=${encodeURIComponent(this.state.url)}`,alt:"Online validator badge"}))):null}}class c extends l.default.Component{constructor(e){super(e),this.state={loaded:!1,error:!1}}componentDidMount(){const e=new Image;e.onload=()=>{this.setState({loaded:!0})},e.onerror=()=>{this.setState({error:!0})},e.src=this.props.src}UNSAFE_componentWillReceiveProps(e){if(e.src!==this.props.src){const t=new Image;t.onload=()=>{this.setState({loaded:!0})},t.onerror=()=>{this.setState({error:!0})},t.src=e.src}}render(){return this.state.error?l.default.createElement("img",{alt:"Error"}):this.state.loaded?l.default.createElement("img",{src:this.props.src,alt:this.props.alt}):null}}},5466:(e,a,n)=>{n.d(a,{Z:()=>d,s:()=>p});var l=n(810),s=(n(5053),n(3952));const o=(e=>{var t={};return n.d(t,e),t})({linkify:()=>t.linkify});const i=(e=>{var t={};return n.d(t,e),t})({default:()=>r.default});var u=n(8096);function c(e){let{source:t,className:r="",getConfigs:a}=e;if("string"!=typeof t)return null;const n=new s.Remarkable({html:!0,typographer:!0,breaks:!0,linkTarget:"_blank"}).use(o.linkify);n.core.ruler.disable(["replacements","smartquotes"]);const{useUnsafeMarkdown:i}=a(),c=n.render(t),d=p(c,{useUnsafeMarkdown:i});return t&&c&&d?l.default.createElement("div",{className:(0,u.default)(r,"markdown"),dangerouslySetInnerHTML:{__html:d}}):null}i.default.addHook&&i.default.addHook("beforeSanitizeElements",(function(e){return e.href&&e.setAttribute("rel","noopener noreferrer"),e})),c.defaultProps={getConfigs:()=>({useUnsafeMarkdown:!1})};const d=c;function p(e){let{useUnsafeMarkdown:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=t,a=t?[]:["style","class"];return t&&!p.hasWarnedAboutDeprecation&&(console.warn("useUnsafeMarkdown display configuration parameter is deprecated since >3.26.0 and will be removed in v4.0.0."),p.hasWarnedAboutDeprecation=!0),i.default.sanitize(e,{ADD_ATTR:["target"],FORBID_TAGS:["style","form"],ALLOW_DATA_ATTR:r,FORBID_ATTR:a})}p.hasWarnedAboutDeprecation=!1},5308:(e,t,r)=>{r.r(t),r.d(t,{default:()=>c});var a,n=r(29),l=r(5487),s=r(6298),o=r(8102);const i=r(5102),u={},c=u;(0,n.default)(a=(0,l.default)(i).call(i)).call(a,(function(e){if("./index.js"===e)return;let t=i(e);u[(0,s.Zl)(e)]=t.default?t.default:t})),u.SafeRender=o.default},5812:(e,t,r)=>{r.r(t),r.d(t,{SHOW_AUTH_POPUP:()=>i,AUTHORIZE:()=>u,LOGOUT:()=>c,PRE_AUTHORIZE_OAUTH2:()=>d,AUTHORIZE_OAUTH2:()=>p,VALIDATE:()=>f,CONFIGURE_AUTH:()=>h,RESTORE_AUTHORIZATION:()=>m,showDefinitions:()=>g,authorize:()=>y,authorizeWithPersistOption:()=>v,logout:()=>E,logoutWithPersistOption:()=>b,preAuthorizeImplicit:()=>S,authorizeOauth2:()=>_,authorizeOauth2WithPersistOption:()=>w,authorizePassword:()=>C,authorizeApplication:()=>x,authorizeAccessCodeWithFormParams:()=>A,authorizeAccessCodeWithBasicAuthentication:()=>I,authorizeRequest:()=>R,configureAuth:()=>T,restoreAuthorization:()=>N,persistAuthorizationIfNeeded:()=>O,authPopup:()=>k});var a=r(313),n=r(7512),l=r(8900),s=r(7504),o=r(6298);const i="show_popup",u="authorize",c="logout",d="pre_authorize_oauth2",p="authorize_oauth2",f="validate",h="configure_auth",m="restore_authorization";function g(e){return{type:i,payload:e}}function y(e){return{type:u,payload:e}}const v=e=>t=>{let{authActions:r}=t;r.authorize(e),r.persistAuthorizationIfNeeded()};function E(e){return{type:c,payload:e}}const b=e=>t=>{let{authActions:r}=t;r.logout(e),r.persistAuthorizationIfNeeded()},S=e=>t=>{let{authActions:r,errActions:n}=t,{auth:l,token:o,isValid:i}=e,{schema:u,name:c}=l,d=u.get("flow");delete s.Z.swaggerUIRedirectOauth2,"accessCode"===d||i||n.newAuthErr({authId:c,source:"auth",level:"warning",message:"Authorization may be unsafe, passed state was changed in server Passed state wasn't returned from auth server"}),o.error?n.newAuthErr({authId:c,source:"auth",level:"error",message:(0,a.default)(o)}):r.authorizeOauth2WithPersistOption({auth:l,token:o})};function _(e){return{type:p,payload:e}}const w=e=>t=>{let{authActions:r}=t;r.authorizeOauth2(e),r.persistAuthorizationIfNeeded()},C=e=>t=>{let{authActions:r}=t,{schema:a,name:l,username:s,password:i,passwordType:u,clientId:c,clientSecret:d}=e,p={grant_type:"password",scope:e.scopes.join(" "),username:s,password:i},f={};switch(u){case"request-body":!function(e,t,r){t&&(0,n.default)(e,{client_id:t});r&&(0,n.default)(e,{client_secret:r})}(p,c,d);break;case"basic":f.Authorization="Basic "+(0,o.r3)(c+":"+d);break;default:console.warn(`Warning: invalid passwordType ${u} was passed, not including client id and secret`)}return r.authorizeRequest({body:(0,o.GZ)(p),url:a.get("tokenUrl"),name:l,headers:f,query:{},auth:e})};const x=e=>t=>{let{authActions:r}=t,{schema:a,scopes:n,name:l,clientId:s,clientSecret:i}=e,u={Authorization:"Basic "+(0,o.r3)(s+":"+i)},c={grant_type:"client_credentials",scope:n.join(" ")};return r.authorizeRequest({body:(0,o.GZ)(c),name:l,url:a.get("tokenUrl"),auth:e,headers:u})},A=e=>{let{auth:t,redirectUrl:r}=e;return e=>{let{authActions:a}=e,{schema:n,name:l,clientId:s,clientSecret:i,codeVerifier:u}=t,c={grant_type:"authorization_code",code:t.code,client_id:s,client_secret:i,redirect_uri:r,code_verifier:u};return a.authorizeRequest({body:(0,o.GZ)(c),name:l,url:n.get("tokenUrl"),auth:t})}},I=e=>{let{auth:t,redirectUrl:r}=e;return e=>{let{authActions:a}=e,{schema:n,name:l,clientId:s,clientSecret:i,codeVerifier:u}=t,c={Authorization:"Basic "+(0,o.r3)(s+":"+i)},d={grant_type:"authorization_code",code:t.code,client_id:s,redirect_uri:r,code_verifier:u};return a.authorizeRequest({body:(0,o.GZ)(d),name:l,url:n.get("tokenUrl"),auth:t,headers:c})}},R=e=>t=>{let r,{fn:s,getConfigs:o,authActions:i,errActions:u,oas3Selectors:c,specSelectors:d,authSelectors:p}=t,{body:f,query:h={},headers:m={},name:g,url:y,auth:v}=e,{additionalQueryStringParams:E}=p.getConfigs()||{};if(d.isOAS3()){let e=c.serverEffectiveValue(c.selectedServer());r=(0,l.default)(y,e,!0)}else r=(0,l.default)(y,d.url(),!0);"object"==typeof E&&(r.query=(0,n.default)({},r.query,E));const b=r.toString();let S=(0,n.default)({Accept:"application/json, text/plain, */*","Content-Type":"application/x-www-form-urlencoded","X-Requested-With":"XMLHttpRequest"},m);s.fetch({url:b,method:"post",headers:S,query:h,body:f,requestInterceptor:o().requestInterceptor,responseInterceptor:o().responseInterceptor}).then((function(e){let t=JSON.parse(e.data),r=t&&(t.error||""),n=t&&(t.parseError||"");e.ok?r||n?u.newAuthErr({authId:g,level:"error",source:"auth",message:(0,a.default)(t)}):i.authorizeOauth2WithPersistOption({auth:v,token:t}):u.newAuthErr({authId:g,level:"error",source:"auth",message:e.statusText})})).catch((e=>{let t=new Error(e).message;if(e.response&&e.response.data){const r=e.response.data;try{const e="string"==typeof r?JSON.parse(r):r;e.error&&(t+=`, error: ${e.error}`),e.error_description&&(t+=`, description: ${e.error_description}`)}catch(e){}}u.newAuthErr({authId:g,level:"error",source:"auth",message:t})}))};function T(e){return{type:h,payload:e}}function N(e){return{type:m,payload:e}}const O=()=>e=>{let{authSelectors:t,getConfigs:r}=e;if(r().persistAuthorization){const e=t.authorized();localStorage.setItem("authorized",(0,a.default)(e.toJS()))}},k=(e,t)=>()=>{s.Z.swaggerUIRedirectOauth2=t,s.Z.open(e)}},3705:(e,t,r)=>{r.r(t),r.d(t,{default:()=>i,preauthorizeBasic:()=>u,preauthorizeApiKey:()=>c});var a=r(5527),n=r(3962),l=r(5812),s=r(35),o=r(8302);function i(){return{afterLoad(e){this.rootInjects=this.rootInjects||{},this.rootInjects.initOAuth=e.authActions.configureAuth,this.rootInjects.preauthorizeApiKey=(0,a.default)(c).call(c,null,e),this.rootInjects.preauthorizeBasic=(0,a.default)(u).call(u,null,e)},statePlugins:{auth:{reducers:n.default,actions:l,selectors:s},spec:{wrapActions:o}}}}function u(e,t,r,a){const{authActions:{authorize:n},specSelectors:{specJson:l,isOAS3:s}}=e,o=s()?["components","securitySchemes"]:["securityDefinitions"],i=l().getIn([...o,t]);return i?n({[t]:{value:{username:r,password:a},schema:i.toJS()}}):null}function c(e,t,r){const{authActions:{authorize:a},specSelectors:{specJson:n,isOAS3:l}}=e,s=l()?["components","securitySchemes"]:["securityDefinitions"],o=n().getIn([...s,t]);return o?a({[t]:{value:r,schema:o.toJS()}}):null}},3962:(e,t,r)=>{r.r(t),r.d(t,{default:()=>i});var a=r(29),n=r(7512),l=r(9725),s=r(6298),o=r(5812);const i={[o.SHOW_AUTH_POPUP]:(e,t)=>{let{payload:r}=t;return e.set("showDefinitions",r)},[o.AUTHORIZE]:(e,t)=>{var r;let{payload:n}=t,o=(0,l.fromJS)(n),i=e.get("authorized")||(0,l.Map)();return(0,a.default)(r=o.entrySeq()).call(r,(t=>{let[r,a]=t;if(!(0,s.Wl)(a.getIn))return e.set("authorized",i);let n=a.getIn(["schema","type"]);if("apiKey"===n||"http"===n)i=i.set(r,a);else if("basic"===n){let e=a.getIn(["value","username"]),t=a.getIn(["value","password"]);i=i.setIn([r,"value"],{username:e,header:"Basic "+(0,s.r3)(e+":"+t)}),i=i.setIn([r,"schema"],a.get("schema"))}})),e.set("authorized",i)},[o.AUTHORIZE_OAUTH2]:(e,t)=>{let r,{payload:a}=t,{auth:s,token:o}=a;s.token=(0,n.default)({},o),r=(0,l.fromJS)(s);let i=e.get("authorized")||(0,l.Map)();return i=i.set(r.get("name"),r),e.set("authorized",i)},[o.LOGOUT]:(e,t)=>{let{payload:r}=t,n=e.get("authorized").withMutations((e=>{(0,a.default)(r).call(r,(t=>{e.delete(t)}))}));return e.set("authorized",n)},[o.CONFIGURE_AUTH]:(e,t)=>{let{payload:r}=t;return e.set("configs",r)},[o.RESTORE_AUTHORIZATION]:(e,t)=>{let{payload:r}=t;return e.set("authorized",(0,l.fromJS)(r.authorized))}}},35:(e,t,r)=>{r.r(t),r.d(t,{shownDefinitions:()=>p,definitionsToAuthorize:()=>f,getDefinitionsByNames:()=>h,definitionsForRequirements:()=>m,authorized:()=>g,isAuthorized:()=>y,getConfigs:()=>v});var a=r(29),n=r(6145),l=r(9963),s=r(8818),o=r(2565),i=r(2740),u=r(8639),c=r(9725);const d=e=>e,p=(0,u.createSelector)(d,(e=>e.get("showDefinitions"))),f=(0,u.createSelector)(d,(()=>e=>{var t;let{specSelectors:r}=e,n=r.securityDefinitions()||(0,c.Map)({}),l=(0,c.List)();return(0,a.default)(t=n.entrySeq()).call(t,(e=>{let[t,r]=e,a=(0,c.Map)();a=a.set(t,r),l=l.push(a)})),l})),h=(e,t)=>e=>{var r;let{specSelectors:n}=e;console.warn("WARNING: getDefinitionsByNames is deprecated and will be removed in the next major version.");let l=n.securityDefinitions(),s=(0,c.List)();return(0,a.default)(r=t.valueSeq()).call(r,(e=>{var t;let r=(0,c.Map)();(0,a.default)(t=e.entrySeq()).call(t,(e=>{let t,[n,s]=e,o=l.get(n);var i;"oauth2"===o.get("type")&&s.size&&(t=o.get("scopes"),(0,a.default)(i=t.keySeq()).call(i,(e=>{s.contains(e)||(t=t.delete(e))})),o=o.set("allowedScopes",t));r=r.set(n,o)})),s=s.push(r)})),s},m=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,c.List)();return e=>{let{authSelectors:r}=e;const a=r.definitionsToAuthorize()||(0,c.List)();return(0,n.default)(a).call(a,(e=>(0,l.default)(t).call(t,(t=>t.get(e.keySeq().first())))))}},g=(0,u.createSelector)(d,(e=>e.get("authorized")||(0,c.Map)())),y=(e,t)=>e=>{var r;let{authSelectors:a}=e,l=a.authorized();return c.List.isList(t)?!!(0,n.default)(r=t.toJS()).call(r,(e=>{var t,r;return-1===(0,s.default)(t=(0,o.default)(r=(0,i.default)(e)).call(r,(e=>!!l.get(e)))).call(t,!1)})).length:null},v=(0,u.createSelector)(d,(e=>e.get("configs")))},8302:(e,t,r)=>{r.r(t),r.d(t,{execute:()=>a});const a=(e,t)=>{let{authSelectors:r,specSelectors:a}=t;return t=>{let{path:n,method:l,operation:s,extras:o}=t,i={authorized:r.authorized()&&r.authorized().toJS(),definitions:a.securityDefinitions()&&a.securityDefinitions().toJS(),specSecurity:a.security()&&a.security().toJS()};return e({path:n,method:l,operation:s,securities:i,...o})}}},714:(e,t,r)=>{r.r(t),r.d(t,{UPDATE_CONFIGS:()=>a,TOGGLE_CONFIGS:()=>n,update:()=>l,toggle:()=>s,loaded:()=>o});const a="configs_update",n="configs_toggle";function l(e,t){return{type:a,payload:{[e]:t}}}function s(e){return{type:n,payload:e}}const o=()=>e=>{let{getConfigs:t,authActions:r}=e;if(t().persistAuthorization){const e=localStorage.getItem("authorized");e&&r.restoreAuthorization({authorized:JSON.parse(e)})}}},2256:(e,t,r)=>{r.r(t),r.d(t,{parseYamlConfig:()=>n});var a=r(626);const n=(e,t)=>{try{return a.default.load(e)}catch(e){return t&&t.errActions.newThrownErr(new Error(e)),{}}}},1661:(e,t,r)=>{r.r(t),r.d(t,{default:()=>c});var a=r(5163),n=r(2256),l=r(714),s=r(2698),o=r(9018),i=r(7743);const u={getLocalConfig:()=>(0,n.parseYamlConfig)(a)};function c(){return{statePlugins:{spec:{actions:s,selectors:u},configs:{reducers:i.default,actions:l,selectors:o}}}}},7743:(e,t,r)=>{r.r(t),r.d(t,{default:()=>l});var a=r(9725),n=r(714);const l={[n.UPDATE_CONFIGS]:(e,t)=>e.merge((0,a.fromJS)(t.payload)),[n.TOGGLE_CONFIGS]:(e,t)=>{const r=t.payload,a=e.get(r);return e.set(r,!a)}}},9018:(e,t,r)=>{r.r(t),r.d(t,{get:()=>n});var a=r(4163);const n=(e,t)=>e.getIn((0,a.default)(t)?t:[t])},2698:(e,t,r)=>{r.r(t),r.d(t,{downloadConfig:()=>n,getConfigByUrl:()=>l});var a=r(2256);const n=e=>t=>{const{fn:{fetch:r}}=t;return r(e)},l=(e,t)=>r=>{let{specActions:n}=r;if(e)return n.downloadConfig(e).then(l,l);function l(r){r instanceof Error||r.status>=400?(n.updateLoadingStatus("failedConfig"),n.updateLoadingStatus("failedConfig"),n.updateUrl(""),console.error(r.statusText+" "+e.url),t(null)):t((0,a.parseYamlConfig)(r.text))}}},1970:(e,t,r)=>{r.r(t),r.d(t,{setHash:()=>a});const a=e=>e?history.pushState(null,null,`#${e}`):window.location.hash=""},4980:(e,t,r)=>{r.r(t),r.d(t,{default:()=>s});var a=r(5858),n=r(877),l=r(4584);function s(){return[a.default,{statePlugins:{configs:{wrapActions:{loaded:(e,t)=>function(){e(...arguments);const r=decodeURIComponent(window.location.hash);t.layoutActions.parseDeepLinkHash(r)}}}},wrapComponents:{operation:n.default,OperationTag:l.default}}]}},5858:(e,t,r)=>{r.r(t),r.d(t,{clearScrollTo:()=>E,default:()=>b,parseDeepLinkHash:()=>g,readyToScroll:()=>y,scrollTo:()=>m,scrollToElement:()=>v,show:()=>h});var n=r(4163),l=r(8136),s=r(2565),o=r(8818),i=r(1970);const u=(e=>{var t={};return r.d(t,e),t})({default:()=>a.default});var c=r(6298),d=r(9725);const p="layout_scroll_to",f="layout_clear_scroll",h=(e,t)=>{let{getConfigs:r,layoutSelectors:a}=t;return function(){for(var t=arguments.length,l=new Array(t),s=0;s<t;s++)l[s]=arguments[s];if(e(...l),r().deepLinking)try{let[e,t]=l;e=(0,n.default)(e)?e:[e];const r=a.urlHashArrayFromIsShownKey(e);if(!r.length)return;const[s,o]=r;if(!t)return(0,i.setHash)("/");2===r.length?(0,i.setHash)((0,c.oJ)(`/${encodeURIComponent(s)}/${encodeURIComponent(o)}`)):1===r.length&&(0,i.setHash)((0,c.oJ)(`/${encodeURIComponent(s)}`))}catch(e){console.error(e)}}},m=e=>({type:p,payload:(0,n.default)(e)?e:[e]}),g=e=>t=>{let{layoutActions:r,layoutSelectors:a,getConfigs:n}=t;if(n().deepLinking&&e){var i;let t=(0,l.default)(e).call(e,1);"!"===t[0]&&(t=(0,l.default)(t).call(t,1)),"/"===t[0]&&(t=(0,l.default)(t).call(t,1));const n=(0,s.default)(i=t.split("/")).call(i,(e=>e||"")),u=a.isShownKeyFromUrlHashArray(n),[c,d="",p=""]=u;if("operations"===c){const e=a.isShownKeyFromUrlHashArray([d]);(0,o.default)(d).call(d,"_")>-1&&(console.warn("Warning: escaping deep link whitespace with `_` will be unsupported in v4.0, use `%20` instead."),r.show((0,s.default)(e).call(e,(e=>e.replace(/_/g," "))),!0)),r.show(e,!0)}((0,o.default)(d).call(d,"_")>-1||(0,o.default)(p).call(p,"_")>-1)&&(console.warn("Warning: escaping deep link whitespace with `_` will be unsupported in v4.0, use `%20` instead."),r.show((0,s.default)(u).call(u,(e=>e.replace(/_/g," "))),!0)),r.show(u,!0),r.scrollTo(u)}},y=(e,t)=>r=>{const a=r.layoutSelectors.getScrollToKey();d.default.is(a,(0,d.fromJS)(e))&&(r.layoutActions.scrollToElement(t),r.layoutActions.clearScrollTo())},v=(e,t)=>r=>{try{t=t||r.fn.getScrollParent(e),u.default.createScroller(t).to(e)}catch(e){console.error(e)}},E=()=>({type:f});const b={fn:{getScrollParent:function(e,t){const r=document.documentElement;let a=getComputedStyle(e);const n="absolute"===a.position,l=t?/(auto|scroll|hidden)/:/(auto|scroll)/;if("fixed"===a.position)return r;for(let t=e;t=t.parentElement;)if(a=getComputedStyle(t),(!n||"static"!==a.position)&&l.test(a.overflow+a.overflowY+a.overflowX))return t;return r}},statePlugins:{layout:{actions:{scrollToElement:v,scrollTo:m,clearScrollTo:E,readyToScroll:y,parseDeepLinkHash:g},selectors:{getScrollToKey:e=>e.get("scrollToKey"),isShownKeyFromUrlHashArray(e,t){const[r,a]=t;return a?["operations",r,a]:r?["operations-tag",r]:[]},urlHashArrayFromIsShownKey(e,t){let[r,a,n]=t;return"operations"==r?[a,n]:"operations-tag"==r?[a]:[]}},reducers:{[p]:(e,t)=>e.set("scrollToKey",d.default.fromJS(t.payload)),[f]:e=>e.delete("scrollToKey")},wrapActions:{show:h}}}}},4584:(e,t,r)=>{r.r(t),r.d(t,{default:()=>l});var a=r(775),n=r(810);r(5053);const l=(e,t)=>class extends n.default.Component{constructor(){super(...arguments),(0,a.default)(this,"onLoad",(e=>{const{tag:r}=this.props,a=["operations-tag",r];t.layoutActions.readyToScroll(a,e)}))}render(){return n.default.createElement("span",{ref:this.onLoad},n.default.createElement(e,this.props))}}},877:(e,t,r)=>{r.r(t),r.d(t,{default:()=>l});var a=r(775),n=r(810);r(9569);const l=(e,t)=>class extends n.default.Component{constructor(){super(...arguments),(0,a.default)(this,"onLoad",(e=>{const{operation:r}=this.props,{tag:a,operationId:n}=r.toObject();let{isShownKey:l}=r.toObject();l=l||["operations",a,n],t.layoutActions.readyToScroll(l,e)}))}render(){return n.default.createElement("span",{ref:this.onLoad},n.default.createElement(e,this.props))}}},8011:(e,t,r)=>{r.r(t),r.d(t,{default:()=>c});var a=r(7512),n=r(3769),l=r(8818),s=r(313),o=r(8639),i=r(9725),u=r(7504);function c(e){let{fn:t}=e;return{statePlugins:{spec:{actions:{download:e=>r=>{let{errActions:l,specSelectors:s,specActions:o,getConfigs:i}=r,{fetch:c}=t;const d=i();function p(t){if(t instanceof Error||t.status>=400)return o.updateLoadingStatus("failed"),l.newThrownErr((0,a.default)(new Error((t.message||t.statusText)+" "+e),{source:"fetch"})),void(!t.status&&t instanceof Error&&function(){try{let t;if("URL"in u.Z?t=new n.default(e):(t=document.createElement("a"),t.href=e),"https:"!==t.protocol&&"https:"===u.Z.location.protocol){const e=(0,a.default)(new Error(`Possible mixed-content issue? The page was loaded over https:// but a ${t.protocol}// URL was specified. Check that you are not attempting to load mixed content.`),{source:"fetch"});return void l.newThrownErr(e)}if(t.origin!==u.Z.location.origin){const e=(0,a.default)(new Error(`Possible cross-origin (CORS) issue? The URL origin (${t.origin}) does not match the page (${u.Z.location.origin}). Check the server returns the correct 'Access-Control-Allow-*' headers.`),{source:"fetch"});l.newThrownErr(e)}}catch(e){return}}());o.updateLoadingStatus("success"),o.updateSpec(t.text),s.url()!==e&&o.updateUrl(e)}e=e||s.url(),o.updateLoadingStatus("loading"),l.clear({source:"fetch"}),c({url:e,loadSpec:!0,requestInterceptor:d.requestInterceptor||(e=>e),responseInterceptor:d.responseInterceptor||(e=>e),credentials:"same-origin",headers:{Accept:"application/json,*/*"}}).then(p,p)},updateLoadingStatus:e=>{let t=[null,"loading","failed","success","failedConfig"];return-1===(0,l.default)(t).call(t,e)&&console.error(`Error: ${e} is not one of ${(0,s.default)(t)}`),{type:"spec_update_loading_status",payload:e}}},reducers:{spec_update_loading_status:(e,t)=>"string"==typeof t.payload?e.set("loadingStatus",t.payload):e},selectors:{loadingStatus:(0,o.createSelector)((e=>e||(0,i.Map)()),(e=>e.get("loadingStatus")||null))}}}}}},4966:(e,t,r)=>{r.r(t),r.d(t,{NEW_THROWN_ERR:()=>n,NEW_THROWN_ERR_BATCH:()=>l,NEW_SPEC_ERR:()=>s,NEW_SPEC_ERR_BATCH:()=>o,NEW_AUTH_ERR:()=>i,CLEAR:()=>u,CLEAR_BY:()=>c,newThrownErr:()=>d,newThrownErrBatch:()=>p,newSpecErr:()=>f,newSpecErrBatch:()=>h,newAuthErr:()=>m,clear:()=>g,clearBy:()=>y});var a=r(8518);const n="err_new_thrown_err",l="err_new_thrown_err_batch",s="err_new_spec_err",o="err_new_spec_err_batch",i="err_new_auth_err",u="err_clear",c="err_clear_by";function d(e){return{type:n,payload:(0,a.serializeError)(e)}}function p(e){return{type:l,payload:e}}function f(e){return{type:s,payload:e}}function h(e){return{type:o,payload:e}}function m(e){return{type:i,payload:e}}function g(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{type:u,payload:e}}function y(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:()=>!0;return{type:c,payload:e}}},6808:(e,t,r)=>{r.r(t),r.d(t,{default:()=>i});var a=r(6145),l=r(2565);const s=(e=>{var t={};return r.d(t,e),t})({default:()=>n.default});const o=[r(2392),r(1835)];function i(e){var t;let r={jsSpec:{}},n=(0,s.default)(o,((e,t)=>{try{let n=t.transform(e,r);return(0,a.default)(n).call(n,(e=>!!e))}catch(t){return console.error("Transformer error:",t),e}}),e);return(0,l.default)(t=(0,a.default)(n).call(n,(e=>!!e))).call(t,(e=>(!e.get("line")&&e.get("path"),e)))}},2392:(e,t,r)=>{r.r(t),r.d(t,{transform:()=>o});var a=r(2565),n=r(8818),l=r(8136),s=r(6785);function o(e){return(0,a.default)(e).call(e,(e=>{var t;let r="is not of a type(s)",a=(0,n.default)(t=e.get("message")).call(t,r);if(a>-1){var o,i;let t=(0,l.default)(o=e.get("message")).call(o,a+r.length).split(",");return e.set("message",(0,l.default)(i=e.get("message")).call(i,0,a)+function(e){return(0,s.default)(e).call(e,((e,t,r,a)=>r===a.length-1&&a.length>1?e+"or "+t:a[r+1]&&a.length>2?e+t+", ":a[r+1]?e+t+" ":e+t),"should be a")}(t))}return e}))}},1835:(e,t,r)=>{r.r(t),r.d(t,{transform:()=>a});r(2565),r(8818),r(9908),r(9725);function a(e,t){let{jsSpec:r}=t;return e}},7793:(e,t,r)=>{r.r(t),r.d(t,{default:()=>s});var a=r(3527),n=r(4966),l=r(7667);function s(e){return{statePlugins:{err:{reducers:(0,a.default)(e),actions:n,selectors:l}}}}},3527:(e,t,r)=>{r.r(t),r.d(t,{default:()=>p});var a=r(7512),n=r(2565),l=r(5171),s=r(6145),o=r(7930),i=r(4966),u=r(9725),c=r(6808);let d={line:0,level:"error",message:"Unknown error"};function p(){return{[i.NEW_THROWN_ERR]:(e,t)=>{let{payload:r}=t,n=(0,a.default)(d,r,{type:"thrown"});return e.update("errors",(e=>(e||(0,u.List)()).push((0,u.fromJS)(n)))).update("errors",(e=>(0,c.default)(e)))},[i.NEW_THROWN_ERR_BATCH]:(e,t)=>{let{payload:r}=t;return r=(0,n.default)(r).call(r,(e=>(0,u.fromJS)((0,a.default)(d,e,{type:"thrown"})))),e.update("errors",(e=>{var t;return(0,l.default)(t=e||(0,u.List)()).call(t,(0,u.fromJS)(r))})).update("errors",(e=>(0,c.default)(e)))},[i.NEW_SPEC_ERR]:(e,t)=>{let{payload:r}=t,a=(0,u.fromJS)(r);return a=a.set("type","spec"),e.update("errors",(e=>(e||(0,u.List)()).push((0,u.fromJS)(a)).sortBy((e=>e.get("line"))))).update("errors",(e=>(0,c.default)(e)))},[i.NEW_SPEC_ERR_BATCH]:(e,t)=>{let{payload:r}=t;return r=(0,n.default)(r).call(r,(e=>(0,u.fromJS)((0,a.default)(d,e,{type:"spec"})))),e.update("errors",(e=>{var t;return(0,l.default)(t=e||(0,u.List)()).call(t,(0,u.fromJS)(r))})).update("errors",(e=>(0,c.default)(e)))},[i.NEW_AUTH_ERR]:(e,t)=>{let{payload:r}=t,n=(0,u.fromJS)((0,a.default)({},r));return n=n.set("type","auth"),e.update("errors",(e=>(e||(0,u.List)()).push((0,u.fromJS)(n)))).update("errors",(e=>(0,c.default)(e)))},[i.CLEAR]:(e,t)=>{var r;let{payload:a}=t;if(!a||!e.get("errors"))return e;let n=(0,s.default)(r=e.get("errors")).call(r,(e=>{var t;return(0,o.default)(t=e.keySeq()).call(t,(t=>{const r=e.get(t),n=a[t];return!n||r!==n}))}));return e.merge({errors:n})},[i.CLEAR_BY]:(e,t)=>{var r;let{payload:a}=t;if(!a||"function"!=typeof a)return e;let n=(0,s.default)(r=e.get("errors")).call(r,(e=>a(e)));return e.merge({errors:n})}}}},7667:(e,t,r)=>{r.r(t),r.d(t,{allErrors:()=>l,lastError:()=>s});var a=r(9725),n=r(8639);const l=(0,n.createSelector)((e=>e),(e=>e.get("errors",(0,a.List)()))),s=(0,n.createSelector)(l,(e=>e.last()))},9978:(e,t,r)=>{r.r(t),r.d(t,{default:()=>n});var a=r(4309);function n(){return{fn:{opsFilter:a.default}}}},4309:(e,t,r)=>{r.r(t),r.d(t,{default:()=>l});var a=r(6145),n=r(8818);function l(e,t){return(0,a.default)(e).call(e,((e,r)=>-1!==(0,n.default)(r).call(r,t)))}},5474:(e,t,r)=>{r.r(t),r.d(t,{UPDATE_LAYOUT:()=>n,UPDATE_FILTER:()=>l,UPDATE_MODE:()=>s,SHOW:()=>o,updateLayout:()=>i,updateFilter:()=>u,show:()=>c,changeMode:()=>d});var a=r(6298);const n="layout_update_layout",l="layout_update_filter",s="layout_update_mode",o="layout_show";function i(e){return{type:n,payload:e}}function u(e){return{type:l,payload:e}}function c(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e=(0,a.AF)(e),{type:o,payload:{thing:e,shown:t}}}function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e=(0,a.AF)(e),{type:s,payload:{thing:e,mode:t}}}},6821:(e,t,r)=>{r.r(t),r.d(t,{default:()=>o});var a=r(5672),n=r(5474),l=r(4400),s=r(8989);function o(){return{statePlugins:{layout:{reducers:a.default,actions:n,selectors:l},spec:{wrapSelectors:s}}}}},5672:(e,t,r)=>{r.r(t),r.d(t,{default:()=>s});var a=r(5171),n=r(9725),l=r(5474);const s={[l.UPDATE_LAYOUT]:(e,t)=>e.set("layout",t.payload),[l.UPDATE_FILTER]:(e,t)=>e.set("filter",t.payload),[l.SHOW]:(e,t)=>{const r=t.payload.shown,a=(0,n.fromJS)(t.payload.thing);return e.update("shown",(0,n.fromJS)({}),(e=>e.set(a,r)))},[l.UPDATE_MODE]:(e,t)=>{var r;let n=t.payload.thing,l=t.payload.mode;return e.setIn((0,a.default)(r=["modes"]).call(r,n),(l||"")+"")}}},4400:(e,t,r)=>{r.r(t),r.d(t,{current:()=>s,currentFilter:()=>o,isShown:()=>i,whatMode:()=>u,showSummary:()=>c});var a=r(8639),n=r(6298),l=r(9725);const s=e=>e.get("layout"),o=e=>e.get("filter"),i=(e,t,r)=>(t=(0,n.AF)(t),e.get("shown",(0,l.fromJS)({})).get((0,l.fromJS)(t),r)),u=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return t=(0,n.AF)(t),e.getIn(["modes",...t],r)},c=(0,a.createSelector)((e=>e),(e=>!i(e,"editor")))},8989:(e,t,r)=>{r.r(t),r.d(t,{taggedOperations:()=>n});var a=r(8136);const n=(e,t)=>function(r){for(var n=arguments.length,l=new Array(n>1?n-1:0),s=1;s<n;s++)l[s-1]=arguments[s];let o=e(r,...l);const{fn:i,layoutSelectors:u,getConfigs:c}=t.getSystem(),d=c(),{maxDisplayedTags:p}=d;let f=u.currentFilter();return f&&!0!==f&&"true"!==f&&"false"!==f&&(o=i.opsFilter(o,f)),p&&!isNaN(p)&&p>=0&&(o=(0,a.default)(o).call(o,0,p)),o}},9150:(e,t,r)=>{r.r(t),r.d(t,{default:()=>n});var a=r(5527);function n(e){let{configs:t}=e;const r={debug:0,info:1,log:2,warn:3,error:4},n=e=>r[e]||-1;let{logLevel:l}=t,s=n(l);function o(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),a=1;a<t;a++)r[a-1]=arguments[a];n(e)>=s&&console[e](...r)}return o.warn=(0,a.default)(o).call(o,null,"warn"),o.error=(0,a.default)(o).call(o,null,"error"),o.info=(0,a.default)(o).call(o,null,"info"),o.debug=(0,a.default)(o).call(o,null,"debug"),{rootInjects:{log:o}}}},7002:(e,t,r)=>{r.r(t),r.d(t,{UPDATE_SELECTED_SERVER:()=>a,UPDATE_REQUEST_BODY_VALUE:()=>n,UPDATE_REQUEST_BODY_VALUE_RETAIN_FLAG:()=>l,UPDATE_REQUEST_BODY_INCLUSION:()=>s,UPDATE_ACTIVE_EXAMPLES_MEMBER:()=>o,UPDATE_REQUEST_CONTENT_TYPE:()=>i,UPDATE_RESPONSE_CONTENT_TYPE:()=>u,UPDATE_SERVER_VARIABLE_VALUE:()=>c,SET_REQUEST_BODY_VALIDATE_ERROR:()=>d,CLEAR_REQUEST_BODY_VALIDATE_ERROR:()=>p,CLEAR_REQUEST_BODY_VALUE:()=>f,setSelectedServer:()=>h,setRequestBodyValue:()=>m,setRetainRequestBodyValueFlag:()=>g,setRequestBodyInclusion:()=>y,setActiveExamplesMember:()=>v,setRequestContentType:()=>E,setResponseContentType:()=>b,setServerVariableValue:()=>S,setRequestBodyValidateError:()=>_,clearRequestBodyValidateError:()=>w,initRequestBodyValidateError:()=>C,clearRequestBodyValue:()=>x});const a="oas3_set_servers",n="oas3_set_request_body_value",l="oas3_set_request_body_retain_flag",s="oas3_set_request_body_inclusion",o="oas3_set_active_examples_member",i="oas3_set_request_content_type",u="oas3_set_response_content_type",c="oas3_set_server_variable_value",d="oas3_set_request_body_validate_error",p="oas3_clear_request_body_validate_error",f="oas3_clear_request_body_value";function h(e,t){return{type:a,payload:{selectedServerUrl:e,namespace:t}}}function m(e){let{value:t,pathMethod:r}=e;return{type:n,payload:{value:t,pathMethod:r}}}const g=e=>{let{value:t,pathMethod:r}=e;return{type:l,payload:{value:t,pathMethod:r}}};function y(e){let{value:t,pathMethod:r,name:a}=e;return{type:s,payload:{value:t,pathMethod:r,name:a}}}function v(e){let{name:t,pathMethod:r,contextType:a,contextName:n}=e;return{type:o,payload:{name:t,pathMethod:r,contextType:a,contextName:n}}}function E(e){let{value:t,pathMethod:r}=e;return{type:i,payload:{value:t,pathMethod:r}}}function b(e){let{value:t,path:r,method:a}=e;return{type:u,payload:{value:t,path:r,method:a}}}function S(e){let{server:t,namespace:r,key:a,val:n}=e;return{type:c,payload:{server:t,namespace:r,key:a,val:n}}}const _=e=>{let{path:t,method:r,validationErrors:a}=e;return{type:d,payload:{path:t,method:r,validationErrors:a}}},w=e=>{let{path:t,method:r}=e;return{type:p,payload:{path:t,method:r}}},C=e=>{let{pathMethod:t}=e;return{type:p,payload:{path:t[0],method:t[1]}}},x=e=>{let{pathMethod:t}=e;return{type:f,payload:{pathMethod:t}}}},3723:(e,t,r)=>{r.r(t),r.d(t,{definitionsToAuthorize:()=>u});var a=r(29),n=r(6145),l=r(6785),s=r(8639),o=r(9725),i=r(7779);const u=(c=(0,s.createSelector)((e=>e),(e=>{let{specSelectors:t}=e;return t.securityDefinitions()}),((e,t)=>{var r;let s=(0,o.List)();return t?((0,a.default)(r=t.entrySeq()).call(r,(e=>{let[t,r]=e;const i=r.get("type");var u;if("oauth2"===i&&(0,a.default)(u=r.get("flows").entrySeq()).call(u,(e=>{let[a,l]=e,i=(0,o.fromJS)({flow:a,authorizationUrl:l.get("authorizationUrl"),tokenUrl:l.get("tokenUrl"),scopes:l.get("scopes"),type:r.get("type"),description:r.get("description")});s=s.push(new o.Map({[t]:(0,n.default)(i).call(i,(e=>void 0!==e))}))})),"http"!==i&&"apiKey"!==i||(s=s.push(new o.Map({[t]:r}))),"openIdConnect"===i&&r.get("openIdConnectData")){let e=r.get("openIdConnectData"),i=e.get("grant_types_supported")||["authorization_code","implicit"];(0,a.default)(i).call(i,(a=>{var i;let u=e.get("scopes_supported")&&(0,l.default)(i=e.get("scopes_supported")).call(i,((e,t)=>e.set(t,"")),new o.Map),c=(0,o.fromJS)({flow:a,authorizationUrl:e.get("authorization_endpoint"),tokenUrl:e.get("token_endpoint"),scopes:u,type:"oauth2",openIdConnectUrl:r.get("openIdConnectUrl")});s=s.push(new o.Map({[t]:(0,n.default)(c).call(c,(e=>void 0!==e))}))}))}})),s):s})),(e,t)=>function(){const r=t.getSystem().specSelectors.specJson();for(var a=arguments.length,n=new Array(a),l=0;l<a;l++)n[l]=arguments[l];if((0,i.isOAS3)(r)){let e=t.getState().getIn(["spec","resolvedSubtrees","components","securitySchemes"]);return c(t,e,...n)}return e(...n)});var c},3427:(e,t,r)=>{r.r(t),r.d(t,{default:()=>o});var a=r(863),n=r(2565),l=r(810),s=(r(5053),r(9569),r(9725));const o=e=>{var t;let{callbacks:r,getComponent:o,specPath:i}=e;const u=o("OperationContainer",!0);if(!r)return l.default.createElement("span",null,"No callbacks");let c=(0,n.default)(t=r.entrySeq()).call(t,(t=>{var r;let[o,c]=t;return l.default.createElement("div",{key:o},l.default.createElement("h2",null,o),(0,n.default)(r=c.entrySeq()).call(r,(t=>{var r;let[c,d]=t;return"$$ref"===c?null:l.default.createElement("div",{key:c},(0,n.default)(r=d.entrySeq()).call(r,(t=>{let[r,n]=t;if("$$ref"===r)return null;let d=(0,s.fromJS)({operation:n});return l.default.createElement(u,(0,a.default)({},e,{op:d,key:r,tag:"",method:r,path:c,specPath:i.push(o,c,r),allowTryItOut:!1}))})))})))}));return l.default.createElement("div",null,c)}},6775:(e,t,r)=>{r.r(t),r.d(t,{default:()=>i});var a=r(775),n=r(7512),l=r(6145),s=r(2565),o=r(810);r(5053);class i extends o.default.Component{constructor(e,t){super(e,t),(0,a.default)(this,"onChange",(e=>{let{onChange:t}=this.props,{value:r,name:a}=e.target,l=(0,n.default)({},this.state.value);a?l[a]=r:l=r,this.setState({value:l},(()=>t(this.state)))}));let{name:r,schema:l}=this.props,s=this.getValue();this.state={name:r,schema:l,value:s}}getValue(){let{name:e,authorized:t}=this.props;return t&&t.getIn([e,"value"])}render(){var e;let{schema:t,getComponent:r,errSelectors:a,name:n}=this.props;const i=r("Input"),u=r("Row"),c=r("Col"),d=r("authError"),p=r("Markdown",!0),f=r("JumpToPath",!0),h=(t.get("scheme")||"").toLowerCase();let m=this.getValue(),g=(0,l.default)(e=a.allErrors()).call(e,(e=>e.get("authId")===n));if("basic"===h){var y;let e=m?m.get("username"):null;return o.default.createElement("div",null,o.default.createElement("h4",null,o.default.createElement("code",null,n||t.get("name")),"  (http, Basic)",o.default.createElement(f,{path:["securityDefinitions",n]})),e&&o.default.createElement("h6",null,"Authorized"),o.default.createElement(u,null,o.default.createElement(p,{source:t.get("description")})),o.default.createElement(u,null,o.default.createElement("label",null,"Username:"),e?o.default.createElement("code",null," ",e," "):o.default.createElement(c,null,o.default.createElement(i,{type:"text",required:"required",name:"username","aria-label":"auth-basic-username",onChange:this.onChange,autoFocus:!0}))),o.default.createElement(u,null,o.default.createElement("label",null,"Password:"),e?o.default.createElement("code",null," ****** "):o.default.createElement(c,null,o.default.createElement(i,{autoComplete:"new-password",name:"password",type:"password","aria-label":"auth-basic-password",onChange:this.onChange}))),(0,s.default)(y=g.valueSeq()).call(y,((e,t)=>o.default.createElement(d,{error:e,key:t}))))}var v;return"bearer"===h?o.default.createElement("div",null,o.default.createElement("h4",null,o.default.createElement("code",null,n||t.get("name")),"  (http, Bearer)",o.default.createElement(f,{path:["securityDefinitions",n]})),m&&o.default.createElement("h6",null,"Authorized"),o.default.createElement(u,null,o.default.createElement(p,{source:t.get("description")})),o.default.createElement(u,null,o.default.createElement("label",null,"Value:"),m?o.default.createElement("code",null," ****** "):o.default.createElement(c,null,o.default.createElement(i,{type:"text","aria-label":"auth-bearer-value",onChange:this.onChange,autoFocus:!0}))),(0,s.default)(v=g.valueSeq()).call(v,((e,t)=>o.default.createElement(d,{error:e,key:t})))):o.default.createElement("div",null,o.default.createElement("em",null,o.default.createElement("b",null,n)," HTTP authentication: unsupported scheme ",`'${h}'`))}}},6467:(e,t,r)=>{r.r(t),r.d(t,{default:()=>d});var a=r(3427),n=r(2458),l=r(5757),s=r(6617),o=r(9928),i=r(5327),u=r(6775),c=r(6796);const d={Callbacks:a.default,HttpAuth:u.default,RequestBody:n.default,Servers:s.default,ServersContainer:o.default,RequestBodyEditor:i.default,OperationServers:c.default,operationLink:l.default}},5757:(e,t,r)=>{r.r(t),r.d(t,{default:()=>o});var a=r(313),n=r(2565),l=r(810);r(5053),r(9569);class s extends l.Component{render(){const{link:e,name:t,getComponent:r}=this.props,s=r("Markdown",!0);let o=e.get("operationId")||e.get("operationRef"),i=e.get("parameters")&&e.get("parameters").toJS(),u=e.get("description");return l.default.createElement("div",{className:"operation-link"},l.default.createElement("div",{className:"description"},l.default.createElement("b",null,l.default.createElement("code",null,t)),u?l.default.createElement(s,{source:u}):null),l.default.createElement("pre",null,"Operation `",o,"`",l.default.createElement("br",null),l.default.createElement("br",null),"Parameters ",function(e,t){var r;if("string"!=typeof t)return"";return(0,n.default)(r=t.split("\n")).call(r,((t,r)=>r>0?Array(e+1).join(" ")+t:t)).join("\n")}(0,(0,a.default)(i,null,2))||"{}",l.default.createElement("br",null)))}}const o=s},6796:(e,t,r)=>{r.r(t),r.d(t,{default:()=>l});var a=r(775),n=r(810);r(5053),r(9569);class l extends n.default.Component{constructor(){super(...arguments),(0,a.default)(this,"setSelectedServer",(e=>{const{path:t,method:r}=this.props;return this.forceUpdate(),this.props.setSelectedServer(e,`${t}:${r}`)})),(0,a.default)(this,"setServerVariableValue",(e=>{const{path:t,method:r}=this.props;return this.forceUpdate(),this.props.setServerVariableValue({...e,namespace:`${t}:${r}`})})),(0,a.default)(this,"getSelectedServer",(()=>{const{path:e,method:t}=this.props;return this.props.getSelectedServer(`${e}:${t}`)})),(0,a.default)(this,"getServerVariable",((e,t)=>{const{path:r,method:a}=this.props;return this.props.getServerVariable({namespace:`${r}:${a}`,server:e},t)})),(0,a.default)(this,"getEffectiveServerValue",(e=>{const{path:t,method:r}=this.props;return this.props.getEffectiveServerValue({server:e,namespace:`${t}:${r}`})}))}render(){const{operationServers:e,pathServers:t,getComponent:r}=this.props;if(!e&&!t)return null;const a=r("Servers"),l=e||t,s=e?"operation":"path";return n.default.createElement("div",{className:"opblock-section operation-servers"},n.default.createElement("div",{className:"opblock-section-header"},n.default.createElement("div",{className:"tab-header"},n.default.createElement("h4",{className:"opblock-title"},"Servers"))),n.default.createElement("div",{className:"opblock-description-wrapper"},n.default.createElement("h4",{className:"message"},"These ",s,"-level options override the global server options."),n.default.createElement(a,{servers:l,currentServer:this.getSelectedServer(),setSelectedServer:this.setSelectedServer,setServerVariableValue:this.setServerVariableValue,getServerVariable:this.getServerVariable,getEffectiveServerValue:this.getEffectiveServerValue})))}}},5327:(e,t,r)=>{r.r(t),r.d(t,{default:()=>i});var a=r(775),n=r(810),l=(r(5053),r(8096)),s=r(6298);const o=Function.prototype;class i extends n.PureComponent{constructor(e,t){super(e,t),(0,a.default)(this,"applyDefaultValue",(e=>{const{onChange:t,defaultValue:r}=e||this.props;return this.setState({value:r}),t(r)})),(0,a.default)(this,"onChange",(e=>{this.props.onChange((0,s.Pz)(e))})),(0,a.default)(this,"onDomChange",(e=>{const t=e.target.value;this.setState({value:t},(()=>this.onChange(t)))})),this.state={value:(0,s.Pz)(e.value)||e.defaultValue},e.onChange(e.value)}UNSAFE_componentWillReceiveProps(e){this.props.value!==e.value&&e.value!==this.state.value&&this.setState({value:(0,s.Pz)(e.value)}),!e.value&&e.defaultValue&&this.state.value&&this.applyDefaultValue(e)}render(){let{getComponent:e,errors:t}=this.props,{value:r}=this.state,a=t.size>0;const s=e("TextArea");return n.default.createElement("div",{className:"body-param"},n.default.createElement(s,{className:(0,l.default)("body-param__text",{invalid:a}),title:t.size?t.join(", "):"",value:r,onChange:this.onDomChange}))}}(0,a.default)(i,"defaultProps",{onChange:o,userHasEditedBody:!1})},2458:(e,t,r)=>{r.r(t),r.d(t,{getDefaultRequestBodyValue:()=>d,default:()=>p});var a=r(2565),n=r(8818),l=r(2372),s=r(4163),o=r(810),i=(r(5053),r(9569),r(9725)),u=r(6298),c=r(2518);const d=(e,t,r)=>{const a=e.getIn(["content",t]),n=a.get("schema").toJS(),l=void 0!==a.get("examples"),s=a.get("example"),o=l?a.getIn(["examples",r,"value"]):s,i=(0,u.xi)(n,t,{includeWriteOnly:!0},o);return(0,u.Pz)(i)},p=e=>{let{userHasEditedBody:t,requestBody:r,requestBodyValue:p,requestBodyInclusionSetting:f,requestBodyErrors:h,getComponent:m,getConfigs:g,specSelectors:y,fn:v,contentType:E,isExecute:b,specPath:S,onChange:_,onChangeIncludeEmpty:w,activeExamplesKey:C,updateActiveExamplesKey:x,setRetainRequestBodyValueFlag:A}=e;const I=e=>{_(e.target.files[0])},R=e=>{let t={key:e,shouldDispatchInit:!1,defaultValue:!0};return"no value"===f.get(e,"no value")&&(t.shouldDispatchInit=!0),t},T=m("Markdown",!0),N=m("modelExample"),O=m("RequestBodyEditor"),k=m("highlightCode"),P=m("ExamplesSelectValueRetainer"),M=m("Example"),j=m("ParameterIncludeEmpty"),{showCommonExtensions:L}=g(),B=r&&r.get("description")||null,q=r&&r.get("content")||new i.OrderedMap;E=E||q.keySeq().first()||"";const D=q.get(E,(0,i.OrderedMap)()),U=D.get("schema",(0,i.OrderedMap)()),V=D.get("examples",null),z=null==V?void 0:(0,a.default)(V).call(V,((e,t)=>{var a;const n=null===(a=e)||void 0===a?void 0:a.get("value",null);return n&&(e=e.set("value",d(r,E,t),n)),e}));if(h=i.List.isList(h)?h:(0,i.List)(),!D.size)return null;const F="object"===D.getIn(["schema","type"]),$="binary"===D.getIn(["schema","format"]),J="base64"===D.getIn(["schema","format"]);if("application/octet-stream"===E||0===(0,n.default)(E).call(E,"image/")||0===(0,n.default)(E).call(E,"audio/")||0===(0,n.default)(E).call(E,"video/")||$||J){const e=m("Input");return b?o.default.createElement(e,{type:"file",onChange:I}):o.default.createElement("i",null,"Example values are not available for ",o.default.createElement("code",null,E)," media types.")}if(F&&("application/x-www-form-urlencoded"===E||0===(0,n.default)(E).call(E,"multipart/"))&&U.get("properties",(0,i.OrderedMap)()).size>0){var W;const e=m("JsonSchemaForm"),t=m("ParameterExt"),r=U.get("properties",(0,i.OrderedMap)());return p=i.Map.isMap(p)?p:(0,i.OrderedMap)(),o.default.createElement("div",{className:"table-container"},B&&o.default.createElement(T,{source:B}),o.default.createElement("table",null,o.default.createElement("tbody",null,i.Map.isMap(r)&&(0,a.default)(W=r.entrySeq()).call(W,(r=>{var n,c;let[d,g]=r;if(g.get("readOnly"))return;let y=L?(0,u.po)(g):null;const E=(0,l.default)(n=U.get("required",(0,i.List)())).call(n,d),S=g.get("type"),C=g.get("format"),x=g.get("description"),A=p.getIn([d,"value"]),I=p.getIn([d,"errors"])||h,N=f.get(d)||!1,O=g.has("default")||g.has("example")||g.hasIn(["items","example"])||g.hasIn(["items","default"]),k=g.has("enum")&&(1===g.get("enum").size||E),P=O||k;let M="";"array"!==S||P||(M=[]),("object"===S||P)&&(M=(0,u.xi)(g,!1,{includeWriteOnly:!0})),"string"!=typeof M&&"object"===S&&(M=(0,u.Pz)(M)),"string"==typeof M&&"array"===S&&(M=JSON.parse(M));const B="string"===S&&("binary"===C||"base64"===C);return o.default.createElement("tr",{key:d,className:"parameters","data-property-name":d},o.default.createElement("td",{className:"parameters-col_name"},o.default.createElement("div",{className:E?"parameter__name required":"parameter__name"},d,E?o.default.createElement("span",null," *"):null),o.default.createElement("div",{className:"parameter__type"},S,C&&o.default.createElement("span",{className:"prop-format"},"($",C,")"),L&&y.size?(0,a.default)(c=y.entrySeq()).call(c,(e=>{let[r,a]=e;return o.default.createElement(t,{key:`${r}-${a}`,xKey:r,xVal:a})})):null),o.default.createElement("div",{className:"parameter__deprecated"},g.get("deprecated")?"deprecated":null)),o.default.createElement("td",{className:"parameters-col_description"},o.default.createElement(T,{source:x}),b?o.default.createElement("div",null,o.default.createElement(e,{fn:v,dispatchInitialValue:!B,schema:g,description:d,getComponent:m,value:void 0===A?M:A,required:E,errors:I,onChange:e=>{_(e,[d])}}),E?null:o.default.createElement(j,{onChange:e=>w(d,e),isIncluded:N,isIncludedOptions:R(d),isDisabled:(0,s.default)(A)?0!==A.length:!(0,u.O2)(A)})):null))})))))}const H=d(r,E,C);let K=null;return(0,c.O)(H)&&(K="json"),o.default.createElement("div",null,B&&o.default.createElement(T,{source:B}),z?o.default.createElement(P,{userHasEditedBody:t,examples:z,currentKey:C,currentUserInputValue:p,onSelect:e=>{x(e)},updateValue:_,defaultToFirstExample:!0,getComponent:m,setRetainRequestBodyValueFlag:A}):null,b?o.default.createElement("div",null,o.default.createElement(O,{value:p,errors:h,defaultValue:H,onChange:_,getComponent:m})):o.default.createElement(N,{getComponent:m,getConfigs:g,specSelectors:y,expandDepth:1,isExecute:b,schema:D.get("schema"),specPath:S.push("content",E),example:o.default.createElement(k,{className:"body-param__example",getConfigs:g,language:K,value:(0,u.Pz)(p)||H}),includeWriteOnly:!0}),z?o.default.createElement(M,{example:z.get(C),getComponent:m,getConfigs:g}):null)}},9928:(e,t,r)=>{r.r(t),r.d(t,{default:()=>n});var a=r(810);r(5053);class n extends a.default.Component{render(){const{specSelectors:e,oas3Selectors:t,oas3Actions:r,getComponent:n}=this.props,l=e.servers(),s=n("Servers");return l&&l.size?a.default.createElement("div",null,a.default.createElement("span",{className:"servers-title"},"Servers"),a.default.createElement(s,{servers:l,currentServer:t.selectedServer(),setSelectedServer:r.setSelectedServer,setServerVariableValue:r.setServerVariableValue,getServerVariable:t.serverVariableValue,getEffectiveServerValue:t.serverEffectiveValue})):null}}},6617:(e,t,r)=>{r.r(t),r.d(t,{default:()=>i});var a=r(775),n=r(1778),l=r(2565),s=r(810),o=r(9725);r(5053),r(9569);class i extends s.default.Component{constructor(){super(...arguments),(0,a.default)(this,"onServerChange",(e=>{this.setServer(e.target.value)})),(0,a.default)(this,"onServerVariableValueChange",(e=>{let{setServerVariableValue:t,currentServer:r}=this.props,a=e.target.getAttribute("data-variable"),n=e.target.value;"function"==typeof t&&t({server:r,key:a,val:n})})),(0,a.default)(this,"setServer",(e=>{let{setSelectedServer:t}=this.props;t(e)}))}componentDidMount(){var e;let{servers:t,currentServer:r}=this.props;r||this.setServer(null===(e=t.first())||void 0===e?void 0:e.get("url"))}UNSAFE_componentWillReceiveProps(e){let{servers:t,setServerVariableValue:r,getServerVariable:a}=e;if(this.props.currentServer!==e.currentServer||this.props.servers!==e.servers){var s;let i=(0,n.default)(t).call(t,(t=>t.get("url")===e.currentServer)),u=(0,n.default)(s=this.props.servers).call(s,(e=>e.get("url")===this.props.currentServer))||(0,o.OrderedMap)();if(!i)return this.setServer(t.first().get("url"));let c=u.get("variables")||(0,o.OrderedMap)(),d=((0,n.default)(c).call(c,(e=>e.get("default")))||(0,o.OrderedMap)()).get("default"),p=i.get("variables")||(0,o.OrderedMap)(),f=((0,n.default)(p).call(p,(e=>e.get("default")))||(0,o.OrderedMap)()).get("default");(0,l.default)(p).call(p,((t,n)=>{a(e.currentServer,n)&&d===f||r({server:e.currentServer,key:n,val:t.get("default")||""})}))}}render(){var e,t;let{servers:r,currentServer:a,getServerVariable:i,getEffectiveServerValue:u}=this.props,c=((0,n.default)(r).call(r,(e=>e.get("url")===a))||(0,o.OrderedMap)()).get("variables")||(0,o.OrderedMap)(),d=0!==c.size;return s.default.createElement("div",{className:"servers"},s.default.createElement("label",{htmlFor:"servers"},s.default.createElement("select",{onChange:this.onServerChange,value:a},(0,l.default)(e=r.valueSeq()).call(e,(e=>s.default.createElement("option",{value:e.get("url"),key:e.get("url")},e.get("url"),e.get("description")&&` - ${e.get("description")}`))).toArray())),d?s.default.createElement("div",null,s.default.createElement("div",{className:"computed-url"},"Computed URL:",s.default.createElement("code",null,u(a))),s.default.createElement("h4",null,"Server variables"),s.default.createElement("table",null,s.default.createElement("tbody",null,(0,l.default)(t=c.entrySeq()).call(t,(e=>{var t;let[r,n]=e;return s.default.createElement("tr",{key:r},s.default.createElement("td",null,r),s.default.createElement("td",null,n.get("enum")?s.default.createElement("select",{"data-variable":r,onChange:this.onServerVariableValueChange},(0,l.default)(t=n.get("enum")).call(t,(e=>s.default.createElement("option",{selected:e===i(a,r),key:e,value:e},e)))):s.default.createElement("input",{type:"text",value:i(a,r)||"",onChange:this.onServerVariableValueChange,"data-variable":r})))}))))):null)}}},7779:(e,t,r)=>{r.r(t),r.d(t,{isOAS3:()=>s,isSwagger2:()=>o,OAS3ComponentWrapFactory:()=>i});var a=r(863),n=r(3590),l=r(810);function s(e){const t=e.get("openapi");return"string"==typeof t&&((0,n.default)(t).call(t,"3.0.")&&t.length>4)}function o(e){const t=e.get("swagger");return"string"==typeof t&&(0,n.default)(t).call(t,"2.0")}function i(e){return(t,r)=>n=>{if(r&&r.specSelectors&&r.specSelectors.specJson){return s(r.specSelectors.specJson())?l.default.createElement(e,(0,a.default)({},n,r,{Ori:t})):l.default.createElement(t,n)}return console.warn("OAS3 wrapper: couldn't get spec"),null}}},7451:(e,t,r)=>{r.r(t),r.d(t,{default:()=>d});var a=r(2044),n=r(3723),l=r(1741),s=r(6467),o=r(7761),i=r(7002),u=r(5065),c=r(2109);function d(){return{components:s.default,wrapComponents:o.default,statePlugins:{spec:{wrapSelectors:a,selectors:l},auth:{wrapSelectors:n},oas3:{actions:i,reducers:c.default,selectors:u}}}}},2109:(e,t,r)=>{r.r(t),r.d(t,{default:()=>i});var a=r(5487),n=r(29),l=r(6785),s=r(9725),o=r(7002);const i={[o.UPDATE_SELECTED_SERVER]:(e,t)=>{let{payload:{selectedServerUrl:r,namespace:a}}=t;const n=a?[a,"selectedServer"]:["selectedServer"];return e.setIn(n,r)},[o.UPDATE_REQUEST_BODY_VALUE]:(e,t)=>{let{payload:{value:r,pathMethod:l}}=t,[o,i]=l;if(!s.Map.isMap(r))return e.setIn(["requestData",o,i,"bodyValue"],r);let u,c=e.getIn(["requestData",o,i,"bodyValue"])||(0,s.Map)();s.Map.isMap(c)||(c=(0,s.Map)());const[...d]=(0,a.default)(r).call(r);return(0,n.default)(d).call(d,(e=>{let t=r.getIn([e]);c.has(e)&&s.Map.isMap(t)||(u=c.setIn([e,"value"],t))})),e.setIn(["requestData",o,i,"bodyValue"],u)},[o.UPDATE_REQUEST_BODY_VALUE_RETAIN_FLAG]:(e,t)=>{let{payload:{value:r,pathMethod:a}}=t,[n,l]=a;return e.setIn(["requestData",n,l,"retainBodyValue"],r)},[o.UPDATE_REQUEST_BODY_INCLUSION]:(e,t)=>{let{payload:{value:r,pathMethod:a,name:n}}=t,[l,s]=a;return e.setIn(["requestData",l,s,"bodyInclusion",n],r)},[o.UPDATE_ACTIVE_EXAMPLES_MEMBER]:(e,t)=>{let{payload:{name:r,pathMethod:a,contextType:n,contextName:l}}=t,[s,o]=a;return e.setIn(["examples",s,o,n,l,"activeExample"],r)},[o.UPDATE_REQUEST_CONTENT_TYPE]:(e,t)=>{let{payload:{value:r,pathMethod:a}}=t,[n,l]=a;return e.setIn(["requestData",n,l,"requestContentType"],r)},[o.UPDATE_RESPONSE_CONTENT_TYPE]:(e,t)=>{let{payload:{value:r,path:a,method:n}}=t;return e.setIn(["requestData",a,n,"responseContentType"],r)},[o.UPDATE_SERVER_VARIABLE_VALUE]:(e,t)=>{let{payload:{server:r,namespace:a,key:n,val:l}}=t;const s=a?[a,"serverVariableValues",r,n]:["serverVariableValues",r,n];return e.setIn(s,l)},[o.SET_REQUEST_BODY_VALIDATE_ERROR]:(e,t)=>{let{payload:{path:r,method:a,validationErrors:n}}=t,o=[];if(o.push("Required field is not provided"),n.missingBodyValue)return e.setIn(["requestData",r,a,"errors"],(0,s.fromJS)(o));if(n.missingRequiredKeys&&n.missingRequiredKeys.length>0){const{missingRequiredKeys:t}=n;return e.updateIn(["requestData",r,a,"bodyValue"],(0,s.fromJS)({}),(e=>(0,l.default)(t).call(t,((e,t)=>e.setIn([t,"errors"],(0,s.fromJS)(o))),e)))}return console.warn("unexpected result: SET_REQUEST_BODY_VALIDATE_ERROR"),e},[o.CLEAR_REQUEST_BODY_VALIDATE_ERROR]:(e,t)=>{let{payload:{path:r,method:n}}=t;const o=e.getIn(["requestData",r,n,"bodyValue"]);if(!s.Map.isMap(o))return e.setIn(["requestData",r,n,"errors"],(0,s.fromJS)([]));const[...i]=(0,a.default)(o).call(o);return i?e.updateIn(["requestData",r,n,"bodyValue"],(0,s.fromJS)({}),(e=>(0,l.default)(i).call(i,((e,t)=>e.setIn([t,"errors"],(0,s.fromJS)([]))),e))):e},[o.CLEAR_REQUEST_BODY_VALUE]:(e,t)=>{let{payload:{pathMethod:r}}=t,[a,n]=r;const l=e.getIn(["requestData",a,n,"bodyValue"]);return l?s.Map.isMap(l)?e.setIn(["requestData",a,n,"bodyValue"],(0,s.Map)()):e.setIn(["requestData",a,n,"bodyValue"],""):e}}},5065:(e,t,r)=>{r.r(t),r.d(t,{selectedServer:()=>p,requestBodyValue:()=>f,shouldRetainRequestBodyValue:()=>h,hasUserEditedBody:()=>m,requestBodyInclusionSetting:()=>g,requestBodyErrors:()=>y,activeExamplesMember:()=>v,requestContentType:()=>E,responseContentType:()=>b,serverVariableValue:()=>S,serverVariables:()=>_,serverEffectiveValue:()=>w,validateBeforeExecute:()=>C,validateShallowRequired:()=>A});var a=r(2565),n=r(29),l=r(2740),s=r(8818),o=r(9725),i=r(7779),u=r(2458),c=r(6298);function d(e){return function(){for(var t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];return t=>{const a=t.getSystem().specSelectors.specJson();return(0,i.isOAS3)(a)?e(...r):null}}}const p=d(((e,t)=>{const r=t?[t,"selectedServer"]:["selectedServer"];return e.getIn(r)||""})),f=d(((e,t,r)=>e.getIn(["requestData",t,r,"bodyValue"])||null)),h=d(((e,t,r)=>e.getIn(["requestData",t,r,"retainBodyValue"])||!1)),m=(e,t,r)=>e=>{const{oas3Selectors:a,specSelectors:n}=e.getSystem(),l=n.specJson();if((0,i.isOAS3)(l)){let e=!1;const l=a.requestContentType(t,r);let s=a.requestBodyValue(t,r);if(o.Map.isMap(s)&&(s=(0,c.Pz)(s.mapEntries((e=>o.Map.isMap(e[1])?[e[0],e[1].get("value")]:e)).toJS())),o.List.isList(s)&&(s=(0,c.Pz)(s)),l){const o=(0,u.getDefaultRequestBodyValue)(n.specResolvedSubtree(["paths",t,r,"requestBody"]),l,a.activeExamplesMember(t,r,"requestBody","requestBody"));e=!!s&&s!==o}return e}return null},g=d(((e,t,r)=>e.getIn(["requestData",t,r,"bodyInclusion"])||(0,o.Map)())),y=d(((e,t,r)=>e.getIn(["requestData",t,r,"errors"])||null)),v=d(((e,t,r,a,n)=>e.getIn(["examples",t,r,a,n,"activeExample"])||null)),E=d(((e,t,r)=>e.getIn(["requestData",t,r,"requestContentType"])||null)),b=d(((e,t,r)=>e.getIn(["requestData",t,r,"responseContentType"])||null)),S=d(((e,t,r)=>{let a;if("string"!=typeof t){const{server:e,namespace:n}=t;a=n?[n,"serverVariableValues",e,r]:["serverVariableValues",e,r]}else{a=["serverVariableValues",t,r]}return e.getIn(a)||null})),_=d(((e,t)=>{let r;if("string"!=typeof t){const{server:e,namespace:a}=t;r=a?[a,"serverVariableValues",e]:["serverVariableValues",e]}else{r=["serverVariableValues",t]}return e.getIn(r)||(0,o.OrderedMap)()})),w=d(((e,t)=>{var r,n;if("string"!=typeof t){const{server:a,namespace:l}=t;n=a,r=l?e.getIn([l,"serverVariableValues",n]):e.getIn(["serverVariableValues",n])}else n=t,r=e.getIn(["serverVariableValues",n]);r=r||(0,o.OrderedMap)();let l=n;return(0,a.default)(r).call(r,((e,t)=>{l=l.replace(new RegExp(`{${t}}`,"g"),e)})),l})),C=(x=(e,t)=>((e,t)=>(t=t||[],!!e.getIn(["requestData",...t,"bodyValue"])))(e,t),function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return e=>{const r=e.getSystem().specSelectors.specJson();let a=[...t][1]||[];return!r.getIn(["paths",...a,"requestBody","required"])||x(...t)}});var x;const A=(e,t)=>{var r;let{oas3RequiredRequestBodyContentType:a,oas3RequestContentType:i,oas3RequestBodyValue:u}=t,c=[];if(!o.Map.isMap(u))return c;let d=[];return(0,n.default)(r=(0,l.default)(a.requestContentType)).call(r,(e=>{if(e===i){let t=a.requestContentType[e];(0,n.default)(t).call(t,(e=>{(0,s.default)(d).call(d,e)<0&&d.push(e)}))}})),(0,n.default)(d).call(d,(e=>{u.getIn([e,"value"])||c.push(e)})),c}},1741:(e,t,r)=>{r.r(t),r.d(t,{servers:()=>u,isSwagger2:()=>d});var a=r(8639),n=r(9725),l=r(7779);const s=e=>e||(0,n.Map)(),o=(0,a.createSelector)(s,(e=>e.get("json",(0,n.Map)()))),i=(0,a.createSelector)(s,(e=>e.get("resolved",(0,n.Map)()))),u=(c=(0,a.createSelector)((e=>{let t=i(e);return t.count()<1&&(t=o(e)),t}),(e=>e.getIn(["servers"])||(0,n.Map)())),()=>function(e){const t=e.getSystem().specSelectors.specJson();if((0,l.isOAS3)(t)){for(var r=arguments.length,a=new Array(r>1?r-1:0),n=1;n<r;n++)a[n-1]=arguments[n];return c(...a)}return null});var c;const d=(e,t)=>()=>{const e=t.getSystem().specSelectors.specJson();return(0,l.isSwagger2)(e)}},2044:(e,t,r)=>{r.r(t),r.d(t,{definitions:()=>f,hasHost:()=>h,securityDefinitions:()=>m,host:()=>g,basePath:()=>y,consumes:()=>v,produces:()=>E,schemes:()=>b,servers:()=>S,isOAS3:()=>_,isSwagger2:()=>w});var a=r(8639),n=r(3881),l=r(9725),s=r(7779);function o(e){return(t,r)=>function(){const a=r.getSystem().specSelectors.specJson();return(0,s.isOAS3)(a)?e(...arguments):t(...arguments)}}const i=e=>e||(0,l.Map)(),u=o((0,a.createSelector)((()=>null))),c=(0,a.createSelector)(i,(e=>e.get("json",(0,l.Map)()))),d=(0,a.createSelector)(i,(e=>e.get("resolved",(0,l.Map)()))),p=e=>{let t=d(e);return t.count()<1&&(t=c(e)),t},f=o((0,a.createSelector)(p,(e=>{const t=e.getIn(["components","schemas"]);return l.Map.isMap(t)?t:(0,l.Map)()}))),h=o((e=>p(e).hasIn(["servers",0]))),m=o((0,a.createSelector)(n.specJsonWithResolvedSubtrees,(e=>e.getIn(["components","securitySchemes"])||null))),g=u,y=u,v=u,E=u,b=u,S=o((0,a.createSelector)(p,(e=>e.getIn(["servers"])||(0,l.Map)()))),_=(e,t)=>()=>{const e=t.getSystem().specSelectors.specJson();return(0,s.isOAS3)(l.Map.isMap(e)?e:(0,l.Map)())},w=(e,t)=>()=>{const e=t.getSystem().specSelectors.specJson();return(0,s.isSwagger2)(l.Map.isMap(e)?e:(0,l.Map)())}},356:(e,t,r)=>{r.r(t),r.d(t,{default:()=>n});var a=r(810);const n=(0,r(7779).OAS3ComponentWrapFactory)((e=>{let{Ori:t,...r}=e;const{schema:n,getComponent:l,errSelectors:s,authorized:o,onAuthChange:i,name:u}=r,c=l("HttpAuth");return"http"===n.get("type")?a.default.createElement(c,{key:u,schema:n,name:u,errSelectors:s,authorized:o,getComponent:l,onChange:i}):a.default.createElement(t,r)}))},7761:(e,t,r)=>{r.r(t),r.d(t,{default:()=>u});var a=r(2460),n=r(356),l=r(9487),s=r(58),o=r(3499),i=r(287);const u={Markdown:a.default,AuthItem:n.default,JsonSchema_string:i.default,VersionStamp:l.default,model:o.default,onlineValidatorBadge:s.default}},287:(e,t,r)=>{r.r(t),r.d(t,{default:()=>n});var a=r(810);const n=(0,r(7779).OAS3ComponentWrapFactory)((e=>{let{Ori:t,...r}=e;const{schema:n,getComponent:l,errors:s,onChange:o}=r,i=n&&n.get?n.get("format"):null,u=n&&n.get?n.get("type"):null,c=l("Input");return u&&"string"===u&&i&&("binary"===i||"base64"===i)?a.default.createElement(c,{type:"file",className:s.length?"invalid":"",title:s.length?s:"",onChange:e=>{o(e.target.files[0])},disabled:t.isDisabled}):a.default.createElement(t,r)}))},2460:(e,t,r)=>{r.r(t),r.d(t,{Markdown:()=>c,default:()=>d});var a=r(5942),n=r(810),l=(r(5053),r(8096)),s=r(3952),o=r(7779),i=r(5466);const u=new s.Remarkable("commonmark");u.block.ruler.enable(["table"]),u.set({linkTarget:"_blank"});const c=e=>{let{source:t,className:r="",getConfigs:s}=e;if("string"!=typeof t)return null;if(t){const{useUnsafeMarkdown:e}=s(),o=u.render(t),c=(0,i.s)(o,{useUnsafeMarkdown:e});let d;return"string"==typeof c&&(d=(0,a.default)(c).call(c)),n.default.createElement("div",{dangerouslySetInnerHTML:{__html:d},className:(0,l.default)(r,"renderedMarkdown")})}return null};c.defaultProps={getConfigs:()=>({useUnsafeMarkdown:!1})};const d=(0,o.OAS3ComponentWrapFactory)(c)},3499:(e,t,r)=>{r.r(t),r.d(t,{default:()=>i});var a=r(863),n=r(810),l=(r(5053),r(7779)),s=r(1543);class o extends n.Component{render(){let{getConfigs:e,schema:t}=this.props,r=["model-box"],l=null;return!0===t.get("deprecated")&&(r.push("deprecated"),l=n.default.createElement("span",{className:"model-deprecated-warning"},"Deprecated:")),n.default.createElement("div",{className:r.join(" ")},l,n.default.createElement(s.Z,(0,a.default)({},this.props,{getConfigs:e,depth:1,expandDepth:this.props.expandDepth||0})))}}const i=(0,l.OAS3ComponentWrapFactory)(o)},58:(e,t,r)=>{r.r(t),r.d(t,{default:()=>l});var a=r(7779),n=r(5623);const l=(0,a.OAS3ComponentWrapFactory)(n.Z)},9487:(e,t,r)=>{r.r(t),r.d(t,{default:()=>n});var a=r(810);const n=(0,r(7779).OAS3ComponentWrapFactory)((e=>{const{Ori:t}=e;return a.default.createElement("span",null,a.default.createElement(t,e),a.default.createElement("small",{className:"version-stamp"},a.default.createElement("pre",{className:"version"},"OAS3")))}))},8560:(e,t,r)=>{r.r(t),r.d(t,{default:()=>l});var a=r(6235);let n=!1;function l(){return{statePlugins:{spec:{wrapActions:{updateSpec:e=>function(){return n=!0,e(...arguments)},updateJsonSpec:(e,t)=>function(){const r=t.getConfigs().onComplete;return n&&"function"==typeof r&&((0,a.default)(r,0),n=!1),e(...arguments)}}}}}}},4624:(e,t,r)=>{r.r(t),r.d(t,{requestSnippetGenerator_curl_bash:()=>b,requestSnippetGenerator_curl_cmd:()=>S,requestSnippetGenerator_curl_powershell:()=>E});var a=r(8818),n=r(5942),s=r(313),o=r(2565);const i=(e=>{var t={};return r.d(t,e),t})({default:()=>l.default});var u=r(2954),c=r(2372),d=r(7504),p=r(9725);const f=e=>{var t;const r="_**[]";return(0,a.default)(e).call(e,r)<0?e:(0,n.default)(t=e.split(r)[0]).call(t)},h=e=>"-d "===e||/^[_\/-]/g.test(e)?e:"'"+e.replace(/'/g,"'\\''")+"'",m=e=>"-d "===(e=e.replace(/\^/g,"^^").replace(/\\"/g,'\\\\"').replace(/"/g,'""').replace(/\n/g,"^\n"))?e.replace(/-d /g,"-d ^\n"):/^[_\/-]/g.test(e)?e:'"'+e+'"',g=e=>"-d "===e?e:/\n/.test(e)?'@"\n'+e.replace(/"/g,'\\"').replace(/`/g,"``").replace(/\$/,"`$")+'\n"@':/^[_\/-]/g.test(e)?e:"'"+e.replace(/"/g,'""').replace(/'/g,"''")+"'";function y(e){let t=[];for(let[r,a]of e.get("body").entrySeq()){let e=f(r);a instanceof d.Z.File?t.push(`  "${e}": {\n    "name": "${a.name}"${a.type?`,\n    "type": "${a.type}"`:""}\n  }`):t.push(`  "${e}": ${(0,s.default)(a,null,2).replace(/(\r\n|\r|\n)/g,"\n  ")}`)}return`{\n${t.join(",\n")}\n}`}const v=function(e,t,r){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",n=!1,l="";const h=function(){for(var e=arguments.length,r=new Array(e),a=0;a<e;a++)r[a]=arguments[a];return l+=" "+(0,o.default)(r).call(r,t).join(" ")},m=function(){for(var e=arguments.length,r=new Array(e),a=0;a<e;a++)r[a]=arguments[a];return l+=(0,o.default)(r).call(r,t).join(" ")},g=()=>l+=` ${r}`,v=function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return l+=(0,i.default)(e="  ").call(e,t)};let E=e.get("headers");if(l+="curl"+a,e.has("curlOptions")&&h(...e.get("curlOptions")),h("-X",e.get("method")),g(),v(),m(`${e.get("url")}`),E&&E.size)for(let t of(0,u.default)(b=e.get("headers")).call(b)){var b;g(),v();let[e,r]=t;m("-H",`${e}: ${r}`),n=n||/^content-type$/i.test(e)&&/^multipart\/form-data$/i.test(r)}const S=e.get("body");var _;if(S)if(n&&(0,c.default)(_=["POST","PUT","PATCH"]).call(_,e.get("method")))for(let[e,t]of S.entrySeq()){let r=f(e);g(),v(),m("-F"),t instanceof d.Z.File?h(`${r}=@${t.name}${t.type?`;type=${t.type}`:""}`):h(`${r}=${t}`)}else if(S instanceof d.Z.File)g(),v(),m(`--data-binary '@${S.name}'`);else{g(),v(),m("-d ");let t=S;p.Map.isMap(t)?m(y(e)):("string"!=typeof t&&(t=(0,s.default)(t)),m(t))}else S||"POST"!==e.get("method")||(g(),v(),m("-d ''"));return l},E=e=>v(e,g,"`\n",".exe"),b=e=>v(e,h,"\\\n"),S=e=>v(e,m,"^\n")},6575:(e,t,r)=>{r.r(t),r.d(t,{default:()=>s});var a=r(4624),n=r(4669),l=r(4206);const s=()=>({components:{RequestSnippets:l.default},fn:a,statePlugins:{requestSnippets:{selectors:n}}})},4206:(e,t,r)=>{r.r(t),r.d(t,{default:()=>h});var a=r(6145),n=r(8898),l=r(29),s=r(2565),o=r(810),i=(r(5053),r(9908)),u=r(7068),c=r(9874),d=r(471);const p={cursor:"pointer",lineHeight:1,display:"inline-flex",backgroundColor:"rgb(250, 250, 250)",paddingBottom:"0",paddingTop:"0",border:"1px solid rgb(51, 51, 51)",borderRadius:"4px 4px 0 0",boxShadow:"none",borderBottom:"none"},f={cursor:"pointer",lineHeight:1,display:"inline-flex",backgroundColor:"rgb(51, 51, 51)",boxShadow:"none",border:"1px solid rgb(51, 51, 51)",paddingBottom:"0",paddingTop:"0",borderRadius:"4px 4px 0 0",marginTop:"-5px",marginRight:"-5px",marginLeft:"-5px",zIndex:"9999",borderBottom:"none"},h=e=>{var t,r;let{request:h,requestSnippetsSelectors:m,getConfigs:g}=e;const y=(0,u.default)(g)?g():null,v=!1!==(0,i.default)(y,"syntaxHighlight")&&(0,i.default)(y,"syntaxHighlight.activated",!0),E=(0,o.useRef)(null),[b,S]=(0,o.useState)(null===(t=m.getSnippetGenerators())||void 0===t?void 0:t.keySeq().first()),[_,w]=(0,o.useState)(null==m?void 0:m.getDefaultExpanded());(0,o.useEffect)((()=>{}),[]),(0,o.useEffect)((()=>{var e;const t=(0,a.default)(e=(0,n.default)(E.current.childNodes)).call(e,(e=>{var t;return!!e.nodeType&&(null===(t=e.classList)||void 0===t?void 0:t.contains("curl-command"))}));return(0,l.default)(t).call(t,(e=>e.addEventListener("mousewheel",T,{passive:!1}))),()=>{(0,l.default)(t).call(t,(e=>e.removeEventListener("mousewheel",T)))}}),[h]);const C=m.getSnippetGenerators(),x=C.get(b),A=x.get("fn")(h),I=()=>{w(!_)},R=e=>e===b?f:p,T=e=>{const{target:t,deltaY:r}=e,{scrollHeight:a,offsetHeight:n,scrollTop:l}=t;a>n&&(0===l&&r<0||n+l>=a&&r>0)&&e.preventDefault()},N=v?o.default.createElement(d.d3,{language:x.get("syntax"),className:"curl microlight",style:(0,d.C2)((0,i.default)(y,"syntaxHighlight.theme"))},A):o.default.createElement("textarea",{readOnly:!0,className:"curl",value:A});return o.default.createElement("div",{className:"request-snippets",ref:E},o.default.createElement("div",{style:{width:"100%",display:"flex",justifyContent:"flex-start",alignItems:"center",marginBottom:"15px"}},o.default.createElement("h4",{onClick:()=>I(),style:{cursor:"pointer"}},"Snippets"),o.default.createElement("button",{onClick:()=>I(),style:{border:"none",background:"none"},title:_?"Collapse operation":"Expand operation"},o.default.createElement("svg",{className:"arrow",width:"10",height:"10"},o.default.createElement("use",{href:_?"#large-arrow-down":"#large-arrow",xlinkHref:_?"#large-arrow-down":"#large-arrow"})))),_&&o.default.createElement("div",{className:"curl-command"},o.default.createElement("div",{style:{paddingLeft:"15px",paddingRight:"10px",width:"100%",display:"flex"}},(0,s.default)(r=C.entrySeq()).call(r,(e=>{let[t,r]=e;return o.default.createElement("div",{style:R(t),className:"btn",key:t,onClick:()=>(e=>{b!==e&&S(e)})(t)},o.default.createElement("h4",{style:t===b?{color:"white"}:{}},r.get("title")))}))),o.default.createElement("div",{className:"copy-to-clipboard"},o.default.createElement(c.CopyToClipboard,{text:A},o.default.createElement("button",null))),o.default.createElement("div",null,N)))}},4669:(e,t,r)=>{r.r(t),r.d(t,{getGenerators:()=>u,getSnippetGenerators:()=>c,getActiveLanguage:()=>d,getDefaultExpanded:()=>p});var a=r(6145),n=r(2372),l=r(2565),s=r(8639),o=r(9725);const i=e=>e||(0,o.Map)(),u=(0,s.createSelector)(i,(e=>{const t=e.get("languages"),r=e.get("generators",(0,o.Map)());return!t||t.isEmpty()?r:(0,a.default)(r).call(r,((e,r)=>(0,n.default)(t).call(t,r)))})),c=e=>t=>{var r,n;let{fn:s}=t;return(0,a.default)(r=(0,l.default)(n=u(e)).call(n,((e,t)=>{const r=(e=>s[`requestSnippetGenerator_${e}`])(t);return"function"!=typeof r?null:e.set("fn",r)}))).call(r,(e=>e))},d=(0,s.createSelector)(i,(e=>e.get("activeLanguage"))),p=(0,s.createSelector)(i,(e=>e.get("defaultExpanded")))},6195:(e,t,r)=>{r.r(t),r.d(t,{ErrorBoundary:()=>s,default:()=>o});r(5053);var a=r(810),n=r(6189),l=r(9403);class s extends a.Component{static getDerivedStateFromError(e){return{hasError:!0,error:e}}constructor(){super(...arguments),this.state={hasError:!1,error:null}}componentDidCatch(e,t){this.props.fn.componentDidCatch(e,t)}render(){const{getComponent:e,targetName:t,children:r}=this.props;if(this.state.hasError){const r=e("Fallback");return a.default.createElement(r,{name:t})}return r}}s.defaultProps={targetName:"this component",getComponent:()=>l.default,fn:{componentDidCatch:n.componentDidCatch},children:null};const o=s},9403:(e,t,r)=>{r.r(t),r.d(t,{default:()=>n});var a=r(810);r(5053);const n=e=>{let{name:t}=e;return a.default.createElement("div",{className:"fallback"},"😱 ",a.default.createElement("i",null,"Could not render ","t"===t?"this component":t,", see the console."))}},6189:(e,t,r)=>{r.r(t),r.d(t,{componentDidCatch:()=>l,withErrorBoundary:()=>s});var a=r(863),n=r(810);const l=console.error,s=e=>t=>{const{getComponent:r,fn:l}=e(),s=r("ErrorBoundary"),o=l.getDisplayName(t);class i extends n.Component{render(){return n.default.createElement(s,{targetName:o,getComponent:r,fn:l},n.default.createElement(t,(0,a.default)({},this.props,this.context)))}}var u;return i.displayName=`WithErrorBoundary(${o})`,(u=t).prototype&&u.prototype.isReactComponent&&(i.prototype.mapStateToProps=t.prototype.mapStateToProps),i}},8102:(e,t,r)=>{r.r(t),r.d(t,{default:()=>c});const a=(e=>{var t={};return r.d(t,e),t})({default:()=>s.default});const n=(e=>{var t={};return r.d(t,e),t})({default:()=>o.default});var l=r(6195),i=r(9403),u=r(6189);const c=function(){let{componentList:e=[],fullOverride:t=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r=>{var s;let{getSystem:o}=r;const c=t?e:["App","BaseLayout","VersionPragmaFilter","InfoContainer","ServersContainer","SchemesContainer","AuthorizeBtnContainer","FilterContainer","Operations","OperationContainer","parameters","responses","OperationServers","Models","ModelWrapper",...e],d=(0,n.default)(c,(0,a.default)(s=Array(c.length)).call(s,((e,t)=>{let{fn:r}=t;return r.withErrorBoundary(e)})));return{fn:{componentDidCatch:u.componentDidCatch,withErrorBoundary:(0,u.withErrorBoundary)(o)},components:{ErrorBoundary:l.default,Fallback:i.default},wrapComponents:d}}}},2473:(e,t,r)=>{r.r(t),r.d(t,{createXMLExample:()=>O,inferSchema:()=>N,memoizedCreateXMLExample:()=>M,memoizedSampleFromSchema:()=>j,sampleFromSchema:()=>k,sampleFromSchemaGeneric:()=>T});var a=r(8818),n=r(29),l=r(4163),s=r(2372),o=r(9963),c=r(8136),d=r(1778),p=r(5171),f=r(2565),h=r(313),m=r(3479),g=r.n(m);const y=(e=>{var t={};return r.d(t,e),t})({default:()=>i.default});const v=(e=>{var t={};return r.d(t,e),t})({default:()=>u.default});var E=r(6298),b=r(9669);const S={string:e=>e.pattern?(e=>{try{return new y.default(e).gen()}catch(e){return"string"}})(e.pattern):"string",string_email:()=>"user@example.com","string_date-time":()=>(new Date).toISOString(),string_date:()=>(new Date).toISOString().substring(0,10),string_uuid:()=>"3fa85f64-5717-4562-b3fc-2c963f66afa6",string_hostname:()=>"example.com",string_ipv4:()=>"198.51.100.42",string_ipv6:()=>"2001:0db8:5b96:0000:0000:426f:8e17:642a",number:()=>0,number_float:()=>0,integer:()=>0,boolean:e=>"boolean"!=typeof e.default||e.default},_=e=>{e=(0,E.mz)(e);let{type:t,format:r}=e,a=S[`${t}_${r}`]||S[t];return(0,E.Wl)(a)?a(e):"Unknown Type: "+e.type},w=e=>(0,E.XV)(e,"$$ref",(e=>"string"==typeof e&&(0,a.default)(e).call(e,"#")>-1)),C=["maxProperties","minProperties"],x=["minItems","maxItems"],A=["minimum","maximum","exclusiveMinimum","exclusiveMaximum"],I=["minLength","maxLength"],R=function(e,t){var r;let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=r=>{void 0===t[r]&&void 0!==e[r]&&(t[r]=e[r])};var u;((0,n.default)(r=["example","default","enum","xml","type",...C,...x,...A,...I]).call(r,(e=>i(e))),void 0!==e.required&&(0,l.default)(e.required))&&(void 0!==t.required&&t.required.length||(t.required=[]),(0,n.default)(u=e.required).call(u,(e=>{var r;(0,s.default)(r=t.required).call(r,e)||t.required.push(e)})));if(e.properties){t.properties||(t.properties={});let r=(0,E.mz)(e.properties);for(let n in r){var c;if(Object.prototype.hasOwnProperty.call(r,n))if(!r[n]||!r[n].deprecated)if(!r[n]||!r[n].readOnly||o.includeReadOnly)if(!r[n]||!r[n].writeOnly||o.includeWriteOnly)if(!t.properties[n])t.properties[n]=r[n],!e.required&&(0,l.default)(e.required)&&-1!==(0,a.default)(c=e.required).call(c,n)&&(t.required?t.required.push(n):t.required=[n])}}return e.items&&(t.items||(t.items={}),t.items=R(e.items,t.items,o)),t},T=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];e&&(0,E.Wl)(e.toJS)&&(e=e.toJS());let u=void 0!==r||e&&void 0!==e.example||e&&void 0!==e.default;const h=!u&&e&&e.oneOf&&e.oneOf.length>0,m=!u&&e&&e.anyOf&&e.anyOf.length>0;if(!u&&(h||m)){const r=(0,E.mz)(h?e.oneOf[0]:e.anyOf[0]);if(R(r,e,t),!e.xml&&r.xml&&(e.xml=r.xml),void 0!==e.example&&void 0!==r.example)u=!0;else if(r.properties){e.properties||(e.properties={});let n=(0,E.mz)(r.properties);for(let s in n){var g;if(Object.prototype.hasOwnProperty.call(n,s))if(!n[s]||!n[s].deprecated)if(!n[s]||!n[s].readOnly||t.includeReadOnly)if(!n[s]||!n[s].writeOnly||t.includeWriteOnly)if(!e.properties[s])e.properties[s]=n[s],!r.required&&(0,l.default)(r.required)&&-1!==(0,a.default)(g=r.required).call(g,s)&&(e.required?e.required.push(s):e.required=[s])}}}const y={};let{xml:b,type:S,example:I,properties:N,additionalProperties:O,items:k}=e||{},{includeReadOnly:P,includeWriteOnly:M}=t;b=b||{};let j,{name:L,prefix:B,namespace:q}=b,D={};if(i&&(L=L||"notagname",j=(B?B+":":"")+L,q)){y[B?"xmlns:"+B:"xmlns"]=q}i&&(D[j]=[]);const U=t=>(0,o.default)(t).call(t,(t=>Object.prototype.hasOwnProperty.call(e,t)));e&&!S&&(N||O||U(C)?S="object":k||U(x)?S="array":U(A)?(S="number",e.type="number"):u||e.enum||(S="string",e.type="string"));const V=t=>{var r,a,n,l,s;null!==(null===(r=e)||void 0===r?void 0:r.maxItems)&&void 0!==(null===(a=e)||void 0===a?void 0:a.maxItems)&&(t=(0,c.default)(t).call(t,0,null===(s=e)||void 0===s?void 0:s.maxItems));if(null!==(null===(n=e)||void 0===n?void 0:n.minItems)&&void 0!==(null===(l=e)||void 0===l?void 0:l.minItems)){let r=0;for(;t.length<(null===(o=e)||void 0===o?void 0:o.minItems);){var o;t.push(t[r++%t.length])}}return t},z=(0,E.mz)(N);let F,$=0;const J=()=>e&&null!==e.maxProperties&&void 0!==e.maxProperties&&$>=e.maxProperties,W=()=>{if(!e||!e.required)return 0;let t=0;var r,a;i?(0,n.default)(r=e.required).call(r,(e=>t+=void 0===D[e]?0:1)):(0,n.default)(a=e.required).call(a,(e=>{var r;return t+=void 0===(null===(r=D[j])||void 0===r?void 0:(0,d.default)(r).call(r,(t=>void 0!==t[e])))?0:1}));return e.required.length-t},H=t=>{var r;return!(e&&e.required&&e.required.length)||!(0,s.default)(r=e.required).call(r,t)},K=t=>!e||null===e.maxProperties||void 0===e.maxProperties||!J()&&(!H(t)||e.maxProperties-$-W()>0);if(F=i?function(r){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;if(e&&z[r]){if(z[r].xml=z[r].xml||{},z[r].xml.attribute){const e=(0,l.default)(z[r].enum)?z[r].enum[0]:void 0,t=z[r].example,a=z[r].default;return void(y[z[r].xml.name||r]=void 0!==t?t:void 0!==a?a:void 0!==e?e:_(z[r]))}z[r].xml.name=z[r].xml.name||r}else z[r]||!1===O||(z[r]={xml:{name:r}});let n=T(e&&z[r]||void 0,t,a,i);var s;K(r)&&($++,(0,l.default)(n)?D[j]=(0,p.default)(s=D[j]).call(s,n):D[j].push(n))}:(e,r)=>{K(e)&&(D[e]=T(z[e],t,r,i),$++)},u){let a;if(a=w(void 0!==r?r:void 0!==I?I:e.default),!i){if("number"==typeof a&&"string"===S)return`${a}`;if("string"!=typeof a||"string"===S)return a;try{return JSON.parse(a)}catch(e){return a}}if(e||(S=(0,l.default)(a)?"array":typeof a),"array"===S){if(!(0,l.default)(a)){if("string"==typeof a)return a;a=[a]}const r=e?e.items:void 0;r&&(r.xml=r.xml||b||{},r.xml.name=r.xml.name||b.name);let n=(0,f.default)(a).call(a,(e=>T(r,t,e,i)));return n=V(n),b.wrapped?(D[j]=n,(0,v.default)(y)||D[j].push({_attr:y})):D=n,D}if("object"===S){if("string"==typeof a)return a;for(let t in a)Object.prototype.hasOwnProperty.call(a,t)&&(e&&z[t]&&z[t].readOnly&&!P||e&&z[t]&&z[t].writeOnly&&!M||(e&&z[t]&&z[t].xml&&z[t].xml.attribute?y[z[t].xml.name||t]=a[t]:F(t,a[t])));return(0,v.default)(y)||D[j].push({_attr:y}),D}return D[j]=(0,v.default)(y)?a:[{_attr:y},a],D}if("object"===S){for(let e in z)Object.prototype.hasOwnProperty.call(z,e)&&(z[e]&&z[e].deprecated||z[e]&&z[e].readOnly&&!P||z[e]&&z[e].writeOnly&&!M||F(e));if(i&&y&&D[j].push({_attr:y}),J())return D;if(!0===O)i?D[j].push({additionalProp:"Anything can be here"}):D.additionalProp1={},$++;else if(O){const r=(0,E.mz)(O),a=T(r,t,void 0,i);if(i&&r.xml&&r.xml.name&&"notagname"!==r.xml.name)D[j].push(a);else{const t=null!==e.minProperties&&void 0!==e.minProperties&&$<e.minProperties?e.minProperties-$:3;for(let e=1;e<=t;e++){if(J())return D;if(i){const t={};t["additionalProp"+e]=a.notagname,D[j].push(t)}else D["additionalProp"+e]=a;$++}}}return D}if("array"===S){if(!k)return;let r;var G,Z;if(i)k.xml=k.xml||(null===(G=e)||void 0===G?void 0:G.xml)||{},k.xml.name=k.xml.name||b.name;if((0,l.default)(k.anyOf))r=(0,f.default)(Z=k.anyOf).call(Z,(e=>T(R(k,e,t),t,void 0,i)));else if((0,l.default)(k.oneOf)){var Y;r=(0,f.default)(Y=k.oneOf).call(Y,(e=>T(R(k,e,t),t,void 0,i)))}else{if(!(!i||i&&b.wrapped))return T(k,t,void 0,i);r=[T(k,t,void 0,i)]}return r=V(r),i&&b.wrapped?(D[j]=r,(0,v.default)(y)||D[j].push({_attr:y}),D):r}let X;if(e&&(0,l.default)(e.enum))X=(0,E.AF)(e.enum)[0];else{if(!e)return;if(X=_(e),"number"==typeof X){let t=e.minimum;null!=t&&(e.exclusiveMinimum&&t++,X=t);let r=e.maximum;null!=r&&(e.exclusiveMaximum&&r--,X=r)}if("string"==typeof X&&(null!==e.maxLength&&void 0!==e.maxLength&&(X=(0,c.default)(X).call(X,0,e.maxLength)),null!==e.minLength&&void 0!==e.minLength)){let t=0;for(;X.length<e.minLength;)X+=X[t++%X.length]}}if("file"!==S)return i?(D[j]=(0,v.default)(y)?X:[{_attr:y},X],D):X},N=e=>(e.schema&&(e=e.schema),e.properties&&(e.type="object"),e),O=(e,t,r)=>{const a=T(e,t,r,!0);if(a)return"string"==typeof a?a:g()(a,{declaration:!0,indent:"\t"})},k=(e,t,r)=>T(e,t,r,!1),P=(e,t,r)=>[e,(0,h.default)(t),(0,h.default)(r)],M=(0,b.Z)(O,P),j=(0,b.Z)(k,P)},8883:(e,t,r)=>{r.r(t),r.d(t,{default:()=>n});var a=r(2473);function n(){return{fn:a}}},5179:(e,t,r)=>{r.r(t),r.d(t,{CLEAR_REQUEST:()=>V,CLEAR_RESPONSE:()=>U,CLEAR_VALIDATE_PARAMS:()=>z,LOG_REQUEST:()=>D,SET_MUTATED_REQUEST:()=>q,SET_REQUEST:()=>B,SET_RESPONSE:()=>L,SET_SCHEME:()=>W,UPDATE_EMPTY_PARAM_INCLUSION:()=>M,UPDATE_JSON:()=>k,UPDATE_OPERATION_META_VALUE:()=>F,UPDATE_PARAM:()=>P,UPDATE_RESOLVED:()=>$,UPDATE_RESOLVED_SUBTREE:()=>J,UPDATE_SPEC:()=>N,UPDATE_URL:()=>O,VALIDATE_PARAMS:()=>j,changeConsumesValue:()=>ce,changeParam:()=>ae,changeParamByIdentity:()=>ne,changeProducesValue:()=>de,clearRequest:()=>Ee,clearResponse:()=>ve,clearValidateParams:()=>ue,execute:()=>ye,executeRequest:()=>ge,invalidateResolvedSubtreeCache:()=>se,logRequest:()=>me,parseToJson:()=>Y,requestResolvedSubtree:()=>re,resolveSpec:()=>Q,setMutatedRequest:()=>he,setRequest:()=>fe,setResponse:()=>pe,setScheme:()=>be,updateEmptyParamInclusion:()=>ie,updateJsonSpec:()=>Z,updateResolved:()=>K,updateResolvedSubtree:()=>le,updateSpec:()=>H,updateUrl:()=>G,validateParams:()=>oe});var a=r(4163),n=r(2565),l=r(6718),s=r.n(l),o=r(6785),i=r(7930);const u=(e=>{var t={};return r.d(t,e),t})({default:()=>c.default});var m=r(6145),g=r(374),y=r(8818),v=r(29),E=r(2740),b=r(7512);const S=(e=>{var t={};return r.d(t,e),t})({default:()=>d.default});var _=r(626),w=r(9725),C=r(8900),x=r(8518);const A=(e=>{var t={};return r.d(t,e),t})({default:()=>p.default});const I=(e=>{var t={};return r.d(t,e),t})({default:()=>f.default});const R=(e=>{var t={};return r.d(t,e),t})({default:()=>h.default});var T=r(6298);const N="spec_update_spec",O="spec_update_url",k="spec_update_json",P="spec_update_param",M="spec_update_empty_param_inclusion",j="spec_validate_param",L="spec_set_response",B="spec_set_request",q="spec_set_mutated_request",D="spec_log_request",U="spec_clear_response",V="spec_clear_request",z="spec_clear_validate_param",F="spec_update_operation_meta_value",$="spec_update_resolved",J="spec_update_resolved_subtree",W="set_scheme";function H(e){const t=(r=e,(0,A.default)(r)?r:"").replace(/\t/g,"  ");var r;if("string"==typeof e)return{type:N,payload:t}}function K(e){return{type:$,payload:e}}function G(e){return{type:O,payload:e}}function Z(e){return{type:k,payload:e}}const Y=e=>t=>{let{specActions:r,specSelectors:a,errActions:n}=t,{specStr:l}=a,s=null;try{e=e||l(),n.clear({source:"parser"}),s=_.default.load(e,{schema:_.JSON_SCHEMA})}catch(e){return console.error(e),n.newSpecErr({source:"parser",level:"error",message:e.reason,line:e.mark&&e.mark.line?e.mark.line+1:void 0})}return s&&"object"==typeof s?r.updateJsonSpec(s):{}};let X=!1;const Q=(e,t)=>r=>{let{specActions:l,specSelectors:o,errActions:i,fn:{fetch:u,resolve:c,AST:d={}},getConfigs:p}=r;X||(console.warn("specActions.resolveSpec is deprecated since v3.10.0 and will be removed in v4.0.0; use requestResolvedSubtree instead!"),X=!0);const{modelPropertyMacro:f,parameterMacro:h,requestInterceptor:m,responseInterceptor:g}=p();void 0===e&&(e=o.specJson()),void 0===t&&(t=o.url());let y=d.getLineNumberForPath?d.getLineNumberForPath:()=>{},v=o.specStr();return c({fetch:u,spec:e,baseDoc:t,modelPropertyMacro:f,parameterMacro:h,requestInterceptor:m,responseInterceptor:g}).then((e=>{let{spec:t,errors:r}=e;if(i.clear({type:"thrown"}),(0,a.default)(r)&&r.length>0){let e=(0,n.default)(r).call(r,(e=>(console.error(e),e.line=e.fullPath?y(v,e.fullPath):null,e.path=e.fullPath?e.fullPath.join("."):null,e.level="error",e.type="thrown",e.source="resolver",s()(e,"message",{enumerable:!0,value:e.message}),e)));i.newThrownErrBatch(e)}return l.updateResolved(t)}))};let ee=[];const te=(0,I.default)((async()=>{const e=ee.system;if(!e)return void console.error("debResolveSubtrees: don't have a system to operate on, aborting.");const{errActions:t,errSelectors:r,fn:{resolveSubtree:l,fetch:c,AST:d={}},specSelectors:p,specActions:f}=e;if(!l)return void console.error("Error: Swagger-Client did not provide a `resolveSubtree` method, doing nothing.");let h=d.getLineNumberForPath?d.getLineNumberForPath:()=>{};const y=p.specStr(),{modelPropertyMacro:v,parameterMacro:E,requestInterceptor:b,responseInterceptor:S}=e.getConfigs();try{var _=await(0,o.default)(ee).call(ee,(async(e,o)=>{const{resultMap:d,specWithCurrentSubtrees:f}=await e,{errors:_,spec:w}=await l(f,o,{baseDoc:p.url(),modelPropertyMacro:v,parameterMacro:E,requestInterceptor:b,responseInterceptor:S});if(r.allErrors().size&&t.clearBy((e=>{var t;return"thrown"!==e.get("type")||"resolver"!==e.get("source")||!(0,i.default)(t=e.get("fullPath")).call(t,((e,t)=>e===o[t]||void 0===o[t]))})),(0,a.default)(_)&&_.length>0){let e=(0,n.default)(_).call(_,(e=>(e.line=e.fullPath?h(y,e.fullPath):null,e.path=e.fullPath?e.fullPath.join("."):null,e.level="error",e.type="thrown",e.source="resolver",s()(e,"message",{enumerable:!0,value:e.message}),e)));t.newThrownErrBatch(e)}var C,x;w&&p.isOAS3()&&"components"===o[0]&&"securitySchemes"===o[1]&&await u.default.all((0,n.default)(C=(0,m.default)(x=(0,g.default)(w)).call(x,(e=>"openIdConnect"===e.type))).call(C,(async e=>{const t={url:e.openIdConnectUrl,requestInterceptor:b,responseInterceptor:S};try{const r=await c(t);r instanceof Error||r.status>=400?console.error(r.statusText+" "+t.url):e.openIdConnectData=JSON.parse(r.text)}catch(e){console.error(e)}})));return(0,R.default)(d,o,w),(0,R.default)(f,o,w),{resultMap:d,specWithCurrentSubtrees:f}}),u.default.resolve({resultMap:(p.specResolvedSubtree([])||(0,w.Map)()).toJS(),specWithCurrentSubtrees:p.specJson().toJS()}));delete ee.system,ee=[]}catch(e){console.error(e)}f.updateResolvedSubtree([],_.resultMap)}),35),re=e=>t=>{var r;(0,y.default)(r=(0,n.default)(ee).call(ee,(e=>e.join("@@")))).call(r,e.join("@@"))>-1||(ee.push(e),ee.system=t,te())};function ae(e,t,r,a,n){return{type:P,payload:{path:e,value:a,paramName:t,paramIn:r,isXml:n}}}function ne(e,t,r,a){return{type:P,payload:{path:e,param:t,value:r,isXml:a}}}const le=(e,t)=>({type:J,payload:{path:e,value:t}}),se=()=>({type:J,payload:{path:[],value:(0,w.Map)()}}),oe=(e,t)=>({type:j,payload:{pathMethod:e,isOAS3:t}}),ie=(e,t,r,a)=>({type:M,payload:{pathMethod:e,paramName:t,paramIn:r,includeEmptyValue:a}});function ue(e){return{type:z,payload:{pathMethod:e}}}function ce(e,t){return{type:F,payload:{path:e,value:t,key:"consumes_value"}}}function de(e,t){return{type:F,payload:{path:e,value:t,key:"produces_value"}}}const pe=(e,t,r)=>({payload:{path:e,method:t,res:r},type:L}),fe=(e,t,r)=>({payload:{path:e,method:t,req:r},type:B}),he=(e,t,r)=>({payload:{path:e,method:t,req:r},type:q}),me=e=>({payload:e,type:D}),ge=e=>t=>{let{fn:r,specActions:l,specSelectors:s,getConfigs:o,oas3Selectors:i}=t,{pathName:u,method:c,operation:d}=e,{requestInterceptor:p,responseInterceptor:f}=o(),h=d.toJS();var g,y;d&&d.get("parameters")&&(0,v.default)(g=(0,m.default)(y=d.get("parameters")).call(y,(e=>e&&!0===e.get("allowEmptyValue")))).call(g,(t=>{if(s.parameterInclusionSettingFor([u,c],t.get("name"),t.get("in"))){e.parameters=e.parameters||{};const r=(0,T.cz)(t,e.parameters);(!r||r&&0===r.size)&&(e.parameters[t.get("name")]="")}}));if(e.contextUrl=(0,C.default)(s.url()).toString(),h&&h.operationId?e.operationId=h.operationId:h&&u&&c&&(e.operationId=r.opId(h,u,c)),s.isOAS3()){const t=`${u}:${c}`;e.server=i.selectedServer(t)||i.selectedServer();const r=i.serverVariables({server:e.server,namespace:t}).toJS(),l=i.serverVariables({server:e.server}).toJS();e.serverVariables=(0,E.default)(r).length?r:l,e.requestContentType=i.requestContentType(u,c),e.responseContentType=i.responseContentType(u,c)||"*
</file>

<file path="docs/swagger/swagger-ui-es-bundle.js">
(()=>{var e={17967:(e,t)=>{"use strict";t.N=void 0;var r=/^([^\w]*)(javascript|data|vbscript)/im,n=/&#(\w+)(^\w|;)?/g,o=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,a=/^([^:]+):/gm,i=[".","/"];t.N=function(e){var t,s=(t=e||"",t.replace(n,(function(e,t){return String.fromCharCode(t)}))).replace(o,"").trim();if(!s)return"about:blank";if(function(e){return i.indexOf(e[0])>-1}(s))return s;var l=s.match(a);if(!l)return s;var u=l[0];return r.test(u)?"about:blank":s}},53795:(e,t,r)=>{"use strict";r.d(t,{Z:()=>T});var n=r(23101),o=r.n(n),a=r(61125),i=r.n(a),s=r(11882),l=r.n(s),u=r(97606),c=r.n(u),p=r(67294),f=r(43393);function h(e){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},h(e)}function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function m(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function g(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function v(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function y(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?v(r,!0).forEach((function(t){g(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):v(r).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function b(e){return b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},b(e)}function w(e,t){return w=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},w(e,t)}function E(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}var x={};function _(e,t,r){return function(e){return null==e}(e)?r:function(e){return null!==e&&"object"===h(e)&&"function"==typeof e.get&&"function"==typeof e.has}(e)?e.has(t)?e.get(t):r:hasOwnProperty.call(e,t)?e[t]:r}function S(e,t,r){for(var n=0;n!==t.length;)if((e=_(e,t[n++],x))===x)return r;return e}function A(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=k(t,r),o=e||Object.keys(y({},r,{},t));return o.every(n)}function k(e,t){return function(r){if("string"==typeof r)return(0,f.is)(t[r],e[r]);if(Array.isArray(r))return(0,f.is)(S(t,r),S(e,r));throw new TypeError("Invalid key: expected Array or string: "+r)}}const C=function(e){function t(){return d(this,t),E(this,b(t).apply(this,arguments))}var r,n,o;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&w(e,t)}(t,e),r=t,n=[{key:"shouldComponentUpdate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return!A(this.updateOnProps,this.props,e,"updateOnProps")||!A(this.updateOnStates,this.state,t,"updateOnStates")}}],n&&m(r.prototype,n),o&&m(r,o),t}(p.Component);var O=r(23930),j=r.n(O),I=r(45697),N=r.n(I);class T extends C{constructor(){super(...arguments),i()(this,"getModelName",(e=>-1!==l()(e).call(e,"#/definitions/")?e.replace(/^.*#\/definitions\//,""):-1!==l()(e).call(e,"#/components/schemas/")?e.replace(/^.*#\/components\/schemas\//,""):void 0)),i()(this,"getRefSchema",(e=>{let{specSelectors:t}=this.props;return t.findDefinition(e)}))}render(){let{getComponent:e,getConfigs:t,specSelectors:n,schema:a,required:i,name:s,isRef:l,specPath:u,displayName:c,includeReadOnly:f,includeWriteOnly:h}=this.props;const d=e("ObjectModel"),m=e("ArrayModel"),g=e("PrimitiveModel");let v="object",y=a&&a.get("$$ref");if(!s&&y&&(s=this.getModelName(y)),!a&&y&&(a=this.getRefSchema(s)),!a)return p.createElement("span",{className:"model model-title"},p.createElement("span",{className:"model-title__text"},c||s),p.createElement("img",{src:r(2517),height:"20px",width:"20px"}));const b=n.isOAS3()&&a.get("deprecated");switch(l=void 0!==l?l:!!y,v=a&&a.get("type")||v,v){case"object":return p.createElement(d,o()({className:"object"},this.props,{specPath:u,getConfigs:t,schema:a,name:s,deprecated:b,isRef:l,includeReadOnly:f,includeWriteOnly:h}));case"array":return p.createElement(m,o()({className:"array"},this.props,{getConfigs:t,schema:a,name:s,deprecated:b,required:i,includeReadOnly:f,includeWriteOnly:h}));default:return p.createElement(g,o()({},this.props,{getComponent:e,getConfigs:t,schema:a,name:s,deprecated:b,required:i}))}}}i()(T,"propTypes",{schema:c()(j()).isRequired,getComponent:N().func.isRequired,getConfigs:N().func.isRequired,specSelectors:N().object.isRequired,name:N().string,displayName:N().string,isRef:N().bool,required:N().bool,expandDepth:N().number,depth:N().number,specPath:j().list.isRequired,includeReadOnly:N().bool,includeWriteOnly:N().bool})},5623:(e,t,r)=>{"use strict";r.d(t,{Z:()=>f});var n=r(61125),o=r.n(n),a=r(28222),i=r.n(a),s=r(67294),l=r(84564),u=r.n(l),c=r(90242),p=r(27504);class f extends s.Component{constructor(e,t){super(e,t),o()(this,"getDefinitionUrl",(()=>{let{specSelectors:e}=this.props;return new(u())(e.url(),p.Z.location).toString()}));let{getConfigs:r}=e,{validatorUrl:n}=r();this.state={url:this.getDefinitionUrl(),validatorUrl:void 0===n?"https://validator.swagger.io/validator":n}}UNSAFE_componentWillReceiveProps(e){let{getConfigs:t}=e,{validatorUrl:r}=t();this.setState({url:this.getDefinitionUrl(),validatorUrl:void 0===r?"https://validator.swagger.io/validator":r})}render(){let{getConfigs:e}=this.props,{spec:t}=e(),r=(0,c.Nm)(this.state.validatorUrl);return"object"==typeof t&&i()(t).length?null:this.state.url&&(0,c.hW)(this.state.validatorUrl)&&(0,c.hW)(this.state.url)?s.createElement("span",{className:"float-right"},s.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:`${r}/debug?url=${encodeURIComponent(this.state.url)}`},s.createElement(h,{src:`${r}?url=${encodeURIComponent(this.state.url)}`,alt:"Online validator badge"}))):null}}class h extends s.Component{constructor(e){super(e),this.state={loaded:!1,error:!1}}componentDidMount(){const e=new Image;e.onload=()=>{this.setState({loaded:!0})},e.onerror=()=>{this.setState({error:!0})},e.src=this.props.src}UNSAFE_componentWillReceiveProps(e){if(e.src!==this.props.src){const t=new Image;t.onload=()=>{this.setState({loaded:!0})},t.onerror=()=>{this.setState({error:!0})},t.src=e.src}}render(){return this.state.error?s.createElement("img",{alt:"Error"}):this.state.loaded?s.createElement("img",{src:this.props.src,alt:this.props.alt}):null}}},86019:(e,t,r)=>{"use strict";r.d(t,{Z:()=>me,s:()=>ge});var n=r(67294),o=r(89927);function a(e,t){if(Array.prototype.indexOf)return e.indexOf(t);for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}function i(e,t){for(var r=e.length-1;r>=0;r--)!0===t(e[r])&&e.splice(r,1)}function s(e){throw new Error("Unhandled case for value: '"+e+"'")}var l=function(){function e(e){void 0===e&&(e={}),this.tagName="",this.attrs={},this.innerHTML="",this.whitespaceRegex=/\s+/,this.tagName=e.tagName||"",this.attrs=e.attrs||{},this.innerHTML=e.innerHtml||e.innerHTML||""}return e.prototype.setTagName=function(e){return this.tagName=e,this},e.prototype.getTagName=function(){return this.tagName||""},e.prototype.setAttr=function(e,t){return this.getAttrs()[e]=t,this},e.prototype.getAttr=function(e){return this.getAttrs()[e]},e.prototype.setAttrs=function(e){return Object.assign(this.getAttrs(),e),this},e.prototype.getAttrs=function(){return this.attrs||(this.attrs={})},e.prototype.setClass=function(e){return this.setAttr("class",e)},e.prototype.addClass=function(e){for(var t,r=this.getClass(),n=this.whitespaceRegex,o=r?r.split(n):[],i=e.split(n);t=i.shift();)-1===a(o,t)&&o.push(t);return this.getAttrs().class=o.join(" "),this},e.prototype.removeClass=function(e){for(var t,r=this.getClass(),n=this.whitespaceRegex,o=r?r.split(n):[],i=e.split(n);o.length&&(t=i.shift());){var s=a(o,t);-1!==s&&o.splice(s,1)}return this.getAttrs().class=o.join(" "),this},e.prototype.getClass=function(){return this.getAttrs().class||""},e.prototype.hasClass=function(e){return-1!==(" "+this.getClass()+" ").indexOf(" "+e+" ")},e.prototype.setInnerHTML=function(e){return this.innerHTML=e,this},e.prototype.setInnerHtml=function(e){return this.setInnerHTML(e)},e.prototype.getInnerHTML=function(){return this.innerHTML||""},e.prototype.getInnerHtml=function(){return this.getInnerHTML()},e.prototype.toAnchorString=function(){var e=this.getTagName(),t=this.buildAttrsStr();return["<",e,t=t?" "+t:"",">",this.getInnerHtml(),"</",e,">"].join("")},e.prototype.buildAttrsStr=function(){if(!this.attrs)return"";var e=this.getAttrs(),t=[];for(var r in e)e.hasOwnProperty(r)&&t.push(r+'="'+e[r]+'"');return t.join(" ")},e}();var u=function(){function e(e){void 0===e&&(e={}),this.newWindow=!1,this.truncate={},this.className="",this.newWindow=e.newWindow||!1,this.truncate=e.truncate||{},this.className=e.className||""}return e.prototype.build=function(e){return new l({tagName:"a",attrs:this.createAttrs(e),innerHtml:this.processAnchorText(e.getAnchorText())})},e.prototype.createAttrs=function(e){var t={href:e.getAnchorHref()},r=this.createCssClass(e);return r&&(t.class=r),this.newWindow&&(t.target="_blank",t.rel="noopener noreferrer"),this.truncate&&this.truncate.length&&this.truncate.length<e.getAnchorText().length&&(t.title=e.getAnchorHref()),t},e.prototype.createCssClass=function(e){var t=this.className;if(t){for(var r=[t],n=e.getCssClassSuffixes(),o=0,a=n.length;o<a;o++)r.push(t+"-"+n[o]);return r.join(" ")}return""},e.prototype.processAnchorText=function(e){return e=this.doTruncate(e)},e.prototype.doTruncate=function(e){var t=this.truncate;if(!t||!t.length)return e;var r=t.length,n=t.location;return"smart"===n?function(e,t,r){var n,o;null==r?(r="&hellip;",o=3,n=8):(o=r.length,n=r.length);var a=function(e){var t="";return e.scheme&&e.host&&(t+=e.scheme+":
</file>

<file path="docs/swagger/swagger-ui-standalone-preset.js">
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.SwaggerUIStandalonePreset=e():t.SwaggerUIStandalonePreset=e()}(this,(function(){return(()=>{var t={7967:(t,e)=>{"use strict";var r=/^([^\w]*)(javascript|data|vbscript)/im,n=/&#(\w+)(^\w|;)?/g,i=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,o=/^([^:]+):/gm,s=[".","/"]},9742:(t,e)=>{"use strict";e.byteLength=function(t){var e=a(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,o=a(t),s=o[0],u=o[1],c=new i(function(t,e,r){return 3*(e+r)/4-r}(0,s,u)),f=0,l=u>0?s-4:s;for(r=0;r<l;r+=4)e=n[t.charCodeAt(r)]<<18|n[t.charCodeAt(r+1)]<<12|n[t.charCodeAt(r+2)]<<6|n[t.charCodeAt(r+3)],c[f++]=e>>16&255,c[f++]=e>>8&255,c[f++]=255&e;2===u&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,c[f++]=255&e);1===u&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,c[f++]=e>>8&255,c[f++]=255&e);return c},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],s=16383,u=0,a=n-i;u<a;u+=s)o.push(c(t,u,u+s>a?a:u+s));1===i?(e=t[n-1],o.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"="));return o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=o.length;s<u;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function a(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function c(t,e,n){for(var i,o,s=[],u=e;u<n;u+=3)i=(t[u]<<16&16711680)+(t[u+1]<<8&65280)+(255&t[u+2]),s.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},8764:(t,e,r)=>{"use strict";const n=r(9742),i=r(645),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=a,e.SlowBuffer=function(t){+t!=t&&(t=0);return a.alloc(+t)},e.INSPECT_MAX_BYTES=50;const s=2147483647;function u(t){if(t>s)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,a.prototype),e}function a(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return l(t)}return c(t,e,r)}function c(t,e,r){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!a.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|y(t,e);let n=u(r);const i=n.write(t,e);i!==r&&(n=n.slice(0,i));return n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(Z(t,Uint8Array)){const e=new Uint8Array(t);return p(e.buffer,e.byteOffset,e.byteLength)}return h(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(Z(t,ArrayBuffer)||t&&Z(t.buffer,ArrayBuffer))return p(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(Z(t,SharedArrayBuffer)||t&&Z(t.buffer,SharedArrayBuffer)))return p(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return a.from(n,e,r);const i=function(t){if(a.isBuffer(t)){const e=0|d(t.length),r=u(e);return 0===r.length||t.copy(r,0,0,e),r}if(void 0!==t.length)return"number"!=typeof t.length||$(t.length)?u(0):h(t);if("Buffer"===t.type&&Array.isArray(t.data))return h(t.data)}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return a.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function f(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function l(t){return f(t),u(t<0?0:0|d(t))}function h(t){const e=t.length<0?0:0|d(t.length),r=u(e);for(let n=0;n<e;n+=1)r[n]=255&t[n];return r}function p(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(n,a.prototype),n}function d(t){if(t>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|t}function y(t,e){if(a.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||Z(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return q(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return H(t).length;default:if(i)return n?-1:q(t).length;e=(""+e).toLowerCase(),i=!0}}function g(t,e,r){let n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return E(this,e,r);case"utf8":case"utf-8":return N(this,e,r);case"ascii":return D(this,e,r);case"latin1":case"binary":return I(this,e,r);case"base64":return x(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function v(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function w(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),$(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=a.from(e,n)),a.isBuffer(e))return 0===e.length?-1:M(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):M(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function M(t,e,r,n,i){let o,s=1,u=t.length,a=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,u/=2,a/=2,r/=2}function c(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){let n=-1;for(o=r;o<u;o++)if(c(t,o)===c(e,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===a)return n*s}else-1!==n&&(o-=o-n),n=-1}else for(r+a>u&&(r=u-a),o=r;o>=0;o--){let r=!0;for(let n=0;n<a;n++)if(c(t,o+n)!==c(e,n)){r=!1;break}if(r)return o}return-1}function L(t,e,r,n){r=Number(r)||0;const i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=e.length;let s;for(n>o/2&&(n=o/2),s=0;s<n;++s){const n=parseInt(e.substr(2*s,2),16);if($(n))return s;t[r+s]=n}return s}function _(t,e,r,n){return J(q(e,t.length-r),t,r,n)}function m(t,e,r,n){return J(function(t){const e=[];for(let r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function b(t,e,r,n){return J(H(e),t,r,n)}function j(t,e,r,n){return J(function(t,e){let r,n,i;const o=[];for(let s=0;s<t.length&&!((e-=2)<0);++s)r=t.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function x(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function N(t,e,r){r=Math.min(t.length,r);const n=[];let i=e;for(;i<r;){const e=t[i];let o=null,s=e>239?4:e>223?3:e>191?2:1;if(i+s<=r){let r,n,u,a;switch(s){case 1:e<128&&(o=e);break;case 2:r=t[i+1],128==(192&r)&&(a=(31&e)<<6|63&r,a>127&&(o=a));break;case 3:r=t[i+1],n=t[i+2],128==(192&r)&&128==(192&n)&&(a=(15&e)<<12|(63&r)<<6|63&n,a>2047&&(a<55296||a>57343)&&(o=a));break;case 4:r=t[i+1],n=t[i+2],u=t[i+3],128==(192&r)&&128==(192&n)&&128==(192&u)&&(a=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&u,a>65535&&a<1114112&&(o=a))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(t){const e=t.length;if(e<=S)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=S));return r}(n)}e.kMaxLength=s,a.TYPED_ARRAY_SUPPORT=function(){try{const t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),a.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}}),a.poolSize=8192,a.from=function(t,e,r){return c(t,e,r)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array),a.alloc=function(t,e,r){return function(t,e,r){return f(t),t<=0?u(t):void 0!==e?"string"==typeof r?u(t).fill(e,r):u(t).fill(e):u(t)}(t,e,r)},a.allocUnsafe=function(t){return l(t)},a.allocUnsafeSlow=function(t){return l(t)},a.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==a.prototype},a.compare=function(t,e){if(Z(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),Z(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.isBuffer(t)||!a.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let r=t.length,n=e.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},a.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return a.alloc(0);let r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;const n=a.allocUnsafe(e);let i=0;for(r=0;r<t.length;++r){let e=t[r];if(Z(e,Uint8Array))i+e.length>n.length?(a.isBuffer(e)||(e=a.from(e)),e.copy(n,i)):Uint8Array.prototype.set.call(n,e,i);else{if(!a.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,i)}i+=e.length}return n},a.byteLength=y,a.prototype._isBuffer=!0,a.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)v(this,e,e+1);return this},a.prototype.swap32=function(){const t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)v(this,e,e+3),v(this,e+1,e+2);return this},a.prototype.swap64=function(){const t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)v(this,e,e+7),v(this,e+1,e+6),v(this,e+2,e+5),v(this,e+3,e+4);return this},a.prototype.toString=function(){const t=this.length;return 0===t?"":0===arguments.length?N(this,0,t):g.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(t){if(!a.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===a.compare(this,t)},a.prototype.inspect=function(){let t="";const r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},o&&(a.prototype[o]=a.prototype.inspect),a.prototype.compare=function(t,e,r,n,i){if(Z(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;let o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0);const u=Math.min(o,s),c=this.slice(n,i),f=t.slice(e,r);for(let t=0;t<u;++t)if(c[t]!==f[t]){o=c[t],s=f[t];break}return o<s?-1:s<o?1:0},a.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},a.prototype.indexOf=function(t,e,r){return w(this,t,e,r,!0)},a.prototype.lastIndexOf=function(t,e,r){return w(this,t,e,r,!1)},a.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return L(this,t,e,r);case"utf8":case"utf-8":return _(this,t,e,r);case"ascii":case"latin1":case"binary":return m(this,t,e,r);case"base64":return b(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const S=4096;function D(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function I(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function E(t,e,r){const n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=e;n<r;++n)i+=V[t[n]];return i}function A(t,e,r){const n=t.slice(e,r);let i="";for(let t=0;t<n.length-1;t+=2)i+=String.fromCharCode(n[t]+256*n[t+1]);return i}function C(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function T(t,e,r,n,i,o){if(!a.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function O(t,e,r,n,i){Q(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,r}function z(t,e,r,n,i){Q(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r+7]=o,o>>=8,t[r+6]=o,o>>=8,t[r+5]=o,o>>=8,t[r+4]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=s,s>>=8,t[r+2]=s,s>>=8,t[r+1]=s,s>>=8,t[r]=s,r+8}function k(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function U(t,e,r,n,o){return e=+e,r>>>=0,o||k(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function R(t,e,r,n,o){return e=+e,r>>>=0,o||k(t,0,r,8),i.write(t,e,r,n,52,8),r+8}a.prototype.slice=function(t,e){const r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);const n=this.subarray(t,e);return Object.setPrototypeOf(n,a.prototype),n},a.prototype.readUintLE=a.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);let n=this[t],i=1,o=0;for(;++o<e&&(i*=256);)n+=this[t+o]*i;return n},a.prototype.readUintBE=a.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);let n=this[t+--e],i=1;for(;e>0&&(i*=256);)n+=this[t+--e]*i;return n},a.prototype.readUint8=a.prototype.readUInt8=function(t,e){return t>>>=0,e||C(t,1,this.length),this[t]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(t,e){return t>>>=0,e||C(t,2,this.length),this[t]|this[t+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(t,e){return t>>>=0,e||C(t,2,this.length),this[t]<<8|this[t+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(t,e){return t>>>=0,e||C(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(t,e){return t>>>=0,e||C(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},a.prototype.readBigUInt64LE=X((function(t){F(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||G(t,this.length-8);const n=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,i=this[++t]+256*this[++t]+65536*this[++t]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))})),a.prototype.readBigUInt64BE=X((function(t){F(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||G(t,this.length-8);const n=e*2**24+65536*this[++t]+256*this[++t]+this[++t],i=this[++t]*2**24+65536*this[++t]+256*this[++t]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),a.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);let n=this[t],i=1,o=0;for(;++o<e&&(i*=256);)n+=this[t+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*e)),n},a.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);let n=e,i=1,o=this[t+--n];for(;n>0&&(i*=256);)o+=this[t+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},a.prototype.readInt8=function(t,e){return t>>>=0,e||C(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},a.prototype.readInt16LE=function(t,e){t>>>=0,e||C(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt16BE=function(t,e){t>>>=0,e||C(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt32LE=function(t,e){return t>>>=0,e||C(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},a.prototype.readInt32BE=function(t,e){return t>>>=0,e||C(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},a.prototype.readBigInt64LE=X((function(t){F(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||G(t,this.length-8);const n=this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+this[++t]*2**24)})),a.prototype.readBigInt64BE=X((function(t){F(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||G(t,this.length-8);const n=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(n)<<BigInt(32))+BigInt(this[++t]*2**24+65536*this[++t]+256*this[++t]+r)})),a.prototype.readFloatLE=function(t,e){return t>>>=0,e||C(t,4,this.length),i.read(this,t,!0,23,4)},a.prototype.readFloatBE=function(t,e){return t>>>=0,e||C(t,4,this.length),i.read(this,t,!1,23,4)},a.prototype.readDoubleLE=function(t,e){return t>>>=0,e||C(t,8,this.length),i.read(this,t,!0,52,8)},a.prototype.readDoubleBE=function(t,e){return t>>>=0,e||C(t,8,this.length),i.read(this,t,!1,52,8)},a.prototype.writeUintLE=a.prototype.writeUIntLE=function(t,e,r,n){if(t=+t,e>>>=0,r>>>=0,!n){T(this,t,e,r,Math.pow(2,8*r)-1,0)}let i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(t,e,r,n){if(t=+t,e>>>=0,r>>>=0,!n){T(this,t,e,r,Math.pow(2,8*r)-1,0)}let i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},a.prototype.writeUint8=a.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||T(this,t,e,1,255,0),this[e]=255&t,e+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||T(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||T(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||T(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||T(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},a.prototype.writeBigUInt64LE=X((function(t,e=0){return O(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),a.prototype.writeBigUInt64BE=X((function(t,e=0){return z(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),a.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);T(this,t,e,r,n-1,-n)}let i=0,o=1,s=0;for(this[e]=255&t;++i<r&&(o*=256);)t<0&&0===s&&0!==this[e+i-1]&&(s=1),this[e+i]=(t/o>>0)-s&255;return e+r},a.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);T(this,t,e,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[e+i]=255&t;--i>=0&&(o*=256);)t<0&&0===s&&0!==this[e+i+1]&&(s=1),this[e+i]=(t/o>>0)-s&255;return e+r},a.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||T(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},a.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||T(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},a.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||T(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},a.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||T(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},a.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||T(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},a.prototype.writeBigInt64LE=X((function(t,e=0){return O(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),a.prototype.writeBigInt64BE=X((function(t,e=0){return z(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),a.prototype.writeFloatLE=function(t,e,r){return U(this,t,e,!0,r)},a.prototype.writeFloatBE=function(t,e,r){return U(this,t,e,!1,r)},a.prototype.writeDoubleLE=function(t,e,r){return R(this,t,e,!0,r)},a.prototype.writeDoubleBE=function(t,e,r){return R(this,t,e,!1,r)},a.prototype.copy=function(t,e,r,n){if(!a.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);const i=n-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,n):Uint8Array.prototype.set.call(t,this.subarray(r,n),e),i},a.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!a.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){const e=t.charCodeAt(0);("utf8"===n&&e<128||"latin1"===n)&&(t=e)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;let i;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i<r;++i)this[i]=t;else{const o=a.isBuffer(t)?t:a.from(t,n),s=o.length;if(0===s)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(i=0;i<r-e;++i)this[i+e]=o[i%s]}return this};const Y={};function B(t,e,r){Y[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}function P(t){let e="",r=t.length;const n="-"===t[0]?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function Q(t,e,r,n,i,o){if(t>r||t<e){const n="bigint"==typeof e?"n":"";let i;throw i=o>3?0===e||e===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${e}${n} and <= ${r}${n}`,new Y.ERR_OUT_OF_RANGE("value",i,t)}!function(t,e,r){F(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||G(e,t.length-(r+1))}(n,i,o)}function F(t,e){if("number"!=typeof t)throw new Y.ERR_INVALID_ARG_TYPE(e,"number",t)}function G(t,e,r){if(Math.floor(t)!==t)throw F(t,r),new Y.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new Y.ERR_BUFFER_OUT_OF_BOUNDS;throw new Y.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}B("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),B("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),B("ERR_OUT_OF_RANGE",(function(t,e,r){let n=`The value of "${t}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=P(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=P(i)),i+="n"),n+=` It must be ${e}. Received ${i}`,n}),RangeError);const W=/[^+/0-9A-Za-z-_]/g;function q(t,e){let r;e=e||1/0;const n=t.length;let i=null;const o=[];for(let s=0;s<n;++s){if(r=t.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function H(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(W,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function J(t,e,r,n){let i;for(i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function Z(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function $(t){return t!=t}const V=function(){const t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)e[n+i]=t[r]+t[i]}return e}();function X(t){return"undefined"==typeof BigInt?K:t}function K(){throw new Error("BigInt not supported")}},93:(t,e,r)=>{var n=r(8196);t.exports=n},5362:(t,e,r)=>{var n=r(3383);t.exports=n},3536:(t,e,r)=>{var n=r(1910);t.exports=n},4493:(t,e,r)=>{r(7971),r(3242);var n=r(4058);t.exports=n.Array.from},4034:(t,e,r)=>{r(2737);var n=r(4058);t.exports=n.Array.isArray},5367:(t,e,r)=>{r(5906);var n=r(5703);t.exports=n("Array").concat},2710:(t,e,r)=>{r(6274),r(5967);var n=r(5703);t.exports=n("Array").entries},1459:(t,e,r)=>{r(8851);var n=r(5703);t.exports=n("Array").every},6172:(t,e,r)=>{r(290);var n=r(5703);t.exports=n("Array").fill},2383:(t,e,r)=>{r(1501);var n=r(5703);t.exports=n("Array").filter},9:(t,e,r)=>{r(4929);var n=r(5703);t.exports=n("Array").findIndex},7671:(t,e,r)=>{r(833);var n=r(5703);t.exports=n("Array").find},9324:(t,e,r)=>{r(2437);var n=r(5703);t.exports=n("Array").forEach},991:(t,e,r)=>{r(7690);var n=r(5703);t.exports=n("Array").includes},8700:(t,e,r)=>{r(9076);var n=r(5703);t.exports=n("Array").indexOf},5909:(t,e,r)=>{r(6274),r(5967);var n=r(5703);t.exports=n("Array").keys},3866:(t,e,r)=>{r(8787);var n=r(5703);t.exports=n("Array").map},2999:(t,e,r)=>{r(1876);var n=r(5703);t.exports=n("Array").reduce},4900:(t,e,r)=>{r(186);var n=r(5703);t.exports=n("Array").slice},3824:(t,e,r)=>{r(6026);var n=r(5703);t.exports=n("Array").some},2948:(t,e,r)=>{r(4115);var n=r(5703);t.exports=n("Array").sort},7700:(t,e,r)=>{r(3381);var n=r(5703);t.exports=n("Function").bind},6246:(t,e,r)=>{var n=r(7046),i=r(7700),o=Function.prototype;t.exports=function(t){var e=t.bind;return t===o||n(o,t)&&e===o.bind?i:e}},6043:(t,e,r)=>{var n=r(7046),i=r(5367),o=Array.prototype;t.exports=function(t){var e=t.concat;return t===o||n(o,t)&&e===o.concat?i:e}},3160:(t,e,r)=>{var n=r(7046),i=r(1459),o=Array.prototype;t.exports=function(t){var e=t.every;return t===o||n(o,t)&&e===o.every?i:e}},446:(t,e,r)=>{var n=r(7046),i=r(6172),o=Array.prototype;t.exports=function(t){var e=t.fill;return t===o||n(o,t)&&e===o.fill?i:e}},2480:(t,e,r)=>{var n=r(7046),i=r(2383),o=Array.prototype;t.exports=function(t){var e=t.filter;return t===o||n(o,t)&&e===o.filter?i:e}},7147:(t,e,r)=>{var n=r(7046),i=r(9),o=Array.prototype;t.exports=function(t){var e=t.findIndex;return t===o||n(o,t)&&e===o.findIndex?i:e}},2236:(t,e,r)=>{var n=r(7046),i=r(7671),o=Array.prototype;t.exports=function(t){var e=t.find;return t===o||n(o,t)&&e===o.find?i:e}},8557:(t,e,r)=>{var n=r(7046),i=r(991),o=r(1631),s=Array.prototype,u=String.prototype;t.exports=function(t){var e=t.includes;return t===s||n(s,t)&&e===s.includes?i:"string"==typeof t||t===u||n(u,t)&&e===u.includes?o:e}},4570:(t,e,r)=>{var n=r(7046),i=r(8700),o=Array.prototype;t.exports=function(t){var e=t.indexOf;return t===o||n(o,t)&&e===o.indexOf?i:e}},8287:(t,e,r)=>{var n=r(7046),i=r(3866),o=Array.prototype;t.exports=function(t){var e=t.map;return t===o||n(o,t)&&e===o.map?i:e}},8025:(t,e,r)=>{var n=r(7046),i=r(2999),o=Array.prototype;t.exports=function(t){var e=t.reduce;return t===o||n(o,t)&&e===o.reduce?i:e}},9601:(t,e,r)=>{var n=r(7046),i=r(4900),o=Array.prototype;t.exports=function(t){var e=t.slice;return t===o||n(o,t)&&e===o.slice?i:e}},8299:(t,e,r)=>{var n=r(7046),i=r(3824),o=Array.prototype;t.exports=function(t){var e=t.some;return t===o||n(o,t)&&e===o.some?i:e}},9355:(t,e,r)=>{var n=r(7046),i=r(2948),o=Array.prototype;t.exports=function(t){var e=t.sort;return t===o||n(o,t)&&e===o.sort?i:e}},1611:(t,e,r)=>{var n=r(7046),i=r(3269),o=String.prototype;t.exports=function(t){var e=t.startsWith;return"string"==typeof t||t===o||n(o,t)&&e===o.startsWith?i:e}},2774:(t,e,r)=>{var n=r(7046),i=r(3348),o=String.prototype;t.exports=function(t){var e=t.trim;return"string"==typeof t||t===o||n(o,t)&&e===o.trim?i:e}},4426:(t,e,r)=>{r(2619);var n=r(4058),i=r(9730);n.JSON||(n.JSON={stringify:JSON.stringify}),t.exports=function(t,e,r){return i(n.JSON.stringify,null,arguments)}},1018:(t,e,r)=>{r(6274),r(7501),r(5967),r(7971);var n=r(4058);t.exports=n.Map},5999:(t,e,r)=>{r(9221);var n=r(4058);t.exports=n.Object.assign},8171:(t,e,r)=>{r(6450);var n=r(4058).Object,i=t.exports=function(t,e,r){return n.defineProperty(t,e,r)};n.defineProperty.sham&&(i.sham=!0)},8494:(t,e,r)=>{r(1724);var n=r(4058);t.exports=n.Object.keys},1631:(t,e,r)=>{r(1035);var n=r(5703);t.exports=n("String").includes},3269:(t,e,r)=>{r(4761);var n=r(5703);t.exports=n("String").startsWith},3348:(t,e,r)=>{r(7398);var n=r(5703);t.exports=n("String").trim},4122:(t,e,r)=>{var n=r(93);t.exports=n},269:(t,e,r)=>{var n=r(5362);t.exports=n},3685:(t,e,r)=>{var n=r(3536);t.exports=n},4883:(t,e,r)=>{var n=r(1899),i=r(7475),o=r(9826),s=n.TypeError;t.exports=function(t){if(i(t))return t;throw s(o(t)+" is not a function")}},1851:(t,e,r)=>{var n=r(1899),i=r(7475),o=n.String,s=n.TypeError;t.exports=function(t){if("object"==typeof t||i(t))return t;throw s("Can't set "+o(t)+" as a prototype")}},8479:t=>{t.exports=function(){}},5743:(t,e,r)=>{var n=r(1899),i=r(7046),o=n.TypeError;t.exports=function(t,e){if(i(e,t))return t;throw o("Incorrect invocation")}},6059:(t,e,r)=>{var n=r(1899),i=r(941),o=n.String,s=n.TypeError;t.exports=function(t){if(i(t))return t;throw s(o(t)+" is not an object")}},7135:(t,e,r)=>{var n=r(5981);t.exports=n((function(){if("function"==typeof ArrayBuffer){var t=new ArrayBuffer(8);Object.isExtensible(t)&&Object.defineProperty(t,"a",{value:8})}}))},1860:(t,e,r)=>{"use strict";var n=r(9678),i=r(9413),o=r(623);t.exports=function(t){for(var e=n(this),r=o(e),s=arguments.length,u=i(s>1?arguments[1]:void 0,r),a=s>2?arguments[2]:void 0,c=void 0===a?r:i(a,r);c>u;)e[u++]=t;return e}},6837:(t,e,r)=>{"use strict";var n=r(3610).forEach,i=r(4194)("forEach");t.exports=i?[].forEach:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}},1354:(t,e,r)=>{"use strict";var n=r(1899),i=r(6843),o=r(8834),s=r(9678),u=r(5196),a=r(6782),c=r(4284),f=r(623),l=r(5449),h=r(3476),p=r(2902),d=n.Array;t.exports=function(t){var e=s(t),r=c(this),n=arguments.length,y=n>1?arguments[1]:void 0,g=void 0!==y;g&&(y=i(y,n>2?arguments[2]:void 0));var v,w,M,L,_,m,b=p(e),j=0;if(!b||this==d&&a(b))for(v=f(e),w=r?new this(v):d(v);v>j;j++)m=g?y(e[j],j):e[j],l(w,j,m);else for(_=(L=h(e,b)).next,w=r?new this:[];!(M=o(_,L)).done;j++)m=g?u(L,y,[M.value,j],!0):M.value,l(w,j,m);return w.length=j,w}},1692:(t,e,r)=>{var n=r(4529),i=r(9413),o=r(623),s=function(t){return function(e,r,s){var u,a=n(e),c=o(a),f=i(s,c);if(t&&r!=r){for(;c>f;)if((u=a[f++])!=u)return!0}else for(;c>f;f++)if((t||f in a)&&a[f]===r)return t||f||0;return!t&&-1}};t.exports={includes:s(!0),indexOf:s(!1)}},3610:(t,e,r)=>{var n=r(6843),i=r(5329),o=r(7026),s=r(9678),u=r(623),a=r(4692),c=i([].push),f=function(t){var e=1==t,r=2==t,i=3==t,f=4==t,l=6==t,h=7==t,p=5==t||l;return function(d,y,g,v){for(var w,M,L=s(d),_=o(L),m=n(y,g),b=u(_),j=0,x=v||a,N=e?x(d,b):r||h?x(d,0):void 0;b>j;j++)if((p||j in _)&&(M=m(w=_[j],j,L),t))if(e)N[j]=M;else if(M)switch(t){case 3:return!0;case 5:return w;case 6:return j;case 2:c(N,w)}else switch(t){case 4:return!1;case 7:c(N,w)}return l?-1:i||f?f:N}};t.exports={forEach:f(0),map:f(1),filter:f(2),some:f(3),every:f(4),find:f(5),findIndex:f(6),filterReject:f(7)}},568:(t,e,r)=>{var n=r(5981),i=r(9813),o=r(3385),s=i("species");t.exports=function(t){return o>=51||!n((function(){var e=[];return(e.constructor={})[s]=function(){return{foo:1}},1!==e[t](Boolean).foo}))}},4194:(t,e,r)=>{"use strict";var n=r(5981);t.exports=function(t,e){var r=[][t];return!!r&&n((function(){r.call(null,e||function(){throw 1},1)}))}},6499:(t,e,r)=>{var n=r(1899),i=r(4883),o=r(9678),s=r(7026),u=r(623),a=n.TypeError,c=function(t){return function(e,r,n,c){i(r);var f=o(e),l=s(f),h=u(f),p=t?h-1:0,d=t?-1:1;if(n<2)for(;;){if(p in l){c=l[p],p+=d;break}if(p+=d,t?p<0:h<=p)throw a("Reduce of empty array with no initial value")}for(;t?p>=0:h>p;p+=d)p in l&&(c=r(c,l[p],p,f));return c}};t.exports={left:c(!1),right:c(!0)}},5790:(t,e,r)=>{var n=r(1899),i=r(9413),o=r(623),s=r(5449),u=n.Array,a=Math.max;t.exports=function(t,e,r){for(var n=o(t),c=i(e,n),f=i(void 0===r?n:r,n),l=u(a(f-c,0)),h=0;c<f;c++,h++)s(l,h,t[c]);return l.length=h,l}},3765:(t,e,r)=>{var n=r(5329);t.exports=n([].slice)},1388:(t,e,r)=>{var n=r(5790),i=Math.floor,o=function(t,e){var r=t.length,a=i(r/2);return r<8?s(t,e):u(t,o(n(t,0,a),e),o(n(t,a),e),e)},s=function(t,e){for(var r,n,i=t.length,o=1;o<i;){for(n=o,r=t[o];n&&e(t[n-1],r)>0;)t[n]=t[--n];n!==o++&&(t[n]=r)}return t},u=function(t,e,r,n){for(var i=e.length,o=r.length,s=0,u=0;s<i||u<o;)t[s+u]=s<i&&u<o?n(e[s],r[u])<=0?e[s++]:r[u++]:s<i?e[s++]:r[u++];return t};t.exports=o},5693:(t,e,r)=>{var n=r(1899),i=r(1052),o=r(4284),s=r(941),u=r(9813)("species"),a=n.Array;t.exports=function(t){var e;return i(t)&&(e=t.constructor,(o(e)&&(e===a||i(e.prototype))||s(e)&&null===(e=e[u]))&&(e=void 0)),void 0===e?a:e}},4692:(t,e,r)=>{var n=r(5693);t.exports=function(t,e){return new(n(t))(0===e?0:e)}},5196:(t,e,r)=>{var n=r(6059),i=r(7609);t.exports=function(t,e,r,o){try{return o?e(n(r)[0],r[1]):e(r)}catch(e){i(t,"throw",e)}}},1385:(t,e,r)=>{var n=r(9813)("iterator"),i=!1;try{var o=0,s={next:function(){return{done:!!o++}},return:function(){i=!0}};s[n]=function(){return this},Array.from(s,(function(){throw 2}))}catch(t){}t.exports=function(t,e){if(!e&&!i)return!1;var r=!1;try{var o={};o[n]=function(){return{next:function(){return{done:r=!0}}}},t(o)}catch(t){}return r}},2532:(t,e,r)=>{var n=r(5329),i=n({}.toString),o=n("".slice);t.exports=function(t){return o(i(t),8,-1)}},9697:(t,e,r)=>{var n=r(1899),i=r(2885),o=r(7475),s=r(2532),u=r(9813)("toStringTag"),a=n.Object,c="Arguments"==s(function(){return arguments}());t.exports=i?s:function(t){var e,r,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(e=a(t),u))?r:c?s(e):"Object"==(n=s(e))&&o(e.callee)?"Arguments":n}},5616:(t,e,r)=>{"use strict";var n=r(5988).f,i=r(9290),o=r(7524),s=r(6843),u=r(5743),a=r(3091),c=r(7771),f=r(4431),l=r(5746),h=r(1647).fastKey,p=r(5402),d=p.set,y=p.getterFor;t.exports={getConstructor:function(t,e,r,c){var f=t((function(t,n){u(t,p),d(t,{type:e,index:i(null),first:void 0,last:void 0,size:0}),l||(t.size=0),null!=n&&a(n,t[c],{that:t,AS_ENTRIES:r})})),p=f.prototype,g=y(e),v=function(t,e,r){var n,i,o=g(t),s=w(t,e);return s?s.value=r:(o.last=s={index:i=h(e,!0),key:e,value:r,previous:n=o.last,next:void 0,removed:!1},o.first||(o.first=s),n&&(n.next=s),l?o.size++:t.size++,"F"!==i&&(o.index[i]=s)),t},w=function(t,e){var r,n=g(t),i=h(e);if("F"!==i)return n.index[i];for(r=n.first;r;r=r.next)if(r.key==e)return r};return o(p,{clear:function(){for(var t=g(this),e=t.index,r=t.first;r;)r.removed=!0,r.previous&&(r.previous=r.previous.next=void 0),delete e[r.index],r=r.next;t.first=t.last=void 0,l?t.size=0:this.size=0},delete:function(t){var e=this,r=g(e),n=w(e,t);if(n){var i=n.next,o=n.previous;delete r.index[n.index],n.removed=!0,o&&(o.next=i),i&&(i.previous=o),r.first==n&&(r.first=i),r.last==n&&(r.last=o),l?r.size--:e.size--}return!!n},forEach:function(t){for(var e,r=g(this),n=s(t,arguments.length>1?arguments[1]:void 0);e=e?e.next:r.first;)for(n(e.value,e.key,this);e&&e.removed;)e=e.previous},has:function(t){return!!w(this,t)}}),o(p,r?{get:function(t){var e=w(this,t);return e&&e.value},set:function(t,e){return v(this,0===t?0:t,e)}}:{add:function(t){return v(this,t=0===t?0:t,t)}}),l&&n(p,"size",{get:function(){return g(this).size}}),f},setStrong:function(t,e,r){var n=e+" Iterator",i=y(e),o=y(n);c(t,e,(function(t,e){d(this,{type:n,target:t,state:i(t),kind:e,last:void 0})}),(function(){for(var t=o(this),e=t.kind,r=t.last;r&&r.removed;)r=r.previous;return t.target&&(t.last=r=r?r.next:t.state.first)?"keys"==e?{value:r.key,done:!1}:"values"==e?{value:r.value,done:!1}:{value:[r.key,r.value],done:!1}:(t.target=void 0,{value:void 0,done:!0})}),r?"entries":"values",!r,!0),f(e)}}},4683:(t,e,r)=>{"use strict";var n=r(6887),i=r(1899),o=r(1647),s=r(5981),u=r(2029),a=r(3091),c=r(5743),f=r(7475),l=r(941),h=r(904),p=r(5988).f,d=r(3610).forEach,y=r(5746),g=r(5402),v=g.set,w=g.getterFor;t.exports=function(t,e,r){var g,M=-1!==t.indexOf("Map"),L=-1!==t.indexOf("Weak"),_=M?"set":"add",m=i[t],b=m&&m.prototype,j={};if(y&&f(m)&&(L||b.forEach&&!s((function(){(new m).entries().next()})))){var x=(g=e((function(e,r){v(c(e,x),{type:t,collection:new m}),null!=r&&a(r,e[_],{that:e,AS_ENTRIES:M})}))).prototype,N=w(t);d(["add","clear","delete","forEach","get","has","set","keys","values","entries"],(function(t){var e="add"==t||"set"==t;!(t in b)||L&&"clear"==t||u(x,t,(function(r,n){var i=N(this).collection;if(!e&&L&&!l(r))return"get"==t&&void 0;var o=i[t](0===r?0:r,n);return e?this:o}))})),L||p(x,"size",{configurable:!0,get:function(){return N(this).collection.size}})}else g=r.getConstructor(e,t,M,_),o.enable();return h(g,t,!1,!0),j[t]=g,n({global:!0,forced:!0},j),L||r.setStrong(g,t,M),g}},7772:(t,e,r)=>{var n=r(9813)("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(r){try{return e[n]=!1,"/./"[t](e)}catch(t){}}return!1}},4160:(t,e,r)=>{var n=r(5981);t.exports=!n((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))},1046:(t,e,r)=>{"use strict";var n=r(5143).IteratorPrototype,i=r(9290),o=r(1887),s=r(904),u=r(2077),a=function(){return this};t.exports=function(t,e,r,c){var f=e+" Iterator";return t.prototype=i(n,{next:o(+!c,r)}),s(t,f,!1,!0),u[f]=a,t}},2029:(t,e,r)=>{var n=r(5746),i=r(5988),o=r(1887);t.exports=n?function(t,e,r){return i.f(t,e,o(1,r))}:function(t,e,r){return t[e]=r,t}},1887:t=>{t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},5449:(t,e,r)=>{"use strict";var n=r(3894),i=r(5988),o=r(1887);t.exports=function(t,e,r){var s=n(e);s in t?i.f(t,s,o(0,r)):t[s]=r}},7771:(t,e,r)=>{"use strict";var n=r(6887),i=r(8834),o=r(2529),s=r(9417),u=r(7475),a=r(1046),c=r(249),f=r(8929),l=r(904),h=r(2029),p=r(9754),d=r(9813),y=r(2077),g=r(5143),v=s.PROPER,w=s.CONFIGURABLE,M=g.IteratorPrototype,L=g.BUGGY_SAFARI_ITERATORS,_=d("iterator"),m="keys",b="values",j="entries",x=function(){return this};t.exports=function(t,e,r,s,d,g,N){a(r,e,s);var S,D,I,E=function(t){if(t===d&&z)return z;if(!L&&t in T)return T[t];switch(t){case m:case b:case j:return function(){return new r(this,t)}}return function(){return new r(this)}},A=e+" Iterator",C=!1,T=t.prototype,O=T[_]||T["@@iterator"]||d&&T[d],z=!L&&O||E(d),k="Array"==e&&T.entries||O;if(k&&(S=c(k.call(new t)))!==Object.prototype&&S.next&&(o||c(S)===M||(f?f(S,M):u(S[_])||p(S,_,x)),l(S,A,!0,!0),o&&(y[A]=x)),v&&d==b&&O&&O.name!==b&&(!o&&w?h(T,"name",b):(C=!0,z=function(){return i(O,this)})),d)if(D={values:E(b),keys:g?z:E(m),entries:E(j)},N)for(I in D)(L||C||!(I in T))&&p(T,I,D[I]);else n({target:e,proto:!0,forced:L||C},D);return o&&!N||T[_]===z||p(T,_,z,{name:d}),y[e]=z,D}},5746:(t,e,r)=>{var n=r(5981);t.exports=!n((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},1333:(t,e,r)=>{var n=r(1899),i=r(941),o=n.document,s=i(o)&&i(o.createElement);t.exports=function(t){return s?o.createElement(t):{}}},3281:t=>{t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},4342:(t,e,r)=>{var n=r(2861).match(/firefox\/(\d+)/i);t.exports=!!n&&+n[1]},7797:(t,e,r)=>{var n=r(2861);t.exports=/MSIE|Trident/.test(n)},6049:(t,e,r)=>{var n=r(2532),i=r(1899);t.exports="process"==n(i.process)},2861:(t,e,r)=>{var n=r(626);t.exports=n("navigator","userAgent")||""},3385:(t,e,r)=>{var n,i,o=r(1899),s=r(2861),u=o.process,a=o.Deno,c=u&&u.versions||a&&a.version,f=c&&c.v8;f&&(i=(n=f.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!i&&s&&(!(n=s.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=s.match(/Chrome\/(\d+)/))&&(i=+n[1]),t.exports=i},8938:(t,e,r)=>{var n=r(2861).match(/AppleWebKit\/(\d+)\./);t.exports=!!n&&+n[1]},5703:(t,e,r)=>{var n=r(4058);t.exports=function(t){return n[t+"Prototype"]}},6759:t=>{t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},6887:(t,e,r)=>{"use strict";var n=r(1899),i=r(9730),o=r(5329),s=r(7475),u=r(9677).f,a=r(7252),c=r(4058),f=r(6843),l=r(2029),h=r(953),p=function(t){var e=function(r,n,o){if(this instanceof e){switch(arguments.length){case 0:return new t;case 1:return new t(r);case 2:return new t(r,n)}return new t(r,n,o)}return i(t,this,arguments)};return e.prototype=t.prototype,e};t.exports=function(t,e){var r,i,d,y,g,v,w,M,L=t.target,_=t.global,m=t.stat,b=t.proto,j=_?n:m?n[L]:(n[L]||{}).prototype,x=_?c:c[L]||l(c,L,{})[L],N=x.prototype;for(d in e)r=!a(_?d:L+(m?".":"#")+d,t.forced)&&j&&h(j,d),g=x[d],r&&(v=t.noTargetGet?(M=u(j,d))&&M.value:j[d]),y=r&&v?v:e[d],r&&typeof g==typeof y||(w=t.bind&&r?f(y,n):t.wrap&&r?p(y):b&&s(y)?o(y):y,(t.sham||y&&y.sham||g&&g.sham)&&l(w,"sham",!0),l(x,d,w),b&&(h(c,i=L+"Prototype")||l(c,i,{}),l(c[i],d,y),t.real&&N&&!N[d]&&l(N,d,y)))}},5981:t=>{t.exports=function(t){try{return!!t()}catch(t){return!0}}},5602:(t,e,r)=>{var n=r(5981);t.exports=!n((function(){return Object.isExtensible(Object.preventExtensions({}))}))},9730:(t,e,r)=>{var n=r(8285),i=Function.prototype,o=i.apply,s=i.call;t.exports="object"==typeof Reflect&&Reflect.apply||(n?s.bind(o):function(){return s.apply(o,arguments)})},6843:(t,e,r)=>{var n=r(5329),i=r(4883),o=r(8285),s=n(n.bind);t.exports=function(t,e){return i(t),void 0===e?t:o?s(t,e):function(){return t.apply(e,arguments)}}},8285:(t,e,r)=>{var n=r(5981);t.exports=!n((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},8308:(t,e,r)=>{"use strict";var n=r(1899),i=r(5329),o=r(4883),s=r(941),u=r(953),a=r(3765),c=r(8285),f=n.Function,l=i([].concat),h=i([].join),p={},d=function(t,e,r){if(!u(p,e)){for(var n=[],i=0;i<e;i++)n[i]="a["+i+"]";p[e]=f("C,a","return new C("+h(n,",")+")")}return p[e](t,r)};t.exports=c?f.bind:function(t){var e=o(this),r=e.prototype,n=a(arguments,1),i=function(){var r=l(n,a(arguments));return this instanceof i?d(e,r.length,r):e.apply(t,r)};return s(r)&&(i.prototype=r),i}},8834:(t,e,r)=>{var n=r(8285),i=Function.prototype.call;t.exports=n?i.bind(i):function(){return i.apply(i,arguments)}},9417:(t,e,r)=>{var n=r(5746),i=r(953),o=Function.prototype,s=n&&Object.getOwnPropertyDescriptor,u=i(o,"name"),a=u&&"something"===function(){}.name,c=u&&(!n||n&&s(o,"name").configurable);t.exports={EXISTS:u,PROPER:a,CONFIGURABLE:c}},5329:(t,e,r)=>{var n=r(8285),i=Function.prototype,o=i.bind,s=i.call,u=n&&o.bind(s,s);t.exports=n?function(t){return t&&u(t)}:function(t){return t&&function(){return s.apply(t,arguments)}}},626:(t,e,r)=>{var n=r(4058),i=r(1899),o=r(7475),s=function(t){return o(t)?t:void 0};t.exports=function(t,e){return arguments.length<2?s(n[t])||s(i[t]):n[t]&&n[t][e]||i[t]&&i[t][e]}},2902:(t,e,r)=>{var n=r(9697),i=r(4229),o=r(2077),s=r(9813)("iterator");t.exports=function(t){if(null!=t)return i(t,s)||i(t,"@@iterator")||o[n(t)]}},3476:(t,e,r)=>{var n=r(1899),i=r(8834),o=r(4883),s=r(6059),u=r(9826),a=r(2902),c=n.TypeError;t.exports=function(t,e){var r=arguments.length<2?a(t):e;if(o(r))return s(i(r,t));throw c(u(t)+" is not iterable")}},4229:(t,e,r)=>{var n=r(4883);t.exports=function(t,e){var r=t[e];return null==r?void 0:n(r)}},1899:(t,e,r)=>{var n=function(t){return t&&t.Math==Math&&t};t.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof r.g&&r.g)||function(){return this}()||Function("return this")()},953:(t,e,r)=>{var n=r(5329),i=r(9678),o=n({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,e){return o(i(t),e)}},7748:t=>{t.exports={}},5463:(t,e,r)=>{var n=r(626);t.exports=n("document","documentElement")},2840:(t,e,r)=>{var n=r(5746),i=r(5981),o=r(1333);t.exports=!n&&!i((function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},7026:(t,e,r)=>{var n=r(1899),i=r(5329),o=r(5981),s=r(2532),u=n.Object,a=i("".split);t.exports=o((function(){return!u("z").propertyIsEnumerable(0)}))?function(t){return"String"==s(t)?a(t,""):u(t)}:u},1302:(t,e,r)=>{var n=r(5329),i=r(7475),o=r(3030),s=n(Function.toString);i(o.inspectSource)||(o.inspectSource=function(t){return s(t)}),t.exports=o.inspectSource},1647:(t,e,r)=>{var n=r(6887),i=r(5329),o=r(7748),s=r(941),u=r(953),a=r(5988).f,c=r(946),f=r(684),l=r(1584),h=r(9418),p=r(5602),d=!1,y=h("meta"),g=0,v=function(t){a(t,y,{value:{objectID:"O"+g++,weakData:{}}})},w=t.exports={enable:function(){w.enable=function(){},d=!0;var t=c.f,e=i([].splice),r={};r[y]=1,t(r).length&&(c.f=function(r){for(var n=t(r),i=0,o=n.length;i<o;i++)if(n[i]===y){e(n,i,1);break}return n},n({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:f.f}))},fastKey:function(t,e){if(!s(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!u(t,y)){if(!l(t))return"F";if(!e)return"E";v(t)}return t[y].objectID},getWeakData:function(t,e){if(!u(t,y)){if(!l(t))return!0;if(!e)return!1;v(t)}return t[y].weakData},onFreeze:function(t){return p&&d&&l(t)&&!u(t,y)&&v(t),t}};o[y]=!0},5402:(t,e,r)=>{var n,i,o,s=r(8019),u=r(1899),a=r(5329),c=r(941),f=r(2029),l=r(953),h=r(3030),p=r(4262),d=r(7748),y="Object already initialized",g=u.TypeError,v=u.WeakMap;if(s||h.state){var w=h.state||(h.state=new v),M=a(w.get),L=a(w.has),_=a(w.set);n=function(t,e){if(L(w,t))throw new g(y);return e.facade=t,_(w,t,e),e},i=function(t){return M(w,t)||{}},o=function(t){return L(w,t)}}else{var m=p("state");d[m]=!0,n=function(t,e){if(l(t,m))throw new g(y);return e.facade=t,f(t,m,e),e},i=function(t){return l(t,m)?t[m]:{}},o=function(t){return l(t,m)}}t.exports={set:n,get:i,has:o,enforce:function(t){return o(t)?i(t):n(t,{})},getterFor:function(t){return function(e){var r;if(!c(e)||(r=i(e)).type!==t)throw g("Incompatible receiver, "+t+" required");return r}}}},6782:(t,e,r)=>{var n=r(9813),i=r(2077),o=n("iterator"),s=Array.prototype;t.exports=function(t){return void 0!==t&&(i.Array===t||s[o]===t)}},1052:(t,e,r)=>{var n=r(2532);t.exports=Array.isArray||function(t){return"Array"==n(t)}},7475:t=>{t.exports=function(t){return"function"==typeof t}},4284:(t,e,r)=>{var n=r(5329),i=r(5981),o=r(7475),s=r(9697),u=r(626),a=r(1302),c=function(){},f=[],l=u("Reflect","construct"),h=/^\s*(?:class|function)\b/,p=n(h.exec),d=!h.exec(c),y=function(t){if(!o(t))return!1;try{return l(c,f,t),!0}catch(t){return!1}},g=function(t){if(!o(t))return!1;switch(s(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return d||!!p(h,a(t))}catch(t){return!0}};g.sham=!0,t.exports=!l||i((function(){var t;return y(y.call)||!y(Object)||!y((function(){t=!0}))||t}))?g:y},7252:(t,e,r)=>{var n=r(5981),i=r(7475),o=/#|\.prototype\./,s=function(t,e){var r=a[u(t)];return r==f||r!=c&&(i(e)?n(e):!!e)},u=s.normalize=function(t){return String(t).replace(o,".").toLowerCase()},a=s.data={},c=s.NATIVE="N",f=s.POLYFILL="P";t.exports=s},941:(t,e,r)=>{var n=r(7475);t.exports=function(t){return"object"==typeof t?null!==t:n(t)}},2529:t=>{t.exports=!0},685:(t,e,r)=>{var n=r(941),i=r(2532),o=r(9813)("match");t.exports=function(t){var e;return n(t)&&(void 0!==(e=t[o])?!!e:"RegExp"==i(t))}},6664:(t,e,r)=>{var n=r(1899),i=r(626),o=r(7475),s=r(7046),u=r(2302),a=n.Object;t.exports=u?function(t){return"symbol"==typeof t}:function(t){var e=i("Symbol");return o(e)&&s(e.prototype,a(t))}},3091:(t,e,r)=>{var n=r(1899),i=r(6843),o=r(8834),s=r(6059),u=r(9826),a=r(6782),c=r(623),f=r(7046),l=r(3476),h=r(2902),p=r(7609),d=n.TypeError,y=function(t,e){this.stopped=t,this.result=e},g=y.prototype;t.exports=function(t,e,r){var n,v,w,M,L,_,m,b=r&&r.that,j=!(!r||!r.AS_ENTRIES),x=!(!r||!r.IS_ITERATOR),N=!(!r||!r.INTERRUPTED),S=i(e,b),D=function(t){return n&&p(n,"normal",t),new y(!0,t)},I=function(t){return j?(s(t),N?S(t[0],t[1],D):S(t[0],t[1])):N?S(t,D):S(t)};if(x)n=t;else{if(!(v=h(t)))throw d(u(t)+" is not iterable");if(a(v)){for(w=0,M=c(t);M>w;w++)if((L=I(t[w]))&&f(g,L))return L;return new y(!1)}n=l(t,v)}for(_=n.next;!(m=o(_,n)).done;){try{L=I(m.value)}catch(t){p(n,"throw",t)}if("object"==typeof L&&L&&f(g,L))return L}return new y(!1)}},7609:(t,e,r)=>{var n=r(8834),i=r(6059),o=r(4229);t.exports=function(t,e,r){var s,u;i(t);try{if(!(s=o(t,"return"))){if("throw"===e)throw r;return r}s=n(s,t)}catch(t){u=!0,s=t}if("throw"===e)throw r;if(u)throw s;return i(s),r}},5143:(t,e,r)=>{"use strict";var n,i,o,s=r(5981),u=r(7475),a=r(9290),c=r(249),f=r(9754),l=r(9813),h=r(2529),p=l("iterator"),d=!1;[].keys&&("next"in(o=[].keys())?(i=c(c(o)))!==Object.prototype&&(n=i):d=!0),null==n||s((function(){var t={};return n[p].call(t)!==t}))?n={}:h&&(n=a(n)),u(n[p])||f(n,p,(function(){return this})),t.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:d}},2077:t=>{t.exports={}},623:(t,e,r)=>{var n=r(3057);t.exports=function(t){return n(t.length)}},2497:(t,e,r)=>{var n=r(3385),i=r(5981);t.exports=!!Object.getOwnPropertySymbols&&!i((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},8019:(t,e,r)=>{var n=r(1899),i=r(7475),o=r(1302),s=n.WeakMap;t.exports=i(s)&&/native code/.test(o(s))},344:(t,e,r)=>{var n=r(1899),i=r(685),o=n.TypeError;t.exports=function(t){if(i(t))throw o("The method doesn't accept regular expressions");return t}},4420:(t,e,r)=>{"use strict";var n=r(5746),i=r(5329),o=r(8834),s=r(5981),u=r(4771),a=r(7857),c=r(6760),f=r(9678),l=r(7026),h=Object.assign,p=Object.defineProperty,d=i([].concat);t.exports=!h||s((function(){if(n&&1!==h({b:1},h(p({},"a",{enumerable:!0,get:function(){p(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},r=Symbol(),i="abcdefghijklmnopqrst";return t[r]=7,i.split("").forEach((function(t){e[t]=t})),7!=h({},t)[r]||u(h({},e)).join("")!=i}))?function(t,e){for(var r=f(t),i=arguments.length,s=1,h=a.f,p=c.f;i>s;)for(var y,g=l(arguments[s++]),v=h?d(u(g),h(g)):u(g),w=v.length,M=0;w>M;)y=v[M++],n&&!o(p,g,y)||(r[y]=g[y]);return r}:h},9290:(t,e,r)=>{var n,i=r(6059),o=r(9938),s=r(6759),u=r(7748),a=r(5463),c=r(1333),f=r(4262),l=f("IE_PROTO"),h=function(){},p=function(t){return"<script>"+t+"</"+"script>"},d=function(t){t.write(p("")),t.close();var e=t.parentWindow.Object;return t=null,e},y=function(){try{n=new ActiveXObject("htmlfile")}catch(t){}var t,e;y="undefined"!=typeof document?document.domain&&n?d(n):((e=c("iframe")).style.display="none",a.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(p("document.F=Object")),t.close(),t.F):d(n);for(var r=s.length;r--;)delete y.prototype[s[r]];return y()};u[l]=!0,t.exports=Object.create||function(t,e){var r;return null!==t?(h.prototype=i(t),r=new h,h.prototype=null,r[l]=t):r=y(),void 0===e?r:o.f(r,e)}},9938:(t,e,r)=>{var n=r(5746),i=r(3937),o=r(5988),s=r(6059),u=r(4529),a=r(4771);e.f=n&&!i?Object.defineProperties:function(t,e){s(t);for(var r,n=u(e),i=a(e),c=i.length,f=0;c>f;)o.f(t,r=i[f++],n[r]);return t}},5988:(t,e,r)=>{var n=r(1899),i=r(5746),o=r(2840),s=r(3937),u=r(6059),a=r(3894),c=n.TypeError,f=Object.defineProperty,l=Object.getOwnPropertyDescriptor,h="enumerable",p="configurable",d="writable";e.f=i?s?function(t,e,r){if(u(t),e=a(e),u(r),"function"==typeof t&&"prototype"===e&&"value"in r&&d in r&&!r.writable){var n=l(t,e);n&&n.writable&&(t[e]=r.value,r={configurable:p in r?r.configurable:n.configurable,enumerable:h in r?r.enumerable:n.enumerable,writable:!1})}return f(t,e,r)}:f:function(t,e,r){if(u(t),e=a(e),u(r),o)try{return f(t,e,r)}catch(t){}if("get"in r||"set"in r)throw c("Accessors not supported");return"value"in r&&(t[e]=r.value),t}},9677:(t,e,r)=>{var n=r(5746),i=r(8834),o=r(6760),s=r(1887),u=r(4529),a=r(3894),c=r(953),f=r(2840),l=Object.getOwnPropertyDescriptor;e.f=n?l:function(t,e){if(t=u(t),e=a(e),f)try{return l(t,e)}catch(t){}if(c(t,e))return s(!i(o.f,t,e),t[e])}},684:(t,e,r)=>{var n=r(2532),i=r(4529),o=r(946).f,s=r(5790),u="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(t){return u&&"Window"==n(t)?function(t){try{return o(t)}catch(t){return s(u)}}(t):o(i(t))}},946:(t,e,r)=>{var n=r(5629),i=r(6759).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return n(t,i)}},7857:(t,e)=>{e.f=Object.getOwnPropertySymbols},249:(t,e,r)=>{var n=r(1899),i=r(953),o=r(7475),s=r(9678),u=r(4262),a=r(4160),c=u("IE_PROTO"),f=n.Object,l=f.prototype;t.exports=a?f.getPrototypeOf:function(t){var e=s(t);if(i(e,c))return e[c];var r=e.constructor;return o(r)&&e instanceof r?r.prototype:e instanceof f?l:null}},1584:(t,e,r)=>{var n=r(5981),i=r(941),o=r(2532),s=r(7135),u=Object.isExtensible,a=n((function(){u(1)}));t.exports=a||s?function(t){return!!i(t)&&((!s||"ArrayBuffer"!=o(t))&&(!u||u(t)))}:u},7046:(t,e,r)=>{var n=r(5329);t.exports=n({}.isPrototypeOf)},5629:(t,e,r)=>{var n=r(5329),i=r(953),o=r(4529),s=r(1692).indexOf,u=r(7748),a=n([].push);t.exports=function(t,e){var r,n=o(t),c=0,f=[];for(r in n)!i(u,r)&&i(n,r)&&a(f,r);for(;e.length>c;)i(n,r=e[c++])&&(~s(f,r)||a(f,r));return f}},4771:(t,e,r)=>{var n=r(5629),i=r(6759);t.exports=Object.keys||function(t){return n(t,i)}},6760:(t,e)=>{"use strict";var r={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,i=n&&!r.call({1:2},1);e.f=i?function(t){var e=n(this,t);return!!e&&e.enumerable}:r},8929:(t,e,r)=>{var n=r(5329),i=r(6059),o=r(1851);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,r={};try{(t=n(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(r,[]),e=r instanceof Array}catch(t){}return function(r,n){return i(r),o(n),e?t(r,n):r.__proto__=n,r}}():void 0)},5623:(t,e,r)=>{"use strict";var n=r(2885),i=r(9697);t.exports=n?{}.toString:function(){return"[object "+i(this)+"]"}},9811:(t,e,r)=>{var n=r(1899),i=r(8834),o=r(7475),s=r(941),u=n.TypeError;t.exports=function(t,e){var r,n;if("string"===e&&o(r=t.toString)&&!s(n=i(r,t)))return n;if(o(r=t.valueOf)&&!s(n=i(r,t)))return n;if("string"!==e&&o(r=t.toString)&&!s(n=i(r,t)))return n;throw u("Can't convert object to primitive value")}},4058:t=>{t.exports={}},7524:(t,e,r)=>{var n=r(9754);t.exports=function(t,e,r){for(var i in e)r&&r.unsafe&&t[i]?t[i]=e[i]:n(t,i,e[i],r);return t}},9754:(t,e,r)=>{var n=r(2029);t.exports=function(t,e,r,i){i&&i.enumerable?t[e]=r:n(t,e,r)}},8219:(t,e,r)=>{var n=r(1899).TypeError;t.exports=function(t){if(null==t)throw n("Can't call method on "+t);return t}},4911:(t,e,r)=>{var n=r(1899),i=Object.defineProperty;t.exports=function(t,e){try{i(n,t,{value:e,configurable:!0,writable:!0})}catch(r){n[t]=e}return e}},4431:(t,e,r)=>{"use strict";var n=r(626),i=r(5988),o=r(9813),s=r(5746),u=o("species");t.exports=function(t){var e=n(t),r=i.f;s&&e&&!e[u]&&r(e,u,{configurable:!0,get:function(){return this}})}},904:(t,e,r)=>{var n=r(2885),i=r(5988).f,o=r(2029),s=r(953),u=r(5623),a=r(9813)("toStringTag");t.exports=function(t,e,r,c){if(t){var f=r?t:t.prototype;s(f,a)||i(f,a,{configurable:!0,value:e}),c&&!n&&o(f,"toString",u)}}},4262:(t,e,r)=>{var n=r(8726),i=r(9418),o=n("keys");t.exports=function(t){return o[t]||(o[t]=i(t))}},3030:(t,e,r)=>{var n=r(1899),i=r(4911),o="__core-js_shared__",s=n[o]||i(o,{});t.exports=s},8726:(t,e,r)=>{var n=r(2529),i=r(3030);(t.exports=function(t,e){return i[t]||(i[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.20.3",mode:n?"pure":"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.20.3/LICENSE",source:"https://github.com/zloirock/core-js"})},4620:(t,e,r)=>{var n=r(5329),i=r(2435),o=r(5803),s=r(8219),u=n("".charAt),a=n("".charCodeAt),c=n("".slice),f=function(t){return function(e,r){var n,f,l=o(s(e)),h=i(r),p=l.length;return h<0||h>=p?t?"":void 0:(n=a(l,h))<55296||n>56319||h+1===p||(f=a(l,h+1))<56320||f>57343?t?u(l,h):n:t?c(l,h,h+2):f-56320+(n-55296<<10)+65536}};t.exports={codeAt:f(!1),charAt:f(!0)}},3093:(t,e,r)=>{var n=r(9417).PROPER,i=r(5981),o=r(3483);t.exports=function(t){return i((function(){return!!o[t]()||"​᠎"!=="​᠎"[t]()||n&&o[t].name!==t}))}},4853:(t,e,r)=>{var n=r(5329),i=r(8219),o=r(5803),s=r(3483),u=n("".replace),a="["+s+"]",c=RegExp("^"+a+a+"*"),f=RegExp(a+a+"*$"),l=function(t){return function(e){var r=o(i(e));return 1&t&&(r=u(r,c,"")),2&t&&(r=u(r,f,"")),r}};t.exports={start:l(1),end:l(2),trim:l(3)}},9413:(t,e,r)=>{var n=r(2435),i=Math.max,o=Math.min;t.exports=function(t,e){var r=n(t);return r<0?i(r+e,0):o(r,e)}},4529:(t,e,r)=>{var n=r(7026),i=r(8219);t.exports=function(t){return n(i(t))}},2435:t=>{var e=Math.ceil,r=Math.floor;t.exports=function(t){var n=+t;return n!=n||0===n?0:(n>0?r:e)(n)}},3057:(t,e,r)=>{var n=r(2435),i=Math.min;t.exports=function(t){return t>0?i(n(t),9007199254740991):0}},9678:(t,e,r)=>{var n=r(1899),i=r(8219),o=n.Object;t.exports=function(t){return o(i(t))}},6935:(t,e,r)=>{var n=r(1899),i=r(8834),o=r(941),s=r(6664),u=r(4229),a=r(9811),c=r(9813),f=n.TypeError,l=c("toPrimitive");t.exports=function(t,e){if(!o(t)||s(t))return t;var r,n=u(t,l);if(n){if(void 0===e&&(e="default"),r=i(n,t,e),!o(r)||s(r))return r;throw f("Can't convert object to primitive value")}return void 0===e&&(e="number"),a(t,e)}},3894:(t,e,r)=>{var n=r(6935),i=r(6664);t.exports=function(t){var e=n(t,"string");return i(e)?e:e+""}},2885:(t,e,r)=>{var n={};n[r(9813)("toStringTag")]="z",t.exports="[object z]"===String(n)},5803:(t,e,r)=>{var n=r(1899),i=r(9697),o=n.String;t.exports=function(t){if("Symbol"===i(t))throw TypeError("Cannot convert a Symbol value to a string");return o(t)}},9826:(t,e,r)=>{var n=r(1899).String;t.exports=function(t){try{return n(t)}catch(t){return"Object"}}},9418:(t,e,r)=>{var n=r(5329),i=0,o=Math.random(),s=n(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+s(++i+o,36)}},2302:(t,e,r)=>{var n=r(2497);t.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},3937:(t,e,r)=>{var n=r(5746),i=r(5981);t.exports=n&&i((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},9813:(t,e,r)=>{var n=r(1899),i=r(8726),o=r(953),s=r(9418),u=r(2497),a=r(2302),c=i("wks"),f=n.Symbol,l=f&&f.for,h=a?f:f&&f.withoutSetter||s;t.exports=function(t){if(!o(c,t)||!u&&"string"!=typeof c[t]){var e="Symbol."+t;u&&o(f,t)?c[t]=f[t]:c[t]=a&&l?l(e):h(e)}return c[t]}},3483:t=>{t.exports="\t\n\v\f\r                　\u2028\u2029\ufeff"},5906:(t,e,r)=>{"use strict";var n=r(6887),i=r(1899),o=r(5981),s=r(1052),u=r(941),a=r(9678),c=r(623),f=r(5449),l=r(4692),h=r(568),p=r(9813),d=r(3385),y=p("isConcatSpreadable"),g=9007199254740991,v="Maximum allowed index exceeded",w=i.TypeError,M=d>=51||!o((function(){var t=[];return t[y]=!1,t.concat()[0]!==t})),L=h("concat"),_=function(t){if(!u(t))return!1;var e=t[y];return void 0!==e?!!e:s(t)};n({target:"Array",proto:!0,forced:!M||!L},{concat:function(t){var e,r,n,i,o,s=a(this),u=l(s,0),h=0;for(e=-1,n=arguments.length;e<n;e++)if(_(o=-1===e?s:arguments[e])){if(h+(i=c(o))>g)throw w(v);for(r=0;r<i;r++,h++)r in o&&f(u,h,o[r])}else{if(h>=g)throw w(v);f(u,h++,o)}return u.length=h,u}})},8851:(t,e,r)=>{"use strict";var n=r(6887),i=r(3610).every;n({target:"Array",proto:!0,forced:!r(4194)("every")},{every:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}})},290:(t,e,r)=>{var n=r(6887),i=r(1860),o=r(8479);n({target:"Array",proto:!0},{fill:i}),o("fill")},1501:(t,e,r)=>{"use strict";var n=r(6887),i=r(3610).filter;n({target:"Array",proto:!0,forced:!r(568)("filter")},{filter:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}})},4929:(t,e,r)=>{"use strict";var n=r(6887),i=r(3610).findIndex,o=r(8479),s="findIndex",u=!0;s in[]&&Array(1).findIndex((function(){u=!1})),n({target:"Array",proto:!0,forced:u},{findIndex:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),o(s)},833:(t,e,r)=>{"use strict";var n=r(6887),i=r(3610).find,o=r(8479),s="find",u=!0;s in[]&&Array(1).find((function(){u=!1})),n({target:"Array",proto:!0,forced:u},{find:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),o(s)},2437:(t,e,r)=>{"use strict";var n=r(6887),i=r(6837);n({target:"Array",proto:!0,forced:[].forEach!=i},{forEach:i})},3242:(t,e,r)=>{var n=r(6887),i=r(1354);n({target:"Array",stat:!0,forced:!r(1385)((function(t){Array.from(t)}))},{from:i})},7690:(t,e,r)=>{"use strict";var n=r(6887),i=r(1692).includes,o=r(8479);n({target:"Array",proto:!0},{includes:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),o("includes")},9076:(t,e,r)=>{"use strict";var n=r(6887),i=r(5329),o=r(1692).indexOf,s=r(4194),u=i([].indexOf),a=!!u&&1/u([1],1,-0)<0,c=s("indexOf");n({target:"Array",proto:!0,forced:a||!c},{indexOf:function(t){var e=arguments.length>1?arguments[1]:void 0;return a?u(this,t,e)||0:o(this,t,e)}})},2737:(t,e,r)=>{r(6887)({target:"Array",stat:!0},{isArray:r(1052)})},6274:(t,e,r)=>{"use strict";var n=r(4529),i=r(8479),o=r(2077),s=r(5402),u=r(5988).f,a=r(7771),c=r(2529),f=r(5746),l="Array Iterator",h=s.set,p=s.getterFor(l);t.exports=a(Array,"Array",(function(t,e){h(this,{type:l,target:n(t),index:0,kind:e})}),(function(){var t=p(this),e=t.target,r=t.kind,n=t.index++;return!e||n>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==r?{value:n,done:!1}:"values"==r?{value:e[n],done:!1}:{value:[n,e[n]],done:!1}}),"values");var d=o.Arguments=o.Array;if(i("keys"),i("values"),i("entries"),!c&&f&&"values"!==d.name)try{u(d,"name",{value:"values"})}catch(t){}},8787:(t,e,r)=>{"use strict";var n=r(6887),i=r(3610).map;n({target:"Array",proto:!0,forced:!r(568)("map")},{map:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}})},1876:(t,e,r)=>{"use strict";var n=r(6887),i=r(6499).left,o=r(4194),s=r(3385),u=r(6049);n({target:"Array",proto:!0,forced:!o("reduce")||!u&&s>79&&s<83},{reduce:function(t){var e=arguments.length;return i(this,t,e,e>1?arguments[1]:void 0)}})},186:(t,e,r)=>{"use strict";var n=r(6887),i=r(1899),o=r(1052),s=r(4284),u=r(941),a=r(9413),c=r(623),f=r(4529),l=r(5449),h=r(9813),p=r(568),d=r(3765),y=p("slice"),g=h("species"),v=i.Array,w=Math.max;n({target:"Array",proto:!0,forced:!y},{slice:function(t,e){var r,n,i,h=f(this),p=c(h),y=a(t,p),M=a(void 0===e?p:e,p);if(o(h)&&(r=h.constructor,(s(r)&&(r===v||o(r.prototype))||u(r)&&null===(r=r[g]))&&(r=void 0),r===v||void 0===r))return d(h,y,M);for(n=new(void 0===r?v:r)(w(M-y,0)),i=0;y<M;y++,i++)y in h&&l(n,i,h[y]);return n.length=i,n}})},6026:(t,e,r)=>{"use strict";var n=r(6887),i=r(3610).some;n({target:"Array",proto:!0,forced:!r(4194)("some")},{some:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}})},4115:(t,e,r)=>{"use strict";var n=r(6887),i=r(5329),o=r(4883),s=r(9678),u=r(623),a=r(5803),c=r(5981),f=r(1388),l=r(4194),h=r(4342),p=r(7797),d=r(3385),y=r(8938),g=[],v=i(g.sort),w=i(g.push),M=c((function(){g.sort(void 0)})),L=c((function(){g.sort(null)})),_=l("sort"),m=!c((function(){if(d)return d<70;if(!(h&&h>3)){if(p)return!0;if(y)return y<603;var t,e,r,n,i="";for(t=65;t<76;t++){switch(e=String.fromCharCode(t),t){case 66:case 69:case 70:case 72:r=3;break;case 68:case 71:r=4;break;default:r=2}for(n=0;n<47;n++)g.push({k:e+n,v:r})}for(g.sort((function(t,e){return e.v-t.v})),n=0;n<g.length;n++)e=g[n].k.charAt(0),i.charAt(i.length-1)!==e&&(i+=e);return"DGBEFHACIJK"!==i}}));n({target:"Array",proto:!0,forced:M||!L||!_||!m},{sort:function(t){void 0!==t&&o(t);var e=s(this);if(m)return void 0===t?v(e):v(e,t);var r,n,i=[],c=u(e);for(n=0;n<c;n++)n in e&&w(i,e[n]);for(f(i,function(t){return function(e,r){return void 0===r?-1:void 0===e?1:void 0!==t?+t(e,r)||0:a(e)>a(r)?1:-1}}(t)),r=i.length,n=0;n<r;)e[n]=i[n++];for(;n<c;)delete e[n++];return e}})},3381:(t,e,r)=>{var n=r(6887),i=r(8308);n({target:"Function",proto:!0,forced:Function.bind!==i},{bind:i})},2619:(t,e,r)=>{var n=r(6887),i=r(1899),o=r(626),s=r(9730),u=r(5329),a=r(5981),c=i.Array,f=o("JSON","stringify"),l=u(/./.exec),h=u("".charAt),p=u("".charCodeAt),d=u("".replace),y=u(1..toString),g=/[\uD800-\uDFFF]/g,v=/^[\uD800-\uDBFF]$/,w=/^[\uDC00-\uDFFF]$/,M=function(t,e,r){var n=h(r,e-1),i=h(r,e+1);return l(v,t)&&!l(w,i)||l(w,t)&&!l(v,n)?"\\u"+y(p(t,0),16):t},L=a((function(){return'"\\udf06\\ud834"'!==f("\udf06\ud834")||'"\\udead"'!==f("\udead")}));f&&n({target:"JSON",stat:!0,forced:L},{stringify:function(t,e,r){for(var n=0,i=arguments.length,o=c(i);n<i;n++)o[n]=arguments[n];var u=s(f,null,o);return"string"==typeof u?d(u,g,M):u}})},7501:(t,e,r)=>{"use strict";r(4683)("Map",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),r(5616))},9221:(t,e,r)=>{var n=r(6887),i=r(4420);n({target:"Object",stat:!0,forced:Object.assign!==i},{assign:i})},6450:(t,e,r)=>{var n=r(6887),i=r(5746),o=r(5988).f;n({target:"Object",stat:!0,forced:Object.defineProperty!==o,sham:!i},{defineProperty:o})},1724:(t,e,r)=>{var n=r(6887),i=r(9678),o=r(4771);n({target:"Object",stat:!0,forced:r(5981)((function(){o(1)}))},{keys:function(t){return o(i(t))}})},5967:()=>{},1035:(t,e,r)=>{"use strict";var n=r(6887),i=r(5329),o=r(344),s=r(8219),u=r(5803),a=r(7772),c=i("".indexOf);n({target:"String",proto:!0,forced:!a("includes")},{includes:function(t){return!!~c(u(s(this)),u(o(t)),arguments.length>1?arguments[1]:void 0)}})},7971:(t,e,r)=>{"use strict";var n=r(4620).charAt,i=r(5803),o=r(5402),s=r(7771),u="String Iterator",a=o.set,c=o.getterFor(u);s(String,"String",(function(t){a(this,{type:u,string:i(t),index:0})}),(function(){var t,e=c(this),r=e.string,i=e.index;return i>=r.length?{value:void 0,done:!0}:(t=n(r,i),e.index+=t.length,{value:t,done:!1})}))},4761:(t,e,r)=>{"use strict";var n,i=r(6887),o=r(5329),s=r(9677).f,u=r(3057),a=r(5803),c=r(344),f=r(8219),l=r(7772),h=r(2529),p=o("".startsWith),d=o("".slice),y=Math.min,g=l("startsWith");i({target:"String",proto:!0,forced:!!(h||g||(n=s(String.prototype,"startsWith"),!n||n.writable))&&!g},{startsWith:function(t){var e=a(f(this));c(t);var r=u(y(arguments.length>1?arguments[1]:void 0,e.length)),n=a(t);return p?p(e,n,r):d(e,r,r+n.length)===n}})},7398:(t,e,r)=>{"use strict";var n=r(6887),i=r(4853).trim;n({target:"String",proto:!0,forced:r(3093)("trim")},{trim:function(){return i(this)}})},7634:(t,e,r)=>{r(6274);var n=r(3281),i=r(1899),o=r(9697),s=r(2029),u=r(2077),a=r(9813)("toStringTag");for(var c in n){var f=i[c],l=f&&f.prototype;l&&o(l)!==a&&s(l,a,c),u[c]=u.Array}},7698:(t,e,r)=>{var n=r(4493);t.exports=n},3363:(t,e,r)=>{var n=r(4034);t.exports=n},2908:(t,e,r)=>{var n=r(2710);t.exports=n},9216:(t,e,r)=>{var n=r(9324);t.exports=n},6668:(t,e,r)=>{var n=r(5909);t.exports=n},8196:(t,e,r)=>{var n=r(6246);t.exports=n},8065:(t,e,r)=>{var n=r(6043);t.exports=n},7448:(t,e,r)=>{r(7634);var n=r(9697),i=r(953),o=r(7046),s=r(2908),u=Array.prototype,a={DOMTokenList:!0,NodeList:!0};t.exports=function(t){var e=t.entries;return t===u||o(u,t)&&e===u.entries||i(a,n(t))?s:e}},9455:(t,e,r)=>{var n=r(3160);t.exports=n},9743:(t,e,r)=>{var n=r(446);t.exports=n},1955:(t,e,r)=>{var n=r(2480);t.exports=n},6064:(t,e,r)=>{var n=r(7147);t.exports=n},1577:(t,e,r)=>{var n=r(2236);t.exports=n},6279:(t,e,r)=>{r(7634);var n=r(9697),i=r(953),o=r(7046),s=r(9216),u=Array.prototype,a={DOMTokenList:!0,NodeList:!0};t.exports=function(t){var e=t.forEach;return t===u||o(u,t)&&e===u.forEach||i(a,n(t))?s:e}},3778:(t,e,r)=>{var n=r(8557);t.exports=n},9373:(t,e,r)=>{var n=r(4570);t.exports=n},3819:(t,e,r)=>{r(7634);var n=r(9697),i=r(953),o=r(7046),s=r(6668),u=Array.prototype,a={DOMTokenList:!0,NodeList:!0};t.exports=function(t){var e=t.keys;return t===u||o(u,t)&&e===u.keys||i(a,n(t))?s:e}},1798:(t,e,r)=>{var n=r(8287);t.exports=n},2527:(t,e,r)=>{var n=r(8025);t.exports=n},2073:(t,e,r)=>{var n=r(9601);t.exports=n},5286:(t,e,r)=>{var n=r(8299);t.exports=n},2856:(t,e,r)=>{var n=r(9355);t.exports=n},5178:(t,e,r)=>{var n=r(1611);t.exports=n},6361:(t,e,r)=>{var n=r(2774);t.exports=n},8933:(t,e,r)=>{var n=r(4426);t.exports=n},5868:(t,e,r)=>{var n=r(1018);r(7634),t.exports=n},3383:(t,e,r)=>{var n=r(5999);t.exports=n},1910:(t,e,r)=>{var n=r(8171);t.exports=n},3059:(t,e,r)=>{var n=r(8494);t.exports=n},8269:function(t,e,r){var n;n=void 0!==r.g?r.g:this,t.exports=function(t){if(t.CSS&&t.CSS.escape)return t.CSS.escape;var e=function(t){if(0==arguments.length)throw new TypeError("`CSS.escape` requires an argument.");for(var e,r=String(t),n=r.length,i=-1,o="",s=r.charCodeAt(0);++i<n;)0!=(e=r.charCodeAt(i))?o+=e>=1&&e<=31||127==e||0==i&&e>=48&&e<=57||1==i&&e>=48&&e<=57&&45==s?"\\"+e.toString(16)+" ":0==i&&1==n&&45==e||!(e>=128||45==e||95==e||e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122)?"\\"+r.charAt(i):r.charAt(i):o+="�";return o};return t.CSS||(t.CSS={}),t.CSS.escape=e,e}(n)},9450:t=>{"use strict";class e{constructor(t,e){this.low=t,this.high=e,this.length=1+e-t}overlaps(t){return!(this.high<t.low||this.low>t.high)}touches(t){return!(this.high+1<t.low||this.low-1>t.high)}add(t){return new e(Math.min(this.low,t.low),Math.max(this.high,t.high))}subtract(t){return t.low<=this.low&&t.high>=this.high?[]:t.low>this.low&&t.high<this.high?[new e(this.low,t.low-1),new e(t.high+1,this.high)]:t.low<=this.low?[new e(t.high+1,this.high)]:[new e(this.low,t.low-1)]}toString(){return this.low==this.high?this.low.toString():this.low+"-"+this.high}}class r{constructor(t,e){this.ranges=[],this.length=0,null!=t&&this.add(t,e)}_update_length(){this.length=this.ranges.reduce(((t,e)=>t+e.length),0)}add(t,n){var i=t=>{for(var e=0;e<this.ranges.length&&!t.touches(this.ranges[e]);)e++;for(var r=this.ranges.slice(0,e);e<this.ranges.length&&t.touches(this.ranges[e]);)t=t.add(this.ranges[e]),e++;r.push(t),this.ranges=r.concat(this.ranges.slice(e)),this._update_length()};return t instanceof r?t.ranges.forEach(i):(null==n&&(n=t),i(new e(t,n))),this}subtract(t,n){var i=t=>{for(var e=0;e<this.ranges.length&&!t.overlaps(this.ranges[e]);)e++;for(var r=this.ranges.slice(0,e);e<this.ranges.length&&t.overlaps(this.ranges[e]);)r=r.concat(this.ranges[e].subtract(t)),e++;this.ranges=r.concat(this.ranges.slice(e)),this._update_length()};return t instanceof r?t.ranges.forEach(i):(null==n&&(n=t),i(new e(t,n))),this}intersect(t,n){var i=[],o=t=>{for(var r=0;r<this.ranges.length&&!t.overlaps(this.ranges[r]);)r++;for(;r<this.ranges.length&&t.overlaps(this.ranges[r]);){var n=Math.max(this.ranges[r].low,t.low),o=Math.min(this.ranges[r].high,t.high);i.push(new e(n,o)),r++}};return t instanceof r?t.ranges.forEach(o):(null==n&&(n=t),o(new e(t,n))),this.ranges=i,this._update_length(),this}index(t){for(var e=0;e<this.ranges.length&&this.ranges[e].length<=t;)t-=this.ranges[e].length,e++;return this.ranges[e].low+t}toString(){return"[ "+this.ranges.join(", ")+" ]"}clone(){return new r(this)}numbers(){return this.ranges.reduce(((t,e)=>{for(var r=e.low;r<=e.high;)t.push(r),r++;return t}),[])}subranges(){return this.ranges.map((t=>({low:t.low,high:t.high,length:1+t.high-t.low})))}}t.exports=r},7187:t=>{"use strict";var e,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};e=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var i=Number.isNaN||function(t){return t!=t};function o(){o.init.call(this)}t.exports=o,t.exports.once=function(t,e){return new Promise((function(r,n){function i(r){t.removeListener(e,o),n(r)}function o(){"function"==typeof t.removeListener&&t.removeListener("error",i),r([].slice.call(arguments))}y(t,e,o,{once:!0}),"error"!==e&&function(t,e,r){"function"==typeof t.on&&y(t,"error",e,r)}(t,i,{once:!0})}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function u(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function a(t){return void 0===t._maxListeners?o.defaultMaxListeners:t._maxListeners}function c(t,e,r,n){var i,o,s,c;if(u(r),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),s=o[e]),void 0===s)s=o[e]=r,++t._eventsCount;else if("function"==typeof s?s=o[e]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=a(t))>0&&s.length>i&&!s.warned){s.warned=!0;var f=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");f.name="MaxListenersExceededWarning",f.emitter=t,f.type=e,f.count=s.length,c=f,console&&console.warn&&console.warn(c)}return t}function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=f.bind(n);return i.listener=r,n.wrapFn=i,i}function h(t,e,r){var n=t._events;if(void 0===n)return[];var i=n[e];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}(i):d(i,i.length)}function p(t){var e=this._events;if(void 0!==e){var r=e[t];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function d(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}function y(t,e,r,n){if("function"==typeof t.on)n.once?t.once(e,r):t.on(e,r);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,(function i(o){n.once&&t.removeEventListener(e,i),r(o)}))}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(t){if("number"!=typeof t||t<0||i(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");s=t}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||i(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},o.prototype.getMaxListeners=function(){return a(this)},o.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var i="error"===t,o=this._events;if(void 0!==o)i=i&&void 0===o.error;else if(!i)return!1;if(i){var s;if(e.length>0&&(s=e[0]),s instanceof Error)throw s;var u=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw u.context=s,u}var a=o[t];if(void 0===a)return!1;if("function"==typeof a)n(a,this,e);else{var c=a.length,f=d(a,c);for(r=0;r<c;++r)n(f[r],this,e)}return!0},o.prototype.addListener=function(t,e){return c(this,t,e,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(t,e){return c(this,t,e,!0)},o.prototype.once=function(t,e){return u(e),this.on(t,l(this,t,e)),this},o.prototype.prependOnceListener=function(t,e){return u(e),this.prependListener(t,l(this,t,e)),this},o.prototype.removeListener=function(t,e){var r,n,i,o,s;if(u(e),void 0===(n=this._events))return this;if(void 0===(r=n[t]))return this;if(r===e||r.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete n[t],n.removeListener&&this.emit("removeListener",t,r.listener||e));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(r,i),1===r.length&&(n[t]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",t,s||e)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(t){var e,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[t]),this;if(0===arguments.length){var i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=r[t]))this.removeListener(t,e);else if(void 0!==e)for(n=e.length-1;n>=0;n--)this.removeListener(t,e[n]);return this},o.prototype.listeners=function(t){return h(this,t,!0)},o.prototype.rawListeners=function(t){return h(this,t,!1)},o.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):p.call(t,e)},o.prototype.listenerCount=p,o.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}},645:(t,e)=>{e.read=function(t,e,r,n,i){var o,s,u=8*i-n-1,a=(1<<u)-1,c=a>>1,f=-7,l=r?i-1:0,h=r?-1:1,p=t[e+l];for(l+=h,o=p&(1<<-f)-1,p>>=-f,f+=u;f>0;o=256*o+t[e+l],l+=h,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=n;f>0;s=256*s+t[e+l],l+=h,f-=8);if(0===o)o=1-c;else{if(o===a)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=c}return(p?-1:1)*s*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var s,u,a,c=8*o-i-1,f=(1<<c)-1,l=f>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,s=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(a=Math.pow(2,-s))<1&&(s--,a*=2),(e+=s+l>=1?h/a:h*Math.pow(2,1-l))*a>=2&&(s++,a/=2),s+l>=f?(u=0,s=f):s+l>=1?(u=(e*a-1)*Math.pow(2,i),s+=l):(u=e*Math.pow(2,l-1)*Math.pow(2,i),s=0));i>=8;t[r+p]=255&u,p+=d,u/=256,i-=8);for(s=s<<i|u,c+=i;c>0;t[r+p]=255&s,p+=d,s/=256,c-=8);t[r+p-d]|=128*y}},3393:function(t){t.exports=function(){"use strict";var t=Array.prototype.slice;function e(t,e){e&&(t.prototype=Object.create(e.prototype)),t.prototype.constructor=t}function r(t){return s(t)?t:H(t)}function n(t){return u(t)?t:J(t)}function i(t){return a(t)?t:Z(t)}function o(t){return s(t)&&!c(t)?t:$(t)}function s(t){return!(!t||!t[l])}function u(t){return!(!t||!t[h])}function a(t){return!(!t||!t[p])}function c(t){return u(t)||a(t)}function f(t){return!(!t||!t[d])}e(n,r),e(i,r),e(o,r),r.isIterable=s,r.isKeyed=u,r.isIndexed=a,r.isAssociative=c,r.isOrdered=f,r.Keyed=n,r.Indexed=i,r.Set=o;var l="@@__IMMUTABLE_ITERABLE__@@",h="@@__IMMUTABLE_KEYED__@@",p="@@__IMMUTABLE_INDEXED__@@",d="@@__IMMUTABLE_ORDERED__@@",y="delete",g=5,v=1<<g,w=v-1,M={},L={value:!1},_={value:!1};function m(t){return t.value=!1,t}function b(t){t&&(t.value=!0)}function j(){}function x(t,e){e=e||0;for(var r=Math.max(0,t.length-e),n=new Array(r),i=0;i<r;i++)n[i]=t[i+e];return n}function N(t){return void 0===t.size&&(t.size=t.__iterate(D)),t.size}function S(t,e){if("number"!=typeof e){var r=e>>>0;if(""+r!==e||4294967295===r)return NaN;e=r}return e<0?N(t)+e:e}function D(){return!0}function I(t,e,r){return(0===t||void 0!==r&&t<=-r)&&(void 0===e||void 0!==r&&e>=r)}function E(t,e){return C(t,e,0)}function A(t,e){return C(t,e,e)}function C(t,e,r){return void 0===t?r:t<0?Math.max(0,e+t):void 0===e?t:Math.min(e,t)}var T=0,O=1,z=2,k="function"==typeof Symbol&&Symbol.iterator,U="@@iterator",R=k||U;function Y(t){this.next=t}function B(t,e,r,n){var i=0===t?e:1===t?r:[e,r];return n?n.value=i:n={value:i,done:!1},n}function P(){return{value:void 0,done:!0}}function Q(t){return!!W(t)}function F(t){return t&&"function"==typeof t.next}function G(t){var e=W(t);return e&&e.call(t)}function W(t){var e=t&&(k&&t[k]||t[U]);if("function"==typeof e)return e}function q(t){return t&&"number"==typeof t.length}function H(t){return null==t?st():s(t)?t.toSeq():ct(t)}function J(t){return null==t?st().toKeyedSeq():s(t)?u(t)?t.toSeq():t.fromEntrySeq():ut(t)}function Z(t){return null==t?st():s(t)?u(t)?t.entrySeq():t.toIndexedSeq():at(t)}function $(t){return(null==t?st():s(t)?u(t)?t.entrySeq():t:at(t)).toSetSeq()}Y.prototype.toString=function(){return"[Iterator]"},Y.KEYS=T,Y.VALUES=O,Y.ENTRIES=z,Y.prototype.inspect=Y.prototype.toSource=function(){return this.toString()},Y.prototype[R]=function(){return this},e(H,r),H.of=function(){return H(arguments)},H.prototype.toSeq=function(){return this},H.prototype.toString=function(){return this.__toString("Seq {","}")},H.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},H.prototype.__iterate=function(t,e){return lt(this,t,e,!0)},H.prototype.__iterator=function(t,e){return ht(this,t,e,!0)},e(J,H),J.prototype.toKeyedSeq=function(){return this},e(Z,H),Z.of=function(){return Z(arguments)},Z.prototype.toIndexedSeq=function(){return this},Z.prototype.toString=function(){return this.__toString("Seq [","]")},Z.prototype.__iterate=function(t,e){return lt(this,t,e,!1)},Z.prototype.__iterator=function(t,e){return ht(this,t,e,!1)},e($,H),$.of=function(){return $(arguments)},$.prototype.toSetSeq=function(){return this},H.isSeq=ot,H.Keyed=J,H.Set=$,H.Indexed=Z;var V,X,K,tt="@@__IMMUTABLE_SEQ__@@";function et(t){this._array=t,this.size=t.length}function rt(t){var e=Object.keys(t);this._object=t,this._keys=e,this.size=e.length}function nt(t){this._iterable=t,this.size=t.length||t.size}function it(t){this._iterator=t,this._iteratorCache=[]}function ot(t){return!(!t||!t[tt])}function st(){return V||(V=new et([]))}function ut(t){var e=Array.isArray(t)?new et(t).fromEntrySeq():F(t)?new it(t).fromEntrySeq():Q(t)?new nt(t).fromEntrySeq():"object"==typeof t?new rt(t):void 0;if(!e)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+t);return e}function at(t){var e=ft(t);if(!e)throw new TypeError("Expected Array or iterable object of values: "+t);return e}function ct(t){var e=ft(t)||"object"==typeof t&&new rt(t);if(!e)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+t);return e}function ft(t){return q(t)?new et(t):F(t)?new it(t):Q(t)?new nt(t):void 0}function lt(t,e,r,n){var i=t._cache;if(i){for(var o=i.length-1,s=0;s<=o;s++){var u=i[r?o-s:s];if(!1===e(u[1],n?u[0]:s,t))return s+1}return s}return t.__iterateUncached(e,r)}function ht(t,e,r,n){var i=t._cache;if(i){var o=i.length-1,s=0;return new Y((function(){var t=i[r?o-s:s];return s++>o?P():B(e,n?t[0]:s-1,t[1])}))}return t.__iteratorUncached(e,r)}function pt(t,e){return e?dt(e,t,"",{"":t}):yt(t)}function dt(t,e,r,n){return Array.isArray(e)?t.call(n,r,Z(e).map((function(r,n){return dt(t,r,n,e)}))):gt(e)?t.call(n,r,J(e).map((function(r,n){return dt(t,r,n,e)}))):e}function yt(t){return Array.isArray(t)?Z(t).map(yt).toList():gt(t)?J(t).map(yt).toMap():t}function gt(t){return t&&(t.constructor===Object||void 0===t.constructor)}function vt(t,e){if(t===e||t!=t&&e!=e)return!0;if(!t||!e)return!1;if("function"==typeof t.valueOf&&"function"==typeof e.valueOf){if((t=t.valueOf())===(e=e.valueOf())||t!=t&&e!=e)return!0;if(!t||!e)return!1}return!("function"!=typeof t.equals||"function"!=typeof e.equals||!t.equals(e))}function wt(t,e){if(t===e)return!0;if(!s(e)||void 0!==t.size&&void 0!==e.size&&t.size!==e.size||void 0!==t.__hash&&void 0!==e.__hash&&t.__hash!==e.__hash||u(t)!==u(e)||a(t)!==a(e)||f(t)!==f(e))return!1;if(0===t.size&&0===e.size)return!0;var r=!c(t);if(f(t)){var n=t.entries();return e.every((function(t,e){var i=n.next().value;return i&&vt(i[1],t)&&(r||vt(i[0],e))}))&&n.next().done}var i=!1;if(void 0===t.size)if(void 0===e.size)"function"==typeof t.cacheResult&&t.cacheResult();else{i=!0;var o=t;t=e,e=o}var l=!0,h=e.__iterate((function(e,n){if(r?!t.has(e):i?!vt(e,t.get(n,M)):!vt(t.get(n,M),e))return l=!1,!1}));return l&&t.size===h}function Mt(t,e){if(!(this instanceof Mt))return new Mt(t,e);if(this._value=t,this.size=void 0===e?1/0:Math.max(0,e),0===this.size){if(X)return X;X=this}}function Lt(t,e){if(!t)throw new Error(e)}function _t(t,e,r){if(!(this instanceof _t))return new _t(t,e,r);if(Lt(0!==r,"Cannot step a Range by 0"),t=t||0,void 0===e&&(e=1/0),r=void 0===r?1:Math.abs(r),e<t&&(r=-r),this._start=t,this._end=e,this._step=r,this.size=Math.max(0,Math.ceil((e-t)/r-1)+1),0===this.size){if(K)return K;K=this}}function mt(){throw TypeError("Abstract")}function bt(){}function jt(){}function xt(){}H.prototype[tt]=!0,e(et,Z),et.prototype.get=function(t,e){return this.has(t)?this._array[S(this,t)]:e},et.prototype.__iterate=function(t,e){for(var r=this._array,n=r.length-1,i=0;i<=n;i++)if(!1===t(r[e?n-i:i],i,this))return i+1;return i},et.prototype.__iterator=function(t,e){var r=this._array,n=r.length-1,i=0;return new Y((function(){return i>n?P():B(t,i,r[e?n-i++:i++])}))},e(rt,J),rt.prototype.get=function(t,e){return void 0===e||this.has(t)?this._object[t]:e},rt.prototype.has=function(t){return this._object.hasOwnProperty(t)},rt.prototype.__iterate=function(t,e){for(var r=this._object,n=this._keys,i=n.length-1,o=0;o<=i;o++){var s=n[e?i-o:o];if(!1===t(r[s],s,this))return o+1}return o},rt.prototype.__iterator=function(t,e){var r=this._object,n=this._keys,i=n.length-1,o=0;return new Y((function(){var s=n[e?i-o:o];return o++>i?P():B(t,s,r[s])}))},rt.prototype[d]=!0,e(nt,Z),nt.prototype.__iterateUncached=function(t,e){if(e)return this.cacheResult().__iterate(t,e);var r=G(this._iterable),n=0;if(F(r))for(var i;!(i=r.next()).done&&!1!==t(i.value,n++,this););return n},nt.prototype.__iteratorUncached=function(t,e){if(e)return this.cacheResult().__iterator(t,e);var r=G(this._iterable);if(!F(r))return new Y(P);var n=0;return new Y((function(){var e=r.next();return e.done?e:B(t,n++,e.value)}))},e(it,Z),it.prototype.__iterateUncached=function(t,e){if(e)return this.cacheResult().__iterate(t,e);for(var r,n=this._iterator,i=this._iteratorCache,o=0;o<i.length;)if(!1===t(i[o],o++,this))return o;for(;!(r=n.next()).done;){var s=r.value;if(i[o]=s,!1===t(s,o++,this))break}return o},it.prototype.__iteratorUncached=function(t,e){if(e)return this.cacheResult().__iterator(t,e);var r=this._iterator,n=this._iteratorCache,i=0;return new Y((function(){if(i>=n.length){var e=r.next();if(e.done)return e;n[i]=e.value}return B(t,i,n[i++])}))},e(Mt,Z),Mt.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},Mt.prototype.get=function(t,e){return this.has(t)?this._value:e},Mt.prototype.includes=function(t){return vt(this._value,t)},Mt.prototype.slice=function(t,e){var r=this.size;return I(t,e,r)?this:new Mt(this._value,A(e,r)-E(t,r))},Mt.prototype.reverse=function(){return this},Mt.prototype.indexOf=function(t){return vt(this._value,t)?0:-1},Mt.prototype.lastIndexOf=function(t){return vt(this._value,t)?this.size:-1},Mt.prototype.__iterate=function(t,e){for(var r=0;r<this.size;r++)if(!1===t(this._value,r,this))return r+1;return r},Mt.prototype.__iterator=function(t,e){var r=this,n=0;return new Y((function(){return n<r.size?B(t,n++,r._value):P()}))},Mt.prototype.equals=function(t){return t instanceof Mt?vt(this._value,t._value):wt(t)},e(_t,Z),_t.prototype.toString=function(){return 0===this.size?"Range []":"Range [ "+this._start+"..."+this._end+(1!==this._step?" by "+this._step:"")+" ]"},_t.prototype.get=function(t,e){return this.has(t)?this._start+S(this,t)*this._step:e},_t.prototype.includes=function(t){var e=(t-this._start)/this._step;return e>=0&&e<this.size&&e===Math.floor(e)},_t.prototype.slice=function(t,e){return I(t,e,this.size)?this:(t=E(t,this.size),(e=A(e,this.size))<=t?new _t(0,0):new _t(this.get(t,this._end),this.get(e,this._end),this._step))},_t.prototype.indexOf=function(t){var e=t-this._start;if(e%this._step==0){var r=e/this._step;if(r>=0&&r<this.size)return r}return-1},_t.prototype.lastIndexOf=function(t){return this.indexOf(t)},_t.prototype.__iterate=function(t,e){for(var r=this.size-1,n=this._step,i=e?this._start+r*n:this._start,o=0;o<=r;o++){if(!1===t(i,o,this))return o+1;i+=e?-n:n}return o},_t.prototype.__iterator=function(t,e){var r=this.size-1,n=this._step,i=e?this._start+r*n:this._start,o=0;return new Y((function(){var s=i;return i+=e?-n:n,o>r?P():B(t,o++,s)}))},_t.prototype.equals=function(t){return t instanceof _t?this._start===t._start&&this._end===t._end&&this._step===t._step:wt(this,t)},e(mt,r),e(bt,mt),e(jt,mt),e(xt,mt),mt.Keyed=bt,mt.Indexed=jt,mt.Set=xt;var Nt="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(t,e){var r=65535&(t|=0),n=65535&(e|=0);return r*n+((t>>>16)*n+r*(e>>>16)<<16>>>0)|0};function St(t){return t>>>1&1073741824|3221225471&t}function Dt(t){if(!1===t||null==t)return 0;if("function"==typeof t.valueOf&&(!1===(t=t.valueOf())||null==t))return 0;if(!0===t)return 1;var e=typeof t;if("number"===e){if(t!=t||t===1/0)return 0;var r=0|t;for(r!==t&&(r^=4294967295*t);t>4294967295;)r^=t/=4294967295;return St(r)}if("string"===e)return t.length>Yt?It(t):Et(t);if("function"==typeof t.hashCode)return t.hashCode();if("object"===e)return At(t);if("function"==typeof t.toString)return Et(t.toString());throw new Error("Value type "+e+" cannot be hashed.")}function It(t){var e=Qt[t];return void 0===e&&(e=Et(t),Pt===Bt&&(Pt=0,Qt={}),Pt++,Qt[t]=e),e}function Et(t){for(var e=0,r=0;r<t.length;r++)e=31*e+t.charCodeAt(r)|0;return St(e)}function At(t){var e;if(kt&&void 0!==(e=zt.get(t)))return e;if(void 0!==(e=t[Rt]))return e;if(!Tt){if(void 0!==(e=t.propertyIsEnumerable&&t.propertyIsEnumerable[Rt]))return e;if(void 0!==(e=Ot(t)))return e}if(e=++Ut,1073741824&Ut&&(Ut=0),kt)zt.set(t,e);else{if(void 0!==Ct&&!1===Ct(t))throw new Error("Non-extensible objects are not allowed as keys.");if(Tt)Object.defineProperty(t,Rt,{enumerable:!1,configurable:!1,writable:!1,value:e});else if(void 0!==t.propertyIsEnumerable&&t.propertyIsEnumerable===t.constructor.prototype.propertyIsEnumerable)t.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},t.propertyIsEnumerable[Rt]=e;else{if(void 0===t.nodeType)throw new Error("Unable to set a non-enumerable property on object.");t[Rt]=e}}return e}var Ct=Object.isExtensible,Tt=function(){try{return Object.defineProperty({},"@",{}),!0}catch(t){return!1}}();function Ot(t){if(t&&t.nodeType>0)switch(t.nodeType){case 1:return t.uniqueID;case 9:return t.documentElement&&t.documentElement.uniqueID}}var zt,kt="function"==typeof WeakMap;kt&&(zt=new WeakMap);var Ut=0,Rt="__immutablehash__";"function"==typeof Symbol&&(Rt=Symbol(Rt));var Yt=16,Bt=255,Pt=0,Qt={};function Ft(t){Lt(t!==1/0,"Cannot perform this action with an infinite size.")}function Gt(t){return null==t?ie():Wt(t)&&!f(t)?t:ie().withMutations((function(e){var r=n(t);Ft(r.size),r.forEach((function(t,r){return e.set(r,t)}))}))}function Wt(t){return!(!t||!t[Ht])}e(Gt,bt),Gt.of=function(){var e=t.call(arguments,0);return ie().withMutations((function(t){for(var r=0;r<e.length;r+=2){if(r+1>=e.length)throw new Error("Missing value for key: "+e[r]);t.set(e[r],e[r+1])}}))},Gt.prototype.toString=function(){return this.__toString("Map {","}")},Gt.prototype.get=function(t,e){return this._root?this._root.get(0,void 0,t,e):e},Gt.prototype.set=function(t,e){return oe(this,t,e)},Gt.prototype.setIn=function(t,e){return this.updateIn(t,M,(function(){return e}))},Gt.prototype.remove=function(t){return oe(this,t,M)},Gt.prototype.deleteIn=function(t){return this.updateIn(t,(function(){return M}))},Gt.prototype.update=function(t,e,r){return 1===arguments.length?t(this):this.updateIn([t],e,r)},Gt.prototype.updateIn=function(t,e,r){r||(r=e,e=void 0);var n=ge(this,_r(t),e,r);return n===M?void 0:n},Gt.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):ie()},Gt.prototype.merge=function(){return he(this,void 0,arguments)},Gt.prototype.mergeWith=function(e){return he(this,e,t.call(arguments,1))},Gt.prototype.mergeIn=function(e){var r=t.call(arguments,1);return this.updateIn(e,ie(),(function(t){return"function"==typeof t.merge?t.merge.apply(t,r):r[r.length-1]}))},Gt.prototype.mergeDeep=function(){return he(this,pe,arguments)},Gt.prototype.mergeDeepWith=function(e){var r=t.call(arguments,1);return he(this,de(e),r)},Gt.prototype.mergeDeepIn=function(e){var r=t.call(arguments,1);return this.updateIn(e,ie(),(function(t){return"function"==typeof t.mergeDeep?t.mergeDeep.apply(t,r):r[r.length-1]}))},Gt.prototype.sort=function(t){return Qe(fr(this,t))},Gt.prototype.sortBy=function(t,e){return Qe(fr(this,e,t))},Gt.prototype.withMutations=function(t){var e=this.asMutable();return t(e),e.wasAltered()?e.__ensureOwner(this.__ownerID):this},Gt.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new j)},Gt.prototype.asImmutable=function(){return this.__ensureOwner()},Gt.prototype.wasAltered=function(){return this.__altered},Gt.prototype.__iterator=function(t,e){return new te(this,t,e)},Gt.prototype.__iterate=function(t,e){var r=this,n=0;return this._root&&this._root.iterate((function(e){return n++,t(e[1],e[0],r)}),e),n},Gt.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?ne(this.size,this._root,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)},Gt.isMap=Wt;var qt,Ht="@@__IMMUTABLE_MAP__@@",Jt=Gt.prototype;function Zt(t,e){this.ownerID=t,this.entries=e}function $t(t,e,r){this.ownerID=t,this.bitmap=e,this.nodes=r}function Vt(t,e,r){this.ownerID=t,this.count=e,this.nodes=r}function Xt(t,e,r){this.ownerID=t,this.keyHash=e,this.entries=r}function Kt(t,e,r){this.ownerID=t,this.keyHash=e,this.entry=r}function te(t,e,r){this._type=e,this._reverse=r,this._stack=t._root&&re(t._root)}function ee(t,e){return B(t,e[0],e[1])}function re(t,e){return{node:t,index:0,__prev:e}}function ne(t,e,r,n){var i=Object.create(Jt);return i.size=t,i._root=e,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function ie(){return qt||(qt=ne(0))}function oe(t,e,r){var n,i;if(t._root){var o=m(L),s=m(_);if(n=se(t._root,t.__ownerID,0,void 0,e,r,o,s),!s.value)return t;i=t.size+(o.value?r===M?-1:1:0)}else{if(r===M)return t;i=1,n=new Zt(t.__ownerID,[[e,r]])}return t.__ownerID?(t.size=i,t._root=n,t.__hash=void 0,t.__altered=!0,t):n?ne(i,n):ie()}function se(t,e,r,n,i,o,s,u){return t?t.update(e,r,n,i,o,s,u):o===M?t:(b(u),b(s),new Kt(e,n,[i,o]))}function ue(t){return t.constructor===Kt||t.constructor===Xt}function ae(t,e,r,n,i){if(t.keyHash===n)return new Xt(e,n,[t.entry,i]);var o,s=(0===r?t.keyHash:t.keyHash>>>r)&w,u=(0===r?n:n>>>r)&w;return new $t(e,1<<s|1<<u,s===u?[ae(t,e,r+g,n,i)]:(o=new Kt(e,n,i),s<u?[t,o]:[o,t]))}function ce(t,e,r,n){t||(t=new j);for(var i=new Kt(t,Dt(r),[r,n]),o=0;o<e.length;o++){var s=e[o];i=i.update(t,0,void 0,s[0],s[1])}return i}function fe(t,e,r,n){for(var i=0,o=0,s=new Array(r),u=0,a=1,c=e.length;u<c;u++,a<<=1){var f=e[u];void 0!==f&&u!==n&&(i|=a,s[o++]=f)}return new $t(t,i,s)}function le(t,e,r,n,i){for(var o=0,s=new Array(v),u=0;0!==r;u++,r>>>=1)s[u]=1&r?e[o++]:void 0;return s[n]=i,new Vt(t,o+1,s)}function he(t,e,r){for(var i=[],o=0;o<r.length;o++){var u=r[o],a=n(u);s(u)||(a=a.map((function(t){return pt(t)}))),i.push(a)}return ye(t,e,i)}function pe(t,e,r){return t&&t.mergeDeep&&s(e)?t.mergeDeep(e):vt(t,e)?t:e}function de(t){return function(e,r,n){if(e&&e.mergeDeepWith&&s(r))return e.mergeDeepWith(t,r);var i=t(e,r,n);return vt(e,i)?e:i}}function ye(t,e,r){return 0===(r=r.filter((function(t){return 0!==t.size}))).length?t:0!==t.size||t.__ownerID||1!==r.length?t.withMutations((function(t){for(var n=e?function(r,n){t.update(n,M,(function(t){return t===M?r:e(t,r,n)}))}:function(e,r){t.set(r,e)},i=0;i<r.length;i++)r[i].forEach(n)})):t.constructor(r[0])}function ge(t,e,r,n){var i=t===M,o=e.next();if(o.done){var s=i?r:t,u=n(s);return u===s?t:u}Lt(i||t&&t.set,"invalid keyPath");var a=o.value,c=i?M:t.get(a,M),f=ge(c,e,r,n);return f===c?t:f===M?t.remove(a):(i?ie():t).set(a,f)}function ve(t){return t=(t=(858993459&(t-=t>>1&1431655765))+(t>>2&858993459))+(t>>4)&252645135,t+=t>>8,127&(t+=t>>16)}function we(t,e,r,n){var i=n?t:x(t);return i[e]=r,i}function Me(t,e,r,n){var i=t.length+1;if(n&&e+1===i)return t[e]=r,t;for(var o=new Array(i),s=0,u=0;u<i;u++)u===e?(o[u]=r,s=-1):o[u]=t[u+s];return o}function Le(t,e,r){var n=t.length-1;if(r&&e===n)return t.pop(),t;for(var i=new Array(n),o=0,s=0;s<n;s++)s===e&&(o=1),i[s]=t[s+o];return i}Jt[Ht]=!0,Jt[y]=Jt.remove,Jt.removeIn=Jt.deleteIn,Zt.prototype.get=function(t,e,r,n){for(var i=this.entries,o=0,s=i.length;o<s;o++)if(vt(r,i[o][0]))return i[o][1];return n},Zt.prototype.update=function(t,e,r,n,i,o,s){for(var u=i===M,a=this.entries,c=0,f=a.length;c<f&&!vt(n,a[c][0]);c++);var l=c<f;if(l?a[c][1]===i:u)return this;if(b(s),(u||!l)&&b(o),!u||1!==a.length){if(!l&&!u&&a.length>=_e)return ce(t,a,n,i);var h=t&&t===this.ownerID,p=h?a:x(a);return l?u?c===f-1?p.pop():p[c]=p.pop():p[c]=[n,i]:p.push([n,i]),h?(this.entries=p,this):new Zt(t,p)}},$t.prototype.get=function(t,e,r,n){void 0===e&&(e=Dt(r));var i=1<<((0===t?e:e>>>t)&w),o=this.bitmap;return 0==(o&i)?n:this.nodes[ve(o&i-1)].get(t+g,e,r,n)},$t.prototype.update=function(t,e,r,n,i,o,s){void 0===r&&(r=Dt(n));var u=(0===e?r:r>>>e)&w,a=1<<u,c=this.bitmap,f=0!=(c&a);if(!f&&i===M)return this;var l=ve(c&a-1),h=this.nodes,p=f?h[l]:void 0,d=se(p,t,e+g,r,n,i,o,s);if(d===p)return this;if(!f&&d&&h.length>=me)return le(t,h,c,u,d);if(f&&!d&&2===h.length&&ue(h[1^l]))return h[1^l];if(f&&d&&1===h.length&&ue(d))return d;var y=t&&t===this.ownerID,v=f?d?c:c^a:c|a,L=f?d?we(h,l,d,y):Le(h,l,y):Me(h,l,d,y);return y?(this.bitmap=v,this.nodes=L,this):new $t(t,v,L)},Vt.prototype.get=function(t,e,r,n){void 0===e&&(e=Dt(r));var i=(0===t?e:e>>>t)&w,o=this.nodes[i];return o?o.get(t+g,e,r,n):n},Vt.prototype.update=function(t,e,r,n,i,o,s){void 0===r&&(r=Dt(n));var u=(0===e?r:r>>>e)&w,a=i===M,c=this.nodes,f=c[u];if(a&&!f)return this;var l=se(f,t,e+g,r,n,i,o,s);if(l===f)return this;var h=this.count;if(f){if(!l&&--h<be)return fe(t,c,h,u)}else h++;var p=t&&t===this.ownerID,d=we(c,u,l,p);return p?(this.count=h,this.nodes=d,this):new Vt(t,h,d)},Xt.prototype.get=function(t,e,r,n){for(var i=this.entries,o=0,s=i.length;o<s;o++)if(vt(r,i[o][0]))return i[o][1];return n},Xt.prototype.update=function(t,e,r,n,i,o,s){void 0===r&&(r=Dt(n));var u=i===M;if(r!==this.keyHash)return u?this:(b(s),b(o),ae(this,t,e,r,[n,i]));for(var a=this.entries,c=0,f=a.length;c<f&&!vt(n,a[c][0]);c++);var l=c<f;if(l?a[c][1]===i:u)return this;if(b(s),(u||!l)&&b(o),u&&2===f)return new Kt(t,this.keyHash,a[1^c]);var h=t&&t===this.ownerID,p=h?a:x(a);return l?u?c===f-1?p.pop():p[c]=p.pop():p[c]=[n,i]:p.push([n,i]),h?(this.entries=p,this):new Xt(t,this.keyHash,p)},Kt.prototype.get=function(t,e,r,n){return vt(r,this.entry[0])?this.entry[1]:n},Kt.prototype.update=function(t,e,r,n,i,o,s){var u=i===M,a=vt(n,this.entry[0]);return(a?i===this.entry[1]:u)?this:(b(s),u?void b(o):a?t&&t===this.ownerID?(this.entry[1]=i,this):new Kt(t,this.keyHash,[n,i]):(b(o),ae(this,t,e,Dt(n),[n,i])))},Zt.prototype.iterate=Xt.prototype.iterate=function(t,e){for(var r=this.entries,n=0,i=r.length-1;n<=i;n++)if(!1===t(r[e?i-n:n]))return!1},$t.prototype.iterate=Vt.prototype.iterate=function(t,e){for(var r=this.nodes,n=0,i=r.length-1;n<=i;n++){var o=r[e?i-n:n];if(o&&!1===o.iterate(t,e))return!1}},Kt.prototype.iterate=function(t,e){return t(this.entry)},e(te,Y),te.prototype.next=function(){for(var t=this._type,e=this._stack;e;){var r,n=e.node,i=e.index++;if(n.entry){if(0===i)return ee(t,n.entry)}else if(n.entries){if(i<=(r=n.entries.length-1))return ee(t,n.entries[this._reverse?r-i:i])}else if(i<=(r=n.nodes.length-1)){var o=n.nodes[this._reverse?r-i:i];if(o){if(o.entry)return ee(t,o.entry);e=this._stack=re(o,e)}continue}e=this._stack=this._stack.__prev}return P()};var _e=v/4,me=v/2,be=v/4;function je(t){var e=Oe();if(null==t)return e;if(xe(t))return t;var r=i(t),n=r.size;return 0===n?e:(Ft(n),n>0&&n<v?Te(0,n,g,null,new De(r.toArray())):e.withMutations((function(t){t.setSize(n),r.forEach((function(e,r){return t.set(r,e)}))})))}function xe(t){return!(!t||!t[Ne])}e(je,jt),je.of=function(){return this(arguments)},je.prototype.toString=function(){return this.__toString("List [","]")},je.prototype.get=function(t,e){if((t=S(this,t))>=0&&t<this.size){var r=Re(this,t+=this._origin);return r&&r.array[t&w]}return e},je.prototype.set=function(t,e){return ze(this,t,e)},je.prototype.remove=function(t){return this.has(t)?0===t?this.shift():t===this.size-1?this.pop():this.splice(t,1):this},je.prototype.insert=function(t,e){return this.splice(t,0,e)},je.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=g,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):Oe()},je.prototype.push=function(){var t=arguments,e=this.size;return this.withMutations((function(r){Ye(r,0,e+t.length);for(var n=0;n<t.length;n++)r.set(e+n,t[n])}))},je.prototype.pop=function(){return Ye(this,0,-1)},je.prototype.unshift=function(){var t=arguments;return this.withMutations((function(e){Ye(e,-t.length);for(var r=0;r<t.length;r++)e.set(r,t[r])}))},je.prototype.shift=function(){return Ye(this,1)},je.prototype.merge=function(){return Be(this,void 0,arguments)},je.prototype.mergeWith=function(e){return Be(this,e,t.call(arguments,1))},je.prototype.mergeDeep=function(){return Be(this,pe,arguments)},je.prototype.mergeDeepWith=function(e){var r=t.call(arguments,1);return Be(this,de(e),r)},je.prototype.setSize=function(t){return Ye(this,0,t)},je.prototype.slice=function(t,e){var r=this.size;return I(t,e,r)?this:Ye(this,E(t,r),A(e,r))},je.prototype.__iterator=function(t,e){var r=0,n=Ce(this,e);return new Y((function(){var e=n();return e===Ae?P():B(t,r++,e)}))},je.prototype.__iterate=function(t,e){for(var r,n=0,i=Ce(this,e);(r=i())!==Ae&&!1!==t(r,n++,this););return n},je.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Te(this._origin,this._capacity,this._level,this._root,this._tail,t,this.__hash):(this.__ownerID=t,this)},je.isList=xe;var Ne="@@__IMMUTABLE_LIST__@@",Se=je.prototype;function De(t,e){this.array=t,this.ownerID=e}Se[Ne]=!0,Se[y]=Se.remove,Se.setIn=Jt.setIn,Se.deleteIn=Se.removeIn=Jt.removeIn,Se.update=Jt.update,Se.updateIn=Jt.updateIn,Se.mergeIn=Jt.mergeIn,Se.mergeDeepIn=Jt.mergeDeepIn,Se.withMutations=Jt.withMutations,Se.asMutable=Jt.asMutable,Se.asImmutable=Jt.asImmutable,Se.wasAltered=Jt.wasAltered,De.prototype.removeBefore=function(t,e,r){if(r===e?1<<e:0===this.array.length)return this;var n=r>>>e&w;if(n>=this.array.length)return new De([],t);var i,o=0===n;if(e>0){var s=this.array[n];if((i=s&&s.removeBefore(t,e-g,r))===s&&o)return this}if(o&&!i)return this;var u=Ue(this,t);if(!o)for(var a=0;a<n;a++)u.array[a]=void 0;return i&&(u.array[n]=i),u},De.prototype.removeAfter=function(t,e,r){if(r===(e?1<<e:0)||0===this.array.length)return this;var n,i=r-1>>>e&w;if(i>=this.array.length)return this;if(e>0){var o=this.array[i];if((n=o&&o.removeAfter(t,e-g,r))===o&&i===this.array.length-1)return this}var s=Ue(this,t);return s.array.splice(i+1),n&&(s.array[i]=n),s};var Ie,Ee,Ae={};function Ce(t,e){var r=t._origin,n=t._capacity,i=Pe(n),o=t._tail;return s(t._root,t._level,0);function s(t,e,r){return 0===e?u(t,r):a(t,e,r)}function u(t,s){var u=s===i?o&&o.array:t&&t.array,a=s>r?0:r-s,c=n-s;return c>v&&(c=v),function(){if(a===c)return Ae;var t=e?--c:a++;return u&&u[t]}}function a(t,i,o){var u,a=t&&t.array,c=o>r?0:r-o>>i,f=1+(n-o>>i);return f>v&&(f=v),function(){for(;;){if(u){var t=u();if(t!==Ae)return t;u=null}if(c===f)return Ae;var r=e?--f:c++;u=s(a&&a[r],i-g,o+(r<<i))}}}}function Te(t,e,r,n,i,o,s){var u=Object.create(Se);return u.size=e-t,u._origin=t,u._capacity=e,u._level=r,u._root=n,u._tail=i,u.__ownerID=o,u.__hash=s,u.__altered=!1,u}function Oe(){return Ie||(Ie=Te(0,0,g))}function ze(t,e,r){if((e=S(t,e))!=e)return t;if(e>=t.size||e<0)return t.withMutations((function(t){e<0?Ye(t,e).set(0,r):Ye(t,0,e+1).set(e,r)}));e+=t._origin;var n=t._tail,i=t._root,o=m(_);return e>=Pe(t._capacity)?n=ke(n,t.__ownerID,0,e,r,o):i=ke(i,t.__ownerID,t._level,e,r,o),o.value?t.__ownerID?(t._root=i,t._tail=n,t.__hash=void 0,t.__altered=!0,t):Te(t._origin,t._capacity,t._level,i,n):t}function ke(t,e,r,n,i,o){var s,u=n>>>r&w,a=t&&u<t.array.length;if(!a&&void 0===i)return t;if(r>0){var c=t&&t.array[u],f=ke(c,e,r-g,n,i,o);return f===c?t:((s=Ue(t,e)).array[u]=f,s)}return a&&t.array[u]===i?t:(b(o),s=Ue(t,e),void 0===i&&u===s.array.length-1?s.array.pop():s.array[u]=i,s)}function Ue(t,e){return e&&t&&e===t.ownerID?t:new De(t?t.array.slice():[],e)}function Re(t,e){if(e>=Pe(t._capacity))return t._tail;if(e<1<<t._level+g){for(var r=t._root,n=t._level;r&&n>0;)r=r.array[e>>>n&w],n-=g;return r}}function Ye(t,e,r){void 0!==e&&(e|=0),void 0!==r&&(r|=0);var n=t.__ownerID||new j,i=t._origin,o=t._capacity,s=i+e,u=void 0===r?o:r<0?o+r:i+r;if(s===i&&u===o)return t;if(s>=u)return t.clear();for(var a=t._level,c=t._root,f=0;s+f<0;)c=new De(c&&c.array.length?[void 0,c]:[],n),f+=1<<(a+=g);f&&(s+=f,i+=f,u+=f,o+=f);for(var l=Pe(o),h=Pe(u);h>=1<<a+g;)c=new De(c&&c.array.length?[c]:[],n),a+=g;var p=t._tail,d=h<l?Re(t,u-1):h>l?new De([],n):p;if(p&&h>l&&s<o&&p.array.length){for(var y=c=Ue(c,n),v=a;v>g;v-=g){var M=l>>>v&w;y=y.array[M]=Ue(y.array[M],n)}y.array[l>>>g&w]=p}if(u<o&&(d=d&&d.removeAfter(n,0,u)),s>=h)s-=h,u-=h,a=g,c=null,d=d&&d.removeBefore(n,0,s);else if(s>i||h<l){for(f=0;c;){var L=s>>>a&w;if(L!==h>>>a&w)break;L&&(f+=(1<<a)*L),a-=g,c=c.array[L]}c&&s>i&&(c=c.removeBefore(n,a,s-f)),c&&h<l&&(c=c.removeAfter(n,a,h-f)),f&&(s-=f,u-=f)}return t.__ownerID?(t.size=u-s,t._origin=s,t._capacity=u,t._level=a,t._root=c,t._tail=d,t.__hash=void 0,t.__altered=!0,t):Te(s,u,a,c,d)}function Be(t,e,r){for(var n=[],o=0,u=0;u<r.length;u++){var a=r[u],c=i(a);c.size>o&&(o=c.size),s(a)||(c=c.map((function(t){return pt(t)}))),n.push(c)}return o>t.size&&(t=t.setSize(o)),ye(t,e,n)}function Pe(t){return t<v?0:t-1>>>g<<g}function Qe(t){return null==t?We():Fe(t)?t:We().withMutations((function(e){var r=n(t);Ft(r.size),r.forEach((function(t,r){return e.set(r,t)}))}))}function Fe(t){return Wt(t)&&f(t)}function Ge(t,e,r,n){var i=Object.create(Qe.prototype);return i.size=t?t.size:0,i._map=t,i._list=e,i.__ownerID=r,i.__hash=n,i}function We(){return Ee||(Ee=Ge(ie(),Oe()))}function qe(t,e,r){var n,i,o=t._map,s=t._list,u=o.get(e),a=void 0!==u;if(r===M){if(!a)return t;s.size>=v&&s.size>=2*o.size?(n=(i=s.filter((function(t,e){return void 0!==t&&u!==e}))).toKeyedSeq().map((function(t){return t[0]})).flip().toMap(),t.__ownerID&&(n.__ownerID=i.__ownerID=t.__ownerID)):(n=o.remove(e),i=u===s.size-1?s.pop():s.set(u,void 0))}else if(a){if(r===s.get(u)[1])return t;n=o,i=s.set(u,[e,r])}else n=o.set(e,s.size),i=s.set(s.size,[e,r]);return t.__ownerID?(t.size=n.size,t._map=n,t._list=i,t.__hash=void 0,t):Ge(n,i)}function He(t,e){this._iter=t,this._useKeys=e,this.size=t.size}function Je(t){this._iter=t,this.size=t.size}function Ze(t){this._iter=t,this.size=t.size}function $e(t){this._iter=t,this.size=t.size}function Ve(t){var e=wr(t);return e._iter=t,e.size=t.size,e.flip=function(){return t},e.reverse=function(){var e=t.reverse.apply(this);return e.flip=function(){return t.reverse()},e},e.has=function(e){return t.includes(e)},e.includes=function(e){return t.has(e)},e.cacheResult=Mr,e.__iterateUncached=function(e,r){var n=this;return t.__iterate((function(t,r){return!1!==e(r,t,n)}),r)},e.__iteratorUncached=function(e,r){if(e===z){var n=t.__iterator(e,r);return new Y((function(){var t=n.next();if(!t.done){var e=t.value[0];t.value[0]=t.value[1],t.value[1]=e}return t}))}return t.__iterator(e===O?T:O,r)},e}function Xe(t,e,r){var n=wr(t);return n.size=t.size,n.has=function(e){return t.has(e)},n.get=function(n,i){var o=t.get(n,M);return o===M?i:e.call(r,o,n,t)},n.__iterateUncached=function(n,i){var o=this;return t.__iterate((function(t,i,s){return!1!==n(e.call(r,t,i,s),i,o)}),i)},n.__iteratorUncached=function(n,i){var o=t.__iterator(z,i);return new Y((function(){var i=o.next();if(i.done)return i;var s=i.value,u=s[0];return B(n,u,e.call(r,s[1],u,t),i)}))},n}function Ke(t,e){var r=wr(t);return r._iter=t,r.size=t.size,r.reverse=function(){return t},t.flip&&(r.flip=function(){var e=Ve(t);return e.reverse=function(){return t.flip()},e}),r.get=function(r,n){return t.get(e?r:-1-r,n)},r.has=function(r){return t.has(e?r:-1-r)},r.includes=function(e){return t.includes(e)},r.cacheResult=Mr,r.__iterate=function(e,r){var n=this;return t.__iterate((function(t,r){return e(t,r,n)}),!r)},r.__iterator=function(e,r){return t.__iterator(e,!r)},r}function tr(t,e,r,n){var i=wr(t);return n&&(i.has=function(n){var i=t.get(n,M);return i!==M&&!!e.call(r,i,n,t)},i.get=function(n,i){var o=t.get(n,M);return o!==M&&e.call(r,o,n,t)?o:i}),i.__iterateUncached=function(i,o){var s=this,u=0;return t.__iterate((function(t,o,a){if(e.call(r,t,o,a))return u++,i(t,n?o:u-1,s)}),o),u},i.__iteratorUncached=function(i,o){var s=t.__iterator(z,o),u=0;return new Y((function(){for(;;){var o=s.next();if(o.done)return o;var a=o.value,c=a[0],f=a[1];if(e.call(r,f,c,t))return B(i,n?c:u++,f,o)}}))},i}function er(t,e,r){var n=Gt().asMutable();return t.__iterate((function(i,o){n.update(e.call(r,i,o,t),0,(function(t){return t+1}))})),n.asImmutable()}function rr(t,e,r){var n=u(t),i=(f(t)?Qe():Gt()).asMutable();t.__iterate((function(o,s){i.update(e.call(r,o,s,t),(function(t){return(t=t||[]).push(n?[s,o]:o),t}))}));var o=vr(t);return i.map((function(e){return dr(t,o(e))}))}function nr(t,e,r,n){var i=t.size;if(void 0!==e&&(e|=0),void 0!==r&&(r===1/0?r=i:r|=0),I(e,r,i))return t;var o=E(e,i),s=A(r,i);if(o!=o||s!=s)return nr(t.toSeq().cacheResult(),e,r,n);var u,a=s-o;a==a&&(u=a<0?0:a);var c=wr(t);return c.size=0===u?u:t.size&&u||void 0,!n&&ot(t)&&u>=0&&(c.get=function(e,r){return(e=S(this,e))>=0&&e<u?t.get(e+o,r):r}),c.__iterateUncached=function(e,r){var i=this;if(0===u)return 0;if(r)return this.cacheResult().__iterate(e,r);var s=0,a=!0,c=0;return t.__iterate((function(t,r){if(!a||!(a=s++<o))return c++,!1!==e(t,n?r:c-1,i)&&c!==u})),c},c.__iteratorUncached=function(e,r){if(0!==u&&r)return this.cacheResult().__iterator(e,r);var i=0!==u&&t.__iterator(e,r),s=0,a=0;return new Y((function(){for(;s++<o;)i.next();if(++a>u)return P();var t=i.next();return n||e===O?t:B(e,a-1,e===T?void 0:t.value[1],t)}))},c}function ir(t,e,r){var n=wr(t);return n.__iterateUncached=function(n,i){var o=this;if(i)return this.cacheResult().__iterate(n,i);var s=0;return t.__iterate((function(t,i,u){return e.call(r,t,i,u)&&++s&&n(t,i,o)})),s},n.__iteratorUncached=function(n,i){var o=this;if(i)return this.cacheResult().__iterator(n,i);var s=t.__iterator(z,i),u=!0;return new Y((function(){if(!u)return P();var t=s.next();if(t.done)return t;var i=t.value,a=i[0],c=i[1];return e.call(r,c,a,o)?n===z?t:B(n,a,c,t):(u=!1,P())}))},n}function or(t,e,r,n){var i=wr(t);return i.__iterateUncached=function(i,o){var s=this;if(o)return this.cacheResult().__iterate(i,o);var u=!0,a=0;return t.__iterate((function(t,o,c){if(!u||!(u=e.call(r,t,o,c)))return a++,i(t,n?o:a-1,s)})),a},i.__iteratorUncached=function(i,o){var s=this;if(o)return this.cacheResult().__iterator(i,o);var u=t.__iterator(z,o),a=!0,c=0;return new Y((function(){var t,o,f;do{if((t=u.next()).done)return n||i===O?t:B(i,c++,i===T?void 0:t.value[1],t);var l=t.value;o=l[0],f=l[1],a&&(a=e.call(r,f,o,s))}while(a);return i===z?t:B(i,o,f,t)}))},i}function sr(t,e){var r=u(t),i=[t].concat(e).map((function(t){return s(t)?r&&(t=n(t)):t=r?ut(t):at(Array.isArray(t)?t:[t]),t})).filter((function(t){return 0!==t.size}));if(0===i.length)return t;if(1===i.length){var o=i[0];if(o===t||r&&u(o)||a(t)&&a(o))return o}var c=new et(i);return r?c=c.toKeyedSeq():a(t)||(c=c.toSetSeq()),(c=c.flatten(!0)).size=i.reduce((function(t,e){if(void 0!==t){var r=e.size;if(void 0!==r)return t+r}}),0),c}function ur(t,e,r){var n=wr(t);return n.__iterateUncached=function(n,i){var o=0,u=!1;function a(t,c){var f=this;t.__iterate((function(t,i){return(!e||c<e)&&s(t)?a(t,c+1):!1===n(t,r?i:o++,f)&&(u=!0),!u}),i)}return a(t,0),o},n.__iteratorUncached=function(n,i){var o=t.__iterator(n,i),u=[],a=0;return new Y((function(){for(;o;){var t=o.next();if(!1===t.done){var c=t.value;if(n===z&&(c=c[1]),e&&!(u.length<e)||!s(c))return r?t:B(n,a++,c,t);u.push(o),o=c.__iterator(n,i)}else o=u.pop()}return P()}))},n}function ar(t,e,r){var n=vr(t);return t.toSeq().map((function(i,o){return n(e.call(r,i,o,t))})).flatten(!0)}function cr(t,e){var r=wr(t);return r.size=t.size&&2*t.size-1,r.__iterateUncached=function(r,n){var i=this,o=0;return t.__iterate((function(t,n){return(!o||!1!==r(e,o++,i))&&!1!==r(t,o++,i)}),n),o},r.__iteratorUncached=function(r,n){var i,o=t.__iterator(O,n),s=0;return new Y((function(){return(!i||s%2)&&(i=o.next()).done?i:s%2?B(r,s++,e):B(r,s++,i.value,i)}))},r}function fr(t,e,r){e||(e=Lr);var n=u(t),i=0,o=t.toSeq().map((function(e,n){return[n,e,i++,r?r(e,n,t):e]})).toArray();return o.sort((function(t,r){return e(t[3],r[3])||t[2]-r[2]})).forEach(n?function(t,e){o[e].length=2}:function(t,e){o[e]=t[1]}),n?J(o):a(t)?Z(o):$(o)}function lr(t,e,r){if(e||(e=Lr),r){var n=t.toSeq().map((function(e,n){return[e,r(e,n,t)]})).reduce((function(t,r){return hr(e,t[1],r[1])?r:t}));return n&&n[0]}return t.reduce((function(t,r){return hr(e,t,r)?r:t}))}function hr(t,e,r){var n=t(r,e);return 0===n&&r!==e&&(null==r||r!=r)||n>0}function pr(t,e,n){var i=wr(t);return i.size=new et(n).map((function(t){return t.size})).min(),i.__iterate=function(t,e){for(var r,n=this.__iterator(O,e),i=0;!(r=n.next()).done&&!1!==t(r.value,i++,this););return i},i.__iteratorUncached=function(t,i){var o=n.map((function(t){return t=r(t),G(i?t.reverse():t)})),s=0,u=!1;return new Y((function(){var r;return u||(r=o.map((function(t){return t.next()})),u=r.some((function(t){return t.done}))),u?P():B(t,s++,e.apply(null,r.map((function(t){return t.value}))))}))},i}function dr(t,e){return ot(t)?e:t.constructor(e)}function yr(t){if(t!==Object(t))throw new TypeError("Expected [K, V] tuple: "+t)}function gr(t){return Ft(t.size),N(t)}function vr(t){return u(t)?n:a(t)?i:o}function wr(t){return Object.create((u(t)?J:a(t)?Z:$).prototype)}function Mr(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):H.prototype.cacheResult.call(this)}function Lr(t,e){return t>e?1:t<e?-1:0}function _r(t){var e=G(t);if(!e){if(!q(t))throw new TypeError("Expected iterable or array-like: "+t);e=G(r(t))}return e}function mr(t,e){var r,n=function(o){if(o instanceof n)return o;if(!(this instanceof n))return new n(o);if(!r){r=!0;var s=Object.keys(t);Nr(i,s),i.size=s.length,i._name=e,i._keys=s,i._defaultValues=t}this._map=Gt(o)},i=n.prototype=Object.create(br);return i.constructor=n,n}e(Qe,Gt),Qe.of=function(){return this(arguments)},Qe.prototype.toString=function(){return this.__toString("OrderedMap {","}")},Qe.prototype.get=function(t,e){var r=this._map.get(t);return void 0!==r?this._list.get(r)[1]:e},Qe.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this):We()},Qe.prototype.set=function(t,e){return qe(this,t,e)},Qe.prototype.remove=function(t){return qe(this,t,M)},Qe.prototype.wasAltered=function(){return this._map.wasAltered()||this._list.wasAltered()},Qe.prototype.__iterate=function(t,e){var r=this;return this._list.__iterate((function(e){return e&&t(e[1],e[0],r)}),e)},Qe.prototype.__iterator=function(t,e){return this._list.fromEntrySeq().__iterator(t,e)},Qe.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t),r=this._list.__ensureOwner(t);return t?Ge(e,r,t,this.__hash):(this.__ownerID=t,this._map=e,this._list=r,this)},Qe.isOrderedMap=Fe,Qe.prototype[d]=!0,Qe.prototype[y]=Qe.prototype.remove,e(He,J),He.prototype.get=function(t,e){return this._iter.get(t,e)},He.prototype.has=function(t){return this._iter.has(t)},He.prototype.valueSeq=function(){return this._iter.valueSeq()},He.prototype.reverse=function(){var t=this,e=Ke(this,!0);return this._useKeys||(e.valueSeq=function(){return t._iter.toSeq().reverse()}),e},He.prototype.map=function(t,e){var r=this,n=Xe(this,t,e);return this._useKeys||(n.valueSeq=function(){return r._iter.toSeq().map(t,e)}),n},He.prototype.__iterate=function(t,e){var r,n=this;return this._iter.__iterate(this._useKeys?function(e,r){return t(e,r,n)}:(r=e?gr(this):0,function(i){return t(i,e?--r:r++,n)}),e)},He.prototype.__iterator=function(t,e){if(this._useKeys)return this._iter.__iterator(t,e);var r=this._iter.__iterator(O,e),n=e?gr(this):0;return new Y((function(){var i=r.next();return i.done?i:B(t,e?--n:n++,i.value,i)}))},He.prototype[d]=!0,e(Je,Z),Je.prototype.includes=function(t){return this._iter.includes(t)},Je.prototype.__iterate=function(t,e){var r=this,n=0;return this._iter.__iterate((function(e){return t(e,n++,r)}),e)},Je.prototype.__iterator=function(t,e){var r=this._iter.__iterator(O,e),n=0;return new Y((function(){var e=r.next();return e.done?e:B(t,n++,e.value,e)}))},e(Ze,$),Ze.prototype.has=function(t){return this._iter.includes(t)},Ze.prototype.__iterate=function(t,e){var r=this;return this._iter.__iterate((function(e){return t(e,e,r)}),e)},Ze.prototype.__iterator=function(t,e){var r=this._iter.__iterator(O,e);return new Y((function(){var e=r.next();return e.done?e:B(t,e.value,e.value,e)}))},e($e,J),$e.prototype.entrySeq=function(){return this._iter.toSeq()},$e.prototype.__iterate=function(t,e){var r=this;return this._iter.__iterate((function(e){if(e){yr(e);var n=s(e);return t(n?e.get(1):e[1],n?e.get(0):e[0],r)}}),e)},$e.prototype.__iterator=function(t,e){var r=this._iter.__iterator(O,e);return new Y((function(){for(;;){var e=r.next();if(e.done)return e;var n=e.value;if(n){yr(n);var i=s(n);return B(t,i?n.get(0):n[0],i?n.get(1):n[1],e)}}}))},Je.prototype.cacheResult=He.prototype.cacheResult=Ze.prototype.cacheResult=$e.prototype.cacheResult=Mr,e(mr,bt),mr.prototype.toString=function(){return this.__toString(xr(this)+" {","}")},mr.prototype.has=function(t){return this._defaultValues.hasOwnProperty(t)},mr.prototype.get=function(t,e){if(!this.has(t))return e;var r=this._defaultValues[t];return this._map?this._map.get(t,r):r},mr.prototype.clear=function(){if(this.__ownerID)return this._map&&this._map.clear(),this;var t=this.constructor;return t._empty||(t._empty=jr(this,ie()))},mr.prototype.set=function(t,e){if(!this.has(t))throw new Error('Cannot set unknown key "'+t+'" on '+xr(this));if(this._map&&!this._map.has(t)&&e===this._defaultValues[t])return this;var r=this._map&&this._map.set(t,e);return this.__ownerID||r===this._map?this:jr(this,r)},mr.prototype.remove=function(t){if(!this.has(t))return this;var e=this._map&&this._map.remove(t);return this.__ownerID||e===this._map?this:jr(this,e)},mr.prototype.wasAltered=function(){return this._map.wasAltered()},mr.prototype.__iterator=function(t,e){var r=this;return n(this._defaultValues).map((function(t,e){return r.get(e)})).__iterator(t,e)},mr.prototype.__iterate=function(t,e){var r=this;return n(this._defaultValues).map((function(t,e){return r.get(e)})).__iterate(t,e)},mr.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map&&this._map.__ensureOwner(t);return t?jr(this,e,t):(this.__ownerID=t,this._map=e,this)};var br=mr.prototype;function jr(t,e,r){var n=Object.create(Object.getPrototypeOf(t));return n._map=e,n.__ownerID=r,n}function xr(t){return t._name||t.constructor.name||"Record"}function Nr(t,e){try{e.forEach(Sr.bind(void 0,t))}catch(t){}}function Sr(t,e){Object.defineProperty(t,e,{get:function(){return this.get(e)},set:function(t){Lt(this.__ownerID,"Cannot set on an immutable record."),this.set(e,t)}})}function Dr(t){return null==t?zr():Ir(t)&&!f(t)?t:zr().withMutations((function(e){var r=o(t);Ft(r.size),r.forEach((function(t){return e.add(t)}))}))}function Ir(t){return!(!t||!t[Ar])}br[y]=br.remove,br.deleteIn=br.removeIn=Jt.removeIn,br.merge=Jt.merge,br.mergeWith=Jt.mergeWith,br.mergeIn=Jt.mergeIn,br.mergeDeep=Jt.mergeDeep,br.mergeDeepWith=Jt.mergeDeepWith,br.mergeDeepIn=Jt.mergeDeepIn,br.setIn=Jt.setIn,br.update=Jt.update,br.updateIn=Jt.updateIn,br.withMutations=Jt.withMutations,br.asMutable=Jt.asMutable,br.asImmutable=Jt.asImmutable,e(Dr,xt),Dr.of=function(){return this(arguments)},Dr.fromKeys=function(t){return this(n(t).keySeq())},Dr.prototype.toString=function(){return this.__toString("Set {","}")},Dr.prototype.has=function(t){return this._map.has(t)},Dr.prototype.add=function(t){return Tr(this,this._map.set(t,!0))},Dr.prototype.remove=function(t){return Tr(this,this._map.remove(t))},Dr.prototype.clear=function(){return Tr(this,this._map.clear())},Dr.prototype.union=function(){var e=t.call(arguments,0);return 0===(e=e.filter((function(t){return 0!==t.size}))).length?this:0!==this.size||this.__ownerID||1!==e.length?this.withMutations((function(t){for(var r=0;r<e.length;r++)o(e[r]).forEach((function(e){return t.add(e)}))})):this.constructor(e[0])},Dr.prototype.intersect=function(){var e=t.call(arguments,0);if(0===e.length)return this;e=e.map((function(t){return o(t)}));var r=this;return this.withMutations((function(t){r.forEach((function(r){e.every((function(t){return t.includes(r)}))||t.remove(r)}))}))},Dr.prototype.subtract=function(){var e=t.call(arguments,0);if(0===e.length)return this;e=e.map((function(t){return o(t)}));var r=this;return this.withMutations((function(t){r.forEach((function(r){e.some((function(t){return t.includes(r)}))&&t.remove(r)}))}))},Dr.prototype.merge=function(){return this.union.apply(this,arguments)},Dr.prototype.mergeWith=function(e){var r=t.call(arguments,1);return this.union.apply(this,r)},Dr.prototype.sort=function(t){return kr(fr(this,t))},Dr.prototype.sortBy=function(t,e){return kr(fr(this,e,t))},Dr.prototype.wasAltered=function(){return this._map.wasAltered()},Dr.prototype.__iterate=function(t,e){var r=this;return this._map.__iterate((function(e,n){return t(n,n,r)}),e)},Dr.prototype.__iterator=function(t,e){return this._map.map((function(t,e){return e})).__iterator(t,e)},Dr.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t);return t?this.__make(e,t):(this.__ownerID=t,this._map=e,this)},Dr.isSet=Ir;var Er,Ar="@@__IMMUTABLE_SET__@@",Cr=Dr.prototype;function Tr(t,e){return t.__ownerID?(t.size=e.size,t._map=e,t):e===t._map?t:0===e.size?t.__empty():t.__make(e)}function Or(t,e){var r=Object.create(Cr);return r.size=t?t.size:0,r._map=t,r.__ownerID=e,r}function zr(){return Er||(Er=Or(ie()))}function kr(t){return null==t?Pr():Ur(t)?t:Pr().withMutations((function(e){var r=o(t);Ft(r.size),r.forEach((function(t){return e.add(t)}))}))}function Ur(t){return Ir(t)&&f(t)}Cr[Ar]=!0,Cr[y]=Cr.remove,Cr.mergeDeep=Cr.merge,Cr.mergeDeepWith=Cr.mergeWith,Cr.withMutations=Jt.withMutations,Cr.asMutable=Jt.asMutable,Cr.asImmutable=Jt.asImmutable,Cr.__empty=zr,Cr.__make=Or,e(kr,Dr),kr.of=function(){return this(arguments)},kr.fromKeys=function(t){return this(n(t).keySeq())},kr.prototype.toString=function(){return this.__toString("OrderedSet {","}")},kr.isOrderedSet=Ur;var Rr,Yr=kr.prototype;function Br(t,e){var r=Object.create(Yr);return r.size=t?t.size:0,r._map=t,r.__ownerID=e,r}function Pr(){return Rr||(Rr=Br(We()))}function Qr(t){return null==t?Jr():Fr(t)?t:Jr().unshiftAll(t)}function Fr(t){return!(!t||!t[Wr])}Yr[d]=!0,Yr.__empty=Pr,Yr.__make=Br,e(Qr,jt),Qr.of=function(){return this(arguments)},Qr.prototype.toString=function(){return this.__toString("Stack [","]")},Qr.prototype.get=function(t,e){var r=this._head;for(t=S(this,t);r&&t--;)r=r.next;return r?r.value:e},Qr.prototype.peek=function(){return this._head&&this._head.value},Qr.prototype.push=function(){if(0===arguments.length)return this;for(var t=this.size+arguments.length,e=this._head,r=arguments.length-1;r>=0;r--)e={value:arguments[r],next:e};return this.__ownerID?(this.size=t,this._head=e,this.__hash=void 0,this.__altered=!0,this):Hr(t,e)},Qr.prototype.pushAll=function(t){if(0===(t=i(t)).size)return this;Ft(t.size);var e=this.size,r=this._head;return t.reverse().forEach((function(t){e++,r={value:t,next:r}})),this.__ownerID?(this.size=e,this._head=r,this.__hash=void 0,this.__altered=!0,this):Hr(e,r)},Qr.prototype.pop=function(){return this.slice(1)},Qr.prototype.unshift=function(){return this.push.apply(this,arguments)},Qr.prototype.unshiftAll=function(t){return this.pushAll(t)},Qr.prototype.shift=function(){return this.pop.apply(this,arguments)},Qr.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):Jr()},Qr.prototype.slice=function(t,e){if(I(t,e,this.size))return this;var r=E(t,this.size);if(A(e,this.size)!==this.size)return jt.prototype.slice.call(this,t,e);for(var n=this.size-r,i=this._head;r--;)i=i.next;return this.__ownerID?(this.size=n,this._head=i,this.__hash=void 0,this.__altered=!0,this):Hr(n,i)},Qr.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Hr(this.size,this._head,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)},Qr.prototype.__iterate=function(t,e){if(e)return this.reverse().__iterate(t);for(var r=0,n=this._head;n&&!1!==t(n.value,r++,this);)n=n.next;return r},Qr.prototype.__iterator=function(t,e){if(e)return this.reverse().__iterator(t);var r=0,n=this._head;return new Y((function(){if(n){var e=n.value;return n=n.next,B(t,r++,e)}return P()}))},Qr.isStack=Fr;var Gr,Wr="@@__IMMUTABLE_STACK__@@",qr=Qr.prototype;function Hr(t,e,r,n){var i=Object.create(qr);return i.size=t,i._head=e,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function Jr(){return Gr||(Gr=Hr(0))}function Zr(t,e){var r=function(r){t.prototype[r]=e[r]};return Object.keys(e).forEach(r),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(e).forEach(r),t}qr[Wr]=!0,qr.withMutations=Jt.withMutations,qr.asMutable=Jt.asMutable,qr.asImmutable=Jt.asImmutable,qr.wasAltered=Jt.wasAltered,r.Iterator=Y,Zr(r,{toArray:function(){Ft(this.size);var t=new Array(this.size||0);return this.valueSeq().__iterate((function(e,r){t[r]=e})),t},toIndexedSeq:function(){return new Je(this)},toJS:function(){return this.toSeq().map((function(t){return t&&"function"==typeof t.toJS?t.toJS():t})).__toJS()},toJSON:function(){return this.toSeq().map((function(t){return t&&"function"==typeof t.toJSON?t.toJSON():t})).__toJS()},toKeyedSeq:function(){return new He(this,!0)},toMap:function(){return Gt(this.toKeyedSeq())},toObject:function(){Ft(this.size);var t={};return this.__iterate((function(e,r){t[r]=e})),t},toOrderedMap:function(){return Qe(this.toKeyedSeq())},toOrderedSet:function(){return kr(u(this)?this.valueSeq():this)},toSet:function(){return Dr(u(this)?this.valueSeq():this)},toSetSeq:function(){return new Ze(this)},toSeq:function(){return a(this)?this.toIndexedSeq():u(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return Qr(u(this)?this.valueSeq():this)},toList:function(){return je(u(this)?this.valueSeq():this)},toString:function(){return"[Iterable]"},__toString:function(t,e){return 0===this.size?t+e:t+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+e},concat:function(){return dr(this,sr(this,t.call(arguments,0)))},includes:function(t){return this.some((function(e){return vt(e,t)}))},entries:function(){return this.__iterator(z)},every:function(t,e){Ft(this.size);var r=!0;return this.__iterate((function(n,i,o){if(!t.call(e,n,i,o))return r=!1,!1})),r},filter:function(t,e){return dr(this,tr(this,t,e,!0))},find:function(t,e,r){var n=this.findEntry(t,e);return n?n[1]:r},forEach:function(t,e){return Ft(this.size),this.__iterate(e?t.bind(e):t)},join:function(t){Ft(this.size),t=void 0!==t?""+t:",";var e="",r=!0;return this.__iterate((function(n){r?r=!1:e+=t,e+=null!=n?n.toString():""})),e},keys:function(){return this.__iterator(T)},map:function(t,e){return dr(this,Xe(this,t,e))},reduce:function(t,e,r){var n,i;return Ft(this.size),arguments.length<2?i=!0:n=e,this.__iterate((function(e,o,s){i?(i=!1,n=e):n=t.call(r,n,e,o,s)})),n},reduceRight:function(t,e,r){var n=this.toKeyedSeq().reverse();return n.reduce.apply(n,arguments)},reverse:function(){return dr(this,Ke(this,!0))},slice:function(t,e){return dr(this,nr(this,t,e,!0))},some:function(t,e){return!this.every(tn(t),e)},sort:function(t){return dr(this,fr(this,t))},values:function(){return this.__iterator(O)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some((function(){return!0}))},count:function(t,e){return N(t?this.toSeq().filter(t,e):this)},countBy:function(t,e){return er(this,t,e)},equals:function(t){return wt(this,t)},entrySeq:function(){var t=this;if(t._cache)return new et(t._cache);var e=t.toSeq().map(Kr).toIndexedSeq();return e.fromEntrySeq=function(){return t.toSeq()},e},filterNot:function(t,e){return this.filter(tn(t),e)},findEntry:function(t,e,r){var n=r;return this.__iterate((function(r,i,o){if(t.call(e,r,i,o))return n=[i,r],!1})),n},findKey:function(t,e){var r=this.findEntry(t,e);return r&&r[0]},findLast:function(t,e,r){return this.toKeyedSeq().reverse().find(t,e,r)},findLastEntry:function(t,e,r){return this.toKeyedSeq().reverse().findEntry(t,e,r)},findLastKey:function(t,e){return this.toKeyedSeq().reverse().findKey(t,e)},first:function(){return this.find(D)},flatMap:function(t,e){return dr(this,ar(this,t,e))},flatten:function(t){return dr(this,ur(this,t,!0))},fromEntrySeq:function(){return new $e(this)},get:function(t,e){return this.find((function(e,r){return vt(r,t)}),void 0,e)},getIn:function(t,e){for(var r,n=this,i=_r(t);!(r=i.next()).done;){var o=r.value;if((n=n&&n.get?n.get(o,M):M)===M)return e}return n},groupBy:function(t,e){return rr(this,t,e)},has:function(t){return this.get(t,M)!==M},hasIn:function(t){return this.getIn(t,M)!==M},isSubset:function(t){return t="function"==typeof t.includes?t:r(t),this.every((function(e){return t.includes(e)}))},isSuperset:function(t){return(t="function"==typeof t.isSubset?t:r(t)).isSubset(this)},keyOf:function(t){return this.findKey((function(e){return vt(e,t)}))},keySeq:function(){return this.toSeq().map(Xr).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},lastKeyOf:function(t){return this.toKeyedSeq().reverse().keyOf(t)},max:function(t){return lr(this,t)},maxBy:function(t,e){return lr(this,e,t)},min:function(t){return lr(this,t?en(t):on)},minBy:function(t,e){return lr(this,e?en(e):on,t)},rest:function(){return this.slice(1)},skip:function(t){return this.slice(Math.max(0,t))},skipLast:function(t){return dr(this,this.toSeq().reverse().skip(t).reverse())},skipWhile:function(t,e){return dr(this,or(this,t,e,!0))},skipUntil:function(t,e){return this.skipWhile(tn(t),e)},sortBy:function(t,e){return dr(this,fr(this,e,t))},take:function(t){return this.slice(0,Math.max(0,t))},takeLast:function(t){return dr(this,this.toSeq().reverse().take(t).reverse())},takeWhile:function(t,e){return dr(this,ir(this,t,e))},takeUntil:function(t,e){return this.takeWhile(tn(t),e)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=sn(this))}});var $r=r.prototype;$r[l]=!0,$r[R]=$r.values,$r.__toJS=$r.toArray,$r.__toStringMapper=rn,$r.inspect=$r.toSource=function(){return this.toString()},$r.chain=$r.flatMap,$r.contains=$r.includes,Zr(n,{flip:function(){return dr(this,Ve(this))},mapEntries:function(t,e){var r=this,n=0;return dr(this,this.toSeq().map((function(i,o){return t.call(e,[o,i],n++,r)})).fromEntrySeq())},mapKeys:function(t,e){var r=this;return dr(this,this.toSeq().flip().map((function(n,i){return t.call(e,n,i,r)})).flip())}});var Vr=n.prototype;function Xr(t,e){return e}function Kr(t,e){return[e,t]}function tn(t){return function(){return!t.apply(this,arguments)}}function en(t){return function(){return-t.apply(this,arguments)}}function rn(t){return"string"==typeof t?JSON.stringify(t):String(t)}function nn(){return x(arguments)}function on(t,e){return t<e?1:t>e?-1:0}function sn(t){if(t.size===1/0)return 0;var e=f(t),r=u(t),n=e?1:0;return un(t.__iterate(r?e?function(t,e){n=31*n+an(Dt(t),Dt(e))|0}:function(t,e){n=n+an(Dt(t),Dt(e))|0}:e?function(t){n=31*n+Dt(t)|0}:function(t){n=n+Dt(t)|0}),n)}function un(t,e){return e=Nt(e,3432918353),e=Nt(e<<15|e>>>-15,461845907),e=Nt(e<<13|e>>>-13,5),e=Nt((e=(e+3864292196|0)^t)^e>>>16,2246822507),e=St((e=Nt(e^e>>>13,3266489909))^e>>>16)}function an(t,e){return t^e+2654435769+(t<<6)+(t>>2)|0}return Vr[h]=!0,Vr[R]=$r.entries,Vr.__toJS=$r.toObject,Vr.__toStringMapper=function(t,e){return JSON.stringify(e)+": "+rn(t)},Zr(i,{toKeyedSeq:function(){return new He(this,!1)},filter:function(t,e){return dr(this,tr(this,t,e,!1))},findIndex:function(t,e){var r=this.findEntry(t,e);return r?r[0]:-1},indexOf:function(t){var e=this.keyOf(t);return void 0===e?-1:e},lastIndexOf:function(t){var e=this.lastKeyOf(t);return void 0===e?-1:e},reverse:function(){return dr(this,Ke(this,!1))},slice:function(t,e){return dr(this,nr(this,t,e,!1))},splice:function(t,e){var r=arguments.length;if(e=Math.max(0|e,0),0===r||2===r&&!e)return this;t=E(t,t<0?this.count():this.size);var n=this.slice(0,t);return dr(this,1===r?n:n.concat(x(arguments,2),this.slice(t+e)))},findLastIndex:function(t,e){var r=this.findLastEntry(t,e);return r?r[0]:-1},first:function(){return this.get(0)},flatten:function(t){return dr(this,ur(this,t,!1))},get:function(t,e){return(t=S(this,t))<0||this.size===1/0||void 0!==this.size&&t>this.size?e:this.find((function(e,r){return r===t}),void 0,e)},has:function(t){return(t=S(this,t))>=0&&(void 0!==this.size?this.size===1/0||t<this.size:-1!==this.indexOf(t))},interpose:function(t){return dr(this,cr(this,t))},interleave:function(){var t=[this].concat(x(arguments)),e=pr(this.toSeq(),Z.of,t),r=e.flatten(!0);return e.size&&(r.size=e.size*t.length),dr(this,r)},keySeq:function(){return _t(0,this.size)},last:function(){return this.get(-1)},skipWhile:function(t,e){return dr(this,or(this,t,e,!1))},zip:function(){return dr(this,pr(this,nn,[this].concat(x(arguments))))},zipWith:function(t){var e=x(arguments);return e[0]=this,dr(this,pr(this,t,e))}}),i.prototype[p]=!0,i.prototype[d]=!0,Zr(o,{get:function(t,e){return this.has(t)?t:e},includes:function(t){return this.has(t)},keySeq:function(){return this.valueSeq()}}),o.prototype.has=$r.includes,o.prototype.contains=o.prototype.includes,Zr(J,n.prototype),Zr(Z,i.prototype),Zr($,o.prototype),Zr(bt,n.prototype),Zr(jt,i.prototype),Zr(xt,o.prototype),{Iterable:r,Seq:H,Collection:mt,Map:Gt,OrderedMap:Qe,List:je,Stack:Qr,Set:Dr,OrderedSet:kr,Record:mr,Range:_t,Repeat:Mt,is:vt,fromJS:pt}}()},5717:t=>{"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},8552:(t,e,r)=>{var n=r(852)(r(5639),"DataView");t.exports=n},1989:(t,e,r)=>{var n=r(1789),i=r(401),o=r(7667),s=r(1327),u=r(1866);function a(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}a.prototype.clear=n,a.prototype.delete=i,a.prototype.get=o,a.prototype.has=s,a.prototype.set=u,t.exports=a},8407:(t,e,r)=>{var n=r(7040),i=r(4125),o=r(2117),s=r(7518),u=r(4705);function a(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}a.prototype.clear=n,a.prototype.delete=i,a.prototype.get=o,a.prototype.has=s,a.prototype.set=u,t.exports=a},7071:(t,e,r)=>{var n=r(852)(r(5639),"Map");t.exports=n},3369:(t,e,r)=>{var n=r(4785),i=r(1285),o=r(6e3),s=r(9916),u=r(5265);function a(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}a.prototype.clear=n,a.prototype.delete=i,a.prototype.get=o,a.prototype.has=s,a.prototype.set=u,t.exports=a},3818:(t,e,r)=>{var n=r(852)(r(5639),"Promise");t.exports=n},8525:(t,e,r)=>{var n=r(852)(r(5639),"Set");t.exports=n},8668:(t,e,r)=>{var n=r(3369),i=r(619),o=r(2385);function s(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new n;++e<r;)this.add(t[e])}s.prototype.add=s.prototype.push=i,s.prototype.has=o,t.exports=s},6384:(t,e,r)=>{var n=r(8407),i=r(7465),o=r(3779),s=r(7599),u=r(4758),a=r(4309);function c(t){var e=this.__data__=new n(t);this.size=e.size}c.prototype.clear=i,c.prototype.delete=o,c.prototype.get=s,c.prototype.has=u,c.prototype.set=a,t.exports=c},2705:(t,e,r)=>{var n=r(5639).Symbol;t.exports=n},1149:(t,e,r)=>{var n=r(5639).Uint8Array;t.exports=n},577:(t,e,r)=>{var n=r(852)(r(5639),"WeakMap");t.exports=n},4963:t=>{t.exports=function(t,e){for(var r=-1,n=null==t?0:t.length,i=0,o=[];++r<n;){var s=t[r];e(s,r,t)&&(o[i++]=s)}return o}},4636:(t,e,r)=>{var n=r(2545),i=r(5694),o=r(1469),s=r(4144),u=r(5776),a=r(6719),c=Object.prototype.hasOwnProperty;t.exports=function(t,e){var r=o(t),f=!r&&i(t),l=!r&&!f&&s(t),h=!r&&!f&&!l&&a(t),p=r||f||l||h,d=p?n(t.length,String):[],y=d.length;for(var g in t)!e&&!c.call(t,g)||p&&("length"==g||l&&("offset"==g||"parent"==g)||h&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||u(g,y))||d.push(g);return d}},9932:t=>{t.exports=function(t,e){for(var r=-1,n=null==t?0:t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}},2488:t=>{t.exports=function(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}},2663:t=>{t.exports=function(t,e,r,n){var i=-1,o=null==t?0:t.length;for(n&&o&&(r=t[++i]);++i<o;)r=e(r,t[i],i,t);return r}},4855:t=>{t.exports=function(t,e){for(var r=-1,n=null==t?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}},4286:t=>{t.exports=function(t){return t.split("")}},9029:t=>{var e=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;t.exports=function(t){return t.match(e)||[]}},4865:(t,e,r)=>{var n=r(9465),i=r(7813),o=Object.prototype.hasOwnProperty;t.exports=function(t,e,r){var s=t[e];o.call(t,e)&&i(s,r)&&(void 0!==r||e in t)||n(t,e,r)}},8470:(t,e,r)=>{var n=r(7813);t.exports=function(t,e){for(var r=t.length;r--;)if(n(t[r][0],e))return r;return-1}},9465:(t,e,r)=>{var n=r(8777);t.exports=function(t,e,r){"__proto__"==e&&n?n(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}},9881:(t,e,r)=>{var n=r(7816),i=r(9291)(n);t.exports=i},1848:t=>{t.exports=function(t,e,r,n){for(var i=t.length,o=r+(n?1:-1);n?o--:++o<i;)if(e(t[o],o,t))return o;return-1}},8483:(t,e,r)=>{var n=r(5063)();t.exports=n},7816:(t,e,r)=>{var n=r(8483),i=r(3674);t.exports=function(t,e){return t&&n(t,e,i)}},7786:(t,e,r)=>{var n=r(1811),i=r(327);t.exports=function(t,e){for(var r=0,o=(e=n(e,t)).length;null!=t&&r<o;)t=t[i(e[r++])];return r&&r==o?t:void 0}},8866:(t,e,r)=>{var n=r(2488),i=r(1469);t.exports=function(t,e,r){var o=e(t);return i(t)?o:n(o,r(t))}},4239:(t,e,r)=>{var n=r(2705),i=r(9607),o=r(2333),s=n?n.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":s&&s in Object(t)?i(t):o(t)}},13:t=>{t.exports=function(t,e){return null!=t&&e in Object(t)}},9454:(t,e,r)=>{var n=r(4239),i=r(7005);t.exports=function(t){return i(t)&&"[object Arguments]"==n(t)}},939:(t,e,r)=>{var n=r(2492),i=r(7005);t.exports=function t(e,r,o,s,u){return e===r||(null==e||null==r||!i(e)&&!i(r)?e!=e&&r!=r:n(e,r,o,s,t,u))}},2492:(t,e,r)=>{var n=r(6384),i=r(7114),o=r(8351),s=r(6096),u=r(8882),a=r(1469),c=r(4144),f=r(6719),l="[object Arguments]",h="[object Array]",p="[object Object]",d=Object.prototype.hasOwnProperty;t.exports=function(t,e,r,y,g,v){var w=a(t),M=a(e),L=w?h:u(t),_=M?h:u(e),m=(L=L==l?p:L)==p,b=(_=_==l?p:_)==p,j=L==_;if(j&&c(t)){if(!c(e))return!1;w=!0,m=!1}if(j&&!m)return v||(v=new n),w||f(t)?i(t,e,r,y,g,v):o(t,e,L,r,y,g,v);if(!(1&r)){var x=m&&d.call(t,"__wrapped__"),N=b&&d.call(e,"__wrapped__");if(x||N){var S=x?t.value():t,D=N?e.value():e;return v||(v=new n),g(S,D,r,y,v)}}return!!j&&(v||(v=new n),s(t,e,r,y,g,v))}},2958:(t,e,r)=>{var n=r(6384),i=r(939);t.exports=function(t,e,r,o){var s=r.length,u=s,a=!o;if(null==t)return!u;for(t=Object(t);s--;){var c=r[s];if(a&&c[2]?c[1]!==t[c[0]]:!(c[0]in t))return!1}for(;++s<u;){var f=(c=r[s])[0],l=t[f],h=c[1];if(a&&c[2]){if(void 0===l&&!(f in t))return!1}else{var p=new n;if(o)var d=o(l,h,f,t,e,p);if(!(void 0===d?i(h,l,3,o,p):d))return!1}}return!0}},8458:(t,e,r)=>{var n=r(3560),i=r(5346),o=r(3218),s=r(346),u=/^\[object .+?Constructor\]$/,a=Function.prototype,c=Object.prototype,f=a.toString,l=c.hasOwnProperty,h=RegExp("^"+f.call(l).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(t){return!(!o(t)||i(t))&&(n(t)?h:u).test(s(t))}},8749:(t,e,r)=>{var n=r(4239),i=r(1780),o=r(7005),s={};s["[object Float32Array]"]=s["[object Float64Array]"]=s["[object Int8Array]"]=s["[object Int16Array]"]=s["[object Int32Array]"]=s["[object Uint8Array]"]=s["[object Uint8ClampedArray]"]=s["[object Uint16Array]"]=s["[object Uint32Array]"]=!0,s["[object Arguments]"]=s["[object Array]"]=s["[object ArrayBuffer]"]=s["[object Boolean]"]=s["[object DataView]"]=s["[object Date]"]=s["[object Error]"]=s["[object Function]"]=s["[object Map]"]=s["[object Number]"]=s["[object Object]"]=s["[object RegExp]"]=s["[object Set]"]=s["[object String]"]=s["[object WeakMap]"]=!1,t.exports=function(t){return o(t)&&i(t.length)&&!!s[n(t)]}},7206:(t,e,r)=>{var n=r(1573),i=r(6432),o=r(6557),s=r(1469),u=r(1733);t.exports=function(t){return"function"==typeof t?t:null==t?o:"object"==typeof t?s(t)?i(t[0],t[1]):n(t):u(t)}},280:(t,e,r)=>{var n=r(5726),i=r(6916),o=Object.prototype.hasOwnProperty;t.exports=function(t){if(!n(t))return i(t);var e=[];for(var r in Object(t))o.call(t,r)&&"constructor"!=r&&e.push(r);return e}},1573:(t,e,r)=>{var n=r(2958),i=r(1499),o=r(2634);t.exports=function(t){var e=i(t);return 1==e.length&&e[0][2]?o(e[0][0],e[0][1]):function(r){return r===t||n(r,t,e)}}},6432:(t,e,r)=>{var n=r(939),i=r(7361),o=r(9095),s=r(5403),u=r(9162),a=r(2634),c=r(327);t.exports=function(t,e){return s(t)&&u(e)?a(c(t),e):function(r){var s=i(r,t);return void 0===s&&s===e?o(r,t):n(e,s,3)}}},371:t=>{t.exports=function(t){return function(e){return null==e?void 0:e[t]}}},9152:(t,e,r)=>{var n=r(7786);t.exports=function(t){return function(e){return n(e,t)}}},8674:t=>{t.exports=function(t){return function(e){return null==t?void 0:t[e]}}},4259:t=>{t.exports=function(t,e,r){var n=-1,i=t.length;e<0&&(e=-e>i?0:i+e),(r=r>i?i:r)<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var o=Array(i);++n<i;)o[n]=t[n+e];return o}},5076:(t,e,r)=>{var n=r(9881);t.exports=function(t,e){var r;return n(t,(function(t,n,i){return!(r=e(t,n,i))})),!!r}},2545:t=>{t.exports=function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}},531:(t,e,r)=>{var n=r(2705),i=r(9932),o=r(1469),s=r(3448),u=n?n.prototype:void 0,a=u?u.toString:void 0;t.exports=function t(e){if("string"==typeof e)return e;if(o(e))return i(e,t)+"";if(s(e))return a?a.call(e):"";var r=e+"";return"0"==r&&1/e==-Infinity?"-0":r}},7561:(t,e,r)=>{var n=r(7990),i=/^\s+/;t.exports=function(t){return t?t.slice(0,n(t)+1).replace(i,""):t}},1717:t=>{t.exports=function(t){return function(e){return t(e)}}},1757:t=>{t.exports=function(t,e,r){for(var n=-1,i=t.length,o=e.length,s={};++n<i;){var u=n<o?e[n]:void 0;r(s,t[n],u)}return s}},4757:t=>{t.exports=function(t,e){return t.has(e)}},1811:(t,e,r)=>{var n=r(1469),i=r(5403),o=r(5514),s=r(9833);t.exports=function(t,e){return n(t)?t:i(t,e)?[t]:o(s(t))}},180:(t,e,r)=>{var n=r(4259);t.exports=function(t,e,r){var i=t.length;return r=void 0===r?i:r,!e&&r>=i?t:n(t,e,r)}},4429:(t,e,r)=>{var n=r(5639)["__core-js_shared__"];t.exports=n},9291:(t,e,r)=>{var n=r(8612);t.exports=function(t,e){return function(r,i){if(null==r)return r;if(!n(r))return t(r,i);for(var o=r.length,s=e?o:-1,u=Object(r);(e?s--:++s<o)&&!1!==i(u[s],s,u););return r}}},5063:t=>{t.exports=function(t){return function(e,r,n){for(var i=-1,o=Object(e),s=n(e),u=s.length;u--;){var a=s[t?u:++i];if(!1===r(o[a],a,o))break}return e}}},8805:(t,e,r)=>{var n=r(180),i=r(2689),o=r(3140),s=r(9833);t.exports=function(t){return function(e){e=s(e);var r=i(e)?o(e):void 0,u=r?r[0]:e.charAt(0),a=r?n(r,1).join(""):e.slice(1);return u[t]()+a}}},5393:(t,e,r)=>{var n=r(2663),i=r(3816),o=r(8748),s=RegExp("['’]","g");t.exports=function(t){return function(e){return n(o(i(e).replace(s,"")),t,"")}}},7740:(t,e,r)=>{var n=r(7206),i=r(8612),o=r(3674);t.exports=function(t){return function(e,r,s){var u=Object(e);if(!i(e)){var a=n(r,3);e=o(e),r=function(t){return a(u[t],t,u)}}var c=t(e,r,s);return c>-1?u[a?e[c]:c]:void 0}}},9389:(t,e,r)=>{var n=r(8674)({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",Ĳ:"IJ",ĳ:"ij",Œ:"Oe",œ:"oe",ŉ:"'n",ſ:"s"});t.exports=n},8777:(t,e,r)=>{var n=r(852),i=function(){try{var t=n(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();t.exports=i},7114:(t,e,r)=>{var n=r(8668),i=r(4855),o=r(4757);t.exports=function(t,e,r,s,u,a){var c=1&r,f=t.length,l=e.length;if(f!=l&&!(c&&l>f))return!1;var h=a.get(t),p=a.get(e);if(h&&p)return h==e&&p==t;var d=-1,y=!0,g=2&r?new n:void 0;for(a.set(t,e),a.set(e,t);++d<f;){var v=t[d],w=e[d];if(s)var M=c?s(w,v,d,e,t,a):s(v,w,d,t,e,a);if(void 0!==M){if(M)continue;y=!1;break}if(g){if(!i(e,(function(t,e){if(!o(g,e)&&(v===t||u(v,t,r,s,a)))return g.push(e)}))){y=!1;break}}else if(v!==w&&!u(v,w,r,s,a)){y=!1;break}}return a.delete(t),a.delete(e),y}},8351:(t,e,r)=>{var n=r(2705),i=r(1149),o=r(7813),s=r(7114),u=r(8776),a=r(1814),c=n?n.prototype:void 0,f=c?c.valueOf:void 0;t.exports=function(t,e,r,n,c,l,h){switch(r){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!l(new i(t),new i(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return o(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var p=u;case"[object Set]":var d=1&n;if(p||(p=a),t.size!=e.size&&!d)return!1;var y=h.get(t);if(y)return y==e;n|=2,h.set(t,e);var g=s(p(t),p(e),n,c,l,h);return h.delete(t),g;case"[object Symbol]":if(f)return f.call(t)==f.call(e)}return!1}},6096:(t,e,r)=>{var n=r(8234),i=Object.prototype.hasOwnProperty;t.exports=function(t,e,r,o,s,u){var a=1&r,c=n(t),f=c.length;if(f!=n(e).length&&!a)return!1;for(var l=f;l--;){var h=c[l];if(!(a?h in e:i.call(e,h)))return!1}var p=u.get(t),d=u.get(e);if(p&&d)return p==e&&d==t;var y=!0;u.set(t,e),u.set(e,t);for(var g=a;++l<f;){var v=t[h=c[l]],w=e[h];if(o)var M=a?o(w,v,h,e,t,u):o(v,w,h,t,e,u);if(!(void 0===M?v===w||s(v,w,r,o,u):M)){y=!1;break}g||(g="constructor"==h)}if(y&&!g){var L=t.constructor,_=e.constructor;L==_||!("constructor"in t)||!("constructor"in e)||"function"==typeof L&&L instanceof L&&"function"==typeof _&&_ instanceof _||(y=!1)}return u.delete(t),u.delete(e),y}},1957:(t,e,r)=>{var n="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;t.exports=n},8234:(t,e,r)=>{var n=r(8866),i=r(9551),o=r(3674);t.exports=function(t){return n(t,o,i)}},5050:(t,e,r)=>{var n=r(7019);t.exports=function(t,e){var r=t.__data__;return n(e)?r["string"==typeof e?"string":"hash"]:r.map}},1499:(t,e,r)=>{var n=r(9162),i=r(3674);t.exports=function(t){for(var e=i(t),r=e.length;r--;){var o=e[r],s=t[o];e[r]=[o,s,n(s)]}return e}},852:(t,e,r)=>{var n=r(8458),i=r(7801);t.exports=function(t,e){var r=i(t,e);return n(r)?r:void 0}},9607:(t,e,r)=>{var n=r(2705),i=Object.prototype,o=i.hasOwnProperty,s=i.toString,u=n?n.toStringTag:void 0;t.exports=function(t){var e=o.call(t,u),r=t[u];try{t[u]=void 0;var n=!0}catch(t){}var i=s.call(t);return n&&(e?t[u]=r:delete t[u]),i}},9551:(t,e,r)=>{var n=r(4963),i=r(479),o=Object.prototype.propertyIsEnumerable,s=Object.getOwnPropertySymbols,u=s?function(t){return null==t?[]:(t=Object(t),n(s(t),(function(e){return o.call(t,e)})))}:i;t.exports=u},8882:(t,e,r)=>{var n=r(8552),i=r(7071),o=r(3818),s=r(8525),u=r(577),a=r(4239),c=r(346),f="[object Map]",l="[object Promise]",h="[object Set]",p="[object WeakMap]",d="[object DataView]",y=c(n),g=c(i),v=c(o),w=c(s),M=c(u),L=a;(n&&L(new n(new ArrayBuffer(1)))!=d||i&&L(new i)!=f||o&&L(o.resolve())!=l||s&&L(new s)!=h||u&&L(new u)!=p)&&(L=function(t){var e=a(t),r="[object Object]"==e?t.constructor:void 0,n=r?c(r):"";if(n)switch(n){case y:return d;case g:return f;case v:return l;case w:return h;case M:return p}return e}),t.exports=L},7801:t=>{t.exports=function(t,e){return null==t?void 0:t[e]}},222:(t,e,r)=>{var n=r(1811),i=r(5694),o=r(1469),s=r(5776),u=r(1780),a=r(327);t.exports=function(t,e,r){for(var c=-1,f=(e=n(e,t)).length,l=!1;++c<f;){var h=a(e[c]);if(!(l=null!=t&&r(t,h)))break;t=t[h]}return l||++c!=f?l:!!(f=null==t?0:t.length)&&u(f)&&s(h,f)&&(o(t)||i(t))}},2689:t=>{var e=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");t.exports=function(t){return e.test(t)}},3157:t=>{var e=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;t.exports=function(t){return e.test(t)}},1789:(t,e,r)=>{var n=r(4536);t.exports=function(){this.__data__=n?n(null):{},this.size=0}},401:t=>{t.exports=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}},7667:(t,e,r)=>{var n=r(4536),i=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;if(n){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return i.call(e,t)?e[t]:void 0}},1327:(t,e,r)=>{var n=r(4536),i=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;return n?void 0!==e[t]:i.call(e,t)}},1866:(t,e,r)=>{var n=r(4536);t.exports=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=n&&void 0===e?"__lodash_hash_undefined__":e,this}},5776:t=>{var e=/^(?:0|[1-9]\d*)$/;t.exports=function(t,r){var n=typeof t;return!!(r=null==r?9007199254740991:r)&&("number"==n||"symbol"!=n&&e.test(t))&&t>-1&&t%1==0&&t<r}},6612:(t,e,r)=>{var n=r(7813),i=r(8612),o=r(5776),s=r(3218);t.exports=function(t,e,r){if(!s(r))return!1;var u=typeof e;return!!("number"==u?i(r)&&o(e,r.length):"string"==u&&e in r)&&n(r[e],t)}},5403:(t,e,r)=>{var n=r(1469),i=r(3448),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,s=/^\w*$/;t.exports=function(t,e){if(n(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!i(t))||(s.test(t)||!o.test(t)||null!=e&&t in Object(e))}},7019:t=>{t.exports=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}},5346:(t,e,r)=>{var n,i=r(4429),o=(n=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";t.exports=function(t){return!!o&&o in t}},5726:t=>{var e=Object.prototype;t.exports=function(t){var r=t&&t.constructor;return t===("function"==typeof r&&r.prototype||e)}},9162:(t,e,r)=>{var n=r(3218);t.exports=function(t){return t==t&&!n(t)}},7040:t=>{t.exports=function(){this.__data__=[],this.size=0}},4125:(t,e,r)=>{var n=r(8470),i=Array.prototype.splice;t.exports=function(t){var e=this.__data__,r=n(e,t);return!(r<0)&&(r==e.length-1?e.pop():i.call(e,r,1),--this.size,!0)}},2117:(t,e,r)=>{var n=r(8470);t.exports=function(t){var e=this.__data__,r=n(e,t);return r<0?void 0:e[r][1]}},7518:(t,e,r)=>{var n=r(8470);t.exports=function(t){return n(this.__data__,t)>-1}},4705:(t,e,r)=>{var n=r(8470);t.exports=function(t,e){var r=this.__data__,i=n(r,t);return i<0?(++this.size,r.push([t,e])):r[i][1]=e,this}},4785:(t,e,r)=>{var n=r(1989),i=r(8407),o=r(7071);t.exports=function(){this.size=0,this.__data__={hash:new n,map:new(o||i),string:new n}}},1285:(t,e,r)=>{var n=r(5050);t.exports=function(t){var e=n(this,t).delete(t);return this.size-=e?1:0,e}},6e3:(t,e,r)=>{var n=r(5050);t.exports=function(t){return n(this,t).get(t)}},9916:(t,e,r)=>{var n=r(5050);t.exports=function(t){return n(this,t).has(t)}},5265:(t,e,r)=>{var n=r(5050);t.exports=function(t,e){var r=n(this,t),i=r.size;return r.set(t,e),this.size+=r.size==i?0:1,this}},8776:t=>{t.exports=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}},2634:t=>{t.exports=function(t,e){return function(r){return null!=r&&(r[t]===e&&(void 0!==e||t in Object(r)))}}},4523:(t,e,r)=>{var n=r(8306);t.exports=function(t){var e=n(t,(function(t){return 500===r.size&&r.clear(),t})),r=e.cache;return e}},4536:(t,e,r)=>{var n=r(852)(Object,"create");t.exports=n},6916:(t,e,r)=>{var n=r(5569)(Object.keys,Object);t.exports=n},1167:(t,e,r)=>{t=r.nmd(t);var n=r(1957),i=e&&!e.nodeType&&e,o=i&&t&&!t.nodeType&&t,s=o&&o.exports===i&&n.process,u=function(){try{var t=o&&o.require&&o.require("util").types;return t||s&&s.binding&&s.binding("util")}catch(t){}}();t.exports=u},2333:t=>{var e=Object.prototype.toString;t.exports=function(t){return e.call(t)}},5569:t=>{t.exports=function(t,e){return function(r){return t(e(r))}}},5639:(t,e,r)=>{var n=r(1957),i="object"==typeof self&&self&&self.Object===Object&&self,o=n||i||Function("return this")();t.exports=o},619:t=>{t.exports=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this}},2385:t=>{t.exports=function(t){return this.__data__.has(t)}},1814:t=>{t.exports=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}},7465:(t,e,r)=>{var n=r(8407);t.exports=function(){this.__data__=new n,this.size=0}},3779:t=>{t.exports=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}},7599:t=>{t.exports=function(t){return this.__data__.get(t)}},4758:t=>{t.exports=function(t){return this.__data__.has(t)}},4309:(t,e,r)=>{var n=r(8407),i=r(7071),o=r(3369);t.exports=function(t,e){var r=this.__data__;if(r instanceof n){var s=r.__data__;if(!i||s.length<199)return s.push([t,e]),this.size=++r.size,this;r=this.__data__=new o(s)}return r.set(t,e),this.size=r.size,this}},3140:(t,e,r)=>{var n=r(4286),i=r(2689),o=r(676);t.exports=function(t){return i(t)?o(t):n(t)}},5514:(t,e,r)=>{var n=r(4523),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,o=/\\(\\)?/g,s=n((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(i,(function(t,r,n,i){e.push(n?i.replace(o,"$1"):r||t)})),e}));t.exports=s},327:(t,e,r)=>{var n=r(3448);t.exports=function(t){if("string"==typeof t||n(t))return t;var e=t+"";return"0"==e&&1/t==-Infinity?"-0":e}},346:t=>{var e=Function.prototype.toString;t.exports=function(t){if(null!=t){try{return e.call(t)}catch(t){}try{return t+""}catch(t){}}return""}},7990:t=>{var e=/\s/;t.exports=function(t){for(var r=t.length;r--&&e.test(t.charAt(r)););return r}},676:t=>{var e="[\\ud800-\\udfff]",r="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",n="\\ud83c[\\udffb-\\udfff]",i="[^\\ud800-\\udfff]",o="(?:\\ud83c[\\udde6-\\uddff]){2}",s="[\\ud800-\\udbff][\\udc00-\\udfff]",u="(?:"+r+"|"+n+")"+"?",a="[\\ufe0e\\ufe0f]?",c=a+u+("(?:\\u200d(?:"+[i,o,s].join("|")+")"+a+u+")*"),f="(?:"+[i+r+"?",r,o,s,e].join("|")+")",l=RegExp(n+"(?="+n+")|"+f+c,"g");t.exports=function(t){return t.match(l)||[]}},2757:t=>{var e="\\u2700-\\u27bf",r="a-z\\xdf-\\xf6\\xf8-\\xff",n="A-Z\\xc0-\\xd6\\xd8-\\xde",i="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",o="["+i+"]",s="\\d+",u="[\\u2700-\\u27bf]",a="["+r+"]",c="[^\\ud800-\\udfff"+i+s+e+r+n+"]",f="(?:\\ud83c[\\udde6-\\uddff]){2}",l="[\\ud800-\\udbff][\\udc00-\\udfff]",h="["+n+"]",p="(?:"+a+"|"+c+")",d="(?:"+h+"|"+c+")",y="(?:['’](?:d|ll|m|re|s|t|ve))?",g="(?:['’](?:D|LL|M|RE|S|T|VE))?",v="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",w="[\\ufe0e\\ufe0f]?",M=w+v+("(?:\\u200d(?:"+["[^\\ud800-\\udfff]",f,l].join("|")+")"+w+v+")*"),L="(?:"+[u,f,l].join("|")+")"+M,_=RegExp([h+"?"+a+"+"+y+"(?="+[o,h,"$"].join("|")+")",d+"+"+g+"(?="+[o,h+p,"$"].join("|")+")",h+"?"+p+"+"+y,h+"+"+g,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",s,L].join("|"),"g");t.exports=function(t){return t.match(_)||[]}},1540:(t,e,r)=>{var n=r(8403),i=r(5393)((function(t,e,r){return e=e.toLowerCase(),t+(r?n(e):e)}));t.exports=i},8403:(t,e,r)=>{var n=r(9833),i=r(1700);t.exports=function(t){return i(n(t).toLowerCase())}},3816:(t,e,r)=>{var n=r(9389),i=r(9833),o=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,s=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");t.exports=function(t){return(t=i(t))&&t.replace(o,n).replace(s,"")}},7813:t=>{t.exports=function(t,e){return t===e||t!=t&&e!=e}},3311:(t,e,r)=>{var n=r(7740)(r(998));t.exports=n},998:(t,e,r)=>{var n=r(1848),i=r(7206),o=r(554),s=Math.max;t.exports=function(t,e,r){var u=null==t?0:t.length;if(!u)return-1;var a=null==r?0:o(r);return a<0&&(a=s(u+a,0)),n(t,i(e,3),a)}},7361:(t,e,r)=>{var n=r(7786);t.exports=function(t,e,r){var i=null==t?void 0:n(t,e);return void 0===i?r:i}},9095:(t,e,r)=>{var n=r(13),i=r(222);t.exports=function(t,e){return null!=t&&i(t,e,n)}},6557:t=>{t.exports=function(t){return t}},5694:(t,e,r)=>{var n=r(9454),i=r(7005),o=Object.prototype,s=o.hasOwnProperty,u=o.propertyIsEnumerable,a=n(function(){return arguments}())?n:function(t){return i(t)&&s.call(t,"callee")&&!u.call(t,"callee")};t.exports=a},1469:t=>{var e=Array.isArray;t.exports=e},8612:(t,e,r)=>{var n=r(3560),i=r(1780);t.exports=function(t){return null!=t&&i(t.length)&&!n(t)}},4144:(t,e,r)=>{t=r.nmd(t);var n=r(5639),i=r(5062),o=e&&!e.nodeType&&e,s=o&&t&&!t.nodeType&&t,u=s&&s.exports===o?n.Buffer:void 0,a=(u?u.isBuffer:void 0)||i;t.exports=a},1609:(t,e,r)=>{var n=r(280),i=r(8882),o=r(5694),s=r(1469),u=r(8612),a=r(4144),c=r(5726),f=r(6719),l=Object.prototype.hasOwnProperty;t.exports=function(t){if(null==t)return!0;if(u(t)&&(s(t)||"string"==typeof t||"function"==typeof t.splice||a(t)||f(t)||o(t)))return!t.length;var e=i(t);if("[object Map]"==e||"[object Set]"==e)return!t.size;if(c(t))return!n(t).length;for(var r in t)if(l.call(t,r))return!1;return!0}},3560:(t,e,r)=>{var n=r(4239),i=r(3218);t.exports=function(t){if(!i(t))return!1;var e=n(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}},1780:t=>{t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}},3218:t=>{t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},7005:t=>{t.exports=function(t){return null!=t&&"object"==typeof t}},3448:(t,e,r)=>{var n=r(4239),i=r(7005);t.exports=function(t){return"symbol"==typeof t||i(t)&&"[object Symbol]"==n(t)}},6719:(t,e,r)=>{var n=r(8749),i=r(1717),o=r(1167),s=o&&o.isTypedArray,u=s?i(s):n;t.exports=u},3674:(t,e,r)=>{var n=r(4636),i=r(280),o=r(8612);t.exports=function(t){return o(t)?n(t):i(t)}},8306:(t,e,r)=>{var n=r(3369);function i(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=t.apply(this,n);return r.cache=o.set(i,s)||o,s};return r.cache=new(i.Cache||n),r}i.Cache=n,t.exports=i},1733:(t,e,r)=>{var n=r(371),i=r(9152),o=r(5403),s=r(327);t.exports=function(t){return o(t)?n(s(t)):i(t)}},9704:(t,e,r)=>{var n=r(4855),i=r(7206),o=r(5076),s=r(1469),u=r(6612);t.exports=function(t,e,r){var a=s(t)?n:o;return r&&u(t,e,r)&&(e=void 0),a(t,i(e,3))}},479:t=>{t.exports=function(){return[]}},5062:t=>{t.exports=function(){return!1}},8601:(t,e,r)=>{var n=r(4841),i=1/0;t.exports=function(t){return t?(t=n(t))===i||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}},554:(t,e,r)=>{var n=r(8601);t.exports=function(t){var e=n(t),r=e%1;return e==e?r?e-r:e:0}},4841:(t,e,r)=>{var n=r(7561),i=r(3218),o=r(3448),s=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,a=/^0o[0-7]+$/i,c=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(o(t))return NaN;if(i(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=i(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=n(t);var r=u.test(t);return r||a.test(t)?c(t.slice(2),r?2:8):s.test(t)?NaN:+t}},9833:(t,e,r)=>{var n=r(531);t.exports=function(t){return null==t?"":n(t)}},1700:(t,e,r)=>{var n=r(8805)("toUpperCase");t.exports=n},8748:(t,e,r)=>{var n=r(9029),i=r(3157),o=r(9833),s=r(2757);t.exports=function(t,e,r){return t=o(t),void 0===(e=r?void 0:e)?i(t)?s(t):n(t):t.match(e)||[]}},7287:(t,e,r)=>{var n=r(4865),i=r(1757);t.exports=function(t,e){return i(t||[],e||[],n)}},7418:t=>{"use strict";var e=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function i(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}t.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(t){n[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(t){return!1}}()?Object.assign:function(t,o){for(var s,u,a=i(t),c=1;c<arguments.length;c++){for(var f in s=Object(arguments[c]))r.call(s,f)&&(a[f]=s[f]);if(e){u=e(s);for(var l=0;l<u.length;l++)n.call(s,u[l])&&(a[u[l]]=s[u[l]])}}return a}},4155:t=>{var e,r,n=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(t){if(e===setTimeout)return setTimeout(t,0);if((e===i||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(r){try{return e.call(null,t,0)}catch(r){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:i}catch(t){e=i}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(t){r=o}}();var u,a=[],c=!1,f=-1;function l(){c&&u&&(c=!1,u.length?a=u.concat(a):f=-1,a.length&&h())}function h(){if(!c){var t=s(l);c=!0;for(var e=a.length;e;){for(u=a,a=[];++f<e;)u&&u[f].run();f=-1,e=a.length}u=null,c=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function d(){}n.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];a.push(new p(t,e)),1!==a.length||c||s(h)},p.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=d,n.addListener=d,n.once=d,n.off=d,n.removeListener=d,n.removeAllListeners=d,n.emit=d,n.prependListener=d,n.prependOnceListener=d,n.listeners=function(t){return[]},n.binding=function(t){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(t){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},4419:(t,e,r)=>{const n=r(697),i=r(9450),o=n.types;t.exports=class t{constructor(t,e){if(this._setDefaults(t),t instanceof RegExp)this.ignoreCase=t.ignoreCase,this.multiline=t.multiline,t=t.source;else{if("string"!=typeof t)throw new Error("Expected a regexp or string");this.ignoreCase=e&&-1!==e.indexOf("i"),this.multiline=e&&-1!==e.indexOf("m")}this.tokens=n(t)}_setDefaults(e){this.max=null!=e.max?e.max:null!=t.prototype.max?t.prototype.max:100,this.defaultRange=e.defaultRange?e.defaultRange:this.defaultRange.clone(),e.randInt&&(this.randInt=e.randInt)}gen(){return this._gen(this.tokens,[])}_gen(t,e){var r,n,i,s,u;switch(t.type){case o.ROOT:case o.GROUP:if(t.followedBy||t.notFollowedBy)return"";for(t.remember&&void 0===t.groupNumber&&(t.groupNumber=e.push(null)-1),n="",s=0,u=(r=t.options?this._randSelect(t.options):t.stack).length;s<u;s++)n+=this._gen(r[s],e);return t.remember&&(e[t.groupNumber]=n),n;case o.POSITION:return"";case o.SET:var a=this._expand(t);return a.length?String.fromCharCode(this._randSelect(a)):"";case o.REPETITION:for(i=this.randInt(t.min,t.max===1/0?t.min+this.max:t.max),n="",s=0;s<i;s++)n+=this._gen(t.value,e);return n;case o.REFERENCE:return e[t.value-1]||"";case o.CHAR:var c=this.ignoreCase&&this._randBool()?this._toOtherCase(t.value):t.value;return String.fromCharCode(c)}}_toOtherCase(t){return t+(97<=t&&t<=122?-32:65<=t&&t<=90?32:0)}_randBool(){return!this.randInt(0,1)}_randSelect(t){return t instanceof i?t.index(this.randInt(0,t.length-1)):t[this.randInt(0,t.length-1)]}_expand(t){if(t.type===n.types.CHAR)return new i(t.value);if(t.type===n.types.RANGE)return new i(t.from,t.to);{let e=new i;for(let r=0;r<t.set.length;r++){let n=this._expand(t.set[r]);if(e.add(n),this.ignoreCase)for(let t=0;t<n.length;t++){let r=n.index(t),i=this._toOtherCase(r);r!==i&&e.add(i)}}return t.not?this.defaultRange.clone().subtract(e):this.defaultRange.clone().intersect(e)}}randInt(t,e){return t+Math.floor(Math.random()*(1+e-t))}get defaultRange(){return this._range=this._range||new i(32,126)}set defaultRange(t){this._range=t}static randexp(e,r){var n;return"string"==typeof e&&(e=new RegExp(e,r)),void 0===e._randexp?(n=new t(e,r),e._randexp=n):(n=e._randexp)._setDefaults(e),n.gen()}static sugar(){RegExp.prototype.gen=function(){return t.randexp(this)}}}},2282:(t,e,r)=>{"use strict";var n=r(4155),i=65536,o=4294967295;var s=r(396).Buffer,u=r.g.crypto||r.g.msCrypto;u&&u.getRandomValues?t.exports=function(t,e){if(t>o)throw new RangeError("requested too many random bytes");var r=s.allocUnsafe(t);if(t>0)if(t>i)for(var a=0;a<t;a+=i)u.getRandomValues(r.slice(a,a+i));else u.getRandomValues(r);if("function"==typeof e)return n.nextTick((function(){e(null,r)}));return r}:t.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}},2408:(t,e,r)=>{"use strict";var n=r(7418),i=60103,o=60106;e.Fragment=60107,e.StrictMode=60108,e.Profiler=60114;var s=60109,u=60110,a=60112;e.Suspense=60113;var c=60115,f=60116;if("function"==typeof Symbol&&Symbol.for){var l=Symbol.for;i=l("react.element"),o=l("react.portal"),e.Fragment=l("react.fragment"),e.StrictMode=l("react.strict_mode"),e.Profiler=l("react.profiler"),s=l("react.provider"),u=l("react.context"),a=l("react.forward_ref"),e.Suspense=l("react.suspense"),c=l("react.memo"),f=l("react.lazy")}var h="function"==typeof Symbol&&Symbol.iterator;function p(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,r=1;r<arguments.length;r++)e+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var d={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},y={};function g(t,e,r){this.props=t,this.context=e,this.refs=y,this.updater=r||d}function v(){}function w(t,e,r){this.props=t,this.context=e,this.refs=y,this.updater=r||d}g.prototype.isReactComponent={},g.prototype.setState=function(t,e){if("object"!=typeof t&&"function"!=typeof t&&null!=t)throw Error(p(85));this.updater.enqueueSetState(this,t,e,"setState")},g.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")},v.prototype=g.prototype;var M=w.prototype=new v;M.constructor=w,n(M,g.prototype),M.isPureReactComponent=!0;var L={current:null},_=Object.prototype.hasOwnProperty,m={key:!0,ref:!0,__self:!0,__source:!0};function b(t,e,r){var n,o={},s=null,u=null;if(null!=e)for(n in void 0!==e.ref&&(u=e.ref),void 0!==e.key&&(s=""+e.key),e)_.call(e,n)&&!m.hasOwnProperty(n)&&(o[n]=e[n]);var a=arguments.length-2;if(1===a)o.children=r;else if(1<a){for(var c=Array(a),f=0;f<a;f++)c[f]=arguments[f+2];o.children=c}if(t&&t.defaultProps)for(n in a=t.defaultProps)void 0===o[n]&&(o[n]=a[n]);return{$$typeof:i,type:t,key:s,ref:u,props:o,_owner:L.current}}function j(t){return"object"==typeof t&&null!==t&&t.$$typeof===i}var x=/\/+/g;function N(t,e){return"object"==typeof t&&null!==t&&null!=t.key?function(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,(function(t){return e[t]}))}(""+t.key):e.toString(36)}function S(t,e,r,n,s){var u=typeof t;"undefined"!==u&&"boolean"!==u||(t=null);var a=!1;if(null===t)a=!0;else switch(u){case"string":case"number":a=!0;break;case"object":switch(t.$$typeof){case i:case o:a=!0}}if(a)return s=s(a=t),t=""===n?"."+N(a,0):n,Array.isArray(s)?(r="",null!=t&&(r=t.replace(x,"$&/")+"/"),S(s,e,r,"",(function(t){return t}))):null!=s&&(j(s)&&(s=function(t,e){return{$$typeof:i,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}(s,r+(!s.key||a&&a.key===s.key?"":(""+s.key).replace(x,"$&/")+"/")+t)),e.push(s)),1;if(a=0,n=""===n?".":n+":",Array.isArray(t))for(var c=0;c<t.length;c++){var f=n+N(u=t[c],c);a+=S(u,e,r,f,s)}else if(f=function(t){return null===t||"object"!=typeof t?null:"function"==typeof(t=h&&t[h]||t["@@iterator"])?t:null}(t),"function"==typeof f)for(t=f.call(t),c=0;!(u=t.next()).done;)a+=S(u=u.value,e,r,f=n+N(u,c++),s);else if("object"===u)throw e=""+t,Error(p(31,"[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e));return a}function D(t,e,r){if(null==t)return t;var n=[],i=0;return S(t,n,"","",(function(t){return e.call(r,t,i++)})),n}function I(t){if(-1===t._status){var e=t._result;e=e(),t._status=0,t._result=e,e.then((function(e){0===t._status&&(e=e.default,t._status=1,t._result=e)}),(function(e){0===t._status&&(t._status=2,t._result=e)}))}if(1===t._status)return t._result;throw t._result}var E={current:null};function A(){var t=E.current;if(null===t)throw Error(p(321));return t}var C={ReactCurrentDispatcher:E,ReactCurrentBatchConfig:{transition:0},ReactCurrentOwner:L,IsSomeRendererActing:{current:!1},assign:n};e.Children={map:D,forEach:function(t,e,r){D(t,(function(){e.apply(this,arguments)}),r)},count:function(t){var e=0;return D(t,(function(){e++})),e},toArray:function(t){return D(t,(function(t){return t}))||[]},only:function(t){if(!j(t))throw Error(p(143));return t}},e.Component=g,e.PureComponent=w,e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=C,e.cloneElement=function(t,e,r){if(null==t)throw Error(p(267,t));var o=n({},t.props),s=t.key,u=t.ref,a=t._owner;if(null!=e){if(void 0!==e.ref&&(u=e.ref,a=L.current),void 0!==e.key&&(s=""+e.key),t.type&&t.type.defaultProps)var c=t.type.defaultProps;for(f in e)_.call(e,f)&&!m.hasOwnProperty(f)&&(o[f]=void 0===e[f]&&void 0!==c?c[f]:e[f])}var f=arguments.length-2;if(1===f)o.children=r;else if(1<f){c=Array(f);for(var l=0;l<f;l++)c[l]=arguments[l+2];o.children=c}return{$$typeof:i,type:t.type,key:s,ref:u,props:o,_owner:a}},e.createContext=function(t,e){return void 0===e&&(e=null),(t={$$typeof:u,_calculateChangedBits:e,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:s,_context:t},t.Consumer=t},e.createElement=b,e.createFactory=function(t){var e=b.bind(null,t);return e.type=t,e},e.createRef=function(){return{current:null}},e.forwardRef=function(t){return{$$typeof:a,render:t}},e.isValidElement=j,e.lazy=function(t){return{$$typeof:f,_payload:{_status:-1,_result:t},_init:I}},e.memo=function(t,e){return{$$typeof:c,type:t,compare:void 0===e?null:e}},e.useCallback=function(t,e){return A().useCallback(t,e)},e.useContext=function(t,e){return A().useContext(t,e)},e.useDebugValue=function(){},e.useEffect=function(t,e){return A().useEffect(t,e)},e.useImperativeHandle=function(t,e,r){return A().useImperativeHandle(t,e,r)},e.useLayoutEffect=function(t,e){return A().useLayoutEffect(t,e)},e.useMemo=function(t,e){return A().useMemo(t,e)},e.useReducer=function(t,e,r){return A().useReducer(t,e,r)},e.useRef=function(t){return A().useRef(t)},e.useState=function(t){return A().useState(t)},e.version="17.0.2"},7294:(t,e,r)=>{"use strict";t.exports=r(2408)},4281:t=>{"use strict";var e={};function r(t,r,n){n||(n=Error);var i=function(t){var e,n;function i(e,n,i){return t.call(this,function(t,e,n){return"string"==typeof r?r:r(t,e,n)}(e,n,i))||this}return n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n,i}(n);i.prototype.name=n.name,i.prototype.code=t,e[t]=i}function n(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map((function(t){return String(t)})),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}r("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),r("ERR_INVALID_ARG_TYPE",(function(t,e,r){var i,o,s,u;if("string"==typeof e&&(o="not ",e.substr(!s||s<0?0:+s,o.length)===o)?(i="must not be",e=e.replace(/^not /,"")):i="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))u="The ".concat(t," ").concat(i," ").concat(n(e,"type"));else{var a=function(t,e,r){return"number"!=typeof r&&(r=0),!(r+e.length>t.length)&&-1!==t.indexOf(e,r)}(t,".")?"property":"argument";u='The "'.concat(t,'" ').concat(a," ").concat(i," ").concat(n(e,"type"))}return u+=". Received type ".concat(typeof r)}),TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.q=e},6753:(t,e,r)=>{"use strict";var n=r(4155),i=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=f;var o=r(9481),s=r(3982);r(5717)(f,o);for(var u=i(s.prototype),a=0;a<u.length;a++){var c=u[a];f.prototype[c]||(f.prototype[c]=s.prototype[c])}function f(t){if(!(this instanceof f))return new f(t);o.call(this,t),s.call(this,t),this.allowHalfOpen=!0,t&&(!1===t.readable&&(this.readable=!1),!1===t.writable&&(this.writable=!1),!1===t.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",l)))}function l(){this._writableState.ended||n.nextTick(h,this)}function h(t){t.end()}Object.defineProperty(f.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(f.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(f.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(f.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}})},2725:(t,e,r)=>{"use strict";t.exports=i;var n=r(4605);function i(t){if(!(this instanceof i))return new i(t);n.call(this,t)}r(5717)(i,n),i.prototype._transform=function(t,e,r){r(null,t)}},9481:(t,e,r)=>{"use strict";var n,i=r(4155);t.exports=x,x.ReadableState=j;r(7187).EventEmitter;var o=function(t,e){return t.listeners(e).length},s=r(2503),u=r(8764).Buffer,a=r.g.Uint8Array||function(){};var c,f=r(4616);c=f&&f.debuglog?f.debuglog("stream"):function(){};var l,h,p,d=r(7327),y=r(1195),g=r(2457).getHighWaterMark,v=r(4281).q,w=v.ERR_INVALID_ARG_TYPE,M=v.ERR_STREAM_PUSH_AFTER_EOF,L=v.ERR_METHOD_NOT_IMPLEMENTED,_=v.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(5717)(x,s);var m=y.errorOrDestroy,b=["error","close","destroy","pause","resume"];function j(t,e,i){n=n||r(6753),t=t||{},"boolean"!=typeof i&&(i=e instanceof n),this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=g(this,t,"readableHighWaterMark",i),this.buffer=new d,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(l||(l=r(2553).s),this.decoder=new l(t.encoding),this.encoding=t.encoding)}function x(t){if(n=n||r(6753),!(this instanceof x))return new x(t);var e=this instanceof n;this._readableState=new j(t,this,e),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),s.call(this)}function N(t,e,r,n,i){c("readableAddChunk",e);var o,s=t._readableState;if(null===e)s.reading=!1,function(t,e){if(c("onEofChunk"),e.ended)return;if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?E(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,A(t)))}(t,s);else if(i||(o=function(t,e){var r;n=e,u.isBuffer(n)||n instanceof a||"string"==typeof e||void 0===e||t.objectMode||(r=new w("chunk",["string","Buffer","Uint8Array"],e));var n;return r}(s,e)),o)m(t,o);else if(s.objectMode||e&&e.length>0)if("string"==typeof e||s.objectMode||Object.getPrototypeOf(e)===u.prototype||(e=function(t){return u.from(t)}(e)),n)s.endEmitted?m(t,new _):S(t,s,e,!0);else if(s.ended)m(t,new M);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!r?(e=s.decoder.write(e),s.objectMode||0!==e.length?S(t,s,e,!1):C(t,s)):S(t,s,e,!1)}else n||(s.reading=!1,C(t,s));return!s.ended&&(s.length<s.highWaterMark||0===s.length)}function S(t,e,r,n){e.flowing&&0===e.length&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&E(t)),C(t,e)}Object.defineProperty(x.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),x.prototype.destroy=y.destroy,x.prototype._undestroy=y.undestroy,x.prototype._destroy=function(t,e){e(t)},x.prototype.push=function(t,e){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof t&&((e=e||n.defaultEncoding)!==n.encoding&&(t=u.from(t,e),e=""),r=!0),N(this,t,e,!1,r)},x.prototype.unshift=function(t){return N(this,t,null,!0,!1)},x.prototype.isPaused=function(){return!1===this._readableState.flowing},x.prototype.setEncoding=function(t){l||(l=r(2553).s);var e=new l(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,i="";null!==n;)i+=e.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var D=1073741824;function I(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function(t){return t>=D?t=D:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function E(t){var e=t._readableState;c("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(c("emitReadable",e.flowing),e.emittedReadable=!0,i.nextTick(A,t))}function A(t){var e=t._readableState;c("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,U(t)}function C(t,e){e.readingMore||(e.readingMore=!0,i.nextTick(T,t,e))}function T(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&0===e.length);){var r=e.length;if(c("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}function O(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function z(t){c("readable nexttick read 0"),t.read(0)}function k(t,e){c("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),U(t),e.flowing&&!e.reading&&t.read(0)}function U(t){var e=t._readableState;for(c("flow",e.flowing);e.flowing&&null!==t.read(););}function R(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function Y(t){var e=t._readableState;c("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,i.nextTick(B,e,t))}function B(t,e){if(c("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function P(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}x.prototype.read=function(t){c("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&((0!==e.highWaterMark?e.length>=e.highWaterMark:e.length>0)||e.ended))return c("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?Y(this):E(this),null;if(0===(t=I(t,e))&&e.ended)return 0===e.length&&Y(this),null;var n,i=e.needReadable;return c("need readable",i),(0===e.length||e.length-t<e.highWaterMark)&&c("length less than watermark",i=!0),e.ended||e.reading?c("reading or ended",i=!1):i&&(c("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=I(r,e))),null===(n=t>0?R(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&Y(this)),null!==n&&this.emit("data",n),n},x.prototype._read=function(t){m(this,new L("_read()"))},x.prototype.pipe=function(t,e){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=t;break;case 1:n.pipes=[n.pipes,t];break;default:n.pipes.push(t)}n.pipesCount+=1,c("pipe count=%d opts=%j",n.pipesCount,e);var s=(!e||!1!==e.end)&&t!==i.stdout&&t!==i.stderr?a:g;function u(e,i){c("onunpipe"),e===r&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,c("cleanup"),t.removeListener("close",d),t.removeListener("finish",y),t.removeListener("drain",f),t.removeListener("error",p),t.removeListener("unpipe",u),r.removeListener("end",a),r.removeListener("end",g),r.removeListener("data",h),l=!0,!n.awaitDrain||t._writableState&&!t._writableState.needDrain||f())}function a(){c("onend"),t.end()}n.endEmitted?i.nextTick(s):r.once("end",s),t.on("unpipe",u);var f=function(t){return function(){var e=t._readableState;c("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&o(t,"data")&&(e.flowing=!0,U(t))}}(r);t.on("drain",f);var l=!1;function h(e){c("ondata");var i=t.write(e);c("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===t||n.pipesCount>1&&-1!==P(n.pipes,t))&&!l&&(c("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function p(e){c("onerror",e),g(),t.removeListener("error",p),0===o(t,"error")&&m(t,e)}function d(){t.removeListener("finish",y),g()}function y(){c("onfinish"),t.removeListener("close",d),g()}function g(){c("unpipe"),r.unpipe(t)}return r.on("data",h),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",p),t.once("close",d),t.once("finish",y),t.emit("pipe",r),n.flowing||(c("pipe resume"),r.resume()),t},x.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=P(e.pipes,t);return-1===s||(e.pipes.splice(s,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r)),this},x.prototype.on=function(t,e){var r=s.prototype.on.call(this,t,e),n=this._readableState;return"data"===t?(n.readableListening=this.listenerCount("readable")>0,!1!==n.flowing&&this.resume()):"readable"===t&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,c("on readable",n.length,n.reading),n.length?E(this):n.reading||i.nextTick(z,this))),r},x.prototype.addListener=x.prototype.on,x.prototype.removeListener=function(t,e){var r=s.prototype.removeListener.call(this,t,e);return"readable"===t&&i.nextTick(O,this),r},x.prototype.removeAllListeners=function(t){var e=s.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||i.nextTick(O,this),e},x.prototype.resume=function(){var t=this._readableState;return t.flowing||(c("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,i.nextTick(k,t,e))}(this,t)),t.paused=!1,this},x.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},x.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;for(var i in t.on("end",(function(){if(c("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(i){(c("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i)||(r.objectMode||i&&i.length)&&(e.push(i)||(n=!0,t.pause()))})),t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var o=0;o<b.length;o++)t.on(b[o],this.emit.bind(this,b[o]));return this._read=function(e){c("wrapped _read",e),n&&(n=!1,t.resume())},this},"function"==typeof Symbol&&(x.prototype[Symbol.asyncIterator]=function(){return void 0===h&&(h=r(5850)),h(this)}),Object.defineProperty(x.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(x.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(x.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}}),x._fromList=R,Object.defineProperty(x.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(x.from=function(t,e){return void 0===p&&(p=r(5167)),p(x,t,e)})},4605:(t,e,r)=>{"use strict";t.exports=f;var n=r(4281).q,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,s=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,u=n.ERR_TRANSFORM_WITH_LENGTH_0,a=r(6753);function c(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=e&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function f(t){if(!(this instanceof f))return new f(t);a.call(this,t),this._transformState={afterTransform:c.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",l)}function l(){var t=this;"function"!=typeof this._flush||this._readableState.destroyed?h(this,null,null):this._flush((function(e,r){h(t,e,r)}))}function h(t,e,r){if(e)return t.emit("error",e);if(null!=r&&t.push(r),t._writableState.length)throw new u;if(t._transformState.transforming)throw new s;return t.push(null)}r(5717)(f,a),f.prototype.push=function(t,e){return this._transformState.needTransform=!1,a.prototype.push.call(this,t,e)},f.prototype._transform=function(t,e,r){r(new i("_transform()"))},f.prototype._write=function(t,e,r){var n=this._transformState;if(n.writecb=r,n.writechunk=t,n.writeencoding=e,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},f.prototype._read=function(t){var e=this._transformState;null===e.writechunk||e.transforming?e.needTransform=!0:(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform))},f.prototype._destroy=function(t,e){a.prototype._destroy.call(this,t,(function(t){e(t)}))}},3982:(t,e,r)=>{"use strict";var n,i=r(4155);function o(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var n=t.entry;t.entry=null;for(;n;){var i=n.callback;e.pendingcb--,i(r),n=n.next}e.corkedRequestsFree.next=t}(e,t)}}t.exports=x,x.WritableState=j;var s={deprecate:r(4927)},u=r(2503),a=r(8764).Buffer,c=r.g.Uint8Array||function(){};var f,l=r(1195),h=r(2457).getHighWaterMark,p=r(4281).q,d=p.ERR_INVALID_ARG_TYPE,y=p.ERR_METHOD_NOT_IMPLEMENTED,g=p.ERR_MULTIPLE_CALLBACK,v=p.ERR_STREAM_CANNOT_PIPE,w=p.ERR_STREAM_DESTROYED,M=p.ERR_STREAM_NULL_VALUES,L=p.ERR_STREAM_WRITE_AFTER_END,_=p.ERR_UNKNOWN_ENCODING,m=l.errorOrDestroy;function b(){}function j(t,e,s){n=n||r(6753),t=t||{},"boolean"!=typeof s&&(s=e instanceof n),this.objectMode=!!t.objectMode,s&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=h(this,t,"writableHighWaterMark",s),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var u=!1===t.decodeStrings;this.decodeStrings=!u,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,n=r.sync,o=r.writecb;if("function"!=typeof o)throw new g;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function(t,e,r,n,o){--e.pendingcb,r?(i.nextTick(o,n),i.nextTick(A,t,e),t._writableState.errorEmitted=!0,m(t,n)):(o(n),t._writableState.errorEmitted=!0,m(t,n),A(t,e))}(t,r,n,e,o);else{var s=I(r)||t.destroyed;s||r.corked||r.bufferProcessing||!r.bufferedRequest||D(t,r),n?i.nextTick(S,t,r,s,o):S(t,r,s,o)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function x(t){var e=this instanceof(n=n||r(6753));if(!e&&!f.call(x,this))return new x(t);this._writableState=new j(t,this,e),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),u.call(this)}function N(t,e,r,n,i,o,s){e.writelen=n,e.writecb=s,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new w("write")):r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function S(t,e,r,n){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,n(),A(t,e)}function D(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,i=new Array(n),s=e.corkedRequestsFree;s.entry=r;for(var u=0,a=!0;r;)i[u]=r,r.isBuf||(a=!1),r=r.next,u+=1;i.allBuffers=a,N(t,e,!0,e.length,i,"",s.finish),e.pendingcb++,e.lastBufferedRequest=null,s.next?(e.corkedRequestsFree=s.next,s.next=null):e.corkedRequestsFree=new o(e),e.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,f=r.encoding,l=r.callback;if(N(t,e,!1,e.objectMode?1:c.length,c,f,l),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function I(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function E(t,e){t._final((function(r){e.pendingcb--,r&&m(t,r),e.prefinished=!0,t.emit("prefinish"),A(t,e)}))}function A(t,e){var r=I(e);if(r&&(function(t,e){e.prefinished||e.finalCalled||("function"!=typeof t._final||e.destroyed?(e.prefinished=!0,t.emit("prefinish")):(e.pendingcb++,e.finalCalled=!0,i.nextTick(E,t,e)))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var n=t._readableState;(!n||n.autoDestroy&&n.endEmitted)&&t.destroy()}return r}r(5717)(x,u),j.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(j.prototype,"buffer",{get:s.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(f=Function.prototype[Symbol.hasInstance],Object.defineProperty(x,Symbol.hasInstance,{value:function(t){return!!f.call(this,t)||this===x&&(t&&t._writableState instanceof j)}})):f=function(t){return t instanceof this},x.prototype.pipe=function(){m(this,new v)},x.prototype.write=function(t,e,r){var n,o=this._writableState,s=!1,u=!o.objectMode&&(n=t,a.isBuffer(n)||n instanceof c);return u&&!a.isBuffer(t)&&(t=function(t){return a.from(t)}(t)),"function"==typeof e&&(r=e,e=null),u?e="buffer":e||(e=o.defaultEncoding),"function"!=typeof r&&(r=b),o.ending?function(t,e){var r=new L;m(t,r),i.nextTick(e,r)}(this,r):(u||function(t,e,r,n){var o;return null===r?o=new M:"string"==typeof r||e.objectMode||(o=new d("chunk",["string","Buffer"],r)),!o||(m(t,o),i.nextTick(n,o),!1)}(this,o,t,r))&&(o.pendingcb++,s=function(t,e,r,n,i,o){if(!r){var s=function(t,e,r){t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=a.from(e,r));return e}(e,n,i);n!==s&&(r=!0,i="buffer",n=s)}var u=e.objectMode?1:n.length;e.length+=u;var c=e.length<e.highWaterMark;c||(e.needDrain=!0);if(e.writing||e.corked){var f=e.lastBufferedRequest;e.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},f?f.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else N(t,e,!1,u,n,i,o);return c}(this,o,u,t,e,r)),s},x.prototype.cork=function(){this._writableState.corked++},x.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.bufferProcessing||!t.bufferedRequest||D(this,t))},x.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new _(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(x.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(x.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),x.prototype._write=function(t,e,r){r(new y("_write()"))},x.prototype._writev=null,x.prototype.end=function(t,e,r){var n=this._writableState;return"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||function(t,e,r){e.ending=!0,A(t,e),r&&(e.finished?i.nextTick(r):t.once("finish",r));e.ended=!0,t.writable=!1}(this,n,r),this},Object.defineProperty(x.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(x.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),x.prototype.destroy=l.destroy,x.prototype._undestroy=l.undestroy,x.prototype._destroy=function(t,e){e(t)}},5850:(t,e,r)=>{"use strict";var n,i=r(4155);function o(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var s=r(8610),u=Symbol("lastResolve"),a=Symbol("lastReject"),c=Symbol("error"),f=Symbol("ended"),l=Symbol("lastPromise"),h=Symbol("handlePromise"),p=Symbol("stream");function d(t,e){return{value:t,done:e}}function y(t){var e=t[u];if(null!==e){var r=t[p].read();null!==r&&(t[l]=null,t[u]=null,t[a]=null,e(d(r,!1)))}}function g(t){i.nextTick(y,t)}var v=Object.getPrototypeOf((function(){})),w=Object.setPrototypeOf((o(n={get stream(){return this[p]},next:function(){var t=this,e=this[c];if(null!==e)return Promise.reject(e);if(this[f])return Promise.resolve(d(void 0,!0));if(this[p].destroyed)return new Promise((function(e,r){i.nextTick((function(){t[c]?r(t[c]):e(d(void 0,!0))}))}));var r,n=this[l];if(n)r=new Promise(function(t,e){return function(r,n){t.then((function(){e[f]?r(d(void 0,!0)):e[h](r,n)}),n)}}(n,this));else{var o=this[p].read();if(null!==o)return Promise.resolve(d(o,!1));r=new Promise(this[h])}return this[l]=r,r}},Symbol.asyncIterator,(function(){return this})),o(n,"return",(function(){var t=this;return new Promise((function(e,r){t[p].destroy(null,(function(t){t?r(t):e(d(void 0,!0))}))}))})),n),v);t.exports=function(t){var e,r=Object.create(w,(o(e={},p,{value:t,writable:!0}),o(e,u,{value:null,writable:!0}),o(e,a,{value:null,writable:!0}),o(e,c,{value:null,writable:!0}),o(e,f,{value:t._readableState.endEmitted,writable:!0}),o(e,h,{value:function(t,e){var n=r[p].read();n?(r[l]=null,r[u]=null,r[a]=null,t(d(n,!1))):(r[u]=t,r[a]=e)},writable:!0}),e));return r[l]=null,s(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=r[a];return null!==e&&(r[l]=null,r[u]=null,r[a]=null,e(t)),void(r[c]=t)}var n=r[u];null!==n&&(r[l]=null,r[u]=null,r[a]=null,n(d(void 0,!0))),r[f]=!0})),t.on("readable",g.bind(null,r)),r}},7327:(t,e,r)=>{"use strict";function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function o(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var s=r(8764).Buffer,u=r(2361).inspect,a=u&&u.custom||"inspect";t.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}var e,r,c;return e=t,r=[{key:"push",value:function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return s.alloc(0);for(var e,r,n,i=s.allocUnsafe(t>>>0),o=this.head,u=0;o;)e=o.data,r=i,n=u,s.prototype.copy.call(e,r,n),u+=o.data.length,o=o.next;return i}},{key:"consume",value:function(t,e){var r;return t<this.head.data.length?(r=this.head.data.slice(0,t),this.head.data=this.head.data.slice(t)):r=t===this.head.data.length?this.shift():e?this._getString(t):this._getBuffer(t),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(t){var e=this.head,r=1,n=e.data;for(t-=n.length;e=e.next;){var i=e.data,o=t>i.length?i.length:t;if(o===i.length?n+=i:n+=i.slice(0,t),0==(t-=o)){o===i.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(t){var e=s.allocUnsafe(t),r=this.head,n=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var i=r.data,o=t>i.length?i.length:t;if(i.copy(e,e.length-t,0,o),0==(t-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,e}},{key:a,value:function(t,e){return u(this,function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?n(Object(r),!0).forEach((function(e){i(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},e,{depth:0,customInspect:!1}))}}],r&&o(e.prototype,r),c&&o(e,c),t}()},1195:(t,e,r)=>{"use strict";var n=r(4155);function i(t,e){s(t,e),o(t)}function o(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function s(t,e){t.emit("error",e)}t.exports={destroy:function(t,e){var r=this,u=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return u||a?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(s,this,t)):n.nextTick(s,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!e&&t?r._writableState?r._writableState.errorEmitted?n.nextTick(o,r):(r._writableState.errorEmitted=!0,n.nextTick(i,r,t)):n.nextTick(i,r,t):e?(n.nextTick(o,r),e(t)):n.nextTick(o,r)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}}},8610:(t,e,r)=>{"use strict";var n=r(4281).q.ERR_STREAM_PREMATURE_CLOSE;function i(){}t.exports=function t(e,r,o){if("function"==typeof r)return t(e,null,r);r||(r={}),o=function(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];t.apply(this,n)}}}(o||i);var s=r.readable||!1!==r.readable&&e.readable,u=r.writable||!1!==r.writable&&e.writable,a=function(){e.writable||f()},c=e._writableState&&e._writableState.finished,f=function(){u=!1,c=!0,s||o.call(e)},l=e._readableState&&e._readableState.endEmitted,h=function(){s=!1,l=!0,u||o.call(e)},p=function(t){o.call(e,t)},d=function(){var t;return s&&!l?(e._readableState&&e._readableState.ended||(t=new n),o.call(e,t)):u&&!c?(e._writableState&&e._writableState.ended||(t=new n),o.call(e,t)):void 0},y=function(){e.req.on("finish",f)};return!function(t){return t.setHeader&&"function"==typeof t.abort}(e)?u&&!e._writableState&&(e.on("end",a),e.on("close",a)):(e.on("complete",f),e.on("abort",d),e.req?y():e.on("request",y)),e.on("end",h),e.on("finish",f),!1!==r.error&&e.on("error",p),e.on("close",d),function(){e.removeListener("complete",f),e.removeListener("abort",d),e.removeListener("request",y),e.req&&e.req.removeListener("finish",f),e.removeListener("end",a),e.removeListener("close",a),e.removeListener("finish",f),e.removeListener("end",h),e.removeListener("error",p),e.removeListener("close",d)}}},5167:t=>{t.exports=function(){throw new Error("Readable.from is not available in the browser")}},9946:(t,e,r)=>{"use strict";var n;var i=r(4281).q,o=i.ERR_MISSING_ARGS,s=i.ERR_STREAM_DESTROYED;function u(t){if(t)throw t}function a(t,e,i,o){o=function(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}(o);var u=!1;t.on("close",(function(){u=!0})),void 0===n&&(n=r(8610)),n(t,{readable:e,writable:i},(function(t){if(t)return o(t);u=!0,o()}));var a=!1;return function(e){if(!u&&!a)return a=!0,function(t){return t.setHeader&&"function"==typeof t.abort}(t)?t.abort():"function"==typeof t.destroy?t.destroy():void o(e||new s("pipe"))}}function c(t){t()}function f(t,e){return t.pipe(e)}function l(t){return t.length?"function"!=typeof t[t.length-1]?u:t.pop():u}t.exports=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var n,i=l(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new o("streams");var s=e.map((function(t,r){var o=r<e.length-1;return a(t,o,r>0,(function(t){n||(n=t),t&&s.forEach(c),o||(s.forEach(c),i(n))}))}));return e.reduce(f)}},2457:(t,e,r)=>{"use strict";var n=r(4281).q.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(t,e,r,i){var o=function(t,e,r){return null!=t.highWaterMark?t.highWaterMark:e?t[r]:null}(e,i,r);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new n(i?r:"highWaterMark",o);return Math.floor(o)}return t.objectMode?16:16384}}},2503:(t,e,r)=>{t.exports=r(7187).EventEmitter},697:(t,e,r)=>{const n=r(6245),i=r(504),o=r(4992),s=r(2407);t.exports=t=>{var e,r,u=0,a={type:i.ROOT,stack:[]},c=a,f=a.stack,l=[],h=e=>{n.error(t,"Nothing to repeat at column "+(e-1))},p=n.strToChars(t);for(e=p.length;u<e;)switch(r=p[u++]){case"\\":switch(r=p[u++]){case"b":f.push(s.wordBoundary());break;case"B":f.push(s.nonWordBoundary());break;case"w":f.push(o.words());break;case"W":f.push(o.notWords());break;case"d":f.push(o.ints());break;case"D":f.push(o.notInts());break;case"s":f.push(o.whitespace());break;case"S":f.push(o.notWhitespace());break;default:/\d/.test(r)?f.push({type:i.REFERENCE,value:parseInt(r,10)}):f.push({type:i.CHAR,value:r.charCodeAt(0)})}break;case"^":f.push(s.begin());break;case"$":f.push(s.end());break;case"[":var d;"^"===p[u]?(d=!0,u++):d=!1;var y=n.tokenizeClass(p.slice(u),t);u+=y[1],f.push({type:i.SET,set:y[0],not:d});break;case".":f.push(o.anyChar());break;case"(":var g={type:i.GROUP,stack:[],remember:!0};"?"===(r=p[u])&&(r=p[u+1],u+=2,"="===r?g.followedBy=!0:"!"===r?g.notFollowedBy=!0:":"!==r&&n.error(t,`Invalid group, character '${r}' after '?' at column `+(u-1)),g.remember=!1),f.push(g),l.push(c),c=g,f=g.stack;break;case")":0===l.length&&n.error(t,"Unmatched ) at column "+(u-1)),f=(c=l.pop()).options?c.options[c.options.length-1]:c.stack;break;case"|":c.options||(c.options=[c.stack],delete c.stack);var v=[];c.options.push(v),f=v;break;case"{":var w,M,L=/^(\d+)(,(\d+)?)?\}/.exec(p.slice(u));null!==L?(0===f.length&&h(u),w=parseInt(L[1],10),M=L[2]?L[3]?parseInt(L[3],10):1/0:w,u+=L[0].length,f.push({type:i.REPETITION,min:w,max:M,value:f.pop()})):f.push({type:i.CHAR,value:123});break;case"?":0===f.length&&h(u),f.push({type:i.REPETITION,min:0,max:1,value:f.pop()});break;case"+":0===f.length&&h(u),f.push({type:i.REPETITION,min:1,max:1/0,value:f.pop()});break;case"*":0===f.length&&h(u),f.push({type:i.REPETITION,min:0,max:1/0,value:f.pop()});break;default:f.push({type:i.CHAR,value:r.charCodeAt(0)})}return 0!==l.length&&n.error(t,"Unterminated group"),a},t.exports.types=i},2407:(t,e,r)=>{const n=r(504);e.wordBoundary=()=>({type:n.POSITION,value:"b"}),e.nonWordBoundary=()=>({type:n.POSITION,value:"B"}),e.begin=()=>({type:n.POSITION,value:"^"}),e.end=()=>({type:n.POSITION,value:"$"})},4992:(t,e,r)=>{const n=r(504),i=()=>[{type:n.RANGE,from:48,to:57}],o=()=>[{type:n.CHAR,value:95},{type:n.RANGE,from:97,to:122},{type:n.RANGE,from:65,to:90}].concat(i()),s=()=>[{type:n.CHAR,value:9},{type:n.CHAR,value:10},{type:n.CHAR,value:11},{type:n.CHAR,value:12},{type:n.CHAR,value:13},{type:n.CHAR,value:32},{type:n.CHAR,value:160},{type:n.CHAR,value:5760},{type:n.RANGE,from:8192,to:8202},{type:n.CHAR,value:8232},{type:n.CHAR,value:8233},{type:n.CHAR,value:8239},{type:n.CHAR,value:8287},{type:n.CHAR,value:12288},{type:n.CHAR,value:65279}];e.words=()=>({type:n.SET,set:o(),not:!1}),e.notWords=()=>({type:n.SET,set:o(),not:!0}),e.ints=()=>({type:n.SET,set:i(),not:!1}),e.notInts=()=>({type:n.SET,set:i(),not:!0}),e.whitespace=()=>({type:n.SET,set:s(),not:!1}),e.notWhitespace=()=>({type:n.SET,set:s(),not:!0}),e.anyChar=()=>({type:n.SET,set:[{type:n.CHAR,value:10},{type:n.CHAR,value:13},{type:n.CHAR,value:8232},{type:n.CHAR,value:8233}],not:!0})},504:t=>{t.exports={ROOT:0,GROUP:1,POSITION:2,SET:3,RANGE:4,REPETITION:5,REFERENCE:6,CHAR:7}},6245:(t,e,r)=>{const n=r(504),i=r(4992),o={0:0,t:9,n:10,v:11,f:12,r:13};e.strToChars=function(t){return t=t.replace(/(\[\\b\])|(\\)?\\(?:u([A-F0-9]{4})|x([A-F0-9]{2})|(0?[0-7]{2})|c([@A-Z[\\\]^?])|([0tnvfr]))/g,(function(t,e,r,n,i,s,u,a){if(r)return t;var c=e?8:n?parseInt(n,16):i?parseInt(i,16):s?parseInt(s,8):u?"@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^ ?".indexOf(u):o[a],f=String.fromCharCode(c);return/[[\]{}^$.|?*+()]/.test(f)&&(f="\\"+f),f}))},e.tokenizeClass=(t,r)=>{for(var o,s,u=[],a=/\\(?:(w)|(d)|(s)|(W)|(D)|(S))|((?:(?:\\)(.)|([^\]\\]))-(?:\\)?([^\]]))|(\])|(?:\\)?([^])/g;null!=(o=a.exec(t));)if(o[1])u.push(i.words());else if(o[2])u.push(i.ints());else if(o[3])u.push(i.whitespace());else if(o[4])u.push(i.notWords());else if(o[5])u.push(i.notInts());else if(o[6])u.push(i.notWhitespace());else if(o[7])u.push({type:n.RANGE,from:(o[8]||o[9]).charCodeAt(0),to:o[10].charCodeAt(0)});else{if(!(s=o[12]))return[u,a.lastIndex];u.push({type:n.CHAR,value:s.charCodeAt(0)})}e.error(r,"Unterminated character class")},e.error=(t,e)=>{throw new SyntaxError("Invalid regular expression: /"+t+"/: "+e)}},4189:(t,e,r)=>{var n=r(396).Buffer;function i(t,e){this._block=n.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}i.prototype.update=function(t,e){"string"==typeof t&&(e=e||"utf8",t=n.from(t,e));for(var r=this._block,i=this._blockSize,o=t.length,s=this._len,u=0;u<o;){for(var a=s%i,c=Math.min(o-u,i-a),f=0;f<c;f++)r[a+f]=t[u+f];u+=c,(s+=c)%i==0&&this._update(r)}return this._len+=o,this},i.prototype.digest=function(t){var e=this._len%this._blockSize;this._block[e]=128,this._block.fill(0,e+1),e>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var o=this._hash();return t?o.toString(t):o},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=i},9072:(t,e,r)=>{var n=t.exports=function(t){t=t.toLowerCase();var e=n[t];if(!e)throw new Error(t+" is not supported (we accept pull requests)");return new e};n.sha=r(4448),n.sha1=r(8336),n.sha224=r(8432),n.sha256=r(7499),n.sha384=r(1686),n.sha512=r(8862)},4448:(t,e,r)=>{var n=r(5717),i=r(4189),o=r(396).Buffer,s=[1518500249,1859775393,-1894007588,-899497514],u=new Array(80);function a(){this.init(),this._w=u,i.call(this,64,56)}function c(t){return t<<30|t>>>2}function f(t,e,r,n){return 0===t?e&r|~e&n:2===t?e&r|e&n|r&n:e^r^n}n(a,i),a.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},a.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,u=0|this._d,a=0|this._e,l=0;l<16;++l)r[l]=t.readInt32BE(4*l);for(;l<80;++l)r[l]=r[l-3]^r[l-8]^r[l-14]^r[l-16];for(var h=0;h<80;++h){var p=~~(h/20),d=0|((e=n)<<5|e>>>27)+f(p,i,o,u)+a+r[h]+s[p];a=u,u=o,o=c(i),i=n,n=d}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=u+this._d|0,this._e=a+this._e|0},a.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=a},8336:(t,e,r)=>{var n=r(5717),i=r(4189),o=r(396).Buffer,s=[1518500249,1859775393,-1894007588,-899497514],u=new Array(80);function a(){this.init(),this._w=u,i.call(this,64,56)}function c(t){return t<<5|t>>>27}function f(t){return t<<30|t>>>2}function l(t,e,r,n){return 0===t?e&r|~e&n:2===t?e&r|e&n|r&n:e^r^n}n(a,i),a.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},a.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,u=0|this._d,a=0|this._e,h=0;h<16;++h)r[h]=t.readInt32BE(4*h);for(;h<80;++h)r[h]=(e=r[h-3]^r[h-8]^r[h-14]^r[h-16])<<1|e>>>31;for(var p=0;p<80;++p){var d=~~(p/20),y=c(n)+l(d,i,o,u)+a+r[p]+s[d]|0;a=u,u=o,o=f(i),i=n,n=y}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=u+this._d|0,this._e=a+this._e|0},a.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=a},8432:(t,e,r)=>{var n=r(5717),i=r(7499),o=r(4189),s=r(396).Buffer,u=new Array(64);function a(){this.init(),this._w=u,o.call(this,64,56)}n(a,i),a.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},a.prototype._hash=function(){var t=s.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t},t.exports=a},7499:(t,e,r)=>{var n=r(5717),i=r(4189),o=r(396).Buffer,s=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],u=new Array(64);function a(){this.init(),this._w=u,i.call(this,64,56)}function c(t,e,r){return r^t&(e^r)}function f(t,e,r){return t&e|r&(t|e)}function l(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function h(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function p(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}n(a,i),a.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},a.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,u=0|this._d,a=0|this._e,d=0|this._f,y=0|this._g,g=0|this._h,v=0;v<16;++v)r[v]=t.readInt32BE(4*v);for(;v<64;++v)r[v]=0|(((e=r[v-2])>>>17|e<<15)^(e>>>19|e<<13)^e>>>10)+r[v-7]+p(r[v-15])+r[v-16];for(var w=0;w<64;++w){var M=g+h(a)+c(a,d,y)+s[w]+r[w]|0,L=l(n)+f(n,i,o)|0;g=y,y=d,d=a,a=u+M|0,u=o,o=i,i=n,n=M+L|0}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=u+this._d|0,this._e=a+this._e|0,this._f=d+this._f|0,this._g=y+this._g|0,this._h=g+this._h|0},a.prototype._hash=function(){var t=o.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t},t.exports=a},1686:(t,e,r)=>{var n=r(5717),i=r(8862),o=r(4189),s=r(396).Buffer,u=new Array(160);function a(){this.init(),this._w=u,o.call(this,128,112)}n(a,i),a.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},a.prototype._hash=function(){var t=s.allocUnsafe(48);function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t},t.exports=a},8862:(t,e,r)=>{var n=r(5717),i=r(4189),o=r(396).Buffer,s=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],u=new Array(160);function a(){this.init(),this._w=u,i.call(this,128,112)}function c(t,e,r){return r^t&(e^r)}function f(t,e,r){return t&e|r&(t|e)}function l(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function h(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function p(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function d(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function y(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function g(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function v(t,e){return t>>>0<e>>>0?1:0}n(a,i),a.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},a.prototype._update=function(t){for(var e=this._w,r=0|this._ah,n=0|this._bh,i=0|this._ch,o=0|this._dh,u=0|this._eh,a=0|this._fh,w=0|this._gh,M=0|this._hh,L=0|this._al,_=0|this._bl,m=0|this._cl,b=0|this._dl,j=0|this._el,x=0|this._fl,N=0|this._gl,S=0|this._hl,D=0;D<32;D+=2)e[D]=t.readInt32BE(4*D),e[D+1]=t.readInt32BE(4*D+4);for(;D<160;D+=2){var I=e[D-30],E=e[D-30+1],A=p(I,E),C=d(E,I),T=y(I=e[D-4],E=e[D-4+1]),O=g(E,I),z=e[D-14],k=e[D-14+1],U=e[D-32],R=e[D-32+1],Y=C+k|0,B=A+z+v(Y,C)|0;B=(B=B+T+v(Y=Y+O|0,O)|0)+U+v(Y=Y+R|0,R)|0,e[D]=B,e[D+1]=Y}for(var P=0;P<160;P+=2){B=e[P],Y=e[P+1];var Q=f(r,n,i),F=f(L,_,m),G=l(r,L),W=l(L,r),q=h(u,j),H=h(j,u),J=s[P],Z=s[P+1],$=c(u,a,w),V=c(j,x,N),X=S+H|0,K=M+q+v(X,S)|0;K=(K=(K=K+$+v(X=X+V|0,V)|0)+J+v(X=X+Z|0,Z)|0)+B+v(X=X+Y|0,Y)|0;var tt=W+F|0,et=G+Q+v(tt,W)|0;M=w,S=N,w=a,N=x,a=u,x=j,u=o+K+v(j=b+X|0,b)|0,o=i,b=m,i=n,m=_,n=r,_=L,r=K+et+v(L=X+tt|0,X)|0}this._al=this._al+L|0,this._bl=this._bl+_|0,this._cl=this._cl+m|0,this._dl=this._dl+b|0,this._el=this._el+j|0,this._fl=this._fl+x|0,this._gl=this._gl+N|0,this._hl=this._hl+S|0,this._ah=this._ah+r+v(this._al,L)|0,this._bh=this._bh+n+v(this._bl,_)|0,this._ch=this._ch+i+v(this._cl,m)|0,this._dh=this._dh+o+v(this._dl,b)|0,this._eh=this._eh+u+v(this._el,j)|0,this._fh=this._fh+a+v(this._fl,x)|0,this._gh=this._gh+w+v(this._gl,N)|0,this._hh=this._hh+M+v(this._hl,S)|0},a.prototype._hash=function(){var t=o.allocUnsafe(64);function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t},t.exports=a},2830:(t,e,r)=>{t.exports=i;var n=r(7187).EventEmitter;function i(){n.call(this)}r(5717)(i,n),i.Readable=r(9481),i.Writable=r(3982),i.Duplex=r(6753),i.Transform=r(4605),i.PassThrough=r(2725),i.finished=r(8610),i.pipeline=r(9946),i.Stream=i,i.prototype.pipe=function(t,e){var r=this;function i(e){t.writable&&!1===t.write(e)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",i),t.on("drain",o),t._isStdio||e&&!1===e.end||(r.on("end",u),r.on("close",a));var s=!1;function u(){s||(s=!0,t.end())}function a(){s||(s=!0,"function"==typeof t.destroy&&t.destroy())}function c(t){if(f(),0===n.listenerCount(this,"error"))throw t}function f(){r.removeListener("data",i),t.removeListener("drain",o),r.removeListener("end",u),r.removeListener("close",a),r.removeListener("error",c),t.removeListener("error",c),r.removeListener("end",f),r.removeListener("close",f),t.removeListener("close",f)}return r.on("error",c),t.on("error",c),r.on("end",f),r.on("close",f),t.on("close",f),t.emit("pipe",r),t}},2553:(t,e,r)=>{"use strict";var n=r(396).Buffer,i=n.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(n.isEncoding===i||!i(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=a,this.end=c,e=4;break;case"utf8":this.fillLast=u,e=4;break;case"base64":this.text=f,this.end=l,e=3;break;default:return this.write=h,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(e)}function s(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function u(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function a(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function c(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function f(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function l(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function h(t){return t.toString(this.encoding)}function p(t){return t&&t.length?this.write(t):""}e.s=o,o.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""},o.prototype.end=function(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"�":e},o.prototype.text=function(t,e){var r=function(t,e,r){var n=e.length-1;if(n<r)return 0;var i=s(e[n]);if(i>=0)return i>0&&(t.lastNeed=i-1),i;if(--n<r||-2===i)return 0;if((i=s(e[n]))>=0)return i>0&&(t.lastNeed=i-2),i;if(--n<r||-2===i)return 0;if((i=s(e[n]))>=0)return i>0&&(2===i?i=0:t.lastNeed=i-3),i;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},396:(t,e,r)=>{var n=r(8764),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,e),e.Buffer=s),s.prototype=Object.create(i.prototype),o(i,s),s.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},4927:(t,e,r)=>{function n(t){try{if(!r.g.localStorage)return!1}catch(t){return!1}var e=r.g.localStorage[t];return null!=e&&"true"===String(e).toLowerCase()}t.exports=function(t,e){if(n("noDeprecation"))return t;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(e);n("traceDeprecation")?console.trace(e):console.warn(e),r=!0}return t.apply(this,arguments)}}},255:t=>{var e={"&":"&amp;",'"':"&quot;","'":"&apos;","<":"&lt;",">":"&gt;"};t.exports=function(t){return t&&t.replace?t.replace(/([&"<>'])/g,(function(t,r){return e[r]})):t}},3479:(t,e,r)=>{var n=r(4155),i=r(255),o=r(2830).Stream;function s(t,e,r){r=r||0;var n,o,u=(n=e,new Array(r||0).join(n||"")),a=t;if("object"==typeof t&&((a=t[o=Object.keys(t)[0]])&&a._elem))return a._elem.name=o,a._elem.icount=r,a._elem.indent=e,a._elem.indents=u,a._elem.interrupt=a,a._elem;var c,f=[],l=[];function h(t){Object.keys(t).forEach((function(e){f.push(function(t,e){return t+'="'+i(e)+'"'}(e,t[e]))}))}switch(typeof a){case"object":if(null===a)break;a._attr&&h(a._attr),a._cdata&&l.push(("<![CDATA["+a._cdata).replace(/\]\]>/g,"]]]]><![CDATA[>")+"]]>"),a.forEach&&(c=!1,l.push(""),a.forEach((function(t){"object"==typeof t?"_attr"==Object.keys(t)[0]?h(t._attr):l.push(s(t,e,r+1)):(l.pop(),c=!0,l.push(i(t)))})),c||l.push(""));break;default:l.push(i(a))}return{name:o,interrupt:!1,attributes:f,content:l,icount:r,indents:u,indent:e}}function u(t,e,r){if("object"!=typeof e)return t(!1,e);var n=e.interrupt?1:e.content.length;function i(){for(;e.content.length;){var i=e.content.shift();if(void 0!==i){if(o(i))return;u(t,i)}}t(!1,(n>1?e.indents:"")+(e.name?"</"+e.name+">":"")+(e.indent&&!r?"\n":"")),r&&r()}function o(e){return!!e.interrupt&&(e.interrupt.append=t,e.interrupt.end=i,e.interrupt=!1,t(!0),!0)}if(t(!1,e.indents+(e.name?"<"+e.name:"")+(e.attributes.length?" "+e.attributes.join(" "):"")+(n?e.name?">":"":e.name?"/>":"")+(e.indent&&n>1?"\n":"")),!n)return t(!1,e.indent?"\n":"");o(e)||i()}t.exports=function(t,e){"object"!=typeof e&&(e={indent:e});var r,i,a=e.stream?new o:null,c="",f=!1,l=e.indent?!0===e.indent?"    ":e.indent:"",h=!0;function p(t){h?n.nextTick(t):t()}function d(t,e){if(void 0!==e&&(c+=e),t&&!f&&(a=a||new o,f=!0),t&&f){var r=c;p((function(){a.emit("data",r)})),c=""}}function y(t,e){u(d,s(t,l,l?1:0),e)}function g(){if(a){var t=c;p((function(){a.emit("data",t),a.emit("end"),a.readable=!1,a.emit("close")}))}}return p((function(){h=!1})),e.declaration&&(r=e.declaration,i={version:"1.0",encoding:r.encoding||"UTF-8"},r.standalone&&(i.standalone=r.standalone),y({"?xml":{_attr:i}}),c=c.replace("/>","?>")),t&&t.forEach?t.forEach((function(e,r){var n;r+1===t.length&&(n=g),y(e,n)})):y(t,g),a?(a.readable=!0,a):c},t.exports.element=t.exports.Element=function(){var t=Array.prototype.slice.call(arguments),e={_elem:s(t),push:function(t){if(!this.append)throw new Error("not assigned to a parent!");var e=this,r=this._elem.indent;u(this.append,s(t,r,this._elem.icount+(r?1:0)),(function(){e.append(!0)}))},close:function(t){void 0!==t&&this.push(t),this.end&&this.end()}};return e}},5996:t=>{"use strict";t.exports="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2aWV3Qm94PSIwIDAgNDA3IDExNiI+DQogIDxkZWZzPg0KICAgIDxzdHlsZT4NCiAgICAgIC5jbHMtMSB7DQogICAgICAgIGNsaXAtcGF0aDogdXJsKCNjbGlwLVNXX1RNLWxvZ28tb24tZGFyayk7DQogICAgICB9DQoNCiAgICAgIC5jbHMtMiB7DQogICAgICAgIGZpbGw6ICNmZmY7DQogICAgICB9DQoNCiAgICAgIC5jbHMtMyB7DQogICAgICAgIGZpbGw6ICM4NWVhMmQ7DQogICAgICB9DQoNCiAgICAgIC5jbHMtNCB7DQogICAgICAgIGZpbGw6ICMxNzM2NDc7DQogICAgICB9DQogICAgPC9zdHlsZT4NCiAgICA8Y2xpcFBhdGggaWQ9ImNsaXAtU1dfVE0tbG9nby1vbi1kYXJrIj4NCiAgICAgIDxyZWN0IHdpZHRoPSI0MDciIGhlaWdodD0iMTE2Ii8+DQogICAgPC9jbGlwUGF0aD4NCiAgPC9kZWZzPg0KICA8ZyBpZD0iU1dfVE0tbG9nby1vbi1kYXJrIiBjbGFzcz0iY2xzLTEiPg0KICAgIDxnIGlkPSJTV19Jbi1Qcm9kdWN0IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMC4zMDEpIj4NCiAgICAgIDxwYXRoIGlkPSJQYXRoXzI5MzYiIGRhdGEtbmFtZT0iUGF0aCAyOTM2IiBjbGFzcz0iY2xzLTIiIGQ9Ik0zNTkuMTUsNzAuNjc0aC0uN1Y2Ni45OTJoLTEuMjZ2LS42aDMuMjE5di42SDM1OS4xNVoiLz4NCiAgICAgIDxwYXRoIGlkPSJQYXRoXzI5MzciIGRhdGEtbmFtZT0iUGF0aCAyOTM3IiBjbGFzcz0iY2xzLTIiIGQ9Ik0zNjMuMjE3LDcwLjY3NCwzNjEuOTc1LDY3LjFoLS4wMjNxLjA1LjguMDUsMS40OTR2Mi4wODNoLS42MzZWNjYuMzkxaC45ODdsMS4xOSwzLjQwN2guMDE3bDEuMjI1LTMuNDA3aC45OXY0LjI4M0gzNjUuMVY2OC41NTZjMC0uMjEzLjAwNi0uNDkuMDE2LS44MzJzLjAyLS41NDkuMDI4LS42MjFoLS4wMjNsLTEuMjg2LDMuNTcxWiIvPg0KICAgICAgPHBhdGggaWQ9IlBhdGhfMjkzOCIgZGF0YS1uYW1lPSJQYXRoIDI5MzgiIGNsYXNzPSJjbHMtMyIgZD0iTTUwLjMyOCw5Ny42NjlBNDcuNjQyLDQ3LjY0MiwwLDEsMSw5Ny45NzEsNTAuMDI3LDQ3LjY0Miw0Ny42NDIsMCwwLDEsNTAuMzI4LDk3LjY2OVoiLz4NCiAgICAgIDxwYXRoIGlkPSJQYXRoXzI5MzkiIGRhdGEtbmFtZT0iUGF0aCAyOTM5IiBjbGFzcz0iY2xzLTMiIGQ9Ik01MC4zMjgsNC43NjlBNDUuMjU4LDQ1LjI1OCwwLDEsMSw1LjA3LDUwLjAyNyw0NS4yNTgsNDUuMjU4LDAsMCwxLDUwLjMyOCw0Ljc2OW0wLTQuNzY5YTUwLjAyNyw1MC4wMjcsMCwxLDAsNTAuMDI3LDUwLjAyN0E1MC4wMjcsNTAuMDI3LDAsMCwwLDUwLjMyOCwwWiIvPg0KICAgICAgPHBhdGggaWQ9IlBhdGhfMjk0MCIgZGF0YS1uYW1lPSJQYXRoIDI5NDAiIGNsYXNzPSJjbHMtNCIgZD0iTTMxLjgsMzMuODU0Yy0uMTU0LDEuNzEyLjA1OCwzLjQ4Mi0uMDU3LDUuMjEzYTQyLjY2NSw0Mi42NjUsMCwwLDEtLjY5Myw1LjE1Niw5LjUzLDkuNTMsMCwwLDEtNC4xLDUuODI5YzQuMDc5LDIuNjU0LDQuNTQsNi43NzEsNC44MSwxMC45NDYuMTM1LDIuMjUuMDc3LDQuNTIuMzA4LDYuNzUyLjE3MywxLjczMS44NDYsMi4xNzQsMi42MzYsMi4yMzEuNzMuMDIsMS40OCwwLDIuMzI3LDBWNzUuMzNjLTUuMjkuOS05LjY1Ny0uNi0xMC43MzQtNS4wNzlhMzAuNzYsMzAuNzYsMCwwLDEtLjY1NC01Yy0uMTE3LTEuNzg5LjA3Ni0zLjU3OC0uMDU4LTUuMzY3LS4zODYtNC45MDYtMS4wMi02LjU2LTUuNzEzLTYuNzkxdi02LjFBOS4xOTEsOS4xOTEsMCwwLDEsMjAuOSw0Ni44MmMyLjU3Ny0uMTM1LDMuNjc0LS45MjQsNC4yMzEtMy40NjNhMjkuMywyOS4zLDAsMCwwLC40ODEtNC4zMjksODIuMSw4Mi4xLDAsMCwxLC42LTguNDA2Yy42NzMtMy45ODIsMy4xMzYtNS45MDYsNy4yMzQtNi4xMzcsMS4xNTQtLjA1NywyLjMyNywwLDMuNjU1LDB2NS40NjRjLS41NTguMDM4LTEuMDM5LjExNS0xLjUzOS4xMTVDMzIuMjI2LDI5Ljk0OSwzMi4wNTIsMzEuMDg0LDMxLjgsMzMuODU0Wm02LjQwNiwxMi42NThoLS4wNzdhMy41MTUsMy41MTUsMCwxLDAtLjM0Niw3LjAyMWguMjMxYTMuNDYxLDMuNDYxLDAsMCwwLDMuNjU1LTMuMjUxVjUwLjA5YTMuNTIzLDMuNTIzLDAsMCwwLTMuNDYxLTMuNTc4Wm0xMi4wNjIsMGEzLjM3MywzLjM3MywwLDAsMC0zLjQ4MiwzLjI1MSwxLjc5LDEuNzksMCwwLDAsLjAyLjMyNywzLjMsMy4zLDAsMCwwLDMuNTc4LDMuNDQzLDMuMjYzLDMuMjYzLDAsMCwwLDMuNDQzLTMuNTU4LDMuMzA4LDMuMzA4LDAsMCwwLTMuNTU3LTMuNDYzWm0xMi4zNTEsMGEzLjU5MiwzLjU5MiwwLDAsMC0zLjY1NSwzLjQ4MkEzLjUyOSwzLjUyOSwwLDAsMCw2Mi41LDUzLjUzM2guMDM5YzEuNzY5LjMwOSwzLjU1OS0xLjQsMy42NzQtMy40NjJhMy41NzEsMy41NzEsMCwwLDAtMy42LTMuNTU5Wm0xNi45NDguMjg4Yy0yLjIzMi0uMS0zLjM0OC0uODQ2LTMuOS0yLjk2MmEyMS40NDcsMjEuNDQ3LDAsMCwxLS42MzUtNC4xMzZjLS4xNTQtMi41NzgtLjEzNS01LjE3NS0uMzA4LTcuNzUzLS40LTYuMTE3LTQuODI4LTguMjUyLTExLjI1NC03LjE5NXY1LjMxYzEuMDE5LDAsMS44MDgsMCwyLjYuMDE5LDEuMzY2LjAxOSwyLjQuNTM5LDIuNTM5LDIuMDU5LjEzNSwxLjM4NS4xMzUsMi43ODkuMjcsNC4xOTMuMjY5LDIuNzkuNDIyLDUuNjE4LjksOC4zNjlBOC43MTUsOC43MTUsMCwwLDAsNzMuNyw1MC4wNTJjLTMuNCwyLjI4OS00LjQwNiw1LjU1OS00LjU3OCw5LjIzNC0uMSwyLjUyLS4xNTQsNS4wNTktLjI4OSw3LjYtLjExNSwyLjMwOC0uOTIzLDMuMDU4LTMuMjUxLDMuMTE2LS42NTQuMDE5LTEuMjg5LjA3Ny0yLjAxOS4xMTV2NS40NDVjMS4zNjUsMCwyLjYxNi4wNzcsMy44NjYsMCwzLjg4Ni0uMjMxLDYuMjMzLTIuMTE3LDctNS44ODdBNDkuMDc5LDQ5LjA3OSwwLDAsMCw3NSw2My40Yy4xMzUtMS45MjMuMTE2LTMuODY2LjMwOC01Ljc3MS4yODktMi45ODIsMS42NTUtNC4yMTMsNC42MzYtNC40YTQuMDM3LDQuMDM3LDAsMCwwLC44MjgtLjE5MnYtNi4xYy0uNS0uMDU4LS44NDMtLjExNS0xLjIwOC0uMTM1WiIvPg0KICAgICAgPHBhdGggaWQ9IlBhdGhfMjk0MSIgZGF0YS1uYW1lPSJQYXRoIDI5NDEiIGNsYXNzPSJjbHMtMiIgZD0iTTE1Mi4yNzMsNTguMTIyYTExLjIyOCwxMS4yMjgsMCwwLDEtNC4zODQsOS40MjRxLTQuMzgzLDMuMzgyLTExLjksMy4zODItOC4xNCwwLTEyLjUyNC0yLjFWNjMuN2EzMi45LDMyLjksMCwwLDAsNi4xMzcsMS44NzksMzIuMywzMi4zLDAsMCwwLDYuNTc1LjY4OXE1LjMyMiwwLDguMDE1LTIuMDJhNi42MjYsNi42MjYsMCwwLDAsMi42OTItNS42Miw3LjIyMiw3LjIyMiwwLDAsMC0uOTU0LTMuOSw4Ljg4NSw4Ljg4NSwwLDAsMC0zLjE5NC0yLjgsNDQuNjM0LDQ0LjYzNCwwLDAsMC02LjgxLTIuOTExcS02LjM4Ny0yLjI4Ni05LjEyNi01LjQxN2ExMS45NTUsMTEuOTU1LDAsMCwxLTIuNzQtOC4xNzJBMTAuMTY0LDEwLjE2NCwwLDAsMSwxMjguMDM5LDI3cTMuOTc3LTMuMTMxLDEwLjUyLTMuMTMxYTMxLDMxLDAsMCwxLDEyLjU1NSwyLjVMMTQ5LjQ1NSwzMWEyOC4zODIsMjguMzgyLDAsMCwwLTExLjAyMS0yLjM4LDEwLjY2OCwxMC42NjgsMCwwLDAtNi42MDYsMS44MTYsNS45ODQsNS45ODQsMCwwLDAtMi4zOCw1LjA0MSw3LjcyMiw3LjcyMiwwLDAsMCwuODc3LDMuOSw4LjI0Miw4LjI0MiwwLDAsMCwyLjk1OSwyLjc4NiwzNi43LDM2LjcsMCwwLDAsNi4zNzEsMi44cTcuMiwyLjU2Niw5LjkxLDUuNTFBMTAuODQsMTAuODQsMCwwLDEsMTUyLjI3Myw1OC4xMjJaIi8+DQogICAgICA8cGF0aCBpZD0iUGF0aF8yOTQyIiBkYXRhLW5hbWU9IlBhdGggMjk0MiIgY2xhc3M9ImNscy0yIiBkPSJNMTg1LjI4OCw3MC4zLDE3OSw1MC4xN3EtLjU5NC0xLjg0OC0yLjIyMi04LjM5MWgtLjI1MXEtMS4yNTIsNS40NzktMi4xOTIsOC40NTNMMTY3Ljg0OSw3MC4zaC02LjAxMWwtOS4zNjEtMzQuMzE1aDUuNDQ3cTMuMzE4LDEyLjkzMSw1LjA1NywxOS42OTNhODAuMTEyLDgwLjExMiwwLDAsMSwxLjk4OCw5LjExMWguMjVxLjM0NS0xLjc4NSwxLjExMi00LjYxOHQxLjMzLTQuNDkzbDYuMjk0LTE5LjY5M2g1LjYzNWw2LjEzNywxOS42OTNhNjYuMzY5LDY2LjM2OSwwLDAsMSwyLjM3OSw5LjA0OGguMjUxYTMzLjE2MywzMy4xNjMsMCwwLDEsLjY3My0zLjQ3NXEuNTQ4LTIuMzQ3LDYuNTI4LTI1LjI2Nmg1LjM4NUwxOTEuNDU2LDcwLjNaIi8+DQogICAgICA8cGF0aCBpZD0iUGF0aF8yOTQzIiBkYXRhLW5hbWU9IlBhdGggMjk0MyIgY2xhc3M9ImNscy0yIiBkPSJNMjI1LjExNSw3MC4zbC0xLjAzMy00Ljg4NWgtLjI1YTE0LjQ0NiwxNC40NDYsMCwwLDEtNS4xMTksNC4zNjgsMTUuNjA4LDE1LjYwOCwwLDAsMS02LjM3MiwxLjE0M3EtNS4xLDAtOC0yLjYzdC0yLjktNy40ODNxMC0xMC40LDE2LjYyNi0xMC45bDUuODIzLS4xODhWNDcuNnEwLTQuMDM4LTEuNzM4LTUuOTY0VDIxNi42LDM5LjcxM2EyMi42MzMsMjIuNjMzLDAsMCwwLTkuNzA2LDIuNjNsLTEuNi0zLjk3N2EyNC40MzcsMjQuNDM3LDAsMCwxLDUuNTU3LTIuMTYsMjQuMDU2LDI0LjA1NiwwLDAsMSw2LjA1OC0uNzgzcTYuMTM2LDAsOS4xLDIuNzI0dDIuOTU5LDguNzM1VjcwLjNabS0xMS43NDEtMy42NjNBMTAuNTQ5LDEwLjU0OSwwLDAsMCwyMjEsNjMuOTc3YTkuODQ1LDkuODQ1LDAsMCwwLDIuNzcxLTcuNDUxdi0zLjFsLTUuMi4yMTlxLTYuMi4yMTktOC45MzksMS45MjZhNS44LDUuOCwwLDAsMC0yLjc0LDUuMzA2LDUuMzU0LDUuMzU0LDAsMCwwLDEuNzA3LDQuMjksNy4wODEsNy4wODEsMCwwLDAsNC43NzUsMS40NzJaIi8+DQogICAgICA8cGF0aCBpZD0iUGF0aF8yOTQ0IiBkYXRhLW5hbWU9IlBhdGggMjk0NCIgY2xhc3M9ImNscy0yIiBkPSJNMjY0LjYsMzUuOTg3djMuMjg3bC02LjM1Ni43NTJhMTEuMTYsMTEuMTYsMCwwLDEsMi4yNTUsNi44NTYsMTAuMTQ4LDEwLjE0OCwwLDAsMS0zLjQ0NCw4LjA0N3EtMy40NDQsMy05LjQ1NiwzYTE1LjczNCwxNS43MzQsMCwwLDEtMi44OC0uMjVRMjQxLjQsNTkuNDM4LDI0MS40LDYyLjFhMi4yNDIsMi4yNDIsMCwwLDAsMS4xNTksMi4wODIsOC40NTYsOC40NTYsMCwwLDAsMy45NzYuNjczaDYuMDc0cTUuNTczLDAsOC41NjMsMi4zNDhhOC4xNTgsOC4xNTgsMCwwLDEsMi45OSw2LjgyNSw5Ljc0Myw5Ljc0MywwLDAsMS00LjU3MSw4LjY4OHEtNC41NzIsMi45ODktMTMuMzM4LDIuOTktNi43MzIsMC0xMC4zNzktMi41YTguMDg3LDguMDg3LDAsMCwxLTMuNjQ3LTcuMDc2LDcuOTQ2LDcuOTQ2LDAsMCwxLDItNS40MTcsMTAuMjExLDEwLjIxMSwwLDAsMSw1LjYzNi0zLjEsNS40MjksNS40MjksMCwwLDEtMi4yMDctMS44NDcsNC44OSw0Ljg5LDAsMCwxLS44OTMtMi45MTIsNS41Myw1LjUzLDAsMCwxLDEtMy4yODgsMTAuNTI5LDEwLjUyOSwwLDAsMSwzLjE2Mi0yLjcyMyw5LjI3NSw5LjI3NSwwLDAsMS00LjMzNi0zLjcyNiwxMC45NDUsMTAuOTQ1LDAsMCwxLTEuNjc1LTYuMDEycTAtNS42MzQsMy4zODItOC42ODh0OS41OC0zLjA1MmExNy40MzksMTcuNDM5LDAsMCwxLDQuODUzLjYyNlpNMjM3LjIzMyw3Ni4wNjJhNC42Niw0LjY2LDAsMCwwLDIuMzQ4LDQuMjI3LDEyLjk3MywxMi45NzMsMCwwLDAsNi43MzIsMS40NHE2LjU0MywwLDkuNjktMS45NTZhNS45OTIsNS45OTIsMCwwLDAsMy4xNDctNS4zMDdxMC0yLjc4Ny0xLjcyMy0zLjg2N3QtNi40ODEtMS4wOGgtNi4yM2E4LjIwNSw4LjIwNSwwLDAsMC01LjUxLDEuNjksNi4wNDMsNi4wNDMsMCwwLDAtMS45NzMsNC44NTNabTIuODE4LTI5LjA4NmE2Ljk4NCw2Ljk4NCwwLDAsMCwyLjAzNSw1LjQ0OCw4LjEyMyw4LjEyMywwLDAsMCw1LjY2NywxLjg0N3E3LjYwOCwwLDcuNjA4LTcuMzg5LDAtNy43MzMtNy43LTcuNzMzYTcuNjI4LDcuNjI4LDAsMCwwLTUuNjM1LDEuOTcycS0xLjk3NiwxLjk3My0xLjk3NSw1Ljg1NVoiLz4NCiAgICAgIDxwYXRoIGlkPSJQYXRoXzI5NDUiIGRhdGEtbmFtZT0iUGF0aCAyOTQ1IiBjbGFzcz0iY2xzLTIiIGQ9Ik0yOTkuMTM2LDM1Ljk4N3YzLjI4N2wtNi4zNTYuNzUyYTExLjE2OCwxMS4xNjgsMCwwLDEsMi4yNTQsNi44NTYsMTAuMTQ1LDEwLjE0NSwwLDAsMS0zLjQ0NCw4LjA0N3EtMy40NDQsMy05LjQ1NSwzYTE1LjczNCwxNS43MzQsMCwwLDEtMi44OC0uMjVxLTMuMzIsMS43NTQtMy4zMTksNC40MTVhMi4yNDMsMi4yNDMsMCwwLDAsMS4xNTgsMi4wODIsOC40NTksOC40NTksMCwwLDAsMy45NzYuNjczaDYuMDc0cTUuNTc0LDAsOC41NjMsMi4zNDhhOC4xNTgsOC4xNTgsMCwwLDEsMi45OSw2LjgyNSw5Ljc0Myw5Ljc0MywwLDAsMS00LjU3MSw4LjY4OHEtNC41NywyLjk4OS0xMy4zMzcsMi45OS02LjczMiwwLTEwLjM3OS0yLjVhOC4wODgsOC4wODgsMCwwLDEtMy42NDgtNy4wNzYsNy45NDcsNy45NDcsMCwwLDEsMi01LjQxNywxMC4yMDcsMTAuMjA3LDAsMCwxLDUuNjM2LTMuMSw1LjQzMiw1LjQzMiwwLDAsMS0yLjIwOC0xLjg0Nyw0Ljg4OSw0Ljg4OSwwLDAsMS0uODkyLTIuOTEyLDUuNTMsNS41MywwLDAsMSwxLTMuMjg4LDEwLjUyOSwxMC41MjksMCwwLDEsMy4xNjItMi43MjMsOS4yNzEsOS4yNzEsMCwwLDEtNC4zMzYtMy43MjYsMTAuOTQ1LDEwLjk0NSwwLDAsMS0xLjY3NS02LjAxMnEwLTUuNjM0LDMuMzgxLTguNjg4dDkuNTgxLTMuMDUyYTE3LjQ0NCwxNy40NDQsMCwwLDEsNC44NTMuNjI2Wk0yNzEuNzcyLDc2LjA2MmE0LjY1OCw0LjY1OCwwLDAsMCwyLjM0OCw0LjIyNywxMi45NjksMTIuOTY5LDAsMCwwLDYuNzMxLDEuNDRxNi41NDQsMCw5LjY5MS0xLjk1NmE1Ljk5Myw1Ljk5MywwLDAsMCwzLjE0Ni01LjMwN3EwLTIuNzg3LTEuNzIyLTMuODY3dC02LjQ4MS0xLjA4aC02LjIzYTguMjA4LDguMjA4LDAsMCwwLTUuNTExLDEuNjlBNi4wNDIsNi4wNDIsMCwwLDAsMjcxLjc3Miw3Ni4wNjJabTIuODE4LTI5LjA4NmE2Ljk4NCw2Ljk4NCwwLDAsMCwyLjAzNSw1LjQ0OCw4LjEyMSw4LjEyMSwwLDAsMCw1LjY2NywxLjg0N3E3LjYwNywwLDcuNjA4LTcuMzg5LDAtNy43MzMtNy43LTcuNzMzYTcuNjI5LDcuNjI5LDAsMCwwLTUuNjM1LDEuOTcycS0xLjk3NSwxLjk3My0xLjk3NSw1Ljg1NVoiLz4NCiAgICAgIDxwYXRoIGlkPSJQYXRoXzI5NDYiIGRhdGEtbmFtZT0iUGF0aCAyOTQ2IiBjbGFzcz0iY2xzLTIiIGQ9Ik0zMTYuNzc4LDcwLjkyOHEtNy42MDgsMC0xMi4wMDctNC42MzR0LTQuNC0xMi44NjhxMC04LjMsNC4wODYtMTMuMTgxYTEzLjU3MywxMy41NzMsMCwwLDEsMTAuOTc0LTQuODg0QTEyLjkzOCwxMi45MzgsMCwwLDEsMzI1LjYzOCwzOS42cTMuNzYyLDQuMjQ3LDMuNzYyLDExLjJ2My4yODdIMzA1Ljc1N3EuMTU2LDYuMDQ0LDMuMDUzLDkuMTc0dDguMTU2LDMuMTMxYTI3LjYzMywyNy42MzMsMCwwLDAsMTAuOTU4LTIuMzE3djQuNjM0YTI3LjUsMjcuNSwwLDAsMS01LjIxMywxLjcwNiwyOS4yNTEsMjkuMjUxLDAsMCwxLTUuOTMzLjUxM1ptLTEuNDA5LTMxLjIxNWE4LjQ4OSw4LjQ4OSwwLDAsMC02LjU5MSwyLjY5MiwxMi40MTYsMTIuNDE2LDAsMCwwLTIuOSw3LjQ1MmgxNy45NHEwLTQuOTE2LTIuMTkxLTcuNTNhNy43MTQsNy43MTQsMCwwLDAtNi4yNTgtMi42MTRaIi8+DQogICAgICA8cGF0aCBpZD0iUGF0aF8yOTQ3IiBkYXRhLW5hbWU9IlBhdGggMjk0NyIgY2xhc3M9ImNscy0yIiBkPSJNMzUwLjksMzUuMzYxYTIwLjM4LDIwLjM4LDAsMCwxLDQuMS4zNzVsLS43MjEsNC44MjJhMTcuNzEyLDE3LjcxMiwwLDAsMC0zLjc1Ny0uNDdBOS4xNDIsOS4xNDIsMCwwLDAsMzQzLjQsNDMuNDdhMTIuMzI3LDEyLjMyNywwLDAsMC0yLjk1OSw4LjQyMlY3MC4zaC01LjJWMzUuOTg3aDQuMjlsLjYsNi4zNTZoLjI1YTE1LjA3MiwxNS4wNzIsMCwwLDEsNC42LTUuMTY2LDEwLjM1NiwxMC4zNTYsMCwwLDEsNS45MTktMS44MTZaIi8+DQogICAgICA8cGF0aCBpZD0iUGF0aF8yOTQ4IiBkYXRhLW5hbWU9IlBhdGggMjk0OCIgY2xhc3M9ImNscy0yIiBkPSJNMjU1Ljg1Nyw5Ni42MzhzLTMuNDMtLjM5MS00Ljg1LS4zOTFjLTIuMDU4LDAtMy4xMTEuNzM1LTMuMTExLDIuMTgsMCwxLjU2OC44ODIsMS45MzUsMy43NDgsMi43MTksMy41MjcuOTgsNC44LDEuOTExLDQuOCw0Ljc3NywwLDMuNjc1LTIuMyw1LjI2Ny01LjYxLDUuMjY3YTM1LjY4NywzNS42ODcsMCwwLDEtNS40ODctLjY2MmwuMjctMi4xOHMzLjMwNi40NDEsNS4wNDYuNDQxYzIuMDgyLDAsMy4wMzctLjkzMSwzLjAzNy0yLjcsMC0xLjQyMS0uNzU5LTEuOTEtMy4zMzEtMi41MjMtMy42MjYtLjkzLTUuMTkzLTIuMDMzLTUuMTkzLTQuOTQ4LDAtMy4zODEsMi4yMjktNC43NzYsNS41ODUtNC43NzZhMzcuMiwzNy4yLDAsMCwxLDUuMzE1LjU4N1oiLz4NCiAgICAgIDxwYXRoIGlkPSJQYXRoXzI5NDkiIGRhdGEtbmFtZT0iUGF0aCAyOTQ5IiBjbGFzcz0iY2xzLTIiIGQ9Ik0yNjIuOTY3LDk0LjE0SDI2Ny43bDMuNzQ4LDEzLjEwNkwyNzUuMiw5NC4xNGg0Ljc1MnYxNi43OEgyNzcuMlY5Ni40MmgtLjE0NWwtNC4xOTEsMTMuODE2aC0yLjg0MkwyNjUuODMxLDk2LjQyaC0uMTQ1djE0LjVoLTIuNzE5WiIvPg0KICAgICAgPHBhdGggaWQ9IlBhdGhfMjk1MCIgZGF0YS1uYW1lPSJQYXRoIDI5NTAiIGNsYXNzPSJjbHMtMiIgZD0iTTMyMi4wNTcsOTQuMTRIMzM0LjN2Mi40MjVoLTQuNzI4VjExMC45MmgtMi43NDNWOTYuNTY1aC00Ljc3N1oiLz4NCiAgICAgIDxwYXRoIGlkPSJQYXRoXzI5NTEiIGRhdGEtbmFtZT0iUGF0aCAyOTUxIiBjbGFzcz0iY2xzLTIiIGQ9Ik0zNDYuMTM3LDk0LjE0YzMuMzMyLDAsNS4xMiwxLjI0OSw1LjEyLDQuMzYxLDAsMi4wMzMtLjYzNywzLjAzNy0xLjk4NCwzLjc3MiwxLjQ0NS41NjMsMi40LDEuNTkyLDIuNCwzLjksMCwzLjQzLTIuMDgxLDQuNzUyLTUuMzM5LDQuNzUyaC02LjU2NlY5NC4xNFptLTMuNjUsMi4zNTJ2NC44aDMuNmMxLjY2NiwwLDIuNC0uODMyLDIuNC0yLjQ3NCwwLTEuNjE3LS44MzMtMi4zMjctMi41LTIuMzI3Wm0wLDcuMXY0Ljk3M2gzLjdjMS42ODksMCwyLjY5NC0uNTM5LDIuNjk0LTIuNTQ4LDAtMS45MTEtMS40MjEtMi40MjUtMi43NDQtMi40MjVaIi8+DQogICAgICA8cGF0aCBpZD0iUGF0aF8yOTUyIiBkYXRhLW5hbWU9IlBhdGggMjk1MiIgY2xhc3M9ImNscy0yIiBkPSJNMzU4LjQxNCw5NC4xNEgzNjl2Mi4zNzdoLTcuODY0djQuNzUxaDYuMzk0VjEwMy42aC02LjM5NHY0LjkyNEgzNjl2Mi40SDM1OC40MTRaIi8+DQogICAgICA8cGF0aCBpZD0iUGF0aF8yOTUzIiBkYXRhLW5hbWU9IlBhdGggMjk1MyIgY2xhc3M9ImNscy0yIiBkPSJNMzc4Ljc0Nyw5NC4xNGg1LjQxNGw0LjE2NCwxNi43OGgtMi43NDRMMzg0LjM0MiwxMDZoLTUuNzc3bC0xLjIzOSw0LjkyM2gtMi43MTlabS4zNjEsOS40NTZoNC43MDhsLTEuNzM3LTcuMTc4aC0xLjIyNVoiLz4NCiAgICAgIDxwYXRoIGlkPSJQYXRoXzI5NTQiIGRhdGEtbmFtZT0iUGF0aCAyOTU0IiBjbGFzcz0iY2xzLTIiIGQ9Ik0zOTcuMSwxMDUuOTQ3djQuOTczaC0yLjcxOVY5NC4xNGg2LjM3YzMuNywwLDUuNjgzLDIuMTIsNS42ODMsNS44NDMsMCwyLjM3Ni0uOTU2LDQuNTE5LTIuNzQ0LDUuMzUybDIuNzY5LDUuNTg1SDQwMy40N2wtMi40MjYtNC45NzNabTMuNjUxLTkuNDU1SDM5Ny4xdjcuMWgzLjdjMi4wNTcsMCwyLjg0MS0xLjg1LDIuODQxLTMuNTg5LDAtMS45LS45MzQtMy41MTEtMi44OTQtMy41MTFaIi8+DQogICAgICA8cGF0aCBpZD0iUGF0aF8yOTU1IiBkYXRhLW5hbWU9IlBhdGggMjk1NSIgY2xhc3M9ImNscy0yIiBkPSJNMjkwLjAxMyw5NC4xNGg1LjQxM2w0LjE2NCwxNi43OGgtMi43NDNMMjk1LjYwOCwxMDZoLTUuNzc3bC0xLjIzOSw0LjkyM2gtMi43MTlabS4zNjEsOS40NTZoNC43MDdsLTEuNzM3LTcuMTc4aC0xLjIyNVoiLz4NCiAgICAgIDxwYXRoIGlkPSJQYXRoXzI5NTYiIGRhdGEtbmFtZT0iUGF0aCAyOTU2IiBjbGFzcz0iY2xzLTIiIGQ9Ik0zMDguMzYyLDEwNS45NDd2NC45NzNoLTIuNzE5Vjk0LjE0aDYuMzY5YzMuNywwLDUuNjgzLDIuMTIsNS42ODMsNS44NDMsMCwyLjM3Ni0uOTU1LDQuNTE5LTIuNzQzLDUuMzUybDIuNzY4LDUuNTg1aC0yLjk4OWwtMi40MjUtNC45NzNabTMuNjUtOS40NTVoLTMuNjV2Ny4xaDMuN2MyLjA1OCwwLDIuODQxLTEuODUsMi44NDEtMy41ODlDMzE0LjksOTguMSwzMTMuOTcyLDk2LjQ5MiwzMTIuMDEyLDk2LjQ5MloiLz4NCiAgICAgIDxwYXRoIGlkPSJQYXRoXzI5NTciIGRhdGEtbmFtZT0iUGF0aCAyOTU3IiBjbGFzcz0iY2xzLTIiIGQ9Ik0xMzAuNjA2LDEwNy42NDNhMy4wMiwzLjAyLDAsMCwxLTEuMTgsMi41MzcsNS4xMTMsNS4xMTMsMCwwLDEtMy4yLjkxLDguMDMsOC4wMywwLDAsMS0zLjM3MS0uNTY0di0xLjM4M2E4Ljc5Myw4Ljc5MywwLDAsMCwxLjY1Mi41MDYsOC42NzIsOC42NzIsMCwwLDAsMS43Ny4xODYsMy41NjUsMy41NjUsMCwwLDAsMi4xNTctLjU0NCwxLjc4MywxLjc4MywwLDAsMCwuNzI1LTEuNTEyLDEuOTQ3LDEuOTQ3LDAsMCwwLS4yNTctMS4wNSwyLjM5MywyLjM5MywwLDAsMC0uODYtLjc1NCwxMi4xNzEsMTIuMTcxLDAsMCwwLTEuODMzLS43ODQsNS44NDIsNS44NDIsMCwwLDEtMi40NTYtMS40NTgsMy4yMTMsMy4yMTMsMCwwLDEtLjczOC0yLjIsMi43MzYsMi43MzYsMCwwLDEsMS4wNzEtMi4yNjcsNC40NDQsNC40NDQsMCwwLDEsMi44MzEtLjg0Myw4LjM0MSw4LjM0MSwwLDAsMSwzLjM4LjY3NWwtLjQ0NywxLjI0N2E3LjYzOSw3LjYzOSwwLDAsMC0yLjk2Ni0uNjQxLDIuODc4LDIuODc4LDAsMCwwLTEuNzc5LjQ4OSwxLjYxMiwxLjYxMiwwLDAsMC0uNjQsMS4zNTcsMi4wODEsMi4wODEsMCwwLDAsLjIzNiwxLjA0OSwyLjIzMSwyLjIzMSwwLDAsMCwuOC43NSw5Ljg3OCw5Ljg3OCwwLDAsMCwxLjcxNS43NTQsNi44LDYuOCwwLDAsMSwyLjY2NywxLjQ4MywyLjkxOSwyLjkxOSwwLDAsMSwuNzIzLDIuMDU3WiIvPg0KICAgICAgPHBhdGggaWQ9IlBhdGhfMjk1OCIgZGF0YS1uYW1lPSJQYXRoIDI5NTgiIGNsYXNzPSJjbHMtMiIgZD0iTTEzNC40NDcsMTAxLjY4NnY1Ljk5MWEyLjQxMSwyLjQxMSwwLDAsMCwuNTE1LDEuNjg2LDIuMDksMi4wOSwwLDAsMCwxLjYwOS41NTYsMi42MjksMi42MjksMCwwLDAsMi4xMi0uNzkyLDQsNCwwLDAsMCwuNjctMi41ODd2LTQuODU0aDEuNHY5LjIzNkgxMzkuNmwtLjItMS4yMzloLS4wNzVhMi43OTMsMi43OTMsMCwwLDEtMS4xOTMsMS4wNDUsNCw0LDAsMCwxLTEuNzQuMzYyLDMuNTI5LDMuNTI5LDAsMCwxLTIuNTI0LS44LDMuNDA5LDMuNDA5LDAsMCwxLS44MzktMi41NjJ2LTYuMDQyWiIvPg0KICAgICAgPHBhdGggaWQ9IlBhdGhfMjk1OSIgZGF0YS1uYW1lPSJQYXRoIDI5NTkiIGNsYXNzPSJjbHMtMiIgZD0iTTE0OC4yMDYsMTExLjA5YTMuOTkzLDMuOTkzLDAsMCwxLTEuNjQ3LS4zMzMsMy4xLDMuMSwwLDAsMS0xLjI1Mi0xLjAyM2gtLjFhMTIuMjY1LDEyLjI2NSwwLDAsMSwuMSwxLjUzM3YzLjhoLTEuNFYxMDEuNjg2aDEuMTM3bC4xOTQsMS4yNjRoLjA2N2EzLjI1NywzLjI1NywwLDAsMSwxLjI1Ni0xLjEsMy44MzEsMy44MzEsMCwwLDEsMS42NDMtLjMzNywzLjQxMywzLjQxMywwLDAsMSwyLjgzNiwxLjI1Niw2LjY4Myw2LjY4MywwLDAsMS0uMDE3LDcuMDU3LDMuNDIsMy40MiwwLDAsMS0yLjgxNywxLjI2NFptLS4yLTguMzg1YTIuNDgyLDIuNDgyLDAsMCwwLTIuMDQ4Ljc4NCw0LjA0MSw0LjA0MSwwLDAsMC0uNjQ5LDIuNDk0di4zMTJhNC42MjUsNC42MjUsMCwwLDAsLjY0OSwyLjc4NSwyLjQ2NywyLjQ2NywwLDAsMCwyLjA4Mi44MzksMi4xNjQsMi4xNjQsMCwwLDAsMS44NzUtLjk2OSw0LjYsNC42LDAsMCwwLC42NzgtMi42NzEsNC40MjgsNC40MjgsMCwwLDAtLjY3OC0yLjY1MSwyLjIzMiwyLjIzMiwwLDAsMC0xLjkxNS0uOTIzWiIvPg0KICAgICAgPHBhdGggaWQ9IlBhdGhfMjk2MCIgZGF0YS1uYW1lPSJQYXRoIDI5NjAiIGNsYXNzPSJjbHMtMiIgZD0iTTE1OS4wMzksMTExLjA5YTMuOTkzLDMuOTkzLDAsMCwxLTEuNjQ3LS4zMzMsMy4xLDMuMSwwLDAsMS0xLjI1Mi0xLjAyM2gtLjFhMTIuMjY1LDEyLjI2NSwwLDAsMSwuMSwxLjUzM3YzLjhoLTEuNFYxMDEuNjg2aDEuMTM3bC4xOTQsMS4yNjRoLjA2N2EzLjI1NywzLjI1NywwLDAsMSwxLjI1Ni0xLjEsMy44MzEsMy44MzEsMCwwLDEsMS42NDMtLjMzNywzLjQxMywzLjQxMywwLDAsMSwyLjgzNiwxLjI1Niw2LjY4Myw2LjY4MywwLDAsMS0uMDE3LDcuMDU3LDMuNDIsMy40MiwwLDAsMS0yLjgxNywxLjI2NFptLS4yLTguMzg1YTIuNDgyLDIuNDgyLDAsMCwwLTIuMDQ4Ljc4NCw0LjA0MSw0LjA0MSwwLDAsMC0uNjQ5LDIuNDk0di4zMTJhNC42MjUsNC42MjUsMCwwLDAsLjY0OSwyLjc4NSwyLjQ2NywyLjQ2NywwLDAsMCwyLjA4Mi44MzksMi4xNjQsMi4xNjQsMCwwLDAsMS44NzUtLjk2OSw0LjYsNC42LDAsMCwwLC42NzgtMi42NzEsNC40MjgsNC40MjgsMCwwLDAtLjY3OC0yLjY1MSwyLjIzMiwyLjIzMiwwLDAsMC0xLjkxMS0uOTIzWiIvPg0KICAgICAgPHBhdGggaWQ9IlBhdGhfMjk2MSIgZGF0YS1uYW1lPSJQYXRoIDI5NjEiIGNsYXNzPSJjbHMtMiIgZD0iTTE3My42MTIsMTA2LjNhNS4wOTMsNS4wOTMsMCwwLDEtMS4xMzcsMy41MjcsNC4wMDUsNC4wMDUsMCwwLDEtMy4xNDMsMS4yNjgsNC4xNzIsNC4xNzIsMCwwLDEtMi4yLS41ODEsMy44NCwzLjg0LDAsMCwxLTEuNDgzLTEuNjY5LDUuOCw1LjgsMCwwLDEtLjUyMi0yLjU0NSw1LjA4Nyw1LjA4NywwLDAsMSwxLjEyOS0zLjUxOCwzLjk5MSwzLjk5MSwwLDAsMSwzLjEzNS0xLjI2LDMuOTA3LDMuOTA3LDAsMCwxLDMuMDgsMS4yOSw1LjA3MSw1LjA3MSwwLDAsMSwxLjE0MSwzLjQ4OFptLTcuMDM2LDBhNC4zODQsNC4zODQsMCwwLDAsLjcwOCwyLjcsMi44MDksMi44MDksMCwwLDAsNC4xNjcsMCw0LjM2NSw0LjM2NSwwLDAsMCwuNzEyLTIuNyw0LjI5Myw0LjI5MywwLDAsMC0uNzEyLTIuNjc1LDIuNSwyLjUsMCwwLDAtMi4xLS45MTUsMi40NjEsMi40NjEsMCwwLDAtMi4wNzIuOSw0LjMzNCw0LjMzNCwwLDAsMC0uNywyLjY5WiIvPg0KICAgICAgPHBhdGggaWQ9IlBhdGhfMjk2MiIgZGF0YS1uYW1lPSJQYXRoIDI5NjIiIGNsYXNzPSJjbHMtMiIgZD0iTTE4MC41MjUsMTAxLjUxN2E1LjUwNiw1LjUwNiwwLDAsMSwxLjEuMWwtLjE5NCwxLjNhNC43ODYsNC43ODYsMCwwLDAtMS4wMTEtLjEyNywyLjQ2LDIuNDYsMCwwLDAtMS45MTcuOTExLDMuMzE4LDMuMzE4LDAsMCwwLS44LDIuMjY3djQuOTU1aC0xLjR2LTkuMjM2aDEuMTU0bC4xNiwxLjcxaC4wNjhhNC4wNTQsNC4wNTQsMCwwLDEsMS4yMzgtMS4zOSwyLjc4NywyLjc4NywwLDAsMSwxLjYtLjQ5WiIvPg0KICAgICAgPHBhdGggaWQ9IlBhdGhfMjk2MyIgZGF0YS1uYW1lPSJQYXRoIDI5NjMiIGNsYXNzPSJjbHMtMiIgZD0iTTE4Ny4zNjMsMTA5LjkzNmE0LjUwNiw0LjUwNiwwLDAsMCwuNzE2LS4wNTUsNC4zODcsNC4zODcsMCwwLDAsLjU0OC0uMTE0djEuMDdhMi41LDIuNSwwLDAsMS0uNjcuMTgxLDUsNSwwLDAsMS0uOC4wNzJxLTIuNjgsMC0yLjY4LTIuODIzdi01LjQ5NGgtMS4zMjNWMTAyLjFsMS4zMjMtLjU4Mi41OS0xLjk3MmguODA5djIuMTQxaDIuNjh2MS4wODdoLTIuNjh2NS40MzVhMS44NjksMS44NjksMCwwLDAsLjQsMS4yODFBMS4zNzcsMS4zNzcsMCwwLDAsMTg3LjM2MywxMDkuOTM2WiIvPg0KICAgICAgPHBhdGggaWQ9IlBhdGhfMjk2NCIgZGF0YS1uYW1lPSJQYXRoIDI5NjQiIGNsYXNzPSJjbHMtMiIgZD0iTTE5NC41MzgsMTExLjA5YTQuMjM5LDQuMjM5LDAsMCwxLTMuMjMxLTEuMjQ3LDQuODI0LDQuODI0LDAsMCwxLTEuMTg0LTMuNDYzLDUuMzU1LDUuMzU1LDAsMCwxLDEuMS0zLjU0OCwzLjY1MiwzLjY1MiwwLDAsMSwyLjk1NC0xLjMxNSwzLjQ4NCwzLjQ4NCwwLDAsMSwyLjc0NywxLjE0Miw0LjM3OCw0LjM3OCwwLDAsMSwxLjAxMSwzLjAxM3YuODg1aC02LjM2MmEzLjY2LDMuNjYsMCwwLDAsLjgyMiwyLjQ2OSwyLjg0MywyLjg0MywwLDAsMCwyLjIuODQzLDcuNDMxLDcuNDMxLDAsMCwwLDIuOTQ5LS42MjR2MS4yNDdhNy4zNzcsNy4zNzcsMCwwLDEtMS40LjQ1OSw3Ljg2Myw3Ljg2MywwLDAsMS0xLjYuMTM5Wm0tLjM3OS04LjRhMi4yODYsMi4yODYsMCwwLDAtMS43NzQuNzI1LDMuMzM3LDMuMzM3LDAsMCwwLS43NzksMi4wMDZoNC44MjhhMy4wNzIsMy4wNzIsMCwwLDAtLjU5LTIuMDI3LDIuMDc2LDIuMDc2LDAsMCwwLTEuNjg1LS43MDZaIi8+DQogICAgICA8cGF0aCBpZD0iUGF0aF8yOTY1IiBkYXRhLW5hbWU9IlBhdGggMjk2NSIgY2xhc3M9ImNscy0yIiBkPSJNMjA2Ljk1MSwxMDkuNjgzaC0uMDc2YTMuMjg3LDMuMjg3LDAsMCwxLTIuOSwxLjQwNywzLjQyNywzLjQyNywwLDAsMS0yLjgxOS0xLjIzOSw1LjQ1Miw1LjQ1MiwwLDAsMS0xLjAwNi0zLjUyMiw1LjU0Miw1LjU0MiwwLDAsMSwxLjAxMS0zLjU0OCwzLjQsMy40LDAsMCwxLDIuODE0LTEuMjY0LDMuMzYxLDMuMzYxLDAsMCwxLDIuODgzLDEuMzY1aC4xMDlsLS4wNTktLjY2NS0uMDM0LS42NDlWOTcuODA5aDEuNHYxMy4xMTNoLTEuMTM4Wm0tMi44LjIzNmEyLjU1MSwyLjU1MSwwLDAsMCwyLjA3OC0uNzc5LDMuOTQ3LDMuOTQ3LDAsMCwwLC42NDQtMi41MTZ2LS4zYTQuNjM4LDQuNjM4LDAsMCwwLS42NTMtMi44LDIuNDgxLDIuNDgxLDAsMCwwLTIuMDg2LS44MzksMi4xNCwyLjE0LDAsMCwwLTEuODgzLjk1Nyw0Ljc2LDQuNzYsMCwwLDAtLjY1MywyLjcsNC41NTQsNC41NTQsMCwwLDAsLjY0OSwyLjY3MSwyLjE5NCwyLjE5NCwwLDAsMCwxLjkwNi45MDZaIi8+DQogICAgICA8cGF0aCBpZD0iUGF0aF8yOTY2IiBkYXRhLW5hbWU9IlBhdGggMjk2NiIgY2xhc3M9ImNscy0yIiBkPSJNMjIwLjcxMiwxMDEuNTM0YTMuNDM1LDMuNDM1LDAsMCwxLDIuODI3LDEuMjQzLDYuNjUzLDYuNjUzLDAsMCwxLS4wMDksNy4wNTMsMy40MTcsMy40MTcsMCwwLDEtMi44MTgsMS4yNiw0LDQsMCwwLDEtMS42NDgtLjMzMywzLjA5NCwzLjA5NCwwLDAsMS0xLjI1MS0xLjAyM2gtLjFsLS4yOTUsMS4xODhoLTFWOTcuODA5aDEuNFYxMDFxMCwxLjA2OS0uMDY4LDEuOTIxaC4wNjhhMy4zMjIsMy4zMjIsMCwwLDEsMi44OTQtMS4zODdabS0uMiwxLjE3MWEyLjQ0LDIuNDQsMCwwLDAtMi4wNjQuODIyLDYuMzM4LDYuMzM4LDAsMCwwLC4wMTcsNS41NTMsMi40NjQsMi40NjQsMCwwLDAsMi4wODEuODM5LDIuMTU4LDIuMTU4LDAsMCwwLDEuOTIyLS45NCw0LjgyOCw0LjgyOCwwLDAsMCwuNjMyLTIuNyw0LjY0NSw0LjY0NSwwLDAsMC0uNjMyLTIuNjg5LDIuMjQyLDIuMjQyLDAsMCwwLTEuOTU5LS44ODVaIi8+DQogICAgICA8cGF0aCBpZD0iUGF0aF8yOTY3IiBkYXRhLW5hbWU9IlBhdGggMjk2NyIgY2xhc3M9ImNscy0yIiBkPSJNMjI1Ljc1OCwxMDEuNjg2aDEuNWwyLjAyMyw1LjI2N2EyMC4xODgsMjAuMTg4LDAsMCwxLC44MjYsMi42aC4wNjdxLjEwOS0uNDMxLjQ1OS0xLjQ3MXQyLjI4OC02LjRoMS41TDIzMC40NTIsMTEyLjJhNS4yNTMsNS4yNTMsMCwwLDEtMS4zNzgsMi4yMTIsMi45MzIsMi45MzIsMCwwLDEtMS45MzQuNjUzLDUuNjU5LDUuNjU5LDAsMCwxLTEuMjY0LS4xNDNWMTEzLjhhNC45LDQuOSwwLDAsMCwxLjAzNy4xLDIuMTM2LDIuMTM2LDAsMCwwLDIuMDU2LTEuNjE4bC41MTQtMS4zMTRaIi8+DQogICAgPC9nPg0KICA8L2c+DQo8L3N2Zz4NCg=="},5163:t=>{"use strict";t.exports='---\nurl: "https://petstore.swagger.io/v2/swagger.json"\ndom_id: "#swagger-ui"\nvalidatorUrl: "https://validator.swagger.io/validator"\n'},2361:()=>{},4616:()=>{},5110:(t,e,r)=>{t.exports=r(7698)},8309:(t,e,r)=>{t.exports=r(3363)},1189:(t,e,r)=>{r(8196)},9022:(t,e,r)=>{t.exports=r(8065)},4386:(t,e,r)=>{r(7448)},2250:(t,e,r)=>{t.exports=r(9455)},2320:(t,e,r)=>{t.exports=r(9743)},4418:(t,e,r)=>{r(1955)},2373:(t,e,r)=>{t.exports=r(6064)},1679:(t,e,r)=>{t.exports=r(1577)},86:(t,e,r)=>{t.exports=r(6279)},8118:(t,e,r)=>{t.exports=r(3778)},1882:(t,e,r)=>{t.exports=r(9373)},8712:(t,e,r)=>{t.exports=r(3819)},7606:(t,e,r)=>{t.exports=r(1798)},4282:(t,e,r)=>{r(2527)},4278:(t,e,r)=>{t.exports=r(2073)},2039:(t,e,r)=>{t.exports=r(5286)},2578:(t,e,r)=>{r(2856)},7043:(t,e,r)=>{r(5178)},1607:(t,e,r)=>{r(6361)},5627:(t,e,r)=>{t.exports=r(8933)},8492:(t,e,r)=>{t.exports=r(5868)},6986:(t,e,r)=>{t.exports=r(3383)},8222:(t,e,r)=>{t.exports=r(3059)},8216:(t,e,r)=>{t.exports=r(4122)},7552:(t,e,r)=>{t.exports=r(269)},7445:(t,e,r)=>{t.exports=r(3685)},1125:(t,e,r)=>{var n=r(7445);t.exports=function(t,e,r){return e in t?n(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t},t.exports.__esModule=!0,t.exports.default=t.exports},3101:(t,e,r)=>{var n=r(7552),i=r(8216);function o(){var e;return t.exports=o=n?i(e=n).call(e):function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},t.exports.__esModule=!0,t.exports.default=t.exports,o.apply(this,arguments)}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={id:n,loaded:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var n={};return(()=>{"use strict";r.d(n,{default:()=>qr});var t={};r.r(t),r.d(t,{TOGGLE_CONFIGS:()=>xr,UPDATE_CONFIGS:()=>jr,loaded:()=>Dr,toggle:()=>Sr,update:()=>Nr});var e={};r.r(e),r.d(e,{downloadConfig:()=>Ir,getConfigByUrl:()=>Er});var i={};r.r(i),r.d(i,{get:()=>Ar});var o=r(7294);class s extends o.Component{render(){const{getComponent:t}=this.props,e=t("Container"),r=t("Row"),n=t("Col"),i=t("Topbar",!0),s=t("BaseLayout",!0),u=t("onlineValidatorBadge",!0);return o.createElement(e,{className:"swagger-ui"},i?o.createElement(i,null):null,o.createElement(s,null),o.createElement(r,null,o.createElement(n,null,o.createElement(u,null))))}}var u=r(1125),a=r.n(u),c=r(86),f=r.n(c),l=r(7606),h=r.n(l),p=r(8309),d=r.n(p),y=(r(4386),r(4418),r(8222)),g=r.n(y),v=(r(1189),r(4282),r(6986)),w=r.n(v),M=(r(2578),r(4278)),L=r.n(M),_=r(9022),m=r.n(_),b=r(2039),j=r.n(b),x=r(8118),N=r.n(x),S=r(5627),D=r.n(S),I=r(1882),E=r.n(I),A=r(1679),C=r.n(A),T=(r(7043),r(1607),r(3393)),O=r.n(T),z=(r(7967),r(1540),r(1700),r(8306)),k=r.n(z),U=(r(3311),r(9704),r(7813),r(3560),r(3479)),R=r.n(U),Y=r(4419),B=r.n(Y),P=r(1609),Q=r.n(P),F=r(2250),G=r.n(F),W=r(5110),q=r.n(W),H=r(8712),J=r.n(H),Z=r(2373),$=r.n(Z),V=r(8492),X=r.n(V);const K=t=>e=>d()(t)&&d()(e)&&t.length===e.length&&G()(t).call(t,((t,r)=>t===e[r])),tt=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return e};class et extends(X()){delete(t){const e=q()(J()(this).call(this)),r=C()(e).call(e,K(t));return super.delete(r)}get(t){const e=q()(J()(this).call(this)),r=C()(e).call(e,K(t));return super.get(r)}has(t){const e=q()(J()(this).call(this));return-1!==$()(e).call(e,K(t))}}const rt=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tt;const{Cache:r}=k();k().Cache=et;const n=k()(t,e);return k().Cache=r,n},nt={string:t=>t.pattern?(t=>{try{return new(B())(t).gen()}catch(t){return"string"}})(t.pattern):"string",string_email:()=>"user@example.com","string_date-time":()=>(new Date).toISOString(),string_date:()=>(new Date).toISOString().substring(0,10),string_uuid:()=>"3fa85f64-5717-4562-b3fc-2c963f66afa6",string_hostname:()=>"example.com",string_ipv4:()=>"198.51.100.42",string_ipv6:()=>"2001:0db8:5b96:0000:0000:426f:8e17:642a",number:()=>0,number_float:()=>0,integer:()=>0,boolean:t=>"boolean"!=typeof t.default||t.default},it=t=>{t=pr(t);let{type:e,format:r}=t,n=nt[`${e}_${r}`]||nt[e];return gr(n)?n(t):"Unknown Type: "+t.type},ot=t=>wr(t,"$$ref",(t=>"string"==typeof t&&E()(t).call(t,"#")>-1)),st=["maxProperties","minProperties"],ut=["minItems","maxItems"],at=["minimum","maximum","exclusiveMinimum","exclusiveMaximum"],ct=["minLength","maxLength"],ft=function(t,e){var r;let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=r=>{void 0===e[r]&&void 0!==t[r]&&(e[r]=t[r])};var o;(f()(r=["example","default","enum","xml","type",...st,...ut,...at,...ct]).call(r,(t=>i(t))),void 0!==t.required&&d()(t.required))&&(void 0!==e.required&&e.required.length||(e.required=[]),f()(o=t.required).call(o,(t=>{var r;N()(r=e.required).call(r,t)||e.required.push(t)})));if(t.properties){e.properties||(e.properties={});let r=pr(t.properties);for(let i in r){var s;if(Object.prototype.hasOwnProperty.call(r,i))if(!r[i]||!r[i].deprecated)if(!r[i]||!r[i].readOnly||n.includeReadOnly)if(!r[i]||!r[i].writeOnly||n.includeWriteOnly)if(!e.properties[i])e.properties[i]=r[i],!t.required&&d()(t.required)&&-1!==E()(s=t.required).call(s,i)&&(e.required?e.required.push(i):e.required=[i])}}return t.items&&(e.items||(e.items={}),e.items=ft(t.items,e.items,n)),e},lt=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];t&&gr(t.toJS)&&(t=t.toJS());let i=void 0!==r||t&&void 0!==t.example||t&&void 0!==t.default;const o=!i&&t&&t.oneOf&&t.oneOf.length>0,s=!i&&t&&t.anyOf&&t.anyOf.length>0;if(!i&&(o||s)){const r=pr(o?t.oneOf[0]:t.anyOf[0]);if(ft(r,t,e),!t.xml&&r.xml&&(t.xml=r.xml),void 0!==t.example&&void 0!==r.example)i=!0;else if(r.properties){t.properties||(t.properties={});let n=pr(r.properties);for(let i in n){var u;if(Object.prototype.hasOwnProperty.call(n,i))if(!n[i]||!n[i].deprecated)if(!n[i]||!n[i].readOnly||e.includeReadOnly)if(!n[i]||!n[i].writeOnly||e.includeWriteOnly)if(!t.properties[i])t.properties[i]=n[i],!r.required&&d()(r.required)&&-1!==E()(u=r.required).call(u,i)&&(t.required?t.required.push(i):t.required=[i])}}}const a={};let{xml:c,type:l,example:p,properties:y,additionalProperties:g,items:v}=t||{},{includeReadOnly:w,includeWriteOnly:M}=e;c=c||{};let _,{name:b,prefix:x,namespace:S}=c,D={};if(n&&(b=b||"notagname",_=(x?x+":":"")+b,S)){a[x?"xmlns:"+x:"xmlns"]=S}n&&(D[_]=[]);const I=e=>j()(e).call(e,(e=>Object.prototype.hasOwnProperty.call(t,e)));t&&!l&&(y||g||I(st)?l="object":v||I(ut)?l="array":I(at)?(l="number",t.type="number"):i||t.enum||(l="string",t.type="string"));const A=e=>{var r,n,i,o,s;null!==(null===(r=t)||void 0===r?void 0:r.maxItems)&&void 0!==(null===(n=t)||void 0===n?void 0:n.maxItems)&&(e=L()(e).call(e,0,null===(s=t)||void 0===s?void 0:s.maxItems));if(null!==(null===(i=t)||void 0===i?void 0:i.minItems)&&void 0!==(null===(o=t)||void 0===o?void 0:o.minItems)){let r=0;for(;e.length<(null===(u=t)||void 0===u?void 0:u.minItems);){var u;e.push(e[r++%e.length])}}return e},T=pr(y);let O,z=0;const k=()=>t&&null!==t.maxProperties&&void 0!==t.maxProperties&&z>=t.maxProperties,U=()=>{if(!t||!t.required)return 0;let e=0;var r,i;n?f()(r=t.required).call(r,(t=>e+=void 0===D[t]?0:1)):f()(i=t.required).call(i,(t=>{var r;return e+=void 0===(null===(r=D[_])||void 0===r?void 0:C()(r).call(r,(e=>void 0!==e[t])))?0:1}));return t.required.length-e},R=e=>{var r;return!(t&&t.required&&t.required.length)||!N()(r=t.required).call(r,e)},Y=e=>!t||null===t.maxProperties||void 0===t.maxProperties||!k()&&(!R(e)||t.maxProperties-z-U()>0);if(O=n?function(r){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;if(t&&T[r]){if(T[r].xml=T[r].xml||{},T[r].xml.attribute){const t=d()(T[r].enum)?T[r].enum[0]:void 0,e=T[r].example,n=T[r].default;return void(a[T[r].xml.name||r]=void 0!==e?e:void 0!==n?n:void 0!==t?t:it(T[r]))}T[r].xml.name=T[r].xml.name||r}else T[r]||!1===g||(T[r]={xml:{name:r}});let o=lt(t&&T[r]||void 0,e,i,n);var s;Y(r)&&(z++,d()(o)?D[_]=m()(s=D[_]).call(s,o):D[_].push(o))}:(t,r)=>{Y(t)&&(D[t]=lt(T[t],e,r,n),z++)},i){let i;if(i=ot(void 0!==r?r:void 0!==p?p:t.default),!n){if("number"==typeof i&&"string"===l)return`${i}`;if("string"!=typeof i||"string"===l)return i;try{return JSON.parse(i)}catch(t){return i}}if(t||(l=d()(i)?"array":typeof i),"array"===l){if(!d()(i)){if("string"==typeof i)return i;i=[i]}const r=t?t.items:void 0;r&&(r.xml=r.xml||c||{},r.xml.name=r.xml.name||c.name);let o=h()(i).call(i,(t=>lt(r,e,t,n)));return o=A(o),c.wrapped?(D[_]=o,Q()(a)||D[_].push({_attr:a})):D=o,D}if("object"===l){if("string"==typeof i)return i;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(t&&T[e]&&T[e].readOnly&&!w||t&&T[e]&&T[e].writeOnly&&!M||(t&&T[e]&&T[e].xml&&T[e].xml.attribute?a[T[e].xml.name||e]=i[e]:O(e,i[e])));return Q()(a)||D[_].push({_attr:a}),D}return D[_]=Q()(a)?i:[{_attr:a},i],D}if("object"===l){for(let t in T)Object.prototype.hasOwnProperty.call(T,t)&&(T[t]&&T[t].deprecated||T[t]&&T[t].readOnly&&!w||T[t]&&T[t].writeOnly&&!M||O(t));if(n&&a&&D[_].push({_attr:a}),k())return D;if(!0===g)n?D[_].push({additionalProp:"Anything can be here"}):D.additionalProp1={},z++;else if(g){const r=pr(g),i=lt(r,e,void 0,n);if(n&&r.xml&&r.xml.name&&"notagname"!==r.xml.name)D[_].push(i);else{const e=null!==t.minProperties&&void 0!==t.minProperties&&z<t.minProperties?t.minProperties-z:3;for(let t=1;t<=e;t++){if(k())return D;if(n){const e={};e["additionalProp"+t]=i.notagname,D[_].push(e)}else D["additionalProp"+t]=i;z++}}}return D}if("array"===l){if(!v)return;let r;var B,P;if(n)v.xml=v.xml||(null===(B=t)||void 0===B?void 0:B.xml)||{},v.xml.name=v.xml.name||c.name;if(d()(v.anyOf))r=h()(P=v.anyOf).call(P,(t=>lt(ft(v,t,e),e,void 0,n)));else if(d()(v.oneOf)){var F;r=h()(F=v.oneOf).call(F,(t=>lt(ft(v,t,e),e,void 0,n)))}else{if(!(!n||n&&c.wrapped))return lt(v,e,void 0,n);r=[lt(v,e,void 0,n)]}return r=A(r),n&&c.wrapped?(D[_]=r,Q()(a)||D[_].push({_attr:a}),D):r}let G;if(t&&d()(t.enum))G=dr(t.enum)[0];else{if(!t)return;if(G=it(t),"number"==typeof G){let e=t.minimum;null!=e&&(t.exclusiveMinimum&&e++,G=e);let r=t.maximum;null!=r&&(t.exclusiveMaximum&&r--,G=r)}if("string"==typeof G&&(null!==t.maxLength&&void 0!==t.maxLength&&(G=L()(G).call(G,0,t.maxLength)),null!==t.minLength&&void 0!==t.minLength)){let e=0;for(;G.length<t.minLength;)G+=G[e++%G.length]}}if("file"!==l)return n?(D[_]=Q()(a)?G:[{_attr:a},G],D):G},ht=(t,e,r)=>[t,D()(e),D()(r)];rt(((t,e,r)=>{const n=lt(t,e,r,!0);if(n)return"string"==typeof n?n:R()(n,{declaration:!0,indent:"\t"})}),ht),rt(((t,e,r)=>lt(t,e,r,!1)),ht);const pt=function(){var t={location:{},history:{},open:()=>{},close:()=>{},File:function(){}};if("undefined"==typeof window)return t;try{t=window;for(var e of["File","Blob","FormData"])e in window&&(t[e]=window[e])}catch(t){console.error(t)}return t}();r(8269);O().Set.of("type","format","items","default","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","maxItems","minItems","uniqueItems","enum","multipleOf");r(2282),r(9072);function dt(t){return null==t}var yt={isNothing:dt,isObject:function(t){return"object"==typeof t&&null!==t},toArray:function(t){return Array.isArray(t)?t:dt(t)?[]:[t]},repeat:function(t,e){var r,n="";for(r=0;r<e;r+=1)n+=t;return n},isNegativeZero:function(t){return 0===t&&Number.NEGATIVE_INFINITY===1/t},extend:function(t,e){var r,n,i,o;if(e)for(r=0,n=(o=Object.keys(e)).length;r<n;r+=1)t[i=o[r]]=e[i];return t}};function gt(t,e){var r="",n=t.reason||"(unknown reason)";return t.mark?(t.mark.name&&(r+='in "'+t.mark.name+'" '),r+="("+(t.mark.line+1)+":"+(t.mark.column+1)+")",!e&&t.mark.snippet&&(r+="\n\n"+t.mark.snippet),n+" "+r):n}function vt(t,e){Error.call(this),this.name="YAMLException",this.reason=t,this.mark=e,this.message=gt(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||""}vt.prototype=Object.create(Error.prototype),vt.prototype.constructor=vt,vt.prototype.toString=function(t){return this.name+": "+gt(this,t)};var wt=vt;function Mt(t,e,r,n,i){var o="",s="",u=Math.floor(i/2)-1;return n-e>u&&(e=n-u+(o=" ... ").length),r-n>u&&(r=n+u-(s=" ...").length),{str:o+t.slice(e,r).replace(/\t/g,"→")+s,pos:n-e+o.length}}function Lt(t,e){return yt.repeat(" ",e-t.length)+t}var _t=function(t,e){if(e=Object.create(e||null),!t.buffer)return null;e.maxLength||(e.maxLength=79),"number"!=typeof e.indent&&(e.indent=1),"number"!=typeof e.linesBefore&&(e.linesBefore=3),"number"!=typeof e.linesAfter&&(e.linesAfter=2);for(var r,n=/\r?\n|\r|\0/g,i=[0],o=[],s=-1;r=n.exec(t.buffer);)o.push(r.index),i.push(r.index+r[0].length),t.position<=r.index&&s<0&&(s=i.length-2);s<0&&(s=i.length-1);var u,a,c="",f=Math.min(t.line+e.linesAfter,o.length).toString().length,l=e.maxLength-(e.indent+f+3);for(u=1;u<=e.linesBefore&&!(s-u<0);u++)a=Mt(t.buffer,i[s-u],o[s-u],t.position-(i[s]-i[s-u]),l),c=yt.repeat(" ",e.indent)+Lt((t.line-u+1).toString(),f)+" | "+a.str+"\n"+c;for(a=Mt(t.buffer,i[s],o[s],t.position,l),c+=yt.repeat(" ",e.indent)+Lt((t.line+1).toString(),f)+" | "+a.str+"\n",c+=yt.repeat("-",e.indent+f+3+a.pos)+"^\n",u=1;u<=e.linesAfter&&!(s+u>=o.length);u++)a=Mt(t.buffer,i[s+u],o[s+u],t.position-(i[s]-i[s+u]),l),c+=yt.repeat(" ",e.indent)+Lt((t.line+u+1).toString(),f)+" | "+a.str+"\n";return c.replace(/\n$/,"")},mt=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],bt=["scalar","sequence","mapping"];var jt=function(t,e){if(e=e||{},Object.keys(e).forEach((function(e){if(-1===mt.indexOf(e))throw new wt('Unknown option "'+e+'" is met in definition of "'+t+'" YAML type.')})),this.options=e,this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(t){return t},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.representName=e.representName||null,this.defaultStyle=e.defaultStyle||null,this.multi=e.multi||!1,this.styleAliases=function(t){var e={};return null!==t&&Object.keys(t).forEach((function(r){t[r].forEach((function(t){e[String(t)]=r}))})),e}(e.styleAliases||null),-1===bt.indexOf(this.kind))throw new wt('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')};function xt(t,e){var r=[];return t[e].forEach((function(t){var e=r.length;r.forEach((function(r,n){r.tag===t.tag&&r.kind===t.kind&&r.multi===t.multi&&(e=n)})),r[e]=t})),r}function Nt(t){return this.extend(t)}Nt.prototype.extend=function(t){var e=[],r=[];if(t instanceof jt)r.push(t);else if(Array.isArray(t))r=r.concat(t);else{if(!t||!Array.isArray(t.implicit)&&!Array.isArray(t.explicit))throw new wt("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");t.implicit&&(e=e.concat(t.implicit)),t.explicit&&(r=r.concat(t.explicit))}e.forEach((function(t){if(!(t instanceof jt))throw new wt("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(t.loadKind&&"scalar"!==t.loadKind)throw new wt("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(t.multi)throw new wt("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")})),r.forEach((function(t){if(!(t instanceof jt))throw new wt("Specified list of YAML types (or a single Type object) contains a non-Type object.")}));var n=Object.create(Nt.prototype);return n.implicit=(this.implicit||[]).concat(e),n.explicit=(this.explicit||[]).concat(r),n.compiledImplicit=xt(n,"implicit"),n.compiledExplicit=xt(n,"explicit"),n.compiledTypeMap=function(){var t,e,r={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function n(t){t.multi?(r.multi[t.kind].push(t),r.multi.fallback.push(t)):r[t.kind][t.tag]=r.fallback[t.tag]=t}for(t=0,e=arguments.length;t<e;t+=1)arguments[t].forEach(n);return r}(n.compiledImplicit,n.compiledExplicit),n};var St=Nt,Dt=new jt("tag:yaml.org,2002:str",{kind:"scalar",construct:function(t){return null!==t?t:""}}),It=new jt("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(t){return null!==t?t:[]}}),Et=new jt("tag:yaml.org,2002:map",{kind:"mapping",construct:function(t){return null!==t?t:{}}}),At=new St({explicit:[Dt,It,Et]});var Ct=new jt("tag:yaml.org,2002:null",{kind:"scalar",resolve:function(t){if(null===t)return!0;var e=t.length;return 1===e&&"~"===t||4===e&&("null"===t||"Null"===t||"NULL"===t)},construct:function(){return null},predicate:function(t){return null===t},represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});var Tt=new jt("tag:yaml.org,2002:bool",{kind:"scalar",resolve:function(t){if(null===t)return!1;var e=t.length;return 4===e&&("true"===t||"True"===t||"TRUE"===t)||5===e&&("false"===t||"False"===t||"FALSE"===t)},construct:function(t){return"true"===t||"True"===t||"TRUE"===t},predicate:function(t){return"[object Boolean]"===Object.prototype.toString.call(t)},represent:{lowercase:function(t){return t?"true":"false"},uppercase:function(t){return t?"TRUE":"FALSE"},camelcase:function(t){return t?"True":"False"}},defaultStyle:"lowercase"});function Ot(t){return 48<=t&&t<=55}function zt(t){return 48<=t&&t<=57}var kt=new jt("tag:yaml.org,2002:int",{kind:"scalar",resolve:function(t){if(null===t)return!1;var e,r,n=t.length,i=0,o=!1;if(!n)return!1;if("-"!==(e=t[i])&&"+"!==e||(e=t[++i]),"0"===e){if(i+1===n)return!0;if("b"===(e=t[++i])){for(i++;i<n;i++)if("_"!==(e=t[i])){if("0"!==e&&"1"!==e)return!1;o=!0}return o&&"_"!==e}if("x"===e){for(i++;i<n;i++)if("_"!==(e=t[i])){if(!(48<=(r=t.charCodeAt(i))&&r<=57||65<=r&&r<=70||97<=r&&r<=102))return!1;o=!0}return o&&"_"!==e}if("o"===e){for(i++;i<n;i++)if("_"!==(e=t[i])){if(!Ot(t.charCodeAt(i)))return!1;o=!0}return o&&"_"!==e}}if("_"===e)return!1;for(;i<n;i++)if("_"!==(e=t[i])){if(!zt(t.charCodeAt(i)))return!1;o=!0}return!(!o||"_"===e)},construct:function(t){var e,r=t,n=1;if(-1!==r.indexOf("_")&&(r=r.replace(/_/g,"")),"-"!==(e=r[0])&&"+"!==e||("-"===e&&(n=-1),e=(r=r.slice(1))[0]),"0"===r)return 0;if("0"===e){if("b"===r[1])return n*parseInt(r.slice(2),2);if("x"===r[1])return n*parseInt(r.slice(2),16);if("o"===r[1])return n*parseInt(r.slice(2),8)}return n*parseInt(r,10)},predicate:function(t){return"[object Number]"===Object.prototype.toString.call(t)&&t%1==0&&!yt.isNegativeZero(t)},represent:{binary:function(t){return t>=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},octal:function(t){return t>=0?"0o"+t.toString(8):"-0o"+t.toString(8).slice(1)},decimal:function(t){return t.toString(10)},hexadecimal:function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),Ut=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");var Rt=/^[-+]?[0-9]+e/;var Yt=new jt("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(t){return null!==t&&!(!Ut.test(t)||"_"===t[t.length-1])},construct:function(t){var e,r;return r="-"===(e=t.replace(/_/g,"").toLowerCase())[0]?-1:1,"+-".indexOf(e[0])>=0&&(e=e.slice(1)),".inf"===e?1===r?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===e?NaN:r*parseFloat(e,10)},predicate:function(t){return"[object Number]"===Object.prototype.toString.call(t)&&(t%1!=0||yt.isNegativeZero(t))},represent:function(t,e){var r;if(isNaN(t))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(yt.isNegativeZero(t))return"-0.0";return r=t.toString(10),Rt.test(r)?r.replace("e",".e"):r},defaultStyle:"lowercase"}),Bt=At.extend({implicit:[Ct,Tt,kt,Yt]}),Pt=Bt,Qt=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Ft=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");var Gt=new jt("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(t){return null!==t&&(null!==Qt.exec(t)||null!==Ft.exec(t))},construct:function(t){var e,r,n,i,o,s,u,a,c=0,f=null;if(null===(e=Qt.exec(t))&&(e=Ft.exec(t)),null===e)throw new Error("Date resolve error");if(r=+e[1],n=+e[2]-1,i=+e[3],!e[4])return new Date(Date.UTC(r,n,i));if(o=+e[4],s=+e[5],u=+e[6],e[7]){for(c=e[7].slice(0,3);c.length<3;)c+="0";c=+c}return e[9]&&(f=6e4*(60*+e[10]+ +(e[11]||0)),"-"===e[9]&&(f=-f)),a=new Date(Date.UTC(r,n,i,o,s,u,c)),f&&a.setTime(a.getTime()-f),a},instanceOf:Date,represent:function(t){return t.toISOString()}});var Wt=new jt("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(t){return"<<"===t||null===t}}),qt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";var Ht=new jt("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(t){if(null===t)return!1;var e,r,n=0,i=t.length,o=qt;for(r=0;r<i;r++)if(!((e=o.indexOf(t.charAt(r)))>64)){if(e<0)return!1;n+=6}return n%8==0},construct:function(t){var e,r,n=t.replace(/[\r\n=]/g,""),i=n.length,o=qt,s=0,u=[];for(e=0;e<i;e++)e%4==0&&e&&(u.push(s>>16&255),u.push(s>>8&255),u.push(255&s)),s=s<<6|o.indexOf(n.charAt(e));return 0===(r=i%4*6)?(u.push(s>>16&255),u.push(s>>8&255),u.push(255&s)):18===r?(u.push(s>>10&255),u.push(s>>2&255)):12===r&&u.push(s>>4&255),new Uint8Array(u)},predicate:function(t){return"[object Uint8Array]"===Object.prototype.toString.call(t)},represent:function(t){var e,r,n="",i=0,o=t.length,s=qt;for(e=0;e<o;e++)e%3==0&&e&&(n+=s[i>>18&63],n+=s[i>>12&63],n+=s[i>>6&63],n+=s[63&i]),i=(i<<8)+t[e];return 0===(r=o%3)?(n+=s[i>>18&63],n+=s[i>>12&63],n+=s[i>>6&63],n+=s[63&i]):2===r?(n+=s[i>>10&63],n+=s[i>>4&63],n+=s[i<<2&63],n+=s[64]):1===r&&(n+=s[i>>2&63],n+=s[i<<4&63],n+=s[64],n+=s[64]),n}}),Jt=Object.prototype.hasOwnProperty,Zt=Object.prototype.toString;var $t=new jt("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function(t){if(null===t)return!0;var e,r,n,i,o,s=[],u=t;for(e=0,r=u.length;e<r;e+=1){if(n=u[e],o=!1,"[object Object]"!==Zt.call(n))return!1;for(i in n)if(Jt.call(n,i)){if(o)return!1;o=!0}if(!o)return!1;if(-1!==s.indexOf(i))return!1;s.push(i)}return!0},construct:function(t){return null!==t?t:[]}}),Vt=Object.prototype.toString;var Xt=new jt("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:function(t){if(null===t)return!0;var e,r,n,i,o,s=t;for(o=new Array(s.length),e=0,r=s.length;e<r;e+=1){if(n=s[e],"[object Object]"!==Vt.call(n))return!1;if(1!==(i=Object.keys(n)).length)return!1;o[e]=[i[0],n[i[0]]]}return!0},construct:function(t){if(null===t)return[];var e,r,n,i,o,s=t;for(o=new Array(s.length),e=0,r=s.length;e<r;e+=1)n=s[e],i=Object.keys(n),o[e]=[i[0],n[i[0]]];return o}}),Kt=Object.prototype.hasOwnProperty;var te=new jt("tag:yaml.org,2002:set",{kind:"mapping",resolve:function(t){if(null===t)return!0;var e,r=t;for(e in r)if(Kt.call(r,e)&&null!==r[e])return!1;return!0},construct:function(t){return null!==t?t:{}}}),ee=Pt.extend({implicit:[Gt,Wt],explicit:[Ht,$t,Xt,te]}),re=Object.prototype.hasOwnProperty,ne=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,ie=/[\x85\u2028\u2029]/,oe=/[,\[\]\{\}]/,se=/^(?:!|!!|![a-z\-]+!)$/i,ue=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function ae(t){return Object.prototype.toString.call(t)}function ce(t){return 10===t||13===t}function fe(t){return 9===t||32===t}function le(t){return 9===t||32===t||10===t||13===t}function he(t){return 44===t||91===t||93===t||123===t||125===t}function pe(t){var e;return 48<=t&&t<=57?t-48:97<=(e=32|t)&&e<=102?e-97+10:-1}function de(t){return 48===t?"\0":97===t?"":98===t?"\b":116===t||9===t?"\t":110===t?"\n":118===t?"\v":102===t?"\f":114===t?"\r":101===t?"":32===t?" ":34===t?'"':47===t?"/":92===t?"\\":78===t?"":95===t?" ":76===t?"\u2028":80===t?"\u2029":""}function ye(t){return t<=65535?String.fromCharCode(t):String.fromCharCode(55296+(t-65536>>10),56320+(t-65536&1023))}for(var ge=new Array(256),ve=new Array(256),we=0;we<256;we++)ge[we]=de(we)?1:0,ve[we]=de(we);function Me(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||ee,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function Le(t,e){var r={name:t.filename,buffer:t.input.slice(0,-1),position:t.position,line:t.line,column:t.position-t.lineStart};return r.snippet=_t(r),new wt(e,r)}function _e(t,e){throw Le(t,e)}function me(t,e){t.onWarning&&t.onWarning.call(null,Le(t,e))}var be={YAML:function(t,e,r){var n,i,o;null!==t.version&&_e(t,"duplication of %YAML directive"),1!==r.length&&_e(t,"YAML directive accepts exactly one argument"),null===(n=/^([0-9]+)\.([0-9]+)$/.exec(r[0]))&&_e(t,"ill-formed argument of the YAML directive"),i=parseInt(n[1],10),o=parseInt(n[2],10),1!==i&&_e(t,"unacceptable YAML version of the document"),t.version=r[0],t.checkLineBreaks=o<2,1!==o&&2!==o&&me(t,"unsupported YAML version of the document")},TAG:function(t,e,r){var n,i;2!==r.length&&_e(t,"TAG directive accepts exactly two arguments"),n=r[0],i=r[1],se.test(n)||_e(t,"ill-formed tag handle (first argument) of the TAG directive"),re.call(t.tagMap,n)&&_e(t,'there is a previously declared suffix for "'+n+'" tag handle'),ue.test(i)||_e(t,"ill-formed tag prefix (second argument) of the TAG directive");try{i=decodeURIComponent(i)}catch(e){_e(t,"tag prefix is malformed: "+i)}t.tagMap[n]=i}};function je(t,e,r,n){var i,o,s,u;if(e<r){if(u=t.input.slice(e,r),n)for(i=0,o=u.length;i<o;i+=1)9===(s=u.charCodeAt(i))||32<=s&&s<=1114111||_e(t,"expected valid JSON character");else ne.test(u)&&_e(t,"the stream contains non-printable characters");t.result+=u}}function xe(t,e,r,n){var i,o,s,u;for(yt.isObject(r)||_e(t,"cannot merge mappings; the provided source object is unacceptable"),s=0,u=(i=Object.keys(r)).length;s<u;s+=1)o=i[s],re.call(e,o)||(e[o]=r[o],n[o]=!0)}function Ne(t,e,r,n,i,o,s,u,a){var c,f;if(Array.isArray(i))for(c=0,f=(i=Array.prototype.slice.call(i)).length;c<f;c+=1)Array.isArray(i[c])&&_e(t,"nested arrays are not supported inside keys"),"object"==typeof i&&"[object Object]"===ae(i[c])&&(i[c]="[object Object]");if("object"==typeof i&&"[object Object]"===ae(i)&&(i="[object Object]"),i=String(i),null===e&&(e={}),"tag:yaml.org,2002:merge"===n)if(Array.isArray(o))for(c=0,f=o.length;c<f;c+=1)xe(t,e,o[c],r);else xe(t,e,o,r);else t.json||re.call(r,i)||!re.call(e,i)||(t.line=s||t.line,t.lineStart=u||t.lineStart,t.position=a||t.position,_e(t,"duplicated mapping key")),"__proto__"===i?Object.defineProperty(e,i,{configurable:!0,enumerable:!0,writable:!0,value:o}):e[i]=o,delete r[i];return e}function Se(t){var e;10===(e=t.input.charCodeAt(t.position))?t.position++:13===e?(t.position++,10===t.input.charCodeAt(t.position)&&t.position++):_e(t,"a line break is expected"),t.line+=1,t.lineStart=t.position,t.firstTabInLine=-1}function De(t,e,r){for(var n=0,i=t.input.charCodeAt(t.position);0!==i;){for(;fe(i);)9===i&&-1===t.firstTabInLine&&(t.firstTabInLine=t.position),i=t.input.charCodeAt(++t.position);if(e&&35===i)do{i=t.input.charCodeAt(++t.position)}while(10!==i&&13!==i&&0!==i);if(!ce(i))break;for(Se(t),i=t.input.charCodeAt(t.position),n++,t.lineIndent=0;32===i;)t.lineIndent++,i=t.input.charCodeAt(++t.position)}return-1!==r&&0!==n&&t.lineIndent<r&&me(t,"deficient indentation"),n}function Ie(t){var e,r=t.position;return!(45!==(e=t.input.charCodeAt(r))&&46!==e||e!==t.input.charCodeAt(r+1)||e!==t.input.charCodeAt(r+2)||(r+=3,0!==(e=t.input.charCodeAt(r))&&!le(e)))}function Ee(t,e){1===e?t.result+=" ":e>1&&(t.result+=yt.repeat("\n",e-1))}function Ae(t,e){var r,n,i=t.tag,o=t.anchor,s=[],u=!1;if(-1!==t.firstTabInLine)return!1;for(null!==t.anchor&&(t.anchorMap[t.anchor]=s),n=t.input.charCodeAt(t.position);0!==n&&(-1!==t.firstTabInLine&&(t.position=t.firstTabInLine,_e(t,"tab characters must not be used in indentation")),45===n)&&le(t.input.charCodeAt(t.position+1));)if(u=!0,t.position++,De(t,!0,-1)&&t.lineIndent<=e)s.push(null),n=t.input.charCodeAt(t.position);else if(r=t.line,Oe(t,e,3,!1,!0),s.push(t.result),De(t,!0,-1),n=t.input.charCodeAt(t.position),(t.line===r||t.lineIndent>e)&&0!==n)_e(t,"bad indentation of a sequence entry");else if(t.lineIndent<e)break;return!!u&&(t.tag=i,t.anchor=o,t.kind="sequence",t.result=s,!0)}function Ce(t){var e,r,n,i,o=!1,s=!1;if(33!==(i=t.input.charCodeAt(t.position)))return!1;if(null!==t.tag&&_e(t,"duplication of a tag property"),60===(i=t.input.charCodeAt(++t.position))?(o=!0,i=t.input.charCodeAt(++t.position)):33===i?(s=!0,r="!!",i=t.input.charCodeAt(++t.position)):r="!",e=t.position,o){do{i=t.input.charCodeAt(++t.position)}while(0!==i&&62!==i);t.position<t.length?(n=t.input.slice(e,t.position),i=t.input.charCodeAt(++t.position)):_e(t,"unexpected end of the stream within a verbatim tag")}else{for(;0!==i&&!le(i);)33===i&&(s?_e(t,"tag suffix cannot contain exclamation marks"):(r=t.input.slice(e-1,t.position+1),se.test(r)||_e(t,"named tag handle cannot contain such characters"),s=!0,e=t.position+1)),i=t.input.charCodeAt(++t.position);n=t.input.slice(e,t.position),oe.test(n)&&_e(t,"tag suffix cannot contain flow indicator characters")}n&&!ue.test(n)&&_e(t,"tag name cannot contain such characters: "+n);try{n=decodeURIComponent(n)}catch(e){_e(t,"tag name is malformed: "+n)}return o?t.tag=n:re.call(t.tagMap,r)?t.tag=t.tagMap[r]+n:"!"===r?t.tag="!"+n:"!!"===r?t.tag="tag:yaml.org,2002:"+n:_e(t,'undeclared tag handle "'+r+'"'),!0}function Te(t){var e,r;if(38!==(r=t.input.charCodeAt(t.position)))return!1;for(null!==t.anchor&&_e(t,"duplication of an anchor property"),r=t.input.charCodeAt(++t.position),e=t.position;0!==r&&!le(r)&&!he(r);)r=t.input.charCodeAt(++t.position);return t.position===e&&_e(t,"name of an anchor node must contain at least one character"),t.anchor=t.input.slice(e,t.position),!0}function Oe(t,e,r,n,i){var o,s,u,a,c,f,l,h,p,d=1,y=!1,g=!1;if(null!==t.listener&&t.listener("open",t),t.tag=null,t.anchor=null,t.kind=null,t.result=null,o=s=u=4===r||3===r,n&&De(t,!0,-1)&&(y=!0,t.lineIndent>e?d=1:t.lineIndent===e?d=0:t.lineIndent<e&&(d=-1)),1===d)for(;Ce(t)||Te(t);)De(t,!0,-1)?(y=!0,u=o,t.lineIndent>e?d=1:t.lineIndent===e?d=0:t.lineIndent<e&&(d=-1)):u=!1;if(u&&(u=y||i),1!==d&&4!==r||(h=1===r||2===r?e:e+1,p=t.position-t.lineStart,1===d?u&&(Ae(t,p)||function(t,e,r){var n,i,o,s,u,a,c,f=t.tag,l=t.anchor,h={},p=Object.create(null),d=null,y=null,g=null,v=!1,w=!1;if(-1!==t.firstTabInLine)return!1;for(null!==t.anchor&&(t.anchorMap[t.anchor]=h),c=t.input.charCodeAt(t.position);0!==c;){if(v||-1===t.firstTabInLine||(t.position=t.firstTabInLine,_e(t,"tab characters must not be used in indentation")),n=t.input.charCodeAt(t.position+1),o=t.line,63!==c&&58!==c||!le(n)){if(s=t.line,u=t.lineStart,a=t.position,!Oe(t,r,2,!1,!0))break;if(t.line===o){for(c=t.input.charCodeAt(t.position);fe(c);)c=t.input.charCodeAt(++t.position);if(58===c)le(c=t.input.charCodeAt(++t.position))||_e(t,"a whitespace character is expected after the key-value separator within a block mapping"),v&&(Ne(t,h,p,d,y,null,s,u,a),d=y=g=null),w=!0,v=!1,i=!1,d=t.tag,y=t.result;else{if(!w)return t.tag=f,t.anchor=l,!0;_e(t,"can not read an implicit mapping pair; a colon is missed")}}else{if(!w)return t.tag=f,t.anchor=l,!0;_e(t,"can not read a block mapping entry; a multiline key may not be an implicit key")}}else 63===c?(v&&(Ne(t,h,p,d,y,null,s,u,a),d=y=g=null),w=!0,v=!0,i=!0):v?(v=!1,i=!0):_e(t,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),t.position+=1,c=n;if((t.line===o||t.lineIndent>e)&&(v&&(s=t.line,u=t.lineStart,a=t.position),Oe(t,e,4,!0,i)&&(v?y=t.result:g=t.result),v||(Ne(t,h,p,d,y,g,s,u,a),d=y=g=null),De(t,!0,-1),c=t.input.charCodeAt(t.position)),(t.line===o||t.lineIndent>e)&&0!==c)_e(t,"bad indentation of a mapping entry");else if(t.lineIndent<e)break}return v&&Ne(t,h,p,d,y,null,s,u,a),w&&(t.tag=f,t.anchor=l,t.kind="mapping",t.result=h),w}(t,p,h))||function(t,e){var r,n,i,o,s,u,a,c,f,l,h,p,d=!0,y=t.tag,g=t.anchor,v=Object.create(null);if(91===(p=t.input.charCodeAt(t.position)))s=93,c=!1,o=[];else{if(123!==p)return!1;s=125,c=!0,o={}}for(null!==t.anchor&&(t.anchorMap[t.anchor]=o),p=t.input.charCodeAt(++t.position);0!==p;){if(De(t,!0,e),(p=t.input.charCodeAt(t.position))===s)return t.position++,t.tag=y,t.anchor=g,t.kind=c?"mapping":"sequence",t.result=o,!0;d?44===p&&_e(t,"expected the node content, but found ','"):_e(t,"missed comma between flow collection entries"),h=null,u=a=!1,63===p&&le(t.input.charCodeAt(t.position+1))&&(u=a=!0,t.position++,De(t,!0,e)),r=t.line,n=t.lineStart,i=t.position,Oe(t,e,1,!1,!0),l=t.tag,f=t.result,De(t,!0,e),p=t.input.charCodeAt(t.position),!a&&t.line!==r||58!==p||(u=!0,p=t.input.charCodeAt(++t.position),De(t,!0,e),Oe(t,e,1,!1,!0),h=t.result),c?Ne(t,o,v,l,f,h,r,n,i):u?o.push(Ne(t,null,v,l,f,h,r,n,i)):o.push(f),De(t,!0,e),44===(p=t.input.charCodeAt(t.position))?(d=!0,p=t.input.charCodeAt(++t.position)):d=!1}_e(t,"unexpected end of the stream within a flow collection")}(t,h)?g=!0:(s&&function(t,e){var r,n,i,o,s,u=1,a=!1,c=!1,f=e,l=0,h=!1;if(124===(o=t.input.charCodeAt(t.position)))n=!1;else{if(62!==o)return!1;n=!0}for(t.kind="scalar",t.result="";0!==o;)if(43===(o=t.input.charCodeAt(++t.position))||45===o)1===u?u=43===o?3:2:_e(t,"repeat of a chomping mode identifier");else{if(!((i=48<=(s=o)&&s<=57?s-48:-1)>=0))break;0===i?_e(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):c?_e(t,"repeat of an indentation width identifier"):(f=e+i-1,c=!0)}if(fe(o)){do{o=t.input.charCodeAt(++t.position)}while(fe(o));if(35===o)do{o=t.input.charCodeAt(++t.position)}while(!ce(o)&&0!==o)}for(;0!==o;){for(Se(t),t.lineIndent=0,o=t.input.charCodeAt(t.position);(!c||t.lineIndent<f)&&32===o;)t.lineIndent++,o=t.input.charCodeAt(++t.position);if(!c&&t.lineIndent>f&&(f=t.lineIndent),ce(o))l++;else{if(t.lineIndent<f){3===u?t.result+=yt.repeat("\n",a?1+l:l):1===u&&a&&(t.result+="\n");break}for(n?fe(o)?(h=!0,t.result+=yt.repeat("\n",a?1+l:l)):h?(h=!1,t.result+=yt.repeat("\n",l+1)):0===l?a&&(t.result+=" "):t.result+=yt.repeat("\n",l):t.result+=yt.repeat("\n",a?1+l:l),a=!0,c=!0,l=0,r=t.position;!ce(o)&&0!==o;)o=t.input.charCodeAt(++t.position);je(t,r,t.position,!1)}}return!0}(t,h)||function(t,e){var r,n,i;if(39!==(r=t.input.charCodeAt(t.position)))return!1;for(t.kind="scalar",t.result="",t.position++,n=i=t.position;0!==(r=t.input.charCodeAt(t.position));)if(39===r){if(je(t,n,t.position,!0),39!==(r=t.input.charCodeAt(++t.position)))return!0;n=t.position,t.position++,i=t.position}else ce(r)?(je(t,n,i,!0),Ee(t,De(t,!1,e)),n=i=t.position):t.position===t.lineStart&&Ie(t)?_e(t,"unexpected end of the document within a single quoted scalar"):(t.position++,i=t.position);_e(t,"unexpected end of the stream within a single quoted scalar")}(t,h)||function(t,e){var r,n,i,o,s,u,a;if(34!==(u=t.input.charCodeAt(t.position)))return!1;for(t.kind="scalar",t.result="",t.position++,r=n=t.position;0!==(u=t.input.charCodeAt(t.position));){if(34===u)return je(t,r,t.position,!0),t.position++,!0;if(92===u){if(je(t,r,t.position,!0),ce(u=t.input.charCodeAt(++t.position)))De(t,!1,e);else if(u<256&&ge[u])t.result+=ve[u],t.position++;else if((s=120===(a=u)?2:117===a?4:85===a?8:0)>0){for(i=s,o=0;i>0;i--)(s=pe(u=t.input.charCodeAt(++t.position)))>=0?o=(o<<4)+s:_e(t,"expected hexadecimal character");t.result+=ye(o),t.position++}else _e(t,"unknown escape sequence");r=n=t.position}else ce(u)?(je(t,r,n,!0),Ee(t,De(t,!1,e)),r=n=t.position):t.position===t.lineStart&&Ie(t)?_e(t,"unexpected end of the document within a double quoted scalar"):(t.position++,n=t.position)}_e(t,"unexpected end of the stream within a double quoted scalar")}(t,h)?g=!0:!function(t){var e,r,n;if(42!==(n=t.input.charCodeAt(t.position)))return!1;for(n=t.input.charCodeAt(++t.position),e=t.position;0!==n&&!le(n)&&!he(n);)n=t.input.charCodeAt(++t.position);return t.position===e&&_e(t,"name of an alias node must contain at least one character"),r=t.input.slice(e,t.position),re.call(t.anchorMap,r)||_e(t,'unidentified alias "'+r+'"'),t.result=t.anchorMap[r],De(t,!0,-1),!0}(t)?function(t,e,r){var n,i,o,s,u,a,c,f,l=t.kind,h=t.result;if(le(f=t.input.charCodeAt(t.position))||he(f)||35===f||38===f||42===f||33===f||124===f||62===f||39===f||34===f||37===f||64===f||96===f)return!1;if((63===f||45===f)&&(le(n=t.input.charCodeAt(t.position+1))||r&&he(n)))return!1;for(t.kind="scalar",t.result="",i=o=t.position,s=!1;0!==f;){if(58===f){if(le(n=t.input.charCodeAt(t.position+1))||r&&he(n))break}else if(35===f){if(le(t.input.charCodeAt(t.position-1)))break}else{if(t.position===t.lineStart&&Ie(t)||r&&he(f))break;if(ce(f)){if(u=t.line,a=t.lineStart,c=t.lineIndent,De(t,!1,-1),t.lineIndent>=e){s=!0,f=t.input.charCodeAt(t.position);continue}t.position=o,t.line=u,t.lineStart=a,t.lineIndent=c;break}}s&&(je(t,i,o,!1),Ee(t,t.line-u),i=o=t.position,s=!1),fe(f)||(o=t.position+1),f=t.input.charCodeAt(++t.position)}return je(t,i,o,!1),!!t.result||(t.kind=l,t.result=h,!1)}(t,h,1===r)&&(g=!0,null===t.tag&&(t.tag="?")):(g=!0,null===t.tag&&null===t.anchor||_e(t,"alias node should not have any properties")),null!==t.anchor&&(t.anchorMap[t.anchor]=t.result)):0===d&&(g=u&&Ae(t,p))),null===t.tag)null!==t.anchor&&(t.anchorMap[t.anchor]=t.result);else if("?"===t.tag){for(null!==t.result&&"scalar"!==t.kind&&_e(t,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+t.kind+'"'),a=0,c=t.implicitTypes.length;a<c;a+=1)if((l=t.implicitTypes[a]).resolve(t.result)){t.result=l.construct(t.result),t.tag=l.tag,null!==t.anchor&&(t.anchorMap[t.anchor]=t.result);break}}else if("!"!==t.tag){if(re.call(t.typeMap[t.kind||"fallback"],t.tag))l=t.typeMap[t.kind||"fallback"][t.tag];else for(l=null,a=0,c=(f=t.typeMap.multi[t.kind||"fallback"]).length;a<c;a+=1)if(t.tag.slice(0,f[a].tag.length)===f[a].tag){l=f[a];break}l||_e(t,"unknown tag !<"+t.tag+">"),null!==t.result&&l.kind!==t.kind&&_e(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+l.kind+'", not "'+t.kind+'"'),l.resolve(t.result,t.tag)?(t.result=l.construct(t.result,t.tag),null!==t.anchor&&(t.anchorMap[t.anchor]=t.result)):_e(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")}return null!==t.listener&&t.listener("close",t),null!==t.tag||null!==t.anchor||g}function ze(t){var e,r,n,i,o=t.position,s=!1;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap=Object.create(null),t.anchorMap=Object.create(null);0!==(i=t.input.charCodeAt(t.position))&&(De(t,!0,-1),i=t.input.charCodeAt(t.position),!(t.lineIndent>0||37!==i));){for(s=!0,i=t.input.charCodeAt(++t.position),e=t.position;0!==i&&!le(i);)i=t.input.charCodeAt(++t.position);for(n=[],(r=t.input.slice(e,t.position)).length<1&&_e(t,"directive name must not be less than one character in length");0!==i;){for(;fe(i);)i=t.input.charCodeAt(++t.position);if(35===i){do{i=t.input.charCodeAt(++t.position)}while(0!==i&&!ce(i));break}if(ce(i))break;for(e=t.position;0!==i&&!le(i);)i=t.input.charCodeAt(++t.position);n.push(t.input.slice(e,t.position))}0!==i&&Se(t),re.call(be,r)?be[r](t,r,n):me(t,'unknown document directive "'+r+'"')}De(t,!0,-1),0===t.lineIndent&&45===t.input.charCodeAt(t.position)&&45===t.input.charCodeAt(t.position+1)&&45===t.input.charCodeAt(t.position+2)?(t.position+=3,De(t,!0,-1)):s&&_e(t,"directives end mark is expected"),Oe(t,t.lineIndent-1,4,!1,!0),De(t,!0,-1),t.checkLineBreaks&&ie.test(t.input.slice(o,t.position))&&me(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&Ie(t)?46===t.input.charCodeAt(t.position)&&(t.position+=3,De(t,!0,-1)):t.position<t.length-1&&_e(t,"end of the stream or a document separator is expected")}function ke(t,e){e=e||{},0!==(t=String(t)).length&&(10!==t.charCodeAt(t.length-1)&&13!==t.charCodeAt(t.length-1)&&(t+="\n"),65279===t.charCodeAt(0)&&(t=t.slice(1)));var r=new Me(t,e),n=t.indexOf("\0");for(-1!==n&&(r.position=n,_e(r,"null byte is not allowed in input")),r.input+="\0";32===r.input.charCodeAt(r.position);)r.lineIndent+=1,r.position+=1;for(;r.position<r.length-1;)ze(r);return r.documents}var Ue={loadAll:function(t,e,r){null!==e&&"object"==typeof e&&void 0===r&&(r=e,e=null);var n=ke(t,r);if("function"!=typeof e)return n;for(var i=0,o=n.length;i<o;i+=1)e(n[i])},load:function(t,e){var r=ke(t,e);if(0!==r.length){if(1===r.length)return r[0];throw new wt("expected a single document in the stream, but found more")}}},Re=Object.prototype.toString,Ye=Object.prototype.hasOwnProperty,Be=65279,Pe={0:"\\0",7:"\\a",8:"\\b",9:"\\t",10:"\\n",11:"\\v",12:"\\f",13:"\\r",27:"\\e",34:'\\"',92:"\\\\",133:"\\N",160:"\\_",8232:"\\L",8233:"\\P"},Qe=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],Fe=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function Ge(t){var e,r,n;if(e=t.toString(16).toUpperCase(),t<=255)r="x",n=2;else if(t<=65535)r="u",n=4;else{if(!(t<=4294967295))throw new wt("code point within a string may not be greater than 0xFFFFFFFF");r="U",n=8}return"\\"+r+yt.repeat("0",n-e.length)+e}function We(t){this.schema=t.schema||ee,this.indent=Math.max(1,t.indent||2),this.noArrayIndent=t.noArrayIndent||!1,this.skipInvalid=t.skipInvalid||!1,this.flowLevel=yt.isNothing(t.flowLevel)?-1:t.flowLevel,this.styleMap=function(t,e){var r,n,i,o,s,u,a;if(null===e)return{};for(r={},i=0,o=(n=Object.keys(e)).length;i<o;i+=1)s=n[i],u=String(e[s]),"!!"===s.slice(0,2)&&(s="tag:yaml.org,2002:"+s.slice(2)),(a=t.compiledTypeMap.fallback[s])&&Ye.call(a.styleAliases,u)&&(u=a.styleAliases[u]),r[s]=u;return r}(this.schema,t.styles||null),this.sortKeys=t.sortKeys||!1,this.lineWidth=t.lineWidth||80,this.noRefs=t.noRefs||!1,this.noCompatMode=t.noCompatMode||!1,this.condenseFlow=t.condenseFlow||!1,this.quotingType='"'===t.quotingType?2:1,this.forceQuotes=t.forceQuotes||!1,this.replacer="function"==typeof t.replacer?t.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function qe(t,e){for(var r,n=yt.repeat(" ",e),i=0,o=-1,s="",u=t.length;i<u;)-1===(o=t.indexOf("\n",i))?(r=t.slice(i),i=u):(r=t.slice(i,o+1),i=o+1),r.length&&"\n"!==r&&(s+=n),s+=r;return s}function He(t,e){return"\n"+yt.repeat(" ",t.indent*e)}function Je(t){return 32===t||9===t}function Ze(t){return 32<=t&&t<=126||161<=t&&t<=55295&&8232!==t&&8233!==t||57344<=t&&t<=65533&&t!==Be||65536<=t&&t<=1114111}function $e(t){return Ze(t)&&t!==Be&&13!==t&&10!==t}function Ve(t,e,r){var n=$e(t),i=n&&!Je(t);return(r?n:n&&44!==t&&91!==t&&93!==t&&123!==t&&125!==t)&&35!==t&&!(58===e&&!i)||$e(e)&&!Je(e)&&35===t||58===e&&i}function Xe(t,e){var r,n=t.charCodeAt(e);return n>=55296&&n<=56319&&e+1<t.length&&(r=t.charCodeAt(e+1))>=56320&&r<=57343?1024*(n-55296)+r-56320+65536:n}function Ke(t){return/^\n* /.test(t)}function tr(t,e,r,n,i,o,s,u){var a,c,f=0,l=null,h=!1,p=!1,d=-1!==n,y=-1,g=Ze(c=Xe(t,0))&&c!==Be&&!Je(c)&&45!==c&&63!==c&&58!==c&&44!==c&&91!==c&&93!==c&&123!==c&&125!==c&&35!==c&&38!==c&&42!==c&&33!==c&&124!==c&&61!==c&&62!==c&&39!==c&&34!==c&&37!==c&&64!==c&&96!==c&&function(t){return!Je(t)&&58!==t}(Xe(t,t.length-1));if(e||s)for(a=0;a<t.length;f>=65536?a+=2:a++){if(!Ze(f=Xe(t,a)))return 5;g=g&&Ve(f,l,u),l=f}else{for(a=0;a<t.length;f>=65536?a+=2:a++){if(10===(f=Xe(t,a)))h=!0,d&&(p=p||a-y-1>n&&" "!==t[y+1],y=a);else if(!Ze(f))return 5;g=g&&Ve(f,l,u),l=f}p=p||d&&a-y-1>n&&" "!==t[y+1]}return h||p?r>9&&Ke(t)?5:s?2===o?5:2:p?4:3:!g||s||i(t)?2===o?5:2:1}function er(t,e,r,n,i){t.dump=function(){if(0===e.length)return 2===t.quotingType?'""':"''";if(!t.noCompatMode&&(-1!==Qe.indexOf(e)||Fe.test(e)))return 2===t.quotingType?'"'+e+'"':"'"+e+"'";var o=t.indent*Math.max(1,r),s=-1===t.lineWidth?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-o),u=n||t.flowLevel>-1&&r>=t.flowLevel;switch(tr(e,u,t.indent,s,(function(e){return function(t,e){var r,n;for(r=0,n=t.implicitTypes.length;r<n;r+=1)if(t.implicitTypes[r].resolve(e))return!0;return!1}(t,e)}),t.quotingType,t.forceQuotes&&!n,i)){case 1:return e;case 2:return"'"+e.replace(/'/g,"''")+"'";case 3:return"|"+rr(e,t.indent)+nr(qe(e,o));case 4:return">"+rr(e,t.indent)+nr(qe(function(t,e){var r,n,i=/(\n+)([^\n]*)/g,o=(u=t.indexOf("\n"),u=-1!==u?u:t.length,i.lastIndex=u,ir(t.slice(0,u),e)),s="\n"===t[0]||" "===t[0];var u;for(;n=i.exec(t);){var a=n[1],c=n[2];r=" "===c[0],o+=a+(s||r||""===c?"":"\n")+ir(c,e),s=r}return o}(e,s),o));case 5:return'"'+function(t){for(var e,r="",n=0,i=0;i<t.length;n>=65536?i+=2:i++)n=Xe(t,i),!(e=Pe[n])&&Ze(n)?(r+=t[i],n>=65536&&(r+=t[i+1])):r+=e||Ge(n);return r}(e)+'"';default:throw new wt("impossible error: invalid scalar style")}}()}function rr(t,e){var r=Ke(t)?String(e):"",n="\n"===t[t.length-1];return r+(n&&("\n"===t[t.length-2]||"\n"===t)?"+":n?"":"-")+"\n"}function nr(t){return"\n"===t[t.length-1]?t.slice(0,-1):t}function ir(t,e){if(""===t||" "===t[0])return t;for(var r,n,i=/ [^ ]/g,o=0,s=0,u=0,a="";r=i.exec(t);)(u=r.index)-o>e&&(n=s>o?s:u,a+="\n"+t.slice(o,n),o=n+1),s=u;return a+="\n",t.length-o>e&&s>o?a+=t.slice(o,s)+"\n"+t.slice(s+1):a+=t.slice(o),a.slice(1)}function or(t,e,r,n){var i,o,s,u="",a=t.tag;for(i=0,o=r.length;i<o;i+=1)s=r[i],t.replacer&&(s=t.replacer.call(r,String(i),s)),(ur(t,e+1,s,!0,!0,!1,!0)||void 0===s&&ur(t,e+1,null,!0,!0,!1,!0))&&(n&&""===u||(u+=He(t,e)),t.dump&&10===t.dump.charCodeAt(0)?u+="-":u+="- ",u+=t.dump);t.tag=a,t.dump=u||"[]"}function sr(t,e,r){var n,i,o,s,u,a;for(o=0,s=(i=r?t.explicitTypes:t.implicitTypes).length;o<s;o+=1)if(((u=i[o]).instanceOf||u.predicate)&&(!u.instanceOf||"object"==typeof e&&e instanceof u.instanceOf)&&(!u.predicate||u.predicate(e))){if(r?u.multi&&u.representName?t.tag=u.representName(e):t.tag=u.tag:t.tag="?",u.represent){if(a=t.styleMap[u.tag]||u.defaultStyle,"[object Function]"===Re.call(u.represent))n=u.represent(e,a);else{if(!Ye.call(u.represent,a))throw new wt("!<"+u.tag+'> tag resolver accepts not "'+a+'" style');n=u.represent[a](e,a)}t.dump=n}return!0}return!1}function ur(t,e,r,n,i,o,s){t.tag=null,t.dump=r,sr(t,r,!1)||sr(t,r,!0);var u,a=Re.call(t.dump),c=n;n&&(n=t.flowLevel<0||t.flowLevel>e);var f,l,h="[object Object]"===a||"[object Array]"===a;if(h&&(l=-1!==(f=t.duplicates.indexOf(r))),(null!==t.tag&&"?"!==t.tag||l||2!==t.indent&&e>0)&&(i=!1),l&&t.usedDuplicates[f])t.dump="*ref_"+f;else{if(h&&l&&!t.usedDuplicates[f]&&(t.usedDuplicates[f]=!0),"[object Object]"===a)n&&0!==Object.keys(t.dump).length?(!function(t,e,r,n){var i,o,s,u,a,c,f="",l=t.tag,h=Object.keys(r);if(!0===t.sortKeys)h.sort();else if("function"==typeof t.sortKeys)h.sort(t.sortKeys);else if(t.sortKeys)throw new wt("sortKeys must be a boolean or a function");for(i=0,o=h.length;i<o;i+=1)c="",n&&""===f||(c+=He(t,e)),u=r[s=h[i]],t.replacer&&(u=t.replacer.call(r,s,u)),ur(t,e+1,s,!0,!0,!0)&&((a=null!==t.tag&&"?"!==t.tag||t.dump&&t.dump.length>1024)&&(t.dump&&10===t.dump.charCodeAt(0)?c+="?":c+="? "),c+=t.dump,a&&(c+=He(t,e)),ur(t,e+1,u,!0,a)&&(t.dump&&10===t.dump.charCodeAt(0)?c+=":":c+=": ",f+=c+=t.dump));t.tag=l,t.dump=f||"{}"}(t,e,t.dump,i),l&&(t.dump="&ref_"+f+t.dump)):(!function(t,e,r){var n,i,o,s,u,a="",c=t.tag,f=Object.keys(r);for(n=0,i=f.length;n<i;n+=1)u="",""!==a&&(u+=", "),t.condenseFlow&&(u+='"'),s=r[o=f[n]],t.replacer&&(s=t.replacer.call(r,o,s)),ur(t,e,o,!1,!1)&&(t.dump.length>1024&&(u+="? "),u+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),ur(t,e,s,!1,!1)&&(a+=u+=t.dump));t.tag=c,t.dump="{"+a+"}"}(t,e,t.dump),l&&(t.dump="&ref_"+f+" "+t.dump));else if("[object Array]"===a)n&&0!==t.dump.length?(t.noArrayIndent&&!s&&e>0?or(t,e-1,t.dump,i):or(t,e,t.dump,i),l&&(t.dump="&ref_"+f+t.dump)):(!function(t,e,r){var n,i,o,s="",u=t.tag;for(n=0,i=r.length;n<i;n+=1)o=r[n],t.replacer&&(o=t.replacer.call(r,String(n),o)),(ur(t,e,o,!1,!1)||void 0===o&&ur(t,e,null,!1,!1))&&(""!==s&&(s+=","+(t.condenseFlow?"":" ")),s+=t.dump);t.tag=u,t.dump="["+s+"]"}(t,e,t.dump),l&&(t.dump="&ref_"+f+" "+t.dump));else{if("[object String]"!==a){if("[object Undefined]"===a)return!1;if(t.skipInvalid)return!1;throw new wt("unacceptable kind of an object to dump "+a)}"?"!==t.tag&&er(t,t.dump,e,o,c)}null!==t.tag&&"?"!==t.tag&&(u=encodeURI("!"===t.tag[0]?t.tag.slice(1):t.tag).replace(/!/g,"%21"),u="!"===t.tag[0]?"!"+u:"tag:yaml.org,2002:"===u.slice(0,18)?"!!"+u.slice(18):"!<"+u+">",t.dump=u+" "+t.dump)}return!0}function ar(t,e){var r,n,i=[],o=[];for(cr(t,i,o),r=0,n=o.length;r<n;r+=1)e.duplicates.push(i[o[r]]);e.usedDuplicates=new Array(n)}function cr(t,e,r){var n,i,o;if(null!==t&&"object"==typeof t)if(-1!==(i=e.indexOf(t)))-1===r.indexOf(i)&&r.push(i);else if(e.push(t),Array.isArray(t))for(i=0,o=t.length;i<o;i+=1)cr(t[i],e,r);else for(i=0,o=(n=Object.keys(t)).length;i<o;i+=1)cr(t[n[i]],e,r)}function fr(t,e){return function(){throw new Error("Function yaml."+t+" is removed in js-yaml 4. Use yaml."+e+" instead, which is now safe by default.")}}const lr={Type:jt,Schema:St,FAILSAFE_SCHEMA:At,JSON_SCHEMA:Bt,CORE_SCHEMA:Pt,DEFAULT_SCHEMA:ee,load:Ue.load,loadAll:Ue.loadAll,dump:{dump:function(t,e){var r=new We(e=e||{});r.noRefs||ar(t,r);var n=t;return r.replacer&&(n=r.replacer.call({"":n},"",n)),ur(r,0,n,!0,!0)?r.dump+"\n":""}}.dump,YAMLException:wt,types:{binary:Ht,float:Yt,map:Et,null:Ct,pairs:Xt,set:te,timestamp:Gt,bool:Tt,int:kt,merge:Wt,omap:$t,seq:It,str:Dt},safeLoad:fr("safeLoad","load"),safeLoadAll:fr("safeLoadAll","loadAll"),safeDump:fr("safeDump","dump")};r(8764).Buffer;const hr=t=>O().Iterable.isIterable(t);function pr(t){return yr(t)?hr(t)?t.toJS():t:{}}function dr(t){return d()(t)?t:[t]}function yr(t){return!!t&&"object"==typeof t}function gr(t){return"function"==typeof t}const vr=()=>{let t={},e=pt.location.search;if(!e)return{};if(""!=e){let r=e.substr(1).split("&");for(let e in r)Object.prototype.hasOwnProperty.call(r,e)&&(e=r[e].split("="),t[decodeURIComponent(e[0])]=e[1]&&decodeURIComponent(e[1])||"")}return t};function wr(t,e){var r;let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:()=>!0;if("object"!=typeof t||d()(t)||null===t||!e)return t;const i=w()({},t);return f()(r=g()(i)).call(r,(t=>{t===e&&n(i[t],t)?delete i[t]:i[t]=wr(i[t],e,n)})),i}class Mr extends o.Component{constructor(t,e){super(t,e),a()(this,"onUrlChange",(t=>{let{target:{value:e}}=t;this.setState({url:e})})),a()(this,"loadSpec",(t=>{this.flushAuthData(),this.props.specActions.updateUrl(t),this.props.specActions.download(t)})),a()(this,"onUrlSelect",(t=>{let e=t.target.value||t.target.href;this.loadSpec(e),this.setSelectedUrl(e),t.preventDefault()})),a()(this,"downloadUrl",(t=>{this.loadSpec(this.state.url),t.preventDefault()})),a()(this,"setSearch",(t=>{let e=vr();e["urls.primaryName"]=t.name;const r=`${window.location.protocol}
</file>

<file path="docs/swagger/swagger-ui.js">
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.SwaggerUICore=t():e.SwaggerUICore=t()}(this,(function(){return(()=>{var e={6024:(e,t,r)=>{"use strict";r.d(t,{Z:()=>v});var n=r(4250),s=r.n(n),a=r(1093),o=r.n(a),l=r(8493),i=r.n(l),c=r(3942),u=r.n(c),p=r(6689),d=r.n(p);const m=require("react-immutable-pure-component");var h=r.n(m),g=r(8082),f=r.n(g),y=r(580),E=r.n(y);class v extends(h()){constructor(){super(...arguments),o()(this,"getModelName",(e=>-1!==i()(e).call(e,"#/definitions/")?e.replace(/^.*#\/definitions\//,""):-1!==i()(e).call(e,"#/components/schemas/")?e.replace(/^.*#\/components\/schemas\//,""):void 0)),o()(this,"getRefSchema",(e=>{let{specSelectors:t}=this.props;return t.findDefinition(e)}))}render(){let{getComponent:e,getConfigs:t,specSelectors:n,schema:a,required:o,name:l,isRef:i,specPath:c,displayName:u,includeReadOnly:p,includeWriteOnly:m}=this.props;const h=e("ObjectModel"),g=e("ArrayModel"),f=e("PrimitiveModel");let y="object",E=a&&a.get("$$ref");if(!l&&E&&(l=this.getModelName(E)),!a&&E&&(a=this.getRefSchema(l)),!a)return d().createElement("span",{className:"model model-title"},d().createElement("span",{className:"model-title__text"},u||l),d().createElement("img",{src:r(2517),height:"20px",width:"20px"}));const v=n.isOAS3()&&a.get("deprecated");switch(i=void 0!==i?i:!!E,y=a&&a.get("type")||y,y){case"object":return d().createElement(h,s()({className:"object"},this.props,{specPath:c,getConfigs:t,schema:a,name:l,deprecated:v,isRef:i,includeReadOnly:p,includeWriteOnly:m}));case"array":return d().createElement(g,s()({className:"array"},this.props,{getConfigs:t,schema:a,name:l,deprecated:v,required:o,includeReadOnly:p,includeWriteOnly:m}));default:return d().createElement(f,s()({},this.props,{getComponent:e,getConfigs:t,schema:a,name:l,deprecated:v,required:o}))}}}o()(v,"propTypes",{schema:u()(f()).isRequired,getComponent:E().func.isRequired,getConfigs:E().func.isRequired,specSelectors:E().object.isRequired,name:E().string,displayName:E().string,isRef:E().bool,required:E().bool,expandDepth:E().number,depth:E().number,specPath:f().list.isRequired,includeReadOnly:E().bool,includeWriteOnly:E().bool})},5623:(e,t,r)=>{"use strict";r.d(t,{Z:()=>m});var n=r(1093),s=r.n(n),a=r(7252),o=r.n(a),l=r(6689),i=r.n(l),c=r(3883),u=r.n(c),p=(r(580),r(1890)),d=r(7504);class m extends i().Component{constructor(e,t){super(e,t),s()(this,"getDefinitionUrl",(()=>{let{specSelectors:e}=this.props;return new(u())(e.url(),d.Z.location).toString()}));let{getConfigs:r}=e,{validatorUrl:n}=r();this.state={url:this.getDefinitionUrl(),validatorUrl:void 0===n?"https://validator.swagger.io/validator":n}}UNSAFE_componentWillReceiveProps(e){let{getConfigs:t}=e,{validatorUrl:r}=t();this.setState({url:this.getDefinitionUrl(),validatorUrl:void 0===r?"https://validator.swagger.io/validator":r})}render(){let{getConfigs:e}=this.props,{spec:t}=e(),r=(0,p.Nm)(this.state.validatorUrl);return"object"==typeof t&&o()(t).length?null:this.state.url&&(0,p.hW)(this.state.validatorUrl)&&(0,p.hW)(this.state.url)?i().createElement("span",{className:"float-right"},i().createElement("a",{target:"_blank",rel:"noopener noreferrer",href:`${r}/debug?url=${encodeURIComponent(this.state.url)}`},i().createElement(h,{src:`${r}?url=${encodeURIComponent(this.state.url)}`,alt:"Online validator badge"}))):null}}class h extends i().Component{constructor(e){super(e),this.state={loaded:!1,error:!1}}componentDidMount(){const e=new Image;e.onload=()=>{this.setState({loaded:!0})},e.onerror=()=>{this.setState({error:!0})},e.src=this.props.src}UNSAFE_componentWillReceiveProps(e){if(e.src!==this.props.src){const t=new Image;t.onload=()=>{this.setState({loaded:!0})},t.onerror=()=>{this.setState({error:!0})},t.src=e.src}}render(){return this.state.error?i().createElement("img",{alt:"Error"}):this.state.loaded?i().createElement("img",{src:this.props.src,alt:this.props.alt}):null}}},2552:(e,t,r)=>{"use strict";r.d(t,{Z:()=>d,s:()=>m});var n=r(6689),s=r.n(n),a=(r(580),r(963));const o=require("remarkable/linkify"),l=require("dompurify");var i=r.n(l),c=r(9003),u=r.n(c);function p(e){let{source:t,className:r="",getConfigs:n}=e;if("string"!=typeof t)return null;const l=new a.Remarkable({html:!0,typographer:!0,breaks:!0,linkTarget:"_blank"}).use(o.linkify);l.core.ruler.disable(["replacements","smartquotes"]);const{useUnsafeMarkdown:i}=n(),c=l.render(t),p=m(c,{useUnsafeMarkdown:i});return t&&c&&p?s().createElement("div",{className:u()(r,"markdown"),dangerouslySetInnerHTML:{__html:p}}):null}i().addHook&&i().addHook("beforeSanitizeElements",(function(e){return e.href&&e.setAttribute("rel","noopener noreferrer"),e})),p.defaultProps={getConfigs:()=>({useUnsafeMarkdown:!1})};const d=p;function m(e){let{useUnsafeMarkdown:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=t,n=t?[]:["style","class"];return t&&!m.hasWarnedAboutDeprecation&&(console.warn("useUnsafeMarkdown display configuration parameter is deprecated since >3.26.0 and will be removed in v4.0.0."),m.hasWarnedAboutDeprecation=!0),i().sanitize(e,{ADD_ATTR:["target"],FORBID_TAGS:["style","form"],ALLOW_DATA_ATTR:r,FORBID_ATTR:n})}m.hasWarnedAboutDeprecation=!1},5308:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>d});var n,s=r(4235),a=r.n(s),o=r(874),l=r.n(o),i=r(1890),c=r(9595);const u=r(5102),p={},d=p;a()(n=l()(u).call(u)).call(n,(function(e){if("./index.js"===e)return;let t=u(e);p[(0,i.Zl)(e)]=t.default?t.default:t})),p.SafeRender=c.default},5812:(e,t,r)=>{"use strict";r.r(t),r.d(t,{SHOW_AUTH_POPUP:()=>p,AUTHORIZE:()=>d,LOGOUT:()=>m,PRE_AUTHORIZE_OAUTH2:()=>h,AUTHORIZE_OAUTH2:()=>g,VALIDATE:()=>f,CONFIGURE_AUTH:()=>y,RESTORE_AUTHORIZATION:()=>E,showDefinitions:()=>v,authorize:()=>S,authorizeWithPersistOption:()=>C,logout:()=>b,logoutWithPersistOption:()=>x,preAuthorizeImplicit:()=>w,authorizeOauth2:()=>_,authorizeOauth2WithPersistOption:()=>A,authorizePassword:()=>I,authorizeApplication:()=>N,authorizeAccessCodeWithFormParams:()=>q,authorizeAccessCodeWithBasicAuthentication:()=>T,authorizeRequest:()=>R,configureAuth:()=>P,restoreAuthorization:()=>k,persistAuthorizationIfNeeded:()=>O,authPopup:()=>M});var n=r(8344),s=r.n(n),a=r(4994),o=r.n(a),l=r(3883),i=r.n(l),c=r(7504),u=r(1890);const p="show_popup",d="authorize",m="logout",h="pre_authorize_oauth2",g="authorize_oauth2",f="validate",y="configure_auth",E="restore_authorization";function v(e){return{type:p,payload:e}}function S(e){return{type:d,payload:e}}const C=e=>t=>{let{authActions:r}=t;r.authorize(e),r.persistAuthorizationIfNeeded()};function b(e){return{type:m,payload:e}}const x=e=>t=>{let{authActions:r}=t;r.logout(e),r.persistAuthorizationIfNeeded()},w=e=>t=>{let{authActions:r,errActions:n}=t,{auth:a,token:o,isValid:l}=e,{schema:i,name:u}=a,p=i.get("flow");delete c.Z.swaggerUIRedirectOauth2,"accessCode"===p||l||n.newAuthErr({authId:u,source:"auth",level:"warning",message:"Authorization may be unsafe, passed state was changed in server Passed state wasn't returned from auth server"}),o.error?n.newAuthErr({authId:u,source:"auth",level:"error",message:s()(o)}):r.authorizeOauth2WithPersistOption({auth:a,token:o})};function _(e){return{type:g,payload:e}}const A=e=>t=>{let{authActions:r}=t;r.authorizeOauth2(e),r.persistAuthorizationIfNeeded()},I=e=>t=>{let{authActions:r}=t,{schema:n,name:s,username:a,password:l,passwordType:i,clientId:c,clientSecret:p}=e,d={grant_type:"password",scope:e.scopes.join(" "),username:a,password:l},m={};switch(i){case"request-body":!function(e,t,r){t&&o()(e,{client_id:t});r&&o()(e,{client_secret:r})}(d,c,p);break;case"basic":m.Authorization="Basic "+(0,u.r3)(c+":"+p);break;default:console.warn(`Warning: invalid passwordType ${i} was passed, not including client id and secret`)}return r.authorizeRequest({body:(0,u.GZ)(d),url:n.get("tokenUrl"),name:s,headers:m,query:{},auth:e})};const N=e=>t=>{let{authActions:r}=t,{schema:n,scopes:s,name:a,clientId:o,clientSecret:l}=e,i={Authorization:"Basic "+(0,u.r3)(o+":"+l)},c={grant_type:"client_credentials",scope:s.join(" ")};return r.authorizeRequest({body:(0,u.GZ)(c),name:a,url:n.get("tokenUrl"),auth:e,headers:i})},q=e=>{let{auth:t,redirectUrl:r}=e;return e=>{let{authActions:n}=e,{schema:s,name:a,clientId:o,clientSecret:l,codeVerifier:i}=t,c={grant_type:"authorization_code",code:t.code,client_id:o,client_secret:l,redirect_uri:r,code_verifier:i};return n.authorizeRequest({body:(0,u.GZ)(c),name:a,url:s.get("tokenUrl"),auth:t})}},T=e=>{let{auth:t,redirectUrl:r}=e;return e=>{let{authActions:n}=e,{schema:s,name:a,clientId:o,clientSecret:l,codeVerifier:i}=t,c={Authorization:"Basic "+(0,u.r3)(o+":"+l)},p={grant_type:"authorization_code",code:t.code,client_id:o,redirect_uri:r,code_verifier:i};return n.authorizeRequest({body:(0,u.GZ)(p),name:a,url:s.get("tokenUrl"),auth:t,headers:c})}},R=e=>t=>{let r,{fn:n,getConfigs:a,authActions:l,errActions:c,oas3Selectors:u,specSelectors:p,authSelectors:d}=t,{body:m,query:h={},headers:g={},name:f,url:y,auth:E}=e,{additionalQueryStringParams:v}=d.getConfigs()||{};if(p.isOAS3()){let e=u.serverEffectiveValue(u.selectedServer());r=i()(y,e,!0)}else r=i()(y,p.url(),!0);"object"==typeof v&&(r.query=o()({},r.query,v));const S=r.toString();let C=o()({Accept:"application/json, text/plain, */*","Content-Type":"application/x-www-form-urlencoded","X-Requested-With":"XMLHttpRequest"},g);n.fetch({url:S,method:"post",headers:C,query:h,body:m,requestInterceptor:a().requestInterceptor,responseInterceptor:a().responseInterceptor}).then((function(e){let t=JSON.parse(e.data),r=t&&(t.error||""),n=t&&(t.parseError||"");e.ok?r||n?c.newAuthErr({authId:f,level:"error",source:"auth",message:s()(t)}):l.authorizeOauth2WithPersistOption({auth:E,token:t}):c.newAuthErr({authId:f,level:"error",source:"auth",message:e.statusText})})).catch((e=>{let t=new Error(e).message;if(e.response&&e.response.data){const r=e.response.data;try{const e="string"==typeof r?JSON.parse(r):r;e.error&&(t+=`, error: ${e.error}`),e.error_description&&(t+=`, description: ${e.error_description}`)}catch(e){}}c.newAuthErr({authId:f,level:"error",source:"auth",message:t})}))};function P(e){return{type:y,payload:e}}function k(e){return{type:E,payload:e}}const O=()=>e=>{let{authSelectors:t,getConfigs:r}=e;if(r().persistAuthorization){const e=t.authorized();localStorage.setItem("authorized",s()(e.toJS()))}},M=(e,t)=>()=>{c.Z.swaggerUIRedirectOauth2=t,c.Z.open(e)}},3705:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>c,preauthorizeBasic:()=>u,preauthorizeApiKey:()=>p});var n=r(593),s=r.n(n),a=r(3962),o=r(5812),l=r(35),i=r(8302);function c(){return{afterLoad(e){this.rootInjects=this.rootInjects||{},this.rootInjects.initOAuth=e.authActions.configureAuth,this.rootInjects.preauthorizeApiKey=s()(p).call(p,null,e),this.rootInjects.preauthorizeBasic=s()(u).call(u,null,e)},statePlugins:{auth:{reducers:a.default,actions:o,selectors:l},spec:{wrapActions:i}}}}function u(e,t,r,n){const{authActions:{authorize:s},specSelectors:{specJson:a,isOAS3:o}}=e,l=o()?["components","securitySchemes"]:["securityDefinitions"],i=a().getIn([...l,t]);return i?s({[t]:{value:{username:r,password:n},schema:i.toJS()}}):null}function p(e,t,r){const{authActions:{authorize:n},specSelectors:{specJson:s,isOAS3:a}}=e,o=a()?["components","securitySchemes"]:["securityDefinitions"],l=s().getIn([...o,t]);return l?n({[t]:{value:r,schema:l.toJS()}}):null}},3962:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>u});var n=r(4235),s=r.n(n),a=r(4994),o=r.n(a),l=r(5572),i=r(1890),c=r(5812);const u={[c.SHOW_AUTH_POPUP]:(e,t)=>{let{payload:r}=t;return e.set("showDefinitions",r)},[c.AUTHORIZE]:(e,t)=>{var r;let{payload:n}=t,a=(0,l.fromJS)(n),o=e.get("authorized")||(0,l.Map)();return s()(r=a.entrySeq()).call(r,(t=>{let[r,n]=t;if(!(0,i.Wl)(n.getIn))return e.set("authorized",o);let s=n.getIn(["schema","type"]);if("apiKey"===s||"http"===s)o=o.set(r,n);else if("basic"===s){let e=n.getIn(["value","username"]),t=n.getIn(["value","password"]);o=o.setIn([r,"value"],{username:e,header:"Basic "+(0,i.r3)(e+":"+t)}),o=o.setIn([r,"schema"],n.get("schema"))}})),e.set("authorized",o)},[c.AUTHORIZE_OAUTH2]:(e,t)=>{let r,{payload:n}=t,{auth:s,token:a}=n;s.token=o()({},a),r=(0,l.fromJS)(s);let i=e.get("authorized")||(0,l.Map)();return i=i.set(r.get("name"),r),e.set("authorized",i)},[c.LOGOUT]:(e,t)=>{let{payload:r}=t,n=e.get("authorized").withMutations((e=>{s()(r).call(r,(t=>{e.delete(t)}))}));return e.set("authorized",n)},[c.CONFIGURE_AUTH]:(e,t)=>{let{payload:r}=t;return e.set("configs",r)},[c.RESTORE_AUTHORIZATION]:(e,t)=>{let{payload:r}=t;return e.set("authorized",(0,l.fromJS)(r.authorized))}}},35:(e,t,r)=>{"use strict";r.r(t),r.d(t,{shownDefinitions:()=>E,definitionsToAuthorize:()=>v,getDefinitionsByNames:()=>S,definitionsForRequirements:()=>C,authorized:()=>b,isAuthorized:()=>x,getConfigs:()=>w});var n=r(4235),s=r.n(n),a=r(9998),o=r.n(a),l=r(5626),i=r.n(l),c=r(8493),u=r.n(c),p=r(3942),d=r.n(p),m=r(7252),h=r.n(m),g=r(6814),f=r(5572);const y=e=>e,E=(0,g.createSelector)(y,(e=>e.get("showDefinitions"))),v=(0,g.createSelector)(y,(()=>e=>{var t;let{specSelectors:r}=e,n=r.securityDefinitions()||(0,f.Map)({}),a=(0,f.List)();return s()(t=n.entrySeq()).call(t,(e=>{let[t,r]=e,n=(0,f.Map)();n=n.set(t,r),a=a.push(n)})),a})),S=(e,t)=>e=>{var r;let{specSelectors:n}=e;console.warn("WARNING: getDefinitionsByNames is deprecated and will be removed in the next major version.");let a=n.securityDefinitions(),o=(0,f.List)();return s()(r=t.valueSeq()).call(r,(e=>{var t;let r=(0,f.Map)();s()(t=e.entrySeq()).call(t,(e=>{let t,[n,o]=e,l=a.get(n);var i;"oauth2"===l.get("type")&&o.size&&(t=l.get("scopes"),s()(i=t.keySeq()).call(i,(e=>{o.contains(e)||(t=t.delete(e))})),l=l.set("allowedScopes",t));r=r.set(n,l)})),o=o.push(r)})),o},C=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,f.List)();return e=>{let{authSelectors:r}=e;const n=r.definitionsToAuthorize()||(0,f.List)();return o()(n).call(n,(e=>i()(t).call(t,(t=>t.get(e.keySeq().first())))))}},b=(0,g.createSelector)(y,(e=>e.get("authorized")||(0,f.Map)())),x=(e,t)=>e=>{var r;let{authSelectors:n}=e,s=n.authorized();return f.List.isList(t)?!!o()(r=t.toJS()).call(r,(e=>{var t,r;return-1===u()(t=d()(r=h()(e)).call(r,(e=>!!s.get(e)))).call(t,!1)})).length:null},w=(0,g.createSelector)(y,(e=>e.get("configs")))},8302:(e,t,r)=>{"use strict";r.r(t),r.d(t,{execute:()=>n});const n=(e,t)=>{let{authSelectors:r,specSelectors:n}=t;return t=>{let{path:s,method:a,operation:o,extras:l}=t,i={authorized:r.authorized()&&r.authorized().toJS(),definitions:n.securityDefinitions()&&n.securityDefinitions().toJS(),specSecurity:n.security()&&n.security().toJS()};return e({path:s,method:a,operation:o,securities:i,...l})}}},714:(e,t,r)=>{"use strict";r.r(t),r.d(t,{UPDATE_CONFIGS:()=>n,TOGGLE_CONFIGS:()=>s,update:()=>a,toggle:()=>o,loaded:()=>l});const n="configs_update",s="configs_toggle";function a(e,t){return{type:n,payload:{[e]:t}}}function o(e){return{type:s,payload:e}}const l=()=>e=>{let{getConfigs:t,authActions:r}=e;if(t().persistAuthorization){const e=localStorage.getItem("authorized");e&&r.restoreAuthorization({authorized:JSON.parse(e)})}}},2256:(e,t,r)=>{"use strict";r.r(t),r.d(t,{parseYamlConfig:()=>a});var n=r(9793),s=r.n(n);const a=(e,t)=>{try{return s().load(e)}catch(e){return t&&t.errActions.newThrownErr(new Error(e)),{}}}},1661:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>u});var n=r(5163),s=r(2256),a=r(714),o=r(2698),l=r(9018),i=r(7743);const c={getLocalConfig:()=>(0,s.parseYamlConfig)(n)};function u(){return{statePlugins:{spec:{actions:o,selectors:c},configs:{reducers:i.default,actions:a,selectors:l}}}}},7743:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>a});var n=r(5572),s=r(714);const a={[s.UPDATE_CONFIGS]:(e,t)=>e.merge((0,n.fromJS)(t.payload)),[s.TOGGLE_CONFIGS]:(e,t)=>{const r=t.payload,n=e.get(r);return e.set(r,!n)}}},9018:(e,t,r)=>{"use strict";r.r(t),r.d(t,{get:()=>a});var n=r(7104),s=r.n(n);const a=(e,t)=>e.getIn(s()(t)?t:[t])},2698:(e,t,r)=>{"use strict";r.r(t),r.d(t,{downloadConfig:()=>s,getConfigByUrl:()=>a});var n=r(2256);const s=e=>t=>{const{fn:{fetch:r}}=t;return r(e)},a=(e,t)=>r=>{let{specActions:s}=r;if(e)return s.downloadConfig(e).then(a,a);function a(r){r instanceof Error||r.status>=400?(s.updateLoadingStatus("failedConfig"),s.updateLoadingStatus("failedConfig"),s.updateUrl(""),console.error(r.statusText+" "+e.url),t(null)):t((0,n.parseYamlConfig)(r.text))}}},1970:(e,t,r)=>{"use strict";r.r(t),r.d(t,{setHash:()=>n});const n=e=>e?history.pushState(null,null,`#${e}`):window.location.hash=""},4980:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>o});var n=r(2179),s=r(877),a=r(4584);function o(){return[n.default,{statePlugins:{configs:{wrapActions:{loaded:(e,t)=>function(){e(...arguments);const r=decodeURIComponent(window.location.hash);t.layoutActions.parseDeepLinkHash(r)}}}},wrapComponents:{operation:s.default,OperationTag:a.default}}]}},2179:(e,t,r)=>{"use strict";r.r(t),r.d(t,{clearScrollTo:()=>w,default:()=>_,parseDeepLinkHash:()=>C,readyToScroll:()=>b,scrollTo:()=>S,scrollToElement:()=>x,show:()=>v});var n=r(7104),s=r.n(n),a=r(600),o=r.n(a),l=r(3942),i=r.n(l),c=r(8493),u=r.n(c),p=r(1970);const d=require("zenscroll");var m=r.n(d),h=r(1890),g=r(5572),f=r.n(g);const y="layout_scroll_to",E="layout_clear_scroll",v=(e,t)=>{let{getConfigs:r,layoutSelectors:n}=t;return function(){for(var t=arguments.length,a=new Array(t),o=0;o<t;o++)a[o]=arguments[o];if(e(...a),r().deepLinking)try{let[e,t]=a;e=s()(e)?e:[e];const r=n.urlHashArrayFromIsShownKey(e);if(!r.length)return;const[o,l]=r;if(!t)return(0,p.setHash)("/");2===r.length?(0,p.setHash)((0,h.oJ)(`/${encodeURIComponent(o)}/${encodeURIComponent(l)}`)):1===r.length&&(0,p.setHash)((0,h.oJ)(`/${encodeURIComponent(o)}`))}catch(e){console.error(e)}}},S=e=>({type:y,payload:s()(e)?e:[e]}),C=e=>t=>{let{layoutActions:r,layoutSelectors:n,getConfigs:s}=t;if(s().deepLinking&&e){var a;let t=o()(e).call(e,1);"!"===t[0]&&(t=o()(t).call(t,1)),"/"===t[0]&&(t=o()(t).call(t,1));const s=i()(a=t.split("/")).call(a,(e=>e||"")),l=n.isShownKeyFromUrlHashArray(s),[c,p="",d=""]=l;if("operations"===c){const e=n.isShownKeyFromUrlHashArray([p]);u()(p).call(p,"_")>-1&&(console.warn("Warning: escaping deep link whitespace with `_` will be unsupported in v4.0, use `%20` instead."),r.show(i()(e).call(e,(e=>e.replace(/_/g," "))),!0)),r.show(e,!0)}(u()(p).call(p,"_")>-1||u()(d).call(d,"_")>-1)&&(console.warn("Warning: escaping deep link whitespace with `_` will be unsupported in v4.0, use `%20` instead."),r.show(i()(l).call(l,(e=>e.replace(/_/g," "))),!0)),r.show(l,!0),r.scrollTo(l)}},b=(e,t)=>r=>{const n=r.layoutSelectors.getScrollToKey();f().is(n,(0,g.fromJS)(e))&&(r.layoutActions.scrollToElement(t),r.layoutActions.clearScrollTo())},x=(e,t)=>r=>{try{t=t||r.fn.getScrollParent(e),m().createScroller(t).to(e)}catch(e){console.error(e)}},w=()=>({type:E});const _={fn:{getScrollParent:function(e,t){const r=document.documentElement;let n=getComputedStyle(e);const s="absolute"===n.position,a=t?/(auto|scroll|hidden)/:/(auto|scroll)/;if("fixed"===n.position)return r;for(let t=e;t=t.parentElement;)if(n=getComputedStyle(t),(!s||"static"!==n.position)&&a.test(n.overflow+n.overflowY+n.overflowX))return t;return r}},statePlugins:{layout:{actions:{scrollToElement:x,scrollTo:S,clearScrollTo:w,readyToScroll:b,parseDeepLinkHash:C},selectors:{getScrollToKey:e=>e.get("scrollToKey"),isShownKeyFromUrlHashArray(e,t){const[r,n]=t;return n?["operations",r,n]:r?["operations-tag",r]:[]},urlHashArrayFromIsShownKey(e,t){let[r,n,s]=t;return"operations"==r?[n,s]:"operations-tag"==r?[n]:[]}},reducers:{[y]:(e,t)=>e.set("scrollToKey",f().fromJS(t.payload)),[E]:e=>e.delete("scrollToKey")},wrapActions:{show:v}}}}},4584:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>l});var n=r(1093),s=r.n(n),a=r(6689),o=r.n(a);r(580);const l=(e,t)=>class extends o().Component{constructor(){super(...arguments),s()(this,"onLoad",(e=>{const{tag:r}=this.props,n=["operations-tag",r];t.layoutActions.readyToScroll(n,e)}))}render(){return o().createElement("span",{ref:this.onLoad},o().createElement(e,this.props))}}},877:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>l});var n=r(1093),s=r.n(n),a=r(6689),o=r.n(a);r(8082);const l=(e,t)=>class extends o().Component{constructor(){super(...arguments),s()(this,"onLoad",(e=>{const{operation:r}=this.props,{tag:n,operationId:s}=r.toObject();let{isShownKey:a}=r.toObject();a=a||["operations",n,s],t.layoutActions.readyToScroll(a,e)}))}render(){return o().createElement("span",{ref:this.onLoad},o().createElement(e,this.props))}}},8011:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>h});var n=r(4994),s=r.n(n),a=r(9478),o=r.n(a),l=r(8493),i=r.n(l),c=r(8344),u=r.n(c),p=r(6814),d=r(5572),m=r(7504);function h(e){let{fn:t}=e;return{statePlugins:{spec:{actions:{download:e=>r=>{let{errActions:n,specSelectors:a,specActions:l,getConfigs:i}=r,{fetch:c}=t;const u=i();function p(t){if(t instanceof Error||t.status>=400)return l.updateLoadingStatus("failed"),n.newThrownErr(s()(new Error((t.message||t.statusText)+" "+e),{source:"fetch"})),void(!t.status&&t instanceof Error&&function(){try{let t;if("URL"in m.Z?t=new(o())(e):(t=document.createElement("a"),t.href=e),"https:"!==t.protocol&&"https:"===m.Z.location.protocol){const e=s()(new Error(`Possible mixed-content issue? The page was loaded over https:// but a ${t.protocol}// URL was specified. Check that you are not attempting to load mixed content.`),{source:"fetch"});return void n.newThrownErr(e)}if(t.origin!==m.Z.location.origin){const e=s()(new Error(`Possible cross-origin (CORS) issue? The URL origin (${t.origin}) does not match the page (${m.Z.location.origin}). Check the server returns the correct 'Access-Control-Allow-*' headers.`),{source:"fetch"});n.newThrownErr(e)}}catch(e){return}}());l.updateLoadingStatus("success"),l.updateSpec(t.text),a.url()!==e&&l.updateUrl(e)}e=e||a.url(),l.updateLoadingStatus("loading"),n.clear({source:"fetch"}),c({url:e,loadSpec:!0,requestInterceptor:u.requestInterceptor||(e=>e),responseInterceptor:u.responseInterceptor||(e=>e),credentials:"same-origin",headers:{Accept:"application/json,*/*"}}).then(p,p)},updateLoadingStatus:e=>{let t=[null,"loading","failed","success","failedConfig"];return-1===i()(t).call(t,e)&&console.error(`Error: ${e} is not one of ${u()(t)}`),{type:"spec_update_loading_status",payload:e}}},reducers:{spec_update_loading_status:(e,t)=>"string"==typeof t.payload?e.set("loadingStatus",t.payload):e},selectors:{loadingStatus:(0,p.createSelector)((e=>e||(0,d.Map)()),(e=>e.get("loadingStatus")||null))}}}}}},4966:(e,t,r)=>{"use strict";r.r(t),r.d(t,{NEW_THROWN_ERR:()=>s,NEW_THROWN_ERR_BATCH:()=>a,NEW_SPEC_ERR:()=>o,NEW_SPEC_ERR_BATCH:()=>l,NEW_AUTH_ERR:()=>i,CLEAR:()=>c,CLEAR_BY:()=>u,newThrownErr:()=>p,newThrownErrBatch:()=>d,newSpecErr:()=>m,newSpecErrBatch:()=>h,newAuthErr:()=>g,clear:()=>f,clearBy:()=>y});var n=r(41);const s="err_new_thrown_err",a="err_new_thrown_err_batch",o="err_new_spec_err",l="err_new_spec_err_batch",i="err_new_auth_err",c="err_clear",u="err_clear_by";function p(e){return{type:s,payload:(0,n.serializeError)(e)}}function d(e){return{type:a,payload:e}}function m(e){return{type:o,payload:e}}function h(e){return{type:l,payload:e}}function g(e){return{type:i,payload:e}}function f(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{type:c,payload:e}}function y(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:()=>!0;return{type:u,payload:e}}},2860:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>u});var n=r(9998),s=r.n(n),a=r(3942),o=r.n(a);const l=require("lodash/reduce");var i=r.n(l);const c=[r(2392),r(1835)];function u(e){var t;let r={jsSpec:{}},n=i()(c,((e,t)=>{try{let n=t.transform(e,r);return s()(n).call(n,(e=>!!e))}catch(t){return console.error("Transformer error:",t),e}}),e);return o()(t=s()(n).call(n,(e=>!!e))).call(t,(e=>(!e.get("line")&&e.get("path"),e)))}},2392:(e,t,r)=>{"use strict";r.r(t),r.d(t,{transform:()=>p});var n=r(3942),s=r.n(n),a=r(8493),o=r.n(a),l=r(600),i=r.n(l),c=r(66),u=r.n(c);function p(e){return s()(e).call(e,(e=>{var t;let r="is not of a type(s)",n=o()(t=e.get("message")).call(t,r);if(n>-1){var s,a;let t=i()(s=e.get("message")).call(s,n+r.length).split(",");return e.set("message",i()(a=e.get("message")).call(a,0,n)+function(e){return u()(e).call(e,((e,t,r,n)=>r===n.length-1&&n.length>1?e+"or "+t:n[r+1]&&n.length>2?e+t+", ":n[r+1]?e+t+" ":e+t),"should be a")}(t))}return e}))}},1835:(e,t,r)=>{"use strict";r.r(t),r.d(t,{transform:()=>n});r(3942),r(8493),r(1712),r(5572);function n(e,t){let{jsSpec:r}=t;return e}},7793:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>o});var n=r(3527),s=r(4966),a=r(7667);function o(e){return{statePlugins:{err:{reducers:(0,n.default)(e),actions:s,selectors:a}}}}},3527:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>y});var n=r(4994),s=r.n(n),a=r(3942),o=r.n(a),l=r(4883),i=r.n(l),c=r(9998),u=r.n(c),p=r(7834),d=r.n(p),m=r(4966),h=r(5572),g=r(2860);let f={line:0,level:"error",message:"Unknown error"};function y(){return{[m.NEW_THROWN_ERR]:(e,t)=>{let{payload:r}=t,n=s()(f,r,{type:"thrown"});return e.update("errors",(e=>(e||(0,h.List)()).push((0,h.fromJS)(n)))).update("errors",(e=>(0,g.default)(e)))},[m.NEW_THROWN_ERR_BATCH]:(e,t)=>{let{payload:r}=t;return r=o()(r).call(r,(e=>(0,h.fromJS)(s()(f,e,{type:"thrown"})))),e.update("errors",(e=>{var t;return i()(t=e||(0,h.List)()).call(t,(0,h.fromJS)(r))})).update("errors",(e=>(0,g.default)(e)))},[m.NEW_SPEC_ERR]:(e,t)=>{let{payload:r}=t,n=(0,h.fromJS)(r);return n=n.set("type","spec"),e.update("errors",(e=>(e||(0,h.List)()).push((0,h.fromJS)(n)).sortBy((e=>e.get("line"))))).update("errors",(e=>(0,g.default)(e)))},[m.NEW_SPEC_ERR_BATCH]:(e,t)=>{let{payload:r}=t;return r=o()(r).call(r,(e=>(0,h.fromJS)(s()(f,e,{type:"spec"})))),e.update("errors",(e=>{var t;return i()(t=e||(0,h.List)()).call(t,(0,h.fromJS)(r))})).update("errors",(e=>(0,g.default)(e)))},[m.NEW_AUTH_ERR]:(e,t)=>{let{payload:r}=t,n=(0,h.fromJS)(s()({},r));return n=n.set("type","auth"),e.update("errors",(e=>(e||(0,h.List)()).push((0,h.fromJS)(n)))).update("errors",(e=>(0,g.default)(e)))},[m.CLEAR]:(e,t)=>{var r;let{payload:n}=t;if(!n||!e.get("errors"))return e;let s=u()(r=e.get("errors")).call(r,(e=>{var t;return d()(t=e.keySeq()).call(t,(t=>{const r=e.get(t),s=n[t];return!s||r!==s}))}));return e.merge({errors:s})},[m.CLEAR_BY]:(e,t)=>{var r;let{payload:n}=t;if(!n||"function"!=typeof n)return e;let s=u()(r=e.get("errors")).call(r,(e=>n(e)));return e.merge({errors:s})}}}},7667:(e,t,r)=>{"use strict";r.r(t),r.d(t,{allErrors:()=>a,lastError:()=>o});var n=r(5572),s=r(6814);const a=(0,s.createSelector)((e=>e),(e=>e.get("errors",(0,n.List)()))),o=(0,s.createSelector)(a,(e=>e.last()))},9978:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>s});var n=r(4309);function s(){return{fn:{opsFilter:n.default}}}},4309:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>l});var n=r(9998),s=r.n(n),a=r(8493),o=r.n(a);function l(e,t){return s()(e).call(e,((e,r)=>-1!==o()(r).call(r,t)))}},5474:(e,t,r)=>{"use strict";r.r(t),r.d(t,{UPDATE_LAYOUT:()=>s,UPDATE_FILTER:()=>a,UPDATE_MODE:()=>o,SHOW:()=>l,updateLayout:()=>i,updateFilter:()=>c,show:()=>u,changeMode:()=>p});var n=r(1890);const s="layout_update_layout",a="layout_update_filter",o="layout_update_mode",l="layout_show";function i(e){return{type:s,payload:e}}function c(e){return{type:a,payload:e}}function u(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e=(0,n.AF)(e),{type:l,payload:{thing:e,shown:t}}}function p(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e=(0,n.AF)(e),{type:o,payload:{thing:e,mode:t}}}},6821:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>l});var n=r(5672),s=r(5474),a=r(4400),o=r(8989);function l(){return{statePlugins:{layout:{reducers:n.default,actions:s,selectors:a},spec:{wrapSelectors:o}}}}},5672:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>l});var n=r(4883),s=r.n(n),a=r(5572),o=r(5474);const l={[o.UPDATE_LAYOUT]:(e,t)=>e.set("layout",t.payload),[o.UPDATE_FILTER]:(e,t)=>e.set("filter",t.payload),[o.SHOW]:(e,t)=>{const r=t.payload.shown,n=(0,a.fromJS)(t.payload.thing);return e.update("shown",(0,a.fromJS)({}),(e=>e.set(n,r)))},[o.UPDATE_MODE]:(e,t)=>{var r;let n=t.payload.thing,a=t.payload.mode;return e.setIn(s()(r=["modes"]).call(r,n),(a||"")+"")}}},4400:(e,t,r)=>{"use strict";r.r(t),r.d(t,{current:()=>o,currentFilter:()=>l,isShown:()=>i,whatMode:()=>c,showSummary:()=>u});var n=r(6814),s=r(1890),a=r(5572);const o=e=>e.get("layout"),l=e=>e.get("filter"),i=(e,t,r)=>(t=(0,s.AF)(t),e.get("shown",(0,a.fromJS)({})).get((0,a.fromJS)(t),r)),c=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return t=(0,s.AF)(t),e.getIn(["modes",...t],r)},u=(0,n.createSelector)((e=>e),(e=>!i(e,"editor")))},8989:(e,t,r)=>{"use strict";r.r(t),r.d(t,{taggedOperations:()=>a});var n=r(600),s=r.n(n);const a=(e,t)=>function(r){for(var n=arguments.length,a=new Array(n>1?n-1:0),o=1;o<n;o++)a[o-1]=arguments[o];let l=e(r,...a);const{fn:i,layoutSelectors:c,getConfigs:u}=t.getSystem(),p=u(),{maxDisplayedTags:d}=p;let m=c.currentFilter();return m&&!0!==m&&"true"!==m&&"false"!==m&&(l=i.opsFilter(l,m)),d&&!isNaN(d)&&d>=0&&(l=s()(l).call(l,0,d)),l}},9150:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>a});var n=r(593),s=r.n(n);function a(e){let{configs:t}=e;const r={debug:0,info:1,log:2,warn:3,error:4},n=e=>r[e]||-1;let{logLevel:a}=t,o=n(a);function l(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),s=1;s<t;s++)r[s-1]=arguments[s];n(e)>=o&&console[e](...r)}return l.warn=s()(l).call(l,null,"warn"),l.error=s()(l).call(l,null,"error"),l.info=s()(l).call(l,null,"info"),l.debug=s()(l).call(l,null,"debug"),{rootInjects:{log:l}}}},7002:(e,t,r)=>{"use strict";r.r(t),r.d(t,{UPDATE_SELECTED_SERVER:()=>n,UPDATE_REQUEST_BODY_VALUE:()=>s,UPDATE_REQUEST_BODY_VALUE_RETAIN_FLAG:()=>a,UPDATE_REQUEST_BODY_INCLUSION:()=>o,UPDATE_ACTIVE_EXAMPLES_MEMBER:()=>l,UPDATE_REQUEST_CONTENT_TYPE:()=>i,UPDATE_RESPONSE_CONTENT_TYPE:()=>c,UPDATE_SERVER_VARIABLE_VALUE:()=>u,SET_REQUEST_BODY_VALIDATE_ERROR:()=>p,CLEAR_REQUEST_BODY_VALIDATE_ERROR:()=>d,CLEAR_REQUEST_BODY_VALUE:()=>m,setSelectedServer:()=>h,setRequestBodyValue:()=>g,setRetainRequestBodyValueFlag:()=>f,setRequestBodyInclusion:()=>y,setActiveExamplesMember:()=>E,setRequestContentType:()=>v,setResponseContentType:()=>S,setServerVariableValue:()=>C,setRequestBodyValidateError:()=>b,clearRequestBodyValidateError:()=>x,initRequestBodyValidateError:()=>w,clearRequestBodyValue:()=>_});const n="oas3_set_servers",s="oas3_set_request_body_value",a="oas3_set_request_body_retain_flag",o="oas3_set_request_body_inclusion",l="oas3_set_active_examples_member",i="oas3_set_request_content_type",c="oas3_set_response_content_type",u="oas3_set_server_variable_value",p="oas3_set_request_body_validate_error",d="oas3_clear_request_body_validate_error",m="oas3_clear_request_body_value";function h(e,t){return{type:n,payload:{selectedServerUrl:e,namespace:t}}}function g(e){let{value:t,pathMethod:r}=e;return{type:s,payload:{value:t,pathMethod:r}}}const f=e=>{let{value:t,pathMethod:r}=e;return{type:a,payload:{value:t,pathMethod:r}}};function y(e){let{value:t,pathMethod:r,name:n}=e;return{type:o,payload:{value:t,pathMethod:r,name:n}}}function E(e){let{name:t,pathMethod:r,contextType:n,contextName:s}=e;return{type:l,payload:{name:t,pathMethod:r,contextType:n,contextName:s}}}function v(e){let{value:t,pathMethod:r}=e;return{type:i,payload:{value:t,pathMethod:r}}}function S(e){let{value:t,path:r,method:n}=e;return{type:c,payload:{value:t,path:r,method:n}}}function C(e){let{server:t,namespace:r,key:n,val:s}=e;return{type:u,payload:{server:t,namespace:r,key:n,val:s}}}const b=e=>{let{path:t,method:r,validationErrors:n}=e;return{type:p,payload:{path:t,method:r,validationErrors:n}}},x=e=>{let{path:t,method:r}=e;return{type:d,payload:{path:t,method:r}}},w=e=>{let{pathMethod:t}=e;return{type:d,payload:{path:t[0],method:t[1]}}},_=e=>{let{pathMethod:t}=e;return{type:m,payload:{pathMethod:t}}}},3723:(e,t,r)=>{"use strict";r.r(t),r.d(t,{definitionsToAuthorize:()=>d});var n=r(4235),s=r.n(n),a=r(9998),o=r.n(a),l=r(66),i=r.n(l),c=r(6814),u=r(5572),p=r(7779);const d=(m=(0,c.createSelector)((e=>e),(e=>{let{specSelectors:t}=e;return t.securityDefinitions()}),((e,t)=>{var r;let n=(0,u.List)();return t?(s()(r=t.entrySeq()).call(r,(e=>{let[t,r]=e;const a=r.get("type");var l;if("oauth2"===a&&s()(l=r.get("flows").entrySeq()).call(l,(e=>{let[s,a]=e,l=(0,u.fromJS)({flow:s,authorizationUrl:a.get("authorizationUrl"),tokenUrl:a.get("tokenUrl"),scopes:a.get("scopes"),type:r.get("type"),description:r.get("description")});n=n.push(new u.Map({[t]:o()(l).call(l,(e=>void 0!==e))}))})),"http"!==a&&"apiKey"!==a||(n=n.push(new u.Map({[t]:r}))),"openIdConnect"===a&&r.get("openIdConnectData")){let e=r.get("openIdConnectData"),a=e.get("grant_types_supported")||["authorization_code","implicit"];s()(a).call(a,(s=>{var a;let l=e.get("scopes_supported")&&i()(a=e.get("scopes_supported")).call(a,((e,t)=>e.set(t,"")),new u.Map),c=(0,u.fromJS)({flow:s,authorizationUrl:e.get("authorization_endpoint"),tokenUrl:e.get("token_endpoint"),scopes:l,type:"oauth2",openIdConnectUrl:r.get("openIdConnectUrl")});n=n.push(new u.Map({[t]:o()(c).call(c,(e=>void 0!==e))}))}))}})),n):n})),(e,t)=>function(){const r=t.getSystem().specSelectors.specJson();for(var n=arguments.length,s=new Array(n),a=0;a<n;a++)s[a]=arguments[a];if((0,p.isOAS3)(r)){let e=t.getState().getIn(["spec","resolvedSubtrees","components","securitySchemes"]);return m(t,e,...s)}return e(...s)});var m},3427:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>u});var n=r(4250),s=r.n(n),a=r(3942),o=r.n(a),l=r(6689),i=r.n(l),c=(r(580),r(8082),r(5572));const u=e=>{var t;let{callbacks:r,getComponent:n,specPath:a}=e;const l=n("OperationContainer",!0);if(!r)return i().createElement("span",null,"No callbacks");let u=o()(t=r.entrySeq()).call(t,(t=>{var r;let[n,u]=t;return i().createElement("div",{key:n},i().createElement("h2",null,n),o()(r=u.entrySeq()).call(r,(t=>{var r;let[u,p]=t;return"$$ref"===u?null:i().createElement("div",{key:u},o()(r=p.entrySeq()).call(r,(t=>{let[r,o]=t;if("$$ref"===r)return null;let p=(0,c.fromJS)({operation:o});return i().createElement(l,s()({},e,{op:p,key:r,tag:"",method:r,path:u,specPath:a.push(n,u,r),allowTryItOut:!1}))})))})))}));return i().createElement("div",null,u)}},6775:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>m});var n=r(1093),s=r.n(n),a=r(4994),o=r.n(a),l=r(9998),i=r.n(l),c=r(3942),u=r.n(c),p=r(6689),d=r.n(p);r(580);class m extends d().Component{constructor(e,t){super(e,t),s()(this,"onChange",(e=>{let{onChange:t}=this.props,{value:r,name:n}=e.target,s=o()({},this.state.value);n?s[n]=r:s=r,this.setState({value:s},(()=>t(this.state)))}));let{name:r,schema:n}=this.props,a=this.getValue();this.state={name:r,schema:n,value:a}}getValue(){let{name:e,authorized:t}=this.props;return t&&t.getIn([e,"value"])}render(){var e;let{schema:t,getComponent:r,errSelectors:n,name:s}=this.props;const a=r("Input"),o=r("Row"),l=r("Col"),c=r("authError"),p=r("Markdown",!0),m=r("JumpToPath",!0),h=(t.get("scheme")||"").toLowerCase();let g=this.getValue(),f=i()(e=n.allErrors()).call(e,(e=>e.get("authId")===s));if("basic"===h){var y;let e=g?g.get("username"):null;return d().createElement("div",null,d().createElement("h4",null,d().createElement("code",null,s||t.get("name")),"  (http, Basic)",d().createElement(m,{path:["securityDefinitions",s]})),e&&d().createElement("h6",null,"Authorized"),d().createElement(o,null,d().createElement(p,{source:t.get("description")})),d().createElement(o,null,d().createElement("label",null,"Username:"),e?d().createElement("code",null," ",e," "):d().createElement(l,null,d().createElement(a,{type:"text",required:"required",name:"username","aria-label":"auth-basic-username",onChange:this.onChange,autoFocus:!0}))),d().createElement(o,null,d().createElement("label",null,"Password:"),e?d().createElement("code",null," ****** "):d().createElement(l,null,d().createElement(a,{autoComplete:"new-password",name:"password",type:"password","aria-label":"auth-basic-password",onChange:this.onChange}))),u()(y=f.valueSeq()).call(y,((e,t)=>d().createElement(c,{error:e,key:t}))))}var E;return"bearer"===h?d().createElement("div",null,d().createElement("h4",null,d().createElement("code",null,s||t.get("name")),"  (http, Bearer)",d().createElement(m,{path:["securityDefinitions",s]})),g&&d().createElement("h6",null,"Authorized"),d().createElement(o,null,d().createElement(p,{source:t.get("description")})),d().createElement(o,null,d().createElement("label",null,"Value:"),g?d().createElement("code",null," ****** "):d().createElement(l,null,d().createElement(a,{type:"text","aria-label":"auth-bearer-value",onChange:this.onChange,autoFocus:!0}))),u()(E=f.valueSeq()).call(E,((e,t)=>d().createElement(c,{error:e,key:t})))):d().createElement("div",null,d().createElement("em",null,d().createElement("b",null,s)," HTTP authentication: unsupported scheme ",`'${h}'`))}}},6467:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>p});var n=r(3427),s=r(2458),a=r(5757),o=r(6617),l=r(9928),i=r(5327),c=r(6775),u=r(6796);const p={Callbacks:n.default,HttpAuth:c.default,RequestBody:s.default,Servers:o.default,ServersContainer:l.default,RequestBodyEditor:i.default,OperationServers:u.default,operationLink:a.default}},5757:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>u});var n=r(8344),s=r.n(n),a=r(3942),o=r.n(a),l=r(6689),i=r.n(l);r(580),r(8082);class c extends l.Component{render(){const{link:e,name:t,getComponent:r}=this.props,n=r("Markdown",!0);let a=e.get("operationId")||e.get("operationRef"),l=e.get("parameters")&&e.get("parameters").toJS(),c=e.get("description");return i().createElement("div",{className:"operation-link"},i().createElement("div",{className:"description"},i().createElement("b",null,i().createElement("code",null,t)),c?i().createElement(n,{source:c}):null),i().createElement("pre",null,"Operation `",a,"`",i().createElement("br",null),i().createElement("br",null),"Parameters ",function(e,t){var r;if("string"!=typeof t)return"";return o()(r=t.split("\n")).call(r,((t,r)=>r>0?Array(e+1).join(" ")+t:t)).join("\n")}(0,s()(l,null,2))||"{}",i().createElement("br",null)))}}const u=c},6796:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>l});var n=r(1093),s=r.n(n),a=r(6689),o=r.n(a);r(580),r(8082);class l extends o().Component{constructor(){super(...arguments),s()(this,"setSelectedServer",(e=>{const{path:t,method:r}=this.props;return this.forceUpdate(),this.props.setSelectedServer(e,`${t}:${r}`)})),s()(this,"setServerVariableValue",(e=>{const{path:t,method:r}=this.props;return this.forceUpdate(),this.props.setServerVariableValue({...e,namespace:`${t}:${r}`})})),s()(this,"getSelectedServer",(()=>{const{path:e,method:t}=this.props;return this.props.getSelectedServer(`${e}:${t}`)})),s()(this,"getServerVariable",((e,t)=>{const{path:r,method:n}=this.props;return this.props.getServerVariable({namespace:`${r}:${n}`,server:e},t)})),s()(this,"getEffectiveServerValue",(e=>{const{path:t,method:r}=this.props;return this.props.getEffectiveServerValue({server:e,namespace:`${t}:${r}`})}))}render(){const{operationServers:e,pathServers:t,getComponent:r}=this.props;if(!e&&!t)return null;const n=r("Servers"),s=e||t,a=e?"operation":"path";return o().createElement("div",{className:"opblock-section operation-servers"},o().createElement("div",{className:"opblock-section-header"},o().createElement("div",{className:"tab-header"},o().createElement("h4",{className:"opblock-title"},"Servers"))),o().createElement("div",{className:"opblock-description-wrapper"},o().createElement("h4",{className:"message"},"These ",a,"-level options override the global server options."),o().createElement(n,{servers:s,currentServer:this.getSelectedServer(),setSelectedServer:this.setSelectedServer,setServerVariableValue:this.setServerVariableValue,getServerVariable:this.getServerVariable,getEffectiveServerValue:this.getEffectiveServerValue})))}}},5327:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>p});var n=r(1093),s=r.n(n),a=r(6689),o=r.n(a),l=(r(580),r(9003)),i=r.n(l),c=r(1890);const u=Function.prototype;class p extends a.PureComponent{constructor(e,t){super(e,t),s()(this,"applyDefaultValue",(e=>{const{onChange:t,defaultValue:r}=e||this.props;return this.setState({value:r}),t(r)})),s()(this,"onChange",(e=>{this.props.onChange((0,c.Pz)(e))})),s()(this,"onDomChange",(e=>{const t=e.target.value;this.setState({value:t},(()=>this.onChange(t)))})),this.state={value:(0,c.Pz)(e.value)||e.defaultValue},e.onChange(e.value)}UNSAFE_componentWillReceiveProps(e){this.props.value!==e.value&&e.value!==this.state.value&&this.setState({value:(0,c.Pz)(e.value)}),!e.value&&e.defaultValue&&this.state.value&&this.applyDefaultValue(e)}render(){let{getComponent:e,errors:t}=this.props,{value:r}=this.state,n=t.size>0;const s=e("TextArea");return o().createElement("div",{className:"body-param"},o().createElement(s,{className:i()("body-param__text",{invalid:n}),title:t.size?t.join(", "):"",value:r,onChange:this.onDomChange}))}}s()(p,"defaultProps",{onChange:u,userHasEditedBody:!1})},2458:(e,t,r)=>{"use strict";r.r(t),r.d(t,{getDefaultRequestBodyValue:()=>f,default:()=>y});var n=r(3942),s=r.n(n),a=r(8493),o=r.n(a),l=r(2605),i=r.n(l),c=r(7104),u=r.n(c),p=r(6689),d=r.n(p),m=(r(580),r(8082),r(5572)),h=r(1890),g=r(2518);const f=(e,t,r)=>{const n=e.getIn(["content",t]),s=n.get("schema").toJS(),a=void 0!==n.get("examples"),o=n.get("example"),l=a?n.getIn(["examples",r,"value"]):o,i=(0,h.xi)(s,t,{includeWriteOnly:!0},l);return(0,h.Pz)(i)},y=e=>{let{userHasEditedBody:t,requestBody:r,requestBodyValue:n,requestBodyInclusionSetting:a,requestBodyErrors:l,getComponent:c,getConfigs:p,specSelectors:y,fn:E,contentType:v,isExecute:S,specPath:C,onChange:b,onChangeIncludeEmpty:x,activeExamplesKey:w,updateActiveExamplesKey:_,setRetainRequestBodyValueFlag:A}=e;const I=e=>{b(e.target.files[0])},N=e=>{let t={key:e,shouldDispatchInit:!1,defaultValue:!0};return"no value"===a.get(e,"no value")&&(t.shouldDispatchInit=!0),t},q=c("Markdown",!0),T=c("modelExample"),R=c("RequestBodyEditor"),P=c("highlightCode"),k=c("ExamplesSelectValueRetainer"),O=c("Example"),M=c("ParameterIncludeEmpty"),{showCommonExtensions:j}=p(),V=r&&r.get("description")||null,D=r&&r.get("content")||new m.OrderedMap;v=v||D.keySeq().first()||"";const L=D.get(v,(0,m.OrderedMap)()),U=L.get("schema",(0,m.OrderedMap)()),z=L.get("examples",null),B=null==z?void 0:s()(z).call(z,((e,t)=>{var n;const s=null===(n=e)||void 0===n?void 0:n.get("value",null);return s&&(e=e.set("value",f(r,v,t),s)),e}));if(l=m.List.isList(l)?l:(0,m.List)(),!L.size)return null;const $="object"===L.getIn(["schema","type"]),J="binary"===L.getIn(["schema","format"]),F="base64"===L.getIn(["schema","format"]);if("application/octet-stream"===v||0===o()(v).call(v,"image/")||0===o()(v).call(v,"audio/")||0===o()(v).call(v,"video/")||J||F){const e=c("Input");return S?d().createElement(e,{type:"file",onChange:I}):d().createElement("i",null,"Example values are not available for ",d().createElement("code",null,v)," media types.")}if($&&("application/x-www-form-urlencoded"===v||0===o()(v).call(v,"multipart/"))&&U.get("properties",(0,m.OrderedMap)()).size>0){var W;const e=c("JsonSchemaForm"),t=c("ParameterExt"),r=U.get("properties",(0,m.OrderedMap)());return n=m.Map.isMap(n)?n:(0,m.OrderedMap)(),d().createElement("div",{className:"table-container"},V&&d().createElement(q,{source:V}),d().createElement("table",null,d().createElement("tbody",null,m.Map.isMap(r)&&s()(W=r.entrySeq()).call(W,(r=>{var o,p;let[g,f]=r;if(f.get("readOnly"))return;let y=j?(0,h.po)(f):null;const v=i()(o=U.get("required",(0,m.List)())).call(o,g),C=f.get("type"),w=f.get("format"),_=f.get("description"),A=n.getIn([g,"value"]),I=n.getIn([g,"errors"])||l,T=a.get(g)||!1,R=f.has("default")||f.has("example")||f.hasIn(["items","example"])||f.hasIn(["items","default"]),P=f.has("enum")&&(1===f.get("enum").size||v),k=R||P;let O="";"array"!==C||k||(O=[]),("object"===C||k)&&(O=(0,h.xi)(f,!1,{includeWriteOnly:!0})),"string"!=typeof O&&"object"===C&&(O=(0,h.Pz)(O)),"string"==typeof O&&"array"===C&&(O=JSON.parse(O));const V="string"===C&&("binary"===w||"base64"===w);return d().createElement("tr",{key:g,className:"parameters","data-property-name":g},d().createElement("td",{className:"parameters-col_name"},d().createElement("div",{className:v?"parameter__name required":"parameter__name"},g,v?d().createElement("span",null," *"):null),d().createElement("div",{className:"parameter__type"},C,w&&d().createElement("span",{className:"prop-format"},"($",w,")"),j&&y.size?s()(p=y.entrySeq()).call(p,(e=>{let[r,n]=e;return d().createElement(t,{key:`${r}-${n}`,xKey:r,xVal:n})})):null),d().createElement("div",{className:"parameter__deprecated"},f.get("deprecated")?"deprecated":null)),d().createElement("td",{className:"parameters-col_description"},d().createElement(q,{source:_}),S?d().createElement("div",null,d().createElement(e,{fn:E,dispatchInitialValue:!V,schema:f,description:g,getComponent:c,value:void 0===A?O:A,required:v,errors:I,onChange:e=>{b(e,[g])}}),v?null:d().createElement(M,{onChange:e=>x(g,e),isIncluded:T,isIncludedOptions:N(g),isDisabled:u()(A)?0!==A.length:!(0,h.O2)(A)})):null))})))))}const H=f(r,v,w);let K=null;return(0,g.O)(H)&&(K="json"),d().createElement("div",null,V&&d().createElement(q,{source:V}),B?d().createElement(k,{userHasEditedBody:t,examples:B,currentKey:w,currentUserInputValue:n,onSelect:e=>{_(e)},updateValue:b,defaultToFirstExample:!0,getComponent:c,setRetainRequestBodyValueFlag:A}):null,S?d().createElement("div",null,d().createElement(R,{value:n,errors:l,defaultValue:H,onChange:b,getComponent:c})):d().createElement(T,{getComponent:c,getConfigs:p,specSelectors:y,expandDepth:1,isExecute:S,schema:L.get("schema"),specPath:C.push("content",v),example:d().createElement(P,{className:"body-param__example",getConfigs:p,language:K,value:(0,h.Pz)(n)||H}),includeWriteOnly:!0}),B?d().createElement(O,{example:B.get(w),getComponent:c,getConfigs:p}):null)}},9928:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>a});var n=r(6689),s=r.n(n);r(580);class a extends s().Component{render(){const{specSelectors:e,oas3Selectors:t,oas3Actions:r,getComponent:n}=this.props,a=e.servers(),o=n("Servers");return a&&a.size?s().createElement("div",null,s().createElement("span",{className:"servers-title"},"Servers"),s().createElement(o,{servers:a,currentServer:t.selectedServer(),setSelectedServer:r.setSelectedServer,setServerVariableValue:r.setServerVariableValue,getServerVariable:t.serverVariableValue,getEffectiveServerValue:t.serverEffectiveValue})):null}}},6617:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>d});var n=r(1093),s=r.n(n),a=r(3580),o=r.n(a),l=r(3942),i=r.n(l),c=r(6689),u=r.n(c),p=r(5572);r(580),r(8082);class d extends u().Component{constructor(){super(...arguments),s()(this,"onServerChange",(e=>{this.setServer(e.target.value)})),s()(this,"onServerVariableValueChange",(e=>{let{setServerVariableValue:t,currentServer:r}=this.props,n=e.target.getAttribute("data-variable"),s=e.target.value;"function"==typeof t&&t({server:r,key:n,val:s})})),s()(this,"setServer",(e=>{let{setSelectedServer:t}=this.props;t(e)}))}componentDidMount(){var e;let{servers:t,currentServer:r}=this.props;r||this.setServer(null===(e=t.first())||void 0===e?void 0:e.get("url"))}UNSAFE_componentWillReceiveProps(e){let{servers:t,setServerVariableValue:r,getServerVariable:n}=e;if(this.props.currentServer!==e.currentServer||this.props.servers!==e.servers){var s;let a=o()(t).call(t,(t=>t.get("url")===e.currentServer)),l=o()(s=this.props.servers).call(s,(e=>e.get("url")===this.props.currentServer))||(0,p.OrderedMap)();if(!a)return this.setServer(t.first().get("url"));let c=l.get("variables")||(0,p.OrderedMap)(),u=(o()(c).call(c,(e=>e.get("default")))||(0,p.OrderedMap)()).get("default"),d=a.get("variables")||(0,p.OrderedMap)(),m=(o()(d).call(d,(e=>e.get("default")))||(0,p.OrderedMap)()).get("default");i()(d).call(d,((t,s)=>{n(e.currentServer,s)&&u===m||r({server:e.currentServer,key:s,val:t.get("default")||""})}))}}render(){var e,t;let{servers:r,currentServer:n,getServerVariable:s,getEffectiveServerValue:a}=this.props,l=(o()(r).call(r,(e=>e.get("url")===n))||(0,p.OrderedMap)()).get("variables")||(0,p.OrderedMap)(),c=0!==l.size;return u().createElement("div",{className:"servers"},u().createElement("label",{htmlFor:"servers"},u().createElement("select",{onChange:this.onServerChange,value:n},i()(e=r.valueSeq()).call(e,(e=>u().createElement("option",{value:e.get("url"),key:e.get("url")},e.get("url"),e.get("description")&&` - ${e.get("description")}`))).toArray())),c?u().createElement("div",null,u().createElement("div",{className:"computed-url"},"Computed URL:",u().createElement("code",null,a(n))),u().createElement("h4",null,"Server variables"),u().createElement("table",null,u().createElement("tbody",null,i()(t=l.entrySeq()).call(t,(e=>{var t;let[r,a]=e;return u().createElement("tr",{key:r},u().createElement("td",null,r),u().createElement("td",null,a.get("enum")?u().createElement("select",{"data-variable":r,onChange:this.onServerVariableValueChange},i()(t=a.get("enum")).call(t,(e=>u().createElement("option",{selected:e===s(n,r),key:e,value:e},e)))):u().createElement("input",{type:"text",value:s(n,r)||"",onChange:this.onServerVariableValueChange,"data-variable":r})))}))))):null)}}},7779:(e,t,r)=>{"use strict";r.r(t),r.d(t,{isOAS3:()=>c,isSwagger2:()=>u,OAS3ComponentWrapFactory:()=>p});var n=r(4250),s=r.n(n),a=r(3262),o=r.n(a),l=r(6689),i=r.n(l);function c(e){const t=e.get("openapi");return"string"==typeof t&&(o()(t).call(t,"3.0.")&&t.length>4)}function u(e){const t=e.get("swagger");return"string"==typeof t&&o()(t).call(t,"2.0")}function p(e){return(t,r)=>n=>{if(r&&r.specSelectors&&r.specSelectors.specJson){return c(r.specSelectors.specJson())?i().createElement(e,s()({},n,r,{Ori:t})):i().createElement(t,n)}return console.warn("OAS3 wrapper: couldn't get spec"),null}}},7451:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>p});var n=r(2044),s=r(3723),a=r(1741),o=r(6467),l=r(7761),i=r(7002),c=r(5065),u=r(2109);function p(){return{components:o.default,wrapComponents:l.default,statePlugins:{spec:{wrapSelectors:n,selectors:a},auth:{wrapSelectors:s},oas3:{actions:i,reducers:u.default,selectors:c}}}}},2109:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>p});var n=r(874),s=r.n(n),a=r(4235),o=r.n(a),l=r(66),i=r.n(l),c=r(5572),u=r(7002);const p={[u.UPDATE_SELECTED_SERVER]:(e,t)=>{let{payload:{selectedServerUrl:r,namespace:n}}=t;const s=n?[n,"selectedServer"]:["selectedServer"];return e.setIn(s,r)},[u.UPDATE_REQUEST_BODY_VALUE]:(e,t)=>{let{payload:{value:r,pathMethod:n}}=t,[a,l]=n;if(!c.Map.isMap(r))return e.setIn(["requestData",a,l,"bodyValue"],r);let i,u=e.getIn(["requestData",a,l,"bodyValue"])||(0,c.Map)();c.Map.isMap(u)||(u=(0,c.Map)());const[...p]=s()(r).call(r);return o()(p).call(p,(e=>{let t=r.getIn([e]);u.has(e)&&c.Map.isMap(t)||(i=u.setIn([e,"value"],t))})),e.setIn(["requestData",a,l,"bodyValue"],i)},[u.UPDATE_REQUEST_BODY_VALUE_RETAIN_FLAG]:(e,t)=>{let{payload:{value:r,pathMethod:n}}=t,[s,a]=n;return e.setIn(["requestData",s,a,"retainBodyValue"],r)},[u.UPDATE_REQUEST_BODY_INCLUSION]:(e,t)=>{let{payload:{value:r,pathMethod:n,name:s}}=t,[a,o]=n;return e.setIn(["requestData",a,o,"bodyInclusion",s],r)},[u.UPDATE_ACTIVE_EXAMPLES_MEMBER]:(e,t)=>{let{payload:{name:r,pathMethod:n,contextType:s,contextName:a}}=t,[o,l]=n;return e.setIn(["examples",o,l,s,a,"activeExample"],r)},[u.UPDATE_REQUEST_CONTENT_TYPE]:(e,t)=>{let{payload:{value:r,pathMethod:n}}=t,[s,a]=n;return e.setIn(["requestData",s,a,"requestContentType"],r)},[u.UPDATE_RESPONSE_CONTENT_TYPE]:(e,t)=>{let{payload:{value:r,path:n,method:s}}=t;return e.setIn(["requestData",n,s,"responseContentType"],r)},[u.UPDATE_SERVER_VARIABLE_VALUE]:(e,t)=>{let{payload:{server:r,namespace:n,key:s,val:a}}=t;const o=n?[n,"serverVariableValues",r,s]:["serverVariableValues",r,s];return e.setIn(o,a)},[u.SET_REQUEST_BODY_VALIDATE_ERROR]:(e,t)=>{let{payload:{path:r,method:n,validationErrors:s}}=t,a=[];if(a.push("Required field is not provided"),s.missingBodyValue)return e.setIn(["requestData",r,n,"errors"],(0,c.fromJS)(a));if(s.missingRequiredKeys&&s.missingRequiredKeys.length>0){const{missingRequiredKeys:t}=s;return e.updateIn(["requestData",r,n,"bodyValue"],(0,c.fromJS)({}),(e=>i()(t).call(t,((e,t)=>e.setIn([t,"errors"],(0,c.fromJS)(a))),e)))}return console.warn("unexpected result: SET_REQUEST_BODY_VALIDATE_ERROR"),e},[u.CLEAR_REQUEST_BODY_VALIDATE_ERROR]:(e,t)=>{let{payload:{path:r,method:n}}=t;const a=e.getIn(["requestData",r,n,"bodyValue"]);if(!c.Map.isMap(a))return e.setIn(["requestData",r,n,"errors"],(0,c.fromJS)([]));const[...o]=s()(a).call(a);return o?e.updateIn(["requestData",r,n,"bodyValue"],(0,c.fromJS)({}),(e=>i()(o).call(o,((e,t)=>e.setIn([t,"errors"],(0,c.fromJS)([]))),e))):e},[u.CLEAR_REQUEST_BODY_VALUE]:(e,t)=>{let{payload:{pathMethod:r}}=t,[n,s]=r;const a=e.getIn(["requestData",n,s,"bodyValue"]);return a?c.Map.isMap(a)?e.setIn(["requestData",n,s,"bodyValue"],(0,c.Map)()):e.setIn(["requestData",n,s,"bodyValue"],""):e}}},5065:(e,t,r)=>{"use strict";r.r(t),r.d(t,{selectedServer:()=>f,requestBodyValue:()=>y,shouldRetainRequestBodyValue:()=>E,hasUserEditedBody:()=>v,requestBodyInclusionSetting:()=>S,requestBodyErrors:()=>C,activeExamplesMember:()=>b,requestContentType:()=>x,responseContentType:()=>w,serverVariableValue:()=>_,serverVariables:()=>A,serverEffectiveValue:()=>I,validateBeforeExecute:()=>N,validateShallowRequired:()=>T});var n=r(3942),s=r.n(n),a=r(4235),o=r.n(a),l=r(7252),i=r.n(l),c=r(8493),u=r.n(c),p=r(5572),d=r(7779),m=r(2458),h=r(1890);function g(e){return function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return t=>{const n=t.getSystem().specSelectors.specJson();return(0,d.isOAS3)(n)?e(...r):null}}}const f=g(((e,t)=>{const r=t?[t,"selectedServer"]:["selectedServer"];return e.getIn(r)||""})),y=g(((e,t,r)=>e.getIn(["requestData",t,r,"bodyValue"])||null)),E=g(((e,t,r)=>e.getIn(["requestData",t,r,"retainBodyValue"])||!1)),v=(e,t,r)=>e=>{const{oas3Selectors:n,specSelectors:s}=e.getSystem(),a=s.specJson();if((0,d.isOAS3)(a)){let e=!1;const a=n.requestContentType(t,r);let o=n.requestBodyValue(t,r);if(p.Map.isMap(o)&&(o=(0,h.Pz)(o.mapEntries((e=>p.Map.isMap(e[1])?[e[0],e[1].get("value")]:e)).toJS())),p.List.isList(o)&&(o=(0,h.Pz)(o)),a){const l=(0,m.getDefaultRequestBodyValue)(s.specResolvedSubtree(["paths",t,r,"requestBody"]),a,n.activeExamplesMember(t,r,"requestBody","requestBody"));e=!!o&&o!==l}return e}return null},S=g(((e,t,r)=>e.getIn(["requestData",t,r,"bodyInclusion"])||(0,p.Map)())),C=g(((e,t,r)=>e.getIn(["requestData",t,r,"errors"])||null)),b=g(((e,t,r,n,s)=>e.getIn(["examples",t,r,n,s,"activeExample"])||null)),x=g(((e,t,r)=>e.getIn(["requestData",t,r,"requestContentType"])||null)),w=g(((e,t,r)=>e.getIn(["requestData",t,r,"responseContentType"])||null)),_=g(((e,t,r)=>{let n;if("string"!=typeof t){const{server:e,namespace:s}=t;n=s?[s,"serverVariableValues",e,r]:["serverVariableValues",e,r]}else{n=["serverVariableValues",t,r]}return e.getIn(n)||null})),A=g(((e,t)=>{let r;if("string"!=typeof t){const{server:e,namespace:n}=t;r=n?[n,"serverVariableValues",e]:["serverVariableValues",e]}else{r=["serverVariableValues",t]}return e.getIn(r)||(0,p.OrderedMap)()})),I=g(((e,t)=>{var r,n;if("string"!=typeof t){const{server:s,namespace:a}=t;n=s,r=a?e.getIn([a,"serverVariableValues",n]):e.getIn(["serverVariableValues",n])}else n=t,r=e.getIn(["serverVariableValues",n]);r=r||(0,p.OrderedMap)();let a=n;return s()(r).call(r,((e,t)=>{a=a.replace(new RegExp(`{${t}}`,"g"),e)})),a})),N=(q=(e,t)=>((e,t)=>(t=t||[],!!e.getIn(["requestData",...t,"bodyValue"])))(e,t),function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return e=>{const r=e.getSystem().specSelectors.specJson();let n=[...t][1]||[];return!r.getIn(["paths",...n,"requestBody","required"])||q(...t)}});var q;const T=(e,t)=>{var r;let{oas3RequiredRequestBodyContentType:n,oas3RequestContentType:s,oas3RequestBodyValue:a}=t,l=[];if(!p.Map.isMap(a))return l;let c=[];return o()(r=i()(n.requestContentType)).call(r,(e=>{if(e===s){let t=n.requestContentType[e];o()(t).call(t,(e=>{u()(c).call(c,e)<0&&c.push(e)}))}})),o()(c).call(c,(e=>{a.getIn([e,"value"])||l.push(e)})),l}},1741:(e,t,r)=>{"use strict";r.r(t),r.d(t,{servers:()=>c,isSwagger2:()=>p});var n=r(6814),s=r(5572),a=r(7779);const o=e=>e||(0,s.Map)(),l=(0,n.createSelector)(o,(e=>e.get("json",(0,s.Map)()))),i=(0,n.createSelector)(o,(e=>e.get("resolved",(0,s.Map)()))),c=(u=(0,n.createSelector)((e=>{let t=i(e);return t.count()<1&&(t=l(e)),t}),(e=>e.getIn(["servers"])||(0,s.Map)())),()=>function(e){const t=e.getSystem().specSelectors.specJson();if((0,a.isOAS3)(t)){for(var r=arguments.length,n=new Array(r>1?r-1:0),s=1;s<r;s++)n[s-1]=arguments[s];return u(...n)}return null});var u;const p=(e,t)=>()=>{const e=t.getSystem().specSelectors.specJson();return(0,a.isSwagger2)(e)}},2044:(e,t,r)=>{"use strict";r.r(t),r.d(t,{definitions:()=>m,hasHost:()=>h,securityDefinitions:()=>g,host:()=>f,basePath:()=>y,consumes:()=>E,produces:()=>v,schemes:()=>S,servers:()=>C,isOAS3:()=>b,isSwagger2:()=>x});var n=r(6814),s=r(3881),a=r(5572),o=r(7779);function l(e){return(t,r)=>function(){const n=r.getSystem().specSelectors.specJson();return(0,o.isOAS3)(n)?e(...arguments):t(...arguments)}}const i=e=>e||(0,a.Map)(),c=l((0,n.createSelector)((()=>null))),u=(0,n.createSelector)(i,(e=>e.get("json",(0,a.Map)()))),p=(0,n.createSelector)(i,(e=>e.get("resolved",(0,a.Map)()))),d=e=>{let t=p(e);return t.count()<1&&(t=u(e)),t},m=l((0,n.createSelector)(d,(e=>{const t=e.getIn(["components","schemas"]);return a.Map.isMap(t)?t:(0,a.Map)()}))),h=l((e=>d(e).hasIn(["servers",0]))),g=l((0,n.createSelector)(s.specJsonWithResolvedSubtrees,(e=>e.getIn(["components","securitySchemes"])||null))),f=c,y=c,E=c,v=c,S=c,C=l((0,n.createSelector)(d,(e=>e.getIn(["servers"])||(0,a.Map)()))),b=(e,t)=>()=>{const e=t.getSystem().specSelectors.specJson();return(0,o.isOAS3)(a.Map.isMap(e)?e:(0,a.Map)())},x=(e,t)=>()=>{const e=t.getSystem().specSelectors.specJson();return(0,o.isSwagger2)(a.Map.isMap(e)?e:(0,a.Map)())}},356:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>a});var n=r(6689),s=r.n(n);const a=(0,r(7779).OAS3ComponentWrapFactory)((e=>{let{Ori:t,...r}=e;const{schema:n,getComponent:a,errSelectors:o,authorized:l,onAuthChange:i,name:c}=r,u=a("HttpAuth");return"http"===n.get("type")?s().createElement(u,{key:c,schema:n,name:c,errSelectors:o,authorized:l,getComponent:a,onChange:i}):s().createElement(t,r)}))},7761:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>c});var n=r(2460),s=r(356),a=r(9487),o=r(58),l=r(3499),i=r(287);const c={Markdown:n.default,AuthItem:s.default,JsonSchema_string:i.default,VersionStamp:a.default,model:l.default,onlineValidatorBadge:o.default}},287:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>a});var n=r(6689),s=r.n(n);const a=(0,r(7779).OAS3ComponentWrapFactory)((e=>{let{Ori:t,...r}=e;const{schema:n,getComponent:a,errors:o,onChange:l}=r,i=n&&n.get?n.get("format"):null,c=n&&n.get?n.get("type"):null,u=a("Input");return c&&"string"===c&&i&&("binary"===i||"base64"===i)?s().createElement(u,{type:"file",className:o.length?"invalid":"",title:o.length?o:"",onChange:e=>{l(e.target.files[0])},disabled:t.isDisabled}):s().createElement(t,r)}))},2460:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Markdown:()=>m,default:()=>h});var n=r(7390),s=r.n(n),a=r(6689),o=r.n(a),l=(r(580),r(9003)),i=r.n(l),c=r(963),u=r(7779),p=r(2552);const d=new c.Remarkable("commonmark");d.block.ruler.enable(["table"]),d.set({linkTarget:"_blank"});const m=e=>{let{source:t,className:r="",getConfigs:n}=e;if("string"!=typeof t)return null;if(t){const{useUnsafeMarkdown:e}=n(),a=d.render(t),l=(0,p.s)(a,{useUnsafeMarkdown:e});let c;return"string"==typeof l&&(c=s()(l).call(l)),o().createElement("div",{dangerouslySetInnerHTML:{__html:c},className:i()(r,"renderedMarkdown")})}return null};m.defaultProps={getConfigs:()=>({useUnsafeMarkdown:!1})};const h=(0,u.OAS3ComponentWrapFactory)(m)},3499:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>u});var n=r(4250),s=r.n(n),a=r(6689),o=r.n(a),l=(r(580),r(7779)),i=r(6024);class c extends a.Component{render(){let{getConfigs:e,schema:t}=this.props,r=["model-box"],n=null;return!0===t.get("deprecated")&&(r.push("deprecated"),n=o().createElement("span",{className:"model-deprecated-warning"},"Deprecated:")),o().createElement("div",{className:r.join(" ")},n,o().createElement(i.Z,s()({},this.props,{getConfigs:e,depth:1,expandDepth:this.props.expandDepth||0})))}}const u=(0,l.OAS3ComponentWrapFactory)(c)},58:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>a});var n=r(7779),s=r(5623);const a=(0,n.OAS3ComponentWrapFactory)(s.Z)},9487:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>a});var n=r(6689),s=r.n(n);const a=(0,r(7779).OAS3ComponentWrapFactory)((e=>{const{Ori:t}=e;return s().createElement("span",null,s().createElement(t,e),s().createElement("small",{className:"version-stamp"},s().createElement("pre",{className:"version"},"OAS3")))}))},8560:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>o});var n=r(9300),s=r.n(n);let a=!1;function o(){return{statePlugins:{spec:{wrapActions:{updateSpec:e=>function(){return a=!0,e(...arguments)},updateJsonSpec:(e,t)=>function(){const r=t.getConfigs().onComplete;return a&&"function"==typeof r&&(s()(r,0),a=!1),e(...arguments)}}}}}}},8223:(e,t,r)=>{"use strict";r.r(t),r.d(t,{requestSnippetGenerator_curl_bash:()=>A,requestSnippetGenerator_curl_cmd:()=>I,requestSnippetGenerator_curl_powershell:()=>_});var n=r(8493),s=r.n(n),a=r(7390),o=r.n(a),l=r(8344),i=r.n(l),c=r(3942),u=r.n(c);const p=require("@babel/runtime-corejs3/core-js-stable/instance/repeat");var d=r.n(p),m=r(7862),h=r.n(m),g=r(2605),f=r.n(g),y=r(7504),E=r(5572);const v=e=>{var t;const r="_**[]";return s()(e).call(e,r)<0?e:o()(t=e.split(r)[0]).call(t)},S=e=>"-d "===e||/^[_\/-]/g.test(e)?e:"'"+e.replace(/'/g,"'\\''")+"'",C=e=>"-d "===(e=e.replace(/\^/g,"^^").replace(/\\"/g,'\\\\"').replace(/"/g,'""').replace(/\n/g,"^\n"))?e.replace(/-d /g,"-d ^\n"):/^[_\/-]/g.test(e)?e:'"'+e+'"',b=e=>"-d "===e?e:/\n/.test(e)?'@"\n'+e.replace(/"/g,'\\"').replace(/`/g,"``").replace(/\$/,"`$")+'\n"@':/^[_\/-]/g.test(e)?e:"'"+e.replace(/"/g,'""').replace(/'/g,"''")+"'";function x(e){let t=[];for(let[r,n]of e.get("body").entrySeq()){let e=v(r);n instanceof y.Z.File?t.push(`  "${e}": {\n    "name": "${n.name}"${n.type?`,\n    "type": "${n.type}"`:""}\n  }`):t.push(`  "${e}": ${i()(n,null,2).replace(/(\r\n|\r|\n)/g,"\n  ")}`)}return`{\n${t.join(",\n")}\n}`}const w=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",s=!1,a="";const o=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return a+=" "+u()(r).call(r,t).join(" ")},l=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return a+=u()(r).call(r,t).join(" ")},c=()=>a+=` ${r}`,p=function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return a+=d()(e="  ").call(e,t)};let m=e.get("headers");if(a+="curl"+n,e.has("curlOptions")&&o(...e.get("curlOptions")),o("-X",e.get("method")),c(),p(),l(`${e.get("url")}`),m&&m.size)for(let t of h()(g=e.get("headers")).call(g)){var g;c(),p();let[e,r]=t;l("-H",`${e}: ${r}`),s=s||/^content-type$/i.test(e)&&/^multipart\/form-data$/i.test(r)}const S=e.get("body");var C;if(S)if(s&&f()(C=["POST","PUT","PATCH"]).call(C,e.get("method")))for(let[e,t]of S.entrySeq()){let r=v(e);c(),p(),l("-F"),t instanceof y.Z.File?o(`${r}=@${t.name}${t.type?`;type=${t.type}`:""}`):o(`${r}=${t}`)}else if(S instanceof y.Z.File)c(),p(),l(`--data-binary '@${S.name}'`);else{c(),p(),l("-d ");let t=S;E.Map.isMap(t)?l(x(e)):("string"!=typeof t&&(t=i()(t)),l(t))}else S||"POST"!==e.get("method")||(c(),p(),l("-d ''"));return a},_=e=>w(e,b,"`\n",".exe"),A=e=>w(e,S,"\\\n"),I=e=>w(e,C,"^\n")},6575:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>o});var n=r(8223),s=r(4669),a=r(4206);const o=()=>({components:{RequestSnippets:a.default},fn:n,statePlugins:{requestSnippets:{selectors:s}}})},4206:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>C});var n=r(9998),s=r.n(n),a=r(1733),o=r.n(a),l=r(4235),i=r.n(l),c=r(3942),u=r.n(c),p=r(6689),d=r.n(p),m=(r(580),r(1712)),h=r.n(m),g=r(5716),f=r.n(g),y=r(2807),E=r(6068);const v={cursor:"pointer",lineHeight:1,display:"inline-flex",backgroundColor:"rgb(250, 250, 250)",paddingBottom:"0",paddingTop:"0",border:"1px solid rgb(51, 51, 51)",borderRadius:"4px 4px 0 0",boxShadow:"none",borderBottom:"none"},S={cursor:"pointer",lineHeight:1,display:"inline-flex",backgroundColor:"rgb(51, 51, 51)",boxShadow:"none",border:"1px solid rgb(51, 51, 51)",paddingBottom:"0",paddingTop:"0",borderRadius:"4px 4px 0 0",marginTop:"-5px",marginRight:"-5px",marginLeft:"-5px",zIndex:"9999",borderBottom:"none"},C=e=>{var t,r;let{request:n,requestSnippetsSelectors:a,getConfigs:l}=e;const c=f()(l)?l():null,m=!1!==h()(c,"syntaxHighlight")&&h()(c,"syntaxHighlight.activated",!0),g=(0,p.useRef)(null),[C,b]=(0,p.useState)(null===(t=a.getSnippetGenerators())||void 0===t?void 0:t.keySeq().first()),[x,w]=(0,p.useState)(null==a?void 0:a.getDefaultExpanded());(0,p.useEffect)((()=>{}),[]),(0,p.useEffect)((()=>{var e;const t=s()(e=o()(g.current.childNodes)).call(e,(e=>{var t;return!!e.nodeType&&(null===(t=e.classList)||void 0===t?void 0:t.contains("curl-command"))}));return i()(t).call(t,(e=>e.addEventListener("mousewheel",T,{passive:!1}))),()=>{i()(t).call(t,(e=>e.removeEventListener("mousewheel",T)))}}),[n]);const _=a.getSnippetGenerators(),A=_.get(C),I=A.get("fn")(n),N=()=>{w(!x)},q=e=>e===C?S:v,T=e=>{const{target:t,deltaY:r}=e,{scrollHeight:n,offsetHeight:s,scrollTop:a}=t;n>s&&(0===a&&r<0||s+a>=n&&r>0)&&e.preventDefault()},R=m?d().createElement(E.d3,{language:A.get("syntax"),className:"curl microlight",style:(0,E.C2)(h()(c,"syntaxHighlight.theme"))},I):d().createElement("textarea",{readOnly:!0,className:"curl",value:I});return d().createElement("div",{className:"request-snippets",ref:g},d().createElement("div",{style:{width:"100%",display:"flex",justifyContent:"flex-start",alignItems:"center",marginBottom:"15px"}},d().createElement("h4",{onClick:()=>N(),style:{cursor:"pointer"}},"Snippets"),d().createElement("button",{onClick:()=>N(),style:{border:"none",background:"none"},title:x?"Collapse operation":"Expand operation"},d().createElement("svg",{className:"arrow",width:"10",height:"10"},d().createElement("use",{href:x?"#large-arrow-down":"#large-arrow",xlinkHref:x?"#large-arrow-down":"#large-arrow"})))),x&&d().createElement("div",{className:"curl-command"},d().createElement("div",{style:{paddingLeft:"15px",paddingRight:"10px",width:"100%",display:"flex"}},u()(r=_.entrySeq()).call(r,(e=>{let[t,r]=e;return d().createElement("div",{style:q(t),className:"btn",key:t,onClick:()=>(e=>{C!==e&&b(e)})(t)},d().createElement("h4",{style:t===C?{color:"white"}:{}},r.get("title")))}))),d().createElement("div",{className:"copy-to-clipboard"},d().createElement(y.CopyToClipboard,{text:I},d().createElement("button",null))),d().createElement("div",null,R)))}},4669:(e,t,r)=>{"use strict";r.r(t),r.d(t,{getGenerators:()=>d,getSnippetGenerators:()=>m,getActiveLanguage:()=>h,getDefaultExpanded:()=>g});var n=r(9998),s=r.n(n),a=r(2605),o=r.n(a),l=r(3942),i=r.n(l),c=r(6814),u=r(5572);const p=e=>e||(0,u.Map)(),d=(0,c.createSelector)(p,(e=>{const t=e.get("languages"),r=e.get("generators",(0,u.Map)());return!t||t.isEmpty()?r:s()(r).call(r,((e,r)=>o()(t).call(t,r)))})),m=e=>t=>{var r,n;let{fn:a}=t;return s()(r=i()(n=d(e)).call(n,((e,t)=>{const r=(e=>a[`requestSnippetGenerator_${e}`])(t);return"function"!=typeof r?null:e.set("fn",r)}))).call(r,(e=>e))},h=(0,c.createSelector)(p,(e=>e.get("activeLanguage"))),g=(0,c.createSelector)(p,(e=>e.get("defaultExpanded")))},6195:(e,t,r)=>{"use strict";r.r(t),r.d(t,{ErrorBoundary:()=>l,default:()=>i});r(580);var n=r(6689),s=r.n(n),a=r(6189),o=r(9403);class l extends n.Component{static getDerivedStateFromError(e){return{hasError:!0,error:e}}constructor(){super(...arguments),this.state={hasError:!1,error:null}}componentDidCatch(e,t){this.props.fn.componentDidCatch(e,t)}render(){const{getComponent:e,targetName:t,children:r}=this.props;if(this.state.hasError){const r=e("Fallback");return s().createElement(r,{name:t})}return r}}l.defaultProps={targetName:"this component",getComponent:()=>o.default,fn:{componentDidCatch:a.componentDidCatch},children:null};const i=l},9403:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>a});var n=r(6689),s=r.n(n);r(580);const a=e=>{let{name:t}=e;return s().createElement("div",{className:"fallback"},"😱 ",s().createElement("i",null,"Could not render ","t"===t?"this component":t,", see the console."))}},6189:(e,t,r)=>{"use strict";r.r(t),r.d(t,{componentDidCatch:()=>l,withErrorBoundary:()=>i});var n=r(4250),s=r.n(n),a=r(6689),o=r.n(a);const l=console.error,i=e=>t=>{const{getComponent:r,fn:n}=e(),l=r("ErrorBoundary"),i=n.getDisplayName(t);class c extends a.Component{render(){return o().createElement(l,{targetName:i,getComponent:r,fn:n},o().createElement(t,s()({},this.props,this.context)))}}var u;return c.displayName=`WithErrorBoundary(${i})`,(u=t).prototype&&u.prototype.isReactComponent&&(c.prototype.mapStateToProps=t.prototype.mapStateToProps),c}},9595:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>u});const n=require("@babel/runtime-corejs3/core-js-stable/instance/fill");var s=r.n(n);const a=require("lodash/zipObject");var o=r.n(a),l=r(6195),i=r(9403),c=r(6189);const u=function(){let{componentList:e=[],fullOverride:t=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r=>{var n;let{getSystem:a}=r;const u=t?e:["App","BaseLayout","VersionPragmaFilter","InfoContainer","ServersContainer","SchemesContainer","AuthorizeBtnContainer","FilterContainer","Operations","OperationContainer","parameters","responses","OperationServers","Models","ModelWrapper",...e],p=o()(u,s()(n=Array(u.length)).call(n,((e,t)=>{let{fn:r}=t;return r.withErrorBoundary(e)})));return{fn:{componentDidCatch:c.componentDidCatch,withErrorBoundary:(0,c.withErrorBoundary)(a)},components:{ErrorBoundary:l.default,Fallback:i.default},wrapComponents:p}}}},4128:(e,t,r)=>{"use strict";r.r(t),r.d(t,{createXMLExample:()=>z,inferSchema:()=>U,memoizedCreateXMLExample:()=>J,memoizedSampleFromSchema:()=>F,sampleFromSchema:()=>B,sampleFromSchemaGeneric:()=>L});var n=r(8493),s=r.n(n),a=r(4235),o=r.n(a),l=r(7104),i=r.n(l),c=r(2605),u=r.n(c),p=r(5626),d=r.n(p),m=r(600),h=r.n(m),g=r(3580),f=r.n(g),y=r(4883),E=r.n(y),v=r(3942),S=r.n(v),C=r(8344),b=r.n(C);const x=require("xml");var w=r.n(x);const _=require("randexp");var A=r.n(_);const I=require("lodash/isEmpty");var N=r.n(I),q=r(1890),T=r(7481);const R={string:e=>e.pattern?(e=>{try{return new(A())(e).gen()}catch(e){return"string"}})(e.pattern):"string",string_email:()=>"user@example.com","string_date-time":()=>(new Date).toISOString(),string_date:()=>(new Date).toISOString().substring(0,10),string_uuid:()=>"3fa85f64-5717-4562-b3fc-2c963f66afa6",string_hostname:()=>"example.com",string_ipv4:()=>"198.51.100.42",string_ipv6:()=>"2001:0db8:5b96:0000:0000:426f:8e17:642a",number:()=>0,number_float:()=>0,integer:()=>0,boolean:e=>"boolean"!=typeof e.default||e.default},P=e=>{e=(0,q.mz)(e);let{type:t,format:r}=e,n=R[`${t}_${r}`]||R[t];return(0,q.Wl)(n)?n(e):"Unknown Type: "+e.type},k=e=>(0,q.XV)(e,"$$ref",(e=>"string"==typeof e&&s()(e).call(e,"#")>-1)),O=["maxProperties","minProperties"],M=["minItems","maxItems"],j=["minimum","maximum","exclusiveMinimum","exclusiveMaximum"],V=["minLength","maxLength"],D=function(e,t){var r;let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const a=r=>{void 0===t[r]&&void 0!==e[r]&&(t[r]=e[r])};var l;(o()(r=["example","default","enum","xml","type",...O,...M,...j,...V]).call(r,(e=>a(e))),void 0!==e.required&&i()(e.required))&&(void 0!==t.required&&t.required.length||(t.required=[]),o()(l=e.required).call(l,(e=>{var r;u()(r=t.required).call(r,e)||t.required.push(e)})));if(e.properties){t.properties||(t.properties={});let r=(0,q.mz)(e.properties);for(let a in r){var c;if(Object.prototype.hasOwnProperty.call(r,a))if(!r[a]||!r[a].deprecated)if(!r[a]||!r[a].readOnly||n.includeReadOnly)if(!r[a]||!r[a].writeOnly||n.includeWriteOnly)if(!t.properties[a])t.properties[a]=r[a],!e.required&&i()(e.required)&&-1!==s()(c=e.required).call(c,a)&&(t.required?t.required.push(a):t.required=[a])}}return e.items&&(t.items||(t.items={}),t.items=D(e.items,t.items,n)),t},L=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];e&&(0,q.Wl)(e.toJS)&&(e=e.toJS());let a=void 0!==r||e&&void 0!==e.example||e&&void 0!==e.default;const l=!a&&e&&e.oneOf&&e.oneOf.length>0,c=!a&&e&&e.anyOf&&e.anyOf.length>0;if(!a&&(l||c)){const r=(0,q.mz)(l?e.oneOf[0]:e.anyOf[0]);if(D(r,e,t),!e.xml&&r.xml&&(e.xml=r.xml),void 0!==e.example&&void 0!==r.example)a=!0;else if(r.properties){e.properties||(e.properties={});let n=(0,q.mz)(r.properties);for(let a in n){var p;if(Object.prototype.hasOwnProperty.call(n,a))if(!n[a]||!n[a].deprecated)if(!n[a]||!n[a].readOnly||t.includeReadOnly)if(!n[a]||!n[a].writeOnly||t.includeWriteOnly)if(!e.properties[a])e.properties[a]=n[a],!r.required&&i()(r.required)&&-1!==s()(p=r.required).call(p,a)&&(e.required?e.required.push(a):e.required=[a])}}}const m={};let{xml:g,type:y,example:v,properties:C,additionalProperties:b,items:x}=e||{},{includeReadOnly:w,includeWriteOnly:_}=t;g=g||{};let A,{name:I,prefix:T,namespace:R}=g,V={};if(n&&(I=I||"notagname",A=(T?T+":":"")+I,R)){m[T?"xmlns:"+T:"xmlns"]=R}n&&(V[A]=[]);const U=t=>d()(t).call(t,(t=>Object.prototype.hasOwnProperty.call(e,t)));e&&!y&&(C||b||U(O)?y="object":x||U(M)?y="array":U(j)?(y="number",e.type="number"):a||e.enum||(y="string",e.type="string"));const z=t=>{var r,n,s,a,o;null!==(null===(r=e)||void 0===r?void 0:r.maxItems)&&void 0!==(null===(n=e)||void 0===n?void 0:n.maxItems)&&(t=h()(t).call(t,0,null===(o=e)||void 0===o?void 0:o.maxItems));if(null!==(null===(s=e)||void 0===s?void 0:s.minItems)&&void 0!==(null===(a=e)||void 0===a?void 0:a.minItems)){let r=0;for(;t.length<(null===(l=e)||void 0===l?void 0:l.minItems);){var l;t.push(t[r++%t.length])}}return t},B=(0,q.mz)(C);let $,J=0;const F=()=>e&&null!==e.maxProperties&&void 0!==e.maxProperties&&J>=e.maxProperties,W=()=>{if(!e||!e.required)return 0;let t=0;var r,s;n?o()(r=e.required).call(r,(e=>t+=void 0===V[e]?0:1)):o()(s=e.required).call(s,(e=>{var r;return t+=void 0===(null===(r=V[A])||void 0===r?void 0:f()(r).call(r,(t=>void 0!==t[e])))?0:1}));return e.required.length-t},H=t=>{var r;return!(e&&e.required&&e.required.length)||!u()(r=e.required).call(r,t)},K=t=>!e||null===e.maxProperties||void 0===e.maxProperties||!F()&&(!H(t)||e.maxProperties-J-W()>0);if($=n?function(r){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;if(e&&B[r]){if(B[r].xml=B[r].xml||{},B[r].xml.attribute){const e=i()(B[r].enum)?B[r].enum[0]:void 0,t=B[r].example,n=B[r].default;return void(m[B[r].xml.name||r]=void 0!==t?t:void 0!==n?n:void 0!==e?e:P(B[r]))}B[r].xml.name=B[r].xml.name||r}else B[r]||!1===b||(B[r]={xml:{name:r}});let a=L(e&&B[r]||void 0,t,s,n);var o;K(r)&&(J++,i()(a)?V[A]=E()(o=V[A]).call(o,a):V[A].push(a))}:(e,r)=>{K(e)&&(V[e]=L(B[e],t,r,n),J++)},a){let s;if(s=k(void 0!==r?r:void 0!==v?v:e.default),!n){if("number"==typeof s&&"string"===y)return`${s}`;if("string"!=typeof s||"string"===y)return s;try{return JSON.parse(s)}catch(e){return s}}if(e||(y=i()(s)?"array":typeof s),"array"===y){if(!i()(s)){if("string"==typeof s)return s;s=[s]}const r=e?e.items:void 0;r&&(r.xml=r.xml||g||{},r.xml.name=r.xml.name||g.name);let a=S()(s).call(s,(e=>L(r,t,e,n)));return a=z(a),g.wrapped?(V[A]=a,N()(m)||V[A].push({_attr:m})):V=a,V}if("object"===y){if("string"==typeof s)return s;for(let t in s)Object.prototype.hasOwnProperty.call(s,t)&&(e&&B[t]&&B[t].readOnly&&!w||e&&B[t]&&B[t].writeOnly&&!_||(e&&B[t]&&B[t].xml&&B[t].xml.attribute?m[B[t].xml.name||t]=s[t]:$(t,s[t])));return N()(m)||V[A].push({_attr:m}),V}return V[A]=N()(m)?s:[{_attr:m},s],V}if("object"===y){for(let e in B)Object.prototype.hasOwnProperty.call(B,e)&&(B[e]&&B[e].deprecated||B[e]&&B[e].readOnly&&!w||B[e]&&B[e].writeOnly&&!_||$(e));if(n&&m&&V[A].push({_attr:m}),F())return V;if(!0===b)n?V[A].push({additionalProp:"Anything can be here"}):V.additionalProp1={},J++;else if(b){const r=(0,q.mz)(b),s=L(r,t,void 0,n);if(n&&r.xml&&r.xml.name&&"notagname"!==r.xml.name)V[A].push(s);else{const t=null!==e.minProperties&&void 0!==e.minProperties&&J<e.minProperties?e.minProperties-J:3;for(let e=1;e<=t;e++){if(F())return V;if(n){const t={};t["additionalProp"+e]=s.notagname,V[A].push(t)}else V["additionalProp"+e]=s;J++}}}return V}if("array"===y){if(!x)return;let r;var Z,G;if(n)x.xml=x.xml||(null===(Z=e)||void 0===Z?void 0:Z.xml)||{},x.xml.name=x.xml.name||g.name;if(i()(x.anyOf))r=S()(G=x.anyOf).call(G,(e=>L(D(x,e,t),t,void 0,n)));else if(i()(x.oneOf)){var Y;r=S()(Y=x.oneOf).call(Y,(e=>L(D(x,e,t),t,void 0,n)))}else{if(!(!n||n&&g.wrapped))return L(x,t,void 0,n);r=[L(x,t,void 0,n)]}return r=z(r),n&&g.wrapped?(V[A]=r,N()(m)||V[A].push({_attr:m}),V):r}let X;if(e&&i()(e.enum))X=(0,q.AF)(e.enum)[0];else{if(!e)return;if(X=P(e),"number"==typeof X){let t=e.minimum;null!=t&&(e.exclusiveMinimum&&t++,X=t);let r=e.maximum;null!=r&&(e.exclusiveMaximum&&r--,X=r)}if("string"==typeof X&&(null!==e.maxLength&&void 0!==e.maxLength&&(X=h()(X).call(X,0,e.maxLength)),null!==e.minLength&&void 0!==e.minLength)){let t=0;for(;X.length<e.minLength;)X+=X[t++%X.length]}}if("file"!==y)return n?(V[A]=N()(m)?X:[{_attr:m},X],V):X},U=e=>(e.schema&&(e=e.schema),e.properties&&(e.type="object"),e),z=(e,t,r)=>{const n=L(e,t,r,!0);if(n)return"string"==typeof n?n:w()(n,{declaration:!0,indent:"\t"})},B=(e,t,r)=>L(e,t,r,!1),$=(e,t,r)=>[e,b()(t),b()(r)],J=(0,T.Z)(z,$),F=(0,T.Z)(B,$)},8883:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>s});var n=r(4128);function s(){return{fn:n}}},9381:(e,t,r)=>{"use strict";r.r(t),r.d(t,{CLEAR_REQUEST:()=>Q,CLEAR_RESPONSE:()=>X,CLEAR_VALIDATE_PARAMS:()=>ee,LOG_REQUEST:()=>Y,SET_MUTATED_REQUEST:()=>G,SET_REQUEST:()=>Z,SET_RESPONSE:()=>K,SET_SCHEME:()=>se,UPDATE_EMPTY_PARAM_INCLUSION:()=>W,UPDATE_JSON:()=>J,UPDATE_OPERATION_META_VALUE:()=>te,UPDATE_PARAM:()=>F,UPDATE_RESOLVED:()=>re,UPDATE_RESOLVED_SUBTREE:()=>ne,UPDATE_SPEC:()=>B,UPDATE_URL:()=>$,VALIDATE_PARAMS:()=>H,changeConsumesValue:()=>be,changeParam:()=>ge,changeParamByIdentity:()=>fe,changeProducesValue:()=>xe,clearRequest:()=>Re,clearResponse:()=>Te,clearValidateParams:()=>Ce,execute:()=>qe,executeRequest:()=>Ne,invalidateResolvedSubtreeCache:()=>Ee,logRequest:()=>Ie,parseToJson:()=>ce,requestResolvedSubtree:()=>he,resolveSpec:()=>pe,setMutatedRequest:()=>Ae,setRequest:()=>_e,setResponse:()=>we,setScheme:()=>Pe,updateEmptyParamInclusion:()=>Se,updateJsonSpec:()=>ie,updateResolved:()=>oe,updateResolvedSubtree:()=>ye,updateSpec:()=>ae,updateUrl:()=>le,validateParams:()=>ve});var n=r(7104),s=r.n(n),a=r(3942),o=r.n(a);const l=require("@babel/runtime-corejs3/core-js-stable/object/define-property");var i=r.n(l),c=r(66),u=r.n(c),p=r(7834),d=r.n(p);const m=require("@babel/runtime-corejs3/core-js-stable/promise");var h=r.n(m),g=r(9998),f=r.n(g),y=r(9968),E=r.n(y),v=r(8493),S=r.n(v),C=r(4235),b=r.n(C),x=r(7252),w=r.n(x),_=r(4994),A=r.n(_);const I=require("@babel/runtime-corejs3/core-js-stable/date/now");var N=r.n(I),q=r(9793),T=r.n(q),R=r(5572),P=r(3883),k=r.n(P),O=r(41);const M=require("lodash/isString");var j=r.n(M);const V=require("lodash/debounce");var D=r.n(V);const L=require("lodash/set");var U=r.n(L),z=r(1890);const B="spec_update_spec",$="spec_update_url",J="spec_update_json",F="spec_update_param",W="spec_update_empty_param_inclusion",H="spec_validate_param",K="spec_set_response",Z="spec_set_request",G="spec_set_mutated_request",Y="spec_log_request",X="spec_clear_response",Q="spec_clear_request",ee="spec_clear_validate_param",te="spec_update_operation_meta_value",re="spec_update_resolved",ne="spec_update_resolved_subtree",se="set_scheme";function ae(e){const t=(r=e,j()(r)?r:"").replace(/\t/g,"  ");var r;if("string"==typeof e)return{type:B,payload:t}}function oe(e){return{type:re,payload:e}}function le(e){return{type:$,payload:e}}function ie(e){return{type:J,payload:e}}const ce=e=>t=>{let{specActions:r,specSelectors:n,errActions:s}=t,{specStr:a}=n,o=null;try{e=e||a(),s.clear({source:"parser"}),o=T().load(e,{schema:q.JSON_SCHEMA})}catch(e){return console.error(e),s.newSpecErr({source:"parser",level:"error",message:e.reason,line:e.mark&&e.mark.line?e.mark.line+1:void 0})}return o&&"object"==typeof o?r.updateJsonSpec(o):{}};let ue=!1;const pe=(e,t)=>r=>{let{specActions:n,specSelectors:a,errActions:l,fn:{fetch:c,resolve:u,AST:p={}},getConfigs:d}=r;ue||(console.warn("specActions.resolveSpec is deprecated since v3.10.0 and will be removed in v4.0.0; use requestResolvedSubtree instead!"),ue=!0);const{modelPropertyMacro:m,parameterMacro:h,requestInterceptor:g,responseInterceptor:f}=d();void 0===e&&(e=a.specJson()),void 0===t&&(t=a.url());let y=p.getLineNumberForPath?p.getLineNumberForPath:()=>{},E=a.specStr();return u({fetch:c,spec:e,baseDoc:t,modelPropertyMacro:m,parameterMacro:h,requestInterceptor:g,responseInterceptor:f}).then((e=>{let{spec:t,errors:r}=e;if(l.clear({type:"thrown"}),s()(r)&&r.length>0){let e=o()(r).call(r,(e=>(console.error(e),e.line=e.fullPath?y(E,e.fullPath):null,e.path=e.fullPath?e.fullPath.join("."):null,e.level="error",e.type="thrown",e.source="resolver",i()(e,"message",{enumerable:!0,value:e.message}),e)));l.newThrownErrBatch(e)}return n.updateResolved(t)}))};let de=[];const me=D()((async()=>{const e=de.system;if(!e)return void console.error("debResolveSubtrees: don't have a system to operate on, aborting.");const{errActions:t,errSelectors:r,fn:{resolveSubtree:n,fetch:a,AST:l={}},specSelectors:c,specActions:p}=e;if(!n)return void console.error("Error: Swagger-Client did not provide a `resolveSubtree` method, doing nothing.");let m=l.getLineNumberForPath?l.getLineNumberForPath:()=>{};const g=c.specStr(),{modelPropertyMacro:y,parameterMacro:v,requestInterceptor:S,responseInterceptor:C}=e.getConfigs();try{var b=await u()(de).call(de,(async(e,l)=>{const{resultMap:u,specWithCurrentSubtrees:p}=await e,{errors:b,spec:x}=await n(p,l,{baseDoc:c.url(),modelPropertyMacro:y,parameterMacro:v,requestInterceptor:S,responseInterceptor:C});if(r.allErrors().size&&t.clearBy((e=>{var t;return"thrown"!==e.get("type")||"resolver"!==e.get("source")||!d()(t=e.get("fullPath")).call(t,((e,t)=>e===l[t]||void 0===l[t]))})),s()(b)&&b.length>0){let e=o()(b).call(b,(e=>(e.line=e.fullPath?m(g,e.fullPath):null,e.path=e.fullPath?e.fullPath.join("."):null,e.level="error",e.type="thrown",e.source="resolver",i()(e,"message",{enumerable:!0,value:e.message}),e)));t.newThrownErrBatch(e)}var w,_;x&&c.isOAS3()&&"components"===l[0]&&"securitySchemes"===l[1]&&await h().all(o()(w=f()(_=E()(x)).call(_,(e=>"openIdConnect"===e.type))).call(w,(async e=>{const t={url:e.openIdConnectUrl,requestInterceptor:S,responseInterceptor:C};try{const r=await a(t);r instanceof Error||r.status>=400?console.error(r.statusText+" "+t.url):e.openIdConnectData=JSON.parse(r.text)}catch(e){console.error(e)}})));return U()(u,l,x),U()(p,l,x),{resultMap:u,specWithCurrentSubtrees:p}}),h().resolve({resultMap:(c.specResolvedSubtree([])||(0,R.Map)()).toJS(),specWithCurrentSubtrees:c.specJson().toJS()}));delete de.system,de=[]}catch(e){console.error(e)}p.updateResolvedSubtree([],b.resultMap)}),35),he=e=>t=>{var r;S()(r=o()(de).call(de,(e=>e.join("@@")))).call(r,e.join("@@"))>-1||(de.push(e),de.system=t,me())};function ge(e,t,r,n,s){return{type:F,payload:{path:e,value:n,paramName:t,paramIn:r,isXml:s}}}function fe(e,t,r,n){return{type:F,payload:{path:e,param:t,value:r,isXml:n}}}const ye=(e,t)=>({type:ne,payload:{path:e,value:t}}),Ee=()=>({type:ne,payload:{path:[],value:(0,R.Map)()}}),ve=(e,t)=>({type:H,payload:{pathMethod:e,isOAS3:t}}),Se=(e,t,r,n)=>({type:W,payload:{pathMethod:e,paramName:t,paramIn:r,includeEmptyValue:n}});function Ce(e){return{type:ee,payload:{pathMethod:e}}}function be(e,t){return{type:te,payload:{path:e,value:t,key:"consumes_value"}}}function xe(e,t){return{type:te,payload:{path:e,value:t,key:"produces_value"}}}const we=(e,t,r)=>({payload:{path:e,method:t,res:r},type:K}),_e=(e,t,r)=>({payload:{path:e,method:t,req:r},type:Z}),Ae=(e,t,r)=>({payload:{path:e,method:t,req:r},type:G}),Ie=e=>({payload:e,type:Y}),Ne=e=>t=>{let{fn:r,specActions:n,specSelectors:a,getConfigs:l,oas3Selectors:i}=t,{pathName:c,method:u,operation:p}=e,{requestInterceptor:d,responseInterceptor:m}=l(),h=p.toJS();var g,y;p&&p.get("parameters")&&b()(g=f()(y=p.get("parameters")).call(y,(e=>e&&!0===e.get("allowEmptyValue")))).call(g,(t=>{if(a.parameterInclusionSettingFor([c,u],t.get("name"),t.get("in"))){e.parameters=e.parameters||{};const r=(0,z.cz)(t,e.parameters);(!r||r&&0===r.size)&&(e.parameters[t.get("name")]="")}}));if(e.contextUrl=k()(a.url()).toString(),h&&h.operationId?e.operationId=h.operationId:h&&c&&u&&(e.operationId=r.opId(h,c,u)),a.isOAS3()){const t=`${c}:${u}`;e.server=i.selectedServer(t)||i.selectedServer();const r=i.serverVariables({server:e.server,namespace:t}).toJS(),n=i.serverVariables({server:e.server}).toJS();e.serverVariables=w()(r).length?r:n,e.requestContentType=i.requestContentType(c,u),e.responseContentType=i.responseContentType(c,u)||"*
</file>

<file path="docs/themes/questiontheme_example/survey/questions/answer/listradio/columns/column_footer.twig">
{#
/**
 * Multiple Choice Html : close column containing item row
 * This view is used only if user set more than one column in the question attribute.
 *
 */
 #}
</ul>
</file>

<file path="docs/themes/questiontheme_example/survey/questions/answer/listradio/columns/column_header.twig">
{#
/**
 * Multiple Choice Html : column containing item row
 * This view is used only if user set more than one column in the question attribute.
 *
 * @var $iColumnWidth
 */
 #}
<!-- on small screen, each column is full width, so it look like a single colunm-->
<ul class="list-unstyled col-md-{{ iColumnWidth }} col-12">
</file>

<file path="docs/themes/questiontheme_example/survey/questions/answer/listradio/rows/answer_row_noanswer.twig">
{#
/**
 * List radio Html : item 'no answer' row
 *
 * @var $name   $ia[1]
 * @var $check_ans
 * @var $checkconditionFunction
 */
#}

<!-- answer_row_noanswer -->
<li id='javatbd{{ name }}' class="mb-3 answer-item radio-item no-anwser-item">
    <input
    type="radio"
    name="{{ name }}"
    id="answer{{ name }}"
    value=""
    {{ check_ans }}
    onclick="if (document.getElementById('answer{{ name }}othertext') != null) document.getElementById('answer{{ name }}othertext').value='';{{ checkconditionFunction }}(this.value, this.name, this.type)"
    />
    <label for="answer{{ name }}" class="control-label radio-label">
        {{ gT('No answer') }}
    </label>
</li>
<!-- endof answer_row_noanswer -->
</file>

<file path="docs/themes/questiontheme_example/survey/questions/answer/listradio/rows/answer_row_other.twig">
{#
/**
 * List radio Html : item 'other' row
 *
 * @var $name
 * @var $answer_other
 * @var $sDisplayStyle
 * @var $sDisable
 * @var $myfname
 * @var $othertext
 * @var $checkedState
 * @var $sValue
 * @var $checkconditionFunction
 */
#}

<!-- answer_row_other -->
<li id='javatbd{{ myfname }}' class='answer-item radio-text-item' role='group' {{ sDisplayStyle }} >
    <div class="row row-cols-lg-auto g-1 align-items-center mb-3">
        <!-- Checkbox + label -->
        <div class="othertext-label-checkox-container radio-item">
            <input
            type="radio"
            value="-oth-"
            name="{{ name }}"
            id="SOTH{{ name }}"
            {{ checkedState }}
            />
    
            <label for="SOTH{{ name }}" class="control-label label-radio" id="label-id-{{ name }}">{{ processString(othertext) }}</label>
... (24 lines truncated)
</file>

<file path="docs/themes/questiontheme_example/survey/questions/answer/listradio/rows/answer_row.twig">
{#
/**
 * Multiple Choice Html : item row
 *
 * @var $name
 * @var $code
 * @var $answer
 * @var $checkedState
 * @var $myfname
 */
#}

<!-- answer_row -->
<li id='javatbd{{ myfname }}' class='answer-item radio-item' {{ sDisplayStyle }} >
    <input
        type="radio"
        value="{{ code }}"
        name="{{ name }}"
        id="answer{{ name }}{{ code }}"
        {{ checkedState }}
        onclick="if (document.getElementById('answer{{ name }}othertext') != null) document.getElementById('answer{{ name }}othertext').value='';checkconditions(this.value, this.name, this.type)"
     />
    <label for="answer{{ name }}{{ code }}" class="control-label radio-label">
        {{ processString(answer) }} [{{ code }}]
    </label>
</li>
<!-- end of answer_row -->
</file>

<file path="docs/themes/questiontheme_example/survey/questions/answer/listradio/answer.twig">
{#
/**
 * List Radio Html
 *
 * @var $name
 * @var $value
 */
#}

<!-- List Radio -->

<!-- answer -->
{{ sTimer }}

<div class="{{ coreClass }} row" role="radiogroup" aria-labelledby="ls-question-text-{{ name }}">
    {# rows/answer_row.php #}
    {{ sRows }}
</div>
{# Value for expression manager javascript (use id) ; no need to submit #}
{{ C.Html.hiddenField("java"~name,value,({
    'id' : "java"~name,
    'disabled' : true,
}))
}}
<!-- end of answer -->
</file>

<file path="docs/themes/questiontheme_example/survey/questions/answer/listradio/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>questiontheme_example</name>
        <type>question_theme</type>
        <title>Custom List (Radio)</title>
        <creationDate>09/08/2018</creationDate>
        <author>LimeSurvey GmbH</author>
        <authorEmail>info@limesurvey.org</authorEmail>
        <authorUrl>http://www.limesurvey.org</authorUrl>
        <copyright>Copyright (C) 2005 - 2018 LimeSurvey Gmbh, Inc. All rights reserved.</copyright>
        <license>GNU General Public License version 2 or later</license>
        <version>1.0</version>
        <apiVersion>1</apiVersion>
        <description>Custom List (radio) question type configuration - Shows option values along with the option text</description>
        <questionType>L</questionType>
        <group>Single choice questions</group>
        <subquestions>0</subquestions>
        <answerscales>1</answerscales>
        <hasdefaultvalues>1</hasdefaultvalues>
        <assessable>1</assessable>
        <class>list-radio</class>
    </metadata>
    <compatibility>
        <version>7.0</version>
        <version>6.0</version>
    </compatibility>
    <files>
        <css>
            <filename></filename>
... (669 lines truncated)
</file>

<file path="docs/credits.txt">
This is at least a partial credits-file of people who helped to
    improve Limesurvey by submitting code, translations, manuals,
    bug reports, patches or good suggestions. It is sorted by first
    name.

----------

Adam Zammit
Alex Simidchiev
Alexander Shilov
Alexei G. Tchernov
Amit Shanker (texens)
Anderson Laecio Galindo Trindade
Andrea Simoes
Andreas Gleis 
Andreas Schroeter
Andrie de Vries
Aniessh Sethh
Arjen Gideonse
Artemis Mendrinos
Bas Peusens
Bjoern Mildh (bpmildh)
Bob C
Bogdan Anastasiei
Brian O'Neill
Brian Staats (bstaats)
C. Scott Ananian
Carlos Juan Martin Perez (kadejo)
Carlos Neira Cortizas
Carsten Schmitz (c_schmitz)
... (127 lines truncated)
</file>

<file path="docs/limesurvey-ruleset.xml">
<?xml version="1.0"?>
<ruleset>
  <description>Ruleset for LimeSurvey coding standard. Whoever has time to implement it fully, please do!</description>
    <rule ref="rulesets/codesize.xml/ExcessiveMethodLength">
        <properties>
        <property name="ignore-whitespace" value="true" />
        <property name="minimum" value="150" />
        </properties>
    </rule>
    <rule ref="rulesets/controversial.xml/Superglobals" />
    <rule ref="rulesets/controversial.xml/CamelCaseClassName" />
    <rule ref="rulesets/controversial.xml/CamelCaseMethodName" />
    <rule ref="rulesets/controversial.xml/CamelCasePropertyName" />
    <rule ref="rulesets/controversial.xml/CamelCaseParameterName" />
    <rule ref="rulesets/controversial.xml/CamelCaseVariableName" />
    <rule ref="rulesets/design.xml/ExitExpression" />
    <rule ref="rulesets/design.xml/EvalExpression" />
    <rule ref="rulesets/design.xml/GotoStatement" />
    <rule ref="rulesets/design.xml/NumberOfChildren" />
    <rule ref="rulesets/design.xml/DepthOfInheritance" />
    <rule ref="rulesets/design.xml/CouplingBetweenObjects">
        <properties>
        <property name="minimum" value="50" />
        </properties>
    </rule>
    <rule ref="rulesets/design.xml/DevelopmentCodeFragment" />
    <rule ref="rulesets/naming.xml/ShortVariable" >
        <properties>
            <property name="minimum" value="3" />
            <property name="exceptions" value="db" />
... (27 lines truncated)
</file>

<file path="docs/release_notes.txt">
Welcome to LimeSurvey v7!

Warranty: This program is provided "as is" without warranties of any kind, either expressed or implied,
including, but not limited to, the implied warranties of merchantability and fitness for a particular
purpose. The entire risk as to the quality and performance of the program is with you.
Should the program prove defective, you assume the cost of all necessary servicing, repair or correction.
In no event will any copyright holder be liable to you for damages, including any general, special,
incidental or consequential damages arising out of the use or inability to use the program
(including but not limited to loss of data or data being rendered inaccurate or losses sustained
by you or third parties or a failure of the program to operate with any other programs).


HOW TO INSTALL
---------------
This release does have the following requirements:

*MySQL ≥ 8.0, PostgreSQL ≥ 14, MariaDB ≥ 10.3.38, or MSSQL ≥ 2019
*PHP 8.1.29 or later with the following modules/libraries enabled:
    *mbstring (Multibyte String Functions) extension library
    *PDO database driver for MySQL (pdo_mysql or pdo_mysqli) or Postgres (pdo_pgsql) or MSSQL (pdo_sqlsrv for Windows and pdo_dblib for Linux)

If you are doing a complete new installation please refer to the manual at
https://manual.limesurvey.org/Installation

Please also have a look at the "Installation security hints" section of the online manual in order to secure your installation.


=== UPGRADING=====
We suggest to check out and hold close to the instructions, which can be found in our online manual:
https://manual.limesurvey.org/Upgrading_from_a_previous_version
... (12574 lines truncated)
</file>

<file path="editor/__mocks__/fileMock.cjs">
module.exports = 'test-file-stub';
</file>

<file path="editor/__mocks__/rawSvgMock.cjs">
// Mock for SVG imports with ?raw query (returns raw SVG string)
module.exports = '<svg></svg>'
</file>

<file path="editor/__mocks__/svgMock.cjs">
// __mocks__/svgMock.js
module.exports = {
  __esModule: true,
  ReactComponent: () => 'svg',
  default: 'svg-file-stub',
}
</file>

<file path="editor/__mocks__/sweetalert2.js">
export default {
  fire: jest.fn(() => Promise.resolve({})),
  close: jest.fn(),
  mixin: jest.fn(() => ({
    fire: jest.fn(() => Promise.resolve({})),
  })),
}
</file>

<file path="editor/.storybook/mocks/i18n.js">
export const t = (key) => key
export let st = (key) => key
</file>

<file path="editor/.storybook/main.js">
import path from 'path'
import { fileURLToPath } from 'url'
import { mergeRsbuildConfig, rspack } from '@rsbuild/core'
const dirname = path.dirname(fileURLToPath(import.meta.url))
const config = {
  stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
  addons: [
    '@storybook/addon-links',
    '@storybook/addon-coverage',
    '@chromatic-com/storybook',
  ],
  framework: {
    name: 'storybook-react-rsbuild',
  },
  docs: {},
  staticDirs: ['../public'],
  core: {
    disableTelemetry: true,
  },
  logLevel: 'error',
  typescript: {
    reactDocgen: 'react-docgen',
  },
  rsbuildFinal: (config) =>
    mergeRsbuildConfig(config, {
      tools: {
        rspack: {
          resolve: {
            modules: ['node_modules', path.resolve(dirname, '../src')],
          },
... (17 lines truncated)
</file>

<file path="editor/.storybook/preview.js">
import { MemoryRouter, Route, Routes } from 'react-router-dom'
import { PersistQueryClientProvider } from '@tanstack/react-query-persist-client'
import surveyData from 'helpers/data/survey-detail.json'
import { queryClient, persistOptions } from '../src/queryClient'
import { I18Provider } from '../src/providers'
import { i18nInstance } from '../src/i18nInit'
import { StoryWrapper } from '../src/sbook/helpers/fixtures/StoryWrapper'
import 'themes/index.scss'
import '../public/remixicon/remixicon.css'
export const preview = {
  decorators: [
    (Story, context) => {
      return (
        <MemoryRouter
          initialEntries={[`/survey/${surveyData.surveyId}/structure/`]}
        >
          <PersistQueryClientProvider
            client={queryClient}
            persistOptions={persistOptions}
          >
            <I18Provider language={'en'} i18n={() => i18nInstance('en')}>
              <Routes>
                <Route
                  path="/survey/:surveyId/:panel?/:menu?"
                  element={<StoryWrapper Story={Story} context={context} />}
                />
              </Routes>
            </I18Provider>
          </PersistQueryClientProvider>
        </MemoryRouter>
... (12 lines truncated)
</file>

<file path="editor/scripts/postbuild.js">
import { fileURLToPath } from 'url'
import path from 'path'
import fs from 'fs'
const _filename = fileURLToPath(import.meta.url)
const _dirname = path.dirname(_filename)
const source = path.join(_dirname, '..', 'build', 'index.html')
const destination = path.join(_dirname, '..', 'index.html')
fs.rename(source, destination, (err) => {
  if (err) {
    console.error('Failed to move index.html:', err)
    process.exit(1)
  }
  console.log('Successfully moved index.html.')
})
</file>

<file path="editor/src/components/ConditionDesigner/ConditionFormFields/AnswerOptionsSelect.js">
import React, { useMemo } from 'react'
import { Select } from 'components'
export const AnswerOptionsSelect = ({ index, condition, updateCondition }) => {
  const options = useMemo(
    () =>
      condition.answers.map(({ value, label }) => ({
        value: String(value),
        label,
      })),
    [condition.answers]
  )
  const selectedOption = useMemo(() => {
    if (condition.value == null) return null
    if (condition.value === '') {
      return options.find((opt) => opt.value === '') || null
    }
    // Split and filter (but keep empty strings if explicitly selected)
    const selectedValues = condition.value.toString().split(',')
    const filteredOptions = options.filter(({ value }) =>
      selectedValues.includes(value)
    )
    return condition.cid ? filteredOptions[0] : filteredOptions
  }, [options, condition.value, condition.cid])
  const handleChange = (selected) => {
    let newValue
    if (Array.isArray(selected)) {
      newValue =
        selected.length > 0
          ? selected.map(({ value }) => value).join(',')
          : null
... (23 lines truncated)
</file>

<file path="editor/src/components/ConditionDesigner/ConditionFormFields/AnswerTypeSelect.js">
import { useCallback, useMemo } from 'react'
import { Select } from 'components'
import { getAllowedMethods, getConditionTypeInfo } from '../utils'
export const AnswerTypeSelect = ({
  index,
  condition,
  updateCondition,
  previousQuestions,
}) => {
  const conditionTypeInfo = getConditionTypeInfo()
  const allowedMethods = getAllowedMethods()
  const handleChange = useCallback(
    (selected) => {
      const newValue = selected?.value || ''
      updateCondition(index, 'targetType', newValue)
      if (newValue === conditionTypeInfo.TARGET.REGEX)
        updateCondition(index, 'method', allowedMethods.REGEX)
      updateCondition(
        index,
        'value',
        condition.targetType === newValue ? condition.value : null
      )
    },
    [condition.targetType, condition.value]
  )
  const selectOptions = useMemo(() => {
    const options = []
    if (condition.method !== allowedMethods.REGEX) {
      if (condition.answers?.length > 0) {
        options.push({
... (40 lines truncated)
</file>

<file path="editor/src/components/ConditionDesigner/ConditionFormFields/ConstantInput.js">
import { useState, useEffect } from 'react'
import { Input } from 'components'
export const ConstantInput = ({ index, condition, updateCondition }) => {
  const sanitizedValue = condition.value ?? '' // null not valid value
  const [value, setValue] = useState(sanitizedValue)
  useEffect(() => {
    if (condition.value === null) {
      updateCondition(index, 'value', '')
      setValue('')
    } else if (condition.value !== value) {
      setValue(sanitizedValue)
    }
  }, [condition.value])
  const handleChange = (e) => {
    const val = e.target.value
    setValue(val)
    updateCondition(index, 'value', val)
  }
  return (
    <Input
      type="text"
      placeholder={t('Value')}
      value={condition.value}
      onChange={handleChange}
      className="mb-3"
    />
  )
}
</file>

<file path="editor/src/components/ConditionDesigner/ConditionFormFields/index.js">
export * from './QuestionsSelect'
export * from './ParticipantDataSelect'
export * from './QuestionTypeToggle'
export * from './QuestionsAsAnswerSelect'
export * from './AnswerOptionsSelect'
export * from './AnswerTypeSelect'
export * from './ConstantInput'
export * from './RegexInput'
export * from './OperatorSelect'
</file>

<file path="editor/src/components/ConditionDesigner/ConditionFormFields/OperatorSelect.js">
import React, { useEffect, useMemo, useCallback } from 'react'
import { getQuestionTypeInfo, Select } from 'components'
import { getQuestionById } from 'helpers'
import { getAllowedMethods, getConditionTypeInfo } from '../utils'
export const OperatorSelect = ({
  index,
  condition,
  updateCondition,
  survey,
}) => {
  const OPERATOR_OPTIONS = [
    { value: '<', label: t('Less than') },
    { value: '<=', label: t('Less than or equal to') },
    { value: '==', label: t('equals') },
    { value: '!=', label: t('Not equal to') },
    { value: '>=', label: t('Greater than or equal to') },
    { value: '>', label: t('Greater than') },
    { value: 'RX', label: t('Regular expression') },
  ]
  const conditionTypeInfo = getConditionTypeInfo()
  const allowedMethods = getAllowedMethods()
  const questionTypeInfo = getQuestionTypeInfo()
  useEffect(() => {
    if (
      condition.targetType === conditionTypeInfo.TARGET.REGEX &&
      condition.method !== allowedMethods.REGEX
    ) {
      updateCondition(index, 'method', allowedMethods.REGEX)
    }
  }, [condition.targetType, condition.method, index, updateCondition])
... (59 lines truncated)
</file>

<file path="editor/src/components/ConditionDesigner/ConditionFormFields/ParticipantDataSelect.js">
import React, { useMemo } from 'react'
import { useFocused } from 'hooks'
import { Select } from 'components'
import { getSurveyParticipantAttributes } from 'helpers'
import { getConditionTypeInfo } from '../utils'
export const ParticipantDataSelect = ({
  index,
  condition,
  updateCondition,
  type = 'source',
  survey,
}) => {
  const { focused } = useFocused()
  const participantDataOptions = useMemo(
    () => getSurveyParticipantAttributes(survey),
    [survey]
  )
  const selectedOption = useMemo(() => {
    return (
      participantDataOptions.find(({ value }) =>
        type === 'source'
          ? value === condition.cfieldname
          : value === condition.value
      ) || null
    )
  }, [participantDataOptions, condition.cfieldname, condition.value, type])
  const handleTokenChange = ({ value }) => {
    if (type === 'target') {
      updateCondition(index, 'value', value)
      return
... (25 lines truncated)
</file>

<file path="editor/src/components/ConditionDesigner/ConditionFormFields/QuestionsAsAnswerSelect.js">
import React from 'react'
import { QuestionsSelect } from './QuestionsSelect'
export const QuestionsAsAnswerSelect = ({
  index,
  condition,
  updateCondition,
  previousQuestions,
}) => {
  const updatedQuestions = previousQuestions
    .filter((question) => question.type !== 'M' && question.type !== 'P')
    .map((question) => ({
      ...question,
      cfieldname: `@${question.cfieldname}@`,
    }))
  if (updatedQuestions.length === 0) {
    return null
  }
  return (
    <QuestionsSelect
      index={index}
      condition={condition}
      updateCondition={() => {}}
      previousQuestions={updatedQuestions}
      valueIdentifier={'value'}
      onChange={({ value }) => {
        updateCondition(index, 'value', value)
      }}
    />
  )
}
... (1 lines truncated)
</file>

<file path="editor/src/components/ConditionDesigner/ConditionFormFields/QuestionsSelect.js">
import React, { useMemo } from 'react'
import { useFocused } from 'hooks'
import { Select } from 'components'
import { getConditionTypeInfo } from '../utils'
export const QuestionsSelect = ({
  index,
  condition,
  updateCondition,
  previousQuestions,
  valueIdentifier = 'cfieldname',
  onChange,
}) => {
  const { focused } = useFocused()
  const conditionTypeInfo = getConditionTypeInfo()
  const options = useMemo(
    () =>
      previousQuestions.map(({ cfieldname, title, qid, answers }, key) => ({
        value: cfieldname,
        label: `${key + 1}. ${title.replace(/&nbsp;/g, ' ')}`,
        cqid: qid,
        answers,
      })),
    [previousQuestions]
  )
  const selectedOption = useMemo(
    () =>
      options.find(({ value }) => value === condition[valueIdentifier]) || null,
    [options, condition[valueIdentifier], valueIdentifier]
  )
  const defaultHandleChange = ({ value, cqid, answers }) => {
... (30 lines truncated)
</file>

<file path="editor/src/components/ConditionDesigner/ConditionFormFields/QuestionTypeToggle.js">
import { useMemo } from 'react'
import { useFocused } from 'hooks'
import { ToggleButtons } from 'components'
import { getConditionTypeInfo } from '../utils'
export const QuestionTypeToggle = ({ index, condition, updateCondition }) => {
  const { groupIndex, questionIndex } = useFocused()
  const isFirstQuestion = groupIndex === 0 && questionIndex === 0
  const conditionTypeInfo = getConditionTypeInfo()
  const handleChange = (selectedValue) => {
    if (selectedValue === condition.sourceType) return
    const updates = {
      sourceType: selectedValue,
      targetType: conditionTypeInfo.TARGET.CONSTANT,
      cqid: '',
      cfieldname: '',
      cquestions: '',
      method: '',
      value: null,
      answers: [],
    }
    Object.keys(updates).forEach((key) =>
      updateCondition(index, key, updates[key])
    )
  }
  // Ensure default selection for the first question
  const defaultSourceType = useMemo(() => {
    return isFirstQuestion
      ? conditionTypeInfo.SOURCE.PARTICIPANT_DATA
      : condition.sourceType || conditionTypeInfo.SOURCE.QUESTION
  }, [isFirstQuestion, condition.sourceType])
... (33 lines truncated)
</file>

<file path="editor/src/components/ConditionDesigner/ConditionFormFields/RegexInput.js">
import { useCallback } from 'react'
export const RegexInput = ({ index, condition, updateCondition }) => {
  const handleChange = useCallback(
    (e) => updateCondition(index, 'value', e.target.value),
    [index]
  )
  return (
    <textarea
      value={condition.value}
      onChange={handleChange}
      placeholder={t('Enter regular expression')}
      className="mb-3 p-2 w-100 form-control"
      rows={5}
    />
  )
}
</file>

<file path="editor/src/components/ConditionDesigner/ExpressionScript/ExpressionScript.js">
import { useParams } from 'react-router-dom'
import React, { useEffect, useState } from 'react'
import classNames from 'classnames'
import {
  useBuffer,
  useExpressionScriptValidation,
  useFocused,
  useSurvey,
} from 'hooks'
import { getQuestionById, QUESTION_RELEVANCE_DEFAULT_VALUE } from 'helpers'
import { SideBarHeader } from 'components/SideBar'
import { Button, ExpressionScriptEditor } from 'components/UIComponents'
import { ArrowLeftIcon } from 'components/icons'
import { handleConditionScriptUpdate } from './handleConditionScriptUpdate'
import {
  isValidRelevanceValue,
  showConditionOverwriteConfirmationOverlay,
  showUnsavedChangesOverlay,
} from '../utils'
export const ExpressionScript = ({ onNavigateBack = () => {} }) => {
  const { surveyId } = useParams()
  const { survey, update } = useSurvey(surveyId)
  const { focused, groupIndex, questionIndex } = useFocused()
  const { addToBuffer } = useBuffer()
  const question = getQuestionById(focused.qid, survey).question
  const validateExpression = useExpressionScriptValidation(
    surveyId,
    question.qid
  )
  const [content, setContent] = useState(
... (107 lines truncated)
</file>

<file path="editor/src/components/ConditionDesigner/ExpressionScript/ExpressionScriptInputBox.js">
import { useParams } from 'react-router-dom'
import {
  useBuffer,
  useExpressionScriptValidation,
  useFocused,
  useSurvey,
} from 'hooks'
import {
  getQuestionById,
  htmlPopup,
  QUESTION_RELEVANCE_DEFAULT_VALUE,
} from 'helpers'
import { Button } from 'components/UIComponents'
import { CloseCircleIcon, ExpandIcon } from 'components/icons'
import { ExpressionScriptEditorOverlay } from '../Overlays'
import { handleConditionScriptUpdate } from './handleConditionScriptUpdate'
import { showResetAllConditionsOverlay, showWarningMessage } from '../utils'
export const ExpressionScriptInputBox = ({ onShowPanel, onNavigateBack }) => {
  const { surveyId } = useParams()
  const { survey, update } = useSurvey(surveyId)
  const { focused, groupIndex, questionIndex } = useFocused()
  const { addToBuffer } = useBuffer()
  const question = getQuestionById(focused.qid, survey).question
  const validateExpression = useExpressionScriptValidation(
    surveyId,
    question.qid
  )
  const hasConditions = (question?.scenarios ?? []).length > 0
  const maybeShowConditionsOverwriteWarning = () => {
    if (hasConditions) {
... (74 lines truncated)
</file>

<file path="editor/src/components/ConditionDesigner/ExpressionScript/handleConditionScriptUpdate.js">
import {
  createBufferOperation,
  QUESTION_RELEVANCE_DEFAULT_VALUE,
} from 'helpers'
import { getApiOperationActions, showSuccessMessage } from '../utils'
export const handleConditionScriptUpdate = (
  script,
  survey,
  questionIndex,
  groupIndex,
  addToBuffer,
  update,
  onNavigateBack = () => {}
) => {
  const question = survey.questionGroups[groupIndex].questions[questionIndex]
  if (
    QUESTION_RELEVANCE_DEFAULT_VALUE !== script.trim() &&
    script.trim() === question.relevance.trim()
  )
    return
  const props = {
    qid: question.qid,
    action: getApiOperationActions().CONDITION_SCRIPT.UPDATE,
    script: script.trim(),
  }
  const operation = createBufferOperation(question.qid)
    .questionCondition()
    .update()
  operation.qid = question.qid
  operation.props = props
... (12 lines truncated)
</file>

<file path="editor/src/components/ConditionDesigner/ExpressionScript/index.js">
export * from './ExpressionScript'
export * from './ExpressionScriptInputBox'
export * from './handleConditionScriptUpdate'
</file>

<file path="editor/src/components/ConditionDesigner/handlers/previousQuestions/helpers/addNoAnswerIfAllowed.js">
import { SOFT_MANDATORY } from 'helpers'
import { questionTypeRequiresBlankNoAnswer } from './questionTypeRequiresBlankNoAnswer'
export const addNoAnswerIfAllowed = (cAnswers, question, fieldname) => {
  const value = questionTypeRequiresBlankNoAnswer(question.type) ? '' : ' '
  const isOptional =
    question.mandatory !== true && question.mandatory !== SOFT_MANDATORY
  if (isOptional) {
    cAnswers.push({
      cfieldname: fieldname,
      value,
      label: t('No answer'),
    })
  }
}
</file>

<file path="editor/src/components/ConditionDesigner/handlers/previousQuestions/helpers/createAnswer.js">
export const createAnswer = (cAnswers, value, label, fieldname) => {
  cAnswers.push({
    cfieldname: fieldname,
    value,
    label,
  })
}
</file>

<file path="editor/src/components/ConditionDesigner/handlers/previousQuestions/helpers/createNumericAnswers.js">
import { createAnswer } from '../helpers'
export const createNumericAnswers = (cAnswers, count, start = 1, fieldname) => {
  for (let i = start; i <= count; i++) {
    createAnswer(cAnswers, i, i, fieldname)
  }
}
</file>

<file path="editor/src/components/ConditionDesigner/handlers/previousQuestions/helpers/createQuestion.js">
import { getQuestionTypeInfo } from 'components/QuestionTypes/index.js'
import { getQuestionText } from '../helpers'
export const createQuestion = (
  cQuestions,
  question,
  subquestion = null,
  fieldname,
  language,
  extraTitle = ''
) => {
  const baseTitle = getQuestionText(question, language)
  let title = baseTitle
  const isRankingQuestion = question.type === getQuestionTypeInfo().RANKING.type
  if (extraTitle && (isRankingQuestion || !subquestion)) {
    title = `[${extraTitle}] ${baseTitle}`
  } else if (subquestion) {
    const subquestionText = getQuestionText(subquestion, language)
    title = `[${subquestionText}]${extraTitle ? `[${extraTitle}]` : ''} ${baseTitle}`
  }
  cQuestions.push({
    title,
    qid: question.qid,
    type: question.type,
    cfieldname: fieldname,
  })
}
</file>

<file path="editor/src/components/ConditionDesigner/handlers/previousQuestions/helpers/createStandardAnswers.js">
import { createAnswer, getAnswerText } from '../helpers'
export const createStandardAnswers = (
  cAnswers,
  question,
  subquestion,
  answers,
  fieldname,
  language
) => {
  for (const answer of answers) {
    createAnswer(
      cAnswers,
      answer.code,
      `${answer.code} (${getAnswerText(answer, language)})`,
      fieldname
    )
  }
}
</file>

<file path="editor/src/components/ConditionDesigner/handlers/previousQuestions/helpers/getAnswerText.js">
import { RemoveHTMLTagsInString } from 'helpers'
export const getAnswerText = (answer, language) =>
  RemoveHTMLTagsInString(answer.l10ns?.[language]?.answer || answer.code)
</file>

<file path="editor/src/components/ConditionDesigner/handlers/previousQuestions/helpers/getQuestionText.js">
import { RemoveHTMLTagsInString } from 'helpers'
export const getQuestionText = (question, language) =>
  RemoveHTMLTagsInString(question.l10ns?.[language]?.question || '')
</file>

<file path="editor/src/components/ConditionDesigner/handlers/previousQuestions/helpers/index.js">
export * from './createAnswer.js'
export * from './createQuestion.js'
export * from './createNumericAnswers.js'
export * from './createStandardAnswers.js'
export * from './getQuestionText.js'
export * from './getAnswerText.js'
export * from './addNoAnswerIfAllowed.js'
export * from './questionTypeRequiresBlankNoAnswer.js'
</file>

<file path="editor/src/components/ConditionDesigner/handlers/previousQuestions/helpers/questionTypeRequiresBlankNoAnswer.js">
import { getQuestionTypeInfo } from 'components/QuestionTypes'
export const questionTypeRequiresBlankNoAnswer = (type) => {
  const questionTypeInfo = getQuestionTypeInfo()
  const blankTypes = [
    'A',
    'B',
    'C',
    'E',
    questionTypeInfo.ARRAY.type,
    questionTypeInfo.ARRAY_COLUMN.type,
    questionTypeInfo.ARRAY_NUMBERS.type,
    questionTypeInfo.ARRAY_TEXT.type,
    questionTypeInfo.ARRAY_DUAL_SCALE.type,
    questionTypeInfo.MULTIPLE_NUMERICAL_INPUTS.type,
    questionTypeInfo.MULTIPLE_SHORT_TEXTS.type,
  ]
  return blankTypes.includes(type)
}
</file>

<file path="editor/src/components/ConditionDesigner/handlers/previousQuestions/typeHandlers/arrayDualScaleTypeHandler.js">
import {
  addNoAnswerIfAllowed,
  createAnswer,
  createQuestion,
  getAnswerText,
} from '../helpers'
import { findFieldname } from '../utils'
export const arrayDualScaleTypeHandler = (
  question,
  language,
  cQuestions,
  cAnswers
) => {
  const subquestions = question.subquestions ?? []
  const label1 = question.attributes?.dualscale_headerA?.[language]?.trim()
    ? question.attributes.dualscale_headerA[language]
    : t('Scale 1')
  const label2 = question.attributes?.dualscale_headerB?.[language]?.trim()
    ? question.attributes.dualscale_headerB[language]
    : t('Scale 2')
  subquestions.forEach((subquestion) => {
    const fieldname0 = findFieldname({
      qid: question.qid,
      sqid: subquestion.qid,
      aid: subquestion.title,
      scaleId: 0,
    })
    const fieldname1 = findFieldname({
      qid: question.qid,
      sqid: subquestion.qid,
... (36 lines truncated)
</file>

<file path="editor/src/components/ConditionDesigner/handlers/previousQuestions/typeHandlers/arrayNumbersTextsTypeHandler.js">
import { createQuestion, getQuestionText } from '../helpers'
import { findFieldname } from '../utils'
export const arrayNumbersTextsTypeHandler = (
  question,
  language,
  cQuestions
) => {
  const xAxis = {}
  ;(question.subquestions ?? [])
    .filter((sq) => sq.scaleId === 1)
    .forEach((sq) => {
      xAxis[sq.title] = getQuestionText(sq, language)
    })
  ;(question.subquestions ?? [])
    .filter((sq) => sq.scaleId === 0)
    .forEach((sq) => {
      Object.entries(xAxis).forEach(([key, value]) => {
        const fieldname = findFieldname({
          qid: question.qid,
          sqid: sq.qid,
          aid: sq.title + '_' + key,
        })
        createQuestion(
          cQuestions,
          question,
          sq,
          fieldname,
          language,
          `${value}`
        )
... (4 lines truncated)
</file>

<file path="editor/src/components/ConditionDesigner/handlers/previousQuestions/typeHandlers/arrayTypeHandler.js">
import {
  addNoAnswerIfAllowed,
  createQuestion,
  createStandardAnswers,
} from '../helpers'
import { findFieldname } from '../utils'
export const arrayTypeHandler = (question, language, cQuestions, cAnswers) => {
  const subquestions = question.subquestions ?? []
  for (let j = 0; j < subquestions.length; j++) {
    const fieldname = findFieldname({
      qid: question.qid,
      sqid: subquestions[j].qid,
      aid: subquestions[j].title,
    })
    createQuestion(cQuestions, question, subquestions[j], fieldname, language)
    createStandardAnswers(
      cAnswers,
      question,
      subquestions[j],
      question.answers ?? [],
      fieldname,
      language
    )
    addNoAnswerIfAllowed(cAnswers, question, fieldname)
  }
}
</file>

<file path="editor/src/components/ConditionDesigner/handlers/previousQuestions/typeHandlers/dateTimeTypeHandler.js">
import {
  addNoAnswerIfAllowed,
  createQuestion,
  createStandardAnswers,
} from '../helpers'
import { findFieldname } from '../utils'
export const dateTimeTypeHandler = (
  question,
  language,
  cQuestions,
  cAnswers
) => {
  const fieldname = findFieldname({
    qid: question.qid,
  })
  createQuestion(cQuestions, question, null, fieldname, language)
  createStandardAnswers(
    cAnswers,
    question,
    null,
    question.answers ?? [],
    fieldname,
    language
  )
  addNoAnswerIfAllowed(cAnswers, question, fieldname)
}
</file>

<file path="editor/src/components/ConditionDesigner/handlers/previousQuestions/typeHandlers/defaultTypeHandler.js">
import { RemoveHTMLTagsInString } from 'helpers'
import { addNoAnswerIfAllowed, createAnswer, createQuestion } from '../helpers'
import { findFieldname } from '../utils'
export const defaultTypeHandler = (
  question,
  language,
  cQuestions,
  cAnswers
) => {
  const fieldname = findFieldname({
    qid: question.qid,
  })
  createQuestion(cQuestions, question, null, fieldname, language)
  const answers = question.answers ?? []
  for (let k = 0; k < answers.length; k++) {
    createAnswer(
      cAnswers,
      answers[k].code,
      `${answers[k].code} (${RemoveHTMLTagsInString(answers[k].l10ns?.[language]?.answer || answers[k].code)})`,
      fieldname
    )
  }
  addNoAnswerIfAllowed(cAnswers, question, fieldname)
}
</file>

<file path="editor/src/components/ConditionDesigner/handlers/previousQuestions/typeHandlers/fivePointChoiceTypeHandler.js">
import {
  createQuestion,
  addNoAnswerIfAllowed,
  createNumericAnswers,
} from '../helpers'
import { findFieldname } from '../utils'
export const fivePointChoiceTypeHandler = (
  question,
  language,
  cQuestions,
  cAnswers
) => {
  const fieldname = findFieldname({
    qid: question.qid,
  })
  createQuestion(cQuestions, question, null, fieldname, language)
  createNumericAnswers(cAnswers, 5, 1, fieldname)
  addNoAnswerIfAllowed(cAnswers, question, fieldname)
}
</file>

<file path="editor/src/components/ConditionDesigner/handlers/previousQuestions/typeHandlers/genderTypeHandler.js">
import { addNoAnswerIfAllowed, createAnswer, createQuestion } from '../helpers'
import { findFieldname } from '../utils'
export const genderTypeHandler = (question, language, cQuestions, cAnswers) => {
  const fieldname = findFieldname({
    qid: question.qid,
  })
  createQuestion(cQuestions, question, null, fieldname, language)
  createAnswer(cAnswers, 'F', t('Female (F)'), fieldname)
  createAnswer(cAnswers, 'M', t('Male (M)'), fieldname)
  addNoAnswerIfAllowed(cAnswers, question, fieldname)
}
</file>

<file path="editor/src/components/ConditionDesigner/handlers/previousQuestions/typeHandlers/increaseDecreaseTypeHandler.js">
import { findFieldname } from '../utils'
import { addNoAnswerIfAllowed, createAnswer, createQuestion } from '../helpers'
export const increaseDecreaseTypeHandler = (
  question,
  language,
  cQuestions,
  cAnswers
) => {
  const fieldname = findFieldname({
    qid: question.qid,
  })
  const choices = [
    { value: 'I', labelKey: t('Increase') },
    { value: 'S', labelKey: t('Same') },
    { value: 'D', labelKey: t('Decrease') },
  ]
  createQuestion(cQuestions, question, null, fieldname, language)
  choices.forEach(({ value, labelKey }) =>
    createAnswer(cAnswers, value, labelKey, fieldname)
  )
  addNoAnswerIfAllowed(cAnswers, question, fieldname)
}
</file>

<file path="editor/src/components/ConditionDesigner/handlers/previousQuestions/typeHandlers/index.js">
export * from './fivePointChoiceTypeHandler'
export * from './tenPointChoiceTypeHandler'
export * from './yesNoUncertainTypeHandler'
export * from './increaseDecreaseTypeHandler'
export * from './arrayTypeHandler'
export * from './genderTypeHandler'
export * from './arrayNumbersTextsTypeHandler'
export * from './arrayDualScaleTypeHandler'
export * from './multipleInputsTypeHandler'
export * from './multipleChoiceTypeHandler'
export * from './rankingTypeHandler'
export * from './yesNoTypeHandler'
export * from './numericTypeHandler'
export * from './dateTimeTypeHandler'
export * from './singleChoiceTypeHandler'
export * from './defaultTypeHandler'
</file>

<file path="editor/src/components/ConditionDesigner/handlers/previousQuestions/typeHandlers/multipleChoiceTypeHandler.js">
import { createAnswer, createQuestion } from '../helpers'
import { findFieldname } from '../utils'
export const multipleChoiceTypeHandler = (
  question,
  language,
  cQuestions,
  cAnswers
) => {
  const subquestions = question.subquestions ?? []
  for (let j = subquestions.length - 1; j >= 0; j--) {
    const fieldname =
      '+' +
      findFieldname({
        qid: question.qid,
        sqid: subquestions[j].qid,
        aid: subquestions[j].title,
      })
    createQuestion(
      cQuestions,
      question,
      subquestions[j],
      fieldname,
      language,
      `Single checkbox`
    )
    createAnswer(cAnswers, 'Y', t('Checked (Y)'), fieldname)
    createAnswer(cAnswers, '', t('Not checked'), fieldname)
  }
}
</file>

<file path="editor/src/components/ConditionDesigner/handlers/previousQuestions/typeHandlers/multipleInputsTypeHandler.js">
import { addNoAnswerIfAllowed, createQuestion } from '../helpers'
import { findFieldname } from '../utils'
export const multipleInputsTypeHandler = (
  question,
  language,
  cQuestions,
  cAnswers
) => {
  const subquestions = question.subquestions ?? []
  for (let j = subquestions.length - 1; j >= 0; j--) {
    const fieldname = findFieldname({
      qid: question.qid,
      sqid: subquestions[j].qid,
      aid: subquestions[j].title,
    })
    createQuestion(cQuestions, question, subquestions[j], fieldname, language)
    addNoAnswerIfAllowed(cAnswers, question, fieldname)
  }
}
</file>

<file path="editor/src/components/ConditionDesigner/handlers/previousQuestions/typeHandlers/numericTypeHandler.js">
import { findFieldname } from '../utils'
import { addNoAnswerIfAllowed, createQuestion } from '../helpers'
export const numericTypeHandler = (
  question,
  language,
  cQuestions,
  cAnswers
) => {
  const fieldname = findFieldname({
    qid: question.qid,
  })
  createQuestion(cQuestions, question, null, fieldname, language)
  addNoAnswerIfAllowed(cAnswers, question, fieldname)
}
</file>

<file path="editor/src/components/ConditionDesigner/handlers/previousQuestions/typeHandlers/rankingTypeHandler.js">
import { format } from 'util'
import {
  addNoAnswerIfAllowed,
  createAnswer,
  createQuestion,
  getQuestionText,
} from '../helpers'
import { findFieldname } from '../utils'
export const rankingTypeHandler = (
  question,
  language,
  cQuestions,
  cAnswers
) => {
  const subquestions = question.subquestions
  const rankingAnswers = subquestions.map((subquestion) => ({
    value: subquestion.title,
    label: `${subquestion.title} (${getQuestionText(subquestion, language)})`,
  }))
  for (let j = 0; j < subquestions.length; j++) {
    const rankingPos = j + 1
    const fieldname = findFieldname({
      qid: question.qid,
      sqid: subquestions[j].qid,
      aid: rankingPos,
    })
    createQuestion(
      cQuestions,
      question,
      subquestions[j],
... (11 lines truncated)
</file>

<file path="editor/src/components/ConditionDesigner/handlers/previousQuestions/typeHandlers/singleChoiceTypeHandler.js">
import {
  addNoAnswerIfAllowed,
  createQuestion,
  createStandardAnswers,
} from '../helpers'
import { findFieldname } from '../utils'
export const singleChoiceTypeHandler = (
  question,
  language,
  cQuestions,
  cAnswers
) => {
  const fieldname = findFieldname({
    qid: question.qid,
  })
  createQuestion(cQuestions, question, null, fieldname, language)
  createStandardAnswers(
    cAnswers,
    question,
    null,
    question.answers ?? [],
    fieldname,
    language
  )
  addNoAnswerIfAllowed(cAnswers, question, fieldname)
}
</file>

<file path="editor/src/components/ConditionDesigner/handlers/previousQuestions/typeHandlers/tenPointChoiceTypeHandler.js">
import { findFieldname } from '../utils'
import {
  createQuestion,
  addNoAnswerIfAllowed,
  createNumericAnswers,
} from '../helpers'
export const tenPointChoiceTypeHandler = (
  question,
  language,
  cQuestions,
  cAnswers
) => {
  const fieldname = findFieldname({
    qid: question.qid,
  })
  createQuestion(cQuestions, question, null, fieldname, language)
  createNumericAnswers(cAnswers, 10, 1, fieldname)
  addNoAnswerIfAllowed(cAnswers, question, fieldname)
}
</file>

<file path="editor/src/components/ConditionDesigner/handlers/previousQuestions/typeHandlers/yesNoTypeHandler.js">
import { findFieldname } from '../utils'
import { addNoAnswerIfAllowed, createAnswer, createQuestion } from '../helpers'
export const yesNoTypeHandler = (question, language, cQuestions, cAnswers) => {
  const fieldname = findFieldname({
    qid: question.qid,
  })
  createQuestion(cQuestions, question, null, fieldname, language)
  createAnswer(cAnswers, 'Y', t('Yes'), fieldname)
  createAnswer(cAnswers, 'N', t('No'), fieldname)
  addNoAnswerIfAllowed(cAnswers, question, fieldname)
}
</file>

<file path="editor/src/components/ConditionDesigner/handlers/previousQuestions/typeHandlers/yesNoUncertainTypeHandler.js">
import { addNoAnswerIfAllowed, createAnswer, createQuestion } from '../helpers'
import { findFieldname } from '../utils'
export const yesNoUncertainTypeHandler = (
  question,
  language,
  cQuestions,
  cAnswers
) => {
  const fieldname = findFieldname({
    qid: question.qid,
  })
  const choices = [
    { value: 'Y', labelKey: t('Yes') },
    { value: 'U', labelKey: t('Uncertain') },
    { value: 'N', labelKey: t('No') },
  ]
  createQuestion(cQuestions, question, null, fieldname, language)
  choices.forEach(({ value, labelKey }) =>
    createAnswer(cAnswers, value, labelKey, fieldname)
  )
  addNoAnswerIfAllowed(cAnswers, question, fieldname)
}
</file>

<file path="editor/src/components/ConditionDesigner/handlers/previousQuestions/utils/findFieldname.js">
import { STATES } from 'helpers'
import { queryClient } from 'queryClient'
export function findFieldname({ qid, sqid, aid, scaleId }) {
  const questionsFieldNamesMap =
    queryClient.getQueryData([STATES.SURVEY_QUESTIONS_FIELDNAME]) || {}
  return (
    questionsFieldNamesMap[qid]?.find(
      (item) =>
        (qid ? item.qid == qid : true) &&
        (sqid ? item.sqid == sqid : true) &&
        (aid ? item.aid == aid : true) &&
        (scaleId !== undefined ? item.scale_id == scaleId : true)
    )?.fieldname || null
  )
}
</file>

<file path="editor/src/components/ConditionDesigner/handlers/previousQuestions/utils/index.js">
export * from './findFieldname'
</file>

<file path="editor/src/components/ConditionDesigner/handlers/previousQuestions/previousQuestionsHandler.js">
import {
  getPreviousQuestions,
  isTrue,
  NEW_OBJECT_ID_PREFIX,
  OTHER_CODE,
} from 'helpers'
import { getQuestionTypeInfo } from 'components/QuestionTypes'
import {
  yesNoUncertainTypeHandler,
  increaseDecreaseTypeHandler,
  arrayTypeHandler,
  genderTypeHandler,
  arrayNumbersTextsTypeHandler,
  arrayDualScaleTypeHandler,
  multipleInputsTypeHandler,
  multipleChoiceTypeHandler,
  rankingTypeHandler,
  yesNoTypeHandler,
  numericTypeHandler,
  dateTimeTypeHandler,
  singleChoiceTypeHandler,
  defaultTypeHandler,
  fivePointChoiceTypeHandler,
  tenPointChoiceTypeHandler,
} from './typeHandlers'
import { createAnswer } from './helpers'
import { findFieldname } from './utils'
const handleAttributes = (question, cAnswers) => {
  const fieldname = findFieldname({
    qid: question.qid,
... (60 lines truncated)
</file>

<file path="editor/src/components/ConditionDesigner/Overlays/ConditionScriptOverwriteConfirmation.js">
import { foldGutter, foldService } from '@codemirror/language'
import { autocompletion } from '@codemirror/autocomplete'
import { Button, ExpressionScriptEditor } from 'components/UIComponents'
import { SwalAlert } from 'helpers'
import { makeExpressionReadable } from '../utils'
export const ConditionScriptOverwriteConfirmation = ({
  script,
  onConfirmChanges,
  onCancelChanges = () => {},
}) => {
  return (
    <div className="condition-designer-overlay">
      <div className="condition-designer-overlay-title">
        <p>{t('Overwriting condition from ExpressionScript')}</p>
      </div>
      <div className="condition-designer-overlay-message">
        {t(
          'The condition created inside the builder will replace your existing condition written in ExpressionScript mode. This action cannot be undone. Do you want to apply your changes?'
        )}
      </div>
      <div className="condition-designer-overlay-message mt-3">
        <p>{t('This script will be overwritten:')}</p>
        <div className="text-start condition-designer-overlay-textarea-container mt-1">
          <ExpressionScriptEditor
            id="expression-script-editor"
            value={makeExpressionReadable(script)}
            height="150px"
            width="100%"
            className="text-start expression-script-codemirror"
            readOnly
... (34 lines truncated)
</file>

<file path="editor/src/components/ConditionDesigner/Overlays/ConditionsOverwriteConfirmationOverlay.js">
import { Button } from 'components/UIComponents'
import { SwalAlert } from 'helpers'
export const ConditionOverwriteConfirmation = ({
  onConfirmChanges,
  onCancelChanges = () => {},
}) => {
  return (
    <div className="condition-designer-overlay">
      <div className="condition-designer-overlay-title">
        <p>{t('Overwriting condition from condition builder')}</p>
      </div>
      <p className="condition-designer-overlay-message">
        {t(
          'Your condition will no longer be editable in the visual builder. Are you sure you want to apply these changes?'
        )}
      </p>
      <div className="condition-designer-overlay-actions d-flex justify-content-end">
        <Button
          variant="secondary"
          className="condition-designer-overlay-secondary-button"
          onClick={() => {
            SwalAlert.close()
            onCancelChanges()
          }}
        >
          {t('Cancel')}
        </Button>
        <Button
          variant="primary"
          className="condition-designer-overlay-primary-button"
... (12 lines truncated)
</file>

<file path="editor/src/components/ConditionDesigner/Overlays/DeleteScenarioOverlay.js">
import { Button } from 'components'
import { SwalAlert } from 'helpers'
import { format } from 'util'
export const DeleteScenarioOverlay = ({ scenarioId, onConfirmDelete }) => {
  return (
    <div className="condition-designer-overlay">
      <div className="condition-designer-overlay-title">
        <p>{t('Confirm')}</p>
      </div>
      <p className="condition-designer-overlay-message">
        {format(
          t('Are you sure you want to delete scenario %s for this question?'),
          scenarioId
        )}
      </p>
      <div className="condition-designer-overlay-actions d-flex justify-content-end">
        <Button
          variant="secondary"
          className="condition-designer-overlay-secondary-button"
          onClick={() => SwalAlert.close()}
        >
          {t('Cancel')}
        </Button>
        <Button
          variant="danger"
          className="condition-designer-overlay-danger-button"
          onClick={() => {
            SwalAlert.close()
            onConfirmDelete()
          }}
... (8 lines truncated)
</file>

<file path="editor/src/components/ConditionDesigner/Overlays/ExpressionScriptEditorOverlay.js">
import { useState } from 'react'
import { foldGutter, foldService } from '@codemirror/language'
import { autocompletion } from '@codemirror/autocomplete'
import { ExpressionScriptEditor } from 'components/UIComponents'
import { QUESTION_RELEVANCE_DEFAULT_VALUE, SwalAlert } from 'helpers'
import { Button } from 'components'
import {
  isValidRelevanceValue,
  makeExpressionReadable,
  clean,
  showConditionOverwriteConfirmationOverlay,
} from '../utils'
export const ExpressionScriptEditorOverlay = ({
  question,
  onApply,
  validateExpression,
}) => {
  const expressionScript =
    question?.relevance === QUESTION_RELEVANCE_DEFAULT_VALUE
      ? ''
      : question?.relevance || ''
  const [content, setContent] = useState(
    makeExpressionReadable(expressionScript)
  )
  const [cleanContent, setCleanContent] = useState(clean(content))
  const handleChange = (newContent) => {
    setCleanContent(clean(newContent))
    setContent(newContent)
  }
  const handleApplyClick = () => {
... (57 lines truncated)
</file>

<file path="editor/src/components/ConditionDesigner/Overlays/index.js">
export * from './ExpressionScriptEditorOverlay'
export * from './ResetAllConditionsOverlay'
export * from './DeleteScenarioOverlay'
export * from './UnsavedChangesOverlay'
export * from './ConditionsOverwriteConfirmationOverlay'
export * from './ConditionScriptOverwriteConfirmation'
</file>

<file path="editor/src/components/ConditionDesigner/Overlays/ResetAllConditionsOverlay.js">
import { Button } from 'components'
import { SwalAlert } from 'helpers'
export const ResetAllConditionsOverlay = ({ onConfirmDelete }) => {
  return (
    <div className="condition-designer-overlay">
      <div className="condition-designer-overlay-title reg24">
        <p>{t('Delete condition')}</p>
      </div>
      <p className="condition-designer-overlay-message reg14">
        {t('Are you sure you want to delete all conditions for this question?')}
      </p>
      <div className="condition-designer-overlay-actions d-flex justify-content-end">
        <Button
          variant="secondary"
          className="condition-designer-overlay-secondary-button"
          onClick={() => SwalAlert.close()}
        >
          {t('Cancel')}
        </Button>
        <Button
          variant="danger"
          className="condition-designer-overlay-danger-button"
          onClick={() => {
            SwalAlert.close()
            onConfirmDelete()
          }}
        >
          {t('Delete')}
        </Button>
      </div>
... (4 lines truncated)
</file>

<file path="editor/src/components/ConditionDesigner/Overlays/UnsavedChangesOverlay.js">
import { Button } from 'components'
import { SwalAlert } from 'helpers'
export const UnsavedChangesOverlay = ({ onIgnoreChanges, message = false }) => {
  const defaultMessage = t(
    'You are about to go back without saving your changes on this scenario. Do you want to proceed?'
  )
  return (
    <div className="condition-designer-overlay">
      <div className="condition-designer-overlay-title reg24">
        <p>{t('Unsaved changes')}</p>
      </div>
      <p className="condition-designer-overlay-message reg14">
        {message ? message : defaultMessage}
      </p>
      <div className="condition-designer-overlay-actions d-flex justify-content-end">
        <Button
          variant="secondary"
          className="condition-designer-overlay-secondary-button"
          onClick={() => {
            onIgnoreChanges()
            SwalAlert.close()
          }}
        >
          {t('Go back without saving')}
        </Button>
        <Button
          variant="primary"
          className="condition-designer-overlay-primary-button"
          onClick={() => SwalAlert.close()}
        >
... (7 lines truncated)
</file>

<file path="editor/src/components/ConditionDesigner/utils/conditionAlertHelpers.js">
import React from 'react'
import { htmlPopup, Toast } from 'helpers'
import { CheckIcon, ExclamationIcon, ExclamationMark } from 'components/icons'
import {
  ConditionOverwriteConfirmation,
  ConditionScriptOverwriteConfirmation,
  DeleteScenarioOverlay,
  ResetAllConditionsOverlay,
  UnsavedChangesOverlay,
} from '../Overlays'
export const showSuccessMessage = (
  message = t('Condition applied successfully')
) => {
  Toast({
    message: message,
    position: 'bottom-center',
    className: 'generic-toast green-left-mark',
    leftIcon: (
      <CheckIcon
        className={`fill-current text-white rounded-circle bg-dark me-1`}
      />
    ),
  })
}
export const showWarningMessage = (message, position = 'bottom-right') => {
  if (!message) return
  Toast({
    message: message,
    position: position,
    className: 'generic-toast yellow-left-mark',
... (85 lines truncated)
</file>

<file path="editor/src/components/ConditionDesigner/utils/expressionScriptHelpers.js">
export const makeExpressionReadable = (content) => {
  let cleaned = content.replace(/\s+/g, ' ').trim()
  const functionRegex = /\b(?:regexMatch|is_empty)\s*\([^()]*\)/g
  const protectedFns = []
  let protectedContent = cleaned.replace(functionRegex, (match) => {
    const token = `__FN_${protectedFns.length}__`
    protectedFns.push(match)
    return token
  })
  let tokens = protectedContent
    .replace(/(\()|(\))|(?<!["'])\b(?:and|or)\b(?!["'])/g, (match, p1, p2) => {
      if (p1) return '\n(\n'
      if (p2) return '\n)\n'
      return `\n${match}\n`
    })
    .split('\n')
    .map((line) => line.trim())
    .filter(Boolean)
  let merged = []
  for (let i = 0; i < tokens.length; i++) {
    if (tokens[i] === '(') {
      let j = i + 1
      let inner = ''
      let parenDepth = 1
      while (j < tokens.length && parenDepth > 0) {
        if (tokens[j] === '(') parenDepth++
        else if (tokens[j] === ')') parenDepth--
        if (parenDepth > 0) {
          inner += tokens[j] + ' '
        }
... (47 lines truncated)
</file>

<file path="editor/src/components/ConditionDesigner/utils/getAllowedMethods.js">
export const getAllowedMethods = () => {
  return {
    LESS_THAN: '<',
    LESS_THAN_OR_EQUAL: '<=',
    EQUAL: '==',
    NOT_EQUAL: '!=',
    GREATER_THAN_OR_EQUAL: '>=',
    GREATER_THAN: '>',
    REGEX: 'RX',
  }
}
</file>

<file path="editor/src/components/ConditionDesigner/utils/getApiOperationActions.js">
export const getApiOperationActions = () => {
  return {
    CONDITION: {
      CREATE: 'insertCondition',
      UPDATE: 'updateCondition',
      DELETE: 'deleteCondition',
    },
    CONDITION_SCRIPT: {
      UPDATE: 'conditionScript',
    },
    SCENARIO: {
      DELETE: 'deleteScenario',
    },
  }
}
</file>

<file path="editor/src/components/ConditionDesigner/utils/getConditionTypeInfo.js">
export const getConditionTypeInfo = () => {
  return {
    SOURCE: {
      QUESTION: 'Question',
      PARTICIPANT_DATA: 'Token',
    },
    TARGET: {
      ANSWER_OPTIONS: 'Answer',
      CONSTANT: 'Constant',
      ANSWER_OF_OTHER_QUESTION: 'Question',
      REGEX: 'RegExp',
      PARTICIPANT_DATA: 'Token',
    },
  }
}
</file>

<file path="editor/src/components/ConditionDesigner/utils/index.js">
export * from './getConditionTypeInfo'
export * from './getAllowedMethods'
export * from './getApiOperationActions'
export * from './questionConditionHelpers'
export * from './scenarioConditionsParser'
export * from './scenarioPayloadBuilder'
export * from './conditionAlertHelpers'
export * from './expressionScriptHelpers'
</file>

<file path="editor/src/components/ConditionDesigner/utils/questionConditionHelpers.js">
import { QUESTION_RELEVANCE_DEFAULT_VALUE } from 'helpers'
import { getConditionTypeInfo } from './getConditionTypeInfo'
import { getAllowedMethods } from './getAllowedMethods'
const conditionTypeInfo = getConditionTypeInfo()
const allowedMethods = getAllowedMethods()
export const getDefaultCondition = () => ({
  qid: '',
  cqid: '',
  cfieldname: '',
  cquestions: '',
  method: '',
  value: null,
  answers: [],
  scenario: '',
  sourceType: conditionTypeInfo.SOURCE.QUESTION,
  targetType: conditionTypeInfo.TARGET.ANSWER_OPTIONS,
  isDeleted: false,
  isUpdated: false,
})
// Checks if a condition has been modified from its original version
export const hasConditionChanged = (
  currentCondition,
  scenarioToPatch,
  question
) => {
  if (!scenarioToPatch) return false
  // Find the original condition in the current scenario
  const scenario = question.scenarios.find(
    (s) => s.scid === scenarioToPatch.scid
  )
... (189 lines truncated)
</file>

<file path="editor/src/components/ConditionDesigner/utils/scenarioConditionsParser.js">
import {
  determineConditionSourceType,
  determineConditionTargetType,
  getBaseConditionObject,
} from './questionConditionHelpers'
export const buildScenarioConditionsForUpdate = (
  scenario,
  previousQuestions
) => {
  if (!scenario) return false
  const scenarios = scenario.conditions.map((condition) => {
    const processedCondition = getBaseConditionObject(condition, scenario.scid)
    determineConditionSourceType(condition, processedCondition)
    determineConditionTargetType(
      condition,
      processedCondition,
      previousQuestions
    )
    if (!processedCondition.answers) {
      processedCondition.answers = []
    }
    return processedCondition
  })
  return scenarios.sort((a, b) => {
    return a.cfieldname.localeCompare(b.cfieldname)
  })
}
</file>

<file path="editor/src/components/ConditionDesigner/utils/scenarioPayloadBuilder.js">
import { getApiOperationActions } from './getApiOperationActions'
const sourceTabs = {
  Question: '#SRCPREVQUEST',
  Token: '#SRCTOKENATTRS',
}
const targetTabs = {
  Answer: '#CANSWERSTAB',
  Constant: '#CONST',
  Question: '#PREVQUESTIONS',
  Token: '#TOKENATTRS',
  RegExp: '#REGEXP',
}
export const buildScenarioPayload = (question, conditions, scenarioName) => {
  const apiActions = getApiOperationActions()
  const qid = question.qid
  const tempIdSeed = Math.floor(Math.random() * 1000000)
  const tempIdPrefix = `temp__${tempIdSeed}`
  let tempIdIndex = 1
  const scenarios = []
  const createApiCondition = (condition, value) => {
    const apiCondition = {
      qid: condition.qid,
      cqid: condition.cqid,
      cfieldname: condition.cfieldname,
      cquestions: condition.cquestions,
      method: condition.method ?? '==',
      value: value,
      scenario: scenarioName,
      action: condition.cid
        ? apiActions.CONDITION.UPDATE
... (52 lines truncated)
</file>

<file path="editor/src/components/ConditionDesigner/AddScenario.js">
import React from 'react'
import { Button } from 'components'
import { AddIcon } from 'components/icons'
export const AddScenario = ({ onShowPanel }) => {
  return (
    <>
      <div className="mb-3">
        <hr className="mb-3" />
        <div>
          <p className="mb-3 fw-bolder">{t('Condition designer')}</p>
          <div className="d-flex align-items-center">
            <Button
              variant="secondary"
              className="add-condition-button d-flex align-items-center justify-content-center"
              onClick={() => onShowPanel(null, true)}
            >
              <AddIcon className="text-white fill-current" />
            </Button>
            <span className="d-inline fw-bolder">{t('New logic')}</span>
          </div>
        </div>
      </div>
    </>
  )
}
</file>

<file path="editor/src/components/ConditionDesigner/ConditionDesigner.js">
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
import classNames from 'classnames'
import { PlusLg } from 'react-bootstrap-icons'
import { Button, Input } from 'components'
import { useBuffer, useFocused, useConditionDesigner } from 'hooks'
import { SideBarHeader } from 'components/SideBar'
import { ArrowLeftIcon } from 'components/icons'
import { getQuestionById, QUESTION_RELEVANCE_DEFAULT_VALUE } from 'helpers'
import { previousQuestionsHandler } from './handlers/previousQuestions/previousQuestionsHandler'
import { ConditionItem } from './ConditionItem'
import {
  buildScenarioConditionsForUpdate,
  getAllowedMethods,
  getConditionTypeInfo,
  getDefaultCondition,
  hasUnsavedChanges,
  showConditionScriptOverwriteConfirmationOverlay,
  showUnsavedChangesOverlay,
  showWarningMessage,
} from './utils'
const conditionTypeInfo = getConditionTypeInfo()
const scenarioActions = {
  CREATE: 'create',
  UPDATE: 'update',
}
export const ConditionDesigner = ({
  survey,
  update,
  language,
  scenarioToPatch = null,
... (185 lines truncated)
</file>

<file path="editor/src/components/ConditionDesigner/ConditionItem.js">
import React, { useState } from 'react'
import { Button } from 'components'
import { DeleteIcon, RecoverIcon } from 'components/icons'
import {
  AnswerOptionsSelect,
  AnswerTypeSelect,
  ConstantInput,
  OperatorSelect,
  ParticipantDataSelect,
  QuestionsAsAnswerSelect,
  QuestionsSelect,
  QuestionTypeToggle,
  RegexInput,
} from './ConditionFormFields'
import { getConditionTypeInfo } from './utils'
export const ConditionItem = ({
  index,
  condition,
  pervCondition,
  previousQuestions,
  updateCondition,
  removeCondition,
  focused,
  survey,
  isUpdateAction,
}) => {
  const [isDeleted, setIsDeleted] = useState(condition.isDeleted || false)
  const conditionTypeInfo = getConditionTypeInfo()
  const handleToggleDelete = () => {
    if (condition.cid) {
... (128 lines truncated)
</file>

<file path="editor/src/components/ConditionDesigner/ScenarioList.js">
import { format } from 'util'
import React, { useCallback, useEffect, useState } from 'react'
import { useParams } from 'react-router-dom'
import classNames from 'classnames'
import { useBuffer, useFocused, useSurvey } from 'hooks'
import {
  createBufferOperation,
  getQuestionById,
  QUESTION_RELEVANCE_DEFAULT_VALUE,
} from 'helpers'
import { Button } from 'components'
import { CloseCircleIcon } from 'components/icons'
import { getApiOperationActions, showDeleteScenarioOverlay } from './utils'
export const ScenarioList = ({
  setScenarioToPatch,
  pendingScenarioName,
  setPendingScenarioName,
}) => {
  const { surveyId } = useParams()
  const { survey, update } = useSurvey(surveyId)
  const { focused, groupIndex, questionIndex } = useFocused()
  const { addToBuffer } = useBuffer()
  const question = getQuestionById(focused.qid, survey).question
  const scenarios = question?.scenarios || []
  const [hasTempId, setHasTempId] = useState(!!pendingScenarioName)
  useEffect(() => {
    if (!pendingScenarioName) return
    const processedScenario = scenarios.find(
      (scenario) => scenario.scid === pendingScenarioName
    )
... (84 lines truncated)
</file>

<file path="editor/src/components/EditableImage/EditableImage.js">
import { useState } from 'react'
import { Button } from 'react-bootstrap'
import { ImageEditor } from 'components/UIComponents'
import { DeleteIcon, EditIcon } from 'components/icons'
export const EditableImage = ({
  width,
  height,
  imageSrc,
  handleRemoveImage = () => {},
  showControllers = true,
  update,
}) => {
  const [selectedFile, setSelectedFile] = useState(null)
  const [show, setShow] = useState(false)
  const handleClose = () => setShow(false)
  const handleEditImage = () => {
    setShow(true)
    setSelectedFile({
      ...{
        ...imageSrc,
        zoom: 1,
        rotate: 0,
        radius: 0,
      },
    })
  }
  return (
    <div
      className="position-relative transition-all"
      style={{
... (47 lines truncated)
</file>

<file path="editor/src/components/EditableImage/EditableImage.stories.js">
import { EditableImage } from './EditableImage'
export default {
  title: 'EditableImage',
}
export const Basic = () => {
  return <EditableImage />
}
export const Customized = () => {
  return (
    <EditableImage
      width={'180px'}
      height={'120px'}
      handleRemoveImage={() => {}}
      showController={false}
      imageSrc={
        'https://media.istockphoto.com/id/1460853312/photo/abstract-connected-dots-and-lines-concept-of-ai-technology-motion-of-digital-data-flow.jpg?s=2048x2048&w=is&k=20&c=7yqKsEDy7_n6bG1jOFFFmYGYDa0MiSjJjYH_JvbxuWs='
      }
    />
  )
}
</file>

<file path="editor/src/components/EndScreenSettings/EndScreenSettings.js">
import React from 'react'
import { Button } from 'react-bootstrap'
import classNames from 'classnames'
import { useBuffer, useFocused, useSurvey } from 'hooks'
import { SideBarHeader } from 'components/SideBar'
import { SettingsWrapper, Input } from 'components/UIComponents'
import { createBufferOperation } from '../../helpers'
import { CloseIcon } from '../icons'
export const EndScreenSettings = ({ surveyId }) => {
  const {
    survey: { languageSettings, language },
    update,
  } = useSurvey(surveyId)
  const { focused = {}, unFocus, setFocused } = useFocused()
  const { addToBuffer } = useBuffer()
  const handleUpdate = (updated) => {
    const updateData = {
      ...languageSettings,
    }
    updateData[language] = {
      ...updateData[language],
      ...updated,
    }
    const operation = createBufferOperation(null)
      .languageSetting()
      .update({
        [language]: updated,
      })
    addToBuffer(operation)
    update({ languageSettings: updateData })
... (45 lines truncated)
</file>

<file path="editor/src/components/EndScreenSettings/EndScreenSettings.stories.js">
import { EndScreenSettings as EndScreenSettingsComponent } from './EndScreenSettings'
export default {
  title: 'EndScreenSettings',
  component: EndScreenSettingsComponent,
}
export const EndScreenSettings = () => {
  const surveyId = '78f91e52-6028-11ed-82e1-7ac846e3af9d'
  return <EndScreenSettingsComponent surveyId={surveyId} />
}
</file>

<file path="editor/src/components/EndScreenSettings/EndScreenSettings.test.js">
import 'tests/mocks'
import { renderWithProviders } from 'tests/testUtils'
import { EndScreenSettings } from './EndScreenSettings'
import { screen, waitFor } from '@testing-library/react'
describe('EndScreenSettings', () => {
  test('Should render EndScreenSettings correctly', async () => {
    await renderWithProviders(<EndScreenSettings />)
    const container = await waitFor(() =>
      screen.getByTestId('end-screen-settings')
    )
    expect(container).toBeInTheDocument()
  })
})
</file>

<file path="editor/src/components/feedback/FeedbackPopup.js">
import { useEffect, useMemo, useState } from 'react'
import { Button, Card, Form } from 'react-bootstrap'
import { useFeedbackForm, useCookieFeedbackStore } from 'hooks'
import {
  FEEDBACK_TYPES,
  FeedbackEventHandler,
  getFeedbackConfigs,
} from 'helpers'
import { CloseIcon } from 'components/icons'
export const FeedbackPopup = () => {
  const { updateFeedbackData } = useCookieFeedbackStore()
  const { showFeedbackForm, trackInitialLoad, shouldShowFeedback } =
    useFeedbackForm()
  const [isFeedbackPopupVisible, setFeedbackPopupVisible] = useState(false)
  const [currentFeedbackType, setCurrentFeedbackType] = useState(null)
  useEffect(() => {
    trackInitialLoad(FEEDBACK_TYPES.GENERAL)
    const checkAndShowFeedback = () => {
      if (
        shouldShowFeedback(FEEDBACK_TYPES.GENERAL) &&
        !isFeedbackPopupVisible &&
        !currentFeedbackType
      ) {
        setCurrentFeedbackType(FEEDBACK_TYPES.GENERAL)
        setFeedbackPopupVisible(true)
        updateFeedbackData(FEEDBACK_TYPES.GENERAL, {
          previouslyShown: new Date().toISOString(),
        })
      }
    }
... (90 lines truncated)
</file>

<file path="editor/src/components/feedback/index.js">
export * from './FeedbackPopup'
</file>

<file path="editor/src/components/GroupSettings/GroupAttribute.js">
import { SettingsWrapper } from 'components/UIComponents'
export const GroupAttribute = ({
  component: Component,
  propName,
  handleUpdate,
  props,
  value,
}) => {
  return (
    <SettingsWrapper
      simpleSettings={true}
      isDefaultOpen={true}
      title={t('Basic')}
    >
      <div className="right-side-bar-settings">
        <Component
          {...props}
          onChange={({ target: { value } }) => handleUpdate(propName, value)}
          value={value}
        />
      </div>
    </SettingsWrapper>
  )
}
</file>

<file path="editor/src/components/GroupSettings/groupAttributes.js">
import { Input } from 'components/UIComponents'
export const groupAttributes = [
  {
    component: Input,
    attributePath: 'l10ns.[language].groupName',
    props: {
      labelText: 'Title',
      dataTestId: 'group-title',
      noPermissionDisabled: true,
    },
  },
  {
    component: Input,
    attributePath: 'l10ns.[language].description',
    props: {
      labelText: 'Description',
      dataTestId: 'group-description',
      noPermissionDisabled: true,
      type: 'textarea',
      role: 'textarea',
    },
  },
  {
    component: Input,
    attributePath: 'randomizationGroup',
    props: {
      labelText: 'Randomization group',
      dataTestId: 'group-randomization-group',
      noPermissionDisabled: true,
      type: 'textarea',
... (16 lines truncated)
</file>

<file path="editor/src/components/GroupSettings/GroupSettings.js">
import React from 'react'
import classNames from 'classnames'
import { useParams } from 'react-router-dom'
import { XLg } from 'react-bootstrap-icons'
import { Button } from 'react-bootstrap'
import { SideBarHeader } from 'components/SideBar'
import { createBufferOperation, STATES } from 'helpers'
import { useAppState, useBuffer, useFocused, useSurvey } from 'hooks'
import { groupAttributes } from './groupAttributes'
import { GroupAttribute } from './GroupAttribute'
export const GroupSettings = ({ gid }) => {
  const { addToBuffer } = useBuffer()
  const { surveyId } = useParams()
  const { survey, update } = useSurvey(surveyId)
  const [language] = useAppState(STATES.ACTIVE_LANGUAGE, 'en')
  const { groupIndex, unFocus } = useFocused()
  const handleUpdate = (key, value) => {
    const updatedQuestionGroups = [...survey.questionGroups]
    if (key === 'randomizationGroup' || key === 'gRelevance') {
      updatedQuestionGroups[groupIndex][key] = value
    } else {
      updatedQuestionGroups[groupIndex].l10ns[language][key] = value
    }
    update({
      questionGroups: updatedQuestionGroups,
    })
    const operation = createBufferOperation(gid).questionGroup().update({
      questionGroup: updatedQuestionGroups[groupIndex],
      questionGroupL10n: updatedQuestionGroups[groupIndex].l10ns,
    })
... (33 lines truncated)
</file>

<file path="editor/src/components/icons/AddIcon.js">
import React from 'react'
export const AddIcon = (props) => {
  return (
    <svg viewBox="0 0 12 12" {...props} width={12} height={12}>
      <path
        fillRule="evenodd"
        clipRule="evenodd"
        d="M5.25 6.75V12H6.75V6.75H12V5.25H6.75V0H5.25V5.25H0V6.75H5.25Z"
      />
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/AlignLeftIcon.js">
import React from 'react'
export const AlignLeftIcon = (props) => {
  return (
    <svg
      xmlns="http://www.w3.org/2000/svg"
      viewBox="0 0 24 24"
      width="24"
      height="24"
      className={props.className}
    >
      <path d="M3 4H21V6H3V4ZM3 19H17V21H3V19ZM3 14H21V16H3V14ZM3 9H17V11H3V9Z"></path>
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/AlignMiddleIcon.js">
import React from 'react'
export const AlignMiddleIcon = (props) => {
  return (
    <svg
      xmlns="http://www.w3.org/2000/svg"
      viewBox="0 0 24 24"
      width="24"
      height="24"
      className={props.className}
    >
      <path d="M3 4H21V6H3V4ZM5 19H19V21H5V19ZM3 14H21V16H3V14ZM5 9H19V11H5V9Z"></path>
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/AlignRightIcon.js">
import React from 'react'
export const AlignRightIcon = (props) => {
  return (
    <svg
      xmlns="http://www.w3.org/2000/svg"
      viewBox="0 0 24 24"
      width="24"
      height="24"
      className={props.className}
    >
      <path d="M3 4H21V6H3V4ZM7 19H21V21H7V19ZM3 14H21V16H3V14ZM7 9H21V11H7V9Z"></path>
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/ArrowBackIcon.js">
import React from 'react'
export const ArrowBackIcon = (props) => {
  return (
    <svg
      xmlns="http://www.w3.org/2000/svg"
      viewBox="0 0 24 24"
      width="16"
      height="16"
      className={props.className}
    >
      <path d="M5.82843 6.99955L8.36396 9.53509L6.94975 10.9493L2 5.99955L6.94975 1.0498L8.36396 2.46402L5.82843 4.99955H13C17.4183 4.99955 21 8.58127 21 12.9996C21 17.4178 17.4183 20.9996 13 20.9996H4V18.9996H13C16.3137 18.9996 19 16.3133 19 12.9996C19 9.68584 16.3137 6.99955 13 6.99955H5.82843Z"></path>
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/ArrowDownIcon.js">
import React from 'react'
export const ArrowDownIcon = (props) => {
  return (
    <svg
      xmlns="http://www.w3.org/2000/svg"
      viewBox="0 0 24 24"
      width={props.width || 16}
      height={props.height || 16}
      fill={props.fill || 'currentColor'}
      className={props.className}
    >
      <path d="M11.9997 13.1714L16.9495 8.22168L18.3637 9.63589L11.9997 15.9999L5.63574 9.63589L7.04996 8.22168L11.9997 13.1714Z"></path>
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/ArrowLeftIcon.js">
import React from 'react'
export const ArrowLeftIcon = (props) => {
  const { width = 20, height = 20, className = '' } = props
  return (
    <svg
      width={width}
      height={height}
      viewBox="0 0 48 48"
      xmlns="http://www.w3.org/2000/svg"
      className={`fill-current ${className}`}
    >
      <path d="M0 0h48v48H0z" fill="none" />
      <path d="M40 22H15.66l11.17-11.17-2.83-2.83-16 16 16 16 2.83-2.83-11.17-11.17H40v-4z" />
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/ArrowRightIcon.js">
import React from 'react'
export const ArrowRightIcon = () => {
  return (
    <svg
      width="13"
      height="13"
      viewBox="0 0 13 13"
      fill="none"
      xmlns="http://www.w3.org/2000/svg"
    >
      <path
        d="M11.7518 6.12297L8.50183 2.87296C8.40595 2.77871 8.27378 2.72021 8.12808 2.72021C7.83341 2.72021 7.59508 2.95909 7.59508 3.25322C7.59508 3.39892 7.65358 3.53109 7.74837 3.62697L10.0727 5.95126H1.62537C1.32258 5.95126 1.07666 6.19663 1.07666 6.49997C1.07666 6.8033 1.32204 7.04867 1.62537 7.04867H10.0727L7.74837 9.37297C7.64979 9.46992 7.58858 9.60426 7.58858 9.75322C7.58858 10.0479 7.82745 10.2862 8.12158 10.2862C8.27053 10.2862 8.40487 10.225 8.50183 10.127L11.7518 6.87697C11.8482 6.78055 11.9078 6.6473 11.9078 6.49997C11.9078 6.35263 11.8482 6.21938 11.7518 6.12297Z"
        fill="#8146F6"
      />
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/ArrowRightLineIcon.js">
import React from 'react'
export const ArrowRightLineIcon = (props) => {
  return (
    <svg
      xmlns="http://www.w3.org/2000/svg"
      width="10"
      height="10"
      viewBox="0 0 10 10"
      fill="none"
      className={props.className}
      {...props}
    >
      <path
        d="M5.48828 4.99932L3.42578 2.93682L4.01495 2.34766L6.66661 4.99932L4.01495 7.65099L3.42578 7.06182L5.48828 4.99932Z"
        fill="white"
      />
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/ArrowUpIcon.js">
import React from 'react'
export const ArrowUpIcon = (props) => {
  return (
    <svg
      xmlns="http://www.w3.org/2000/svg"
      viewBox="0 0 24 24"
      width="16"
      height="16"
      className={props.className}
    >
      <path d="M11.9997 10.8284L7.04996 15.7782L5.63574 14.364L11.9997 8L18.3637 14.364L16.9495 15.7782L11.9997 10.8284Z"></path>
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/BrushIcon.js">
import React from 'react'
export const BrushIcon = (props) => {
  return (
    <svg
      width="24"
      height="24"
      viewBox="0 0 24 24"
      fill="none"
      xmlns="http://www.w3.org/2000/svg"
      className={props.className}
    >
      <path
        d="M4 20H12V18.5H4V20ZM18.9 3.50005C18.3 2.90005 17.4 2.90005 16.8 3.50005L9.6 10.7C9.2 10.6 8.9 10.7 8.5 10.8C8 11 7 11.5 6.6 13C6.2 14.7 5.8 15.2 5.5 15.7C5.4 15.8 5.3 16 5.2 16.1L4.6 17.2H6C8 17.2 9.4 16.8 10.7 15.8C11.5 15.2 11.9 14.4 12 13.5C12 13.2 12 13 11.9 12.8L19 5.70005C19.5 5.10005 19.5 4.10005 18.9 3.50005ZM9.7 14.7C9 15.2 8.2 15.5 7.3 15.7C7.5 15.2 7.8 14.5 8.1 13.4C8.3 12.8 8.5 12.4 8.9 12.3C9.4 12.2 9.9 12.4 10.2 12.6C10.4 12.8 10.5 13.1 10.4 13.4C10.4 13.7 10.3 14.3 9.7 14.7V14.7Z"
        fill="#F9F9FB"
      />
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/CheckIcon.js">
import React from 'react'
export const CheckIcon = (props) => {
  return (
    <svg
      xmlns="http://www.w3.org/2000/svg"
      viewBox="0 0 24 24"
      width="24"
      height="24"
      className={props.className}
    >
      <path d="M10.0007 15.1709L19.1931 5.97852L20.6073 7.39273L10.0007 17.9993L3.63672 11.6354L5.05093 10.2212L10.0007 15.1709Z"></path>
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/ClipBoardIcon.js">
import React from 'react'
export const ClipBoardIcon = (props) => {
  return (
    <svg
      width="24"
      height="24"
      viewBox="0 0 24 24"
      fill="none"
      xmlns="http://www.w3.org/2000/svg"
      className={props.className}
    >
      <g clipPath="url(#clip0_1299_3611)">
        <path
          d="M17 2V4H20.007C20.555 4 21 4.445 21 4.993V21.007C21 21.555 20.555 22 20.007 22H3.993C3.445 22 3 21.555 3 21.007V4.993C3 4.445 3.445 4 3.993 4H7V2H17ZM7 6H5V20H19V6H17V8H7V6ZM9 16V18H7V16H9ZM9 13V15H7V13H9ZM9 10V12H7V10H9ZM15 4H9V6H15V4Z"
          fill="#1E1E1E"
        />
      </g>
      <defs>
        <clipPath id="clip0_1299_3611">
          <rect width="24" height="24" fill="white" />
        </clipPath>
      </defs>
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/ClockArrowIcon.js">
import React from 'react'
export const ClockArrowIcon = () => {
  return (
    <svg
      width="18"
      height="19"
      viewBox="0 0 18 19"
      fill="none"
      xmlns="http://www.w3.org/2000/svg"
    >
      <path
        d="M2.52049 0L1.09699 5.31259L6.4096 6.73609C6.4733 6.62129 6.50515 6.56389 6.52705 6.51719C6.9048 5.71069 6.5007 4.75459 5.6591 4.46342C5.6103 4.44655 5.54695 4.4294 5.42025 4.3951L4.93885 4.26482C6.0841 3.4477 7.4859 2.96699 9 2.96699C12.866 2.96699 16 6.10099 16 9.96699C16 13.833 12.866 16.967 9 16.967C5.134 16.967 1.99998 13.833 1.99998 9.96699H0C0 14.9375 4.02945 18.967 9 18.967C13.9706 18.967 18 14.9375 18 9.96699C18 4.99644 13.9706 0.966986 9 0.966986C7.1161 0.966986 5.36745 1.5458 3.92207 2.5353L4.05535 2.03794C4.09095 1.905 4.10875 1.8385 4.11895 1.7854C4.28635 0.913886 3.66464 0.0883885 2.78079 0.00857755C2.72694 0.00371485 2.65811 0.00247655 2.52049 0Z"
        fill="black"
      />
      <path
        d="M13.6993 7.00647L12.7352 5.85742L8.64061 8.98762L4.50391 9.21747V10.7175L8.89056 10.9612C8.92771 10.9654 8.96551 10.9675 9.00381 10.9675C9.28171 10.9675 9.53316 10.8542 9.71436 10.6712L13.6993 7.00647Z"
        fill="black"
      />
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/ClockIcon.js">
import React from 'react'
export const ClockIcon = (props) => {
  return (
    <svg
      xmlns="http://www.w3.org/2000/svg"
      viewBox="0 0 24 24"
      width="18"
      height="18"
      className={props.className}
    >
      <path d="M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM13 12H17V14H11V7H13V12Z"></path>
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/CloseCircleFillIcon.js">
import React from 'react'
export const CloseCircleFillIcon = (props) => {
  return (
    <svg height={14} width={14} {...props}>
      <path d="M6.99992 13.6667C3.31792 13.6667 0.333252 10.682 0.333252 7.00004C0.333252 3.31804 3.31792 0.333374 6.99992 0.333374C10.6819 0.333374 13.6666 3.31804 13.6666 7.00004C13.6666 10.682 10.6819 13.6667 6.99992 13.6667ZM6.99992 6.05737L5.11459 4.17137L4.17125 5.11471L6.05725 7.00004L4.17125 8.88537L5.11459 9.82871L6.99992 7.94271L8.88525 9.82871L9.82859 8.88537L7.94258 7.00004L9.82859 5.11471L8.88525 4.17137L6.99992 6.05737Z" />
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/CloseCircleIcon.js">
import React from 'react'
export const CloseCircleIcon = ({
  width = 16,
  height = 16,
  color = '#6c757d',
  strokeWidth = 2,
  className = '',
}) => {
  return (
    <svg
      xmlns="http://www.w3.org/2000/svg"
      width={width}
      height={height}
      viewBox="0 0 16 16"
      fill="none"
      stroke={color}
      strokeWidth={strokeWidth}
      strokeLinecap="round"
      className={className}
    >
      <circle cx="8" cy="8" r="7" />
      <line x1="5" y1="5" x2="11" y2="11" />
      <line x1="11" y1="5" x2="5" y2="11" />
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/CloseIcon.js">
import React from 'react'
export const CloseIcon = ({ className, width = 20, height = 20 }) => {
  return (
    <svg
      width={width}
      height={height}
      viewBox="0 0 24 24"
      fill="none"
      xmlns="http://www.w3.org/2000/svg"
      className={className}
    >
      <g clipPath="url(#clip0_1_4259)">
        <path d="M12.0007 10.586L16.9507 5.63599L18.3647 7.04999L13.4147 12L18.3647 16.95L16.9507 18.364L12.0007 13.414L7.05072 18.364L5.63672 16.95L10.5867 12L5.63672 7.04999L7.05072 5.63599L12.0007 10.586Z" />
      </g>
      <defs>
        <clipPath id="clip0_1_4259">
          <rect width="20" height="20" fill="white" />
        </clipPath>
      </defs>
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/ColumnsIcon.js">
export const ColumnsIcon = () => {
  return (
    <svg
      width="24"
      height="24"
      viewBox="0 0 24 24"
      fill="none"
      xmlns="http://www.w3.org/2000/svg"
    >
      <g clipPath="url(#clip0_10987_18957)">
        <path
          d="M11 5H5V19H11V5ZM13 5V19H19V5H13ZM4 3H20C20.2652 3 20.5196 3.10536 20.7071 3.29289C20.8946 3.48043 21 3.73478 21 4V20C21 20.2652 20.8946 20.5196 20.7071 20.7071C20.5196 20.8946 20.2652 21 20 21H4C3.73478 21 3.48043 20.8946 3.29289 20.7071C3.10536 20.5196 3 20.2652 3 20V4C3 3.73478 3.10536 3.48043 3.29289 3.29289C3.48043 3.10536 3.73478 3 4 3Z"
          fill="#1E1E1E"
        />
      </g>
      <defs>
        <clipPath id="clip0_10987_18957">
          <rect width="24" height="24" fill="white" />
        </clipPath>
      </defs>
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/CopyIcon.js">
import React from 'react'
export const CopyIcon = (props) => {
  return (
    <svg
      xmlns="http://www.w3.org/2000/svg"
      viewBox="0 0 24 24"
      width="18"
      height="18"
      className={props.className}
    >
      <path d="M6.9998 6V3C6.9998 2.44772 7.44752 2 7.9998 2H19.9998C20.5521 2 20.9998 2.44772 20.9998 3V17C20.9998 17.5523 20.5521 18 19.9998 18H16.9998V20.9991C16.9998 21.5519 16.5499 22 15.993 22H4.00666C3.45059 22 3 21.5554 3 20.9991L3.0026 7.00087C3.0027 6.44811 3.45264 6 4.00942 6H6.9998ZM5.00242 8L5.00019 20H14.9998V8H5.00242ZM8.9998 6H16.9998V16H18.9998V4H8.9998V6Z"></path>
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/CornerMediumIcon.js">
export const CornerMediumIcon = ({ color = 'black' }) => (
  <svg
    width="19"
    height="14"
    viewBox="0 0 19 14"
    fill="none"
    xmlns="http://www.w3.org/2000/svg"
    style={{ color }}
  >
    <path
      d="M19 1.5H3C1.89543 1.5 1 2.39543 1 3.5V10.5C1 11.6046 1.89543 12.5 3 12.5H19"
      stroke="currentColor"
      strokeWidth="1.5"
      strokeLinejoin="round"
    />
  </svg>
)
</file>

<file path="editor/src/components/icons/CornerNormalIcon.js">
export const CornerNormalIcon = ({ color = 'black' }) => (
  <svg
    width="17"
    height="12"
    viewBox="0 0 17 12"
    fill="none"
    xmlns="http://www.w3.org/2000/svg"
    style={{ color }}
  >
    <path d="M17 1H1V11H17" stroke="currentColor" strokeWidth="1.5" />
  </svg>
)
</file>

<file path="editor/src/components/icons/CornerRoundedIcon.js">
export const CornerRoundedIcon = ({ color = 'black' }) => (
  <svg
    width="19"
    height="14"
    viewBox="0 0 19 14"
    fill="none"
    xmlns="http://www.w3.org/2000/svg"
    style={{ color }}
  >
    <path
      d="M19 1.5H6.5C3.46243 1.5 1 3.96243 1 7V7C1 10.0376 3.46243 12.5 6.5 12.5H19"
      stroke="currentColor"
      strokeWidth="1.5"
      strokeLinejoin="round"
    />
  </svg>
)
</file>

<file path="editor/src/components/icons/DateIcon.js">
import React from 'react'
export const DateIcon = (props) => {
  return (
    <svg
      xmlns="http://www.w3.org/2000/svg"
      viewBox="0 0 20 20"
      width="20"
      height="20"
      className={props.className}
    >
      <path d="M7.50033 0.833496V2.50016H12.5003V0.833496H14.167V2.50016H17.5003C17.9606 2.50016 18.3337 2.87326 18.3337 3.3335V16.6668C18.3337 17.1271 17.9606 17.5002 17.5003 17.5002H2.50033C2.04009 17.5002 1.66699 17.1271 1.66699 16.6668V3.3335C1.66699 2.87326 2.04009 2.50016 2.50033 2.50016H5.83366V0.833496H7.50033ZM16.667 9.16683H3.33366V15.8335H16.667V9.16683ZM5.83366 4.16683H3.33366V7.50016H16.667V4.16683H14.167V5.8335H12.5003V4.16683H7.50033V5.8335H5.83366V4.16683Z" />
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/DeleteIcon.js">
import React from 'react'
export const DeleteIcon = (props) => {
  return (
    <svg
      xmlns="http://www.w3.org/2000/svg"
      viewBox="0 0 24 24"
      width="18"
      height="18"
      {...props}
      className={props.className}
    >
      <path
        fill={props.fill}
        d="M17 6H22V8H20V21C20 21.5523 19.5523 22 19 22H5C4.44772 22 4 21.5523 4 21V8H2V6H7V3C7 2.44772 7.44772 2 8 2H16C16.5523 2 17 2.44772 17 3V6ZM18 8H6V20H18V8ZM9 4V6H15V4H9Z"
      ></path>
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/DeleteIconFilled.js">
import React from 'react'
export const DeleteIconFilled = ({
  fill = 'currentColor',
  className,
  width,
  height,
  ...rest
}) => {
  return (
    <svg
      xmlns="http://www.w3.org/2000/svg"
      viewBox="0 0 16 16"
      width={width || '18'}
      height={height || '18'}
      className={className}
      {...rest}
    >
      <path
        fillRule="evenodd"
        style={{ fill }}
        d="M11.3334 4.00016H14.6667V5.3335H13.3334V14.0002C13.3334 14.177 13.2631 14.3465 13.1381 14.4716C13.0131 14.5966 12.8435 14.6668 12.6667 14.6668H3.33337C3.15656 14.6668 2.98699 14.5966 2.86197 14.4716C2.73695 14.3465 2.66671 14.177 2.66671 14.0002V5.3335H1.33337V4.00016H4.66671V2.00016C4.66671 1.82335 4.73695 1.65378 4.86197 1.52876C4.98699 1.40373 5.15656 1.3335 5.33337 1.3335H10.6667C10.8435 1.3335 11.0131 1.40373 11.1381 1.52876C11.2631 1.65378 11.3334 1.82335 11.3334 2.00016V4.00016ZM6.00004 7.3335V11.3335H7.33337V7.3335H6.00004ZM8.66671 7.3335V11.3335H10V7.3335H8.66671ZM6.00004 2.66683V4.00016H10V2.66683H6.00004Z"
      />
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/DoubleGreaterThanArrow.js">
import React from 'react'
export const DoubleGreaterThanArrow = () => {
  return (
    <svg
      width="16"
      height="16"
      viewBox="0 0 16 16"
      fill="none"
      xmlns="http://www.w3.org/2000/svg"
    >
      <path
        d="M12.7762 7.99941L8.63813 3.86133L7.69533 4.80413L10.8906 7.99941L7.69533 11.1947L8.63813 12.1375L12.7762 7.99941ZM9.0096 7.99941L4.87152 3.86133L3.92871 4.80413L7.124 7.99941L3.92871 11.1947L4.87152 12.1375L9.0096 7.99941Z"
        fill="currentColor"
      />
    </svg>
  )
}
export default DoubleGreaterThanArrow
</file>

<file path="editor/src/components/icons/DownloadIcon.js">
import React from 'react'
export const DownloadIcon = (props) => {
  return (
    <svg {...props} viewBox="0 0 24 24">
      <path d="M3 19H21V21H3V19ZM13 13.1716L19.0711 7.1005L20.4853 8.51472L12 17L3.51472 8.51472L4.92893 7.1005L11 13.1716V2H13V13.1716Z"></path>
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/DragIcon.js">
import React from 'react'
export const DragIcon = (props) => {
  return (
    <svg
      {...props}
      style={{
        height: '14px',
        width: '14px',
        ...props.style,
      }}
    >
      <path d="M0.69339 0.125H3.47641V2.625H0.69339V0.125ZM6.25943 0.125H9.04245V2.625H6.25943V0.125ZM0.69339 5.75H3.47641V8.25H0.69339V5.75ZM6.25943 5.75H9.04245V8.25H6.25943V5.75ZM0.69339 11.375H3.47641V13.875H0.69339V11.375ZM6.25943 11.375H9.04245V13.875H6.25943V11.375Z" />
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/DropdownIcon.js">
import React from 'react'
export const DropdownIcon = () => {
  return (
    <svg
      height="20"
      width="20"
      viewBox="0 0 20 20"
      aria-hidden="true"
      focusable="false"
      fill="#6e748c"
    >
      <path d="M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"></path>
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/EditIcon.js">
import React from 'react'
export const EditIcon = (props) => {
  return (
    <svg
      xmlns="http://www.w3.org/2000/svg"
      viewBox="0 0 24 24"
      width={props.width || '18'}
      height={props.height || '18'}
      className={props.className}
    >
      <path d="M15.7279 9.57629L14.3137 8.16207L5 17.4758V18.89H6.41421L15.7279 9.57629ZM17.1421 8.16207L18.5563 6.74786L17.1421 5.33365L15.7279 6.74786L17.1421 8.16207ZM7.24264 20.89H3V16.6474L16.435 3.21233C16.8256 2.8218 17.4587 2.8218 17.8492 3.21233L20.6777 6.04075C21.0682 6.43128 21.0682 7.06444 20.6777 7.45497L7.24264 20.89Z"></path>
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/EditNotPossibleIcon.js">
import React from 'react'
export const EditNotPossibleIcon = () => {
  return (
    <svg
      width="33"
      height="28"
      viewBox="0 0 33 28"
      fill="none"
      xmlns="http://www.w3.org/2000/svg"
    >
      <g clipPath="url(#clip0_8771_15104)">
        <path
          d="M18.3493 11.2995L16.6997 9.64979L5.83333 20.5161V22.1658H7.483L18.3493 11.2995ZM19.999 9.64979L21.6487 8.00012L19.999 6.35045L18.3493 8.00012L19.999 9.64979ZM8.449 24.4991H3.5V19.549L19.1742 3.87479C19.3929 3.65607 19.6896 3.5332 19.999 3.5332C20.3084 3.5332 20.6051 3.65607 20.8238 3.87479L24.1243 7.17529C24.343 7.39407 24.4659 7.69076 24.4659 8.00012C24.4659 8.30948 24.343 8.60617 24.1243 8.82495L8.45017 24.4991H8.449Z"
          fill="#1E1E1E"
        />
      </g>
      <g clipPath="url(#clip1_8771_15104)">
        <path
          d="M27 11C24.2385 11 22 8.7615 22 6C22 3.2385 24.2385 1 27 1C29.7615 1 32 3.2385 32 6C32 8.7615 29.7615 11 27 11ZM27 5.293L25.586 3.8785L24.8785 4.586L26.293 6L24.8785 7.414L25.586 8.1215L27 6.707L28.414 8.1215L29.1215 7.414L27.707 6L29.1215 4.586L28.414 3.8785L27 5.293Z"
          fill="#FF515F"
        />
      </g>
      <defs>
        <clipPath id="clip0_8771_15104">
          <rect width="28" height="28" fill="white" />
        </clipPath>
        <clipPath id="clip1_8771_15104">
          <rect width="12" height="12" fill="white" transform="translate(21)" />
        </clipPath>
      </defs>
... (4 lines truncated)
</file>

<file path="editor/src/components/icons/EditPossibleIcon.js">
import React from 'react'
export const EditPossibleIcon = () => {
  return (
    <svg
      width="34"
      height="28"
      viewBox="0 0 34 28"
      fill="none"
      xmlns="http://www.w3.org/2000/svg"
    >
      <g clipPath="url(#clip0_8771_15127)">
        <path
          d="M18.3493 11.2995L16.6997 9.64979L5.83333 20.5161V22.1658H7.483L18.3493 11.2995ZM19.999 9.64979L21.6487 8.00012L19.999 6.35045L18.3493 8.00012L19.999 9.64979ZM8.449 24.4991H3.5V19.549L19.1742 3.87479C19.3929 3.65607 19.6896 3.5332 19.999 3.5332C20.3084 3.5332 20.6051 3.65607 20.8238 3.87479L24.1243 7.17529C24.343 7.39407 24.4659 7.69076 24.4659 8.00012C24.4659 8.30948 24.343 8.60617 24.1243 8.82495L8.45017 24.4991H8.449Z"
          fill="#1E1E1E"
        />
      </g>
      <g clipPath="url(#clip1_8771_15127)">
        <path
          d="M28 11C25.2385 11 23 8.7615 23 6C23 3.2385 25.2385 1 28 1C30.7615 1 33 3.2385 33 6C33 8.7615 30.7615 11 28 11ZM27.5015 8L31.0365 4.4645L30.3295 3.7575L27.5015 6.586L26.087 5.1715L25.38 5.8785L27.5015 8Z"
          fill="#4DD753"
        />
      </g>
      <defs>
        <clipPath id="clip0_8771_15127">
          <rect width="28" height="28" fill="white" />
        </clipPath>
        <clipPath id="clip1_8771_15127">
          <rect width="12" height="12" fill="white" transform="translate(22)" />
        </clipPath>
      </defs>
... (4 lines truncated)
</file>

<file path="editor/src/components/icons/ExclamationIcon.js">
import React from 'react'
export const ExclamationIcon = () => {
  return (
    <svg
      width="16"
      height="16"
      viewBox="0 0 16 16"
      fill="none"
      xmlns="http://www.w3.org/2000/svg"
    >
      <g clipPath="url(#clip0_8942_9589)">
        <path
          d="M8.57902 1.99932L14.9297 12.9993C14.9882 13.1007 15.019 13.2156 15.019 13.3326C15.019 13.4497 14.9882 13.5646 14.9297 13.666C14.8712 13.7673 14.787 13.8515 14.6857 13.91C14.5843 13.9685 14.4694 13.9993 14.3524 13.9993H1.65102C1.534 13.9993 1.41904 13.9685 1.3177 13.91C1.21635 13.8515 1.1322 13.7673 1.07369 13.666C1.01518 13.5646 0.984374 13.4497 0.984375 13.3326C0.984376 13.2156 1.01518 13.1007 1.07369 12.9993L7.42436 1.99932C7.48287 1.89798 7.56703 1.81383 7.66837 1.75532C7.76972 1.69682 7.88467 1.66602 8.00169 1.66602C8.11871 1.66602 8.23367 1.69682 8.33501 1.75532C8.43635 1.81383 8.52051 1.89798 8.57902 1.99932ZM7.33502 10.666V11.9993H8.66836V10.666H7.33502ZM7.33502 5.99932V9.33265H8.66836V5.99932H7.33502Z"
          fill="#1E1E1E"
        />
      </g>
      <defs>
        <clipPath id="clip0_8942_9589">
          <rect width="16" height="16" fill="white" />
        </clipPath>
      </defs>
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/ExclamationMark.js">
export const ExclamationMark = (props) => {
  return (
    <svg
      width="20"
      height="20"
      viewBox="0 0 14 14"
      xmlns="http://www.w3.org/2000/svg"
      className={props.className}
    >
      <path d="M7.00016 13.6668C3.31816 13.6668 0.333496 10.6822 0.333496 7.00016C0.333496 3.31816 3.31816 0.333496 7.00016 0.333496C10.6822 0.333496 13.6668 3.31816 13.6668 7.00016C13.6668 10.6822 10.6822 13.6668 7.00016 13.6668ZM6.3335 9.00016V10.3335H7.66683V9.00016H6.3335ZM6.3335 3.66683V7.66683H7.66683V3.66683H6.3335Z" />
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/ExpandIcon.js">
import React from 'react'
export const ExpandIcon = ({
  width = 16,
  height = 16,
  stroke = '#6c757d',
  strokeWidth = 2,
  className = '',
}) => {
  return (
    <svg
      xmlns="http://www.w3.org/2000/svg"
      width={width}
      height={height}
      fill="none"
      stroke={stroke}
      strokeWidth={strokeWidth}
      strokeLinecap="round"
      viewBox="0 0 16 16"
      className={className}
    >
      <path d="M3 3h3M3 3v3M13 3h-3M13 3v3M3 13h3M3 13v-3M13 13h-3M13 13v-3" />
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/ExpandPreviewIcon.js">
import React from 'react'
export const ExpandPreviewIcon = () => {
  return (
    <svg
      width="28"
      height="36"
      viewBox="0 0 28 36"
      fill="none"
      xmlns="http://www.w3.org/2000/svg"
    >
      <g clipPath="url(#clip0_9232_16467)">
        <path
          d="M0 8C0 4.22876 0 2.34315 1.17157 1.17157C2.34315 0 4.22876 0 8 0H28V36H8C4.22876 36 2.34315 36 1.17157 34.8284C0 33.6569 0 31.7712 0 28V8Z"
          fill="#6E748C"
        />
      </g>
      <path
        fillRule="evenodd"
        clipRule="evenodd"
        d="M18.6667 22.6667H14.7778V21.1111H17.1111V18.7778H18.6667V22.6667ZM13.2222 14.8889H10.8889V17.2222H9.33333V13.3333H13.2222V14.8889ZM18.6667 11H9.33333C8.04456 11 7 12.0446 7 13.3333V22.6667C7 23.9554 8.04456 25 9.33333 25H18.6667C19.9554 25 21 23.9554 21 22.6667V13.3333C21 12.0446 19.9554 11 18.6667 11Z"
        fill="white"
      />
      <defs>
        <clipPath id="clip0_9232_16467">
          <path
            d="M0 8C0 4.22876 0 2.34315 1.17157 1.17157C2.34315 0 4.22876 0 8 0H28V36H8C4.22876 36 2.34315 36 1.17157 34.8284C0 33.6569 0 31.7712 0 28V8Z"
            fill="white"
          />
        </clipPath>
      </defs>
... (4 lines truncated)
</file>

<file path="editor/src/components/icons/ExternalLinkIcon.js">
import React from 'react'
export const ExternalLinkIcon = (props) => {
  return (
    <svg
      xmlns="http://www.w3.org/2000/svg"
      viewBox="0 0 24 24"
      width="18"
      height="18"
      className={props.className}
    >
      <path d="M10 6V8H5V19H16V14H18V20C18 20.5523 17.5523 21 17 21H4C3.44772 21 3 20.5523 3 20V7C3 6.44772 3.44772 6 4 6H10ZM21 3V11H19L18.9999 6.413L11.2071 14.2071L9.79289 12.7929L17.5849 5H13V3H21Z"></path>
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/EyeIcon.js">
import React from 'react'
export const EyeIcon = (props) => {
  return (
    <svg
      xmlns="http://www.w3.org/2000/svg"
      viewBox="0 0 24 24"
      width="16"
      height="16"
      {...props}
      className={props.className}
    >
      <path d="M12.0003 3C17.3924 3 21.8784 6.87976 22.8189 12C21.8784 17.1202 17.3924 21 12.0003 21C6.60812 21 2.12215 17.1202 1.18164 12C2.12215 6.87976 6.60812 3 12.0003 3ZM12.0003 19C16.2359 19 19.8603 16.052 20.7777 12C19.8603 7.94803 16.2359 5 12.0003 5C7.7646 5 4.14022 7.94803 3.22278 12C4.14022 16.052 7.7646 19 12.0003 19ZM12.0003 16.5C9.51498 16.5 7.50026 14.4853 7.50026 12C7.50026 9.51472 9.51498 7.5 12.0003 7.5C14.4855 7.5 16.5003 9.51472 16.5003 12C16.5003 14.4853 14.4855 16.5 12.0003 16.5ZM12.0003 14.5C13.381 14.5 14.5003 13.3807 14.5003 12C14.5003 10.6193 13.381 9.5 12.0003 9.5C10.6196 9.5 9.50026 10.6193 9.50026 12C9.50026 13.3807 10.6196 14.5 12.0003 14.5Z"></path>
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/FeedbackIcon.js">
import React from 'react'
export const FeedbackIcon = () => {
  return (
    <svg
      width="36"
      height="36"
      viewBox="0 0 36 36"
      fill="none"
      xmlns="http://www.w3.org/2000/svg"
    >
      <rect width="36" height="36" rx="4" fill="#14AE5C" />
      <path
        d="M17.9999 22.695L12.7102 25.656L13.8914 19.71L9.44019 15.594L15.4604 14.88L17.9999 9.375L20.5394 14.88L26.5597 15.594L22.1084 19.71L23.2897 25.656L17.9999 22.695Z"
        fill="white"
      />
      <path
        d="M6.99982 24.1088L4.35134 25.5913L4.94277 22.6142L2.71411 20.5534L5.72834 20.1959L6.99982 17.4397L8.2713 20.1959L11.2855 20.5534L9.05687 22.6142L9.6483 25.5913L6.99982 24.1088Z"
        fill="white"
      />
      <path
        d="M28.8773 24.1088L26.2288 25.5913L26.8202 22.6142L24.5916 20.5534L27.6058 20.1959L28.8773 17.4397L30.1487 20.1959L33.163 20.5534L30.9343 22.6142L31.5257 25.5913L28.8773 24.1088Z"
        fill="white"
      />
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/FilterIcon.js">
export const FilterIcon = (props) => {
  return (
    <svg
      width="20"
      height="20"
      viewBox="0 0 20 20"
      fill="none"
      xmlns="http://www.w3.org/2000/svg"
      {...props}
    >
      <path
        d="M11.6663 10.8333V15.8333L8.33301 17.5V10.8333L3.33301 3.33329V1.66663H16.6663V3.33329L11.6663 10.8333ZM5.33609 3.33329L9.99967 10.3286L14.6633 3.33329H5.33609Z"
        fill="#1E1E1E"
      />
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/GlobalIcon.js">
import React from 'react'
export const GlobalIcon = (props) => {
  const width = props.width || 20
  const height = props.height || 20
  const viewBox = props.viewBox || `0 0 ${width} ${height}`
  return (
    <svg
      width={width}
      height={height}
      viewBox={viewBox}
      className={props.className}
      xmlns="http://www.w3.org/2000/svg"
    >
      <path d="M10 20C4.47715 20 0 15.5228 0 10C0 4.47715 4.47715 0 10 0C15.5228 0 20 4.47715 20 10C20 15.5228 15.5228 20 10 20ZM7.71002 17.6674C6.74743 15.6259 6.15732 13.3742 6.02731 11H2.06189C2.458 14.1765 4.71639 16.7747 7.71002 17.6674ZM8.0307 11C8.1811 13.4388 8.8778 15.7297 10 17.752C11.1222 15.7297 11.8189 13.4388 11.9693 11H8.0307ZM17.9381 11H13.9727C13.8427 13.3742 13.2526 15.6259 12.29 17.6674C15.2836 16.7747 17.542 14.1765 17.9381 11ZM2.06189 9H6.02731C6.15732 6.62577 6.74743 4.37407 7.71002 2.33256C4.71639 3.22533 2.458 5.8235 2.06189 9ZM8.0307 9H11.9693C11.8189 6.56122 11.1222 4.27025 10 2.24799C8.8778 4.27025 8.1811 6.56122 8.0307 9ZM12.29 2.33256C13.2526 4.37407 13.8427 6.62577 13.9727 9H17.9381C17.542 5.8235 15.2836 3.22533 12.29 2.33256Z" />
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/GreaterThanArrow.js">
import React from 'react'
export const GreaterThanArrow = () => {
  return (
    <svg
      width="16"
      height="16"
      viewBox="0 0 16 16"
      fill="none"
      xmlns="http://www.w3.org/2000/svg"
    >
      <g clipPath="url(#clip0_11235_19637)">
        <path
          d="M8.78145 8.00048L5.48145 4.70048L6.42411 3.75781L10.6668 8.00048L6.42411 12.2431L5.48145 11.3005L8.78145 8.00048Z"
          fill="currentColor"
        />
      </g>
      <defs>
        <clipPath id="clip0_11235_19637">
          <rect width="16" height="16" fill="white" />
        </clipPath>
      </defs>
    </svg>
  )
}
export default GreaterThanArrow
</file>

<file path="editor/src/components/icons/icons.stories.js">
import {
  AddIcon,
  AlignLeftIcon,
  AlignMiddleIcon,
  AlignRightIcon,
  ArrowDownIcon,
  ArrowRightIcon,
  ArrowUpIcon,
  BrushIcon,
  CheckIcon,
  ClipBoardIcon,
  ClockIcon,
  CloseCircleFillIcon,
  CloseIcon,
  DeleteIcon,
  CopyIcon,
  DragIcon,
  EditIcon,
  ExternalLinkIcon,
  LeftSideBarToggleIcon,
  MenuIcon,
  PushPinIcon,
  QuestionListIcon,
  RankingIcon,
  SettingsIcon,
  ShutDownIcon,
  SmallThreeDotIcon,
  StarIcon,
  TableIcon,
  TrashIcon,
... (38 lines truncated)
</file>

<file path="editor/src/components/icons/ImportIcon.js">
import React from 'react'
export const ImportIcon = () => {
  return (
    <svg
      width="28"
      height="28"
      viewBox="0 0 28 28"
      fill="none"
      xmlns="http://www.w3.org/2000/svg"
    >
      <path
        d="M15.1667 14.0007H18.6667L14 18.6673L9.33333 14.0007H12.8333V9.33398H15.1667V14.0007ZM17.5 4.66732H5.83333V23.334H22.1667V9.33398H17.5V4.66732ZM3.5 3.49108C3.5 2.85204 4.02207 2.33398 4.66492 2.33398H18.6667L24.4996 8.16732L24.5 24.4919C24.5 25.141 23.9809 25.6673 23.341 25.6673H4.65897C4.01889 25.6673 3.5 25.1361 3.5 24.5102V3.49108Z"
        fill="black"
      />
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/index.js">
export * from './AddIcon'
export * from './DownloadIcon'
export * from './LanguageIcon'
export * from './AlignLeftIcon'
export * from './AlignMiddleIcon'
export * from './AlignRightIcon'
export * from './LeftSideBarToggleIcon'
export * from './ArrowBackIcon'
export * from './ArrowDownIcon'
export * from './ArrowRightIcon'
export * from './ArrowLeftIcon'
export * from './ArrowUpIcon'
export * from './BrushIcon'
export * from './CheckIcon'
export * from './ClipBoardIcon'
export * from './ClockIcon'
export * from './CloseCircleFillIcon'
export * from './CloseIcon'
export * from './CopyIcon'
export * from './DeleteIcon'
export * from './DragIcon'
export * from './EditIcon'
export * from './EyeIcon'
export * from './ExternalLinkIcon'
export * from './MenuIcon'
export * from './SettingsIcon'
export * from './PushPinIcon'
export * from './QuestionListIcon'
export * from './QuestionInserterDataIcon'
export * from './QuestionInserterMultipleChoice'
... (64 lines truncated)
</file>

<file path="editor/src/components/icons/InfoIcon.js">
import React from 'react'
const InfoIcon = ({ width = '40', height = '40' }) => {
  return (
    <svg
      width={width}
      height={height}
      viewBox="0 0 15 15"
      fill="none"
      xmlns="http://www.w3.org/2000/svg"
    >
      <path
        d="M8.00065 14.6673C4.31865 14.6673 1.33398 11.6827 1.33398 8.00065C1.33398 4.31865 4.31865 1.33398 8.00065 1.33398C11.6827 1.33398 14.6673 4.31865 14.6673 8.00065C14.6673 11.6827 11.6827 14.6673 8.00065 14.6673ZM7.33398 7.33398V11.334H8.66732V7.33398H7.33398ZM7.33398 4.66732V6.00065H8.66732V4.66732H7.33398Z"
        fill="#1E1E1E"
      />
    </svg>
  )
}
export default InfoIcon
</file>

<file path="editor/src/components/icons/InformationIcon.js">
import React from 'react'
export const InformationIcon = () => {
  return (
    <svg
      width="28"
      height="28"
      viewBox="0 0 28 28"
      fill="none"
      xmlns="http://www.w3.org/2000/svg"
    >
      <g clipPath="url(#clip0_8943_14743)">
        <path
          d="M13.9987 25.6673C7.5552 25.6673 2.33203 20.4442 2.33203 14.0007C2.33203 7.55715 7.5552 2.33398 13.9987 2.33398C20.4422 2.33398 25.6654 7.55715 25.6654 14.0007C25.6654 20.4442 20.4422 25.6673 13.9987 25.6673ZM12.832 12.834V19.834H15.1654V12.834H12.832ZM12.832 8.16732V10.5007H15.1654V8.16732H12.832Z"
          fill="#1E1E1E"
        />
      </g>
      <defs>
        <clipPath id="clip0_8943_14743">
          <rect width="28" height="28" fill="white" />
        </clipPath>
      </defs>
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/InvisibleIcon.js">
import React from 'react'
export const InvisibleIcon = () => {
  return (
    <svg
      width="28"
      height="28"
      viewBox="0 0 28 28"
      fill="none"
      xmlns="http://www.w3.org/2000/svg"
    >
      <path
        d="M20.8635 22.5121C18.8786 23.7706 16.5248 24.4994 14.0007 24.4994C7.7098 24.4994 2.47617 19.973 1.37891 13.9994C1.88837 11.2258 3.28953 8.76424 5.27421 6.92286L1.62626 3.27492L3.27619 1.625L26.375 24.7238L24.7251 26.3738L20.8635 22.5121ZM6.92519 8.57384C5.37484 9.98603 4.24443 11.8609 3.76024 13.9994C4.83058 18.7266 9.05903 22.1661 14.0007 22.1661C15.8666 22.1661 17.631 21.6756 19.162 20.8107L16.7957 18.4443C15.9863 18.9543 15.0279 19.2494 14.0007 19.2494C11.1011 19.2494 8.75063 16.8988 8.75063 13.9994C8.75063 12.9721 9.04569 12.0136 9.55569 11.2043L6.92519 8.57384ZM15.0665 16.7152L11.2849 12.9336C11.1552 13.2637 11.084 13.6232 11.084 13.9994C11.084 15.6102 12.3899 16.9161 14.0007 16.9161C14.3768 16.9161 14.7364 16.8448 15.0665 16.7152ZM24.2749 19.3571L22.6057 17.6878C23.3709 16.5971 23.935 15.3509 24.241 13.9994C23.1707 9.27207 18.9422 5.83271 14.0007 5.83271C13.0138 5.83271 12.0554 5.96988 11.1449 6.22707L9.30386 4.38603C10.7585 3.81371 12.3428 3.49938 14.0007 3.49938C20.2915 3.49938 25.5251 8.02577 26.6224 13.9994C26.2581 15.9823 25.4381 17.8058 24.2749 19.3571ZM13.677 8.75919C13.784 8.75268 13.8919 8.74938 14.0007 8.74938C16.9001 8.74938 19.2507 11.0999 19.2507 13.9994C19.2507 14.108 19.2473 14.216 19.2409 14.3229L13.677 8.75919Z"
        fill="#1E1E1E"
      />
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/LanguageIcon.js">
import React from 'react'
export const LanguageIcon = () => {
  return (
    <svg
      width="16"
      height="16"
      viewBox="0 0 14 14"
      fill="none"
      xmlns="http://www.w3.org/2000/svg"
    >
      <path
        d="M3.15665 3.30192C2.30667 4.18411 1.78631 5.33202 1.68303 6.5527C1.57974 7.77337 1.89983 8.99239 2.58948 10.0049C3.27914 11.0173 4.29632 11.7615 5.47005 12.1123C6.64379 12.4631 7.90251 12.3992 9.03465 11.9313C9.11131 11.4313 8.94331 10.9513 8.87465 10.7833C8.72131 10.4099 8.21598 9.77192 7.37265 8.88725C7.14731 8.65059 7.16198 8.46859 7.24265 7.92925L7.25131 7.86859C7.30598 7.49925 7.39798 7.28059 8.64131 7.08325C9.27331 6.98325 9.43931 7.23525 9.66931 7.58525L9.74665 7.69992C9.96531 8.01992 10.1273 8.09325 10.372 8.20392C10.482 8.25392 10.6186 8.31725 10.802 8.42059C11.2366 8.66925 11.2366 8.94992 11.2366 9.56459V9.63459C11.2366 9.89525 11.2113 10.1246 11.1713 10.3239C11.6829 9.68187 12.0394 8.93041 12.213 8.12805C12.3867 7.32568 12.3728 6.49407 12.1725 5.69794C11.9722 4.90181 11.5909 4.16266 11.0582 3.53801C10.5255 2.91337 9.85582 2.42009 9.10131 2.09659C8.73265 2.34525 8.22665 2.69792 8.04998 2.93992C7.95998 3.06325 7.83198 3.69459 7.41665 3.74659C7.30865 3.75992 7.16265 3.75059 7.00798 3.74059C6.59331 3.71392 6.02665 3.67725 5.84531 4.16992C5.72998 4.48192 5.70998 5.32992 6.08265 5.76992C6.14265 5.83992 6.15398 5.96992 6.11331 6.11592C6.05998 6.30725 5.95265 6.42392 5.91865 6.44792C5.85465 6.41059 5.72665 6.26192 5.63931 6.16125C5.43065 5.91792 5.16931 5.61459 4.83198 5.52125C4.70931 5.48725 4.57465 5.45925 4.44331 5.43125C4.07731 5.35459 3.66331 5.26725 3.56665 5.06192C3.49598 4.91125 3.49665 4.70392 3.49665 4.48525C3.49665 4.20725 3.49665 3.89325 3.36065 3.58859C3.31337 3.47986 3.24388 3.38221 3.15665 3.30192ZM6.99998 13.6666C3.31798 13.6666 0.333313 10.6819 0.333313 6.99992C0.333313 3.31792 3.31798 0.333252 6.99998 0.333252C10.682 0.333252 13.6666 3.31792 13.6666 6.99992C13.6666 10.6819 10.682 13.6666 6.99998 13.6666Z"
        fill="#6E748C"
      />
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/LeftSideBarToggleIcon.js">
import React from 'react'
export const LeftSideBarToggleIcon = (props) => {
  return (
    <svg
      width="20"
      height="20"
      viewBox="0 0 20 20"
      fill="none"
      xmlns="http://www.w3.org/2000/svg"
      className={props.className}
    >
      <g clipPath="url(#clip0_1344_2657)">
        <path
          d="M10 2.5V4.16667H2.5V2.5H10ZM13.3333 15.8333V17.5H2.5V15.8333H13.3333ZM18.3333 9.16667V10.8333H2.5V9.16667H18.3333Z"
          fill="#1E1E1E"
        />
      </g>
      <defs>
        <clipPath id="clip0_1344_2657">
          <rect width="20" height="20" fill="white" />
        </clipPath>
      </defs>
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/LockIcon.js">
import React from 'react'
export const LockIcon = (props) => {
  const width = props.width || 18
  const height = props.height || 21
  const viewBox = props.viewBox || `0 0 ${width} ${height}`
  return (
    <svg
      width={width}
      height={height}
      viewBox={viewBox}
      fill={props.fill}
      className={props.className}
      xmlns="http://www.w3.org/2000/svg"
    >
      <path d="M3 7V6C3 4.4087 3.63214 2.88258 4.75736 1.75736C5.88258 0.632141 7.4087 0 9 0C10.5913 0 12.1174 0.632141 13.2426 1.75736C14.3679 2.88258 15 4.4087 15 6V7H17C17.2652 7 17.5196 7.10536 17.7071 7.29289C17.8946 7.48043 18 7.73478 18 8V20C18 20.2652 17.8946 20.5196 17.7071 20.7071C17.5196 20.8946 17.2652 21 17 21H1C0.734784 21 0.48043 20.8946 0.292893 20.7071C0.105357 20.5196 0 20.2652 0 20V8C0 7.73478 0.105357 7.48043 0.292893 7.29289C0.48043 7.10536 0.734784 7 1 7H3ZM16 9H2V19H16V9ZM8 14.732C7.61872 14.5119 7.32072 14.1721 7.15224 13.7653C6.98376 13.3586 6.9542 12.9076 7.06815 12.4823C7.1821 12.057 7.43319 11.6813 7.78248 11.4132C8.13177 11.1452 8.55973 10.9999 9 10.9999C9.44027 10.9999 9.86823 11.1452 10.2175 11.4132C10.5668 11.6813 10.8179 12.057 10.9319 12.4823C11.0458 12.9076 11.0162 13.3586 10.8478 13.7653C10.6793 14.1721 10.3813 14.5119 10 14.732V17H8V14.732ZM5 7H13V6C13 4.93913 12.5786 3.92172 11.8284 3.17157C11.0783 2.42143 10.0609 2 9 2C7.93913 2 6.92172 2.42143 6.17157 3.17157C5.42143 3.92172 5 4.93913 5 6V7Z" />
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/MenuIcon.js">
import React from 'react'
export const MenuIcon = (props) => {
  return (
    <svg
      xmlns="http://www.w3.org/2000/svg"
      width="36"
      height="36"
      viewBox="0 0 36 36"
      fill="none"
      className={props.className}
    >
      <g clipPath="url(#clip0_1_4230)">
        <path
          d="M7.5 15C5.85 15 4.5 16.35 4.5 18C4.5 19.65 5.85 21 7.5 21C9.15 21 10.5 19.65 10.5 18C10.5 16.35 9.15 15 7.5 15ZM28.5 15C26.85 15 25.5 16.35 25.5 18C25.5 19.65 26.85 21 28.5 21C30.15 21 31.5 19.65 31.5 18C31.5 16.35 30.15 15 28.5 15ZM18 15C16.35 15 15 16.35 15 18C15 19.65 16.35 21 18 21C19.65 21 21 19.65 21 18C21 16.35 19.65 15 18 15Z"
          fill="#1E1E1E"
        />
      </g>
      <defs>
        <clipPath id="clip0_1_4230">
          <rect width="36" height="36" fill="white" />
        </clipPath>
      </defs>
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/MergeIcon.js">
import React from 'react'
export const MergeIcon = () => {
  return (
    <svg
      width="28"
      height="28"
      viewBox="0 0 28 28"
      fill="none"
      xmlns="http://www.w3.org/2000/svg"
    >
      <path
        d="M7 5.83333C6.35567 5.83333 5.83333 6.35567 5.83333 7C5.83333 7.64433 6.35567 8.16667 7 8.16667C7.64433 8.16667 8.16667 7.64433 8.16667 7C8.16667 6.35567 7.64433 5.83333 7 5.83333ZM3.5 7C3.5 5.06701 5.06701 3.5 7 3.5C8.93299 3.5 10.5 5.06701 10.5 7C10.5 8.52392 9.52605 9.82037 8.16667 10.3008V10.5C8.16667 11.7887 9.21133 12.8333 10.5 12.8333H17.5C18.7887 12.8333 19.8333 11.7887 19.8333 10.5V10.3008C18.4739 9.82037 17.5 8.52392 17.5 7C17.5 5.06701 19.0669 3.5 21 3.5C22.9331 3.5 24.5 5.06701 24.5 7C24.5 8.52392 23.5261 9.82037 22.1667 10.3008V10.5C22.1667 13.0773 20.0773 15.1667 17.5 15.1667H15.1667V17.6991C16.5261 18.1796 17.5 19.4761 17.5 21C17.5 22.9331 15.933 24.5 14 24.5C12.0669 24.5 10.5 22.9331 10.5 21C10.5 19.4761 11.4739 18.1796 12.8333 17.6991V15.1667H10.5C7.92267 15.1667 5.83333 13.0773 5.83333 10.5V10.3008C4.47394 9.82037 3.5 8.52392 3.5 7ZM21 5.83333C20.3556 5.83333 19.8333 6.35567 19.8333 7C19.8333 7.64433 20.3556 8.16667 21 8.16667C21.6444 8.16667 22.1667 7.64433 22.1667 7C22.1667 6.35567 21.6444 5.83333 21 5.83333ZM14 19.8333C13.3556 19.8333 12.8333 20.3556 12.8333 21C12.8333 21.6444 13.3556 22.1667 14 22.1667C14.6444 22.1667 15.1667 21.6444 15.1667 21C15.1667 20.3556 14.6444 19.8333 14 19.8333Z"
        fill="#1E1E1E"
      />
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/MinimizeIcon.js">
import React from 'react'
export const MinimizeIcon = () => {
  return (
    <svg
      width="28"
      height="36"
      viewBox="0 0 28 36"
      fill="none"
      xmlns="http://www.w3.org/2000/svg"
    >
      <path
        d="M0 8C0 4.22876 0 2.34315 1.17157 1.17157C2.34315 0 4.22876 0 8 0H28V36H8C4.22876 36 2.34315 36 1.17157 34.8284C0 33.6569 0 31.7712 0 28V8Z"
        fill="#6E748C"
      />
      <path
        fillRule="evenodd"
        clipRule="evenodd"
        d="M19.6667 20.3333H17.3333V22.6667H15.7778V18.7778H19.6667V20.3333ZM14.2222 17.2222H10.3333V15.6667H12.6667V13.3333H14.2222V17.2222ZM19.6667 11H10.3333C9.04456 11 8 12.0446 8 13.3333V22.6667C8 23.9554 9.04456 25 10.3333 25H19.6667C20.9554 25 22 23.9554 22 22.6667V13.3333C22 12.0446 20.9554 11 19.6667 11Z"
        fill="white"
      />
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/OverviewIcon.js">
import React from 'react'
const OverviewIcon = () => {
  return (
    <svg
      width="24"
      height="24"
      viewBox="0 0 24 24"
      fill="none"
      xmlns="http://www.w3.org/2000/svg"
    >
      <path
        d="M21.5645 12.9092V19.9102C21.5645 20.4625 21.1168 20.9102 20.5645 20.9102H12.5645V12.9092H21.5645ZM10.5645 12.9092V20.9102H2.56445C2.01217 20.9102 1.56445 20.4625 1.56445 19.9102V12.9092H10.5645ZM10.5645 2.91016V10.9092H1.56445V3.91016C1.56445 3.35788 2.01217 2.91016 2.56445 2.91016H10.5645ZM20.5645 2.91016C21.1168 2.91016 21.5645 3.35788 21.5645 3.91016V10.9092H12.5645V2.91016H20.5645Z"
        fill="white"
      />
    </svg>
  )
}
export default OverviewIcon
</file>

<file path="editor/src/components/icons/ParticipantsIcon.js">
import React from 'react'
const ParticipantsIcon = () => {
  return (
    <svg
      width="24"
      height="24"
      viewBox="0 0 24 24"
      fill="none"
      xmlns="http://www.w3.org/2000/svg"
    >
      <g clipPath="url(#clip0_8222_24659)">
        <path
          d="M2 22C2 19.8783 2.84285 17.8434 4.34315 16.3431C5.84344 14.8429 7.87827 14 10 14C12.1217 14 14.1566 14.8429 15.6569 16.3431C17.1571 17.8434 18 19.8783 18 22H16C16 20.4087 15.3679 18.8826 14.2426 17.7574C13.1174 16.6321 11.5913 16 10 16C8.4087 16 6.88258 16.6321 5.75736 17.7574C4.63214 18.8826 4 20.4087 4 22H2ZM10 13C6.685 13 4 10.315 4 7C4 3.685 6.685 1 10 1C13.315 1 16 3.685 16 7C16 10.315 13.315 13 10 13ZM10 11C12.21 11 14 9.21 14 7C14 4.79 12.21 3 10 3C7.79 3 6 4.79 6 7C6 9.21 7.79 11 10 11ZM18.284 14.703C19.6893 15.3359 20.882 16.3612 21.7186 17.6557C22.5552 18.9502 23.0002 20.4587 23 22H21C21.0002 20.844 20.6666 19.7125 20.0391 18.7416C19.4116 17.7707 18.5171 17.0017 17.463 16.527L18.283 14.703H18.284ZM17.596 3.413C18.6035 3.8283 19.465 4.53354 20.071 5.43923C20.6771 6.34492 21.0004 7.41024 21 8.5C21.0004 9.87233 20.4877 11.1952 19.5625 12.2088C18.6374 13.2224 17.3667 13.8535 16 13.978V11.965C16.7409 11.8589 17.4283 11.518 17.9613 10.9925C18.4943 10.4669 18.8447 9.78432 18.9612 9.04493C19.0776 8.30555 18.954 7.5483 18.6084 6.88435C18.2628 6.22041 17.7134 5.68475 17.041 5.356L17.596 3.413Z"
          fill="#1E1E1E"
        />
      </g>
      <defs>
        <clipPath id="clip0_8222_24659">
          <rect width="24" height="24" fill="white" />
        </clipPath>
      </defs>
    </svg>
  )
}
export default ParticipantsIcon
</file>

<file path="editor/src/components/icons/PrivacyMandatoryInlineIcon.js">
import React from 'react'
export const PrivacyMandatoryInlineIcon = (props) => {
  return (
    <svg
      xmlns="http://www.w3.org/2000/svg"
      width="88"
      height="60"
      viewBox="0 0 88 60"
      fill="none"
      className={props.className}
    >
      <rect
        className="privacy-icon-bg"
        width="88"
        height="60"
        rx="3"
        fill="#EEEFF7"
      />
      <rect x="7" y="27" width="32" height="6" rx="2" fill="white" />
      <rect
        className="privacy-icon-accent"
        x="43"
        y="4"
        width="42"
        height="52"
        rx="2"
        fill="#D3D5DA"
      />
      <rect
        className="privacy-icon-accent"
... (20 lines truncated)
</file>

<file path="editor/src/components/icons/PrivacyMandatoryNoIcon.js">
import React from 'react'
export const PrivacyMandatoryNoIcon = (props) => {
  return (
    <svg
      width="88"
      height="60"
      viewBox="0 0 88 60"
      fill="none"
      xmlns="http://www.w3.org/2000/svg"
      className={props.className}
    >
      <rect
        className="privacy-icon-bg"
        width="88"
        height="60"
        rx="3"
        fill="#EEEFF7"
      />
      <rect
        className="privacy-icon-accent"
        x="7"
        y="6"
        width="32"
        height="6"
        rx="2"
        fill="#D3D5DA"
      />
      <rect
        className="privacy-icon-accent"
        x="7"
... (28 lines truncated)
</file>

<file path="editor/src/components/icons/PrivacyMandatoryPopUpIcon.js">
import React from 'react'
export const PrivacyMandatoryPopUpIcon = (props) => {
  return (
    <svg
      width="88"
      height="60"
      viewBox="0 0 88 60"
      fill="none"
      xmlns="http://www.w3.org/2000/svg"
      className={props.className}
    >
      <rect
        className="privacy-icon-bg"
        width="88"
        height="60"
        rx="3"
        fill="#EEEFF7"
      />
      <rect
        className="privacy-icon-accent"
        x="7"
        y="6"
        width="32"
        height="6"
        rx="2"
        fill="#D3D5DA"
      />
      <rect
        className="privacy-icon-accent"
        x="7"
... (29 lines truncated)
</file>

<file path="editor/src/components/icons/PushPinIcon.js">
import React from 'react'
export const PushPinIcon = (props) => {
  return (
    <svg
      width="24"
      height="24"
      viewBox="0 0 24 24"
      fill="none"
      xmlns="http://www.w3.org/2000/svg"
      className={props.className}
    >
      <path
        d="M12.606 1.68604L21.092 10.172L19.677 11.586L18.97 10.879L14.728 15.121L14.021 18.657L12.606 20.071L8.364 15.828L3.414 20.778L2 19.364L6.95 14.414L2.707 10.172L4.121 8.75704L7.658 8.05004L11.9 3.80804L11.193 3.10104L12.607 1.68604H12.606ZM13.314 5.22204L8.643 9.89204L5.821 10.457L12.321 16.957L12.885 14.135L17.556 9.46504L13.314 5.22204Z"
        fill="black"
      />
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/QrCodeIcon.js">
import React from 'react'
export const QrCodeIcon = (props) => {
  const { width = 24, height = 24, className, ...rest } = props
  return (
    <svg
      xmlns="http://www.w3.org/2000/svg"
      viewBox={`0 0 ${width} ${height}`}
      width={width}
      height={height}
      className={className}
      {...rest}
    >
      <path d="M26.6667 28.3333V26.6667H21.6667V21.6667H26.6667V25H30V28.3333H28.3333V31.6667H25V35H21.6667V30H25V28.3333H26.6667ZM35 35H28.3333V31.6667H31.6667V28.3333H35V35ZM5 5H18.3333V18.3333H5V5ZM8.33333 8.33333V15H15V8.33333H8.33333ZM21.6667 5H35V18.3333H21.6667V5ZM25 8.33333V15H31.6667V8.33333H25ZM5 21.6667H18.3333V35H5V21.6667ZM8.33333 25V31.6667H15V25H8.33333ZM30 21.6667H35V25H30V21.6667ZM10 10H13.3333V13.3333H10V10ZM10 26.6667H13.3333V30H10V26.6667ZM26.6667 10H30V13.3333H26.6667V10Z" />
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/QuestionInserterDataIcon.js">
import React from 'react'
export const QuestionInserterDataIcon = () => {
  return (
    <svg
      xmlns="http://www.w3.org/2000/svg"
      width="24"
      height="24"
      viewBox="0 0 24 24"
      fill="none"
    >
      <path
        d="M4 18V14.3C4 13.4716 3.32843 12.8 2.5 12.8H2V11.2H2.5C3.32843 11.2 4 10.5284 4 9.7V6C4 4.34315 5.34315 3 7 3H8V5H7C6.44772 5 6 5.44772 6 6V10.1C6 10.9858 5.42408 11.7372 4.62623 12C5.42408 12.2628 6 13.0142 6 13.9V18C6 18.5523 6.44772 19 7 19H8V21H7C5.34315 21 4 19.6569 4 18ZM20 14.3V18C20 19.6569 18.6569 21 17 21H16V19H17C17.5523 19 18 18.5523 18 18V13.9C18 13.0142 18.5759 12.2628 19.3738 12C18.5759 11.7372 18 10.9858 18 10.1V6C18 5.44772 17.5523 5 17 5H16V3H17C18.6569 3 20 4.34315 20 6V9.7C20 10.5284 20.6716 11.2 21.5 11.2H22V12.8H21.5C20.6716 12.8 20 13.4716 20 14.3Z"
        fill="#333641"
      />
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/QuestionInserterMultipleChoice.js">
import React from 'react'
export const QuestionInserterMultipleChoiceIcon = (props) => {
  return (
    <svg
      xmlns="http://www.w3.org/2000/svg"
      width="15"
      height="15"
      fill="none"
      className={props.className}
    >
      <rect
        width="15"
        height="2.456"
        y="3.947"
        fill="#333641"
        opacity=".2"
        rx="1"
      />
      <rect width="15" height="2.456" y="8.246" fill="#333641" rx="1" />
      <rect width="15" height="2.456" fill="#333641" rx="1" />
      <rect width="15" height="2.456" y="12.544" fill="#333641" rx="1" />
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/QuestionInserterNumberIcon.js">
import React from 'react'
export const QuestionInserterNumberIcon = () => {
  return (
    <svg
      xmlns="http://www.w3.org/2000/svg"
      width="28"
      height="20"
      viewBox="0 0 28 20"
      fill="none"
    >
      <path
        d="M4.66833 14.7634V3.22833H2.76011L0 5.22267V7.05645L2.6664 5.15506H2.76011V14.7634H4.66833Z"
        fill="#333641"
      />
      <path
        d="M9.89039 6.55786C9.89039 6.54096 9.89039 6.48181 9.89039 6.45645C9.89039 5.45929 10.606 4.57197 11.8327 4.57197C12.9316 4.57197 13.7409 5.28182 13.7409 6.35505C13.7409 7.36067 13.0594 8.12967 12.429 8.81417L8.10995 13.5634V14.7634H15.8791V13.1662H10.7934V13.0564L13.6642 9.85359C14.7206 8.68741 15.6747 7.70714 15.6747 6.19449C15.6747 4.36916 14.1754 3.00016 11.8753 3.00016C9.31963 3.00016 8.0418 4.71563 8.0418 6.46491V6.55786H9.89039Z"
        fill="#333641"
      />
      <path
        d="M20.5475 9.59162H21.8253C23.1628 9.59162 24.0572 10.3691 24.0658 11.493C24.0828 12.6338 23.1713 13.4535 21.7572 13.4451C20.5049 13.4366 19.6019 12.769 19.5167 11.9071H17.7363C17.8044 13.6057 19.2611 15 21.7401 15C24.1424 15 26.0336 13.6479 25.9995 11.5437C25.9655 9.70148 24.5002 8.88177 23.478 8.78037V8.67896C24.3469 8.5353 25.6673 7.61419 25.6332 5.97477C25.5906 4.2762 24.1169 2.98326 21.7998 3.00016C19.3634 3.00861 18.0344 4.41986 17.9833 6.05928H19.7978C19.8489 5.25647 20.6071 4.53817 21.7572 4.53817C22.8987 4.53817 23.7165 5.23957 23.7165 6.26209C23.725 7.29306 22.8987 8.04517 21.7657 8.04517H20.5475V9.59162Z"
        fill="#333641"
      />
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/QuestionInserterRankIcon.js">
import React from 'react'
export const QuestionInserterRankIcon = (props) => {
  return (
    <svg
      xmlns="http://www.w3.org/2000/svg"
      width="24"
      height="24"
      fill="none"
      className={props.className}
    >
      <g clipPath="url(#a)">
        <path
          fill="#333641"
          d="M8 4h13v2H8V4ZM5 3v3h1v1H3V6h1V4H3V3h2ZM3 14v-2.5h2V11H3v-1h3v2.5H4v.5h2v1H3Zm2 5.5H3v-1h2V18H3v-1h3v4H3v-1h2v-.5ZM8 11h13v2H8v-2Zm0 7h13v2H8v-2Z"
        />
      </g>
      <defs>
        <clipPath id="a">
          <path fill="#fff" d="M0 0h24v24H0z" />
        </clipPath>
      </defs>
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/QuestionInserterSingleChoiceIcon.js">
import React from 'react'
export const QuestionInserterSingleChoiceIcon = (props) => {
  return (
    <svg
      xmlns="http://www.w3.org/2000/svg"
      width="15"
      height="14"
      fill="none"
      className={props.className}
    >
      <rect width="15" height="3.111" fill="#D3D5DA" opacity=".2" rx="1" />
      <rect width="15" height="3.111" y="5.444" fill="#333641" rx="1" />
      <rect
        width="15"
        height="3.111"
        y="10.889"
        fill="#333641"
        opacity=".2"
        rx="1"
      />
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/QuestionInserterTextIcon.js">
import React from 'react'
export const QuestionInserterTextIcon = () => {
  return (
    <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none">
      <g clipPath="url(#a)">
        <path
          fill="#333641"
          d="M12 3v2H3V3h9Zm4 16v2H3v-2h13Zm6-8v2H3v-2h19Z"
        />
      </g>
      <defs>
        <clipPath id="a">
          <path fill="#fff" d="M0 0h24v24H0z" />
        </clipPath>
      </defs>
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/QuestionListIcon.js">
import React from 'react'
export const QuestionListIcon = (props) => {
  return (
    <svg
      width="24"
      height="24"
      viewBox="0 0 24 24"
      fill="none"
      xmlns="http://www.w3.org/2000/svg"
      className={props.className}
    >
      <path d="M13 14H21V16H13V14ZM8 7H21V9H8V7Z" fill="#25003E" />
      <path
        fillRule="evenodd"
        clipRule="evenodd"
        d="M5 16C5.55228 16 6 15.5523 6 15C6 14.4477 5.55228 14 5 14C4.44772 14 4 14.4477 4 15C4 15.5523 4.44772 16 5 16ZM5 17C6.10457 17 7 16.1046 7 15C7 13.8954 6.10457 13 5 13C3.89543 13 3 13.8954 3 15C3 16.1046 3.89543 17 5 17Z"
        fill="#25003E"
      />
      <path
        d="M12 15C12 16.1046 11.1046 17 10 17C8.89543 17 8 16.1046 8 15C8 13.8954 8.89543 13 10 13C11.1046 13 12 13.8954 12 15Z"
        fill="#25003E"
      />
      <path
        d="M7 8C7 9.10457 6.10457 10 5 10C3.89543 10 3 9.10457 3 8C3 6.89543 3.89543 6 5 6C6.10457 6 7 6.89543 7 8Z"
        fill="#25003E"
      />
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/QuestionMarkIcon.js">
import React from 'react'
export const QuestionMarkIcon = () => {
  return (
    <svg
      width="24"
      height="28"
      viewBox="0 0 24 24"
      fill="none"
      xmlns="http://www.w3.org/2000/svg"
    >
      <g clipPath="url(#clip0_8771_15406)">
        <path
          d="M12 22C6.477 22 2 17.523 2 12C2 6.477 6.477 2 12 2C17.523 2 22 6.477 22 12C22 17.523 17.523 22 12 22ZM12 20C14.1217 20 16.1566 19.1571 17.6569 17.6569C19.1571 16.1566 20 14.1217 20 12C20 9.87827 19.1571 7.84344 17.6569 6.34315C16.1566 4.84285 14.1217 4 12 4C9.87827 4 7.84344 4.84285 6.34315 6.34315C4.84285 7.84344 4 9.87827 4 12C4 14.1217 4.84285 16.1566 6.34315 17.6569C7.84344 19.1571 9.87827 20 12 20ZM11 15H13V17H11V15ZM13 13.355V14H11V12.5C11 12.2348 11.1054 11.9804 11.2929 11.7929C11.4804 11.6054 11.7348 11.5 12 11.5C12.2841 11.5 12.5623 11.4193 12.8023 11.2673C13.0423 11.1154 13.2343 10.8984 13.3558 10.6416C13.4773 10.3848 13.5234 10.0988 13.4887 9.81684C13.454 9.53489 13.34 9.26858 13.1598 9.04891C12.9797 8.82924 12.7409 8.66523 12.4712 8.57597C12.2015 8.48671 11.912 8.47587 11.6364 8.54471C11.3608 8.61354 11.1104 8.75923 10.9144 8.96482C10.7183 9.1704 10.5847 9.42743 10.529 9.706L8.567 9.313C8.68863 8.70508 8.96951 8.14037 9.38092 7.67659C9.79233 7.2128 10.3195 6.86658 10.9086 6.67332C11.4977 6.48006 12.1275 6.44669 12.7337 6.57661C13.3399 6.70654 13.9007 6.99511 14.3588 7.41282C14.8169 7.83054 15.1559 8.36241 15.3411 8.95406C15.5263 9.54572 15.5511 10.1759 15.4129 10.7803C15.2747 11.3847 14.9785 11.9415 14.5545 12.3939C14.1306 12.8462 13.5941 13.1779 13 13.355Z"
          fill="#8146F6"
        />
      </g>
      <defs>
        <clipPath id="clip0_8771_15406">
          <rect width="24" height="24" fill="white" />
        </clipPath>
      </defs>
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/RadioSelectedIcon.js">
import React from 'react'
export const RadioSelectedIcon = ({ size = 32 }) => {
  return (
    <svg
      width={size}
      height={size}
      viewBox="0 0 32 32"
      fill="none"
      xmlns="http://www.w3.org/2000/svg"
    >
      <rect
        x="0.665"
        y="0.665"
        width="30.67"
        height="30.67"
        rx="15.335"
        fill="white"
        stroke="#1E1E1E"
        strokeWidth="1.33"
      />
      <circle
        cx="16"
        cy="16"
        r="8.335"
        fill="#333641"
        stroke="#1E1E1E"
        strokeWidth="1.33"
      />
    </svg>
  )
... (2 lines truncated)
</file>

<file path="editor/src/components/icons/RadioUnselectedIcon.js">
import React from 'react'
export const RadioUnselectedIcon = ({ size = 32 }) => {
  return (
    <svg
      width={size}
      height={size}
      viewBox="0 0 32 32"
      fill="none"
      xmlns="http://www.w3.org/2000/svg"
    >
      <rect
        x="0.665"
        y="0.665"
        width="30.67"
        height="30.67"
        rx="15.335"
        fill="white"
        stroke="#1E1E1E"
        strokeWidth="1.33"
      />
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/RankingIcon.js">
import React from 'react'
export const RankingIcon = () => {
  return (
    <svg
      xmlns="http://www.w3.org/2000/svg"
      width="16"
      height="16"
      fill="currentColor"
      className="bi bi-reception-4"
      viewBox="0 0 16 16"
    >
      <path d="M0 11.5a.5.5 0 0 1 .5-.5h2a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1-.5-.5v-2zm4-3a.5.5 0 0 1 .5-.5h2a.5.5 0 0 1 .5.5v5a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1-.5-.5v-5zm4-3a.5.5 0 0 1 .5-.5h2a.5.5 0 0 1 .5.5v8a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1-.5-.5v-8zm4-3a.5.5 0 0 1 .5-.5h2a.5.5 0 0 1 .5.5v11a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1-.5-.5v-11z" />
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/RecoverIcon.js">
import React from 'react'
export const RecoverIcon = ({ width = '28', height = '28' }) => {
  return (
    <svg
      width={width}
      height={height}
      viewBox="0 0 28 28"
      fill="none"
      xmlns="http://www.w3.org/2000/svg"
    >
      <path
        d="M2.33203 14.0007C2.33203 20.4439 7.55537 25.6673 13.9987 25.6673C20.442 25.6673 25.6654 20.4439 25.6654 14.0007C25.6654 7.55733 20.442 2.33398 13.9987 2.33398V4.66732C19.1534 4.66732 23.332 8.84599 23.332 14.0007C23.332 19.1553 19.1534 23.334 13.9987 23.334C8.84404 23.334 4.66536 19.1553 4.66536 14.0007C4.66536 10.7926 6.28393 7.96253 8.74898 6.28258L8.7487 9.33398H11.082V2.33398H4.08203V4.66732L6.99774 4.66719C4.16457 6.79571 2.33203 10.1842 2.33203 14.0007Z"
        fill="#1E1E1E"
      />
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/RefreshIcon.js">
import React from 'react'
const RefreshIcon = ({ width = '20', height = '20' }) => {
  return (
    <svg
      width={width}
      height={height}
      viewBox="0 0 20 20"
      fill="white"
      xmlns="http://www.w3.org/2000/svg"
    >
      <path
        className="refresh-icon"
        d="M4.55185 3.69352C6.06398 2.38324 7.9985 1.66323 9.99935 1.66602C14.6018 1.66602 18.3327 5.39686 18.3327 9.99936C18.3327 11.7794 17.7743 13.4294 16.8244 14.7827L14.166 9.99936H16.666C16.6661 8.69238 16.2821 7.41419 15.5616 6.32374C14.8411 5.23328 13.816 4.37866 12.6137 3.86613C11.4114 3.3536 10.0849 3.20578 8.79931 3.44104C7.51368 3.6763 6.32556 4.28427 5.38268 5.18936L4.55185 3.69352ZM15.4468 16.3052C13.9347 17.6155 12.0002 18.3355 9.99935 18.3327C5.39685 18.3327
    1.66602 14.6019 1.66602 9.99936C1.66602 8.21936 2.22435 6.56936 3.17435 5.21602L5.83268 9.99936H3.33268C3.33258 11.3063 3.71664 12.5845 4.43713 13.675C5.15762 14.7654 6.18274 15.6201 7.38503 16.1326C8.58733 16.6451 9.91375 16.7929 11.1994 16.5577C12.485 16.3224 13.6731 15.7144 14.616 14.8094L15.4468 16.3052Z"
        fill="#6E748C"
      />
    </svg>
  )
}
export default RefreshIcon
</file>

<file path="editor/src/components/icons/ResetIcon.js">
import React from 'react'
const ResetIcon = ({ color = '#8146f6' }) => {
  return (
    <svg
      width="14"
      height="15"
      viewBox="0 0 14 15"
      fill="none"
      xmlns="http://www.w3.org/2000/svg"
      style={{ color }}
    >
      <path
        d="M2.97529 2.45526C4.185 1.40703 5.73262 0.831025 7.33329 0.833258C11.0153 0.833258 14 3.81793 14 7.49993C14 8.92393 13.5533 10.2439 12.7933 11.3266L10.6666 7.49993H12.6666C12.6667 6.45434 12.3595 5.43179 11.7831 4.55943C11.2067 3.68706 10.3866 3.00336 9.42475 2.59334C8.46291 2.18332 7.40177 2.06506 6.37326 2.25327C5.34476 2.44148 4.39426 2.92786 3.63996 3.65193L2.97529 2.45526ZM11.6913 12.5446C10.4816 13.5928 8.93397 14.1688 7.33329 14.1666C3.65129 14.1666 0.666626 11.1819 0.666626 7.49993C0.666626 6.07593 1.11329 4.75593 1.87329 3.67326L3.99996 7.49993H1.99996C1.99987 8.54551 2.30713 9.56806 2.88352 10.4404C3.45991 11.3128 4.28 11.9965 5.24184 12.4065C6.20368 12.8165 7.26482 12.9348 8.29332 12.7466C9.32183 12.5584 10.2723 12.072 11.0266 11.3479L11.6913 12.5446Z"
        fill="currentColor"
      />
    </svg>
  )
}
export default ResetIcon
</file>

<file path="editor/src/components/icons/ResponsesAvailableIcon.js">
import React from 'react'
export const ResponsesAvailableIcon = () => {
  return (
    <svg
      width="34"
      height="28"
      viewBox="0 0 34 28"
      fill="none"
      xmlns="http://www.w3.org/2000/svg"
    >
      <path
        d="M2.33203 15.1667H9.33203V24.5H2.33203V15.1667ZM18.6654 9.33333H25.6654V24.5H18.6654V9.33333ZM10.4987 3.5H17.4987V24.5H10.4987V3.5ZM4.66536 17.5V22.1667H6.9987V17.5H4.66536ZM12.832 5.83333V22.1667H15.1654V5.83333H12.832ZM20.9987 11.6667V22.1667H23.332V11.6667H20.9987Z"
        fill="#1E1E1E"
      />
      <g clipPath="url(#clip0_8771_15109)">
        <path
          d="M28 11C25.2385 11 23 8.7615 23 6C23 3.2385 25.2385 1 28 1C30.7615 1 33 3.2385 33 6C33 8.7615 30.7615 11 28 11ZM27.5015 8L31.0365 4.4645L30.3295 3.7575L27.5015 6.586L26.087 5.1715L25.38 5.8785L27.5015 8Z"
          fill="#4DD753"
        />
      </g>
      <defs>
        <clipPath id="clip0_8771_15109">
          <rect width="12" height="12" fill="white" transform="translate(22)" />
        </clipPath>
      </defs>
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/ResponsesNotAvailableIcon.js">
import React from 'react'
export const ResponsesNotAvailableIcon = () => {
  return (
    <svg
      width="34"
      height="28"
      viewBox="0 0 34 28"
      fill="none"
      xmlns="http://www.w3.org/2000/svg"
    >
      <path
        d="M2.33203 15.1667H9.33203V24.5H2.33203V15.1667ZM18.6654 9.33333H25.6654V24.5H18.6654V9.33333ZM10.4987 3.5H17.4987V24.5H10.4987V3.5ZM4.66536 17.5V22.1667H6.9987V17.5H4.66536ZM12.832 5.83333V22.1667H15.1654V5.83333H12.832ZM20.9987 11.6667V22.1667H23.332V11.6667H20.9987Z"
        fill="#1E1E1E"
      />
      <g clipPath="url(#clip0_8771_15132)">
        <path
          d="M28 11C25.2385 11 23 8.7615 23 6C23 3.2385 25.2385 1 28 1C30.7615 1 33 3.2385 33 6C33 8.7615 30.7615 11 28 11ZM28 5.293L26.586 3.8785L25.8785 4.586L27.293 6L25.8785 7.414L26.586 8.1215L28 6.707L29.414 8.1215L30.1215 7.414L28.707 6L30.1215 4.586L29.414 3.8785L28 5.293Z"
          fill="#FF515F"
        />
      </g>
      <defs>
        <clipPath id="clip0_8771_15132">
          <rect width="12" height="12" fill="white" transform="translate(22)" />
        </clipPath>
      </defs>
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/ResponseTableIcon.js">
import React from 'react'
export const ResponseTableIcon = () => {
  return (
    <svg
      width="28"
      height="28"
      viewBox="0 0 28 28"
      fill="none"
      xmlns="http://www.w3.org/2000/svg"
    >
      <path
        d="M4.66536 9.33333H23.332V5.83333H4.66536V9.33333ZM16.332 22.1667V11.6667H11.6654V22.1667H16.332ZM18.6654 22.1667H23.332V11.6667H18.6654V22.1667ZM9.33203 22.1667V11.6667H4.66536V22.1667H9.33203ZM3.4987 3.5H24.4987C25.143 3.5 25.6654 4.02234 25.6654 4.66667V23.3333C25.6654 23.9777 25.143 24.5 24.4987 24.5H3.4987C2.85437 24.5 2.33203 23.9777 2.33203 23.3333V4.66667C2.33203 4.02234 2.85437 3.5 3.4987 3.5Z"
        fill="#1E1E1E"
      />
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/SearchIcon.js">
import React from 'react'
export const SearchIcon = () => {
  return (
    <svg
      xmlns="http://www.w3.org/2000/svg"
      width="24"
      height="24"
      viewBox="0 0 24 24"
      fill="none"
    >
      <g id="Icon">
        <path
          id="Shape"
          fillRule="evenodd"
          d="M17.4997 11.5C17.4997 13.7091 15.7089 15.5 13.4997 15.5C11.2906 15.5 9.49974 13.7091 9.49974 11.5C9.49974 9.29086 11.2906 7.5 13.4997 7.5C15.7089 7.5 17.4997 9.29086 17.4997 11.5ZM18.9997 11.5C18.9997 14.5376 16.5373 17 13.4997 17C12.1028 17 10.8275 16.4792 9.85737 15.6211L6.49362 18.5644L5.50586 17.4356L8.87891 14.4841C8.32267 13.6246 7.99974 12.6 7.99974 11.5C7.99974 8.46243 10.4622 6 13.4997 6C16.5373 6 18.9997 8.46243 18.9997 11.5Z"
          fill="#1E1E1E"
        />
      </g>
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/Separator.js">
import React from 'react'
export const Separator = (props) => {
  return (
    <svg width="2" height="26" viewBox="0 0 2 26" fill="none" {...props}>
      <path d="M1 1L0.999999 25" stroke="#DDDEE8" strokeLinecap="round" />
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/SettingsIcon.js">
import React from 'react'
export const SettingsIcon = (props) => {
  return (
    <svg
      width="24"
      height="24"
      viewBox="0 0 24 24"
      fill="none"
      xmlns="http://www.w3.org/2000/svg"
      className={props.className}
    >
      <path
        fillRule="evenodd"
        clipRule="evenodd"
        d="M10.2889 4.8356C10.3693 4.35341 10.7865 4 11.2753 4H12.5811C13.0699 4 13.4871 4.35341 13.5675 4.8356L13.8118 6.30162C14.5992 6.56176 15.3145 6.98055 15.9196 7.52014L17.3127 6.99827C17.7704 6.82677 18.2851 7.01137 18.5295 7.43471L19.1824 8.56552C19.4268 8.98887 19.3293 9.52687 18.9519 9.83756L17.8045 10.7821C17.8856 11.1754 17.9282 11.5827 17.9282 12C17.9282 12.4171 17.8856 12.8243 17.8046 13.2174L18.9529 14.1627C19.3303 14.4734 19.4277 15.0114 19.1833 15.4347L18.5304 16.5655C18.286 16.9889 17.7714 17.1735 17.3136 17.002L15.9197 16.4798C15.3145 17.0194 14.5993 17.4382 13.8118 17.6984L13.5675 19.1644C13.4871 19.6466 13.0699 20 12.5811 20H11.2753C10.7865 20 10.3693 19.6466 10.2889 19.1644L10.0446 17.6984C9.25714 17.4382 8.54188 17.0194 7.93667 16.4798L6.54281 17.002C6.08504 17.1735 5.57038 16.9889 5.32597 16.5655L4.67309 15.4347C4.42867 15.0114 4.52614 14.4734 4.90355 14.1627L6.05178 13.2174C5.97076 12.8243 5.9282 12.4171 5.9282 12C5.9282 11.5827 5.9708 11.1754 6.05188 10.7821L4.90449 9.83757C4.52708 9.52688 4.42961 8.98888 4.67403 8.56553L5.3269 7.43472C5.57132 7.01137 6.08598 6.82678 6.54375 6.99828L7.93675 7.52015C8.54195 6.98055 9.25718 6.56176 10.0446 6.30162L10.2889 4.8356ZM14.9282 12C14.9282 13.6569 13.5851 15 11.9282 15C10.2713 15 8.9282 13.6569 8.9282 12C8.9282 10.3431 10.2713 9 11.9282 9C13.5851 9 14.9282 10.3431 14.9282 12Z"
        fill="#1E1E1E"
      />
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/ShareBoxIcon.js">
import React from 'react'
export const ShareBoxIcon = (props) => {
  return (
    <svg
      className={props.className}
      xmlns="http://www.w3.org/2000/svg"
      viewBox="0 0 24 24"
      width="16"
      height="16"
      {...props}
    >
      <path
        fill={props.fill}
        d="M10 3V5H5V19H19V14H21V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3H10ZM17.5858 5H13V3H21V11H19V6.41421L12 13.4142L10.5858 12L17.5858 5Z"
      ></path>
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/ShortcutIcon.js">
import React from 'react'
export const ShortcutIcon = (props) => {
  return (
    <svg
      xmlns="http://www.w3.org/2000/svg"
      width="8"
      height="8"
      fill="none"
      className={props.className}
      {...props}
    >
      <path
        d="M3.33333 2.66667H4.66667V2.16667C4.66667 1.52233 5.189 1 5.83333 1C6.47767 1 7 1.52233 7 2.16667C7 2.811 6.47767 3.33333 5.83333 3.33333H5.33333V4.66667H5.83333C6.47767 4.66667 7 5.189 7 5.83333C7 6.47767 6.47767 7 5.83333 7C5.189 7 4.66667 6.47767 4.66667 5.83333V5.33333H3.33333V5.83333C3.33333 6.47767 2.811 7 2.16667 7C1.52233 7 1 6.47767 1 5.83333C1 5.189 1.52233 4.66667 2.16667 4.66667H2.66667V3.33333H2.16667C1.52233 3.33333 1 2.811 1 2.16667C1 1.52233 1.52233 1 2.16667 1C2.811 1 3.33333 1.52233 3.33333 2.16667V2.66667ZM2.66667 2.66667V2.16667C2.66667 1.89052 2.44281 1.66667 2.16667 1.66667C1.89052 1.66667 1.66667 1.89052 1.66667 2.16667C1.66667 2.44281 1.89052 2.66667 2.16667 2.66667H2.66667ZM2.66667 5.33333H2.16667C1.89052 5.33333 1.66667 5.5572 1.66667 5.83333C1.66667 6.10947 1.89052 6.33333 2.16667 6.33333C2.44281 6.33333 2.66667 6.10947 2.66667 5.83333V5.33333ZM5.33333 2.66667H5.83333C6.10947 2.66667 6.33333 2.44281 6.33333 2.16667C6.33333 1.89052 6.10947 1.66667 5.83333 1.66667C5.5572 1.66667 5.33333 1.89052 5.33333 2.16667V2.66667ZM5.33333 5.33333V5.83333C5.33333 6.10947 5.5572 6.33333 5.83333 6.33333C6.10947 6.33333 6.33333 6.10947 6.33333 5.83333C6.33333 5.5572 6.10947 5.33333 5.83333 5.33333H5.33333ZM3.33333 3.33333V4.66667H4.66667V3.33333H3.33333Z"
        fill="white"
      />
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/ShutDownIcon.js">
import React from 'react'
export const ShutDownIcon = (props) => {
  return (
    <svg
      className={props.className}
      xmlns="http://www.w3.org/2000/svg"
      viewBox="0 0 24 24"
    >
      <path d="M6.26489 3.80698L7.41191 5.44558C5.34875 6.89247 4 9.28873 4 12C4 16.4183 7.58172 20 12 20C16.4183 20 20 16.4183 20 12C20 9.28873 18.6512 6.89247 16.5881 5.44558L17.7351 3.80698C20.3141 5.61559 22 8.61091 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 8.61091 3.68594 5.61559 6.26489 3.80698ZM11 12V2H13V12H11Z"></path>
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/SmallCheckMarkIcon.js">
import React from 'react'
const SmallCheckMarkIcon = ({ classname }) => {
  return (
    <svg
      className={classname}
      width="16"
      height="16"
      viewBox="0 0 16 16"
      fill="none"
      xmlns="http://www.w3.org/2000/svg"
    >
      <g clipPath="url(#clip0_9045_7635)">
        <path
          d="M7.9987 14.6673C4.3167 14.6673 1.33203 11.6827 1.33203 8.00065C1.33203 4.31865 4.3167 1.33398 7.9987 1.33398C11.6807 1.33398 14.6654 4.31865 14.6654 8.00065C14.6654 11.6827 11.6807 14.6673 7.9987 14.6673ZM7.33403 10.6673L12.0474 5.95332L11.1047 5.01065L7.33403 8.78198L5.44803 6.89598L4.50536 7.83865L7.33403 10.6673Z"
          fill="#1E1E1E"
        />
      </g>
      <defs>
        <clipPath id="clip0_9045_7635">
          <rect width="16" height="16" fill="white" />
        </clipPath>
      </defs>
    </svg>
  )
}
export default SmallCheckMarkIcon
</file>

<file path="editor/src/components/icons/SmallThreeDotIcon.js">
import React from 'react'
export const SmallThreeDotIcon = (props) => {
  return (
    <svg
      width="24"
      height="24"
      viewBox="0 0 24 24"
      fill="none"
      xmlns="http://www.w3.org/2000/svg"
      className={props.className}
    >
      <path
        d="M5 10C3.9 10 3 10.9 3 12C3 13.1 3.9 14 5 14C6.1 14 7 13.1 7 12C7 10.9 6.1 10 5 10ZM19 10C17.9 10 17 10.9 17 12C17 13.1 17.9 14 19 14C20.1 14 21 13.1 21 12C21 10.9 20.1 10 19 10ZM12 10C10.9 10 10 10.9 10 12C10 13.1 10.9 14 12 14C13.1 14 14 13.1 14 12C14 10.9 13.1 10 12 10Z"
        fill="#9094A7"
      />
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/StarIcon.js">
import React from 'react'
export const StarIcon = (props) => {
  return (
    <svg
      xmlns="http://www.w3.org/2000/svg"
      viewBox="0 0 24 24"
      width="24"
      height="24"
      className={props.className}
    >
      <path d="M12.0006 18.26L4.94715 22.2082L6.52248 14.2799L0.587891 8.7918L8.61493 7.84006L12.0006 0.5L15.3862 7.84006L23.4132 8.7918L17.4787 14.2799L19.054 22.2082L12.0006 18.26ZM12.0006 15.968L16.2473 18.3451L15.2988 13.5717L18.8719 10.2674L14.039 9.69434L12.0006 5.27502L9.96214 9.69434L5.12921 10.2674L8.70231 13.5717L7.75383 18.3451L12.0006 15.968Z"></path>
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/StopIcon.js">
import React from 'react'
export const StopIcon = (props) => {
  return (
    <svg
      xmlns="http://www.w3.org/2000/svg"
      width="25"
      height="25"
      viewBox="0 0 25 25"
      fill="none"
      {...props}
    >
      <path
        d="M4.5 3.69531H20.5C21.0523 3.69531 21.5 4.14303 21.5 4.69531V20.6953C21.5 21.2476 21.0523 21.6953 20.5 21.6953H4.5C3.94772 21.6953 3.5 21.2476 3.5 20.6953V4.69531C3.5 4.14303 3.94772 3.69531 4.5 3.69531Z"
        fill="white"
      />
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/SurveyMenuIcon.js">
import React from 'react'
export const SurveyMenuIcon = (props) => {
  return (
    <svg
      xmlns="http://www.w3.org/2000/svg"
      width="36"
      height="36"
      fill="none"
      className={props.className}
      {...props}
    >
      <g clipPath="url(#bg)">
        <rect width="36" height="36" fill={props.bgcolor} rx="4" />
        <g clipPath="url(#icon)" transform="translate(6, 6)">
          <path d="M21 8V20.993C21.0009 21.1243 20.976 21.2545 20.9266 21.3762C20.8772 21.4979 20.8043 21.6087 20.7121 21.7022C20.6199 21.7957 20.5101 21.8701 20.3892 21.9212C20.2682 21.9723 20.1383 21.9991 20.007 22H3.993C3.72981 22 3.47739 21.8955 3.2912 21.7095C3.105 21.5235 3.00027 21.2712 3 21.008V2.992C3 2.455 3.449 2 4.002 2H14.997L21 8ZM19 9H14V4H5V20H19V9ZM8 7H11V9H8V7ZM8 11H16V13H8V11ZM8 15H16V17H8V15Z" />
        </g>
      </g>
      <defs>
        <clipPath id="bg">
          <rect width="36" height="36" />
        </clipPath>
        <clipPath id="icon">
          <rect width="24" height="24" />
        </clipPath>
      </defs>
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/SurveyPermissionsIcon.js">
import React from 'react'
export const SurveyPermissionsIcon = (props) => {
  return (
    <svg
      xmlns="http://www.w3.org/2000/svg"
      width="36"
      height="36"
      fill="none"
      className={props.className}
      {...props}
    >
      <g clipPath="url(#bg_permissions)">
        <rect width="36" height="36" fill={props.bgcolor} rx="4" />
        <g clipPath="url(#icon_permissions)" transform="translate(6, 6)">
          <path d="M2 22C2 17.5817 5.58172 14 10 14C14.4183 14 18 17.5817 18 22H16C16 18.6863 13.3137 16 10 16C6.68629 16 4 18.6863 4 22H2ZM10 13C6.685 13 4 10.315 4 7C4 3.685 6.685 1 10 1C13.315 1 16 3.685 16 7C16 10.315 13.315 13 10 13ZM10 11C12.21 11 14 9.21 14 7C14 4.79 12.21 3 10 3C7.79 3 6 4.79 6 7C6 9.21 7.79 11 10 11ZM18.2837 14.7028C21.0644 15.9561 23 18.752 23 22H21C21 19.564 19.5483 17.4671 17.4628 16.5271L18.2837 14.7028ZM17.5962 3.41321C19.5944 4.23703 21 6.20361 21 8.5C21 11.3702 18.8042 13.7252 16 13.9776V11.9646C17.6967 11.7222 19 10.264 19 8.5C19 7.11935 18.2016 5.92603 17.041 5.35635L17.5962 3.41321Z"></path>
        </g>
      </g>
      <defs>
        <clipPath id="bg_permissions">
          <rect width="36" height="36" />
        </clipPath>
        <clipPath id="icon_permissions">
          <rect width="24" height="24" />
        </clipPath>
      </defs>
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/SurveyPresentationIcon.js">
import React from 'react'
export const SurveyPresentationIcon = (props) => {
  return (
    <svg
      xmlns="http://www.w3.org/2000/svg"
      width="36"
      height="36"
      fill="none"
      className={props.className}
      {...props}
    >
      <g clipPath="url(#bg_presentation)">
        <rect width="36" height="36" fill={props.bgcolor} rx="4" />
        <g clipPath="url(#icon_presentation)" transform="translate(6, 6)">
          <path d="M18.2277 17.7321L19.9955 15.9644L21.7632 17.7321C22.7395 18.7084 22.7395 20.2914 21.7632 21.2677C20.7869 22.244 19.204 22.244 18.2277 21.2677C17.2514 20.2914 17.2514 18.7084 18.2277 17.7321ZM7.87861 0.0795898L19.1923 11.3933C19.5828 11.7838 19.5828 12.417 19.1923 12.8075L10.707 21.2928C10.3165 21.6833 9.6833 21.6833 9.2928 21.2928L0.807538 12.8075C0.417018 12.417 0.417018 11.7838 0.807538 11.3933L8.58572 3.61512L6.4644 1.4938L7.87861 0.0795898ZM9.9999 5.02934L2.92886 12.1004H17.071L9.9999 5.02934Z" />
        </g>
      </g>
      <defs>
        <clipPath id="bg_presentation">
          <rect width="36" height="36" />
        </clipPath>
        <clipPath id="icon_presentation">
          <rect width="24" height="24" />
        </clipPath>
      </defs>
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/SurveySettingsIcon.js">
import React from 'react'
export const SurveySettingsIcon = (props) => {
  return (
    <svg
      xmlns="http://www.w3.org/2000/svg"
      width="36"
      height="36"
      fill="none"
      className={props.className}
      {...props}
    >
      <g clipPath="url(#bg)">
        <rect width="36" height="36" fill={props.bgcolor} rx="4" />
        <g clipPath="url(#b)">
          <path d="M16.295 9.842a8.324 8.324 0 0 1 3.409-.002c.148.966.717 1.86 1.629 2.386.912.527 1.97.573 2.88.218a8.325 8.325 0 0 1 1.703 2.953A3.327 3.327 0 0 0 24.666 18c0 1.054.489 1.993 1.252 2.604a8.37 8.37 0 0 1-1.705 2.952 3.328 3.328 0 0 0-2.88.218 3.328 3.328 0 0 0-1.629 2.384 8.325 8.325 0 0 1-3.409.002 3.327 3.327 0 0 0-1.629-2.386 3.327 3.327 0 0 0-2.88-.218 8.326 8.326 0 0 1-1.703-2.953 3.327 3.327 0 0 0 1.25-2.603 3.327 3.327 0 0 0-1.251-2.603 8.365 8.365 0 0 1 1.704-2.952c.91.355 1.968.308 2.88-.218a3.327 3.327 0 0 0 1.629-2.384ZM18 20.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Z" />
        </g>
      </g>
      <defs>
        <clipPath id="a">
          <rect width="36" height="36" rx="4" />
        </clipPath>
        <clipPath id="b">
          <path d="M8 8h20v20H8z" />
        </clipPath>
      </defs>
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/SurveyStructureIcon.js">
import React from 'react'
export const SurveyStructureIcon = (props) => {
  return (
    <svg
      xmlns="http://www.w3.org/2000/svg"
      width="36"
      height="36"
      fill="none"
      className={props.className}
    >
      <g clipPath="url(#bg)">
        <rect width="36" height="36" fill={props.bgcolor} rx="4" />
        <g clipPath="url(#b)">
          <path d="M18 10.5v1.667h-7.5V10.5H18Zm3.333 13.333V25.5H10.5v-1.667h10.833Zm5-6.666v1.666H10.5v-1.666h15.833Z" />
        </g>
      </g>
      <defs>
        <clipPath id="a">
          <rect width="36" height="36" rx="4" />
        </clipPath>
        <clipPath id="b">
          <path d="M8 8h20v20H8z" />
        </clipPath>
      </defs>
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/SurveyTranslationIcon.js">
import React from 'react'
export const SurveyTranslationIcon = (props) => {
  return (
    <svg
      xmlns="http://www.w3.org/2000/svg"
      width="36"
      height="36"
      fill="none"
      className={props.className}
      {...props}
    >
      <g clipPath="url(#bg_translation)">
        <rect width="36" height="36" fill={props.bgcolor} rx="4" />
        <g clipPath="url(#icon_translation)" transform="translate(6, 6)">
          <path d="M17.5 10L21.9 21H19.745L18.544 18H14.454L13.255 21H11.101L15.5 10H17.5ZM9 2V4H15V6L13.0322 6.0006C12.2425 8.36616 10.9988 10.5057 9.4115 12.301C10.1344 12.9457 10.917 13.5176 11.7475 14.0079L10.9969 15.8855C9.9237 15.2781 8.91944 14.5524 7.99961 13.7249C6.21403 15.332 4.10914 16.5553 1.79891 17.2734L1.26257 15.3442C3.2385 14.7203 5.04543 13.6737 6.59042 12.3021C5.46277 11.0281 4.50873 9.57985 3.76742 8.00028L6.00684 8.00037C6.57018 9.03885 7.23979 10.0033 7.99967 10.877C9.2283 9.46508 10.2205 7.81616 10.9095 6.00101L1 6V4H7V2H9ZM16.5 12.8852L15.253 16H17.745L16.5 12.8852Z" />
        </g>
      </g>
      <defs>
        <clipPath id="bg_translation">
          <rect width="36" height="36" />
        </clipPath>
        <clipPath id="icon_translation">
          <rect width="24" height="24" />
        </clipPath>
      </defs>
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/TableIcon.js">
import React from 'react'
export const TableIcon = (props) => {
  return (
    <svg
      xmlns="http://www.w3.org/2000/svg"
      viewBox="0 0 24 24"
      width="16"
      height="16"
      className={props.className}
    >
      <path d="M14 10V14H10V10H14ZM16 10H21V14H16V10ZM14 21H10V16H14V21ZM16 21V16H21V20C21 20.5523 20.5523 21 20 21H16ZM14 3V8H10V3H14ZM16 3H20C20.5523 3 21 3.44772 21 4V8H16V3ZM8 10V14H3V10H8ZM8 21H4C3.44772 21 3 20.5523 3 20V16H8V21ZM8 3V8H3V4C3 3.44772 3.44772 3 4 3H8Z"></path>
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/TextIcon.js">
import React from 'react'
export const TextIcon = (props) => {
  return (
    <svg
      xmlns="http://www.w3.org/2000/svg"
      viewBox="0 0 24 24"
      width="16"
      height="16"
      className={props.className}
    >
      <path d="M13 6V21H11V6H5V4H19V6H13Z"></path>
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/TrashIcon.js">
import React from 'react'
export const TrashIcon = (props) => {
  return (
    <svg
      width="24"
      height="24"
      viewBox="0 0 24 24"
      fill="none"
      xmlns="http://www.w3.org/2000/svg"
      className={props.className}
    >
      <path
        fillRule="evenodd"
        clipRule="evenodd"
        d="M12 2.71436C10.7376 2.71436 9.71429 3.7377 9.71429 5.00007H4V7.00007H5.46699C5.46718 7.09839 5.47463 7.19809 5.4898 7.29864L7.17174 18.4415C7.3194 19.4197 8.16005 20.143 9.14934 20.143H14.8507C15.84 20.143 16.6806 19.4197 16.8283 18.4415L18.5102 7.29864C18.5254 7.19809 18.5328 7.09839 18.533 7.00007H20V5.00007H14.2857C14.2857 3.7377 13.2624 2.71436 12 2.71436ZM16.8151 7.04277C16.8173 7.02839 16.8183 7.01413 16.8184 7.00007H7.18163C7.18165 7.01413 7.18271 7.02839 7.18489 7.04277L8.86683 18.1856C8.88792 18.3253 9.00801 18.4287 9.14934 18.4287H14.8507C14.992 18.4287 15.1121 18.3253 15.1332 18.1856L16.8151 7.04277Z"
        fill="#F9F9FB"
      />
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/UploadIcon.js">
import React from 'react'
export const UploadIcon = (props) => {
  return (
    <svg
      xmlns="http://www.w3.org/2000/svg"
      viewBox="0 0 24 24"
      width="18"
      height="18"
      className={props.className}
    >
      <path d="M3 19H21V21H3V19ZM13 5.82843V17H11V5.82843L4.92893 11.8995L3.51472 10.4853L12 2L20.4853 10.4853L19.0711 11.8995L13 5.82843Z"></path>
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/XIcon.js">
export const XIcon = () => {
  return (
    <svg
      width="14"
      height="14"
      viewBox="0 0 10 10"
      fill="none"
      xmlns="http://www.w3.org/2000/svg"
    >
      <path
        d="M4.99999 4.05732L8.29999 0.757324L9.24266 1.69999L5.94266 4.99999L9.24266 8.29999L8.29999 9.24266L4.99999 5.94266L1.69999 9.24266L0.757324 8.29999L4.05732 4.99999L0.757324 1.69999L1.69999 0.757324L4.99999 4.05732Z"
        fill="black"
      />
    </svg>
  )
}
</file>

<file path="editor/src/components/icons/XIconWithBorder.js">
export const XIconWithBorder = () => {
  return (
    <svg
      width="20"
      height="20"
      viewBox="0 0 20 20"
      fill="none"
      xmlns="http://www.w3.org/2000/svg"
    >
      <g clipPath="url(#clip0_10966_5517)">
        <path
          d="M9.99984 18.3327C5.39734 18.3327 1.6665 14.6018 1.6665 9.99935C1.6665 5.39685 5.39734 1.66602 9.99984 1.66602C14.6023 1.66602 18.3332 5.39685 18.3332 9.99935C18.3332 14.6018 14.6023 18.3327 9.99984 18.3327ZM9.99984 16.666C11.7679 16.666 13.4636 15.9636 14.7139 14.7134C15.9641 13.4632 16.6665 11.7675 16.6665 9.99935C16.6665 8.23124 15.9641 6.53555 14.7139 5.2853C13.4636 4.03506 11.7679 3.33268 9.99984 3.33268C8.23173 3.33268 6.53604 4.03506 5.28579 5.2853C4.03555 6.53555 3.33317 8.23124 3.33317 9.99935C3.33317 11.7675 4.03555 13.4632 5.28579 14.7134C6.53604 15.9636 8.23173 16.666 9.99984 16.666ZM9.99984 8.82102L12.3565 6.46352L13.5357 7.64268L11.1782 9.99935L13.5357 12.356L12.3565 13.5352L9.99984 11.1777L7.64317 13.5352L6.464 12.356L8.8215 9.99935L6.464 7.64268L7.64317 6.46352L9.99984 8.82102Z"
          fill="#6E748C"
        />
      </g>
      <defs>
        <clipPath id="clip0_10966_5517">
          <rect width="20" height="20" fill="white" />
        </clipPath>
      </defs>
    </svg>
  )
}
</file>

<file path="editor/src/components/ImportSurvey/decodeHtmlEntities.js">
export const decodeHtmlEntities = (value) => {
  if (typeof value !== 'string' || !value.includes('&')) return value
  const textarea = document.createElement('textarea')
  textarea.innerHTML = value
  return textarea.value
}
</file>

<file path="editor/src/components/ImportSurvey/importSurveyConfig.js">
export const IMPORT_SURVEY_FILE_TYPES = {
  'application/octet-stream': ['.lsa', '.lss'],
  'text/plain': ['.txt', '.tsv'],
  'text/tab-separated-values': ['.tsv'],
  'text/xml': ['.lss'],
}
export const IMPORT_SURVEY_GROUP_STRATEGIES = {
  DEFAULT: 'default',
  FROM_SURVEY: 'from_survey',
}
export const getImportSurveyGroupOptions = () => [
  {
    value: IMPORT_SURVEY_GROUP_STRATEGIES.DEFAULT,
    label: t('Import on default survey group'),
  },
  {
    value: IMPORT_SURVEY_GROUP_STRATEGIES.FROM_SURVEY,
    label: t('Keep the survey group from the imported file'),
  },
]
</file>

<file path="editor/src/components/ImportSurvey/ImportSurveyForm.js">
import { Alert, Form } from 'react-bootstrap'
import { FileDropZone, FormCheck, Select } from 'components/UIComponents'
import {
  getImportSurveyGroupOptions,
  IMPORT_SURVEY_FILE_TYPES,
  IMPORT_SURVEY_GROUP_STRATEGIES,
} from './importSurveyConfig'
export const ImportSurveyForm = ({
  convertResourceLinks,
  file,
  fileError,
  groupStrategy,
  maxFileSize,
  onConvertResourceLinksChange,
  onFileChange,
  onFileReject,
  onGroupStrategyChange,
  submitting,
}) => {
  const surveyGroupOptions = getImportSurveyGroupOptions()
  return (
    <Form id="import-survey-form">
      <div className="import-survey-modal__description">
        <p className="mb-1">
          {t(
            'Select a survey structure file (.lss, .txt, .tsv) or survey archive file (.lsa)'
          )}
        </p>
        {Number.isFinite(maxFileSize) && (
          <p className="mb-0">
... (45 lines truncated)
</file>

<file path="editor/src/components/ImportSurvey/ImportSurveyModal.js">
import { useEffect, useState } from 'react'
import { Modal, Spinner } from 'react-bootstrap'
import { Button } from 'components/UIComponents'
import { ImportSurveyForm } from './ImportSurveyForm'
import { ImportSurveySummary } from './ImportSurveySummary'
import { IMPORT_SURVEY_GROUP_STRATEGIES } from './importSurveyConfig'
import { showImportError, showImportSuccess } from './importSurveyNotifications'
export const ImportSurveyModal = ({
  maxFileSize,
  onGoToSurvey = () => {},
  onHide = () => {},
  onImport = async () => null,
  show = false,
  summary: controlledSummary = null,
}) => {
  const [convertResourceLinks, setConvertResourceLinks] = useState(true)
  const [file, setFile] = useState(null)
  const [fileError, setFileError] = useState('')
  const [groupStrategy, setGroupStrategy] = useState(
    IMPORT_SURVEY_GROUP_STRATEGIES.DEFAULT
  )
  const [submitting, setSubmitting] = useState(false)
  const [submittedSummary, setSubmittedSummary] = useState(null)
  const summary = controlledSummary || submittedSummary
  useEffect(() => {
    if (!show) {
      setConvertResourceLinks(true)
      setFile(null)
      setFileError('')
      setGroupStrategy(IMPORT_SURVEY_GROUP_STRATEGIES.DEFAULT)
... (123 lines truncated)
</file>

<file path="editor/src/components/ImportSurvey/ImportSurveyModal.test.js">
import 'tests/mocks'
import { screen } from '@testing-library/react'
import userEvent from '@testing-library/user-event'
import { renderWithProviders } from 'tests/testUtils'
import { ImportSurveyModal } from './ImportSurveyModal'
describe('ImportSurveyModal', () => {
  const maxFileSize = 10 * 1024 * 1024
  test('submits the selected options and displays the returned summary', async () => {
    const user = userEvent.setup()
    const onImport = jest.fn().mockResolvedValue({
      newsid: 123456,
      surveys: 1,
      questions: 4,
    })
    await renderWithProviders(
      <ImportSurveyModal maxFileSize={maxFileSize} show onImport={onImport} />
    )
    expect(
      await screen.findByText('Maximum file size 10.00 MB')
    ).toBeInTheDocument()
    const file = new File(['survey'], 'survey.lss', { type: 'text/xml' })
    await user.upload(
      await screen.findByLabelText('Select or drop a file here'),
      file
    )
    await user.click(screen.getByRole('button', { name: 'Import survey' }))
    expect(onImport).toHaveBeenCalledWith({
      convertResourceLinks: true,
      file,
      groupStrategy: 'default',
... (39 lines truncated)
</file>

<file path="editor/src/components/ImportSurvey/importSurveyNotifications.js">
import React from 'react'
import { ExclamationMark } from 'components/icons'
import SmallCheckMarkIcon from 'components/icons/SmallCheckMarkIcon'
import { Toast } from 'helpers'
const BASE_OPTIONS = {
  position: 'top-center',
}
export const showImportError = (message) =>
  Toast({
    ...BASE_OPTIONS,
    message,
    className: 'import-survey-toast import-survey-toast--error',
    leftIcon: <ExclamationMark />,
    duration: 8000,
  })
export const showImportSuccess = () =>
  Toast({
    ...BASE_OPTIONS,
    message: t('Import of survey is completed.'),
    className: 'import-survey-toast import-survey-toast--success',
    leftIcon: <SmallCheckMarkIcon />,
    rightIcon: '',
    duration: 5000,
  })
</file>

<file path="editor/src/components/ImportSurvey/ImportSurveySummary.js">
import { Alert, Table } from 'react-bootstrap'
import { decodeHtmlEntities } from './decodeHtmlEntities'
const getSummaryFields = () => [
  ['surveys', t('Surveys')],
  ['languages', t('Languages')],
  ['groups', t('Question groups')],
  ['questions', t('Questions')],
  ['question_attributes', t('Question attributes')],
  ['answers', t('Answers')],
  ['subquestions', t('Subquestions')],
  ['defaultvalues', t('Default answers')],
  ['conditions', t('Conditions')],
  ['labelsets', t('Label sets')],
  ['assessments', t('Assessments')],
  ['quota', t('Quotas')],
  ['quotamembers', t('Quota rules')],
  ['quotals', t('Quota language settings')],
  ['plugin_settings', t('Plugin settings')],
  ['themes', t('Themes')],
  ['responses', t('Responses')],
]
export const ImportSurveySummary = ({ summary }) => {
  const rows = getSummaryFields().filter(
    ([key]) => summary[key] !== undefined && summary[key] !== null
  )
  return (
    <div className="import-survey-summary">
      <p>{t('Import of survey is completed.')}</p>
      <Table bordered size="sm" className="mb-0">
        <caption className="visually-hidden">
... (29 lines truncated)
</file>

<file path="editor/src/components/ImportSurvey/index.js">
export * from './ImportSurveyModal'
export * from './ImportSurveyForm'
export * from './ImportSurveySummary'
</file>

<file path="editor/src/components/MeatballMenu/MeatballMenu.js">
import React, { useMemo, useState } from 'react'
import { Button, OverlayTrigger, Popover } from 'react-bootstrap'
import { useAppState } from 'hooks'
import { STATES } from 'helpers'
import { TooltipContainer } from 'components'
import { SmallThreeDotIcon } from 'components/icons'
import { getTooltipMessages } from 'helpers/options'
export const MeatballMenu = ({
  duplicateText,
  deleteText,
  handleDuplicate,
  handleDelete,
  testId = '',
  items = [],
  additionalItems = [],
  shouldDisableIfSurveyActive = true,
  meatballClassName = 'meatball-menu ',
  actionsTitle = '',
  placement = 'right',
  submenuPlacement = 'left',
  TogglerIcon = SmallThreeDotIcon,
}) => {
  const [showMeatballMenu, setShowMeatballMenu] = useState(false)
  const [isSurveyActive] = useAppState(STATES.IS_SURVEY_ACTIVE, false)
  const [hasSurveyUpdatePermission] = useAppState(
    STATES.HAS_SURVEY_UPDATE_PERMISSION
  )
  const onDuplicate = () => {
    setShowMeatballMenu(false)
    handleDuplicate()
... (177 lines truncated)
</file>

<file path="editor/src/components/MeatballMenu/MeatballMenu.test.js">
import 'tests/mocks'
import { screen } from '@testing-library/react'
import userEvent from '@testing-library/user-event'
import { renderWithProviders } from 'tests/testUtils'
import { MeatballMenu } from './MeatballMenu'
describe('MeatballMenu', () => {
  const handleDelete = jest.fn(() => {})
  const handleDuplicate = jest.fn(() => {})
  beforeEach(async () => {
    await renderWithProviders(
      <MeatballMenu
        duplicateText={'duplicateText'}
        deleteText={'deleteText'}
        handleDelete={handleDelete}
        handleDuplicate={handleDuplicate}
      />
    )
  })
  test('Should open and close the meatball menu', async () => {
    const meatballToggler = screen.getByTestId('meatball-menu-button')
    await userEvent.click(meatballToggler)
    expect(screen.queryByTestId('meatball-menu-overlay')).toBeTruthy()
  })
  test('Should click on duplicate button', async () => {
    const meatballToggler = screen.getByTestId('meatball-menu-button')
    await userEvent.click(meatballToggler)
    const button = await screen.findByTestId('duplicate-button')
    await userEvent.click(button)
    expect(handleDuplicate).toHaveBeenCalled()
  })
... (9 lines truncated)
</file>

<file path="editor/src/components/MeatballMenu/MeatbalMenu.stories.js">
import { MeatballMenu } from './MeatballMenu'
import { fn } from 'storybook/test'
export default {
  title: 'MeatballMenu',
  component: MeatballMenu,
}
const handleDelete = fn(() => {})
const handleDuplicate = fn(() => {})
export const Basic = () => {
  return (
    <MeatballMenu
      duplicateText={'duplicateText'}
      deleteText={'deleteText'}
      handleDelete={handleDelete}
      handleDuplicate={handleDuplicate}
    />
  )
}
</file>

<file path="editor/src/components/Modals/ComponentModal.js">
import * as React from 'react'
import { Modal } from 'react-bootstrap'
import { CloseIcon } from 'components/icons'
import { Button } from 'components/UIComponents'
export const ComponentModal = ({
  show = false,
  onHide = () => {},
  Component,
  componentClassname = '',
  modalClassname = '',
  headerClassname = '',
  title = '',
  confirmButtonText = t('Confirm'),
  cancelButtonText = t('Cancel'),
  onConfirm = () => {},
  useFooter = false,
  isLoading = false,
  ...props
}) => {
  const titleId = React.useId()
  return (
    <Modal
      className={`component-modal ${modalClassname}`}
      size="lg"
      show={show}
      centered
      onHide={onHide}
      aria-labelledby={title ? titleId : undefined}
      {...props}
    >
... (46 lines truncated)
</file>

<file path="editor/src/components/Modals/ConfirmModal.js">
import * as React from 'react'
import { Modal } from 'react-bootstrap'
import { Button } from 'components/UIComponents'
export const ConfirmModal = ({
  show = false,
  onHide = () => {},
  onConfirm,
  title = t('Confirm action'),
  description = t('Are you sure you want to perform this action?'),
  confirmButtonText = t('Confirm'),
  ...props
}) => {
  return (
    <Modal
      {...props}
      show={show}
      centered
      onHide={onHide}
      className="confirm-modal"
    >
      <Modal.Header
        className="border-none d-flex align-items-center gap-2 text-center"
        closeButton
      ></Modal.Header>
      <Modal.Body>
        <h1 className="reg24">{title}</h1>
        <h3 className="reg14 description">{description}</h3>
      </Modal.Body>
      <Modal.Footer className="border-none  p-0 d-flex justify-content-end text-center">
        <Button
... (21 lines truncated)
</file>

<file path="editor/src/components/Modals/index.js">
export * from './ConfirmModal'
export * from './ComponentModal'
</file>

<file path="editor/src/components/PublicSurveyAlias/SurveyAccessMode/surveyAccessMode.test.js">
import React from 'react'
import {
  render,
  screen,
  fireEvent,
  waitFor,
  within,
} from '@testing-library/react'
import userEvent from '@testing-library/user-event'
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import { queryClient } from 'queryClient'
import { PublicSurveyAlias } from '../PublicSurveyAlias'
import surveyData from 'helpers/data/survey-detail.json'
import { ACCESS_MODES, ARCHIVE_BASE_TABLE_TOKENS, Toast } from 'helpers'
import {
  getSurveyAccessModeOptions,
  SURVEY_ARCHIVED_TOKENS_QUERY_KEY,
} from './surveyAccessModeHandler'
global.t = (key) => key
jest.mock('helpers', () => {
  const original = jest.requireActual('helpers')
  return {
    ...original,
    Toast: jest.fn(),
  }
})
describe('PublicSurveyAlias - Access Mode Change', () => {
  const mockSurvey = surveyData.survey
  const mockUpdate = jest.fn()
  const mockOnSurveyAccessModeChange = jest.fn()
... (302 lines truncated)
</file>

<file path="editor/src/components/PublicSurveyAlias/SurveyAccessMode/surveyAccessModeHandler.js">
import React from 'react'
import { queryClient } from 'queryClient'
import {
  Toast,
  getSiteUrl,
  ACCESS_MODES,
  SURVEY_ARCHIVES_QUERY_KEY_PREFIX,
  ARCHIVE_BASE_TABLE_TOKENS,
} from 'helpers'
import { format } from 'util'
import { ExclamationIcon, GlobalIcon, LockIcon } from 'components/icons'
export const SURVEY_ARCHIVED_TOKENS_QUERY_KEY = `${SURVEY_ARCHIVES_QUERY_KEY_PREFIX}${ARCHIVE_BASE_TABLE_TOKENS}`
export const getSurveyAccessModeOptions = () => ({
  open: {
    label: t('Anyone with link'),
    key: 'open',
    value: ACCESS_MODES.OPEN_TO_ALL,
    description: t('Anyone with the link to this survey can access.'),
    icon: <GlobalIcon className="me-2" />,
  },
  closed: {
    label: t('Link with access code'),
    key: 'closed',
    value: ACCESS_MODES.CLOSED,
    description: t(
      'Only participants with a personalized link or a general link with access code can access.'
    ),
    icon: <LockIcon className="me-2" />,
  },
})
... (124 lines truncated)
</file>

<file path="editor/src/components/PublicSurveyAlias/SurveyAccessMode/SurveyAccessModeSelector.js">
import React, { useMemo, useEffect, useState } from 'react'
import { Dropdown } from 'react-bootstrap'
import classNames from 'classnames'
import { ACCESS_MODES } from 'helpers'
import { useSurveyArchive, useSurveyUpdatePermission } from 'hooks'
import { ArrowDownIcon, CheckIcon } from 'components/icons'
import {
  handleSurveyAccessModeChange,
  getSurveyAccessModeOptions,
} from './surveyAccessModeHandler'
export const SurveyAccessModeSelector = ({
  parentName = null,
  survey,
  currentSurveyAccessMode,
  onSurveyAccessModeChange,
  createBufferOperation,
  addToBuffer,
  update,
}) => {
  const { fetchFilteredSurveyArchivesByBase } = useSurveyArchive(survey.sid)
  const surveyAccessModeChangeOptions = useMemo(
    () => getSurveyAccessModeOptions(),
    []
  )
  const [selectedAccessMode, setSelectedAccessMode] = useState(
    survey?.access_mode === ACCESS_MODES.CLOSED
      ? surveyAccessModeChangeOptions.closed.key
      : surveyAccessModeChangeOptions.open.key
  )
  const hasUpdatePermission = useSurveyUpdatePermission(survey)
... (120 lines truncated)
</file>

<file path="editor/src/components/PublicSurveyAlias/CopyButton.js">
import React, { useState } from 'react'
import { CopyIcon } from 'components/icons'
const CopyButton = ({ onClick }) => {
  const [copied, setCopied] = useState(false)
  const handleClick = () => {
    if (onClick) {
      onClick()
    }
    setCopied(true)
    setTimeout(() => {
      setCopied(false)
    }, 600)
  }
  return (
    <button
      onClick={handleClick}
      className={`btn btn-primary btn-sm copy-btn d-flex justify-content-center align-items-center gap-2`}
    >
      {copied ? null : <CopyIcon className="text-white fill-current" />}
      <p>{copied ? t('Copied!') : t('Copy')}</p>
    </button>
  )
}
export default CopyButton
</file>

<file path="editor/src/components/PublicSurveyAlias/PublicSurveyAlias.js">
import React, { useEffect, useMemo, useRef, useState } from 'react'
import copy from 'copy-text-to-clipboard'
import classNames from 'classnames'
import { useSurveyUpdatePermission } from 'hooks'
import { formatUrlPreview, getSurveyAccessLink } from 'helpers'
import { Button, CustomizeButton, Input } from 'components/UIComponents'
import CopyButton from './CopyButton'
import { SurveyAccessModeSelector } from './SurveyAccessMode/SurveyAccessModeSelector'
export const PublicSurveyAlias = ({
  parentName = null,
  survey = {},
  update,
  language = '',
  onAliasChange = () => {},
  setLink,
  editable = true,
  aliasHasError = false,
  currentSurveyAccessMode,
  onSurveyAccessModeChange = () => {},
  createBufferOperation,
  addToBuffer,
}) => {
  const [isEditingAlias, setIsEditingAlias] = useState(false)
  const inputRef = useRef(null)
  const aliasRef = useRef(null)
  const linkPrefix =
    window.location.protocol + '
  const alias = useMemo(
    () => survey.languageSettings[language]?.alias?.trim() || '',
    [language, survey]
... (124 lines truncated)
</file>

<file path="editor/src/components/PublishSettings/PublishSettings.js">
import { useMemo } from 'react'
import { useParams } from 'react-router-dom'
import classNames from 'classnames'
import { useAppState, useSurveyArchive } from 'hooks'
import { STATES } from 'helpers'
import { getTooltipMessages } from 'helpers/options'
import { Button, TooltipContainer } from 'components'
import { CheckIcon, StopIcon } from 'components/icons'
export const PublishSettings = ({
  operationsLength = 0,
  triggerPublish,
  className = '',
}) => {
  const { surveyId } = useParams()
  const { surveyArchives } = useSurveyArchive(surveyId)
  const [surveyPublishRunning] = useAppState(
    STATES.SURVEY_PUBLISH_RUNNING,
    false
  )
  const [numberOfQuestions] = useAppState(STATES.NUMBER_OF_QUESTIONS)
  const [isSurveyActive] = useAppState(STATES.IS_SURVEY_ACTIVE, false)
  const [hasSurveyUpdatePermission] = useAppState(
    STATES.HAS_SURVEY_UPDATE_PERMISSION
  )
  const surveyHasArchivedResponses = useMemo(
    () => surveyArchives.length > 0,
    [surveyArchives]
  )
  const getActivateTip = () => {
    if (isSurveyActive) {
... (71 lines truncated)
</file>

<file path="editor/src/components/PublishSettings/SurveyActivationHandler.js">
import {
  forwardRef,
  useEffect,
  useImperativeHandle,
  useMemo,
  useRef,
  useState,
} from 'react'
import { useNavigate, useParams } from 'react-router-dom'
import {
  createBufferOperation,
  Entities,
  errorToast,
  GetInvalidSurveyObjects,
  htmlPopup,
  Operations,
  STATES,
  Toast,
  isSurveyExpired,
  SURVEY_MENU_TITLES,
} from 'helpers'
import {
  useAppState,
  useBuffer,
  useFocused,
  useSurvey,
  useOperationCallback,
  useSurveyArchive,
} from 'hooks'
import { ComponentModal } from 'components/Modals'
... (240 lines truncated)
</file>

<file path="editor/src/components/QuestionSettings/array/getArrayByColumnSettings.js">
import { getQuestionAttributesTitles } from 'helpers'
import {
  getTimerAttributes,
  getStatisticsAttributes,
  getOtherAttributes,
  getLogicAttributes,
  getDisplayAttributes,
  getGeneralAttributes,
} from '../attributes'
const simpleSettings = () => {
  const generalAttributes = getGeneralAttributes()
  return [
    generalAttributes.QUESTION_CODE,
    generalAttributes.QUESTION_TYPE,
    generalAttributes.MANDATORY,
    generalAttributes.LOGIC,
    getStatisticsAttributes().SHOW_IN_STATISTICS,
    getDisplayAttributes().IMAGE_SETTINGS,
  ]
}
const generalSettings = () => {
  const generalAttributes = getGeneralAttributes()
  return [
    generalAttributes.QUESTION_CODE,
    generalAttributes.QUESTION_TYPE,
    generalAttributes.MANDATORY,
    generalAttributes.ENCRYPTED,
    generalAttributes.SAVE_AS_DEFAULT,
  ]
}
... (92 lines truncated)
</file>

<file path="editor/src/components/QuestionSettings/array/getArrayDualScaleSettings.js">
import { getQuestionAttributesTitles } from 'helpers'
import {
  getTimerAttributes,
  getStatisticsAttributes,
  getOtherAttributes,
  getLogicAttributes,
  getDisplayAttributes,
  getGeneralAttributes,
} from '../attributes'
const simpleSettings = () => {
  const generalAttributes = getGeneralAttributes()
  return [
    generalAttributes.QUESTION_CODE,
    generalAttributes.QUESTION_TYPE,
    generalAttributes.MANDATORY,
    generalAttributes.LOGIC,
    getStatisticsAttributes().SHOW_IN_STATISTICS,
    getDisplayAttributes().IMAGE_SETTINGS,
  ]
}
const generalSettings = () => {
  const generalAttributes = getGeneralAttributes()
  return [
    generalAttributes.QUESTION_CODE,
    generalAttributes.QUESTION_TYPE,
    generalAttributes.MANDATORY,
    generalAttributes.ENCRYPTED,
    generalAttributes.SAVE_AS_DEFAULT,
  ]
}
... (99 lines truncated)
</file>

<file path="editor/src/components/QuestionSettings/array/getArrayNumbersSettings.js">
import { getQuestionAttributesTitles } from 'helpers'
import {
  getTimerAttributes,
  getStatisticsAttributes,
  getOtherAttributes,
  getLogicAttributes,
  getDisplayAttributes,
  getGeneralAttributes,
} from '../attributes'
const simpleSettings = () => {
  const generalAttributes = getGeneralAttributes()
  return [
    generalAttributes.QUESTION_CODE,
    generalAttributes.QUESTION_TYPE,
    generalAttributes.MANDATORY,
    generalAttributes.LOGIC,
    getStatisticsAttributes().SHOW_IN_STATISTICS,
    getDisplayAttributes().IMAGE_SETTINGS,
  ]
}
const generalSettings = () => {
  const generalAttributes = getGeneralAttributes()
  return [
    generalAttributes.QUESTION_CODE,
    generalAttributes.QUESTION_TYPE,
    generalAttributes.MANDATORY,
    generalAttributes.ENCRYPTED,
    generalAttributes.SAVE_AS_DEFAULT,
    generalAttributes.INPUT_VALIDATION,
    generalAttributes.MAX_CHARACTERS,
... (111 lines truncated)
</file>

<file path="editor/src/components/QuestionSettings/array/getArrayPointChoiceSettings.js">
import { getQuestionAttributesTitles } from 'helpers'
import {
  getTimerAttributes,
  getStatisticsAttributes,
  getOtherAttributes,
  getLogicAttributes,
  getDisplayAttributes,
  getGeneralAttributes,
} from '../attributes'
const simpleSettings = () => {
  const generalAttributes = getGeneralAttributes()
  return [
    generalAttributes.QUESTION_CODE,
    generalAttributes.QUESTION_TYPE,
    generalAttributes.MANDATORY,
    generalAttributes.LOGIC,
    getStatisticsAttributes().SHOW_IN_STATISTICS,
    getDisplayAttributes().IMAGE_SETTINGS,
  ]
}
const generalSettings = () => {
  const generalAttributes = getGeneralAttributes()
  return [
    generalAttributes.QUESTION_CODE,
    generalAttributes.QUESTION_TYPE,
    generalAttributes.MANDATORY,
    generalAttributes.ENCRYPTED,
    generalAttributes.SAVE_AS_DEFAULT,
  ]
}
... (101 lines truncated)
</file>

<file path="editor/src/components/QuestionSettings/array/getArrayTextsSettings.js">
import { getQuestionAttributesTitles } from 'helpers'
import {
  getTimerAttributes,
  getStatisticsAttributes,
  getOtherAttributes,
  getLogicAttributes,
  getDisplayAttributes,
  getGeneralAttributes,
} from '../attributes'
const simpleSettings = () => {
  const generalAttributes = getGeneralAttributes()
  return [
    generalAttributes.QUESTION_CODE,
    generalAttributes.QUESTION_TYPE,
    generalAttributes.MANDATORY,
    {
      ...generalAttributes.MAX_CHARACTERS,
      props: {
        ...generalAttributes.MAX_CHARACTERS.props,
        placeholder: 250,
      },
    },
    generalAttributes.LOGIC,
    getStatisticsAttributes().SHOW_IN_STATISTICS,
    getDisplayAttributes().IMAGE_SETTINGS,
  ]
}
const generalSettings = () => {
  const generalAttributes = getGeneralAttributes()
  return [
... (110 lines truncated)
</file>

<file path="editor/src/components/QuestionSettings/array/index.js">
export { getArrayPointChoiceSettings } from './getArrayPointChoiceSettings'
export { getArrayTextsSettings } from './getArrayTextsSettings'
export { getArrayNumbersSettings } from './getArrayNumbersSettings'
export { getArrayByColumnSettings } from './getArrayByColumnSettings'
export { getArrayDualScaleSettings } from './getArrayDualScaleSettings'
</file>

<file path="editor/src/components/QuestionSettings/attributes/getDisplayAttributes.js">
import {
  getVisualizationOptions,
  getSliderLayoutOptions,
  getOrderOptions,
  getDisplayButtonTypeOptions,
  getColumnWidthOptions,
  getLabelWrapperWidthOptions,
  getYesNoOptions,
  YESNO_LONGSTRING,
  getOnOffOptions,
} from 'helpers/options'
import { L10ns } from 'helpers'
import { Input, Select, ToggleButtons } from 'components/UIComponents'
import { getQuestionTypeInfo } from 'components/QuestionTypes'
import { ImageAttributes } from '../attributes'
const imageChoiceThemes = [
  getQuestionTypeInfo().SINGLE_CHOICE_IMAGE_SELECT.theme,
  getQuestionTypeInfo().MULTIPLE_CHOICE_IMAGE_SELECT.theme,
]
export const getDisplayAttributes = () => ({
  IMAGE_SETTINGS: {
    component: ImageAttributes,
    attributePath: 'attributes.image',
    props: {},
  },
  PAGE_BREAK_IN_PRINTABLE_VIEW: {
    component: ToggleButtons,
    attributePath: 'attributes.page_break',
    props: {
      id: 'insert-page-break-in-printable-view',
... (651 lines truncated)
</file>

<file path="editor/src/components/QuestionSettings/attributes/getFileMetaDataAttributes.js">
import { ToggleButtons } from 'components/UIComponents'
import { getOnOffOptions } from 'helpers/options'
export const getFileMetaDataAttributes = () => ({
  SHOW_TITLE: {
    component: ToggleButtons,
    attributePath: 'attributes.show_title',
    props: {
      labelText: t('Show title'),
      id: 'show-title',
      toggleOptions: getOnOffOptions(),
      defaultValue: '0',
    },
  },
  SHOW_COMMENT: {
    component: ToggleButtons,
    attributePath: 'attributes.show_comment',
    props: {
      labelText: t('Show comment'),
      id: 'show-comment',
      toggleOptions: getOnOffOptions(),
      defaultValue: '0',
    },
  },
})
</file>

<file path="editor/src/components/QuestionSettings/attributes/getGeneralAttributes.js">
import { Input, ToggleButtons } from 'components/UIComponents'
import { DefaultValuesActions } from '../DefaultValuesActions'
import { QuestionTypeAttribute } from './QuestionTypeAttribute'
import { QuestionCodeAttribute } from './QuestionCodeAttribute'
import { RatingItems } from 'components/UIComponents/RatingItems'
import {
  getOnOffOptions,
  getYesNoOptions,
  ONOFF_BOOLEAN,
  YESNO_BOOLEAN,
} from 'helpers/options'
export const getGeneralAttributes = () => ({
  QUESTION_CODE: {
    component: QuestionCodeAttribute,
    attributePath: 'title',
    props: {},
    returnValues: ['title'],
  },
  QUESTION_TYPE: {
    component: QuestionTypeAttribute,
    attributePath: 'questionThemeName',
    props: {},
    returnValues: ['type', 'questionThemeName'],
  },
  MANDATORY: {
    component: ToggleButtons,
    attributePath: 'mandatory',
    props: {
      labelText: t('Mandatory'),
      id: 'mandatory',
... (84 lines truncated)
</file>

<file path="editor/src/components/QuestionSettings/attributes/getImageAttributes.js">
import { useCallback, useState } from 'react'
import { Button, Form } from 'react-bootstrap'
import { Direction } from 'react-range'
import {
  AlignButtons,
  DropZone,
  ImageEditor,
  InputRange,
} from 'components/UIComponents'
import { TrashIcon, BrushIcon } from 'components/icons'
export const GetImageAttributes = ({ update, value = {} }) => {
  const charLimit = 125
  const [show, setShow] = useState(false)
  const [selectedFile, setSelectedFile] = useState(null)
  const [remainingChars, setRemainingChars] = useState(charLimit)
  const handleClose = () => setShow(false)
  const onReaderResult = useCallback(
    (readerResult) => {
      update({
        image: readerResult,
      })
    },
    [update]
  )
  const handleAlignChange = (value) => {
    update({ imageAlign: value })
  }
  const handleBrightnessChange = (value) => {
    update({ imageBrightness: value[0] })
  }
... (104 lines truncated)
</file>

<file path="editor/src/components/QuestionSettings/attributes/getInputAttributes.js">
import { Input, Select, ToggleButtons } from 'components/UIComponents'
import { getYesNoOptions } from 'helpers/options'
export const getInputAttributes = () => ({
  DATE_FORMAT: {
    component: Select,
    attributePath: 'attributes.date_format',
    props: {
      labelText: t('Date/time format'),
      dataTestId: 'date-time-format',
      options: [
        {
          label: 'yyyy-mm-dd',
          value: 'yyyy-mm-dd',
        },
        {
          label: 'yyyy/mm/dd',
          value: 'yyyy/mm/dd',
        },
        {
          label: 'mm-dd-yyyy',
          value: 'mm-dd-yyyy',
        },
        {
          label: 'mm/dd/yyyy',
          value: 'mm/dd/yyyy',
        },
        {
          label: 'dd-mm-yyyy',
          value: 'dd-mm-yyyy',
        },
... (101 lines truncated)
</file>

<file path="editor/src/components/QuestionSettings/attributes/getLocationAttributes.js">
import { AlignButtons, Input, ToggleButtons } from 'components/UIComponents'
import { getYesNoOptions } from 'helpers/options'
export const getLocationAttributes = () => ({
  USE_MAPPING_SERVICE: {
    component: ToggleButtons,
    attributePath: 'attributes.location_mapservice',
    props: {
      id: 'use-mapping-service',
      labelText: t('Use mapping service'),
      optionTextClassName: 'text-sm',
      toggleOptions: [
        { name: t('Google Maps'), value: '1' },
        { name: t('OpenStreetMap via MapQuest'), value: '100' },
        { name: t('Off'), value: '0' },
      ],
      defaultValue: '100',
    },
  },
  MAP_POSITION: {
    component: AlignButtons,
    attributePath: 'attributes.location_mapposition',
    props: {
      id: 'map-position',
      labelText: t('Map position'),
      dataTestId: 'map-position',
      value: 'center',
    },
  },
  IP_AS_DEFAULT_LOCATION: {
    component: ToggleButtons,
... (67 lines truncated)
</file>

<file path="editor/src/components/QuestionSettings/attributes/getLogicAttributes.js">
import {
  ExpressionScriptEditor,
  Input,
  Select,
  ToggleButtons,
} from 'components/UIComponents'
import { getCommentedCheckboxOptions, getOnOffOptions } from 'helpers/options'
const commentedCheckboxOptions = getCommentedCheckboxOptions()
export const getLogicAttributes = () => ({
  MINIMUM_ANSWERS: {
    component: Input,
    attributePath: 'attributes.min_answers',
    props: {
      labelText: t('Minimum answers'),
      dataTestId: 'minimum-answers',
    },
  },
  MAXIMUM_ANSWERS: {
    component: Input,
    attributePath: 'attributes.max_answers',
    props: {
      labelText: t('Maximum answers'),
      dataTestId: 'maximum-answers',
    },
  },
  COMMENT_ONLY_WHEN: {
    component: Select,
    attributePath: 'attributes.commented_checkbox',
    props: {
      labelText: t('Comment only when'),
... (150 lines truncated)
</file>

<file path="editor/src/components/QuestionSettings/attributes/getOtherAttributes.js">
import { Input, Select, ToggleButtons } from 'components/UIComponents'
import { getOnOffOptions, getYesNoOptions } from 'helpers/options'
export const getOtherAttributes = () => ({
  MIN_NUMBER_FILES: {
    component: Input,
    attributePath: 'attributes.min_num_of_files',
    props: {
      labelText: t('Minimum number of files'),
      dataTestId: 'min-number-of-files',
      type: 'number',
      defaultValue: '1',
    },
  },
  ALLOWED_FILE_TYPES: {
    component: Input,
    attributePath: 'attributes.allowed_filetypes',
    props: {
      labelText: t('Allowed file types'),
      dataTestId: 'allowed-file-types',
      defaultValue: 'png, gif, doc, odt, jpg, jpeg',
    },
  },
  MAXIMUM_FILE_SIZE_ALLOWED: {
    component: Input,
    attributePath: 'attributes.max_filesize',
    props: {
      labelText: t('Maximum file size (kB)'),
      dataTestId: 'maximum-file-size-allowed',
      type: 'number',
      min: 1,
... (105 lines truncated)
</file>

<file path="editor/src/components/QuestionSettings/attributes/getSliderAttributes.js">
import { Input, Select, ToggleButtons } from 'components/UIComponents'
import { THUMB_TYPES } from 'helpers'
import { getYesNoOptions } from 'helpers/options'
export const getSliderAttributes = () => ({
  USE_SLIDER_LAYOUT: {
    component: ToggleButtons,
    attributePath: 'attributes.slider_layout',
    props: {
      id: 'use-slider-layout',
      labelText: t('Use slider layout'),
      toggleOptions: getYesNoOptions(),
      defaultValue: '0',
    },
  },
  ORIENTATION: {
    component: ToggleButtons,
    attributePath: 'attributes.slider_orientation',
    props: {
      id: 'orientation',
      labelText: t('Orientation'),
      toggleOptions: [
        { name: t('Horizontal'), value: '0' },
        { name: t('Vertical'), value: '1' },
      ],
      defaultValue: '0',
    },
  },
  SLIDER_MINIMUM_VALUE: {
    component: Input,
    attributePath: 'attributes.slider_min',
... (136 lines truncated)
</file>

<file path="editor/src/components/QuestionSettings/attributes/getStatisticsAttributes.js">
import { ToggleButtons, Select } from 'components/UIComponents'
import { getOnOffOptions } from 'helpers/options'
import {
  getStatisticsGraphsForType,
  statisticsGraphs,
} from '../../../pages/Responses/components/ResponsesStatistics/ChartsUtils'
const getGraphOptions = () => [
  { label: t('Bar chart'), value: statisticsGraphs.BAR_CHART },
  { label: t('Pie chart'), value: statisticsGraphs.PIE_CHART },
  { label: t('Radar chart'), value: statisticsGraphs.RADAR },
  { label: t('Line chart'), value: statisticsGraphs.LINE },
  { label: t('Polar chart'), value: statisticsGraphs.POLAR_AREA },
  { label: t('Doughnut chart'), value: statisticsGraphs.DOUGHNUT_CHART },
  { label: t('Stacked bar chart'), value: statisticsGraphs.STACKED_BAR },
  { label: t('Grouped bar chart'), value: statisticsGraphs.GROUPED_BAR },
  { label: t('Grid'), value: statisticsGraphs.GRID },
  { label: t('Table'), value: statisticsGraphs.TABLE },
  { label: t('Comments'), value: statisticsGraphs.COMMENTS },
]
export const getStatisticsAttributes = () => ({
  SHOW_IN_STATISTICS: {
    component: Select,
    attributePath: 'attributes.statistics_graphtype',
    getOptions: ({ question }) => {
      const graphs = getStatisticsGraphsForType(question?.type)
      return [
        { label: t('Default'), value: '' },
        { label: t("Don't show"), value: String(statisticsGraphs.DONT_SHOW) },
        ...getGraphOptions()
          .filter(({ value }) => graphs.includes(value))
... (23 lines truncated)
</file>

<file path="editor/src/components/QuestionSettings/attributes/getThemeAttributes.js">
import { Select, ToggleButtons } from 'components/UIComponents'
import { getYesNoOptions, YESNO_STRING_BOOLEAN } from 'helpers/options'
export const getThemeAttributes = () => ({
  BUTTON_SIZE: {
    component: Select,
    attributePath: 'attributes.button_size',
    props: {
      labelText: t('Button size'),
      id: 'button-size',
      options: [
        { label: t('Default'), value: 'default' },
        { label: t('Large'), value: 'lg' },
        { label: t('Small'), value: 'sm' },
        { label: t('Extra small'), value: 'xs' },
      ],
      defaultValue: 'default',
    },
  },
  MAXIMUM_NUMBER_OF_BUTTONS_IN_A_ROW: {
    component: Select,
    attributePath: 'attributes.max_buttons_row',
    props: {
      id: 'maximum-number-of-buttons-in-a-row',
      labelText: t('Maximum number of buttons in a row'),
      options: [
        { label: t('Default'), value: 'default' },
        { label: '1', value: 'col-md-12' },
        { label: '2', value: 'col-md-6' },
        { label: '3', value: 'col-md-4' },
        { label: '4', value: 'col-md-3' },
... (41 lines truncated)
</file>

<file path="editor/src/components/QuestionSettings/attributes/getTimerAttributes.js">
import { Input, Select, ToggleButtons } from 'components/UIComponents'
import { getOnOffOptions, getYesNoOptions } from 'helpers/options'
export const getTimerAttributes = () => ({
  TIME_LIMIT_TIMER_CSS_STYLE: {
    component: Input,
    attributePath: 'attributes.time_limit_timer_style',
    props: {
      labelText: t('Time limit timer CSS style'),
      dataTestId: 'minimum-value',
    },
  },
  TIME_LIMIT_EXPIRY_MESSAGE_DISPLAY_TIME: {
    component: Input,
    attributePath: 'attributes.time_limit_message_delay',
    props: {
      labelText: t('Expiry message display time'),
      dataTestId: 'time-limit-expiry-message-display-time',
      rightInputText: 'sec',
      type: 'number',
    },
  },
  TIME_LIMIT_EXPIRY_MESSAGE: {
    component: Input,
    attributePath: 'attributes.time_limit_message',
    languageBased: true,
    props: {
      labelText: t('Expiry message'),
      as: 'textarea',
      type: 'textarea',
      role: 'textarea',
... (218 lines truncated)
</file>

<file path="editor/src/components/QuestionSettings/attributes/ImageAttributes.js">
import React, { useEffect, useRef, useState } from 'react'
import { Button, Form } from 'react-bootstrap'
import { Direction } from 'react-range'
import {
  AlignButtons,
  DropZone,
  ImageEditor,
  InputRange,
  ToggleButtons,
} from 'components/UIComponents'
import { DeleteIconFilled, EditIcon } from 'components/icons'
import { useFileService } from 'hooks'
import {
  getQuestionImageObjectFromImageAttribute,
  getAndGenerateImageStyles,
  getClearedQuestionImageObject,
} from 'helpers/questionImage'
import { getYesNoOptions, isTrue } from 'helpers'
export const ImageAttributes = ({
  update,
  value = {},
  isSimpleSettings = false,
  disabled = false,
}) => {
  const charLimit = 125
  const [show, setShow] = useState(false)
  const [imageState, setImageState] = useState(() =>
    getQuestionImageObjectFromImageAttribute(value)
  )
  const [previewUrl, setPreviewUrl] = useState(() => {
... (221 lines truncated)
</file>

<file path="editor/src/components/QuestionSettings/attributes/index.js">
export { getDisplayAttributes } from './getDisplayAttributes'
export { getFileMetaDataAttributes } from './getFileMetaDataAttributes'
export { getGeneralAttributes } from './getGeneralAttributes'
export { getInputAttributes } from './getInputAttributes'
export { getLocationAttributes } from './getLocationAttributes'
export { getLogicAttributes } from './getLogicAttributes'
export { getOtherAttributes } from './getOtherAttributes'
export { getSliderAttributes } from './getSliderAttributes'
export { getStatisticsAttributes } from './getStatisticsAttributes'
export { getTimerAttributes } from './getTimerAttributes'
export { getThemeAttributes } from './getThemeAttributes'
export { ImageAttributes } from './ImageAttributes'
</file>

<file path="editor/src/components/QuestionSettings/attributes/QuestionCodeAttribute.js">
import { useEffect, useState } from 'react'
import { useAppState, useFocused } from 'hooks'
import { TestValidation } from '../../Survey/Questions/QuestionCodeSchema'
import { STATES } from '../../../helpers'
import { Form, FormControl } from 'react-bootstrap'
import { showErrorMessage } from '../../ConditionDesigner/utils/conditionAlertHelpers'
import { ExclamationMark } from '../../icons'
export const QuestionCodeAttribute = ({ value, update, disabled = false }) => {
  const [codeToQuestion, setCodeToQuestion] = useAppState(
    STATES.CODE_TO_QUESTION,
    {}
  )
  const [errorMessage, setErrorMessage] = useState('')
  const [inputValue, setInputValue] = useState(value)
  const { focused } = useFocused()
  useEffect(() => {
    setInputValue(value)
    validateCode(value)
  }, [focused?.qid])
  const validateCode = (value) => {
    const matchingKey = codeToQuestion
      ? Object.keys(codeToQuestion).find(
          (key) => key.toUpperCase() === value?.toUpperCase()
        )
      : null
    const { question } = matchingKey
      ? codeToQuestion[matchingKey]
      : { question: null }
    const questionIsNotFocused = question?.title !== focused?.title
    const codeExist = question && questionIsNotFocused
... (65 lines truncated)
</file>

<file path="editor/src/components/QuestionSettings/attributes/QuestionTypeAttribute.js">
import { Button, Form, OverlayTrigger, Popover } from 'react-bootstrap'
import { useState } from 'react'
import { useAppState } from 'hooks'
import { STATES } from 'helpers'
import { QuestionTypeSelector } from 'components/QuestionTypeSelector'
import { ArrowDownIcon } from 'components/icons'
import { getQuestionTypeInfo } from '../../QuestionTypes'
export const QuestionTypeAttribute = ({
  value,
  update,
  activeDisabled = false,
}) => {
  const [isAddingQuestionOrGroup, setIsAddingQuestionOrGroup] = useState(false)
  const [isSurveyActive] = useAppState(STATES.IS_SURVEY_ACTIVE)
  const [hasSurveyUpdatePermission] = useAppState(
    STATES.HAS_SURVEY_UPDATE_PERMISSION
  )
  const disabled =
    (isSurveyActive && activeDisabled) || !hasSurveyUpdatePermission
  const questionTypeSelectorPopover = (
    <Popover
      id="question-type-selector-popover"
      bsPrefix="question-type-attribute-selector-container"
    >
      <QuestionTypeSelector
        callBack={(typeInfo) =>
          update({
            type: typeInfo.type,
            questionThemeName: typeInfo.questionThemeName,
          })
... (37 lines truncated)
</file>

<file path="editor/src/components/QuestionSettings/datesAndData/getBrowserDetectionSettings.js">
import { getQuestionAttributesTitles } from 'helpers'
import {
  getStatisticsAttributes,
  getLogicAttributes,
  getDisplayAttributes,
  getGeneralAttributes,
  getTimerAttributes,
  getLocationAttributes,
} from '../attributes'
const simpleSettings = () => {
  const generalAttributes = getGeneralAttributes()
  const displayAttributes = getDisplayAttributes()
  return [
    generalAttributes.QUESTION_CODE,
    generalAttributes.QUESTION_TYPE,
    generalAttributes.MANDATORY,
    displayAttributes.IMAGE_SETTINGS,
    generalAttributes.LOGIC,
    displayAttributes.SHOW_PLATFORM_INFORMATION,
    getStatisticsAttributes().SHOW_IN_STATISTICS,
    getLocationAttributes().USE_MAPPING_SERVICE,
  ]
}
const generalSettings = () => {
  const generalAttributes = getGeneralAttributes()
  return [
    generalAttributes.QUESTION_CODE,
    generalAttributes.QUESTION_TYPE,
    generalAttributes.MANDATORY,
    generalAttributes.ENCRYPTED,
... (86 lines truncated)
</file>

<file path="editor/src/components/QuestionSettings/datesAndData/getDateTimeSettings.js">
import { getQuestionAttributesTitles } from 'helpers'
import {
  getStatisticsAttributes,
  getOtherAttributes,
  getLogicAttributes,
  getDisplayAttributes,
  getGeneralAttributes,
  getTimerAttributes,
  getInputAttributes,
} from '../attributes'
const simpleSettings = () => {
  const generalAttributes = getGeneralAttributes()
  const displayAttributes = getDisplayAttributes()
  const inputAttributes = getInputAttributes()
  return [
    generalAttributes.QUESTION_CODE,
    generalAttributes.QUESTION_TYPE,
    generalAttributes.MANDATORY,
    displayAttributes.DISPLAY_DROPDOWN_BOXES,
    displayAttributes.MONTH_DISPLAY_STYLE,
    displayAttributes.MINIMUM_DATE,
    displayAttributes.MAXIMUM_DATE,
    inputAttributes.DATE_FORMAT,
    inputAttributes.MINUTE_STEP_INTERVAL,
    generalAttributes.LOGIC,
    getStatisticsAttributes().SHOW_IN_STATISTICS,
    displayAttributes.IMAGE_SETTINGS,
  ]
}
const generalSettings = () => {
... (90 lines truncated)
</file>

<file path="editor/src/components/QuestionSettings/datesAndData/getFileUploadSettings.js">
import { getQuestionAttributesTitles } from 'helpers'
import {
  getStatisticsAttributes,
  getOtherAttributes,
  getLogicAttributes,
  getDisplayAttributes,
  getGeneralAttributes,
  getTimerAttributes,
} from '../attributes'
const simpleSettings = () => {
  const generalAttributes = getGeneralAttributes()
  const otherAttributes = getOtherAttributes()
  return [
    generalAttributes.QUESTION_CODE,
    generalAttributes.QUESTION_TYPE,
    generalAttributes.MANDATORY,
    otherAttributes.MIN_NUMBER_FILES,
    otherAttributes.MAX_NUMBER_FILES,
    otherAttributes.ALLOWED_FILE_TYPES,
    otherAttributes.MAXIMUM_FILE_SIZE_ALLOWED,
    getDisplayAttributes().IMAGE_SETTINGS,
    generalAttributes.LOGIC,
    getStatisticsAttributes().SHOW_IN_STATISTICS,
  ]
}
const generalSettings = () => {
  const generalAttributes = getGeneralAttributes()
  return [
    generalAttributes.QUESTION_CODE,
    generalAttributes.QUESTION_TYPE,
... (80 lines truncated)
</file>

<file path="editor/src/components/QuestionSettings/datesAndData/index.js">
export { getBrowserDetectionSettings } from './getBrowserDetectionSettings'
export { getDateTimeSettings } from './getDateTimeSettings'
export { getFileUploadSettings } from './getFileUploadSettings'
</file>

<file path="editor/src/components/QuestionSettings/multipleChoice/getMultipleChoiceButtonsSettings.js">
import { getQuestionAttributesTitles } from 'helpers'
import {
  getTimerAttributes,
  getStatisticsAttributes,
  getOtherAttributes,
  getLogicAttributes,
  getDisplayAttributes,
  getGeneralAttributes,
  getThemeAttributes,
} from '../attributes'
const simpleSettings = () => {
  const generalAttributes = getGeneralAttributes()
  return [
    generalAttributes.QUESTION_CODE,
    generalAttributes.QUESTION_TYPE,
    generalAttributes.MANDATORY,
    getDisplayAttributes().IMAGE_SETTINGS,
    generalAttributes.LOGIC,
    getStatisticsAttributes().SHOW_IN_STATISTICS,
  ]
}
const generalSettings = () => {
  const generalAttributes = getGeneralAttributes()
  return [
    generalAttributes.QUESTION_CODE,
    generalAttributes.QUESTION_TYPE,
    generalAttributes.MANDATORY,
    generalAttributes.ENCRYPTED,
    generalAttributes.SAVE_AS_DEFAULT,
    generalAttributes.OTHER,
... (111 lines truncated)
</file>

<file path="editor/src/components/QuestionSettings/multipleChoice/getMultipleChoiceImageSettings.js">
import { getQuestionAttributesTitles } from 'helpers'
import {
  getTimerAttributes,
  getStatisticsAttributes,
  getOtherAttributes,
  getLogicAttributes,
  getDisplayAttributes,
  getGeneralAttributes,
} from '../attributes'
const simpleSettings = () => {
  const generalAttributes = getGeneralAttributes()
  return [
    generalAttributes.QUESTION_CODE,
    generalAttributes.QUESTION_TYPE,
    generalAttributes.MANDATORY,
    generalAttributes.LOGIC,
    getStatisticsAttributes().SHOW_IN_STATISTICS,
    getDisplayAttributes().IMAGE_SETTINGS,
  ]
}
const generalSettings = () => {
  const generalAttributes = getGeneralAttributes()
  return [
    generalAttributes.QUESTION_CODE,
    generalAttributes.QUESTION_TYPE,
    generalAttributes.MANDATORY,
    generalAttributes.ENCRYPTED,
    generalAttributes.SAVE_AS_DEFAULT,
    generalAttributes.OTHER,
    generalAttributes.INPUT_VALIDATION,
... (101 lines truncated)
</file>

<file path="editor/src/components/QuestionSettings/multipleChoice/getMultipleChoiceSettings.js">
import { getQuestionAttributesTitles } from 'helpers'
import {
  getTimerAttributes,
  getStatisticsAttributes,
  getOtherAttributes,
  getLogicAttributes,
  getDisplayAttributes,
  getGeneralAttributes,
} from '../attributes'
const simpleSettings = () => {
  const generalAttributes = getGeneralAttributes()
  return [
    generalAttributes.QUESTION_CODE,
    generalAttributes.QUESTION_TYPE,
    generalAttributes.MANDATORY,
    generalAttributes.LOGIC,
    getStatisticsAttributes().SHOW_IN_STATISTICS,
    getDisplayAttributes().IMAGE_SETTINGS,
  ]
}
const generalSettings = () => {
  const generalAttributes = getGeneralAttributes()
  return [
    generalAttributes.QUESTION_CODE,
    generalAttributes.QUESTION_TYPE,
    generalAttributes.MANDATORY,
    generalAttributes.ENCRYPTED,
    generalAttributes.SAVE_AS_DEFAULT,
    generalAttributes.OTHER,
  ]
... (108 lines truncated)
</file>

<file path="editor/src/components/QuestionSettings/multipleChoice/getMultipleChoiceWithCommentsSettings.js">
import { getQuestionAttributesTitles } from 'helpers'
import {
  getTimerAttributes,
  getStatisticsAttributes,
  getOtherAttributes,
  getLogicAttributes,
  getDisplayAttributes,
  getGeneralAttributes,
} from '../attributes'
const simpleSettings = () => {
  const generalAttributes = getGeneralAttributes()
  return [
    generalAttributes.QUESTION_CODE,
    generalAttributes.QUESTION_TYPE,
    generalAttributes.MANDATORY,
    getLogicAttributes().COMMENT_ONLY_WHEN,
    generalAttributes.LOGIC,
    getStatisticsAttributes().SHOW_IN_STATISTICS,
    getDisplayAttributes().IMAGE_SETTINGS,
  ]
}
const generalSettings = () => {
  const generalAttributes = getGeneralAttributes()
  return [
    generalAttributes.QUESTION_CODE,
    generalAttributes.QUESTION_TYPE,
    generalAttributes.MANDATORY,
    generalAttributes.ENCRYPTED,
    generalAttributes.SAVE_AS_DEFAULT,
    generalAttributes.OTHER,
... (99 lines truncated)
</file>

<file path="editor/src/components/QuestionSettings/multipleChoice/index.js">
export { getMultipleChoiceSettings } from './getMultipleChoiceSettings'
export { getMultipleChoiceWithCommentsSettings } from './getMultipleChoiceWithCommentsSettings'
export { getMultipleChoiceButtonsSettings } from './getMultipleChoiceButtonsSettings'
export { getMultipleChoiceImageSettings } from './getMultipleChoiceImageSettings'
</file>

<file path="editor/src/components/QuestionSettings/number/getEquationSettings.js">
import { getQuestionAttributesTitles } from 'helpers'
import {
  getStatisticsAttributes,
  getOtherAttributes,
  getLogicAttributes,
  getDisplayAttributes,
  getGeneralAttributes,
} from '../attributes'
const simpleSettings = () => {
  const generalAttributes = getGeneralAttributes()
  return [
    generalAttributes.QUESTION_CODE,
    generalAttributes.QUESTION_TYPE,
    generalAttributes.MANDATORY,
    getStatisticsAttributes().SHOW_IN_STATISTICS,
    getLogicAttributes().EQUATION,
    getDisplayAttributes().IMAGE_SETTINGS,
  ]
}
const generalSettings = () => {
  const generalAttributes = getGeneralAttributes()
  return [
    generalAttributes.QUESTION_CODE,
    generalAttributes.QUESTION_TYPE,
    generalAttributes.MANDATORY,
    generalAttributes.ENCRYPTED,
    generalAttributes.SAVE_AS_DEFAULT,
  ]
}
const displaySettings = () => {
... (85 lines truncated)
</file>

<file path="editor/src/components/QuestionSettings/number/getMultipleNumericalInputsSettings.js">
import { getQuestionAttributesTitles } from 'helpers'
import {
  getStatisticsAttributes,
  getOtherAttributes,
  getLogicAttributes,
  getDisplayAttributes,
  getGeneralAttributes,
  getSliderAttributes,
  getInputAttributes,
} from '../attributes'
const simpleSettings = () => {
  const generalAttributes = getGeneralAttributes()
  return [
    generalAttributes.QUESTION_CODE,
    generalAttributes.QUESTION_TYPE,
    generalAttributes.MANDATORY,
    generalAttributes.LOGIC,
    generalAttributes.ENCRYPTED,
    getDisplayAttributes().IMAGE_SETTINGS,
  ]
}
const generalSettings = () => {
  const generalAttributes = getGeneralAttributes()
  return [
    generalAttributes.QUESTION_CODE,
    generalAttributes.QUESTION_TYPE,
    getSliderAttributes().USE_SLIDER_LAYOUT,
    generalAttributes.MANDATORY,
    generalAttributes.ENCRYPTED,
  ]
... (119 lines truncated)
</file>

<file path="editor/src/components/QuestionSettings/number/getTextDisplaySettings.js">
import { getQuestionAttributesTitles } from 'helpers'
import {
  getStatisticsAttributes,
  getOtherAttributes,
  getLogicAttributes,
  getDisplayAttributes,
  getGeneralAttributes,
  getTimerAttributes,
} from '../attributes'
const simpleSettings = () => {
  const generalAttributes = getGeneralAttributes()
  return [
    generalAttributes.QUESTION_CODE,
    generalAttributes.QUESTION_TYPE,
    generalAttributes.MANDATORY,
    generalAttributes.LOGIC,
    getStatisticsAttributes().SHOW_IN_STATISTICS,
    getDisplayAttributes().IMAGE_SETTINGS,
  ]
}
const generalSettings = () => {
  const generalAttributes = getGeneralAttributes()
  return [
    generalAttributes.QUESTION_CODE,
    generalAttributes.QUESTION_TYPE,
    generalAttributes.MANDATORY,
    generalAttributes.ENCRYPTED,
    generalAttributes.SAVE_AS_DEFAULT,
  ]
}
... (77 lines truncated)
</file>

<file path="editor/src/components/QuestionSettings/number/index.js">
export { getEquationSettings } from './getEquationSettings'
export { getMultipleNumericalInputsSettings } from './getMultipleNumericalInputsSettings'
export { getTextDisplaySettings } from './getTextDisplaySettings'
</file>

<file path="editor/src/components/QuestionSettings/rankingAndRating/getGenderSettings.js">
import { getQuestionAttributesTitles } from 'helpers'
import {
  getStatisticsAttributes,
  getOtherAttributes,
  getLogicAttributes,
  getDisplayAttributes,
  getGeneralAttributes,
  getTimerAttributes,
} from '../attributes'
const simpleSettings = () => {
  const generalAttributes = getGeneralAttributes()
  const displayAttributes = getDisplayAttributes()
  return [
    generalAttributes.QUESTION_CODE,
    generalAttributes.QUESTION_TYPE,
    generalAttributes.MANDATORY,
    generalAttributes.LOGIC,
    displayAttributes.DISPLAY_TYPE,
    getStatisticsAttributes().SHOW_IN_STATISTICS,
    displayAttributes.IMAGE_SETTINGS,
  ]
}
const generalSettings = () => {
  const generalAttributes = getGeneralAttributes()
  return [
    generalAttributes.QUESTION_CODE,
    generalAttributes.QUESTION_TYPE,
    generalAttributes.MANDATORY,
    generalAttributes.ENCRYPTED,
    generalAttributes.SAVE_AS_DEFAULT,
... (81 lines truncated)
</file>

<file path="editor/src/components/QuestionSettings/rankingAndRating/getRankingAdvancedSettings.js">
import { getQuestionAttributesTitles } from 'helpers'
import {
  getStatisticsAttributes,
  getOtherAttributes,
  getLogicAttributes,
  getDisplayAttributes,
  getGeneralAttributes,
  getTimerAttributes,
} from '../attributes'
const simpleSettings = () => {
  const generalAttributes = getGeneralAttributes()
  const logicAttributes = getLogicAttributes()
  return [
    generalAttributes.QUESTION_CODE,
    generalAttributes.QUESTION_TYPE,
    generalAttributes.MANDATORY,
    getDisplayAttributes().IMAGE_SETTINGS,
    generalAttributes.LOGIC,
    logicAttributes.MINIMUM_ANSWERS,
    logicAttributes.MAXIMUM_ANSWERS,
    getStatisticsAttributes().SHOW_IN_STATISTICS,
  ]
}
const generalSettings = () => {
  const generalAttributes = getGeneralAttributes()
  return [
    generalAttributes.QUESTION_CODE,
    generalAttributes.QUESTION_TYPE,
    generalAttributes.MANDATORY,
    generalAttributes.ENCRYPTED,
... (99 lines truncated)
</file>

<file path="editor/src/components/QuestionSettings/rankingAndRating/getRankingSettings.js">
import { getQuestionAttributesTitles } from 'helpers'
import {
  getStatisticsAttributes,
  getOtherAttributes,
  getLogicAttributes,
  getDisplayAttributes,
  getGeneralAttributes,
  getTimerAttributes,
} from '../attributes'
const simpleSettings = () => {
  const generalAttributes = getGeneralAttributes()
  return [
    generalAttributes.QUESTION_CODE,
    generalAttributes.QUESTION_TYPE,
    generalAttributes.MANDATORY,
    getDisplayAttributes().IMAGE_SETTINGS,
    generalAttributes.LOGIC,
    getStatisticsAttributes().SHOW_IN_STATISTICS,
  ]
}
const generalSettings = () => {
  const generalAttributes = getGeneralAttributes()
  return [
    generalAttributes.QUESTION_CODE,
    generalAttributes.QUESTION_TYPE,
    generalAttributes.MANDATORY,
    generalAttributes.ENCRYPTED,
    generalAttributes.SAVE_AS_DEFAULT,
  ]
}
... (74 lines truncated)
</file>

<file path="editor/src/components/QuestionSettings/rankingAndRating/getRatingSettings.js">
import { getQuestionAttributesTitles } from 'helpers'
import {
  getStatisticsAttributes,
  getOtherAttributes,
  getLogicAttributes,
  getDisplayAttributes,
  getGeneralAttributes,
  getTimerAttributes,
} from '../attributes'
const simpleSettings = () => {
  const generalAttributes = getGeneralAttributes()
  return [
    generalAttributes.QUESTION_CODE,
    generalAttributes.QUESTION_TYPE,
    generalAttributes.MANDATORY,
    generalAttributes.RATING_ITEMS,
    generalAttributes.LOGIC,
    getStatisticsAttributes().SHOW_IN_STATISTICS,
    getDisplayAttributes().IMAGE_SETTINGS,
  ]
}
const generalSettings = () => {
  const generalAttributes = getGeneralAttributes()
  return [
    generalAttributes.QUESTION_CODE,
    generalAttributes.QUESTION_TYPE,
    generalAttributes.MANDATORY,
    generalAttributes.ENCRYPTED,
    generalAttributes.SAVE_AS_DEFAULT,
  ]
... (77 lines truncated)
</file>

<file path="editor/src/components/QuestionSettings/rankingAndRating/getYesNoSettings.js">
import { getQuestionAttributesTitles } from 'helpers'
import {
  getStatisticsAttributes,
  getOtherAttributes,
  getLogicAttributes,
  getDisplayAttributes,
  getGeneralAttributes,
  getTimerAttributes,
} from '../attributes'
const simpleSettings = () => {
  const generalAttributes = getGeneralAttributes()
  const displayAttributes = getDisplayAttributes()
  return [
    generalAttributes.QUESTION_CODE,
    generalAttributes.QUESTION_TYPE,
    generalAttributes.MANDATORY,
    displayAttributes.DISPLAY_TYPE,
    generalAttributes.LOGIC,
    getStatisticsAttributes().SHOW_IN_STATISTICS,
    displayAttributes.IMAGE_SETTINGS,
  ]
}
const generalSettings = () => {
  const generalAttributes = getGeneralAttributes()
  return [
    generalAttributes.QUESTION_CODE,
    generalAttributes.QUESTION_TYPE,
    generalAttributes.MANDATORY,
    generalAttributes.ENCRYPTED,
    generalAttributes.SAVE_AS_DEFAULT,
... (81 lines truncated)
</file>

<file path="editor/src/components/QuestionSettings/rankingAndRating/index.js">
export { getRankingSettings } from './getRankingSettings'
export { getRankingAdvancedSettings } from './getRankingAdvancedSettings'
export { getRatingSettings } from './getRatingSettings'
export { getGenderSettings } from './getGenderSettings'
export { getYesNoSettings } from './getYesNoSettings'
</file>

<file path="editor/src/components/QuestionSettings/singleChoice/getDropdownSettings.js">
import { getQuestionAttributesTitles } from 'helpers'
import {
  getTimerAttributes,
  getStatisticsAttributes,
  getOtherAttributes,
  getLogicAttributes,
  getDisplayAttributes,
  getGeneralAttributes,
  getThemeAttributes,
} from '../attributes'
const simpleSettings = () => {
  const generalAttributes = getGeneralAttributes()
  return [
    generalAttributes.QUESTION_CODE,
    generalAttributes.QUESTION_TYPE,
    generalAttributes.MANDATORY,
    generalAttributes.LOGIC,
    getStatisticsAttributes().SHOW_IN_STATISTICS,
    getDisplayAttributes().IMAGE_SETTINGS,
  ]
}
const generalSettings = () => {
  const generalAttributes = getGeneralAttributes()
  return [
    generalAttributes.QUESTION_CODE,
    generalAttributes.QUESTION_TYPE,
    generalAttributes.MANDATORY,
    generalAttributes.ENCRYPTED,
    generalAttributes.SAVE_AS_DEFAULT,
    generalAttributes.OTHER,
... (106 lines truncated)
</file>

<file path="editor/src/components/QuestionSettings/singleChoice/getFivePointChoiceSettings.js">
import { getQuestionAttributesTitles } from 'helpers'
import {
  getStatisticsAttributes,
  getOtherAttributes,
  getLogicAttributes,
  getDisplayAttributes,
  getGeneralAttributes,
} from '../attributes'
const simpleSettings = () => {
  const generalAttributes = getGeneralAttributes()
  return [
    generalAttributes.QUESTION_CODE,
    generalAttributes.QUESTION_TYPE,
    generalAttributes.MANDATORY,
    generalAttributes.LOGIC,
    getStatisticsAttributes().SHOW_IN_STATISTICS,
    getDisplayAttributes().IMAGE_SETTINGS,
  ]
}
const generalSettings = () => {
  const generalAttributes = getGeneralAttributes()
  return [
    generalAttributes.QUESTION_CODE,
    generalAttributes.QUESTION_TYPE,
    generalAttributes.MANDATORY,
    generalAttributes.ENCRYPTED,
    generalAttributes.SAVE_AS_DEFAULT,
  ]
}
const displaySettings = () => {
... (90 lines truncated)
</file>

<file path="editor/src/components/QuestionSettings/singleChoice/getListImageSelectSettings.js">
import { getQuestionAttributesTitles } from 'helpers'
import {
  getStatisticsAttributes,
  getOtherAttributes,
  getLogicAttributes,
  getDisplayAttributes,
  getGeneralAttributes,
} from '../attributes'
const simpleSettings = () => {
  const generalAttributes = getGeneralAttributes()
  return [
    generalAttributes.QUESTION_CODE,
    generalAttributes.QUESTION_TYPE,
    generalAttributes.MANDATORY,
    generalAttributes.LOGIC,
    getStatisticsAttributes().SHOW_IN_STATISTICS,
    getDisplayAttributes().IMAGE_SETTINGS,
  ]
}
const generalSettings = () => {
  const generalAttributes = getGeneralAttributes()
  return [
    generalAttributes.QUESTION_CODE,
    generalAttributes.QUESTION_TYPE,
    generalAttributes.MANDATORY,
    generalAttributes.ENCRYPTED,
    generalAttributes.SAVE_AS_DEFAULT,
    generalAttributes.OTHER,
  ]
}
... (94 lines truncated)
</file>

<file path="editor/src/components/QuestionSettings/singleChoice/getListRadioSettings.js">
import { getQuestionAttributesTitles } from 'helpers'
import {
  getStatisticsAttributes,
  getOtherAttributes,
  getLogicAttributes,
  getDisplayAttributes,
  getGeneralAttributes,
  getTimerAttributes,
} from '../attributes'
const simpleSettings = () => {
  const generalAttributes = getGeneralAttributes()
  return [
    generalAttributes.QUESTION_CODE,
    generalAttributes.QUESTION_TYPE,
    generalAttributes.MANDATORY,
    generalAttributes.LOGIC,
    getStatisticsAttributes().SHOW_IN_STATISTICS,
    getDisplayAttributes().IMAGE_SETTINGS,
  ]
}
const generalSettings = () => {
  const generalAttributes = getGeneralAttributes()
  return [
    generalAttributes.QUESTION_CODE,
    generalAttributes.QUESTION_TYPE,
    generalAttributes.MANDATORY,
    generalAttributes.ENCRYPTED,
    generalAttributes.SAVE_AS_DEFAULT,
    generalAttributes.OTHER,
  ]
... (101 lines truncated)
</file>

<file path="editor/src/components/QuestionSettings/singleChoice/getListWithCommentRadioSettings.js">
import { getQuestionAttributesTitles } from 'helpers'
import {
  getStatisticsAttributes,
  getLogicAttributes,
  getDisplayAttributes,
  getGeneralAttributes,
} from '../attributes'
const simpleSettings = () => {
  const generalAttributes = getGeneralAttributes()
  return [
    generalAttributes.QUESTION_CODE,
    generalAttributes.QUESTION_TYPE,
    generalAttributes.MANDATORY,
    generalAttributes.LOGIC,
    getStatisticsAttributes().SHOW_IN_STATISTICS,
    getDisplayAttributes().IMAGE_SETTINGS,
  ]
}
const generalSettings = () => {
  const generalAttributes = getGeneralAttributes()
  return [
    generalAttributes.QUESTION_CODE,
    generalAttributes.QUESTION_TYPE,
    generalAttributes.MANDATORY,
    generalAttributes.ENCRYPTED,
    generalAttributes.SAVE_AS_DEFAULT,
  ]
}
const displaySettings = () => {
  const displayAttributes = getDisplayAttributes()
... (82 lines truncated)
</file>

<file path="editor/src/components/QuestionSettings/singleChoice/getSingleChoiceButtonsSettings.js">
import { getQuestionAttributesTitles } from 'helpers'
import {
  getTimerAttributes,
  getStatisticsAttributes,
  getOtherAttributes,
  getLogicAttributes,
  getDisplayAttributes,
  getGeneralAttributes,
  getThemeAttributes,
} from '../attributes'
const simpleSettings = () => {
  const generalAttributes = getGeneralAttributes()
  return [
    generalAttributes.QUESTION_CODE,
    generalAttributes.QUESTION_TYPE,
    generalAttributes.MANDATORY,
    generalAttributes.LOGIC,
    getStatisticsAttributes().SHOW_IN_STATISTICS,
    getDisplayAttributes().IMAGE_SETTINGS,
  ]
}
const generalSettings = () => {
  const generalAttributes = getGeneralAttributes()
  return [
    generalAttributes.QUESTION_CODE,
    generalAttributes.QUESTION_TYPE,
    generalAttributes.MANDATORY,
    generalAttributes.ENCRYPTED,
    generalAttributes.SAVE_AS_DEFAULT,
    generalAttributes.OTHER,
... (107 lines truncated)
</file>

<file path="editor/src/components/QuestionSettings/singleChoice/index.js">
export { getListRadioSettings } from './getListRadioSettings'
export { getListImageSelectSettings } from './getListImageSelectSettings'
export { getListWithCommentRadioSettings } from './getListWithCommentRadioSettings'
export { getFivePointChoiceSettings } from './getFivePointChoiceSettings'
export { getDropdownSettings } from './getDropdownSettings'
export { getSingleChoiceButtonsSettings } from './getSingleChoiceButtonsSettings'
</file>

<file path="editor/src/components/QuestionSettings/textQuestion/getLongTextSettings.js">
import { getQuestionAttributesTitles } from 'helpers'
import {
  getTimerAttributes,
  getStatisticsAttributes,
  getOtherAttributes,
  getLogicAttributes,
  getDisplayAttributes,
  getGeneralAttributes,
} from '../attributes'
const simpleSettings = () => {
  const generalAttributes = getGeneralAttributes()
  return [
    generalAttributes.QUESTION_CODE,
    generalAttributes.QUESTION_TYPE,
    generalAttributes.MANDATORY,
    {
      ...generalAttributes.MAX_CHARACTERS,
      props: {
        ...generalAttributes.MAX_CHARACTERS.props,
        placeholder: 1500,
      },
    },
    generalAttributes.LOGIC,
    getStatisticsAttributes().SHOW_IN_STATISTICS,
    getDisplayAttributes().IMAGE_SETTINGS,
  ]
}
const generalSettings = () => {
  const generalAttributes = getGeneralAttributes()
  return [
... (94 lines truncated)
</file>

<file path="editor/src/components/QuestionSettings/textQuestion/getMultipleShortTextSettings.js">
import { getQuestionAttributesTitles } from 'helpers'
import {
  getTimerAttributes,
  getStatisticsAttributes,
  getOtherAttributes,
  getLogicAttributes,
  getDisplayAttributes,
  getGeneralAttributes,
} from '../attributes'
const simpleSettings = () => {
  const generalAttributes = getGeneralAttributes()
  const displayAttributes = getDisplayAttributes()
  return [
    generalAttributes.QUESTION_CODE,
    generalAttributes.QUESTION_TYPE,
    generalAttributes.MANDATORY,
    generalAttributes.NUMBERS_ONLY,
    generalAttributes.MAX_CHARACTERS,
    displayAttributes.INPUT_ON_DEMAND,
    generalAttributes.LOGIC,
    getStatisticsAttributes().SHOW_IN_STATISTICS,
    displayAttributes.IMAGE_SETTINGS,
  ]
}
const generalSettings = () => {
  const generalAttributes = getGeneralAttributes()
  return [
    generalAttributes.QUESTION_CODE,
    generalAttributes.QUESTION_TYPE,
    generalAttributes.MANDATORY,
... (94 lines truncated)
</file>

<file path="editor/src/components/QuestionSettings/textQuestion/getNumericSettings.js">
import { getQuestionAttributesTitles } from 'helpers'
import {
  getStatisticsAttributes,
  getOtherAttributes,
  getLogicAttributes,
  getDisplayAttributes,
  getGeneralAttributes,
  getInputAttributes,
} from '../attributes'
const simpleSettings = () => {
  const generalAttributes = getGeneralAttributes()
  return [
    generalAttributes.QUESTION_CODE,
    generalAttributes.QUESTION_TYPE,
    generalAttributes.MANDATORY,
    getStatisticsAttributes().SHOW_IN_STATISTICS,
    getDisplayAttributes().IMAGE_SETTINGS,
  ]
}
const generalSettings = () => {
  const generalAttributes = getGeneralAttributes()
  return [
    generalAttributes.QUESTION_CODE,
    generalAttributes.QUESTION_TYPE,
    generalAttributes.MANDATORY,
    generalAttributes.ENCRYPTED,
    generalAttributes.SAVE_AS_DEFAULT,
    generalAttributes.INPUT_VALIDATION,
    generalAttributes.MAX_CHARACTERS,
  ]
... (66 lines truncated)
</file>

<file path="editor/src/components/QuestionSettings/textQuestion/getShortTextSettings.js">
import { getQuestionAttributesTitles } from 'helpers'
import {
  getTimerAttributes,
  getStatisticsAttributes,
  getOtherAttributes,
  getLogicAttributes,
  getDisplayAttributes,
  getGeneralAttributes,
} from '../attributes'
const simpleSettings = () => {
  const generalAttributes = getGeneralAttributes()
  return [
    generalAttributes.QUESTION_CODE,
    generalAttributes.QUESTION_TYPE,
    generalAttributes.MANDATORY,
    generalAttributes.NUMBERS_ONLY,
    generalAttributes.MAX_CHARACTERS,
    getStatisticsAttributes().SHOW_IN_STATISTICS,
    generalAttributes.LOGIC,
    getDisplayAttributes().IMAGE_SETTINGS,
  ]
}
const generalSettings = () => {
  const generalAttributes = getGeneralAttributes()
  return [
    generalAttributes.QUESTION_CODE,
    generalAttributes.QUESTION_TYPE,
    generalAttributes.MANDATORY,
    generalAttributes.NUMBERS_ONLY,
    generalAttributes.MAX_CHARACTERS,
... (97 lines truncated)
</file>

<file path="editor/src/components/QuestionSettings/textQuestion/index.js">
export { getLongTextSettings } from './getLongTextSettings'
export { getShortTextSettings } from './getShortTextSettings'
export { getMultipleShortTextSettings } from './getMultipleShortTextSettings'
export { getNumericSettings } from './getNumericSettings'
</file>

<file path="editor/src/components/QuestionSettings/DefaultValuesActions.js">
import React, { useState } from 'react'
import { Button } from 'react-bootstrap'
import { ArrowDownIcon, ArrowUpIcon, InformationIcon } from 'components/icons'
const Details = ({ children }) => {
  const [isOpen, setIsOpen] = useState(false)
  return (
    <div className="default-values-details">
      <button
        type="button"
        className="default-values-details-toggle"
        aria-expanded={isOpen}
        onClick={() => setIsOpen((open) => !open)}
      >
        <InformationIcon />
        <span>{isOpen ? t('Hide details') : t('Learn more')}</span>
        {isOpen ? <ArrowUpIcon /> : <ArrowDownIcon />}
      </button>
      {isOpen && <div className="default-values-details-text">{children}</div>}
    </div>
  )
}
export const DefaultValuesActions = ({
  update,
  hasDefaultAttributeValues = false,
  activeDisabled = false,
}) => {
  return (
    <div className="default-values-actions">
      <div>
        <Button
... (36 lines truncated)
</file>

<file path="editor/src/components/QuestionSettings/DefaultValuesActions.test.js">
import 'tests/mocks'
import { fireEvent, render, screen } from '@testing-library/react'
import { DefaultValuesActions } from './DefaultValuesActions'
global.t = (key) => key
describe('DefaultValuesActions', () => {
  test('saves defaults and hides clear when no defaults exist', async () => {
    const update = jest.fn()
    render(<DefaultValuesActions update={update} />)
    expect(screen.queryByText('Clear default values')).not.toBeInTheDocument()
    fireEvent.click(
      screen.getByRole('button', { name: 'Save as default values' })
    )
    expect(update).toHaveBeenCalledWith({ saveAsDefault: true })
    expect(
      screen.queryByText(/The current attribute values/)
    ).not.toBeInTheDocument()
    fireEvent.click(screen.getByRole('button', { name: 'Learn more' }))
    expect(screen.getByText(/The current attribute values/)).toBeInTheDocument()
    expect(
      screen.getByRole('button', { name: 'Hide details' })
    ).toBeInTheDocument()
  })
  test('shows and triggers clear when defaults exist', async () => {
    const update = jest.fn()
    render(
      <DefaultValuesActions update={update} hasDefaultAttributeValues={true} />
    )
    fireEvent.click(
      screen.getByRole('button', { name: 'Clear default values' })
    )
... (4 lines truncated)
</file>

<file path="editor/src/components/QuestionSettings/getQuestionSettings.js">
import { getQuestionTypeInfo } from 'components/QuestionTypes'
import {
  getShortTextSettings,
  getLongTextSettings,
  getMultipleShortTextSettings,
  getNumericSettings,
} from './textQuestion'
import {
  getBrowserDetectionSettings,
  getDateTimeSettings,
  getFileUploadSettings,
} from './datesAndData'
import {
  getEquationSettings,
  getMultipleNumericalInputsSettings,
  getTextDisplaySettings,
} from './number'
import {
  getListImageSelectSettings,
  getListRadioSettings,
  getListWithCommentRadioSettings,
  getFivePointChoiceSettings,
  getDropdownSettings,
  getSingleChoiceButtonsSettings,
} from './singleChoice'
import {
  getMultipleChoiceButtonsSettings,
  getMultipleChoiceImageSettings,
  getMultipleChoiceSettings,
  getMultipleChoiceWithCommentsSettings,
... (65 lines truncated)
</file>

<file path="editor/src/components/QuestionSettings/QuestionSettings.js">
import React, { useState, useMemo, useEffect } from 'react'
import classNames from 'classnames'
import { Button } from 'react-bootstrap'
import {
  STATES,
  getQuestionAttributesTitles,
  createBufferOperation,
  getDisabledQuestionTypes,
  errorToast,
  isTempId,
} from 'helpers'
import { useAppState, useBuffer, useFocused, useSurvey } from 'hooks'
import { SideBarHeader } from 'components/SideBar'
import { CloseIcon } from 'components/icons'
import { ToggleButtons } from 'components/UIComponents'
import { Setting } from './Setting'
import { getQuestionSettings } from './getQuestionSettings'
import { getQuestionTypeInfo } from '../QuestionTypes'
import { ScenarioList } from 'components/ConditionDesigner/ScenarioList'
import { ConditionDesigner } from 'components/ConditionDesigner/ConditionDesigner'
import { AddScenario } from 'components/ConditionDesigner/AddScenario'
import { ExpressionScript } from '../ConditionDesigner/ExpressionScript'
import { ExpressionScriptInputBox } from '../ConditionDesigner/ExpressionScript/ExpressionScriptInputBox'
export const QuestionSettings = ({ surveyId }) => {
  const [questionSettingsOptions, setQuestionSettingsOptions] = useAppState(
    STATES.QUESTION_SETTINGS_OPTIONS,
    { isAdvanced: false }
  )
  const { survey, update, language } = useSurvey(surveyId)
  const { addToBuffer } = useBuffer()
... (309 lines truncated)
</file>

<file path="editor/src/components/QuestionSettings/Setting.js">
import React from 'react'
import { useParams } from 'react-router-dom'
import { STATES, isTempId, isTrue } from 'helpers'
import { getTooltipMessages } from 'helpers/options'
import { useAppState, useExpressionScriptValidation } from 'hooks'
import { SettingsWrapper } from 'components/UIComponents'
import { TooltipContainer } from '../TooltipContainer/TooltipContainer'
export const Setting = ({
  question,
  handleUpdate,
  isAdvanced = false,
  language = 'en',
  title = '',
  attributes = [],
  simpleSettings = false,
  hasDefaultAttributeValues = false,
  sectionExpanded,
  onSectionToggle,
}) => {
  const { surveyId } = useParams()
  const [isSurveyActive] = useAppState(STATES.IS_SURVEY_ACTIVE)
  const [hasSurveyUpdatePermission] = useAppState(
    STATES.HAS_SURVEY_UPDATE_PERMISSION
  )
  const validateExpression = useExpressionScriptValidation(
    surveyId,
    question?.qid
  )
  const isDependsOnSatisfied = (dependsOn, dependsOnValue) => {
    if (!dependsOn) {
... (196 lines truncated)
</file>

<file path="editor/src/components/QuestionSettings/Setting.stories.js">
import { mockQuestion } from 'sbook/helpers/fixtures/mockQuestion'
import { Setting } from './Setting'
import { getDisplayAttributes } from './attributes/getDisplayAttributes'
import { getFileMetaDataAttributes } from './attributes/getFileMetaDataAttributes'
import { getGeneralAttributes } from './attributes/getGeneralAttributes'
import { getInputAttributes } from './attributes/getInputAttributes'
import { getLocationAttributes } from './attributes/getLocationAttributes'
import { getLogicAttributes } from './attributes/getLogicAttributes'
import { getOtherAttributes } from './attributes/getOtherAttributes'
import { getSliderAttributes } from './attributes/getSliderAttributes'
import { getStatisticsAttributes } from './attributes/getStatisticsAttributes'
import { getThemeAttributes } from './attributes/getThemeAttributes'
import { getTimerAttributes } from './attributes/getTimerAttributes'
export default {
  title: 'QuestionSettings',
  decorators: [(Story) => <Story />],
}
export const General = () => {
  return (
    <div className="w-25">
      <Setting
        question={mockQuestion()}
        handleUpdate={() => {}}
        simpleSettings={true}
        title="General"
        attributes={Object.values(getGeneralAttributes())}
      />
    </div>
  )
}
... (131 lines truncated)
</file>

<file path="editor/src/components/QuestionsParticipantMode/ArrayParticipantMode/ArrayParticipantMode.js">
import { cloneDeep } from 'lodash'
import { useMemo, useRef } from 'react'
import { Table } from 'react-bootstrap'
import {
  getNotSupportedQuestionTypeInfo,
  getQuestionTypeInfo,
} from 'components/QuestionTypes'
import {
  ContentEditor,
  FormCheck,
  formCheckName,
  Input,
  Select,
  selectName,
} from 'components/UIComponents'
import { Entities, isTrue, L10ns, mockAnswer, SCALE_1, SCALE_2 } from 'helpers'
const arrayOrDualScaleIsChecked = (
  rowId,
  columnId,
  columnCode,
  rowIdKey,
  columnIdKey,
  valueInfo = {},
  questionThemeName,
  columnNumber
) => {
  if (
    ![
      getQuestionTypeInfo().ARRAY.theme,
      getQuestionTypeInfo().ARRAY_DUAL_SCALE.theme,
... (456 lines truncated)
</file>

<file path="editor/src/components/QuestionsParticipantMode/index.js">
export * from './ArrayParticipantMode/ArrayParticipantMode'
</file>

<file path="editor/src/components/QuestionTypes/ArrayQuestion/ArrayColumnsTitles/ArrayColumnsTitles.js">
import { useEffect, useMemo, useRef, useState } from 'react'
import { Draggable } from 'react-beautiful-dnd'
import { useParams } from 'react-router-dom'
import classNames from 'classnames'
import { max } from 'lodash'
import {
  Entities,
  getAttributeValue,
  L10ns,
  getNoAnswerLabel,
  SCALE_1,
  SCALE_2,
  STATES,
} from 'helpers'
import { useAppState, useSurvey } from 'hooks'
import { ContentEditor, DragAndDrop } from 'components'
import { getDisplayAttributes } from 'components/QuestionSettings/attributes'
import { getQuestionTypeInfo } from 'components/QuestionTypes/getQuestionTypeInfo'
import { ARRAY_ROW_LABEL_INSET } from '../arrayLayout'
import { ArrayColumnTitle } from './ArrayColumnTitle'
export const ArrayColumnsTitles = ({
  question: {
    answers = [],
    subquestions = [],
    attributes = {},
    qid,
    questionThemeName,
  } = {},
  onDragEndCallback,
  highestSubquestionWidth,
... (303 lines truncated)
</file>

<file path="editor/src/components/QuestionTypes/ArrayQuestion/ArrayColumnsTitles/ArrayColumnTitle.js">
import classNames from 'classnames'
import { useParams } from 'react-router-dom'
import { ContentEditor } from 'components'
import { CloseCircleFillIcon, DragIcon } from 'components/icons'
import { hasTempId, STATES } from 'helpers'
import { useAppState, useSurvey } from 'hooks'
import { SubquestionCodeInput } from '../../subquestionCodeComponents'
import { AssessmentValueInput } from '../../AssessmentValueInput'
export const ArrayColumnTitle = ({
  isFocused,
  removeItem,
  dragIconSize,
  provided = {},
  highestHeight,
  index,
  title,
  handleUpdateL10ns,
  placeholder = 'Answer option',
  itemsKey,
  isNoAnswer = false,
  code,
  handleChildCodeUpdate,
  showAssessmentValue = false,
  assessmentValue,
  assessmentScaleNumber,
  handleAssessmentValueUpdate = () => {},
  qid = '',
  isTitleFocused,
  id,
}) => {
... (83 lines truncated)
</file>

<file path="editor/src/components/QuestionTypes/ArrayQuestion/ArrayRows/ArrayRow.js">
import React from 'react'
import classNames from 'classnames'
import { useParams } from 'react-router-dom'
import { SubquestionCodeInput } from '../../subquestionCodeComponents'
import { AssessmentValueInput } from '../../AssessmentValueInput'
import { DragIcon, CloseCircleFillIcon } from 'components/icons'
import { useAppState, useSurvey } from 'hooks'
import {
  TooltipContainer,
  ContentEditor,
  getQuestionTypeInfo,
} from 'components'
import { hasTempId, STATES } from 'helpers'
import { getTooltipMessages } from 'helpers/options'
import { ArraySubQuestionRadioAnswers } from './ArraySubQuestionRadioAnswers'
import { ArraySubQuestionTextAnswers } from './ArraySubQuestionTextAnswers'
import { ArraySubQuestionNumberAnswers } from './ArraySubQuestionNumberAnswers'
import { ARRAY_ROW_GAP, ARRAY_ROW_LABEL_INSET } from '../arrayLayout'
export const ArrayRow = ({
  questionThemeName,
  isFocused,
  highestWidth,
  subQuestionsHeight,
  arrayAnswersWidth,
  dragIconSize,
  provided = {},
  index,
  handleUpdateL10ns,
  handleCodeUpdate,
  removeItem,
... (186 lines truncated)
</file>

<file path="editor/src/components/QuestionTypes/ArrayQuestion/ArrayRows/ArrayRows.js">
import { useEffect, useMemo, useRef } from 'react'
import { Draggable } from 'react-beautiful-dnd'
import classNames from 'classnames'
import { DragAndDrop } from 'components/UIComponents/DragAndDrop/DragAndDrop'
import { getQuestionTypeInfo } from 'components/QuestionTypes/getQuestionTypeInfo'
import { Entities, L10ns, getNoAnswerLabel } from 'helpers'
import { ArrayRow } from './ArrayRow'
export const ArrayRows = ({
  onDragEndCallback,
  question: { questionThemeName, answers = [], subquestions = [], qid } = {},
  language,
  handleUpdate,
  isFocused,
  highestWidth,
  setHighestWidth,
  arrayAnswersWidth,
  dragIconSize,
  showContentEditor = true,
  showQuestionCode = true,
  scaleId,
  subQuestionsHeight,
  setSubQuestionsHeight,
  numberOfHorizontalEntities = 0,
  removeItem = () => {},
  handleUpdateL10ns = () => {},
  setVerticalEntitiesInfo,
  showNoAnswer = false,
  handleChildCodeUpdate = () => {},
  handleChildAssessmentValueUpdate = () => {},
  showAssessmentValue = false,
... (230 lines truncated)
</file>

<file path="editor/src/components/QuestionTypes/ArrayQuestion/ArrayRows/ArraySubQuestionNumberAnswers.js">
import classNames from 'classnames'
import { Select } from 'components/UIComponents'
import { useParams } from 'react-router-dom'
import { useSurvey } from '../../../../hooks'
export const ArraySubQuestionNumberAnswers = ({
  index,
  subQuestionindex,
  subQuestionsHeight = [],
  arrayAnswersWidth = [],
  dragIconSize = 1,
  showBackgroundUnderSubQuestion = false,
  isFocused,
}) => {
  const { surveyId } = useParams()
  const { survey } = useSurvey(surveyId)
  const showQNumCode = survey.showQNumCode
  const options = [
    { value: '...', label: '...' },
    ...Array(10)
      .fill('-')
      .map((_, idx) => ({
        label: `${idx + 1}`,
        value: `${idx + 1}`,
      })),
  ]
  return (
    <div
      className={classNames(
        'array-question-item d-flex align-items-center justify-content-center py-1',
        {
... (20 lines truncated)
</file>

<file path="editor/src/components/QuestionTypes/ArrayQuestion/ArrayRows/ArraySubQuestionRadioAnswers.js">
import classNames from 'classnames'
import { FormCheck } from 'react-bootstrap'
import { useParams } from 'react-router-dom'
import { useSurvey } from 'hooks'
export const ArraySubQuestionRadioAnswers = ({
  subQuestionindex,
  subQuestionsHeight = [],
  arrayAnswersWidth = [],
  dragIconSize = 1,
  index,
  showBackgroundUnderSubQuestion = false,
  qid,
  isFocused,
}) => {
  const { surveyId } = useParams()
  const { survey } = useSurvey(surveyId)
  const showQNumCode = survey.showQNumCode
  return (
    <FormCheck
      onClick={(e) => {
        e.stopPropagation()
      }}
      type="radio"
      className={classNames(
        'mb-0 array-question-item  d-flex align-items-center justify-content-center',
        { 'bg-grey': showBackgroundUnderSubQuestion }
      )}
      style={{
        width: `${arrayAnswersWidth[index] + (isFocused && showQNumCode?.showNumber ? 80 : dragIconSize * 2)}px`,
        minHeight: (subQuestionsHeight[subQuestionindex] || 50) + 10,
... (6 lines truncated)
</file>

<file path="editor/src/components/QuestionTypes/ArrayQuestion/ArrayRows/ArraySubQuestionTextAnswers.js">
import { useParams } from 'react-router-dom'
import classNames from 'classnames'
import { Input } from 'components/UIComponents'
import { useSurvey } from 'hooks'
export const ArraySubQuestionTextAnswers = ({
  subQuestionindex,
  subQuestionsHeight = [],
  arrayAnswersWidth = [],
  dragIconSize = 1,
  index,
  showBackgroundUnderSubQuestion = false,
  isFocused,
}) => {
  const { surveyId } = useParams()
  const { survey } = useSurvey(surveyId)
  const showQNumCode = survey.showQNumCode
  return (
    <div
      className={classNames(
        'array-question-item d-flex align-items-center py-1',
        {
          'bg-grey': showBackgroundUnderSubQuestion,
        }
      )}
      style={{
        minHeight: (subQuestionsHeight[subQuestionindex] || 50) + 10,
        cursor: 'not-allowed',
      }}
    >
      <Input
... (11 lines truncated)
</file>

<file path="editor/src/components/QuestionTypes/ArrayQuestion/arrayLayout.js">
export const ARRAY_ROW_GAP = 16
export const ARRAY_ROW_LABEL_INSET = 14 + ARRAY_ROW_GAP
</file>

<file path="editor/src/components/QuestionTypes/ArrayQuestion/ArrayQuestion.js">
import { useMemo, useState } from 'react'
import classNames from 'classnames'
import {
  SCALE_1,
  SCALE_2,
  createBufferOperation,
  STATES,
  isTrue,
} from 'helpers'
import { useAppState, useBuffer } from 'hooks'
import { getTooltipMessages } from 'helpers/options'
import { getDisplayAttributes } from 'components/QuestionSettings/attributes'
import { Button } from 'components/UIComponents'
import { AddIcon } from 'components/icons'
import { TooltipContainer } from 'components'
import { getQuestionTypeInfo } from '../getQuestionTypeInfo'
import { ArrayColumnsTitles, ArrayRows } from './'
import { ARRAY_ROW_LABEL_INSET } from './arrayLayout'
const DRAG_ICON_SIZE = 22
export const ArrayQuestion = ({
  question,
  handleUpdate,
  language,
  isFocused,
  surveySettings,
  handleChildLUpdate,
  handleChildAdd,
  handleChildDelete,
  handleOnChildDragEnd,
  handleChildCodeUpdate,
... (301 lines truncated)
</file>

<file path="editor/src/components/QuestionTypes/ArrayQuestion/index.js">
export * from './ArrayColumnsTitles/ArrayColumnsTitles'
export * from './ArrayColumnsTitles/ArrayColumnTitle'
export * from './ArrayRows/ArrayRows'
export * from './ArrayRows/ArrayRow'
</file>

<file path="editor/src/components/QuestionTypes/DateTime/DateTime.js">
import React, { useEffect, useState } from 'react'
import { DemoContainer } from '@mui/x-date-pickers/internals/demo'
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider'
import { DatePicker } from '@mui/x-date-pickers/DatePicker'
import { Select } from 'components/UIComponents'
const shortMonthOptions = [
  { label: t('Month'), value: 'month' },
  { label: t('Jan'), value: 'jan' },
  { label: t('Feb'), value: 'feb' },
  { label: t('Mar'), value: 'mar' },
  { label: t('Apr'), value: 'apr' },
  { label: t('May'), value: 'may' },
  { label: t('Jun'), value: 'jun' },
  { label: t('Jul'), value: 'jul' },
  { label: t('Aug'), value: 'aug' },
  { label: t('Sep'), value: 'sep' },
  { label: t('Oct'), value: 'oct' },
  { label: t('Nov'), value: 'nov' },
  { label: t('Dec'), value: 'dec' },
]
const fullMonthOptions = [
  { label: t('Month'), value: 'month' },
  { label: t('January'), value: 'jan' },
  { label: t('February'), value: 'feb' },
  { label: t('March'), value: 'mar' },
  { label: t('April'), value: 'apr' },
  { label: t('May'), value: 'may' },
  { label: t('June'), value: 'jun' },
  { label: t('July'), value: 'jul' },
... (226 lines truncated)
</file>

<file path="editor/src/components/QuestionTypes/Equation/Equation.js">
import { ContentEditor } from 'components/UIComponents'
export const Equation = ({ values = [], onValueChange, participantMode }) => {
  const valueInfo = values?.[0]
  if (participantMode) {
    return (
      <ContentEditor
        value={valueInfo.value}
        update={(value) => onValueChange(value, valueInfo.key)}
      />
    )
  }
  return null
}
</file>

<file path="editor/src/components/QuestionTypes/FileUpload/FileRejectionItems.js">
import React from 'react'
import { format } from 'util'
export const FileRejectionItems = ({ fileRejections }) => (
  <ul>
    {fileRejections.map(({ file, errors }) => {
      return (
        <li key={file.path}>
          {file.path} - {format(t('%s bytes'), file.size)}
          <ul>
            {errors.map((e) => (
              <li className="text-danger" key={e.code}>
                {e.message}
              </li>
            ))}
          </ul>
        </li>
      )
    })}
  </ul>
)
</file>

<file path="editor/src/components/QuestionTypes/FileUpload/FileUpload.js">
import React, { useState } from 'react'
import { useDropzone } from 'react-dropzone'
import { cloneDeep } from 'lodash'
import { UploadIcon } from 'components/icons'
import { ImageEditor } from 'components/UIComponents/ImageEditor/ImageEditor'
import { FileRejectionItems } from './FileRejectionItems'
import { FileUploadItem } from './FileUploadItem'
import { FileUploadParticipantView } from './FileUploadParticipantView'
import categorizeFileTypes from 'helpers/categorizeFileTypes'
export const FileUpload = ({
  question,
  values = [],
  participantMode,
  onValueChange = () => {},
}) => {
  const [uploadedImages, setUploadedImages] = useState([])
  const [show, setShow] = useState(false)
  const [selectedIndex, setSelectedIndex] = useState(-1)
  const [selectedFile, setSelectedFile] = useState(null)
  const [files, setFiles] = useState(cloneDeep(values))
  const allowedFileTypes = question?.attributes?.allowedFileTypes?.value
  const accept = categorizeFileTypes(allowedFileTypes)
  const maxFileSize = question?.attributes?.maximumFileSizeAllowed?.value
  const handleClose = () => {
    setShow(false)
    setSelectedFile(null)
    setSelectedIndex(-1)
  }
  const handleChange = (file) => {
    setUploadedImages((prev) => {
... (104 lines truncated)
</file>

<file path="editor/src/components/QuestionTypes/FileUpload/FileUploadItem.js">
import React from 'react'
import { Button, Form } from 'react-bootstrap'
import { DeleteIcon, EditIcon } from 'components/icons'
export const FileUploadItem = ({
  file,
  index,
  onEdit,
  onDelete,
  onMetadataChange,
  question,
}) => {
  const showTitle = question?.attributes?.showTitle?.value
  const showComment = question?.attributes?.showComment?.value
  const fileTitle = file.title || ''
  const fileComment = file.comment || ''
  const handleTitleChange = (e) => {
    onMetadataChange(index, 'title', e.target.value)
  }
  const handleCommentChange = (e) => {
    onMetadataChange(index, 'comment', e.target.value)
  }
  return (
    <div className="mb-3">
      <div
        className="position-relative image-wrapper"
        style={{
          maxWidth: '300px',
          background: 'rgba(0, 0, 0, 0.05)',
        }}
      >
... (58 lines truncated)
</file>

<file path="editor/src/components/QuestionTypes/FileUpload/FileUploadParticipantView.js">
import { format } from 'util'
import React from 'react'
import { Button } from 'react-bootstrap'
import { Input } from 'components/UIComponents'
export const FileUploadParticipantView = ({
  files,
  question,
  onValueChange,
}) => {
  const handleOnValueChange = (newValue, keyToUpdate, index) => {
    const updatedFiles = [...files]
    updatedFiles[index] = { ...updatedFiles[index], [keyToUpdate]: newValue }
    onValueChange(JSON.stringify(updatedFiles), files[index].key)
  }
  if (!files.length) {
    return (
      <>
        <h1>{t('No files uploaded')}</h1>
      </>
    )
  }
  return (
    <>
      {files?.map((file, index) => {
        return (
          <div className="w-50" key={`${file.size}-${index}`}>
            <div className="d-flex justify-content-between my-2 align-items-center">
              {t('File name')}:
              <Input
                update={(value) => handleOnValueChange(value, 'name', index)}
... (42 lines truncated)
</file>

<file path="editor/src/components/QuestionTypes/FivePointChoiceQuestion/FivePointChoiceQuestion.js">
import { useEffect, useState } from 'react'
import './FivePointChoiceQuestion.scss'
import { ContentEditor, FormCheck } from 'components/UIComponents'
import { getNoAnswerLabel } from 'helpers'
const POINT_OPTIONS = [1, 2, 3, 4, 5]
const NO_ANSWER_INDEX = POINT_OPTIONS.length
const getSelectedOptionIndex = (valueInfo, preselectNoAnswer) => {
  const selectedIndex = POINT_OPTIONS.findIndex(
    (point) => point.toString() === valueInfo?.value?.toString()
  )
  if (selectedIndex !== -1) {
    return selectedIndex
  }
  return preselectNoAnswer && !valueInfo?.checked ? NO_ANSWER_INDEX : -1
}
export const FivePointChoiceQuestion = ({
  question = {},
  surveySettings = {},
  values = [],
  participantMode = false,
  onValueChange = () => {},
}) => {
  const showNoAnswer = !question?.mandatory && surveySettings?.showNoAnswer
  const valueInfo = participantMode ? values[0] : {}
  const [selectedOptionIndex, setSelectedOptionIndex] = useState(() =>
    getSelectedOptionIndex(valueInfo, surveySettings?.preselectNoAnswer)
  )
  useEffect(() => {
    setSelectedOptionIndex(
      getSelectedOptionIndex(valueInfo, surveySettings?.preselectNoAnswer)
... (44 lines truncated)
</file>

<file path="editor/src/components/QuestionTypes/GenderQuestion/GenderQuestion.js">
import { FormCheck } from 'react-bootstrap'
import WomenLineIcon from 'remixicon-react/WomenLineIcon'
import MenLineIcon from 'remixicon-react/MenLineIcon'
import CheckboxBlankCircleLineIcon from 'remixicon-react/CheckboxBlankCircleLineIcon'
import { useEffect, useState } from 'react'
import classNames from 'classnames'
import { getAttributeValue, isTrue, getNoAnswerLabel } from 'helpers'
import { getDisplayButtonTypeOptions } from 'helpers/options'
import { Button } from 'components/UIComponents'
export const GenderQuestion = ({
  question,
  surveySettings,
  values = [],
  onValueChange = () => {},
}) => {
  const valueInfo = values?.[0] || {}
  const [currentSelectedOptionIndex, setCurrentSelectedOptionIndex] = useState(
    surveySettings.preselectNoAnswer ? 2 : -1
  )
  const options = [
    { icon: WomenLineIcon, name: st('Female'), value: 'F' },
    { icon: MenLineIcon, name: st('Male'), value: 'M' },
  ]
  useEffect(() => {
    const info = valueInfo.value
    let selectedIndex = surveySettings.preselectNoAnswer ? 2 : -1
    options.forEach((option, index) => {
      if (
        info === option.value &&
        (option.value !== null || surveySettings.preselectNoAnswer)
... (92 lines truncated)
</file>

<file path="editor/src/components/QuestionTypes/MultipleChoice/MultipleChoice.js">
import { useRef } from 'react'
import classNames from 'classnames'
import { Draggable } from 'react-beautiful-dnd'
import { Button, Form } from 'react-bootstrap'
import { PlusLg } from 'react-bootstrap-icons'
import { useAppState, useChildKeyboardShortcuts } from 'hooks'
import { STATES, Entities } from 'helpers'
import { getTooltipMessages } from 'helpers/options'
import { DragAndDrop } from 'components/UIComponents'
import { TooltipContainer } from 'components'
import { getQuestionTypeInfo } from '../getQuestionTypeInfo'
import { MultipleChoiceSubquestion } from './MultipleChoiceSubquestion'
export const MultipleChoice = ({
  question: { subquestions = [], questionThemeName, attributes = {} } = {},
  handleChildLUpdate,
  showCommentsInputs = false,
  isFocused = false,
  language,
  handleChildAdd,
  handleOnChildDragEnd,
  handleChildDelete,
}) => {
  const [isSurveyActive] = useAppState(STATES.IS_SURVEY_ACTIVE)
  const containersRef = useRef(null)
  const subquestionsRef = useRef(null)
  subquestionsRef.current = subquestions
  const { getKeyDownHandler } = useChildKeyboardShortcuts({
    children: subquestions,
    entityType: Entities.subquestion,
    handleChildAdd,
... (97 lines truncated)
</file>

<file path="editor/src/components/QuestionTypes/MultipleChoice/MultipleChoiceButtonSubquestion.js">
import ContentEditable from 'react-contenteditable'
import { Button } from 'components/UIComponents'
export const MultipleChoiceButtonSubquestion = ({ value = '' }) => {
  return (
    <Button variant="outline-success" className="me-2 button-question">
      <ContentEditable disabled={true} html={value} />
    </Button>
  )
}
</file>

<file path="editor/src/components/QuestionTypes/MultipleChoice/MultipleChoiceCheckboxSubquestion.js">
import { useState } from 'react'
import { Form, FormCheck } from 'react-bootstrap'
import classNames from 'classnames'
import { getQuestionTypeInfo } from '../getQuestionTypeInfo'
import { getCommentedCheckboxOptions } from 'helpers/options'
import { ContentEditor } from 'components/UIComponents'
export const MultipleChoiceCheckboxSubquestion = ({
  subQuestion,
  questionThemeName,
  value,
  commentedCheckbox,
}) => {
  const [isChecked, setIsChecked] = useState(false)
  const commentedCheckboxOptions = getCommentedCheckboxOptions()
  const showCommentInput =
    ((isChecked &&
      commentedCheckbox === commentedCheckboxOptions.CHECKED.value) ||
      (!isChecked &&
        commentedCheckbox === commentedCheckboxOptions.UNCHECKED.value) ||
      commentedCheckbox === commentedCheckboxOptions.ALWAYS.value) &&
    questionThemeName ===
      getQuestionTypeInfo().MULTIPLE_CHOICE_WITH_COMMENTS.theme
  return (
    <div className="d-flex align-items-center w-100 gap-4 multiple-choice-checkbox-subquestion">
      <Form.Group className="d-flex gap-4 align-items-center">
        <FormCheck
          value={subQuestion.qid}
          type={'checkbox'}
          checked={isChecked}
          name={`${subQuestion.qid}-multiple-choice-checkbox`}
... (36 lines truncated)
</file>

<file path="editor/src/components/QuestionTypes/MultipleChoice/MultipleChoiceImageSubquestion.js">
import React from 'react'
import { ImageChoice } from '../ImageChoice'
export const MultipleChoiceImageSubquestion = ({
  index,
  isFocused,
  subQuestion,
  update,
  value,
  subquestionErrors,
  setSubquestionErrors,
}) => {
  return (
    <ImageChoice
      index={index}
      inputType="checkbox"
      isFocused={isFocused}
      idPrefix="q"
      id={subQuestion?.qid}
      update={update}
      value={value}
      errors={subquestionErrors}
      setErrors={setSubquestionErrors}
    />
  )
}
</file>

<file path="editor/src/components/QuestionTypes/MultipleChoice/MultipleChoiceNumericalSlider.js">
import classNames from 'classnames'
import { InputRange } from 'components/UIComponents'
import { getStringPartsUsingSeperator, getAttributeValue } from 'helpers'
import React from 'react'
import { Direction } from 'react-range'
const MultipleChoiceNumericalSlider = ({
  attributes,
  text,
  defaultValue,
  onChange,
  participantMode = false,
}) => {
  const {
    slider_orientation,
    slider_min,
    slider_max,
    slider_accuracy,
    slider_reversed,
    slider_middlestart,
    slider_showminmax,
    slider_separator,
    slider_default,
    slider_default_set,
    slider_handle,
    slider_custom_handle,
  } = attributes
  const orientationValue = getAttributeValue(slider_orientation) ?? '0'
  const isOrientationReversed = getAttributeValue(slider_reversed) === '1'
  const isOrientationHorizontal = orientationValue === '0'
  const orientation = isOrientationHorizontal
... (76 lines truncated)
</file>

<file path="editor/src/components/QuestionTypes/MultipleChoice/MultipleChoiceNumericalSubquestion.js">
import React from 'react'
import { Form } from 'react-bootstrap'
import { filterToNumericOrEmpty, L10ns } from 'helpers'
import MultipleChoiceNumericalSlider from './MultipleChoiceNumericalSlider'
export const MultipleChoiceNumericalSubquestion = ({
  onChange,
  attributes,
  childrenInfo,
  language,
  child,
  hasSliderLayout = false,
  valueInfo = {},
  participantMode = false,
}) => {
  const handleOnChange = (event) => {
    const newValue = filterToNumericOrEmpty(event.target.value)
    if (onChange) {
      onChange(newValue)
    }
  }
  if (hasSliderLayout) {
    return (
      <MultipleChoiceNumericalSlider
        attributes={attributes}
        text={L10ns({
          prop: childrenInfo.titleKey,
          language,
          l10ns: child.l10ns,
        })}
        defaultValue={valueInfo?.value}
... (24 lines truncated)
</file>

<file path="editor/src/components/QuestionTypes/MultipleChoice/MultipleChoiceShortTextSubquestion.js">
import { ContentEditor, Input } from 'components/UIComponents'
import { Form } from 'react-bootstrap'
export const MultipleChoiceShortTextSubquestion = ({
  index,
  handleUpdateSubquestion,
  value,
}) => {
  return (
    <div className="w-100">
      <Form.Group className="d-flex w-100 gap-3 align-items-center">
        <Form.Label
          style={{ minWidth: 'fit-content' }}
          className="multi-choice-content-editor m-0"
        >
          <ContentEditor
            disabled={true}
            value={value}
            className="multi-choice-content-editor choice"
          />
        </Form.Label>
        <Input
          className="w-100"
          placeholder={st('Enter your comment here.')}
          dataTestId={'multiple-choice-comment-input'}
          onChange={(e) => handleUpdateSubquestion(e.target.value, index, true)}
        />
      </Form.Group>
    </div>
  )
}
... (1 lines truncated)
</file>

<file path="editor/src/components/QuestionTypes/MultipleChoice/MultipleChoiceSubquestion.js">
import { useState } from 'react'
import { Direction } from 'react-range'
import classNames from 'classnames'
import { CloseCircleFillIcon, DragIcon } from 'components/icons'
import { ContentEditor } from 'components/UIComponents'
import { getQuestionTypeInfo } from '../getQuestionTypeInfo'
import { L10ns, getAttributeValue } from 'helpers'
import { MultipleChoiceButtonSubquestion } from './MultipleChoiceButtonSubquestion'
import { MultipleChoiceCheckboxSubquestion } from './MultipleChoiceCheckboxSubquestion'
import { MultipleChoiceImageSubquestion } from './MultipleChoiceImageSubquestion'
import { MultipleChoiceShortTextSubquestion } from './MultipleChoiceShortTextSubquestion'
import { MultipleChoiceNumericalSubquestion } from './MultipleChoiceNumericalSubquestion'
export const MultipleChoiceSubquestion = ({
  index,
  subQuestion,
  questionThemeName,
  handleUpdateSubquestion,
  handleRemovingSubquestions,
  provided = {},
  isFocused = false,
  language,
  isSurveyActive,
  onKeyDown,
  attributes: {
    slider_layout,
    sliderOrientation = Direction.Right,
    form_field_text = {},
    commented_checkbox = {},
  } = {},
}) => {
... (124 lines truncated)
</file>

<file path="editor/src/components/QuestionTypes/QuestionModes/OptionQuestionEditMode.js">
import { Button } from 'react-bootstrap'
import { useParams } from 'react-router-dom'
import { Draggable } from 'react-beautiful-dnd'
import { PlusLg } from 'react-bootstrap-icons'
import classNames from 'classnames'
import { useAppState, useSurvey, useChildKeyboardShortcuts } from 'hooks'
import { Entities, hasTempId, L10ns, STATES } from 'helpers'
import { getTooltipMessages } from 'helpers/options'
import { ContentEditor, DragAndDrop, TooltipContainer } from 'components'
import { CloseCircleFillIcon, DragIcon } from 'components/icons'
import { ImageChoice } from 'components/QuestionTypes/ImageChoice'
import { getQuestionTypeInfo } from '../getQuestionTypeInfo'
import { singleChoiceThemes } from '../singleChoiceThemes'
import { SubquestionCodeInput } from '../subquestionCodeComponents'
import { AssessmentValueInput } from '../AssessmentValueInput'
const imageThemeComponents = [
  getQuestionTypeInfo().SINGLE_CHOICE_IMAGE_SELECT.theme,
  getQuestionTypeInfo().MULTIPLE_CHOICE_IMAGE_SELECT.theme,
]
export const OptionQuestionEditMode = ({
  question: { questionThemeName, showAssessmentValue } = {},
  handleChildLUpdate,
  isFocused,
  handleChildAdd,
  handleOnChildDragEnd,
  handleChildDelete,
  language,
  handleChildCodeUpdate,
  handleChildAssessmentValueUpdate,
  _children = [],
... (177 lines truncated)
</file>

<file path="editor/src/components/QuestionTypes/QuestionModes/OptionQuestionViewMode.js">
import { useEffect, useMemo, useState } from 'react'
import {
  Entities,
  getStringPartsUsingSeperator,
  getAttributeValue,
  isTrue,
  L10ns,
  OTHER_CODE,
} from 'helpers'
import {
  Button,
  ContentEditor,
  contentEditorName,
  FormCheck,
  Input,
  Select,
  selectName,
} from 'components'
import { ImageChoice } from 'components/QuestionTypes/ImageChoice'
import { getQuestionTypeInfo } from '../getQuestionTypeInfo'
import { getNotSupportedQuestionTypeInfo } from '../getNotSupportedQuestionTypeInfo'
import { getCommentedCheckboxOptions } from 'helpers/options'
import { MultipleChoiceNumericalSubquestion } from '../MultipleChoice/MultipleChoiceNumericalSubquestion'
import { cloneDeep } from 'lodash'
import { singleChoiceThemes } from '../singleChoiceThemes'
const dropdownThemeComponents = [
  getQuestionTypeInfo().SINGLE_CHOICE_DROPDOWN.theme,
  getNotSupportedQuestionTypeInfo().LANGUAGE_SWITCH.theme,
  getNotSupportedQuestionTypeInfo().LIST_DROPDOWN_DEFAULT.theme,
]
... (505 lines truncated)
</file>

<file path="editor/src/components/QuestionTypes/RankingAdvancedQuestion/RankingAdvancedQuestion.js">
import { DragDropContext, Droppable } from 'react-beautiful-dnd'
import classNames from 'classnames'
import { PlusLg } from 'react-bootstrap-icons'
import { Button } from 'react-bootstrap'
import { useState } from 'react'
import { cloneDeep } from 'lodash'
import {
  Entities,
  getInfoFromObjectByIndex,
  getTooltipMessages,
  STATES,
  Toast,
} from 'helpers'
import { useAppState } from 'hooks'
import { TooltipContainer } from 'components'
import { RankingAdvancedQuestionSubquestionsPlaceholder } from './RankingAdvancedQuestionSubquestionsPlaceholder'
import { RankingAdvancedQuestionSubquestions } from './RankingAdvancedQuestionSubquestions'
import { findFieldname } from 'components/ConditionDesigner/handlers/previousQuestions/utils'
const SUBQUESTIONS_DROPPALE_ID = 'ranking-advanced-subquestions'
const PLACEHOLDERS_DROPPALE_ID = 'ranking-advanced-placeholders'
export const RankingAdvancedQuestion = ({
  question: { subquestions: rankingSubquestions = [], qid } = {},
  isFocused,
  handleChildLUpdate,
  handleChildAdd,
  handleChildDelete,
  handleOnChildDragEnd,
  values = [],
  participantMode,
  language,
... (153 lines truncated)
</file>

<file path="editor/src/components/QuestionTypes/RankingAdvancedQuestion/RankingAdvancedQuestionSubquestions.js">
import { useEffect, useRef } from 'react'
import { Draggable } from 'react-beautiful-dnd'
import classNames from 'classnames'
import { SubquestionCodeInput } from '../subquestionCodeComponents'
import { useSurvey, useAppState } from 'hooks'
import { Entities, hasTempId, STATES } from 'helpers'
import { useParams } from 'react-router-dom'
import { ContentEditor } from 'components/UIComponents'
import { CloseCircleFillIcon, DragIcon } from 'components/icons'
import { L10ns } from 'helpers'
export const RankingAdvancedQuestionSubquestions = ({
  handleSubquestionUpdate = () => {},
  handleRemoveSubquestion = () => {},
  isFocused,
  setSubQuestionsHeight,
  subquestions = [],
  qid,
  language,
  handleCodeUpdate,
  isTitleFocused,
}) => {
  const subquestionsRef = useRef(null)
  const { surveyId } = useParams()
  const { survey } = useSurvey(surveyId)
  const [isSurveyActive] = useAppState(STATES.IS_SURVEY_ACTIVE)
  useEffect(() => {
    if (!setSubQuestionsHeight) {
      return
    }
    const subquestionsHeight = []
... (122 lines truncated)
</file>

<file path="editor/src/components/QuestionTypes/RankingAdvancedQuestion/RankingAdvancedQuestionSubquestionsPlaceholder.js">
import { Droppable } from 'react-beautiful-dnd'
import { CloseCircleFillIcon } from 'components/icons'
import { ContentEditor } from 'components/UIComponents'
import classNames from 'classnames'
export const RankingAdvancedQuestionSubquestionsPlaceholder = ({
  subquestions,
  subquestionsHeight = [],
  subquestionsValue = [],
  clearSubquestion,
}) => {
  return (
    <div>
      {subquestions.map((subquestion, index) => {
        const subquestionInfo = subquestionsValue[index]
        const hasValue = !!subquestionInfo?.value
        const subquestionTitle = subquestionInfo?.subquestionTitle
        return (
          <Droppable
            key={`ranked-advanced-placeholder-${subquestion.parentQid}-${index}`}
            droppableId={`${index}`}
            index={`ranked-advanced-placeholder-${index}`}
          >
            {(provided, snapshot) => (
              <div
                data-index={index}
                ref={provided.innerRef}
                {...provided.draggableProps}
              >
                <div className="position-relative subquestion-item-placeholder p-1 d-flex align-items-center">
                  <div
... (35 lines truncated)
</file>

<file path="editor/src/components/QuestionTypes/RankingQuestion/RankingQuestion.js">
import { Entities } from 'helpers'
import { RankingQuestionSubquestions } from './RankingQuestionSubquestions'
export const RankingQuestion = ({
  question: { subquestions = [] } = {},
  question = {},
  handleUpdate = () => {},
  isFocused,
  handleChildLUpdate,
  handleChildAdd,
  handleChildDelete,
  handleOnChildDragEnd,
  handleChildCodeUpdate,
}) => {
  const handleSubquestionUpdate = (value, index) => {
    handleChildLUpdate(value, index, subquestions, Entities.subquestion)
  }
  const handleOnDragEnd = (dropResult) => {
    handleOnChildDragEnd(dropResult, subquestions, Entities.subquestion)
  }
  const handleRemovingSubquestions = (subquestionId) => {
    handleChildDelete(subquestionId, subquestions, Entities.subquestion)
  }
  return (
    <div data-testid="ranking-question">
      <RankingQuestionSubquestions
        isFocused={isFocused}
        handleChildAdd={handleChildAdd}
        handleSubquestionUpdate={handleSubquestionUpdate}
        handleUpdate={handleUpdate}
        question={question}
... (8 lines truncated)
</file>

<file path="editor/src/components/QuestionTypes/RankingQuestion/RankingQuestionSubquestion.js">
import classNames from 'classnames'
import { isString } from 'lodash'
import { EditableImage } from 'components/EditableImage/EditableImage'
import { ContentEditor, DropZone } from 'components/UIComponents'
import { CloseCircleFillIcon, DragIcon } from 'components/icons'
import { useParams } from 'react-router-dom'
import { useSurvey, useAppState } from 'hooks'
import { STATES } from 'helpers'
import { SubquestionCodeInput } from '../subquestionCodeComponents'
export const RankingQuestionSubquestion = ({
  subquestion,
  qid,
  onChange = () => {},
  isFocused,
  provided = {},
  handleRemovingSubquestions,
  handleCodeUpdate,
  index,
  title,
}) => {
  const { surveyId } = useParams()
  const { survey } = useSurvey(surveyId)
  const [isSurveyActive] = useAppState(STATES.IS_SURVEY_ACTIVE)
  const handleSubquestionUpdate = (value) => {
    onChange(value)
  }
  return (
    <div className="d-flex align-items-center position-relative remove-option-button-parent">
      <div
        className={classNames('cursor-pointer remove-option-button me-1', {
... (58 lines truncated)
</file>

<file path="editor/src/components/QuestionTypes/RankingQuestion/RankingQuestionSubquestions.js">
import { Button } from 'react-bootstrap'
import { PlusLg } from 'react-bootstrap-icons'
import classNames from 'classnames'
import { RankingQuestionSubquestion } from './RankingQuestionSubquestion'
import { DragAndDrop } from 'components/UIComponents'
import { Draggable } from 'react-beautiful-dnd'
import { Entities, L10ns, STATES } from 'helpers'
import { useAppState } from 'hooks'
export const RankingQuestionSubquestions = ({
  question: { subquestions = [] } = {},
  isFocused,
  handleChildAdd,
  handleSubquestionUpdate,
  handleOnDragEnd,
  handleRemovingSubquestions,
  handleChildCodeUpdate,
}) => {
  const [activeLanguage] = useAppState(STATES.ACTIVE_LANGUAGE)
  const getSubquestionStyle = (draggableStyle) => ({
    userSelect: 'none',
    margin: `0 0 8px 0`,
    ...draggableStyle,
  })
  return (
    <>
      {isFocused && (
        <div className="mb-4">
          <h5>{t('You can add texts or upload images')}</h5>
        </div>
      )}
... (63 lines truncated)
</file>

<file path="editor/src/components/QuestionTypes/RatingQuestion/RatingQuestion.js">
import { useState } from 'react'
import { Form } from 'react-bootstrap'
import classNames from 'classnames'
import { StarIcon } from 'components/icons/StarIcon'
export const RatingQuestion = ({ question, handleUpdate }) => {
  const answers = question && question.answers ? question.answers[0] : []
  const [hoveredValue, setHoveredValue] = useState(-1)
  const handleOnMouseHover = (idx) => {
    setHoveredValue(idx)
  }
  const handleOnClick = (idx) => {
    const updatedQuestionAnswers = { ...answers, value: idx }
    handleUpdate({
      answers: [updatedQuestionAnswers],
    })
  }
  return (
    <div className="start-rating-question" data-testid="rating-question">
      <Form className="py-2">
        <div className="flex-wrap question-body-content d-flex">
          {Array(parseInt(question?.attributes?.items_count?.['']?.value) || 5)
            .fill('-')
            .map((_, idx) => (
              <div
                onMouseOver={() => handleOnMouseHover(idx)}
                onMouseLeave={() => handleOnMouseHover(-1)}
                onClick={() => handleOnClick(idx)}
                className={classNames('me-3')}
                key={`${question?.qid}-rating-question-${idx}`}
                data-testid="rate-question-star-div"
... (28 lines truncated)
</file>

<file path="editor/src/components/QuestionTypes/stories/Arrays.stories.js">
import { mockQuestionType } from 'sbook/helpers/fixtures/mockQuestionType'
import { QuestionPreview } from 'sbook/helpers/fixtures/QuestionPreview'
import { getQuestionTypeInfo } from '../getQuestionTypeInfo'
export default {
  title: 'QuestionTypes/Arrays',
}
const pointChoiceQuestion = mockQuestionType(getQuestionTypeInfo().ARRAY)
export const PointChoice = () => {
  return <QuestionPreview question={pointChoiceQuestion} />
}
const numbersQuestion = mockQuestionType(getQuestionTypeInfo().ARRAY_NUMBERS)
export const Numbers = () => {
  return <QuestionPreview question={numbersQuestion} />
}
const textsQuestion = mockQuestionType(getQuestionTypeInfo().ARRAY_TEXT)
export const Texts = () => {
  return <QuestionPreview question={textsQuestion} />
}
const arrayByColumnQuestion = mockQuestionType(
  getQuestionTypeInfo().ARRAY_COLUMN
)
export const ArrayByColumn = () => {
  return <QuestionPreview question={arrayByColumnQuestion} />
}
const arrayDualScaleQuestion = mockQuestionType(
  getQuestionTypeInfo().ARRAY_DUAL_SCALE
)
export const ArrayDualScale = () => {
  return <QuestionPreview question={arrayDualScaleQuestion} />
}
... (1 lines truncated)
</file>

<file path="editor/src/components/QuestionTypes/stories/Mask.stories.js">
import { getQuestionTypeInfo } from '../getQuestionTypeInfo'
import { mockQuestionType } from 'sbook/helpers/fixtures/mockQuestionType'
import { QuestionPreview } from 'sbook/helpers/fixtures/QuestionPreview'
import { mockQuestionTypeWithSettings } from '../../../sbook/helpers/fixtures/mockQuestionTypeWithSettings'
export default {
  title: 'QuestionTypes/Mask',
}
const equationQuestion = mockQuestionType(getQuestionTypeInfo().EQUATION)
export const Equation = () => {
  return <QuestionPreview question={equationQuestion} />
}
const fileUploadQuestion = mockQuestionType(getQuestionTypeInfo().FILE_UPLOAD)
export const FileUpload = () => {
  return <QuestionPreview question={fileUploadQuestion} />
}
const genderQuestion = mockQuestionTypeWithSettings(
  getQuestionTypeInfo().GENDER
)
export const Gender = () => {
  return (
    <QuestionPreview
      question={genderQuestion}
      surveySettings={genderQuestion.surveySettings}
    />
  )
}
const multipleNumericalInputsQuestion = mockQuestionType(
  getQuestionTypeInfo().MULTIPLE_NUMERICAL_INPUTS
)
export const MultipleNumericalInput = () => {
... (33 lines truncated)
</file>

<file path="editor/src/components/QuestionTypes/stories/MultipleChoice.stories.js">
import { getQuestionTypeInfo } from '../getQuestionTypeInfo'
import { mockQuestionType } from 'sbook/helpers/fixtures/mockQuestionType'
import { QuestionPreview } from 'sbook/helpers/fixtures/QuestionPreview'
export default {
  title: 'QuestionTypes/MultipleChoice',
}
const checkboxQuestion = mockQuestionType(getQuestionTypeInfo().MULTIPLE_CHOICE)
export const Checkbox = () => {
  return <QuestionPreview question={checkboxQuestion} />
}
const withCommentsQuestion = mockQuestionType(
  getQuestionTypeInfo().MULTIPLE_CHOICE_WITH_COMMENTS
)
export const WithComments = () => {
  return <QuestionPreview question={withCommentsQuestion} />
}
const buttonsQuestion = mockQuestionType(
  getQuestionTypeInfo().MULTIPLE_CHOICE_BUTTONS
)
export const Buttons = () => {
  return <QuestionPreview question={buttonsQuestion} />
}
const imageSelectQuestion = mockQuestionType(
  getQuestionTypeInfo().MULTIPLE_CHOICE_IMAGE_SELECT
)
export const ImageSelect = () => {
  return <QuestionPreview question={imageSelectQuestion} />
}
</file>

<file path="editor/src/components/QuestionTypes/stories/SingleChoice.stories.js">
import { getQuestionTypeInfo } from '../getQuestionTypeInfo'
import { QuestionPreview } from 'sbook/helpers/fixtures/QuestionPreview'
import { mockQuestionTypeWithSettings } from '../../../sbook/helpers/fixtures/mockQuestionTypeWithSettings'
export default {
  title: 'QuestionTypes/SingleChoice',
}
const radioListQuestion = mockQuestionTypeWithSettings(
  getQuestionTypeInfo().SINGLE_CHOICE_LIST_RADIO
)
export const RadioList = () => {
  return (
    <QuestionPreview
      question={radioListQuestion}
      surveySettings={radioListQuestion.surveySettings}
    />
  )
}
const radioListWithCommentsQuestion = mockQuestionTypeWithSettings(
  getQuestionTypeInfo().SINGLE_CHOICE_LIST_RADIO_WITH_COMMENT
)
export const RadioListWithComments = () => {
  return (
    <QuestionPreview
      question={radioListWithCommentsQuestion}
      surveySettings={radioListWithCommentsQuestion.surveySettings}
    />
  )
}
const dropdownQuestion = mockQuestionTypeWithSettings(
  getQuestionTypeInfo().SINGLE_CHOICE_DROPDOWN
... (43 lines truncated)
</file>

<file path="editor/src/components/QuestionTypes/stories/Text.stories.js">
import { getQuestionTypeInfo } from '../getQuestionTypeInfo'
import { QuestionPreview } from 'sbook/helpers/fixtures/QuestionPreview'
import { mockQuestionType } from 'sbook/helpers/fixtures/mockQuestionType'
export default {
  title: 'QuestionTypes/Text',
}
const shortTextQuestion = mockQuestionType(getQuestionTypeInfo().SHORT_TEXT, {
  image: '',
})
export const ShortText = () => {
  return <QuestionPreview question={shortTextQuestion} />
}
const longTextQuestion = mockQuestionType(getQuestionTypeInfo().LONG_TEXT)
export const LongText = () => {
  return <QuestionPreview question={longTextQuestion} />
}
const multipleShortTextQuestion = mockQuestionType(
  getQuestionTypeInfo().MULTIPLE_SHORT_TEXTS
)
export const MultipleShortTexts = () => {
  return <QuestionPreview question={multipleShortTextQuestion} />
}
</file>

<file path="editor/src/components/QuestionTypes/TextQuestion/BrowserDetectionTextAnswer.js">
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
import { Form } from 'react-bootstrap'
import Bowser from 'bowser'
import {
  MapContainer,
  TileLayer,
  Popup,
  Marker as LeafLetMarker,
  useMap,
  useMapEvents,
} from 'react-leaflet'
import L from 'leaflet'
import { ContentEditor } from 'components/UIComponents'
import { getAttributeValue } from 'helpers'
import './TextQuestion.scss'
const DEFAULT_CENTER = [53.61422133647984, 9.972816890552014]
const LeafletMapComponent = ({ value, onChange }) => {
  const customIcon = new L.Icon({
    iconUrl: 'https://unpkg.com/leaflet@1.5.1/dist/images/marker-icon.png',
    iconSize: [25, 41],
    iconAnchor: [12, 41],
    popupAnchor: [0, -41],
  })
  const initialPosition = useMemo(() => {
    const coords = value?.split(';').map(Number)
    return coords?.length === 2 && coords.every((n) => !Number.isNaN(n))
      ? coords
      : DEFAULT_CENTER
  }, [value])
  const [position, setPosition] = useState(initialPosition)
... (112 lines truncated)
</file>

<file path="editor/src/components/QuestionTypes/TextQuestion/BrowserDetectionTextAnswer.test.js">
import React from 'react'
import { render, screen } from '@testing-library/react'
import { BrowserDetectionTextAnswer } from './BrowserDetectionTextAnswer'
let capturedMapEvents = {}
let capturedMarkerProps = {}
jest.mock('leaflet', () => ({
  __esModule: true,
  default: {
    Icon: class {
      constructor(options) {
        this.options = options
      }
    },
  },
}))
jest.mock('react-leaflet', () => {
  const ReactMock = require('react')
  return {
    __esModule: true,
    MapContainer: ({ children, center }) => (
      <div data-testid="map" data-center={JSON.stringify(center)}>
        {children}
      </div>
    ),
    TileLayer: () => <div data-testid="tile-layer" />,
    Popup: ({ children }) => <div data-testid="popup">{children}</div>,
    Marker: ReactMock.forwardRef((props, ref) => {
      capturedMarkerProps = props
      if (ref) {
        ref.current = { getLatLng: () => ({ lat: 10.5, lng: 20.25 }) }
... (74 lines truncated)
</file>

<file path="editor/src/components/QuestionTypes/TextQuestion/LongTextAnswer.js">
import { Form } from 'react-bootstrap'
import { getAttributeValue } from 'helpers'
import './TextQuestion.scss'
export const LongTextAnswer = ({ attributes = {}, value, onValueChange }) => {
  const maxChars = getAttributeValue(attributes.maximum_chars)
  return (
    <Form.Control
      onClick={(e) => {
        e.stopPropagation()
      }}
      placeholder={st('Enter your answer here.')}
      as="textarea"
      type="textarea"
      role="textarea"
      rows={4}
      maxLength={maxChars ? maxChars : Infinity}
      data-testid="text-question-answer-input"
      className="long-text-answer"
      defaultValue={value}
      onChange={(event) => onValueChange(event.target.value)}
    />
  )
}
</file>

<file path="editor/src/components/QuestionTypes/TextQuestion/NumericAnswer.js">
import { Form } from 'react-bootstrap'
import './TextQuestion.scss'
import { filterToNumericOrEmpty } from 'helpers'
export const NumericAnswer = ({ value, onValueChange }) => {
  return (
    <div className={'question-body-content'}>
      <div className="d-flex gap-2 align-items-center justify-content-center">
        <Form.Group className="flex-grow-1">
          <Form.Control
            type={'text'}
            placeholder={st('Enter your answer here.')}
            data-testid="text-question-answer-input"
            defaultValue={value}
            onChange={(event) =>
              onValueChange(filterToNumericOrEmpty(event.target.value))
            }
          />
        </Form.Group>
      </div>
    </div>
  )
}
</file>

<file path="editor/src/components/QuestionTypes/TextQuestion/ShortTextAnswer.js">
import { Form } from 'react-bootstrap'
import { filterToNumericOrEmpty, getAttributeValue, isTrue } from 'helpers'
import './TextQuestion.scss'
export const ShortTextAnswer = ({
  attributes = {},
  value = '',
  language = 'en',
  onValueChange,
}) => {
  const maxChars = getAttributeValue(attributes.maximum_chars)
  const numbersOnly = isTrue(
    getAttributeValue(attributes.numbers_only, language)
  )
  const onKeyDown = (event) => {
    const inputValue = event.target.value
    if (
      maxChars &&
      event.key !== 'Backspace' &&
      inputValue.length >= maxChars
    ) {
      event.preventDefault()
    }
    if (maxChars && inputValue.length > maxChars) {
      event.target.value = ''
    }
  }
  return (
    <div className={'question-body-content'}>
      <div className="d-flex gap-2 align-items-center justify-content-center">
        <Form.Group className="flex-grow-1">
... (20 lines truncated)
</file>

<file path="editor/src/components/QuestionTypes/TextQuestion/TextDisplay.js">
export const TextDisplay = () => {
  return <></>
}
</file>

<file path="editor/src/components/QuestionTypes/TextQuestion/TextQuestion.js">
import {
  getNotSupportedQuestionTypeInfo,
  getQuestionTypeInfo,
} from '../../QuestionTypes'
import './TextQuestion.scss'
import { LongTextAnswer } from './LongTextAnswer'
import { ShortTextAnswer } from './ShortTextAnswer'
import { NumericAnswer } from './NumericAnswer'
import { BrowserDetectionTextAnswer } from './BrowserDetectionTextAnswer'
export const TextQuestion = ({
  question: { questionThemeName, attributes },
  values = [],
  onValueChange = () => {},
}) => {
  const value = values?.[0] || {}
  const handleOnChange = (newValue) => {
    onValueChange(newValue, value.key)
  }
  return (
    <div className={'question-body-content'}>
      {questionThemeName === getQuestionTypeInfo().NUMERIC.theme && (
        <NumericAnswer value={value.value} onValueChange={handleOnChange} />
      )}
      {(questionThemeName === getQuestionTypeInfo().LONG_TEXT.theme ||
        questionThemeName ===
          getNotSupportedQuestionTypeInfo().HUGE_FREE_TEXT.theme) && (
        <LongTextAnswer
          attributes={attributes}
          value={value.value}
          onValueChange={handleOnChange}
... (20 lines truncated)
</file>

<file path="editor/src/components/QuestionTypes/Utils/index.js">
export * from './isQuestionWithAnswers'
export * from './isQuestionWithSubquestions'
</file>

<file path="editor/src/components/QuestionTypes/Utils/isQuestionWithAnswers.js">
import { getQuestionTypeInfo } from '../getQuestionTypeInfo'
import { getNotSupportedQuestionTypeInfo } from '../getNotSupportedQuestionTypeInfo'
const questionTypeInfo = getQuestionTypeInfo()
const notSupportedQuestionTypeInfo = getNotSupportedQuestionTypeInfo()
const answersThemes = [
  questionTypeInfo.SINGLE_CHOICE_BUTTONS.theme,
  questionTypeInfo.SINGLE_CHOICE_DROPDOWN.theme,
  questionTypeInfo.SINGLE_CHOICE_FIVE_POINT_CHOICE.theme,
  questionTypeInfo.SINGLE_CHOICE_IMAGE_SELECT.theme,
  questionTypeInfo.SINGLE_CHOICE_LIST_RADIO.theme,
  questionTypeInfo.SINGLE_CHOICE_LIST_RADIO_WITH_COMMENT.theme,
  notSupportedQuestionTypeInfo.LIST_DROPDOWN_DEFAULT.theme,
]
export const isQuestionWithAnswers = (questionThemeName) => {
  return answersThemes.includes(questionThemeName)
}
</file>

<file path="editor/src/components/QuestionTypes/Utils/isQuestionWithSubquestions.js">
import { getQuestionTypeInfo } from '../getQuestionTypeInfo'
const questionTypeInfo = getQuestionTypeInfo()
const subquestionsThemes = [
  questionTypeInfo.MULTIPLE_CHOICE.theme,
  questionTypeInfo.MULTIPLE_CHOICE_BUTTONS.theme,
  questionTypeInfo.MULTIPLE_CHOICE_WITH_COMMENTS.theme,
  questionTypeInfo.MULTIPLE_CHOICE_IMAGE_SELECT.theme,
  questionTypeInfo.MULTIPLE_NUMERICAL_INPUTS.theme,
  questionTypeInfo.MULTIPLE_SHORT_TEXTS.theme,
]
export const isQuestionWithSubquestions = (questionThemeName) => {
  return subquestionsThemes.includes(questionThemeName)
}
</file>

<file path="editor/src/components/QuestionTypes/YesNoQuestion/YesNoQuestion.js">
import { FormCheck } from 'react-bootstrap'
import CheckboxCircleLineIcon from 'remixicon-react/CheckboxCircleLineIcon'
import CloseCircleLineIcon from 'remixicon-react/CloseCircleLineIcon'
import CheckboxBlankCircleLineIcon from 'remixicon-react/CheckboxBlankCircleLineIcon'
import { getAttributeValue, getNoAnswerLabel, isTrue } from 'helpers'
import { getDisplayButtonTypeOptions } from 'helpers/options'
import { Button } from 'components/UIComponents'
import { useEffect, useState } from 'react'
import classNames from 'classnames'
export const YesNoQuestion = ({
  question,
  surveySettings,
  values = [],
  onValueChange = () => {},
}) => {
  const valueInfo = values?.[0] || {}
  const [currentSelectedOptionIndex, setCurrentSelectedOptionIndex] = useState(
    surveySettings.preselectNoAnswer ? 2 : -1
  )
  const options = [
    { icon: CheckboxCircleLineIcon, name: st('Yes'), value: 'Y' },
    { icon: CloseCircleLineIcon, name: st('No'), value: 'N' },
  ]
  useEffect(() => {
    const info = valueInfo.value
    let selectedIndex = surveySettings.preselectNoAnswer ? 2 : -1
    options.forEach((option, index) => {
      if (
        info === option.value &&
        (option.value !== null || surveySettings.preselectNoAnswer)
... (87 lines truncated)
</file>

<file path="editor/src/components/QuestionTypes/AssessmentValue.test.js">
import 'tests/mocks'
import { fireEvent, render, screen } from '@testing-library/react'
import userEvent from '@testing-library/user-event'
import { AssessmentValueBadge } from './AssessmentValueBadge'
import {
  AssessmentValueInput,
  normalizeAssessmentValue,
} from './AssessmentValueInput'
describe('Assessment value accessibility', () => {
  const originalTranslate = globalThis.t
  beforeAll(() => {
    globalThis.t = (text) => text
  })
  afterAll(() => {
    globalThis.t = originalTranslate
  })
  test('inputs have unique accessible names', () => {
    render(
      <>
        <AssessmentValueInput answerCode="A1" assessmentValue="1" />
        <AssessmentValueInput
          answerCode="A1"
          scaleNumber={2}
          assessmentValue="2"
        />
      </>
    )
    expect(
      screen.getByRole('textbox', {
        name: 'Assessment value for answer option A1',
... (135 lines truncated)
</file>

<file path="editor/src/components/QuestionTypes/AssessmentValueBadge.js">
import { useRef } from 'react'
import { Badge } from 'react-bootstrap'
export const AssessmentValueBadge = () => {
  const nextInputIndex = useRef(0)
  const focusNextAssessmentValueInput = (event) => {
    const inputs = event.currentTarget
      .closest('.question')
      ?.querySelectorAll('input.assessment-value-input')
    if (!inputs?.length) return
    inputs[nextInputIndex.current % inputs.length].focus()
    nextInputIndex.current = (nextInputIndex.current + 1) % inputs.length
  }
  return (
    <Badge
      as="button"
      type="button"
      bg=""
      className="assessment-value-badge"
      data-testid="assessment-value-badge"
      onClick={focusNextAssessmentValueInput}
    >
      {t('Assessment value')}
    </Badge>
  )
}
</file>

<file path="editor/src/components/QuestionTypes/AssessmentValueInput.js">
import { useRef, useEffect } from 'react'
import { format } from 'util'
const ASSESSMENT_VALUE_PATTERN = /^-?\d*$/
export const ASSESSMENT_VALUE_MAX_LENGTH = 5
const isIncompleteValue = (value) => String(value ?? '').trim() === '-'
const isAllowedInput = (value) =>
  value.length <= ASSESSMENT_VALUE_MAX_LENGTH &&
  ASSESSMENT_VALUE_PATTERN.test(value)
/**
 * Bring a typed value into the form the backend stores: empty becomes 0,
 * leading zeros and "-0" are dropped. A lone minus has no numeric meaning and
 * falls back to the given value.
 */
export const normalizeAssessmentValue = (value, fallback = '0') => {
  const stringValue = String(value ?? '').trim()
  if (stringValue === '') {
    return '0'
  }
  if (isIncompleteValue(stringValue)) {
    return fallback
  }
  const parsed = parseInt(stringValue, 10)
  return Number.isNaN(parsed) ? fallback : String(parsed)
}
const getAccessibleLabel = (answerCode, scaleNumber) =>
  scaleNumber
    ? format(
        t('Assessment value for answer option %s (scale %s)'),
        answerCode,
        scaleNumber
... (66 lines truncated)
</file>

<file path="editor/src/components/QuestionTypes/getNotSupportedQuestionTypeInfo.js">
export const getNotSupportedQuestionTypeInfo = () => {
  return {
    HUGE_FREE_TEXT: {
      type: 'U',
      theme: 'hugefreetext',
      title: t('Huge free text'),
    },
    INPUT_ON_DEMAND: {
      type: 'Q',
      theme: 'inputondemand',
      title: t('Input on demand'),
    },
    LANGUAGE_SWITCH: {
      type: 'I',
      theme: 'language',
      title: t('Language switch'),
    },
    LIST_DROPDOWN_DEFAULT: {
      type: '!',
      theme: 'list_dropdown',
      title: t('List (Dropdown)'),
    },
    ARRAY_FIVE_POINT: {
      type: 'A',
      theme: 'arrays/5point',
      title: t('Array (5 point choice)'),
    },
    ARRAY_TEN_POINT: {
      type: 'B',
      theme: 'arrays/10point',
... (15 lines truncated)
</file>

<file path="editor/src/components/QuestionTypes/getQuestionTypeInfo.js">
export const getQuestionTypeInfo = () => {
  return {
    ARRAY: {
      type: 'F',
      theme: 'arrays/array',
      title: t('Array (Point choice)'),
    },
    ARRAY_TEXT: {
      type: ';',
      theme: 'arrays/texts',
      title: t('Array (Texts)'),
    },
    ARRAY_NUMBERS: {
      type: ':',
      theme: 'arrays/multiflexi',
      title: t('Array (Numbers)'),
    },
    ARRAY_COLUMN: {
      type: 'H',
      theme: 'arrays/column',
      title: t('Array by column'),
    },
    ARRAY_DUAL_SCALE: {
      type: '1',
      theme: 'arrays/dualscale',
      title: t('Array dual scale'),
    },
    BROWSER_DETECTION: {
      type: 'S',
      theme: 'browserdetect',
... (135 lines truncated)
</file>

<file path="editor/src/components/QuestionTypes/ImageChoice.js">
import React, { useMemo, useState, useEffect } from 'react'
import { Image } from 'react-bootstrap'
import classNames from 'classnames'
import {
  isTempId,
  IMAGE_PREVIEW_HEIGHT,
  getNoAnswerLabel,
  docUrls,
} from 'helpers'
import NoImageFound from 'assets/images/no-image-found.jpg'
import { ContentEditor, DropZone, FormCheck } from 'components/UIComponents'
import { useFileService } from 'hooks'
export const ImageChoice = ({
  id,
  idPrefix,
  index,
  inputType = 'checkbox',
  isFocused,
  update,
  value,
  isNoAnswer,
  groupName,
  checked = null,
  defaultChecked = false,
  errors,
  setErrors = () => {},
}) => {
  const [isLoading, setIsLoading] = useState(false)
  const { fileService } = useFileService()
  const [previewUrl, setPreviewUrl] = useState(
... (90 lines truncated)
</file>

<file path="editor/src/components/QuestionTypes/index.js">
export * from './getNotSupportedQuestionTypeInfo'
export * from './getQuestionTypeInfo'
export * from './singleChoiceThemes'
export * from './FivePointChoiceQuestion/FivePointChoiceQuestion'
export * from './TextQuestion/TextQuestion'
export * from './RatingQuestion/RatingQuestion'
export * from './MultipleChoice/MultipleChoice'
export * from './FileUpload/FileUpload'
export * from './RankingQuestion/RankingQuestion'
export * from './RankingAdvancedQuestion/RankingAdvancedQuestion'
export * from './Equation/Equation'
export * from './DateTime/DateTime'
export * from './GenderQuestion/GenderQuestion'
export * from './YesNoQuestion/YesNoQuestion'
export * from './ArrayQuestion/ArrayQuestion'
export * from './QuestionModes/OptionQuestionEditMode'
export * from './QuestionModes/OptionQuestionViewMode'
export * from './TextQuestion/TextDisplay'
export * from './Utils/index'
export * from './questionViewComponents'
export * from './questionEditComponents'
</file>

<file path="editor/src/components/QuestionTypes/NoAnswerPreselection.test.js">
import 'tests/mocks'
import { useState } from 'react'
import { screen } from '@testing-library/react'
import userEvent from '@testing-library/user-event'
import { renderWithProviders } from 'tests/testUtils'
import { FivePointChoiceQuestion } from './FivePointChoiceQuestion/FivePointChoiceQuestion'
import { GenderQuestion } from './GenderQuestion/GenderQuestion'
import { OptionQuestionViewMode } from './QuestionModes/OptionQuestionViewMode'
import { YesNoQuestion } from './YesNoQuestion/YesNoQuestion'
import { getQuestionTypeInfo } from './getQuestionTypeInfo'
const question = { qid: 1, mandatory: false }
const PreselectionHarness = ({ QuestionComponent, componentProps }) => {
  const [preselectNoAnswer, setPreselectNoAnswer] = useState(false)
  return (
    <>
      <button onClick={() => setPreselectNoAnswer(true)}>
        Enable preselection
      </button>
      <QuestionComponent
        {...componentProps}
        surveySettings={{ showNoAnswer: true, preselectNoAnswer }}
      />
    </>
  )
}
describe('No answer preselection', () => {
  test('shows No answer without selecting it when preselection is disabled', async () => {
    await renderWithProviders(
      <FivePointChoiceQuestion
        question={question}
... (131 lines truncated)
</file>

<file path="editor/src/components/QuestionTypes/questionEditComponents.js">
import { getQuestionTypeInfo } from './getQuestionTypeInfo'
import { FivePointChoiceQuestion } from './FivePointChoiceQuestion/FivePointChoiceQuestion'
import { TextQuestion } from './TextQuestion/TextQuestion'
import { RatingQuestion } from './RatingQuestion/RatingQuestion'
import { FileUpload } from './FileUpload/FileUpload'
import { RankingQuestion } from './RankingQuestion/RankingQuestion'
import { RankingAdvancedQuestion } from './RankingAdvancedQuestion/RankingAdvancedQuestion'
import { Equation } from './Equation/Equation'
import { DateTime } from './DateTime/DateTime'
import { GenderQuestion } from './GenderQuestion/GenderQuestion'
import { YesNoQuestion } from './YesNoQuestion/YesNoQuestion'
import { ArrayQuestion } from './ArrayQuestion/ArrayQuestion'
import { OptionQuestionEditMode } from './QuestionModes/OptionQuestionEditMode'
import { TextDisplay } from './TextQuestion/TextDisplay'
export const questionEditComponents = {
  [getQuestionTypeInfo().SINGLE_CHOICE_LIST_RADIO.theme]:
    OptionQuestionEditMode,
  [getQuestionTypeInfo().SINGLE_CHOICE_LIST_RADIO_WITH_COMMENT.theme]:
    OptionQuestionEditMode,
  [getQuestionTypeInfo().SINGLE_CHOICE_DROPDOWN.theme]: OptionQuestionEditMode,
  [getQuestionTypeInfo().SINGLE_CHOICE_BUTTONS.theme]: OptionQuestionEditMode,
  [getQuestionTypeInfo().SINGLE_CHOICE_IMAGE_SELECT.theme]:
    OptionQuestionEditMode,
  [getQuestionTypeInfo().MULTIPLE_CHOICE.theme]: OptionQuestionEditMode,
  [getQuestionTypeInfo().MULTIPLE_CHOICE_WITH_COMMENTS.theme]:
    OptionQuestionEditMode,
  [getQuestionTypeInfo().MULTIPLE_CHOICE_BUTTONS.theme]: OptionQuestionEditMode,
  [getQuestionTypeInfo().MULTIPLE_CHOICE_IMAGE_SELECT.theme]:
    OptionQuestionEditMode,
  [getQuestionTypeInfo().MULTIPLE_SHORT_TEXTS.theme]: OptionQuestionEditMode,
... (24 lines truncated)
</file>

<file path="editor/src/components/QuestionTypes/questionPreviewComponents.js">
import { getQuestionTypeInfo } from './getQuestionTypeInfo'
import { getNotSupportedQuestionTypeInfo } from './getNotSupportedQuestionTypeInfo'
import { FivePointChoiceQuestion } from './FivePointChoiceQuestion/FivePointChoiceQuestion'
import { TextQuestion } from './TextQuestion/TextQuestion'
import { RatingQuestion } from './RatingQuestion/RatingQuestion'
import { FileUpload } from './FileUpload/FileUpload'
import { RankingAdvancedQuestion } from './RankingAdvancedQuestion/RankingAdvancedQuestion'
import { Equation } from './Equation/Equation'
import { GenderQuestion } from './GenderQuestion/GenderQuestion'
import { YesNoQuestion } from './YesNoQuestion/YesNoQuestion'
import { OptionQuestionViewMode } from './QuestionModes/OptionQuestionViewMode'
import { TextDisplay } from './TextQuestion/TextDisplay'
import { DateTimePickerComponent } from 'components/UIComponents/DateTimePicker/DateTimePicker'
import { ArrayParticipantMode } from 'components/QuestionsParticipantMode'
export const questionPreviewComponents = {
  [getQuestionTypeInfo().SINGLE_CHOICE_LIST_RADIO.theme]:
    OptionQuestionViewMode,
  [getQuestionTypeInfo().SINGLE_CHOICE_LIST_RADIO_WITH_COMMENT.theme]:
    OptionQuestionViewMode,
  [getQuestionTypeInfo().SINGLE_CHOICE_DROPDOWN.theme]: OptionQuestionViewMode,
  [getNotSupportedQuestionTypeInfo().LANGUAGE_SWITCH.theme]:
    OptionQuestionViewMode,
  [getNotSupportedQuestionTypeInfo().LIST_DROPDOWN_DEFAULT.theme]:
    OptionQuestionViewMode,
  [getQuestionTypeInfo().SINGLE_CHOICE_BUTTONS.theme]: OptionQuestionViewMode,
  [getQuestionTypeInfo().SINGLE_CHOICE_IMAGE_SELECT.theme]:
    OptionQuestionViewMode,
  [getQuestionTypeInfo().MULTIPLE_CHOICE.theme]: OptionQuestionViewMode,
  [getQuestionTypeInfo().MULTIPLE_CHOICE_WITH_COMMENTS.theme]:
    OptionQuestionViewMode,
... (39 lines truncated)
</file>

<file path="editor/src/components/QuestionTypes/questionViewComponents.js">
import { getQuestionTypeInfo } from './getQuestionTypeInfo'
import { FivePointChoiceQuestion } from './FivePointChoiceQuestion/FivePointChoiceQuestion'
import { TextQuestion } from './TextQuestion/TextQuestion'
import { RatingQuestion } from './RatingQuestion/RatingQuestion'
import { FileUpload } from './FileUpload/FileUpload'
import { RankingQuestion } from './RankingQuestion/RankingQuestion'
import { RankingAdvancedQuestion } from './RankingAdvancedQuestion/RankingAdvancedQuestion'
import { Equation } from './Equation/Equation'
import { DateTime } from './DateTime/DateTime'
import { GenderQuestion } from './GenderQuestion/GenderQuestion'
import { YesNoQuestion } from './YesNoQuestion/YesNoQuestion'
import { ArrayQuestion } from './ArrayQuestion/ArrayQuestion'
import { OptionQuestionViewMode } from './QuestionModes/OptionQuestionViewMode'
import { TextDisplay } from './TextQuestion/TextDisplay'
export const questionViewComponents = {
  [getQuestionTypeInfo().SINGLE_CHOICE_LIST_RADIO.theme]:
    OptionQuestionViewMode,
  [getQuestionTypeInfo().SINGLE_CHOICE_LIST_RADIO_WITH_COMMENT.theme]:
    OptionQuestionViewMode,
  [getQuestionTypeInfo().SINGLE_CHOICE_DROPDOWN.theme]: OptionQuestionViewMode,
  [getQuestionTypeInfo().SINGLE_CHOICE_BUTTONS.theme]: OptionQuestionViewMode,
  [getQuestionTypeInfo().SINGLE_CHOICE_IMAGE_SELECT.theme]:
    OptionQuestionViewMode,
  [getQuestionTypeInfo().MULTIPLE_CHOICE.theme]: OptionQuestionViewMode,
  [getQuestionTypeInfo().MULTIPLE_CHOICE_WITH_COMMENTS.theme]:
    OptionQuestionViewMode,
  [getQuestionTypeInfo().MULTIPLE_CHOICE_BUTTONS.theme]: OptionQuestionViewMode,
  [getQuestionTypeInfo().MULTIPLE_CHOICE_IMAGE_SELECT.theme]:
    OptionQuestionViewMode,
  [getQuestionTypeInfo().MULTIPLE_SHORT_TEXTS.theme]: OptionQuestionViewMode,
... (24 lines truncated)
</file>

<file path="editor/src/components/QuestionTypes/singleChoiceThemes.js">
import { getQuestionTypeInfo } from './getQuestionTypeInfo'
import { getNotSupportedQuestionTypeInfo } from './getNotSupportedQuestionTypeInfo'
export const singleChoiceThemes = [
  getQuestionTypeInfo().SINGLE_CHOICE_LIST_RADIO.theme,
  getQuestionTypeInfo().SINGLE_CHOICE_LIST_RADIO_WITH_COMMENT.theme,
  getQuestionTypeInfo().SINGLE_CHOICE_DROPDOWN.theme,
  getQuestionTypeInfo().SINGLE_CHOICE_BUTTONS.theme,
  getQuestionTypeInfo().SINGLE_CHOICE_IMAGE_SELECT.theme,
  getNotSupportedQuestionTypeInfo().LANGUAGE_SWITCH.theme,
  getNotSupportedQuestionTypeInfo().LIST_DROPDOWN_DEFAULT.theme,
]
</file>

<file path="editor/src/components/QuestionTypes/SubquestionCode.test.js">
import 'tests/mocks'
import { render, screen } from '@testing-library/react'
import { SubquestionCodeInput } from './subquestionCodeComponents'
describe('Subquestion code accessibility', () => {
  const originalTranslate = globalThis.t
  beforeAll(() => {
    globalThis.t = (text) => text
  })
  afterAll(() => {
    globalThis.t = originalTranslate
  })
  test('editable codes have unique accessible names and disable autocomplete', () => {
    render(
      <>
        <SubquestionCodeInput code="SQ001" onChange={jest.fn()} />
        <SubquestionCodeInput code="SQ002" onChange={jest.fn()} />
      </>
    )
    expect(
      screen.getByRole('textbox', { name: 'Subquestion code SQ001' })
    ).toHaveAttribute('autocomplete', 'off')
    expect(
      screen.getByRole('textbox', { name: 'Subquestion code SQ002' })
    ).toHaveAttribute('autocomplete', 'off')
  })
})
</file>

<file path="editor/src/components/QuestionTypes/subquestionCodeComponents.js">
import classNames from 'classnames'
import { Form } from 'react-bootstrap'
import { format } from 'util'
const getAccessibleLabel = (code) => format(t('Subquestion code %s'), code)
export const SubquestionCodeErrorMessage = ({ errorMessage, maxWidth }) => (
  <div className={'text-wrap d-block '} style={{ maxWidth: maxWidth }}>
    <Form.Text className="text-danger question-code-tag-error">
      {errorMessage}
    </Form.Text>
  </div>
)
export const SubquestionCodeInput = ({
  isSurveyActive,
  code,
  onChange,
  isColumnTitle = false,
  className = '',
}) => (
  <div className={classNames('question-code-container', className)}>
    {isSurveyActive ? (
      <div
        className="question-code-tag"
        style={isColumnTitle ? { marginLeft: '0px' } : undefined}
      >
        {code}
      </div>
    ) : (
      <input
        style={isColumnTitle ? { marginLeft: '0px' } : undefined}
        className="question-code-tag"
... (10 lines truncated)
</file>

<file path="editor/src/components/QuestionTypes/Text.test.js">
import 'tests/mocks'
import { renderWithProviders } from 'tests/testUtils'
import { QuestionPreview } from 'sbook/helpers/fixtures/QuestionPreview'
import { mockQuestionType } from 'sbook/helpers/fixtures/mockQuestionType'
import { getQuestionTypeInfo } from './getQuestionTypeInfo'
import { screen, waitFor } from '@testing-library/react'
import userEvent from '@testing-library/user-event'
import { sleep } from 'helpers'
const LONG_TEXT = `This is a text that me Rami, wrote just to test the long text question. I would like to say that I,
  Rami, an Egyptian from Egypt, wrote this text to test the long text question, and I would like to say that I, Rami, an Egyptian
  from Egypt, wrote this text to say that I'm actually a robot from the future.`
describe('QuestionTypes/Text - ShortText', () => {
  const shortTextQuestion = mockQuestionType(getQuestionTypeInfo().SHORT_TEXT, {
    image: '',
  })
  test('Should test short text question', async () => {
    await renderWithProviders(<QuestionPreview question={shortTextQuestion} />)
    const answer = await waitFor(() =>
      screen.getByTestId('text-question-answer-input')
    )
    expect(answer).toBeInTheDocument()
    await userEvent.type(answer, 'My name is Tom Riddle.', { delay: 0 })
    expect(answer.value).toBe('My name is Tom Riddle.')
  })
})
describe('QuestionTypes/Text - LongText', () => {
  const longTextQuestion = mockQuestionType(getQuestionTypeInfo().LONG_TEXT)
  test('Should test long text question', async () => {
    await renderWithProviders(<QuestionPreview question={longTextQuestion} />)
    const answer = await waitFor(() =>
... (9 lines truncated)
</file>

<file path="editor/src/components/QuestionTypeSelector/constants.js">
import { getQuestionTypeInfo } from '../QuestionTypes'
import {
  TableIcon,
  QuestionInserterRankIcon,
  QuestionInserterDataIcon,
  QuestionInserterTextIcon,
  QuestionInserterNumberIcon,
  QuestionInserterSingleChoiceIcon,
  QuestionInserterMultipleChoiceIcon,
} from 'components/icons'
export const getQuestionGroupItem = () => ({
  value: getQuestionTypeInfo().QUESTION_GROUP.type,
  label: getQuestionTypeInfo().QUESTION_GROUP.title,
  theme: getQuestionTypeInfo().QUESTION_GROUP.theme,
})
export const getQuestionItemsList = () => [
  {
    title: t('Single choice'),
    icon: <QuestionInserterSingleChoiceIcon />,
    items: [
      {
        value: getQuestionTypeInfo().SINGLE_CHOICE_LIST_RADIO.type,
        label: getQuestionTypeInfo().SINGLE_CHOICE_LIST_RADIO.title,
        theme: getQuestionTypeInfo().SINGLE_CHOICE_LIST_RADIO.theme,
      },
      {
        value: getQuestionTypeInfo().SINGLE_CHOICE_LIST_RADIO_WITH_COMMENT.type,
        label:
          getQuestionTypeInfo().SINGLE_CHOICE_LIST_RADIO_WITH_COMMENT.title,
        theme:
... (184 lines truncated)
</file>

<file path="editor/src/components/QuestionTypeSelector/index.js">
export * from './QuestionTypeSelector'
</file>

<file path="editor/src/components/QuestionTypeSelector/QuestionTypeSelector.js">
import React, { useEffect, useRef, useState } from 'react'
import ListGroup from 'react-bootstrap/ListGroup'
import classNames from 'classnames'
import Container from 'react-bootstrap/Container'
import Row from 'react-bootstrap/Row'
import Col from 'react-bootstrap/Col'
import { ClockArrowIcon, AddIcon } from 'components/icons'
import { Input } from 'components/UIComponents'
import searchIcon from 'assets/icons/search-icon.svg'
import { getQuestionGroupItem, getQuestionItemsList } from './constants'
export const QuestionTypeSelector = ({
  callBack,
  disableAddingQuestions = false,
  attributeTypeSelector = false,
}) => {
  const [searchTerm, setSearchTerm] = useState('')
  const [selectedItemIndex, setSelectedItemIndex] = useState(-1)
  const searchInputRef = useRef(null)
  const listRef = useRef(null)
  const listItemRef = useRef(null)
  const [searchedQuestionTypeOrGroup, setSearchedQuestionTypeOrGroup] =
    useState([])
  const filteredItemsLists = getQuestionItemsList().reduce(
    (result, currentItem) => {
      const filteredItems = currentItem.items.filter(
        (item) => item.label.toLowerCase().includes(searchTerm.toLowerCase())
        // && !item.hidden
      )
      if (filteredItems.length) {
        result.push({
... (209 lines truncated)
</file>

<file path="editor/src/components/QuestionTypeSelector/QuestionTypeSelector.stories.js">
import { QuestionTypeSelector as QuestionTypeSelectorComponent } from './'
export default {
  title: 'General/QuestionTypeSelector',
  component: QuestionTypeSelectorComponent,
}
export const QuestionTypeSelector = () => (
  <QuestionTypeSelectorComponent callBack={() => {}} />
)
</file>

<file path="editor/src/components/QuestionTypeSelector/QuestionTypeSelector.test.js">
import 'tests/mocks'
import { renderWithProviders } from 'tests/testUtils'
import { QuestionTypeSelector } from './'
import { screen } from '@testing-library/react'
import userEvent from '@testing-library/user-event'
import { getQuestionTypeInfo } from 'components/QuestionTypes/getQuestionTypeInfo'
describe('QuestionTypeSelector', () => {
  let selectedType
  beforeEach(async () => {
    await renderWithProviders(
      <QuestionTypeSelector
        callBack={(value) => {
          selectedType = value.type
        }}
      />
    )
  })
  test('Should use the labels exactly one time', async () => {
    for (const key of Object.keys(getQuestionTypeInfo())) {
      if (!getQuestionTypeInfo()[key].isQuestionType) {
        continue
      }
      const questionTypeInputs = screen.getAllByTestId(
        `question-type-${getQuestionTypeInfo()[key].theme}`
      )
      expect(questionTypeInputs.length).toBe(1)
    }
  })
  test('Should be mapping the labels to the correct values', async () => {
    for (const key of Object.keys(getQuestionTypeInfo())) {
... (69 lines truncated)
</file>

<file path="editor/src/components/SharingPanel/menus/overview/AliasSettingsCard.js">
import React from 'react'
import { Card } from 'react-bootstrap'
import { ACCESS_MODES } from 'helpers'
import { PublicSurveyAlias } from 'components'
export const AliasSettingsCard = ({
  survey,
  onAliasChange,
  setLink,
  selectedLanguage,
  aliasHasError,
  update,
  createBufferOperation,
  addToBuffer,
}) => {
  return (
    <div className="col-md-6 d-flex align-items-stretch">
      <Card className="card d-flex flex-column justify-content-between h-100 w-100">
        <PublicSurveyAlias
          survey={survey}
          update={update}
          onAliasChange={onAliasChange}
          setLink={setLink}
          language={selectedLanguage}
          currentSurveyAccessMode={
            survey?.access_mode || ACCESS_MODES.OPEN_TO_ALL
          }
          aliasHasError={aliasHasError}
          createBufferOperation={createBufferOperation}
          addToBuffer={addToBuffer}
        />
... (5 lines truncated)
</file>

<file path="editor/src/components/SharingPanel/menus/overview/LanguageSelector.js">
import React from 'react'
import { Card } from 'react-bootstrap'
import { Select } from 'components/UIComponents'
export const LanguageSelector = ({
  selectOptions,
  selectedLanguage,
  setSelectedLanguage,
}) => {
  return (
    <div className="col-12 d-flex align-items-stretch">
      <Card className="card h-100 w-100">
        <h5 className="med16-c">{t('Survey language version')}</h5>
        <div className="d-flex justify-content-between align-items-center">
          <p className="reg14">
            {t('Select the language version of the survey you want to share.')}
          </p>
          <Select
            options={selectOptions}
            value={selectedLanguage}
            className="sharing-panel-select med14-c"
            onChange={(option) => setSelectedLanguage(option.value)}
          />
        </div>
      </Card>
    </div>
  )
}
</file>

<file path="editor/src/components/SharingPanel/menus/overview/ParticipantsListCard.js">
import React from 'react'
import classNames from 'classnames'
import { Card } from 'react-bootstrap'
import { PlusLg } from 'react-bootstrap-icons'
import { getSiteUrl } from 'helpers'
import { TooltipContainer } from 'components'
export const ParticipantsListCard = ({ hasUpdatePermission, surveyId }) => {
  const handleParticipantListNav = () => {
    if (hasUpdatePermission) {
      window.open(
        getSiteUrl(`/admin/tokens/sa/index/surveyid/${surveyId}`),
        '_self'
      )
    }
  }
  return (
    <div
      className={classNames('col-md-3', 'd-flex', 'align-items-stretch', {
        'opacity-50': !hasUpdatePermission,
      })}
    >
      <TooltipContainer
        tip={t('You currently have "View only" access.')}
        showTip={!hasUpdatePermission}
      >
        <Card className="card h-100 w-100">
          <h5 className="med16-c">{t('Participant lists')}</h5>
          <p className="reg14 mb-5">
            {t('Setup participant lists and invite participants via email.')}
          </p>
... (13 lines truncated)
</file>

<file path="editor/src/components/SharingPanel/menus/overview/QRCodeCard.js">
import React from 'react'
import { Card } from 'react-bootstrap'
import { BrandedQRCode } from 'shared/BrandedQRCode'
export const QRCodeCard = ({ link }) => {
  return (
    <div className="col-md-3 d-flex align-items-stretch">
      <Card className="h-100 w-100 d-flex justify-content-center align-items-center p-3">
        <BrandedQRCode value={link} />
      </Card>
    </div>
  )
}
</file>

<file path="editor/src/components/SharingPanel/menus/overview/SharingOverview.js">
import { format } from 'util'
import { useEffect, useMemo, useState } from 'react'
import { useParams } from 'react-router-dom'
import { createBufferOperation, Entities, STATES } from 'helpers'
import {
  useAppState,
  useBuffer,
  useErrors,
  useSurvey,
  useSurveyUpdatePermission,
} from 'hooks'
import { PluginSlot } from 'plugins/PluginSlot'
import { PLUGIN_SLOTS } from 'plugins/slots'
import { LanguageSelector } from './LanguageSelector'
import { SocialMediaCard } from './SocialMediaCard'
import { AliasSettingsCard } from './AliasSettingsCard'
import { QRCodeCard } from './QRCodeCard'
import { ParticipantsListCard } from './ParticipantsListCard'
export const SharingOverview = () => {
  const { surveyId } = useParams()
  const { survey, update } = useSurvey(surveyId)
  const [allLanguages] = useAppState(STATES.ALL_AVAILABLE_LANGUAGES)
  const [userDetails] = useAppState(STATES.USER_DETAIL)
  const languages = allLanguages[userDetails.lang]
  const [aliasHasError, setAliasHasError] = useState(false)
  const { errors } = useErrors()
  const { addToBuffer } = useBuffer()
  const [activeLanguage] = useAppState(STATES.ACTIVE_LANGUAGE)
  const [link, setLink] = useState('')
  const [selectedLanguage, setSelectedLanguage] = useState(activeLanguage)
... (83 lines truncated)
</file>

<file path="editor/src/components/SharingPanel/menus/overview/SocialMediaCard.js">
import React from 'react'
import { Card } from 'react-bootstrap'
import { SocialMediaShare } from 'components/SocialMediaShare/SocialMediaShare'
import { PluginSlot } from 'plugins/PluginSlot'
import { PLUGIN_SLOTS } from 'plugins/slots'
export const SocialMediaCard = ({ link, title }) => {
  return (
    <div className="col-md-3 d-flex">
      <Card className="card d-flex flex-column justify-content-between  d-flex flex-column h-100 w-100">
        <SocialMediaShare shareUrl={link} surveyTitle={title} />
        <PluginSlot
          slotName={PLUGIN_SLOTS.SHARING_OVERVIEW_SOCIAL_MEDIA_CARD_BOTTOM}
        />
      </Card>
    </div>
  )
}
</file>

<file path="editor/src/components/SharingPanel/menus/index.js">
export * from './overview/SharingOverview'
</file>

<file path="editor/src/components/SharingPanel/index.js">
export * from './menus'
export * from './SharingSidebar'
</file>

<file path="editor/src/components/SharingPanel/SharingSidebar.js">
import React from 'react'
import { Button } from 'react-bootstrap'
import { SideBarHeader } from 'components/SideBar'
import { CloseIcon } from 'components/icons'
export const SharingSideBar = ({ title, children, onClose }) => {
  return (
    <div
      id="sidebar-embed"
      className="right-side-bar bg-white sidebar active-side-bar"
    >
      <div className="right-sidebar-settings">
        <SideBarHeader className="right-side-bar-header primary">
          <div>{title}</div>
          {onClose && (
            <Button variant="link" style={{ padding: 0 }} onClick={onClose}>
              <CloseIcon className="text-black fill-current" />
            </Button>
          )}
        </SideBarHeader>
        {children}
      </div>
    </div>
  )
}
</file>

<file path="editor/src/components/SideBar/index.js">
export * from './SideBar'
export * from './SideBarHeader'
export * from './SectionHeader'
export * from './SideBarPanelItem'
</file>

<file path="editor/src/components/SideBar/QuestionContextMenu.js">
import React, { useCallback, useEffect, useState } from 'react'
import { OverlayTrigger } from 'react-bootstrap'
import { useParams } from 'react-router-dom'
import copy from 'copy-text-to-clipboard'
import { useBuffer, useSurvey } from 'hooks'
import { createBufferOperation } from 'helpers'
import { ShortcutIcon } from 'components/icons'
export const QuestionContextMenu = ({
  code,
  positionX,
  positionY,
  isToggled,
  contextMenuRef,
  setContextMenu,
}) => {
  const [goToMenu, setGoToMenu] = useState(false)
  const { surveyId } = useParams()
  const { survey, update } = useSurvey(surveyId)
  const { addToBuffer } = useBuffer()
  const buttons = [
    {
      text: t('Show/hide question codes'),
      icon: <ShortcutIcon />,
      shortcut: 'H',
      onClick: (e) => {
        e.stopPropagation()
        let operationAttr = {
          showQNumCode: {
            showCode: !survey.showQNumCode?.showCode,
            showNumber: !survey.showQNumCode?.showNumber,
... (85 lines truncated)
</file>

<file path="editor/src/components/SideBar/SectionHeader.js">
import React from 'react'
import classNames from 'classnames'
export const SectionHeader = ({ children, style }) => {
  return (
    <h6
      className={classNames(
        'd-flex',
        'align-items-center',
        'justify-content-between',
        'section-header'
      )}
      style={style}
    >
      {children}
    </h6>
  )
}
</file>

<file path="editor/src/components/SideBar/SideBar.js">
import classNames from 'classnames'
import React, { useMemo } from 'react'
import { useParams } from 'react-router-dom'
import { FeedbackButton, TooltipContainer } from 'components'
import { SideBarPanel } from './SideBarPanel'
export const SideBar = ({
  testId = '',
  sidebarClassName = '',
  items = [],
  onIconClick = () => {},
  page = 'survey',
  showCloseButton = true,
  showFeedbackButton = false,
}) => {
  const { panel: currentPanel } = useParams()
  const panelInfo = useMemo(() => {
    return items.find((item) => item.panel === currentPanel) || {}
  }, [currentPanel, items])
  return (
    <div
      className={`sidebar d-flex flex-row ${sidebarClassName}`}
      data-testid={testId}
      id="sidebar"
    >
      <div className="sidebar-icons d-flex flex-column pb-2">
        {items
          .filter((item) => item.icon)
          .map((item, index) => {
            return (
              <React.Fragment key={index + 'sidebar'}>
... (57 lines truncated)
</file>

<file path="editor/src/components/SideBar/SideBar.stories.js">
import { SideBar } from './SideBar'
export default {
  title: 'General/SideBar',
  component: SideBar,
}
export const Basic = {
  render: () => <SideBar>Sample Content</SideBar>,
}
</file>

<file path="editor/src/components/SideBar/SideBarHeader.js">
import React from 'react'
import classNames from 'classnames'
export const SideBarHeader = ({ children = null, className = '' }) => {
  return (
    <div
      className={classNames(
        'd-flex',
        'sidebar-header',
        'align-items-center',
        'justify-content-between',
        className
      )}
    >
      {children}
    </div>
  )
}
</file>

<file path="editor/src/components/SideBar/SideBarPanel.js">
import { Button } from 'react-bootstrap'
import { useNavigate, useParams } from 'react-router-dom'
import { SideBarHeader, SideBarPanelItem } from 'components/SideBar'
import { CloseIcon } from 'components/icons'
export const SideBarPanel = ({
  label,
  options = [],
  page = 'survey',
  showCloseButton = true,
}) => {
  const { surveyId } = useParams()
  const navigate = useNavigate()
  const handleClose = () => {
    navigate(`/${page}/${surveyId}`)
  }
  return (
    <div data-testid="survey-menu-panel" className="d-flex h-100">
      <div className="survey-structure">
        <div className={'survey-menu'}>
          <SideBarHeader className="right-side-bar-header primary">
            {label}
            {showCloseButton && (
              <Button
                variant="link"
                className="p-0 btn-close-lime"
                onClick={handleClose}
                data-testid="btn-close-survey-menu-panel"
              >
                <CloseIcon className="text-black fill-current" />
              </Button>
... (17 lines truncated)
</file>

<file path="editor/src/components/SideBar/SideBarPanelItem.js">
import classNames from 'classnames'
import React from 'react'
import { Form } from 'react-bootstrap'
import { TooltipContainer } from 'components'
import { useNavigate, useParams } from 'react-router-dom'
export const SideBarPanelItem = ({ options, page }) => {
  const { panel, menu, surveyId } = useParams()
  const navigate = useNavigate()
  const handleOnOptionClick = () => {
    if (options.redirect) {
      window.open(options.redirect, '_self')
    } else {
      const navPage = options.page !== undefined ? options.page : page
      const navPanel = options.panel !== undefined ? options.panel : panel
      const hasPanel = navPanel && navPanel !== ''
      navigate(
        `/${navPage}/${surveyId}/${navPanel}${hasPanel && '/'}${options.menu}`
      )
    }
  }
  const isActive =
    menu === options.menu ||
    (Array.isArray(options.activeMenus) && options.activeMenus.includes(menu))
  return (
    <TooltipContainer
      tip={options.disabledTip}
      showTip={options.disabled}
      placement="right"
    >
      <div
... (21 lines truncated)
</file>

<file path="editor/src/components/SideBar/SideBarRow.js">
import React, { useEffect, useState, useRef, useCallback } from 'react'
import { useParams } from 'react-router-dom'
import classNames from 'classnames'
import Button from 'react-bootstrap/Button'
import { useSurvey } from 'hooks'
import { ArrowDownIcon } from 'components/icons'
import { ContentEditor, Dropdown, TooltipContainer } from 'components'
import { RemoveHTMLTagsInString } from 'helpers'
import { QuestionContextMenu } from './QuestionContextMenu'
export const SideBarRow = ({
  icon,
  title,
  titlePlaceholder,
  code,
  children,
  style,
  testId = '',
  /* Also used as a test id for the menu toggle */
  menuToggleId = '',
  /* Also used as a test id for the menu toggle */
  menuId = '',
  provided = {},
  onTitleClick = () => {},
  onRowClick = () => {},
  isQuestionGroup,
  isOpen: _isOpen = false,
  className = '',
  isFocused = false,
  menuItems = [],
}) => {
... (161 lines truncated)
</file>

<file path="editor/src/components/SocialMediaShare/SocialMediaShare.js">
import {
  FacebookShareButton,
  LinkedinShareButton,
  EmailShareButton,
  EmailIcon,
  TwitterShareButton,
} from 'react-share'
import facebookIcon from 'assets/icons/facebook-icon.svg'
import linkedinIcon from 'assets/icons/linkedin-icon.svg'
import xIcon from 'assets/icons/twitter-icon.svg'
export const SocialMediaShare = ({ shareUrl = '', surveyTitle = '' }) => {
  return (
    <>
      <h5 className="med16-c">{t('Share on social media')}</h5>
      <div className="social-cards-wrapper">
        <FacebookShareButton url={shareUrl} title={surveyTitle}>
          <img src={facebookIcon} alt="bold icon" />
        </FacebookShareButton>
        <EmailShareButton
          subject={surveyTitle}
          url={shareUrl}
          title={surveyTitle}
        >
          <EmailIcon
            style={{ width: 36, height: 36, border: 5, borderRadius: 2 }}
            bgStyle={{ fill: '#6e748c' }}
          />
        </EmailShareButton>
        <LinkedinShareButton url={shareUrl} title={surveyTitle}>
          <img src={linkedinIcon} alt="bold icon" />
... (9 lines truncated)
</file>

<file path="editor/src/components/Survey/AddQuestion/AddQuestion.js">
import { Button } from 'react-bootstrap'
import classnames from 'classnames'
import { useAppState } from 'hooks'
import { STATES } from 'helpers'
import { getTooltipMessages } from 'helpers/options'
import { TooltipContainer } from 'components'
import { AddIcon, CloseIcon } from 'components/icons'
export const AddQuestion = ({
  toggleDarkOnOpen = false,
  groupIndex = null,
  onClick = () => {},
  id = null,
  className = '',
}) => {
  const [isSurveyActive] = useAppState(STATES.IS_SURVEY_ACTIVE, false)
  const [hasSurveyUpdatePermission] = useAppState(
    STATES.HAS_SURVEY_UPDATE_PERMISSION
  )
  const [isAddingQuestionOrGroup, setIsAddingQuestionOrGroup] = useAppState(
    STATES.IS_ADDING_QUESTION_OR_GROUP,
    false
  )
  const [, setClickedQuestionGroupIndex] = useAppState(
    STATES.CLICKED_QUESTION_GROUP_INDEX,
    0
  )
  const toolTip = !hasSurveyUpdatePermission
    ? getTooltipMessages().NO_PERMISSION
    : getTooltipMessages().ACTIVE_DISABLED
  return (
... (37 lines truncated)
</file>

<file path="editor/src/components/Survey/AddQuestion/index.js">
export * from './AddQuestion'
</file>

<file path="editor/src/components/Survey/QuestionGroups/index.js">
export * from './QuestionGroups'
</file>

<file path="editor/src/components/Survey/QuestionGroups/QuestionGroup.js">
import { useEffect, useMemo, useRef, useState } from 'react'
import classNames from 'classnames'
import { Section } from 'components/Survey/Section'
import { Card } from 'components/Survey/Card'
import { FOCUS_ANIMATION_DURATION_IN_MS, ScrollToElement } from 'helpers'
import { useFocused } from 'hooks'
import { QuestionGroupHeader } from './QuestionGroupHeader'
import { QuestionGroupFooter } from './QuestionGroupFooter'
import { QuestionGroupBody } from './QuestionGroupBody'
export const QuestionGroup = ({
  language = 'en',
  questionGroup = {},
  groupIndex,
  update = () => {},
  duplicateGroup = () => {},
  deleteGroup = () => {},
  firstQuestionNumber,
  surveySettings,
}) => {
  const [showQuestions, setShowQuestions] = useState(true)
  const [, setFocusDescription] = useState(false)
  const [highlightQuestionGroup, setHighlightQuestionGroup] = useState(false)
  const [errors, setErrors] = useState('')
  const questionGroupTitleRef = useRef(null)
  const { focused = {}, setFocused, questionIndex } = useFocused()
  useEffect(() => {
    const isQuestionGroupFocused = focused.gid === questionGroup.gid
    const isFocusingAQuestion = focused.qid
    if (isQuestionGroupFocused && isFocusingAQuestion) {
      setShowQuestions(true)
... (89 lines truncated)
</file>

<file path="editor/src/components/Survey/QuestionGroups/QuestionGroup.stories.js">
import QuestionGroupComponent from './QuestionGroup'
export default {
  title: 'General/QuestionGroup',
  component: QuestionGroupComponent,
}
export const QuestionGroup = ({ survey, update }) => {
  return (
    <QuestionGroupComponent
      questionGroup={survey?.questionGroups[0]}
      update={update}
      firstQuestionNumber={0}
      groupIndex={0}
      deleteGroup={() => {}}
      duplicateGroup={() => {}}
      language="en"
      surveySettings={{ showNoAnswer: true }}
    />
  )
}
</file>

<file path="editor/src/components/Survey/QuestionGroups/QuestionGroup.test.js">
import 'tests/mocks'
import { renderWithProviders } from 'tests/testUtils'
import { QuestionGroup } from './QuestionGroup'
import { screen, waitFor } from '@testing-library/react'
import userEvent from '@testing-library/user-event'
import surveyData from 'helpers/data/survey-detail.json'
import { sleep } from 'helpers'
describe('QuestionGroup', () => {
  test('Should be able to collapse question group body', async () => {
    const questionGroups = surveyData.survey.questionGroups
    await renderWithProviders(
      <QuestionGroup
        questionGroup={questionGroups[0]}
        update={() => {}}
        firstQuestionNumber={0}
        groupIndex={0}
        deleteGroup={() => {}}
        duplicateGroup={() => {}}
        language="en"
        surveySettings={{ showNoAnswer: true }}
      />
    )
    const collapseToggleButton = screen.getByTestId(
      'collapse-button-question-group'
    )
    await userEvent.click(collapseToggleButton)
    expect(screen.queryAllByTestId('question-container')).toHaveLength(0)
  })
  test('Should be able to unfold question group body', async () => {
    const questionGroup = surveyData.survey.questionGroups[0]
... (50 lines truncated)
</file>

<file path="editor/src/components/Survey/QuestionGroups/QuestionGroupBody.js">
import { Collapse } from 'react-bootstrap'
import { Questions } from '../Questions'
export const QuestionGroupBody = ({
  showQuestions,
  setFocused,
  focused,
  questionGroup,
  questionIndex,
  handleUpdateQuestions,
  language,
  firstQuestionNumber,
  groupIndex,
  surveySettings,
}) => {
  return (
    <Collapse
      in={showQuestions}
      unmountOnExit={true}
      onEntered={() => {
        const isFocusingAQuestion = questionIndex
        if (isFocusingAQuestion) {
          setFocused(focused, questionGroup, questionIndex)
        }
      }}
    >
      <div className="question-group-body">
        <Questions
          language={language}
          questions={questionGroup.questions}
          update={handleUpdateQuestions}
... (11 lines truncated)
</file>

<file path="editor/src/components/Survey/QuestionGroups/QuestionGroupFooter.js">
import classNames from 'classnames'
import { useAppState } from 'hooks'
import { STATES } from 'helpers'
import { AddQuestion } from '../AddQuestion'
export const QuestionGroupFooter = ({ groupIndex }) => {
  const [isSurveyActive] = useAppState(STATES.IS_SURVEY_ACTIVE, false)
  return (
    <div
      className={classNames(
        'add-question',
        'd-flex',
        'justify-content-center',
        'mt-4'
      )}
      style={{ color: isSurveyActive ? '#63c792' : '#14ae5c' }}
    >
      <AddQuestion groupIndex={groupIndex} />
    </div>
  )
}
</file>

<file path="editor/src/components/Survey/QuestionGroups/QuestionGroupHeader.js">
import { useEffect, useMemo, useState } from 'react'
import { useParams } from 'react-router-dom'
import { Button } from 'react-bootstrap'
import classNames from 'classnames'
import { createBufferOperation, hasTempId, L10ns, getSiteUrl } from 'helpers'
import { useBuffer } from 'hooks'
import { ContentEditor } from 'components/UIComponents'
import { Dropdown } from 'components/UIComponents/Dropdown/Dropdown'
import { ReactComponent as DownArrow } from 'assets/icons/down-arrow.svg'
import { EyeIcon } from 'components/icons'
import { TestValidation } from './QuestionGroupSchema'
export const QuestionGroupHeader = ({
  questionGroup,
  duplicateGroup,
  deleteGroup,
  handleFocusGroup,
  setShowQuestions,
  showQuestions,
  handleUpdate,
  language,
  onErrors,
  questionsLength = 0,
  isFocused,
}) => {
  const [errors, setErrors] = useState('')
  const { surveyId } = useParams()
  const { addToBuffer } = useBuffer()
  const handleDuplicate = () => {
    duplicateGroup()
  }
... (122 lines truncated)
</file>

<file path="editor/src/components/Survey/QuestionGroups/QuestionGroupHeader.test.js">
import 'tests/mocks'
import { screen, fireEvent } from '@testing-library/react'
import { renderWithProviders } from 'tests/testUtils'
import { getSiteUrl } from 'helpers'
import surveyData from 'helpers/data/survey-detail.json'
import { QuestionGroupHeader } from './QuestionGroupHeader'
describe('QuestionGroupHeader', () => {
  const questionGroup = { gid: 3, l10ns: {} }
  let openSpy
  beforeEach(async () => {
    openSpy = jest.spyOn(window, 'open').mockImplementation(() => {})
    await renderWithProviders(
      <QuestionGroupHeader
        questionGroup={questionGroup}
        duplicateGroup={() => {}}
        deleteGroup={() => {}}
        handleFocusGroup={() => {}}
        setShowQuestions={() => {}}
        showQuestions={false}
        handleUpdate={() => {}}
        language="en"
        onErrors={() => {}}
        isFocused
      />
    )
  })
  afterEach(() => {
    openSpy.mockRestore()
  })
  test('Opens the group preview URL in a new tab when the preview icon is clicked', async () => {
... (14 lines truncated)
</file>

<file path="editor/src/components/Survey/QuestionGroups/QuestionGroups.js">
import { useState } from 'react'
import { useParams } from 'react-router-dom'
import {
  useBuffer,
  useFocused,
  useSurveyRequestTimestamp,
  useAppState,
} from 'hooks'
import {
  createBufferOperation,
  DuplicateQuestion,
  DuplicateQuestionGroup,
  getReorganizedQuestionGroups,
  InsertElementAndIncrementProperty,
  STATES,
} from 'helpers'
import { ConfirmModal } from 'components/Modals'
import { QuestionGroup } from './QuestionGroup'
export const QuestionGroups = ({
  language,
  questionGroups = [],
  update,
  surveySettings,
}) => {
  const { focused = {}, setFocused, unFocus } = useFocused()
  const { addToBuffer } = useBuffer()
  const [deleteState, setDeleteState] = useState({ show: false, index: null })
  const { surveyId } = useParams()
  const { clearSurveyRequestTimestamp } = useSurveyRequestTimestamp()
  const [, setSurveyRefreshRequired] = useAppState(
... (107 lines truncated)
</file>

<file path="editor/src/components/Survey/QuestionGroups/QuestionGroupSchema.js">
import Joi from 'joi'
export const QuestionGroupHeaderSchema = Joi.object({})
export const TestValidation = () => {
  return QuestionGroupHeaderSchema.validate({})
}
</file>

<file path="editor/src/components/Survey/Questions/QuestionPreview/index.js">
export * from './QuestionPreview'
export * from './QuestionPreviewHeader'
export * from './QuestionPreviewBody'
</file>

<file path="editor/src/components/Survey/Questions/QuestionPreview/QuestionPreview.js">
import classNames from 'classnames'
import { getAttributeValue, isTrue, RandomNumber } from 'helpers'
import { useAppState } from 'hooks'
import { STATES } from 'helpers'
import { QuestionBodyPreview, QuestionHeaderPreview } from './'
import { useState } from 'react'
export const QuestionPreview = ({
  language,
  surveySettings = {},
  valueInfo,
  onSave,
  onCancel,
  disableUpdatingResponses: disableUpdatingResponsesProp,
}) => {
  const [hasResponsesUpdatePermission] = useAppState(
    STATES.HAS_RESPONSES_UPDATE_PERMISSION,
    false
  )
  const [hasResponsesReadPermission] = useAppState(
    STATES.HAS_RESPONSES_READ_PERMISSION,
    false
  )
  const disableUpdatingResponses =
    disableUpdatingResponsesProp !== undefined
      ? disableUpdatingResponsesProp
      : !hasResponsesUpdatePermission
  const canViewResponses =
    hasResponsesReadPermission || hasResponsesUpdatePermission
  const { question, questionNumber } = valueInfo
  const [key, setKey] = useState(RandomNumber(1, 9999999999))
... (56 lines truncated)
</file>

<file path="editor/src/components/Survey/Questions/QuestionPreview/QuestionPreviewBody.js">
import { useEffect, useMemo, useState, useRef } from 'react'
import classNames from 'classnames'
import { singleChoiceThemes } from '../../../QuestionTypes'
import { questionPreviewComponents } from '../../../QuestionTypes/questionPreviewComponents'
import { Button } from 'components/UIComponents'
import { Toast } from 'helpers'
export const QuestionBodyPreview = ({
  question,
  language,
  isHovered,
  isQuestionDisabled,
  surveySettings,
  valueInfo = {},
  onSave = () => {},
  onCancel = () => {},
  disableUpdatingResponses,
}) => {
  const [children, setChildren] = useState([])
  const [valueIsUpdated, setValueIsUpdated] = useState(false)
  const [value, setValue] = useState({})
  const lastToastTimeRef = useRef(0)
  const QuestionViewComponent = useMemo(
    () => questionPreviewComponents[question.questionThemeName],
    [question.questionThemeName]
  )
  const isSingleChoiceTheme = useMemo(
    () => singleChoiceThemes.includes(question.questionThemeName),
    [question.questionThemeName]
  )
  if (!QuestionViewComponent) {
... (85 lines truncated)
</file>

<file path="editor/src/components/Survey/Questions/QuestionPreview/QuestionPreviewHeader.js">
import classNames from 'classnames'
import ReactContentEditable from 'react-contenteditable'
import { isTrue, L10ns } from 'helpers'
import { ArrowRightIcon } from 'components/icons'
export const QuestionHeaderPreview = ({
  language,
  question,
  questionNumber,
}) => {
  const questionTitle = L10ns({
    prop: 'question',
    language,
    l10ns: question.l10ns,
  })
  const questionDescription = L10ns({
    prop: 'help',
    language,
    l10ns: question.l10ns,
  })
  return (
    <div
      data-testid="question-header"
      className="question-header d-flex flex-row"
    >
      <div className="questoin-header-title-container d-flex flex-column">
        <div className="question-title question-title-row d-flex align-items-center">
          <div className="question-number d-flex align-items-center">
            <div data-testid="question-number">{questionNumber}</div>
            <ArrowRightIcon className="text-primary fill-current" />
          </div>
... (35 lines truncated)
</file>

<file path="editor/src/components/Survey/Questions/index.js">
export { Questions } from './Questions'
export { Question } from './Question'
export * from './QuestionPreview'
</file>

<file path="editor/src/components/Survey/Questions/Question.js">
import classNames from 'classnames'
import { useEffect, useMemo, useRef, useState } from 'react'
import { Button } from 'react-bootstrap'
import { useAppState, useErrors, useFocused } from 'hooks'
import {
  getDisabledQuestionTypes,
  Entities,
  getAttributeValue,
  isTrue,
  ScrollToElement,
  STATES,
} from 'helpers'
import { getTooltipMessages } from 'helpers/options'
import { getQuestionImageObjectFromImageAttribute } from 'helpers/questionImage'
import { ArrowDownIcon, ArrowUpIcon } from 'components/icons'
import { QuestionSkeleton, TooltipContainer } from 'components'
import { useIsInViewport } from 'hooks/useInViewport'
import { QuestionHeader } from './QuestionHeader'
import { QuestionBody } from './QuestionBody'
import { QuestionFooter } from './QuestionFooter'
import { getQuestionTypeInfo } from '../../QuestionTypes'
import { QuestionContainer } from './QuestionContainer'
import { AssessmentValueBadge } from '../../QuestionTypes/AssessmentValueBadge'
const isInTestMode = process.env.STORYBOOK_DEV === 'true'
export const Question = ({
  language,
  question: { attributes = {} },
  question,
  handleRemove,
  handleDuplicate,
... (186 lines truncated)
</file>

<file path="editor/src/components/Survey/Questions/QuestionBody.js">
import classNames from 'classnames'
import { useAppState, useQuestionChildren } from 'hooks'
import { STATES } from 'helpers'
import {
  questionViewComponents,
  questionEditComponents,
} from '../../QuestionTypes'
export const QuestionBody = ({
  question,
  handleUpdate,
  language,
  isFocused,
  isHovered,
  isQuestionDisabled,
  surveySettings,
  isTitleFocused = false,
}) => {
  const QuestionViewComponent =
    questionViewComponents[question.questionThemeName]
  const QuestionEditComponent =
    questionEditComponents[question.questionThemeName]
  const [hasSurveyUpdatePermission] = useAppState(
    STATES.HAS_SURVEY_UPDATE_PERMISSION
  )
  const isFocusedWithPermission = isFocused && hasSurveyUpdatePermission
  const {
    children,
    handleChildAdd,
    handleChildDelete,
    handleOnChildDragEnd,
... (57 lines truncated)
</file>

<file path="editor/src/components/Survey/Questions/QuestionCodeSchema.js">
import Joi from 'joi'
export const QuestionCodeSchema = Joi.object({
  code: Joi.string().pattern(/^[A-Za-z0-9]+$/),
})
export const TestValidation = (code) => {
  return QuestionCodeSchema.validate({ code })
}
</file>

<file path="editor/src/components/Survey/Questions/QuestionContainer.js">
import React from 'react'
import classNames from 'classnames'
export const QuestionContainer = ({ questionImageObject, children }) => {
  const hasQuestionImage = questionImageObject.hasQuestionImage
  const hasImageAsBackground = questionImageObject.hasQuestionImageAsBackground
  if (!hasQuestionImage) {
    return children
  }
  if (hasImageAsBackground) {
    return (
      <div className="position-relative w-100 h-auto overflow-hidden p-0">
        {}
        <div className="position-relative w-100">
          <img
            className={'w-100 h-auto d-block'}
            src={questionImageObject.imagePreviewUrl}
            alt={questionImageObject.imageAltText || ''}
            style={questionImageObject.imageStyles}
            data-testid="question-background-image"
          />
          {/* Content overlay */}
          <div className="background-image-overlay position-absolute top-0 start-0 end-0 bottom-0 p-3 z-1">
            {children}
          </div>
        </div>
      </div>
    )
  }
  // If image exists and not used as background, render flex layout
  return (
... (26 lines truncated)
</file>

<file path="editor/src/components/Survey/Questions/QuestionFooter.js">
import { useState } from 'react'
import { useParams } from 'react-router-dom'
import classNames from 'classnames'
import { useAppState, useBuffer } from 'hooks'
import { STATES, createBufferOperation, getSiteUrl } from 'helpers'
import { getTooltipMessages } from 'helpers/options'
import { TooltipContainer } from 'components'
import { DeleteIcon, CopyIcon, EyeIcon } from 'components/icons'
import { ConfirmModal } from 'components/Modals'
export const QuestionFooter = ({
  question,
  handleRemove,
  handleDuplicate,
  isFocused = false,
}) => {
  const [isSurveyActive] = useAppState(STATES.IS_SURVEY_ACTIVE, false)
  const [activeLanguage] = useAppState(STATES.ACTIVE_LANGUAGE)
  const { surveyId } = useParams()
  const { addToBuffer } = useBuffer()
  const [showDeleteModal, setShowDeleteModal] = useState(false)
  const handleRemoveQuestion = () => {
    setShowDeleteModal(true)
  }
  const handleConfirmRemove = () => {
    const operation = createBufferOperation(question.qid).question().delete()
    addToBuffer(operation)
    handleRemove()
    setShowDeleteModal(false)
  }
  const openQuestionPreview = () => {
... (91 lines truncated)
</file>

<file path="editor/src/components/Survey/Questions/QuestionFooter.test.js">
import 'tests/mocks'
import { screen, fireEvent } from '@testing-library/react'
import { renderWithProviders } from 'tests/testUtils'
import { getSiteUrl } from 'helpers'
import surveyData from 'helpers/data/survey-detail.json'
import { QuestionFooter } from './QuestionFooter'
describe('QuestionFooter', () => {
  const question = { qid: 42, gid: 7 }
  let openSpy
  beforeEach(async () => {
    openSpy = jest.spyOn(window, 'open').mockImplementation(() => {})
    await renderWithProviders(
      <QuestionFooter
        question={question}
        handleRemove={() => {}}
        handleDuplicate={() => {}}
        isFocused
      />
    )
  })
  afterEach(() => {
    openSpy.mockRestore()
  })
  test('Opens the question preview URL in a new tab when the preview icon is clicked', async () => {
    const previewIcon = await screen.findByTestId(
      'question-footer-preview-icon'
    )
    fireEvent.click(previewIcon)
    expect(openSpy).toHaveBeenCalledTimes(1)
    const [url, target] = openSpy.mock.calls[0]
... (9 lines truncated)
</file>

<file path="editor/src/components/Survey/Questions/QuestionHeader.js">
import { useEffect, useMemo, useRef, useState } from 'react'
import classNames from 'classnames'
import { useAppState, useBuffer, useErrors } from 'hooks'
import {
  isTrue,
  L10ns,
  createBufferOperation,
  Entities,
  hasTempId,
  STATES,
} from 'helpers'
import { ContentEditor } from 'components/UIComponents'
import { ArrowRightIcon } from 'components/icons'
import { hasQuestionCondition } from 'components/ConditionDesigner/utils'
import { getPlaceholdersConfig } from 'shared/getPlaceholdersConfig'
import { TestValidation } from './QuestionSchema'
export const QuestionHeader = ({
  handleUpdate,
  language,
  question,
  onError = () => {},
  isFocused = false,
  questionNumber,
  setIsTitleFocused,
}) => {
  const { addToBuffer } = useBuffer()
  const [errors, setErrors] = useState('')
  const { getError } = useErrors()
  const titleRef = useRef(null)
  const [codeToQuestion] = useAppState(STATES.CODE_TO_QUESTION)
... (134 lines truncated)
</file>

<file path="editor/src/components/Survey/Questions/Questions.js">
import React from 'react'
import {
  createBufferOperation,
  arrayDeleteItem,
  DuplicateQuestion,
  MoveQuestion,
  getReorganizedQuestions,
  InsertElementAndIncrementProperty,
  updateQuestionsSortOrder,
} from 'helpers'
import { useBuffer, useFocused } from 'hooks'
import { Question } from './Question'
export const Questions = ({
  language,
  questions = [],
  update,
  firstQuestionNumber,
  questionGroupIsOpen,
  groupIndex,
  questionGroup,
  surveySettings,
}) => {
  const { setFocused, unFocus, questionIndex } = useFocused()
  const { addToBuffer } = useBuffer()
  let questionNumber = firstQuestionNumber
  const handleUpdate = (index, change, isInserting = false) => {
    const lastSliceIndex = isInserting ? index : index + 1
    update([
      ...questions.slice(0, index),
      change,
... (92 lines truncated)
</file>

<file path="editor/src/components/Survey/Questions/QuestionSchema.js">
import Joi from 'joi'
export const QuestionHeaderSchema = Joi.object({})
export const TestValidation = () => {
  return QuestionHeaderSchema.validate({})
}
</file>

<file path="editor/src/components/Survey/Card.js">
import classNames from 'classnames'
export const Card = ({ children, className, style }) => {
  return (
    <div className={classNames(className, 'survey-card')} style={style}>
      {children}
    </div>
  )
}
</file>

<file path="editor/src/components/Survey/index.js">
export * from './Survey'
export * from './Questions'
export * from './QuestionGroups'
export * from './SurveyHeader'
export * from './SurveyFooter'
</file>

<file path="editor/src/components/Survey/Section.js">
export const Section = ({
  onClick = () => {},
  children,
  sectionRef,
  className = '',
  testId = '',
}) => {
  return (
    <div
      onClick={onClick}
      className={`survey-section ${className}`}
      ref={sectionRef}
      data-testid={testId}
    >
      {children}
    </div>
  )
}
</file>

<file path="editor/src/components/Survey/Survey.js">
import { useMemo } from 'react'
import classNames from 'classnames'
import Col from 'react-bootstrap/Col'
import { useAppState, useSurvey } from 'hooks'
import { STATES } from 'helpers'
import { SurveyHeader } from './SurveyHeader'
import { SurveyFooter } from './SurveyFooter'
import { SurveyBody } from './SurveyBody'
import { SurveyLanguageSwitch } from './SurveyLanguageSwitch'
export const Survey = ({ id }) => {
  const [activeLanguage] = useAppState(STATES.ACTIVE_LANGUAGE)
  const [userDetails] = useAppState(STATES.USER_DETAIL)
  const [numberOfQuestions] = useAppState(STATES.NUMBER_OF_QUESTIONS, 0)
  const { survey = {}, update } = useSurvey(id)
  const [allLanguages] = useAppState(STATES.ALL_AVAILABLE_LANGUAGES)
  const surveySettings = useMemo(() => {
    return {
      showNoAnswer: survey.showNoAnswer,
      preselectNoAnswer: survey.preselectNoAnswer,
      languages: survey.languages,
    }
  }, [survey.showNoAnswer, survey.preselectNoAnswer, survey.languages])
  const surveyHasAdditionalLanguages = () => {
    return survey.additionalLanguages?.trim().length !== 0
  }
  return (
    <Col
      className={classNames(
        'd-flex',
        'mx-4',
... (35 lines truncated)
</file>

<file path="editor/src/components/Survey/Survey.stories.js">
import { Survey as SurveyComponent } from './Survey'
export default {
  title: 'General/Survey',
  component: SurveyComponent,
}
const surveyId = '78f91e52-6028-11ed-82e1-7ac846e3af9d'
export const Survey = () => {
  return <SurveyComponent id={surveyId} />
}
</file>

<file path="editor/src/components/Survey/SurveyBody.js">
import { AddQuestion } from './AddQuestion'
import { QuestionGroups } from './QuestionGroups'
export const SurveyBody = ({
  questionGroups,
  language,
  update,
  surveySettings,
}) => {
  return (
    <>
      {questionGroups?.length ? (
        <QuestionGroups
          language={language}
          questionGroups={questionGroups}
          update={(questionGroups) => update({ questionGroups })}
          surveySettings={surveySettings}
        />
      ) : (
        <div className="d-flex align-items-center justify-content-center">
          <div className={'add-question d-flex justify-content-center mt-4'}>
            <AddQuestion />
          </div>
        </div>
      )}
    </>
  )
}
</file>

<file path="editor/src/components/Survey/SurveyFooter.js">
import { useEffect, useRef, useState } from 'react'
import classNames from 'classnames'
import { Collapse } from 'react-bootstrap'
import { ReactComponent as DownArrow } from 'assets/icons/down-arrow.svg'
import { useFocused, useBuffer, useAppState } from 'hooks'
import {
  createBufferOperation,
  L10ns,
  LANGUAGE_CODES,
  ScrollToElement,
  STATES,
} from 'helpers'
import { getTooltipMessages } from 'helpers/options'
import { Button, ContentEditor } from 'components/UIComponents'
import { getQuestionTypeInfo } from 'components/QuestionTypes'
import { TooltipContainer } from 'components'
import { Section } from './Section'
import { Card } from './Card'
export const SurveyFooter = ({
  language,
  survey: { languageSettings, sid },
  update,
}) => {
  const titleRef = useRef(null)
  const [hasSurveyUpdatePermission] = useAppState(
    STATES.HAS_SURVEY_UPDATE_PERMISSION
  )
  const [collapse, setCollapse] = useState(false)
  const { focused = {}, setFocused } = useFocused()
  const { addToBuffer } = useBuffer()
... (145 lines truncated)
</file>

<file path="editor/src/components/Survey/SurveyFooter.stories.js">
import { SurveyFooter } from './SurveyFooter'
export default {
  title: 'General/Survey/Footer',
  component: SurveyFooter,
}
export const Footer = ({ survey, update }) => {
  return (
    <SurveyFooter
      language="en"
      update={(languageSettings) => update(languageSettings)}
      isEmpty={!survey.questionGroups?.length}
      survey={survey}
    />
  )
}
</file>

<file path="editor/src/components/Survey/SurveyFooter.test.js">
import 'tests/mocks'
import { renderWithProviders } from 'tests/testUtils'
import { SurveyFooter } from './SurveyFooter'
import { screen } from '@testing-library/react'
import surveyData from 'helpers/data/survey-detail.json'
describe('SurveyFooter', () => {
  beforeEach(async () => {})
  test('Survey footer should render the finish button', async () => {
    await renderWithProviders(
      <SurveyFooter
        language="en"
        update={() => {}}
        isEmpty={!surveyData.survey.questionGroups?.length}
        survey={surveyData.survey}
      />
    )
    const finishButton = await screen.findByTestId(
      'survey-footer-finish-button'
    )
    expect(finishButton).toBeInTheDocument()
  })
  test('Survey footer end text editor should use rich text toolbar mode', async () => {
    await renderWithProviders(
      <SurveyFooter
        language="en"
        update={() => {}}
        isEmpty={!surveyData.survey.questionGroups?.length}
        survey={surveyData.survey}
      />
    )
... (8 lines truncated)
</file>

<file path="editor/src/components/Survey/SurveyHeader.js">
import { useEffect, useMemo, useRef, useState } from 'react'
import { Collapse, FormCheck } from 'react-bootstrap'
import classNames from 'classnames'
import { format } from 'util'
import { useFocused, useBuffer, useAppState } from 'hooks'
import { ReactComponent as DownArrow } from 'assets/icons/down-arrow.svg'
import {
  createBufferOperation,
  decodeHTMLEntities,
  L10ns,
  RemoveHTMLTagsInString,
  ScrollToElement,
  STATES,
} from 'helpers'
import { getTooltipMessages } from 'helpers/options'
import { Button, ContentEditor, Select } from 'components/UIComponents'
import { LanguageSwitch } from 'components/SurveySettings/GeneralSettings/LanguageSwitch'
import { getQuestionTypeInfo } from 'components/QuestionTypes'
import { LanguageIcon } from 'components/icons'
import { Section } from './Section'
import { TooltipContainer } from '../TooltipContainer/TooltipContainer'
export const SurveyHeader = ({
  update,
  numberOfQuestions,
  activeLanguage,
  survey: {
    sid,
    languageSettings,
    language,
    welcomeImage,
... (279 lines truncated)
</file>

<file path="editor/src/components/Survey/SurveyHeader.stories.js">
import { SurveyHeader } from './SurveyHeader'
export default {
  title: 'General/Survey/Header',
  component: SurveyHeader,
}
export const Header = ({ survey, update }) => {
  const allLanguages = {
    en: {
      description: 'English',
      nativedescription: 'English',
    },
  }
  return (
    <SurveyHeader
      update={(updated) => update(updated)}
      survey={survey}
      allLanguages={allLanguages}
      activeLanguage="en"
    />
  )
}
</file>

<file path="editor/src/components/Survey/SurveyHeader.test.js">
import 'tests/mocks'
import { screen } from '@testing-library/react'
import { renderWithProviders } from 'tests/testUtils'
import surveyData from 'helpers/data/survey-detail.json'
import { SurveyHeader } from './SurveyHeader'
describe('SurveyHeader', () => {
  let Survey
  beforeEach(async () => {
    Survey = surveyData.survey
    await renderWithProviders(
      <SurveyHeader
        update={() => {}}
        survey={Survey}
        allLanguages={{
          en: {
            description: 'English',
            nativedescription: 'English',
          },
        }}
        activeLanguage="en"
      />
    )
  })
  test('Should have language switch select', async () => {
    const languageSelect = screen.getByTestId('language-change-select')
    expect(languageSelect).toBeInTheDocument()
  })
})
</file>

<file path="editor/src/components/Survey/SurveyLanguageSwitch.js">
import { useMemo } from 'react'
import { useAppState } from 'hooks'
import { decodeHTMLEntities, STATES } from 'helpers'
import { Dropdown } from '../UIComponents'
import { SurveyTranslationIcon } from '../icons'
export const SurveyLanguageSwitch = ({ survey, allLanguages }) => {
  const [activeLanguage, setActiveLanguage] = useAppState(
    STATES.ACTIVE_LANGUAGE,
    survey.language
  )
  const languages = useMemo(() => {
    if (!survey.additionalLanguages || survey.additionalLanguages === '') {
      return [survey.language]
    }
    return [survey.language, ...survey.additionalLanguages.split(' ')]
  }, [survey.language, survey.additionalLanguages])
  const languageOptions = useMemo(() => {
    if (!languages) return []
    return languages.map((language) => {
      return {
        value: language,
        label: decodeHTMLEntities(allLanguages?.[language]?.description),
      }
    })
  }, [languages, allLanguages])
  const activeLanguageLabel = useMemo(() => {
    return (
      languageOptions.find((language) => language.value === activeLanguage)
        ?.label || ''
    )
... (36 lines truncated)
</file>

<file path="editor/src/components/SurveyOverview/OverViewToast.js">
import React from 'react'
import SmallCheckMarkIcon from 'components/icons/SmallCheckMarkIcon'
const OverViewToast = ({ message }) => {
  return (
    <div className="overview-toast">
      <SmallCheckMarkIcon classname="overview-left-spacing" />
      <span className="reg14 overview-left-spacing">{message}</span>
    </div>
  )
}
export default OverViewToast
</file>

<file path="editor/src/components/SurveyOverview/SurveyOverview.js">
import { useState, useEffect, useLayoutEffect, useRef } from 'react'
import { useNavigate } from 'react-router-dom'
import { Button, Card, Container } from 'react-bootstrap'
import { ContentEditor, PublicSurveyAlias } from 'components'
import { ACCESS_MODES, PAGES, SURVEY_MENU_TITLES } from 'helpers'
import { useStatisticsAtGlance } from 'hooks'
import { getSharingPanels } from 'shared/getSharingPanels'
import { BrandedQRCode } from 'shared/BrandedQRCode'
import { CheckIcon, EyeIcon, StopIcon } from 'components/icons'
import rightArrowIcon from 'assets/icons/right-arrow.svg'
import pencilIconWhite from 'assets/icons/pencil-icon-white.svg'
import OverViewToast from './OverViewToast'
export const SurveyOverview = ({
  survey = {},
  update,
  hasOperations,
  numberOfQuestions = 0,
  hasSurveyUpdatePermission,
  editSurvey,
  togglePublish,
  toastMessage,
  activeLanguage,
  setShowOverViewModal = () => {},
  createBufferOperation = () => {},
  addToBuffer = () => {},
}) => {
  const navigate = useNavigate()
  const [link, setLink] = useState('')
  const [isWide, setIsWide] = useState(false)
  const {
... (229 lines truncated)
</file>

<file path="editor/src/components/SurveySettings/AdvancedOptions/index.js">
import React from 'react'
import { Form } from 'react-bootstrap'
import Button from 'react-bootstrap/Button'
import { ExternalLinkIcon } from 'components/icons'
import getSiteUrl from '../../../helpers/getSiteUrl'
export const AdvancedOptionsSettings = ({ surveyId }) => {
  const openSurveySettingsInMainApp = () => {
    window.open(
      getSiteUrl('/surveyAdministration/view/surveyid/' + surveyId),
      '_blank'
    )
  }
  return (
    <>
      <Form.Label>
        {t(
          'Explore additional configuration options, more detailed features and settings.'
        )}
      </Form.Label>
      <Button
        variant="secondary"
        className="d-flex align-items-center"
        onClick={() => {
          openSurveySettingsInMainApp()
        }}
      >
        <span className="me-1">{t('Go to advanced options')}</span>
        <ExternalLinkIcon className="text-white fill-current" />
      </Button>
    </>
... (3 lines truncated)
</file>

<file path="editor/src/components/SurveySettings/components/SettingsBlocksRenderer.js">
import { SURVEY_MENU_TITLES } from 'helpers'
import { SurveySettingBlock } from '../SurveySettingBlock'
import { useMemo } from 'react'
import { PluginSlot } from 'plugins/PluginSlot'
import { PLUGIN_SLOTS } from 'plugins/slots'
export const SettingsBlocksRenderer = ({
  menu,
  settingsBlocksInfo,
  panelInfo,
  globalStates,
  helperSettings,
  survey,
  updateSurveySetting,
  rerenderSettings,
  setRerenderSettings,
}) => {
  const blockToRender = useMemo(() => {
    return Object.entries(settingsBlocksInfo?.[menu] || {})
  }, [settingsBlocksInfo, menu])
  return (
    <>
      {blockToRender.map(([blockKey, blockSettingsInfo], blockIndex) => {
        return (
          <div key={`${blockIndex}-${blockKey}-container`}>
            <SurveySettingBlock
              blockSettingsInfo={blockSettingsInfo}
              currentOpenPanelLabel={panelInfo.label}
              globalStates={globalStates}
              helperSettings={helperSettings}
              survey={survey}
... (17 lines truncated)
</file>

<file path="editor/src/components/SurveySettings/GeneralSettings/LanguageSwitch.js">
import { LanguageOptions } from 'helpers'
import { Select } from 'components/UIComponents'
export const LanguageSwitch = ({
  language,
  handleLanguageChange = () => {},
  label = t('Language'),
}) => {
  const languageOptionsAsArray = Object.keys(LanguageOptions).map((key) => {
    return {
      value: key,
      label: LanguageOptions[key].label,
    }
  })
  return (
    <Select
      labelText={label}
      options={languageOptionsAsArray}
      onChange={({ target: { value } }) => {
        handleLanguageChange(value)
      }}
      selectedOption={LanguageOptions[language] || {}}
    />
  )
}
</file>

<file path="editor/src/components/SurveySettings/GeneralSettings/Theme.js">
import React from 'react'
import { SurveySetting } from '../SurveySetting'
import { useSurvey } from '../../../hooks'
export const Theme = (props) => {
  const { survey } = useSurvey(props.surveyId)
  const currentTemplate = survey?.template
  const availableThemes = survey?.availableThemes || []
  const selectedTheme = availableThemes.find(
    (theme) => theme.value === currentTemplate
  )
  let templatePreview = selectedTheme?.preview || survey?.templatePreview || ''
  if (process.env.REACT_APP_DEV_MODE && templatePreview) {
    templatePreview = process.env.REACT_APP_SITE_URL + templatePreview
  }
  return (
    <>
      <SurveySetting {...props} />
      {templatePreview && (
        <img
          className="img-thumbnail theme-preview p-0 mt-4 rounded-0"
          src={templatePreview}
          alt={t('Theme preview')}
        />
      )}
    </>
  )
}
</file>

<file path="editor/src/components/SurveySettings/Settings/themeOptionTypes/handleButtonType.js">
import { ToggleButtons } from 'components/UIComponents'
import { Entities } from 'helpers'
import {
  CornerRoundedIcon,
  CornerMediumIcon,
  CornerNormalIcon,
} from '../../../icons/index.js'
const iconMappings = {
  'cornerradius_0.svg': CornerNormalIcon,
  'cornerradius_4.svg': CornerMediumIcon,
  'cornerradius_20.svg': CornerRoundedIcon,
}
const getToggleOptions = (optionLabels, options, optionimages) => {
  optionLabels = optionLabels.split('|')
  optionimages = optionimages.split('|')
  options = options.split('|')
  return options.map((option, index) => ({
    name: t(optionLabels[index]),
    icon: iconMappings[optionimages[index]] ?? optionimages[index],
    value: option,
  }))
}
export const handleButtonType = (attribute = {}, keyPath) => {
  return {
    keyPath: `themesettings.${keyPath}`,
    entity: Entities.themeSettings,
    props: {
      id: keyPath,
      mainText: t(attribute.title),
      noPermissionDisabled: true,
... (10 lines truncated)
</file>

<file path="editor/src/components/SurveySettings/Settings/themeOptionTypes/handleColorPickerType.js">
import ColorPicker from 'components/UIComponents/ColorPicker/ColorPicker'
import { Entities } from 'helpers'
export const handleColorPickerType = (attribute = {}, keyPath) => {
  return {
    keyPath: `themesettings.${keyPath}`,
    entity: Entities.themeSettings,
    props: {
      id: keyPath,
      mainText: t(attribute.title),
      childComponent: ColorPicker,
      noPermissionDisabled: true,
    },
  }
}
</file>

<file path="editor/src/components/SurveySettings/Settings/themeOptionTypes/handleDropdownType.js">
import { Select } from 'components/UIComponents'
import { Entities, FILE_UPLOAD_MAX_SIZE_STRING } from 'helpers'
import { format } from 'util'
import ThemeOptionsImageUpload from '../../../ThemeOptions/ThemeOptionsImageUpload.js'
export const handleDropdownType = (
  attribute = {},
  keyPath,
  hasFileUpload = false
) => {
  return {
    keyPath: `themesettings.${keyPath}`,
    entity: Entities.themeSettings,
    selectOptions: () => {
      return attribute.dropdownoptions
    },
    formatPreview: (value) => {
      if (!hasFileUpload) {
        return null
      }
      const val =
        value.currentValue === 'inherit'
          ? value.parentValue
          : value.currentValue
      const image = value.dropdownoptions.find((option) => option.value === val)
      if (image) {
        return image?.imagePreviewPath ?? null
      }
      return null
    },
    props: {
... (27 lines truncated)
</file>

<file path="editor/src/components/SurveySettings/Settings/themeOptionTypes/handleDurationType.js">
import { Input } from 'components/UIComponents'
import { Entities } from 'helpers'
export const handleDurationType = (attribute = {}, keyPath) => {
  return {
    keyPath: `themesettings.${keyPath}`,
    entity: Entities.themeSettings,
    props: {
      id: keyPath,
      mainText: t(attribute.title),
      childComponent: Input,
      type: 'number',
      noPermissionDisabled: true,
    },
  }
}
</file>

<file path="editor/src/components/SurveySettings/Settings/themeOptionTypes/handleIconType.js">
import ThemeOptionsIconSelect from 'components/ThemeOptions/ThemeOptionsIconSelect'
import { Entities } from 'helpers'
export const handleIconType = (attribute = {}, keyPath) => {
  return {
    keyPath: `themesettings.${keyPath}`,
    entity: Entities.themeSettings,
    selectOptions: () => {
      return attribute.dropdownoptions
    },
    props: {
      id: keyPath,
      mainText: t(attribute.title),
      childComponent: ThemeOptionsIconSelect,
      noPermissionDisabled: true,
    },
  }
}
</file>

<file path="editor/src/components/SurveySettings/Settings/themeOptionTypes/handleTextareaType.js">
import { Entities } from 'helpers'
import { Form } from 'react-bootstrap'
export const handleTextareaType = (attribute = {}, keyPath) => {
  return {
    keyPath: `themesettings.${keyPath}`,
    entity: Entities.themeSettings,
    props: {
      id: keyPath,
      mainText: t(attribute.title),
      title: t(attribute.title),
      label: t(attribute.title),
      rows: +attribute.rows,
      as: 'textarea',
      childComponent: Form.Control,
      childOnNewLine: true,
      noPermissionDisabled: true,
    },
  }
}
</file>

<file path="editor/src/components/SurveySettings/Settings/themeOptionTypes/handleTextType.js">
import { Input } from 'components/UIComponents'
import { Entities } from 'helpers'
export const handleTextType = (attribute = {}, keyPath) => {
  return {
    keyPath: `themesettings.${keyPath}`,
    entity: Entities.themeSettings,
    props: {
      id: keyPath,
      mainText: t(attribute.title),
      childComponent: Input,
      noPermissionDisabled: true,
    },
  }
}
</file>

<file path="editor/src/components/SurveySettings/Settings/themeOptionTypes/index.js">
export * from './types'
export * from './handleButtonType'
export * from './handleDropdownType'
export * from './handleIconType'
export * from './handleTextType'
export * from './handleDurationType'
export * from './handleTextareaType'
</file>

<file path="editor/src/components/SurveySettings/Settings/themeOptionTypes/types.js">
export const TYPES = {
  BUTTONS: 'buttons',
  DROPDOWN: 'dropdown',
  COLORPICKER: 'colorpicker',
  ICON: 'icon',
  TEXT: 'text',
  TEXTAREA: 'textarea',
  DURATION: 'duration',
}
</file>

<file path="editor/src/components/SurveySettings/Settings/getGeneralSettingsBlocks.js">
import { Input, Select } from 'components/UIComponents'
import { STATES } from 'helpers'
import { getFormatOptions } from 'helpers/options'
import { Theme } from '../GeneralSettings/Theme'
export const getGeneralSettingsBlocks = () => ({
  GENERAL: {
    title: t('General'),
    settings: {
      LANGUAGES: {
        keyPath: 'additionalLanguages',
        formatUpdateValue: (languagesArray, globalStates) => {
          const { language } = globalStates[STATES.SURVEY].survey
          const languagesArrayWithoutBaseLanguage = languagesArray.filter(
            (lang) => lang !== language
          )
          const additonalLanguagesString =
            languagesArrayWithoutBaseLanguage.join(' ')
          return {
            updateValue: additonalLanguagesString,
            operationValue: languagesArrayWithoutBaseLanguage,
          }
        },
        condition: {
          update: {
            get settings() {
              return [getGeneralSettingsBlocks().GENERAL.settings.BASE_LANGUAGE]
            },
            check: (updateValue, [baseLanguage]) => {
              const baseLanguageValue = baseLanguage.value
              let baseLanguageExist = false
... (242 lines truncated)
</file>

<file path="editor/src/components/SurveySettings/Settings/getNotificationsDataSettingsBlocks.js">
import { getSettingValueFromSurvey, ignoreUpdate, STATES } from 'helpers'
import { ToggleButtons, Input } from 'components/UIComponents'
import {
  getOnOffOptions,
  getYesNoOptions,
  ONOFF_BOOLEAN,
  YESNO_BOOLEAN,
} from 'helpers/options'
export const getNotificationsDataSettingsBlocks = () => ({
  NOTIFICATIONS_DATA: {
    title: t('Notifications & data'),
    settings: {
      DATESTAMP: {
        keyPath: 'datestamp',
        props: {
          id: 'datestamp',
          mainText: t('Date stamp'),
          childComponent: ToggleButtons,
          toggleOptions: getOnOffOptions(ONOFF_BOOLEAN),
          activeDisabled: true,
          noPermissionDisabled: true,
        },
      },
      IP_ADDR: {
        keyPath: 'ipAddr',
        props: {
          id: 'ipAddr',
          mainText: t('Save IP address'),
          childComponent: ToggleButtons,
          toggleOptions: getOnOffOptions(ONOFF_BOOLEAN),
... (305 lines truncated)
</file>

<file path="editor/src/components/SurveySettings/Settings/getParticipantsSettingsBlocks.js">
import { getSettingValueFromSurvey, STATES } from 'helpers'
import { ToggleButtons, Input } from 'components/UIComponents'
import { getOnOffOptions, ONOFF_BOOLEAN } from 'helpers/options'
export const getParticipantsSettingsBlocks = () => ({
  PARTICIPANTS: {
    title: t('Participant settings'),
    settings: {
      ANONYMIZED: {
        keyPath: 'anonymized',
        props: {
          id: 'anonymize-responses',
          mainText: t('Anonymized responses'),
          childComponent: ToggleButtons,
          toggleOptions: getOnOffOptions(ONOFF_BOOLEAN),
          activeDisabled: true,
          noPermissionDisabled: true,
        },
      },
      ENABLE_PARTICIPANT_BASED_RESPONSE_PERSISTENCE: {
        keyPath: 'tokenAnswersPersistence',
        props: {
          id: 'token-answer-persistence',
          mainText: t('Enable participant-based response persistence'),
          childComponent: ToggleButtons,
          toggleOptions: getOnOffOptions(ONOFF_BOOLEAN),
          noPermissionDisabled: true,
        },
      },
      ALLOWED_IT_AFTER_COMPLETION: {
        keyPath: 'allowedItAfterCompletion',
... (121 lines truncated)
</file>

<file path="editor/src/components/SurveySettings/Settings/getPresentationSettingsBlocks.js">
import { format } from 'util'
import {
  ToggleButtons,
  Input,
  Select,
  CheckboxRadio,
} from 'components/UIComponents'
import {
  Entities,
  getSettingValueFromSurvey,
  ignoreUpdate,
  STATES,
} from 'helpers'
import { getOnOffOptions, ONOFF_BOOLEAN } from 'helpers/options'
export const getPresentationSettingsBlocks = () => ({
  DISPLAY: {
    title: t('Display'),
    settings: {
      SHOW_PROGRESS: {
        keyPath: 'showProgress',
        props: {
          id: 'show-progress-bar',
          mainText: t('Progress bar'),
          childComponent: ToggleButtons,
          toggleOptions: getOnOffOptions(ONOFF_BOOLEAN),
          noPermissionDisabled: true,
        },
      },
      SHOW_NO_ANSWER: {
        keyPath: 'showNoAnswer',
... (406 lines truncated)
</file>

<file path="editor/src/components/SurveySettings/Settings/getPresentationSettingsBlocks.test.js">
import { STATES } from 'helpers'
import { getPresentationSettingsBlocks } from './getPresentationSettingsBlocks'
describe('No answer preselection setting', () => {
  const getDisableCondition = () =>
    getPresentationSettingsBlocks().DISPLAY.settings.PRESELECT_NO_ANSWER
      .disableCondition
  const globalStatesWithShowNoAnswer = (showNoAnswer) => ({
    [STATES.SURVEY]: { survey: { showNoAnswer } },
  })
  it('is disabled when No answer is off', () => {
    expect(
      getDisableCondition().check(globalStatesWithShowNoAnswer(false))
    ).toBe(true)
  })
  it('is enabled when No answer is on', () => {
    expect(
      getDisableCondition().check(globalStatesWithShowNoAnswer(true))
    ).toBe(false)
  })
  it('remains enabled when the survey inherits the No answer setting', () => {
    expect(
      getDisableCondition().check(globalStatesWithShowNoAnswer(null))
    ).toBe(false)
  })
})
</file>

<file path="editor/src/components/SurveySettings/Settings/getPrivacyPolicySettingsBlocks.js">
import { format } from 'util'
import { Entities, getSettingValueFromSurvey, STATES } from 'helpers'
import { getOnOffOptions, ONOFF_BOOLEAN } from 'helpers/options'
import {
  ContentEditor,
  Select,
  ToggleButtons,
  Input,
  PrivacyPolicyButtons,
} from 'components/UIComponents'
export const getPrivacyPolicySettingsBlocks = () => ({
  TOGGLES: {
    settings: {
      SHOW_SURVEY_POLICY_NOTICE: {
        keyPath: 'showSurveyPolicyNotice',
        props: {
          id: 'show-survey-policy-notice',
          mainText: t(
            'Show privacy policy text with mandatory checkbox in welcome screen'
          ),
          childComponent: PrivacyPolicyButtons,
          noPermissionDisabled: true,
        },
      },
      SHOW_LEGAL_NOTICE_BUTTON: {
        keyPath: 'showLegalNoticeButton',
        props: {
          id: 'show-legal-notice',
          mainText: t('Show link to legal notice in survey footer'),
          childComponent: ToggleButtons,
... (356 lines truncated)
</file>

<file path="editor/src/components/SurveySettings/Settings/getThemeOptionsSettingsBlocks.js">
import {
  TYPES,
  handleDropdownType,
  handleButtonType,
  handleIconType,
  handleTextType,
  handleDurationType,
  handleTextareaType,
} from './themeOptionTypes'
import { handleColorPickerType } from './themeOptionTypes/handleColorPickerType'
export const getThemeOptions = (survey) => {
  const themesettings = (survey && survey.themesettings) || {}
  const keysToMap = Object.keys(themesettings)
  const options = {}
  keysToMap.forEach((keyPath) => {
    const attribute = survey.themesettings[keyPath]
    const category = survey.themesettings[keyPath].category
    if (!options[category]) {
      options[category] = { title: t(category), settings: {} }
    }
    let setting
    if (attribute.type === TYPES.BUTTONS) {
      setting = handleButtonType(attribute, keyPath)
    } else if (attribute.type === TYPES.DROPDOWN) {
      setting = handleDropdownType(attribute, keyPath, attribute.hasFileUpload)
    } else if (attribute.type === TYPES.COLORPICKER) {
      setting = handleColorPickerType(attribute, keyPath)
    } else if (attribute.type === TYPES.ICON) {
      setting = handleIconType(attribute, keyPath)
    } else if (attribute.type === TYPES.TEXT) {
... (17 lines truncated)
</file>

<file path="editor/src/components/SurveySettings/Settings/index.js">
import * as General from './getGeneralSettingsBlocks'
import * as Participants from './getParticipantsSettingsBlocks'
import * as Presentation from './getPresentationSettingsBlocks'
import * as PrivacyPolicy from './getPrivacyPolicySettingsBlocks'
import * as PublicationAccess from 'shared/getPublicationAccessSettingsBlocks'
import * as NotificationData from './getNotificationsDataSettingsBlocks'
import * as ThemeOptions from './getThemeOptionsSettingsBlocks'
export const settingsBlocks = {
  ...General,
  ...Participants,
  ...Presentation,
  ...PrivacyPolicy,
  ...PublicationAccess,
  ...NotificationData,
  ...ThemeOptions,
}
</file>

<file path="editor/src/components/SurveySettings/utils/settingHelpers.js">
import { getSettingValueFromSurvey } from 'helpers'
import { SurveySetting } from '../SurveySetting'
export const checkRenderCondition = (
  setting,
  helperSettings,
  survey,
  globalStates
) => {
  const renderCondition = setting.condition?.render
  if (!renderCondition) {
    return true
  }
  const renderSettings = renderCondition.settings.map((condSetting) => {
    const value = condSetting.helperSetting
      ? helperSettings[condSetting.keyPath]
      : getSettingValueFromSurvey(survey, condSetting)
    return {
      setting: condSetting,
      value,
    }
  })
  return renderCondition.check(renderSettings, globalStates)
}
export const applyDisableCondition = (setting, globalStates) => {
  if (!setting.disableCondition) {
    return
  }
  const shouldBeDisabled = setting.disableCondition.check(globalStates)
  setting.disabled = shouldBeDisabled
  setting.overlayMessage = setting.disableCondition.message
... (20 lines truncated)
</file>

<file path="editor/src/components/SurveySettings/utils/settingsConfig.js">
import { SURVEY_MENU_TITLES } from 'helpers'
import { settingsBlocks } from '../Settings'
import { getThemeOptions } from '../Settings/getThemeOptionsSettingsBlocks'
export const getSettingsBlocksInfo = (survey) => {
  return {
    [SURVEY_MENU_TITLES.generalSettings]: Object.values(
      settingsBlocks.getGeneralSettingsBlocks()
    ),
    [SURVEY_MENU_TITLES.dataSecurity]: Object.values(
      settingsBlocks.getPrivacyPolicySettingsBlocks()
    ),
    [SURVEY_MENU_TITLES.publication]: Object.values(
      settingsBlocks.getPublicationAccessSettingsBlocks()
    ),
    [SURVEY_MENU_TITLES.notification]: Object.values(
      settingsBlocks.getNotificationsDataSettingsBlocks()
    ),
    [SURVEY_MENU_TITLES.tokens]: Object.values(
      settingsBlocks.getParticipantsSettingsBlocks()
    ),
    [SURVEY_MENU_TITLES.presentation]: Object.values(
      settingsBlocks.getPresentationSettingsBlocks()
    ),
    [SURVEY_MENU_TITLES.themeOptions]: Object.values(getThemeOptions(survey)),
  }
}
</file>

<file path="editor/src/components/SurveySettings/utils/updateSettingHelpers.js">
import { getSettingValueFromSurvey, errorToast, Entities } from 'helpers'
export const validateSettingUpdate = (setting, value, survey) => {
  const updateConditionSettings = setting.condition?.update?.settings
  if (!updateConditionSettings) {
    return null
  }
  const settingsValue = updateConditionSettings.map((setting) => {
    return {
      setting,
      value: getSettingValueFromSurvey(survey, setting),
    }
  })
  const conditionResult = setting.condition.update.check(value, settingsValue)
  if (!conditionResult.valid) {
    errorToast(conditionResult.errorMessage)
    return { error: true }
  }
  return null
}
export const formatUpdateValue = (setting, value, globalStates) => {
  return setting.formatUpdateValue
    ? setting.formatUpdateValue(value, globalStates)
    : { updateValue: value, operationValue: value }
}
export const getUpdateKey = (setting, updateInfo) => {
  return updateInfo.updateValueKey
    ? updateInfo.updateValueKey
    : setting?.keyPath.split('.').pop()
}
export const createSurveyUpdate = (
... (82 lines truncated)
</file>

<file path="editor/src/components/SurveySettings/panelOptions.js">
import {
  PAGES,
  SURVEY_MENU_TITLES,
  decodeHTMLEntities,
  getSiteUrl,
} from 'helpers'
import { getTooltipMessages } from 'helpers/options'
export const presentationOptions = (surveyId, menuEntries) => [
  {
    label: menuEntries[SURVEY_MENU_TITLES.themeOptions]?.menuTitle,
    labelEditor: t('Theme options'),
    menu: SURVEY_MENU_TITLES.themeOptions,
  },
  {
    label: menuEntries[SURVEY_MENU_TITLES.presentation]?.menuTitle,
    labelEditor: t('Presentation'),
    menu: SURVEY_MENU_TITLES.presentation,
  },
]
export const settingsOptions = (surveyId, menuEntries) => [
  {
    label: menuEntries[SURVEY_MENU_TITLES.generalSettings]?.menuTitle,
    labelEditor: t('General'),
    menu: SURVEY_MENU_TITLES.generalSettings,
  },
  {
    label: menuEntries[SURVEY_MENU_TITLES.dataSecurity]?.menuTitle,
    labelEditor: t('Privacy policy'),
    menu: SURVEY_MENU_TITLES.dataSecurity,
  },
... (100 lines truncated)
</file>

<file path="editor/src/components/SurveySettings/SettingItem.js">
import classNames from 'classnames'
export const SettingItem = ({
  setting,
  formattedValue,
  previewUrl,
  component: Component,
  active,
  sid,
  updateSurveySetting,
  rerenderSettings,
  setRerenderSettings,
  globalStates,
  noAccessDisabled = false,
}) => {
  return (
    <div
      className={classNames('mb-2 survey-setting', {
        'survey-border-top': !setting.noBorderTop,
      })}
    >
      <Component
        options={
          setting.selectOptions ? setting.selectOptions(globalStates) : []
        }
        {...setting.props}
        value={formattedValue}
        defaultValue={formattedValue}
        previewUrl={previewUrl}
        update={(value, _setting = setting) =>
          updateSurveySetting(_setting, value)
... (15 lines truncated)
</file>

<file path="editor/src/components/SurveySettings/SurveySetting.js">
import React, { useEffect, useState } from 'react'
import { Form } from 'react-bootstrap'
import { format } from 'util'
export const SurveySetting = (props) => {
  const [rerender, setRerender] = useState(false)
  const childComponentOnNewLine = props?.childOnNewLine
  if (props.renderFullWidth) {
    return (
      <div className="mt-2">
        <Form.Label>{props.subText}</Form.Label>
        <div className={` ${props.extraClass || ''}`}>
          <props.childComponent {...props} />
        </div>
      </div>
    )
  }
  useEffect(() => {
    if (props.rerenderSettings[props.setting.keyPath] === true) {
      setRerender(true)
      props.setRerenderSettings({
        ...props.rerenderSettings,
        [props.setting.keyPath]: false,
      })
    } else if (rerender) {
      setRerender(false)
    }
  }, [props.rerenderSettings, rerender])
  if (rerender) {
    return (
      <div
... (58 lines truncated)
</file>

<file path="editor/src/components/SurveySettings/SurveySettingBlock.js">
import { decodeHTMLEntities } from 'helpers'
import { SettingItem } from './SettingItem'
import {
  checkRenderCondition,
  applyDisableCondition,
  getSettingValue,
  formatSettingValue,
  getSettingPreviewUrl,
  getSettingComponent,
} from './utils/settingHelpers'
export const SurveySettingBlock = ({
  blockSettingsInfo,
  currentOpenPanelLabel,
  globalStates,
  helperSettings,
  survey: { active = false, sid = '' },
  survey,
  updateSurveySetting,
  rerenderSettings,
  setRerenderSettings,
}) => {
  return (
    <div className="settings-block p-4 mb-4 bg-white">
      <div className="d-flex justify-content-between">
        <h5>
          {decodeHTMLEntities(blockSettingsInfo.title || currentOpenPanelLabel)}
        </h5>
      </div>
      {Object.entries(blockSettingsInfo.settings ?? {}).map(
        ([settingKey, setting]) => {
... (46 lines truncated)
</file>

<file path="editor/src/components/SurveySettings/SurveySettings.js">
import { useEffect, useMemo, useState, useCallback } from 'react'
import { useParams } from 'react-router-dom'
import { useAppState, useSurvey, useBuffer, useGlobalStates } from 'hooks'
import {
  STATES,
  getSettingValueFromSurvey,
  ignoreUpdate,
  createBufferOperation,
  Entities,
} from 'helpers'
import { getSurveyPanels } from 'helpers/options'
import { AdvancedOptionsSettings } from './AdvancedOptions'
import { SettingsBlocksRenderer } from './components/SettingsBlocksRenderer'
import { getSettingsBlocksInfo } from './utils/settingsConfig'
import {
  validateSettingUpdate,
  formatUpdateValue,
  getUpdateKey,
  createSurveyUpdate,
  createBufferOperationForSetting,
} from './utils/updateSettingHelpers'
export const SurveySettings = ({ id }) => {
  const { panel, menu } = useParams()
  const { survey, update } = useSurvey(id)
  const { operationsBuffer, addToBuffer } = useBuffer()
  const [rerenderSettings, setRerenderSettings] = useState({})
  const [surveyHash = {}] = useAppState(STATES.SURVEY_HASH)
  const [helperSettings = {}, setHelperSettings] = useAppState(
    STATES.HELPER_SETTINGS
  )
... (165 lines truncated)
</file>

<file path="editor/src/components/SurveySettings/SurveySettings.stories.js">
import { SurveySettings } from './SurveySettings'
export default {
  title: 'General/SurveySettings',
  component: SurveySettings,
}
export const Basic = () => {
  return <SurveySettings />
}
export const WithSurveyId = () => {
  const surveyId = '78f91e52-6028-11ed-82e1-7ac846e3af9d'
  return <SurveySettings surveyId={surveyId} />
}
</file>

<file path="editor/src/components/SurveyStatusSwitchPopup/index.js">
export * from './SurveyDeactivationPopup'
export * from './SurveyReactivationPopup'
export * from './SurveyStatusSwitchConfig'
</file>

<file path="editor/src/components/SurveyStatusSwitchPopup/SurveyDeactivationPopup.js">
import { useMemo } from 'react'
import parse from 'html-react-parser'
import {
  ExclamationIcon,
  InformationIcon,
  RadioSelectedIcon,
  RadioUnselectedIcon,
  EditPossibleIcon,
  ResponsesAvailableIcon,
  EditNotPossibleIcon,
  InvisibleIcon,
  ResponsesNotAvailableIcon,
  RecoverIcon,
} from 'components/icons'
import SurveyStatusSwitchPopup from './surveyStatusSwitchPopup'
import { SURVEY_STATUS_SWITCH_TYPES } from './SurveyStatusSwitchConfig'
import { format } from 'util'
const SurveyDeactivationPopup = ({
  surveyId,
  onConfirm,
  surveyIsExpired,
  navigateToPublication,
}) => {
  const title = useMemo(
    () => (
      <>
        {t('Do you want to stop your survey?')} <b>({surveyId})</b>
      </>
    ),
    [surveyId]
... (183 lines truncated)
</file>

<file path="editor/src/components/SurveyStatusSwitchPopup/SurveyReactivationPopup.js">
import { useMemo } from 'react'
import { format } from 'util'
import {
  ImportIcon,
  MergeIcon,
  RadioSelectedIcon,
  RadioUnselectedIcon,
  ResponseTableIcon,
} from 'components/icons'
import { SURVEY_STATUS_SWITCH_TYPES } from './SurveyStatusSwitchConfig'
import SurveyStatusSwitchPopup from './surveyStatusSwitchPopup'
const SurveyReactivationPopup = ({
  surveyId,
  onConfirm,
  responseTableSelectionOptions,
}) => {
  const title = useMemo(
    () => (
      <span
        dangerouslySetInnerHTML={{
          __html: format(
            t('What do you want to do with the %sexisting%s Responses?'),
            '<b>',
            '</b>'
          ),
        }}
      />
    ),
    []
  )
... (100 lines truncated)
</file>

<file path="editor/src/components/SurveyStatusSwitchPopup/SurveyStatusSwitchConfig.js">
import parse from 'html-react-parser'
import { format } from 'util'
import { SURVEY_MENU_TITLES } from 'helpers'
import { getSurveyPanels } from 'helpers/options'
import { CheckIcon, ExclamationIcon } from 'components/icons'
export const SURVEY_STATUS_SWITCH_TYPES = {
  KEEP_RESPONSES: 'activate_and_keep_responses',
  START_FROM_SCRATCH: 'activate_and_start_from_scratch',
  DEACTIVATE: 'deactivate',
  PAUSE: 'pause',
}
export const getSurveyDeactivationToastOptions = () => {
  return {
    message: t('Your survey has been deactivated'),
    position: 'bottom-center',
    className: 'success-toast',
    leftIcon: (
      <CheckIcon className="fill-current text-success rounded-circle bg-dark me-1" />
    ),
  }
}
export const getPublicationPath = (surveyId) =>
  `/survey/${surveyId}/${getSurveyPanels().settings.panel}/${SURVEY_MENU_TITLES.publication}`
export const getSurveyPauseToastOptions = (surveyId, navigate) => {
  const publicationPath = getPublicationPath(surveyId)
  return {
    message: (
      <p className="label-m">
        {parse(
          format(
... (33 lines truncated)
</file>

<file path="editor/src/components/SurveyStatusSwitchPopup/surveyStatusSwitchPopup.js">
import React, { useCallback, useState } from 'react'
import classNames from 'classnames'
import { SwalAlert } from 'helpers'
import { SURVEY_STATUS_SWITCH_TYPES } from './SurveyStatusSwitchConfig'
import SurveyStatusSwitchPopupHeader from './SurveyStatusSwitchPopupHeader'
import SurveyStatusSwitchPopupCard from './SurveyStatusSwitchPopupCard'
import SurveyStatusSwitchPopupFooter from './SurveyStatusSwitchPopupFooter'
const SurveyStatusSwitchPopup = ({
  title,
  getCards,
  onConfirm,
  responseTableSelectionOptions,
  surveyIsExpired = false,
  navigateToPublication = () => {},
}) => {
  const [choice, setChoice] = useState(null)
  const onNavigateToPublicationClick = useCallback(() => {
    navigateToPublication()
    SwalAlert.close()
  }, [navigateToPublication])
  const cards = getCards({
    selectedChoice: choice,
    navigateToPublication: onNavigateToPublicationClick,
  })
  const handleAction = useCallback(() => {
    if (onConfirm && choice) {
      onConfirm(choice)
      SwalAlert.close()
    }
  }, [choice, onConfirm])
... (48 lines truncated)
</file>

<file path="editor/src/components/SurveyStatusSwitchPopup/SurveyStatusSwitchPopupCard.js">
import React from 'react'
import SurveyStatusSwitchPopupCardElement from './SurveyStatusSwitchPopupCardElement'
const SurveyStatusSwitchPopupCard = ({ elements = [], isDisabled }) => {
  const elementsToShow = elements.filter((element) => {
    if (!isDisabled) {
      return !element.onlyDisabled
    }
    return true
  })
  return (
    <>
      {elementsToShow.map((element, index) => (
        <div key={index}>
          <SurveyStatusSwitchPopupCardElement
            Icon={element.Icon}
            label={element.label}
            isMainElement={element.isMainElement}
            isDisabled={isDisabled && !element.onlyDisabled}
          />
        </div>
      ))}
    </>
  )
}
export default SurveyStatusSwitchPopupCard
</file>

<file path="editor/src/components/SurveyStatusSwitchPopup/SurveyStatusSwitchPopupCardElement.js">
import React from 'react'
import classNames from 'classnames'
const SurveyStatusSwitchPopupCardElement = ({
  Icon,
  label,
  isMainElement,
  isDisabled,
}) => {
  return (
    <div
      className={classNames('survey-status-switch-popup-card-element', {
        'survey-status-switch-popup-card-element--primary': isMainElement,
        'survey-status-switch-popup-card-element--secondary': !isMainElement,
        'survey-status-switch-popup-card-element--disabled': isDisabled,
      })}
    >
      {Icon && (
        <div className="survey-status-switch-popup-card-element-icon">
          <Icon size={24} />
        </div>
      )}
      <span className="survey-status-switch-popup-card-element-label">
        {label}
      </span>
    </div>
  )
}
export default SurveyStatusSwitchPopupCardElement
</file>

<file path="editor/src/components/SurveyStatusSwitchPopup/SurveyStatusSwitchPopupFooter.js">
import React, { useCallback } from 'react'
import { Button } from 'components/UIComponents'
import { SwalAlert } from 'helpers'
import SurveyStatusSwitchPopupResponsesSelect from './SurveyStatusSwitchPopupResponsesSelect'
const SurveyStatusSwitchPopupFooter = ({
  confirmButtonAction,
  confirmButtonActive,
  responseTableSelectionOptions,
  isResponsesTableSelectDisabled,
}) => {
  const handlePopupCancel = useCallback(() => SwalAlert.close(), [])
  return (
    <div className="survey-status-switch-popup-footer">
      {responseTableSelectionOptions && (
        <SurveyStatusSwitchPopupResponsesSelect
          isDisabled={isResponsesTableSelectDisabled}
          responseTableSelectionOptions={responseTableSelectionOptions}
        />
      )}
      <div className="survey-status-switch-popup-footer-right">
        <Button
          variant="secondary"
          className="survey-status-switch-popup-cancelBtn"
          onClick={handlePopupCancel}
        >
          {t('Cancel')}
        </Button>
        <Button
          className="survey-status-switch-popup-confirmBtn"
          disabled={!confirmButtonActive}
... (10 lines truncated)
</file>

<file path="editor/src/components/SurveyStatusSwitchPopup/SurveyStatusSwitchPopupHeader.js">
import { useCallback } from 'react'
import { SwalAlert } from 'helpers'
import { CloseIcon, QuestionMarkIcon } from 'components/icons'
import { Button } from 'components/UIComponents'
const SurveyStatusSwitchPopupHeader = ({ titleElement }) => {
  const handlePopupClose = useCallback(() => SwalAlert.close(), [])
  return (
    <div className="survey-status-switch-popup-header">
      <p className="survey-status-switch-popup-title">{titleElement}</p>
      <div className="survey-status-switch-popup-header-right">
        <Button
          className="survey-status-switch-popup-tooltip invisible"
          variant="link"
          style={{ padding: 0 }}
        >
          <div className="survey-status-switch-popup-tooltip-icon">
            <QuestionMarkIcon />
          </div>
          <p className="survey-status-switch-popup-tooltip-text">
            {t('See details')}
          </p>
        </Button>
        <Button
          variant="link"
          style={{ padding: 0 }}
          onClick={handlePopupClose}
        >
          <CloseIcon className="text-black fill-current" />
        </Button>
      </div>
... (5 lines truncated)
</file>

<file path="editor/src/components/SurveyStatusSwitchPopup/SurveyStatusSwitchPopupResponsesSelect.js">
import React, { useCallback, useMemo } from 'react'
import { Form } from 'react-bootstrap'
import ReactSelect from 'react-select'
import classNames from 'classnames'
import { format } from 'util'
const SurveyStatusSwitchPopupResponsesSelect = ({
  responseTableSelectionOptions,
  isDisabled,
}) => {
  const formatDateTime = useCallback((dateTimeStr) => {
    const year = dateTimeStr.substring(0, 4)
    const month = dateTimeStr.substring(4, 6)
    const day = dateTimeStr.substring(6, 8)
    const hour = dateTimeStr.substring(8, 10)
    const minute = dateTimeStr.substring(10, 12)
    const formattedDate = `${year}-${month}-${day} ${hour}:${minute}`
    return formattedDate
  }, [])
  const selectOptions = useMemo(() => {
    return responseTableSelectionOptions.options.map((option, index) => ({
      value: index,
      label: `${formatDateTime(option.timestamp)} (${option.count} responses)`,
    }))
  }, [responseTableSelectionOptions.options])
  const handleChangeSelect = (option) => {
    responseTableSelectionOptions.onChange(
      responseTableSelectionOptions.options[option.value]
    )
  }
  return (
... (74 lines truncated)
</file>

<file path="editor/src/components/SurveyStructure/stories/RowQuestionGroup.stories.js">
import { DragDropContext } from 'react-beautiful-dnd'
import { useSurvey } from 'hooks'
import { RowQuestionGroup as RowQuestionGroupComponent } from '../RowQuestionGroup'
export default {
  title: 'General/RowQuestionGroup',
  component: RowQuestionGroupComponent,
  args: { survey: {}, update: () => {} },
}
export const RowQuestionGroup = () => {
  const { survey } = useSurvey()
  return (
    <DragDropContext onDragEnd={() => {}} onDragUpdate={() => {}}>
      <RowQuestionGroupComponent
        questionGroup={survey.questionGroups[0]}
        language={survey.language}
        onTitleClick={() => {}}
      />
    </DragDropContext>
  )
}
</file>

<file path="editor/src/components/SurveyStructure/stories/SurveyStructure.stories.js">
import React, { useEffect } from 'react'
import { useAppState, useSurvey } from 'hooks'
import { SurveyStructure } from '../../SurveyStructure'
export default {
  title: 'General/SurveyStructure',
  component: SurveyStructure,
}
export const Basic = () => {
  const { survey } = useSurvey()
  const [, editorStructurePanelOpen] = useAppState(
    'editorStructurePanelOpen',
    true
  )
  useEffect(() => {
    editorStructurePanelOpen(true)
  }, [])
  return <SurveyStructure survey={survey} />
}
</file>

<file path="editor/src/components/SurveyStructure/index.js">
export { SurveyStructure } from './SurveyStructure'
</file>

<file path="editor/src/components/SurveyStructure/RowPinned.js">
import { SideBarRow } from 'components/SideBar/SideBarRow'
import { PushPinIcon } from 'components/icons'
export const RowPinned = ({ title, disabled = false }) => {
  return (
    <SideBarRow
      title={title}
      icon={<PushPinIcon />}
      style={{ marginLeft: 20 }}
      className={disabled ? 'disabled' : ''}
    />
  )
}
</file>

<file path="editor/src/components/SurveyStructure/RowQuestion.js">
import { useState } from 'react'
import { useParams } from 'react-router-dom'
import classNames from 'classnames'
import { useFocused } from 'hooks'
import { SideBarRow } from 'components/SideBar/SideBarRow'
import { QuestionListIcon } from 'components/icons'
import { SurveyLogicModal } from './SurveyLogicModal'
export const RowQuestion = ({
  question,
  language,
  provided,
  duplicateQuestion,
  deleteQuestion,
  groupIndex,
  questionIndex,
  snapshot,
  focused,
  isSurveyActive,
}) => {
  const { setFocused } = useFocused()
  const { surveyId } = useParams()
  const [showLogicModal, setShowLogicModal] = useState(false)
  return (
    <div
      className={classNames('question-body-content ', {
        'focus-element': snapshot.isDragging,
        'opacity-25': question.attributes?.hide_question?.value,
        'focus-bg-purple': focused.qid === question.qid,
        'text-white': focused.qid === question.qid,
      })}
... (54 lines truncated)
</file>

<file path="editor/src/components/SurveyStructure/RowQuestionGroup.js">
import { useState } from 'react'
import { useParams } from 'react-router-dom'
import { SideBarRow } from 'components/SideBar/SideBarRow'
import { RowQuestionsList } from './RowQuestionsList'
import { ClipBoardIcon } from 'components/icons'
import { LANGUAGE_CODES } from 'helpers'
import { useFocused } from 'hooks'
import { SurveyLogicModal } from './SurveyLogicModal'
export const RowQuestionGroup = ({
  questionGroup: { l10ns = {}, questions = [], gid },
  questionGroup = {},
  language,
  update,
  provided,
  duplicateGroup,
  deleteGroup,
  groupIndex,
  onTitleClick = () => {},
  isSurveyActive,
}) => {
  const { setFocused, focused } = useFocused()
  const { surveyId } = useParams()
  const [showLogicModal, setShowLogicModal] = useState(false)
  const handleQuestionsUpdate = (questions) => {
    update({ ...questionGroup, questions })
  }
  const handleDuplicate = () => {
    duplicateGroup()
  }
  const handleDelete = () => {
... (77 lines truncated)
</file>

<file path="editor/src/components/SurveyStructure/RowQuestionGroup.test.js">
import 'tests/mocks'
import { RowQuestionGroup } from './RowQuestionGroup'
import { waitFor, screen } from '@testing-library/react'
import userEvent from '@testing-library/user-event'
import surveyData from 'helpers/data/survey-detail.json'
import { DragDropContext } from 'react-beautiful-dnd'
import { renderWithProviders } from 'tests/testUtils'
describe('RowQuestionGroup', () => {
  test('Should be able to toggle the list', async () => {
    const questionGroup = surveyData.survey.questionGroups[0]
    renderWithProviders(
      <DragDropContext onDragEnd={() => {}} onDragUpdate={() => {}}>
        <RowQuestionGroup
          questionGroup={questionGroup}
          language={surveyData.survey.language}
          onTitleClick={() => {}}
          groupIndex={0}
        />
      </DragDropContext>
    )
    const togglerButton = await waitFor(
      () => screen.getAllByTestId('sidebar-row-toggler-button')[0]
    )
    const questionsBefore = screen.queryAllByTestId('sidebar-row-question')
    await userEvent.click(togglerButton)
    await waitFor(() => {
      const questionsAfter = screen.queryAllByTestId('sidebar-row-question')
      if (questionsBefore.length === 0) {
        expect(questionsAfter.length).toBeGreaterThanOrEqual(
          questionGroup.questions.length
... (8 lines truncated)
</file>

<file path="editor/src/components/SurveyStructure/RowQuestionsList.js">
import { useState } from 'react'
import { Draggable, Droppable } from 'react-beautiful-dnd'
import classNames from 'classnames'
import { useAppState, useBuffer, useFocused } from 'hooks'
import {
  arrayDeleteItem,
  DuplicateQuestion,
  createBufferOperation,
  STATES,
} from 'helpers'
import { ConfirmModal } from 'components/Modals'
import { RowQuestion } from './RowQuestion'
import { InsertElementAndIncrementProperty } from 'helpers/InsertElementAndIncrementProperty'
export const RowQuestionsList = ({
  questions = [],
  handleUpdate,
  language,
  groupIndex,
}) => {
  const { addToBuffer } = useBuffer()
  const { focused = {}, setFocused, unFocus } = useFocused()
  const [deleteState, setDeleteState] = useState({ show: false, index: null })
  const [isSurveyActive] = useAppState(STATES.IS_SURVEY_ACTIVE, false)
  const getQuestionDragStyle = (draggableStyle) => ({
    userSelect: 'none',
    margin: '0',
    ...draggableStyle,
  })
  const duplicateQuestion = (question, questionIndex) => {
    const cloneIndex = questionIndex + 1
... (117 lines truncated)
</file>

<file path="editor/src/components/SurveyStructure/SurveyLogicModal.js">
import React, { useEffect, useRef } from 'react'
import Tooltip from 'bootstrap/js/dist/tooltip'
import { useSurveyLogic } from 'hooks'
import { ComponentModal } from 'components/Modals'
const TOOLTIP_TEMPLATE =
  '<div class="tooltip expression-tooltip" role="tooltip">' +
  '<div class="tooltip-arrow"></div>' +
  '<div class="tooltip-inner"></div>' +
  '</div>'
export const SurveyLogicModal = ({
  show = false,
  onHide = () => {},
  sid,
  gid,
  qid,
  language,
}) => {
  const { surveyLogic, isFetching, isError } = useSurveyLogic({
    sid,
    gid,
    qid,
    language,
    enabled: show,
  })
  const contentRef = useRef(null)
  useEffect(() => {
    const root = contentRef.current
    if (!root) {
      return undefined
    }
... (47 lines truncated)
</file>

<file path="editor/src/components/SurveyStructure/SurveyStructure.js">
import { useState, useEffect } from 'react'
import { DragDropContext, Draggable, Droppable } from 'react-beautiful-dnd'
import classNames from 'classnames'
import Button from 'react-bootstrap/Button'
import { useNavigate, useParams } from 'react-router-dom'
import {
  arrayDeleteItem,
  DuplicateQuestionGroup,
  IsElementOnScreen,
  ScrollToElement,
  moveQuestionGroup,
  createBufferOperation,
  getReorganizedQuestionGroups,
  STATES,
  MoveQuestion,
  getReorganizedQuestions,
  InsertElementAndIncrementProperty,
  DuplicateQuestion,
} from 'helpers'
import {
  useFocused,
  useAppState,
  useBuffer,
  useSurvey,
  useSurveyRequestTimestamp,
} from 'hooks'
import { SideBarHeader } from 'components/SideBar'
import { CloseIcon } from 'components/icons'
import { ConfirmModal } from 'components/Modals'
import { getQuestionTypeInfo } from '../QuestionTypes'
... (366 lines truncated)
</file>

<file path="editor/src/components/SurveyStructure/SurveyStructure.test.js">
import 'tests/mocks'
import { renderWithProviders } from 'tests/testUtils'
import { SurveyStructure } from './SurveyStructure'
import { screen } from '@testing-library/react'
import surveyData from 'helpers/data/survey-detail.json'
describe('SurveyStructure', () => {
  const Survey = surveyData.survey
  test('Should have the Header and Footer', async () => {
    await renderWithProviders(<SurveyStructure />)
    const header = await screen.findByTestId('survey-structure-header')
    const footer = await screen.findByTestId('survey-structure-footer')
    expect(header).toBeDefined()
    expect(footer).toBeDefined()
  })
  test('Should have all of the survey question groups', async () => {
    await renderWithProviders(<SurveyStructure />)
    const questionGroups = await screen.findAllByTestId(
      'survey-structure-question-group'
    )
    expect(questionGroups.length).toBe(Survey?.questionGroups.length)
  })
})
</file>

<file path="editor/src/components/ThemeOptions/ThemeOptionsIconSelect.js">
import classNames from 'classnames'
import { DropdownIcon } from 'components/icons'
import { useClickOutside } from 'hooks'
import React, { useMemo, useRef, useState } from 'react'
const hexToChar = (hex) => String.fromCharCode(parseInt(hex, 16))
const ensureHashPrefix = (color) =>
  color && !color.startsWith('#') ? `#${color}` : color
const IconPreview = ({
  library,
  value,
  className = '',
  colorSwatch = false,
}) => {
  if (colorSwatch) {
    return (
      <span
        className={classNames('swatch', className)}
        style={{
          backgroundColor: ensureHashPrefix(value),
          marginRight: 5,
        }}
      />
    )
  }
  const iconClass = library === 'remixicon' ? 'ri-' : 'fa t'
  return (
    <i className={classNames(iconClass, 'icon-preview', className)}>
      {hexToChar(value)}
    </i>
  )
... (86 lines truncated)
</file>

<file path="editor/src/components/ThemeOptions/ThemeOptionsImageUpload.js">
import React from 'react'
import { DropZone } from 'components/UIComponents'
import { Entities } from 'helpers'
import { useFileService } from 'hooks'
const ThemeOptionsImageUpload = ({ previewUrl, update, setting }) => {
  const EMPTY_ZONE_TEXT = t('Drop image here or click here to select a file')
  const { fileService } = useFileService()
  const onChange = (filePath) => {
    if (!filePath) {
      return
    }
    const nativeKey = setting?.keyPath.split('.').pop()
    const fileName = filePath.split('/').pop()
    const updateValue = `image::survey::${fileName}`
    const settingOptions = {
      entity: Entities.themeSettings,
      keyPath: `themesettings.${nativeKey}`,
      type: 'dropdown',
      formatUpdateValue: () => {
        const customSettingUpdate = {
          updateValueKey: nativeKey,
          updateOperationKey: nativeKey,
          updateValue: updateValue,
          operationValue: fileName,
          filePath,
        }
        customSettingUpdate.secondaryKey = nativeKey
        customSettingUpdate.secondaryValue = updateValue
        return customSettingUpdate
      },
... (38 lines truncated)
</file>

<file path="editor/src/components/ThemeOptions/ThemeOptionsPreview.js">
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
import { useParams } from 'react-router-dom'
import classNames from 'classnames'
import { useOperationCallback, useSurvey } from 'hooks'
import { Entities, getSiteUrl, Operations } from 'helpers'
import { ExpandPreviewIcon, MinimizeIcon } from 'components/icons'
const addPopupPreviewParam = (url) => {
  const parsedUrl = new URL(url, window.location.origin)
  return parsedUrl.toString() + '&popuppreview=true'
}
const ThemeOptionsPreview = ({ shouldBeVisible = true }) => {
  const { surveyId } = useParams()
  const { survey } = useSurvey(surveyId)
  const { subscribeToOperationFinish } = useOperationCallback()
  const iframeSrc = useMemo(() => {
    const previewUrl = getSiteUrl(survey.previewLink, false)
    return addPopupPreviewParam(previewUrl)
  }, [survey.previewLink])
  const iframeRef = useRef(null)
  const prevVisibleRef = useRef(shouldBeVisible)
  const [isPreviewLarge, setIsPreviewLarge] = useState(false)
  const [previewLoading, setPreviewLoading] = useState(false)
  const togglePreviewSize = useCallback(
    () => setIsPreviewLarge((prev) => !prev),
    []
  )
  useEffect(() => {
    subscribeToOperationFinish({
      entity: Entities.themeSettings,
      operation: Operations.update,
... (56 lines truncated)
</file>

<file path="editor/src/components/TooltipContainer/TooltipContainer.js">
import React, { useId, useMemo } from 'react'
import { OverlayTrigger, Tooltip } from 'react-bootstrap'
export const TooltipContainer = ({
  children,
  offset = [0, 10],
  tip,
  placement = 'top',
  showTip = true,
  tooltipClassName = '',
}) => {
  const id = useId()
  const overlay = useMemo(
    () => (
      <Tooltip id={`tooltip-${id}`} className={tooltipClassName}>
        {tip}
      </Tooltip>
    ),
    [tip, tooltipClassName]
  )
  return (
    <OverlayTrigger
      placement={placement}
      offset={offset}
      overlay={showTip && tip ? overlay : <></>}
    >
      <span>{children}</span>
    </OverlayTrigger>
  )
}
</file>

<file path="editor/src/components/TooltipContainer/TooltipContainer.stories.js">
import { TooltipContainer } from './TooltipContainer'
export default {
  title: 'General/Tooltip',
  component: TooltipContainer,
}
export const Tooltip = () => (
  <div>
    <TooltipContainer placement={'right'} tip={`This is a tool tip`}>
      <span className="title">Hover me to see a right tooltip</span>
    </TooltipContainer>
    <br />
    <div>tooltips can have other placement like:</div>
    <div>
      top, bottom, left, right top-start, top-end, bottom-start, bottom-end,
      right-start, right-end, left-start, left-end auto, auto-start, auto-end
    </div>
  </div>
)
</file>

<file path="editor/src/components/TopBar/Button/ActionButton.js">
import { PublishSettings } from 'components/PublishSettings/PublishSettings'
import { Button, TooltipContainer } from 'components'
import { getSiteUrl, getTooltipMessages, STATES } from 'helpers'
import { useAppState } from 'hooks'
export const ActionButton = ({
  className = '',
  survey,
  operationsLength = 0,
  triggerPublish,
  showShareActionButton,
  showExportResponsesButton,
  showExportStatisticsButton,
  onExportResponsesClick,
  showPublishSettings = true,
}) => {
  const [isSurveyActive] = useAppState(STATES.IS_SURVEY_ACTIVE, false)
  if (showShareActionButton) {
    return (
      <TooltipContainer
        placement="bottom"
        showTip={!isSurveyActive}
        tip={getTooltipMessages().SURVEY_NOT_ACTIVE_NO_RESULTS}
      >
        <Button
          variant="success"
          className={className}
          href={'#/responses/' + survey.sid}
          rel="noreferrer"
          disabled={!isSurveyActive}
        >
... (41 lines truncated)
</file>

<file path="editor/src/components/TopBar/Button/ButtonBackToClassicEditor.js">
import { URLS } from 'helpers'
import classNames from 'classnames'
import { Button, TooltipContainer } from 'components'
import { ArrowBackIcon } from 'components/icons'
export const ButtonBackToClassicEditor = ({ surveyId, className = '' }) => {
  const classicEditorUrl = URLS.SURVEY_OVERVIEW + '?surveyid=' + surveyId
  return (
    <TooltipContainer
      placement="bottom"
      showTip={true}
      tip={t('Go back to classic editor')}
    >
      <Button
        href={classicEditorUrl}
        variant="light"
        className={classNames('align-items-center', className)}
      >
        <ArrowBackIcon className="me-1" />
        {t('Back to classic editor')}
      </Button>
    </TooltipContainer>
  )
}
</file>

<file path="editor/src/components/TopBar/index.js">
export * from './TopBar'
export * from './SurveyNavigation'
</file>

<file path="editor/src/components/TopBar/PreviewButton.js">
import { useMemo } from 'react'
import { Button } from 'components/UIComponents'
import { EyeIcon } from 'components/icons'
import { TooltipContainer } from 'components/TooltipContainer/TooltipContainer'
import { decodeHTMLEntities, getSurveyAccessLink, STATES } from 'helpers'
import { useAppState } from 'hooks'
export const PreviewButton = ({ survey }) => {
  const [allLanguages] = useAppState(STATES.ALL_AVAILABLE_LANGUAGES)
  const [userDetails] = useAppState(STATES.USER_DETAIL)
  const languageNames = allLanguages?.[userDetails?.lang]
  const surveyLanguages = useMemo(() => {
    if (!survey.additionalLanguages || survey.additionalLanguages === '') {
      return [survey.language]
    }
    return [survey.language, ...survey.additionalLanguages.split(' ')]
  }, [survey.language, survey.additionalLanguages])
  const languageOptions = useMemo(() => {
    return surveyLanguages.map((code) => ({
      code,
      label: decodeHTMLEntities(languageNames?.[code]?.description || code),
      href: getSurveyAccessLink({ survey, language: code }),
    }))
  }, [survey, surveyLanguages, languageNames])
  return (
    <div className="preview-button-wrapper me-2">
      <TooltipContainer
        showTip={!survey?.additionalLanguages}
        placement="bottom"
        tip={t('Preview survey')}
      >
... (37 lines truncated)
</file>

<file path="editor/src/components/TopBar/SurveyListComponent.js">
import { Form } from 'react-bootstrap'
import classNames from 'classnames'
import { L10ns, RemoveHTMLTagsInString } from 'helpers'
export const SurveyListComponent = ({
  surveyId,
  surveyList,
  activeLanguage,
  surveyTitleIsFocused,
  surveyTitleWidth,
  titleRef,
  titleSelectOffset,
  handleSurveySwitch,
}) => {
  return (
    <Form.Select
      aria-label="Default select example"
      onChange={handleSurveySwitch}
      value={surveyId}
      className={classNames('form-select-top-bar', {
        'd-none': surveyTitleIsFocused,
      })}
      style={{
        width: surveyTitleWidth + titleSelectOffset,
        height: titleRef.current?.offsetHeight,
      }}
    >
      {surveyList.map((survey) => {
        let title = L10ns({
          prop: 'title',
          language: activeLanguage,
... (19 lines truncated)
</file>

<file path="editor/src/components/TopBar/SurveyNavigation.js">
import { useLocation, useNavigate } from 'react-router-dom'
import { useMemo } from 'react'
import { useAppState } from 'hooks'
import { PAGES, STATES, SURVEY_MENU_TITLES } from 'helpers'
import { getSharingPanels } from 'shared/getSharingPanels'
import { ToggleButtons } from 'components/UIComponents/Buttons/ToggleButtons'
const isActiveMenuItem = (url, location) => {
  if (!url) {
    return false
  }
  const currentPath = location.pathname
  return currentPath === url || currentPath.startsWith(`${url}/`)
}
const EditorIcon = () => <i className="ri-pencil-line" />
const ShareIcon = () => <i className="ri-share-forward-line" />
const ResultsIcon = () => <i className="ri-bar-chart-2-line" />
const NAV_CONFIG = [
  {
    page: PAGES.EDITOR,
    value: 'editor',
    getUrl: (surveyId) => `/${PAGES.EDITOR}/${surveyId}/structure`,
  },
  {
    page: PAGES.SHARE,
    value: 'share',
    getUrl: (surveyId) =>
      `/${PAGES.SHARE}/${surveyId}/${getSharingPanels().sharing.panel}/${SURVEY_MENU_TITLES.sharingOverview}`,
  },
  {
    page: PAGES.RESPONSES,
... (44 lines truncated)
</file>

<file path="editor/src/components/TopBar/SurveyTitleSelector.js">
import { useCallback, useEffect, useRef, useState } from 'react'
import { Entities, L10ns, RemoveHTMLTagsInString } from 'helpers'
import { ContentEditor } from 'components'
import { SurveyListComponent } from './SurveyListComponent'
const TITLE_SELECT_OFFSET = 40
export const SurveyTitleSelector = ({
  surveyId,
  survey,
  surveyList,
  activeLanguage,
  onSurveyTitleChange,
  handleSurveySwitch,
  getError,
}) => {
  const [surveyTitleIsFocused, setSurveyTitleIsFocused] = useState(false)
  const titleRef = useRef(null)
  const surveyTitle = L10ns({
    prop: 'title',
    language: activeLanguage,
    l10ns: survey.languageSettings,
  })
  const [surveyTitleWidth, setSurveyTitleWidth] = useState(0)
  useEffect(() => {
    const element = titleRef.current
    if (!element) return
    const resizeObserver = new ResizeObserver((entries) => {
      for (let entry of entries) {
        const width =
          entry.borderBoxSize?.[0]?.inlineSize || entry.contentRect.width
        setSurveyTitleWidth(width)
... (51 lines truncated)
</file>

<file path="editor/src/components/TopBar/TopBar.js">
import { useEffect, useMemo, useRef, useState } from 'react'
import { useNavigate } from 'react-router-dom'
import { useAppState, useBuffer, useErrors, useSurvey } from 'hooks'
import {
  RemoveHTMLTagsInString,
  STATES,
  createBufferOperation,
  URLS,
  isSurveyExpired,
} from 'helpers'
import { AddQuestion } from 'components/Survey/AddQuestion'
import SurveyActivationHandler from 'components/PublishSettings/SurveyActivationHandler'
import LogoIcon from '../../assets/images/logo-icon-black.png'
import { SurveyTitleSelector } from './SurveyTitleSelector'
import { TopBarActions } from './TopBarActions'
import { SurveyNavigation } from './SurveyNavigation'
export const TopBar = ({
  surveyId,
  surveyActivationHandlerRef,
  showAddQuestionButton = true,
  showPublishSettings = true,
  showPreviewButton = true,
  showShareActionButton = false,
  showExportResponsesButton = false,
  showExportStatisticsButton = false,
  onExportResponsesClick,
}) => {
  const { survey, update, surveyList } = useSurvey(surveyId)
  const { getError } = useErrors()
  const navigate = useNavigate()
... (127 lines truncated)
</file>

<file path="editor/src/components/TopBar/TopBar.stories.js">
import React from 'react'
import { TopBar as TopbarComponent } from './TopBar'
export default {
  title: 'Page/Editor/TopBar',
  component: TopbarComponent,
}
export const TopBar = ({ survey }) => {
  return <TopbarComponent surveyId={survey.sid} />
}
</file>

<file path="editor/src/components/TopBar/TopBar.test.js">
import 'tests/mocks'
import { renderWithProviders } from 'tests/testUtils'
import { TopBar } from './TopBar'
import { act, screen, waitFor } from '@testing-library/react'
import userEvent from '@testing-library/user-event'
import { PAGES, STATES, URLS } from 'helpers'
import { queryClient } from 'queryClient'
import surveyData from 'helpers/data/survey-detail.json'
jest.mock('components/PublishSettings/SurveyActivationHandler', () => {
  const React = require('react')
  return React.forwardRef(function MockSurveyActivationHandler(
    { showOverViewModal, setShowOverViewModal },
    ref
  ) {
    void ref
    return (
      <>
        <button
          data-testid="overview-modal-state"
          data-open={showOverViewModal}
          onClick={() => setShowOverViewModal(false)}
        />
        <button
          data-testid="open-overview-modal"
          onClick={() => setShowOverViewModal(true)}
        />
      </>
    )
  })
})
... (141 lines truncated)
</file>

<file path="editor/src/components/TopBar/TopBarActions.js">
import { useState } from 'react'
import { useLocation, useNavigate } from 'react-router-dom'
import classNames from 'classnames'
import {
  useAppState,
  useBuffer,
  useSurvey,
  useSurveyImportService,
} from 'hooks'
import {
  createBufferOperation,
  getSiteUrl,
  getTooltipMessages,
  PAGES,
  STATES,
  SURVEY_MENU_TITLES,
} from 'helpers'
import { Dropdown } from 'components/UIComponents/Dropdown/Dropdown'
import { PreviewButton } from './PreviewButton'
import { getSharingPanels } from 'shared/getSharingPanels'
import { PLUGIN_SLOTS } from 'plugins/slots'
import { PluginSlot } from 'plugins/PluginSlot'
import { ActionButton } from './Button/ActionButton'
import { TopBarQuestionInserter } from './TopBarQuestionInserter'
import { ImportSurveyModal } from 'components/ImportSurvey'
export const TopBarActions = ({
  surveyId,
  showPreviewButton,
  isSurveyActive,
  survey,
... (250 lines truncated)
</file>

<file path="editor/src/components/TopBar/TopBarQuestionInserter.js">
import React from 'react'
import { mapValues, pick } from 'lodash'
import { QuestionTypeSelector } from 'components/QuestionTypeSelector'
import { getQuestionTypeInfo } from 'components/QuestionTypes'
import {
  RandomNumber,
  SCALE_2,
  STATES,
  NEW_OBJECT_ID_PREFIX,
  createQuestionGroup,
  createBufferOperation,
  getAnswerExample,
  getNextAnswerCode,
  getQuestionExample,
  getNextQuestionCode,
  getNextSubQuestionCode,
  isTrue,
} from 'helpers'
import { useAppState, useBuffer, useFocused, useSurvey } from 'hooks'
export const TopBarQuestionInserter = ({ surveyID }) => {
  const [, setIsAddingQuestionOrGroup] = useAppState(
    STATES.IS_ADDING_QUESTION_OR_GROUP,
    false
  )
  const [codeToQuestion] = useAppState(STATES.CODE_TO_QUESTION, {})
  const [clickedQuestionGroupIndex, setClickedQuestionGroupIndex] = useAppState(
    STATES.CLICKED_QUESTION_GROUP_INDEX,
    null
  )
  const { survey, update, language } = useSurvey(surveyID)
... (266 lines truncated)
</file>

<file path="editor/src/components/Tutorial/Tutorial.js">
import { useEffect } from 'react'
import Joyride, { ACTIONS, EVENTS, STATUS } from 'react-joyride'
import { TutorialTooltip } from './TutorialTooltip'
export const Tutorial = ({
  onHighlightAreaClick = () => {},
  onNextStep = () => {},
  onPreviousStep = () => {},
  onStepChange = () => {},
  onTutorialFinish = () => {},
  onTutorialSkip = () => {},
  tutorialState,
  setTutorialState,
}) => {
  const { run, steps, stepIndex } = tutorialState
  const handleJoyrideCallback = async (data) => {
    const { action, index, type, status } = data
    const finishedStatuses = [STATUS.FINISHED, STATUS.SKIPPED]
    const nextStepIndex = index + (action === ACTIONS.PREV ? -1 : 1)
    if (finishedStatuses.includes(status)) {
      setTutorialState({ steps, stepIndex, run: false })
      onTutorialFinish()
    }
    if (type === EVENTS.TARGET_NOT_FOUND) {
      setTimeout(() => {
        setTutorialState({
          ...tutorialState,
          stepIndex: index,
          run: true,
        })
      }, 100)
... (103 lines truncated)
</file>

<file path="editor/src/components/Tutorial/TutorialTooltip.js">
import classNames from 'classnames'
import { Button } from 'components/UIComponents'
export const TutorialTooltip = ({
  backProps,
  index,
  size,
  primaryProps,
  step,
  tooltipProps,
}) => {
  return (
    <div className="tutorial-tooltip" {...tooltipProps}>
      <div className="content-container">
        <div className="semi18">{step.title}</div>
        <div className="reg14">{step.content}</div>
      </div>
      <div className="d-flex w-100 gap-3 justify-content-between align-items-center">
        <Button
          disabled={index < 1}
          className="p-0 border-none mt-1"
          variant="none"
          {...backProps}
        >
          <i className="ri-arrow-left-line"></i>
        </Button>
        <div className="progress-bar-container">
          <div
            style={{ width: `${(index / size) * 100}%` }}
            className="progress-bar"
          ></div>
... (21 lines truncated)
</file>

<file path="editor/src/components/UIComponents/Badge/Badge.js">
import classNames from 'classnames'
export const Badge = ({ children, className }) => {
  return (
    <div className={classNames('badge-component', className)}>{children}</div>
  )
}
</file>

<file path="editor/src/components/UIComponents/Buttons/AlignButtons.js">
import ToggleButton from 'react-bootstrap/ToggleButton'
import { Form } from 'react-bootstrap'
import { AlignLeftIcon } from 'components/icons/AlignLeftIcon'
import { AlignMiddleIcon } from 'components/icons/AlignMiddleIcon'
import { AlignRightIcon } from 'components/icons/AlignRightIcon'
export const AlignButtons = ({ value, update, labelText }) => {
  return (
    <div>
      {labelText && (
        <Form.Label data-testid="align-buttons-label-text">
          {labelText}
        </Form.Label>
      )}
      <div className="lime-svg-btn-group lime-align-btn-group d-flex">
        <div data-testid="option-3">
          <ToggleButton
            id="option-3"
            type="radio"
            variant="outline-lime-svg"
            checked={value === 'right'}
            onChange={() => update('right')}
            className="d-flex me-2"
            data-testid="right-align-btn"
          >
            <div className="left-side align-items-center d-flex">
              <AlignLeftIcon className="fill-current" />
            </div>
            <div className="right-side" />
          </ToggleButton>
        </div>
... (36 lines truncated)
</file>

<file path="editor/src/components/UIComponents/Buttons/AlignButtons.test.js">
import 'tests/mocks'
import { renderWithProviders } from 'tests/testUtils'
import { AlignButtons } from './AlignButtons'
import { screen } from '@testing-library/react'
import userEvent from '@testing-library/user-event'
import { useState } from 'react'
describe('AlignButtons', () => {
  beforeEach(async () => {
    const AlignButtonsWrapper = () => {
      const [value, setValue] = useState('right')
      return (
        <>
          <p className="d-none" data-testid="output">
            {value}
          </p>
          <AlignButtons
            labelText="Aligned Buttons"
            value={value}
            update={(value) => setValue(value)}
          />
        </>
      )
    }
    await renderWithProviders(<AlignButtonsWrapper />)
  })
  test('Should display the label text', async () => {
    const labelText = screen.getByTestId('align-buttons-label-text')
    expect(labelText.innerHTML).toBe('Aligned Buttons')
  })
  test('Should output left when clicking on the left button', async () => {
... (19 lines truncated)
</file>

<file path="editor/src/components/UIComponents/Buttons/Button.js">
import React from 'react'
import BootstrapButton from 'react-bootstrap/Button'
import ContentEditable from 'react-contenteditable'
export const Button = React.forwardRef(function Button(
  {
    onClick = () => {},
    id = '',
    text,
    name = '',
    Icon,
    iconSize = 24,
    children,
    className = '',
    style = {},
    disabled = false,
    variant = 'success',
    testId = 'button',
    value = '',
    href = null,
    active = false,
    size = '',
    ariaLabel,
    type = 'button',
  },
  ref
) {
  return (
    <BootstrapButton
      name={name || id}
      variant={variant}
... (23 lines truncated)
</file>

<file path="editor/src/components/UIComponents/Buttons/CustomizeButton.js">
import React from 'react'
import classNames from 'classnames'
import pencilIcon from 'assets/icons/pencil-icon.svg'
export const CustomizeButton = ({ text, onClick, isDisabled }) => {
  return (
    <button
      disabled={isDisabled}
      onClick={onClick}
      className={classNames('customize-button-container med14-c gap-1', {
        'disable-settings': isDisabled,
      })}
    >
      <img src={pencilIcon} alt="" /> {text}
    </button>
  )
}
</file>

<file path="editor/src/components/UIComponents/Buttons/index.js">
export * from './AlignButtons'
export * from './ToggleButtons'
export * from './Button'
export * from './CustomizeButton'
export * from './PrivacyPolicyButtons'
</file>

<file path="editor/src/components/UIComponents/Buttons/PrivacyPolicyButtons.js">
import ToggleButton from 'react-bootstrap/ToggleButton'
import { Form } from 'react-bootstrap'
import { PrivacyMandatoryInlineIcon } from 'components/icons/PrivacyMandatoryInlineIcon'
import { PrivacyMandatoryPopUpIcon } from 'components/icons/PrivacyMandatoryPopUpIcon'
import { PrivacyMandatoryNoIcon } from 'components/icons/PrivacyMandatoryNoIcon'
export const PrivacyPolicyButtons = ({
  value,
  update = () => {},
  labelText,
}) => {
  const PRIVACY_POLICY_OPTIONS = [
    {
      value: 1,
      label: t('Inline'),
      Icon: PrivacyMandatoryInlineIcon,
      testId: 'inline-privacy-btn',
    },
    {
      value: 2,
      label: t('Popup/Collapsible'),
      Icon: PrivacyMandatoryPopUpIcon,
      testId: 'popup-privacy-btn',
    },
    {
      value: 0,
      label: t('Off'),
      Icon: PrivacyMandatoryNoIcon,
      testId: 'no-privacy-btn',
    },
  ]
... (32 lines truncated)
</file>

<file path="editor/src/components/UIComponents/Buttons/PrivacyPolicyButtons.test.js">
import 'tests/mocks'
import { renderWithProviders } from 'tests/testUtils'
import { PrivacyPolicyButtons } from './PrivacyPolicyButtons'
import { screen } from '@testing-library/react'
import userEvent from '@testing-library/user-event'
import { useState } from 'react'
describe('PrivacyPolicyButtons', () => {
  beforeEach(async () => {
    const PrivacyPolicyButtonsWrapper = () => {
      const [value, setValue] = useState(1)
      return (
        <>
          <p className="d-none" data-testid="output">
            {value}
          </p>
          <PrivacyPolicyButtons
            labelText="Privacy Policy Buttons"
            value={value}
            update={(value) => setValue(value)}
          />
        </>
      )
    }
    await renderWithProviders(<PrivacyPolicyButtonsWrapper />)
  })
  test('Should display the label text', async () => {
    const labelText = screen.getByTestId('privacy-policy-buttons-label-text')
    expect(labelText.innerHTML).toBe('Privacy Policy Buttons')
  })
  test('Should output 1 when clicking on the inline button', async () => {
... (19 lines truncated)
</file>

<file path="editor/src/components/UIComponents/Buttons/ResetButton.js">
import ResetIcon from 'components/icons/ResetIcon'
import { RESET_TYPES } from 'helpers'
import React, { useCallback } from 'react'
const ResetButton = ({ resetType }) => {
  const handleReset = useCallback((type) => {
    switch (type) {
      case RESET_TYPES.ThemeOptions:
        resetThemeOptions()
        break
      default:
        break
    }
  }, [])
  const resetThemeOptions = useCallback(() => {
  }, [])
  return (
    <div
      onClick={() => handleReset(resetType)}
      className="cursor-pointer d-flex align-items-center gap-2 px-2 fit mb-2"
    >
      <ResetIcon />
      <span className="text-primary">{t('Reset')}</span>
    </div>
  )
}
export default ResetButton
</file>

<file path="editor/src/components/UIComponents/Buttons/ToggleButtons.js">
import classNames from 'classnames'
import { useEffect, useState } from 'react'
import { ToggleButton, ButtonGroup, Form } from 'react-bootstrap'
import { useAppState } from 'hooks'
import { STATES } from 'helpers'
import {
  getOnOffOptions,
  getTooltipMessages,
  ONOFF_BOOLEAN,
} from 'helpers/options'
import { TooltipContainer } from 'components/TooltipContainer/TooltipContainer'
import { useQueryClient } from '@tanstack/react-query'
const getTwoConditions = () => getOnOffOptions(ONOFF_BOOLEAN)
const getThreeConditions = () => [
  { name: 'Yes', value: '1' },
  { name: 'Maybe', value: '0' },
  { name: 'No', value: '-1' },
]
export const ToggleButtons = ({
  id,
  toggleOptions,
  value = '',
  defaultValue,
  labelText,
  onOffToggle = true,
  name,
  height,
  isSecondary = false,
  onChange = () => {},
  update = () => {},
... (100 lines truncated)
</file>

<file path="editor/src/components/UIComponents/Buttons/ToggleButtons.test.js">
import 'tests/mocks'
import { useState } from 'react'
import { renderWithProviders } from 'tests/testUtils'
import { ToggleButtons } from './ToggleButtons'
import { screen } from '@testing-library/react'
import userEvent from '@testing-library/user-event'
function BasicWrapper() {
  const [value, setValue] = useState(-1)
  return (
    <div data-testid="toggle-buttons-toggle-group">
      <p className="d-none" data-testid="output">
        {JSON.stringify(value)}
      </p>
      <ToggleButtons
        id="toggle-buttons"
        value={value}
        onChange={(v) => setValue(v)}
      />
    </div>
  )
}
function WithThreeOptionsWrapper() {
  const [value, setValue] = useState(-1)
  return (
    <div data-testid="toggle-buttons-toggle-group-three-options">
      <p className="d-none" data-testid="output">
        {JSON.stringify(value)}
      </p>
      <ToggleButtons
        id="toggle-buttons"
... (79 lines truncated)
</file>

<file path="editor/src/components/UIComponents/CheckboxRadio/CheckboxRadio.js">
import React, { useState } from 'react'
import { Form } from 'react-bootstrap'
import classNames from 'classnames'
import { useAppState } from '../../../hooks'
import { STATES } from '../../../helpers'
import { getTooltipMessages } from 'helpers/options'
import { TooltipContainer } from '../../TooltipContainer/TooltipContainer'
export const CheckboxRadio = ({
  id,
  labelText = '',
  options = [],
  className = '',
  optionClassName = '',
  dataTestId = '',
  onChange = () => {},
  update = () => {},
  activeDisabled = false,
  noPermissionDisabled = false,
  noAccessDisabled = false,
  isCheckbox = true,
  groupName = '',
  value,
  hasReset = true,
}) => {
  const [isSurveyActive] = useAppState(STATES.IS_SURVEY_ACTIVE)
  const [optionsValues, setOptionsValues] = useState(value)
  const [hasSurveyUpdatePermission] = useAppState(
    STATES.HAS_SURVEY_UPDATE_PERMISSION
  )
  const disabled =
... (62 lines truncated)
</file>

<file path="editor/src/components/UIComponents/Collapsible/Collapsible.js">
import { useState } from 'react'
import classNames from 'classnames'
import { Collapse } from 'react-bootstrap'
export const Collapsible = ({
  text,
  children,
  defaultOpen = true,
  open: openProp,
  onToggle,
  className,
  unmountOnExit = false,
}) => {
  const isControlled = openProp !== undefined
  const [internalOpen, setInternalOpen] = useState(defaultOpen)
  const isOpen = isControlled ? openProp : internalOpen
  const handleToggle = () => {
    const next = !isOpen
    if (!isControlled) setInternalOpen(next)
    if (onToggle) onToggle(next)
  }
  return (
    <div className={classNames('collapsible', className)}>
      {text !== undefined && (
        <button
          type="button"
          className="collapsible-header"
          onClick={handleToggle}
          aria-expanded={isOpen}
        >
          <i
... (15 lines truncated)
</file>

<file path="editor/src/components/UIComponents/ColorPicker/ColorPicker.js">
import React, { useCallback, useEffect, useState, useRef } from 'react'
import { PopoverPicker } from './PopoverPicker'
const ColorPicker = ({ onChange = () => {}, update = () => {}, value }) => {
  const [color, setColor] = useState(value)
  const timerRef = useRef(null)
  const debounceColorUpdate = useCallback(
    (newColor) => {
      if (timerRef.current) {
        clearTimeout(timerRef.current)
      }
      timerRef.current = setTimeout(() => {
        onChange(newColor)
        update(newColor)
        timerRef.current = null
      }, 400)
    },
    [onChange, update]
  )
  const onColorChange = useCallback(
    (newColor) => {
      setColor(newColor)
      debounceColorUpdate(newColor)
    },
    [debounceColorUpdate]
  )
  useEffect(() => {
    setColor(value)
  }, [value])
  useEffect(() => {
    return () => {
... (10 lines truncated)
</file>

<file path="editor/src/components/UIComponents/ColorPicker/PopoverPicker.js">
import React, { useCallback, useRef, useState } from 'react'
import { HexColorPicker } from 'react-colorful'
import { useClickOutside } from 'hooks'
import { DropdownIcon } from 'components/icons'
const expandHex = (hex) => {
  const short = /^#?([a-f\d])([a-f\d])([a-f\d])$/i.exec(hex)
  if (short)
    return `#${short[1]}${short[1]}${short[2]}${short[2]}${short[3]}${short[3]}`
  return hex
}
const hexToRgb = (hex) => {
  const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(
    expandHex(hex)
  )
  return result
    ? {
        r: parseInt(result[1], 16),
        g: parseInt(result[2], 16),
        b: parseInt(result[3], 16),
      }
    : { r: 0, g: 0, b: 0 }
}
const rgbToHex = (r, g, b) =>
  '#' +
  [r, g, b]
    .map((v) => {
      const hex = Math.max(0, Math.min(255, v)).toString(16)
      return hex.length === 1 ? '0' + hex : hex
    })
    .join('')
... (87 lines truncated)
</file>

<file path="editor/src/components/UIComponents/ContentEditor/CodeEditor/CodeEditor.js">
import CodeMirror from '@uiw/react-codemirror'
import { html } from '@codemirror/lang-html'
import { EditorView } from '@codemirror/view'
import { useEffect } from 'react'
export const htmlExtensions = [html({ autoCloseTags: true })]
const codeEditorTheme = EditorView.theme({
  '&': {
    backgroundColor: '#ffffff',
    border: '2px solid #6e748c',
    borderRadius: '2px',
    padding: '12px 4px',
  },
  '&.cm-focused': {
    outline: 'none',
  },
  '.cm-gutters': {
    backgroundColor: '#f8f9fa',
    color: '#1E1E1E',
    border: 'none',
    maxWidth: '24px',
  },
  '.cm-lineNumbers': {
    fontSize: '10px',
    color: '#1E1E1E',
    textAlign: 'center',
  },
  '.cm-gutterElement': {
    display: 'flex',
    justifyContent: 'center',
    alignItems: 'center',
... (59 lines truncated)
</file>

<file path="editor/src/components/UIComponents/ContentEditor/TinyMCE/mceToolbar.js">
import {
  boldIcon,
  italicIcon,
  underlineIcon,
  verticalThreeDots,
} from './tinyMCEIcons'
export const mceToolbar = (editor) => {
  editor.ui.registry.addIcon('verticalThreeDots', verticalThreeDots)
  editor.ui.registry.addIcon('boldIcon', boldIcon)
  editor.ui.registry.addIcon('italicIcon', italicIcon)
  editor.ui.registry.addIcon('underlineIcon', underlineIcon)
  editor.ui.registry.addToggleButton('customItalic', {
    icon: 'italicIcon',
    onAction: (api) => {
      editor.execCommand('mceToggleFormat', !api.isActive(), 'italic')
    },
    onSetup: (api) => {
      api.setActive(editor.formatter.match('italic'))
      const changed = editor.formatter.formatChanged('italic', (state) =>
        api.setActive(state)
      )
      return () => changed.unbind()
    },
  })
  editor.ui.registry.addToggleButton('customBold', {
    icon: 'boldIcon',
    onAction: (api) => {
      editor.execCommand('mceToggleFormat', api.isActive(), 'bold')
    },
    onSetup: (api) => {
... (75 lines truncated)
</file>

<file path="editor/src/components/UIComponents/ContentEditor/TinyMCE/TinyMCE.js">
import React, { useEffect, useMemo, useRef, useState } from 'react'
import { Editor } from '@tinymce/tinymce-react'
import {
  htmlPopup,
  RandomNumber,
  removePlaceholderBadges,
  wrapPlaceholdersInBadges,
} from 'helpers'
import beautify from 'js-beautify'
import { CodeEditor } from '../CodeEditor/CodeEditor'
import { mceToolbar } from './mceToolbar'
import { toolbarActions } from './toolbarActions'
import { PluginSlot } from 'plugins/PluginSlot'
import { PLUGIN_SLOTS } from 'plugins/slots'
const FORCED_ROOT_BLOCK = 'p'
export const TinyMCE = ({
  testId,
  disabled = false,
  onBlur,
  onFocus,
  onKeyDown = () => {},
  handleOnChange,
  placeholder,
  value = '',
  focus,
  showToolbar = false,
  questionNumber,
  codeToQuestion = [],
  attributeDescriptions = {},
  surveyHeader = false,
... (166 lines truncated)
</file>

<file path="editor/src/components/UIComponents/ContentEditor/TinyMCE/tinyMCEIcons.js">
export const verticalThreeDots = `<svg width="2" height="14" viewBox="0 0 2 14" fill="none">
<path fillRule="evenodd" clipRule="evenodd" d="M0 13.9999L9.13912e-08 11.9999L2 11.9999L2 13.9999L0 13.9999ZM-2.62268e-07 7.99988L-1.70877e-07 5.99988L2 5.99988L2 7.99988L-2.62268e-07 7.99988ZM-5.24537e-07 1.99988L-4.33146e-07 -0.00012207L2 -0.000122158L2 1.99988L-5.24537e-07 1.99988Z" fill="#1E1E1E"/>
</svg>
`
export const boldIcon = `<svg  viewBox="0 0 24 24" width="24" height="24"  ><path  d="M8 11H12.5C13.8807 11 15 9.88071 15 8.5C15 7.11929 13.8807 6 12.5 6H8V11ZM18 15.5C18 17.9853 15.9853 20 13.5 20H6V4H12.5C14.9853 4 17 6.01472 17 8.5C17 9.70431 16.5269 10.7981 15.7564 11.6058C17.0979 12.3847 18 13.837 18 15.5ZM8 13V18H13.5C14.8807 18 16 16.8807 16 15.5C16 14.1193 14.8807 13 13.5 13H8Z"></path></svg>`
export const italicIcon = `<svg viewBox="0 0 24 24" width="24" height="24"><path d="M15 20H7V18H9.92661L12.0425 6H9V4H17V6H14.0734L11.9575 18H15V20Z"></path></svg>`
export const underlineIcon = `<svg viewBox="0 0 24 24" width="24" height="24"><path d="M12 17C8.68629 17 6 14.3137 6 11V4H8V11C8 13.2091 9.79086 15 12 15C14.2091 15 16 13.2091 16 11V4H18V11C18 14.3137 15.3137 17 12 17ZM5 20V18H19V20H5Z"></path></svg>`
</file>

<file path="editor/src/components/UIComponents/ContentEditor/TinyMCE/toolbarActions.js">
import { decodeHtml, L10ns, RemoveHTMLTagsInString } from 'helpers'
export const toolbarActions = (
  editor,
  openHtmlEditorRef,
  codeToQuestionRef = {},
  attributeDescriptionsRef = {},
  questionNumber,
  language,
  surveyHeader
) => {
  editor.ui.registry.addMenuButton('toolbarActions', {
    icon: 'verticalThreeDots',
    type: 'menubutton',
    fetch: (callback) => {
      const codeToQuestion = codeToQuestionRef.current
      const previousAnswerFields = []
      if (questionNumber) {
        const entries = Object.entries(codeToQuestion ?? {})
        for (let i = 0; i < entries.length; i++) {
          const [, { question }] = entries[i]
          if (question.questionNumber >= questionNumber) {
            continue
          }
          const questionTitle = RemoveHTMLTagsInString(
            L10ns({ prop: 'question', language, l10ns: question.l10ns })
          )
          if (question.subquestions?.length) {
            question.subquestions.map((subquestion, index) => {
              const subquestionTitle =
                RemoveHTMLTagsInString(
... (115 lines truncated)
</file>

<file path="editor/src/components/UIComponents/ContentEditor/ContentEditable.js">
import { useEffect, useRef, useState } from 'react'
import ReactContentEditable from 'react-contenteditable'
import { useAppState } from 'hooks'
import {
  RemoveHTMLTagsInString,
  removePlaceholderBadges,
  ReplaceQuestionCodesWithAnswers,
  STATES,
  wrapPlaceholdersInBadges,
} from 'helpers'
import { PluginSlot } from 'plugins/PluginSlot'
import { PLUGIN_SLOTS } from 'plugins/slots'
export const ContentEditable = ({
  onFocus,
  onBlur,
  disabled,
  handleOnChange,
  value,
  placeholder,
  replaceVariables,
  focus = false,
  onKeyDown,
  testId = '',
}) => {
  const [codeToQuestion] = useAppState(STATES.CODE_TO_QUESTION, {})
  const [questionTitle, setQuestionTitle] = useState(value)
  const [isFocused, setIsFocused] = useState(false)
  const inputRef = useRef(null)
  const onChange = (value) => {
    const parsedValue = RemoveHTMLTagsInString(removePlaceholderBadges(value), [
... (54 lines truncated)
</file>

<file path="editor/src/components/UIComponents/ContentEditor/ContentEditor.js">
import React, { useEffect, useState } from 'react'
import { useAppState } from 'hooks'
import { RemoveHTMLTagsInString, STATES } from 'helpers'
import { getTooltipMessages } from 'helpers/options'
import { TooltipContainer } from 'components/TooltipContainer/TooltipContainer'
import { TinyMCE } from './TinyMCE/TinyMCE'
import { ContentEditable } from './ContentEditable'
export const ContentEditor = ({
  value = '',
  placeholder = '',
  className = '',
  update = () => {},
  onFocus = () => {},
  onBlur = () => {},
  onClick = () => {},
  setErrors = () => {},
  onKeyDown = () => {},
  style = {},
  testValidation,
  id,
  focus = false,
  disabled = false,
  replaceVariables = false,
  editorRef,
  noPermissionDisabled = false,
  noAccessDisabled = false,
  showToolTip = true,
  toolTipPlacement = 'top',
  testId = 'content-editor',
  showToolbar = false,
... (101 lines truncated)
</file>

<file path="editor/src/components/UIComponents/ContentEditor/ContentEditor.test.js">
import 'tests/mocks'
import { screen } from '@testing-library/react'
import userEvent from '@testing-library/user-event'
import { renderWithProviders } from 'tests/testUtils'
import { ContentEditor } from './ContentEditor'
jest.mock('./TinyMCE/TinyMCE', () => {
  const React = require('react')
  return {
    TinyMCE: ({ testId = 'content-editor' }) =>
      React.createElement('div', {
        'data-testid': `${testId}-tinymce`,
      }),
  }
})
describe('ContentEditor', () => {
  test('Should have the value "random text 123"', async () => {
    await renderWithProviders(
      <ContentEditor testId="content-editor" placeholder="Enter your comment" />
    )
    const contentEditor = screen.getByTestId('content-editor')
    await userEvent.type(contentEditor, 'random text 123')
    expect(contentEditor.innerHTML).toBe('random text 123')
  })
  test('Should render TinyMCE when toolbar is enabled', async () => {
    await renderWithProviders(
      <ContentEditor
        testId="content-editor"
        placeholder="Enter your comment"
        showToolbar={true}
      />
... (5 lines truncated)
</file>

<file path="editor/src/components/UIComponents/DateRangePicker/DateRangePicker.js">
import { useRef, useState } from 'react'
import { DateRangePicker as ReactDateRangePicker } from 'react-date-range'
import { format } from 'date-fns'
import { useElementClick } from 'hooks/useElementClick'
import { Button } from '../Buttons'
export const DateRangePicker = ({
  startDate = null,
  endDate = null,
  minDate = new Date('2000-04-17T15:30'),
  maxDate = new Date('2050-04-17T15:30'),
  onUpdate = () => {},
  dateFormat = 'yyyy-MM-dd',
}) => {
  const [range, setRange] = useState([
    {
      startDate,
      endDate,
      key: 'selection',
    },
  ])
  const [tempRange, setTempRange] = useState([
    {
      startDate,
      endDate,
      key: 'selection',
    },
  ])
  const [showPicker, setShowPicker] = useState(false)
  const triggerRef = useRef(null)
  const [pickerPosition, setPickerPosition] = useState({ top: 0, left: 0 })
... (84 lines truncated)
</file>

<file path="editor/src/components/UIComponents/DateTimePicker/DateTimePicker.js">
import { useState } from 'react'
import { Form } from 'react-bootstrap'
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider'
import { DateTimePicker } from '@mui/x-date-pickers/DateTimePicker'
import { DateIcon, CloseIcon } from 'components/icons'
import { TooltipContainer } from 'components/TooltipContainer/TooltipContainer'
import { useAppState } from 'hooks'
import { dayJsHelper, STATES, getTooltipMessages } from 'helpers'
export const DateTimePickerComponent = ({
  labelText,
  defaultValue,
  update = () => {},
  minDate = dayJsHelper('2000-04-17T15:30'),
  maxDate = dayJsHelper('2050-04-17T15:30'),
  noPermissionDisabled = false,
  noAccessDisabled = false,
  values = [],
  onValueChange: onParticipantValueChange = () => {},
  participantMode = false,
  closeOnSelect = true,
}) => {
  const valueInfo = values?.[0]
  const [hasSurveyUpdatePermission] = useAppState(
    STATES.HAS_SURVEY_UPDATE_PERMISSION
  )
  const [open, setOpen] = useState(false)
  const [value, setValue] = useState(
    defaultValue ? dayJsHelper(defaultValue) : null
  )
... (110 lines truncated)
</file>

<file path="editor/src/components/UIComponents/DragAndDrop/DragAndDrop.js">
import { DragDropContext, Droppable } from 'react-beautiful-dnd'
import { useAppState } from '../../../hooks'
import { errorToast, STATES } from '../../../helpers'
import { getTooltipMessages } from 'helpers/options'
export const DragAndDrop = ({
  children,
  onDragStart,
  onDragEnd,
  droppableId,
  className,
  direction = 'vertical',
  dataTestId = 'drag-and-drop',
  isDropDisabled = false,
  surveyActiveDisable = true,
}) => {
  const [isSurveyActive] = useAppState(STATES.IS_SURVEY_ACTIVE)
  const [hasSurveyUpdatePermission] = useAppState(
    STATES.HAS_SURVEY_UPDATE_PERMISSION
  )
  const disabled =
    (isSurveyActive && surveyActiveDisable) ||
    isDropDisabled ||
    !hasSurveyUpdatePermission
  const handleOnDragEnd = (result) => {
    if ((isSurveyActive && surveyActiveDisable) || !hasSurveyUpdatePermission)
      errorToast(
        isSurveyActive && surveyActiveDisable
          ? getTooltipMessages().ACTIVE_DISABLED
          : getTooltipMessages().NO_PERMISSION
      )
... (28 lines truncated)
</file>

<file path="editor/src/components/UIComponents/DragAndDrop/DragAndDrop.test.js">
import 'tests/mocks'
import { DragAndDrop } from './DragAndDrop'
import { renderWithProviders } from 'tests/testUtils'
import { screen } from '@testing-library/react'
import { useState } from 'react'
import { Draggable } from 'react-beautiful-dnd'
import { DragDropContext } from 'react-beautiful-dnd'
import { DragIcon } from 'components/icons'
const DATA = [
  { value: 'A', qid: '1', aid: 'a' },
  { value: 'B', qid: '2', aid: 'b' },
  { value: 'C', qid: '3', aid: 'c' },
  { value: 'D', qid: '4', aid: 'd' },
]
function arrayMove(arr, fromIndex, toIndex) {
  const arrayData = [...arr]
  const element = arr[fromIndex]
  arrayData.splice(fromIndex, 1)
  arrayData.splice(toIndex, 0, element)
  return arrayData
}
describe('DragAndDrop', () => {
  test('Should render DragAndDrop correctly', async () => {
    const DragAndDropWrapper = () => {
      const [testData, setTestData] = useState(DATA)
      const handleOnDragEnd = (result) => {
        const { source, destination } = result
        if (!destination) {
          return
        }
... (50 lines truncated)
</file>

<file path="editor/src/components/UIComponents/Dropdown/Dropdown.js">
import React, { useState } from 'react'
import { createPortal } from 'react-dom'
import { Dropdown as BootstrapDropdown } from 'react-bootstrap'
import classNames from 'classnames'
import { TooltipContainer } from 'components/TooltipContainer/TooltipContainer'
const Submenu = ({
  label,
  icon,
  submenu,
  isOpen,
  onMouseEnter,
  onMouseLeave,
}) => {
  return (
    <BootstrapDropdown
      drop="end"
      show={isOpen}
      onMouseEnter={onMouseEnter}
      onMouseLeave={onMouseLeave}
    >
      <BootstrapDropdown.Toggle as="div" className="dropdown-item has-submenu">
        <span>
          <i className={icon}></i>
          {label}
        </span>
        <i className="ri-arrow-right-s-line"></i>
      </BootstrapDropdown.Toggle>
      <BootstrapDropdown.Menu
        className="dropdown-submenu"
        popperConfig={{ modifiers: [{ name: 'flip', enabled: false }] }}
... (152 lines truncated)
</file>

<file path="editor/src/components/UIComponents/DropZone/DropZone.js">
import React, {
  useCallback,
  useEffect,
  useState,
  useImperativeHandle,
  forwardRef,
} from 'react'
import { useDropzone } from 'react-dropzone'
import { Form, Button, Image } from 'react-bootstrap'
import NoImageFound from 'assets/images/no-image-found.jpg'
import { UploadIcon, DeleteIcon } from 'components/icons'
import { errorToast } from 'helpers/Alert'
import { FILE_UPLOAD_MAX_SIZE } from 'helpers/constants'
import classNames from 'classnames'
export const DropZone = forwardRef(
  (
    {
      fileService,
      onChange = () => {},
      onLoading = () => {},
      onChangePreview = () => {},
      onDelete = () => {},
      previewUrlInit = null,
      cleanPreviewOnInitValueChange = false,
      isValidImg = true,
      labelText = '',
      labelCommentText,
      emptyZoneText = t('Drop image here'),
      previewMaxHeight = '300px',
      previewMaxWidth = '100%',
... (169 lines truncated)
</file>

<file path="editor/src/components/UIComponents/DropZone/DropZone.test.js">
import 'tests/mocks'
import { renderWithProviders } from 'tests/testUtils'
import { DropZone } from './DropZone'
import { screen } from '@testing-library/react'
import userEvent from '@testing-library/user-event'
import { getNoAnswerLabel } from 'helpers'
beforeAll(() => {
  global.URL.createObjectURL = jest.fn(() => 'blob:mock-url')
  global.URL.revokeObjectURL = jest.fn()
})
describe('DropZone', () => {
  test('Should render DropZone with a label', async () => {
    await renderWithProviders(
      <DropZone
        labelText="Drop zone label"
        image={getNoAnswerLabel(true)}
        onReaderResult={() => {}}
      />
    )
    const dropzone = screen.getByTestId('dropzone')
    const input = dropzone.querySelector('input')
    const label = dropzone.querySelector('label')
    expect(dropzone).toBeInTheDocument()
    expect(input).toBeInTheDocument()
    expect(label).toHaveTextContent('Drop zone label')
  })
  test('Should handle upload', async () => {
    await renderWithProviders(
      <DropZone
        labelText="Drop zone label"
... (14 lines truncated)
</file>

<file path="editor/src/components/UIComponents/ExpressionScriptEditor/ExpressionScriptEditor.js">
import { useEffect, useState } from 'react'
import { EditorState } from '@uiw/react-codemirror'
import { EditorView } from '@codemirror/view'
import { CodeEditor } from '../ContentEditor/CodeEditor/CodeEditor'
import {
  expressionScriptDiagnostics,
  expressionScriptExtensions,
  expressionScriptTooltips,
} from './expressionScriptExtensions'
export const ExpressionScriptEditor = ({
  id = 'expression-script-editor',
  value = '',
  update,
  onChange,
  labelText,
  height = '120px',
  width = '100%',
  className = '',
  readOnly = false,
  activeDisabled = false,
  disabled = false,
  noPermissionDisabled = false,
  noAccessDisabled = false,
  hasSurveyUpdatePermission = true,
  ariaLabel,
  extensions = [],
  validateExpression,
  validationDelay = 400,
}) => {
  const [diagnostics, setDiagnostics] = useState([])
... (72 lines truncated)
</file>

<file path="editor/src/components/UIComponents/ExpressionScriptEditor/expressionScriptExtensions.js">
import {
  Decoration,
  EditorView,
  hoverTooltip,
  ViewPlugin,
} from '@codemirror/view'
const KEYWORDS = new Set(['and', 'or', 'not', 'true', 'false', 'null'])
const OPENING_BRACKETS = new Set(['(', '[', '{'])
const CLOSING_BRACKETS = new Map([
  [')', '('],
  [']', '['],
  ['}', '{'],
])
const isIdentifierStart = (character) => /[A-Za-z_$]/.test(character)
const isIdentifierPart = (character) => /[A-Za-z0-9_$.:]/.test(character)
export const tokenizeExpressionScript = (content) => {
  const tokens = []
  const brackets = []
  let index = 0
  const addToken = (from, to, type, message = '') => {
    const token = { from, to, type, message }
    tokens.push(token)
    return token
  }
  while (index < content.length) {
    const character = content[index]
    if (/\s/.test(character)) {
      index += 1
      continue
    }
... (255 lines truncated)
</file>

<file path="editor/src/components/UIComponents/ExpressionScriptEditor/expressionScriptExtensions.test.js">
import {
  expressionScriptDiagnostics,
  findExpressionScriptIssue,
  tokenizeExpressionScript,
} from './expressionScriptExtensions'
describe('Expression Script highlighting', () => {
  it('recognises the main Expression Script token types', () => {
    const tokens = tokenizeExpressionScript(
      'if(Q01.NAOK >= 2 and is_empty("answer"), true, false)'
    )
    expect(tokens.map(({ type }) => type)).toEqual(
      expect.arrayContaining([
        'function',
        'variable',
        'operator',
        'number',
        'keyword',
        'string',
        'bracket',
        'punctuation',
      ])
    )
  })
  it('marks unmatched brackets as errors', () => {
    const tokens = tokenizeExpressionScript('(Q01 == 1')
    expect(tokens[0]).toMatchObject({
      type: 'error',
      message: 'Unmatched opening bracket',
    })
  })
... (67 lines truncated)
</file>

<file path="editor/src/components/UIComponents/ExpressionScriptEditor/index.js">
export * from './ExpressionScriptEditor'
export * from './expressionScriptExtensions'
</file>

<file path="editor/src/components/UIComponents/FileDropZone/FileDropZone.js">
import classNames from 'classnames'
import { useDropzone } from 'react-dropzone'
import { Button } from 'components/UIComponents/Buttons/Button'
import { DeleteIcon, UploadIcon } from 'components/icons'
export const FileDropZone = ({
  accept,
  disabled = false,
  error = '',
  file = null,
  helperText = '',
  id = 'file-drop-zone',
  label = '',
  maxSize,
  onChange = () => {},
  onReject = () => {},
  prompt = t('Drop file here'),
}) => {
  const { getInputProps, getRootProps, isDragActive } = useDropzone({
    accept,
    disabled,
    maxFiles: 1,
    maxSize,
    multiple: false,
    onDropAccepted: ([acceptedFile]) => onChange(acceptedFile),
    onDropRejected: onReject,
  })
  const removeFile = (event) => {
    event.stopPropagation()
    onChange(null)
  }
... (52 lines truncated)
</file>

<file path="editor/src/components/UIComponents/FileDropZone/FileDropZone.test.js">
import 'tests/mocks'
import { useState } from 'react'
import { screen } from '@testing-library/react'
import userEvent from '@testing-library/user-event'
import { renderWithProviders } from 'tests/testUtils'
import { FileDropZone } from './FileDropZone'
describe('FileDropZone', () => {
  test('selects and removes a file', async () => {
    const user = userEvent.setup()
    const onChange = jest.fn()
    const file = new File(['survey'], 'survey.lss', { type: 'text/xml' })
    const ControlledFileDropZone = () => {
      const [selectedFile, setSelectedFile] = useState(null)
      const handleChange = (nextFile) => {
        setSelectedFile(nextFile)
        onChange(nextFile)
      }
      return (
        <FileDropZone
          label="Survey file"
          file={selectedFile}
          onChange={handleChange}
        />
      )
    }
    await renderWithProviders(<ControlledFileDropZone />)
    await user.upload(await screen.findByLabelText('Survey file'), file)
    expect(onChange).toHaveBeenCalledWith(file)
    await user.click(
      screen.getByRole('button', { name: 'Remove selected file' })
... (5 lines truncated)
</file>

<file path="editor/src/components/UIComponents/FormCheck/FormCheck.js">
import React from 'react'
import { Form } from 'react-bootstrap'
import { useAppState } from '../../../hooks'
import { STATES } from '../../../helpers'
import { getTooltipMessages } from 'helpers/options'
import { TooltipContainer } from '../../TooltipContainer/TooltipContainer'
export const FormCheck = ({
  id,
  className = '',
  dataTestId = '',
  activeDisabled = false,
  noPermissionDisabled = false,
  noAccessDisabled = false,
  type,
  groupName = '',
  value,
  label,
  checked = null,
  defaultChecked = false,
  update = () => {},
  sendValueOnUpdate = false,
}) => {
  const [isSurveyActive] = useAppState(STATES.IS_SURVEY_ACTIVE)
  const [hasSurveyUpdatePermission] = useAppState(
    STATES.HAS_SURVEY_UPDATE_PERMISSION
  )
  const disabled =
    (isSurveyActive && activeDisabled) ||
    (!hasSurveyUpdatePermission && noPermissionDisabled) ||
    noAccessDisabled
... (25 lines truncated)
</file>

<file path="editor/src/components/UIComponents/ImageEditor/ImageEditor.js">
import React, { useEffect, useRef, useState } from 'react'
import AvatarEditor from 'react-avatar-editor'
import { Direction } from 'react-range'
import Modal from 'react-bootstrap/Modal'
import { Button } from 'react-bootstrap'
import { InputRange } from '../InputRange/InputRange'
import { getAndGenerateImageStyles } from 'helpers/questionImage'
export const ImageEditor = ({ showModal, onClose, imageObject, onChange }) => {
  const editor = useRef(null)
  const [selectedFile, setSelectedFile] = useState(null)
  const [isLoading, setIsLoading] = useState(false)
  useEffect(() => {
    if (imageObject) {
      setSelectedFile({ ...imageObject })
    }
  }, [imageObject])
  const handleZoomChange = (value) =>
    setSelectedFile((prev) => ({ ...prev, imageZoom: value[0] }))
  const handleRotateChange = (value) =>
    setSelectedFile((prev) => ({ ...prev, imageRotate: value[0] }))
  const handleRadiusChange = (value) =>
    setSelectedFile((prev) => ({ ...prev, imageRadius: value[0] }))
  const handlePositionChange = (position) => {
    setSelectedFile((prev) => ({
      ...prev,
      imagePositionX: position.x,
      imagePositionY: position.y,
    }))
  }
  const handleSave = () => {
... (108 lines truncated)
</file>

<file path="editor/src/components/UIComponents/Input/Input.js">
import { useEffect, useRef, useState } from 'react'
import { Form } from 'react-bootstrap'
import { useAppState } from 'hooks'
import { STATES } from 'helpers'
import { getTooltipMessages } from 'helpers/options'
import { TooltipContainer } from '../../TooltipContainer/TooltipContainer'
import { useQueryClient } from '@tanstack/react-query'
export const Input = ({
  value = null,
  defaultValue = '',
  dataTestId,
  onChange = () => {},
  onBlur = () => {},
  inputRef: inputRefProp = null,
  type = 'text',
  role = 'input',
  rows = 1,
  placeholder = t('Enter here'),
  id = '',
  Icon,
  leftIcons,
  labelText,
  paddinRight = '40px',
  paddingLeft = '40px',
  disabled = false,
  max = Infinity,
  min = -Infinity,
  className = '',
  iconClassName = '',
  style = {},
... (142 lines truncated)
</file>

<file path="editor/src/components/UIComponents/Input/Input.test.js">
import { screen } from '@testing-library/react'
import userEvent from '@testing-library/user-event'
import 'tests/mocks'
import { renderWithProviders } from 'tests/testUtils'
import { Input } from './Input'
describe('Input', () => {
  let input
  beforeEach(async () => {
    await renderWithProviders(
      <Input
        dataTestId={'input-test'}
        placeholder="Enter your name"
        labelText={'Name'}
        onChange={() => {}}
      />
    )
    input = screen.getByTestId('input-test')
  })
  afterEach(() => {
    input.remove()
  })
  test('Should have the value "random text 123"', async () => {
    await userEvent.type(input, 'random text 123')
    expect(input.value).toBe('random text 123')
  })
  test('Should be able to clear the text', async () => {
    await userEvent.type(input, 'random text')
    await userEvent.clear(input)
    expect(input.value).toBe('')
  })
... (71 lines truncated)
</file>

<file path="editor/src/components/UIComponents/Input/TextArea.js">
import classNames from 'classnames'
import React from 'react'
import { Form } from 'react-bootstrap'
import { TooltipContainer } from 'components/TooltipContainer/TooltipContainer'
import { getTooltipMessages } from 'helpers'
export const TextArea = ({
  labelText,
  labelCommentText,
  value,
  onChange = () => {},
  rows = 4,
  maxLength = 30,
  disabled = false,
  overlayMessage,
}) => {
  const toolTip = overlayMessage
    ? overlayMessage
    : getTooltipMessages().NO_PERMISSION
  return (
    <TooltipContainer tip={toolTip} showTip={disabled} placement="bottom">
      <div className="w-full">
        {labelText && (
          <Form.Label className="ui-label">
            {labelText}{' '}
            {labelCommentText && (
              <span className="fw-normal ps-1">({labelCommentText})</span>
            )}
          </Form.Label>
        )}
        <div className="position-relative">
... (18 lines truncated)
</file>

<file path="editor/src/components/UIComponents/InputRange/InputRange.js">
import React, { useEffect, useState } from 'react'
import { Direction, Range, getTrackBackground } from 'react-range'
import { Form } from 'react-bootstrap'
import { Input } from '../Input/Input'
import classNames from 'classnames'
import { getThumbStyle, THUMB_TYPES } from 'helpers'
export const InputRange = ({
  labelText,
  min = 0,
  max = 100,
  step = 1,
  value = 0,
  onChange = () => {},
  showInput = true,
  direction = Direction.Right,
  showMinMax = false,
  reverseMinMax = false,
  thumbType = THUMB_TYPES.CIRCLE,
  customUnicode = '',
}) => {
  const [values, setValues] = useState([value >= min ? value : min])
  const [callOnChange, setCallOnChange] = useState(false)
  const [horizontal, setHorizontal] = useState(
    direction === Direction.Right || direction === Direction.Left
  )
  const inputRef = React.useRef(null)
  const handleOnChange = (values) => {
    setValues([...values])
  }
  useEffect(() => {
... (149 lines truncated)
</file>

<file path="editor/src/components/UIComponents/InputRange/InputRange.test.js">
import 'tests/mocks'
import { renderWithProviders } from 'tests/testUtils'
import { InputRange } from './InputRange'
import { screen } from '@testing-library/react'
import { Direction } from 'react-range'
describe('InputRange Basic', () => {
  let container
  let input
  beforeAll(async () => {
    await renderWithProviders(<InputRange direction={Direction.Down} />)
    container = screen.getByTestId('input-range')
    input = container.querySelector('input')
  })
  test('Should render Input Range without a label correctly', async () => {
    expect(input).toBeInTheDocument()
    expect(container).toBeInTheDocument()
    expect(container.querySelector('label')).toBeNull()
  })
})
describe('InputRange Horizontal', () => {
  let container
  let input
  let slider
  beforeAll(async () => {
    await renderWithProviders(
      <InputRange labelText={'Input Range'} direction={Direction.Right} />
    )
    container = screen.getByTestId('input-range')
    input = container.querySelector('input')
    slider = screen.getByRole('slider')
... (10 lines truncated)
</file>

<file path="editor/src/components/UIComponents/LSTable/index.js">
export * from './LSTable'
export * from './RowActions'
</file>

<file path="editor/src/components/UIComponents/LSTable/LSTable.js">
import React, { useState } from 'react'
import { Table } from 'react-bootstrap'
import classNames from 'classnames'
import {
  useReactTable,
  getCoreRowModel,
  getSortedRowModel,
  flexRender,
} from '@tanstack/react-table'
const MIN_COLUMN_WIDTH = 60
const defaultGetRowId = (row, index) => row?.id ?? String(index)
const SortIcon = ({ sorted, ariaLabel }) => (
  <i
    className={classNames('ls-table__sort-icon', {
      'ri-arrow-up-s-line': sorted === 'asc',
      'ri-arrow-down-s-line': sorted === 'desc',
      'ls-table__sort-icon--active': !!sorted,
    })}
    aria-label={sorted ? ariaLabel : undefined}
    aria-hidden={!sorted}
  />
)
const ariaSort = (canSort, sorted) => {
  if (!canSort) return undefined
  if (sorted === 'desc') return 'descending'
  if (sorted === 'asc') return 'ascending'
  return 'none'
}
export const LSTable = ({
  columns,
... (175 lines truncated)
</file>

<file path="editor/src/components/UIComponents/LSTable/RowActions.js">
import React from 'react'
import { MeatballMenu } from 'components/MeatballMenu/MeatballMenu'
export const RowActions = ({
  actions = [],
  placement = 'left',
  testId = 'row-actions',
}) => {
  const items = actions.map((action) => ({
    label: action.label,
    onClick: action.onClick,
    icon: action.icon,
    className: action.danger ? 'meat-ball-delete-button' : action.className,
  }))
  return (
    <MeatballMenu
      shouldDisableIfSurveyActive={false}
      items={items}
      meatballClassName="ls-table-row-actions"
      placement={placement}
      testId={testId}
    />
  )
}
</file>

<file path="editor/src/components/UIComponents/PaginationButtons/PaginationButtons.js">
import { useMemo } from 'react'
import { format } from 'util'
import { Button } from '../Buttons'
import { DoubleGreaterThanArrow, GreaterThanArrow } from 'components/icons'
import ReactSelect from 'react-select'
export const PaginationButtons = ({
  OnPageNumberClick = () => {},
  onNextPageClick = () => {},
  onPrevPageClick = () => {},
  onFirstPageClick = () => {},
  onLastPageClick = () => {},
  onPageSizeChange = () => {},
  canGoNextPage = false,
  canGoPrevPage = false,
  currentPageIndex = 0,
  totalPages = 0,
  totalResults = 0,
  maxNumberOfButtons = 5,
  pageSize = 10,
}) => {
  const pageNumbers = useMemo(() => {
    const startPage = Math.max(
      1,
      currentPageIndex + 1 - Math.floor(maxNumberOfButtons / 2)
    )
    const endPage = Math.min(totalPages, startPage + (maxNumberOfButtons - 1))
    const pages = []
    for (let i = startPage; i <= endPage; i++) {
      pages.push(i)
    }
... (87 lines truncated)
</file>

<file path="editor/src/components/UIComponents/Range/Range.js">
import React, { useState } from 'react'
import { Range as ReactRange, getTrackBackground } from 'react-range'
export const Range = () => {
  const [values, setValues] = useState([50])
  const STEP = 0.1
  const MIN = 0
  const MAX = 100
  return (
    <div data-testid="range">
      <ReactRange
        values={values}
        step={STEP}
        min={MIN}
        max={MAX}
        onChange={(values) => setValues([...values])}
        renderTrack={({ props, children }) => (
          <div
            onMouseDown={props.onMouseDown}
            onTouchStart={props.onTouchStart}
            style={{
              ...props.style,
              height: '4px',
              display: 'flex',
              width: '100%',
            }}
          >
            <div
              ref={props.ref}
              style={{
                height: '4px',
... (56 lines truncated)
</file>

<file path="editor/src/components/UIComponents/Range/Range.test.js">
import 'tests/mocks'
import { renderWithProviders } from 'tests/testUtils'
import { Range } from './Range'
import { screen } from '@testing-library/react'
describe('Range', () => {
  test('Should render Range correctly', async () => {
    await renderWithProviders(<Range />)
    const container = screen.getByTestId('range')
    const slider = screen.getByRole('slider')
    expect(container).toBeInTheDocument()
    expect(slider).toBeInTheDocument()
  })
})
</file>

<file path="editor/src/components/UIComponents/SearchInput/SearchInput.js">
import { useEffect, useMemo, useRef, useState } from 'react'
import { Badge, CloseButton } from 'react-bootstrap'
const MAX_TERMS = 10
const TYPING_DEBOUNCE_MS = 600
export const useSearchTerms = () => {
  const [terms, setTerms] = useState([])
  const [typed, setTyped] = useState('')
  const [debouncedTyped, setDebouncedTyped] = useState('')
  useEffect(() => {
    const id = setTimeout(
      () => setDebouncedTyped(typed.trim()),
      TYPING_DEBOUNCE_MS
    )
    return () => clearTimeout(id)
  }, [typed])
  const search = useMemo(
    () =>
      debouncedTyped && !terms.includes(debouncedTyped)
        ? [...terms, debouncedTyped]
        : terms,
    [terms, debouncedTyped]
  )
  return { terms, setTerms, setTyped, search }
}
const escapeRegExp = (value) => value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
/**
 * Renders `text` with every (case-insensitive) occurrence of the search terms
 * wrapped in a highlight mark, mirroring the backend's LIKE matching.
 */
export const HighlightedText = ({ text, terms = [] }) => {
... (79 lines truncated)
</file>

<file path="editor/src/components/UIComponents/Select/ColorSelect.js">
import { Form } from 'react-bootstrap'
import ReactSelect from 'react-select'
export const ColorSelect = ({ labelText, value, options = [], onChange }) => {
  const selectedValue =
    typeof value === 'string'
      ? options.find((opt) => opt.value === value)
      : value
  const formatOptionLabel = ({ label, value }) => {
    return (
      <div className="color-select-option">
        <span
          className="color-select-preview"
          style={{ backgroundColor: value }}
        />
        <span className="color-select-label">{label}</span>
      </div>
    )
  }
  return (
    <div className="select-component color-select">
      {labelText && <Form.Label>{labelText}</Form.Label>}
      <ReactSelect
        classNames={{
          control: () => 'select',
        }}
        formatOptionLabel={formatOptionLabel}
        value={selectedValue}
        onChange={onChange}
        options={options}
        components={{
... (52 lines truncated)
</file>

<file path="editor/src/components/UIComponents/Select/Select.js">
import React, { useEffect, useState, useMemo } from 'react'
import { Form } from 'react-bootstrap'
import ReactSelect from 'react-select'
import classNames from 'classnames'
import { useQueryClient } from '@tanstack/react-query'
import { useAppState } from '../../../hooks'
import { RemoveHTMLTagsInString, STATES } from '../../../helpers'
import { getTooltipMessages } from 'helpers/options'
import { TooltipContainer } from '../../TooltipContainer/TooltipContainer'
const optionFilter = (options, fieldName, value) =>
  options.find((option) => option[fieldName] == value)
export const Select = ({
  labelText,
  options = [],
  className = '',
  dataTestId = '',
  onChange = () => {},
  update = () => {},
  value,
  disabled = false,
  activeDisabled = false,
  noPermissionDisabled = false,
  noAccessDisabled = false,
  onMenuClose = () => {},
  onMenuOpen = () => {},
  isMultiselect = false,
  defaultValue = options[0],
  menuStyle = {},
  menuClassName = '',
  placeholder = t('Please choose...'),
... (153 lines truncated)
</file>

<file path="editor/src/components/UIComponents/SettingsWrapper/SettingsWrapper.js">
import Accordion from 'react-bootstrap/Accordion'
export const SettingsWrapper = ({
  title,
  children,
  isDefaultOpen = false,
  isAdvanced = false,
  simpleSettings = false,
  isExpanded,
  onToggle,
}) => {
  if ((!isAdvanced && simpleSettings) || (isAdvanced && title === ' ')) {
    return <>{children}</>
  } else if (isAdvanced && !simpleSettings) {
    const isControlled = typeof isExpanded === 'boolean'
    if (isControlled) {
      return (
        <Accordion
          activeKey={isExpanded ? '0' : null}
          onSelect={(eventKey) => onToggle?.(eventKey === '0')}
        >
          <Accordion.Item eventKey="0">
            <Accordion.Header>{title}</Accordion.Header>
            <Accordion.Body>{children}</Accordion.Body>
          </Accordion.Item>
        </Accordion>
      )
    }
    return (
      <Accordion defaultActiveKey="0">
        <Accordion.Item eventKey={isDefaultOpen ? '0' : '1'}>
... (9 lines truncated)
</file>

<file path="editor/src/components/UIComponents/Skeletons/QuestionSkeleton.js">
import React from 'react'
import Skeleton from 'react-loading-skeleton'
export const QuestionSkeleton = React.memo(({ height }) => {
  return (
    <div style={{ height }}>
      <Skeleton height="24px" width="80%" style={{ marginBottom: '5px' }} />
      <Skeleton height="16px" count={3} />
    </div>
  )
})
QuestionSkeleton.displayName = 'QuestionSkeleton'
</file>

<file path="editor/src/components/UIComponents/stories/button/AlignButton.stories.js">
import { useState } from 'react'
import { AlignButtons as AlignButtonsComponent } from '../../Buttons/AlignButtons'
export default {
  title: 'UIComponents/Button/AlignButtons',
  component: AlignButtonsComponent,
}
export const AlignButtons = () => {
  const [value, setValue] = useState('right')
  return (
    <>
      <p className="d-none" data-testid="output">
        {value}
      </p>
      <AlignButtonsComponent
        labelText="Aligned Buttons"
        value={value}
        update={(value) => setValue(value)}
      />
    </>
  )
}
</file>

<file path="editor/src/components/UIComponents/stories/button/ToggleButton.stories.js">
import { useState } from 'react'
import { ToggleButtons } from '../../Buttons/ToggleButtons'
export default {
  title: 'UIComponents/Button/ToggleButton',
  component: ToggleButtons,
}
export function Basic(args) {
  const [value, setValue] = useState(-1)
  return (
    <div data-testid="toggle-buttons-toggle-group">
      <p className="d-none" data-testid="output">
        {JSON.stringify(value)}
      </p>
      <ToggleButtons
        id="toggle-buttons"
        value={value}
        onChange={(value) => setValue(value)}
        {...args}
      />
    </div>
  )
}
</file>

<file path="editor/src/components/UIComponents/stories/ContentEditor.stories.js">
import { ContentEditor as ContentEditorComponent } from '../ContentEditor/ContentEditor'
export default {
  title: 'UIComponents/ContentEditor',
  component: ContentEditorComponent,
}
export const ContentEditor = () => {
  return (
    <ContentEditorComponent
      testId="content-editor"
      placeholder="Enter your comment"
    />
  )
}
</file>

<file path="editor/src/components/UIComponents/stories/DateTimePicker.stories.js">
import { DateTimePickerComponent } from '../DateTimePicker/DateTimePicker'
export default {
  title: 'UIComponents/DateTimePicker',
  component: DateTimePickerComponent,
}
export const DateTimePicker = (args) => {
  return <DateTimePickerComponent {...args} />
}
</file>

<file path="editor/src/components/UIComponents/stories/DragAndDrop.stories.js">
import { Draggable } from 'react-beautiful-dnd'
import { useState } from 'react'
import { DragIcon } from 'components/icons'
import { DragAndDrop as DragAndDropComponent } from '../DragAndDrop/DragAndDrop'
export default {
  title: 'UIComponents/DragAndDrop',
  component: DragAndDropComponent,
}
const DATA = [
  { value: 'A', qid: '1', aid: 'a' },
  { value: 'B', qid: '2', aid: 'b' },
  { value: 'C', qid: '3', aid: 'c' },
  { value: 'D', qid: '4', aid: 'd' },
]
function arrayMove(arr, fromIndex, toIndex) {
  const arrayData = [...arr]
  const element = arr[fromIndex]
  arrayData.splice(fromIndex, 1)
  arrayData.splice(toIndex, 0, element)
  return arrayData
}
export const DragAndDrop = () => {
  const [testData, setTestData] = useState(DATA)
  const handleOnDragEnd = (result) => {
    const { source, destination } = result
    if (!destination) {
      return
    }
    if (source.index === destination.index) {
      return
... (35 lines truncated)
</file>

<file path="editor/src/components/UIComponents/stories/DropZone.stories.js">
import { DropZone as DropZoneComponent } from '../DropZone/DropZone'
import { getNoAnswerLabel } from 'helpers'
export default {
  title: 'UIComponents/DropZone',
  component: DropZoneComponent,
}
export const DropZone = () => {
  return (
    <DropZoneComponent
      labelText="Drop zone label"
      image={getNoAnswerLabel(true)}
      onReaderResult={() => {}}
    />
  )
}
</file>

<file path="editor/src/components/UIComponents/stories/ImageEditor.stories.js">
import { useState } from 'react'
import { ImageEditor } from '../ImageEditor/ImageEditor'
export default {
  title: 'UIComponents/ImageEditor',
  component: ImageEditor,
}
const FILE = {
  origin: 'image3.jpg',
  zoom: 1,
  rotate: 0,
  radius: 0,
}
export function Basic() {
  const [selectedFile, setSelectedFile] = useState(FILE)
  return (
    <ImageEditor
      showModal={true}
      onChange={(file) => {
        setSelectedFile({ ...file })
      }}
      file={selectedFile}
    />
  )
}
</file>

<file path="editor/src/components/UIComponents/stories/Input.stories.js">
import { useRef, useState } from 'react'
import { Input as InputComponent } from '../Input/Input'
export default {
  title: 'UIComponents/Input',
  component: InputComponent,
}
export const Input = () => {
  const [value, setValue] = useState('')
  return (
    <InputComponent
      dataTestId={'story-input-test-id'}
      placeholder="Enter your name"
      labelText={'Name'}
      value={value}
      onChange={({ target: { value } }) => setValue(value)}
    />
  )
}
export function Disabled() {
  return <Input placeholder="Disabled" labelText={'Disabled'} disabled />
}
export function Number() {
  const [value, setValue] = useState('')
  return (
    <Input
      placeholder="Enter your age"
      labelText={'Age'}
      dataTestId={'story-input-test-id'}
      value={value}
      onChange={({ target: { value } }) => setValue(value)}
... (38 lines truncated)
</file>

<file path="editor/src/components/UIComponents/stories/InputRange.stories.js">
import { InputRange } from '../InputRange/InputRange'
import { Direction } from 'react-range'
export default {
  title: 'UIComponents/InputRange',
  component: InputRange,
}
export function Basic() {
  return <InputRange direction={Direction.Down} />
}
export function Horizontal() {
  return <InputRange labelText={'Input Range'} direction={Direction.Right} />
}
</file>

<file path="editor/src/components/UIComponents/stories/LSTable.stories.js">
import { useState } from 'react'
import { LSTable, RowActions } from '../LSTable'
export default {
  title: 'UIComponents/LSTable',
  component: LSTable,
}
const sampleData = [
  { id: 1, title: 'Survey Name' },
  { id: 2, title: 'Survey Name the 2nd' },
  { id: 3, title: 'Customer Feedback Q1' },
]
const buildColumns = () => [
  {
    accessorKey: 'id',
    header: 'ID',
    enableSorting: true,
    cell: ({ getValue }) => getValue(),
  },
  {
    accessorKey: 'title',
    header: 'Survey Name',
    enableSorting: true,
    cell: ({ getValue }) => getValue(),
  },
  {
    id: 'actions',
    header: '',
    meta: { align: 'right' },
    cell: ({ row }) => (
      <RowActions
... (67 lines truncated)
</file>

<file path="editor/src/components/UIComponents/stories/Range.stories.js">
import { Range as RangeComponent } from '../Range/Range'
export default {
  title: 'UIComponents/Range',
  component: RangeComponent,
}
export const Range = () => {
  return <RangeComponent />
}
</file>

<file path="editor/src/components/UIComponents/stories/Select.stories.js">
import { useState } from 'react'
import { Select } from '../Select/Select'
export default {
  title: 'UIComponents/Select',
  component: Select,
}
const USERS = [
  { value: '1', label: 'Jack' },
  { value: '2', label: 'Han' },
  { value: '3', label: 'Alex' },
  { value: '4', label: 'Lucia' },
]
export function Basic() {
  const [selected, setSelected] = useState(USERS[2])
  const handleChange = (event) => {
    setSelected(USERS.find((el) => el.value === event.target.value))
  }
  return (
    <Select
      size="md"
      labelText="Select"
      selectedOption={selected}
      onChange={handleChange}
      options={USERS}
    />
  )
}
</file>

<file path="editor/src/components/UIComponents/index.js">
export * from './SettingsWrapper/SettingsWrapper'
export * from './DateTimePicker/DateTimePicker'
export * from './Input/Input'
export * from './Input/TextArea'
export * from './ContentEditor/ContentEditor'
export * from './ExpressionScriptEditor'
export * from './DropZone/DropZone'
export * from './FileDropZone/FileDropZone'
export * from './Select/Select'
export * from './Range/Range'
export * from './ImageEditor/ImageEditor'
export * from './InputRange/InputRange'
export * from './DragAndDrop/DragAndDrop'
export * from './Buttons'
export * from './FormCheck/FormCheck'
export * from './CheckboxRadio/CheckboxRadio'
export * from './ColorPicker/ColorPicker'
export * from './PaginationButtons/PaginationButtons'
export * from './LSTable'
export * from './Dropdown/Dropdown'
export * from './DateRangePicker/DateRangePicker'
export * from './Skeletons/QuestionSkeleton'
export * from './Collapsible/Collapsible'
export * from './Badge/Badge'
export * from './SearchInput/SearchInput'
</file>

<file path="editor/src/components/UIComponents/RatingItems.js">
import React from 'react'
import { components } from 'react-select'
import { Form } from 'react-bootstrap'
import { Select } from 'components/UIComponents'
const options = [
  { value: 'numbers', label: t('Numbers') },
  { value: 'stars', label: t('Stars') },
]
const items = [
  {
    label: '1',
    value: '1',
  },
  {
    label: '2',
    value: '2',
  },
  {
    label: '3',
    value: '3',
  },
  {
    label: '4',
    value: '4',
  },
  {
    label: '5',
    value: '5',
  },
]
... (108 lines truncated)
</file>

<file path="editor/src/components/WelcomeSettings/WelcomeSettings.js">
import { Button } from 'react-bootstrap'
import React from 'react'
import classNames from 'classnames'
import { useNavigate } from 'react-router-dom'
import { isTrue, createBufferOperation, SURVEY_MENU_TITLES } from 'helpers'
import { getSurveyPanels } from 'helpers/options'
import { useBuffer, useFocused, useSurvey } from 'hooks'
import { SideBarHeader } from 'components/SideBar'
import { SettingsWrapper, ToggleButtons } from 'components/UIComponents'
import { GetImageAttributes } from 'components/QuestionSettings/attributes/getImageAttributes'
import { CloseIcon, SettingsIcon } from '../icons'
export const WelcomeSettings = ({ surveyId }) => {
  const {
    survey: {
      imageAlign,
      showXQuestions,
      showWelcome,
      welcomeImage,
      imageBrightness,
    },
    update,
  } = useSurvey(surveyId)
  const { focused = {}, unFocus, setFocused } = useFocused()
  const { addToBuffer } = useBuffer()
  const navigate = useNavigate()
  const handleUpdate = (prop) => {
    update(prop)
    const operation = createBufferOperation(surveyId)
      .survey()
      .update({ ...prop })
... (67 lines truncated)
</file>

<file path="editor/src/components/wrappers/EditorContextController.js">
import React, { useEffect, useState } from 'react'
import { useLocation, useParams } from 'react-router-dom'
import { getQuestionTypeInfo } from 'components/QuestionTypes'
import { SiteSettingsService } from 'services'
import {
  useAppState,
  useFocused,
  useSurvey,
  useSurveyGroupsService,
  useSetAllLanguages,
  useTranslationsService,
} from 'hooks'
import {
  EntitiesType,
  STATES,
  getApiUrl,
  getGroupById,
  getQuestionById,
} from 'helpers'
import { identifyAndReportMissingTranslations } from '../../i18n/scripts/identifyAndReportMissingTranslations'
export const EditorContextController = ({ children }) => {
  const { surveyId } = useParams()
  const location = useLocation()
  const { survey = {}, update } = useSurvey(surveyId)
  const { unFocus, setFocused } = useFocused()
  const { fetchAllLanguages } = useSetAllLanguages()
  const { surveyGroupsService } = useSurveyGroupsService()
  const { translationsService } = useTranslationsService()
  const [hasNavigated, setHasNavigated] = useState(false)
  const [, setAttributeDescriptions] = useAppState(
... (153 lines truncated)
</file>

<file path="editor/src/components/wrappers/index.js">
export * from './EditorContextController'
export * from './SurveyWorkspace'
</file>

<file path="editor/src/components/wrappers/SurveyLogicProvider.js">
import React, { useEffect } from 'react'
import { useParams } from 'react-router-dom'
import { format } from 'util'
import { queryClient } from 'queryClient'
import { useAppState, useBuffer, useErrors, useFocused, useSurvey } from 'hooks'
import {
  EntitiesType,
  OperationsBuffer,
  STATES,
  errorToast,
  processValidationErrorsAndUpdateOperations,
  replaceTempIdsInSurveyAndBuffer,
  updateSurveyEntitiesData,
  dayJsHelper,
  RandomNumber,
} from 'helpers'
export const SurveyLogicProvider = ({ children }) => {
  const { surveyId } = useParams()
  const { setFocused, groupIndex, questionIndex } = useFocused()
  const { surveyPatch, fetchSurvey, update, refetchQuestionsFieldNamesMap } =
    useSurvey(surveyId)
  const { operationsBuffer, addToBuffer, setBuffer, clearBuffer } = useBuffer()
  const { setErrorsFromPatchResponse, clearErrors } = useErrors()
  const [surveyRefreshRequired, setSurveyRefreshRequired] = useAppState(
    STATES.SURVEY_REFRESH_REQUIRED
  )
  const [isPatchSurveyRunning, setIsPatchSurveyRunning] = useAppState(
    STATES.IS_PATCH_SURVEY_RUNNING,
    false
  )
... (163 lines truncated)
</file>

<file path="editor/src/components/wrappers/SurveyWorkspace.js">
import React, { useEffect } from 'react'
import { useParams } from 'react-router-dom'
import { Toaster } from 'react-hot-toast'
import { Toast } from 'helpers'
import { useErrors, useEditorCompatibilityGuard } from 'hooks'
import { ExclamationMark, XIcon } from 'components/icons'
import { FeedbackPopup } from 'components/feedback'
import { SurveyLogicProvider } from './SurveyLogicProvider'
export const SurveyWorkspace = ({ children }) => {
  const { surveyId } = useParams()
  const isIncompatible = useEditorCompatibilityGuard(surveyId)
  const { errorMessages, clearErrorMessages } = useErrors()
  useEffect(() => {
    if (!errorMessages?.length) {
      return
    }
    for (const error of errorMessages) {
      Toast({
        message: error,
        leftIcon: <ExclamationMark className="error-fill" />,
        rightIcon: <XIcon />,
      })
    }
    clearErrorMessages()
  }, [errorMessages?.length])
  if (isIncompatible) {
    return null
  }
  return (
    <SurveyLogicProvider>
... (7 lines truncated)
</file>

<file path="editor/src/components/AuthGate.js">
import { useAuth } from 'hooks'
import { useEffect } from 'react'
import { useParams } from 'react-router-dom'
import { URLS } from '../helpers'
export const AuthGate = ({ children }) => {
  const auth = useAuth()
  const { surveyId } = useParams()
  const isLoggedIn = !!auth && !!auth.isLoggedIn
  useEffect(() => {
    const timeoutId = setTimeout(() => {
      if (auth && !isLoggedIn) {
        if (!surveyId) {
          window.location = URLS.ADMIN
        } else {
          window.location = URLS.SURVEY_OVERVIEW + '?surveyid=' + surveyId
        }
      }
    }, 1000)
    return () => clearTimeout(timeoutId)
  }, [auth])
  if (isLoggedIn) {
    return children
  }
}
export default AuthGate
</file>

<file path="editor/src/components/ExportOptionsForm.js">
import { useEffect, useState } from 'react'
import { Form } from 'react-bootstrap'
import { useTranslation } from 'react-i18next'
import { decodeHTMLEntities, STATES } from 'helpers'
import { useAppState } from 'hooks'
export const ExportOptionsForm = ({
  surveyLanguage,
  additionalLanguages = '',
  onOptionsChange,
}) => {
  const { t } = useTranslation()
  const [allLanguages] = useAppState(STATES.ALL_AVAILABLE_LANGUAGES)
  const [userDetails] = useAppState(STATES.USER_DETAIL)
  const languageNames = allLanguages?.[userDetails?.lang]
  const [responseType, setResponseType] = useState('filtered')
  const [type, setType] = useState('csv')
  const [language, setLanguage] = useState(surveyLanguage)
  const [answerFormat] = useState('long')
  const [csvSeparator, setCsvSeparator] = useState(',')
  const languages = surveyLanguage ? [surveyLanguage] : []
  if (additionalLanguages && typeof additionalLanguages === 'string') {
    const additional = additionalLanguages
      .split(' ')
      .filter((l) => l && l !== surveyLanguage)
    languages.push(...additional)
  }
  const responseTypeOptions = [
    { label: t('Filtered data'), value: 'filtered' },
    { label: t('All data'), value: 'all' },
  ]
... (155 lines truncated)
</file>

<file path="editor/src/components/index.js">
export * from './UIComponents'
export * from '../pages/Editor/LeftSideBar/FeedbackButton'
export * from '../pages/Errors/NotFound'
export * from './TooltipContainer/TooltipContainer'
export * from './QuestionTypes'
export * from '../pages/SharingPanel/SharingPanel'
export * from './PublicSurveyAlias/PublicSurveyAlias'
export * from './SocialMediaShare/SocialMediaShare'
export * from './SurveyOverview/SurveyOverview'
export * from './SurveyStatusSwitchPopup'
export * from './Modals'
export * from './Survey'
export * from './Modals'
export * from './Tutorial/Tutorial'
export * from './QuestionsParticipantMode'
export * from './TopBar'
export * from './MeatballMenu/MeatballMenu'
export * from './wrappers'
export * from './feedback'
export * from './ExportOptionsForm'
</file>

<file path="editor/src/helpers/Buffer/operationsHandlers/handleAnswerOperation/handleAnswerOperation.js">
import { cloneDeep } from 'lodash'
export const handleAnswerOperation = (
  _bufferOperations,
  _operation,
  _currentOperation,
  _newQuestionOperation
) => {
  if (!_operation) {
    return {
      bufferOperations: _bufferOperations,
      newOperation: {},
      addToBuffer: false,
    }
  }
  let newOperation
  let addToBuffer = false
  const bufferOperations = cloneDeep(_bufferOperations)
  const operation = cloneDeep(_operation)
  let currentOperation = cloneDeep(_currentOperation)
  const newQuestionOperation = cloneDeep(_newQuestionOperation)
  if (newQuestionOperation) {
    newQuestionOperation.props.answers = operation.props
    newOperation = newQuestionOperation
  } else {
    if (currentOperation) {
      currentOperation.props = operation.props
    } else {
      currentOperation = operation
      addToBuffer = true
    }
... (5 lines truncated)
</file>

<file path="editor/src/helpers/Buffer/operationsHandlers/handleAnswerOperation/handleAnswerOperation.test.js">
import { Entities, NEW_OBJECT_ID_PREFIX } from 'helpers'
import { handleAnswerOperation } from './handleAnswerOperation'
describe('handleAnswerOperation', () => {
  test('Handles operation with newQuestionOperation', () => {
    const operation = {
      id: 'temp__1492592123',
      op: 'update',
      entity: 'answer',
      props: [
        {
          tempId: `${NEW_OBJECT_ID_PREFIX}1`,
          code: 'A001',
          sortOrder: 1,
          assessmentValue: 0,
          scaleId: 0,
          l10ns: {
            en: {
              answer: 'Answer 1',
              language: 'en',
            },
            de: {
              answer: 'Answer 1',
              language: 'de',
            },
          },
        },
      ],
    }
    const newQuestionOperation = {
      id: 'temp__149259',
... (214 lines truncated)
</file>

<file path="editor/src/helpers/Buffer/operationsHandlers/handleQuestionConditionOperation/handleQuestionConditionOperation.js">
import { cloneDeep, merge } from 'lodash'
import { Entities, Operations } from 'helpers'
export const handleQuestionConditionOperation = (
  _bufferOperations,
  _operation,
  _currentOperation
) => {
  if (!_operation) {
    return {
      bufferOperations: _bufferOperations,
      newOperation: {},
      addToBuffer: false,
    }
  }
  let bufferOperations = cloneDeep(_bufferOperations)
  let currentOperation = cloneDeep(_currentOperation)
  const operation = cloneDeep(_operation) || {}
  if (operation.op === Operations.delete) {
    let updatedBufferOperations = bufferOperations.filter((op) => {
      return !(
        op.id === operation.id && op.entity === Entities.questionCondition
      )
    })
    return {
      bufferOperations: updatedBufferOperations,
      newOperation: operation,
      addToBuffer: true,
    }
  }
  const newOperation = currentOperation
... (12 lines truncated)
</file>

<file path="editor/src/helpers/Buffer/operationsHandlers/handleQuestionConditionOperation/handleQuestionConditionOperation.test.js">
import { merge } from 'lodash'
import { Operations } from 'helpers'
import { handleQuestionOperation } from '../handleQuestionOperation/handleQuestionOperation'
import { handleQuestionConditionOperation } from './handleQuestionConditionOperation'
describe('handleQuestionConditionOperation Tests', () => {
  const questionConditionCreateOperation = {
    id: 108,
    entity: 'questionCondition',
    op: Operations.create,
    props: {
      qid: 108,
      scenarios: [
        {
          scid: 1,
          conditions: [
            {
              qid: 108,
              cqid: 4,
              cfieldname: 'Q108',
              cquestions: 'Q108',
              method: '<',
              value: 'test123',
              scenario: 1,
              action: 'insertCondition',
              editSourceTab: '#SRCPREVQUEST',
              editTargetTab: '#CONST',
              tempId: 'temp__602899_1',
              cid: 'temp__602899_1',
              tempcids: ['temp__602899_1'],
              ConditionConst: 'test123',
... (268 lines truncated)
</file>

<file path="editor/src/helpers/Buffer/operationsHandlers/handleQuestionGroupOperation/handleQuestionGroupOperation.js">
import { cloneDeep, merge } from 'lodash'
import { hasTempId, Operations } from 'helpers'
export const handleQuestionGroupOperation = (
  _bufferOperations = [],
  _operation,
  _currentOperation = null
) => {
  if (!_operation) {
    return {
      bufferOperations: _bufferOperations,
      newOperation: {},
      addToBuffer: false,
    }
  }
  const bufferOperations = cloneDeep(_bufferOperations)
  let currentOperation = cloneDeep(_currentOperation)
  const operation = cloneDeep(_operation) || {}
  const isAddingNewQuestionGroup = hasTempId(operation.id)
  if (operation.op === Operations.delete) {
    let updatedBufferOperations = bufferOperations.filter((op) => {
      if (operation.props?.question && operation.props.question.gid === op.id) {
        return false
      } else if (operation.id === op.id) {
        return false
      }
      return true
    })
    return {
      bufferOperations: updatedBufferOperations,
      newOperation: isAddingNewQuestionGroup ? {} : operation,
... (17 lines truncated)
</file>

<file path="editor/src/helpers/Buffer/operationsHandlers/handleQuestionGroupOperation/handleQuestionGroupOperation.test.js">
import { merge } from 'lodash'
import { handleQuestionGroupOperation } from './handleQuestionGroupOperation'
import { Operations } from 'helpers'
describe('handleQuestionGroupOperation Tests', () => {
  const createOperation = {
    id: 'temp__568708',
    op: Operations.create,
    entity: 'questionGroup',
    props: {
      questionGroup: {
        gid: 'temp__568708',
        sid: 613724,
        type: 'QG',
        theme: 'QuestionGroup',
        sortOrder: 1,
        gRelevance: '',
        tempId: 'temp__568708',
      },
      questionGroupL10n: {
        en: {
          groupName: '',
          description: '',
        },
      },
    },
  }
  const createOperation2 = {
    id: 'temp__5682270822',
    op: Operations.create,
    entity: 'questionGroup',
... (163 lines truncated)
</file>

<file path="editor/src/helpers/Buffer/operationsHandlers/handleQuestionOperation/handleQuestionOperation.js">
import { cloneDeep, merge } from 'lodash'
import { Operations, hasTempId } from 'helpers'
export const handleQuestionOperation = (
  _bufferOperations,
  _operation,
  _currentOperation
) => {
  if (!_operation) {
    return {
      bufferOperations: _bufferOperations,
      newOperation: {},
      addToBuffer: false,
    }
  }
  let bufferOperations = cloneDeep(_bufferOperations)
  let currentOperation = cloneDeep(_currentOperation)
  const operation = cloneDeep(_operation) || {}
  const questionHasATempId = hasTempId(operation.id)
  if (operation.op === Operations.delete) {
    let updatedBufferOperations = bufferOperations.filter((op) => {
      if (op.id === operation.id) {
        return false
      }
      return true
    })
    return {
      bufferOperations: updatedBufferOperations,
      newOperation: questionHasATempId ? {} : operation,
      addToBuffer: !questionHasATempId,
    }
... (14 lines truncated)
</file>

<file path="editor/src/helpers/Buffer/operationsHandlers/handleQuestionOperation/handleQuestionOperation.test.js">
import { handleQuestionOperation } from './handleQuestionOperation'
import { NEW_OBJECT_ID_PREFIX, Operations } from 'helpers'
import { cloneDeep, merge } from 'lodash'
describe('handleQuestionOperation Tests', () => {
  const questionCreateOperation = {
    entity: 'question',
    op: Operations.create,
    id: `${NEW_OBJECT_ID_PREFIX}1`,
    tempId: `${NEW_OBJECT_ID_PREFIX}1`,
    props: {
      question: {
        qid: `${NEW_OBJECT_ID_PREFIX}1`,
        tempId: `${NEW_OBJECT_ID_PREFIX}1`,
        title: 'G01Q06',
        type: '1',
        questionThemeName: 'arrays/dualscale',
        gid: '1',
        mandatory: false,
        relevance: '1',
        encrypted: false,
        saveAsDefault: false,
      },
      questionL10n: {
        en: {
          question: 'Array Question',
          help: 'Help text',
        },
        de: {
          question: 'Array ger',
          help: 'help ger',
... (252 lines truncated)
</file>

<file path="editor/src/helpers/Buffer/operationsHandlers/handleSubquestionOperation/handleSubquestionOperation.js">
import { cloneDeep } from 'lodash'
export const handleSubquestionOperation = (
  _bufferOperations,
  _operation,
  _currentOperation,
  _newQuestionOperation
) => {
  if (!_operation) {
    return {
      bufferOperations: _bufferOperations,
      newOperation: {},
      addToBuffer: false,
    }
  }
  let newOperation
  let addToBuffer = false
  const bufferOperations = cloneDeep(_bufferOperations)
  const operation = cloneDeep(_operation)
  let currentOperation = cloneDeep(_currentOperation)
  const newQuestionOperation = cloneDeep(_newQuestionOperation)
  if (newQuestionOperation) {
    newQuestionOperation.props.subquestions = operation.props
    newOperation = newQuestionOperation
  } else {
    if (currentOperation) {
      currentOperation.props = operation.props
    } else {
      currentOperation = operation
      addToBuffer = true
    }
... (5 lines truncated)
</file>

<file path="editor/src/helpers/Buffer/operationsHandlers/handleSubquestionOperation/handleSubquestionOperation.test.js">
import { handleSubquestionOperation } from './handleSubquestionOperation'
import { cloneDeep } from 'lodash'
import { Operations } from 'helpers'
describe('handleSubquestionOperation Tests', () => {
  const subquestionOperation = {
    id: 'temp__149259',
    op: Operations.update,
    entity: 'subquestion',
    props: [
      {
        qid: 'temp__149259212',
        parentQid: 'temp__149259',
        sid: 596477,
        type: 'T',
        title: 'SQ001',
        preg: null,
        other: false,
        mandatory: null,
        encrypted: false,
        sortOrder: 0,
        scaleId: 0,
        questionThemeName: 'longfreetext',
        gid: 5,
        relevance: '1',
        l10ns: {
          en: {
            id: 73,
            qid: 71,
            question: 'Subquestion 1',
            language: 'en',
... (122 lines truncated)
</file>

<file path="editor/src/helpers/Buffer/operationsHandlers/handleSurveyOperation/handleSurveyOperation.js">
import { cloneDeep, merge } from 'lodash'
export const handleSurveyOperation = (
  _bufferOperations,
  _operation,
  _currentOperation
) => {
  if (!_operation) {
    return {
      bufferOperations: _bufferOperations,
      newOperation: {},
      addToBuffer: false,
    }
  }
  const bufferOperations = cloneDeep(_bufferOperations)
  const operation = cloneDeep(_operation)
  let currentOperation = cloneDeep(_currentOperation)
  if (currentOperation) {
    const newOperation = {
      ...currentOperation,
      props: merge({}, currentOperation.props, operation.props),
    }
    if (operation.props.additionalLanguages) {
      newOperation.props.additionalLanguages =
        operation.props.additionalLanguages
    }
    return { bufferOperations, newOperation, addToBuffer: false }
  }
  return { bufferOperations, newOperation: operation, addToBuffer: true }
}
</file>

<file path="editor/src/helpers/Buffer/operationsHandlers/handleSurveyOperation/handleSurveyOperation.test.js">
import { cloneDeep, merge } from 'lodash'
import { Operations } from 'helpers'
import { handleSurveyOperation } from './handleSurveyOperation'
describe('handleSurveyOperation Tests', () => {
  const surveyUpdateOperation = {
    entity: 'survey',
    op: Operations.update,
    props: {
      anonymized: false,
      language: 'en',
      additionalLanguages: ['de'],
      expires: '2001-03-20 13:28:00',
      template: 'fruity_twentythree',
      format: 'G',
    },
  }
  const surveyStatusUpdateOperation = {
    id: 571271,
    op: Operations.update,
    entity: 'surveyStatus',
    error: false,
    props: {
      anonymized: false,
      activate: true,
    },
  }
  const languageSettingUpdateOperation = {
    entity: 'languageSetting',
    op: Operations.update,
    id: null,
... (86 lines truncated)
</file>

<file path="editor/src/helpers/Buffer/operationsHandlers/index.js">
export { handleQuestionGroupOperation } from './handleQuestionGroupOperation/handleQuestionGroupOperation'
export { handleQuestionOperation } from './handleQuestionOperation/handleQuestionOperation'
export { handleAnswerOperation } from './handleAnswerOperation/handleAnswerOperation'
export { handleSubquestionOperation } from './handleSubquestionOperation/handleSubquestionOperation'
export { handleSurveyOperation } from './handleSurveyOperation/handleSurveyOperation'
export { handleQuestionConditionOperation } from './handleQuestionConditionOperation/handleQuestionConditionOperation'
</file>

<file path="editor/src/helpers/Buffer/operationsScheme/answer/answerCreateJoi.js">
import Joi from 'joi'
import { Entities, Operations } from '../../../../helpers/Buffer'
export const answerCreateJoi = Joi.object({
  entity: Joi.string().valid(Entities.answer).required(),
  op: Joi.string().valid(Operations.create).required(),
  id: Joi.alternatives().try(Joi.string(), Joi.number()).required(),
  props: Joi.array()
    .items(
      Joi.object({
        tempId: Joi.alternatives().try(Joi.string(), Joi.number()).optional(),
        aid: Joi.alternatives().try(Joi.string(), Joi.number()).optional(),
        qid: Joi.alternatives().try(Joi.string(), Joi.number()).optional(),
        code: Joi.alternatives().try(Joi.string(), Joi.number()).required(),
        sortOrder: Joi.alternatives()
          .try(Joi.string(), Joi.number())
          .required(),
        assessmentValue: Joi.alternatives()
          .try(Joi.string(), Joi.number())
          .required(),
        scaleId: Joi.alternatives().try(Joi.string(), Joi.number()).required(),
        l10ns: Joi.object()
          .pattern(
            /^[a-zA-Z-]{2,}$/,
            Joi.object({
              id: Joi.alternatives().try(Joi.string(), Joi.number()).optional(),
              aid: Joi.alternatives()
                .try(Joi.string(), Joi.number())
                .optional(),
              answer: Joi.alternatives()
                .try(Joi.string().allow(''), Joi.number())
... (13 lines truncated)
</file>

<file path="editor/src/helpers/Buffer/operationsScheme/answer/answerDeleteJoi.js">
import Joi from 'joi'
import { Entities, Operations } from '../../../../helpers/Buffer'
export const answerDeleteJoi = Joi.object({
  entity: Joi.string().valid(Entities.answer).required(),
  op: Joi.string().valid(Operations.delete).required(),
  id: Joi.alternatives().try(Joi.string(), Joi.number()).required(),
})
</file>

<file path="editor/src/helpers/Buffer/operationsScheme/answer/answerSchemes.test.js">
import { Entities, Operations } from 'helpers'
import { answerCreateJoi } from './answerCreateJoi'
import { answerUpdateJoi } from './answerUpdateJoi'
import { answerDeleteJoi } from './answerDeleteJoi'
describe('AnswerCreateJoi Schema Tests', () => {
  test('Validates a correct input', () => {
    const validObject = {
      entity: Entities.answer,
      op: Operations.create,
      id: 123,
      props: [
        {
          tempId: 'temp_001',
          code: 'A01',
          sortOrder: 1,
          assessmentValue: 0,
          scaleId: 2,
          l10ns: {
            en: { answer: 'Answer 1', language: 'en' },
          },
        },
      ],
    }
    const { error, value } = answerCreateJoi.validate(validObject)
    expect(error).toBeUndefined()
    expect(value).toEqual(validObject)
  })
  test('Fails validation when "entity" is missing', () => {
    const invalidObject = {
      op: Operations.create,
... (411 lines truncated)
</file>

<file path="editor/src/helpers/Buffer/operationsScheme/answer/answerUpdateJoi.js">
import Joi from 'joi'
import { Entities, Operations } from '../../../../helpers/Buffer'
export const answerUpdateJoi = Joi.object({
  entity: Joi.string().valid(Entities.answer).required(),
  op: Joi.string().valid(Operations.update).required(),
  id: Joi.alternatives().try(Joi.string(), Joi.number()).required(),
  props: Joi.array()
    .items(
      Joi.object({
        tempId: Joi.alternatives().try(Joi.string(), Joi.number()).optional(),
        appKey: Joi.string().optional(),
        aid: Joi.alternatives().try(Joi.string(), Joi.number()).required(),
        qid: Joi.alternatives().try(Joi.string(), Joi.number()).optional(),
        code: Joi.alternatives().try(Joi.string(), Joi.number()).required(),
        sortOrder: Joi.alternatives()
          .try(Joi.string(), Joi.number())
          .required(),
        assessmentValue: Joi.alternatives()
          .try(Joi.string(), Joi.number())
          .required(),
        scaleId: Joi.alternatives().try(Joi.string(), Joi.number()).required(),
        l10ns: Joi.object()
          .pattern(
            /^[a-zA-Z-]{2,}$/,
            Joi.object({
              id: Joi.alternatives().try(Joi.string(), Joi.number()).optional(),
              aid: Joi.alternatives()
                .try(Joi.string(), Joi.number())
                .optional(),
              answer: Joi.alternatives()
... (14 lines truncated)
</file>

<file path="editor/src/helpers/Buffer/operationsScheme/question/index.js">
export * from './questionCreateJoi'
export * from './questionUpdateJoi'
export * from './questionDeleteJoi'
export * from './questionAttributeUpdateJoi'
export * from './questionL10nUpdateJoi'
</file>

<file path="editor/src/helpers/Buffer/operationsScheme/question/questionAttributeUpdateJoi.js">
import Joi from 'joi'
import { Entities, Operations } from '../../../../helpers/Buffer'
export const questionAttributeUpdateJoi = Joi.object({
  entity: Joi.string().valid(Entities.questionAttribute).required(),
  op: Joi.string().valid(Operations.update).required(),
  id: Joi.alternatives().try(Joi.string(), Joi.number()).required(),
  props: Joi.object()
    .pattern(
      Joi.string(),
      Joi.object().pattern(Joi.string().allow(''), Joi.any())
    )
    .required(),
})
</file>

<file path="editor/src/helpers/Buffer/operationsScheme/question/questionCreateJoi.js">
import Joi from 'joi'
import { questionUpdateJoi } from './questionUpdateJoi'
import { questionL10nUpdateJoi } from './questionL10nUpdateJoi'
import { questionAttributeUpdateJoi } from './questionAttributeUpdateJoi'
import { answerCreateJoi } from '../answer/answerCreateJoi'
import { subquestionCreateJoi } from '../subQuestion/subquestionCreateJoi'
export const questionCreateJoi = Joi.object({
  entity: Joi.string().valid('question').required(),
  op: Joi.string().valid('create').required(),
  id: Joi.alternatives().try(Joi.string(), Joi.number()).required(),
  props: Joi.object({
    question: questionUpdateJoi.extract('props').required(),
    questionL10n: questionL10nUpdateJoi.extract('props').required(),
    attributes: questionAttributeUpdateJoi.extract('props').optional(),
    answers: answerCreateJoi.extract('props').optional(),
    subquestions: subquestionCreateJoi.extract('props').optional(),
  }).required(),
})
</file>

<file path="editor/src/helpers/Buffer/operationsScheme/question/questionDeleteJoi.js">
import Joi from 'joi'
import { Entities, Operations } from '../../../../helpers/Buffer'
export const questionDeleteJoi = Joi.object({
  entity: Joi.string().valid(Entities.question).required(),
  op: Joi.string().valid(Operations.delete).required(),
  id: Joi.alternatives().try(Joi.string(), Joi.number()).required(),
})
</file>

<file path="editor/src/helpers/Buffer/operationsScheme/question/questionL10nUpdateJoi.js">
import Joi from 'joi'
import { Entities, Operations } from '../../../../helpers/Buffer'
export const questionL10nUpdateJoi = Joi.object({
  entity: Joi.string().valid(Entities.questionL10n).required(),
  op: Joi.string().valid(Operations.update).required(),
  id: Joi.alternatives().try(Joi.string(), Joi.number()).required(),
  props: Joi.object()
    .pattern(
      /^[a-zA-Z-]{2,}$/,
      Joi.object({
        question: Joi.string().allow('').optional(),
        help: Joi.string().allow('').optional(),
      }).or('question', 'help')
    )
    .required(),
})
</file>

<file path="editor/src/helpers/Buffer/operationsScheme/question/questionSchemes.test.js">
import {
  questionCreateJoi,
  questionAttributeUpdateJoi,
  questionDeleteJoi,
  questionL10nUpdateJoi,
  questionUpdateJoi,
} from './'
describe('QuestionCreateJoi Schema Tests', () => {
  test('Validates a correct input with all fields', () => {
    const validObject = {
      entity: 'question',
      op: 'create',
      id: '0',
      props: {
        question: {
          qid: '0',
          title: 'G01Q06',
          type: '1',
          questionThemeName: 'arrays/dualscale',
          gid: '1',
          mandatory: false,
          relevance: '1',
          encrypted: false,
          saveAsDefault: false,
          tempId: 'XXX321',
          sortOrder: '1',
        },
        questionL10n: {
          en: {
            question: 'Array Question',
... (449 lines truncated)
</file>

<file path="editor/src/helpers/Buffer/operationsScheme/question/questionUpdateJoi.js">
import Joi from 'joi'
import { Entities, Operations } from '../../../../helpers/Buffer'
export const questionUpdateJoi = Joi.object({
  entity: Joi.string().valid(Entities.question).required(),
  op: Joi.string().valid(Operations.update).required(),
  id: Joi.alternatives().try(Joi.string(), Joi.number()).required(),
  props: Joi.object().pattern(Joi.string(), Joi.any()).required(),
})
</file>

<file path="editor/src/helpers/Buffer/operationsScheme/questionCondition/index.js">
export * from './questionConditionBaseJoi'
export * from './questionConditionCreateJoi'
export * from './questionConditionUpdateJoi'
export * from './questionConditionDeleteJoi'
</file>

<file path="editor/src/helpers/Buffer/operationsScheme/questionCondition/questionConditionBaseJoi.js">
import Joi from 'joi'
export const questionConditionBaseJoi = Joi.object({
  qid: Joi.number().required(),
  cqid: Joi.number().required(),
  cfieldname: Joi.string().required(),
  cquestions: Joi.string().required(),
  method: Joi.string()
    .valid('<', '>', '<=', '>=', '==', '!=', 'RX')
    .default('=='),
  value: Joi.string().allow('').trim(false),
  scenario: Joi.number().required(),
  editSourceTab: Joi.string()
    .pattern(/^#\w+$/)
    .required(),
  editTargetTab: Joi.string()
    .pattern(/^#\w+$/)
    .required(),
  csrctoken: Joi.string().optional(),
  canswers: Joi.alternatives().try(
    Joi.array().items(Joi.string()).min(1).required(),
    Joi.string().required()
  ),
  ConditionConst: Joi.string().allow('').trim(false),
  prevQuestionSGQA: Joi.string().optional(),
  ConditionRegexp: Joi.string().optional(),
  tokenAttr: Joi.string().optional(),
}).when('editTargetTab', {
  switch: [
    {
      is: '#CANSWERSTAB',
... (35 lines truncated)
</file>

<file path="editor/src/helpers/Buffer/operationsScheme/questionCondition/questionConditionCreateJoi.js">
import Joi from 'joi'
import { questionConditionBaseJoi } from './questionConditionBaseJoi.js'
export const questionConditionCreateJoi = Joi.object({
  id: Joi.alternatives().try(Joi.string(), Joi.number()).required(),
  op: Joi.string().valid('create').required(),
  entity: Joi.string().valid('questionCondition').required(),
  qid: Joi.number().required(),
  props: {
    qid: Joi.number().required(),
    scenarios: Joi.array().items(
      Joi.object({
        scid: Joi.number().required(),
        conditions: Joi.array()
          .items(
            questionConditionBaseJoi.keys({
              action: Joi.string().valid('insertCondition').required(),
              tempId: Joi.string()
                .pattern(/^temp__\d+_\d+$/)
                .required(),
              cid: Joi.string()
                .pattern(/^temp__\d+_\d+$/)
                .required(),
              tempcids: Joi.array()
                .items(
                  Joi.string()
                    .pattern(/^temp__\d+_\d+$/)
                    .required()
                )
                .required(),
            })
... (8 lines truncated)
</file>

<file path="editor/src/helpers/Buffer/operationsScheme/questionCondition/questionConditionDeleteJoi.js">
import Joi from 'joi'
const scenarioSchema = Joi.object({
  scid: Joi.number().required(),
  action: Joi.string().valid('deleteScenario').required(),
})
const conditionSchema = Joi.object({
  scid: Joi.number().required(),
  conditions: Joi.array()
    .items(
      Joi.object({
        cid: Joi.number().required(),
        action: Joi.string().valid('deleteCondition').required(),
      })
    )
    .min(1)
    .required(),
})
export const questionConditionDeleteJoi = Joi.object({
  id: Joi.alternatives().try(Joi.string(), Joi.number()).required(),
  op: Joi.string().valid('delete').required(),
  entity: Joi.string().valid('questionCondition').required(),
  qid: Joi.number().optional(),
  props: Joi.object({
    qid: Joi.number().optional(),
    scenarios: Joi.array()
      .items(Joi.alternatives().try(scenarioSchema, conditionSchema).required())
      .min(1)
      .required(),
  }).required(),
})
... (1 lines truncated)
</file>

<file path="editor/src/helpers/Buffer/operationsScheme/questionCondition/questionConditionSchemas.test.js">
import { questionConditionCreateJoi } from './questionConditionCreateJoi'
import { questionConditionUpdateJoi } from './questionConditionUpdateJoi'
import { questionConditionDeleteJoi } from './questionConditionDeleteJoi'
const BASE_CONDITION = {
  qid: 177,
  cqid: 456,
  cfieldname: '766191X1X456',
  cquestions: '766191X1X456',
  method: '==',
  value: 'test',
  scenario: 1,
  editSourceTab: '#SRCPREVQUEST',
}
const BASE_SCENARIO = {
  scid: 1,
  conditions: [BASE_CONDITION],
}
const BASE_PROPS = {
  qid: 177,
  scenarios: [BASE_SCENARIO],
}
const BASE_VALID_OBJECT = {
  entity: 'questionCondition',
  op: 'create',
  id: 177,
  props: BASE_PROPS,
  qid: 177,
}
const CONDITION_TYPES = [
  {
... (544 lines truncated)
</file>

<file path="editor/src/helpers/Buffer/operationsScheme/questionCondition/questionConditionSchemes.test.js">
import { questionConditionCreateJoi } from './questionConditionCreateJoi'
import { questionConditionUpdateJoi } from './questionConditionUpdateJoi'
import { questionConditionDeleteJoi } from './questionConditionDeleteJoi'
const BASE_CONDITION = {
  qid: 177,
  cqid: 456,
  cfieldname: 'Q177',
  cquestions: 'Q177',
  method: '==',
  value: 'test',
  scenario: 1,
  editSourceTab: '#SRCPREVQUEST',
}
const BASE_SCENARIO = {
  scid: 1,
  conditions: [BASE_CONDITION],
}
const BASE_PROPS = {
  qid: 177,
  scenarios: [BASE_SCENARIO],
}
const BASE_VALID_OBJECT = {
  entity: 'questionCondition',
  op: 'create',
  id: 177,
  props: BASE_PROPS,
  qid: 177,
}
const CONDITION_TYPES = [
  {
... (544 lines truncated)
</file>

<file path="editor/src/helpers/Buffer/operationsScheme/questionCondition/questionConditionUpdateJoi.js">
import Joi from 'joi'
import { questionConditionBaseJoi } from './questionConditionBaseJoi.js'
const actionConditionTypes = ['insertCondition', 'updateCondition']
const conditionActionPropsSchema = {
  qid: Joi.number().required(),
  scenarios: Joi.array().items(
    Joi.object({
      scid: Joi.number().required(),
      conditions: Joi.array()
        .items(
          questionConditionBaseJoi.keys({
            action: Joi.string()
              .valid(...actionConditionTypes)
              .required(),
            cid: Joi.alternatives()
              .try(Joi.number(), Joi.string().pattern(/^temp__\d+_\d+$/))
              .required(),
            tempId: Joi.string()
              .pattern(/^temp__\d+_\d+$/)
              .optional(),
            tempcids: Joi.array().items(Joi.string()).optional(),
          })
        )
        .min(1)
        .required(),
    })
  ),
}
const conditionScriptPropsSchema = Joi.object({
  qid: Joi.number().required(),
... (23 lines truncated)
</file>

<file path="editor/src/helpers/Buffer/operationsScheme/questionGroup/questionGroupCreateJoi.js">
import Joi from 'joi'
import { Entities, Operations } from '../../../../helpers/Buffer'
import { questionGroupL10nUpdateJoi } from './questionGroupL10nUpdateJoi'
export const questionGroupCreateJoi = Joi.object({
  entity: Joi.string().valid(Entities.questionGroup).required(),
  op: Joi.string().valid(Operations.create).required(),
  id: Joi.alternatives().try(Joi.string(), Joi.number()).required(),
  props: Joi.object({
    questionGroup: Joi.object().pattern(Joi.string(), Joi.any()).required(),
    questionGroupL10n: questionGroupL10nUpdateJoi.extract('props').required(),
  }).required(),
})
</file>

<file path="editor/src/helpers/Buffer/operationsScheme/questionGroup/questionGroupDeleteJoi.js">
import Joi from 'joi'
import { Entities } from 'helpers/Buffer/Entities'
import { Operations } from 'helpers/Buffer/Operations'
export const questionGroupDeleteJoi = Joi.object({
  entity: Joi.string().valid(Entities.questionGroup).required(),
  op: Joi.string().valid(Operations.delete).required(),
  id: Joi.alternatives().try(Joi.string(), Joi.number()).required(),
})
</file>

<file path="editor/src/helpers/Buffer/operationsScheme/questionGroup/questionGroupL10nUpdateJoi.js">
import Joi from 'joi'
import { Entities, Operations } from '../../../../helpers/Buffer'
export const questionGroupL10nUpdateJoi = Joi.object({
  entity: Joi.string().valid(Entities.questionGroupL10n).required(),
  op: Joi.string().valid(Operations.update).required(),
  id: Joi.alternatives().try(Joi.string(), Joi.number()).required(),
  props: Joi.object()
    .pattern(
      /^[a-zA-Z-]{2,}$/,
      Joi.object({
        groupName: Joi.string().allow('').optional(),
        description: Joi.string().allow('').optional(),
      }).or('groupName', 'description')
    )
    .required(),
})
</file>

<file path="editor/src/helpers/Buffer/operationsScheme/questionGroup/questionGroupSchemes.test.js">
import { questionGroupCreateJoi } from './questionGroupCreateJoi'
import { questionGroupUpdateJoi } from './questionGroupUpdateJoi'
import { questionGroupL10nUpdateJoi } from './questionGroupL10nUpdateJoi'
import { questionGroupDeleteJoi } from './questionGroupDeleteJoi'
describe('QuestionGroupL10nUpdateJoi Schema Tests', () => {
  test('Validates a correct input', () => {
    const validObject = {
      entity: 'questionGroupL10n',
      op: 'update',
      id: 1,
      props: {
        en: {
          groupName: 'Name of group',
          description: 'English description',
        },
        de: {
          groupName: 'Gruppenname',
          description: 'Deutsche Beschreibung',
        },
      },
    }
    const { error, value } = questionGroupL10nUpdateJoi.validate(validObject)
    expect(error).toBeUndefined()
    expect(value).toEqual(validObject)
  })
  test('Fails validation when "entity" is incorrect', () => {
    const invalidObject = {
      entity: 'wrongEntity',
      op: 'update',
      id: 1,
... (447 lines truncated)
</file>

<file path="editor/src/helpers/Buffer/operationsScheme/questionGroup/questionGroupUpdateJoi.js">
import Joi from 'joi'
import { Entities, Operations } from '../../../../helpers/Buffer'
import { questionGroupL10nUpdateJoi } from './questionGroupL10nUpdateJoi'
export const questionGroupUpdateJoi = Joi.object({
  entity: Joi.string().valid(Entities.questionGroup).required(),
  op: Joi.string().valid(Operations.update).required(),
  id: Joi.alternatives().try(Joi.string(), Joi.number()).required(),
  props: Joi.object({
    questionGroup: Joi.object()
      .pattern(
        Joi.string(),
        Joi.alternatives().try(
          Joi.string().allow(''),
          Joi.number(),
          Joi.object(),
          Joi.array()
        )
      )
      .required(),
    questionGroupL10n: questionGroupL10nUpdateJoi.extract('props').required(),
  }).required(),
})
</file>

<file path="editor/src/helpers/Buffer/operationsScheme/subQuestion/subquestionCreateJoi.js">
import Joi from 'joi'
import { Entities, Operations } from '../../../../helpers/Buffer'
export const subquestionCreateJoi = Joi.object({
  id: Joi.alternatives().try(Joi.string(), Joi.number()).required(),
  op: Joi.string().valid(Operations.create).required(),
  entity: Joi.string().valid(Entities.subquestion).required(),
  props: Joi.array()
    .items(
      Joi.object({
        tempId: Joi.string().required(),
        sid: Joi.alternatives().try(Joi.string(), Joi.number()).optional(),
        qid: Joi.string().required(),
        gid: Joi.alternatives().try(Joi.string(), Joi.number()).required(),
        type: Joi.string().required(),
        scaleId: Joi.alternatives().try(Joi.string(), Joi.number()).required(),
        sortOrder: Joi.alternatives()
          .try(Joi.string(), Joi.number())
          .required(),
        questionThemeName: Joi.string().required(),
        parentQid: Joi.alternatives()
          .try(Joi.string(), Joi.number())
          .required(),
        title: Joi.string().required(),
        preg: Joi.any().allow(null),
        other: Joi.boolean().optional(),
        mandatory: Joi.boolean().allow(null).required(),
        encrypted: Joi.boolean().optional(),
        moduleName: Joi.any().allow(null),
        sameDefault: Joi.any().optional(null),
        relevance: Joi.string().optional(),
... (26 lines truncated)
</file>

<file path="editor/src/helpers/Buffer/operationsScheme/subQuestion/subquestionDeleteJoi.js">
import Joi from 'joi'
import { Entities, Operations } from '../../../../helpers/Buffer'
export const subquestionDeleteJoi = Joi.object({
  entity: Joi.string().valid(Entities.subquestion).required(),
  op: Joi.string().valid(Operations.delete).required(),
  id: Joi.alternatives().try(Joi.string(), Joi.number()).required(),
})
</file>

<file path="editor/src/helpers/Buffer/operationsScheme/subQuestion/subQuestionSchemes.test.js">
import { Entities, Operations } from 'helpers'
import { subquestionCreateJoi } from './subquestionCreateJoi'
import { subquestionUpdateJoi } from './subquestionUpdateJoi'
import { subquestionDeleteJoi } from './subquestionDeleteJoi'
describe('SubquestionCreateJoi Schema Tests', () => {
  test('Validates a correct input with tempId', () => {
    const validObject = {
      id: 4684,
      op: Operations.create,
      entity: 'subquestion',
      props: [
        {
          tempId: 'temp__001',
          sid: 476182,
          qid: 'temp__360280',
          gid: 528,
          type: 'T',
          scaleId: 0,
          sortOrder: 1,
          questionThemeName: 'longfreetext',
          parentQid: 4684,
          title: 'SQ740842',
          preg: null,
          other: false,
          mandatory: false,
          encrypted: false,
          moduleName: null,
          sameDefault: null,
          relevance: '1',
          sameScript: null,
... (463 lines truncated)
</file>

<file path="editor/src/helpers/Buffer/operationsScheme/subQuestion/subquestionUpdateJoi.js">
import Joi from 'joi'
import { Entities, Operations } from '../../../../helpers/Buffer'
export const subquestionUpdateJoi = Joi.object({
  id: Joi.alternatives().try(Joi.string(), Joi.number()).required(),
  op: Joi.string().valid(Operations.update).required(),
  entity: Joi.string().valid(Entities.subquestion).required(),
  props: Joi.array()
    .items(
      Joi.object({
        qid: Joi.alternatives().try(Joi.string(), Joi.number()).required(),
        tempId: Joi.alternatives().try(Joi.string(), Joi.number()).optional(),
        appKey: Joi.string().optional(),
        parentQid: Joi.alternatives()
          .try(Joi.string(), Joi.number())
          .optional(),
        sid: Joi.alternatives().try(Joi.string(), Joi.number()).optional(),
        type: Joi.string().required(),
        sortOrder: Joi.alternatives()
          .try(Joi.string(), Joi.number())
          .required(),
        title: Joi.string().required(),
        preg: Joi.any().allow(null),
        other: Joi.boolean().optional(),
        mandatory: Joi.boolean().allow(null),
        encrypted: Joi.boolean().optional(),
        questionOrder: Joi.alternatives()
          .try(Joi.string(), Joi.number())
          .optional(),
        scaleId: Joi.alternatives().try(Joi.string(), Joi.number()).required(),
        sameDefault: Joi.boolean().allow(null),
... (30 lines truncated)
</file>

<file path="editor/src/helpers/Buffer/operationsScheme/survey/accessModeUpdate.Joi.js">
import Joi from 'joi'
import { Entities, Operations } from 'helpers/Buffer'
import { ACCESS_MODES } from 'helpers'
export const accessModeUpdateJoi = Joi.object({
  entity: Joi.string().valid(Entities.accessMode).required(),
  op: Joi.string().valid(Operations.update).required(),
  id: Joi.alternatives().try(Joi.string(), Joi.number()).required(),
  props: Joi.object({
    accessMode: Joi.string()
      .valid(...Object.values(ACCESS_MODES))
      .required(),
    action: Joi.string().optional().valid('K', 'D', 'A'),
  }).required(),
})
</file>

<file path="editor/src/helpers/Buffer/operationsScheme/survey/languageSettingUpdateJoi.js">
import Joi from 'joi'
import { Entities, Operations } from '../../../../helpers/Buffer'
export const languageSettingUpdateJoi = Joi.object({
  entity: Joi.string().valid(Entities.languageSetting).required(),
  op: Joi.string().valid(Operations.update).required(),
  id: Joi.any().valid(null).required(),
  props: Joi.object()
    .pattern(
      Joi.string(),
      Joi.object().pattern(Joi.string().allow(''), Joi.any())
    )
    .required(),
})
</file>

<file path="editor/src/helpers/Buffer/operationsScheme/survey/surveyImportResponsesJoi.js">
import Joi from 'joi'
import { Entities, Operations } from '../../../../helpers/Buffer'
export const surveyImportResponsesJoi = Joi.object({
  id: Joi.alternatives().try(Joi.string(), Joi.number()).required(),
  op: Joi.string().valid(Operations.update).required(),
  entity: Joi.string().valid(Entities.importResponses).required(),
  error: Joi.boolean().optional(),
  props: Joi.object({
    preserveIDs: Joi.boolean().required(),
    timestamp: Joi.alternatives().try(Joi.string(), Joi.number()).optional(),
  }).required(),
})
</file>

<file path="editor/src/helpers/Buffer/operationsScheme/survey/surveySchemes.test.js">
import { languageSettingUpdateJoi } from './languageSettingUpdateJoi'
import { surveyUpdateJoi } from './surveyUpdateJoi'
import { surveyStatusUpdateJoi } from './surveyStatusUpdateJoi'
describe('LanguageSettingUpdateJoi Schema Tests', () => {
  test('Validates a correct input', () => {
    const validObject = {
      entity: 'languageSetting',
      op: 'update',
      id: null,
      props: {
        de: {
          title: 'Beispielfragebogen',
        },
        en: {
          title: 'Example Survey',
        },
      },
    }
    const { error, value } = languageSettingUpdateJoi.validate(validObject)
    expect(error).toBeUndefined()
    expect(value).toEqual(validObject)
  })
  test('Fails validation when "entity" is missing', () => {
    const invalidObject = {
      op: 'update',
      id: null,
      props: {
        de: {
          title: 'Beispielfragebogen',
        },
... (300 lines truncated)
</file>

<file path="editor/src/helpers/Buffer/operationsScheme/survey/surveyStatusUpdateJoi.js">
import Joi from 'joi'
import { Entities, Operations } from '../../../../helpers/Buffer'
export const surveyStatusUpdateJoi = Joi.object({
  id: Joi.alternatives().try(Joi.string(), Joi.number()).required(),
  op: Joi.string().valid(Operations.update).required(),
  entity: Joi.string().valid(Entities.surveyStatus).required(),
  error: Joi.boolean().optional(),
  props: Joi.object({
    anonymized: Joi.boolean().required(),
    activate: Joi.boolean(),
    deactivate: Joi.boolean(),
    expire: Joi.boolean(),
  }).required(),
})
</file>

<file path="editor/src/helpers/Buffer/operationsScheme/survey/surveyUpdateJoi.js">
import Joi from 'joi'
import { Entities, Operations } from '../../../../helpers/Buffer'
export const surveyUpdateJoi = Joi.object({
  entity: Joi.string().valid(Entities.survey).required(),
  op: Joi.string().valid(Operations.update).required(),
  props: Joi.object().pattern(Joi.string(), Joi.any()).required(),
  id: Joi.any().optional(),
})
</file>

<file path="editor/src/helpers/Buffer/operationsScheme/survey/themeSettingUpdateJoi.js">
import Joi from 'joi'
import { Entities, Operations } from '../../../../helpers/Buffer'
export const themeSettingUpdateJoi = Joi.object({
  id: Joi.alternatives().try(Joi.string(), Joi.number()).required(),
  op: Joi.string().valid(Operations.update).required(),
  entity: Joi.string().valid(Entities.themeSettings).required(),
  error: Joi.boolean().optional(),
  props: Joi.object({
    templateName: Joi.string().required(),
    font: Joi.string().optional(),
    cssframework: Joi.string().optional(),
    backgroundimagefile: Joi.string().optional(),
    brandlogofile: Joi.string().optional(),
    hideprivacyinfo: Joi.string().optional(),
    showpopups: Joi.string().optional(),
    showclearall: Joi.string().optional(),
    questionhelptextposition: Joi.string().optional(),
    fixnumauto: Joi.string().optional(),
    backgroundimage: Joi.string().optional(),
    brandlogo: Joi.string().optional(),
    cornerradius: Joi.string().optional(),
    deselectsinglechoice: Joi.string().optional(),
    container: Joi.string().optional(),
    zebrastriping: Joi.string().optional(),
    crosshover: Joi.string().optional(),
    fontcolor: Joi.string().optional(),
    bodybackgroundcolor: Joi.string().optional(),
    questionbackgroundcolor: Joi.string().optional(),
    themecolor: Joi.string().optional(),
    darkmode: Joi.string().optional(),
... (4 lines truncated)
</file>

<file path="editor/src/helpers/Buffer/Buffer.test.js">
import { createBufferOperation, entity, operation } from './Operation'
import { OperationsBuffer } from './OperationsBuffer'
import { Entities } from './Entities.js'
import { Operations } from './Operations'
describe('Buffer utility functions', () => {
  const id = 123
  test('createBufferOperation should return an object with entity functions', () => {
    const operation = createBufferOperation(id)
    Object.keys(Entities).forEach((key) => {
      expect(typeof operation[key]).toBe('function')
    })
  })
  test('entity should return an object with create, update, and delete functions', () => {
    Object.keys(Entities).forEach((key) => {
      const surveyEntity = entity(id, Entities[key])
      expect(typeof surveyEntity.create).toBe('function')
      expect(typeof surveyEntity.update).toBe('function')
      expect(typeof surveyEntity.delete).toBe('function')
      expect(Object.keys(surveyEntity).length).toBe(3)
    })
  })
  test('create and update operations should return objects with the correct properties', () => {
    const createOp = operation(id, Entities.question, Operations.create, {
      title: 'New Survey',
    })
    const updateOp = operation(id, Entities.question, Operations.update, {
      description: 'Updated Description',
    })
    const deleteOp = operation(id, Entities.question, Operations.delete)
    expect(createOp.id).toBe(id)
... (119 lines truncated)
</file>

<file path="editor/src/helpers/Buffer/Entities.js">
export const Entities = {
  questionGroup: 'questionGroup',
  questionGroupL10n: 'questionGroupL10n',
  question: 'question',
  questionL10n: 'questionL10n',
  questionAttribute: 'questionAttribute',
  subquestion: 'subquestion',
  answer: 'answer',
  languageSetting: 'languageSetting',
  survey: 'survey',
  surveyStatus: 'surveyStatus',
  questionCondition: 'questionCondition',
  questionGroupReorder: 'questionGroupReorder',
  importResponses: 'importResponses',
  themeSettings: 'themeSettings',
  response: 'response',
  responseFile: 'response-file',
  accessMode: 'accessMode',
}
</file>

<file path="editor/src/helpers/Buffer/EntitiesPath.js">
import { EntitiesType } from './EntitiesType'
export const EntitiesPath = {
  survey: `${EntitiesType.survey}.$property`,
  languageSetting: `${EntitiesType.survey}.languageSettings.$language`,
  question: `${EntitiesType.question}.$attributeName`,
  questionAttribute: `${EntitiesType.question}.attributes.$attributeName`,
  questionGroupL10n: `${EntitiesType.groupName}.l10ns.$language`,
  questionL10n: `${EntitiesType.question}.l10ns.$language`,
  answer: `${EntitiesType.question}.answers`,
  subquestion: `${EntitiesType.question}.subquestions`,
  questionGroup: 'questionGroup',
  questionGroupReorder: 'questionGroupReorder',
  questionCondition: 'questionCondition',
  accessMode: 'accessMode',
}
</file>

<file path="editor/src/helpers/Buffer/EntitiesType.js">
export const EntitiesType = {
  question: 'question',
  group: 'group',
  survey: 'survey',
  groupName: 'groupName',
  answer: 'answer',
  subquestion: 'subquestion',
  condition: 'condition',
  welcomeScreen: 'welcomeScreen',
  endScreen: 'endScreen',
}
</file>

<file path="editor/src/helpers/Buffer/getOperationScheme.js">
import Joi from 'joi'
import { Operations, Entities } from 'helpers'
import {
  questionAttributeUpdateJoi,
  questionCreateJoi,
  questionDeleteJoi,
  questionL10nUpdateJoi,
  questionUpdateJoi,
} from './operationsScheme/question'
import { questionGroupUpdateJoi } from './operationsScheme/questionGroup/questionGroupUpdateJoi'
import { answerUpdateJoi } from './operationsScheme/answer/answerUpdateJoi'
import { subquestionUpdateJoi } from './operationsScheme/subQuestion/subquestionUpdateJoi'
import { questionGroupL10nUpdateJoi } from './operationsScheme/questionGroup/questionGroupL10nUpdateJoi'
import { surveyUpdateJoi } from './operationsScheme/survey/surveyUpdateJoi'
import { surveyStatusUpdateJoi } from './operationsScheme/survey/surveyStatusUpdateJoi'
import { questionGroupCreateJoi } from './operationsScheme/questionGroup/questionGroupCreateJoi'
import { answerCreateJoi } from './operationsScheme/answer/answerCreateJoi'
import { subquestionCreateJoi } from './operationsScheme/subQuestion/subquestionCreateJoi'
import { questionGroupDeleteJoi } from './operationsScheme/questionGroup/questionGroupDeleteJoi'
import { answerDeleteJoi } from './operationsScheme/answer/answerDeleteJoi'
import { subquestionDeleteJoi } from './operationsScheme/subQuestion/subquestionDeleteJoi'
import { languageSettingUpdateJoi } from './operationsScheme/survey/languageSettingUpdateJoi'
import { surveyImportResponsesJoi } from './operationsScheme/survey/surveyImportResponsesJoi'
import {
  questionConditionCreateJoi,
  questionConditionUpdateJoi,
  questionConditionDeleteJoi,
} from './operationsScheme/questionCondition'
import { themeSettingUpdateJoi } from './operationsScheme/survey/themeSettingUpdateJoi'
import { accessModeUpdateJoi } from './operationsScheme/survey/accessModeUpdate.Joi'
... (41 lines truncated)
</file>

<file path="editor/src/helpers/Buffer/index.js">
export * from './OperationsBuffer'
export * from './Entities'
export * from './EntitiesPath'
export * from './Operations'
export * from './Operation'
export * from './EntitiesType'
export * from './getOperationScheme'
</file>

<file path="editor/src/helpers/Buffer/Operation.js">
import { Entities } from './Entities'
import { Operations } from './Operations'
export const createBufferOperation = (id) => {
  const entities = {
    survey: () => entity(id, Entities.survey),
    question: () => entity(id, Entities.question),
    questionAttribute: () => entity(id, Entities.questionAttribute),
    answer: () => entity(id, Entities.answer),
    languageSetting: () => entity(id, Entities.languageSetting),
    questionGroup: () => entity(id, Entities.questionGroup),
    questionGroupL10n: () => entity(id, Entities.questionGroupL10n),
    questionGroupReorder: () => entity(id, Entities.questionGroupReorder),
    questionL10n: () => entity(id, Entities.questionL10n),
    subquestion: () => entity(id, Entities.subquestion),
    surveyStatus: () => entity(id, Entities.surveyStatus),
    questionCondition: () => entity(id, Entities.questionCondition),
    importResponses: () => entity(id, Entities.importResponses),
    themeSettings: () => entity(id, Entities.themeSettings),
    response: () => entity(id, Entities.response),
    responseFile: () => entity(id, Entities.responseFile),
    accessMode: () => entity(id, Entities.accessMode),
  }
  return entities
}
export const entity = (id, entity, props = {}) => {
  return {
    create: (props) => operation(id, entity, Operations.create, props),
    update: (props) => operation(id, entity, Operations.update, props),
    delete: () => operation(id, entity, Operations.delete, props),
  }
... (15 lines truncated)
</file>

<file path="editor/src/helpers/Buffer/Operations.js">
export const Operations = {
  update: 'update',
  delete: 'delete',
  create: 'create',
}
export const AppliedOperations = {
  QUESTIONS: 'questionsMap',
}
</file>

<file path="editor/src/helpers/Buffer/OperationsBuffer.js">
import { cloneDeep, merge } from 'lodash'
import {
  arrayDeleteItem,
  filterArray,
  filterCollection,
  hasTempId,
} from 'helpers'
import { Entities, getOperationScheme, Operations } from './'
import {
  handleAnswerOperation,
  handleQuestionGroupOperation,
  handleQuestionOperation,
  handleSubquestionOperation,
  handleSurveyOperation,
  handleQuestionConditionOperation,
} from './operationsHandlers'
import { addBreadcrumb, reportExtras } from 'appInstrumentation'
export class OperationsBuffer {
  operations = []
  bufferHash = ''
  constructor(operations = [], hash = '') {
    this.operations = cloneDeep(operations)
    this.bufferHash = hash
  }
  getOperations = ({ ready } = {}) => {
    const includeReady = ready === undefined || ready === true
    const includeNotReady = ready === undefined || ready === false
    const includeAll = includeReady && includeNotReady
    const allOperations = cloneDeep(this.operations)
    const hasCreateOp = allOperations.some(
... (311 lines truncated)
</file>

<file path="editor/src/helpers/constants/constants.js">
export const MINIMUM_INPUT_WIDTH_PERCENT = 15
export const FOCUS_ANIMATION_DURATION_IN_MS = 1000
export const SCALE_1 = 0
export const SCALE_2 = 1
export const NEW_OBJECT_ID_PREFIX = 'temp__'
export const APP_KEY_PREFIX = 'ls_ce_editor'
export const SOFT_MANDATORY = 'S'
export const OTHER_CODE = '-oth-'
export const ignoreUpdate = '_________________________ignore_update________'
export const STATES = {
  ATTRIBUTE_DESCRIPTIONS: 'attribute_descriptions',
  QUESTION_SETTINGS_OPTIONS: 'question_settings_options',
  IS_SURVEY_ACTIVE: 'is_survey_active',
  CODE_TO_QUESTION: 'code_to_question',
  SEARCHED_TERM: 'searched_term',
  IS_EDITOR_STRUCTURE_PANEL_OPEN: 'is_editor_structure_panel_open',
  IS_PREVIEW_MODE: 'is_preview_mode_active',
  IS_SURVEY_SETTINGS_OPEN: 'is_question_settings_open',
  IS_ADDING_QUESTION_OR_GROUP: 'is_adding_questions_or_group',
  CLICKED_QUESTION_GROUP_INDEX: 'clicked_question_group_index',
  SURVEY_ID: 'survey_id',
  SAVE_STATE: 'save_state',
  FOCUSED_ENTITY: 'focused_entity',
  SURVEY_SERVICE: 'survey_service',
  SURVEY: 'survey',
  USER_DETAIL: 'user_detail',
  AUTH: 'auth',
  BUFFER: 'buffer',
  BUFFER_HASH: 'buffer_hash',
  ERRORS: 'errors',
... (104 lines truncated)
</file>

<file path="editor/src/helpers/constants/docUrls.js">
export const docUrls = {
  imageQuestionHtmlImageValue:
    'https://www.limesurvey.org/manual/Image_Question_HTML_Image_Value',
}
</file>

<file path="editor/src/helpers/constants/index.js">
export * from './constants'
export * from './docUrls'
export * from './languages'
export * from './questionTypes'
export * from './slider'
</file>

<file path="editor/src/helpers/constants/languages.js">
export const LANGUAGE_CODES = {
  DE_INFORMAL: 'de-informal',
  EN: 'en',
  ES: 'es',
  OM: 'om',
  AA: 'aa',
  AF: 'af',
  AK: 'ak',
  AN: 'an',
  IG: 'ig',
  GN: 'gn',
  AE: 'ae',
  AY: 'ay',
  AZ: 'az',
  ID: 'id',
  MS: 'ms',
  BM: 'bm',
  JV: 'jv',
  SU: 'su',
  BI: 'bi',
  BS: 'bs',
  BR: 'br',
  CA: 'ca',
  CH: 'ch',
  NY: 'ny',
  SN: 'sn',
  CO: 'co',
  CY: 'cy',
  DA: 'da',
  SE: 'se',
... (1089 lines truncated)
</file>

<file path="editor/src/helpers/constants/questionTypes.js">
export const QT_1_ARRAY_DUAL = '1'
export const QT_5_POINT_CHOICE = '5'
export const QT_A_ARRAY_5_POINT = 'A'
export const QT_B_ARRAY_10_CHOICE_QUESTIONS = 'B'
export const QT_C_ARRAY_YES_UNCERTAIN_NO = 'C'
export const QT_D_DATE = 'D'
export const QT_E_ARRAY_INC_SAME_DEC = 'E'
export const QT_F_ARRAY = 'F'
export const QT_G_GENDER = 'G'
export const QT_H_ARRAY_COLUMN = 'H'
export const QT_I_LANGUAGE = 'I'
export const QT_K_MULTIPLE_NUMERICAL = 'K'
export const QT_L_LIST = 'L'
export const QT_M_MULTIPLE_CHOICE = 'M'
export const QT_N_NUMERICAL = 'N'
export const QT_O_LIST_WITH_COMMENT = 'O'
export const QT_P_MULTIPLE_CHOICE_WITH_COMMENTS = 'P'
export const QT_Q_MULTIPLE_SHORT_TEXT = 'Q'
export const QT_R_RANKING = 'R'
export const QT_S_SHORT_FREE_TEXT = 'S'
export const QT_T_LONG_FREE_TEXT = 'T'
export const QT_U_HUGE_FREE_TEXT = 'U'
export const QT_X_TEXT_DISPLAY = 'X'
export const QT_Y_YES_NO_RADIO = 'Y'
export const QT_EXCLAMATION_LIST_DROPDOWN = '!'
export const QT_VERTICAL_FILE_UPLOAD = '|'
export const QT_ASTERISK_EQUATION = '*'
export const QT_COLON_ARRAY_NUMBERS = ':'
export const QT_SEMICOLON_ARRAY_TEXT = ';'
</file>

<file path="editor/src/helpers/constants/slider.js">
export const THUMB_TYPES = {
  CIRCLE: '0',
  SQUARE: '1',
  TRIANGLE: '2',
  CUSTOM: '3',
}
</file>

<file path="editor/src/helpers/data/survey-detail.json">
{
  "surveyId": 596477,
  "survey": {
    "sid": 596477,
    "gsid": 1,
    "active": false,
    "language": "en",
    "expires": null,
    "startDate": null,
    "anonymized": false,
    "saveTimings": null,
    "additionalLanguages": "",
    "datestamp": null,
    "useCookie": null,
    "allowRegister": null,
    "allowSave": null,
    "autoNumberStart": 0,
    "autoRedirect": null,
    "allowPrev": null,
    "hasSurveyUpdatePermission": true,
    "printAnswers": null,
    "ipAddr": null,
    "ipAnonymize": null,
    "refUrl": null,
    "saveQuotaExit": null,
    "dateCreated": "2023-10-04T10:27:05.000Z",
    "publicStatistics": null,
    "publicGraphs": null,
    "listPublic": null,
    "sendConfirmation": null,
... (6897 lines truncated)
</file>

<file path="editor/src/helpers/feedback/feedbackConfig.js">
export const FEEDBACK_TYPES = {
  GENERAL: 'general',
  SHARING: 'sharing',
}
export const cookieExpiresInterval = 365 * 24 * 60 * 60 * 1000
export const getFeedbackConfigs = () => {
  return {
    [FEEDBACK_TYPES.GENERAL]: {
      surveyId: 516925,
      cookieKey: 'LS_FEEDBACK_POPUP',
      title: t('What do you think so far?'),
      description: t(
        'We would very much appreciate it if you could answer two quick questions about your experience with the new editor?'
      ),
      triggerType: 'automatic',
      delayMins: process.env.REACT_APP_FEEDBACK_POPUP_DELAY_MINS,
      intervalMinutes: process.env.REACT_APP_FEEDBACK_POPUP_INTERVAL_MINS,
    },
    [FEEDBACK_TYPES.SHARING]: {
      surveyId: 763972,
      cookieKey: 'LS_FEEDBACK_POPUP_SHARING',
      title: t('Do you have a minute?'),
      description: t(
        'We would love to hear your thoughts on our sharing options!'
      ),
      triggerType: 'manual',
      primaryCTA: t('Tell us'),
    },
  }
}
... (1 lines truncated)
</file>

<file path="editor/src/helpers/feedback/FeedbackEventHandler.js">
class FeedbackEventTarget extends EventTarget {
  constructor() {
    super()
  }
  requestFeedback(feedbackType) {
    this.dispatchEvent(
      new CustomEvent('feedbackRequested', {
        detail: { feedbackType },
      })
    )
  }
  onFeedbackRequested(callback) {
    this.addEventListener('feedbackRequested', callback)
    return () => this.removeEventListener('feedbackRequested', callback)
  }
}
export const FeedbackEventHandler = new FeedbackEventTarget()
</file>

<file path="editor/src/helpers/feedback/index.js">
export * from './feedbackConfig'
export * from './FeedbackEventHandler'
export * from './utils'
</file>

<file path="editor/src/helpers/feedback/utils.js">
export const openFeedbackSurveyInNewTab = (surveyId, urlParams) => {
  window.open(
    `https://survey.limesurvey.org/${surveyId}?${urlParams.toString()}`,
    '_blank'
  )
}
</file>

<file path="editor/src/helpers/L10ns/L10ns.js">
import isString from 'lodash/isString'
export const L10ns = ({ prop, language, l10ns }) => {
  if (
    l10ns?.[language]?.hasOwnProperty(prop) &&
    isString(l10ns[language][prop])
  ) {
    return l10ns[language][prop]
  }
  return ''
}
</file>

<file path="editor/src/helpers/L10ns/L10ns.test.js">
import React from 'react'
import { render, screen } from '@testing-library/react'
import { L10ns } from './L10ns'
import { LANGUAGE_CODES } from 'helpers/constants'
const l10ns = {
  en: { welcome: 'Hello' },
  es: { welcome: 'Hola' },
  fr: { welcome: 'Bonjour' },
}
test('renders selected language', () => {
  render(<L10ns prop="welcome" language={LANGUAGE_CODES.EN} l10ns={l10ns} />)
  const textEn = screen.getByText(/Hello/i)
  expect(textEn).toBeInTheDocument()
  render(<L10ns prop="welcome" language={LANGUAGE_CODES.ES} l10ns={l10ns} />)
  const textEs = screen.getByText(/Hola/i)
  expect(textEs).toBeInTheDocument()
  render(<L10ns prop="welcome" language={LANGUAGE_CODES.FR} l10ns={l10ns} />)
  const textFr = screen.getByText(/Bonjour/i)
  expect(textFr).toBeInTheDocument()
})
</file>

<file path="editor/src/helpers/network/axiosErrorHandler.js">
import { addBreadcrumb } from 'appInstrumentation'
export const handleAxiosError = (error, options = {}) => {
  const { throwError = false, logToConsole = true } = options
  const normalizedError = {
    code: 'UNKNOWN_ERROR',
    message: 'An unknown error occurred',
    httpStatus: 500,
    originalError: error,
  }
  if (error.name === 'CanceledError') {
    return
  }
  if (error.response) {
    const { status, data } = error.response
    switch (status) {
      case 400:
        normalizedError.httpStatus = 400
        normalizedError.code = 'BAD_REQUEST'
        break
      case 401:
        normalizedError.httpStatus = 401
        normalizedError.code = 'UNAUTHORIZED'
        break
      case 403:
        normalizedError.httpStatus = 403
        normalizedError.code = 'FORBIDDEN'
        break
      case 404:
        normalizedError.httpStatus = 404
        normalizedError.code = 'NOT_FOUND'
... (47 lines truncated)
</file>

<file path="editor/src/helpers/options/getColumnWidthOptions.js">
export const getColumnWidthOptions = () => {
  return [
    {
      label: t('Default'),
      value: 'default',
    },
    {
      label: '8%',
      value: '1',
    },
    {
      label: '17%',
      value: '2',
    },
    {
      label: '25%',
      value: '3',
    },
    {
      label: '33%',
      value: '4',
    },
    {
      label: '41%',
      value: '5',
    },
    {
      label: '50%',
      value: '6',
    },
... (27 lines truncated)
</file>

<file path="editor/src/helpers/options/getCommentedCheckboxOptions.js">
export const getCommentedCheckboxOptions = () => {
  return {
    CHECKED: {
      get label() {
        return t('Checkbox is checked')
      },
      value: 'checked',
    },
    ALWAYS: {
      get label() {
        return t('No control on checkbox')
      },
      value: 'allways',
    },
    UNCHECKED: {
      get label() {
        return t('Checkbox is unchecked')
      },
      value: 'unchecked',
    },
  }
}
</file>

<file path="editor/src/helpers/options/getDisplayButtonTypeOptions.js">
export const getDisplayButtonTypeOptions = () => {
  return {
    BUTTONS: { name: t('Buttons'), value: '0' },
    RADIO: { name: t('Radio'), value: '1' },
  }
}
</file>

<file path="editor/src/helpers/options/getFormatOptions.js">
export const getFormatOptions = () => {
  return [
    {
      label: t('All in one'),
      value: 'A',
    },
    {
      label: t('Question by question'),
      value: 'S',
    },
    {
      label: t('Group by group'),
      value: 'G',
    },
  ]
}
</file>

<file path="editor/src/helpers/options/getLabelWrapperWidthOptions.js">
export const getLabelWrapperWidthOptions = () => {
  return [
    {
      label: t('Default'),
      value: 'default',
    },
    {
      label: t('Hidden'),
      value: 'hidden',
    },
    {
      label: '8%',
      value: '1',
    },
    {
      label: '17%',
      value: '2',
    },
    {
      label: '25%',
      value: '3',
    },
    {
      label: '33%',
      value: '4',
    },
    {
      label: '41%',
      value: '5',
    },
... (31 lines truncated)
</file>

<file path="editor/src/helpers/options/getOnOffOptions.js">
export const ONOFF_BOOLEAN = 'boolean'
export const ONOFF_NUMERIC = 'numeric'
export const ONOFF_SHORTSTRING = 'shortString'
export const getOnOffOptions = (valueType = ONOFF_NUMERIC) => {
  let options = []
  switch (valueType) {
    case ONOFF_BOOLEAN:
      options = [
        { name: t('On'), value: true },
        { name: t('Off'), value: false },
      ]
      break
    case ONOFF_NUMERIC:
      options = [
        { name: t('On'), value: '1' },
        { name: t('Off'), value: '0' },
      ]
      break
    case ONOFF_SHORTSTRING:
      options = [
        { name: t('On'), value: 'Y' },
        { name: t('Off'), value: 'N' },
      ]
      break
  }
  return options
}
</file>

<file path="editor/src/helpers/options/getOrderOptions.js">
export const getOrderOptions = () => {
  return [
    {
      label: t('Normal'),
      value: 'normal',
    },
    {
      label: t('Random'),
      value: 'random',
    },
    {
      label: t('Alphabetical'),
      value: 'alphabetical',
    },
    {
      label: t('Random A-Z/Z-A'),
      value: 'random_alphabetical',
    },
  ]
}
</file>

<file path="editor/src/helpers/options/getSliderLayoutOptions.js">
export const getSliderLayoutOptions = () => {
  return [
    {
      label: t('Off'),
      value: '0',
    },
    {
      label: t('Stars'),
      value: '1',
    },
    {
      label: t('Slider with emoticon'),
      value: '2',
    },
  ]
}
</file>

<file path="editor/src/helpers/options/getSurveyPanels.js">
import { getSurveyPanelConfig } from 'shared/getSurveyPanelConfig'
export const getSurveyPanels = (survey = {}) => {
  return getSurveyPanelConfig(survey)
}
export const getCurrentLayout = (panel) => {
  const settingsPanels = [
    getSurveyPanels().settings.panel,
    getSurveyPanels().presentation.panel,
  ]
  if (settingsPanels.includes(panel)) {
    return LAYOUT_TYPES.Settings
  }
  if (panel === getSurveyPanels().translations.panel) {
    return LAYOUT_TYPES.Translations
  }
  return LAYOUT_TYPES.Survey
}
export const LAYOUT_TYPES = {
  Survey: 'survey',
  Settings: 'settings',
  Translations: 'translations',
}
</file>

<file path="editor/src/helpers/options/getTooltipMessages.js">
export const getTooltipMessages = () => {
  return {
    ACTIVE_DISABLED: t('Deactivate survey to edit'),
    DISABLE_FIRST: t('Please deactivate the survey before using this feature.'),
    NO_PERMISSION: t('No permission.'),
    SURVEY_NOT_ACTIVE: t('Survey is not active'),
    SURVEY_NOT_ACTIVE_NO_RESULTS: t(
      'This survey has not been activated. There are no results to browse.'
    ),
  }
}
</file>

<file path="editor/src/helpers/options/getVisualizationOptions.js">
export const getVisualizationOptions = () => {
  return [
    {
      label: t('List'),
      value: 'list',
    },
    {
      label: t('Block'),
      value: 'blocks',
    },
    {
      label: t('Buttons'),
      value: 'buttons',
    },
  ]
}
</file>

<file path="editor/src/helpers/options/getYesNoOptions.js">
export const YESNO_BOOLEAN = 'boolean'
export const YESNO_STRING_BOOLEAN = 'stringBoolean'
export const YESNO_NUMERIC = 'numeric'
export const YESNO_SHORTSTRING = 'shortString'
export const YESNO_LONGSTRING = 'longString'
export const YESNO_AS_ONOFFSTRING = 'asOnOffString'
export const getYesNoOptions = (valueType = YESNO_NUMERIC) => {
  let options = []
  switch (valueType) {
    case YESNO_BOOLEAN:
      options = [
        { name: t('Yes'), value: true },
        { name: t('No'), value: false },
      ]
      break
    case YESNO_STRING_BOOLEAN:
      options = [
        { name: t('Yes'), value: 'true' },
        { name: t('No'), value: 'false' },
      ]
      break
    case YESNO_NUMERIC:
      options = [
        { name: t('Yes'), value: '1' },
        { name: t('No'), value: '0' },
      ]
      break
    case YESNO_SHORTSTRING:
      options = [
        { name: t('Yes'), value: 'Y' },
... (19 lines truncated)
</file>

<file path="editor/src/helpers/options/index.js">
export * from './getFormatOptions'
export * from './getVisualizationOptions'
export * from './getSliderLayoutOptions'
export * from './getOrderOptions'
export * from './getDisplayButtonTypeOptions'
export * from './getColumnWidthOptions'
export * from './getLabelWrapperWidthOptions'
export * from './getCommentedCheckboxOptions'
export * from './getSurveyPanels'
export * from './getTooltipMessages'
export * from './getYesNoOptions'
export * from './getOnOffOptions'
</file>

<file path="editor/src/helpers/questionImage/getAndGenerateQuestionImageStyles.js">
export const getAndGenerateImageStyles = (imageProps, asString = false) => {
  const styles = {
    borderRadius: `${imageProps.imageRadius || 0}px`,
    filter: '',
  }
  // Custom brightness value expected between -100 and 100
  const imageBrightness = imageProps.imageBrightness || 0
  // Map -100 to 100 -> 0 to 2 (CSS brightness range)
  const brightnessValue = (imageBrightness + 100) / 100
  styles.filter = `brightness(${brightnessValue})`
  // If asString is true, convert the styles object to a CSS string with proper kebab-case
  if (asString) {
    return Object.entries(styles)
      .map(([property, value]) => {
        // Convert camelCase to kebab-case (e.g., borderRadius -> border-radius)
        const cssProperty = property.replace(/([A-Z])/g, '-$1').toLowerCase()
        return `${cssProperty}: ${value};`
      })
      .join(' ')
  }
  return styles
}
</file>

<file path="editor/src/helpers/questionImage/getClearedQuestionImageObject.js">
export const getClearedQuestionImageObject = () => {
  return {
    imagePath: '',
    imageAlign: 'left',
    imageBrightness: 0,
    imageRadius: 0,
    imageAltText: '',
    imageStyles: '',
  }
}
</file>

<file path="editor/src/helpers/questionImage/getQuestionImageObjectFromImageAttribute.js">
import { getAndGenerateImageStyles } from './getAndGenerateQuestionImageStyles'
export const getQuestionImageObjectFromImageAttribute = (imageAttribute) => {
  const jsonString = imageAttribute?.[''] || imageAttribute
  let parsedValue = jsonString
  if (typeof jsonString === 'string' && jsonString !== '') {
    try {
      parsedValue = JSON.parse(jsonString)
    } catch (error) {
      parsedValue = {}
    }
  }
  const imageAlign = parsedValue?.image_align || 'left'
  const imageBrightness = parsedValue?.image_brightness || 0
  const imageZoom = parsedValue?.image_zoom || 1
  const imageRotate = parsedValue?.image_rotate || 0
  const imageRadius = parsedValue?.image_radius || 0
  const imagePositionX = parsedValue?.image_position_x || 0.5
  const imagePositionY = parsedValue?.image_position_y || 0.5
  const imageAltText = parsedValue?.image_alt_text || ''
  const imagePath = parsedValue?.image_path || ''
  const imagePreviewUrl = imagePath
    ? process.env.REACT_APP_SITE_URL + imagePath
    : null
  const hasQuestionImage = imagePath !== ''
  const hasQuestionImageAsBackground =
    hasQuestionImage && imageAlign === 'center'
  const imageObject = {
    hasQuestionImage,
    hasQuestionImageAsBackground,
    imageAlign,
... (14 lines truncated)
</file>

<file path="editor/src/helpers/questionImage/index.js">
export * from './getQuestionImageObjectFromImageAttribute'
export * from './getAndGenerateQuestionImageStyles'
export * from './getClearedQuestionImageObject'
</file>

<file path="editor/src/helpers/Alert.js">
import { CloseIcon, ExclamationMark, XIcon } from 'components/icons'
import toast from 'react-hot-toast'
import Swal from 'sweetalert2'
import withReactContent from 'sweetalert2-react-content'
import React from 'react'
import ReactDOMServer from 'react-dom/server'
export const SwalAlert = withReactContent(Swal)
export const confirmAlert = ({
  title = t('Are you sure?'),
  text = t("You won't be able to revert this!"),
  showCancelButton = true,
  confirmButtonText = t('Yes, delete'),
  icon = '',
  html = '',
  width = 400,
  confirmButtonClass = '',
  containerClass = '',
  showCloseButton = true,
  closeButtonClass = '',
}) => {
  return SwalAlert.fire({
    showCloseButton,
    closeButtonHtml: ReactDOMServer.renderToString(
      <CloseIcon className="text-black fill-current" />
    ),
    title,
    text,
    icon,
    showCancelButton,
    confirmButtonText,
... (133 lines truncated)
</file>

<file path="editor/src/helpers/arrayDeleteItem.js">
import { cloneDeep } from 'lodash'
export const arrayDeleteItem = (array, index) => {
  const clonedArray = cloneDeep(array)
  const deletedItem = clonedArray.splice(index, 1)
  return [clonedArray, deletedItem]
}
</file>

<file path="editor/src/helpers/arrayInsertItem.js">
import { cloneDeep } from 'lodash'
export const arrayInsertItem = (array, index, newItem) => {
  const clonedArray = cloneDeep(array)
  clonedArray.splice(index, 0, newItem)
  return clonedArray
}
</file>

<file path="editor/src/helpers/categorizeFileTypes.js">
const mimeTypes = {
  jpg: 'image/jpeg',
  jpeg: 'image/jpeg',
  jfif: 'image/jpeg',
  jpe: 'image/jpeg',
  png: 'image/png',
  gif: 'image/gif',
  bmp: 'image/bmp',
  tif: 'image/tiff',
  tiff: 'image/tiff',
  webp: 'image/webp',
  txt: 'text/plain',
  csv: 'text/csv',
  xml: 'text/xml',
  json: 'application/json',
  html: 'text/html',
  htm: 'text/html',
  css: 'text/css',
  js: 'application/javascript',
  md: 'text/markdown',
  log: 'text/plain',
  sql: 'text/plain',
  py: 'text/x-python',
  java: 'text/x-java-source',
  c: 'text/x-c',
  cpp: 'text/x-c++',
  pdf: 'application/pdf',
  doc: 'application/msword',
  docx: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
  xls: 'application/vnd.ms-excel',
... (25 lines truncated)
</file>

<file path="editor/src/helpers/createQuestionGroup.js">
import { APP_KEY_PREFIX, NEW_OBJECT_ID_PREFIX } from './constants/constants'
import { RandomNumber } from './RandomNumber'
export const createQuestionGroup = ({
  sid,
  language,
  gid,
  appKey = `questionGroup-${APP_KEY_PREFIX}${RandomNumber()}`,
  type = 'QG',
  theme = 'QuestionGroup',
}) => {
  const resolvedGid = gid ?? `${NEW_OBJECT_ID_PREFIX}${RandomNumber()}`
  return {
    gid: resolvedGid,
    appKey: appKey,
    sid,
    type,
    theme,
    l10ns: {
      [language]: {
        groupName: '',
        description: '',
      },
    },
    questions: [],
  }
}
</file>

<file path="editor/src/helpers/dayJsHelper.js">
import dayjs from 'dayjs'
import utc from 'dayjs/plugin/utc'
import timezone from 'dayjs/plugin/timezone'
import relativeTime from 'dayjs/plugin/relativeTime'
dayjs.extend(utc)
dayjs.extend(timezone)
dayjs.extend(relativeTime)
export const dayJsHelper = dayjs
</file>

<file path="editor/src/helpers/decodeHtml.js">
export const decodeHtml = (html) => {
  const txt = document.createElement('textarea')
  txt.innerHTML = html
  return txt.value
}
</file>

<file path="editor/src/helpers/decodeHTMLEntities.js">
export const decodeHTMLEntities = (text) => {
  const element = document.createElement('span')
  if (text) {
    element.innerHTML = text
    return element.textContent
  }
  return ''
}
</file>

<file path="editor/src/helpers/downloadBlob.js">
export function getFilenameFromContentDisposition(
  contentDisposition,
  fallback
) {
  const match = /filename="?([^"]+)"?/i.exec(contentDisposition || '')
  return match ? match[1] : fallback
}
export function downloadBlob(blob, filename) {
  const url = URL.createObjectURL(blob)
  const link = document.createElement('a')
  link.href = url
  link.download = filename
  document.body.appendChild(link)
  link.click()
  link.remove()
  URL.revokeObjectURL(url)
}
</file>

<file path="editor/src/helpers/downloadCanvasAsImage.js">
export function downloadCanvasAsImage(
  canvas,
  filename = 'QRCode.png',
  type = 'image/png'
) {
  if (!canvas) return
  const dataURL = canvas.toDataURL(type)
  const link = document.createElement('a')
  link.href = dataURL
  link.download = filename
  link.click()
}
</file>

<file path="editor/src/helpers/DuplicateQuestion.js">
import { NEW_OBJECT_ID_PREFIX, RandomNumber } from 'helpers'
import { cloneDeep } from 'lodash'
export const DuplicateQuestion = (question) => {
  const newDuplicatedQuestionId = `${NEW_OBJECT_ID_PREFIX}${RandomNumber()}`
  const duplicatedQuestion = cloneDeep({
    ...question,
    qid: newDuplicatedQuestionId,
    tempId: newDuplicatedQuestionId,
    title: `Q${RandomNumber()}`,
  })
  for (const [languageKey, language] of Object.entries(
    duplicatedQuestion.l10ns ?? {}
  )) {
    duplicatedQuestion.l10ns[languageKey] = {
      question: language.question,
      help: language.help,
    }
  }
  duplicatedQuestion.answers =
    duplicatedQuestion.answers?.map((answer) => {
      delete answer.aid
      const tempId = `${NEW_OBJECT_ID_PREFIX}${RandomNumber()}`
      for (const [languageKey, language] of Object.entries(
        answer.l10ns ?? {}
      )) {
        answer.l10ns[languageKey] = {
          answer: language.answer,
          language: language.language,
        }
      }
... (29 lines truncated)
</file>

<file path="editor/src/helpers/DuplicateQuestionGroup.js">
import {
  APP_KEY_PREFIX,
  DuplicateQuestion,
  NEW_OBJECT_ID_PREFIX,
} from 'helpers'
import { RandomNumber } from './RandomNumber'
import { cloneDeep } from 'lodash'
export const DuplicateQuestionGroup = (questionGroup) => {
  const duplicatedQuestionGroup = cloneDeep(questionGroup)
  const gid = `${NEW_OBJECT_ID_PREFIX}${RandomNumber()}`
  duplicatedQuestionGroup.gid = gid
  duplicatedQuestionGroup.tempId = gid
  duplicatedQuestionGroup.appKey = `questionGroup-${APP_KEY_PREFIX}${RandomNumber()}`
  for (const [languageKey, language] of Object.entries(
    duplicatedQuestionGroup.l10ns ?? {}
  )) {
    duplicatedQuestionGroup.l10ns[languageKey] = {
      groupName: language.groupName,
      description: language.description,
    }
  }
  duplicatedQuestionGroup.questions = duplicatedQuestionGroup.questions.map(
    (question) => {
      question.gid = gid
      return DuplicateQuestion(question, false)
    }
  )
  return duplicatedQuestionGroup
}
</file>

<file path="editor/src/helpers/entityHelpers.js">
import { isUndefined } from 'lodash'
import { EntitiesType } from './Buffer'
import { arrayDeleteItem } from './arrayDeleteItem'
import { getEntityInfo } from './getEntityInfo'
import { replaceValuesInObject } from './replaceValuesInObject'
export const replaceSurveyEntityParentRefs = function (
  survey,
  groupIndex,
  questionIndex,
  subquestionIndex,
  answerIndex
) {
  if (isUndefined(groupIndex) || !survey?.questionGroups?.[groupIndex]) return
  const newGroups = [...survey.questionGroups]
  const newGroup = { ...newGroups[groupIndex] }
  newGroups[groupIndex] = newGroup
  survey.questionGroups = newGroups
  if (isUndefined(questionIndex) || !newGroup.questions?.[questionIndex]) return
  const newQuestions = [...newGroup.questions]
  const newQuestion = { ...newQuestions[questionIndex] }
  newQuestions[questionIndex] = newQuestion
  newGroup.questions = newQuestions
  if (!isUndefined(subquestionIndex)) {
    const newSubquestions = [...newQuestion.subquestions]
    newSubquestions[subquestionIndex] = { ...newSubquestions[subquestionIndex] }
    newQuestion.subquestions = newSubquestions
  }
  if (!isUndefined(answerIndex)) {
    const newAnswers = [...newQuestion.answers]
    newAnswers[answerIndex] = { ...newAnswers[answerIndex] }
... (153 lines truncated)
</file>

<file path="editor/src/helpers/extractStrings.js">
export const extractStrings = (obj, ignoredKeys = []) => {
  const result = []
  function traverse(value, key) {
    if (ignoredKeys.includes(key)) {
      return
    }
    if (typeof value === 'string') {
      result.push(value)
    } else if (Array.isArray(value)) {
      value.forEach((item) => traverse(item, key))
    } else if (typeof value === 'object' && value !== null) {
      Object.entries(value).forEach(([k, v]) => traverse(v, k))
    }
  }
  if (Array.isArray(obj)) {
    obj.forEach((item) => traverse(item, null))
  } else {
    traverse(obj, null)
  }
  return result
}
</file>

<file path="editor/src/helpers/filterArray.js">
import { cloneDeep } from 'lodash'
export const filterArray = (_array, conditionFunction) => {
  const array = cloneDeep(_array)
  const filterResult = array.reduce(
    ({ validArray, filteredArray }, item) => {
      if (conditionFunction(item)) {
        validArray.push(item)
      } else {
        filteredArray.push(item)
      }
      return { validArray, filteredArray }
    },
    { validArray: [], filteredArray: [] }
  )
  return {
    validArray: filterResult.validArray,
    filteredArray: filterResult.filteredArray,
  }
}
</file>

<file path="editor/src/helpers/filterCollection.js">
export const filterCollection = (collection, callback) => {
  if (Array.isArray(collection)) {
    return collection.filter(callback)
  } else if (typeof collection === 'object' && collection !== null) {
    return Object.fromEntries(
      Object.entries(collection).filter(([key, value]) =>
        callback(value, key, collection)
      )
    )
  } else {
    throw new TypeError('Input should be an array or an object')
  }
}
</file>

<file path="editor/src/helpers/filterObjectByStructure.js">
export const filterObjectByStructure = (
  data,
  scheme
) => {
  const filteredData = {}
  if (typeof data !== 'object' || data === null || Array.isArray(data)) {
    console.error('Invalid data: Expected an object.')
    return {}
  }
  if (typeof scheme !== 'object' || scheme === null || Array.isArray(scheme)) {
    console.error('Invalid structure: Expected an object.')
    return data
  }
  for (const key in scheme) {
    if (data.hasOwnProperty(key)) {
      const typeInStructure = scheme[key]
      const valueInData = data[key]
      if (
        (typeInStructure === 'string' && typeof valueInData === 'string') ||
        (typeInStructure === 'number' && typeof valueInData === 'number') ||
        (typeInStructure === 'object' &&
          typeof valueInData === 'object' &&
          valueInData !== null)
      ) {
        filteredData[key] = valueInData
      }
    } else {
    }
  }
  return filteredData
... (2 lines truncated)
</file>

<file path="editor/src/helpers/filterToNumericOrEmpty.js">
export const filterToNumericOrEmpty = (value) => {
  if (value === '' || /^-?\d*\.?\d*$/.test(value)) {
    return value
  }
  return ''
}
</file>

<file path="editor/src/helpers/getAnswerById.js">
export const getAnswerById = (id, question) => {
  if (question.answers && question.answers.length) {
    for (let i = 0; i < question.answers.length; i++) {
      const answer = question.answers[i]
      if (answer.aid === id) {
        return {
          answer,
          answerIndex: i,
        }
      }
    }
  }
  return {}
}
</file>

<file path="editor/src/helpers/getAnswerByProperty.js">
export const getAnswerByProperty = (propertyValue, propertyName, question) => {
  if (question.answers && question.answers.length) {
    for (let i = 0; i < question.answers.length; i++) {
      const answer = question.answers[i]
      if (answer[propertyName] === propertyValue) {
        return {
          answer,
          answerIndex: i,
        }
      }
    }
  }
  return {}
}
</file>

<file path="editor/src/helpers/getAnswerExample.js">
import { NEW_OBJECT_ID_PREFIX, SCALE_1 } from 'helpers'
import { RandomNumber } from './RandomNumber'
export const getAnswerExample = ({
  qid,
  aid,
  sortOrder = 0,
  scaleId = SCALE_1,
  languages = [],
  languageValue = '',
  code = `A${RandomNumber(1, 999)}`,
}) => {
  aid = aid ?? `${NEW_OBJECT_ID_PREFIX}${RandomNumber()}`
  qid = qid ?? `${NEW_OBJECT_ID_PREFIX}${RandomNumber()}`
  return {
    aid,
    tempId: aid,
    qid,
    code,
    sortOrder,
    assessmentValue: 0,
    scaleId,
    l10ns: languages.reduce((acc, language) => {
      acc[language] = {
        aid: aid,
        answer: languageValue,
        language,
      }
      return acc
    }, {}),
  }
... (2 lines truncated)
</file>

<file path="editor/src/helpers/getApiUrl.js">
export const getApiUrl = (
  relativeUrl = null,
  { version = 'v1', baseUrl = process.env.REACT_APP_API_BASE_URL } = {}
) => {
  if (!baseUrl) {
    const host = window.location.protocol + '//' + window.location.host
    const pathPrefix = window.location.pathname.split('/editor')[0]
    baseUrl = host + pathPrefix + '/rest'
  }
  let parts = [baseUrl]
  if (version) parts.push(version)
  if (relativeUrl) parts.push(relativeUrl)
  return parts.join('/')
}
export default getApiUrl
</file>

<file path="editor/src/helpers/getAttributeValue.js">
import { LANGUAGE_CODES } from 'helpers'
export const getAttributeValue = (attribute, language = 'en') => {
  if (typeof attribute !== 'object') {
    return attribute
  } else if (attribute[language] !== undefined) {
    return attribute[language]
  } else if (attribute[''] !== undefined) {
    return attribute['']
  } else if (attribute[LANGUAGE_CODES.EN] !== undefined) {
    return attribute[LANGUAGE_CODES.EN]
  } else if (attribute !== undefined) {
    return attribute
  } else if (typeof attribute === 'object') {
    return ''
  }
  return attribute
}
</file>

<file path="editor/src/helpers/getCurrentUtcTimestamp.js">
export const getCurrentUtcTimestamp = () => Math.floor(Date.now() / 1000)
</file>

<file path="editor/src/helpers/getDisabledQuestionTypes.js">
import { getQuestionTypeInfo } from '../components'
export const getDisabledQuestionTypes = () => {
  return [getQuestionTypeInfo().RANKING.theme]
}
</file>

<file path="editor/src/helpers/getEntityInfo.js">
import { EntitiesType } from './Buffer'
export const getEntityInfo = (id, survey, entityType) => {
  for (let i = 0; i < survey.questionGroups.length; i++) {
    const group = survey.questionGroups[i]
    if (group.gid === id && entityType === EntitiesType.group) {
      return { [entityType]: group, groupIndex: i }
    }
    if (entityType !== EntitiesType.group) {
      for (let j = 0; j < group.questions.length; j++) {
        const question = group.questions[j]
        if (question.qid === id && entityType === EntitiesType.question) {
          return { [entityType]: question, groupIndex: i, questionIndex: j }
        }
        if (entityType === EntitiesType.answer) {
          for (let k = 0; k < question.answers.length; k++) {
            const answer = question.answers[k]
            if (answer.aid === id) {
              return {
                [entityType]: answer,
                groupIndex: i,
                questionIndex: j,
                answerIndex: k,
              }
            }
          }
        }
        if (entityType === EntitiesType.subquestion) {
          for (let k = 0; k < question.subquestions?.length; k++) {
            const subquestion = question.subquestions[k]
            if (subquestion.qid === id) {
... (31 lines truncated)
</file>

<file path="editor/src/helpers/getGroupById.js">
export const getGroupById = (id, survey) => {
  for (let i = 0; i < survey.questionGroups.length; i++) {
    const group = survey.questionGroups[i]
    if (group.gid === id) {
      return { group, index: i }
    }
  }
  return {}
}
</file>

<file path="editor/src/helpers/getInfoFromObjectByIndex.js">
export const getInfoFromObjectByIndex = (obj = {}, index = 0) => {
  if (!obj) {
    return { value: '', key: '' }
  }
  const values = Object.values(obj ?? {})
  const keys = Object.keys(obj ?? {})
  return { value: values?.[index], key: keys?.[index] }
}
</file>

<file path="editor/src/helpers/GetInvalidSurveyObjects.js">
import { L10ns } from './L10ns/L10ns'
import { TestValidation as TestGroupValidation } from 'components/Survey/QuestionGroups/QuestionGroupSchema'
import { TestValidation as TestQuestionValidation } from 'components/Survey/Questions/QuestionSchema'
import { RemoveHTMLTagsInString } from './RemoveHTMLTagsInString'
export const GetInvalidSurveyObjects = (survey) => {
  let invalidObjectIds = {}
  const questionGroups = survey.questionGroups || []
  const invalidQuestionGroupsIds = validateArray(
    questionGroups,
    'groupName',
    'gid',
    survey.language,
    TestGroupValidation
  )
  invalidObjectIds['gid'] = { ...invalidQuestionGroupsIds }
  for (let i = 0; i < questionGroups.length; i++) {
    const questions = questionGroups[i].questions || []
    const invalidQuestionsIds = validateArray(
      questions,
      'question',
      'qid',
      survey.language,
      TestQuestionValidation,
      i
    )
    invalidObjectIds['qid'] = {
      ...invalidObjectIds['qid'],
      ...invalidQuestionsIds,
    }
  }
... (29 lines truncated)
</file>

<file path="editor/src/helpers/getNoAnswerLabel.js">
export const getNoAnswerLabel = (useForSurveyPreview = false) => {
  if (useForSurveyPreview) {
    return st('No answer')
  } else {
    return t('No answer')
  }
}
</file>

<file path="editor/src/helpers/getPreviousQuestions.js">
import { NEW_OBJECT_ID_PREFIX } from 'helpers'
const hasPreviousQuestions = (
  survey,
  group,
  question,
  currentGroupIndex,
  currentQuestionIndex
) => {
  if (!survey?.questionGroups || !group?.questions) return false
  const groupIndex = survey.questionGroups.indexOf(group)
  const questionIndex = group.questions.indexOf(question)
  if (groupIndex === -1 || questionIndex === -1) return false
  return (
    groupIndex < currentGroupIndex ||
    (groupIndex === currentGroupIndex && questionIndex < currentQuestionIndex)
  )
}
export const getPreviousQuestions = (
  survey,
  currentGroupIndex,
  currentQuestionIndex
) => {
  if (!survey || typeof survey !== 'object') {
    return []
  }
  const questions = []
  const questionGroups = survey.questionGroups || []
  questionGroups.forEach((group) => {
    const groupQuestions = group?.questions || []
    groupQuestions.forEach((question) => {
... (21 lines truncated)
</file>

<file path="editor/src/helpers/getQuestionAttributesTitles.js">
export const getQuestionAttributesTitles = () => {
  return {
    SIMPLE: t('Simple'),
    GENERAL: t('General'),
    DISPLAY: t('Display'),
    LOGIC: t('Logic'),
    OTHER: t('Other'),
    INPUT: t('Input'),
    STATISTICS: t('Statistics'),
    TIMER: t('Timer'),
    LOCATION: t('Location'),
    SLIDER: t('Slider'),
    THEME_OPTIONS: t('Display theme options'),
    FILE_META_DATA: t('File metadata'),
  }
}
</file>

<file path="editor/src/helpers/getQuestionById.js">
export const getQuestionById = (id, survey) => {
  let questionNumber = 0
  for (let i = 0; i < survey.questionGroups.length; i++) {
    const group = survey.questionGroups[i]
    for (let j = 0; j < group.questions.length; j++) {
      const question = group.questions[j]
      ++questionNumber
      if (question.qid?.toString() === id?.toString()) {
        return { question, groupIndex: i, questionIndex: j, questionNumber }
      }
    }
  }
  return {}
}
</file>

<file path="editor/src/helpers/getQuestionExample.js">
import { NEW_OBJECT_ID_PREFIX, SCALE_1 } from 'helpers'
import { RandomNumber } from './RandomNumber'
export const getQuestionExample = ({
  gid,
  qid,
  sid,
  parentQid = 0,
  questionThemeName = 'longfreetext',
  type = 'T',
  sortOrder = 1,
  scaleId = SCALE_1,
  title = `Q${RandomNumber(1, 999)}`,
  answers = [],
  subquestions = [],
  attributes = [],
  mandatory = false,
  encrypted = false,
  relevance = '1',
  languages = [],
  scenarios = [],
  showAssessmentValue,
}) => {
  qid = qid ?? `${NEW_OBJECT_ID_PREFIX}${RandomNumber()}`
  return {
    sid,
    qid,
    tempId: qid,
    gid,
    type,
    scaleId,
... (28 lines truncated)
</file>

<file path="editor/src/helpers/getQuestionExample.test.js">
import { getQuestionExample } from './getQuestionExample'
describe('getQuestionExample', () => {
  test('includes supplied question attributes', () => {
    const attributes = { random_order: { '': '1' } }
    const question = getQuestionExample({ attributes })
    expect(question.attributes).toEqual(attributes)
  })
  test('includes whether assessment values should be shown', () => {
    const question = getQuestionExample({ showAssessmentValue: true })
    expect(question.showAssessmentValue).toBe(true)
  })
  test('omits the assessment flag when it is not provided', () => {
    const question = getQuestionExample({})
    expect(question).not.toHaveProperty('showAssessmentValue')
  })
  test('preserves an explicitly disabled assessment flag', () => {
    const question = getQuestionExample({ showAssessmentValue: false })
    expect(question.showAssessmentValue).toBe(false)
  })
})
</file>

<file path="editor/src/helpers/getReorganizedQuestionGroups.js">
import { cloneDeep } from 'lodash'
export const getReorganizedQuestionGroups = (reorderedQuestionGroups) => {
  const updatedQuestionGroups = cloneDeep(reorderedQuestionGroups)
  return updatedQuestionGroups
    .map((group, index) => {
      const questions = group.questions
        .map((question, index) => {
          return {
            [question.qid]: {
              sortOrder: index + 1,
            },
          }
        })
        .reduce((a, b) => Object.assign(a, b), {})
      return {
        [group.gid]: {
          sortOrder: index + 1,
          questions,
        },
      }
    })
    .reduce((a, b) => Object.assign(a, b), {})
}
</file>

<file path="editor/src/helpers/getReorganizedQuestions.js">
import { cloneDeep } from 'lodash'
export const getReorganizedQuestions = (reorderedQuestions) => {
  const updatedQuestions = cloneDeep(reorderedQuestions)
  return updatedQuestions
    .map((question) => {
      return {
        [question.qid]: {
          sortOrder: question.sortOrder,
        },
      }
    })
    .reduce((a, b) => Object.assign(a, b), {})
}
</file>

<file path="editor/src/helpers/getSettingValueFromSurvey.js">
const reduceValue = (survey, keyPathArrayWithLimit) => {
  return keyPathArrayWithLimit.reduce(
    (accumulator, currentValue) =>
      accumulator && accumulator[currentValue] !== 'undefined'
        ? accumulator[currentValue]
        : undefined,
    survey
  )
}
export const getSettingValueFromSurvey = (survey, string, language) => {
  if (!language) {
    language = survey.language
  }
  let keyPathArray = string?.keyPath.split('.')
  const isLanguageSetting = keyPathArray[0] === 'languageSettings'
  if (isLanguageSetting) {
    keyPathArray = ['languageSettings', language, ...keyPathArray.slice(1)]
  }
  return keyPathArray.length > 1
    ? (reduceValue(survey, keyPathArray) ?? '')
    : survey?.[string?.keyPath]
}
</file>

<file path="editor/src/helpers/getSiteUrl.js">
export const getSiteUrl = (path = '', needPrefix = true) => {
  let baseUrl = process.env.REACT_APP_SITE_URL
  if (!baseUrl || baseUrl === '/') {
    const host = window.location.protocol + '
    const pathPrefix = window.location.pathname.split('/editor')[0]
    baseUrl = needPrefix ? host + pathPrefix : host
  }
  return baseUrl + path
}
export default getSiteUrl
</file>

<file path="editor/src/helpers/getSubquestionById.js">
export const getSubquestionById = (id, question) => {
  if (question.subquestions && question.subquestions.length) {
    for (let i = 0; i < question.subquestions.length; i++) {
      const subquestion = question.subquestions[i]
      if (subquestion.qid === id) {
        return {
          subquestion,
          subquestionIndex: i,
        }
      }
    }
  }
  return {}
}
</file>

<file path="editor/src/helpers/getSubquestionByProperty.js">
export const getSubquestionByProperty = (
  propertyValue,
  propertyName,
  question
) => {
  if (question.subquestions && question.subquestions.length) {
    for (let i = 0; i < question.subquestions.length; i++) {
      const subquestion = question.subquestions[i]
      if (subquestion[propertyName] === propertyValue) {
        return {
          subquestion,
          subquestionIndex: i,
        }
      }
    }
  }
  return {}
}
</file>

<file path="editor/src/helpers/getSurveyAccessLink.js">
import getSiteUrl from 'helpers/getSiteUrl'
export const getSurveyAccessLink = ({
  survey,
  language,
  isPreviewLink = false,
}) => {
  const alias = survey.languageSettings[language]?.alias?.trim() || ''
  const link = alias || survey.sid
  const lang =
    language && language !== survey.language ? `lang=${language}&` : ''
  const params = isPreviewLink ? '' : `?${lang}newtest=Y`
  return getSiteUrl(`/${link}${params}`)
}
</file>

<file path="editor/src/helpers/getSurveyParticipantAttributes.js">
const getStandardSurveyParticipantsAttributes = () => {
  return [
    { value: '{TOKEN:FIRSTNAME}', label: t('First name') },
    { value: '{TOKEN:LASTNAME}', label: t('Last name') },
    { value: '{TOKEN:EMAIL}', label: t('Email address') },
    { value: '{TOKEN:EMAILSTATUS}', label: t('Email status') },
    { value: '{TOKEN:TOKEN}', label: t('Access code') },
    { value: '{TOKEN:LANGUAGE}', label: t('Language code') },
    { value: '{TOKEN:SENT}', label: t('Invitation sent') },
    { value: '{TOKEN:REMINDERSENT}', label: t('Last reminder sent') },
    {
      value: '{TOKEN:REMINDERCOUNT}',
      label: t('Total number of reminders sent'),
    },
    { value: '{TOKEN:USESLEFT}', label: t('Uses left') },
    { value: '{TOKEN:COMPLETED}', label: t('Completed') },
  ]
}
export const getSurveyParticipantAttributes = (survey) => {
  const attributeDescriptions = survey?.attributeDescriptions || {}
  const customAttributes = Object.entries(attributeDescriptions).map(
    ([key, value]) => ({
      value: `{TOKEN:${key.toUpperCase()}}`,
      label: value.description ? value.description : key,
    })
  )
  const existingValues = new Set(
    getStandardSurveyParticipantsAttributes().map(({ value }) => value)
  )
  const uniqueCustomAttributes = customAttributes.filter(
... (8 lines truncated)
</file>

<file path="editor/src/helpers/hasTempId.js">
import { NEW_OBJECT_ID_PREFIX } from './constants'
const containsTempId = (value) =>
  typeof value === 'string' && value.includes(NEW_OBJECT_ID_PREFIX)
export const hasTempId = (data, key) => {
  if (typeof data === 'string') {
    return containsTempId(data)
  }
  if (typeof data === 'object' && data !== null) {
    for (const k in data) {
      if (k === key && containsTempId(data[k])) {
        return true
      }
      if (typeof data[k] === 'object' && hasTempId(data[k], key)) {
        return true
      }
    }
  }
  return false
}
</file>

<file path="editor/src/helpers/htmlToPlainText.js">
import { RemoveHTMLTagsInString } from './RemoveHTMLTagsInString'
import { decodeHTMLEntities } from './decodeHTMLEntities'
export const htmlToPlainText = (string) =>
  decodeHTMLEntities(RemoveHTMLTagsInString(string))
</file>

<file path="editor/src/helpers/index.js">
export * from './L10ns/L10ns'
export * from './dayJsHelper'
export * from './maybe'
export * from './getApiUrl'
export * from './uuid'
export * from './IsElementOnScreen'
export * from './ScrollToElement'
export * from './constants'
export * from './Alert'
export * from './RandomNumber'
export * from './arrayDeleteItem'
export * from './DuplicateQuestionGroup'
export * from './DuplicateQuestion'
export * from './GetInvalidSurveyObjects'
export * from './RemoveHTMLTagsInString'
export * from './isTrue'
export * from './isTempId'
export * from './MoveQuestion'
export * from './moveQuestionGroup'
export * from './MoveQuestionToGroup'
export * from './ReplaceQuestionCodesWithAnswers'
export * from './SortByProperty'
export * from './Buffer'
export * from './getAttributeValue'
export * from './getQuestionById'
export * from './getGroupById'
export * from './filterArray'
export * from './replaceValuesInObject'
export * from './entityHelpers'
export * from './getEntityInfo'
... (44 lines truncated)
</file>

<file path="editor/src/helpers/InsertElementAndIncrementProperty.js">
import { cloneDeep } from 'lodash'
export const InsertElementAndIncrementProperty = (
  array = [],
  element,
  index = array.length,
  property
) => {
  const newArray = cloneDeep(array)
  newArray.splice(index, 0, element)
  if (property) {
    for (let i = index; i < newArray.length; i++) {
      newArray[i][property] = i + 1
    }
  }
  return newArray
}
</file>

<file path="editor/src/helpers/isArrayQuestion.js">
import {
  getNotSupportedQuestionTypeInfo,
  getQuestionTypeInfo,
} from 'components/QuestionTypes'
const arrayQuestionThemes = [
  getQuestionTypeInfo().ARRAY.theme,
  getQuestionTypeInfo().ARRAY_COLUMN.theme,
  getQuestionTypeInfo().ARRAY_DUAL_SCALE.theme,
  getQuestionTypeInfo().ARRAY_NUMBERS.theme,
  getQuestionTypeInfo().ARRAY_TEXT.theme,
  getNotSupportedQuestionTypeInfo().ARRAY_YES_NO_UNCERTAIN.theme,
  getNotSupportedQuestionTypeInfo().ARRAY_INCREASE_SAME_DECREASE.theme,
]
export const isArrayQuestion = (questionThemeName) => {
  return arrayQuestionThemes.includes(questionThemeName)
}
</file>

<file path="editor/src/helpers/IsElementOnScreen.js">
export const IsElementOnScreen = (
  element,
  bottomOffset = 300,
  topOffset = 200
) => {
  if (!element) {
    return false
  }
  var rect = element.getBoundingClientRect()
  var viewHeight = Math.max(
    document.documentElement.clientHeight,
    window.innerHeight
  )
  return !(
    rect.bottom - bottomOffset < 0 || rect.top + topOffset - viewHeight >= 0
  )
}
</file>

<file path="editor/src/helpers/isRankingQuestion.js">
import { getQuestionTypeInfo } from 'components/QuestionTypes'
const rankingQuestionThemes = [
  getQuestionTypeInfo().RANKING.theme,
  getQuestionTypeInfo().RANKING_ADVANCED.theme,
]
export const isRankingQuestion = (questionThemeName) => {
  return rankingQuestionThemes.includes(questionThemeName)
}
</file>

<file path="editor/src/helpers/isSingleChoiceQuestion.js">
import { singleChoiceThemes } from 'components/QuestionTypes'
export const isSingleChoiceQuestion = (questionThemeName) => {
  return singleChoiceThemes.includes(questionThemeName)
}
</file>

<file path="editor/src/helpers/isSurveyExpired.js">
export const isSurveyExpired = (expires) => {
  if (!expires) {
    return false
  }
  const now = new Date()
  return now > new Date(expires)
}
</file>

<file path="editor/src/helpers/isTempId.js">
import { NEW_OBJECT_ID_PREFIX } from './constants'
export const isTempId = (id) => {
  return String(id).indexOf(NEW_OBJECT_ID_PREFIX) === 0
}
</file>

<file path="editor/src/helpers/isTrue.js">
export const isTrue = (value = '') => {
  return (
    value === true ||
    value === 'true' ||
    value === '1' ||
    value === 'on' ||
    value === 'yes' ||
    value === 'crop' ||
    value === 'Y'
  )
}
</file>

<file path="editor/src/helpers/maybe.js">
const maybe = (maybeName, locale = 'en', defaultValue = '') => {
  if (!maybeName) return defaultValue
  return maybeName[locale] || defaultValue
}
export default maybe
</file>

<file path="editor/src/helpers/mockAnswer.js">
import { RandomNumber } from './RandomNumber'
export const mockAnswer = (title, languages, data) => {
  const aid = RandomNumber()
  const l10ns = languages.reduce((acc, l10ns) => {
    return { ...acc, [l10ns]: { answer: title, aid, language: [l10ns] } }
  }, {})
  return {
    aid: 375,
    qid: 346,
    code: 'A1',
    sortOrder: 0,
    assessmentValue: 1,
    scaleId: 0,
    l10ns,
    ...data,
  }
}
</file>

<file path="editor/src/helpers/MoveQuestion.js">
export const MoveQuestion = (questions, currentIndex, newIndex) => {
  const reorderedQuestions = insertQuestion(questions, currentIndex, newIndex)
  const movedQuestion = reorderedQuestions[newIndex]
  return { reorderedQuestions, movedQuestion }
}
const insertQuestion = (questionsList, startIndex, endIndex) => {
  const updatedList = [...questionsList]
  const [removed] = updatedList.splice(startIndex, 1)
  updatedList.splice(endIndex, 0, removed)
  return updatedList.map((question, index) => {
    question.sortOrder = index + 1
    return question
  })
}
</file>

<file path="editor/src/helpers/moveQuestionGroup.js">
export const moveQuestionGroup = (questionGroupsList, groupIndex, newIndex) => {
  const updatedList = [...questionGroupsList]
  const [removed] = updatedList.splice(groupIndex, 1)
  updatedList.splice(newIndex, 0, removed)
  return updatedList.map((questionGroup, index) => {
    questionGroup.sortOrder = index + 1
    return questionGroup
  })
}
</file>

<file path="editor/src/helpers/MoveQuestionToGroup.js">
export const MoveQuestionToGroup = (
  questionIndex,
  sourceGroup,
  destinationGroup
) => {
  const sourceGroupCopy = { ...sourceGroup }
  const destinationGroupCopy = { ...destinationGroup }
  const [removedItem] = sourceGroupCopy.questions.splice(questionIndex, 1)
  removedItem.gid = destinationGroup.gid
  sourceGroupCopy.questions = sourceGroupCopy.questions.map(
    (question, index) => {
      return { ...question, sortOrder: index + 1 }
    }
  )
  destinationGroupCopy.questions.push(removedItem)
  destinationGroupCopy.questions = destinationGroupCopy.questions.map(
    (question, index) => {
      return { ...question, sortOrder: index + 1 }
    }
  )
  return {
    sourceGroup: sourceGroupCopy,
    destinationGroup: destinationGroupCopy,
  }
}
</file>

<file path="editor/src/helpers/placeholder.js">
export const extractPlaceholders = (text) => {
  return (text.match(/{([^}]+)}/g) || []).map((match) =>
    match.slice(1, -1).replace(/TOKEN:/g, '')
  )
}
export const getQuestionPlaceholders = (language, question) => {
  const questionText = question?.l10ns?.[language]?.question
  return questionText ? extractPlaceholders(questionText) : []
}
export const isPlaceholderInUse = (language, question, placeholderKey) => {
  return getQuestionPlaceholders(language, question).includes(placeholderKey)
}
// Placeholders are highlighted with a <badge> tag so researchers can see at a
// glance that a question or answer uses one. See the `badge` rule in
// themes/contenteditor/content-editor.scss for the styling.
const PLACEHOLDER_REGEX = /(\{[^{}]+\})/g
const PLACEHOLDER_BADGE_REGEX = /<badge>(\{[^{}]+\})<\/badge>/g
export const wrapPlaceholdersInBadges = (text = '') => {
  return removePlaceholderBadges(text).replace(
    PLACEHOLDER_REGEX,
    '<badge>$1</badge>'
  )
}
export const removePlaceholderBadges = (text = '') => {
  return text.replace(PLACEHOLDER_BADGE_REGEX, '$1')
}
</file>

<file path="editor/src/helpers/questionAndAnswerCodeGenerators.js">
const findMaxCode = (codes, defaultPrefix) => {
  return codes.reduce(
    (max, code) => {
      const match = code.match(/^([^\d]*)(\d+)$/)
      if (match) {
        const [, prefix, numericPart] = match
        const numericCode = parseInt(numericPart, 10)
        return numericCode > max.numeric
          ? { numeric: numericCode, prefix: prefix || defaultPrefix }
          : max
      }
      return max
    },
    { numeric: 0, prefix: defaultPrefix }
  )
}
export const getNextQuestionCode = (codeToQuestion) => {
  const maxCode = findMaxCode(Object.keys(codeToQuestion), 'Q')
  const newNumeric = maxCode.numeric + 1
  return `${maxCode.prefix}${newNumeric.toString().padStart(3, '0')}`
}
export const getNextSubQuestionCode = (question, initialCode = null) => {
  let subquestionTitles = []
  if (
    (initialCode === null || initialCode === undefined) &&
    question.qid !== null &&
    question.qid !== undefined
  ) {
    const subquestions = question?.subquestions ?? []
    subquestionTitles = subquestions.map((sq) => sq.title).filter(Boolean)
... (24 lines truncated)
</file>

<file path="editor/src/helpers/RandomNumber.js">
export const RandomNumber = (min = 0, max = 1000000) => {
  min = Math.ceil(min)
  max = Math.ceil(max)
  return Math.floor(Math.random() * (max - min + 1)) + min
}
</file>

<file path="editor/src/helpers/RemoveHTMLTagsInString.js">
export const RemoveHTMLTagsInString = (string, allowedTags = []) => {
  if (!string || typeof string !== 'string') {
    return ''
  }
  // Remove all HTML tags if no allowed tags are provided
  if (allowedTags.length === 0) {
    return string.replace(/<\/?[^>]+>/gi, '')
  }
  // Create a regex pattern to allow only the specified tags and strip their attributes
  const allowedTagsRegex = new RegExp(
    `<(/?(${allowedTags.join('|')}))\\s*[^>]*?>`,
    'gi'
  )
  string = string.replace(allowedTagsRegex, (match, tag) => `<${tag}>`)
  const disallowedTagsRegex = new RegExp(
    `<(?!/?(${allowedTags.join('|')})\\b)[^>]+>`,
    'gi'
  )
  string = string.replace(disallowedTagsRegex, '')
  return string
}
</file>

<file path="editor/src/helpers/ReplaceQuestionCodesWithAnswers.js">
import Mexp from 'math-expression-evaluator'
import { RemoveHTMLTagsInString } from './RemoveHTMLTagsInString'
export const ReplaceQuestionCodesWithAnswers = (value, codeToQuestion = {}) => {
  const questionValue = value
  const usedVariables = {}
  const mexp = new Mexp()
  const result = questionValue.replace(
    /\{([^}]+)\}/g,
    (match, variableString) => {
      let hasUndefined = false
      const variableStringWithoutHTML = RemoveHTMLTagsInString(variableString)
      const variables = variableStringWithoutHTML
        .split(/([+\-*/])/)
        .map((variable) => variable.trim())
      for (const variable of variables) {
        if (codeToQuestion.hasOwnProperty(variable)) {
          usedVariables[variable] = codeToQuestion[variable]
          const answerExample = codeToQuestion[variable].question.answerExample
          if (!answerExample) {
            hasUndefined = true
          }
          variableString = variableString.replace(
            variable,
            answerExample ? answerExample : ''
          )
        }
      }
      if (hasUndefined) {
        return ''
      }
... (10 lines truncated)
</file>

<file path="editor/src/helpers/replaceValuesInObject.js">
import { cloneDeep } from 'lodash'
export const replaceValuesInObject = (_obj, oldValue, newValue) => {
  const obj = cloneDeep(_obj)
  Object.keys(obj).forEach((key) => {
    if (key === oldValue) {
      obj[newValue] = obj[key]
      delete obj[key]
    }
    if (typeof obj[newValue] === 'object' && obj[newValue] !== null) {
      obj[newValue] = replaceValuesInObject(obj[newValue], oldValue, newValue)
    }
  })
  Object.keys(obj).forEach((key) => {
    if (obj[key] === oldValue) {
      obj[key] = newValue
    } else if (typeof obj[key] === 'object' && obj[key] !== null) {
      obj[key] = replaceValuesInObject(obj[key], oldValue, newValue)
    }
  })
  return obj
}
</file>

<file path="editor/src/helpers/ScrollToElement.js">
import { IsElementOnScreen } from './IsElementOnScreen'
export const ScrollToElement = (element, offset = 125) => {
  if (!element) {
    return
  }
  if (IsElementOnScreen(element)) {
    return
  }
  var elementPosition = element.getBoundingClientRect().top
  var offsetPosition = elementPosition + window.scrollY - offset
  setTimeout(() => {
    window.scrollTo({
      top: offsetPosition,
      behavior: 'smooth',
    })
  }, 1)
}
</file>

<file path="editor/src/helpers/sleep.js">
export function sleep(ms = 100, scale = 1) {
  return new Promise((resolve) => setTimeout(resolve, ms * scale))
}
</file>

<file path="editor/src/helpers/sliderUtils.js">
import { THUMB_TYPES } from './constants/slider'
export const getStringPartsUsingSeperator = (inputString, separator = '|') => {
  if (!inputString || typeof inputString !== 'string') {
    return { value: '', leftText: null, rightText: null }
  }
  const parts = inputString.split(separator)
  if (parts.length >= 3) {
    return {
      value: parts[0],
      leftText: parts[1],
      rightText: parts[2],
    }
  } else if (parts.length === 2) {
    return {
      value: parts[0],
      leftText: parts[1],
      rightText: null,
    }
  } else {
    return {
      value: parts[0],
      leftText: null,
      rightText: null,
    }
  }
}
export const getThumbStyle = (baseStyle, isDragged, thumbType) => {
  const commonStyle = {
    ...baseStyle,
    display: 'flex',
... (50 lines truncated)
</file>

<file path="editor/src/helpers/SortByProperty.js">
export const SortByProperty = (array, property) => {
  const newArray = [...array]
  newArray.sort((a, b) => {
    const propA = a[property]
    const propB = b[property]
    if (propA < propB) {
      return -1
    }
    if (propA > propB) {
      return 1
    }
    return 0
  })
  return newArray
}
</file>

<file path="editor/src/helpers/surveyExample.js">
export const surveyExample = {
  sid: 596477,
  gsid: 1,
  active: false,
  language: 'en',
  expires: null,
  startDate: null,
  anonymized: false,
  saveTimings: null,
  additionalLanguages: '',
  datestamp: null,
  useCookie: null,
  allowRegister: null,
  allowSave: null,
  autoNumberStart: 0,
  autoRedirect: null,
  allowPrev: null,
  hasSurveyUpdatePermission: true,
  printAnswers: null,
  ipAddr: null,
  ipAnonymize: null,
  refUrl: null,
  saveQuotaExit: null,
  dateCreated: '2023-10-04T10:27:05.000Z',
  publicStatistics: null,
  publicGraphs: null,
  listPublic: null,
  sendConfirmation: null,
  tokenAnswersPersistence: null,
  assessments: null,
... (6894 lines truncated)
</file>

<file path="editor/src/helpers/updateQuestionsSortOrder.js">
export const updateQuestionsSortOrder = (questions) => {
  let i = 1
  questions.forEach((question) => {
    question.sortOrder = i
    ++i
  })
  return questions
}
</file>

<file path="editor/src/helpers/Utils.js">
export const formatUrlPreview = (url, maxLength) => {
  const cleanUrl = url.replace(/(^\w+:|^)\/\//, '') // Removes protocol
  if (cleanUrl.length <= maxLength) return cleanUrl
  const halfLength = Math.floor((maxLength - 3) / 2) /// Half of the remaining length for the ellipsis ( 3 is for ... )
  return cleanUrl.slice(0, halfLength) + '...' + cleanUrl.slice(-halfLength)
}
</file>

<file path="editor/src/helpers/uuid.js">
const uuid = () => {
  var S4 = function () {
    return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1)
  }
  return (
    S4() +
    S4() +
    '-' +
    S4() +
    '-' +
    S4() +
    '-' +
    S4() +
    '-' +
    S4() +
    S4() +
    S4()
  )
}
export default uuid
</file>

<file path="editor/src/hooks/feedback/index.js">
export * from './useCookieFeedbackStore'
export * from './useFeedbackForm'
</file>

<file path="editor/src/hooks/feedback/useCookieFeedbackStore.js">
import { useCallback } from 'react'
import { useCookies } from 'react-cookie'
import { cookieExpiresInterval, getFeedbackConfigs } from 'helpers'
export const useCookieFeedbackStore = () => {
  const feedbackConfigs = getFeedbackConfigs()
  const cookieKeys = Object.values(feedbackConfigs).map(
    (config) => config.cookieKey
  )
  const [cookies, setCookie] = useCookies(cookieKeys)
  const getFeedbackData = useCallback(
    (feedbackType) => {
      const config = feedbackConfigs[feedbackType]
      return (
        cookies[config.cookieKey] ?? {
          initialLoad: null,
          previouslyShown: null,
          dontAskAgain: false,
          feedbackGiven: false,
        }
      )
    },
    [cookies]
  )
  const setFeedbackData = useCallback(
    (feedbackType, setDataCallback) => {
      const config = feedbackConfigs[feedbackType]
      const currentData = getFeedbackData(feedbackType)
      setCookie(config.cookieKey, setDataCallback(currentData), {
        path: '/',
        expires: new Date(Date.now() + cookieExpiresInterval),
... (19 lines truncated)
</file>

<file path="editor/src/hooks/feedback/useFeedbackForm.js">
import { useMemo, useCallback } from 'react'
import {
  dayJsHelper,
  getFeedbackConfigs,
  FEEDBACK_TYPES,
  openFeedbackSurveyInNewTab,
} from 'helpers'
import { useAuth, useCookieFeedbackStore } from 'hooks'
import pluginManager from 'plugins/PluginManager'
import { PLUGIN_SLOTS } from 'plugins/slots'
export const useFeedbackForm = () => {
  const { userId } = useAuth()
  const { getFeedbackData, updateFeedbackData } = useCookieFeedbackStore()
  const feedbackConfigs = useMemo(() => getFeedbackConfigs(), [])
  const urlParams = useMemo(() => {
    return new URLSearchParams({
      domain: window.location.hostname,
      userId,
    })
  }, [userId])
  const trackInitialLoad = useCallback(
    (feedbackType) => {
      const data = getFeedbackData(feedbackType)
      if (!data.initialLoad) {
        updateFeedbackData(feedbackType, {
          initialLoad: dayJsHelper().toISOString(),
        })
      }
    },
    [getFeedbackData, updateFeedbackData]
... (51 lines truncated)
</file>

<file path="editor/src/hooks/index.js">
export * from './useAppState'
export * from './useAuth'
export * from './useAuthService'
export * from './useFileService'
export * from './useFocused'
export * from './useSurvey'
export * from './useSurveyArchive'
export * from './useSurveyLogic'
export * from './useExpressionScriptValidation'
export * from './useElementClick'
export * from './useBuffer'
export * from './useGlobalStates'
export * from './useSurveyService'
export * from './useSurveyGroupsService'
export * from './useSurveyImportService'
export * from './useErrors'
export * from './useQueryRetry'
export * from './useOperationCallback'
export * from './useQuestionChildren'
export * from './useTranslationsService'
export * from './useUserService'
export * from './useSetAllLanguages'
export * from './useClickOutside'
export * from './useDebounce'
export * from './useConditionDesigner'
export * from './feedback'
export * from './useSurveyUpdatePermission'
export * from './useResponses'
export * from './useDebouncedCallback'
export * from './useResponses'
... (9 lines truncated)
</file>

<file path="editor/src/hooks/useAppState.js">
import { useQuery } from '@tanstack/react-query'
import { useCallback } from 'react'
import { queryClient } from 'queryClient'
export const useAppState = (key, initValue = '', config = {}) => {
  const { data } = useQuery({
    queryKey: ['appState', key],
    queryFn: () => initValue,
    select: (data) => data,
    staleTime: Infinity,
    cacheTime: Infinity,
    meta: {
      persist: true,
    },
    ...config,
  })
  const setValue = useCallback((newValue) => {
    queryClient.setQueryData(['appState', key], newValue)
  }, [])
  return [data, setValue]
}
</file>

<file path="editor/src/hooks/useAuth.js">
import { useEffect } from 'react'
import { useQuery } from '@tanstack/react-query'
import { useCookies } from 'react-cookie'
import { queryClient } from 'queryClient'
import { dayJsHelper } from 'helpers'
import { useAuthService } from './'
export const useAuth = () => {
  const { authService } = useAuthService()
  const [cookies, removeCookie] = useCookies(['LS_AUTH_INIT'])
  const { data: auth } = useQuery({
    queryKey: ['auth'],
    queryFn: async () => {
      const initData = queryClient.getQueryData(['auth']) || {}
      const restHeaders = getRestHeaders(initData)
      let result = initData
      if (isLoggedIn(initData) && getTokenAgeSeconds(initData) >= 60 * 30) {
        result = await authService.refresh(restHeaders)
      }
      return result
    },
    refetchOnMount: 'always',
    staleTime: Infinity,
    refetchInterval: 1000 * 60,
    meta: {
      persist: true,
    },
  })
  const setAuth = (value) => {
    return queryClient.setQueryData(['auth'], value)
  }
... (42 lines truncated)
</file>

<file path="editor/src/hooks/useAuthService.js">
import { AuthService } from 'services'
import { getApiUrl } from 'helpers'
export const useAuthService = () => {
  return {
    authService: new AuthService(getApiUrl()),
  }
}
</file>

<file path="editor/src/hooks/useBuffer.js">
import { useCallback } from 'react'
import { useQuery } from '@tanstack/react-query'
import { queryClient } from 'queryClient'
import { OperationsBuffer, STATES } from 'helpers'
import { useErrors } from './useErrors'
export const useBuffer = () => {
  let { data } = useQuery({
    queryKey: [STATES.BUFFER],
    queryFn: () => [],
    cacheTime: Infinity,
    staleTime: Infinity,
  })
  let { data: hash = '' } = useQuery({
    queryKey: [STATES.BUFFER_HASH],
    queryFn: () => '',
    cacheTime: Infinity,
    staleTime: Infinity,
  })
  const { removeError } = useErrors()
  const setBuffer = (data, hash) => {
    queryClient.setQueryData([STATES.BUFFER], data)
    if (hash) {
      queryClient.setQueryData([STATES.BUFFER_HASH], hash)
    }
  }
  const clearBuffer = useCallback(({ ready } = {}) => {
    const operationBuffer = new OperationsBuffer(
      queryClient.getQueryData([STATES.BUFFER])
    )
    const newOperations =
... (31 lines truncated)
</file>

<file path="editor/src/hooks/useChildKeyboardShortcuts.js">
import { useCallback, useRef } from 'react'
export const useChildKeyboardShortcuts = ({
  children,
  entityType,
  handleChildAdd,
  handleChildDelete,
  isSurveyActive,
}) => {
  const childrenRef = useRef(children)
  childrenRef.current = children
  const getKeyDownHandler = useCallback(
    (childId, index) => (event) => {
      if (isSurveyActive) return
      if (event.defaultPrevented || event.repeat) return
      const isCtrlOrCmd = event.ctrlKey || event.metaKey
      const isEnterKey =
        event.key === 'Enter' ||
        event.code === 'Enter' ||
        event.code === 'NumpadEnter'
      const currentChildren = childrenRef.current || []
      if (isCtrlOrCmd && event.shiftKey) {
        return
      }
      if (isEnterKey && (isCtrlOrCmd || event.shiftKey)) {
        event.preventDefault()
        event.stopPropagation()
        event.nativeEvent?.stopImmediatePropagation?.()
        const currentIndex = currentChildren.findIndex(
          (child) => child.qid === childId || child.aid === childId
        )
... (22 lines truncated)
</file>

<file path="editor/src/hooks/useClickOutside.js">
import { useEffect } from 'react'
export const useClickOutside = (ref, handler) => {
  useEffect(() => {
    let startedInside = false
    let startedWhenMounted = false
    const listener = (event) => {
      if (startedInside || !startedWhenMounted) return
      if (!ref.current || ref.current.contains(event.target)) return
      handler(event)
    }
    const validateEventStart = (event) => {
      startedWhenMounted = ref.current
      startedInside = ref.current && ref.current.contains(event.target)
    }
    document.addEventListener('mousedown', validateEventStart)
    document.addEventListener('touchstart', validateEventStart)
    document.addEventListener('click', listener)
    return () => {
      document.removeEventListener('mousedown', validateEventStart)
      document.removeEventListener('touchstart', validateEventStart)
      document.removeEventListener('click', listener)
    }
  }, [ref, handler])
}
</file>

<file path="editor/src/hooks/useConditionDesigner.js">
import { useRef } from 'react'
import {
  createBufferOperation,
  errorToast,
  QUESTION_RELEVANCE_DEFAULT_VALUE,
} from 'helpers'
import {
  buildScenarioPayload,
  getApiOperationActions,
  getDefaultCondition,
  hasConditionChanged,
  isDuplicateCondition,
  showSuccessMessage,
  updateQuestionScenarios,
  syncSurveyQuestionWithScenarios,
  isDuplicate,
} from '../components/ConditionDesigner/utils'
export const useConditionDesigner = ({
  survey,
  question,
  focused,
  scid,
  scenarioToPatch,
  groupIndex,
  questionIndex,
  conditions,
  addToBuffer,
  setScid,
  setConditions,
  update,
... (212 lines truncated)
</file>

<file path="editor/src/hooks/useDebounce.js">
import { useRef, useCallback } from 'react'
const useAnimationFrameDebounce = (fn, wait = 0) => {
  const frameId = useRef(null)
  const lastArgs = useRef([])
  const debounced = useCallback(
    (...args) => {
      if (frameId.current !== null) {
        cancelAnimationFrame(frameId.current)
      }
      const startTime = performance.now()
      lastArgs.current = args
      const loop = (timeNow) => {
        if (timeNow - startTime < wait) {
          frameId.current = requestAnimationFrame(loop)
          return
        }
        fn(...lastArgs.current)
        frameId.current = null
      }
      frameId.current = requestAnimationFrame(loop)
    },
    [fn, wait]
  )
  return debounced
}
export const useDebounce = (fn, wait = 0) => {
  return useAnimationFrameDebounce(fn, wait)
}
</file>

<file path="editor/src/hooks/useDebouncedCallback.js">
import { useRef, useCallback, useEffect } from 'react'
export const useDebouncedCallback = (callback, delay = 500) => {
  const timeoutRef = useRef()
  const debouncedFn = useCallback(
    (...args) => {
      if (timeoutRef.current) {
        clearTimeout(timeoutRef.current)
      }
      timeoutRef.current = setTimeout(() => {
        callback(...args)
      }, delay)
    },
    [callback, delay]
  )
  useEffect(() => {
    return () => clearTimeout(timeoutRef.current)
  }, [])
  return debouncedFn
}
</file>

<file path="editor/src/hooks/useEditorCompatibilityGuard.js">
import { useEffect } from 'react'
import { getSiteUrl } from 'helpers'
import { useSurvey } from './useSurvey'
export const useEditorCompatibilityGuard = (surveyId) => {
  const { survey } = useSurvey(surveyId)
  const isSurveyForRoute =
    survey?.sid !== undefined && Number(survey.sid) === Number(surveyId)
  const isIncompatible = isSurveyForRoute && survey.isEditorCompatible === false
  useEffect(() => {
    if (isIncompatible) {
      window.location.replace(
        getSiteUrl('/surveyAdministration/view/surveyid/' + surveyId)
      )
    }
  }, [isIncompatible, surveyId])
  return isIncompatible
}
</file>

<file path="editor/src/hooks/useElementClick.js">
import { useRef, useEffect } from 'react'
export const useElementClick = (callback, isOutSide = true) => {
  const ref = useRef()
  useEffect(() => {
    const handleClick = (event) => {
      if (ref.current) {
        if (isOutSide && !ref.current.contains(event.target)) {
          callback()
        } else if (!isOutSide && ref.current.contains(event.target)) {
          callback()
        }
      }
    }
    document.addEventListener('click', handleClick, true)
    return () => {
      document.removeEventListener('click', handleClick, true)
    }
  }, [ref, callback, isOutSide])
  return ref
}
</file>

<file path="editor/src/hooks/useErrors.js">
import { useCallback } from 'react'
import { useQuery } from '@tanstack/react-query'
import { queryClient } from 'queryClient'
import { extractStrings, STATES } from 'helpers'
export const useErrors = () => {
  let { data = {} } = useQuery({
    queryKey: [STATES.ERRORS],
    queryFn: () => [],
    cacheTime: Infinity,
    staleTime: Infinity,
  })
  let { data: errorMessages } = useQuery({
    queryKey: [STATES.ERROR_MESSAGES],
    queryFn: () => [],
    cacheTime: Infinity,
    staleTime: Infinity,
  })
  const setErrorsFromPatchResponse = useCallback((patchResponse = []) => {
    queryClient.setQueryData([STATES.ERRORS], {})
    const errors = organizeErrors(patchResponse)
    queryClient.setQueryData([STATES.ERRORS], { ...errors })
  }, [])
  const setErrors = (errors) => {
    queryClient.setQueryData([STATES.ERRORS], { ...errors })
  }
  const setErrorMessages = (errorMessages) => {
    queryClient.setQueryData([STATES.ERROR_MESSAGES], errorMessages)
  }
  const clearErrorMessages = () => {
    setErrorMessages([])
... (41 lines truncated)
</file>

<file path="editor/src/hooks/useExpressionScriptValidation.js">
import { useCallback, useMemo } from 'react'
import { getApiUrl } from 'helpers'
import { ExpressionScriptValidationService } from 'services'
import useAuth from './useAuth'
export const useExpressionScriptValidation = (surveyId, questionId) => {
  const auth = useAuth()
  const service = useMemo(
    () => new ExpressionScriptValidationService(auth, surveyId, getApiUrl()),
    [auth, surveyId]
  )
  return useCallback(
    async (expression, signal) => {
      if (!surveyId || !questionId || !String(expression).trim()) {
        return { valid: true, diagnostics: [] }
      }
      return await service.validate(expression, questionId, signal)
    },
    [questionId, service, surveyId]
  )
}
</file>

<file path="editor/src/hooks/useFileService.js">
import { useParams } from 'react-router-dom'
import { FileService } from 'services'
import { getApiUrl } from 'helpers'
import useAuth from './useAuth'
export const useFileService = () => {
  const auth = useAuth()
  const { surveyId } = useParams()
  return {
    fileService: new FileService(auth, getApiUrl(), surveyId),
  }
}
</file>

<file path="editor/src/hooks/useFocused.js">
import { useQuery } from '@tanstack/react-query'
import { cloneDeep } from 'lodash'
import { useLocation, useNavigate } from 'react-router-dom'
import { getQuestionTypeInfo } from 'components'
import { EntitiesType, STATES } from 'helpers'
import { queryClient } from 'queryClient'
export const useFocused = (focused, groupIndex, questionIndex) => {
  const navigate = useNavigate()
  const location = useLocation()
  const { data } = useQuery({
    queryKey: [STATES.FOCUSED_ENTITY],
    queryFn: () => {
      return {
        focused,
        groupIndex,
        questionIndex,
      }
    },
    staleTime: Infinity,
    meta: {
      persist: true,
    },
  })
  const setFocused = (
    focusElement,
    groupIndex,
    questionIndex,
    unfocus = true
  ) => {
    if (unfocus) unFocus()
... (54 lines truncated)
</file>

<file path="editor/src/hooks/useGlobalStates.js">
import { useMemo } from 'react'
import { queryClient } from 'queryClient'
export const useGlobalStates = (operationsBuffer, surveyHash) => {
  return useMemo(() => {
    const statesArray = queryClient.getQueriesData().map((state) => {
      const key = state[0]
      const value = state[1]
      return {
        [key[1] ? key[1] : key[0]]: value,
      }
    })
    const statesObject = Object.assign({}, ...statesArray)
    return statesObject
  }, [
    queryClient,
    operationsBuffer.bufferHash,
    surveyHash.updateHash,
    surveyHash.refetchHash,
  ])
}
</file>

<file path="editor/src/hooks/useInViewport.js">
import { useEffect, useRef, useState } from 'react'
export const useIsInViewport = (
  externalRef = null,
  { initialInView = true, rootMargin = '1000px 0px 1000px 0px', onChange } = {}
) => {
  const internalRef = useRef(null)
  const [isInView, setIsInView] = useState(initialInView)
  const ref = externalRef || internalRef
  const onChangeRef = useRef(onChange)
  onChangeRef.current = onChange
  useEffect(() => {
    const observer = new IntersectionObserver(
      (entries) => {
        entries.forEach((entry) => {
          setIsInView(entry.isIntersecting)
          onChangeRef.current?.(entry.isIntersecting)
        })
      },
      {
        threshold: 0,
        rootMargin,
      }
    )
    if (ref.current) {
      observer.observe(ref.current)
    }
    return () => {
      if (ref.current) {
        observer.unobserve(ref.current)
      }
... (5 lines truncated)
</file>

<file path="editor/src/hooks/useOperationCallback.js">
import { useCallback } from 'react'
import { useQuery } from '@tanstack/react-query'
import { queryClient } from 'queryClient'
import { STATES } from 'helpers'
export const useOperationCallback = () => {
  const { data: subscriptionMap } = useQuery({
    queryKey: [STATES.OPERATION_FINISH_SUBSCRIPTIONS],
    initialData: new Map(),
    queryFn: () => [],
    staleTime: Infinity,
  })
  const subscribe = useCallback(
    ({ entity, operation, callback, once = true }) => {
      const key = `${entity}_${operation}`
      const subscription = { callback, once }
      const currentSubscriptions = queryClient.getQueryData([
        STATES.OPERATION_FINISH_SUBSCRIPTIONS,
      ])
      if (currentSubscriptions.has(key)) {
        currentSubscriptions.get(key).push(subscription)
      } else {
        currentSubscriptions.set(key, [subscription])
      }
      queryClient.setQueryData(
        [STATES.OPERATION_FINISH_SUBSCRIPTIONS],
        currentSubscriptions
      )
    },
    []
  )
... (33 lines truncated)
</file>

<file path="editor/src/hooks/useQueryRetry.js">
import { useEffect, useState } from 'react'
import { useIdleTimer } from 'react-idle-timer'
import { SwalAlert } from 'helpers'
export const useQueryRetry = ({
  normalFetchInterval = 1000 * 60,
  idleFetchInterval = 1000 * 60 * 5,
  idleTimeOut = 1000 * 60 * 5,
  refetchStopTime = 1000 * 60 * 60,
  detectUserIdleInterval = 1000 * 60 * 5,
}) => {
  const [refetchInterval, setRefetchInterval] = useState(normalFetchInterval)
  const onIdle = () => {
    setRefetchInterval(idleFetchInterval)
  }
  const onActive = () => {
    setRefetchInterval(normalFetchInterval)
  }
  const onAction = () => {}
  const { getTotalIdleTime } = useIdleTimer({
    onIdle,
    onActive,
    onAction,
    timeout: idleTimeOut,
  })
  const handleRetry = (failureCount, error) => {
    if (failureCount < 10) {
      return true
    }
    SwalAlert.fire({
      title: <strong>{error.message}</strong>,
... (27 lines truncated)
</file>

<file path="editor/src/hooks/useQuestionAnswers.js">
import { keepPreviousData, useInfiniteQuery } from '@tanstack/react-query'
import { useMemo } from 'react'
import { getApiUrl, STATES } from 'helpers'
import { StatisticsService } from 'services'
import { useAppState } from './useAppState'
import useAuth from './useAuth'
export const PAGE_SIZE = 15
export function useQuestionAnswers(
  surveyId,
  questionCode,
  buildQuery,
  { enabled = true, fields = [], pageItems } = {}
) {
  const auth = useAuth()
  const [activeLanguage] = useAppState(STATES.ACTIVE_LANGUAGE)
  const statisticsService = useMemo(
    () => new StatisticsService(auth, surveyId, getApiUrl()),
    [auth, surveyId]
  )
  const { queryKey, queryFn } = buildQuery({
    statisticsService,
    activeLanguage,
  })
  const {
    data,
    fetchNextPage,
    hasNextPage,
    isFetching,
    isFetchingNextPage,
    isLoading,
... (33 lines truncated)
</file>

<file path="editor/src/hooks/useQuestionChildren.js">
import { useEffect, useState } from 'react'
import { omit } from 'lodash'
import { useQuery } from '@tanstack/react-query'
import { useBuffer } from './useBuffer'
import {
  Entities,
  SCALE_1,
  SCALE_2,
  STATES,
  createBufferOperation,
  getAnswerExample,
  getNextAnswerCode,
  getQuestionExample,
  getNextSubQuestionCode,
  RandomNumber,
  APP_KEY_PREFIX,
} from 'helpers'
import { reportExtras } from 'appInstrumentation'
import { singleChoiceThemes } from 'components/QuestionTypes'
import { TestValidation } from 'components/Survey/Questions/QuestionCodeSchema'
import { showErrorMessage } from 'components/ConditionDesigner/utils'
export const createChildrenUpdateOperation = (qid, entityType, children) => {
  const props = children.map((child) => omit(child, 'conditiontext'))
  return entityType === Entities.answer
    ? createBufferOperation(qid).answer().update(props)
    : createBufferOperation(qid).subquestion().update(props)
}
export const useQuestionChildren = ({
  question,
  handleUpdate,
... (309 lines truncated)
</file>

<file path="editor/src/hooks/useQuestionChildren.test.js">
import { mapValues, pick } from 'lodash'
import {
  createBufferOperation,
  Entities,
  getAnswerExample,
  getQuestionExample,
  Operations,
  SCALE_1,
  SCALE_2,
} from 'helpers'
import { getOperationScheme } from 'helpers/Buffer/getOperationScheme'
import { OperationsBuffer } from 'helpers/Buffer/OperationsBuffer'
import { createChildrenUpdateOperation } from './useQuestionChildren'
const QID = 5
const serverAnswer = (aid, code, scaleId) => ({
  aid,
  qid: QID,
  code,
  sortOrder: 0,
  assessmentValue: 0,
  scaleId,
  l10ns: { en: { id: aid * 10, aid, answer: code, language: 'en' } },
})
const serverSubquestion = {
  qid: 7,
  parentQid: QID,
  sid: 1,
  type: 'T',
  title: 'SQ001',
  preg: null,
... (112 lines truncated)
</file>

<file path="editor/src/hooks/useQuestionComments.js">
import { useMemo } from 'react'
import { STATES } from 'helpers'
import { PAGE_SIZE, useQuestionAnswers } from './useQuestionAnswers'
export function useQuestionComments(
  surveyId,
  questionCode,
  {
    enabled = true,
    selectedAnswer = '',
    selectedField = '',
    fields = [],
    questionType,
  } = {}
) {
  const { data, ...rest } = useQuestionAnswers(
    surveyId,
    questionCode,
    ({ statisticsService, activeLanguage }) => ({
      queryKey: [
        STATES.SURVEY_RESPONSE_COMMENTS,
        surveyId,
        questionCode,
        activeLanguage,
        selectedAnswer,
        selectedField,
        fields,
        questionType,
      ],
      queryFn: ({ pageParam = 0 }) =>
        statisticsService.getQuestionComments(
... (20 lines truncated)
</file>

<file path="editor/src/hooks/useQuestionFiles.js">
import { STATES } from 'helpers'
import { useQuestionAnswers } from './useQuestionAnswers'
export function useQuestionFiles(
  surveyId,
  questionCode,
  { enabled = true, field, filters = {}, search = [], pageSize } = {}
) {
  const fields = field ? [field] : []
  const {
    items: files,
    data,
    ...rest
  } = useQuestionAnswers(
    surveyId,
    questionCode,
    ({ statisticsService, activeLanguage }) => ({
      queryKey: [
        STATES.SURVEY_RESPONSE_FILES,
        surveyId,
        questionCode,
        activeLanguage,
        field,
        filters,
        search,
        pageSize,
      ],
      queryFn: ({ pageParam = 0 }) =>
        statisticsService.getQuestionFiles(
          surveyId,
          pageParam,
... (13 lines truncated)
</file>

<file path="editor/src/hooks/useQuestionResponses.js">
import { STATES } from 'helpers'
import { PAGE_SIZE, useQuestionAnswers } from './useQuestionAnswers'
export function useQuestionResponses(
  surveyId,
  questionCode,
  { enabled = true, fields = [], filters = {}, search = [] } = {}
) {
  const {
    items: rows,
    data,
    ...rest
  } = useQuestionAnswers(
    surveyId,
    questionCode,
    ({ statisticsService, activeLanguage }) => ({
      queryKey: [
        STATES.SURVEY_RESPONSE_ANSWERS,
        surveyId,
        questionCode,
        activeLanguage,
        filters,
        search,
      ],
      queryFn: ({ pageParam = 0 }) =>
        statisticsService.getQuestionResponses(
          surveyId,
          questionCode,
          pageParam,
          PAGE_SIZE,
          activeLanguage,
... (12 lines truncated)
</file>

<file path="editor/src/hooks/useResponses.js">
import { keepPreviousData, useMutation, useQuery } from '@tanstack/react-query'
import { useMemo } from 'react'
import { getApiUrl, STATES } from 'helpers'
import { ResponseService } from 'services'
import { queryClient } from 'queryClient'
import useAuth from './useAuth'
export function useResponses(surveyId, pagination, filters, sorting) {
  const auth = useAuth()
  const responseService = useMemo(
    () => new ResponseService(auth, surveyId, getApiUrl()),
    [auth]
  )
  const {
    data: responses,
    isFetching,
    refetch,
  } = useQuery({
    queryKey: [
      STATES.SURVEY_RESPONSES,
      surveyId,
      pagination.pageIndex,
      pagination.pageSize,
      filters,
      sorting,
    ],
    queryFn: () =>
      responseService.getSurveyResponses(surveyId, {
        pagination,
        filters,
        sorting,
... (48 lines truncated)
</file>

<file path="editor/src/hooks/useRestClient.js">
import { useParams } from 'react-router-dom'
import { RestClient } from 'services'
import { getApiUrl } from 'helpers'
import useAuth from './useAuth'
export const useRestClient = () => {
  const auth = useAuth()
  const { surveyId } = useParams()
  return {
    restClient: new RestClient(`${getApiUrl}/${surveyId}`, auth.restHeaders),
  }
}
</file>

<file path="editor/src/hooks/useSetAllLanguages.js">
import { useState } from 'react'
import { useAppState, useTranslationsService } from './index'
import { STATES } from '../helpers'
export const useSetAllLanguages = () => {
  const [languages, setLanguages] = useAppState(STATES.ALL_AVAILABLE_LANGUAGES)
  const [userDetail] = useAppState(STATES.USER_DETAIL)
  const { translationsService } = useTranslationsService()
  const [isLoading, setIsLoading] = useState(false)
  const fetchAllLanguages = (surveyLanguages = []) => {
    if (!userDetail?.lang || process.env.STORYBOOK_DEV) {
      return
    }
    if (!isLoading) {
      setIsLoading(true)
      const languagesToFetch = [userDetail.lang, ...surveyLanguages].filter(
        (lang, index, self) =>
          !(languages || {})[lang] && self.indexOf(lang) === index
      )
      if (languagesToFetch.length === 0) {
        setIsLoading(false)
        return
      }
      Promise.all(
        languagesToFetch.map((lang) =>
          translationsService
            .getAllLanguages(lang)
            .then((allLanguages) => ({ [lang]: allLanguages }))
            .catch((error) => {
              console.error(`Error fetching languages for ${lang}:`, error)
              return null
... (26 lines truncated)
</file>

<file path="editor/src/hooks/useStatistics.js">
import { keepPreviousData, useInfiniteQuery } from '@tanstack/react-query'
import { useMemo } from 'react'
import { getApiUrl, STATES } from 'helpers'
import { StatisticsService } from 'services'
import { useAppState } from './useAppState'
import useAuth from './useAuth'
export function useStatistics(surveyId, filters) {
  const auth = useAuth()
  const [activeLanguage] = useAppState(STATES.ACTIVE_LANGUAGE)
  const statisticsService = useMemo(
    () => new StatisticsService(auth, surveyId, getApiUrl()),
    [auth]
  )
  const {
    data: statistics,
    isFetching,
    isFetchingNextPage,
    hasNextPage,
    fetchNextPage,
    refetch,
  } = useInfiniteQuery({
    queryKey: [STATES.SURVEY_STATISTICS, surveyId, activeLanguage, filters],
    queryFn: ({ pageParam }) =>
      statisticsService.getSurveyStatistics(
        surveyId,
        filters,
        pageParam,
        undefined,
        activeLanguage
      ),
... (16 lines truncated)
</file>

<file path="editor/src/hooks/useStatisticsAtGlance.js">
import { useQuery } from '@tanstack/react-query'
import { useMemo } from 'react'
import { getApiUrl, STATES } from 'helpers'
import { StatisticsService } from 'services'
import useAuth from './useAuth'
export function useStatisticsAtGlance(surveyId) {
  const auth = useAuth()
  const statisticsService = useMemo(
    () => new StatisticsService(auth, surveyId, getApiUrl()),
    [auth]
  )
  const {
    data: statistics,
    isFetching,
    refetch,
  } = useQuery({
    queryKey: [STATES.SURVEY_STATISTICS, surveyId],
    queryFn: () => statisticsService.getSurveyStatisticsAtGlance(surveyId),
    select: (data) => data.statistics,
  })
  return {
    statistics,
    isFetching,
    refetch,
  }
}
</file>

<file path="editor/src/hooks/useSurvey.js">
import { useCallback } from 'react'
import { debounce } from 'lodash'
import { useQuery } from '@tanstack/react-query'
import surveyData from 'helpers/data/survey-detail.json'
import { queryClient } from 'queryClient'
import { STATES, SURVEY_NOT_MODIFIED } from 'helpers'
import {
  useAppState,
  useQueryRetry,
  useSurveyRequestTimestamp,
  useSurveyService,
} from './'
import { useOperationCallback } from './useOperationCallback'
const PATCH_DEBOUNCE_TIME = 1000
export const useSurvey = (id) => {
  const { triggerCallbacks } = useOperationCallback()
  const { surveyService } = useSurveyService()
  const { refetchInterval, handleRetry } = useQueryRetry({})
  const { getSurveyRequestTimestamp, setSurveyRequestTimestamp } =
    useSurveyRequestTimestamp()
  const [, setSurveyRefreshRequired] = useAppState(
    STATES.SURVEY_REFRESH_REQUIRED
  )
  const [, setLoadedSurveyId] = useAppState(STATES.LOADED_SURVEY_ID, null, {
    meta: { persist: false },
  })
  const [surveyHash, setSurveyHash] = useAppState(STATES.SURVEY_HASH, {
    updateHash: 0,
    refetchHash: 0,
  })
... (178 lines truncated)
</file>

<file path="editor/src/hooks/useSurveyArchive.js">
import { useMemo } from 'react'
import { useQuery } from '@tanstack/react-query'
import { queryClient } from 'queryClient'
import { getApiUrl, STATES, SURVEY_ARCHIVES_QUERY_KEY_PREFIX } from 'helpers'
import { SurveyArchiveService } from 'services'
import useAuth from './useAuth'
export const useSurveyArchive = (sid) => {
  const auth = useAuth()
  const surveyArchiveService = useMemo(() => {
    return new SurveyArchiveService(auth, sid, getApiUrl())
  }, [auth, sid])
  const { data: surveyArchives, refetch } = useQuery({
    queryKey: [STATES.SURVEY_ARCHIVES, sid],
    queryFn: async ({ signal }) => {
      const archives = await surveyArchiveService.getSurveyArchives(sid, signal)
      if (!archives) return []
      const archivesArray = Array.isArray(archives) ? archives : []
      return archivesArray
        .filter((archive) => archive.newformat && archive.count > 0)
        .sort((a, b) => b.timestamp - a.timestamp)
    },
    enabled: !!sid && !process.env.REACT_APP_DEMO_MODE,
    initialData: [],
    staleTime: Infinity,
    cacheTime: Infinity,
  })
  const fetchFilteredSurveyArchivesByBase = async (
    sid,
    baseTable = 'tokens',
    signal
... (31 lines truncated)
</file>

<file path="editor/src/hooks/useSurveyGroupsService.js">
import { useParams } from 'react-router-dom'
import { SurveyGroupsService } from 'services'
import { getApiUrl } from 'helpers'
import useAuth from './useAuth'
export const useSurveyGroupsService = () => {
  const auth = useAuth()
  const { surveyId } = useParams()
  return {
    surveyGroupsService: new SurveyGroupsService(auth, surveyId, getApiUrl()),
  }
}
</file>

<file path="editor/src/hooks/useSurveyImportService.js">
import { useMemo } from 'react'
import { getApiUrl } from 'helpers'
import { SurveyImportService } from 'services'
import useAuth from './useAuth'
export const useSurveyImportService = () => {
  const auth = useAuth()
  return useMemo(() => new SurveyImportService(auth, getApiUrl()), [auth.token])
}
</file>

<file path="editor/src/hooks/useSurveyLogic.js">
import { useMemo } from 'react'
import { useQuery } from '@tanstack/react-query'
import { getApiUrl, STATES } from 'helpers'
import { SurveyLogicService } from 'services'
import useAuth from './useAuth'
export const useSurveyLogic = ({ sid, gid, qid, language, enabled = true }) => {
  const auth = useAuth()
  const surveyLogicService = useMemo(
    () => new SurveyLogicService(auth, sid, getApiUrl()),
    [auth, sid]
  )
  const { data, isFetching, isError, refetch } = useQuery({
    queryKey: [STATES.SURVEY_LOGIC, sid, gid, qid, language],
    queryFn: ({ signal }) =>
      surveyLogicService.getSurveyLogic(sid, { gid, qid, language }, signal),
    select: (response) => response?.surveyLogic,
    enabled: !!enabled && !!sid,
    staleTime: 0,
  })
  return {
    surveyLogic: data,
    isFetching,
    isError,
    refetch,
  }
}
</file>

<file path="editor/src/hooks/useSurveyRequestTimestamp.js">
import { useCallback, useEffect } from 'react'
import { queryClient } from 'queryClient'
import { getCurrentUtcTimestamp, STATES } from 'helpers'
export const useSurveyRequestTimestamp = () => {
  const getSurveyRequestTimestamp = useCallback((surveyId) => {
    const timestamps =
      queryClient.getQueryData([STATES.SURVEY_REQUEST_UTC_TIMESTAMP]) || {}
    return timestamps[surveyId] || null
  }, [])
  const setSurveyRequestTimestamp = useCallback((surveyId) => {
    queryClient.setQueryData(
      [STATES.SURVEY_REQUEST_UTC_TIMESTAMP],
      (old = {}) => ({
        ...old,
        [surveyId]: getCurrentUtcTimestamp(),
      })
    )
    return getCurrentUtcTimestamp()
  }, [])
  const clearSurveyRequestTimestamp = useCallback((surveyId) => {
    queryClient.setQueryData(
      [STATES.SURVEY_REQUEST_UTC_TIMESTAMP],
      (old = {}) => {
        const updated = { ...old }
        if (surveyId) {
          delete updated[surveyId]
        }
        return updated
      }
    )
... (19 lines truncated)
</file>

<file path="editor/src/hooks/useSurveyService.js">
import { useParams } from 'react-router-dom'
import { SurveyService } from 'services'
import { getApiUrl } from 'helpers'
import useAuth from './useAuth'
export const useSurveyService = () => {
  const auth = useAuth()
  const { surveyId } = useParams()
  return {
    surveyService: new SurveyService(auth, surveyId, getApiUrl()),
  }
}
</file>

<file path="editor/src/hooks/useSurveyUpdatePermission.js">
import { useEffect } from 'react'
import { useAppState } from './index'
export function useSurveyUpdatePermission(survey) {
  const [hasSurveyUpdatePermission, setHasSurveyUpdatePermission] = useAppState(
    'sharing_update_permission',
    survey.hasSurveyUpdatePermission
  )
  useEffect(() => {
    setHasSurveyUpdatePermission(survey.hasSurveyUpdatePermission)
  }, [survey, survey.sid, survey.hasSurveyUpdatePermission])
  return hasSurveyUpdatePermission
}
</file>

<file path="editor/src/hooks/useTranslationsService.js">
import { getApiUrl } from 'helpers'
import useAuth from './useAuth'
import { TranslationsService } from '../services/translations.service'
export const useTranslationsService = () => {
  const auth = useAuth()
  return {
    translationsService: new TranslationsService(auth, getApiUrl()),
  }
}
</file>

<file path="editor/src/hooks/useUserService.js">
import { useParams } from 'react-router-dom'
import { UserService } from 'services'
import { getApiUrl } from 'helpers'
import useAuth from './useAuth'
export const useUserService = () => {
  const auth = useAuth()
  const { userId } = useParams()
  return new UserService(auth, userId, getApiUrl())
}
</file>

<file path="editor/src/i18n/scripts/identifyAndReportMissingTranslations.js">
export function getMissingTranslationKeys(
  translationStrings,
  storedTranslations,
  lang
) {
  return translationStrings
    .filter((key) => !(key in storedTranslations))
    .map((key) => ({ key, lang }))
}
export async function identifyAndReportMissingTranslations(
  translationsService,
  userLang
) {
  if (!userLang) {
    console.error(
      'No language set in user details. Cannot load initial translations.'
    )
    return
  }
  try {
    const response = await fetch(
      `${process.env.PUBLIC_URL}/translationStrings.json`
    )
    if (!response.ok) {
      throw new Error('Failed to load translation strings')
    }
    const contentType = response.headers.get('content-type')
    if (!contentType || !contentType.includes('application/json')) {
      return
    }
... (25 lines truncated)
</file>

<file path="editor/src/i18n/CustomI18nBackend.js">
class CustomI18nBackend {
  setLanguages
  languages
  constructor(_setLanguages, languages) {
    this.setLanguages = _setLanguages
    this.languages = languages || {}
  }
  init(services, backendOptions = {}) {
    this.options = backendOptions
    this.translationsService = backendOptions.translationsService
    if (
      !this.translationsService ||
      typeof this.translationsService.getTranslations !== 'function'
    ) {
      throw new Error(
        'translationsService.getTranslations must be a valid function'
      )
    }
  }
  read(language, namespace, callback) {
    this.translationsService
      .getTranslations(language)
      .then((data) => {
        this.setLanguages({
          ...this.languages,
          [language]: data[0]['languages'],
        })
        callback(null, data[0]['translations'])
      })
      .catch((error) => {
... (6 lines truncated)
</file>

<file path="editor/src/pages/Editor/LeftSideBar/FeedbackButton.js">
import React from 'react'
import { FeedbackIcon } from 'components/icons'
import { TooltipContainer } from 'components'
import { useFeedbackForm } from 'hooks'
export const FeedbackButton = () => {
  const { showFeedbackForm } = useFeedbackForm()
  return (
    <TooltipContainer
      offset={[0, 20]}
      placement="top"
      tip={t('Help us with your feedback')}
    >
      <span className="cursor-pointer" onClick={() => showFeedbackForm()}>
        <FeedbackIcon />
      </span>
    </TooltipContainer>
  )
}
export default FeedbackButton
</file>

<file path="editor/src/pages/Editor/LeftSideBar/index.js">
export * from './LeftSideBar'
</file>

<file path="editor/src/pages/Editor/LeftSideBar/LeftSideBar.js">
import React, { useMemo, useCallback } from 'react'
import { useNavigate, useParams } from 'react-router-dom'
import { SideBar } from 'components/SideBar'
import { SurveyStructure } from 'components/SurveyStructure'
import { useSurvey } from 'hooks'
import { getSurveyPanels } from 'helpers/options'
import {
  menuOptions,
  presentationOptions,
  settingsOptions,
} from 'components/SurveySettings/panelOptions'
import { PAGES } from 'helpers'
import { getSharingPanels } from 'shared/getSharingPanels'
import { getSharingPanelOptions } from 'shared/sharingPanelOptions'
import { translationsPanelOptions } from 'shared/translationPanelOptions'
export const LeftSideBar = ({
  surveyId,
  page = PAGES.EDITOR,
  navigatePage = null,
  showSidebarCloseButton = true,
}) => {
  const { panel } = useParams()
  const navigate = useNavigate()
  const { survey = {}, surveyMenus = {} } = useSurvey(surveyId)
  const menuEntries = useMemo(() => {
    const menuKeys = Object.keys(surveyMenus)
    const groupedMenuEntries = menuKeys.map((key) => {
      return Object.keys(surveyMenus[key].entries).map((entryKey) => {
        return {
          entryKey,
... (91 lines truncated)
</file>

<file path="editor/src/pages/Editor/LeftSideBar/LeftSideBar.stories.js">
import { LeftSideBar as LeftSideBarComponent } from './LeftSideBar'
const meta = {
  title: 'Page/Editor/LeftSideBar',
  component: LeftSideBarComponent,
  argTypes: {
    structurePanel: {
      name: 'Toggle structure panel',
      control: { type: 'boolean' },
    },
    settingsPanel: {
      name: 'Toggle settings panel',
      control: { type: 'boolean' },
    },
  },
}
export default meta
export const LeftSideBar = () => {
  return <LeftSideBarComponent />
}
</file>

<file path="editor/src/pages/Editor/LeftSideBar/LeftSideBar.test.js">
import 'tests/mocks'
import { renderWithProviders } from 'tests/testUtils'
import { LeftSideBar } from './LeftSideBar'
import { screen, waitFor } from '@testing-library/react'
import userEvent from '@testing-library/user-event'
import { getSurveyPanels } from 'helpers/options'
describe('LeftSideBar', () => {
  beforeEach(async () => {
    await renderWithProviders(<LeftSideBar />)
    await waitFor(() => screen.getByTestId('left-sidebar'))
  })
  test('Should be able to toggle the structure panel', async () => {
    const closeButton = screen.queryByTestId('btn-close-structure')
    if (closeButton) {
      await userEvent.click(closeButton)
      expect(
        screen.queryByTestId('editor-structure-panel')
      ).not.toBeInTheDocument()
      await userEvent.click(
        screen.getByTestId(`btn-${getSurveyPanels().structure.panel}-open`)
      )
      expect(
        await screen.findByTestId('editor-structure-panel')
      ).toBeInTheDocument()
    } else {
      await userEvent.click(
        screen.getByTestId(`btn-${getSurveyPanels().structure.panel}-open`)
      )
      expect(
        await screen.findByTestId('editor-structure-panel')
... (9 lines truncated)
</file>

<file path="editor/src/pages/Editor/RightSideBar/RightSideBar.js">
import { useAppState, useFocused } from 'hooks'
import classNames from 'classnames'
import { useParams } from 'react-router-dom'
import { STATES } from 'helpers'
import { getSurveyPanels } from 'helpers/options'
import { QuestionSettings } from 'components/QuestionSettings/QuestionSettings'
import { WelcomeSettings } from 'components/WelcomeSettings/WelcomeSettings'
import { GroupSettings } from 'components/GroupSettings/GroupSettings'
import { getQuestionTypeInfo } from 'components/QuestionTypes'
import { EndScreenSettings } from 'components/EndScreenSettings/EndScreenSettings'
export const RightSideBar = ({ surveyId }) => {
  const { panel } = useParams()
  const [isAddingQuestionOrGroup] = useAppState(
    STATES.IS_ADDING_QUESTION_OR_GROUP,
    false
  )
  const { focused, groupIndex, questionIndex } = useFocused()
  const shouldDisplay = focused && Object.keys(focused).length > 0
  if (
    isAddingQuestionOrGroup ||
    (panel && panel !== getSurveyPanels().structure.panel)
  ) {
    return <></>
  }
  return (
    <div
      className={classNames('right-side-bar', {
        'bg-white sidebar active-side-bar': shouldDisplay,
        'd-none': !shouldDisplay,
      })}
... (17 lines truncated)
</file>

<file path="editor/src/pages/Editor/RightSideBar/RightSideBar.stories.js">
import React from 'react'
import { RightSideBar as RightSideBarComponent } from './RightSideBar'
export default {
  title: 'Page/Editor/RightSideBar',
  component: RightSideBarComponent,
}
const surveyId = '78f91e52-6028-11ed-82e1-7ac846e3af9d'
export const RightSideBar = () => {
  return <RightSideBarComponent surveyId={surveyId} />
}
</file>

<file path="editor/src/pages/Editor/Editor.js">
import React, { useCallback, useEffect, useRef } from 'react'
import { useNavigate, useParams } from 'react-router-dom'
import Container from 'react-bootstrap/Container'
import { useTranslation } from 'react-i18next'
import { useAppState, useSurvey } from 'hooks'
import {
  STATES,
  Toast,
  isSurveyExpired,
  SURVEY_MENU_TITLES,
  PAGES,
} from 'helpers'
import { getSurveyPauseToastOptions } from 'components'
import ThemeOptionsPreview from 'components/ThemeOptions/ThemeOptionsPreview'
import Layout from './Layout'
import { EditorTutorial } from './EditorTutorial'
import { LoadingIndicator } from './LoadingIndicator'
import { PluginSlot } from 'plugins/PluginSlot'
import { PLUGIN_SLOTS } from 'plugins/slots'
export const Editor = () => {
  const { surveyId, panel, menu } = useParams()
  const navigate = useNavigate()
  const { survey = {} } = useSurvey(surveyId)
  const { ready } = useTranslation()
  const [, setTopbarConfig] = useAppState(STATES.TOPBAR_CONFIG, {})
  const surveyActivationHandlerRef = useRef(null)
  const expiryToastRanForSurvey = useRef(null)
  const [activeLanguage = undefined] = useAppState(
    STATES.ACTIVE_LANGUAGE,
    survey.language
... (61 lines truncated)
</file>

<file path="editor/src/pages/Editor/Editor.stories.js">
import { Editor as EditorComponent } from './Editor'
const meta = {
  title: 'Page/Editor',
  component: EditorComponent,
  argTypes: {
    structurePanel: {
      name: 'Toggle structure panel',
      control: { type: 'boolean' },
    },
    settingsPanel: {
      name: 'Toggle settings panel',
      control: { type: 'boolean' },
    },
  },
  args: {
    structurePanel: true,
    settingsPanel: true,
  },
}
export default meta
export const Editor = () => {
  return <EditorComponent />
}
</file>

<file path="editor/src/pages/Editor/Editor.test.js">
import 'tests/mocks'
import { renderWithProviders } from 'tests/testUtils'
import { Editor } from './Editor'
import { screen, waitFor, within } from '@testing-library/react'
import userEvent from '@testing-library/user-event'
import { getSurveyPanels } from 'helpers/options'
import surveyData from 'helpers/data/survey-detail.json'
describe('Editor interactions', () => {
  beforeEach(async () => {
    await renderWithProviders(<Editor />)
    await waitFor(() =>
      expect(screen.getByTestId('editor')).toBeInTheDocument()
    )
    await waitFor(() =>
      expect(screen.getAllByTestId('question-group').length).toBeGreaterThan(0)
    )
  })
  test('Should show all question groups and questions', async () => {
    const structureButton = screen.getByTestId(
      `btn-${getSurveyPanels().structure.panel}-open`
    )
    await userEvent.click(structureButton)
    const questionGroups = screen.getAllByTestId('question-group')
    const questions = screen.getAllByTestId('question')
    expect(questionGroups).toHaveLength(surveyData.survey.questionGroups.length)
    const numberOfQuestions = surveyData.survey.questionGroups.reduce(
      (acc, group) => acc + group.questions.length,
      0
    )
    expect(questions).toHaveLength(numberOfQuestions)
... (156 lines truncated)
</file>

<file path="editor/src/pages/Editor/EditorTutorial.js">
import { getQuestionTypeInfo, Tutorial } from 'components'
import SmallCheckMarkIcon from 'components/icons/SmallCheckMarkIcon'
import { getApiUrl, sleep, STATES, toastComponent, TUTORIALS } from 'helpers'
import { getSurveyPanels } from 'helpers/options'
import { useAppState, useAuth, useFocused } from 'hooks'
import { useEffect, useMemo, useState } from 'react'
import { useNavigate, useParams } from 'react-router-dom'
import { UserSettingsService } from 'services'
export const EditorTutorial = ({ isSurveyActive = false, survey }) => {
  const { surveyId } = useParams()
  const [, setIsAddingQuestionOrGroup] = useAppState(
    STATES.IS_ADDING_QUESTION_OR_GROUP
  )
  const [hasEditorHelpAppeared, setHasEdtiroHelpAppeared] = useAppState(
    STATES.EDITOR_HELP_APPEARED,
    false,
    { staleTime: null, cacheTime: null }
  )
  const [startEditorTutorial, setStartEditorTutorial] = useAppState(
    STATES.START_EDITOR_TUTORIAL,
    false
  )
  const auth = useAuth()
  const navigate = useNavigate()
  const surveyPanels = getSurveyPanels()
  const { unFocus, setFocused } = useFocused()
  const tutorialSteps = [
    {
      title: t('Welcome to LimeSurvey'),
      content: t(
... (292 lines truncated)
</file>

<file path="editor/src/pages/Editor/index.js">
export * from './LeftSideBar'
</file>

<file path="editor/src/pages/Editor/Layout.js">
import React from 'react'
import { useParams } from 'react-router-dom'
import { STATES } from 'helpers'
import {
  useAppState,
  useAuth,
  useElementClick,
  useFocused,
  useSurvey,
} from 'hooks'
import {
  getCurrentLayout,
  getSurveyPanels,
  LAYOUT_TYPES,
} from 'helpers/options'
import { Survey } from 'components'
import { SurveySettings } from 'components/SurveySettings/SurveySettings'
import { PluginSlot } from 'plugins/PluginSlot'
import { PLUGIN_SLOTS } from 'plugins/slots'
import { LeftSideBar } from './LeftSideBar/LeftSideBar'
import { i18nInstance } from '../../i18nInit'
import { I18Provider } from '../../providers'
import { RightSideBar } from './RightSideBar/RightSideBar'
const Layout = () => {
  const { surveyId, panel } = useParams()
  const { survey = {} } = useSurvey(surveyId)
  const auth = useAuth()
  const { unFocus } = useFocused()
  const [activeLanguage = undefined] = useAppState(
    STATES.ACTIVE_LANGUAGE,
... (71 lines truncated)
</file>

<file path="editor/src/pages/Editor/LoadingIndicator.js">
import React from 'react'
export const LoadingIndicator = ({ isLoadingSurvey }) => {
  return (
    <div
      style={{ height: '100vh' }}
      className="d-flex flex-column justify-content-center align-items-center"
    >
      <span style={{ width: 48, height: 48 }} className="loader mb-4"></span>
      <h1>
        {isLoadingSurvey
          ? t('Loading survey...')
          : t('Loading translations...')}
      </h1>
    </div>
  )
}
</file>

<file path="editor/src/pages/Errors/index.js">
export * from './NotFound'
export * from './Unauthorized'
</file>

<file path="editor/src/pages/Errors/NotFound.js">
export const NotFound = () => {
  return (
    <div
      style={{ height: '100vh' }}
      className="d-flex gap-4 flex-column justify-content-center align-items-center"
    >
      <h1>404</h1> {t("Page doesn't exist")}
    </div>
  )
}
</file>

<file path="editor/src/pages/Errors/Unauthorized.js">
export const Unauthorized = () => {
  return (
    <div
      style={{ height: '100vh' }}
      className="d-flex gap-4 flex-column justify-content-center align-items-center"
    >
      <h1>401</h1> {t('Access denied')}
    </div>
  )
}
</file>

<file path="editor/src/pages/Responses/components/Overview/index.js">
export * from './ResponsesOverview'
</file>

<file path="editor/src/pages/Responses/components/Overview/ResponsesOverview.js">
import { useEffect, useState } from 'react'
import { Card } from 'react-bootstrap'
import { useNavigate } from 'react-router-dom'
import { cloneDeep } from 'lodash'
import { format } from 'date-fns'
import { ResponseService } from 'services'
import { useAuth } from 'hooks'
import { getApiUrl } from 'helpers'
import { ChartRenderer } from '../ChartRenderer'
import {
  getDataWithPercentages,
  statisticsGraphs,
} from '../ResponsesStatistics'
import { ResponsesTable } from '../ResponsesTable'
import { getResponsesPanels, panelItemsKeys } from '../../Sidebars'
export const ResponsesOverview = ({ surveyId, survey, surveyQuestions }) => {
  const navigate = useNavigate()
  const [data, setData] = useState(null)
  const [dailyActivityData, setDailyActivityData] = useState(null)
  const [lurkerData, setLurkerData] = useState(null)
  const [overview = {}, setOverview] = useState(null)
  const auth = useAuth()
  useEffect(() => {
    new ResponseService(auth, surveyId, getApiUrl())
      .getResponsesOverview(surveyId)
      .then((result) => {
        setData(result?.overview)
        const dailyActivity = cloneDeep(result.overview.dailyActivity)
        dailyActivity.data = dailyActivity.data.map((item) => ({
          ...item,
... (155 lines truncated)
</file>

<file path="editor/src/pages/Responses/components/ResponsesStatistics/Charts/BarChart.js">
import React from 'react'
import classNames from 'classnames'
import {
  BarChart as RechartsBarChart,
  Bar,
  XAxis,
  YAxis,
  CartesianGrid,
  Tooltip,
  Cell,
  LabelList,
  ResponsiveContainer,
} from 'recharts'
import {
  BAR_MAX_SIZE,
  COLORS,
  CustomTooltip,
  TruncatedTick,
  formatMetricValue,
  getBarChartMinWidth,
  getLabelInterval,
  getMetricDataKey,
  VALUE_TYPE,
} from '../ChartsUtils'
export const BarChart = ({
  data,
  valueType = VALUE_TYPE.PERCENTAGE,
  isImage = false,
  hasComments = false,
  onViewComments,
... (85 lines truncated)
</file>

<file path="editor/src/pages/Responses/components/ResponsesStatistics/Charts/CustomLegend.js">
import { shouldRenderImage } from '../ChartsUtils'
export const CustomLegend = ({ payload, isImage = false }) => {
  return (
    <div className="responses-statistics-legend">
      {payload.map((entry, index) => (
        <div className="responses-statistics-legend-item" key={index}>
          <div
            className="recharts-square"
            style={{ background: entry.color }}
          ></div>
          <div
            title={entry.value}
            className="responses-statistics-legend-value"
          >
            {shouldRenderImage(isImage, entry.payload) ? (
              <img
                src={entry.value}
                alt={entry.value}
                className="responses-statistics-legend-image"
              />
            ) : (
              entry.value
            )}
          </div>
        </div>
      ))}
    </div>
  )
}
</file>

<file path="editor/src/pages/Responses/components/ResponsesStatistics/Charts/DoughnutChart.js">
import React from 'react'
import {
  Legend,
  Cell,
  PieChart as RechartsPieChart,
  Pie,
  ResponsiveContainer,
  Sector,
  Tooltip,
} from 'recharts'
import { COLORS, CustomTooltip } from '../ChartsUtils'
import { CustomLegend } from './CustomLegend'
const renderActiveShape = ({
  cx,
  cy,
  midAngle,
  outerRadius,
  startAngle,
  endAngle,
  fill,
  percent,
  value,
  payload,
}) => {
  const RADIAN = Math.PI / 180
  const sin = Math.sin(-RADIAN * (midAngle ?? 1))
  const cos = Math.cos(-RADIAN * (midAngle ?? 1))
  const sx = (cx ?? 0) + ((outerRadius ?? 0) + 10) * cos
  const sy = (cy ?? 0) + ((outerRadius ?? 0) + 10) * sin
  const mx = (cx ?? 0) + ((outerRadius ?? 0) + 30) * cos
... (71 lines truncated)
</file>

<file path="editor/src/pages/Responses/components/ResponsesStatistics/Charts/DualScaleDoughnutChart.js">
import React from 'react'
import {
  PieChart as RechartsPieChart,
  Pie,
  Cell,
  Tooltip,
  ResponsiveContainer,
} from 'recharts'
import {
  getUnionSegments,
  TooltipShell,
  TooltipMetricLines,
} from '../ChartsUtils'
import { StackedLegend } from './StackedLegend'
const DOUGHNUT_SIZE = 220
const DoughnutTooltip = ({ active, payload, row }) => {
  if (!active || !payload?.length) return null
  const segment = payload[0]?.payload ?? {}
  return (
    <TooltipShell>
      <div style={{ fontWeight: 600, marginBottom: 4 }}>
        {row.title} - {row.scaleTitle} : {segment.title}
      </div>
      <TooltipMetricLines
        count={segment.value ?? 0}
        percentage={(segment.percentage ?? 0).toFixed(1)}
      />
    </TooltipShell>
  )
}
... (68 lines truncated)
</file>

<file path="editor/src/pages/Responses/components/ResponsesStatistics/Charts/GroupedBarChart.js">
import React from 'react'
import {
  BarChart as RechartsBarChart,
  Bar,
  XAxis,
  YAxis,
  Cell,
  LabelList,
  Tooltip,
  ResponsiveContainer,
} from 'recharts'
import {
  COLORS,
  CustomTooltip,
  formatMetricValue,
  getMetricDataKey,
  TooltipShell,
  VALUE_TYPE,
} from '../ChartsUtils'
const GroupedTooltip = ({ active, payload, categoryTitle }) => {
  if (!active || !payload?.length) return null
  const option = payload[0]?.payload ?? {}
  const stats = option.stats
  if (!stats) {
    return <CustomTooltip active={active} payload={payload} />
  }
  return (
    <TooltipShell>
      <div style={{ fontWeight: 600, marginBottom: 4 }}>
        {categoryTitle} - {option.title}
... (101 lines truncated)
</file>

<file path="editor/src/pages/Responses/components/ResponsesStatistics/Charts/index.js">
export * from './BarChart'
export * from './RankingBarChart'
export * from './StackedBarChart'
export * from './GroupedBarChart'
export * from './DualScaleDoughnutChart'
export * from './StackedLegend'
export * from './PieChart'
export * from './RadarChart'
export * from './LineChart'
export * from './PolarAreaChart'
export * from './DoughnutChart'
</file>

<file path="editor/src/pages/Responses/components/ResponsesStatistics/Charts/LineChart.js">
import React from 'react'
import {
  Tooltip,
  LineChart as RechartsLineChart,
  CartesianGrid,
  XAxis,
  YAxis,
  Legend,
  Line,
  ResponsiveContainer,
} from 'recharts'
import {
  BAR_MAX_SIZE,
  CustomTooltip,
  TruncatedTick,
  getLabelInterval,
  getMetricDataKey,
  VALUE_TYPE,
} from '../ChartsUtils'
const CustomizedLabel = ({ x, y, stroke, value, isPercentage }) => {
  return (
    <text x={x} y={y} dy={-4} fill={stroke} fontSize={10} textAnchor="middle">
      {isPercentage ? `${Math.round(value)}%` : value}
    </text>
  )
}
export const LineChart = ({
  data,
  isImage = false,
  valueType = VALUE_TYPE.PERCENTAGE,
... (36 lines truncated)
</file>

<file path="editor/src/pages/Responses/components/ResponsesStatistics/Charts/PieChart.js">
import React, { useLayoutEffect, useRef, useState } from 'react'
import {
  Cell,
  PieChart as RechartsPieChart,
  Pie,
  ResponsiveContainer,
  Tooltip,
} from 'recharts'
import {
  COLORS,
  CustomTooltip,
  VALUE_TYPE,
  getDisplayMetric,
  shouldRenderImage,
} from '../ChartsUtils'
const LABEL_IMAGE_WIDTH = 56
const LABEL_IMAGE_HEIGHT = 40
const LABEL_IMAGE_PADDING = 6
const LABEL_IMAGE_BORDER = '#d3d5da'
const LABEL_MAX_WIDTH = 160
const LABEL_NAME_HEIGHT = 32
const RADIAN = Math.PI / 180
const PIE_START_ANGLE = 90
const PIE_END_ANGLE = -270
const LabelName = ({ label, justify }) => {
  const ref = useRef(null)
  const [isTruncated, setIsTruncated] = useState(false)
  useLayoutEffect(() => {
    const el = ref.current
    if (el) setIsTruncated(el.scrollWidth > el.clientWidth)
... (259 lines truncated)
</file>

<file path="editor/src/pages/Responses/components/ResponsesStatistics/Charts/PolarAreaChart.js">
import React from 'react'
import {
  Tooltip,
  Legend,
  RadialBarChart,
  PolarGrid,
  RadialBar,
  ResponsiveContainer,
} from 'recharts'
import {
  COLORS,
  CustomTooltip,
  getMetricDataKey,
  VALUE_TYPE,
} from '../ChartsUtils'
import { CustomLegend } from './CustomLegend'
export const PolarAreaChart = ({
  data,
  isImage = false,
  valueType = VALUE_TYPE.PERCENTAGE,
}) => {
  const coloredData = data.map((entry, index) => ({
    ...entry,
    fill: entry.fill ?? COLORS[index % COLORS.length],
  }))
  const legendPayload = coloredData.map((entry) => ({
    value: entry.title,
    color: entry.fill,
    type: 'square',
    payload: entry,
... (28 lines truncated)
</file>

<file path="editor/src/pages/Responses/components/ResponsesStatistics/Charts/RadarChart.js">
import React from 'react'
import {
  Tooltip,
  RadarChart as RechartsRadarChart,
  PolarGrid,
  PolarAngleAxis,
  Radar,
  ResponsiveContainer,
} from 'recharts'
import {
  COLORS,
  CustomTooltip,
  TruncatedTick,
  getMetricDataKey,
  VALUE_TYPE,
} from '../ChartsUtils'
const RADAR_IMAGE_SIZE = 72
export const RadarChart = ({
  data,
  isImage = false,
  valueType = VALUE_TYPE.PERCENTAGE,
}) => {
  return (
    <ResponsiveContainer width="100%" minHeight={400} height="100%">
      <RechartsRadarChart
        data={data}
        outerRadius={isImage ? '62%' : '80%'}
      >
        <PolarGrid />
        <PolarAngleAxis
... (28 lines truncated)
</file>

<file path="editor/src/pages/Responses/components/ResponsesStatistics/Charts/RankingBarChart.js">
import { format } from 'util'
import React, { useState } from 'react'
import {
  BarChart as RechartsBarChart,
  Bar,
  XAxis,
  YAxis,
  Cell,
  LabelList,
  Tooltip,
  ResponsiveContainer,
} from 'recharts'
import { ordinal } from '../ChartsUtils'
import { htmlToPlainText } from 'helpers'
import { StatisticsDetailModal } from '../StatisticsDetailModal.js'
import { StatisticsFilterSelect } from '../StatisticsFilterSelect.js'
const ROW_HEIGHT = 56
const CHART_TOP_MARGIN = 22
const BADGE_COLUMN_WIDTH = 52
const BADGE_HEIGHT = 36
const NameLabel = ({ x, y, value }) => (
  <text className="responses-statistics-chart-labels" x={x} y={y - 8}>
    {value}
    <title>{value}</title>
  </text>
)
const RankBadgeTick = ({ x, y, index, ranked }) => {
  const entry = ranked[index]
  if (!entry) return null
  return (
... (111 lines truncated)
</file>

<file path="editor/src/pages/Responses/components/ResponsesStatistics/Charts/StackedBarChart.js">
import React from 'react'
import classNames from 'classnames'
import {
  BarChart as RechartsBarChart,
  Bar,
  XAxis,
  YAxis,
  Tooltip,
  LabelList,
  ResponsiveContainer,
} from 'recharts'
import {
  COLORS,
  getUnionSegments,
  TooltipShell,
  TooltipMetricLines,
  TruncatedTick,
  VALUE_TYPE,
} from '../ChartsUtils'
import { StackedLegend } from './StackedLegend'
const BAR_SIZE = 24
const ROW_GAP = 20
const ROW_HEIGHT = BAR_SIZE + ROW_GAP
const DUAL_BAR_SIZE = 14
const DUAL_BAR_HEIGHT = 20
const isDarkFill = (hex) => {
  const c = String(hex || '').replace('#', '')
  if (c.length < 6) return false
  const r = parseInt(c.slice(0, 2), 16)
  const g = parseInt(c.slice(2, 4), 16)
... (235 lines truncated)
</file>

<file path="editor/src/pages/Responses/components/ResponsesStatistics/Charts/StackedLegend.js">
import React from 'react'
export const StackedLegend = ({ segments = [] }) => (
  <div className="responses-statistics-stacked-legend">
    <span className="responses-statistics-stacked-legend-title">
      {t('Distribution')}:
    </span>
    <div className="responses-statistics-stacked-legend-items">
      {segments.map((segment) => (
        <span
          key={segment.title}
          className="responses-statistics-stacked-legend-item"
        >
          <span
            className="responses-statistics-stacked-legend-swatch"
            style={{ backgroundColor: segment.color }}
          />
          {segment.title}
        </span>
      ))}
    </div>
  </div>
)
</file>

<file path="editor/src/pages/Responses/components/ResponsesStatistics/StatisticsFiltersModal/sources/fields/DateField.js">
import React, { useEffect, useLayoutEffect, useRef, useState } from 'react'
import { createPortal } from 'react-dom'
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider'
import { DateCalendar } from '@mui/x-date-pickers/DateCalendar'
import { DateIcon } from 'components/icons'
import { dayJsHelper } from 'helpers'
export const DateField = ({ value, placeholder, onChange }) => {
  const [open, setOpen] = useState(false)
  const [position, setPosition] = useState({ top: 0, left: 0 })
  const anchorRef = useRef(null)
  const popoverRef = useRef(null)
  const selected = value ? dayJsHelper(value) : null
  const updatePosition = () => {
    const anchor = anchorRef.current
    if (!anchor) return
    const rect = anchor.getBoundingClientRect()
    const margin = 4
    const popoverHeight = popoverRef.current?.offsetHeight ?? 360
    const spaceBelow = window.innerHeight - rect.bottom
    const openUp = spaceBelow < popoverHeight + margin
    const top = openUp
      ? Math.max(8, rect.top - popoverHeight - margin)
      : rect.bottom + margin
    setPosition({ top, left: rect.left })
  }
  useLayoutEffect(() => {
    if (!open) return undefined
    updatePosition()
    const reposition = () => updatePosition()
... (59 lines truncated)
</file>

<file path="editor/src/pages/Responses/components/ResponsesStatistics/StatisticsFiltersModal/sources/fields/DateRangeField.js">
import React from 'react'
import { DateField } from './DateField'
export const DateRangeField = ({ from, to, onFromChange, onToChange }) => (
  <div className="responses-statistics-filters-dates">
    <DateField
      value={from}
      placeholder={t('Start date')}
      onChange={onFromChange}
    />
    <DateField value={to} placeholder={t('End date')} onChange={onToChange} />
  </div>
)
</file>

<file path="editor/src/pages/Responses/components/ResponsesStatistics/StatisticsFiltersModal/sources/fields/FileUploadedToggle.js">
import React from 'react'
import { ToggleButtons } from 'components'
import { FILE_UPLOADED } from '../../utils'
const fileUploadedOptions = () => [
  { name: t('Yes'), value: FILE_UPLOADED.YES },
  { name: t('No'), value: FILE_UPLOADED.NO },
]
export const FileUploadedToggle = ({ id, value, onChange }) => (
  <ToggleButtons
    id={id}
    toggleOptions={fileUploadedOptions()}
    value={value}
    onChange={onChange}
  />
)
</file>

<file path="editor/src/pages/Responses/components/ResponsesStatistics/StatisticsFiltersModal/sources/fields/IncludedToggle.js">
import React from 'react'
import { ToggleButtons } from 'components'
import { INCLUDED } from '../../utils'
const includedOptions = () => [
  { name: t('All'), value: INCLUDED.ALL },
  { name: t('Complete'), value: INCLUDED.COMPLETE },
  { name: t('Incomplete'), value: INCLUDED.INCOMPLETE },
]
export const IncludedToggle = ({ id, value, onChange }) => (
  <ToggleButtons
    id={id}
    toggleOptions={includedOptions()}
    value={value}
    onChange={onChange}
  />
)
</file>

<file path="editor/src/pages/Responses/components/ResponsesStatistics/StatisticsFiltersModal/sources/fields/index.js">
export * from './IncludedToggle'
export * from './FileUploadedToggle'
export * from './DateField'
export * from './DateRangeField'
export * from './NumberRangeField'
export * from './LanguageMultiSelect'
</file>

<file path="editor/src/pages/Responses/components/ResponsesStatistics/StatisticsFiltersModal/sources/fields/LanguageMultiSelect.js">
import React, { useMemo } from 'react'
import { FilterSelect } from '../../FilterSelect'
export const LanguageMultiSelect = ({
  languages = [],
  value = [],
  onChange,
}) => {
  const options = useMemo(
    () => languages.map((lang) => ({ value: lang, label: lang })),
    [languages]
  )
  const selected = options.filter((option) => value.includes(option.value))
  return (
    <FilterSelect
      options={options}
      value={selected}
      isMultiselect
      placeholder={t('Please select ...')}
      update={onChange}
    />
  )
}
</file>

<file path="editor/src/pages/Responses/components/ResponsesStatistics/StatisticsFiltersModal/sources/fields/NumberRangeField.js">
import React from 'react'
import { Input } from 'components'
export const NumberRangeField = ({ min, max, onMinChange, onMaxChange }) => (
  <div className="responses-statistics-filters-row-range">
    <Input
      type="number"
      placeholder={t('Min')}
      value={min}
      update={onMinChange}
    />
    <Input
      type="number"
      placeholder={t('Max')}
      value={max}
      update={onMaxChange}
    />
  </div>
)
</file>

<file path="editor/src/pages/Responses/components/ResponsesStatistics/StatisticsFiltersModal/sources/ArrayFilter.js">
import React from 'react'
import { Input } from 'components'
import { FilterSelect } from '../FilterSelect'
import { NumberRangeField } from './fields'
export const ArrayFilter = ({ question, filter, onUpdate }) => {
  const { kind, array } = question
  const rowSelect = (
    <div className="responses-statistics-filters-row-field">
      <FilterSelect
        options={array.rows}
        value={filter.row}
        defaultValue={null}
        placeholder={t('Select row ...')}
        update={(value) => onUpdate('row', value)}
      />
    </div>
  )
  const renderColumn = ({ options, value, key, label }) => (
    <div className="responses-statistics-filters-row-field">
      {label && (
        <span className="responses-statistics-filters-col-label">{label}</span>
      )}
      <FilterSelect
        options={options}
        value={value}
        defaultValue={null}
        placeholder={t('Select column ...')}
        update={(next) => onUpdate(key, next)}
      />
    </div>
... (64 lines truncated)
</file>

<file path="editor/src/pages/Responses/components/ResponsesStatistics/StatisticsFiltersModal/sources/index.js">
export * from './QuestionSource'
export * from './SurveyDataSource'
export * from './ParticipantSource'
</file>

<file path="editor/src/pages/Responses/components/ResponsesStatistics/StatisticsFiltersModal/sources/ParticipantSource.js">
import React from 'react'
import { Input } from 'components'
import { getSurveyParticipantAttributes } from 'helpers'
import { FilterSelect } from '../FilterSelect'
export const ParticipantSource = ({ filter, survey, onUpdate }) => {
  const options = getSurveyParticipantAttributes(survey)
  return (
    <div className="responses-statistics-filters-row-body">
      <div className="responses-statistics-filters-row-field">
        <FilterSelect
          options={options}
          value={filter.attribute}
          defaultValue={null}
          placeholder={t('Please select ...')}
          update={(value) => onUpdate('attribute', value)}
        />
      </div>
      {filter.attribute && (
        <div className="responses-statistics-filters-row-field">
          <Input
            placeholder={t('Enter value')}
            value={filter.attributeValue}
            update={(value) => onUpdate('attributeValue', value)}
          />
        </div>
      )}
    </div>
  )
}
</file>

<file path="editor/src/pages/Responses/components/ResponsesStatistics/StatisticsFiltersModal/sources/QuestionSource.js">
import React, { useMemo } from 'react'
import { Input } from 'components'
import { FILE_UPLOADED } from '../utils'
import { FilterSelect } from '../FilterSelect'
import { ArrayFilter } from './ArrayFilter'
import { RankingFilter } from './RankingFilter'
import { DateRangeField, FileUploadedToggle, NumberRangeField } from './fields'
const formatImageOption = (option, { context }) => {
  if (!option.image) return option.label
  if (context === 'value') {
    return (
      <img
        src={option.image}
        alt={option.label}
        title={option.label}
        className="responses-statistics-filters-image-chip"
      />
    )
  }
  return (
    <div
      className="responses-statistics-filters-image-option"
      title={option.label}
    >
      <img src={option.image} alt={option.label} />
      <span className="responses-statistics-filters-image-option-name">
        {option.label}
      </span>
    </div>
  )
... (159 lines truncated)
</file>

<file path="editor/src/pages/Responses/components/ResponsesStatistics/StatisticsFiltersModal/sources/RankingFilter.js">
import React from 'react'
import { FilterSelect } from '../FilterSelect'
export const RankingFilter = ({ question, filter, onUpdate }) => {
  const { ranking } = question
  return (
    <div className="responses-statistics-filters-row-range">
      <div className="responses-statistics-filters-row-field">
        <FilterSelect
          options={ranking.ranks}
          value={filter.row}
          defaultValue={null}
          placeholder={t('Select rank ...')}
          update={(value) => onUpdate('row', value)}
        />
      </div>
      <div className="responses-statistics-filters-row-field">
        <FilterSelect
          options={ranking.items}
          value={filter.column}
          defaultValue={null}
          placeholder={t('Select answer ...')}
          update={(value) => onUpdate('column', value)}
        />
      </div>
    </div>
  )
}
</file>

<file path="editor/src/pages/Responses/components/ResponsesStatistics/StatisticsFiltersModal/sources/SurveyDataSource.js">
import React from 'react'
import { FilterSelect } from '../FilterSelect'
import {
  FIELD_KIND,
  getSurveyDataFieldOptions,
  getSurveyFieldKind,
} from '../utils'
import {
  DateRangeField,
  IncludedToggle,
  LanguageMultiSelect,
  NumberRangeField,
} from './fields'
export const SurveyDataSource = ({ filter, survey, onUpdate }) => {
  const kind = getSurveyFieldKind(filter.surveyField)
  return (
    <div className="responses-statistics-filters-row-body">
      <div className="responses-statistics-filters-row-field">
        <FilterSelect
          options={getSurveyDataFieldOptions()}
          value={filter.surveyField}
          defaultValue={null}
          placeholder={t('Please select ...')}
          update={(value) => onUpdate('surveyField', value)}
        />
      </div>
      {kind === FIELD_KIND.INCLUDED && (
        <IncludedToggle
          id={`included-${filter.id}`}
          value={filter.included}
... (30 lines truncated)
</file>

<file path="editor/src/pages/Responses/components/ResponsesStatistics/StatisticsFiltersModal/utils/buildQuestionOptions.js">
import { format } from 'util'
import { getQuestionTypeInfo } from 'components'
import { RemoveHTMLTagsInString, getAttributeValue } from 'helpers'
const localized = (l10ns, language, key) => {
  if (!l10ns) return ''
  const entry = l10ns[language] || l10ns[Object.keys(l10ns)[0]]
  return entry?.[key] || ''
}
// Free-text question types (short / long / huge text).
const FREE_TEXT_TYPES = ['S', 'T', 'U']
const EXCLUDED_TYPES = ['X', '*']
const isFilterableQuestion = (question) =>
  !EXCLUDED_TYPES.includes(question.type) &&
  question.questionThemeName !== getQuestionTypeInfo().BROWSER_DETECTION.theme
const isImageSelect = (question) => {
  const info = getQuestionTypeInfo()
  return [
    info.SINGLE_CHOICE_IMAGE_SELECT.theme,
    info.MULTIPLE_CHOICE_IMAGE_SELECT.theme,
  ].includes(question.questionThemeName)
}
const SITE_URL = process.env.REACT_APP_SITE_URL || ''
// Turn image-select options into thumbnail options
const toImageOptions = (options) =>
  options.map((option) => {
    const path = option.label
    if (!path || !path.includes('/')) return option
    return {
      value: option.value,
      label: decodeURIComponent(path.split('/').pop()),
... (171 lines truncated)
</file>

<file path="editor/src/pages/Responses/components/ResponsesStatistics/StatisticsFiltersModal/utils/filterModel.js">
export const SOURCE = {
  QUESTION: 'question',
  SURVEY_DATA: 'surveyData',
  PARTICIPANT: 'participant',
}
export const JOIN = { AND: 'and', OR: 'or' }
export const SURVEY_FIELD = {
  RESPONSE_ID: 'id',
  SEED: 'seed',
  SUBMIT_DATE: 'submitdate',
  LAST_ACTION: 'datestamp',
  INCLUDED: 'completed',
  LANGUAGE: 'startlanguage',
}
export const INCLUDED = {
  ALL: 'all',
  COMPLETE: 'complete',
  INCOMPLETE: 'incomplete',
}
export const FILE_UPLOADED = { YES: 'Y', NO: 'N' }
let _fallbackId = 0
const createId = () => {
  if (typeof crypto !== 'undefined' && crypto.randomUUID) {
    return crypto.randomUUID()
  }
  _fallbackId += 1
  return `filter-${_fallbackId}`
}
export const createEmptyFilter = () => ({
  id: createId(),
... (94 lines truncated)
</file>

<file path="editor/src/pages/Responses/components/ResponsesStatistics/StatisticsFiltersModal/utils/index.js">
export * from './filterModel'
export * from './buildQuestionOptions'
export * from './surveyDataFields'
</file>

<file path="editor/src/pages/Responses/components/ResponsesStatistics/StatisticsFiltersModal/utils/surveyDataFields.js">
import { SURVEY_FIELD } from './filterModel'
export const FIELD_KIND = {
  INCLUDED: 'included',
  DATE_RANGE: 'dateRange',
  NUMBER_RANGE: 'numberRange',
  LANGUAGE_MULTI: 'languageMulti',
}
export const getSurveyDataFieldOptions = () => [
  { value: SURVEY_FIELD.RESPONSE_ID, label: t('Response ID') },
  { value: SURVEY_FIELD.SEED, label: t('Seed') },
  { value: SURVEY_FIELD.SUBMIT_DATE, label: t('Submit date') },
  { value: SURVEY_FIELD.LAST_ACTION, label: t('Date last action') },
  { value: SURVEY_FIELD.INCLUDED, label: t('Included responses') },
  { value: SURVEY_FIELD.LANGUAGE, label: t('Language') },
]
export const getSurveyFieldKind = (field) => {
  switch (field) {
    case SURVEY_FIELD.INCLUDED:
      return FIELD_KIND.INCLUDED
    case SURVEY_FIELD.SUBMIT_DATE:
    case SURVEY_FIELD.LAST_ACTION:
      return FIELD_KIND.DATE_RANGE
    case SURVEY_FIELD.RESPONSE_ID:
    case SURVEY_FIELD.SEED:
      return FIELD_KIND.NUMBER_RANGE
    case SURVEY_FIELD.LANGUAGE:
      return FIELD_KIND.LANGUAGE_MULTI
    default:
      return null
  }
... (2 lines truncated)
</file>

<file path="editor/src/pages/Responses/components/ResponsesStatistics/StatisticsFiltersModal/FilterSelect.js">
import React from 'react'
import { Select } from 'components'
export const FilterSelect = (props) => (
  <Select
    menuPosition="fixed"
    menuClassName="responses-statistics-filter-menu"
    {...props}
  />
)
</file>

<file path="editor/src/pages/Responses/components/ResponsesStatistics/StatisticsFiltersModal/FilterSelectionRow.js">
import { format } from 'util'
import React from 'react'
import { Button, ToggleButtons } from 'components'
import { DeleteIcon } from 'components/icons'
import { FilterSelect } from './FilterSelect'
import { JOIN, SOURCE } from './utils'
import { ParticipantSource, QuestionSource, SurveyDataSource } from './sources'
const sourceTabs = () => [
  { name: t('Question'), value: SOURCE.QUESTION },
  { name: t('Response data'), value: SOURCE.SURVEY_DATA },
  { name: t('Participant data'), value: SOURCE.PARTICIPANT },
]
const joinOptions = () => [
  { value: JOIN.AND, label: t('AND') },
  { value: JOIN.OR, label: t('OR') },
]
export const FilterSelectionRow = ({
  filter,
  index,
  questionOptions,
  survey,
  onUpdate,
  onRemove,
}) => {
  const update = (key, value) => onUpdate(filter.id, key, value)
  return (
    <>
      {index > 0 && (
        <div className="responses-statistics-filters-join">
          <FilterSelect
... (54 lines truncated)
</file>

<file path="editor/src/pages/Responses/components/ResponsesStatistics/StatisticsFiltersModal/index.js">
export * from './StatisticsFiltersBuilder'
</file>

<file path="editor/src/pages/Responses/components/ResponsesStatistics/StatisticsFiltersModal/ResetIcon.js">
import React from 'react'
export const ResetIcon = ({ className = '', size = 20 }) => (
  <svg
    width={size}
    height={size}
    viewBox="0 0 20 20"
    fill="none"
    xmlns="http://www.w3.org/2000/svg"
    className={className}
  >
    <path
      d="M1.66797 10.0013C1.66797 14.6036 5.39893 18.3346 10.0013 18.3346C14.6036 18.3346 18.3346 14.6036 18.3346 10.0013C18.3346 5.39893 14.6036 1.66797 10.0013 1.66797V3.33464C13.6832 3.33464 16.668 6.3194 16.668 10.0013C16.668 13.6832 13.6832 16.668 10.0013 16.668C6.3194 16.668 3.33464 13.6832 3.33464 10.0013C3.33464 7.70982 4.49075 5.68836 6.2515 4.48839L6.2513 6.66797H7.91797V1.66797H2.91797V3.33464L5.00062 3.33454C2.97693 4.85492 1.66797 7.27524 1.66797 10.0013Z"
      fill="currentColor"
    />
  </svg>
)
</file>

<file path="editor/src/pages/Responses/components/ResponsesStatistics/StatisticsFiltersModal/StatisticsFiltersBuilder.js">
import React, { useState } from 'react'
import { PlusLg } from 'react-bootstrap-icons'
import { Button } from 'components'
import { FilterSelectionRow } from './FilterSelectionRow'
import { ResetIcon } from './ResetIcon'
import {
  FILE_UPLOADED,
  INCLUDED,
  createEmptyFilter,
  hasPrimarySelection,
  isFilterComplete,
} from './utils'
export const StatisticsFiltersBuilder = ({
  questionOptions = [],
  survey,
  onApply = () => {},
}) => {
  const [filters, setFilters] = useState([])
  const updateFilter = (id, key, value) => {
    setFilters((prev) =>
      prev.map((filter) => {
        if (filter.id !== id) return filter
        if (key === 'source') {
          return {
            ...createEmptyFilter(),
            id: filter.id,
            join: filter.join,
            source: value,
          }
        }
... (103 lines truncated)
</file>

<file path="editor/src/pages/Responses/components/ResponsesStatistics/ArrayTextTable.js">
import { useEffect, useMemo, useState } from 'react'
import { format } from 'util'
import {
  HighlightedText,
  LSTable,
  SearchInput,
  useSearchTerms,
} from 'components'
import { htmlToPlainText } from 'helpers'
import { useQuestionResponses } from 'hooks'
import { useIsInViewport } from 'hooks/useInViewport'
import { formatAnswerDate } from './ChartsUtils.js'
const ColumnHeader = ({ primary, secondary }) => (
  <>
    <span className="responses-statistics-array-text-col-primary">
      {htmlToPlainText(primary)}
    </span>
    {secondary && (
      <span className="responses-statistics-array-text-col-secondary">
        {' - '}
        {htmlToPlainText(secondary)}
      </span>
    )}
  </>
)
export const ArrayTextTable = ({
  surveyId,
  questionCode,
  fields,
  filters,
... (142 lines truncated)
</file>

<file path="editor/src/pages/Responses/components/ResponsesStatistics/ChartHeader.js">
import { MeatballMenu } from 'components/MeatballMenu/MeatballMenu'
import { Badge } from 'components/UIComponents'
import { getQuestionTypeInfo } from 'components/QuestionTypes'
const resolveThemeTitle = (type, themeName, fallback) => {
  if (!themeName) return fallback
  const info = Object.values(getQuestionTypeInfo()).find(
    (entry) => entry.type === type && entry.theme === themeName
  )
  return info?.title ?? fallback
}
export const ChartHeader = ({
  index,
  code,
  type,
  themeName,
  typeLabel,
  title,
  help,
  actions = [],
}) => {
  const themeTitle = resolveThemeTitle(type, themeName, typeLabel)
  return (
    <div className="responses-statistics-chart-header">
      <div className="responses-statistics-chart-title">
        <div className="responses-statistics-chart-title-main">
          <span className="responses-statistics-chart-title-index">
            {index + 1} <i className="ri-arrow-right-line" />
          </span>
          <span className="responses-statistics-chart-title-key">{code}</span>
          <Badge>{themeTitle}</Badge>
... (20 lines truncated)
</file>

<file path="editor/src/pages/Responses/components/ResponsesStatistics/ChartRenderV2.js">
import { useRef, useState } from 'react'
import classNames from 'classnames'
import { Card } from 'react-bootstrap'
import { Collapsible, ToggleButtons, TooltipContainer } from 'components'
import {
  isRankingQuestion,
  QT_1_ARRAY_DUAL,
  QT_COLON_ARRAY_NUMBERS,
  QT_K_MULTIPLE_NUMERICAL,
  QT_N_NUMERICAL,
  QT_S_SHORT_FREE_TEXT,
  QT_SEMICOLON_ARRAY_TEXT,
  QT_T_LONG_FREE_TEXT,
  QT_U_HUGE_FREE_TEXT,
  QT_VERTICAL_FILE_UPLOAD,
} from 'helpers'
import { ReactComponent as StackedBarIcon } from 'assets/icons/stacked-bar-icon.svg'
import { ReactComponent as RadarIcon } from 'assets/icons/radar-icon.svg'
import { ChartHeader } from './ChartHeader.js'
import { StatisticsTable } from './StatisticsTable.js'
import { ArrayTextTable } from './ArrayTextTable.js'
import { ResponsesGrid } from './ResponsesGrid.js'
import { MultiNumericalGrid } from './MultiNumericalGrid.js'
import { FileUploadTable } from './FileUploadTable.js'
import {
  BarChart,
  PieChart,
  RankingBarChart,
  StackedBarChart,
  GroupedBarChart,
... (481 lines truncated)
</file>

<file path="editor/src/pages/Responses/components/ResponsesStatistics/ChartsUtils.js">
import { format } from 'util'
import { getQuestionTypeInfo } from 'components/QuestionTypes'
import {
  dayJsHelper,
  QT_1_ARRAY_DUAL,
  QT_5_POINT_CHOICE,
  QT_A_ARRAY_5_POINT,
  QT_B_ARRAY_10_CHOICE_QUESTIONS,
  QT_C_ARRAY_YES_UNCERTAIN_NO,
  QT_COLON_ARRAY_NUMBERS,
  QT_E_ARRAY_INC_SAME_DEC,
  QT_EXCLAMATION_LIST_DROPDOWN,
  QT_F_ARRAY,
  QT_G_GENDER,
  QT_H_ARRAY_COLUMN,
  QT_I_LANGUAGE,
  QT_K_MULTIPLE_NUMERICAL,
  QT_L_LIST,
  QT_M_MULTIPLE_CHOICE,
  QT_N_NUMERICAL,
  QT_O_LIST_WITH_COMMENT,
  QT_P_MULTIPLE_CHOICE_WITH_COMMENTS,
  QT_Q_MULTIPLE_SHORT_TEXT,
  QT_R_RANKING,
  QT_S_SHORT_FREE_TEXT,
  QT_SEMICOLON_ARRAY_TEXT,
  QT_T_LONG_FREE_TEXT,
  QT_U_HUGE_FREE_TEXT,
  QT_VERTICAL_FILE_UPLOAD,
  QT_Y_YES_NO_RADIO,
... (388 lines truncated)
</file>

<file path="editor/src/pages/Responses/components/ResponsesStatistics/ChartsUtils.test.js">
import {
  BAR_MIN_CATEGORY_WIDTH,
  BAR_SCROLL_THRESHOLD,
  getBarChartMinWidth,
} from './ChartsUtils'
describe('getBarChartMinWidth', () => {
  test('keeps the responsive chart width through the density threshold', () => {
    expect(getBarChartMinWidth(BAR_SCROLL_THRESHOLD)).toBeUndefined()
  })
  test('grows dense charts so their categories remain readable', () => {
    const count = BAR_SCROLL_THRESHOLD + 1
    expect(getBarChartMinWidth(count)).toBe(count * BAR_MIN_CATEGORY_WIDTH)
  })
})
</file>

<file path="editor/src/pages/Responses/components/ResponsesStatistics/CommentsModal.js">
import React, { useEffect, useMemo, useState } from 'react'
import { useQuestionComments } from 'hooks'
import { dayJsHelper, htmlToPlainText } from 'helpers'
import { StatisticsDetailModal } from './StatisticsDetailModal.js'
import { StatisticsFilterSelect } from './StatisticsFilterSelect.js'
import {
  CommentSwatch,
  buildOptionByAnswer,
  getAnswerFilterOptions,
} from './ChartsUtils.js'
export const CommentsModal = ({
  show,
  onHide,
  surveyId,
  questionCode,
  questionType,
  questionTitle = '',
  fields,
  answerOptions = [],
  initialAnswer = '',
}) => {
  const [selectedAnswer, setSelectedAnswer] = useState(initialAnswer)
  useEffect(() => {
    setSelectedAnswer(initialAnswer)
  }, [initialAnswer])
  const selectedField = useMemo(
    () =>
      answerOptions.find(
        (option) => String(option.key) === String(selectedAnswer)
      )?.field ?? '',
... (88 lines truncated)
</file>

<file path="editor/src/pages/Responses/components/ResponsesStatistics/FileUploadTable.js">
import { useEffect, useMemo, useState } from 'react'
import { format } from 'util'
import {
  Button,
  HighlightedText,
  LSTable,
  SearchInput,
  TooltipContainer,
  useSearchTerms,
} from 'components'
import { getSiteUrl, htmlToPlainText, STATES } from 'helpers'
import { useAppState, useQuestionFiles } from 'hooks'
import { useIsInViewport } from 'hooks/useInViewport'
import { StatisticsDetailModal } from './StatisticsDetailModal.js'
const FILES_PER_PAGE = 5
const IMAGE_EXTENSIONS = ['jpg', 'jpeg', 'png', 'gif', 'webp', 'bmp']
const FILE_ICONS = {
  'ri-image-line': ['svg', 'tif', 'tiff', 'heic', 'ico'],
  'ri-file-pdf-2-line': ['pdf'],
  'ri-file-word-line': ['doc', 'docx', 'odt', 'rtf'],
  'ri-file-excel-line': ['xls', 'xlsx', 'ods', 'csv'],
  'ri-file-ppt-line': ['ppt', 'pptx', 'odp'],
  'ri-file-zip-line': ['zip', 'rar', '7z', 'gz', 'tar'],
  'ri-file-music-line': ['mp3', 'wav', 'ogg', 'm4a', 'flac'],
  'ri-file-video-line': ['mp4', 'mov', 'avi', 'webm', 'mkv'],
  'ri-file-text-line': ['txt', 'md'],
}
const fileIcon = (extension) =>
  Object.keys(FILE_ICONS).find((icon) =>
    FILE_ICONS[icon].includes(extension)
... (337 lines truncated)
</file>

<file path="editor/src/pages/Responses/components/ResponsesStatistics/index.js">
export * from './ResponsesStatistics'
export * from './ChartsUtils'
export * from './StatisticsFilters'
</file>

<file path="editor/src/pages/Responses/components/ResponsesStatistics/MultiNumericalGrid.js">
import React, { useEffect, useMemo, useState } from 'react'
import { format } from 'util'
import { HighlightedText, SearchInput, useSearchTerms } from 'components'
import { htmlToPlainText } from 'helpers'
import { useQuestionResponses } from 'hooks'
import { useIsInViewport } from 'hooks/useInViewport'
import { formatAnswerDate } from './ChartsUtils.js'
export const MultiNumericalGrid = ({
  surveyId,
  questionCode,
  fields,
  filters,
}) => {
  const [containerRef, isInView] = useIsInViewport(null, {
    initialInView: false,
  })
  const [shouldLoad, setShouldLoad] = useState(false)
  useEffect(() => {
    if (isInView) {
      setShouldLoad(true)
    }
  }, [isInView])
  const { terms, setTerms, setTyped, search } = useSearchTerms()
  const highlightTerms = useMemo(
    () => [...new Set([...(filters?.search ?? []), ...search])],
    [filters, search]
  )
  const {
    columns,
    rows,
... (112 lines truncated)
</file>

<file path="editor/src/pages/Responses/components/ResponsesStatistics/QuestionComments.js">
import { useMemo } from 'react'
import { useQuestionComments } from 'hooks'
import { LSTable } from 'components'
import { htmlToPlainText } from 'helpers'
import { CommentSwatch, buildOptionByAnswer } from './ChartsUtils.js'
const PREVIEW_LIMIT = 5
export const QuestionComments = ({
  surveyId,
  questionCode,
  fields,
  answerOptions = [],
  onViewComments,
}) => {
  const { comments, isLoading } = useQuestionComments(surveyId, questionCode, {
    fields,
  })
  const optionByAnswer = useMemo(
    () => buildOptionByAnswer(answerOptions),
    [answerOptions]
  )
  const columns = useMemo(
    () => [
      {
        id: 'answer',
        header: t('Answer option'),
        cell: ({ row }) => (
          <>
            <CommentSwatch
              fill={optionByAnswer[row.original.subQuestion]?.fill}
            />
... (56 lines truncated)
</file>

<file path="editor/src/pages/Responses/components/ResponsesStatistics/ResponsesGrid.js">
import { useEffect, useMemo, useState } from 'react'
import { format } from 'util'
import classNames from 'classnames'
import { HighlightedText, SearchInput, useSearchTerms } from 'components'
import { htmlToPlainText } from 'helpers'
import { useQuestionResponses } from 'hooks'
import { useIsInViewport } from 'hooks/useInViewport'
import { StatisticsDetailModal } from './StatisticsDetailModal.js'
import { formatAnswerDate } from './ChartsUtils.js'
const INLINE_LIMIT = 5
export const ResponsesGrid = ({
  surveyId,
  questionCode,
  title = '',
  fields,
  filters,
  twoColumns = false,
}) => {
  const [containerRef, isInView] = useIsInViewport(null, {
    initialInView: false,
  })
  const [shouldLoad, setShouldLoad] = useState(false)
  const [showModal, setShowModal] = useState(false)
  useEffect(() => {
    if (isInView) {
      setShouldLoad(true)
    }
  }, [isInView])
  const { terms, setTerms, setTyped, search } = useSearchTerms()
  // The backend matches the global panel terms too, so highlight both.
... (142 lines truncated)
</file>

<file path="editor/src/pages/Responses/components/ResponsesStatistics/ResponsesStatistics.js">
import React, { useMemo, useState } from 'react'
import { ToggleButtons } from 'components'
import { useAppState, useStatistics, useSurvey } from 'hooks'
import { STATES } from 'helpers'
import { useIsInViewport } from 'hooks/useInViewport'
import { ResponsesHeader } from '../../ResponsesHeader'
import { TAB_KEYS } from '../../utils'
import { VALUE_TYPE } from './ChartsUtils'
import { StatisticsContainer } from './StatisticsContainer.js'
import { buildQuestionOptions } from './StatisticsFiltersModal/utils'
const valueTypeOptions = [
  { name: '%', value: VALUE_TYPE.PERCENTAGE },
  { name: '#', value: VALUE_TYPE.COUNT },
]
export const ResponsesStatistics = ({
  surveyId,
  filters = {},
  showFilters,
  setShowFilters,
  setFilters,
}) => {
  const {
    statistics,
    isFetching,
    isFetchingNextPage,
    hasNextPage,
    fetchNextPage,
  } = useStatistics(surveyId, filters)
  const [valueType, setValueType] = useState(VALUE_TYPE.PERCENTAGE)
  const [loadMoreRef] = useIsInViewport(null, {
... (64 lines truncated)
</file>

<file path="editor/src/pages/Responses/components/ResponsesStatistics/StatisticsContainer.js">
import React, { memo, useMemo } from 'react'
import { useAppState, useSurvey } from 'hooks'
import { htmlToPlainText, STATES } from 'helpers'
import { getDataWithPercentages } from './ChartsUtils.js'
import { ChartRendererV2 } from './ChartRenderV2.js'
const UNGROUPED_KEY = '__ungrouped__'
const getQuestionGroupId = (statisticsItem) =>
  statisticsItem?.meta?.question?.gid ??
  statisticsItem?.meta?.question?.groupId ??
  null
const getGroupTitle = (group, activeLanguage) => {
  if (!group) return null
  const localized =
    group.l10ns?.[activeLanguage] ??
    group.l10ns?.[Object.keys(group.l10ns || {})[0]]
  const name = localized?.groupName ?? group.groupName ?? null
  return name ? htmlToPlainText(name) : name
}
const StatisticsChartCard = memo(function StatisticsChartCard({
  item,
  index,
  surveyId,
  valueType,
  filters,
}) {
  const data = useMemo(() => getDataWithPercentages(item), [item])
  const question = useMemo(
    () => ({
      qid: item?.meta?.question?.qid,
      type: item?.meta?.question?.type,
... (94 lines truncated)
</file>

<file path="editor/src/pages/Responses/components/ResponsesStatistics/StatisticsDetailModal.js">
import React from 'react'
import { ComponentModal } from 'components'
export const StatisticsDetailModal = ({
  show,
  onHide,
  modalClassname = '',
  children,
}) => (
  <ComponentModal
    show={show}
    onHide={onHide}
    modalClassname={`responses-statistics-modal ${modalClassname}`.trim()}
    componentClassname="responses-statistics-modal-body"
    Component={children}
  />
)
</file>

<file path="editor/src/pages/Responses/components/ResponsesStatistics/StatisticsFilters.js">
import { useCallback, useEffect, useState } from 'react'
import { debounce } from 'lodash'
import { Badge, Button, Select } from 'components'
import { SideBarHeader } from 'components/SideBar'
import { CloseIcon } from 'components/icons'
const MAX_SEARCH_TERMS = 10
export const StatisticsFilters = ({ filters, setFilters, setShowFilters }) => {
  const [_filters, _setFilters] = useState(filters)
  const [error, setError] = useState(null)
  const [searchInput, setSearchInput] = useState('')
  const searchTerms = _filters.search ?? []
  const addSearchTerm = () => {
    const term = searchInput.trim()
    if (
      !term ||
      searchTerms.includes(term) ||
      searchTerms.length >= MAX_SEARCH_TERMS
    ) {
      return
    }
    _setFilters({ ..._filters, search: [...searchTerms, term] })
    setSearchInput('')
  }
  const removeSearchTerm = (term) => {
    const next = searchTerms.filter((item) => item !== term)
    const rest = { ..._filters }
    delete rest.search
    _setFilters(next.length ? { ...rest, search: next } : rest)
  }
  const handleOnFilterChange = useCallback(
... (130 lines truncated)
</file>

<file path="editor/src/pages/Responses/components/ResponsesStatistics/StatisticsFilterSelect.js">
import React from 'react'
import { Dropdown } from 'react-bootstrap'
export const StatisticsFilterSelect = ({
  label,
  options = [],
  value,
  onChange = () => {},
  allOption,
}) => {
  const selected = options.find((option) => option.key === value)
  const selectedLabel = selected?.title || allOption?.label || ''
  return (
    <div className="responses-statistics-filter">
      {label && (
        <span className="responses-statistics-filter-label">{label}</span>
      )}
      <Dropdown className="responses-statistics-filter-dropdown">
        <Dropdown.Toggle
          variant="light"
          className="responses-statistics-filter-toggle"
        >
          <span className="responses-statistics-filter-value">
            {selected?.fill && (
              <span
                className="responses-statistics-filter-swatch"
                style={{ backgroundColor: selected.fill }}
              />
            )}
            <span className="responses-statistics-filter-text">
              {selectedLabel}
... (32 lines truncated)
</file>

<file path="editor/src/pages/Responses/components/ResponsesStatistics/StatisticsTable.js">
import { LSTable, TooltipContainer } from 'components'
import {
  VALUE_TYPE,
  getDisplayMetric,
  getUnionSegments,
  ordinal,
  shouldRenderImage,
  wrapTerm,
} from './ChartsUtils'
const AnswerCell = ({ row, isImage }) =>
  shouldRenderImage(isImage, row) ? (
    <img
      src={row.title}
      alt={row.title}
      className="responses-statistics-table-image"
    />
  ) : (
    row.title
  )
const withRowIds = (rows) =>
  rows.map((row, index) => ({ ...row, id: row.key ?? `row-${index}` }))
export const StatisticsTable = ({
  data = [],
  isImage = false,
  valueType = VALUE_TYPE.PERCENTAGE,
}) => {
  const isRanking = data.some((item) => Array.isArray(item?.ranks))
  const isSegmented = data.some((item) => Array.isArray(item?.segments))
  const statsItem = data.find((item) => item?.stats)
  if (statsItem) {
... (161 lines truncated)
</file>

<file path="editor/src/pages/Responses/components/ResponsesTable/FileInfoCell.js">
import { format } from 'util'
import { Badge } from 'react-bootstrap'
export const FileInfoCell = ({ filesInfo, surveyId, rowId, questionId }) => {
  const filesToRender = filesInfo.map((fileInfo, index) => {
    const fileSize = Math.max(fileInfo.approxFileSizeInMB, 0.1)
    if (fileInfo.isDeleted) {
      return (
        <Badge key={`${fileInfo.key}-${index}`}>
          <span className="file-name text-danger">
            {t('File has been deleted')}
          </span>
        </Badge>
      )
    }
    return (
      <div className="td-value-container" key={`${fileInfo.key}-${index}`}>
        <Badge>
          <div>
            <span className="file-name">{fileInfo.name}:</span>
            <a
              href={`${location.protocol}//${location.hostname}/responses/downloadfile?surveyId=${surveyId}&responseId=${rowId}&qid=${questionId}&index=${index}`}
              className="ms-1 file-size"
              target="_blank"
              rel="noreferrer"
            >
              {format(t('%s MB'), fileSize)}
            </a>
          </div>
        </Badge>
        {fileInfo.comment && (
... (23 lines truncated)
</file>

<file path="editor/src/pages/Responses/components/ResponsesTable/index.js">
export * from './ResponsesTable'
export * from './FileInfoCell'
</file>

<file path="editor/src/pages/Responses/components/ResponsesTable/ResponsesTable.js">
import React, { useCallback, useEffect, useRef, useState } from 'react'
import {
  useReactTable,
  getCoreRowModel,
  getSortedRowModel,
  getPaginationRowModel,
  getFacetedRowModel,
  getFacetedUniqueValues,
} from '@tanstack/react-table'
import { debounce } from 'lodash'
import classNames from 'classnames'
import { PaginationButtons } from 'components'
import { QuestionPreview } from 'components/Survey/Questions/QuestionPreview'
import {
  getDefaultColumns,
  getInitialColumnVisibility,
  generateColumns,
  generateData,
  SelectColumnId,
  ActionsColumnId,
  applyStoredColumnVisibility,
  readColumnVisibility,
  writeColumnVisibility,
} from '../../utils'
import { Toast } from 'helpers'
import { BulkActions, ResponseDetailView } from '../'
import { ResponseModals } from '../'
import { ResponsesTableHeader } from './ResponsesTableHeader'
import { ResponsesTableBody } from './ResponsesTableBody'
export const ResponsesTable = ({
... (516 lines truncated)
</file>

<file path="editor/src/pages/Responses/components/ResponsesTable/ResponsesTableBody.js">
import classNames from 'classnames'
import { getQuestionTypeInfo } from 'components'
import { getCellInfo, getCommonPinningStyles } from '../../utils'
import { ColumnFilter } from '../ColumnFilter'
import { FileInfoCell } from './FileInfoCell'
import { TableCell } from './TableCell'
export const ResponsesTableBody = ({
  table,
  clickedRowRef,
  showFilters,
  sortedColumnId,
  columnsFilters,
  setColumnsFilters,
  sid,
  setShowQuestionComponent,
  cellQuestionInfoRef,
  baseLanguage,
}) => {
  const handleOnCellClick = (cell, row) => {
    const question = cell.column.columnDef?.meta?.question
    clickedRowRef.current = row
    let cellInfo = getCellInfo(cell, row)
    cellQuestionInfoRef.current = {
      ...cellInfo,
      cell,
    }
    if (question) {
      setShowQuestionComponent(true)
    }
  }
... (83 lines truncated)
</file>

<file path="editor/src/pages/Responses/components/ResponsesTable/ResponsesTableHeader.js">
import classNames from 'classnames'
import { flexRender } from '@tanstack/react-table'
import { ContentEditor } from 'components'
import {
  ActionsColumnId,
  getCommonPinningStyles,
  idColumnKey,
  SelectColumnId,
} from '../../utils'
export const ResponsesTableHeader = ({
  table,
  pinnedColumns,
  setPinnedColumns,
}) => {
  const handleColumnPin = ({ column, id }) => {
    if (id === SelectColumnId) {
      setPinnedColumns([...pinnedColumns])
      return
    }
    const isPinned = column.getIsPinned()
    if (!isPinned) {
      setPinnedColumns([...pinnedColumns, id])
    } else {
      const index = pinnedColumns.indexOf(id)
      pinnedColumns.splice(index, 1)
      setPinnedColumns([...pinnedColumns])
    }
  }
  return (
    <thead>
... (99 lines truncated)
</file>

<file path="editor/src/pages/Responses/components/ResponsesTable/TableCell.js">
import { flexRender } from '@tanstack/react-table'
import { isArrayQuestion } from 'helpers'
import { completedColumnKey, renderCellText } from '../../utils'
import { Badge } from 'react-bootstrap'
export const TableCell = ({ cell, question = {}, baseLanguage }) => {
  const cellValue = cell.getContext().getValue()
  let value = ''
  if (typeof cellValue === 'object') {
    value = cellValue?.map(
      (
        {
          value,
          comment,
          subquestionTitle,
          answerTitle,
          questionThemeName,
          checked,
          key,
          subquestion1,
          subquestion2,
        },
        index
      ) => {
        if (value === '-oth-') {
          return <></>
        }
        return (
          <Badge
            key={`cell-value-${index}${cell.column.id}`}
            className={
... (33 lines truncated)
</file>

<file path="editor/src/pages/Responses/components/BulkActions.js">
import classNames from 'classnames'
import { Button } from 'components'
import {
  DeleteIcon,
  DownloadIcon,
  Separator,
  XIcon,
} from 'components/icons'
export const BulkActions = ({
  table,
  selectedCount = 0,
  onDeleteClick = () => {},
  onAttachmentsDeleteClick = () => {},
  onDownloadFilesClick = () => {},
  onUnselectAll = () => {},
}) => {
  const tableHasRowsSelected = selectedCount > 0
  const handleUnSelectAll = () => {
    table.toggleAllRowsSelected(false)
    onUnselectAll()
  }
  const [selectedBefore, selectedAfter] = t('%s selected').split('%s')
  return (
    <div
      className={classNames(`bulk-actions`, {
        'pointer-events-none': !tableHasRowsSelected,
      })}
      style={{
        opacity: tableHasRowsSelected ? '1' : '0',
      }}
... (30 lines truncated)
</file>

<file path="editor/src/pages/Responses/components/ChartRenderer.js">
import { useMemo, useState } from 'react'
import { Card } from 'react-bootstrap'
import { Button } from 'components'
import { statisticsGraphs } from './ResponsesStatistics'
import {
  BarChart,
  DoughnutChart,
  LineChart,
  PieChart,
  PolarAreaChart,
  RadarChart,
} from './ResponsesStatistics/Charts'
export const ChartRenderer = ({
  statisticsData,
  graphType,
  onGraphChangeCallbackData = () => {},
  title,
  filterZeroValues = false,
  disablePieChart = false,
  disableDoughnutChart = false,
  disableBarChart = false,
  disableLineChart = false,
  disableRadarChart = false,
  emptyMessage = null,
}) => {
  const [chartType, setChartType] = useState(graphType)
  const data = useMemo(() => {
    const shouldFilterZeroValues =
      filterZeroValues &&
      (chartType === statisticsGraphs.PIE_CHART ||
... (116 lines truncated)
</file>

<file path="editor/src/pages/Responses/components/ColumnActions.js">
import classNames from 'classnames'
import { ArrowDownIcon } from 'components/icons'
import { MeatballMenu } from 'components/MeatballMenu/MeatballMenu'
export const ColumnActions = ({
  handleColumnPin = () => {},
  handleColumnFilter = () => {},
  header,
}) => {
  const columnIsPinned = header.column.getIsPinned()
  return (
    <MeatballMenu
      shouldDisableIfSurveyActive={false}
      items={[
        {
          label: t('Filter column'),
          icon: <div className={classNames('ri-filter-line')}></div>,
          onClick: () => handleColumnFilter(header),
        },
        {
          label: columnIsPinned ? t('Unpin column') : t('Pin column'),
          icon: (
            <div
              className={classNames('pin-icon', {
                'ri-pushpin-2-line': !header.column.getIsPinned(),
                'ri-unpin-line': header.column.getIsPinned(),
              })}
            ></div>
          ),
          onClick: () => handleColumnPin(header),
        },
... (9 lines truncated)
</file>

<file path="editor/src/pages/Responses/components/ColumnFilter.js">
import { format } from 'date-fns'
import { DateRangePicker, getQuestionTypeInfo, Input, Select } from 'components'
import {
  completedColumnKey,
  containfilter,
  dateRangeFilter,
  multiSelectFilter,
  rangeFilter,
} from '../utils'
export const filterFns = {
  [multiSelectFilter]: (row, columnId, filterValue) => {
    return filterValue?.includes(row.getValue(columnId))
  },
  [rangeFilter]: (row, columnId, filterValue) => {
    const [min, max] = filterValue ?? []
    const value = row.getValue(columnId)
    if (min !== '' && value < min) return false
    if (max !== '' && value > max) return false
    return true
  },
  [dateRangeFilter]: (row, columnId, filterValue) => {
    const [from, to] = filterValue ?? []
    const cellDate = row.getValue(columnId)
    if (!cellDate) return false
    const cellTime = new Date(cellDate).getTime()
    const fromTime = from ? new Date(from).getTime() : null
    const toTime = to ? new Date(to).getTime() : null
    if (fromTime && cellTime < fromTime) {
      return false
    }
... (169 lines truncated)
</file>

<file path="editor/src/pages/Responses/components/ColumnsManagement.js">
import classNames from 'classnames'
import { useEffect, useMemo, useRef, useState } from 'react'
import { DragDropContext, Draggable, Droppable } from 'react-beautiful-dnd'
import { Button, TooltipContainer } from 'components'
import {
  ArrowDownIcon,
  ArrowUpIcon,
  CheckIcon,
  DragIcon,
  XIconWithBorder,
} from 'components/icons'
import { completedColumnKey, idColumnKey } from '../utils/generateColumns'
import { ActionsColumnId, SelectColumnId } from '../utils/getDefaultColumns'
const isSpecialColumn = ({ id }) =>
  id === SelectColumnId || id === ActionsColumnId
const hasQuestionId = (column, qid) =>
  qid != null && column.qid?.toString() === qid.toString()
const orderColumns = (columns, normalColumns, timingColumns) => [
  ...columns.filter(({ id }) => id === SelectColumnId),
  ...normalColumns,
  ...timingColumns,
  ...columns.filter(({ id }) => id === ActionsColumnId),
]
const ColumnManagerLabel = ({ column }) => {
  const question = column.questionLabel
  if (!question) {
    return column.header
  }
  return (
    <>
... (321 lines truncated)
</file>

<file path="editor/src/pages/Responses/components/ColumnsManagement.test.js">
import 'tests/mocks'
import { render, screen, within } from '@testing-library/react'
import userEvent from '@testing-library/user-event'
import { ColumnsManagement } from './ColumnsManagement'
const createColumn = ({
  id,
  header,
  isTiming = false,
  timingType,
  qid,
  questionLabel,
  visible = true,
}) => ({
  id,
  columnDef: {
    header,
    meta: {
      ...(isTiming && { columnCategory: 'timing' }),
      ...(timingType && { timingType }),
      ...(qid != null && { qid }),
      ...(questionLabel && { questionLabel }),
    },
  },
  getIsVisible: () => visible,
})
describe('ColumnsManagement', () => {
  beforeAll(() => {
    globalThis.t = (text) => text
  })
  test('groups timings without drag controls and appends them on confirm', async () => {
... (196 lines truncated)
</file>

<file path="editor/src/pages/Responses/components/ExportResponsesModal.js">
import { useEffect, useState } from 'react'
import { ExportOptionsForm } from 'components'
export const ExportResponsesModal = ({
  surveyLanguage,
  additionalLanguages,
  exportRef,
}) => {
  const [exportOptions, setExportOptions] = useState({
    responseType: 'filtered',
    type: 'csv',
    language: surveyLanguage,
    answerFormat: 'long',
    csvSeparator: ',',
  })
  useEffect(() => {
    if (!exportRef) {
      return undefined
    }
    exportRef.current = {
      options: exportOptions,
    }
    return () => {
      exportRef.current = null
    }
  }, [exportOptions, exportRef])
  return (
    <div className="export-responses-modal">
      <ExportOptionsForm
        surveyLanguage={surveyLanguage}
        additionalLanguages={additionalLanguages}
... (6 lines truncated)
</file>

<file path="editor/src/pages/Responses/components/index.js">
export * from './ColumnFilter'
export * from './ExportResponsesModal'
export * from './ResponseDetailView'
export * from './BulkActions'
export * from './ColumnActions'
export * from './ResponsesTable'
export * from './ResponseModals'
export * from './ResponsesStatistics'
export * from './ChartRenderer'
</file>

<file path="editor/src/pages/Responses/components/ResponseDetailView.js">
import React from 'react'
import { Button } from 'components'
import { QuestionPreview } from 'components/Survey'
import { getCellInfo } from '../utils'
import { getSiteUrl } from 'helpers'
export const ResponseDetailView = ({
  language,
  survey = {},
  onSave,
  showResponseDetails,
  canGoNextResponse,
  canGoPreviousResponse,
  rowInfo = {},
  disableUpdatingResponses = false,
}) => {
  const rowCells = rowInfo.getVisibleCells()
  const questionsInfo = {}
  const rowData = rowInfo?.original || {}
  rowCells.map((cell) => {
    const question = cell.column.columnDef?.meta?.question
    if (!question || questionsInfo[question.qid]) {
      return
    }
    questionsInfo[question.qid] = getCellInfo(cell, rowInfo)
  })
  return (
    <div key={rowData?.id} className="response-detail-view">
      <div className="response-questions">
        {Object.entries(questionsInfo).map(([, questionInfo], index) => {
          return (
... (91 lines truncated)
</file>

<file path="editor/src/pages/Responses/components/ResponseModals.js">
import { ComponentModal, ConfirmModal } from 'components'
import { ColumnsManagement } from './ColumnsManagement'
export const ResponseModals = ({
  showResponsesDeleteModal,
  setShowResponsesDeleteModal,
  showAttachmentsDeleteModal,
  setShowAttachmentsDeleteModal,
  showColumnManagementModal,
  setShowColumnManagementModal,
  showQuestionComponent,
  setShowQuestionComponent,
  showSurveyDetails,
  setShowSurveyDetails,
  handleOnColumnsManagementConfirm = () => {},
  onAttachmentsDeleteConfirm = () => {},
  onResponsesDeleteConfirm = () => {},
  QuestionComponent,
  SurveyDetailsComponent,
  table,
  saveTimings = false,
  handleOnHide,
  isBulkAction,
  selectedRowsIds = [],
}) => {
  const handleOnDeleteConfirm = () => {
    onResponsesDeleteConfirm()
    setShowResponsesDeleteModal(false)
  }
  const handleAttachmentsDeleteConfirm = () => {
    onAttachmentsDeleteConfirm()
... (87 lines truncated)
</file>

<file path="editor/src/pages/Responses/Sidebars/getResponsesPanels.js">
import { SurveyStructureIcon } from 'components/icons'
import { TAB_KEYS } from '../utils'
export const getResponsesPanels = () => {
  return {
    results: {
      label: t('Results'),
      panel: 'results',
      icon: SurveyStructureIcon,
      defaultMenu: panelItemsKeys.overview,
    },
  }
}
export const panelItemsKeys = {
  overview: TAB_KEYS.OVERVIEW,
  list: TAB_KEYS.RESPONSES,
  statistics: TAB_KEYS.STATISTICS,
}
export const panelOptions = () => {
  return {
    [getResponsesPanels().results.panel]: [
      {
        label: t('Results overview'),
        labelEditor: t('Results overview'),
        menu: panelItemsKeys.overview,
      },
      {
        label: t('Responses list'),
        labelEditor: t('Responses list'),
        menu: TAB_KEYS.RESPONSES,
      },
... (9 lines truncated)
</file>

<file path="editor/src/pages/Responses/Sidebars/index.js">
export * from './LeftSideBar'
export * from './getResponsesPanels'
</file>

<file path="editor/src/pages/Responses/Sidebars/LeftSideBar.js">
import React, { useEffect, useMemo } from 'react'
import { useNavigate, useParams } from 'react-router-dom'
import { SideBar } from 'components/SideBar'
import { useSurvey } from 'hooks'
import { getResponsesPanels, panelOptions } from './getResponsesPanels'
export const LeftSideBar = ({ surveyId }) => {
  const navigate = useNavigate()
  const { panel } = useParams()
  const { survey = {} } = useSurvey(surveyId)
  const handlePanelChange = (panelKey) => {
    const panelInfo = getResponsesPanels()[panelKey]
    if (panelInfo.panel === panel) {
      return
    }
    if (panelInfo.getRedirectUrl && !process.env.STORYBOOK_DEV) {
      window.open(panelInfo.getRedirectUrl(survey.sid), '_self')
    } else {
      navigate(
        `/responses/${survey.sid}/${panelInfo.panel}/${panelInfo.defaultMenu || ''}`
      )
    }
  }
  const items = useMemo(() => {
    const items = []
    const panelComponents = {}
    Object.keys(getResponsesPanels()).forEach((panelKey) => {
      const panelInfo = getResponsesPanels()[panelKey]
      items.push({
        icon: panelInfo.icon,
        label: panelInfo.label,
... (38 lines truncated)
</file>

<file path="editor/src/pages/Responses/Sidebars/RightSideBar.js">
import React from 'react'
import { TAB_KEYS } from '../utils'
import { StatisticsFilters } from '../components/ResponsesStatistics/StatisticsFilters'
export const RightSideBar = ({
  tabKey,
  filters,
  setFilters,
  showStatisticsFilters,
  setShowStatisticsFilters,
}) => {
  if (tabKey === TAB_KEYS.STATISTICS && showStatisticsFilters) {
    return (
      <StatisticsFilters
        setShowFilters={setShowStatisticsFilters}
        filters={filters}
        setFilters={setFilters}
      />
    )
  }
  return null
}
</file>

<file path="editor/src/pages/Responses/utils/columnVisibility.js">
const STORAGE_KEY_PREFIX = 'responses-table-column-visibility'
const LEGACY_STORAGE_KEY_PREFIX = 'responses-table-timing-column-visibility'
const getStorageKey = (surveyId) => `${STORAGE_KEY_PREFIX}:${surveyId}`
const getLegacyStorageKey = (surveyId) =>
  `${LEGACY_STORAGE_KEY_PREFIX}:${surveyId}`
export const readColumnVisibility = (surveyId) => {
  if (!surveyId || typeof localStorage === 'undefined') {
    return {}
  }
  try {
    const storedVisibility = localStorage.getItem(getStorageKey(surveyId))
    const legacyVisibility = localStorage.getItem(getLegacyStorageKey(surveyId))
    return JSON.parse(storedVisibility ?? legacyVisibility) || {}
  } catch {
    return {}
  }
}
export const writeColumnVisibility = (surveyId, columns) => {
  if (!surveyId || typeof localStorage === 'undefined') {
    return
  }
  const visibility = Object.fromEntries(
    columns
      .filter(({ checked }) => typeof checked === 'boolean')
      .map(({ id, checked }) => [id, checked])
  )
  try {
    localStorage.setItem(getStorageKey(surveyId), JSON.stringify(visibility))
  } catch {
  }
... (14 lines truncated)
</file>

<file path="editor/src/pages/Responses/utils/columnVisibility.test.js">
import {
  applyStoredColumnVisibility,
  readColumnVisibility,
  writeColumnVisibility,
} from './columnVisibility'
describe('columnVisibility', () => {
  beforeEach(() => {
    localStorage.removeItem('responses-table-column-visibility:123')
    localStorage.removeItem('responses-table-column-visibility:456')
    localStorage.removeItem('responses-table-timing-column-visibility:123')
  })
  test('stores normal and timing column visibility by survey', () => {
    writeColumnVisibility(123, [
      { id: 'question-time', isTiming: true, checked: true },
      { id: 'question', isTiming: false, checked: false },
    ])
    expect(readColumnVisibility(123)).toEqual({
      'question-time': true,
      'question': false,
    })
    expect(readColumnVisibility(456)).toEqual({})
  })
  test('stores visibility for surveys without timing columns', () => {
    writeColumnVisibility(123, [
      { id: 'id', checked: true },
      { id: 'question-1', checked: false },
      { id: 'question-2', checked: false },
    ])
    expect(readColumnVisibility(123)).toEqual({
      'id': true,
... (37 lines truncated)
</file>

<file path="editor/src/pages/Responses/utils/filterTypes.js">
export const dateRangeFilter = 'date-range'
export const multiSelectFilter = 'multi-select'
export const rangeFilter = 'range'
export const containfilter = 'contain'
</file>

<file path="editor/src/pages/Responses/utils/generateColumns.js">
import { getQuestionById, getSiteUrl, htmlToPlainText } from 'helpers'
import { TooltipContainer } from 'components'
import {
  containfilter,
  dateRangeFilter,
  multiSelectFilter,
  rangeFilter,
} from './filterTypes'
export const idColumnKey = 'id'
export const completedColumnKey = 'completed'
export const getInitialColumnVisibility = (columns) =>
  Object.fromEntries(
    columns
      .filter(({ meta }) => meta?.visibleByDefault === false)
      .map(({ id }) => [id, false])
  )
const createQuestionLabel = (question, language) => {
  const code = question?.title
  const text = htmlToPlainText(question?.l10ns?.[language]?.question)
  return code ? { code, text } : undefined
}
const createTimingColumn = (
  { fieldname, question: header, qid, type },
  survey
) => {
  const question =
    type === 'answer_time' && Array.isArray(survey.questionGroups)
      ? getQuestionById(qid, survey)?.question
      : undefined
  const questionLabel = createQuestionLabel(question, survey.language)
... (202 lines truncated)
</file>

<file path="editor/src/pages/Responses/utils/generateColumns.test.js">
import 'tests/mocks'
import { fireEvent, render, screen } from '@testing-library/react'
import { getSiteUrl } from 'helpers'
import { generateColumns, getInitialColumnVisibility } from './generateColumns'
describe('generateColumns', () => {
  beforeAll(() => {
    globalThis.t = (text) => text
  })
  test('adds columns from timing field metadata', () => {
    const timingFields = [
      {
        fieldname: 'interviewtime',
        type: 'interview_time',
        question: 'Total time (in s)',
      },
      {
        fieldname: 'G12time',
        type: 'page_time',
        question: 'Group time: Demographics',
      },
      {
        fieldname: 'Q34time',
        qid: 34,
        type: 'answer_time',
        question: 'Question time: AGE',
      },
    ]
    const columns = generateColumns(
      { responseField: { qid: 34 } },
      {
... (128 lines truncated)
</file>

<file path="editor/src/pages/Responses/utils/generateData.js">
import {
  getQuestionTypeInfo,
  isQuestionWithAnswers,
  isQuestionWithSubquestions,
} from 'components'
import {
  dayJsHelper,
  getAnswerById,
  getAnswerByProperty,
  getSubquestionById,
  getSubquestionByProperty,
  isRankingQuestion,
  htmlToPlainText,
  OTHER_CODE,
} from 'helpers'
import { cloneDeep } from 'lodash'
export const generateData = (responses, language, generatedColumns) => {
  const data = []
  const questions = {}
  const formatDate = (date) =>
    date ? dayJsHelper(date).format('MM-DD-YYYY HH:mm:ss') : 'N/A'
  responses.forEach((response, index) => {
    data.push({
      ...response.timings,
      language: response.language,
      id: response.id,
      seed: response.seed,
      token: response.token,
      firstName: response.firstName,
      lastName: response.lastName,
... (240 lines truncated)
</file>

<file path="editor/src/pages/Responses/utils/generateData.test.js">
import 'tests/mocks'
import { generateData } from './generateData'
describe('generateData', () => {
  test('maps timing values onto the response row', () => {
    const [row] = generateData(
      [
        {
          id: 10,
          answers: {},
          timings: {
            interviewtime: 125.42,
            G12time: 60.17,
            Q34time: 18.03,
          },
        },
      ],
      'en',
      []
    )
    expect(row).toEqual(
      expect.objectContaining({
        interviewtime: 125.42,
        G12time: 60.17,
        Q34time: 18.03,
      })
    )
  })
  test('supports responses without timing data', () => {
    const [row] = generateData([{ id: 10, answers: {} }], 'en', [])
    expect(row.id).toBe(10)
... (4 lines truncated)
</file>

<file path="editor/src/pages/Responses/utils/getCellInfo.js">
export const getCellInfo = (cell) => {
  const question = cell.column.columnDef?.meta?.question
  if (!question) {
    return {}
  }
  let meta = {
    ...cell?.column?.columnDef?.meta,
  }
  return { values: [...cell.getContext().getValue()], ...meta }
}
</file>

<file path="editor/src/pages/Responses/utils/getCommonPinningStyles.js">
export const getCommonPinningStyles = (column) => {
  const isPinned = column.getIsPinned()
  const isLastLeftPinnedColumn =
    isPinned === 'left' && column.getIsLastColumn('left')
  if (!isPinned) {
    return { position: 'relative' }
  }
  return {
    boxShadow: isLastLeftPinnedColumn && '-4px 0px 2px -4px gray inset',
    left: isPinned === 'left' && `${column.getStart('left') - 35}px`,
    right: isPinned === 'right' && `${column.getAfter('right') - 35}px`,
    opacity: 0.95,
    position: 'sticky',
    width: column.getSize(),
    zIndex: 2,
  }
}
</file>

<file path="editor/src/pages/Responses/utils/getDefaultColumns.js">
import {
  ColumnsIcon,
  DeleteIcon,
  DownloadIcon,
  EyeIcon,
} from 'components/icons'
import { MeatballMenu } from 'components/MeatballMenu/MeatballMenu'
export const SelectColumnId = 'column-select'
export const ActionsColumnId = 'response-actions'
export const getDefaultColumns = ({
  onResponseDetailViewClick = () => {},
  deleteCallback = () => {},
  showColumnsManagment = () => {},
  onDownloadAllFilesClick = () => {},
  onDeleteResponseFilesClick = () => {},
}) => {
  return {
    SELECT: {
      id: SelectColumnId,
      maxSize: 60,
      header: ({ table }) => (
        <input
          type="checkbox"
          className="form-check-input"
          checked={table.getIsAllRowsSelected()}
          onChange={table.getToggleAllRowsSelectedHandler()}
        />
      ),
      cell: ({ row }) => (
        <input
... (49 lines truncated)
</file>

<file path="editor/src/pages/Responses/utils/getSelectedRowIdsFromTable.js">
export const getSelectedRowIdsFromTable = (table) => {
  const selectedRows = table.getSelectedRowModel().rows
  return selectedRows.map((row) => row.original.id)
}
</file>

<file path="editor/src/pages/Responses/utils/index.js">
export * from './generateColumns'
export * from './generateData'
export * from './getDefaultColumns'
export * from './getSelectedRowIdsFromTable'
export * from './renderCellText'
export * from './getCommonPinningStyles'
export * from './filterTypes'
export * from './getCellInfo'
export * from './tabKeys'
export * from './columnVisibility'
</file>

<file path="editor/src/pages/Responses/utils/renderCellText.js">
import { useLayoutEffect, useRef, useState } from 'react'
import { getQuestionTypeInfo } from 'components'
import {
  isArrayQuestion,
  isRankingQuestion,
  isSingleChoiceQuestion,
  OTHER_CODE,
} from 'helpers'
const ArrayResponseAnswer = ({ answerTitle, comment }) => {
  const titleRef = useRef(null)
  const [minimumWidth, setMinimumWidth] = useState(0)
  useLayoutEffect(() => {
    setMinimumWidth(
      Math.min(40, titleRef.current?.getBoundingClientRect().width || 0)
    )
  }, [answerTitle])
  return (
    <span className="array-response-answer" style={{ minWidth: minimumWidth }}>
      <span
        ref={titleRef}
        className="array-response-answer-measure"
        aria-hidden="true"
      >
        {answerTitle}
      </span>
      {answerTitle}
      {comment && <span>: {comment.value}</span>}
    </span>
  )
}
... (84 lines truncated)
</file>

<file path="editor/src/pages/Responses/utils/tabKeys.js">
export const TAB_KEYS = {
  RESPONSES: 'responses',
  STATISTICS: 'statistics',
  OVERVIEW: 'overview',
}
</file>

<file path="editor/src/pages/Responses/index.js">
export * from './components'
export * from './utils'
</file>

<file path="editor/src/pages/Responses/Responses.js">
import React, { useEffect, useRef, useState } from 'react'
import { useParams, useSearchParams } from 'react-router-dom'
import { Toaster } from 'react-hot-toast'
import { useTranslation } from 'react-i18next'
import { Container } from 'react-bootstrap'
import { useAppState, useResponses, useSetAllLanguages, useSurvey } from 'hooks'
import {
  createBufferOperation,
  downloadBlob,
  getFilenameFromContentDisposition,
  PAGES,
  STATES,
  Toast,
  toastComponent,
} from 'helpers'
import { ComponentModal } from 'components'
import { LeftSideBar } from './Sidebars/LeftSideBar'
import {
  ResponsesTable,
  ExportResponsesModal,
  ResponsesStatistics,
} from './components'
import { ResponsesHeader } from './ResponsesHeader'
import { TAB_KEYS } from './utils'
import { ResponsesOverview } from './components/Overview/ResponsesOverview'
import { panelItemsKeys } from './Sidebars'
import { RightSideBar } from './Sidebars/RightSideBar'
export const Responses = () => {
  const { t } = useTranslation()
  const { surveyId, menu } = useParams()
... (339 lines truncated)
</file>

<file path="editor/src/pages/Responses/ResponsesHeader.js">
import classNames from 'classnames'
import { Button } from 'components'
import { TAB_KEYS } from './utils'
import { useParams } from 'react-router-dom'
import { panelItemsKeys } from './Sidebars'
export const ResponsesHeader = ({
  setShowFilters = () => {},
  showFilters,
  setFilters = () => {},
  tabKey,
}) => {
  const { menu } = useParams()
  const isStatistics = tabKey === TAB_KEYS.STATISTICS
  if (menu === panelItemsKeys.overview) {
    return null
  }
  return (
    <div className="d-flex justify-content-between">
      <div
        className={classNames('d-flex gap-2 align-items-center', {
          'opacity-0 disabled': tabKey === TAB_KEYS.OVERVIEW,
        })}
      >
        {!isStatistics && (
          <>
            <div>
              <Button
                className={`btn filter-button`}
                onClick={() => setShowFilters(!showFilters)}
                variant="light"
... (29 lines truncated)
</file>

<file path="editor/src/pages/SharingPanel/SharingPanel.js">
import classNames from 'classnames'
import { useParams } from 'react-router-dom'
import { Container } from 'react-bootstrap'
import { PAGES, STATES, SURVEY_MENU_TITLES } from 'helpers'
import { SharingOverview } from 'components/SharingPanel'
import { PluginSlot } from 'plugins/PluginSlot'
import { PLUGIN_SLOTS } from 'plugins/slots'
import { LeftSideBar } from '../../pages/Editor'
import { useAppState } from 'hooks'
import { useEffect } from 'react'
export const SharingPanel = () => {
  const { menu, surveyId } = useParams()
  const shouldHaveRightMargin = menu !== SURVEY_MENU_TITLES.sharingOverview
  const [, setTopbarConfig] = useAppState(STATES.TOPBAR_CONFIG, {})
  const renderCurrentMenu = () => {
    switch (menu) {
      case SURVEY_MENU_TITLES.sharingOverview:
        return <SharingOverview />
      default:
        return null
    }
  }
  useEffect(() => {
    setTopbarConfig({
      surveyId,
      showShareButton: false,
      showShareActionButton: true,
      showAddQuestionButton: false,
      pageName: PAGES.SHARE,
    })
... (28 lines truncated)
</file>

<file path="editor/src/pages/index.js">
export * from './Editor/Editor'
export * from './SharingPanel/SharingPanel'
</file>

<file path="editor/src/plugins/PluginManager.js">
import { pluginRegistry } from 'pluginRegistry'
export class PluginManager {
  static instance = null
  constructor() {
    this.plugins = new Map()
    this.loadPlugins()
  }
  static getInstance() {
    if (!PluginManager.instance) {
      PluginManager.instance = new PluginManager()
    }
    return PluginManager.instance
  }
  loadPlugins() {
    Object.entries(pluginRegistry).forEach(([slot, plugin]) => {
      this.plugins.set(slot, plugin)
    })
  }
  getPlugin(slotName) {
    return this.plugins.get(slotName)
  }
  hasPlugin(slotName) {
    return this.plugins.has(slotName)
  }
}
const pluginManagerInstance = PluginManager.getInstance()
export default pluginManagerInstance
</file>

<file path="editor/src/plugins/pluginRegistry.js">
export const pluginRegistry = {
}
</file>

<file path="editor/src/plugins/PluginSlot.js">
import React, { useMemo } from 'react'
import pluginManagerInstance from './PluginManager'
export const PluginSlot = ({ slotName, fallback = null, ...props }) => {
  const manager = useMemo(() => pluginManagerInstance, [])
  const PluginComponent = useMemo(() => manager.getPlugin(slotName), [slotName])
  if (!PluginComponent) {
    return fallback
  }
  return <PluginComponent {...props} />
}
</file>

<file path="editor/src/plugins/slots.js">
export const PLUGIN_SLOTS = {
  TOP_BAR_RIGHT: 'topbar:right',
  EDITOR_TOP: 'editor:top',
  EDITOR_LAYOUT_EXTRA: 'editor:layout:extra',
  SHARING_PANEL_EXTRA_MENU: 'sharingpanel:extra:menu',
  SURVEY_SETTINGS_BLOCK_TOKENS_BOTTOM: 'surveysettingsblock:tokens:bottom',
  SHARING_OVERVIEW_BOTTOM_LEFT: 'sharingoverview:bottom:left',
  SHARING_OVERVIEW_BOTTOM_RIGHT: 'sharingoverview:bottom:right',
  SHARING_OVERVIEW_CARD_BOTTOM: 'sharingoverview:card:bottom',
  SHARING_OVERVIEW_SOCIAL_MEDIA_CARD_BOTTOM:
    'sharingoverview:socialmediacard:bottom',
  TRANSLATIONS_PANEL: 'translations:panel:content',
  FEEDBACK_FORM_OPEN: 'feedback:form:open',
  CONTENT_EDITOR: 'content:editor:extra',
}
</file>

<file path="editor/src/providers/I18nextProvider.js">
import { useAppState, useAuth, useUserService } from 'hooks'
import { I18nextProvider } from 'react-i18next'
import { STATES } from '../helpers'
import { useEffect, useState } from 'react'
export const I18Provider = ({ i18n, children, language }) => {
  const auth = useAuth()
  const [, setUserDetail] = useAppState(STATES.USER_DETAIL)
  const [languages, setLanguages] = useAppState(STATES.ALL_AVAILABLE_LANGUAGES)
  const userService = useUserService()
  const [i18nInstance, setI18nInstance] = useState(null)
  const [isTranslationLoaded, setIsTranslationLoaded] = useState(false)
  useEffect(() => {
    if (!auth.isLoggedIn || auth.userId == 0 || process.env.STORYBOOK_DEV) {
      setUserDetail({ lang: 'en' })
      setI18nInstance(i18n('en', auth, setLanguages, languages))
      setIsTranslationLoaded(true)
      return
    }
    if (!language) {
      userService.getUserDetail(auth.userId).then((result) => {
        if (!result) {
          return
        }
        setUserDetail(result)
        let lang = result.lang
        if (lang === 'auto') {
          const browserLanguage = navigator.language || navigator.userLanguage
          lang = browserLanguage.substring(0, 2)
          if (!lang) {
            lang = 'en'
... (29 lines truncated)
</file>

<file path="editor/src/providers/index.js">
export * from './I18nextProvider'
</file>

<file path="editor/src/providers/PermissionsProvider.js">
import { useEffect, useState } from 'react'
import { useParams, useLocation } from 'react-router-dom'
import { useAppState, useAuth, useUserService } from 'hooks'
import { STATES } from 'helpers'
export const PermissionsProvider = ({ children }) => {
  const auth = useAuth()
  const { surveyId } = useParams()
  const { pathname } = useLocation()
  const userService = useUserService()
  const [hasSurveyReadPermission, setHasSurveyReadPermission] = useState(false)
  const [loading, setLoading] = useState(true)
  const [error, setError] = useState(null)
  const [hasSurveyUpdatePermission, setHasSurveyUpdatePermission] = useAppState(
    STATES.HAS_SURVEY_UPDATE_PERMISSION,
    false
  )
  const [hasResponsesReadPermission, setHasResponsesReadPermission] =
    useAppState(STATES.HAS_RESPONSES_READ_PERMISSION, false)
  const [hasResponsesUpdatePermission, setHasResponsesUpdatePermission] =
    useAppState(STATES.HAS_RESPONSES_UPDATE_PERMISSION, false)
  const [permissions, setPermissions] = useAppState(
    STATES.USER_PERMISSIONS,
    null
  )
  useEffect(() => {
    const controller = new AbortController()
    setPermissions(null)
    setError(null)
    userService
      .getUserPermissions(surveyId, controller.signal)
... (79 lines truncated)
</file>

<file path="editor/src/sbook/helpers/constants/index.js">
export * from './languages'
</file>

<file path="editor/src/sbook/helpers/constants/languages.js">
export const languages = {
  'af': {
    description: 'Afrikaans',
    nativedescription: 'Afrikaans',
    rtl: false,
    dateformat: 1,
    radixpoint: 1,
    momentjs: 'af',
  },
  'sq': {
    description: 'Albanian',
    nativedescription: 'Shqipe',
    rtl: false,
    dateformat: 1,
    radixpoint: 1,
    momentjs: 'sq',
  },
  'am': {
    description: 'Amharic',
    nativedescription: '&#4768;&#4635;&#4653;&#4763;',
    rtl: false,
    dateformat: 2,
    radixpoint: 1,
    momentjs: null,
  },
  'ar': {
    description: 'Arabic',
    nativedescription: '&#1593;&#1614;&#1585;&#1614;&#1576;&#1610;&#1618;',
    rtl: true,
    dateformat: 2,
... (981 lines truncated)
</file>

<file path="editor/src/sbook/helpers/fixtures/mockEmptyQuestion.js">
export function mockEmptyQuestion(questionTypeInfo) {
  return {
    gid: Math.floor(Math.random() * 10),
    qid: Math.floor(Math.random() * 10),
    sid: Math.floor(Math.random() * 10),
    questionThemeName: questionTypeInfo.theme,
    type: questionTypeInfo.type,
    attributes: {},
  }
}
</file>

<file path="editor/src/sbook/helpers/fixtures/mockQuestion.js">
import { getQuestionTypeInfo } from 'components/QuestionTypes'
import { Direction } from 'react-range'
import { LANGUAGE_CODES } from 'helpers/constants'
const QUESTION_ATTRIBUTES = {
  useSlider: false,
  sliderOrientation: Direction.Right,
  maximumFileSizeAllowed: { value: false },
  public_statistics: {
    value: true,
  },
  minuteStepInterval: {
    value: 2,
  },
  imageAlign: 'center',
  imageBrightness: 1,
}
export function mockQuestion(
  type = getQuestionTypeInfo().ARRAY,
  questionAttributes = QUESTION_ATTRIBUTES
) {
  const attributes = { ...QUESTION_ATTRIBUTES, ...questionAttributes }
  return {
    gid: 1,
    qid: 1,
    sid: 1,
    type,
    l10ns: {
      en: {
        id: 1,
        language: LANGUAGE_CODES.EN,
... (28 lines truncated)
</file>

<file path="editor/src/sbook/helpers/fixtures/mockQuestionType.js">
import { LANGUAGE_CODES } from 'helpers/constants'
import { mockQuestion } from './mockQuestion'
export function mockQuestionType(questionTypeInfo, attrs = {}) {
  const question = mockQuestion(questionTypeInfo, attrs)
  question.l10ns = {
    en: {
      id: 1,
      language: LANGUAGE_CODES.EN,
      qid: 1,
      question: questionTypeInfo.title,
      script: '',
    },
  }
  question.questionThemeName = questionTypeInfo.theme
  question.type = questionTypeInfo.type
  return question
}
</file>

<file path="editor/src/sbook/helpers/fixtures/mockQuestionTypeWithSettings.js">
import { mockQuestionType } from './mockQuestionType'
export function mockQuestionTypeWithSettings(questionTypeInfo, attrs = {}) {
  const question = mockQuestionType(questionTypeInfo, attrs)
  question.surveySettings = {
    showNoAnswer: true,
    preselectNoAnswer: false,
  }
  return question
}
</file>

<file path="editor/src/sbook/helpers/fixtures/QuestionPreview.js">
import { Col, Row } from 'react-bootstrap'
import { LANGUAGE_CODES } from 'helpers/constants'
import { Question } from 'components/Survey/Questions/Question'
import { useState } from 'react'
import { QuestionSettings } from 'components/QuestionSettings/QuestionSettings'
const SURVEY_ID = '78f91e52-6028-11ed-82e1-7ac846e3af9d'
export function QuestionPreview({
  question,
  surveySettings = {},
  showAttributesTogether = true,
}) {
  const [questions, setQuestions] = useState([question])
  const handleQuestionUpdate = (value, index) => {
    const updatedQuestions = [...questions]
    updatedQuestions[index] = {
      ...updatedQuestions[index],
      ...value,
    }
    setQuestions(updatedQuestions)
  }
  const handleDuplicate = (index) => {
    setQuestions([...questions, questions[index]])
  }
  const handleRemove = (index) => {
    if (index === 0) {
      alert("You can't delete the first question")
    } else {
      setQuestions(questions.filter((_, idx) => idx !== index))
    }
  }
... (31 lines truncated)
</file>

<file path="editor/src/sbook/helpers/fixtures/StoryOutput.js">
export const StoryOutput = ({ output }) => {
  return (
    <div className="mt-3">
      <h3>
        <b>Value</b>: <span data-testid="output">{output}</span>
      </h3>
    </div>
  )
}
</file>

<file path="editor/src/sbook/helpers/fixtures/StoryWrapper.js">
import { useNavigate } from 'react-router-dom'
import React, { useEffect } from 'react'
import { STATES } from 'helpers'
import { useAppState, useSurvey } from 'hooks'
import { languages } from '../constants'
export const StoryWrapper = ({ Story, context }) => {
  const { survey, update } = useSurvey()
  const navigate = useNavigate()
  const [, setUserDetails] = useAppState(STATES.USER_DETAIL)
  const [, setActiveLanguage] = useAppState(STATES.ACTIVE_LANGUAGE, 'en')
  const [siteSettings = {}, setSiteSettings] = useAppState(
    STATES.SITE_SETTINGS,
    { siteName: 'LimeSurvey', timezone: 'UTC', languages }
  )
  const [, setHasSurveyUpdatePermission] = useAppState(
    STATES.HAS_SURVEY_UPDATE_PERMISSION,
    true
  )
  const [, setSurveyGroups] = useAppState(STATES.SURVEY_GROUPS, {})
  const [allLanguages, setAllAvailableLanguages] = useAppState(
    STATES.ALL_AVAILABLE_LANGUAGES,
    {
      en: {
        en: {
          description: 'English',
          nativedescription: 'English',
        },
      },
    }
  )
... (32 lines truncated)
</file>

<file path="editor/src/sbook/helpers/functions/waitFor.js">
import { waitFor as storybookWaitFor } from 'storybook/test'
export const waitFor = (callback, options = { timeout: 10000 }) => {
  return storybookWaitFor(callback, { ...options })
}
</file>

<file path="editor/src/sbook/index.js">
export * from './helpers/functions/waitFor'
</file>

<file path="editor/src/services/auth.service.js">
import axios from 'axios'
import { handleAxiosError } from 'helpers/network/axiosErrorHandler'
export class AuthService {
  constructor(baseUrl) {
    this.baseurl = baseUrl
  }
  login = async (username, password) => {
    try {
      const res = await axios.post(`${this.baseurl}/auth`, {
        username,
        password,
      })
      return res.data
    } catch (error) {
      handleAxiosError(error)
    }
  }
  refresh = async (headers) => {
    try {
      const res = await axios.put(
        `${this.baseurl}/auth`,
        {},
        {
          headers,
        }
      )
      return res.data
    } catch (error) {
      handleAxiosError(error)
    }
... (13 lines truncated)
</file>

<file path="editor/src/services/expressionScriptValidation.service.js">
import { RestClient } from './restClient.service'
export class ExpressionScriptValidationService {
  constructor(auth, surveyId, baseUrl) {
    this.surveyId = surveyId
    this.restClient = new RestClient(baseUrl, auth.restHeaders)
  }
  validate = async (expression, questionId, signal) => {
    return await this.restClient.post(
      `expression-script-validation/${this.surveyId}`,
      { expression, questionId },
      {},
      true,
      { signal }
    )
  }
}
</file>

<file path="editor/src/services/file.service.js">
import { RestClient } from './restClient.service'
export class FileService {
  constructor(auth, baseUrl, surveyId) {
    this.auth = auth
    this.surveyId = surveyId
    this.baseurl = baseUrl
    this.restClient = new RestClient(baseUrl, auth.restHeaders)
  }
  uploadSurveyImage = async (data) => {
    return await this.restClient.post(
      `${this.baseurl}/file-upload-survey-image/${this.surveyId}`,
      data,
      {},
      true
    )
  }
}
</file>

<file path="editor/src/services/index.js">
export * from './auth.service'
export * from './file.service'
export * from './siteSettings.service'
export * from './surveyGroups.service'
export * from './survey.service'
export * from './surveyImport.service'
export * from './surveyArchive.service'
export * from './surveyLogic.service'
export * from './expressionScriptValidation.service'
export * from './restClient.service'
export * from './translations.service'
export * from './user.service'
export * from './responses.service'
export * from './versionInfo.service'
export * from './statistics.service'
export * from './userSettings.service'
</file>

<file path="editor/src/services/responses.service.js">
import { RestClient } from './restClient.service'
export class ResponseService {
  constructor(auth, surveyId, baseUrl) {
    this.auth = auth
    this.surveyId = surveyId
    this.baseurl = baseUrl
    this.restClient = new RestClient(baseUrl, auth.restHeaders)
  }
  patchResponses = async (patch) => {
    return await this.restClient.patch(`/survey-responses/${this.surveyId}`, {
      patch,
    })
  }
  getSurveyResponses = async (
    sid,
    options = {
      pagination: { pageIndex: 0, pageSize: 10 },
      filters: [],
      sorting: [],
    }
  ) => {
    const {
      pagination = { pageIndex: 0, pageSize: 10 },
      filters = [],
      sorting = [],
    } = options
    const body = {
      page: {
        currentPage: pagination.pageIndex,
        pageSize: pagination.pageSize,
... (45 lines truncated)
</file>

<file path="editor/src/services/restClient.service.js">
import axios from 'axios'
import { handleAxiosError } from 'helpers/network/axiosErrorHandler'
export class RestClient {
  constructor(baseUrl, restHeaders) {
    this.restHeaders = restHeaders
    this.client = axios.create({
      baseURL: baseUrl,
      headers: restHeaders,
    })
  }
  async get(
    endpoint,
    additionalHeaders = {},
    signal,
    canThrowError = false,
    params
  ) {
    try {
      const response = await this.client.get(endpoint, {
        headers: { ...this.restHeaders, ...additionalHeaders },
        params,
        signal,
      })
      return response.data
    } catch (error) {
      return handleAxiosError(error, { throwError: canThrowError })
    }
  }
  async post(
    endpoint,
... (57 lines truncated)
</file>

<file path="editor/src/services/siteSettings.service.js">
import axios from 'axios'
import { handleAxiosError } from 'helpers/network/axiosErrorHandler'
export class SiteSettingsService {
  constructor(baseUrl) {
    this.baseurl = baseUrl
  }
  getSiteData = async () => {
    try {
      const response = await axios.get(`${this.baseurl}/site-settings`)
      return response.data
    } catch (error) {
      handleAxiosError(error)
    }
  }
}
</file>

<file path="editor/src/services/statistics.service.js">
import {
  QT_O_LIST_WITH_COMMENT,
  QT_P_MULTIPLE_CHOICE_WITH_COMMENTS,
} from 'helpers'
import { RestClient } from './restClient.service'
const belongsToQuestion = (answer, questionCode) =>
  String(answer?.title) === String(questionCode)
const buildResponseFilters = ({ completed, minId, maxId } = {}) => {
  const filters = []
  if (typeof completed === 'boolean') {
    filters.push({
      key: 'completed',
      filterMethod: 'equal',
      value: String(completed),
    })
  }
  let min = typeof minId === 'number' ? minId : ''
  const max = typeof maxId === 'number' ? maxId : ''
  if (min !== '' && max !== '' && min > max) {
    min = max
  }
  if (min !== '' || max !== '') {
    filters.push({ key: 'id', filterMethod: 'range', value: [min, max] })
  }
  return filters
}
const buildAnswerFilters = (
  selectedAnswer,
  fields,
  questionType,
... (292 lines truncated)
</file>

<file path="editor/src/services/survey.service.js">
import axios from 'axios'
import { RestClient } from './restClient.service'
export class SurveyService {
  constructor(auth, surveyId, baseUrl) {
    this.auth = auth
    this.surveyId = surveyId
    this.baseurl = baseUrl
    this.restClient = new RestClient(baseUrl, auth.restHeaders)
  }
  patchSurvey = async (buffer) => {
    return await this.restClient.patch(
      `/survey-detail/${this.surveyId}`,
      {
        patch: buffer,
      },
      true
    )
  }
  getSurveyList = async (page = 1, pageSize = 10) => {
    return await this.restClient.get(`/survey`, {
      params: { page, pageSize },
    })
  }
  getSurveyDetail = async (id, signal, lastRequestedAt = null) => {
    const url = lastRequestedAt
      ? `survey-detail/${id}/ts/${lastRequestedAt}`
      : `survey-detail/${id}`
    return await this.restClient.get(url, {}, signal)
  }
  getSurveyQuestionsFieldname = async (sid, signal) => {
... (15 lines truncated)
</file>

<file path="editor/src/services/surveyArchive.service.js">
import { RestClient } from './restClient.service'
export class SurveyArchiveService {
  constructor(auth, surveyId, baseUrl) {
    this.auth = auth
    this.surveyId = surveyId
    this.baseurl = baseUrl
    this.restClient = new RestClient(baseUrl, auth.restHeaders)
  }
  getSurveyArchives = async (sid, signal) => {
    return await this.restClient.get(`survey-archives/${sid}`, {}, signal)
  }
  getSurveyArchivesByBaseTable = async (sid, basetable, signal) => {
    let result = await this.restClient.get(`survey-archives/${sid}`, {}, signal)
    return result.filter((item) => item.types.indexOf(basetable) >= 0)
  }
}
</file>

<file path="editor/src/services/surveyGroups.service.js">
import { RestClient } from './restClient.service'
export class SurveyGroupsService {
  constructor(auth, surveyId, baseUrl) {
    this.auth = auth
    this.surveyId = surveyId
    this.baseurl = baseUrl
    this.restClient = new RestClient(baseUrl, auth.restHeaders)
  }
  getSurveyGroups = async () => {
    return await this.restClient.get(`${this.baseurl}/survey-groups`)
  }
}
</file>

<file path="editor/src/services/surveyImport.service.js">
import { RestClient } from './restClient.service'
export class SurveyImportService {
  constructor(auth, baseUrl) {
    this.restClient = new RestClient(baseUrl, auth.restHeaders)
  }
  importSurvey = async ({ convertResourceLinks, file, groupStrategy }) => {
    const formData = new FormData()
    formData.append('file', file, file.name)
    formData.append('surveysgroup', groupStrategy)
    formData.append('translinksfields', convertResourceLinks ? '1' : '0')
    return await this.restClient.post('/survey-import', formData, {}, true)
  }
}
</file>

<file path="editor/src/services/surveyLogic.service.js">
import { RestClient } from './restClient.service'
export class SurveyLogicService {
  constructor(auth, surveyId, baseUrl) {
    this.auth = auth
    this.surveyId = surveyId
    this.baseurl = baseUrl
    this.restClient = new RestClient(baseUrl, auth.restHeaders)
  }
  getSurveyLogic = async (sid, { gid, qid, language } = {}, signal) => {
    const params = {}
    if (gid != null) params.gid = gid
    if (qid != null) params.qid = qid
    if (language) params.lang = language
    return await this.restClient.get(
      `survey-logic/${sid}`,
      {},
      signal,
      true,
      params
    )
  }
}
</file>

<file path="editor/src/services/translations.service.js">
import { RestClient } from './restClient.service'
export class TranslationsService {
  constructor(auth, baseUrl) {
    this.auth = auth
    this.baseurl = baseUrl
    this.restClient = new RestClient(baseUrl, auth.restHeaders)
    this.sentMissingKeys = new Set()
    this.pendingMissingKeys = new Set()
    this.debounceTimer = null
  }
  getTranslations = async (id) => {
    if (this.auth.userId) {
      return await this.restClient.get(`/i18n/${id}`, {}, undefined, true)
    }
  }
  getAllLanguages = async (id) => {
    if (this.auth.userId) {
      return await this.restClient.get(
        `/i18n-refresh-languages/${id}`,
        {},
        undefined,
        true
      )
    }
  }
  saveMissingKeys = async (keyObjs) => {
    if (process.env.NODE_ENV === 'development' && this.auth.userId) {
      const newKeys = keyObjs.filter(
        (keyObj) =>
          !this.sentMissingKeys.has(keyObj.key) &&
... (24 lines truncated)
</file>

<file path="editor/src/services/user.service.js">
import { RestClient } from './restClient.service'
export class UserService {
  constructor(auth, userId, baseUrl) {
    this.auth = auth
    this.userId = userId
    this.baseurl = baseUrl
    this.restClient = new RestClient(baseUrl, auth.restHeaders)
  }
  getUserDetail = async (id) => {
    return await this.restClient.get(`user-detail/${id}`)
  }
  getUserPermissions = async (surveyId, signal) => {
    return await this.restClient.get('user-permissions', {}, signal, false, {
      surveyId,
    })
  }
}
</file>

<file path="editor/src/services/userSettings.service.js">
import { RestClient } from './restClient.service'
export class UserSettingsService {
  constructor(auth, baseUrl) {
    this.auth = auth
    this.baseurl = baseUrl
    this.restClient = new RestClient(baseUrl, auth.restHeaders)
  }
  getUserSettingByName = async (settingName) => {
    return await this.restClient.get(
      `${this.baseurl}/user-setting/${settingName}`
    )
  }
  setUserSettingByName = async (settingName, settingValue) => {
    return await this.restClient.post(`${this.baseurl}/user-setting`, {
      settingName,
      settingValue,
    })
  }
}
</file>

<file path="editor/src/services/versionInfo.service.js">
import axios from 'axios'
export class VersionInfoService {
  constructor(baseUrl) {
    this.baseurl = baseUrl
  }
  getVersionInfo = async () => {
    return await axios.get(`${this.baseurl}/version-info`)
  }
}
</file>

<file path="editor/src/shared/BrandedQRCode.js">
import React, { useRef } from 'react'
import { QRCode } from 'react-qrcode-logo'
import downloadArrowIcon from 'assets/icons/download-arrow.svg'
import lsIcon from 'assets/icons/limesurvey_logo.svg'
import { downloadCanvasAsImage, errorToast } from 'helpers'
export const BrandedQRCode = ({
  value = 'https://www.limesurvey.org/',
  previewSize = 150,
  previewPixelRatio = 3,
  previewQuietZone = 10,
  downloadTotal = 600,
  downloadQuietZone = 16,
  logoFraction = 0.2,
  ecLevel = 'Q',
  logoOpacity = 1,
  logoPadding = 4,
  logoPaddingStyle = 'square',
  removeQrCodeBehindLogo = true,
  qrStyle = 'fluid',
  eyeRadius = [
    { outer: [10, 10, 10, 10], inner: [0, 0, 0, 0] },
    { outer: [10, 10, 10, 10], inner: [0, 0, 0, 0] },
    { outer: [10, 10, 10, 10], inner: [0, 0, 0, 0] },
  ],
  eyeColor = {
    outer: '#000000',
    inner: '#25c267',
  },
  fgColor = '#000000',
  bgColor = '#ffffff',
... (69 lines truncated)
</file>

<file path="editor/src/shared/getPlaceholdersConfig.js">
export const getPlaceholdersConfig = () => ({
  questionTitlePlaceholder: t('Your question here'),
})
</file>

<file path="editor/src/shared/getPublicationAccessSettingsBlocks.js">
import { DateTimePickerComponent, ToggleButtons } from 'components/UIComponents'
import { getOnOffOptions, ONOFF_BOOLEAN } from 'helpers/options'
import getSiteUrl from 'helpers/getSiteUrl'
export const getPublicationAccessSettingsBlocks = () => ({
  DATE: {
    title: t('Publication date'),
    settings: {
      START_DATE: {
        keyPath: 'startDate',
        props: {
          id: 'start-date-time',
          mainText: t('Start date/time'),
          childComponent: DateTimePickerComponent,
          childOnNewLine: true,
          noPermissionDisabled: true,
        },
      },
      EXPIRES: {
        keyPath: 'expires',
        props: {
          id: ' end-date-time',
          mainText: t('End date/time'),
          childComponent: DateTimePickerComponent,
          noPermissionDisabled: true,
          childOnNewLine: true,
        },
      },
    },
  },
  ACCESS: {
... (56 lines truncated)
</file>

<file path="editor/src/shared/getSharingPanels.js">
import { SurveyStructureIcon } from 'components/icons'
import { SURVEY_MENU_TITLES } from 'helpers'
export const getSharingPanels = () => {
  return {
    sharing: {
      label: t('Share survey'),
      panel: 'sharing',
      icon: SurveyStructureIcon,
      defaultMenu: SURVEY_MENU_TITLES.sharingOverview,
    },
  }
}
</file>

<file path="editor/src/shared/getSurveyPanelConfig.js">
import {
  SurveyMenuIcon,
  SurveyPermissionsIcon,
  SurveyPresentationIcon,
  SurveySettingsIcon,
  SurveyStructureIcon,
  SurveyTranslationIcon,
} from 'components/icons'
import { getSiteUrl, SURVEY_MENU_TITLES } from 'helpers'
export const getSurveyPanelConfig = () => {
  return {
    structure: {
      label: t('Structure'),
      panel: 'structure',
      icon: SurveyStructureIcon,
    },
    settings: {
      label: t('Settings'),
      panel: 'settings',
      defaultMenu: SURVEY_MENU_TITLES.generalSettings,
      icon: SurveySettingsIcon,
    },
    presentation: {
      label: t('Presentation'),
      panel: 'presentation',
      defaultMenu: SURVEY_MENU_TITLES.themeOptions,
      icon: SurveyPresentationIcon,
    },
    menu: {
      label: t('Menu'),
... (27 lines truncated)
</file>

<file path="editor/src/shared/sharingPanelOptions.js">
import { getSiteUrl, SURVEY_MENU_TITLES } from 'helpers'
import { getSharingPanels } from './getSharingPanels'
export const sharingOptions = (surveyId) => [
  {
    labelEditor: t('Sharing overview'),
    menu: SURVEY_MENU_TITLES.sharingOverview,
  },
  {
    labelEditor: t('Participant lists'),
    menu: SURVEY_MENU_TITLES.participantsList,
    redirect: getSiteUrl(`/admin/tokens/sa/index/surveyid/${surveyId}`),
  },
]
export const getSharingPanelOptions = (surveyId) => {
  const sharingPanels = getSharingPanels()
  return {
    [sharingPanels.sharing?.panel]: sharingOptions(surveyId),
  }
}
</file>

<file path="editor/src/shared/translationPanelOptions.js">
import { getSiteUrl, SURVEY_MENU_TITLES } from 'helpers'
export const translationsPanelOptions = (surveyId) => [
  {
    labelEditor: t('Quick translations'),
    menu: SURVEY_MENU_TITLES.quickTranslations,
    redirect: getSiteUrl(`/quickTranslation/index?surveyid=${surveyId}`),
  },
]
</file>

<file path="editor/src/App.js">
import React, { useEffect } from 'react'
import ThemeProvider from 'react-bootstrap/ThemeProvider'
import { PersistQueryClientProvider } from '@tanstack/react-query-persist-client'
import { ReactQueryDevtools } from '@tanstack/react-query-devtools'
import { queryClient, persistOptions } from 'queryClient'
import 'bootstrap/dist/css/bootstrap.min.css'
import 'themes/index.scss'
import { VersionInfoService } from 'services'
import { getApiUrl, URLS } from 'helpers'
import { RouterProvider } from 'react-router-dom'
import { I18Provider } from './providers/I18nextProvider'
import { i18nInstance } from 'i18nInit'
import routes from 'routes'
import {
  AppErrorBoundary,
  withAppProfiler,
  initInstrumentation,
  createRouter,
} from 'appInstrumentation'
initInstrumentation()
const router = createRouter(routes)
function App() {
  useEffect(() => {
    const fetchVersionInfoInterval = setInterval(() => {
      const versionInfoService = new VersionInfoService(getApiUrl())
      versionInfoService
        .getVersionInfo()
        .then(({ data: { needsDbUpdate } }) => {
          if (needsDbUpdate) {
            alert(
... (38 lines truncated)
</file>

<file path="editor/src/appInstrumentation.js">
import React from 'react'
import { createHashRouter } from 'react-router-dom'
export const createRouter = (routes) => {
  return createHashRouter(routes)
}
export const AppErrorBoundary = ({ children }) => {
  return <>{children}</>
}
export const withAppProfiler = (Component) => {
  return Component
}
export const initInstrumentation = () => {}
export const reportExtras = ({ extraData, message }) => {}
export const addBreadcrumb = ({ category, message, data, level }) => {}
</file>

<file path="editor/src/config.js">
export const config = {
  siteName: 'LimeSurvey',
  api: {
    baseURL: 'http://ls-ce/rest/v2',
    timeout: 5000,
  },
}
export default config
</file>

<file path="editor/src/i18next.test.js">
const fs = require('fs')
const path = require('path')
const babelParser = require('@babel/parser')
const traverse = require('@babel/traverse').default
const generate = require('@babel/generator').default
function getExcludedFiles() {
  return [
    'node_modules',
    'dist',
    'build',
    'test',
    'tests',
    'i18next.test.js',
    'App.js',
    'Home.js',
    '.stories.js',
    'I18nextProvider.js',
    'StoryOutput.js',
    'StoryWrapper.js',
    'getLabelWrapperWidthOptions.js',
    'getColumnWidthOptions.js',
    'constants.js',
    'languages.js',
    'survey-detail.json',
    'helpers',
    'panelOptions.js',
    'getThemeOptionsSettingsBlocks.js',
    'components/SurveySettings/Settings/themeOptionTypes',
  ]
}
... (328 lines truncated)
</file>

<file path="editor/src/i18nInit.js">
import Backend from 'i18next-chained-backend'
import LocalStorageBackend from 'i18next-localstorage-backend'
import CustomI18nBackend from 'i18n/CustomI18nBackend'
import { getApiUrl } from 'helpers'
import { TranslationsService } from 'services'
import i18next from 'i18next'
export const i18nInstance = (
  lang = '',
  auth = {},
  setLanguages = () => {},
  languages = [],
  isSurveyTranslation = false
) => {
  const translationsService = new TranslationsService(auth, getApiUrl())
  const i18nInstance = i18next.createInstance()
  if (process.env.STORYBOOK_DEV || process.env.REACT_APP_DEMO_MODE === 'true') {
    global.st = i18nInstance.t.bind(i18nInstance)
    global.t = i18nInstance.t.bind(i18nInstance)
    i18nInstance.init({
      lng: lang,
      fallbackLng: 'en',
      debug: false,
      resources: {
        en: {},
      },
      interpolation: { escapeValue: false },
    })
    return i18nInstance
  } else {
    if (isSurveyTranslation) {
... (29 lines truncated)
</file>

<file path="editor/src/index.js">
import ReactDOM from 'react-dom/client'
import App from './App'
import reportWebVitals from './reportWebVitals'
const root = ReactDOM.createRoot(document.getElementById('root'))
root.render(<App />)
reportWebVitals(console.log)
</file>

<file path="editor/src/queryClient.js">
import { QueryClient, defaultShouldDehydrateQuery } from '@tanstack/react-query'
import { createSyncStoragePersister } from '@tanstack/query-sync-storage-persister'
const millisecondsPerDay = 1000 * 60 * 60 * 24
const persistenceMaxAgeMilliseconds = millisecondsPerDay * 30
export const queryClient = new QueryClient({
  defaultOptions: {
    queries: {
      refetchOnWindowFocus: true,
      staleTime: Infinity,
      cacheTime: persistenceMaxAgeMilliseconds,
    },
  },
})
const persister = createSyncStoragePersister({
  storage: process.env.NODE_ENV === 'test' ? null : window.localStorage,
  serialize: (data) => {
    return JSON.stringify(data)
  },
  deserialize: (data) => {
    return JSON.parse(data)
  },
})
const commitHash = process.env.REACT_APP_COMMIT_HASH
  ? process.env.REACT_APP_COMMIT_HASH
  : ''
export const persistOptions = {
  persister,
  buster: process.env.REACT_APP_RELEASE + '-' + commitHash.substring(0, 10),
  dehydrateOptions: {
    shouldDehydrateQuery: (query) => {
... (9 lines truncated)
</file>

<file path="editor/src/reportWebVitals.js">
const reportWebVitals = (onPerfEntry) => {
  if (onPerfEntry && onPerfEntry instanceof Function) {
    import('web-vitals').then(({ onCLS, onINP, onFCP, onLCP, onTTFB }) => {
      onCLS(onPerfEntry)
      onINP(onPerfEntry)
      onFCP(onPerfEntry)
      onLCP(onPerfEntry)
      onTTFB(onPerfEntry)
    })
  }
}
export default reportWebVitals
</file>

<file path="editor/src/routes.js">
import { Outlet } from 'react-router-dom'
import { Editor } from 'pages'
import AuthGate from 'components/AuthGate'
import { Unauthorized, NotFound } from './pages/Errors'
import { Responses } from 'pages/Responses/Responses'
import { SharingPanel } from 'pages/SharingPanel/SharingPanel'
import { EditorContextController, SurveyWorkspace } from 'components'
import { PermissionsProvider } from 'providers/PermissionsProvider'
import { TopBar } from 'components/TopBar'
import { useAppState } from 'hooks'
import { STATES } from 'helpers'
const RootLayout = () => {
  const [topbarConfig] = useAppState(STATES.TOPBAR_CONFIG)
  return (
    <>
      {topbarConfig && <TopBar {...topbarConfig} />}
      <Outlet />
    </>
  )
}
const routes = [
  {
    element: <RootLayout />,
    children: [
      ...(process.env.REACT_APP_DEMO_MODE === 'true'
        ? [
            {
              path: '/survey',
              element: (
                <AuthGate>
... (60 lines truncated)
</file>

<file path="editor/src/setupTests.js">
import '@testing-library/jest-dom'
import { TextEncoder, TextDecoder } from 'util'
global.IS_REACT_ACT_ENVIRONMENT = true
global.TextEncoder = TextEncoder
global.TextDecoder = TextDecoder
globalThis.t = () => {}
globalThis.st = () => {}
global.IntersectionObserver = class {
  constructor() {}
  observe() {}
  unobserve() {}
  disconnect() {}
}
global.ResizeObserver = class {
  constructor() {}
  observe() {}
  unobserve() {}
  disconnect() {}
}
window.scrollTo = jest.fn()
window.matchMedia = jest.fn()
jest.mock('sweetalert2-react-content', () => {
  return {
    __esModule: true,
    default: () => ({
      fire: jest.fn(() =>
        Promise.resolve({
          isConfirmed: true,
        })
      ),
... (12 lines truncated)
</file>

<file path="editor/.env">
# https://create-react-app.dev/docs/adding-custom-environment-variables/
HTTPS=
HOST=
BUILD_PATH=./build
PUBLIC_URL=/editor
REACT_APP_NAME=${npm_package_name}
REACT_APP_VERSION=${npm_package_version}
REACT_APP_RELEASE=${npm_package_name}@${npm_package_version}
REACT_APP_DEMO_MODE=
REACT_APP_DEV_MODE=
REACT_APP_API_BASE_URL=
REACT_APP_SITE_URL=
REACT_APP_FEEDBACK_POPUP_DELAY_MINS=1
REACT_APP_FEEDBACK_POPUP_INTERVAL_MINS=120
</file>

<file path="editor/.eslintrc.json">
{
  "root": true,
  "settings": {
    "react": {
      "version": "detect"
    }
  },
  "env": {
    "node": true,
    "browser": true,
    "es2021": true,
    "jest/globals": true
  },
  "extends": ["eslint:recommended", "plugin:react/recommended", "plugin:storybook/recommended"],
  "parserOptions": {
    "ecmaVersion": "latest",
    "sourceType": "module"
  },
  "overrides": [
    {
      // or whatever matches stories specified in .storybook/main.js
      "files": ["**/*.stories.@(ts|tsx|js|jsx|mjs|cjs)"],
      "rules": {
        // example of overriding a rule
        "storybook/hierarchy-separator": "error",
        // example of disabling a rule
        "storybook/default-exports": "off"
      }
    }
  ],
... (20 lines truncated)
</file>

<file path="editor/.prettierrc.json">
{
  "printWidth": 80,
  "tabWidth": 2,
  "useTabs": false,
  "semi": false,
  "singleQuote": true,
  "quoteProps": "consistent",
  "jsxSingleQuote": false,
  "trailingComma": "es5",
  "bracketSpacing": true,
  "bracketSameLine": false,
  "arrowParens": "always",
  "proseWrap": "always",
  "htmlWhitespaceSensitivity": "ignore",
  "endOfLine": "lf"
}
</file>

<file path="editor/babel.config.cjs">
module.exports = {
    presets: [
      '@babel/preset-env',
      ['@babel/preset-react', {runtime: 'automatic'}],
    ],
  };
</file>

<file path="editor/build.cjs">
#!/usr/bin/env node
'use strict';

const { execSync } = require('child_process');
const fs = require('fs');
const { name: pkgName, version: pkgVersion } = require('./package.json');

const commitHash = execSync('git rev-parse HEAD').toString().trim();
process.env.REACT_APP_COMMIT_HASH = commitHash;

execSync('rsbuild build', { stdio: 'inherit' });

if (process.platform !== 'win32' && fs.existsSync('postbuild.sh')) {
    execSync('bash postbuild.sh', { stdio: 'inherit' });
}
</file>

<file path="editor/index.html">
<!DOCTYPE html>
<html lang="en">
  <head>
    <script>
      globalThis.t = () => {}
      globalThis.st = () => {}
    </script>
    <meta charset="utf-8" />
    <link rel="icon" href="build/favicon.ico" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta name="theme-color" content="#000000" />
    <meta
      name="description"
      content="Limesurvey Editor"
    />
    <link rel="manifest" href="build/manifest.json" />
    <link
      href="build/remixicon/remixicon.css"
      rel="stylesheet"
    />
    <title>LimeSurvey - Editor</title>
  <link rel="icon" href="build/favicon.ico"><script defer src="build/static/js/lib-react.921b21ad.js"></script><script defer src="build/static/js/lib-router.0cdc4daf.js"></script><script defer src="build/static/js/lib-axios.3b7ba2f5.js"></script><script defer src="build/static/js/lib-polyfill.57770fb6.js"></script><script defer src="build/static/js/290.83c0d9fd.js"></script><script defer src="build/static/js/index.0ea53ec6.js"></script><link href="build/static/css/290.cee11549.css" rel="stylesheet"><link href="build/static/css/index.fb44392a.css" rel="stylesheet"></head>
  <body>
    <noscript>You need to enable JavaScript to run this app.</noscript>
    <div id="root"></div>
  </body>
</html>
</file>

<file path="editor/jest.config.cjs">
module.exports = {
  testEnvironment: 'jsdom',
  testTimeout: 30000,
  transform: {
    '^.+\\.[j]s?$': 'babel-jest',
  },
  moduleNameMapper: {
    // Stub static asset imports
    '\\.(jpg|jpeg|png|gif|webp)$': '<rootDir>/__mocks__/fileMock.cjs',
    '\\.svg$': '<rootDir>/__mocks__/svgMock.cjs',
    // SVG with ?raw query (Vite/rsbuild) - returns raw string
    '\\.svg\\?raw$': '<rootDir>/__mocks__/rawSvgMock.cjs',
    '\\.(css|less|scss|sass)$': 'identity-obj-proxy',
    '^/(.*)$': '<rootDir>/src/$1',
    'pluginRegistry': '<rootDir>/src/plugins/pluginRegistry',
  },
  transformIgnorePatterns: [
    '/node_modules/(?!(react-leaflet|react-google-maps|dayjs|@mui|@babel/runtime|@react-leaflet|copy-text-to-clipboard)/)',
  ],
  moduleDirectories: ['node_modules', 'src'],
  setupFilesAfterEnv: ['<rootDir>/src/setupTests.js'],
  globalTeardown: '<rootDir>/src/tests/teardown.cjs',
}
</file>

<file path="editor/jsconfig.json">
{
  "compilerOptions": {
    "baseUrl": "src"
  },
  "include": ["src"]
}
</file>

<file path="editor/package.json">
{
  "name": "limesurvey-editor",
  "version": "1.0.11",
  "homepage": ".",
  "private": true,
  "type": "module",
  "dependencies": {
    "@codemirror/autocomplete": "^6.18.6",
    "@codemirror/lang-html": "^6.4.9",
    "@codemirror/lang-javascript": "^6.2.3",
    "@codemirror/language": "^6.11.2",
    "@codemirror/view": "^6.38.1",
    "@emotion/react": "^11.11.1",
    "@emotion/styled": "^11.11.0",
    "@fortawesome/fontawesome-free": "^6.7.2",
    "@mui/material": "^5.13.7",
    "@mui/x-date-pickers": "^6.9.2",
    "@tanstack/query-sync-storage-persister": "^5.0.5",
    "@tanstack/react-query": "^5.0.5",
    "@tanstack/react-query-devtools": "^5.4.2",
    "@tanstack/react-query-persist-client": "^5.0.5",
    "@tanstack/react-table": "^8.21.2",
    "@tinymce/tinymce-react": "^6.0.0",
    "@uiw/react-codemirror": "^4.23.10",
    "axios": "^1.20.0",
    "bootstrap": "^5.2.3",
    "bowser": "^2.11.0",
    "classnames": "^2.5.1",
    "copy-text-to-clipboard": "^3.1.0",
    "date-fns": "^4.1.0",
... (132 lines truncated)
</file>

<file path="editor/README.md">
# LimeSurvey Editor — Frontend Architecture

> **Source of Truth** for the React editor SPA. This document covers project
> structure, state management, core hooks, the survey update pipeline, and
> styling conventions. It is aimed at developers who are new to this codebase
> but already comfortable with React.

---

## Table of Contents

1. [Project Overview & Tech Stack](#1-project-overview--tech-stack)
2. [Prerequisites & Running the App](#2-prerequisites--running-the-app)
3. [Project Structure](#3-project-structure)
4. [State Management](#4-state-management)
5. [Core Hooks](#5-core-hooks)
6. [Buffer & Survey Update Pipeline](#6-buffer--survey-update-pipeline)
7. [Styling Strategy](#7-styling-strategy)

---

## 1. Project Overview & Tech Stack

The LimeSurvey Editor is a single-page application (SPA) that powers the survey
builder, response viewer, and sharing panel. It is embedded inside the
LimeSurvey PHP backend and communicates with a REST v2 API.

**Key characteristics:**

- **Hash-based routing** (`createHashRouter`) — the PHP backend owns the URL;
... (579 lines truncated)
</file>

<file path="editor/rsbuild.config.js">
import { defineConfig, loadEnv } from '@rsbuild/core'
import { pluginEslint } from '@rsbuild/plugin-eslint'
import { pluginReact } from '@rsbuild/plugin-react'
import { pluginSass } from '@rsbuild/plugin-sass'
import { pluginSvgr } from '@rsbuild/plugin-svgr'
const { publicVars, rawPublicVars } = loadEnv({
  prefixes: ['REACT_APP_', 'HTTPS', 'HOST', 'PORT', 'PUBLIC_URL'],
})
const isProduction = process.env.NODE_ENV === 'production'
const isDevBuild =
  !isProduction ||
  process.env.REACT_APP_DEV_MODE === 'true' ||
  process.env.REACT_APP_DEMO_MODE === 'true'
const buildInfoMessage =
  `\x1b[1m${isDevBuild ? '\x1b[33m' : '\x1b[32m'}\n` +
  '================================================================================\n' +
  ` NODE_ENV=${process.env.NODE_ENV}\n` +
  ` REACT_APP_DEV_MODE=${process.env.REACT_APP_DEV_MODE ?? 'undefined'}\n` +
  ` REACT_APP_DEMO_MODE=${process.env.REACT_APP_DEMO_MODE ?? 'undefined'}\n` +
  (isDevBuild ? ' DO NOT deploy this build to production.\n' : '') +
  '================================================================================\n' +
  '\x1b[0m'
export default defineConfig({
  plugins: [
    {
      name: 'build-info',
      setup(api) {
        api.onAfterBuild(() => console.log(buildInfoMessage))
        api.onAfterStartDevServer(() => console.log(buildInfoMessage))
      },
... (80 lines truncated)
</file>

<file path="editor/start.cjs">
#!/usr/bin/env node
'use strict';

const { execSync } = require('child_process');

const commitHash = execSync('git rev-parse HEAD').toString().trim();
process.env.REACT_APP_COMMIT_HASH = commitHash;

execSync('rsbuild dev', { stdio: 'inherit' });
</file>

<file path="installer/create-database.php">
<?php
function populateDatabase($oDB)
{
    $version = require(\Yii::app()->getBasePath() . '/config/version.php');
    $databaseCurrentVersion = $version['dbversionnumber'];
    Yii::app()->loadHelper('database');
    Yii::app()->loadHelper('update.updatedb');
    $options = '';
    // The engine has to be explicitly set because MYSQL 8 switches the default engine to INNODB
    if ($oDB->driverName == 'mysql') {
        $options = 'ENGINE=' . Yii::app()->getConfig('mysqlEngine') . ' DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci';
        if (Yii::app()->getConfig('mysqlEngine') == 'INNODB') {
            $options .= ' ROW_FORMAT=DYNAMIC';
        }
    }
    $oTransaction = $oDB->beginTransaction();
    try {
        $oDB->createCommand()->createTable('{{answers}}', array(
            'aid' =>  "pk",
            'qid' => 'integer NOT NULL',
            'code' => 'string(5) NOT NULL',
            'sortorder' => 'integer NOT NULL',
            'assessment_value' => 'integer NOT NULL DEFAULT 0',
            'scale_id' => 'integer NOT NULL DEFAULT 0',
        ), $options);
        $oDB->createCommand()->createIndex('{{answers_idx}}', '{{answers}}', ['qid', 'code', 'scale_id'], false);
        $oDB->createCommand()->createIndex('{{answers_idx2}}', '{{answers}}', 'sortorder', false);
        $oDB->createCommand()->createTable('{{answer_l10ns}}', array(
            'id' =>  "pk",
            'aid' =>  "integer NOT NULL",
... (950 lines truncated)
</file>

<file path="modules/admin/globalsettings/controller/globalsettings.php">
<?php
namespace lsadminmodules\globalsettings\controller;
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
class GlobalSettings extends \GlobalSettings
{
    public $myNewParam = "This was not in global setting core controller";
    public function HelloWorld($sWho="World")
    {
        $this->_renderWrappedTemplate('globalsettings', 'HelloWorld', array(
            'sWho'=>$sWho,
          ));
    }
    protected function renderWrappedTemplate($sAction = '', $aViewUrls = array(), $aData = array(), $sRenderFile = false)
    {
        // We add ou new parameter to the data to parse to the view
        $aData["myNewParam"] = $this->myNewParam;
        // Then we just call the parent method
        parent::renderWrappedTemplate($sAction, $aViewUrls, $aData, $sRenderFile);
    }
    /**
     * Override Survey_Common_Action::renderCentralContents
     *
     * If you don't understand what it does, just copy / paste it in your own admin module
     * We let it here just in case you're trying to do something different
     *
     * NOTE: you just need to copy/paste here any view called by the core GlobalSettings to override it.
     *
     */
... (10 lines truncated)
</file>

<file path="modules/admin/globalsettings/views/_overview.php">
<?php
?>
<?php if (YII_DEBUG) : ?>
    <?php
    $this->widget('ext.AlertWidget.AlertWidget', [
        'tag' => 'p',
        'text' => gT(
            'This subview is rendered from global setting module. This message is shown only when debug mode is activated.'
        ),
        'type' => 'info',
        'showCloseButton' => false,
    ]);
    ?>
<?php endif;?>
<br />
<div class="table-responsive">
    <table class='table table-hover'>
        <tr>
            <th><?php eT("Users"); ?>:</th>
            <td><?php echo $usercount; ?></td>
        </tr>
        <tr>
            <th><?php eT("Surveys"); ?>:</th>
            <td><?php echo $surveycount; ?></td>
        </tr>
        <tr>
            <th><?php eT("Active surveys"); ?>:</th>
            <td><?php echo $activesurveycount; ?></td>
        </tr>
        <tr>
... (39 lines truncated)
</file>

<file path="modules/admin/globalsettings/views/globalSettings_view.php">
<?php
echo viewHelper::getViewTestTag('globalsettings');
?>
<script type="text/javascript">
    var msgCantRemoveDefaultLanguage = '<?php eT("You can't remove the default language.", 'js'); ?>';
    var msgEmailPluginRequired = '<?php eT("Email method 'Plugin' requires a plugin to be selected.", 'js'); ?>';
</script>
<ul class="nav nav-tabs" id="settingTabs" role="tablist">
    <li role="presentation" class="nav-item"><a role="tab" class="nav-link active" data-bs-toggle="tab" href='#overview'><?php eT("Overview"); ?></a></li>
    <li role="presentation" class="nav-item"><a role="tab" class="nav-link" data-bs-toggle="tab" href='#general'><?php eT("General"); ?></a></li>
    <li role="presentation" class="nav-item"><a role="tab" class="nav-link" data-bs-toggle="tab" href='#email'><?php eT("Email settings"); ?></a></li>
    <li role="presentation" class="nav-item"><a role="tab" class="nav-link" data-bs-toggle="tab" href='#bounce'><?php eT("Bounce settings"); ?></a></li>
    <li role="presentation" class="nav-item"><a role="tab" class="nav-link" data-bs-toggle="tab" href='#security'><?php eT("Security"); ?></a></li>
    <li role="presentation" class="nav-item"><a role="tab" class="nav-link" data-bs-toggle="tab" href='#useradmin'><?php eT("User administration"); ?></a></li>
    <li role="presentation" class="nav-item"><a role="tab" class="nav-link" data-bs-toggle="tab" href='#presentation'><?php eT("Presentation"); ?></a></li>
    <li role="presentation" class="nav-item"><a role="tab" class="nav-link" data-bs-toggle="tab" href='#language'><?php eT("Language"); ?></a></li>
    <li role="presentation" class="nav-item"><a role="tab" class="nav-link" data-bs-toggle="tab" href='#interfaces'><?php eT("Interfaces"); ?></a></li>
    <li role="presentation" class="nav-item"><a role="tab" class="nav-link" data-bs-toggle="tab" href='#storage'><?php eT("Storage"); ?></a></li>
    <li role="presentation" class="nav-item"><a role="tab" class="nav-link" data-bs-toggle="tab" href='#updates'><?php eT("Updates"); ?></a></li>
</ul>
<?php echo CHtml::form(["admin/globalsettings"], 'post', ['class' => '', 'id' => 'frmglobalsettings', 'name' => 'frmglobalsettings', 'autocomplete' => 'off']); ?>
<div class="tab-content">
    <div id="overview" class="tab-pane show active col-lg-6 offset-lg-1">
        <?php $this->renderPartial(
            "./globalsettings/_overview",
            [
                'usercount'          => $usercount,
                'surveycount'        => $surveycount,
                'activesurveycount'  => $activesurveycount,
                'deactivatedsurveys' => $deactivatedsurveys,
... (67 lines truncated)
</file>

<file path="modules/admin/globalsettings/views/HelloWorld.php">
<?php
?>
<div class="col-12 ">
    <h3 class="pagetitle"><?php eT('Hello World From Global Settings!'); ?></h3>
    <div class="row">
        <div class="col-12 ">
          <?php eT('Hello '); echo $sWho; ?> !
        </div>
    </div>
</div>
</file>

<file path="modules/admin/globalsettings/README.md">
# GlobalSettings admin module for LimeSurvey

## Quick introduction
Coming with LS4, it's now possible for 3rd party developers to extends LimeSurvey controllers, and to override their views and subviews.
Here a very small example to show how to proceed.

## Directories, namespace and class name

### The core file name determines the directory name

You can extend any of the controller in the admin directory:
https://github.com/LimeSurvey/LimeSurvey/tree/85cc7c52479addbffb6a857ddc7aa10f52b0b02c/application/controllers/admin

For this example, we choose to extend GlobalSettings controller:
https://github.com/LimeSurvey/LimeSurvey/blob/85cc7c52479addbffb6a857ddc7aa10f52b0b02c/application/controllers/admin/globalsettings.php

Since the name of the file is **globalsettings.php**, we must create a directory **modules/admin/globalsettings/**. Respecting case of original file is important.
Note that LimeSurvey files are not normalized (sometime upper case, sometime lower case, sometime using dash, sometime camel cased, etc ). If we have time, we'll normalize the names before we release LS 4.0.0.

Then, inside **modules/admin/globalsettings/controller/** we create a file with the exact same name as the core file: **globalsettings.php**

### The directory path determines the name space

LimeSurvey is based on yii1, and yii1 doesn't really use name space, but rather aliases for path. This is for historical reasons: PHP prior to 5.3.0 does not support namespace intrinsically. So yii1 rather uses a prefix for all their core classes, and uses path aliases extensively. But, for those who want to use namespace, all the Yii import methods accepts path, alias, or namespace. So ideally, in yii1, it must be possible to easily translate your namespace to aliases so we can easily translate your namespace to aliases. To be clear:

So first, in **modules/admin/globalsettings/controller/globalsettings.php** we define a namespace:

```php
 namespace lsadminmodules\globalsettings\controller;
```
... (215 lines truncated)
</file>

<file path="modules/admin/HelloWorld/controller/HelloWorld.php">
<?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
class HelloWorld extends SurveyCommonAction
{
      public function index()
      {
        return $this->sayHello();
      }
      public function sayHello($sWho="World")
      {
          $this->renderWrappedTemplate('HelloWorld', 'index', array(
              'sWho'=>$sWho,
            ));
      }
      public function HelloWorldSurvey($surveyid)
      {
        $oSurvey = Survey::model()->findByPk($surveyid);
        $aData = array();
        $aData['surveyid'] = $surveyid;
        $aData['title_bar']['title'] = $oSurvey->currentLanguageSettings->surveyls_title." (".gT("ID").":".$surveyid.")";
        $aData['title_bar']['module_subaction'] = "HelloWorld";
        $aData['title_bar']['module_subaction_url'] = App()->createUrl('admin/HelloWorld/sa/HelloWorldSurvey/', ['surveyid' => $oSurvey->sid]);
        $aData['sWho'] = "root";
        $this->renderWrappedTemplate('HelloWorld', 'HelloWorldSurvey', $aData, false);
      }
    public function sayHelloUser($sWho="World", $surveyid)
    {
        $oSurvey = Survey::model()->findByPk($surveyid);
... (16 lines truncated)
</file>

<file path="modules/admin/HelloWorld/views/HelloWorldSurvey.php">
<?php
?>
<div class='menubar surveybar' id="helloworldbarid">
    <div class="container-fluid">
        <div class='row'>
            <!-- left buttons -->
            <div class="col-lg-10">
                <a class="btn btn-outline-secondary pjax" href='<?php echo $this->createUrl('admin/HelloWorld/sa/sayHelloUser/', ['surveyid' => $oSurvey->sid, 'sWho' => "foo"]); ?>' role="button">
                    <span class="ri-emotion-happy-line text-success"></span>
                    Hello user
                </a>
            </div>
        </div>
    </div>
</div>
<div class="col-12 ">
    <h3 class="pagetitle"><?php eT('Hello World Admin Module'); ?></h3>
    <div class="row">
        <div class="col-12 ">
            This is the root function. Just click on menu item to see the breadcrumb in action
        </div>
    </div>
</div>
</file>

<file path="modules/admin/HelloWorld/views/index.php">
<?php
?>
<div class="col-12 ">
    <h3 class="pagetitle"><?php eT('Hello World Admin Module'); ?></h3>
    <div class="row">
        <div class="col-12 ">
          <?php eT('Hello '); echo $sWho; ?> !
        </div>
    </div>
</div>
</file>

<file path="modules/admin/HelloWorld/views/sayHelloUser.php">
<?php
?>
<div class="col-12 ">
    <h3 class="pagetitle"><?php eT('Hello World Admin Module'); ?></h3>
    <div class="row">
        <div class="col-12 ">
          Hello <?php echo $sUserName; ?> ! <br/>
          sWho parameter in url: <?php echo $sWho; ?>
        </div>
        <div class="col-12 ">
          No more menus? Just use the breadcrump to go back to root page :)
        </div>
    </div>
</div>
</file>

<file path="modules/admin/HelloWorld/README.md">
# HelloWorld admin module for LimeSurvey

## Quick introduction
Here a very small example of an admin MVC module for  LimeSurvey.

This module consists in two parts: Full page module and survey page module.
The code is commented so you can easily copy / paste those files and modify them to your need.
We'll add soon a model and a table creation process.


To create a module, you must first know a bit of the Yii 1 Framework.
see: https://www.yiiframework.com/doc/guide/1.1/en


NB: More info can be found in deleted globalsettings module: bc85197a266d44b75e8b7a5f6193ee750a0871a2

##  Full page Hello World Module


###  Global presentation

The first part of the module HelloWorld is a "full page module".
Example of this kind of modules in LimeSurvey are the Global Settings page, or the label sets page, or the user account page. They are accessible via the navigation bar, or via the boxes on the home page. When we'll provide you a module uploader, you'll can set your menu / box via the module manifest. For now, you must access it via the URL or by creating a box on the home page (see: index.php?r=admin/homepagesettings ).

You can reach this full page helloWorld module via the URL:

**index.php?r=admin/HelloWorld/**

You will see:
![Full page HelloWorld Module](https://account.limesurvey.org/images/github/full-page-hello-world-module.png)
... (248 lines truncated)
</file>

<file path="modules/root/HelloWorld/controllers/HelloWorldController.php">
<?php
class HelloWorldController extends CController
{
	protected function _init()
	{
			parent::_init();
	}
	public function actionIndex()
	{
		 echo "Hello World";
	}
	public function actionHelloAdmin()
	{
		if (Permission::model()->hasGlobalPermission('superadmin')){
			echo "Hello Super Admin";
		}else{
			echo "you must first login as super admin";
		}
	}
}
</file>

<file path="modules/root/HelloWorld/HelloWorldModule.php">
<?php
 class HelloWorldModule extends CWebModule
 {
   public $defaultController='HelloWorld';
   public function init()
   {
     parent::init();
     Yii::setPathOfAlias('helloworld',dirname(__FILE__));
   }
 }
</file>

<file path="modules/root/HelloWorld/README.md">
# HelloWorld Yii modules for LimeSurvey


## Quick introduction
Here a very small example of a Yii Module working in LimeSurvey.
If you want to learn more about Yii Modules, see:
see: https://www.yiiframework.com/doc/guide/1.1/en/basics.module

## Notice

The HelloWorld Modules has been be loaded first in internal.php. In the future, if we want to allow user to upload Yii Modules, we'll provide a way to do it by DB.

## Reach the module

### Default action

You can reach the default action via the url:
```
index.php?r=HelloWorld
```

It will shows the result of HelloWorldController::actionIndex()


### Other actions

You can reach the action HelloWorldController::actionHelloAdmin() via the url:

```
index.php?r=HelloWorld/HelloWorld/HelloAdmin
... (3 lines truncated)
</file>

<file path="modules/root/README.md">
# Yii modules for LimeSurvey


## Quick introduction
In this folder you can add Yii modules for LimeSurvey.
see: https://www.yiiframework.com/doc/guide/1.1/en/basics.module

Modules must be loaded first in internal.php. In the future, if we want to allow user to upload Yii Modules, we'll provide a way to do it by DB.

In the subfolder HelloWorld, you'll fin a minimal example of a Yii Module.

## Note about yii modules and admin interface
Since LimeSurvey still doesn't use a real layout system, but rather the SurveyCommonAction strategy, those modules can't be shown inside the admin interface. They can still be useful, for echoing pure json for example.

In future version of limesurve, we'll use the yii layout system so we'll can use real modules for the admin interface. For now, if you want to create modules for the admin interface, see modules/admin/.
</file>

<file path="plugins/Demo/demoAddEmFunction/demo/limesurvey_survey_demo.lss">
<?xml version="1.0" encoding="UTF-8"?>
<document>
 <LimeSurveyDocType>Survey</LimeSurveyDocType>
 <DBVersion>403</DBVersion>
 <languages>
  <language>en</language>
 </languages>
 <groups>
  <fields>
   <fieldname>gid</fieldname>
   <fieldname>sid</fieldname>
   <fieldname>group_order</fieldname>
   <fieldname>randomization_group</fieldname>
   <fieldname>grelevance</fieldname>
  </fields>
  <rows>
   <row>
    <gid><![CDATA[26]]></gid>
    <sid><![CDATA[267333]]></sid>
    <group_order><![CDATA[1]]></group_order>
    <randomization_group/>
    <grelevance/>
   </row>
   <row>
    <gid><![CDATA[27]]></gid>
    <sid><![CDATA[267333]]></sid>
    <group_order><![CDATA[2]]></group_order>
    <randomization_group/>
    <grelevance/>
   </row>
... (564 lines truncated)
</file>

<file path="plugins/Demo/demoAddEmFunction/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>demoAddEmFunction</name>
        <type>plugin</type>
        <creationDate>2018-04-15</creationDate>
        <last_update>2018-10-08</last_update>
        <author>Denis Chenu</author>
        <authorUrl>https://www.limesurvey.org</authorUrl>
        <version>0.0.2</version>
        <license>GNU General Public License version 2 or later</license>
        <description><![CDATA[Demo: add a new function for expression manager]]></description>
    </metadata>
    <compatibility>
        <version>4.0</version>
        <version>5.0</version>
    </compatibility>
    <updaters disabled="disabled">
    </updaters>
</config>
</file>

<file path="plugins/Demo/demoAddEmFunction/demoAddEmFunction.php">
<?php
class demoAddEmFunction extends PluginBase
{
    static protected $description = 'Demo: adding a new function';
    static protected $name = 'demoAddEmFunction';
    public function init()
    {
        $this->subscribe('ExpressionManagerStart','newValidFunctions');
    }
    public function newValidFunctions()
    {
        Yii::setPathOfAlias(get_class($this),dirname(__FILE__));
        $newFunctions = array(
            'doHtmlList' => array(
                '\demoAddEmFunction\exampleFunctions::doHtmlList',
                'demoAddEmFunction.doHtmlList',
                $this->gT("Show a HTML list with elements"),
                'string doHtmlList(arg1, arg2, ... argN)',
                'https://www.limesurvey.org',
                -1,
            ),
            'sayHello' => array(
                '\demoAddEmFunction\exampleFunctions::sayHello',
                'demoAddEmFunction.sayHello',
                $this->gT("Say hello"),
                'string sayHello(string)',
                'https://www.limesurvey.org',
                1,
            ),
        );
... (11 lines truncated)
</file>

<file path="plugins/Demo/demoAddEmFunction/exampleFunctions.php">
<?php
namespace demoAddEmFunction;
class exampleFunctions
{
    public static function sayHello($message)
    {
        return "Hello ".$message;
    }
    public static function doHtmlList($elements)
    {
        if(!count($elements)) {
            return "";
        }
        $returnHtml = "";
        foreach($elements as $element) {
            if(strval($element)) {
                $returnHtml .= "<li>".$element."</li>";
            }
        }
        if($returnHtml) {
            $returnHtml = "<ul>".$returnHtml."</ul>";
        }
        return $returnHtml;
    }
}
</file>

<file path="plugins/Demo/DemoDateSetting/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>DemoDateSetting</name>
        <type>plugin</type>
        <creationDate>2022-12-01</creationDate>
        <lastUpdate>2023-03-06</lastUpdate>
        <author>Denis Chenu</author>
        <authorUrl>https://community.limesurvey.org/</authorUrl>
        <version>0.1.0</version>
        <license>MIT</license>
        <description><![CDATA[Way to save date settings.]]></description>
    </metadata>
    <compatibility>
        <version>5</version>
    </compatibility>
</config>
</file>

<file path="plugins/Demo/DemoDateSetting/DemoDateSetting.php">
<?php
class DemoDateSetting extends PluginBase
{
    protected static $name = 'DemoDateSetting';
    protected static $description = 'Plugin to show saveformat function in date setting.';
    protected $storage = 'DbStorage';
    protected $settings = [
        'checkDateDate' => array(
            'type' => 'date',
            'saveformat' => "Y-m-d",
        ),
        'checkDateYear' => array(
            'type' => 'date',
            'saveformat' => "Y",
        ),
        'checkDateFalse' => array(
            'type' => 'date',
            'saveformat' => false,
        ),
        'checkDateDefault' => array(
            'type' => 'date',
        ),
    ];
    public function init()
    {
        $this->subscribe('beforeSurveySettings');
        $this->subscribe('newSurveySettings');
    }
    public function beforeSurveySettings()
    {
... (109 lines truncated)
</file>

<file path="plugins/Demo/DemoDateSetting/LICENSE">
MIT License

Copyright (c) 2022-2023 LimeSurvey / Denis Chenu

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
</file>

<file path="plugins/Demo/Example/Example.php">
<?php
class Example extends PluginBase {
    protected $storage = 'DbStorage';
    static protected $name = 'Example';
    static protected $description = 'Example plugin';
    protected $settings = array(
        'test' => array(
            'type' => 'string',
            'label' => 'Message'
        ),
    );
    public function init()
    {
        $this->subscribe('beforeSurveySettings');
        $this->subscribe('newSurveySettings');
    }
    public function beforeSurveySettings()
    {
        $event = $this->event;
        $event->set("surveysettings.{$this->id}", array(
            'name' => get_class($this),
            'settings' => array(
                'message' => array(
                    'type' => 'string',
                    'label' => 'Message to show to users:',
                    'current' => $this->get('message', 'Survey', $event->get('survey'))
                )
            )
         ));
    }
... (10 lines truncated)
</file>

<file path="plugins/Demo/noMailToExample/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>noMailToExample</name>
        <type>plugin</type>
        <creationDate>2016-12-15</creationDate>
        <last_update>2019-03-18</last_update>
        <author>Denis Chenu</author>
        <authorUrl>https://www.sondages.pro</authorUrl>
        <version>0.0.2</version>
        <license>GNU General Public License version 2 or later</license>
        <description><![CDATA[deactivate mail send to @example.org or @example.com. A simple demo plugin for beforeEmail and related event.]]></description>
    </metadata>
    <compatibility>
        <version>4.0</version>
        <version>5.0</version>
    </compatibility>
    <updaters disabled="disabled">
    </updaters>
</config>
</file>

<file path="plugins/Demo/noMailToExample/noMailToExample.php">
<?php
class noMailToExample extends PluginBase
{
    static protected $description = 'Don\t send email to example.(com|org)';
    static protected $name = 'noMailToExample';
    public function init()
    {
        $this->subscribe('beforeEmail','beforeEmail');
        $this->subscribe('beforeSurveyEmail','beforeEmail');
        $this->subscribe('beforeTokenEmail','beforeEmail');
    }
    public function beforeEmail()
    {
        $emailTos=$this->getEvent()->get("to");
        if(empty($emailTos)) {
            return;
        }
        if(is_string($emailTos)) {
            $emailTos=array($emailTos);
        }
        $cleanedEmailTos=array();
        foreach($emailTos as $emailTo){
            $emailOnly=$emailTo[0];
            $domainName = strtolower(substr(strrchr($emailOnly, "@"), 1));
            if($domainName=='example.com' || $domainName=='example.org'){
                $this->getEvent()->set("send",false);
                $this->getEvent()->set("error","No email was sent to example.(org|com)");
            }else{
                $cleanedEmailTos[]=$emailTo;
            }
... (8 lines truncated)
</file>

<file path="plugins/Demo/ShowResponse/ShowResponse.php">
<?php
class ShowResponse extends PluginBase {
    protected $storage = 'DbStorage';
    static protected $description = 'Demo: handle a survey response';
    static protected $name = 'Show response';
    public function init()
    {
        $this->subscribe('afterSurveyComplete', 'showTheResponse');
    }
    public function showTheResponse()
    {
        $event      = $this->getEvent();
        $surveyId   = $event->get('surveyId');
        $responseId = $event->get('responseId');
        $response   = $this->pluginManager->getAPI()->getResponse($surveyId, $responseId);
        $event->getContent($this)
              ->addContent('You response was:<br/><pre>' . print_r($response, true) . '</pre>');
    }
}
</file>

<file path="plugins/Demo/UnActivatable/UnActivatable.php">
<?php
    class UnActivatable extends PluginBase
    {
        static protected $description = 'Demo: This plugin can not be activated';
        static protected $name = 'Unactivatable';
        public function init()
        {
            $this->subscribe('beforeActivate');
        }
        public function beforeActivate()
        {
            $event = $this->getEvent();
            $event->set('success', false);
            $event->set('message', 'Custom error message from plugin.');
        }
    }
?>
</file>

<file path="plugins/index.html">
<html>
<head>
	<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
</file>

<file path="themes/admin/Sea_Green/images/limesurvey.pal">
20,130,200
232,95,51
34,205,33
210,211,28
134,179,129
201,171,131
251,231,221
23,169,161
167,187,213
211,151,213
147,145,246
147,39,90
250,250,201
201,250,250
94,0,94
250,125,127
0,96,201
201,202,250
0,0,127
250,0,250
250,250,0
0,250,250
127,0,127
127,0,0
0,125,127
0,0,250
0,202,250
201,250,250
201,250,201
250,250,151
... (43 lines truncated)
</file>

<file path="themes/admin/Sea_Green/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>Sea Green</name>
        <creationDate>08/12/2015</creationDate>
        <author>LimeSurvey GmbH</author>
        <authorEmail>info@limesurvey.org</authorEmail>
        <authorUrl>http://www.limesurvey.org</authorUrl>
        <copyright>Copyright (C) 2005 - 2022 LimeSurvey Gmbh, Inc. All rights reserved.</copyright>
        <license>GNU General Public License version 2 or later</license>
        <version>3.0</version>
        <description>Default LimeSurvey admin interface template.</description>
        <basecolor>#328637</basecolor>
        <lastUpdate>2017-27-11 17:00:00</lastUpdate>
    </metadata>
    <compatibility>
        <version>7.0</version>
        <version>6.0</version>
    </compatibility>
    <files>
        <css>
            <filename>sea_green.css</filename>
        </css>
        <js></js>
        <rtl>
            <css>
                <filename>sea_green-rtl.css</filename>
            </css>
            <js>
            </js>
... (7 lines truncated)
</file>

<file path="themes/admin/index.html">
<html>
<head>
	<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
</file>

<file path="themes/admin/README_RTL.txt">
This is information about how to generate right-to-left CSS.

Right-to-left locale, e.g. Hebrew

Use the tool R2 (nodejs) in styles/Sea_Green/css/ to convert from ltr to rtl. Source: https://pyjamacoder.com/2012/02/01/twitter-bootstrap-v2-rtl-edition/

    $ cd styles/Sea_Green/css
    $ rm *-rtl.css
    $ git checkout adminstyle-rtl.css  # This file is manually edited
    $ for file in *.css; do if [ "$file" == "adminstyle-rtl.css" ] ; then continue; fi; r2 "$file" "${file/.css/-rtl.css}"; done

PLEASE OBSERVE: The only file which has manually RTL-style is adminstyle-rtl.css. All other rtl-files are generated using R2.

Things to check:

* Plugin settings. Core plugins should use localization.
* Copy files from Sea_green into the other templates
* Minimum screen resolution: 1024 x 768
* Test a survey
</file>

<file path="themes/question/bootstrap_buttons/survey/questions/answer/listradio/columns/column_footer.twig">
{#
/**
 * Multiple Choice Html : close column containing item row
 * This view is used only if user set more than one column in the question attribute.
 *
 */
 #}
</file>

<file path="themes/question/bootstrap_buttons/survey/questions/answer/listradio/columns/column_header.twig">
{#
/**
 * Multiple Choice Html : column containing item row
 * This view is used only if user set more than one column in the question attribute.
 *
 * @var $iColumnWidth
 */
 #}
</file>

<file path="themes/question/bootstrap_buttons/survey/questions/answer/listradio/rows/answer_row_noanswer.twig">
{#
/**
 * List radio Html : item 'no answer' row
 *
 * @var $name   $ia[1]
 * @var $check_ans
 * @var $checkconditionFunction
 */
#}

{% set button_size_class = (question_template_attribute.button_size == 'default' or question_template_attribute.button_size is empty) ? '' : "btn-"~question_template_attribute.button_size %}
{% set max_buttons_row = (question_template_attribute.max_buttons_row == 'default' or question_template_attribute.max_buttons_row is empty) ? 'col-md-2' : question_template_attribute.max_buttons_row %}

<!-- answer_row_noanswer -->
<li class="bootstrap-buttons-div col-12 {{ max_buttons_row }}">
    <div id="javatbd{{ name }}" class="form-check col-12 {% if check_ans!='' %} active {% endif %} col-12">
        <input
            class="btn-check visually-hidden button-item"
            type="radio"
            name="{{ name }}"
            id="answer{{ name }}"
            value="{{ code }}"
            {{ check_ans }}
            />
        <label class="btn btn-primary w-100 {{ button_size_class }}" for="answer{{ name }}">
            <span class="" aria-hidden="true"></span> {{ gT('No answer') }}
        </label>
    </div>
</li>
<!-- endof answer_row_noanswer -->
... (1 lines truncated)
</file>

<file path="themes/question/bootstrap_buttons/survey/questions/answer/listradio/rows/answer_row_other.twig">
{#
/**
 * List radio Html : item 'other' row
 *
 * @var $name
 * @var $answer_other
 * @var $sDisplayStyle
 * @var $sDisable
 * @var $myfname
 * @var $othertext
 * @var $otherTextRight
 * @var $otherItemExtraClass
 * @var $checkedState
 * @var $sValue
 * @var $checkconditionFunction
 * @var $oth_checkconditionFunction
 * @var $otherInputSize
 * @var $otherMaxLength
 */
#}

{% set button_size_class = (question_template_attribute.button_size == 'default' or question_template_attribute.button_size is empty) ? '' : "btn-"~question_template_attribute.button_size %}
{% set max_buttons_row = (question_template_attribute.max_buttons_row == 'default' or question_template_attribute.max_buttons_row is empty) ? 'col-md-2' : question_template_attribute.max_buttons_row %}

<!-- answer_row_other -->
<li class="bootstrap-buttons-div col-12 {{ max_buttons_row }} {{ otherItemExtraClass }}">
    <div id="javatbd{{ name }}_Cother" class="form-check bootstrap-buttons-div col-12 {% if checkedState!='' %} active focus {% endif %}" {{ sDisplayStyle }}>
        <input
            class="btn-check visually-hidden button-item"
            type="radio"
... (17 lines truncated)
</file>

<file path="themes/question/bootstrap_buttons/survey/questions/answer/listradio/rows/answer_row.twig">
{#
/**
 * List radio Html : item row
 *
 * @var $name
 * @var $code
 * @var $answer
 * @var $checkedState
 * @var $myfname
 */
#}

{% set button_size_class = (question_template_attribute.button_size == 'default' or question_template_attribute.button_size is empty) ? '' : "btn-"~question_template_attribute.button_size %}
{% set max_buttons_row = (question_template_attribute.max_buttons_row == 'default' or question_template_attribute.max_buttons_row is empty) ? 'col-md-2' : question_template_attribute.max_buttons_row %}

<!-- answer_row -->
<li id="javatbd{{ myfname }}" class="bootstrap-buttons-div col-12 {{ max_buttons_row }}">
    <div class="form-check col-12 {% if checkedState!='' %} active {% endif %}">
        <input
            class="btn-check visually-hidden button-item"
            type="radio"
            name="{{ name }}"
            id="answer{{ name }}{{ code }}"
            value={{ code }}
            {{ checkedState }}
        >
        <label class="btn btn-primary w-100 {{ button_size_class }}" for="answer{{ name }}{{ code }}"> {{ processString(answer) }}
        </label>
    </div>
</li>
... (2 lines truncated)
</file>

<file path="themes/question/bootstrap_buttons/survey/questions/answer/listradio/answer.twig">
{#
/**
 * List Radio Html
 *
 * @var $name
 * @var $value
 * @var $othertext
 * @var $otherTextRight
 * @var $otherInputSize
 * @var $otherMaxLength
 */
#}

<!-- List Radio -->
<!-- answer -->
{# Translate the col-md-* option of "Maximum number of buttons in a row" into a fixed grid column count #}
{% set buttons_per_row_map = {'col-md-12': 1, 'col-md-6': 2, 'col-md-4': 3, 'col-md-3': 4, 'col-md-2': 6, 'col-md-1': 12} %}
{% set max_buttons_row_value = question_template_attribute.max_buttons_row|default('') %}
{% set buttons_cols_class = max_buttons_row_value in buttons_per_row_map|keys ? 'bootstrap-buttons-cols-' ~ buttons_per_row_map[max_buttons_row_value] : '' %}
{{ sTimer }}
<div>
    <ul class="{{coreClass}} list-unstyled bootstrap-buttons-list {{ buttons_cols_class }}" data-bs-toggle="buttons" role="radiogroup" aria-labelledby="ls-question-text-{{name }}">
    {# rows/answer_row.php #}
    {{ sRows }}
    </ul>

    {# Value for expression manager javascript (use id) ; no need to submit #}
    {{ C.Html.hiddenField("java"~name,value,({
        'id' : "java"~name,
        'disabled' : true,
... (29 lines truncated)
</file>

<file path="themes/question/bootstrap_buttons/survey/questions/answer/listradio/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>bootstrap_buttons</name>
        <type>question_theme</type>
        <title>Bootstrap buttons</title>
        <creationDate>22/05/2018</creationDate>
        <author>LimeSurvey GmbH</author>
        <authorEmail>info@limesurvey.org</authorEmail>
        <authorUrl>http://www.limesurvey.org</authorUrl>
        <copyright>Copyright (C) 2005 - 2018 LimeSurvey Gmbh, Inc. All rights reserved.</copyright>
        <license>GNU General Public License version 2 or later</license>
        <version>1.0</version>
        <apiVersion>1</apiVersion>
        <description>New implementation of the Bootstrap buttons question theme</description>
        <questionType>L</questionType>
        <group>Single choice questions</group>
        <subquestions>0</subquestions>
        <answerscales>1</answerscales>
        <hasdefaultvalues>1</hasdefaultvalues>
        <assessable>1</assessable>
        <class>list-radio</class>
    </metadata>
    <compatibility>
        <version>4.0</version>
        <version>5.0</version>
        <version>6.0</version>
        <version>7.0</version>
    </compatibility>
    <files>
... (67 lines truncated)
</file>

<file path="themes/question/bootstrap_buttons/survey/questions/answer/listradio/translations.php">
<?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
gT("Bootstrap buttons");
gT('Change button size');
gT('Button size');
gT('Large');
gT('Small');
gT('Extra small');
gT('Choose maximum number of buttons in a row');
gT('Maximum number of buttons in a row');
</file>

<file path="themes/question/bootstrap_buttons_multi/survey/questions/answer/multiplechoice/rows/answer_row_other.twig">
{#
/**
 * Multiple Choice Html : item 'other' row
 *
 * @var $sDisable
 * @var $myfname
 * @var $othertext
 * @var $checkedState
 * @var $sValue
 * @var $oth_checkconditionFunction
 * @var $checkconditionFunction
 * @var $sValueHidden
 * @var $wrapper
 */
#}

<!-- answer_row_other -->
<li class="bootstrap-buttons-div col-12 {{ max_buttons_row }}">
    <div id='javatbd{{ myfname }}' class="form-check col-12 {% if checkedState!='' %} active {% endif %}">

        <!-- Checkbox + label -->
            <!-- checkbox -->
            <input
                class="other-checkbox bootstrap-checkbox-other btn-check button-item"
                type="checkbox"
                name="{{myfname}}cbox"
                id="answer{{myfname}}cbox"
                data-name="{{ name }}other"
                {{checkedState}}
                aria-hidden="true"
... (17 lines truncated)
</file>

<file path="themes/question/bootstrap_buttons_multi/survey/questions/answer/multiplechoice/rows/answer_row.twig">
{#

!!!! BECAREFUL: ONLY FOR TESTING !!!!!
!!!! DON'T START TO TRANSLATE ALL VIEWS BASED ON THIS MODEL !!!!!

!!!! IT WILL PROBABLY FIRST NEED TO CHANGE  THE TWIG TEMPLATE SYNTAX TO AVOID CONFLICT WITH EXPRESSION MANAGER !!!!

/**
 * Multiple Choice Html : item row
 *
 * @var hiddenfield
 * @var name
 * @var title
 * @var question
 * @var checkedState
 * @var sCheckconditionFunction
 * @var myfname
 * @var sValue
 */
#}

<!-- answer_row -->
<li id='javatbd{{ myfname }}' class="bootstrap-buttons-div question-item answer-item col-12 {{ max_buttons_row }}">
    <div class="form-check col-12 {% if checkedState!='' %} active {% endif %}">
    <input
        type="checkbox"
        name="{{ myfname }}"
        data-name="{{ myfname }}"
        class="btn-check button-item"
        id="answer{{ myfname }}"
... (15 lines truncated)
</file>

<file path="themes/question/bootstrap_buttons_multi/survey/questions/answer/multiplechoice/answer.twig">
{# 
/**
 * Multiple Choice question item Html
 *
 * @var $sRows      : the rows, generated with the views rows/answer_row*.php
 *
 * @var $name
 * @var $anscount
 * @var $othertext
 * @var $otherTextRight
 * @var $otherInputSize
 * @var $otherMaxLength
 */
 #}
<!-- Multiple Choice -->

<!-- answer -->

{% set button_size_class = (question_template_attribute.button_size == 'default' or question_template_attribute.button_size is empty) ? '' : "btn-"~question_template_attribute.button_size %}
{% set max_buttons_row = (question_template_attribute.max_buttons_row == 'default' or question_template_attribute.max_buttons_row is empty) ? 'col-md-2' : question_template_attribute.max_buttons_row %}
{# Translate the col-md-* option of "Maximum number of buttons in a row" into a fixed grid column count #}
{% set buttons_per_row_map = {'col-md-12': 1, 'col-md-6': 2, 'col-md-4': 3, 'col-md-3': 4, 'col-md-2': 6, 'col-md-1': 12} %}
{% set max_buttons_row_value = question_template_attribute.max_buttons_row|default('') %}
{% set buttons_cols_class = max_buttons_row_value in buttons_per_row_map|keys ? 'bootstrap-buttons-cols-' ~ buttons_per_row_map[max_buttons_row_value] : '' %}
<input type="hidden" name="MULTI{{name}}" value="{{anscount}}" />
<div class="{{coreClass}} {{ extraclass }}" >
    <ul class="list-unstyled bootstrap-buttons-list {{ buttons_cols_class }}" data-bs-toggle="buttons" role="group" aria-labelledby="ls-question-text-{{basename }}">
        {% for aRow in aRows %}
            {% set aRow = aRow|merge({'button_size_class': button_size_class})|merge({'max_buttons_row': max_buttons_row}) %}
            {% set rowTemplate = aRow.other ? './survey/questions/answer/multiplechoice/rows/answer_row_other.twig' : './survey/questions/answer/multiplechoice/rows/answer_row.twig' %}
... (34 lines truncated)
</file>

<file path="themes/question/bootstrap_buttons_multi/survey/questions/answer/multiplechoice/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>bootstrap_buttons_multi</name>
        <type>question_theme</type>
        <title>Bootstrap buttons</title>
        <creationDate>22/05/2018</creationDate>
        <author>LimeSurvey GmbH</author>
        <authorEmail>info@limesurvey.org</authorEmail>
        <authorUrl>http://www.limesurvey.org</authorUrl>
        <copyright>Copyright (C) 2005 - 2018 LimeSurvey Gmbh, Inc. All rights reserved.</copyright>
        <license>GNU General Public License version 2 or later</license>
        <version>1.1</version>
        <apiVersion>1</apiVersion>
        <description>New implementation of the Bootstrap buttons question theme</description>
        <questionType>M</questionType>
        <group>Multiple choice questions</group>
        <subquestions>1</subquestions>
        <answerscales>0</answerscales>
        <hasdefaultvalues>1</hasdefaultvalues>
        <assessable>1</assessable>
        <class>multiple-opt</class>
    </metadata>
    <compatibility>
        <version>4.0</version>
        <version>5.0</version>
        <version>6.0</version>
        <version>7.0</version>
    </compatibility>
    <files>
... (65 lines truncated)
</file>

<file path="themes/question/bootstrap_buttons_multi/survey/questions/answer/multiplechoice/translations.php">
<?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
gT("Bootstrap buttons");
gT('Change button size');
gT('Button size');
gT('Large');
gT('Small');
gT('Extra small');
gT('Choose maximum number of buttons in a row');
gT('Maximum number of buttons in a row');
</file>

<file path="themes/question/bootstrap_dropdown/survey/questions/answer/list_dropdown/rows/answer_row.twig">
{#
/**
 * List DropDown Option Html
 * @var $value          $ansrow['code'];
 * @var $opt_select
 * @var $answer         flattenText($_prefix.$ansrow['answer'])."
 * @var $classes
 */
#}

<!-- option -->
<option data-content="{{ answer }}" value='{{ code }}' {{ opt_select }} {% if classes is not empty %} class="{{ classes }}" {% endif %} >
    {{ flattenText(answer) }}
</option>
<!-- end of option -->
</file>

<file path="themes/question/bootstrap_dropdown/survey/questions/answer/list_dropdown/rows/optgroup.twig">
{#
/**
 * List DropDown Option group header Html
 * @var $sOptGroupOptions   the current options for this group, generated with the view rows/options.php
 *
 * @var $categoryname
 */
#}

<!-- optgroup -->
<optgroup class="dropdowncategory" label="{{ flattenText(categoryname) }}">
        {# rows/option.php #}
        {{ sOptGroupOptions }}
</optgroup>
<!-- end of optgroup -->
</file>

<file path="themes/question/bootstrap_dropdown/survey/questions/answer/list_dropdown/rows/option.twig">
{#
/**
 * List DropDown Option Html
 * @var $value          $ansrow['code'];
 * @var $opt_select
 * @var $answer         flattenText($_prefix.$ansrow['answer'])."
 * @var $classes
 */
#}

<!-- option -->
<option data-content="{{ processString(answer,1) }}" value='{{ value }}' {{ opt_select }} {% if classes is not empty %} class="{{ classes }}" {% endif %} >
    {{ flatString(processString(answer,1),1) }}
</option>
<!-- end of option -->
</file>

<file path="themes/question/bootstrap_dropdown/survey/questions/answer/list_dropdown/rows/othertext.twig">
{#
/**
 * List DropDown, Other Option
 *
 * @var $name           $ia[1]
 * @var $display
 * @var $value
 * @var $checkconditionFunction
 */
#}
<div class="col-auto">
    <label for="othertext{{ name }}" class="visually-hidden">
        {{ processString(label) }}
    </label>
</div>
<div class="text-item other-text-item col-auto">
    {{ C.Html.textField(name~"_Cother",value,({
        'id' : "othertext"~name,
        'class':"form-control",
        'aria-labelledby' : "answer"~name~"-oth-",
    })) }}
</div>
<script>
if( $("#answer{{ name }}").val() != "-oth-" ){
    $("#othertext{{ name }}").hide();
}
$(document).on("change","#answer{{ name }}", function(){
    if($("#answer{{ name }}").val() != "-oth-"){
        $("#othertext{{ name }}").hide();
        $("#othertext{{ name }}").val("").trigger("keyup");
... (8 lines truncated)
</file>

<file path="themes/question/bootstrap_dropdown/survey/questions/answer/list_dropdown/answer.twig">
{#
/**
 * List DropDown select Html
 *
 * @var $sOptions         : the select options, generated with the view item_options.php
 * @var $sOther           : the other input field, generated with the view item_noanswer.php
 *
 * @var $name
 * @var $dropdownSize
 * @var $checkconditionFunction
 * @var $select_show_hide
 *
 */
#}


{% set data_live_search = (question_template_attribute.show_search == 'default' or question_template_attribute.show_search is empty or question_template_attribute.show_search == 'false') ? '' : "data-live-search='true'" %}
{% set show_tick = (question_template_attribute.show_tick == 'default' or question_template_attribute.show_tick is empty or question_template_attribute.show_tick == 'false') ? '' : "show-tick" %}
{% set width_entry = (question_template_attribute.width_entry == 'default' or question_template_attribute.width_entry is empty or question_template_attribute.width_entry == 'false') ? "data-width='auto'" : '' %}

<!-- List Dropdown -->

<!-- answer-->
<div class="mb-3 row align-items-center">
    <div class="{{ coreClass }} col-auto">
        <select
                class="form-control list-question-select {{ show_tick }}"
                {{ data_live_search }}
                {{ width_entry }}
                data-none-selected-text=''
... (85 lines truncated)
</file>

<file path="themes/question/bootstrap_dropdown/survey/questions/answer/list_dropdown/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>bootstrap_dropdown</name>
        <type>question_theme</type>
        <title>Bootstrap dropdown</title>
        <creationDate>2021-09-29</creationDate>
        <author>Adam Zammit</author>
        <authorEmail>adam.zammit@acspri.org.au</authorEmail>
        <authorUrl>https://www.acspri.org.au</authorUrl>
        <copyright>Copyright (C) 2021 The Australian Consoritium for Social and Political Research Incorporated (ACSPRI)</copyright>
        <license>GNU General Public License version 2 or later</license>
        <version>1.0</version>
        <apiVersion>1</apiVersion>
        <description>Bootstrap dropdown</description>
        <questionType>!</questionType>
        <group>Single choice questions</group>
        <subquestions>0</subquestions>
        <answerscales>1</answerscales>
        <hasdefaultvalues>1</hasdefaultvalues>
        <assessable>1</assessable>
        <class>list-dropdown</class>
    </metadata>
    <compatibility>
        <version>4.0</version>
        <version>5.0</version>
        <version>6.0</version>
        <version>7.0</version>
    </compatibility>
    <files>
... (59 lines truncated)
</file>

<file path="themes/question/bootstrap_dropdown/survey/questions/answer/list_dropdown/translations.php">
<?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
gT("Bootstrap dropdown");
gT('Enable search function');
gT('Allow searching of dropdown');
gT('On (searchable)');
gT('Off (no search function)');
gT('Show a tick on the selected item in the dropdown');
gT('Display tick on selected item');
gT('Show tick');
gT('No tick');
gT('Can be as wide as the entry that is selected, or fixed at the longest entry (default)');
gT('Width of dropdown should be the currently selected entry');
gT('Width of dropdown to be currently selected entry');
gT('Width of dropdown to be longest entry');
</file>

<file path="themes/question/browserdetect/survey/questions/answer/shortfreetext/text/item.twig">
{#
/**
 * Shortfreetext, input text style, item Html
 *
 * $extraclass 
 * $name        $ia[1]
 * $prefix
 * $suffix
 * $tiwidth
 * $dispVal
 * $maxlength
 * $checkconditionFunction
 **** Additional attributes:
 * @var question_template_attribute.add_platform_info
 */
#}

{#<p>DEBUG:<br>
question_template_attribute.add_platform_info           : {{question_template_attribute.add_platform_info}}<br/>
</p>
#}

{% if withColumn %}
<div class='{{coreClass}} row'>
    <div class="{{extraclass}}">
{% else %}
<div class='{{coreClass}} {{extraclass}}'>
{% endif %}

    {% if prefix is not empty or suffix is not empty %}
... (40 lines truncated)
</file>

<file path="themes/question/browserdetect/survey/questions/answer/shortfreetext/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>browserdetect</name>
        <type>question_theme</type>
        <title>Browser detection</title>
        <creationDate>07/09/2017</creationDate>
        <author>LimeSurvey GmbH</author>
        <authorEmail>info@limesurvey.org</authorEmail>
        <authorUrl>http://www.limesurvey.org</authorUrl>
        <copyright>Copyright (C) 2005 - 2017 LimeSurvey Gmbh, Inc. All rights reserved.</copyright>
        <license>GNU General Public License version 2 or later</license>
        <version>1.0</version>
        <apiVersion>1</apiVersion>
        <description>Browser, Platform and Proxy detection</description>
        <questionType>S</questionType>
        <group>Text questions</group>
        <subquestions>0</subquestions>
        <answerscales>0</answerscales>
        <hasdefaultvalues>1</hasdefaultvalues>
        <assessable>0</assessable>
        <class>text-short</class>
    </metadata>
    <compatibility>
        <version>4.0</version>
        <version>5.0</version>
        <version>6.0</version>
        <version>7.0</version>
    </compatibility>
    <files>
... (33 lines truncated)
</file>

<file path="themes/question/browserdetect/survey/questions/answer/shortfreetext/translations.php">
<?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
gT("Browser detection");
gT('Show also the platform information of the participant');
gT('Show platform information:');
</file>

<file path="themes/question/image_select-listradio/survey/questions/answer/listradio/rows/answer_row_noanswer.twig">
{#
/**
 * List radio Html : item 'no answer' row
 *
 * @var $name   $ia[1]
 * @var $check_ans
 * @var $checkconditionFunction
 */
#}

<!-- answer_row_noanswer -->
<li id='javatbd{{ name }}' class="mb-3 answer-item radio-item no-anwser-item">
    <input
    type="radio"
    name="{{ name }}"
    id="answer{{ name }}"
    value=""
    {{ check_ans }}
    onclick="if (document.getElementById('answer{{ name }}othertext') != null) document.getElementById('answer{{ name }}othertext').value='';{{ checkconditionFunction }}(this.value, this.name, this.type)"
    />
    <label for="answer{{ name }}" class="control-label radio-label">
        {{ gT('No answer') }}
    </label>
</li>
<!-- endof answer_row_noanswer -->
</file>

<file path="themes/question/image_select-listradio/survey/questions/answer/listradio/rows/answer_row_other.twig">
{#
/**
 * List radio Html : item 'other' row
 *
 * @var $name
 * @var $answer_other
 * @var $sDisplayStyle
 * @var $sDisable
 * @var $myfname
 * @var $othertext
 * @var $otherTextRight
 * @var $otherItemExtraClass
 * @var $checkedState
 * @var $sValue
 * @var $checkconditionFunction
 * @var $oth_checkconditionFunction
 * @var $otherInputSize
 * @var $otherMaxLength
 */
#}

<!-- answer_row_other -->
<li id='javatbd{{ myfname }}' class='row answer-item radio-text-item radio-item d-flex imageselect-other {{ otherItemExtraClass }}' role='group' {{ sDisplayStyle }} >
        <!-- Radio + label -->
        <div class="othertext-label-checkox-container col-auto">
            <input
            type="radio"
            value="-oth-"
            name="{{ name }}"
            id="SOTH{{ name }}"
... (39 lines truncated)
</file>

<file path="themes/question/image_select-listradio/survey/questions/answer/listradio/rows/answer_row.twig">
{#

!!!! BECAREFUL: ONLY FOR TESTING !!!!!
!!!! DON'T START TO TRANSLATE ALL VIEWS BASED ON THIS MODEL !!!!!

!!!! IT WILL PROBABLY FIRST NEED TO CHANGE  THE TWIG TEMPLATE SYNTAX TO AVOID CONFLICT WITH EXPRESSION MANAGER !!!!

/**
 * Multiple Choice Html : item row
 *
 * @var hiddenfield
 * @var name
 * @var code
 * @var answer
 * @var checkedState
 * @var sCheckconditionFunction
 * @var myfname
 * @var sValue
 **** Additional attributes:
 * @var question_template_attribute.fix_width
 * @var question_template_attribute.fix_height
 * @var question_template_attribute.keep_aspect
 * @var question_template_attribute.crop_or_resize
 * @var question_template_attribute.horizontal_scroll
 */
#}

{#<p>DEBUG:<br>
question_template_attribute.fix_width           : {{question_template_attribute.fix_width}}<br/>
question_template_attribute.fix_height          : {{question_template_attribute.fix_height}}<br/>
... (61 lines truncated)
</file>

<file path="themes/question/image_select-listradio/survey/questions/answer/listradio/answer.twig">
{#
/**
 * List Radio Html
 *
 * @var $name
 * @var $value
 */
#}

<!-- List Radio -->

<!-- answer -->
{{ sTimer }}
<ul class="imageselect-list {{ coreClass }} list-unstyled {% if iNbCols > 1 %} ls-column-count-{{iNbCols}}{% endif %}" role="radiogroup" aria-labelledby="ls-question-text-{{ name }}"{% if iNbCols > 1 %} data-column-count={{iNbCols}}{% endif %}>
    {# rows/answer_row.php #}
    {{ sRows }}
</ul>
{# Value for expression manager javascript (use id) ; no need to submit #}
{{ C.Html.hiddenField("java"~name,value,({
    'id' : "java"~name,
    'disabled' : true,
}))
}}
<!-- end of answer -->
</file>

<file path="themes/question/image_select-listradio/survey/questions/answer/listradio/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>image_select-listradio</name>
        <type>question_theme</type>
        <title>Image select list (Radio)</title>
        <creationDate>23/12/2016</creationDate>
        <author>LimeSurvey GmbH</author>
        <authorEmail>info@limesurvey.org</authorEmail>
        <authorUrl>http://www.limesurvey.org</authorUrl>
        <copyright>Copyright (C) 2005 - 2016 LimeSurvey Gmbh, Inc. All rights reserved.</copyright>
        <license>GNU General Public License version 2 or later</license>
        <version>1.0</version>
        <apiVersion>1</apiVersion>
        <description>List Radio with images.</description>
        <questionType>L</questionType>
        <group>Single choice questions</group>
        <subquestions>0</subquestions>
        <answerscales>1</answerscales>
        <hasdefaultvalues>1</hasdefaultvalues>
        <assessable>1</assessable>
        <class>list-radio</class>
    </metadata>
    <compatibility>
        <version>4.0</version>
        <version>5.0</version>
        <version>6.0</version>
        <version>7.0</version>
    </compatibility>
    <files>
... (74 lines truncated)
</file>

<file path="themes/question/image_select-listradio/survey/questions/answer/listradio/translations.php">
<?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
gT("Image select list (Radio)");
gT('Show an horizontal scroll for the images instead of a vertical list. Needs JavaScript enabled.');
gT('Horizontal scroll:');
gT('Keep images aspect ratio. Can be achieved by not setting both width and height. Needs JavaScript enabled.');
gT('Keep aspect-ratio');
gT('Crop images to fit into size. Needs JavaScript enabled.');
gT('Crop or resize');
gT('Resize');
gT('Crop');
gT('Fix width of the images to this value. Leave empty to not change them.');
gT('Fix width');
gT('Fix height of the images to this value. Leave empty to not change them.');
gT('Fix height');
</file>

<file path="themes/question/image_select-multiplechoice/survey/questions/answer/multiplechoice/columns/column_header.twig">
{{# @deprecated 6.0.1 #}
</file>

<file path="themes/question/image_select-multiplechoice/survey/questions/answer/multiplechoice/rows/answer_row_other.twig">
{#
/**
 * Multiple Choice Html : item 'other' row
 *
 * @var $sDisplayStyle
 * @var $sDisable
 * @var $myfname
 * @var $othertext
 * @var $othertextRight
 * @var $otherItemExtraClass
 * @var $checkedState
 * @var $sValue
 * @var $oth_checkconditionFunction
 * @var $checkconditionFunction
 * @var $sValueHidden
 * @var $wrapper
 * @var $otherInputSize
 * @var $otherMaxLength
 */
#}

<!-- answer_row_other -->
    <li id='javatbd{{ myfname }}' class='question-item answer-item checkbox-text-item form-group imageselect-other {{ otherItemExtraClass }}' {{ sDisplayStyle }} >
        <div class="row align-items-center">
            <div class="col-auto d-flex">
                <!-- Checkbox + label -->
                <div class="checkbox-item othertext-label-checkbox-container">
                    <!-- checkbox -->
                    <input
                        class="other-checkbox"
... (82 lines truncated)
</file>

<file path="themes/question/image_select-multiplechoice/survey/questions/answer/multiplechoice/rows/answer_row.twig">
{#

!!!! BECAREFUL: ONLY FOR TESTING !!!!!
!!!! DON'T START TO TRANSLATE ALL VIEWS BASED ON THIS MODEL !!!!!

!!!! IT WILL PROBABLY FIRST NEED TO CHANGE  THE TWIG TEMPLATE SYNTAX TO AVOID CONFLICT WITH EXPRESSION MANAGER !!!!

/**
 * Multiple Choice Html : item row
 *
 * @var hiddenfield
 * @var name
 * @var title
 * @var question
 * @var checkedState
 * @var sCheckconditionFunction
 * @var myfname
 * @var sValue
 **** Additional attributes:
 * @var question_template_attribute.fix_width
 * @var question_template_attribute.fix_height
 * @var question_template_attribute.keep_aspect
 * @var question_template_attribute.crop_or_resize
 * @var question_template_attribute.horizontal_scroll
 */
#}

{#<p>DEBUG:<br>
question_template_attribute.fix_width           : {{question_template_attribute.fix_width}}<br/>
question_template_attribute.fix_height          : {{question_template_attribute.fix_height}}<br/>
... (44 lines truncated)
</file>

<file path="themes/question/image_select-multiplechoice/survey/questions/answer/multiplechoice/answer.twig">
{#
/**
 * Multiple Choice question item Html
 *
 * @var $sRows      : the rows, generated with the views rows/answer_row*.twig
 *
 * @var $name
 * @var $anscount
 */
#}
<!-- Multiple Choice -->

<!-- answer -->
{# What is the usage of this input ? #}
<input type="hidden" name="MULTI{{ name }}" value="{{ anscount }}" />
<ul class="list-unstyled {{coreClass}} {% if iNbCols > 1 %} ls-column-count-{{iNbCols}}{% endif %}"{% if iNbCols > 1 %} data-column-count={{iNbCols}}{% endif %}>
    {% for aRow in aRows %}
        {% set rowTemplate = aRow.other ? './survey/questions/answer/multiplechoice/rows/answer_row_other.twig' : './survey/questions/answer/multiplechoice/rows/answer_row.twig' %}
        {% include rowTemplate with aRow %}
    {% endfor %}
</ul>
<!-- end of answer -->
</file>

<file path="themes/question/image_select-multiplechoice/survey/questions/answer/multiplechoice/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>image_select-multiplechoice</name>
        <type>question_theme</type>
        <title>Image select multiple choice</title>
        <creationDate>23/12/2016</creationDate>
        <author>LimeSurvey GmbH</author>
        <authorEmail>info@limesurvey.org</authorEmail>
        <authorUrl>http://www.limesurvey.org</authorUrl>
        <copyright>Copyright (C) 2005 - 2016 LimeSurvey Gmbh, Inc. All rights reserved.</copyright>
        <license>GNU General Public License version 2 or later</license>
        <version>1.0</version>
        <apiVersion>1</apiVersion>
        <description>Multiplechoice with images.</description>
        <questionType>M</questionType>
        <group>Multiple choice questions</group>
        <subquestions>1</subquestions>
        <answerscales>0</answerscales>
        <hasdefaultvalues>1</hasdefaultvalues>
        <assessable>1</assessable>
        <class>multiple-opt</class>
    </metadata>
    <compatibility>
        <version>4.0</version>
        <version>5.0</version>
        <version>6.0</version>
        <version>7.0</version>
    </compatibility>
    <files>
... (74 lines truncated)
</file>

<file path="themes/question/image_select-multiplechoice/survey/questions/answer/multiplechoice/translations.php">
<?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
gT("Image select multiple choice");
gT('Show an horizontal scroll for the images instead of a vertical list. Needs JavaScript enabled.');
gT('Horizontal scroll:');
gT('Keep images aspect ratio. Can be achieved by not setting both width and height. Needs JavaScript enabled.');
gT('Keep aspect-ratio');
gT('Crop images to fit into size. Needs JavaScript enabled.');
gT('Crop or resize');
gT('Resize');
gT('Crop');
gT('Fix width of the images to this value. Leave empty to not change them.');
gT('Fix width');
gT('Fix height of the images to this value. Leave empty to not change them.');
gT('Fix height');
</file>

<file path="themes/question/inputondemand/survey/questions/answer/multipleshorttext/rows/answer_row_inputtext.twig">
{#
/**
* Multiple short texts question, item input text Html

* @var $question
* @var $alert
* @var $extraclass
* @var $sDisplayStyle
* @var $myfname
* @var $tiwidth
* @var $prefix
* @var $suffix
* @var $maxlength
* @var $dispVal
* @var $checkconditionFunction
*/
#}

<!--answer_row_inputtext -->
<li id="javatbd{{ myfname }}"
    class="selector--inputondemand-list-item row d-none question-item answer-item text-item mb-3{% if alert %} ls-error-mandatory has-error{% endif %}{{ extraclass }}" {{ sDisplayStyle }} >
    <label class="control-label col-12 col-md-{{ sLabelWidth }} {% if sLabelWidth == 0 %}d-none{% endif %}"
           for="answer{{ myfname }}">
        {{ question }}
    </label>
    <div class="col-12 col-md-{{ sInputContainerWidth }}">

        {% if prefix != '' or suffix != '' %}
        <div class="ls-input-group">
            {% endif %}
... (27 lines truncated)
</file>

<file path="themes/question/inputondemand/survey/questions/answer/multipleshorttext/rows/answer_row_textarea.twig">
{#
/**
 * Multiple short texts question, item text area Html
 * @var $extraclass
 * @var $sDisplayStyle
 * @var $prefix
 * @var $myfname
 * @var $labelText                  $ansrow['question']
 * @var $prefix
 * @var $rows                       $drows.' '.$maxlength
 * @var $checkconditionFunction     $checkconditionFunction.'(this.value, this.name, this.type)'
 * @var $dispVal
 * @var $suffix
 */
#}
<!-- answer_row_textarea -->
<!-- Multiple short texts question, item text area Html -->
<!-- question attribute "display_rows" is set -> we need a textarea to be able to show several rows -->
<li id="javatbd{{ myfname }}"
    class="selector--inputondemand-list-item row d-none question-item answer-item text-item mb-3 {% if alert %} ls-error-mandatory has-error{% endif %}{{ extraclass }}" {{ sDisplayStyle }}>
    <!--  color code missing mandatory questions red -->
    <label class="control-label col-12 col-md-{{ sLabelWidth }} {% if sLabelWidth==0 %}d-none{% endif %}"
           for="answer{{ myfname }}">
        {{ question }}
    </label>


    <div class="col-12 col-md-{{ sInputContainerWidth }}">
        {% if prefix != '' or suffix != '' %}
        <div class="ls-input-group">
... (27 lines truncated)
</file>

<file path="themes/question/inputondemand/survey/questions/answer/multipleshorttext/answer.twig">
{#
/**
 * Multiple short text question Html
 *
 * @var $aRows      : the rows, generated with the views rows/answer_row*.php
 *
 */
#}
<!-- Multiple short text -->

<!-- answer -->
<div class="container-center" id="selector--inputondemand-{{ basename }}">
    <div class="row">
        <div class="col-12">
            <ul id="inputondemand-list-{{ basename }}" class="{{ coreClass }} list-unstyled form-horizontal selector--inputondemand-list" role="group" aria-labelledby="ls-question-text-{{ basename }}">
                {% if aRows is empty %}
                    {% include 'survey/questions/answer/multipleshorttext/empty.twig' %}
                {% else %}
                    {% for aRow in aRows %}
                        {% set rowTemplate = (aRow.textarea ? 'survey/questions/answer/multipleshorttext/rows/answer_row_textarea.twig' : 'survey/questions/answer/multipleshorttext/rows/answer_row_inputtext.twig') %}
                        {% include rowTemplate with aRow %}
                    {% endfor %}
                {% endif %}
            </ul>
        </div>
        <div class="col-12 text-end">
            <button type="button" class="btn btn-outline-secondary selector--inputondemand-addlinebutton" aria-controls="inputondemand-list-{{ basename }}" aria-describedby="inputondemand-addline-description-{{ basename }}">
                {% set riClass = '' %}
                {% if question_template_attribute.addlineicon is same as("plus") %}
                    {% set riClass = 'ri-add-line' %}
... (26 lines truncated)
</file>

<file path="themes/question/inputondemand/survey/questions/answer/multipleshorttext/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>inputondemand</name>
        <type>question_theme</type>
        <title>Input on demand</title>
        <creationDate>10/04/2019</creationDate>
        <author>LimeSurvey GmbH</author>
        <authorEmail>info@limesurvey.org</authorEmail>
        <authorUrl>http://www.limesurvey.org</authorUrl>
        <copyright>Copyright (C) 2005 - 2019 LimeSurvey Gmbh, Inc. All rights reserved.</copyright>
        <license>GNU General Public License version 2 or later</license>
        <version>1.0</version>
        <apiVersion>1</apiVersion>
        <description>Hide not needed input fields in multiple shorttext</description>
        <questionType>Q</questionType>
        <group>Text questions</group>
        <subquestions>1</subquestions>
        <answerscales>0</answerscales>
        <hasdefaultvalues>1</hasdefaultvalues>
        <assessable>0</assessable>
        <class>multiple-short-txt</class>
        <database></database>
    </metadata>
    <compatibility>
        <version>4.0</version>
        <version>5.0</version>
        <version>6.0</version>
        <version>7.0</version>
    </compatibility>
... (47 lines truncated)
</file>

<file path="themes/question/inputondemand/survey/questions/answer/multipleshorttext/empty.twig">
<!-- empty -->
<li class="alert alert-danger">
    {{ gT('Error: This question has no answers.') }}
</li>
</file>

<file path="themes/question/inputondemand/survey/questions/answer/multipleshorttext/translations.php">
<?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
gT("Input on demand");
gT('Automatically add a new line when something is inserted');
gT('Auto-add new line:');
gT('The icon used on the "Add row"-button');
gT("'Add row' icon:");
gT('Plus');
gT('Plus in circle');
gT('Chevron down');
gT('Arrow down');
</file>

<file path="themes/question/ranking_advanced/survey/questions/answer/ranking/rows/answer_row_alt.twig">
{#
/**
 * Ranking question, item Html
 * @var $value
 * @var $selected
 * @var $classes
 * @var $id
 * @var $optiontext
 */
#}

<li class="select-item mb-3">
    <label for="answer{{ myfname }}" class="control-label col-md-4">
        {{ labeltext }}
    </label>
    <div class="col-md-8">
        <select  class='form-select' name="{{ myfname }}" id="answer{{ myfname }}">
            {% for option in options %}
                <option value="{{ option.value }}" {{ option.selected }} class='{{ option.classes }}'>
                    {{ option.optiontext }}
                </option>
            {% endfor %}
        </select>
        <!-- Hidden form: maybe can be replaced with ranking.js -->
        <input type="hidden" id="java{{ myfname }}" disabled="disabled" value="{{ thisvalue }}"/>
    </div>
</li>
</file>

<file path="themes/question/ranking_advanced/survey/questions/answer/ranking/rows/answer_row.twig">
{#
/**
 * Ranking question, item Html
 * @var $value
 * @var $selected
 * @var $classes
 * @var $id
 * @var $optiontext
 */
#}

<li class="select-item mb-3">
    <label for="answer{{myfname}}" class="control-label col-md-4">
        {{labeltext}}
    </label>
    <div class="col-md-8">
        <select  class='form-select' name="{{myfname}}" id="answer{{myfname}}">
            {% for option in options %}
                <option value="{{ option.value }}" {{ option.selected }} class='{{option.classes}}'>
                    {{ option.optiontext }}
                </option>
            {% endfor %}
        </select>
        <!-- Hidden form: maybe can be replaced with ranking.js -->
        <input type="hidden" id="java{{myfname}}" disabled="disabled" value="{{thisvalue}}"/>
    </div>
</li>
</file>

<file path="themes/question/ranking_advanced/survey/questions/answer/ranking/answer_alt.twig">
{#
/**
 * Ranking question, item list header Html
 * @var $sOptions         : the select options, generated with the view answer_row.php
 *
 * @var $name
 * @var $myfname
 * @var $labeltext
 * @var $rankId
 * @var $rankingName
 * @var $max_answers
 * @var $min_answers
 * @var $qid
 * @var $choice_title
 * @var $rank_title
 * @var $rank_help
 * @var $showpopups
 * @var $samechoiceheight
 * @var $samelistheight
 */
#}

<!-- Ranking -->

<!-- answer -->
<div class="{{ coreClass }}">
    <ul class="list-unstyled ls-js-hidden-sr answers-list select-list " role="group" aria-labelledby="ls-question-text-{{ basename }}">
        {# rows/answer_row.twig #}
            {{ sSelects }}
    </ul>
... (38 lines truncated)
</file>

<file path="themes/question/ranking_advanced/survey/questions/answer/ranking/answer.twig">
{#
!!!! BECAREFUL: ONLY FOR TESTING !!!!!
!!!! DON'T START TO TRANSLATE ALL VIEWS BASED ON THIS MODEL !!!!!

!!!! IT WILL PROBABLY FIRST NEED TO CHANGE  THE TWIG TEMPLATE SYNTAX TO AVOID CONFLICT WITH EXPRESSION MANAGER !!!!

/**
 * Ranking question, item list header Html
 *
 * @var $sOptions         : the select options, generated with the view answer_row.php
 *
 * @var $name
 * @var $myfname
 * @var $labeltext
 * @var $rankId
 * @var $rankingName
 * @var $max_answers
 * @var $min_answers
 * @var $qid
 * @var $choice_title
 * @var $rank_title
 * @var $rank_help
 * @var $showpopups
 * @var $samechoiceheight
 * @var $samelistheight
 **** Additional attributes:
 * @var question_template_attribute.show_handle
 * @var question_template_attribute.only_pull
 * @var question_template_attribute.visualize
 */
... (50 lines truncated)
</file>

<file path="themes/question/ranking_advanced/survey/questions/answer/ranking/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>ranking_advanced</name>
        <type>question_theme</type>
        <title>Ranking advanced</title>
        <creationDate>15/11/2017</creationDate>
        <author>LimeSurvey GmbH</author>
        <authorEmail>info@limesurvey.org</authorEmail>
        <authorUrl>http://www.limesurvey.org</authorUrl>
        <copyright>Copyright (C) 2005 - 2017 LimeSurvey Gmbh, Inc. All rights reserved.</copyright>
        <license>GNU General Public License version 2 or later</license>
        <version>1.0</version>
        <apiVersion>1</apiVersion>
        <description>New implementation of the ranking question</description>
        <questionType>R</questionType>
        <group>Mask questions</group>
        <subquestions>1</subquestions>
        <answerscales>0</answerscales>
        <hasdefaultvalues>0</hasdefaultvalues>
        <assessable>1</assessable>
        <class>ranking</class>
    </metadata>
    <compatibility>
        <version>4.0</version>
        <version>5.0</version>
        <version>6.0</version>
        <version>7.0</version>
    </compatibility>
    <files>
... (70 lines truncated)
</file>

<file path="themes/question/ranking_advanced/survey/questions/answer/ranking/translations.php">
<?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
gT("Ranking advanced");
gT('Show a handle for drag and drop');
gT('Show handle:');
gT('Show the actual list numbers');
gT('Show number:');
gT('Allow only moving the answers');
gT('Without reorder:');
gT('Change visualization of the ranking question');
gT('Visualization:');
gT('Blocks');
</file>

<file path="themes/question/ranking_advanced/views/basic.twig">
<div class="container-center">
    <div class="ls-no-js-hidden answers-list{{ samechoiceheight ? " list-samechoiceheight": "" }} {{ samelistheight ? " list-samelistheight": "" }} row" aria-hidden="true">
        {% block choice %}
            <div>
                {% for index, ansrow in  answers %}
                        <p>{{ansrow.answer}}</p>
                {% endfor %}
                <li class="d-none ls-remove"></li>
            </div>
        {% endblock %}

        {% block rank %}
            <div>
            </div>
        {% endblock %}
    </div>
</div>
</file>

<file path="themes/question/ranking_advanced/views/blocks.twig">
{% extends "./views/basic.twig" %}
{% block choice %}
    <div class="col-12 ranking-advanced-available-items">
        <strong class="sortable-subtitle sortable-rank-subtitle">{{choice_title}}</strong>
        <!-- @todo : move htmlblock at the good place -->      
        <div id="sortable-choice-{{qId}}" class="sortable-choice sortable-list ls-flex wrap ls-flex-row display_block_group ">
            {% for ansrow in  answers %}
                <div id="javatbd{{rankingName}}_S{{ansrow.sqid}}" class="ls-choice answer-item sortable-item sortable-enable sortable-button ls-flex sortable-block grabable" data-value="{{ansrow.title}}">
                    <div class="sortable-block-content">
                    {% if show_handle is same as('yes') %} 
                        <i class="fa fa-bars bigIcons grabable selector__dragHandle "></i>
                        <span class="grabable selector__dragHandle d-none">
                            <svg class="" width="9" height="14" viewBox="0 0 9 14" fill="none" xmlns="http://www.w3.org/2000/svg">
                                <path fill-rule="evenodd" clip-rule="evenodd" d="M0.4646 0.125H3.24762V2.625H0.4646V0.125ZM6.03064 0.125H8.81366V2.625H6.03064V0.125ZM0.4646 5.75H3.24762V8.25H0.4646V5.75ZM6.03064 5.75H8.81366V8.25H6.03064V5.75ZM0.4646 11.375H3.24762V13.875H0.4646V11.375ZM6.03064 11.375H8.81366V13.875H6.03064V11.375Z" fill="currentColor"/>
                            </svg>
                        </span>
                        <span class="icon-divider"></span>
                    {% else %}
                    {% endif %}
                    {% if show_number is same as('yes') %} 
                        <b class="selector__index_row"></b>
                    {% endif %}
                    {{ansrow.answer}}
                    </div>
                </div>
            {% endfor %}
            <div class="d-none ls-remove"></div>
        </div>
    </div>
{% endblock %}
... (10 lines truncated)
</file>

<file path="themes/question/ranking_advanced/views/bubbles.twig">
{# Bubbles view is not mature enough for usage yet #}
{% extends "./views/basic.twig" %}
{% block choice %}
    <div class="col-12 ranking-advanced-available-items">
        <p><strong class="sortable-subtitle sortable-rank-subtitle">{{choice_title}}</strong></p>
        <!-- @todo : move htmlblock at the good place -->      
        <div id="sortable-choice-{{qId}}" class="sortable-choice sortable-list display_bubble_group">
            {% for ansrow in  answers %}
                <div id="javatbd{{rankingName}}_S{{ansrow.sqid}}" class="ls-choice answer-item sortable-item sortable-enable grabable display_bubble" data-value="{{ansrow.title}}">
                    {% if show_number is same as('yes') %} 
                        <b class="selector__index_row"></b>
                    {% endif %}
                    {{ansrow.answer}}
                </div>
            {% endfor %}
            <div class="d-none ls-remove"></div>
        </div>
    </div>
{% endblock %}

{% block rank %}
    <div class="col-12 ranking-advanced-sorted-items">
        <p><strong class="sortable-subtitle sortable-rank-subtitle">{{rank_title}}</strong></p>
        <div id="sortable-rank-{{qId}}" class="sortable-rank sortable-list display_bubble_group">
            <div class="d-none ls-remove"></div>
        </div>
    </div>
{% endblock %}
</file>

<file path="themes/question/ranking_advanced/views/buttons.twig">
{% extends "./views/basic.twig" %}
{% block choice %}
    <div class="col-md-6 col-12 ranking-advanced-available-items">
        <strong class="sortable-subtitle sortable-rank-subtitle">{{choice_title}}</strong>
        <!-- @todo : move htmlblock at the good place -->      
        <div id="sortable-choice-{{qId}}" class="sortable-choice sortable-list ">
            {% for ansrow in  answers %}
                {% if show_handle is same as('yes') %} 
                    <div id="javatbd{{rankingName}}_S{{ansrow.sqid}}" class="ls-choice answer-item sortable-item sortable-enable sortable-button btn btn-outline-secondary" data-value="{{ansrow.title}}">
                    <i class="fa fa-bars bigIcons grabable selector__dragHandle "></i>
                    <span class="icon-divider"></span>
                {% else %}
                    <div id="javatbd{{rankingName}}_S{{ansrow.sqid}}" class="ls-choice answer-item sortable-item sortable-enable sortable-button btn btn-outline-secondary grabable" data-value="{{ansrow.title}}">
                {% endif %}
                {% if show_number is same as('yes') %} 
                    <b class="selector__index_row"></b>
                {% endif %}
                    {{ansrow.answer}}
                    
                </div>
            {% endfor %}
            <div class="d-none ls-remove"></div>
        </div>
    </div>
{% endblock %}

{% block rank %}
    <div class="col-md-6 col-12 ranking-advanced-sorted-items">
        <strong class="sortable-subtitle sortable-rank-subtitle">{{rank_title}}</strong>
        <div id="sortable-rank-{{qId}}" class="sortable-rank sortable-list list-group">
... (5 lines truncated)
</file>

<file path="themes/question/ranking_advanced/views/list.twig">
{% extends "./views/basic.twig" %}
{% block choice %}
    <div class="col-md-6 col-6">
        <strong class="sortable-subtitle sortable-rank-subtitle">{{choice_title}}</strong>
        <!-- @todo : move htmlblock at the good place -->      
        <ul id="sortable-choice-{{qId}}" class="sortable-choice sortable-list list-group">
            {% for ansrow in  answers %}
                {% if show_handle is same as('yes') %} 
                    <li id="javatbd{{rankingName}}_S{{ansrow.sqid}}" class="ls-choice list-group-item answer-item sortable-item sortable-enable" data-value="{{ansrow.title}}">
                    <i class="fa fa-bars bigIcons grabable selector__dragHandle "></i>
                    <span class="icon-divider"></span>
                {% else %}
                    <li id="javatbd{{rankingName}}_S{{ansrow.sqid}}" class="ls-choice list-group-item answer-item sortable-item sortable-enable grabable" data-value="{{ansrow.title}}">
                {% endif %}
                {% if show_number is same as('yes') %} 
                    <b class="selector__index_row"></b>
                {% endif %}
                    {{ansrow.answer}}
                </li>
            {% endfor %}
            <li class="d-none ls-remove"></li>
        </ul>
    </div>
{% endblock %}

{% block rank %}
    <div class="col-md-6 col-6">
        <strong class="sortable-subtitle sortable-rank-subtitle">{{rank_title}}</strong>
        <ul id="sortable-rank-{{qId}}" class="sortable-rank sortable-list list-group">
            <li class="d-none ls-remove"></li>
... (4 lines truncated)
</file>

<file path="themes/question/README.md">
# Question templates for LimeSurvey

Coming with the 3.X Version of LimeSurvey you will be able to create your 
own set of question types and alternative views for questions.

All you need to know is a little HTML and XML.
(And for the more advanced stuff also JavaScript and CSS would help.)

## The config.xml

XML config files are very common, a.e. Joomla. The config file for the question-template should contain a few basic things.

### Metadata - Or, what is this about and who has written it?

Your question view or type should have your name and your email on it, so people can ask questions and congratulate you to 
your awesome question type

Also you should give some information about the used licence (remember LimeSurvey is GPL) and a short description.

It makes a lot of sense to write which version of the view it is, to let people know If they would have to update.

Also, there is a difference between `name` and `title` tags.
`name` tag is used to enter a question theme code, without spaces.
`title` tag is used to enter a nice title which would be visible on Question theme dropdown on edit question page.
Both tags are required.

The `metadata` part should therefore look something like this:

```xml
    <metadata>
... (194 lines truncated)
</file>

<file path="themes/survey/bootswatch/css/variations/README.txt">
Files in this directory were taken from https://github.com/thomaspark/bootswatch/tree/v5/dist/
flatly.min.css was modified to load Lato fonts locally and not from Google Fonts.
</file>

<file path="themes/survey/bootswatch/options/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="themes/survey/bootswatch/options/options.js">

</file>

<file path="themes/survey/bootswatch/options/options.twig">
{#
here you can create custom HTML for the surveytheme options page
the default one can be found in application/views/themeOptions/options_core.php
to activate this file replace <optionspage>core</optionspage> with <optionspage>custom</optionspage> in the config.xml of this theme
#}
</file>

<file path="themes/survey/bootswatch/options/README.md">
![LimeSurvey Logo](https://account.limesurvey.org/images/logos/logo_main.png)
# Survey Themes Custom options

Since LimeSurvey 3, Theme providers can now add their own options in a template.
The files options.twig and options.js will be used to render the theme's option page inside the Admin Interface.
For Core Theme, this option page is very basic and simple. So, please, if you're a Theme Provider, try to create your own option page with its own look and feels.
</file>

<file path="themes/survey/bootswatch/scripts/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="themes/survey/bootswatch/views/subviews/content/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="themes/survey/bootswatch/views/subviews/survey/question_subviews/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="themes/survey/bootswatch/views/subviews/survey/question_subviews/question_text_container.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.



    (¯`·._.·(¯`·._.· Question Text Container  ·._.·´¯)·._.·´¯)

    This file render the quetion text.
    The container div itself could often change from a template to another, so we clearly separate it.
    NOTE: see views/subviews/survey/question.twig comments for more infos

#}

<!-- Question text -->
<div class="{{ aSurveyInfo.class.questiontitlecontainer }} bg-primary col-12 " {{ aSurveyInfo.attr.questiontitlecontainer }} >

    {{ include('./subviews/survey/question_subviews/question_text_content.twig') }}

</div>
</file>

<file path="themes/survey/bootswatch/views/subviews/survey/question_subviews/valid_message_and_help.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.



    (¯`·._.·(¯`·._.· Valid message and helper  ·._.·´¯)·._.·´¯)

    This file render the quetion text.
    The container div itself could often change from a template to another, so we clearly separate it.
    NOTE: see views/subviews/survey/question.twig comments for more infos

#}

<!-- LimeSurvey valid message and help -->
<div class="{{ aSurveyInfo.class.questionvalidcontainer }} bg-primary text-info col-12" {{ aSurveyInfo.attr.questionvalidcontainer }}>
    {{ aQuestion.valid_message      | raw }} {# The validation message, eg: "Only numbers may be entered in this field.". This text is inside EM Helper, and can be changed by creating a translation file #}
    {{ aQuestion.man_message        | raw }} {# The question mandatory error message: "This question is mandatory!". This text is inside EM Helper, and can be changed by creating a translation file #}
    {{ aQuestion.file_valid_message | raw }} {# Used only for file upload question type... TODO: check if we can remove it and use valid_message for file upload question type too #}
</div>
</file>

<file path="themes/survey/bootswatch/views/subviews/survey/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="themes/survey/bootswatch/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>bootswatch</name>
        <title>Bootswatch</title>
        <type>theme</type>
        <creationDate>08/01/2016</creationDate>
        <author>LimeSurvey GmbH</author>
        <authorEmail>info@limesurvey.org</authorEmail>
        <authorUrl>http://www.limesurvey.org</authorUrl>
        <copyright>Copyright (C) 2005 - 2025 LimeSurvey Gmbh, Inc. All rights reserved.</copyright>
        <license>GNU General Public License version 2 or later</license>
        <version>3.0</version>
        <apiVersion>3</apiVersion>
        <description><![CDATA[{{gT("Based on BootsWatch Themes:")}} <br><a href='https://bootswatch.com/3/' target='_blank' rel='external' title='{{gT("Visit Bootswatch page in a new window.")}}'>{{gT("Visit Bootswatch page")}} <i class='ri-external-link-line'></i><span class='visually-hidden'>({{gT("Opens in a new window")}})</span></a> ]]></description>
        <lastUpdate>2025-11-25 11:35:00</lastUpdate>
        <extends>vanilla</extends>
    </metadata>
    <compatibility>
        <version>7.0</version>
        <version>6.0</version>
    </compatibility>
    <files>
        <css>
            <replace>css/theme.css</replace>
            <replace>css/custom.css</replace>
        </css>
        <js>
            <replace>scripts/theme.js</replace>
            <replace>scripts/custom.js</replace>
... (55 lines truncated)
</file>
                    <file type="view" role="subview">./subviews/footer/footer.twig</file>
                    <file type="view" role="content">./subviews/content/main.twig</file>
                    <file type="view" role="subview">./subviews/messages/justsaved.twig</file>
                    <file type="view" role="subview">./subviews/survey/group.twig</file>
                    <file type="view" role="subview">./subviews/survey/group_subviews/group_container.twig</file>
                    <file type="view" role="subview">./subviews/survey/group_subviews/group_desc.twig</file>
                    <file type="view" role="subview">./subviews/survey/group_subviews/group_name.twig</file>
                    <file type="view" role="subview">./subviews/survey/question.twig</file>
                    <file type="view" role="subview">./subviews/survey/question_container.twig</file>
                    <file type="view" role="subview">./subviews/survey/question_subviews/question_text_container.twig</file>
                    <file type="view" role="subview">./subviews/survey/question_subviews/question_text_content.twig</file>
                    <file type="view" role="subview">./subviews/survey/question_subviews/answers.twig</file>
                    <file type="view" role="subview">./subviews/survey/question_subviews/survey_question_help.twig</file>
                    <file type="view" role="subview">./subviews/survey/question_subviews/valid_message_and_help.twig</file>
                    <file type="css">./css/theme.css</file>
                    <file type="js">./scripts/theme.js</file>
                    <file type="css">./css/custom.css</file>
                    <file type="js">./scripts/custom.js</file>
                </question>
                <surveylist>
                    <screen_title  type="data"  role="title" twig="on"><![CDATA[ {{gT('Survey list')}} ]]></screen_title>
                    <file type="view" role="layout">layout_survey_list.twig</file>
                    <file type="view" role="subview">./subviews/footer/footer.twig</file>
                    <file type="view" role="subview">./subviews/content/mainrow.twig</file>
                    <file type="view" role="subview">./subviews/content/outerframe.twig</file>
                    <file type="css">./css/theme.css</file>
                    <file type="js">./scripts/theme.js</file>
                    <file type="css">./css/custom.css</file>
                    <file type="js">./scripts/custom.js</file>
                </surveylist>
                <welcome>
                    <screen_title  type="data"  role="title" twig="on"><![CDATA[ {{gT('Welcome')}} ]]></screen_title>
                    <file type="view" role="layout">layout_global.twig</file>
                    <file type="view" role="subview">./subviews/footer/footer.twig</file>
                    <file type="view" role="subview">./subviews/content/mainrow.twig</file>
                    <file type="view" role="subview">./subviews/content/outerframe.twig</file>
                    <file type="view" role="content">./subviews/content/firstpage.twig</file>
                    <file type="view" role="subview">./subviews/header/head.twig</file>
                    <file type="view" role="subview">./subviews/header/custom_header.twig</file>
                    <file type="view" role="subview">./subviews/header/nav_bar.twig</file>
                    <file type="view" role="subview">./subviews/header/progress_bar.twig</file>
                    <file type="view" role="subview">./subviews/messages/welcome.twig</file>
                    <file type="view" role="subview">./subviews/messages/warnings.twig</file>
                    <file type="view" role="subview">./subviews/messages/no_js_alert.twig</file>
                    <file type="view" role="subview">./subviews/privacy/privacy.twig</file>
                    <file type="view" role="subview">./subviews/navigation/language_changer_first_page.twig</file>
                    <file type="css">./css/theme.css</file>
                    <file type="js">./scripts/theme.js</file>
                    <file type="css">./css/custom.css</file>
                    <file type="js">./scripts/custom.js</file>
                </welcome>
                <completed>
                    <screen_title  type="data"  role="title" twig="on"><![CDATA[ {{gT('Completed')}} ]]></screen_title>
                    <file type="view" role="layout">layout_global.twig</file>
                    <file type="view" role="subview">./subviews/footer/footer.twig</file>
                    <file type="view" role="subview">./subviews/content/mainrow.twig</file>
                    <file type="view" role="subview">./subviews/content/outerframe.twig</file>
                    <file type="view" role="content">./subviews/content/submit.twig</file>
                    <file type="css">./css/theme.css</file>
                    <file type="js">./scripts/theme.js</file>
                    <file type="css">./css/custom.css</file>
                    <file type="js">./scripts/custom.js</file>
                </completed>
                <assessments>
                    <screen_title  type="data"  role="title" twig="on"><![CDATA[ {{gT('Assessments')}} ]]></screen_title>
                    <file type="view" role="layout">layout_global.twig</file>
                    <file type="view" role="subview">./subviews/footer/footer.twig</file>
                    <file type="view" role="subview">./subviews/content/mainrow.twig</file>
                    <file type="view" role="subview">./subviews/content/outerframe.twig</file>
                    <file type="view" role="content">./subviews/content/submit.twig</file>
                    <file type="view" role="subview">./subviews/messages/assessments.twig</file>
                    <file type="css">./css/theme.css</file>
                    <file type="js">./scripts/theme.js</file>
                    <file type="css">./css/custom.css</file>
                    <file type="js">./scripts/custom.js</file>
                </assessments>
                <error>
                    <screen_title  type="data"  role="title" twig="on"><![CDATA[ {{gT('Error')}} ]]></screen_title>
                    <file type="view" role="layout">layout_errors.twig</file>
                    <file type="view" role="subview">./subviews/footer/footer.twig</file>
                </error>
                <clearall>
                    <screen_title  type="data"  role="title" twig="on"><![CDATA[ {{gT('Clear all')}} ]]></screen_title>
                    <file type="view" role="layout">layout_global.twig</file>
                    <file type="view" role="subview">./subviews/footer/footer.twig</file>
                    <file type="view" role="subview">./subviews/content/mainrow.twig</file>
                    <file type="view" role="subview">./subviews/content/outerframe.twig</file>
                    <file type="view" role="content">./subviews/content/clearall.twig</file>
                    <file type="css">./css/theme.css</file>
                    <file type="js">./scripts/theme.js</file>
                    <file type="css">./css/custom.css</file>
                    <file type="js">./scripts/custom.js</file>
                </clearall>
                <load>
                    <screen_title  type="data"  role="title" twig="on"><![CDATA[ {{gT('Load')}} ]]></screen_title>
                    <file type="view" role="layout">layout_global.twig</file>
                    <file type="view" role="subview">./subviews/footer/footer.twig</file>
                    <file type="view" role="subview">./subviews/content/mainrow.twig</file>
                    <file type="view" role="subview">./subviews/content/outerframe.twig</file>
                    <file type="view" role="content">./subviews/content/load.twig</file>
                    <file type="css">./css/theme.css</file>
                    <file type="js">./scripts/theme.js</file>
                    <file type="css">./css/custom.css</file>
                    <file type="js">./scripts/custom.js</file>
                </load>
                <save>
                    <screen_title  type="data"  role="title" twig="on"><![CDATA[ {{gT('Save')}} ]]></screen_title>
                    <file type="view" role="layout">layout_global.twig</file>
                    <file type="view" role="subview">./subviews/footer/footer.twig</file>
                    <file type="view" role="subview">./subviews/content/mainrow.twig</file>
                    <file type="view" role="subview">./subviews/content/outerframe.twig</file>
                    <file type="view" role="content">./subviews/content/save.twig</file>
                    <file type="css">./css/theme.css</file>
                    <file type="js">./scripts/theme.js</file>
                    <file type="css">./css/custom.css</file>
                    <file type="js">./scripts/custom.js</file>
                </save>
                <register>
                    <screen_title  type="data"  role="title" twig="on"><![CDATA[ {{gT('Registration')}} ]]></screen_title>
                    <file type="view" role="layout">layout_global.twig</file>
                    <file type="view" role="subview">./subviews/footer/footer.twig</file>
                    <file type="view" role="content">./subviews/content/register.twig</file>
                    <file type="view" role="subview">./subviews/registration/register_error.twig</file>
                    <file type="view" role="subview">./subviews/registration/register_head.twig</file>
                    <file type="view" role="subview">./subviews/registration/register_message.twig</file>
                    <file type="view" role="subview">./subviews/registration/register_success.twig</file>
                    <file type="view" role="subview">./subviews/registration/required.twig</file>
                </register>
                <printanswers>
                    <screen_title  type="data"  role="title" twig="on"><![CDATA[ {{gT('Print answers')}} ]]></screen_title>
                    <file type="view" role="layout">layout_printanswers.twig</file>
                    <file type="view" role="subview">./subviews/content/outerframe.twig</file>
                    <file type="view" role="content">./subviews/content/printanswers.twig</file>
                    <file type="view" role="subview">./subviews/printanswers/printanswers_head.twig</file>
                    <file type="view" role="subview">./subviews/printanswers/printanswers_table.twig</file>
                    <file type="view" role="subview">./subviews/printanswers/printanswers_question.twig</file>
                    <file type="view" role="subview">./subviews/printanswers/printanswers_foot.twig</file>
                </printanswers>
                <statistics_user>
                    <screen_title  type="data"  role="title" twig="on"><![CDATA[ {{gT('Public statistics')}} ]]></screen_title>
                    <file type="view" role="layout">layout_statistics_user.twig</file>
                    <file type="view" role="subview">./subviews/content/outerframe.twig</file>
                    <file type="view" role="content">./subviews/content/statistics_user.twig</file>
                    <file type="view" role="subview">./subviews/statistics_user/statistics_user_head.twig</file>
                    <file type="view" role="subview">./subviews/statistics_user/statistics_user_content.twig</file>
                    <file type="view" role="subview">./subviews/statistics_user/statistics_user_foot.twig</file>
                </statistics_user>
                <pdf>
                    <screen_title  type="data"  role="title" twig="on"><![CDATA[ {{gT('PDF')}} ]]></screen_title>
                    <file type="view" role="layout">layout_print.twig</file>
                </pdf>
                <navigation>
                    <screen_title  type="data"  role="title" twig="on"><![CDATA[ {{gT('Navigation')}} ]]></screen_title>
                    <file type="view" role="layout">layout_global.twig</file>
                    <file type="view" role="subview">./subviews/footer/footer.twig</file>
                    <file type="view" role="content">./subviews/content/main.twig</file>
                    <file type="view" role="subview">./subviews/navigation/ajax_indicator.twig</file>
                    <file type="view" role="subview">./subviews/navigation/clearall_links.twig</file>
                    <file type="view" role="subview">./subviews/navigation/language_changer_top_menu.twig</file>
                    <file type="view" role="subview">./subviews/navigation/navigator.twig</file>
                    <file type="view" role="subview">./subviews/navigation/question_index_menu.twig</file>
                    <file type="view" role="subview">./subviews/navigation/save_links.twig</file>
                </navigation>
                <quotas>
                  <screen_title  type="data"  role="title" twig="on"><![CDATA[ {{gT('Quotas exceeded')}} ]]></screen_title>
                  <file type="view" role="layout">layout_global.twig</file>
                  <file type="view" role="content">./subviews/content/quotas.twig</file>
                  <file type="view" role="subview">./subviews/header/start_form.twig</file>
                </quotas>
                <token>
                  <screen_title  type="data"  role="title" twig="on"><![CDATA[ {{gT('Participant')}} ]]></screen_title>
                  <file type="view" role="layout">layout_user_forms.twig</file>
                  <file type="view" role="content">./subviews/content/userforms.twig</file>
                  <file type="view" role="subview">./subviews/logincomponents/token.twig</file>
                  <file type="view" role="subview">./subviews/logincomponents/captcha.twig</file>
                </token>
            </screens>
            <default_data>
              <survey type="core">
                <name type="data" twig="on"><![CDATA[ {{ gT("Template Sample") }} ]]></name>
                <description type="data" twig="on"><![CDATA[<p>{{ gT('This is a sample survey description. It could be quite long.') }}</p><p>{{ gT("But this one isn't.") }}<p>]]></description>
                <welcome  type="data" twig="on"><![CDATA[<p>{{ gT('Welcome to this sample survey')}} <p> <p> {{ gT('You should have a great time doing this') }} <p> ]]></welcome>
                <therearexquestions  type="data" twig="on"><![CDATA[gT('There are 2 questions in this survey.'])]]></therearexquestions>
                <surveyls_url type="data" twig="on">"https://www.limesurvey.org/"</surveyls_url>
                <surveyls_urldescription type="data" twig="on"><![CDATA[ gT("Some URL description") ]]></surveyls_urldescription>
              </survey>
              <group type="core">
                <name type="data" twig="on"><![CDATA[ {{ gT("Group 1: The first lot of questions") }} ]]></name>
                <description type="data" twig="on"><![CDATA[ {{ gT("This group description is fairly vacuous, but quite important.") }} ]]></description>
              </group>
              <question_1 type="core">
                <code type="data" >'Q1 '</code>
                <text type="data" twig="on"><![CDATA[ {{ gT("How many roads must a man walk down?") }} ]]></text>
                <valid_message type="data" twig="on"><![CDATA[ <div id="vmsg_4496_num_answers" class="em_num_answers emtip error"><span class="fa fa-exclamation-circle" aria-hidden="true"></span> {{ gT("Choose one of the following answers") }} </div> ]]></valid_message>
              </question_1>
              <question_2 type="core">
                <code type="data" >'Q2 '</code>
                <text type="data" twig="on"><![CDATA[ {{ gT("Please explain something in detail:") }} ]]></text>
                <valid_message type="data" twig="on"><![CDATA[<div id="vmsg_4496_num_answers" class="em_num_answers emtip error"><span class="fa fa-exclamation-circle" aria-hidden="true"></span> {{ gT("Hint when response is not valid") }} </div> ]]></valid_message>
              </question_2>
              <assessments  type="core">
                <name type="data" twig="on"><![CDATA[ {{ gT("Welcome to the Assessment") }} ]]></name>
                <message type="data" twig="on"><![CDATA[ {{ gT("You got {TOTAL} points out of 3 possible points.") }} ]]></message>
              </assessments>
              <quotas type="custom" arrayName="aQuotas">
                <sMessage type="data" twig="on"><![CDATA[ {{ gT("Sorry your responses have exceeded a quota on this survey.") }} ]]></sMessage>
                <sUrl type="data">http://limesurvey.org</sUrl>
                <sUrlDescription type="data" twig="on"><![CDATA[ {{ gT("End url") }} ]]></sUrlDescription>
                <bShowNavigator type="data">false</bShowNavigator>
              </quotas>
              <userforms type="custom" arrayName="aForm">
                <sType type="data">token</sType>
              </userforms>
            </default_data>
        </template_editor>
    </engine>
    <updaters disabled="disabled">
    </updaters>
</config>
</file>

<file path="themes/survey/fruity/css/variations/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="themes/survey/fruity/css/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="themes/survey/fruity/files/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="themes/survey/fruity/options/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="themes/survey/fruity/options/options.js">

</file>

<file path="themes/survey/fruity/options/options.twig">
{#
here you can create custom HTML for the surveytheme options page
the default one can be found in application/views/themeOptions/options_core.php
to activate this file replace <optionspage>core</optionspage> with <optionspage>custom</optionspage> in the config.xml of this theme
#}
</file>

<file path="themes/survey/fruity/scripts/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="themes/survey/fruity/views/subviews/content/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="themes/survey/fruity/views/subviews/header/custom_header.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.

    (¯`·._.·(¯`·._.· Custom Header  ·._.·´¯)·._.·´¯)

    If you extend a template, and want to add custom headers (js, css, scripts, meta etc), you'd rather do it here.
    This file is empty in Vanilla, and contains the code for the background option in Fruity
#}

{# Have no-more-tables activated on every screen size or completely off #}
{% if (aSurveyInfo.options.notables == "2" ) %}
    {{ registerTemplateCssFile('./css/noTablesGeneral.css') }}
{% elseif (aSurveyInfo.options.notables == "1" ) %}
    {{ registerTemplateCssFile('./css/noTablesOnMobile.css') }}
{% endif %}

{# Custom background option #}
<style>
    {% if (aSurveyInfo.options.backgroundimage == "on" and imageSrc(aSurveyInfo.options.backgroundimagefile )) %}
        body {
            background-image: url('{{ imageSrc(aSurveyInfo.options.backgroundimagefile ) }}');
            background-attachment: fixed;
... (260 lines truncated)
</file>

<file path="themes/survey/fruity/views/subviews/header/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="themes/survey/fruity/views/subviews/messages/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="themes/survey/fruity/views/subviews/navigation/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="themes/survey/fruity/views/subviews/printanswers/question_types/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="themes/survey/fruity/views/subviews/printanswers/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="themes/survey/fruity/views/subviews/privacy/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="themes/survey/fruity/views/subviews/registration/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="themes/survey/fruity/views/subviews/survey/group_subviews/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="themes/survey/fruity/views/subviews/survey/question_subviews/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="themes/survey/fruity/views/subviews/survey/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="themes/survey/fruity/views/subviews/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="themes/survey/fruity/views/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="themes/survey/fruity/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>fruity</name>
        <title>Fruity</title>
        <type>theme</type>
        <creationDate>08/01/2016</creationDate>
        <author>LimeSurvey GmbH</author>
        <authorEmail>info@limesurvey.org</authorEmail>
        <authorUrl>http://www.limesurvey.org</authorUrl>
        <copyright>Copyright (C) 2005 - 2019 LimeSurvey Gmbh, Inc. All rights reserved.</copyright>
        <license>GNU General Public License version 2 or later</license>
        <version>3.0.1</version>
        <apiVersion>3</apiVersion>
        <description twig="on"><![CDATA[{{gT("A fruity theme for a flexible use. This theme offers monochromes variations and many options for easy customizations.")}}]]></description>
        <lastUpdate>2019-10-24 12:00:00</lastUpdate>
        <extends>vanilla</extends>
    </metadata>
    <compatibility>
        <version>7.0</version>
        <version>6.0</version>
    </compatibility>
    <files>
        <css>
            <add>css/variations/sea_green.css</add>
            <remove>css/noTablesOnMobile.css</remove>
            <replace>css/animate.css</replace>
            <replace>css/theme.css</replace>
            <replace>css/custom.css</replace>
        </css>
... (634 lines truncated)
</file>

<file path="themes/survey/fruity/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="themes/survey/fruity_twentythree/css/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="themes/survey/fruity_twentythree/files/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="themes/survey/fruity_twentythree/options/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="themes/survey/fruity_twentythree/options/options.js">

</file>

<file path="themes/survey/fruity_twentythree/options/options.twig">
{#
here you can create custom HTML for the surveytheme options page
the default one can be found in application/views/themeOptions/options_core.php
to activate this file replace <optionspage>core</optionspage> with <optionspage>custom</optionspage> in the config.xml of this theme
#}
</file>

<file path="themes/survey/fruity_twentythree/scripts/ajaxify.js">
var isIE10 = false;
console.ls.log("isIE10: ", isIE10);
var AjaxSubmitObject = function () {
    var activeSubmit = false;
    var move = '';
    var startLoadingBar = function () {
        //Scroll to the top of the page
        window.scrollTo(0, 0);
        $('#ajax_loading_indicator').css('display', 'block').find('#ajax_loading_indicator_bar').css({
            'width': '20%',
            'display': 'block'
        });
    };
    var endLoadingBar = function () {
        $('#ajax_loading_indicator').css('opacity', '0').find('#ajax_loading_indicator_bar').css('width', '100%');
        setTimeout(function () {
            $('#ajax_loading_indicator').css({
                'display': 'none',
                'opacity': 1
            }).find('#ajax_loading_indicator_bar').css({
                'width': '0%',
                'display': 'none'
            });
        }, 1800);
    };
    var checkScriptNotLoaded = function (scriptNode) {
        if (scriptNode.src) {
            return ($('head').find('script[src="' + scriptNode.src + '"]').length > 0);
        }
        return true;
... (88 lines truncated)
</file>

<file path="themes/survey/fruity_twentythree/scripts/custom.js">

</file>

<file path="themes/survey/fruity_twentythree/scripts/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    <title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="themes/survey/fruity_twentythree/scripts/theme.js">
(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
"use strict";
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
var Bootstrap = _interopRequireWildcard(require("../../../node_modules/bootstrap/dist/js/bootstrap.esm.js"));
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
window.bootstrap = Bootstrap;
},{"../../../node_modules/bootstrap/dist/js/bootstrap.esm.js":14}],2:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;
var timeout;
var A11yHandles = {
  initLiveRegion: function initLiveRegion() {
    var LiveRegion = document.createElement('div');
    LiveRegion.id = 'live-region';
    LiveRegion.classList.add('sr-only');
    LiveRegion.setAttribute('aria-live', 'polite');
    LiveRegion.setAttribute('role', 'status');
    document.body.appendChild(LiveRegion);
  },
  liveAnnounce: function liveAnnounce(message) {
    var liveRegion = document.getElementById('live-region');
    clearTimeout(timeout);
    liveRegion.innerHTML = '';
    timeout = setTimeout(function () {
      liveRegion.innerHTML = '<p>' + message + '</p>';
    }, 500);
  },
... (6675 lines truncated)
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/content/clearall.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.

    (¯`·._.·(¯`·._.· Clear All Content  ·._.·´¯)·._.·´¯)

    This file displays the page shown to a respondent when they have cleared the survey (only show "Restart this survey")

    NOTE: This content is included inside mainrow.twig
#}

<div class='{{ aSurveyInfo.class.clearall }}' {{ aSurveyInfo.attr.clearall }}>
    <div class=" {{ aSurveyInfo.class.clearalldiv }} form-heading" {{ aSurveyInfo.attr.clearalldiv }}>
        <p role="heading" aria-level="2">{{ gT("Answers cleared") }}</p>
        <a href="{{ aSurveyInfo.surveyUrl }}" class="{{ aSurveyInfo.class.clearalla }} btn btn-primary" {{ aSurveyInfo.attr.clearalla }}>{{ gT("Restart this survey") }}</a>
    </div>
</div>
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/content/firstpage.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.

    (¯`·._.·(¯`·._.· Content First Page  ·._.·´¯)·._.·´¯)

    This content is included inside mainrow.twig

#}

{# render the layout_global content block #}

{# Include the alert for no JavaScript #}
{{ include('./subviews/messages/no_js_alert.twig') }}

{# Include the language changer selector #}
{{ include('./subviews/navigation/language_changer_first_page.twig') }}

{# Include the form opening tag #}
{{ include('./subviews/header/start_form.twig') }} <!-- main form -->

    {# This will display the script and the hidden inputs needed for ExpressionScript Engine #}
    {{ aSurveyInfo.EM.ScriptsAndHiddenInputs  }}
... (16 lines truncated)
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/content/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/content/load.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.

    (¯`·._.·(¯`·._.· Save page Content  ·._.·´¯)·._.·´¯)

    This file displays the page shown to a respondent when they save the survey to complete it later.

    Depending on survey config, a navigator allowing user to change their response can be shown, and an end url

    Form data are in: aSurveyInfo.aLoadForm (errors, css classes, captcha, etc)
    To show this data, turn debug mode on and copy the following line to the end of the <body> element in this file:
    {{ dump(aSurveyInfo.aLoadForm ) }} )

    (¯`·._.·(¯`·._.·  Advanced ·._.·´¯)·._.·´¯)

    The form is generated using the Yii function CHtml::form. You must keep it to get the CRSF token.
    Inputs are also generated using the Yii function CHtml. Eg: input textField is generated via CHtml::textField
    You can replace those inputs by pure Html (<input type="text" ... />), just be sure to use the correct options (id, classes, required, etc)
    @see: http://www.yiiframework.com/wiki/48/by-example-chtml/ , http://www.yiiframework.com/doc/api/1.1/CHtml

    NOTE: see layout_global.twig for more infos
    NOTE: This content is included inside mainrow.twig
... (115 lines truncated)
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/content/main.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.



    (¯`·._.·(¯`·._.·  Main Content  ·._.·´¯)·._.·´¯)

    This is the main content of the template.
    It is the file used to display groups and questions.

    NOTE: This content is included inside mainrow.twig
    NOTE: see layout_global.twig for more infos
#}

{# Include the form opening tag #}
{{ include('./subviews/header/start_form.twig') }} <!-- main form -->

    {# This will display the script and the hidden inputs needed for ExpressionScript Engine #}
    {{ aSurveyInfo.EM.ScriptsAndHiddenInputs  }}

    {# Include the alert for no JavaScript #}
    {{ include('./subviews/messages/no_js_alert.twig') }}
... (28 lines truncated)
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/content/mainrow.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.

    (¯`·._.·(¯`·._.· Main Row  ·._.·´¯)·._.·´¯)

#}

<!-- Main Row -->
<div id="{{ aSurveyInfo.id.mainrow }}" {{ aSurveyInfo.attr.mainrow }} >
    <!-- Main Col -->
    <div class="{{ aSurveyInfo.class.maincol }} col-centered  space-col" id="{{ aSurveyInfo.id.maincol }}" {{ aSurveyInfo.attr.maincol }}>

        {# This is the main block that will be replaced/extended by other layouts#}
            {# Include the various Warnings (preview mode, unanswered mandatory questions, etc) #}
            {{ include('./subviews/messages/warnings.twig') }}
            {# Include the just saved success #}
            {{ include('./subviews/messages/justsaved.twig') }}

            {# Which file to include for content is decided inside the layout #}
            {% if(include_content) != "./subviews/content/" %}
                {{ include(include_content) }}
            {% endif %}
... (5 lines truncated)
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/content/optin.twig">
<p>{{ aSurveyInfo.optin_message }} </p>
{% if aSurveyInfo.optin_link %}
    <p><a href="{{ aSurveyInfo.optin_link }}" class="btn btn-outline-secondary btn-lg"> {{ gT("I confirm") }} </a><p>
{% endif %}
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/content/optout.twig">
<p>{{ aSurveyInfo.optin_message }} </p>
{% if aSurveyInfo.optin_post_link is defined and aSurveyInfo.optin_post_link %}
    {% set htmlOptions = {
        'id'    : 'form-optout',
        'class' : 'ls-form',
    } %}
    {{
        C.Html.form(
            ( aSurveyInfo.optin_post_link ),
            'post',
            (htmlOptions)
        )
    }}
        <p><button type="submit" class="btn btn-outline-secondary btn-lg"> {{ gT("I confirm") }} </button></p>
    </form>
{% elseif aSurveyInfo.optin_link %}
    <p><a href="{{ aSurveyInfo.optin_link }}" class="btn btn-outline-secondary btn-lg"> {{ gT("I confirm") }} </a></p>
{% endif %}
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/content/outerframe.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.



    (¯`·._.·(¯`·._.· Outer Frame  ·._.·´¯)·._.·´¯)

    This div will often change from a template to another.
    So, to keep changes between ls-inherited templates as slightly as possible, we put it in a separated file

#}

<!-- outer frame container -->
<div role="main" class="{{ aSurveyInfo.class.outerframe }} container-fluid"
     id="{{ aSurveyInfo.id.outerframe }}" {{ aSurveyInfo.attr.outerframe }} >
    <div class="row">
        <div class="col-centered col-xl-8">
            {# Which file to include for content is decided inside the layout #}
            {% include './subviews/content/mainrow.twig' with {'include_content': include_content } %}
        </div>
    </div>
</div>
... (1 lines truncated)
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/content/printanswers.twig">
{# 
    LimeSurvey 
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved. 
    License: GNU/GPL License v2 or later, see LICENSE.php 
    LimeSurvey is free software. This version may have been modified pursuant 
    to the GNU General Public License, and as distributed it includes or 
    is derivative of works licensed under the GNU General Public License or 
    other free or open source software licenses. 
    See COPYRIGHT.php for copyright notices and details. 
 
    (¯`·._.·(¯`·._.· Print answers Layout  ·._.·´¯)·._.·´¯) 
 
    This file displays the page shown to user when a participant registers for taking a survey. 
 
    NOTE: see layout_main.twig for more infos 
#}<section> 
        {% if (aSurveyInfo.printPdf != 1) %} 
            {# This will display the script and the hidden inputs needed for ExpressionScript Engine #} 
            {{ aSurveyInfo.EM.ScriptsAndHiddenInputs  }} 
        {% endif %} 
 
        {{ include('./subviews/printanswers/printanswers_head.twig') }} 
        {{ include('./subviews/printanswers/printanswers_table.twig') }} 
        {{ include('./subviews/printanswers/printanswers_foot.twig') }} 
    </section>
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/content/quotas.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.

    (¯`·._.·(¯`·._.· Quotas Content  ·._.·´¯)·._.·´¯)

    This file displays the page shown to user when a quota limit is reached.
    Depending on survey config, a navigator allowing the respondent to change their responses can be shown, and an end url.

    Quotas data are in: aSurveyInfo.aQuotas
    To show this data, turn debug mode on and copy the following line to the end of the <body> element in this file:
    {{ dump(aSurveyInfo.aQuotas ) }} )

    NOTE: This content is included inside mainrow.twig
    NOTE: see layout_global.twig for more infos
#}


    {# Include the form opening tag #}
    {{ include('./subviews/header/start_form.twig') }} <!-- main form -->

        {# This will display the script and the hidden inputs needed for ExpressionScript Engine #}
        {{ aSurveyInfo.EM.ScriptsAndHiddenInputs  }}
... (79 lines truncated)
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/content/README.md">
![LimeSurvey Logo](https://account.limesurvey.org/images/logos/logo_main.png)
# LimeSurvey Bootstrap Vanilla Survey Theme

## content directory


layout_global.twig renders the specific content via this statement:
```
{% set sViewContent =  './subviews/content/' ~ aSurveyInfo.include_content ~ '.twig'%}
{% include './subviews/content/outerframe.twig' with {'include_content': sViewContent } %}
```

see: https://github.com/LimeSurvey/LimeSurvey/blob/7ffc17fbb872791a9ba1a6b6ab68cec0263f3eca/themes/survey/vanilla/views/layout_global.twig#L103-L111

Here are the subviews to render the content. Most of them corresponds to the old pstpl files for limesurvey 2.x

* mainrow.twig
* submit_preview.twig  
* quotas.twig
* survey_list.twig
* clearall.twig
* register.twig
* firstpage.twig
* load.twig
* outerframe.twig
* submit.twig
* save.twig
* main.twig


... (5 lines truncated)
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/content/register.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.

    (¯`·._.·(¯`·._.· Registration Content  ·._.·´¯)·._.·´¯)

    This file displays the page shown to user when a participant registers for taking a survey.
    
    NOTE: This content is included inside mainrow.twig
    NOTE: see layout_global.twig for more infos
#}
    <div class="{{ aSurveyInfo.class.register }} container" {{ aSurveyInfo.attr.register }}>
        {# This will display the script and the hidden inputs needed for ExpressionScript Engine #}
        {{ aSurveyInfo.EM.ScriptsAndHiddenInputs  }}

        <div class="{{ aSurveyInfo.class.registerrow }} row" {{ aSurveyInfo.attr.registerrow }}>
            <div class='{{ aSurveyInfo.class.registerrowjumbotron }}' {{ aSurveyInfo.attr.registerrowjumbotron }}>
                <div class="{{ aSurveyInfo.class.registerrowjumbotrondiv }} clearfix" {{ aSurveyInfo.attr.registerrowjumbotrondiv }}>
                    {{ include('./subviews/registration/register_head.twig') }}
                    {{ include('./subviews/registration/register_message.twig') }}
                </div>
            </div>
        </div>
... (7 lines truncated)
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/content/save.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.

    (¯`·._.·(¯`·._.· Save page Content  ·._.·´¯)·._.·´¯)

    This file displays the page shown to a respondent when they save the survey to complete later.

    Depending on survey config, a navigator allowing the respondent to change their responses can be shown, and an end url.

    Form data are in: aSurveyInfo.aSaveForm (errors, css classes, captcha, etc)
    To show this data, turn debug mode on and copy the following line to the end of the <body> element in this file:
    {{ dump(aSurveyInfo.aSaveForm ) }} )

    (¯`·._.·(¯`·._.·  Advanced ·._.·´¯)·._.·´¯)

    The form is generated using the Yii function CHtml::form. You must keep it to get the CRSF token.
    Inputs are also generated using the Yii function CHtml. Eg: input textField is generated via CHtml::textField
    You can replace those inputs by pure Html (<input type="text" ... />), just be sure to use the correct options (id, classes, required, etc)
    @see: http://www.yiiframework.com/wiki/48/by-example-chtml/ , http://www.yiiframework.com/doc/api/1.1/CHtml

    NOTE: This content is included inside mainrow.twig
    NOTE: see layout_global.twig for more infos
... (214 lines truncated)
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/content/statistics_user.twig">
{# 
    LimeSurvey 
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved. 
    License: GNU/GPL License v2 or later, see LICENSE.php 
    LimeSurvey is free software. This version may have been modified pursuant 
    to the GNU General Public License, and as distributed it includes or 
    is derivative of works licensed under the GNU General Public License or 
    other free or open source software licenses. 
    See COPYRIGHT.php for copyright notices and details. 
 
    (¯`·._.·(¯`·._.· Public Statistics Layout  ·._.·´¯)·._.·´¯) 
 
    This file displays the page shown to user when viewing the statistics after taking a survey. 
 
    NOTE: see layout_main.twig for more infos 
#}<section> 
        {{ include('./subviews/statistics_user/statistics_user_head.twig') }} 
        {{ include('./subviews/statistics_user/statistics_user_content.twig') }} 
        {{ include('./subviews/statistics_user/statistics_user_foot.twig') }} 
    </section>
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/content/submit_preview.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.

    (¯`·._.·(¯`·._.· Submit Preview Content  ·._.·´¯)·._.·´¯)

    TODO: this file should be merged with layout_submit,
    adding the warning message "Your survey responses have not been recorded. This survey is not yet active." to  aSurveyInfo.errorHtml.messages

    NOTE: This content is included inside mainrow.twig
    NOTE: see layout_global.twig for more infos
#}
{% extends "./subviews/content/submit.twig" %}
{% block endtext %}
    <div class="alert alert-warning"><strong class="h4 text-danger">{{ gT("Responses were not saved") }} </strong>
        {{ gT("Your survey responses have not been recorded. This survey is not yet active.") }}
    </div>
    {{ parent() }}
{% endblock %}
{% block printanswer %}
    {#  Link to Print Answer Preview #}
    {% if (aSurveyInfo.aCompleted.aPrintAnswers.show == true) %}
        <!--  Link to Print Answer Preview -->
... (28 lines truncated)
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/content/submit.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.

    (¯`·._.·(¯`·._.· Submit Content  ·._.·´¯)·._.·´¯)

    This page is displayed after user submits the survey.
    It could be, visually, very different (no header, etc).

    It shows the end text, assessments, print answer, and statistics.

    Data are in: aSurveyInfo.aCompleted and aSurveyInfo.aAssessments.
    To show this data, turn debug mode on and copy the following line to the end of the <body> element in this file:
    {{ dump(aSurveyInfo.aCompleted ) }}

    NOTE: This content is included inside mainrow.twig
    NOTE: see layout_global.twig for more infos
#}

{# include the form opening tag #}
<!-- main form -->
{{ include('./subviews/header/start_form.twig') }}
    {# This will display the script and the hidden inputs needed for ExpressionScript Engine #}
... (56 lines truncated)
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/content/userforms.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.

    (¯`·._.·(¯`·._.· User Forms Layout  ·._.·´¯)·._.·´¯)

    This file renders the user forms such as: token (survey participant), and register.

    NOTE: see layout_global.twig for more infos
#}

<!-- Main Row -->
<div id="{{ aSurveyInfo.id.mainrow }}" {{ aSurveyInfo.attr.mainrow }}>

    <!-- Main Col -->
    <div class="{{ aSurveyInfo.class.maincol }} col-centered " id="{{ aSurveyInfo.id.maincol }}" {{ aSurveyInfo.attr.maincol }}>
        {{ include('./subviews/navigation/language_changer_form.twig') }}
        <div class='{{aSurveyInfo.aForm.sType}}-page' {{ aSurveyInfo.attr.maincoldiv }}>
                {% set sUserformContent =  './subviews/logincomponents/' ~ aSurveyInfo.aForm.sType ~ '.twig' %}
                {% include sUserformContent %}
        </div>
    </div> <!-- main col -->
</div> <!-- main row -->
... (1 lines truncated)
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/footer/footer.twig">
{#
Add your footer in this file.

You will need to add custom CSS to make this work, for example, the following
should work for a bottom-aligned footer in all browsers that properly support
flex:

body {
     padding-bottom: 0; /* no bottom padding, footer should be bottom aligned */
     padding-top: 60px;/* now is redefine in JS to fit any title length */
     flex-direction: column; /* article, then footer */
     display: flex; /* flex, to extend the content to full size */
     min-height: 100vh; /* full height, to bottom-align footer */
}
body > article {
    flex: 1; /* the main article should use as much space as possible */
}

#}
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/header/custom_header.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.

    (¯`·._.·(¯`·._.· Custom Header  ·._.·´¯)·._.·´¯)

    If you extend a template, and want to add custom headers (js, css, scripts, meta etc), you'd rather do it here.
    This file is empty in Vanilla, and contains the code for the background option in Fruity
#}

{# Custom background option #}
<style>
    {% if (aSurveyInfo.options.backgroundimage == "on" and imageSrc(aSurveyInfo.options.backgroundimagefile )) %}
        body {
            background-image: url('{{ imageSrc(aSurveyInfo.options.backgroundimagefile ) }}');
            background-attachment: fixed;
            background-size: cover;

        }

        body .top-container {
            background-color: rgba(236, 240, 241, 0.2);
        }
... (156 lines truncated)
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/header/google_analytics.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.

    (¯`·._.·(¯`·._.· Google Analytics  ·._.·´¯)·._.·´¯)

    This file generates the scripts for Google Analytics, as set by user in survey settings.
    See: survey settings
#}
{% if aSurveyInfo.googleanalyticsapikey  is defined and aSurveyInfo.googleanalyticsapikey and aSurveyInfo.googleanalyticsstyle %}
    {# Check if the tracking ID is a Universal Analytics (legacy) or a Google Analytics 4 ID #}
    {% if aSurveyInfo.googleanalyticsapikey starts with 'UA-' %}
        {# Legacy UA #}
        {% if aSurveyInfo.googleanalyticsstyle  is defined and aSurveyInfo.googleanalyticsstyle == 1 %}
            <script>
            (function(i,s,o,g,r,a,m){ i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
                (i[r].q=i[r].q||[]).push(arguments) },i[r].l=1*new Date();a=s.createElement(o),
                m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
            })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

            ga('create', '{{aSurveyInfo.googleanalyticsapikey}}', 'auto');  // Replace with your property ID.
            ga('send', 'pageview');
            </script>
... (31 lines truncated)
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/header/head.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.

    (¯`·._.·(¯`·._.· Header  ·._.·´¯)·._.·´¯)

    This file generates the headers.
    Most of the time, it is not the right place to add your own JS/CSS - instead, use the config.xml file for that.
#}

{% if(aSurveyInfo.jYesNo) %}
    {{ registerScript('activateConfirmLanguage',"$.extend(LSvar.lang," ~ aSurveyInfo.jYesNo ~ ")", "POS_BEGIN") }}
{% endif %}
{{ registerScript('activateActionLink',"activateActionLink();", "POS_POSTSCRIPT") }}

<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="generator" content="LimeSurvey http://www.limesurvey.org" />

    {{ aSurveyInfo.metas }}

... (43 lines truncated)
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/header/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/header/nav_bar.twig">
{#
LimeSurvey
Copyright (C) 2007-2026 The LimeSurvey Project Team
All rights reserved.
License: GNU/GPL License v2 or later, see LICENSE.php
LimeSurvey is free software. This version may have been modified pursuant
to the GNU General Public License, and as distributed it includes or
is derivative of works licensed under the GNU General Public License or
other free or open source software licenses.
See COPYRIGHT.php for copyright notices and details.

(¯`·._.·(¯`·._.· Bootstrap Navigation Bar ·._.·´¯)·._.·´¯)

This file renders a typical bootstrap navigation bar.
See: https://getbootstrap.com/components/#navbar

For the survey navigator ("Next", "Back", etc.), see: navigation/navigator.twig
#}
{% if not aSurveyInfo.popupPreview %}
    <!-- Bootstrap Navigation Bar -->
    <header role="banner" id="survey-nav" class="navbar fixed-top">
        <div class="container-fluid col-xl-8">
            {% if( aSurveyInfo.options.brandlogo == "on") %}
                <div class="navbar-brand logo-container">
                    {{ image(aSurveyInfo.options.brandlogofile, '', {"class": "logo img-fluid"}) }}
                </div>
            {% endif %}
            <div id="navbar-menu" class="dropdown ms-auto ls-no-js-hidden">
                {% if( aSurveyInfo.aNavigator.load.show == "Y" or
                    aSurveyInfo.aNavigator.save.show == "Y" or
... (29 lines truncated)
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/header/progress_bar.twig">
{#
LimeSurvey
Copyright (C) 2007-2026 The LimeSurvey Project Team
All rights reserved.
License: GNU/GPL License v2 or later, see LICENSE.php
LimeSurvey is free software. This version may have been modified pursuant
to the GNU General Public License, and as distributed it includes or
is derivative of works licensed under the GNU General Public License or
other free or open source software licenses.
See COPYRIGHT.php for copyright notices and details.

(¯`·._.·(¯`·._.· Top Container·._.·´¯)·._.·´¯)

This file generates the top container. It's above the form itself, and contains the progress bar.
The progress bar is a Bootstrap progress bar.
@see: http://getbootstrap.com/components/#progress
#}
{# do not show if : All in one or is not Y or on aCompleted #}
{% if aSurveyInfo.showprogress == 'Y' and aSurveyInfo.format != 'A' and not aSurveyInfo.aCompleted %}
        {% set progressValue = aSurveyInfo.progress.value|default(0) %}
    <!-- Top container -->
    <div class="{{ aSurveyInfo.class.topcontainer }} container-fluid" {{ aSurveyInfo.attr.topcontainer }} >
        <div class="row justify-content-center">
            <div class="{{ aSurveyInfo.class.topcontent }} col-12 col-xl-8" {{ aSurveyInfo.attr.topcontent }}>
                <div id="progressbar-top" tabindex="0" role="progressbar" aria-label="{{ gT('Progress percentage') }}" aria-valuenow="{{ progressValue }}" aria-valuemin="0" aria-valuemax="100" class="ls-progress-container" data-bs-toggle="tooltip" data-bs-placement="bottom"
                     title="{{ sprintf(gT('You have completed %s%% of this survey'),progressValue) }}">
                    <div class="visually-hidden">{{ sprintf(gT('You have completed %s%% of this survey'),progressValue) }}</div>
                    <div class="{{ aSurveyInfo.class.progress }}" {{ aSurveyInfo.attr.progress }} aria-hidden="true" data-bs-placement="bottom">
                        <div class="{{ aSurveyInfo.class.progressbar }}" {{ aSurveyInfo.attr.progressbar }} style="width: {{ progressValue }}%;">
                        </div>
... (7 lines truncated)
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/header/start_form.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.

    (¯`·._.·(¯`·._.· Start Form ·._.·´¯)·._.·´¯)

    This file generates the opening form tag and the CRSF token for the main survey Form.
    eg:
        <form enctype="multipart/form-data" id="limesurvey" name="limesurvey" autocomplete="off" class="survey-form-container" action="index.php/289445" method="post">
        <input type="hidden" value="393e1f3e91d6fb062b8c67d39771bb674de337ca" name="YII_CSRF_TOKEN">

    It uses the Yii function CHtml::form
    @see: http://www.yiiframework.com/doc/api/1.1/CHtml#form-detail

    The hidden submit button is used for any submission (triggered via JS event).
#}

{#
    array of attributes of the form tag.
    To add a new attribute, just add an entry:
    'attribute' : 'value',
#}
{% set htmlOptions = {
... (42 lines truncated)
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/logincomponents/captcha.twig">
<div class="{{ aSurveyInfo.class.maincoldivdiva }} form-heading" {{ aSurveyInfo.attr.maincoldivdiva }}>
    {% block formheading %}
        {{ gT("Before you start, please prove you are human.") }}
    {% endblock %}
</div>
<div class="{{ aSurveyInfo.class.maincoldivdivb }} " {{ aSurveyInfo.attr.maincoldivdivb }}>

    {% block description %}
        
    {% endblock %}

    {% if  not empty(aSurveyInfo.aForm.aEnterErrors) %}
        <ul class='{{ aSurveyInfo.class.maincoldivdivbul }} alert alert-danger list-unstyled mt-3' {{ aSurveyInfo.attr.maincoldivdivbul }}>
            {% for  key, error in aSurveyInfo.aForm.aEnterErrors %}
                <li>{{ error }}</li>
            {% endfor %}
        </ul>
    {% endif %}

    <div class="form-{{ aSurveyInfo.aForm.sType }} {{ aSurveyInfo.class.maincoldivdivbdiv }}" {{ aSurveyInfo.attr.maincoldivdivbdiv }} >
        {#
            array of attributes of the form tag.
            To add a new attribute, just add an entry:
            'attribute' : 'value',
        #}
        {%
            set htmlOptions = {
                'id'          : 'form-' ~ aSurveyInfo.aForm.sType ,
                'name'        : 'limesurvey',
                'class'       : 'ls-form form form-horizontal',
... (50 lines truncated)
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/logincomponents/token_privacy.twig">
{% extends './subviews/privacy/privacy.twig' %}
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/logincomponents/token.twig">
{% extends "./subviews/logincomponents/captcha.twig" %}

    {% block formheading %}
        {{ gT("Please enter your access code to participate in this survey.") }}
    {% endblock %}

    {% block description %}
        <div class="col-lg-12">
            <p class='{{ aSurveyInfo.class.maincoldivdivbp }} alert alert-info' {{ aSurveyInfo.attr.maincoldivdivbp }}>
                {% if aSurveyInfo.aForm.token == null %}
                    {{ gT("If you have been issued an access code, please enter it in the box below and click continue.") }}
                {% else %}
                    {{ gT("Please confirm the access code by answering the security question below and click continue.") }}
                {% endif %}
            </p>
        </div>
    {% endblock %}


    {% block formcontent %}
        <div class="col-lg-12">
            <span class="{{ aSurveyInfo.class.maincolformmandatoryinfo }}" {{ aSurveyInfo.attr.maincolformmandatoryinfo }}>
                {{ sprintf(gT("Fields marked with %s are mandatory."), '<span class="' ~ aSurveyInfo.class.maincolformmandatoryinfoasterisk ~ '">*</span>') }}
            </span>
            <div class='{{ aSurveyInfo.class.maincolform }}' {{ aSurveyInfo.attr.maincolform }}>
                <label class='{{ aSurveyInfo.class.maincolformlabel }} control-label' {{ aSurveyInfo.attr.maincolformlabel }}>
                    <small class="{{ aSurveyInfo.class.maincolformlabelsmall }} text-danger asterisk ri-asterisk float-start small " {{ aSurveyInfo.attr.maincolformlabelsmall }} ></small>
                    {{ gT("Access code:") }}
                    <span class="{{ aSurveyInfo.class.maincolformlabelspan }} visually-hidden asterisk " {{ aSurveyInfo.attr.maincolformlabelspan }}>
                    ( {{ gT("Mandatory") }} )
... (94 lines truncated)
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/messages/assessments.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.



    (¯`·._.·(¯`·._.·  Assessments ·._.·´¯)·._.·´¯)

    This file renders the results of Assessments.
    The data are inside aSurveyInfo.aAssessments.datas
#}

{% set aAssessments = aSurveyInfo.aAssessments.datas %}
<!-- Assessments -->
<div class="{{ aSurveyInfo.class.assessmenttable }} border" {{ aSurveyInfo.attr.assessmenttable }} role="region" aria-labelledby="ls-assessment-heading">

    <!-- Heading -->
    <div class="{{ aSurveyInfo.class.assessmentheading }} border-bottom-0 border-top p-2" {{ aSurveyInfo.attr.assessmentheading }} id="ls-assessment-heading" role="heading" aria-level="2">
        {{ gT("Your assessment") }}
    </div>

    <!-- Results -->
    <div class="{{ aSurveyInfo.class.assessmentscontainer }} border-bottom-0 border-top p-2" {{ aSurveyInfo.attr.assessmentscontainer }} >
... (47 lines truncated)
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/messages/bootstrap_alert_modal.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.



    (¯`·._.·(¯`·._.·  Bootstrap Modal Alert ·._.·´¯)·._.·´¯)

    This is the modal that shows most of the alert messages.
    The conversion from pure JavaScript alert to Bootstrap modal is done in theme-core.js

    About Bootstrap modal, see: http://getbootstrap.com/javascript/#modals
#}



{# Register script for modal #}
{% if( empty(json_decode(aSurveyInfo.jPopup)) == false ) %}
    {{ registerScript('startPopup',"LSvar.startPopups = " ~ aSurveyInfo.jPopup , "POS_HEAD") }}
    {{ registerScript('showStartPopups',"window.templateCore.alertSurveyDialog(" ~ aSurveyInfo.jPopup ~ ");", "POS_END") }}
    {{ registerScript('activateSoftMandatory',"activateSoftMandatory();", "POS_END") }}
{% endif %}

... (44 lines truncated)
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/messages/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/messages/justsaved.twig">
{% if (intval(aSurveyInfo.options.showpopups) >= 0 and aSurveyInfo.saved.text) %}
    {% set savedClass = 'success' %}
    {% if (not aSurveyInfo.saved.success) %}
        {% set savedClass = 'error' %}
    {% endif %}
    {% if (aSurveyInfo.active != "Y") %}
        {% set savedClass = 'info' %}
    {% endif %}
    <div class="alert alert-{{ savedClass }} alert-dismissible fade in{% if(intval(aSurveyInfo.options.showpopups) > 0) %} ls-js-hidden{% endif %} " role="alert">
        <button class="btn-close ls-no-js-hidden" data-bs-dismiss="alert"><span class="visually-hidden">{{ gT("Close") }}</span></button>
        {{ aSurveyInfo.saved.text }}
    </div>
{% endif %}
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/messages/no_js_alert.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.

    (¯`·._.·(¯`·._.· No JavaScript Alert  ·._.·´¯)·._.·´¯)

    If JavaScript is not enabled, this alert will appear on the screen.

#}


<!-- No JavaScript alert -->
<div class='{{ aSurveyInfo.class.nojs  }} alert alert-danger '  {{ aSurveyInfo.attr.nojs  }} data-type='checkjavascript'>
    {{
        "Caution: JavaScript execution is disabled in your browser or for this website. You may not be able to answer all questions in this survey. Please, verify your browser parameters."
        | t
    }}
</div>
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/messages/warnings.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.



    (¯`·._.·(¯`·._.· Warnings  ·._.·´¯)·._.·´¯)

    Show various warnings on top of the form

    Error Html warnings can be:
        - One or more mandatory questions have not been answered. You cannot proceed until these have been completed.
        - One or more questions have not been answered in a valid manner. You cannot proceed until these answers are valid.
        - One or more uploaded files are not in proper format/size. You cannot proceed until these files are valid.

    The easiest way to change the text in the warnings is to create a new translation.

    These warnings are complementary to the popup ones. If you're using popups (set in config file), and then don't want to show these alerts, you can uncomment the hiddenClass checker
#}

{# Preview mode warning #}
{% if (aSurveyInfo.active != 'Y') and (not aSurveyInfo.popupPreview) %}
    <!-- Preview mode warning -->
... (20 lines truncated)
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/messages/welcome.twig">
{#
LimeSurvey
Copyright (C) 2007-2026 The LimeSurvey Project Team
All rights reserved.
License: GNU/GPL License v2 or later, see LICENSE.php
LimeSurvey is free software. This version may have been modified pursuant
to the GNU General Public License, and as distributed it includes or
is derivative of works licensed under the GNU General Public License or
other free or open source software licenses.
See COPYRIGHT.php for copyright notices and details.


(¯`·._.·(¯`·._.·  Welcome page ·._.·´¯)·._.·´¯)

This view is used to render the welcome message in All In One mode.
TODO: use it for other modes too

In this file, you have access to the array aSurveyInfo that contains the datas of the current survey
To see what's inside aSurveyInfo, turn debug mode on and copy the following line to the end of this file:
{{ dump(aSurveyInfo) }}
#}

<!-- Welcome Message -->
<div id="{{ aSurveyInfo.id.welcomecontainer }}" class="{{ aSurveyInfo.class.welcomecontainer }}" {{ aSurveyInfo.attr.welcomecontainer }}>

    <!-- Survey Name -->
    <h1 class="{{ aSurveyInfo.class.surveyname }} large-heading mt-0" {{ aSurveyInfo.attr.surveyname }} >
        {{ processString(aSurveyInfo.name,1) }}
    </h1>

... (27 lines truncated)
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/navigation/ajax_indicator.twig">
<script>
    $.ajaxSetup({
        beforeSend:function(){
            // show gif here, eg:
            $("#ajax-loading").show();
        },
        complete:function(){
            // hide gif here, eg:
            $("#ajax-loading").hide();
        }
    });
</script>
<div id="ajax-loading" hidden></div>
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/navigation/back.twig">
<li class="index-item">
    <a class="back-link nav-link" href="#">{{ gT('Back') }}</a>
</li>
<li>
    <hr class="dropdown-divider">
</li>
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/navigation/clearall_buttons.twig">
{#
    This file is part of LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    This file render the exit button accessible without javascript
#}

<div class="{{ aSurveyInfo.class.clearallwrapper }} mb-3 pe-2">
    <a href="#" class='{{ aSurveyInfo.class.clearallbutton }} btn btn-outline-secondary'
       data-bs-toggle="modal"
       data-bs-target="#clear-all-modal"
       data-limesurvey-submit='{ "clearall":"clearall" }'
       data-confirmedby='{ "confirm-clearall":"confirm" }'>
        {{ gT("Exit and clear survey" ) }}
    </a>
</div>
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/navigation/clearall_links.twig">
{#
LimeSurvey
Copyright (C) 2007-2026 The LimeSurvey Project Team
All rights reserved.
License: GNU/GPL License v2 or later, see LICENSE.php
LimeSurvey is free software. This version may have been modified pursuant
to the GNU General Public License, and as distributed it includes or
is derivative of works licensed under the GNU General Public License or
other free or open source software licenses.
See COPYRIGHT.php for copyright notices and details.

(¯`·._.·(¯`·._.· Clear all links: Shows the exit button ·._.·´¯)·._.·´¯)

This file render the exit button for top menu bar
#}

{# It must not be shown once survey is completed #}
{# aSurveyInfo.options.bShowClearAll is a user option to decide if the "exit and clear" button should be shown #}
{# aSurveyInfo.bShowClearAll is define in core, so if option is on, it's not shown in welcome and submit page. #}


 {% if aSurveyInfo.bShowClearAll == true or aSurveyInfo.bShowClearAll == null %}
     {% if aSurveyInfo.options.showclearall == 'on' %}
         <!-- Exit and clear survey -->
         <li class="nav-item ls-no-js-hidden">
             <a href="#" class='nav-link ls-link-action ls-link-clearall'
                data-bs-toggle="modal"
                data-bs-target="#clear-all-modal"
                data-limesurvey-submit='{ "clearall":"clearall" }'
                data-confirmedby='{ "confirm-clearall":"confirm" }'>
... (6 lines truncated)
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/navigation/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/navigation/language_changer_first_page.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.

    (¯`·._.·(¯`·._.· Language Changer  ·._.·´¯)·._.·´¯)

    This file renders language changer inside the main container when multiple survey languages are available.

    It uses the Yii helper CHtml::dropDownList().
    @see: http://www.yiiframework.com/wiki/48/by-example-chtml/#hh5

#}
{% if aSurveyInfo.alanguageChanger.show == true %}
    {% set htmlOptions = {
        'id'          : 'firstpage-changelang',
        'autocomplete': 'off',
        'class'       : 'form',
    } %}

    <!-- Start of language change Form-->
    {{ C.Html.form(
        ( aSurveyInfo.surveyUrl ),
    'post',
... (9 lines truncated)
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/navigation/language_changer_form.twig">
{#
    This file is part of LimeSurvey
    Copyright (C) 2018-2026 The LimeSurvey Project Team
    This file render the language changer out of limesurvey form when no form is required (example survey listing)
    This file can be added for a no javascript solution to change language when not inside limesurvey form
#}
{% if(aSurveyInfo.surveyUrl) %}
    {{ C.Html.form(aSurveyInfo.surveyUrl,'get') }} {# auto adding needed parameters #}
{% else %}
    <form method="get">
{% endif %}
    {{ include('./subviews/navigation/language_changer.twig') }}
</form>
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/navigation/language_changer_top_menu.twig">
{#
LimeSurvey
Copyright (C) 2007-2026 The LimeSurvey Project Team
All rights reserved.
License: GNU/GPL License v2 or later, see LICENSE.php
LimeSurvey is free software. This version may have been modified pursuant
to the GNU General Public License, and as distributed it includes or
is derivative of works licensed under the GNU General Public License or
other free or open source software licenses.
See COPYRIGHT.php for copyright notices and details.

(¯`·._.·(¯`·._.·  Language Changer for Top Menu ·._.·´¯)·._.·´¯)

Show a language changer inside the top menu

It's a typical bootstrap dropdown button.
@see: http://getbootstrap.com/components/#dropdowns

@var array  aSurveyInfo.alanguageChangerDatas.aListLang :  contains the list of available languages for this survey, 'language_code' => 'language name'
@var string aSurveyInfo.alanguageChangerDatas.sSelected :  the language code of the selected language

The language change is done via javascript
#}

{# There is many condition where the language changer should not be shown. Eg: there is only one language available #}
{% if  aSurveyInfo.alanguageChanger.show == true %}

    {# we set a shortcut for aSurveyInfo.alanguageChangerDatas #}
    {% set aLCD  = aSurveyInfo.alanguageChanger.datas %}

... (26 lines truncated)
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/navigation/language_changer.twig">
{#
    This file is part of LimeSurvey
    Copyright (C) 2018-2026 The LimeSurvey Project Team

    This file renders language changer inside the main container when multiple survey languages are available.

    It uses the Yii helper CHtml::dropDownList().
    @see: http://www.yiiframework.com/wiki/48/by-example-chtml/#hh5

#}

{% if aSurveyInfo.alanguageChanger.show == true %}
    
    {# set a shortcut for aSurveyInfo.alanguageChanger.datas #}
    {% set aLCD  = aSurveyInfo.alanguageChanger.datas %}

    {#
        array of attributes of the Drop Down list.
        To add a new attribute, just add an entry:
        'attribute' : 'value',
    #}
    {% set htmlOptions = {
            'class'          : 'form-control',
            'data-targeturl' : aLCD.targetUrl,
        }
    %}
    <!-- Language Changer -->
    <div class=" {{ aSurveyInfo.class.formgroup }} form-change-lang row row-cols-lg-auto g-1" {{ aSurveyInfo.attr.formgroup }} >
        <div class="col-auto">
            <label class="{{ aSurveyInfo.class.controllabel }} col-form-label fw-bold control-label" {{ aSurveyInfo.attr.controllabel }} for="language-changer-select">
... (41 lines truncated)
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/navigation/navigator_complement.twig">
{#
    This file is part of LimeSurvey
    Copyright (C) 2018-2026 The LimeSurvey Project Team
    This file render extra part for navigator
#}
{% if aSurveyInfo.aNavigator.load.show == "Y" or aSurveyInfo.aNavigator.save.show == "Y" or aSurveyInfo.aQuestionIndex.bShow == true or aSurveyInfo.bShowClearAll == true %}
    <!-- extra tools, can be shown with javascript too (just remove ls-js-hidden class -->
    <div class="row ls-js-hidden">
        <!-- Extra button container -->
        <div class="col-md-6 clearall-saveall-wrapper d-flex justify-content-start">
            {% if aSurveyInfo.aNavigator.load.show == "Y" or aSurveyInfo.aNavigator.save.show == "Y" %}
                {{ include('./subviews/navigation/save_buttons.twig') }}
            {% endif %}
            {% if aSurveyInfo.bShowClearAll == true or aSurveyInfo.bShowClearAll == null %}
                {{ include('./subviews/navigation/clearall_buttons.twig') }}
            {% endif %}
        </div>
         <!-- Index container -->
        {% if (aSurveyInfo.aQuestionIndex.bShow == true) %}
            {{ include('./subviews/navigation/question_index_buttons.twig') }}
        {% endif %}
    </div>
{% endif %}
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/navigation/navigator.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.



    (¯`·._.·(¯`·._.· Navigator  ·._.·´¯)·._.·´¯)

    Render the navigator: Previous, Next, Submit, Load, Save
    All needed datas are inside aSurveyInfo.aNavigator
    If you want to see what is available in aNavigator, turn debug mode on in application/config.php, and move out of comments the following line:
    {{ dump(aSurveyInfo.aNavigator) }}
#}

{# create a shortcut for aSurveyInfo.aNavigator #}
{% set aNavigator = aSurveyInfo.aNavigator %}

<!-- PRESENT THE NAVIGATOR -->
<div class="{{ aSurveyInfo.class.navigatorcontainer }} row navigator space-col" id="{{ aSurveyInfo.id.navigatorcontainer }}" {{ aSurveyInfo.attr.navigatorcontainer }}>

    <!-- Previous button container -->
    <div class="{{ aSurveyInfo.class.navigatorbuttonl }} col-6 text-start" {{ aSurveyInfo.attr.navigatorbuttonl }}>

... (37 lines truncated)
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/navigation/question_index_buttons.twig">
{#
    This file is part of LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team

    Show the question index in navigator
#}

<div class="col-md-6 index-wrapper">
    {% if aSurveyInfo.format == 'G' %}
        {{ include('./subviews/navigation/question_index_groups_buttons.twig') }}
    {% endif %}

    {% if aSurveyInfo.format == 'S' %}
        {{ include('./subviews/navigation/question_index_questions_buttons.twig') }}
    {% endif %}
</div>
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/navigation/question_index_groups_buttons.twig">
{#
    This file is part of LimeSurvey
    Copyright (C) 2018-2026 The LimeSurvey Project Team
    This file render group index
#}
<div class="list-group index-button-full">
  <div class="list-group-item">
      <div class="h4 list-group-item-heading">{{ gT("Question index") }}</div>
  </div>
  {% for step, indexItem in aSurveyInfo.aQuestionIndex.items %}
    {% set templateClass = ''  %}
    {% if indexItem.stepStatus['index-item-unanswered'] is defined and indexItem.stepStatus['index-item-unanswered'] == true  %}
        {% set templateClass = templateClass ~ ' list-group-item-warning'  %}
    {% endif %}
    {% if indexItem.stepStatus['index-item-error'] is defined and indexItem.stepStatus['index-item-error'] == true   %}
        {% set templateClass = templateClass ~ ' list-group-item-danger'  %}
    {% endif %}
    {% if indexItem.stepStatus['index-item-current'] is defined and indexItem.stepStatus['index-item-current'] == true %}
        {% set templateClass = templateClass ~  ' disabled'  %}
    {% endif %}
    <button type="submit" name="move" value="{{ indexItem.step }}" class="list-group-item {{ indexItem.coreClass }} {{ templateClass }}" >{{ indexItem.text }}</button>
  {% endfor %}
</div>
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/navigation/question_index_menu.twig">
{#
LimeSurvey
Copyright (C) 2007-2026 The LimeSurvey Project Team
All rights reserved.
License: GNU/GPL License v2 or later, see LICENSE.php
LimeSurvey is free software. This version may have been modified pursuant
to the GNU General Public License, and as distributed it includes or
is derivative of works licensed under the GNU General Public License or
other free or open source software licenses.
See COPYRIGHT.php for copyright notices and details.

(¯`·._.·(¯`·._.·  Question index  ·._.·´¯)·._.·´¯)

Show the question index in top menu.

There is two type of index:
- Full        :  show all the questions/groups
- Incremental :  only show the previous questions/groups

There is two possible displays for index, depending on Survey Mode:
- Group by Group       : Survey mode is in Group By Group mode, so the entry of the index should be groups
- Question by Question : Survey mode is in Question By Question mode, so the entry of the index should be questions
- All in One           : No index needed
#}

{# Question index in group by group mode #}

{% if (aSurveyInfo.aQuestionIndex.bShow == true) %}
    {% if aSurveyInfo.format == 'G' %}
        <!-- Question index, group, {{ aSurveyInfo.aQuestionIndex.type }} -->
... (79 lines truncated)
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/navigation/question_index_questions_buttons.twig">
{#
    This file is part of LimeSurvey
    Copyright (C) 2018-2026 The LimeSurvey Project Team
    This file render question index
#}
<div class="list-group index-button index-button-{{ aSurveyInfo.aQuestionIndex.type }}">
    <div class="list-group-item">
        <div class="h4 list-group-item-heading">{{ gT("Question index") }}</div>
    </div>
    {% for indexGroup in aSurveyInfo.aQuestionIndex.items %}
    <div class="list-group" data-gid="{{ indexGroup.gid }}">
        <div class="list-group-item">
            <div class="h5 list-group-item-heading">{{ flatString(indexGroup.text) }}</div>
        </div>
        {% for indexQuestion in indexGroup.questions %}
        {% set templateClass = ''  %}
        {% if indexQuestion.stepStatus['index-item-unanswered'] is defined and indexQuestion.stepStatus['index-item-unanswered'] == true  %}
            {% set templateClass = templateClass ~ ' list-group-item-warning'  %}
        {% endif %}
        {% if indexQuestion.stepStatus['index-item-error'] is defined and indexQuestion.stepStatus['index-item-error'] == true   %}
            {% set templateClass = templateClass ~ ' list-group-item-danger'  %}
        {% endif %}
        {% if indexQuestion.stepStatus['index-item-current'] is defined and indexQuestion.stepStatus['index-item-current'] == true %}
            {% set templateClass = templateClass ~  ' disabled'  %}
        {% endif %}
            <button type="submit" name="move" value="{{ indexQuestion.step }}" class="list-group-item {{ indexQuestion.coreClass }} {{ templateClass }}" data-qid="{{ indexQuestion.qid }}">
                {{ ellipsizeString(indexQuestion.text, 80, 0.6, "…" ) }}
            </button>
        {% endfor %}
    </div>
... (3 lines truncated)
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/navigation/save_buttons.twig">
{#
    This file is part of LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    This file render the load or save buttons without javascript needed
#}
{% if aSurveyInfo.aNavigator.load.show == "Y" %}
<div class="mb-3 pe-2">
    <button {{ aSurveyInfo.attr.loadbutton }} accesskey="l" class="{{ aSurveyInfo.class.loadbutton }} action--ls-button-submit btn btn-outline-secondary mb-3">{{ gT("Load unfinished survey") }}</button>
</div>
{% endif %}
{% if aSurveyInfo.aNavigator.save.show == "Y" %}
<div class="mb-3 pe-2">
    <button {{ aSurveyInfo.attr.savebutton }} accesskey="s" class='{{ aSurveyInfo.class.savebutton }} action--ls-button-submit btn btn-outline-secondary mb-3'>
        {{ gT('Resume later') }}
    </button>
</div>
{% endif %}
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/navigation/save_links.twig">
{#
LimeSurvey
Copyright (C) 2007-2026 The LimeSurvey Project Team
All rights reserved.
License: GNU/GPL License v2 or later, see LICENSE.php
LimeSurvey is free software. This version may have been modified pursuant
to the GNU General Public License, and as distributed it includes or
is derivative of works licensed under the GNU General Public License or
other free or open source software licenses.
See COPYRIGHT.php for copyright notices and details.



(¯`·._.·(¯`·._.·  Save/Load buttons  ·._.·´¯)·._.·´¯)

Display the buttons to load/save a survey.
There are many cases when those button are not shown:
via survey configuration, at start page, when survey is completed, etc
#}
{% if aSurveyInfo.aNavigator.load.show == "Y" %}
    <!-- Load unfinished survey button -->
    <li class="nav-item ls-no-js-hidden" {{ aSurveyInfo.attr.loadlinksli }}>
        <a href="#" data-limesurvey-submit='{ "loadall":"loadall" }'
           class='nav-link ls-link-action ls-link-loadall'>
            {{ gT('Load unfinished survey') }}
        </a>
    </li>
    {% if aSurveyInfo.access_mode == "O" and aSurveyInfo.hastokenstable == true and not aSurveyInfo.filltoken %}
    <!-- Fill token button -->
    <li class="nav-item ls-no-js-hidden">
... (36 lines truncated)
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/print/print_group.twig">
<div class="survey-group {{odd_even}}">
    <h2>{{group.groupname}}</h2>
    <div class="group-desc">
        {{group.groupdescription}}
    </div>
    {% for question in group.questions %}
        {% set questionTemplate = './subviews/print/print_question.twig' %}
        {{ include(questionTemplate) }}
    {% endfor %}
</div>
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/print/print_question.twig">
<div id="question{{question.qid}}" class="{{question.class}} question-wrapper">
    <div class="q-text">
        <h3>{{question.number}} {{question.code ? '[' ~ question.code ~ ']' : ''}}{{question.text}}
            <span class="mandatory">{{question.mandatory}}</span>
        </h3>
        <p class="q-scenaria">{{question.scenario}}</p>
        <p class="q-type-help">{{question.type_help}}</p>
        <p class="q-man-message">{{question.man_message}}</p>
        <p class="q-validation">{{question.valid_message}}</p>
        <p class="q-fvalidation">{{question.file_valid_message}}</p>
    </div>
    <div class="q-answer">
        {{question.answer}}
    </div>
    <div class="q-help">
        {{question.help}}
    </div>
</div>
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/printanswers/question_types/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/printanswers/question_types/template_array-10-pt.twig">
{% extends "./subviews/printanswers/printanswers_question.twig" %}
 {% block question_answer %}
 <div class="col-lg-8">
    {% for subquestionId, subquestion in question.subquestions %}
        <div class="row">
            <div class="col-lg-4 text-end">
                {{subquestion.answervalue}}
            </div>
            <div class="col-lg-8 text-start">
                <b>{{subquestion.question}} ({{subquestion.qid}})</b>
            </div>
        </div>
    {% endfor %}
</div>
{% endblock %}
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/printanswers/question_types/template_array-5-pt.twig">
{% extends "./subviews/printanswers/printanswers_question.twig" %}
{% block question_answer %}
 <div class="col-lg-8">
    {% for subquestionId, subquestion in question.subquestions %}
        <div class="row">
            <div class="col-lg-4 text-end">
                {{subquestion.answervalue}}
            </div>
            <div class="col-lg-8 text-start">
                <b>{{subquestion.question}} ({{subquestion.qid}})</b>
            </div>
        </div>
    {% endfor %}
</div>

{% endblock %}
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/printanswers/question_types/template_array-flexible-column.twig">
{% extends "./subviews/printanswers/printanswers_question.twig" %}
 {% block question_answer %}
 <div class="col-lg-8">
    {% for subquestionId, subquestion in question.subquestions %}
        <div class="row">
            <div class="col-lg-4 text-end">
                {{subquestion.answeroption.answer}} - {{subquestion.answervalue}}
            </div>
            <div class="col-lg-8 text-start">
                <b>{{subquestion.question}} ({{subquestion.qid}})</b>
            </div>
        </div>
    {% endfor %}
</div>
{% endblock %}
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/printanswers/question_types/template_array-flexible-dual-scale.twig">
{% extends "./subviews/printanswers/printanswers_question.twig" %}
 {% block question_answer %}
 <div class="col-lg-8">
    <table class="table table-condensed table-striped">
    {% for subquestionId, subquestion in question.subquestions %}
        {% if loop.first %}
            <tr>
                <th></th>
                {% for colname, value in question.dualscale_header %}
                    <th><b>{{value}}</b></th>
                {% endfor %}                    
            </tr>
        {% endif %}
        
        <tr>
            <td>
                {{subquestion.question}} ({{subquestion.title}})
            </td>
            {% for colname, value in subquestion.answervalues %}
                <td>
                    {{value}}
                </td>    
            {% endfor %}
        </tr>
    {% endfor %}
    </table>
</div>
{% endblock %}
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/printanswers/question_types/template_array-flexible-row.twig">
{% extends "./subviews/printanswers/printanswers_question.twig" %}
 {% block question_answer %}
 <div class="col-lg-8">
    {% for subquestionId, subquestion in question.subquestions %}
        <div class="row">
            <div class="col-lg-4 text-end">
                {{subquestion.answeroption.answer}} - {{subquestion.answervalue}}
            </div>
            <div class="col-lg-8 text-start">
                <b>{{subquestion.question}} ({{subquestion.qid}})</b>
            </div>
        </div>
    {% endfor %}
</div>
{% endblock %}
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/printanswers/question_types/template_array-increase-same-decrease.twig">
{% extends "./subviews/printanswers/printanswers_question.twig" %}
 {% block question_answer %}
 <div class="col-lg-8">
    {% for subquestionId, subquestion in question.subquestions %}
        <div class="row">
            <div class="col-lg-4 text-end">
            {% if subquestion.answervalue is same as("I") %}
                {{ gT("Increase") }} <i class="ri-add-line"></i>
            {% elseif subquestion.answervalue is same as("S") %}
                {{ gT("Same") }} <i class="ri-checkbox-blank-circle-fill"></i>
            {% elseif subquestion.answervalue is same as("D") %}
                {{ gT("Decrease") }} <i class="ri-subtract-fill"></i>
            {% else %}

            {% endif %}
            </div>
            <div class="col-lg-8 text-start">
                <b>{{subquestion.question}} ({{subquestion.qid}})</b>
            </div>
        </div>
    {% endfor %}
</div>
{% endblock %}
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/printanswers/question_types/template_array-multi-flexi-text.twig">
{% extends "./subviews/printanswers/printanswers_question.twig" %}
 {% block question_answer %}
 <div class="col-lg-8">
    <table class="table table-condensed table-striped">
    {% for subquestionId, subquestion in question.subquestions %}
        {% if loop.first %}
            <tr>
                <th></th>
                {% for colname, value in subquestion.answervalueslabels %}
                    <th class="text-center"><b>{{value}} - {{colname}}</b></th>
                {% endfor %}
            </tr>
        {% endif %}
        
        <tr>
            <td>
                {{subquestion.question}} - {{subquestion.title}}
            </td>
            {% for colname, value in subquestion.answervalues %}
                <td>
                    {{value|escape}}
                </td>
            {% endfor %}
        </tr>
    {% endfor %}
    </table>
</div>
{% endblock %}
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/printanswers/question_types/template_array-multi-flexi.twig">
{% extends "./subviews/printanswers/printanswers_question.twig" %}
 {% block question_answer %}
 <div class="col-lg-8">
    <table class="table table-condensed table-striped">
    {% for subquestionId, subquestion in question.subquestions %}
        {% if loop.first %}
            <tr>
                <th></th>
                {% for colname, value in subquestion.answervalueslabels %}
                    <th class="text-center"><b>{{value}} - {{colname}}</b></th>
                {% endfor %}                    
            </tr>
        {% endif %}
        
        <tr>
            <td>
                {{subquestion.question}} - {{subquestion.title}}
            </td>
            {% for colname, value in subquestion.answervalues %}
                <td class="text-center">
                    {{value}}
                </td>    
            {% endfor %}
        </tr>
    {% endfor %}
    </table>
</div>
{% endblock %}
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/printanswers/question_types/template_array-yes-uncertain-no.twig">
{% extends "./subviews/printanswers/printanswers_question.twig" %}
 {% block question_answer %}
 <div class="col-lg-8">
    {% for subquestionId, subquestion in question.subquestions %}
        <div class="row">
            <div class="col-lg-4 text-end">
                {% if subquestion.answervalue is same as("Y") %}
                    {{ gT("Yes") }} <i class="ri-checkbox-line"></i>
                {% elseif subquestion.answervalue is same as("N") %}
                    {{ gT("No") }} <i class="ri-checkbox-blank-line"></i>
                {% elseif subquestion.answervalue is same as("U") %}
                    {{ gT("Uncertain") }} <i class="ri-checkbox-indeterminate-line"></i>
                {% else %}

                {% endif %}
            </div>
            <div class="col-lg-8 text-start">
                <b>{{subquestion.question}} ({{subquestion.qid}})</b>
            </div>
        </div>
    {% endfor %}
</div>
{% endblock %}
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/printanswers/question_types/template_boilerplate.twig">
{% extends "./subviews/printanswers/printanswers_question.twig" %}
{% block question_answer %}
    <div class="col-2">
            {{question.answervalue}}
    </div>
{% endblock %}
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/printanswers/question_types/template_choice-5-pt-radio.twig">
{% extends "./subviews/printanswers/printanswers_question.twig" %}
 {% block question_answer %} 
 <div class="col-lg-8">
    <div class="row">
        <div class="col-lg-4 text-end">
        </div>
        <div class="col-lg-8 text-start">
            {{question.answervalue}}
        </div>
    </div>
</div>
{% endblock %}
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/printanswers/question_types/template_date.twig">
{% extends "./subviews/printanswers/printanswers_question.twig" %}
 {% block question_answer %}
 <div class="col-lg-8">
    <div class="row">
        <div class="col-lg-4 text-end">
        </div>
        <div class="col-lg-8 text-start">
            {% if question.answervalue %}
                {{question.answervalue|date(question.dateformat.phpdate)}}
            {% endif %}
        </div>
    </div>
</div>
{% endblock %}
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/printanswers/question_types/template_equation.twig">
{% extends "./subviews/printanswers/printanswers_question.twig" %}
 {% block question_answer %}
 <div class="col-lg-8">
    <div class="row">
        <div class="col-lg-4 text-end">
        </div>
        <div class="col-lg-8 text-start">
            {{question.answervalue}}
        </div>
    </div>
</div>
{% endblock %}
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/printanswers/question_types/template_gender.twig">
{% extends "./subviews/printanswers/printanswers_question.twig" %}
 {% block question_answer %}
 <div class="col-lg-8">
    <div class="row">
        <div class="col-lg-4 text-end">
        </div>
        <div class="col-lg-8 text-start">
            {% if question.answervalue is same as("M") %}
                {{ gT("Male") }} <i class="ri-men-line"></i>
            {% elseif question.answervalue is same as("F") %}
                {{ gT("Female") }} <i class="ri-women-line"></i>
            {% else %}
                {{question.answervalue}}
            {% endif %}
        </div>
    </div>
</div>
{% endblock %}
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/printanswers/question_types/template_generic_question.twig">
{% extends "./subviews/printanswers/printanswers_question.twig" %}
 {% block question_answer %}
 <div class="col-lg-8">
    {% if question.subquestions is empty %}
            {{question.answervalue}}
    {% else %}
            {% for subquestionId, subquestion in question.subquestions %}
                <div class="row">
                    <div class="col-lg-4 text-end">
                        <b>{{subquestion.question}} ({{subquestion.qid}})</b>
                    </div>
                    <div class="col-lg-8 text-start">
                        {{subquestion.answervalue}}
                    </div>
                </div>
            {% endfor %}
    {% endif %}
</div>
{% endblock %}
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/printanswers/question_types/template_language.twig">
{% extends "./subviews/printanswers/printanswers_question.twig" %}
 {% block question_answer %}
 <div class="col-lg-8">
    <div class="row">
        <div class="col-lg-4 text-end">
        </div>
        <div class="col-lg-8 text-start">
            {{question.languageArray.description}} ({{question.answervalue}})
        </div>
    </div>
</div>
{% endblock %}
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/printanswers/question_types/template_list-dropdown.twig">
{% extends "./subviews/printanswers/printanswers_question.twig" %}
 {% block question_answer %}
 <div class="col-lg-8">
    <div class="row">
        <div class="col-lg-4 text-end">
        </div>
        <div class="col-lg-8 text-start">
            {{question.answervalue}} -
            {% if question.answercode == '-oth-' %}
                {{question.answeroption.answer|escape}}
            {% else %}
                {{question.answeroption.answer}}
            {%endif %}
        </div>
    </div>
</div>
{% endblock %}
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/printanswers/question_types/template_list-radio-flexible.twig">
{% extends "./subviews/printanswers/printanswers_question.twig" %}
 {% block question_answer %}
 <div class="col-lg-8">
    {% if question.subquestions is empty %}
            {{question.answervalue}}
    {% else %}
            {% for subquestionId, subquestion in question.subquestions %}
                <div class="row">
                    <div class="col-lg-4 text-end">
                        <b>{{subquestion.question}} ({{subquestion.qid}})</b>
                    </div>
                    <div class="col-lg-8 text-start">
                        {{subquestion.answervalue}}
                    </div>
                </div>
            {% endfor %}
    {% endif %}
</div>
{% endblock %}
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/printanswers/question_types/template_list-radio.twig">
{% extends "./subviews/printanswers/printanswers_question.twig" %}
 {% block question_answer %}
 <div class="col-lg-8">
    <div class="row">
        <div class="col-lg-4 text-end">
            {% if question.answercode == '-oth-' %}
                {{question.answeroption.answer|escape}}
            {% elseif question.question_theme_name == 'image_select-listradio' and question.answeroption.answer|isImageUrl %}
                <img src="{{ question.answeroption.answer|escape('html') }}" style="max-width:150px;max-height:150px;" />
            {% else %}
                {{question.answeroption.answer}}
            {%endif %}
        </div>
        <div class="col-lg-8 text-start">
            <b>{{question.answervalue}}</b>
        </div>
    </div>
</div>
{% endblock %}
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/printanswers/question_types/template_list-with-comment.twig">
{% extends "./subviews/printanswers/printanswers_question.twig" %}
 {% block question_answer %}
 <div class="col-lg-8">
    <div class="row">
        <div class="col-lg-4 text-end">
        </div>
        <div class="col-lg-8 text-start">
            {{question.answervalue}} - {{question.answeroption.answer}}
        </div>
    </div>
    <div class="row">
        <div class="col-md-4 text-right">
        </div>
        <div class="col-md-8 text-left">
            {{question.comment.answervalue|escape}}
        </div>
    </div>
</div>
{% endblock %}
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/printanswers/question_types/template_multiple-opt-comments.twig">
{% extends "./subviews/printanswers/printanswers_question.twig" %}
 {% block question_answer %}
 <div class="col-lg-8">
    {% for subquestionId, subquestion in question.subquestions %}
        <div class="row">
            <div class="col-lg-4 text-end">
                {% if subquestion.answervalue is same as("Y") %}
                    <i class="ri-checkbox-line"></i>
                {% else %}
                    {{subquestion.answervalue|escape}}
                {% endif %}
            </div>
            <div class="col-lg-4 text-start">
                <b>{{subquestion.question}} ({{subquestion.qid}})</b>
            </div>
            <div class="col-lg-4 text-start">
                    {{subquestion.comment.answervalue|escape}}
            </div>
        </div>
    {% endfor %}
</div>
{% endblock %}
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/printanswers/question_types/template_multiple-opt.twig">
{% extends "./subviews/printanswers/printanswers_question.twig" %}
 {% block question_answer %}
 <div class="col-lg-8">
    {% for subquestionId, subquestion in question.subquestions %}
        <div class="row">
            <div class="col-lg-4 text-end">
                {% if subquestion.answervalue is same as("Y") %}
                    <i class="ri-checkbox-line"></i>
                {% else %}
                    {{subquestion.answervalue|escape}}
                {% endif %}
            </div>
            <div class="col-lg-8 text-start">
                <b>
                    {% if question.question_theme_name == 'image_select-multiplechoice' and subquestion.question|isImageUrl %}
                        <img src="{{ subquestion.question|escape('html') }}" style="max-width:150px;max-height:150px;" />
                    {% else %}
                        {{subquestion.question}}
                    {% endif %}
                    {% if subquestion.qid != 'other' %} ({{subquestion.qid}}){% endif %}
                </b>
            </div>
        </div>
    {% endfor %}
</div>
{% endblock %}
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/printanswers/question_types/template_multiple-short-txt.twig">
{% extends "./subviews/printanswers/printanswers_question.twig" %}
 {% block question_answer %}
 <div class="col-lg-8 child-row-spacing">
    {% for subquestionId, subquestion in question.subquestions %}
        <div class="row">
            <div class="col-lg-8">
                {{subquestion.answervalue|escape}}
            </div>
            <div class="col-lg-4 text-start">
                <b>{{subquestion.question}} ({{subquestion.qid}})</b>
            </div>
        </div>
    {% endfor %}
</div>
{% endblock %}
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/printanswers/question_types/template_numeric-multi.twig">
{% extends "./subviews/printanswers/printanswers_question.twig" %}
 {% block question_answer %}
 <div class="col-lg-8">
    {% for subquestionId, subquestion in question.subquestions %}
        <div class="row">
            <div class="col-lg-4 text-end">
                {{subquestion.answervalue}}
            </div>
            <div class="col-lg-8 text-start">
                <b>{{subquestion.question}} ({{subquestion.qid}})</b>
            </div>
        </div>
    {% endfor %}
</div>
{% endblock %}
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/printanswers/question_types/template_numeric.twig">
{% extends "./subviews/printanswers/printanswers_question.twig" %}
 {% block question_answer %}
 <div class="col-lg-8">
    <div class="row">
        <div class="col-lg-4 text-end">
        </div>
        <div class="col-lg-8 text-start">
            {{question.answervalue}}
        </div>
    </div>
</div>
{% endblock %}
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/printanswers/question_types/template_ranking.twig">
{% extends "./subviews/printanswers/printanswers_question.twig" %}
 {% block question_answer %}
 <div class="col-lg-8">
    {% for iterator, rankedvalue in question.answervalues %}
        <div class="row">
            <div class="col-lg-4 text-end">
                <b>{{gT('Rank')}} #{{(iterator+1)}}:</b>
            </div>
            <div class="col-lg-8 text-start">
                {{rankedvalue.value}}  - {{rankedvalue.answertext}}
            </div>
        </div>
    {% endfor %}

</div>
{% endblock %}
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/printanswers/question_types/template_text-huge.twig">
{% extends "./subviews/printanswers/printanswers_question.twig" %}
 {% block question_answer %}
 <div class="col-lg-8 text-break-pre">
    {{question.answervalue|escape}}
    <br/>
</div>
{% endblock %}
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/printanswers/question_types/template_text-long.twig">
{% extends "./subviews/printanswers/printanswers_question.twig" %}
 {% block question_answer %}
 <div class="col-lg-8 text-break-pre">
    {% if (aSurveyInfo.printPdf != 1) %}
    {{question.answervalue|escape}}
    {% else %}
    {{question.answervalue|nl2br}}
    {% endif %}
    <br/>
</div>
{% endblock %}
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/printanswers/question_types/template_text-short.twig">
{% extends "./subviews/printanswers/printanswers_question.twig" %}
 {% block question_answer %}
<div class="col-lg-8">
    {{question.answervalue|escape}}
</div>
{% endblock %}
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/printanswers/question_types/template_upload-files.twig">
{% extends "./subviews/printanswers/printanswers_question.twig" %}
 {% block question_answer %}
<div class="col-lg-8">
    {% for file in question.fileinfo %}
        <div class="row">
                    <div class="col-lg-4 text-end">
                        <b>{{file.title}}</b></a>
                    </div>
                    <div class="col-lg-8 text-start">
                        {{file.comment == '' ? gT('No comment') : file.comment}}
                    </div>
                    <div class="col-lg-4 text-end">
                        {{ gT("File type") }} "{{file.ext}}"
                    </div>
                    <div class="col-lg-8 text-start">
                    </div>
                </div>
    {% endfor %}
</div>
{% endblock %}
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/printanswers/question_types/template_yes-no.twig">
{% extends "./subviews/printanswers/printanswers_question.twig" %}
 {% block question_answer %}
 <div class="col-lg-8">
    <div class="row">
        <div class="col-lg-4 text-end">
        </div>
        <div class="col-lg-8 text-start">
            {% if question.answervalue is same as("Y") %}
                {{ gT("Yes") }} <i class="ri-check-fill"></i>
            {% elseif question.answervalue is same as("N") %}
                {{ gT("No") }} <i class="ri-close-fill"></i>
            {% else %}
                {{question.answervalue}}
            {% endif %}
        </div>
    </div>
</div>
{% endblock %}
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/printanswers/question_types/text_question.twig">
{% extends "./subviews/printanswers/printanswers_question.twig" %}
 {% block question_answer %}
 <div class="col-lg-8">
    {% if question.subquestions is empty %}
            {{question.answervalue | escape}}
    {% else %}
            {% for subquestionId, subquestion in question.subquestions %}
                <div class="row">
                    <div class="col-lg-4 text-end">
                        <b>{{subquestion.question}} ({{subquestion.qid}})</b>
                    </div>
                    <div class="col-lg-8 text-start">
                        {{subquestion.answervalue}}
                    </div>
                </div>
            {% endfor %}
    {% endif %}
</div>
{% endblock %}
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/printanswers/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/printanswers/printanswers_foot.twig">
</div>
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/printanswers/printanswers_head.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.

    (¯`·._.·(¯`·._.· Registration form._.·´¯)·._.·´¯)

    This is the head for the printanswers table.
    It is used for the rendering of the responses at the end of the survey.

#}

{% if (aSurveyInfo.printPdf == 1) %} 
{{ include('./subviews/printanswers/printanswers_style.twig') }}
<style> 
    body{ 
        font-size: 11pt;
        line-height: 80%; 
    } 
    div{
        margin: 0;
        padding: 0;
    }
    .question-container-printanswers{
... (30 lines truncated)
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/printanswers/printanswers_question.twig">
<div class="row question-container-printanswers" style="page-break-inside:avoid;"> 
    {% block question_name %}
    <div class="col-md-4">
        <b>{{question.question}} ({{question.qid}})</b><br/>
        <small>{{ gT("Type:") }} ({{question.type}}/{{question.questionclass}})</small>
    </div>
    {% endblock  %}
    {% block question_answer %}
        {{ include('./subviews/printanswers/question_types/template_generic_question.twig') }}
    {% endblock  %}
</div>
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/printanswers/printanswers_style.twig">
<style>
/*!
 * Bootstrap v3.3.7 (http://getbootstrap.com)
 * Copyright 2011-2016 Twitter, Inc.
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 */
code,
kbd,
pre,
samp {
  font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
}
code {
  padding: 2px 4px;
  font-size: 90%;
  color: #c7254e;
  background-color: #f9f2f4;
  border-radius: 4px;
}
kbd {
  padding: 2px 4px;
  font-size: 90%;
  color: #fff;
  background-color: #333;
  border-radius: 3px;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.25);
}
kbd kbd {
  padding: 0;
  font-size: 100%;
... (1770 lines truncated)
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/printanswers/printanswers_table.twig">
{% if (aSurveyInfo.printPdf != 1) %} 
    <div class="row">
        <div class="col-sm-12">
            <h1>{{ sprintf(gT("Survey name (ID): %s (%s)"), aSurveyInfo.surveyls_title, aSurveyInfo.sid) }}</h1>
        </div>
    </div>
{% endif %} 

{% for groupid,group in aSurveyInfo.groupArray %}
    {% if (aSurveyInfo.printPdf == 1) %} 
    <br pagebreak="true" /> 
    {% endif %}
    <groupsection class="groupSection"> 
        <div class="row">
            <div class="col-12">
                <h1>{{group.group_name}} ({{group.gid}})</h1>
            </div>
        </div>
        <div class="row">
            <div class="container-fluid col-11 col-md-10 offset-1 offset-lg-2">
                {% for questionId,question in group.answerArray %}
                {% set questionTemplate = './subviews/printanswers/question_types/template_' ~ question.questionclass ~ '.twig' %}
                {{ include(questionTemplate) }}
                {% endfor %} 
            </div>
        </div>
    </groupsection> 
{% endfor %}
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/printanswers/README.md">
![LimeSurvey Logo](https://account.limesurvey.org/images/logos/logo_main.png)
# LimeSurvey Bootstrap Vanilla Survey Theme

## Print answers directory

The views to print the survey.
In future version of LimeSurvey (3.5 or 4.x ) the subfolder "question_type" will not exist anymore, and each question theme will have its own view for the print rendering.
**If you create a template from scratchn, you can update the content of those files, but keep the structure of that directory (file name, directories, etc)**
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/privacy/allinone_mode_welcome_privacy.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.



    (¯`·._.·(¯`·._.·  Test Welcome / Privacy for All in one mode  ·._.·´¯)·._.·´¯)

    This file is only a piece of logic, it doesn't show nothing. We use it to hide complexity in layout.twig

    When survey is in All In One mode, if welcome or privacy message are activated, they must be shown on the page.
#}
{% if aSurveyInfo.format == 'A' %}
    {% if aSurveyInfo.showwelcome is not defined or aSurveyInfo.showwelcome != 'N' %}
        {{ include('./subviews/messages/welcome.twig') }}
    {% endif %}

    {{ include('./subviews/privacy/privacy.twig') }}
{% endif %}
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/privacy/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/privacy/privacy_datasecurity_notice_label.twig">
{# 
    use aSurveyInfo datasecurity_notice_label
#}
{% set dataSecurityNoticeLabel = aSurveyInfo.datasecurity_notice_label %}
{% set STARTPOLICYLINK = "" %}
{% set ENDPOLICYLINK = "" %}
{% if(aSurveyInfo.showsurveypolicynotice == 2) %}
    {% set STARTPOLICYLINK = "<a data-bs-target='#data-security-modal-" ~ aSurveyInfo.sid ~ "' class='show-policy' data-bs-toggle='modal'>" %}
    {% set ENDPOLICYLINK = "</a>" %}
    {% if( strpos( " " ~ dataSecurityNoticeLabel, '{STARTPOLICYLINK}') == false and strpos( " " ~ dataSecurityNoticeLabel, '{ENDPOLICYLINK}') == false) %}
        {% set dataSecurityNoticeLabel = dataSecurityNoticeLabel ~ "<br/> {STARTPOLICYLINK}" ~ gT("Show policy") ~ "{ENDPOLICYLINK}" %}
    {% endif %}
{% endif %}
{% set haveENDPOLICYLINK = strpos( " " ~ dataSecurityNoticeLabel, '{ENDPOLICYLINK}') %}
{% set dataSecurityNoticeLabel = str_replace('{STARTPOLICYLINK}', STARTPOLICYLINK, dataSecurityNoticeLabel) %}
{% set dataSecurityNoticeLabel = str_replace('{ENDPOLICYLINK}', ENDPOLICYLINK, dataSecurityNoticeLabel) %}
{% if( haveENDPOLICYLINK == false ) %}
    {% set dataSecurityNoticeLabel = dataSecurityNoticeLabel ~ ENDPOLICYLINK %}
{% endif %}
{{ dataSecurityNoticeLabel }}
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/privacy/privacy_modal.twig">
{#
LimeSurvey
Copyright (C) 2007-2026 The LimeSurvey Project Team
All rights reserved.
License: GNU/GPL License v2 or later, see LICENSE.php
LimeSurvey is free software. This version may have been modified pursuant
to the GNU General Public License, and as distributed it includes or
is derivative of works licensed under the GNU General Public License or
other free or open source software licenses.
See COPYRIGHT.php for copyright notices and details.

(¯`·._.·(¯`·._.· Privacy with modal ·._.·´¯)·._.·´¯)

Show the privacy message and the data security message will be available in a modal
#}
{% set describedbyprivacy = "datasecurity_notice" %}
    {% set privacychecked = "" %}
    {% if getPost('datasecurity_accepted') %}
        {% set privacychecked = "checked" %}
    {%endif %}
{% if aSurveyInfo.datasecurity_error %}
    <div class="ls-privacy-block">
        <div class="{{ aSurveyInfo.class.activealert }} alert alert-danger alert-dismissible alert-dismissible {% if not aSurveyInfo.datasecuritynotaccepted %}ls-js-hidden {% endif %}" {{ aSurveyInfo.attr.activealert }}
             id="datasecurity_error">
            <a {{ aSurveyInfo.attr.activealertbutton }} class="{{ aSurveyInfo.class.activealertbutton }} btn-close" aria-hidden="true"></a>
            {{ aSurveyInfo.datasecurity_error }}
        </div>
        {% if aSurveyInfo.datasecuritynotaccepted %}
            {% set describedbyprivacy = "datasecurity_error " ~ describedbyprivacy %}
        {% endif %}
... (57 lines truncated)
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/privacy/privacy_text.twig">
{#
LimeSurvey
Copyright (C) 2007-2026 The LimeSurvey Project Team
All rights reserved.
License: GNU/GPL License v2 or later, see LICENSE.php
LimeSurvey is free software. This version may have been modified pursuant
to the GNU General Public License, and as distributed it includes or
is derivative of works licensed under the GNU General Public License or
other free or open source software licenses.
See COPYRIGHT.php for copyright notices and details.

(¯`·._.·(¯`·._.· Privacy with modal ·._.·´¯)·._.·´¯)

Show the privacy message and the data security message will be available in a modal
#}

{% set describeprivacy = "" %}
{% set privacychecked = "" %}
{% if getPost('datasecurity_accepted') %}
    {% set privacychecked = "checked" %}
{%endif %}
{% if aSurveyInfo.datasecurity_notice %}
    <div class="ls-privacy-block">
        <div id="datasecurity_notice_label" class="fw-bold text-uppercase">
            {{ gT("Privacy policy") }}
        </div>
        <div class="{{ aSurveyInfo.class.privacydatasectextbody }}" id="datasecurity_notice">
            {{ aSurveyInfo.datasecurity_notice }}
        </div>
    </div>
... (48 lines truncated)
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/privacy/privacy.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.

    (¯`·._.·(¯`·._.· Privacy ·._.·´¯)·._.·´¯)

    Show the privacy message (in All in One Mode)
    see: allinone_mode_welcome_privacy.twig

#}

<!-- Privacy message -->

<div class="{{ aSurveyInfo.class.privacycontainer }} row" {{ aSurveyInfo.attr.privacycontainer }}>
    <div class="col-12 col-centered {{ aSurveyInfo.class.privacycol }}" {{ aSurveyInfo.attr.privacycol }}>
        {% if (aSurveyInfo.options.hideprivacyinfo == "off" ) %}
            {% block anonymous %}
                {% if (aSurveyInfo.anonymized == "Y") %}
                    <div class="ls-privacy-block">
                        <div role="heading" aria-level="2" class="{{ aSurveyInfo.class.privacyhead }} text-uppercase" {{ aSurveyInfo.attr.privacyhead }}>
                            {{ gT("This survey is anonymous.") }}
                        </div>
                        <div>
... (21 lines truncated)
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/registration/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/registration/register_error.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.

    (¯`·._.·(¯`·._.· Registration errors._.·´¯)·._.·´¯)

    If there where errors on registration show them here

#}
{% if aSurveyInfo.errors is not empty %}
    <ul class='{{ aSurveyInfo.class.registerul }} alert alert-danger list-unstyled' {{ aSurveyInfo.attr.registerul }} >
        {% for error in aSurveyInfo.errors  %}
            <!-- Error Html warnings -->
                <li {{ aSurveyInfo.attr.registerulli }} >{{ error }}</li>
                <br/>
        {% endfor %}
    </ul>
{% endif %}
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/registration/register_form.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.

    (¯`·._.·(¯`·._.· Registration form._.·´¯)·._.·´¯)

    This is the registration form for participant registration on a survey.

#}

<div class="{{ aSurveyInfo.class.registerform }} row" {{ aSurveyInfo.attr.registerform }}>
    {{ C.Html.form(aSurveyInfo.sRegisterFormUrl,'post',({'id' : 'limesurvey', 'role' : 'form', 'class' : 'form'})) }}

    {{aSurveyInfo.registerform.hiddeninputs}}

    <div class='{{ aSurveyInfo.class.registerformcol }} col-12' {{ aSurveyInfo.attr.registerformcol }}>
        <div class="ls-js-hidden ">
            {{ include('./subviews/navigation/language_changer.twig') }}
        </div>
        <div class="row mb-3">
            {# Participants first name #}
            <div class='{{ aSurveyInfo.class.registerformcolrow }} col-md-6 col-12 mb-3 mb-md-0' {{ aSurveyInfo.attr.registerformcolrow }}>
                <label for='register_firstname' class='{{ aSurveyInfo.class.registerformcolrowlabel }} control-label '>{{ gT("First name") }}</label>
... (114 lines truncated)
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/registration/register_head.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.

    (¯`·._.·(¯`·._.· Registration head·._.·´¯)·._.·´¯)

    This file generates the top container for the participant registration page.

#}

<div class="d-flex justify-content-end ls-no-js-hidden">
    {{ include('./subviews/navigation/language_changer.twig') }}
</div>

<div class="{{ aSurveyInfo.class.registerhead }} row register-head" {{ aSurveyInfo.attr.registerhead }}>
    {{aSurveyInfo.registration.head}}
</div>
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/registration/register_message.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.

    (¯`·._.·(¯`·._.· Registration message._.·´¯)·._.·´¯)

    If there is a message on the registration page, like "Survey has not started, or Register now! here it is displayed

#}

{% if registerSuccess %}
    <h2 {{ aSurveyInfo.attr.registermessagea }} class="large-heading">
        {{ gT("Thank you for registering.") }}
    </h2>
    <p class="form-heading mt-3">
        {{ gT("You will receive an email shortly. But if you already registered, you will not receive another email.") }}
    </p>
{% else %}
    <h2 {{ aSurveyInfo.attr.registermessageb }} class="form-heading">
    {% if sStartDate %}
        {{ gT("You may register for this survey but you have to wait for the {{sStartDate}} before starting the survey.") }}
    {% else %}
        {{ gT("You may have to register to take part in this survey.") }}
... (13 lines truncated)
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/registration/register_privacy.twig">
{% extends './subviews/privacy/privacy.twig' %}
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/registration/register_success.twig">
{#<div class="row">#}
{#    <div class='{{ aSurveyInfo.class.registersuccessblock }}' {{ aSurveyInfo.attr.registersuccessblock }} >#}
{#        <ul class='{{ aSurveyInfo.class.registersuccesslist }}' {{ aSurveyInfo.attr.registersuccesslist }}>#}
{#            <li class='{{ aSurveyInfo.class.registersuccesslistitem }}' {{ aSurveyInfo.attr.registersuccesslistitem }}>#}
{#                <div class="row">#}
{#                    <div class='{{ aSurveyInfo.class.registersuccesslistlabel }}' {{ aSurveyInfo.attr.registersuccesslistlabel }}>#}
{#                        {{ gT("First name") }}#}
{#                    </div>#}
{#                    <div class='{{ aSurveyInfo.class.registersuccesslistcontent }}' {{ aSurveyInfo.attr.registersuccesslistcontent }}>#}
{#                        {{ aSurveyInfo.sFirstName }}#}
{#                    </div>#}
{#                </div>#}
{#            </li>#}
{#            <li class='{{ aSurveyInfo.class.registersuccesslistitem }}' {{ aSurveyInfo.attr.registersuccesslistitem }}>#}
{#                <div class="row">#}
{#                    <div class='{{ aSurveyInfo.class.registersuccesslistlabel }}' {{ aSurveyInfo.attr.registersuccesslistlabel }}>#}
{#                        {{ gT("Last name") }}#}

{#                    </div>#}
{#                    <div class='{{ aSurveyInfo.class.registersuccesslistcontent }}' {{ aSurveyInfo.attr.registersuccesslistcontent }}>#}
{#                        {{ aSurveyInfo.sLastName }}#}

{#                    </div>#}
{#                </div>#}
{#            </li>#}
{#            <li class='{{ aSurveyInfo.class.registersuccesslistitem }}' {{ aSurveyInfo.attr.registersuccesslistitem }}>#}
{#                <div class="row">#}
{#                    <div class='{{ aSurveyInfo.class.registersuccesslistlabel }}' {{ aSurveyInfo.attr.registersuccesslistlabel }}>#}
{#                        {{ gT("Email address") }}#}

... (11 lines truncated)
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/registration/required.twig">
<small class="{{ aSurveyInfo.class.required  }} asterisk ri-asterisk superset" {{ aSurveyInfo.attr.required  }} ></small>
<span class="{{ aSurveyInfo.class.requiredspan  }} visually-hidden asterisk" {{ aSurveyInfo.attr.requiredspan  }} > ({{ gT("Mandatory") }})</span>
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/statistics_user/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/statistics_user/statistics_user_content.twig">
<div class="public-stats__content">
    {% if statisticsoutput %}
        {{ statisticsoutput }}
    {% endif %}
</div>
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/statistics_user/statistics_user_foot.twig">
</div>
            <input type='hidden' class='hidemenubutton'/>
        </div>
    </div>
</div>
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/statistics_user/statistics_user_head.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.

    (¯`·._.·(¯`·._.· Public Statistics Header ._.·´¯)·._.·´¯)

    This is the head for the public statistics page.

#}

<div class="container public-stats">
    <div class="row">
        <div class="col-12">
            <div id='statsContainer'>
                <div id='statsHeader'>
                    <h2 class='statsSurveyTitle public-stats__title'>{{ aSurveyInfo.surveyls_title }}</h2>
                    <div class='statsNumRecords public-stats__num-records'>{{ gT("Total records in survey") }} : {{ totalrecords }}</div>
                </div>
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/survey/group_subviews/group_container.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.



    (¯`·._.·(¯`·._.· Group Container  ·._.·´¯)·._.·´¯)


    The container div itself could often change from a template to another, so we clearly separate it.
    NOTE: see views/subviews/survey/group.twig comments for more infos
#}

{% set sGroupName = processString(aGroup.name) %}
{% set bShowGroupTitle = (aGroup.showgroupinfo == 'N' or aGroup.showgroupinfo == 'B')
    and sGroupName|striptags|replace({'&nbsp;': ' '})|trim != '' %}

<div class="{{ aSurveyInfo.class.groupcontainer }} space-col" {{ aSurveyInfo.attr.groupcontainer }}>

    {# Group Name #}
    {{ include('./subviews/survey/group_subviews/group_name.twig') }}

    {# Group Description #}
... (23 lines truncated)
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/survey/group_subviews/group_desc.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.



    (¯`·._.·(¯`·._.· Group Name  ·._.·´¯)·._.·´¯)

    Presentation of the group description

    NOTE: see views/subviews/survey/group.twig comments for more infos
#}

{% if aGroup.showgroupinfo == 'D' or aGroup.showgroupinfo == 'B' %}
    {% if aGroup.description != '' %}
        <!-- Group description -->
        <div class="{{ aSurveyInfo.class.groupdesc }} space-col" {{ aSurveyInfo.attr.groupdesc }}>
            {{ processString(aGroup.description) }}
        </div>
    {% endif %}
{% endif %}
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/survey/group_subviews/group_name.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.



    (¯`·._.·(¯`·._.· Group Name  ·._.·´¯)·._.·´¯)

    Presentation of the group name

    NOTE: see views/subviews/survey/group.twig comments for more infos
#}

<!-- Group Name -->
{% if bShowGroupTitle is defined and bShowGroupTitle %}
    <h2 class="{{ aSurveyInfo.class.grouptitle }}" {{ aSurveyInfo.attr.grouptitle }}>
        {{ sGroupName }}
    </h2>
{% endif %}
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/survey/group_subviews/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/survey/question_subviews/answers.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.



    (¯`·._.·(¯`·._.· Answers  ·._.·´¯)·._.·´¯)

    The rendering of the answers: the input elements the survey respondent interacts with.
    The container div itself could often change from a template to another, so we clearly separate it.
    NOTE: see views/subviews/survey/question.twig comments for more infos

#}

<!-- Answer -->
<div class="{{ aSurveyInfo.class.answercontainer }} col-12" {{ aSurveyInfo.attr.answercontainer }}>
    {# NOTE: If you want to customize the question rendering, use a question theme #}
    {{ aQuestion.answer | raw }}
</div>
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/survey/question_subviews/asterisk.twig">
{#
/**
 * This file render the asterisk for mandatory questions
 */
#}
<!-- The asterisk alone would convey "mandatory" by symbol only, so the word is shown too -->
<i class="asterisk ri-asterisk" aria-hidden="true"></i>
<span class="ls-question-mandatory small">{{ gT("Required") }}</span>
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/survey/question_subviews/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/survey/question_subviews/question_image_container.twig">
{% set imageAlign = aQuestion.image['image_align'] is defined ? aQuestion.image['image_align'] : 'left' %}
{% if imageAlign == 'center' %}
    <div class="position-relative w-100">
        <div class="question-image-container w-100">
            <div class="w-100 text-center">
                {{ include('./subviews/survey/question_subviews/question_image.twig') }}
            </div>
        </div>
        <div class="question-content-container position-absolute top-0 start-0 w-100 d-flex align-items-start">
            <div class="p-5 w-100">
                {{ include('./subviews/survey/question.twig') }}
            </div>
        </div>
    </div>
{% else %}
    <div class="d-flex flex-wrap {% if imageAlign == 'right' %}flex-row-reverse{% endif %}">
        <div class="question-image-container col-12 col-md-6">
            {{ include('./subviews/survey/question_subviews/question_image.twig') }}
        </div>
        <div class="question-content-container col-12 col-md-6 pt-3">
            {{ include('./subviews/survey/question.twig') }}
        </div>
    </div>
{% endif %}
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/survey/question_subviews/question_image.twig">
<div class="position-relative overflow-hidden p-2 {% if imageAlign == 'center' %}h-auto object-fit-cover{% endif %}">
    <img class="img-fluid w-100"
         src="{{ aQuestion.image.image_path }}"
         alt="{{ aQuestion.image.image_alt_text }}"
         style="{{ aQuestion.image.image_styles }}">
</div>
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/survey/question_subviews/question_text_container.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.



    (¯`·._.·(¯`·._.· Question Text Container  ·._.·´¯)·._.·´¯)

    This file render the quetion text.
    The container div itself could often change from a template to another, so we clearly separate it.
    NOTE: see views/subviews/survey/question.twig comments for more infos

#}

{% set iQuestionHeadingLevel = (bShowGroupTitle is defined and bShowGroupTitle) ? 3 : 2 %}

<!-- Question text -->
<div role="heading" aria-level="{{ iQuestionHeadingLevel }}" id="question-text-container-{{ aQuestion.SGQ }}" class="{{ aSurveyInfo.class.questiontitlecontainer }}  col-12 " {{ aSurveyInfo.attr.questiontitlecontainer }} >
    {{ include('./subviews/survey/question_subviews/question_text_content.twig') }}
</div>
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/survey/question_subviews/question_text_content.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.



    (¯`·._.·(¯`·._.· Question Text Content  ·._.·´¯)·._.·´¯)

    This file render the quetion text content.
    NOTE: see views/subviews/survey/question.twig comments for more infos
#}
{# Use twig from core, if the question is mandatory,return ./subviews/survey/question_subviews/asterisk.twig #}
{% if (aQuestion.mandatory == 'Y') %}
    {{ include('./subviews/survey/question_subviews/asterisk.twig') }}
{% endif %}

{# If the question number is to be shown (set in survey settings) #}
{% if (aShow.question_number) %}
    <span class='{{ aSurveyInfo.class.questionnumber }}' {{ aSurveyInfo.attr.questionnumber }} >
        {{ aQuestion.number }}
    </span>
{% endif %}

... (14 lines truncated)
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/survey/question_subviews/survey_question_help.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.



    (¯`·._.·(¯`·._.· Survey Question Help  ·._.·´¯)·._.·´¯)

    The additional question help as entered by the survey creator in question editing
    NOTE: see views/subviews/survey/question.twig comments for more infos
#}

<!-- Survey question help -->
<div class="{{ aSurveyInfo.class.helpcontainer }} col-12" {{ aSurveyInfo.attr.helpcontainer }}>
    {% if aQuestion.help.show %}
        <div class="{{ aSurveyInfo.class.lsquestionhelp }}">
            {{ aQuestion.help.text | raw }}
        </div>
    {% else %}
            {{ aQuestion.help.text | raw }}
    {% endif %}
</div>
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/survey/question_subviews/valid_message_and_help.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.



    (¯`·._.·(¯`·._.· Valid message and helper  ·._.·´¯)·._.·´¯)

    This file render the quetion text.
    The container div itself could often change from a template to another, so we clearly separate it.
    NOTE: see views/subviews/survey/question.twig comments for more infos

#}

<!-- LimeSurvey valid message and help -->
<div id="ls-question-validation-{{ aQuestion.SGQ }}" class="{{ aSurveyInfo.class.questionvalidcontainer }} text-info col-12" {{ aSurveyInfo.attr.questionvalidcontainer }}>
    {{ aQuestion.valid_message      | raw }} {# The validation message, eg: "Only numbers may be entered in this field.". This text is inside EM Helper, and can be changed by creating a translation file #}
    {{ aQuestion.man_message        | raw }} {# The question mandatory error message: "This question is mandatory!". This text is inside EM Helper, and can be changed by creating a translation file #}
    {{ aQuestion.file_valid_message | raw }} {# Used only for file upload question type... TODO: check if we can remove it and use valid_message for file upload question type too #}
</div>
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/survey/group.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.

    (¯`·._.·(¯`·._.· Group  ·._.·´¯)·._.·´¯)

    This file is one of the most important of the rendering progress.
    It will display the group and the questions inside the group via the for statement that includes question.twig

    Here, you have access to the array aGroup that contains the data of the current group and the array of questions of this group: aQuestions
    To see what's inside aGroup, turn debug mode on and copy the following line to the end of this file:
    {{ dump(aGroup) }}

#}

<!-- START OF GROUP: {{ aGroup.name }} {{ aGroup.gid }}  -->
<div id='group-{{ aGroup.gseq }}' class="{{ aSurveyInfo.class.groupoutercontainer }}{{ aGroup.class }} space-col" {{ aSurveyInfo.attr.questiongroup }}>

    {# The container div itself could often change from a template to another, so we clearly separate it. #}
    {{ include('./subviews/survey/group_subviews/group_container.twig') }}

</div>
<!-- END OF GROUP: {{ aGroup.name }} {{ aGroup.gid }}  -->
... (1 lines truncated)
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/survey/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/survey/question_container.twig">
<!-- Question {{ aQuestion.qid }} -->
{% set hasImage = aQuestion.image['image_path'] is defined and aQuestion.image['image_path'] %}

<div role="group" aria-labelledby="question-text-container-{{ aQuestion.SGQ }}" {{ aQuestion.attributes }} class="row {{ aQuestion.class }} {{ aQuestion.input_error_class }} {{ aSurveyInfo.class.questioncontainer }}{% if aSurveyInfo.options.deselectsinglechoice == 'on' %} deselect-singlechoice{% endif %}" {{ aSurveyInfo.attr.questioncontainer }}>
    {% if hasImage %}
        {{ include('./subviews/survey/question_subviews/question_image_container.twig') }}
    {% else %}
        {{ include('./subviews/survey/question.twig') }}
    {% endif %}
</div>
<!-- End of question {{ aQuestion.qid }} -->
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/survey/question.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.



    (¯`·._.·(¯`·._.· Question Layout  ·._.·´¯)·._.·´¯)

    This file is one of the most important of the rendering progress.
    It will render a question. It's included in the for loop in group.twig

    Here, you have access to the array aQuestion that contains the data of the current question.
    To see what's inside aQuestion, turn debug mode on, and copy the following line to the end of this file:
    {{ dump(aQuestion) }}

    All content of aQuestion itself is generated from qanda_helper.
    To modify it, you must create a question theme and apply it to the question in its display settings
    (here, you're inside the survey theme, applied to the survey in its settings).

#}


{# Showing question code/number is a survey level setting, so it's inside the array aSurveyInfo #}
... (25 lines truncated)
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/survey/README.md">
![LimeSurvey Logo](https://account.limesurvey.org/images/logos/logo_main.png)
# LimeSurvey Bootstrap Vanilla Survey Theme

## Survey directory
The subviews to render the question groups and the questions.

group.twig is the main view here. It's rendered from content/main.twig, and then via a each loop it renders each relevant group and question.
We tried to atomize it as much as possible, so if a user update one of those views via the template manager, only a small amount of HTML will be loaded from local template.
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="themes/survey/fruity_twentythree/views/subviews/README.md">
![LimeSurvey Logo](https://account.limesurvey.org/images/logos/logo_main.png)
# LimeSurvey Bootstrap Vanilla Survey Theme

## subviews directory
The subview directory contains only subdirectories.
If you're creating a template from scratch, there is no obligation to respect this structure.

* content/      
    The directory content contains all the subviews render from layout_global.
    They are used to render any page directly related to survey taking.
    If you're creating a template from scratch, you can place those subviews wherever you want (by updating the path of sViewContent in the global layout).
    **But those views must exist with the very same name.**

* header/       
    Anything on top of the survey form. (including the survey form tag).
    *Those subviews are hard included in other views. So if you create a template from scratch, you can named them as you want (or you can even not create them at all)*

* messages/     
    Messages sent to the user, such as the modals, alerts, warning, welcome, or assessments results
    *Those subviews are hard included in other views. So if you create a template from scratch, you can named them as you want (or you can even not create them at all)*

* navigation/
    Anything causing a page reload: navigator (next, prev, submit, etc), clear all, save, change language, question index, etc
    *Those subviews are hard included in other views. So if you create a template from scratch, you can named them as you want (or you can even not create them at all)*

* printanswers/
    The views to print the survey. In future version of LimeSurvey (3.5 or 4.x ) The subfolder "question_type" will not exist anymore, and each question theme will have its own view for the print rendering.
    **If you create a template from scratch, you can update the content of those files, but keep the structure of that directory (file name, directories, etc)**

* privacy/
... (11 lines truncated)
</file>

<file path="themes/survey/fruity_twentythree/views/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="themes/survey/fruity_twentythree/views/layout_errors.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.



    (¯`·._.·(¯`·._.· Vanilla Theme Errors Layout  ·._.·´¯)·._.·´¯)

    This layout is used to render errors that block survey rendering.
    Eg: wrong survey ID, empty group in preview group, etc.

    It has no obligation to be the same layout as layout_global.twig, it can be completely different.

    NOTE: To see it: just try to preview a survey with an empty group.

    NOTE: see layout_global.twig for more infos
#}

{# We register a specific css file for that layout. #}
{{ registerTemplateCssFile('css/errors.css') }}
{% set aError     = aSurveyInfo.aError    %}

<!DOCTYPE html>
... (71 lines truncated)
</file>

<file path="themes/survey/fruity_twentythree/views/layout_global.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.

    (¯`·._.·(¯`·._.· Global Layout  ·._.·´¯)·._.·´¯)

    This is the global layout that will be used to displayed most pages (less the error page)
    If you're creating your own template, remember there is no obligation to respect the current file flow of this template.
    This is different from the old LimeSurvey template engine, where you had to provide every one of the pstpl files.
    Here, you must have a file called main_layout.twig (called from SurveyRuntimeHelper::run() ).
    Other than that, you're free to organize your files and inclusions as you want.



    (¯`·._.·(¯`·._.· Bootstrap ·._.·´¯)·._.·´¯)

    LimeSurvey uses Bootstrap.
    See: https://getbootstrap.com

    This template is an instance of Bootswatch Theme Flatly.
    See: https://bootswatch.com/


... (132 lines truncated)
</file>

<file path="themes/survey/fruity_twentythree/views/layout_maintenance.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.



    (¯`·._.·(¯`·._.· Vanilla Theme Maintenance Layout  ·._.·´¯)·._.·´¯)

    This layout is used to render message explaining that maintenance mode is activated.

#}

{# We register a specific css file for that layout. #}
{{ registerTemplateCssFile('css/maintenance.css') }}

<!DOCTYPE html>
<html lang="{{ aSurveyInfo.htmllanguagecode }}" dir="{{ aSurveyInfo.dir }}" class="{{ aSurveyInfo.languagecode }} dir-{{ aSurveyInfo.dir }} {{ aSurveyInfo.class.html }}" {{ aSurveyInfo.attr.html }}>

    <head>
        <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />

... (30 lines truncated)
</file>

<file path="themes/survey/fruity_twentythree/views/layout_print.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.

    (¯`·._.·(¯`·._.· Print Layout  ·._.·´¯)·._.·´¯)

    This is the layout that will be used to print the survey to pdf
    If you're creating your own template, remember there is no obligation to respect the current file flow of this template.
    This is different from the old LimeSurvey template engine, where you had to provide every one of the pstpl files.
    Here, you must have a file called layout_global.twig (called from SurveyRuntimeHelper::run() ).
    Other than that, you're free to organize your files and inclusions as you want.
#}
<!DOCTYPE html>
<html lang="{{ aSurveyInfo.htmllanguagecode }}" dir="{{ aSurveyInfo.dir }}" class="{{ aSurveyInfo.languagecode }} dir-{{ aSurveyInfo.dir }} {{ aSurveyInfo.class.html }}" {{ aSurveyInfo.attr.html }}>
    <head>
        <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
        <title>{{print.sitename}} - {{ aSurveyInfo.surveyls_title }}</title>
    </head>
    <body>

    {# DO NOT REMOVE This is for automated testing to validate we see that page #}
    <x-test id="action::printableSurvey"></x-test>

... (27 lines truncated)
</file>

<file path="themes/survey/fruity_twentythree/views/layout_printanswers.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.

    (¯`·._.·(¯`·._.· Print Answers Layout  ·._.·´¯)·._.·´¯)

    This is the layout that will be used to print the answers. 

#}
{% extends 'layout_global.twig' %}
{% block ajaxindicator %}{% endblock %}
{% block pjaxbegin %}{% endblock %}
{% block body %}
    {% block nav_bar %}
        {% if (not aSurveyInfo.printPdf) %} 
            {{ parent() }}
        {% endif %}
    {% endblock %}
    {% block content %}
        {% set sViewContent =  './subviews/content/' ~ aSurveyInfo.include_content ~ '.twig' %}
        {% include './subviews/content/outerframe.twig' with {'include_content': sViewContent } %}
    {% endblock %}
    {% if (not aSurveyInfo.printPdf) %} 
... (15 lines truncated)
</file>

<file path="themes/survey/fruity_twentythree/views/layout_statistics_user.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.

    (¯`·._.·(¯`·._.· Public Statistics Layout  ·._.·´¯)·._.·´¯)

    This is the layout that will be used to show the public statistics. 

#}
{% extends 'layout_global.twig' %}
{% block ajaxindicator %}{% endblock %}
{% block pjaxbegin %}{% endblock %}
{% block body %}
    {% block nav_bar %}
        {{ parent() }}
    {% endblock %}
    {{ registerScript("StatisticsUserBaseScripts", "var graphUrl = '" ~ graphUrl ~ "';", "POS_BEGIN") }}
    {% block content %}
        {% set sViewContent =  './subviews/content/' ~ aSurveyInfo.include_content ~ '.twig' %}
        {% include './subviews/content/outerframe.twig' with {'include_content': sViewContent } %}
    {% endblock %}
{% endblock %}
{% block footer %}
... (4 lines truncated)
</file>

<file path="themes/survey/fruity_twentythree/views/layout_survey_list.twig">
{#
LimeSurvey
Copyright (C) 2007-2026 The LimeSurvey Project Team
All rights reserved.
License: GNU/GPL License v2 or later, see LICENSE.php
LimeSurvey is free software. This version may have been modified pursuant
to the GNU General Public License, and as distributed it includes or
is derivative of works licensed under the GNU General Public License or
other free or open source software licenses.
See COPYRIGHT.php for copyright notices and details.
(¯`·._.·(¯`·._.· Survey List Layout  ·._.·´¯)·._.·´¯)
This file renders the list of publicly listed surveys in your LimeSurvey home page.
NOTE: see layout_main.twig for more infos
#}



{#
LimeSurvey
Copyright (C) 2007-2026 The LimeSurvey Project Team
All rights reserved.
License: GNU/GPL License v2 or later, see LICENSE.php
LimeSurvey is free software. This version may have been modified pursuant
to the GNU General Public License, and as distributed it includes or
is derivative of works licensed under the GNU General Public License or
other free or open source software licenses.
See COPYRIGHT.php for copyright notices and details.

(¯`·._.·(¯`·._.· Global Layout  ·._.·´¯)·._.·´¯)

... (207 lines truncated)
</file>

<file path="themes/survey/fruity_twentythree/views/layout_user_forms.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.

    (¯`·._.·(¯`·._.· User Forms Layout  ·._.·´¯)·._.·´¯)

    This file renders the user forms such as: token (survey participant), and register.
    => it is a direct child of layout_global
    NOTE: see layout_global.twig for more infos
#}
{% extends "layout_global.twig" %}
</file>

<file path="themes/survey/fruity_twentythree/views/ls_logo_svg.twig">
<svg class="ls-logo"  viewBox="0 0 181 48" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M4.90266 5.45549C6.39808 5.48742 7.87852 5.77592 9.28559 6.30963C10.6926 6.82561 12.0528 7.47323 13.3499 8.2447C14.6388 9.00242 15.881 9.84508 17.0688 10.7677C17.4586 11.0719 17.8424 11.3803 18.2216 11.6969C18.5464 11.3595 18.8755 11.0295 19.2088 10.707C19.6931 10.2399 20.1959 9.78686 20.6981 9.34742C20.954 9.13006 21.2093 8.91328 21.4652 8.69945L21.851 8.38195L22.2457 8.07505C23.2955 7.25036 24.3857 6.48929 25.5071 5.77771C26.6286 5.06612 27.786 4.42817 28.9657 3.83793C31.3266 2.66289 33.804 1.76676 36.3525 1.16594C37.6252 0.872812 38.9145 0.666212 40.2125 0.547428C41.5135 0.423944 42.8224 0.42079 44.124 0.538003C43.7551 0.805308 43.382 1.04476 43.0117 1.28236L43.0115 1.28245C42.8327 1.3972 42.6545 1.51153 42.4778 1.62836C42.2085 1.80507 41.9353 1.98179 41.6615 2.14732L41.6376 2.1624C41.5111 2.24221 41.3842 2.32231 41.2578 2.4071L40.8541 2.66687C40.1685 3.10077 39.494 3.53924 38.8247 3.97428C38.4472 4.21963 38.0714 4.46389 37.6963 4.70562C35.6246 6.06517 33.614 7.42885 31.6448 8.83553C29.6756 10.2422 27.7552 11.6813 25.8778 13.1728C25.7208 13.2999 25.5633 13.4259 25.4058 13.5519L25.4055 13.5521L25.405 13.5525C25.0947 13.8007 24.7843 14.049 24.478 14.3056C24.1647 14.5561 23.8571 14.8157 23.5503 15.0746L23.55 15.0748L23.5498 15.075C23.4001 15.2014 23.2506 15.3275 23.1007 15.4525C23.0057 15.5346 22.9107 15.6165 22.8159 15.6983L22.8157 15.6985C22.4583 16.0068 22.1029 16.3134 21.7569 16.6229C21.6381 16.7301 21.5196 16.8357 21.4017 16.9406L21.4015 16.9408L21.401 16.9412C21.3007 17.0305 21.2008 17.1194 21.1018 17.2085L20.5094 17.7557L18.0067 20.063L16.3785 17.7657C16.3471 17.7186 16.2889 17.6479 16.2396 17.589L16.0828 17.3905L15.7642 16.9893L15.1136 16.1823C14.6739 15.6443 14.2297 15.1079 13.7811 14.573C12.8852 13.5062 11.9731 12.4447 11.0375 11.4015C10.1019 10.3583 9.14898 9.32975 8.14395 8.33365C7.1237 7.30167 6.041 6.34027 4.90266 5.45549ZM19.6102 40.3559C17.3913 40.3536 15.2172 39.737 13.3328 38.5754C11.4484 37.4139 9.92874 35.7536 8.94502 33.7817L1.85366 36.8077C3.95889 41.2615 7.68852 44.7588 12.2911 46.5948C16.8936 48.4308 22.027 48.469 26.6569 46.7018L23.6092 39.6716C22.3257 40.1256 20.9729 40.357 19.6102 40.3559ZM9.24702 22.7652C8.24123 24.5329 7.71203 26.5278 7.71051 28.5574C7.71022 29.8015 7.90887 31.0377 8.29907 32.22L1.19445 35.246C-0.298664 31.2011 -0.394613 26.7792 0.921669 22.6744C2.23795 18.5696 4.89193 15.0144 8.46691 12.567L13.4525 18.4657C11.7012 19.5167 10.2528 20.9975 9.24702 22.7652ZM31.4388 13.0627L24.7814 17.9345C27.0245 19.0163 28.8722 20.7639 30.0679 22.9343L37.1681 19.9083C35.8135 17.2208 33.8531 14.8785 31.4388 13.0627ZM37.8631 21.4544C38.763 23.7169 39.2238 26.1275 39.2213 28.5596C39.2178 32.1993 38.1851 35.7652 36.2403 38.8523C34.2956 41.9394 31.5167 44.424 28.2193 46.0241L25.1672 38.989C27.717 37.6543 29.6912 35.4471 30.7228 32.7776C31.7545 30.1082 31.7735 27.1582 30.7762 24.476L37.8631 21.4544Z" fill="#14AE5C"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M4.90266 5.45549C6.39808 5.48742 7.87852 5.77592 9.28559 6.30963C10.6926 6.82561 12.0528 7.47323 13.3499 8.2447C14.6388 9.00242 15.881 9.84508 17.0688 10.7677C17.4586 11.0719 17.8424 11.3803 18.2216 11.6969C18.5464 11.3595 18.8755 11.0295 19.2088 10.707C19.6931 10.2399 20.1959 9.78686 20.6981 9.34742C20.954 9.13006 21.2093 8.91328 21.4652 8.69945L21.851 8.38195L22.2457 8.07505C23.2955 7.25036 24.3857 6.48929 25.5071 5.77771C26.6286 5.06612 27.786 4.42817 28.9657 3.83793C31.3266 2.66289 33.804 1.76676 36.3525 1.16594C37.6252 0.872812 38.9145 0.666212 40.2125 0.547428C41.5135 0.423944 42.8224 0.42079 44.124 0.538003C43.7551 0.805308 43.382 1.04476 43.0117 1.28236L43.0115 1.28245C42.8327 1.3972 42.6545 1.51153 42.4778 1.62836C42.2085 1.80507 41.9353 1.98179 41.6615 2.14732L41.6376 2.1624C41.5111 2.24221 41.3842 2.32231 41.2578 2.4071L40.8541 2.66687C40.1685 3.10077 39.494 3.53924 38.8247 3.97428C38.4472 4.21963 38.0714 4.46389 37.6963 4.70562C35.6246 6.06517 33.614 7.42885 31.6448 8.83553C29.6756 10.2422 27.7552 11.6813 25.8778 13.1728C25.7208 13.2999 25.5633 13.4259 25.4058 13.5519L25.4055 13.5521L25.405 13.5525C25.0947 13.8007 24.7843 14.049 24.478 14.3056C24.1647 14.5561 23.8571 14.8157 23.5503 15.0746L23.55 15.0748L23.5498 15.075C23.4001 15.2014 23.2506 15.3275 23.1007 15.4525C23.0057 15.5346 22.9107 15.6165 22.8159 15.6983L22.8157 15.6985C22.4583 16.0068 22.1029 16.3134 21.7569 16.6229C21.6381 16.7301 21.5196 16.8357 21.4017 16.9406L21.4015 16.9408L21.401 16.9412C21.3007 17.0305 21.2008 17.1194 21.1018 17.2085L20.5094 17.7557L18.0067 20.063L16.3785 17.7657C16.3471 17.7186 16.2889 17.6479 16.2396 17.589L16.0828 17.3905L15.7642 16.9893L15.1136 16.1823C14.6739 15.6443 14.2297 15.1079 13.7811 14.573C12.8852 13.5062 11.9731 12.4447 11.0375 11.4015C10.1019 10.3583 9.14898 9.32975 8.14395 8.33365C7.1237 7.30167 6.041 6.34027 4.90266 5.45549ZM19.6102 40.3559C17.3913 40.3536 15.2172 39.737 13.3328 38.5754C11.4484 37.4139 9.92874 35.7536 8.94502 33.7817L1.85366 36.8077C3.95889 41.2615 7.68852 44.7588 12.2911 46.5948C16.8936 48.4308 22.027 48.469 26.6569 46.7018L23.6092 39.6716C22.3257 40.1256 20.9729 40.357 19.6102 40.3559ZM9.24702 22.7652C8.24123 24.5329 7.71203 26.5278 7.71051 28.5574C7.71022 29.8015 7.90887 31.0377 8.29907 32.22L1.19445 35.246C-0.298664 31.2011 -0.394613 26.7792 0.921669 22.6744C2.23795 18.5696 4.89193 15.0144 8.46691 12.567L13.4525 18.4657C11.7012 19.5167 10.2528 20.9975 9.24702 22.7652ZM31.4388 13.0627L24.7814 17.9345C27.0245 19.0163 28.8722 20.7639 30.0679 22.9343L37.1681 19.9083C35.8135 17.2208 33.8531 14.8785 31.4388 13.0627ZM37.8631 21.4544C38.763 23.7169 39.2238 26.1275 39.2213 28.5596C39.2178 32.1993 38.1851 35.7652 36.2403 38.8523C34.2956 41.9394 31.5167 44.424 28.2193 46.0241L25.1672 38.989C27.717 37.6543 29.6912 35.4471 30.7228 32.7776C31.7545 30.1082 31.7735 27.1582 30.7762 24.476L37.8631 21.4544Z" fill="#14AE5C"/>
<path d="M50 35.9151V21.7594H53.2477V33.2457H60.2844V35.9151H50Z" fill="#14AE5C"/>
<path d="M61.8981 35.9151V25.0354H65.0256V35.9151H61.8981ZM63.4618 23.5187C62.8871 23.5187 62.4194 23.3502 62.0585 23.0131C61.6976 22.6761 61.5172 22.2582 61.5172 21.7594C61.5172 21.2605 61.6976 20.8426 62.0585 20.5056C62.4194 20.1685 62.8871 20 63.4618 20C64.0365 20 64.5043 20.1618 64.8652 20.4853C65.226 20.7954 65.4065 21.1999 65.4065 21.6987C65.4065 22.2245 65.226 22.6626 64.8652 23.0131C64.5177 23.3502 64.0499 23.5187 63.4618 23.5187Z" fill="#14AE5C"/>
<path d="M81.7409 24.8736C82.5963 24.8736 83.3514 25.0489 84.0063 25.3994C84.6746 25.7364 85.1958 26.2622 85.57 26.9767C85.9576 27.6778 86.1514 28.5811 86.1514 29.6866V35.9151H83.024V30.1719C83.024 29.2956 82.8435 28.6485 82.4827 28.2305C82.1218 27.8126 81.614 27.6036 80.9591 27.6036C80.5047 27.6036 80.097 27.7115 79.7362 27.9272C79.3753 28.1294 79.0946 28.4395 78.8942 28.8574C78.6937 29.2754 78.5934 29.8079 78.5934 30.455V35.9151H75.466V30.1719C75.466 29.2956 75.2856 28.6485 74.9247 28.2305C74.5772 27.8126 74.076 27.6036 73.4211 27.6036C72.9667 27.6036 72.5591 27.7115 72.1982 27.9272C71.8374 28.1294 71.5567 28.4395 71.3562 28.8574C71.1558 29.2754 71.0555 29.8079 71.0555 30.455V35.9151H67.9281V25.0354H70.9152V28.0081L70.3538 27.1385C70.7281 26.397 71.256 25.8375 71.9376 25.4601C72.6326 25.0691 73.4211 24.8736 74.3032 24.8736C75.2923 24.8736 76.1543 25.1298 76.8894 25.6421C77.6378 26.1409 78.1323 26.9093 78.3729 27.9474L77.2703 27.6441C77.6312 26.7947 78.2059 26.1207 78.9944 25.6218C79.7963 25.123 80.7118 24.8736 81.7409 24.8736Z" fill="#14AE5C"/>
<path d="M94.3857 36.0768C93.1561 36.0768 92.0735 35.8342 91.1379 35.3488C90.2158 34.8635 89.5007 34.2029 88.9928 33.367C88.485 32.5177 88.231 31.5538 88.231 30.4752C88.231 29.3832 88.4783 28.4193 88.9728 27.5834C89.4807 26.7341 90.169 26.0735 91.0377 25.6016C91.9064 25.1163 92.8888 24.8736 93.9847 24.8736C95.0406 24.8736 95.9895 25.1028 96.8315 25.5612C97.6868 26.0061 98.3618 26.6532 98.8563 27.5025C99.3508 28.3384 99.5981 29.3428 99.5981 30.5157C99.5981 30.637 99.5914 30.7786 99.578 30.9403C99.5646 31.0886 99.5513 31.2302 99.5379 31.365H90.7771V29.5248H97.894L96.6911 30.0708C96.6911 29.5045 96.5775 29.0125 96.3503 28.5945C96.1231 28.1766 95.8091 27.8531 95.4081 27.6239C95.0071 27.3812 94.5394 27.2599 94.0048 27.2599C93.4702 27.2599 92.9957 27.3812 92.5814 27.6239C92.1804 27.8531 91.8663 28.1833 91.6391 28.6148C91.4119 29.0327 91.2983 29.5315 91.2983 30.1112V30.5966C91.2983 31.1898 91.4253 31.7155 91.6792 32.1739C91.9465 32.6188 92.3141 32.9626 92.7819 33.2053C93.263 33.4344 93.8243 33.549 94.4659 33.549C95.0406 33.549 95.5417 33.4614 95.9694 33.2861C96.4105 33.1109 96.8114 32.848 97.1723 32.4975L98.8362 34.3175C98.3417 34.8837 97.7203 35.3219 96.9718 35.632C96.2234 35.9285 95.3613 36.0768 94.3857 36.0768Z" fill="#14AE5C"/>
<path d="M106.512 36.1577C105.389 36.1577 104.313 36.0094 103.284 35.7128C102.255 35.4028 101.426 35.0051 100.798 34.5197L101.901 32.0526C102.502 32.484 103.21 32.8413 104.026 33.1244C104.854 33.394 105.69 33.5288 106.532 33.5288C107.173 33.5288 107.688 33.4682 108.075 33.3468C108.476 33.212 108.77 33.03 108.957 32.8008C109.145 32.5716 109.238 32.3087 109.238 32.0121C109.238 31.6346 109.091 31.3381 108.797 31.1223C108.503 30.8932 108.115 30.7112 107.634 30.5763C107.153 30.428 106.619 30.2932 106.031 30.1719C105.456 30.0371 104.874 29.8753 104.286 29.6866C103.712 29.4978 103.184 29.2551 102.703 28.9585C102.221 28.6619 101.827 28.271 101.52 27.7856C101.226 27.3003 101.079 26.6801 101.079 25.9252C101.079 25.1163 101.293 24.3815 101.72 23.7209C102.161 23.0468 102.816 22.5143 103.685 22.1234C104.567 21.7189 105.67 21.5167 106.993 21.5167C107.875 21.5167 108.744 21.6245 109.599 21.8402C110.454 22.0425 111.21 22.3525 111.864 22.7705L110.862 25.2578C110.207 24.8804 109.552 24.604 108.897 24.4287C108.242 24.24 107.601 24.1456 106.973 24.1456C106.345 24.1456 105.83 24.2198 105.429 24.368C105.028 24.5163 104.741 24.7118 104.567 24.9545C104.393 25.1837 104.306 25.4533 104.306 25.7634C104.306 26.1274 104.453 26.424 104.747 26.6532C105.042 26.8689 105.429 27.0442 105.91 27.179C106.391 27.3138 106.919 27.4486 107.494 27.5834C108.082 27.7182 108.663 27.8733 109.238 28.0485C109.826 28.2238 110.361 28.4597 110.842 28.7563C111.323 29.0529 111.711 29.4439 112.005 29.9292C112.312 30.4146 112.466 31.028 112.466 31.7695C112.466 32.5649 112.245 33.2929 111.804 33.9535C111.363 34.6141 110.702 35.1466 109.82 35.5511C108.951 35.9555 107.848 36.1577 106.512 36.1577Z" fill="#14AE5C"/>
<path d="M119.015 36.0768C118.12 36.0768 117.318 35.9016 116.61 35.5511C115.915 35.2005 115.373 34.668 114.986 33.9535C114.598 33.2255 114.404 32.302 114.404 31.183V25.0354H117.532V30.7179C117.532 31.6212 117.719 32.2885 118.093 32.7199C118.481 33.1378 119.022 33.3468 119.717 33.3468C120.198 33.3468 120.626 33.2457 121 33.0435C121.374 32.8278 121.668 32.5042 121.882 32.0728C122.096 31.6279 122.203 31.0752 122.203 30.4146V25.0354H125.33V35.9151H122.363V32.9221L122.905 33.7917C122.544 34.5467 122.009 35.1196 121.301 35.5106C120.606 35.8881 119.844 36.0768 119.015 36.0768Z" fill="#14AE5C"/>
<path d="M128.228 35.9151V25.0354H131.215V28.1092L130.794 27.2194C131.115 26.451 131.629 25.8713 132.337 25.4803C133.046 25.0758 133.908 24.8736 134.924 24.8736V27.7856C134.79 27.7722 134.67 27.7654 134.563 27.7654C134.456 27.7519 134.342 27.7452 134.222 27.7452C133.367 27.7452 132.672 27.9946 132.137 28.4934C131.616 28.9788 131.355 29.7405 131.355 30.7786V35.9151H128.228Z" fill="#14AE5C"/>
<path d="M140.082 35.9151L135.551 25.0354H138.779L142.548 34.3984H140.944L144.853 25.0354H147.861L143.31 35.9151H140.082Z" fill="#14AE5C"/>
<path d="M154.196 36.0768C152.966 36.0768 151.884 35.8342 150.948 35.3488C150.026 34.8635 149.311 34.2029 148.803 33.367C148.295 32.5177 148.041 31.5538 148.041 30.4752C148.041 29.3832 148.288 28.4193 148.783 27.5834C149.291 26.7341 149.979 26.0735 150.848 25.6016C151.717 25.1163 152.699 24.8736 153.795 24.8736C154.851 24.8736 155.8 25.1028 156.642 25.5612C157.497 26.0061 158.172 26.6532 158.666 27.5025C159.161 28.3384 159.408 29.3428 159.408 30.5157C159.408 30.637 159.402 30.7786 159.388 30.9403C159.375 31.0886 159.361 31.2302 159.348 31.365H150.587V29.5248H157.704L156.501 30.0708C156.501 29.5045 156.388 29.0125 156.16 28.5945C155.933 28.1766 155.619 27.8531 155.218 27.6239C154.817 27.3812 154.35 27.2599 153.815 27.2599C153.28 27.2599 152.806 27.3812 152.392 27.6239C151.991 27.8531 151.676 28.1833 151.449 28.6148C151.222 29.0327 151.108 29.5315 151.108 30.1112V30.5966C151.108 31.1898 151.235 31.7155 151.489 32.1739C151.757 32.6188 152.124 32.9626 152.592 33.2053C153.073 33.4344 153.634 33.549 154.276 33.549C154.851 33.549 155.352 33.4614 155.78 33.2861C156.221 33.1109 156.622 32.848 156.982 32.4975L158.646 34.3175C158.152 34.8837 157.53 35.3219 156.782 35.632C156.034 35.9285 155.171 36.0768 154.196 36.0768Z" fill="#14AE5C"/>
<path d="M162.658 40C162.096 40 161.542 39.9124 160.994 39.7371C160.446 39.5618 159.998 39.3192 159.651 39.0091L160.793 36.7644C161.034 36.9801 161.308 37.1486 161.615 37.27C161.936 37.3913 162.25 37.452 162.558 37.452C162.999 37.452 163.346 37.3441 163.6 37.1284C163.867 36.9262 164.108 36.5824 164.322 36.0971L164.883 34.7624L165.124 34.4186L168.993 25.0354H172L167.128 36.5824C166.781 37.4587 166.38 38.1463 165.926 38.6451C165.485 39.1439 164.99 39.4944 164.442 39.6967C163.907 39.8989 163.313 40 162.658 40ZM164.502 36.3397L159.691 25.0354H162.918L166.647 34.1355L164.502 36.3397Z" fill="#14AE5C"/>
</svg>
</file>

<file path="themes/survey/fruity_twentythree/views/README.md">
![LimeSurvey Logo](https://account.limesurvey.org/images/logos/logo_main.png)
# LimeSurvey Bootstrap Vanilla Survey Theme

## Views directory
The view directory contains all the necessary views to render the frontend.

* layout_global.twig: render the pages for survey taking
* layout_user_forms.twig: renders the user forms such as: token (survey participant), and register.
* layout_survey_list.twig: render the survey list (if this theme is set as default)
* layout_errors.twig: used to render errors that block survey rendering. ( wrong survey id, empty group in preview group, etc.)


Each one of the layout can have a complete different look & feel from the other layouts.
In vanilla, layout_user_forms and layout_global are pretty similar, and share some subviews: this is not an obligation at all.

## Content system
layout_global.twig renders the specific content via this statement:
```
{% set sViewContent =  './subviews/content/' ~ aSurveyInfo.include_content ~ '.twig' %}
{% include './subviews/content/outerframe.twig' with {'include_content': sViewContent } %}
```

see: https://github.com/LimeSurvey/LimeSurvey/blob/7ffc17fbb872791a9ba1a6b6ab68cec0263f3eca/themes/survey/vanilla/views/layout_global.twig#L103-L111

So, if you're creating a template from scratch, you're free to place the content views where ever you want. Just update the definition of sViewContent in layout_global
</file>

<file path="themes/survey/fruity_twentythree/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>fruity_twentythree</name>
        <title>Fruity TwentyThree</title>
        <type>theme</type>
        <creationDate>03/15/2023</creationDate>
        <author>LimeSurvey GmbH</author>
        <authorEmail>info@limesurvey.org</authorEmail>
        <authorUrl>http://www.limesurvey.org</authorUrl>
        <copyright>Copyright (C) 2005 - 2023 LimeSurvey Gmbh, Inc. All rights reserved.</copyright>
        <license>GNU General Public License version 2 or later</license>
        <version>1.0.0</version>
        <apiVersion>3.0</apiVersion>
        <description twig="on"><![CDATA[{{gT("Our default theme for a fruity and flexible use. This theme offers single color variations")}}]]></description>
        <lastUpdate>2023-10-03 10:31:00</lastUpdate>
    </metadata>
    <compatibility>
        <version>7.0</version>
        <version>6.0</version>
    </compatibility>
    <files>
        <css>
            <add>css/variations/theme_apple.css</add>
            <add>css/base.css</add>
            <add>css/custom.css</add>
            <remove>survey.css</remove>
            <remove>template-core.css</remove>
            <remove>awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css</remove>
            <remove>awesome-bootstrap-checkbox/awesome-bootstrap-checkbox-rtl.css</remove>
... (129 lines truncated)
</file>
                    <file type="view" role="subview">./subviews/footer/footer.twig</file>
                    <file type="view" role="content">./subviews/content/main.twig</file>
                    <file type="view" role="subview">./subviews/messages/justsaved.twig</file>
                    <file type="view" role="subview">./subviews/survey/group.twig</file>
                    <file type="view" role="subview">./subviews/survey/group_subviews/group_container.twig</file>
                    <file type="view" role="subview">./subviews/survey/group_subviews/group_desc.twig</file>
                    <file type="view" role="subview">./subviews/survey/group_subviews/group_name.twig</file>
                    <file type="view" role="subview">./subviews/survey/question.twig</file>
                    <file type="view" role="subview">./subviews/survey/question_container.twig</file>
                    <file type="view" role="subview">./subviews/survey/question_subviews/question_text_container.twig</file>
                    <file type="view" role="subview">./subviews/survey/question_subviews/question_text_content.twig</file>
                    <file type="view" role="subview">./subviews/survey/question_subviews/answers.twig</file>
                    <file type="view" role="subview">./subviews/survey/question_subviews/survey_question_help.twig</file>
                    <file type="view" role="subview">./subviews/survey/question_subviews/valid_message_and_help.twig</file>
                    <file type="view" role="subview">./subviews/survey/question_subviews/question_image_container.twig</file>
                    <file type="view" role="subview">./subviews/survey/question_subviews/question_image.twig</file>
                    <file type="css">./css/variations/theme_apple.css</file>
                    <file type="css">./css/variations/theme_apple-rtl.css</file>
                    <file type="css">./css/variations/theme_blueberry.css</file>
                    <file type="css">./css/variations/theme_blueberry-rtl.css</file>
                    <file type="css">./css/variations/theme_grape.css</file>
                    <file type="css">./css/variations/theme_grape-rtl.css</file>
                    <file type="css">./css/variations/theme_mango.css</file>
                    <file type="css">./css/variations/theme_mango-rtl.css</file>
                    <file type="js">./scripts/theme.js</file>
                    <file type="css">./css/custom.css</file>
                    <file type="js">./scripts/custom.js</file>
                </question>
                <surveylist>
                    <screen_title type="data" role="title" twig="on"><![CDATA[ {{gT('Survey list')}} ]]></screen_title>
                    <file type="view" role="layout">layout_survey_list.twig</file>
                    <file type="view" role="layout">ls_logo_svg.twig</file>
                    <file type="view" role="subview">./subviews/footer/footer.twig</file>
                    <file type="view" role="subview">./subviews/content/mainrow.twig</file>
                    <file type="view" role="subview">./subviews/content/outerframe.twig</file>
                    <file type="view" role="subview">./subviews/navigation/language_changer_form.twig</file>
                    <file type="css">./css/variations/theme_apple.css</file>
                    <file type="css">./css/variations/theme_apple-rtl.css</file>
                    <file type="css">./css/variations/theme_blueberry.css</file>
                    <file type="css">./css/variations/theme_blueberry-rtl.css</file>
                    <file type="css">./css/variations/theme_grape.css</file>
                    <file type="css">./css/variations/theme_grape-rtl.css</file>
                    <file type="css">./css/variations/theme_mango.css</file>
                    <file type="css">./css/variations/theme_mango-rtl.css</file>
                    <file type="js">./scripts/theme.js</file>
                    <file type="css">./css/custom.css</file>
                    <file type="js">./scripts/custom.js</file>
                </surveylist>
                <welcome>
                    <screen_title type="data" role="title" twig="on"><![CDATA[ {{gT('Welcome')}} ]]></screen_title>
                    <file type="view" role="layout">layout_global.twig</file>
                    <file type="view" role="subview">./subviews/footer/footer.twig</file>
                    <file type="view" role="subview">./subviews/content/mainrow.twig</file>
                    <file type="view" role="subview">./subviews/content/outerframe.twig</file>
                    <file type="view" role="content">./subviews/content/firstpage.twig</file>
                    <file type="view" role="subview">./subviews/header/head.twig</file>
                    <file type="view" role="subview">./subviews/header/custom_header.twig</file>
                    <file type="view" role="subview">./subviews/header/nav_bar.twig</file>
                    <file type="view" role="subview">./subviews/header/progress_bar.twig</file>
                    <file type="view" role="subview">./subviews/messages/welcome.twig</file>
                    <file type="view" role="subview">./subviews/messages/warnings.twig</file>
                    <file type="view" role="subview">./subviews/messages/no_js_alert.twig</file>
                    <file type="view" role="subview">./subviews/privacy/privacy.twig</file>
                    <file type="view" role="subview">./subviews/navigation/language_changer.twig</file>
                    <file type="view" role="subview">./subviews/logincomponents/captcha.twig</file>
                    <file type="view" role="subview">./subviews/logincomponents/token.twig</file>
                    <file type="css">./css/variations/theme_apple.css</file>
                    <file type="css">./css/variations/theme_apple-rtl.css</file>
                    <file type="css">./css/variations/theme_blueberry.css</file>
                    <file type="css">./css/variations/theme_blueberry-rtl.css</file>
                    <file type="css">./css/variations/theme_grape.css</file>
                    <file type="css">./css/variations/theme_grape-rtl.css</file>
                    <file type="css">./css/variations/theme_mango.css</file>
                    <file type="css">./css/variations/theme_mango-rtl.css</file>
                    <file type="js">./scripts/theme.js</file>
                    <file type="css">./css/custom.css</file>
                    <file type="js">./scripts/custom.js</file>
                </welcome>
                <completed>
                    <screen_title type="data" role="title" twig="on"><![CDATA[ {{gT('Completed')}} ]]></screen_title>
                    <file type="view" role="layout">layout_global.twig</file>
                    <file type="view" role="subview">./subviews/footer/footer.twig</file>
                    <file type="view" role="subview">./subviews/content/mainrow.twig</file>
                    <file type="view" role="subview">./subviews/content/outerframe.twig</file>
                    <file type="view" role="content">./subviews/content/submit.twig</file>
                    <file type="css">./css/variations/theme_apple.css</file>
                    <file type="css">./css/variations/theme_apple-rtl.css</file>
                    <file type="css">./css/variations/theme_blueberry.css</file>
                    <file type="css">./css/variations/theme_blueberry-rtl.css</file>
                    <file type="css">./css/variations/theme_grape.css</file>
                    <file type="css">./css/variations/theme_grape-rtl.css</file>
                    <file type="css">./css/variations/theme_mango.css</file>
                    <file type="css">./css/variations/theme_mango-rtl.css</file>
                    <file type="js">./scripts/theme.js</file>
                    <file type="css">./css/custom.css</file>
                    <file type="js">./scripts/custom.js</file>
                </completed>
                <assessments>
                    <screen_title type="data" role="title" twig="on"><![CDATA[ {{gT('Assessments')}} ]]></screen_title>
                    <file type="view" role="layout">layout_global.twig</file>
                    <file type="view" role="subview">./subviews/footer/footer.twig</file>
                    <file type="view" role="subview">./subviews/content/mainrow.twig</file>
                    <file type="view" role="subview">./subviews/content/outerframe.twig</file>
                    <file type="view" role="content">./subviews/content/submit.twig</file>
                    <file type="view" role="subview">./subviews/messages/assessments.twig</file>
                    <file type="css">./css/variations/theme_apple.css</file>
                    <file type="css">./css/variations/theme_apple-rtl.css</file>
                    <file type="css">./css/variations/theme_blueberry.css</file>
                    <file type="css">./css/variations/theme_blueberry-rtl.css</file>
                    <file type="css">./css/variations/theme_grape.css</file>
                    <file type="css">./css/variations/theme_grape-rtl.css</file>
                    <file type="css">./css/variations/theme_mango.css</file>
                    <file type="css">./css/variations/theme_mango-rtl.css</file>
                    <file type="js">./scripts/theme.js</file>
                    <file type="css">./css/custom.css</file>
                    <file type="js">./scripts/custom.js</file>
                </assessments>
                <error>
                    <screen_title type="data" role="title" twig="on"><![CDATA[ {{gT('Error')}} ]]></screen_title>
                    <file type="view" role="layout">layout_errors.twig</file>
                    <file type="view" role="subview">./subviews/footer/footer.twig</file>
                </error>
                <clearall>
                    <screen_title type="data" role="title" twig="on"><![CDATA[ {{gT('Clear all')}} ]]></screen_title>
                    <file type="view" role="layout">layout_global.twig</file>
                    <file type="view" role="subview">./subviews/footer/footer.twig</file>
                    <file type="view" role="subview">./subviews/content/mainrow.twig</file>
                    <file type="view" role="subview">./subviews/content/outerframe.twig</file>
                    <file type="view" role="content">./subviews/content/clearall.twig</file>
                    <file type="css">./css/variations/theme_apple.css</file>
                    <file type="css">./css/variations/theme_apple-rtl.css</file>
                    <file type="css">./css/variations/theme_blueberry.css</file>
                    <file type="css">./css/variations/theme_blueberry-rtl.css</file>
                    <file type="css">./css/variations/theme_grape.css</file>
                    <file type="css">./css/variations/theme_grape-rtl.css</file>
                    <file type="css">./css/variations/theme_mango.css</file>
                    <file type="css">./css/variations/theme_mango-rtl.css</file>
                    <file type="js">./scripts/theme.js</file>
                    <file type="css">./css/custom.css</file>
                    <file type="js">./scripts/custom.js</file>
                </clearall>
                <load>
                    <screen_title type="data" role="title" twig="on"><![CDATA[ {{gT('Load')}} ]]></screen_title>
                    <file type="view" role="layout">layout_global.twig</file>
                    <file type="view" role="subview">./subviews/footer/footer.twig</file>
                    <file type="view" role="subview">./subviews/content/mainrow.twig</file>
                    <file type="view" role="subview">./subviews/content/outerframe.twig</file>
                    <file type="view" role="content">./subviews/content/load.twig</file>
                    <file type="css">./css/variations/theme_apple.css</file>
                    <file type="css">./css/variations/theme_apple-rtl.css</file>
                    <file type="css">./css/variations/theme_blueberry.css</file>
                    <file type="css">./css/variations/theme_blueberry-rtl.css</file>
                    <file type="css">./css/variations/theme_grape.css</file>
                    <file type="css">./css/variations/theme_grape-rtl.css</file>
                    <file type="css">./css/variations/theme_mango.css</file>
                    <file type="css">./css/variations/theme_mango-rtl.css</file>
                    <file type="js">./scripts/theme.js</file>
                    <file type="css">./css/custom.css</file>
                    <file type="js">./scripts/custom.js</file>
                </load>
                <save>
                    <screen_title type="data" role="title" twig="on"><![CDATA[ {{gT('Save')}} ]]></screen_title>
                    <file type="view" role="layout">layout_global.twig</file>
                    <file type="view" role="subview">./subviews/footer/footer.twig</file>
                    <file type="view" role="subview">./subviews/content/mainrow.twig</file>
                    <file type="view" role="subview">./subviews/content/outerframe.twig</file>
                    <file type="view" role="content">./subviews/content/save.twig</file>
                    <file type="css">./css/variations/theme_apple.css</file>
                    <file type="css">./css/variations/theme_apple-rtl.css</file>
                    <file type="css">./css/variations/theme_blueberry.css</file>
                    <file type="css">./css/variations/theme_blueberry-rtl.css</file>
                    <file type="css">./css/variations/theme_grape.css</file>
                    <file type="css">./css/variations/theme_grape-rtl.css</file>
                    <file type="css">./css/variations/theme_mango.css</file>
                    <file type="css">./css/variations/theme_mango-rtl.css</file>
                    <file type="js">./scripts/theme.js</file>
                    <file type="css">./css/custom.css</file>
                    <file type="js">./scripts/custom.js</file>
                </save>
                <register>
                    <screen_title type="data" role="title" twig="on"><![CDATA[ {{gT('Registration')}} ]]></screen_title>
                    <file type="view" role="layout">layout_global.twig</file>
                    <file type="view" role="subview">./subviews/footer/footer.twig</file>
                    <file type="view" role="content">./subviews/content/register.twig</file>
                    <file type="view" role="subview">./subviews/registration/register_error.twig</file>
                    <file type="view" role="subview">./subviews/registration/register_head.twig</file>
                    <file type="view" role="subview">./subviews/registration/register_message.twig</file>
                    <file type="view" role="subview">./subviews/registration/register_success.twig</file>
                    <file type="view" role="subview">./subviews/registration/register_form.twig</file>
                    <file type="view" role="subview">./subviews/registration/required.twig</file>
                </register>
                <printanswers>
                    <screen_title type="data" role="title" twig="on">
                        <![CDATA[ {{gT('Print answers')}} ]]></screen_title>
                    <file type="view" role="layout">layout_printanswers.twig</file>
                    <file type="view" role="subview">./subviews/content/outerframe.twig</file>
                    <file type="view" role="content">./subviews/content/printanswers.twig</file>
                    <file type="view" role="subview">./subviews/printanswers/printanswers_head.twig</file>
                    <file type="view" role="subview">./subviews/printanswers/printanswers_table.twig</file>
                    <file type="view" role="subview">./subviews/printanswers/printanswers_question.twig</file>
                    <file type="view" role="subview">./subviews/printanswers/printanswers_foot.twig</file>
                </printanswers>
                <statistics_user>
                    <screen_title type="data" role="title" twig="on">
                        <![CDATA[ {{gT('Public statistics')}} ]]></screen_title>
                    <file type="view" role="layout">layout_statistics_user.twig</file>
                    <file type="view" role="subview">./subviews/content/outerframe.twig</file>
                    <file type="view" role="content">./subviews/content/statistics_user.twig</file>
                    <file type="view" role="subview">./subviews/statistics_user/statistics_user_head.twig</file>
                    <file type="view" role="subview">./subviews/statistics_user/statistics_user_content.twig</file>
                    <file type="view" role="subview">./subviews/statistics_user/statistics_user_foot.twig</file>
                </statistics_user>
                <pdf>
                    <screen_title type="data" role="title" twig="on"><![CDATA[ {{gT('PDF')}} ]]></screen_title>
                    <file type="view" role="layout">layout_print.twig</file>
                </pdf>
                <quotas>
                    <screen_title type="data" role="title" twig="on">
                        <![CDATA[ {{gT('Quotas exceeded')}} ]]></screen_title>
                    <file type="view" role="layout">layout_global.twig</file>
                    <file type="view" role="content">./subviews/content/quotas.twig</file>
                    <file type="view" role="subview">./subviews/header/start_form.twig</file>
                </quotas>
                <navigation>
                    <screen_title type="data" role="title" twig="on"><![CDATA[ {{gT('Navigation')}} ]]></screen_title>
                    <file type="view" role="layout">layout_global.twig</file>
                    <file type="view" role="layout">ls_logo_svg.twig</file>
                    <file type="view" role="subview">./subviews/footer/footer.twig</file>
                    <file type="view" role="content">./subviews/content/main.twig</file>
                    <file type="view" role="subview">./subviews/navigation/ajax_indicator.twig</file>
                    <file type="view" role="subview">./subviews/navigation/clearall_links.twig</file>
                    <file type="view" role="subview">./subviews/navigation/save_links.twig</file>
                    <file type="view" role="subview">./subviews/navigation/language_changer_top_menu.twig</file>
                    <file type="view" role="subview">./subviews/navigation/language_changer.twig</file>
                    <file type="view" role="subview">./subviews/navigation/question_index_menu.twig</file>
                    <file type="view" role="subview">./subviews/navigation/navigator.twig</file>
                    <file type="view" role="subview">./subviews/navigation/navigator_complement.twig</file>
                    <file type="view" role="subview">./subviews/navigation/clearall_buttons.twig</file>
                    <file type="view" role="subview">./subviews/navigation/save_buttons.twig</file>
                    <file type="view" role="subview">./subviews/navigation/question_index_buttons.twig</file>
                    <file type="view" role="subview">./subviews/navigation/question_index_questions_buttons.twig</file>
                    <file type="view" role="subview">./subviews/navigation/question_index_groups_buttons.twig</file>
                </navigation>
                <token>
                    <screen_title type="data" role="title" twig="on"><![CDATA[ {{gT('Participant')}} ]]></screen_title>
                    <file type="view" role="layout">layout_user_forms.twig</file>
                    <file type="view" role="content">./subviews/content/userforms.twig</file>
                    <file type="view" role="subview">./subviews/logincomponents/token.twig</file>
                    <file type="view" role="subview">./subviews/logincomponents/captcha.twig</file>
                </token>
            </screens>
            <default_data>
                <survey type="core">
                    <name type="data" twig="on"><![CDATA[ {{ gT("Template Sample") }} ]]></name>
                    <description type="data" twig="on">
                        <![CDATA[<p>{{ gT('This is a sample survey description. It could be quite long.') }}</p><p>{{ gT("But this one isn't.") }}<p>]]></description>
                    <welcome type="data" twig="on">
                        <![CDATA[<p>{{ gT('Welcome to this sample survey')}} <p> <p> {{ gT('You should have a great time doing this') }} <p> ]]></welcome>
                    <therearexquestions type="data" twig="on">
                        <![CDATA[gT('There are 2 questions in this survey,'])]]></therearexquestions>
                    <surveyls_url type="data" twig="on">"https://www.limesurvey.org/"</surveyls_url>
                    <surveyls_urldescription type="data" twig="on">
                        <![CDATA[ gT("Some URL description") ]]></surveyls_urldescription>
                    <showsurveypolicynotice>2</showsurveypolicynotice>
                    <datasecurity_notice_label type="data" twig="on">
                        <![CDATA[ {STARTPOLICYLINK}{{ gT('Show privacy policy') }}{ENDPOLICYLINK} ]]></datasecurity_notice_label>
                    <datasecurity_notice type="data" twig="on">
                        <![CDATA[ {{ gT("Your privacy policy text is shown here.") }} ]]></datasecurity_notice>
                </survey>
                <group type="core">
                    <name type="data" twig="on"><![CDATA[ {{ gT("Group 1: The first lot of questions") }} ]]></name>
                    <description type="data" twig="on">
                        <![CDATA[ {{ gT("This group description is fairly vacuous, but quite important.") }} ]]></description>
                </group>
                <question_1 type="core">
                    <code type="data">'Q1 '</code>
                    <text type="data" twig="on"><![CDATA[ {{ gT("How many roads must a man walk down?") }} ]]></text>
                    <valid_message type="data" twig="on">
                        <![CDATA[ <div id="vmsg_4496_num_answers" class="em_num_answers emtip error"><span class="ri-error-warning-fill" aria-hidden="true"></span> {{ gT("Choose one of the following answers") }} </div> ]]></valid_message>
                </question_1>
                <question_2 type="core">
                    <code type="data">'Q2 '</code>
                    <text type="data" twig="on"><![CDATA[ {{ gT("Please explain something in detail:") }} ]]></text>
                    <valid_message type="data" twig="on">
                        <![CDATA[<div id="vmsg_4496_num_answers" class="em_num_answers emtip error"><span class="ri-error-warning-fill" aria-hidden="true"></span> {{ gT("Hint when response is not valid") }} </div> ]]></valid_message>
                </question_2>
                <assessments type="core">
                    <name type="data" twig="on"><![CDATA[ {{ gT("Welcome to the Assessment") }} ]]></name>
                    <message type="data" twig="on">
                        <![CDATA[ {{ gT("You got {TOTAL} points out of 3 possible points.") }} ]]></message>
                </assessments>
                <quotas type="custom" arrayName="aQuotas">
                    <sMessage type="data" twig="on">
                        <![CDATA[ {{ gT("Sorry your responses have exceeded a quota on this survey.") }} ]]></sMessage>
                    <sUrl type="data">http://limesurvey.org</sUrl>
                    <sUrlDescription type="data" twig="on"><![CDATA[ {{ gT("End url") }} ]]></sUrlDescription>
                    <bShowNavigator type="data">false</bShowNavigator>
                </quotas>
                <userforms type="custom" arrayName="aForm">
                    <sType type="data">token</sType>
                </userforms>
            </default_data>
        </template_editor>
    </engine>
    <updaters disabled="disabled">
    </updaters>
</config>
</file>

<file path="themes/survey/fruity_twentythree/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="themes/survey/vanilla/css/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    <title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="themes/survey/vanilla/files/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="themes/survey/vanilla/options/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    <title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="themes/survey/vanilla/options/options.js">

</file>

<file path="themes/survey/vanilla/options/options.twig">
{#
here you can create custom HTML for the surveytheme options page
the default one can be found in application/views/themeOptions/options_core.php
to activate this file replace <optionspage>core</optionspage> with <optionspage>custom</optionspage> in the config.xml of this theme
#}
</file>

<file path="themes/survey/vanilla/options/README.md">
![LimeSurvey Logo](https://account.limesurvey.org/images/logos/logo_main.png)
# Survey Themes Custom options

Since LimeSurvey 3, Theme providers can now add their own options in a template.
The files options.twig and options.js will be used to render the theme's option page inside the Admin Interface.
For Core Theme, this option page is very basic and simple. So, please, if you're a Theme Provider, try to create your own option page with its own look and feels.
</file>

<file path="themes/survey/vanilla/scripts/ajaxify.js">
var isIE10 = false;
console.ls.log("isIE10: ", isIE10);
var AjaxSubmitObject = function () {
    var activeSubmit = false;
    var move = '';
    var startLoadingBar = function () {
        //Scroll to the top of the page
        window.scrollTo(0, 0);
        $('#ajax_loading_indicator').css('display', 'block').find('#ajax_loading_indicator_bar').css({
            'width': '20%',
            'display': 'block'
        });
    };
    var endLoadingBar = function () {
        $('#ajax_loading_indicator').css('opacity', '0').find('#ajax_loading_indicator_bar').css('width', '100%');
        setTimeout(function () {
            $('#ajax_loading_indicator').css({
                'display': 'none',
                'opacity': 1
            }).find('#ajax_loading_indicator_bar').css({
                'width': '0%',
                'display': 'none'
            });
        }, 1800);
    };
    var checkScriptNotLoaded = function (scriptNode) {
        if (scriptNode.src) {
            return ($('head').find('script[src="' + scriptNode.src + '"]').length > 0);
        }
        return true;
... (88 lines truncated)
</file>

<file path="themes/survey/vanilla/scripts/custom.js">
$(document).on('ready pjax:scriptcomplete',function(){
});
</file>

<file path="themes/survey/vanilla/scripts/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    <title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="themes/survey/vanilla/scripts/theme.js">
var ThemeScripts = function () {
    var logObject = console.ls ? (window.debugState.frontend ? console.ls : console.ls.silent) : console;
    var focusFirst = function focusFirst() {
        $('#limesurvey :input:visible:enabled:first').focus();
    };
    var fixBodyPadding = function fixBodyPadding() {
        $('body').css('padding-top', Math.round($('#survey-nav').height()) + 'px');
    };
    var hideEmptyPart = function hideEmptyPart() {
        $('.question-help-container').each(function () {
            if ($(this).text().trim() == '' && !/<img/.test($(this).html())) {
                $(this).addClass('d-none');
            }
        });
        $('.group-description').each(function () {
            if ($(this).text().trim() == '' && !/<img/.test($(this).html())) {
                $(this).addClass('d-none');
            }
        });
        $('.question-help-container.hidden').on('html:updated', function () {
            if ($(this).text().trim() != '' && !/<img/.test($(this).html())) {
                $(this).removeClass('d-none');
            }
        });
        $('.question-help-container').on('html:updated', function () {
            if ($(this).text().trim() == '' && !/<img/.test($(this).html())) {
                $(this).addClass('d-none');
            }
        });
    };
... (136 lines truncated)
</file>

<file path="themes/survey/vanilla/views/subviews/content/clearall.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.

    (¯`·._.·(¯`·._.· Clear All Content  ·._.·´¯)·._.·´¯)

    This file displays the page shown to a respondent when they have cleared the survey (only show "Restart this survey")

    NOTE: This content is included inside mainrow.twig
#}

<div class='{{ aSurveyInfo.class.clearall }}' {{ aSurveyInfo.attr.clearall }}>
    <div class=" {{ aSurveyInfo.class.clearalldiv }} " {{ aSurveyInfo.attr.clearalldiv }}>
        <p role="heading" aria-level="2">{{ gT("Answers cleared") }}</p>
        <a href="{{ aSurveyInfo.surveyUrl }}" class="{{ aSurveyInfo.class.clearalla }}" {{ aSurveyInfo.attr.clearalla }}>{{ gT("Restart this survey") }}</a>
    </div>
</div>
</file>

<file path="themes/survey/vanilla/views/subviews/content/firstpage.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.

    (¯`·._.·(¯`·._.· Content First Page  ·._.·´¯)·._.·´¯)

    This content is included inside mainrow.twig

#}

{# render the layout_global content block #}

{# Include the alert for no JavaScript #}
{{ include('./subviews/messages/no_js_alert.twig') }}

{# Include the language changer selector #}
{{ include('./subviews/navigation/language_changer_first_page.twig') }}

{# Include the form opening tag #}
{{ include('./subviews/header/start_form.twig') }} <!-- main form -->

    {# This will display the script and the hidden inputs needed for ExpressionScript Engine #}
    {{ aSurveyInfo.EM.ScriptsAndHiddenInputs  }}
... (16 lines truncated)
</file>

<file path="themes/survey/vanilla/views/subviews/content/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="themes/survey/vanilla/views/subviews/content/load.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.

    (¯`·._.·(¯`·._.· Save page Content  ·._.·´¯)·._.·´¯)

    This file displays the page shown to a respondent when they save the survey to complete it later.

    Depending on survey config, a navigator allowing user to change their response can be shown, and an end url

    Form data are in: aSurveyInfo.aLoadForm (errors, css classes, captcha, etc)
    To show this data, turn debug mode on and copy the following line to the end of the <body> element in this file:
    {{ dump(aSurveyInfo.aLoadForm ) }} )

    (¯`·._.·(¯`·._.·  Advanced ·._.·´¯)·._.·´¯)

    The form is generated using the Yii function CHtml::form. You must keep it to get the CRSF token.
    Inputs are also generated using the Yii function CHtml. Eg: input textField is generated via CHtml::textField
    You can replace those inputs by pure Html (<input type="text" ... />), just be sure to use the correct options (id, classes, required, etc)
    @see: http://www.yiiframework.com/wiki/48/by-example-chtml/ , http://www.yiiframework.com/doc/api/1.1/CHtml

    NOTE: see layout_global.twig for more infos
    NOTE: This content is included inside mainrow.twig
... (116 lines truncated)
</file>

<file path="themes/survey/vanilla/views/subviews/content/main.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.



    (¯`·._.·(¯`·._.·  Main Content  ·._.·´¯)·._.·´¯)

    This is the main content of the template.
    It is the file used to display groups and questions.

    NOTE: This content is included inside mainrow.twig
    NOTE: see layout_global.twig for more infos
#}

{# Include the form opening tag #}
{{ include('./subviews/header/start_form.twig') }} <!-- main form -->

    {# This will display the script and the hidden inputs needed for ExpressionScript Engine #}
    {{ aSurveyInfo.EM.ScriptsAndHiddenInputs  }}

    {# Include the alert for no JavaScript #}
    {{ include('./subviews/messages/no_js_alert.twig') }}
... (22 lines truncated)
</file>

<file path="themes/survey/vanilla/views/subviews/content/mainrow.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.

    (¯`·._.·(¯`·._.· Main Row  ·._.·´¯)·._.·´¯)

#}

<!-- Main Row -->
<div id="{{ aSurveyInfo.id.mainrow }}" {{ aSurveyInfo.attr.mainrow }} >
    <!-- Main Col -->
    <div class="{{ aSurveyInfo.class.maincol }} col-centered  space-col" id="{{ aSurveyInfo.id.maincol }}" {{ aSurveyInfo.attr.maincol }}>

        {# This is the main block that will be replaced/extended by other layouts#}
            {# Include the various Warnings (preview mode, unanswered mandatory questions, etc) #}
            {{ include('./subviews/messages/warnings.twig') }}
            {# Include the just saved success #}
            {{ include('./subviews/messages/justsaved.twig') }}

            {# Which file to include for content is decided inside the layout #}
            {% if(include_content) != "./subviews/content/" %}
                {{ include(include_content) }}
            {% endif %}
... (5 lines truncated)
</file>

<file path="themes/survey/vanilla/views/subviews/content/optin.twig">
<p>{{ aSurveyInfo.optin_message }} </p>
{% if aSurveyInfo.optin_link %}
    <p><a href="{{ aSurveyInfo.optin_link }}" class="btn btn-outline-secondary btn-lg"> {{ gT("I confirm") }} </a><p>
{% endif %}
</file>

<file path="themes/survey/vanilla/views/subviews/content/optout.twig">
<p>{{ aSurveyInfo.optin_message }} </p>
{% if aSurveyInfo.optin_post_link is defined and aSurveyInfo.optin_post_link %}
    {% set htmlOptions = {
        'id'    : 'form-optout',
        'class' : 'ls-form',
    } %}
    {{
        C.Html.form(
            ( aSurveyInfo.optin_post_link ),
            'post',
            (htmlOptions)
        )
    }}
        <p><button type="submit" class="btn btn-outline-secondary btn-lg"> {{ gT("I confirm") }} </button></p>
    </form>
{% elseif aSurveyInfo.optin_link %}
    <p><a href="{{ aSurveyInfo.optin_link }}" class="btn btn-outline-secondary btn-lg"> {{ gT("I confirm") }} </a></p>
{% endif %}
</file>

<file path="themes/survey/vanilla/views/subviews/content/outerframe.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.



    (¯`·._.·(¯`·._.· Outer Frame  ·._.·´¯)·._.·´¯)

    This div will often change from a template to another.
    So, to keep changes between ls-inherited templates as slightly as possible, we put it in a separated file

#}
<!-- outer frame container -->
<main role="main" class="{{ aSurveyInfo.class.outerframe }}  {% if (aSurveyInfo.options.container == "on") %} container-md {% else %} container-fluid {% endif %} " id="{{ aSurveyInfo.id.outerframe }}" {{ aSurveyInfo.attr.outerframe }} >
    {# Which file to include for content is decided inside the layout #}
    {% include './subviews/content/mainrow.twig' with {'include_content': include_content } %}
</main>
</file>

<file path="themes/survey/vanilla/views/subviews/content/printanswers.twig">
{# 
    LimeSurvey 
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved. 
    License: GNU/GPL License v2 or later, see LICENSE.php 
    LimeSurvey is free software. This version may have been modified pursuant 
    to the GNU General Public License, and as distributed it includes or 
    is derivative of works licensed under the GNU General Public License or 
    other free or open source software licenses. 
    See COPYRIGHT.php for copyright notices and details. 
 
    (¯`·._.·(¯`·._.· Print answers Layout  ·._.·´¯)·._.·´¯) 
 
    This file displays the page shown to user when a participant registers for taking a survey. 
 
    NOTE: see layout_main.twig for more infos 
#}<section> 
        {% if (aSurveyInfo.printPdf != 1) %} 
            {# This will display the script and the hidden inputs needed for ExpressionScript Engine #} 
            {{ aSurveyInfo.EM.ScriptsAndHiddenInputs  }} 
        {% endif %} 
 
        {{ include('./subviews/printanswers/printanswers_head.twig') }} 
        {{ include('./subviews/printanswers/printanswers_table.twig') }} 
        {{ include('./subviews/printanswers/printanswers_foot.twig') }} 
    </section>
</file>

<file path="themes/survey/vanilla/views/subviews/content/quotas.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.

    (¯`·._.·(¯`·._.· Quotas Content  ·._.·´¯)·._.·´¯)

    This file displays the page shown to user when a quota limit is reached.
    Depending on survey config, a navigator allowing the respondent to change their responses can be shown, and an end url.

    Quotas data are in: aSurveyInfo.aQuotas
    To show this data, turn debug mode on and copy the following line to the end of the <body> element in this file:
    {{ dump(aSurveyInfo.aQuotas ) }} )

    NOTE: This content is included inside mainrow.twig
    NOTE: see layout_global.twig for more infos
#}


    {# Include the form opening tag #}
    {{ include('./subviews/header/start_form.twig') }} <!-- main form -->

        {# This will display the script and the hidden inputs needed for ExpressionScript Engine #}
        {{ aSurveyInfo.EM.ScriptsAndHiddenInputs  }}
... (79 lines truncated)
</file>

<file path="themes/survey/vanilla/views/subviews/content/README.md">
![LimeSurvey Logo](https://account.limesurvey.org/images/logos/logo_main.png)
# LimeSurvey Bootstrap Vanilla Survey Theme

## content directory


layout_global.twig renders the specific content via this statement:
```
{% set sViewContent =  './subviews/content/' ~ aSurveyInfo.include_content ~ '.twig'%}
{% include './subviews/content/outerframe.twig' with {'include_content': sViewContent } %}
```

see: https://github.com/LimeSurvey/LimeSurvey/blob/7ffc17fbb872791a9ba1a6b6ab68cec0263f3eca/themes/survey/vanilla/views/layout_global.twig#L103-L111

Here are the subviews to render the content. Most of them corresponds to the old pstpl files for limesurvey 2.x

* mainrow.twig
* submit_preview.twig  
* quotas.twig
* survey_list.twig
* clearall.twig
* register.twig
* firstpage.twig
* load.twig
* outerframe.twig
* submit.twig
* save.twig
* main.twig


... (5 lines truncated)
</file>

<file path="themes/survey/vanilla/views/subviews/content/register.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.

    (¯`·._.·(¯`·._.· Registration Content  ·._.·´¯)·._.·´¯)

    This file displays the page shown to user when a participant registers for taking a survey.
    
    NOTE: This content is included inside mainrow.twig
    NOTE: see layout_global.twig for more infos
#}
    <div class="{{ aSurveyInfo.class.register }} container" {{ aSurveyInfo.attr.register }}>
        {# This will display the script and the hidden inputs needed for ExpressionScript Engine #}
        {{ aSurveyInfo.EM.ScriptsAndHiddenInputs  }}

        <div class="{{ aSurveyInfo.class.registerrow }} row" {{ aSurveyInfo.attr.registerrow }}>
            <div class='{{ aSurveyInfo.class.registerrowjumbotron }}' {{ aSurveyInfo.attr.registerrowjumbotron }}>
                <div class="{{ aSurveyInfo.class.registerrowjumbotrondiv }} container clearfix" {{ aSurveyInfo.attr.registerrowjumbotrondiv }}>
                    {{ include('./subviews/registration/register_head.twig') }}
                    {{ include('./subviews/registration/register_message.twig') }}
                </div>
            </div>
        </div>
... (7 lines truncated)
</file>

<file path="themes/survey/vanilla/views/subviews/content/save.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.

    (¯`·._.·(¯`·._.· Save page Content  ·._.·´¯)·._.·´¯)

    This file displays the page shown to a respondent when they save the survey to complete later.

    Depending on survey config, a navigator allowing the respondent to change their responses can be shown, and an end url.

    Form data are in: aSurveyInfo.aSaveForm (errors, css classes, captcha, etc)
    To show this data, turn debug mode on and copy the following line to the end of the <body> element in this file:
    {{ dump(aSurveyInfo.aSaveForm ) }} )

    (¯`·._.·(¯`·._.·  Advanced ·._.·´¯)·._.·´¯)

    The form is generated using the Yii function CHtml::form. You must keep it to get the CRSF token.
    Inputs are also generated using the Yii function CHtml. Eg: input textField is generated via CHtml::textField
    You can replace those inputs by pure Html (<input type="text" ... />), just be sure to use the correct options (id, classes, required, etc)
    @see: http://www.yiiframework.com/wiki/48/by-example-chtml/ , http://www.yiiframework.com/doc/api/1.1/CHtml

    NOTE: This content is included inside mainrow.twig
    NOTE: see layout_global.twig for more infos
... (208 lines truncated)
</file>

<file path="themes/survey/vanilla/views/subviews/content/statistics_user.twig">
{# 
    LimeSurvey 
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved. 
    License: GNU/GPL License v2 or later, see LICENSE.php 
    LimeSurvey is free software. This version may have been modified pursuant 
    to the GNU General Public License, and as distributed it includes or 
    is derivative of works licensed under the GNU General Public License or 
    other free or open source software licenses. 
    See COPYRIGHT.php for copyright notices and details. 
 
    (¯`·._.·(¯`·._.· Public Statistics Layout  ·._.·´¯)·._.·´¯) 
 
    This file displays the page shown to user when viewing the statistics after taking a survey. 
 
    NOTE: see layout_main.twig for more infos 
#}<section> 
        {{ include('./subviews/statistics_user/statistics_user_head.twig') }} 
        {{ include('./subviews/statistics_user/statistics_user_content.twig') }} 
        {{ include('./subviews/statistics_user/statistics_user_foot.twig') }} 
    </section>
</file>

<file path="themes/survey/vanilla/views/subviews/content/submit_preview.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.

    (¯`·._.·(¯`·._.· Submit Preview Content  ·._.·´¯)·._.·´¯)

    TODO: this file should be merged with layout_submit,
    adding the warning message "Your survey responses have not been recorded. This survey is not yet active." to  aSurveyInfo.errorHtml.messages

    NOTE: This content is included inside mainrow.twig
    NOTE: see layout_global.twig for more infos
#}
{% extends "./subviews/content/submit.twig" %}
{% block endtext %}
    <div class="alert alert-warning"><strong class="h4 text-danger">{{ gT("Responses were not saved") }} </strong>
        {{ gT("Your survey responses have not been recorded. This survey is not yet active.") }}
    </div>
    {{ parent() }}
{% endblock %}
{% block printanswer %}
    {#  Link to Print Answer Preview #}
    {% if (aSurveyInfo.aCompleted.aPrintAnswers.show == true) %}
        <!--  Link to Print Answer Preview -->
... (28 lines truncated)
</file>

<file path="themes/survey/vanilla/views/subviews/content/submit.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.

    (¯`·._.·(¯`·._.· Submit Content  ·._.·´¯)·._.·´¯)

    This page is displayed after user submits the survey.
    It could be, visually, very different (no header, etc).

    It shows the end text, assessments, print answer, and statistics.

    Data are in: aSurveyInfo.aCompleted and aSurveyInfo.aAssessments.
    To show this data, turn debug mode on and copy the following line to the end of the <body> element in this file:
    {{ dump(aSurveyInfo.aCompleted ) }}

    NOTE: This content is included inside mainrow.twig
    NOTE: see layout_global.twig for more infos
#}

{# include the form opening tag #}
<!-- main form -->
{{ include('./subviews/header/start_form.twig') }}
    {# This will display the script and the hidden inputs needed for ExpressionScript Engine #}
... (56 lines truncated)
</file>

<file path="themes/survey/vanilla/views/subviews/content/userforms.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.

    (¯`·._.·(¯`·._.· User Forms Layout  ·._.·´¯)·._.·´¯)

    This file renders the user forms such as: token (survey participant), and register.

    NOTE: see layout_global.twig for more infos
#}

<!-- Main Row -->
<div id="{{ aSurveyInfo.id.mainrow }}" {{ aSurveyInfo.attr.mainrow }}>

    <!-- Main Col -->
    <div class="{{ aSurveyInfo.class.maincol }} col-centered " id="{{ aSurveyInfo.id.maincol }}" {{ aSurveyInfo.attr.maincol }}>

        <div class='{{aSurveyInfo.aForm.sType}}-page' {{ aSurveyInfo.attr.maincoldiv }}>
                {% set sUserformContent =  './subviews/logincomponents/' ~ aSurveyInfo.aForm.sType ~ '.twig' %}
                {% include sUserformContent %}
        </div>

        {{ include('./subviews/navigation/language_changer_form.twig') }}
... (4 lines truncated)
</file>

<file path="themes/survey/vanilla/views/subviews/footer/footer.twig">
{#
Add your footer in this file.

For example :
<footer role="contentinfo">
<p class="text-center">© My company</p>
</footer>

You will need to add custom CSS to have the footer at bottom.
For example, the following should work for a bottom-aligned footer in
all browsers that properly support flex:

body {
     padding-bottom: 0; /* no bottom padding, footer should be bottom aligned */
     flex-direction: column; /* content, then footer */
     display: flex; /* flex, to extend the content to full size */
     min-height: 100vh; /* full height, to bottom-align footer */
}
body > #content {
    flex: 1; /* the main article should use as much space as possible */
}
#}
</file>

<file path="themes/survey/vanilla/views/subviews/header/custom_header.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.

    (¯`·._.·(¯`·._.· Custom Header  ·._.·´¯)·._.·´¯)

    If you extend a template, and want to add custom headers (js, css, scripts, meta etc), you'd rather do it here.

#}

{# Custom logo option #}
{% if ( aSurveyInfo.options.brandlogo == "on" ) %}
    <style>
        body .top-container {
            margin-top: 70px;
        }
    </style>
{% endif %}
</file>

<file path="themes/survey/vanilla/views/subviews/header/google_analytics.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.

    (¯`·._.·(¯`·._.· Google Analytics  ·._.·´¯)·._.·´¯)

    This file generates the scripts for Google Analytics, as set by user in survey settings.
    See: survey settings
#}
{% if aSurveyInfo.googleanalyticsapikey  is defined and aSurveyInfo.googleanalyticsapikey and aSurveyInfo.googleanalyticsstyle %}
    {# Check if the tracking ID is a Universal Analytics (legacy) or a Google Analytics 4 ID #}
    {% if aSurveyInfo.googleanalyticsapikey starts with 'UA-' %}
        {# Legacy UA #}
        {% if aSurveyInfo.googleanalyticsstyle  is defined and aSurveyInfo.googleanalyticsstyle == 1 %}
            <script>
            (function(i,s,o,g,r,a,m){ i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
                (i[r].q=i[r].q||[]).push(arguments) },i[r].l=1*new Date();a=s.createElement(o),
                m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
            })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

            ga('create', '{{aSurveyInfo.googleanalyticsapikey}}', 'auto');  // Replace with your property ID.
            ga('send', 'pageview');
            </script>
... (31 lines truncated)
</file>

<file path="themes/survey/vanilla/views/subviews/header/head.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.

    (¯`·._.·(¯`·._.· Header  ·._.·´¯)·._.·´¯)

    This file generates the headers.
    Most of the time, it is not the right place to add your own JS/CSS - instead, use the config.xml file for that.
#}

{% if(aSurveyInfo.jYesNo) %}
    {{ registerScript('activateConfirmLanguage',"$.extend(LSvar.lang," ~ aSurveyInfo.jYesNo ~ ")", "POS_BEGIN") }}
{% endif %}
{{ registerScript('activateActionLink',"activateActionLink();", "POS_POSTSCRIPT") }}
{{ registerScript('activateConfirmButton',"activateConfirmButton();", "POS_POSTSCRIPT") }}

<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="generator" content="LimeSurvey http://www.limesurvey.org" />

    {{ aSurveyInfo.metas }}
... (44 lines truncated)
</file>

<file path="themes/survey/vanilla/views/subviews/header/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="themes/survey/vanilla/views/subviews/header/nav_bar.twig">
{#
LimeSurvey
Copyright (C) 2007-2026 The LimeSurvey Project Team
All rights reserved.
License: GNU/GPL License v2 or later, see LICENSE.php
LimeSurvey is free software. This version may have been modified pursuant
to the GNU General Public License, and as distributed it includes or
is derivative of works licensed under the GNU General Public License or
other free or open source software licenses.
See COPYRIGHT.php for copyright notices and details.

(¯`·._.·(¯`·._.· Bootstrap Navigation Bar ·._.·´¯)·._.·´¯)

This file renders a typical bootstrap navigation bar.
See: https://getbootstrap.com/components/#navbar

For the survey navigator ("Next", "Back", etc.), see: navigation/navigator.twig
#}
{% if not aSurveyInfo.popupPreview %}
    {% set navClass = "navbar-light bg-light" %}
    {% if( aSurveyInfo.template == "bootswatch") %}
        {% set navClass = "navbar-default bg-primary" %}
    {% endif %}
    <!-- Bootstrap Navigation Bar -->
    {# ShowMenu used for navbar-toggler and navbar-collapse #}
    {% set ShowMenu = (aSurveyInfo.aNavigator.load.show == "Y" or aSurveyInfo.aNavigator.save.show == "Y")
        or ((aSurveyInfo.bShowClearAll == true or aSurveyInfo.bShowClearAll == null) and aSurveyInfo.options.showclearall == 'on')
        or (aSurveyInfo.aQuestionIndex.bShow == true and aSurveyInfo.format != 'A')
        or (aSurveyInfo.alanguageChanger.show)
    %}
... (33 lines truncated)
</file>

<file path="themes/survey/vanilla/views/subviews/header/progress_bar.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.

    (¯`·._.·(¯`·._.· Top Container·._.·´¯)·._.·´¯)

    This file generates the top container. It's above the form itself, and contains the progress bar.
    The progress bar is a Bootstrap progress bar.
    @see: http://getbootstrap.com/components/#progress

#}
{# do not show if : All in one or is not Y or on aCompleted #}
{% if aSurveyInfo.showprogress == 'Y' and aSurveyInfo.format != 'A' and not aSurveyInfo.aCompleted %}
    <!-- Top container -->
    <aside class="{{ aSurveyInfo.class.topcontainer  }} space-col"  {{ aSurveyInfo.attr.topcontainer  }} >
        <div class="{{ aSurveyInfo.class.topcontent  }} container-fluid" {{ aSurveyInfo.attr.topcontent  }} >
            {% set progressValue  = aSurveyInfo.progress.value %}
            <div class="visually-hidden">{{ sprintf(gT('You have completed %s%% of this survey'),progressValue) }}</div>
                <div class="{{ aSurveyInfo.class.progress  }}" {{ aSurveyInfo.attr.progress  }}  aria-hidden="true">
                    <div class="{{ aSurveyInfo.class.progressbar  }}" {{ aSurveyInfo.attr.progressbar  }} style="min-width: 2em; width: {{ progressValue }}%;">
                        {{ progressValue }}%
                    </div>
                </div>
... (4 lines truncated)
</file>

<file path="themes/survey/vanilla/views/subviews/header/start_form.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.

    (¯`·._.·(¯`·._.· Start Form ·._.·´¯)·._.·´¯)

    This file generates the opening form tag and the CRSF token for the main survey Form.
    eg:
        <form enctype="multipart/form-data" id="limesurvey" name="limesurvey" autocomplete="off" class="survey-form-container" action="index.php/289445" method="post">
        <input type="hidden" value="393e1f3e91d6fb062b8c67d39771bb674de337ca" name="YII_CSRF_TOKEN">

    It uses the Yii function CHtml::form
    @see: http://www.yiiframework.com/doc/api/1.1/CHtml#form-detail

    The hidden submit button is used for any submission (triggered via JS event).
#}

{#
    array of attributes of the form tag.
    To add a new attribute, just add an entry:
    'attribute' : 'value',
#}
{% set htmlOptions = {
... (33 lines truncated)
</file>

<file path="themes/survey/vanilla/views/subviews/logincomponents/captcha.twig">
<div class="{{ aSurveyInfo.class.maincoldivdiva }} h2" {{ aSurveyInfo.attr.maincoldivdiva }}>
    {% block formheading %}
        {{ gT("Before you start, please prove you are human.") }}
    {% endblock %}
</div>
<div class="{{ aSurveyInfo.class.maincoldivdivb }} card card-body bg-light container-fluid mb-3" {{ aSurveyInfo.attr.maincoldivdivb }}>

    {% block description %}
        
    {% endblock %}

    {% if  not empty(aSurveyInfo.aForm.aEnterErrors) %}
        <ul class='{{ aSurveyInfo.class.maincoldivdivbul }} alert alert-danger list-unstyled' {{ aSurveyInfo.attr.maincoldivdivbul }}>
            {% for  key, error in aSurveyInfo.aForm.aEnterErrors %}
                <li>{{ error }}</li>
            {% endfor %}
        </ul>
    {% endif %}

    <div class="form-{{ aSurveyInfo.aForm.sType }} {{ aSurveyInfo.class.maincoldivdivbdiv }}" {{ aSurveyInfo.attr.maincoldivdivbdiv }} >
        {#
            array of attributes of the form tag.
            To add a new attribute, just add an entry:
            'attribute' : 'value',
        #}
        {%
            set htmlOptions = {
                'id'          : 'form-' ~ aSurveyInfo.aForm.sType ,
                'name'        : 'limesurvey',
                'class'       : 'ls-form form form-horizontal',
... (49 lines truncated)
</file>

<file path="themes/survey/vanilla/views/subviews/logincomponents/token_privacy.twig">
{% extends './subviews/privacy/privacy.twig' %}
</file>

<file path="themes/survey/vanilla/views/subviews/logincomponents/token.twig">
{% extends "./subviews/logincomponents/captcha.twig" %}

    {% block formheading %}
        {{ gT("To participate in this restricted survey, you need a valid access code.") }}
    {% endblock %}

    {% block description %}
        <div class="col-lg-8 offset-lg-2">
            <p class='{{ aSurveyInfo.class.maincoldivdivbp }} text-info' {{ aSurveyInfo.attr.maincoldivdivbp }}>
                {% if aSurveyInfo.aForm.token == null %}
                    {{ gT("If you have been issued an access code, please enter it in the box below and click continue.") }}
                {% else %}
                    {{ gT("Please confirm the access code by answering the security question below and click continue.") }}
                {% endif %}
            </p>
        </div>
    {% endblock %}


    {% block formcontent %}
        <div class="col-lg-8 offset-lg-2">
            <span class="{{ aSurveyInfo.class.maincolformmandatoryinfo }}" {{ aSurveyInfo.attr.maincolformmandatoryinfo }}>
                {{ sprintf(gT("Fields marked with %s are mandatory."), '<span class="' ~ aSurveyInfo.class.maincolformmandatoryinfoasterisk ~ '">*</span>') }}
            </span>
            <div class='{{ aSurveyInfo.class.maincolform }} mb-3' {{ aSurveyInfo.attr.maincolform }}>
                <label
                    class='{{ aSurveyInfo.class.maincolformlabel }} control-label col-md-3' {{ aSurveyInfo.attr.maincolformlabel }}>
                    <small
                        class="{{ aSurveyInfo.class.maincolformlabelsmall }} text-danger asterisk fa fa-asterisk float-start small " {{ aSurveyInfo.attr.maincolformlabelsmall }} ></small>
                    {{ gT("Access code:") }}
... (103 lines truncated)
</file>

<file path="themes/survey/vanilla/views/subviews/messages/assessments.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.



    (¯`·._.·(¯`·._.·  Assessments ·._.·´¯)·._.·´¯)

    This file renders the results of Assessments.
    The data are inside aSurveyInfo.aAssessments.datas
#}

{% set aAssessments = aSurveyInfo.aAssessments.datas %}
<!-- Assessments -->
<div class="{{ aSurveyInfo.class.assessmenttable }} border" {{ aSurveyInfo.attr.assessmenttable }} role="region" aria-labelledby="ls-assessment-heading">

    <!-- Heading -->
    <div class="{{ aSurveyInfo.class.assessmentheading }} border-bottom-0 border-top p-2" {{ aSurveyInfo.attr.assessmentheading }} id="ls-assessment-heading" role="heading" aria-level="2">
        {{ gT("Your assessment") }}
    </div>

    <!-- Results -->
    <div class="{{ aSurveyInfo.class.assessmentscontainer }} border-bottom-0 border-top p-2" {{ aSurveyInfo.attr.assessmentscontainer }} >
... (47 lines truncated)
</file>

<file path="themes/survey/vanilla/views/subviews/messages/bootstrap_alert_modal.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.



    (¯`·._.·(¯`·._.·  Bootstrap Modal Alert ·._.·´¯)·._.·´¯)

    This is the modal that shows most of the alert messages.
    The conversion from pure JavaScript alert to Bootstrap modal is done in theme-core.js

    About Bootstrap modal, see: http://getbootstrap.com/javascript/#modals
#}



{# Register script for modal #}
{% if( empty(json_decode(aSurveyInfo.jPopup)) == false ) %}
    {{ registerScript('startPopup',"LSvar.startPopups = " ~ aSurveyInfo.jPopup , "POS_HEAD") }}
    {{ registerScript('showStartPopups',"window.templateCore.alertSurveyDialog(" ~ aSurveyInfo.jPopup ~ ");", "POS_END") }}
    {{ registerScript('activateSoftMandatory',"activateSoftMandatory();", "POS_END") }}
{% endif %}
<!-- Bootstrap Modal Alert -->
... (32 lines truncated)
</file>

<file path="themes/survey/vanilla/views/subviews/messages/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="themes/survey/vanilla/views/subviews/messages/justsaved.twig">
{% if (intval(aSurveyInfo.options.showpopups) >= 0 and aSurveyInfo.saved.text) %}
    {% set savedClass = 'success' %}
    {% if (not aSurveyInfo.saved.success) %}
        {% set savedClass = 'error' %}
    {% endif %}
    {% if (aSurveyInfo.active != "Y") %}
        {% set savedClass = 'info' %}
    {% endif %}
    <div class="alert alert-{{ savedClass }} alert-dismissible fade in{% if(intval(aSurveyInfo.options.showpopups) > 0) %} ls-js-hidden{% endif %} " role="alert">
        <button class="btn-close ls-no-js-hidden" data-bs-dismiss="alert"><span class="visually-hidden">{{ gT("Close") }}</span></button>
        {{ aSurveyInfo.saved.text }}
    </div>
{% endif %}
</file>

<file path="themes/survey/vanilla/views/subviews/messages/no_js_alert.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.

    (¯`·._.·(¯`·._.· No JavaScript Alert  ·._.·´¯)·._.·´¯)

    If JavaScript is not enabled, this alert will appear on the screen.

#}


<!-- No JavaScript alert -->
<div class='{{ aSurveyInfo.class.nojs  }} alert alert-danger '  {{ aSurveyInfo.attr.nojs  }} data-type='checkjavascript'>
    {{
        "Caution: JavaScript execution is disabled in your browser or for this website. You may not be able to answer all questions in this survey. Please, verify your browser parameters."
        | t
    }}
</div>
</file>

<file path="themes/survey/vanilla/views/subviews/messages/warnings.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.



    (¯`·._.·(¯`·._.· Warnings  ·._.·´¯)·._.·´¯)

    Show various warnings on top of the form

    Error Html warnings can be:
        - One or more mandatory questions have not been answered. You cannot proceed until these have been completed.
        - One or more questions have not been answered in a valid manner. You cannot proceed until these answers are valid.
        - One or more uploaded files are not in proper format/size. You cannot proceed until these files are valid.

    The easiest way to change the text in the warnings is to create a new translation.

    These warnings are complementary to the popup ones. If you're using popups (set in config file), and then don't want to show these alerts, you can uncomment the hiddenClass checker
#}

{# Preview mode warning #}
{% if (aSurveyInfo.active != 'Y') and (not aSurveyInfo.popupPreview) %}
    <!-- Preview mode warning -->
... (20 lines truncated)
</file>

<file path="themes/survey/vanilla/views/subviews/messages/welcome.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.


    (¯`·._.·(¯`·._.·  Welcome page ·._.·´¯)·._.·´¯)

    This view is used to render the welcome message in All In One mode.
    TODO: use it for other modes too

    In this file, you have access to the array aSurveyInfo that contains the datas of the current survey
    To see what's inside aSurveyInfo, turn debug mode on and copy the following line to the end of this file:
    {{ dump(aSurveyInfo) }}

#}

<!-- Welcome Message -->
<div id="{{ aSurveyInfo.id.welcomecontainer }}" class="{{ aSurveyInfo.class.welcomecontainer }}" {{ aSurveyInfo.attr.welcomecontainer }}>

    <!-- Survey Name -->
    <h1 class="{{ aSurveyInfo.class.surveyname }} text-center" {{ aSurveyInfo.attr.surveyname }} >
        {{ processString(aSurveyInfo.name,1) }}
    </h1>
... (29 lines truncated)
</file>

<file path="themes/survey/vanilla/views/subviews/navigation/ajax_indicator.twig">
<script>
    $.ajaxSetup({
        beforeSend:function(){
            // show gif here, eg:
            $("#ajax-loading").show();
        },
        complete:function(){
            // hide gif here, eg:
            $("#ajax-loading").hide();
        }
    });
</script>
<div id="ajax-loading" hidden></div>
</file>

<file path="themes/survey/vanilla/views/subviews/navigation/clearall_buttons.twig">
{#
    This file is part of LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    This file render the exit button accessible without javascript
#}

<div class="{{ aSurveyInfo.class.clearallwrapper }}">
    <div class="{{ aSurveyInfo.class.clearallwrapper }}">
        <label class="col-form-label fw-bold {{ aSurveyInfo.class.clearalllabel }}">
            <input {{ aSurveyInfo.attr.clearallconfirm }} class="me-2 {{ aSurveyInfo.class.clearallconfirm }}"><span class="control-label">{{gT("Please confirm you want to clear your response?")}}</span>
        </label>
        <button {{ aSurveyInfo.attr.clearallbutton }} class="{{ aSurveyInfo.class.clearallbutton }} btn btn-link" title="{{ gT("This action need to be confirmed.") }}">{{gT("Exit and clear survey")}}</button>
    </div>
</div>
</file>

<file path="themes/survey/vanilla/views/subviews/navigation/clearall_links.twig">
{#
LimeSurvey
Copyright (C) 2007-2026 The LimeSurvey Project Team
All rights reserved.
License: GNU/GPL License v2 or later, see LICENSE.php
LimeSurvey is free software. This version may have been modified pursuant
to the GNU General Public License, and as distributed it includes or
is derivative of works licensed under the GNU General Public License or
other free or open source software licenses.
See COPYRIGHT.php for copyright notices and details.

(¯`·._.·(¯`·._.· Clear all links: Shows the exit button ·._.·´¯)·._.·´¯)

This file render the exit button for top menu bar
#}

{# It must not be shown once survey is completed #}
{# aSurveyInfo.options.bShowClearAll is a user option to decide if the "exit and clear" button should be shown #}
{# aSurveyInfo.bShowClearAll is define in core, so if option is on, it's not shown in welcome and submit page. #}


 {% if aSurveyInfo.bShowClearAll == true or aSurveyInfo.bShowClearAll == null %}
     {% if aSurveyInfo.options.showclearall == 'on' %}
         <!-- Exit and clear survey -->
         <li class="nav-item ls-no-js-hidden px-2">
             <a href="#" class='nav-link ls-link-action ls-link-clearall'
                data-limesurvey-submit='{ "clearall":"clearall" }'
                data-confirmedby='{ "confirm-clearall":"confirm" }'
                data-confirmlabel='{{ gT("Please confirm you want to clear your response?" ) }}'>
                 {{ gT("Exit and clear survey" ) }}
... (5 lines truncated)
</file>

<file path="themes/survey/vanilla/views/subviews/navigation/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="themes/survey/vanilla/views/subviews/navigation/language_changer_first_page.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.

    (¯`·._.·(¯`·._.· Language Changer  ·._.·´¯)·._.·´¯)

    This file renders language changer inside the main container when multiple survey languages are available.

    It uses the Yii helper CHtml::dropDownList().
    @see: http://www.yiiframework.com/wiki/48/by-example-chtml/#hh5

#}
{% if aSurveyInfo.alanguageChanger.show == true %}
    {% set htmlOptions = {
        'id'          : 'firstpage-changelang',
        'autocomplete': 'off',
        'class'       : 'form',
    } %}

    <!-- Start of language change Form-->
    {{ C.Html.form(
        ( aSurveyInfo.surveyUrl ),
    'post',
... (9 lines truncated)
</file>

<file path="themes/survey/vanilla/views/subviews/navigation/language_changer_form.twig">
{#
    This file is part of LimeSurvey
    Copyright (C) 2018-2026 The LimeSurvey Project Team
    This file render the language changer out of limesurvey form when no form is required (example survey listing)
    This file can be added for a no javascript solution to change language when not inside limesurvey form
#}
{% if(aSurveyInfo.surveyUrl) %}
    {{ C.Html.form(aSurveyInfo.surveyUrl,'get') }} {# auto adding needed parameters #}
{% else %}
    <form method="get">
{% endif %}
    {{ include('./subviews/navigation/language_changer.twig') }}
</form>
</file>

<file path="themes/survey/vanilla/views/subviews/navigation/language_changer_top_menu.twig">
{#
LimeSurvey
Copyright (C) 2007-2026 The LimeSurvey Project Team
All rights reserved.
License: GNU/GPL License v2 or later, see LICENSE.php
LimeSurvey is free software. This version may have been modified pursuant
to the GNU General Public License, and as distributed it includes or
is derivative of works licensed under the GNU General Public License or
other free or open source software licenses.
See COPYRIGHT.php for copyright notices and details.

(¯`·._.·(¯`·._.·  Language Changer for Top Menu ·._.·´¯)·._.·´¯)

Show a language changer inside the top menu

It's a typical bootstrap dropdown button.
@see: http://getbootstrap.com/components/#dropdowns

@var array  aSurveyInfo.alanguageChangerDatas.aListLang :  contains the list of available languages for this survey, 'language_code' => 'language name'
@var string aSurveyInfo.alanguageChangerDatas.sSelected :  the language code of the selected language

The language change is done via javascript
#}

{# There is many condition where the language changer should not be shown. Eg: there is only one language available #}
{% if  aSurveyInfo.alanguageChanger.show == true %}

    {# we set a shortcut for aSurveyInfo.alanguageChangerDatas #}
    {% set aLCD  = aSurveyInfo.alanguageChanger.datas %}

... (24 lines truncated)
</file>

<file path="themes/survey/vanilla/views/subviews/navigation/language_changer.twig">
{#
    This file is part of LimeSurvey
    Copyright (C) 2018-2026 The LimeSurvey Project Team

    This file renders language changer inside the main container when multiple survey languages are available.

    It uses the Yii helper CHtml::dropDownList().
    @see: http://www.yiiframework.com/wiki/48/by-example-chtml/#hh5

#}

{% if aSurveyInfo.alanguageChanger.show == true %}
    
    {# set a shortcut for aSurveyInfo.alanguageChanger.datas #}
    {% set aLCD  = aSurveyInfo.alanguageChanger.datas %}

    {#
        array of attributes of the Drop Down list.
        To add a new attribute, just add an entry:
        'attribute' : 'value',
    #}
    {% set htmlOptions = {
            'class'          : 'form-control',
            'data-targeturl' : aLCD.targetUrl,
        }
    %}
    <!-- Language Changer -->
    <div class=" {{ aSurveyInfo.class.formgroup }} form-change-lang row row-cols-lg-auto g-1" {{ aSurveyInfo.attr.formgroup }} >
        <label class="{{ aSurveyInfo.class.controllabel }} col-form-label col-auto fw-bold" {{ aSurveyInfo.attr.controllabel }} for="lang">
            <span class="control-label" {{ aSurveyInfo.attr.languagechanger }}>{{ gT("Language:") }}</span>
... (34 lines truncated)
</file>

<file path="themes/survey/vanilla/views/subviews/navigation/navigator_complement.twig">
{#
    This file is part of LimeSurvey
    Copyright (C) 2018-2026 The LimeSurvey Project Team
    This file render extra part for navigator
#}
{% if aSurveyInfo.aNavigator.load.show == "Y" or aSurveyInfo.aNavigator.save.show == "Y" or aSurveyInfo.aQuestionIndex.bShow == true or aSurveyInfo.bShowClearAll == true %}
    <!-- extra tools, can be shown with javascript too (just remove ls-js-hidden class -->
    <div class="row ls-js-hidden">
        <!-- Extra button container -->
        <div class="col-6 clearall-saveall-wrapper">
            {% if aSurveyInfo.aNavigator.load.show == "Y" or aSurveyInfo.aNavigator.save.show == "Y" %}
                {{ include('./subviews/navigation/save_buttons.twig') }}
            {% endif %}
            {% if aSurveyInfo.bShowClearAll == true %}
                {{ include('./subviews/navigation/clearall_buttons.twig') }}
            {% endif %}
        </div>
         <!-- Index container -->
        {% if (aSurveyInfo.aQuestionIndex.bShow == true) %}
            {{ include('./subviews/navigation/question_index_buttons.twig') }}
        {% endif %}
    </div>
{% endif %}
</file>

<file path="themes/survey/vanilla/views/subviews/navigation/navigator.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.



    (¯`·._.·(¯`·._.· Navigator  ·._.·´¯)·._.·´¯)

    Render the navigator: Previous, Next, Submit, Load, Save
    All needed datas are inside aSurveyInfo.aNavigator
    If you want to see what is available in aNavigator, turn debug mode on in application/config.php, and move out of comments the following line:
    {{ dump(aSurveyInfo.aNavigator) }}
#}

{# create a shortcut for aSurveyInfo.aNavigator #}
{% set aNavigator = aSurveyInfo.aNavigator %}

<!-- PRESENT THE NAVIGATOR -->
<div class="{{ aSurveyInfo.class.navigatorcontainer }} row navigator space-col" id="{{ aSurveyInfo.id.navigatorcontainer }}" {{ aSurveyInfo.attr.navigatorcontainer }}>

    <!-- Previous button container -->
    <div class="{{ aSurveyInfo.class.navigatorbuttonl }} col-6 text-start" {{ aSurveyInfo.attr.navigatorbuttonl }}>

... (31 lines truncated)
</file>

<file path="themes/survey/vanilla/views/subviews/navigation/question_index_buttons.twig">
{#
    This file is part of LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team

    Show the question index in navigator
#}

<div class="col-md-6 index-wrapper">
    {% if aSurveyInfo.format == 'G' %}
        {{ include('./subviews/navigation/question_index_groups_buttons.twig') }}
    {% endif %}

    {% if aSurveyInfo.format == 'S' %}
        {{ include('./subviews/navigation/question_index_questions_buttons.twig') }}
    {% endif %}
</div>
</file>

<file path="themes/survey/vanilla/views/subviews/navigation/question_index_groups_buttons.twig">
{#
    This file is part of LimeSurvey
    Copyright (C) 2018-2026 The LimeSurvey Project Team
    This file render group index
#}
<div class="list-group index-button-full">
  <div class="list-group-item">
      <div class="h4 list-group-item-heading">{{ gT("Question index") }}</div>
  </div>
  {% for step, indexItem in aSurveyInfo.aQuestionIndex.items %}
    {% set templateClass = ''  %}
    {% if indexItem.stepStatus['index-item-unanswered'] is defined and indexItem.stepStatus['index-item-unanswered'] == true  %}
        {% set templateClass = templateClass ~ ' list-group-item-warning'  %}
    {% endif %}
    {% if indexItem.stepStatus['index-item-error'] is defined and indexItem.stepStatus['index-item-error'] == true   %}
        {% set templateClass = templateClass ~ ' list-group-item-danger'  %}
    {% endif %}
    {% if indexItem.stepStatus['index-item-current'] is defined and indexItem.stepStatus['index-item-current'] == true %}
        {% set templateClass = templateClass ~  ' disabled'  %}
    {% endif %}
    <button type="submit" name="move" value="{{ indexItem.step }}" class="list-group-item {{ indexItem.coreClass }} {{ templateClass }}" >{{ indexItem.text }}</button>
  {% endfor %}
</div>
</file>

<file path="themes/survey/vanilla/views/subviews/navigation/question_index_menu.twig">
{#
LimeSurvey
Copyright (C) 2007-2026 The LimeSurvey Project Team
All rights reserved.
License: GNU/GPL License v2 or later, see LICENSE.php
LimeSurvey is free software. This version may have been modified pursuant
to the GNU General Public License, and as distributed it includes or
is derivative of works licensed under the GNU General Public License or
other free or open source software licenses.
See COPYRIGHT.php for copyright notices and details.

(¯`·._.·(¯`·._.·  Question index  ·._.·´¯)·._.·´¯)

Show the question index in top menu.

There is two type of index:
- Full        :  show all the questions/groups
- Incremental :  only show the previous questions/groups

There is two possible displays for index, depending on Survey Mode:
- Group by Group       : Survey mode is in Group By Group mode, so the entry of the index should be groups
- Question by Question : Survey mode is in Question By Question mode, so the entry of the index should be questions
- All in One           : No index needed
#}

{# Question index in group by group mode #}

{% if (aSurveyInfo.aQuestionIndex.bShow == true) %}
    {% if aSurveyInfo.format == 'G' %}
        <!-- Question index, group, {{ aSurveyInfo.aQuestionIndex.type }} -->
... (80 lines truncated)
</file>

<file path="themes/survey/vanilla/views/subviews/navigation/question_index_questions_buttons.twig">
{#
    This file is part of LimeSurvey
    Copyright (C) 2018-2026 The LimeSurvey Project Team
    This file render question index
#}
<div class="list-group index-button index-button-{{ aSurveyInfo.aQuestionIndex.type }}">
    <div class="list-group-item">
        <div class="h4 list-group-item-heading">{{ gT("Question index") }}</div>
    </div>
    {% for indexGroup in aSurveyInfo.aQuestionIndex.items %}
    <div class="list-group" data-gid="{{ indexGroup.gid }}">
        <div class="list-group-item">
            <div class="h5 list-group-item-heading">{{ flatString(indexGroup.text) }}</div>
        </div>
        {% for indexQuestion in indexGroup.questions %}
        {% set templateClass = ''  %}
        {% if indexQuestion.stepStatus['index-item-unanswered'] is defined and indexQuestion.stepStatus['index-item-unanswered'] == true  %}
            {% set templateClass = templateClass ~ ' list-group-item-warning'  %}
        {% endif %}
        {% if indexQuestion.stepStatus['index-item-error'] is defined and indexQuestion.stepStatus['index-item-error'] == true   %}
            {% set templateClass = templateClass ~ ' list-group-item-danger'  %}
        {% endif %}
        {% if indexQuestion.stepStatus['index-item-current'] is defined and indexQuestion.stepStatus['index-item-current'] == true %}
            {% set templateClass = templateClass ~  ' disabled'  %}
        {% endif %}
            <button type="submit" name="move" value="{{ indexQuestion.step }}" class="list-group-item {{ indexQuestion.coreClass }} {{ templateClass }}" data-qid="{{ indexQuestion.qid }}">
                {{ ellipsizeString(indexQuestion.text, 80, 0.6, "…" ) }}
            </button>
        {% endfor %}
    </div>
... (3 lines truncated)
</file>

<file path="themes/survey/vanilla/views/subviews/navigation/save_buttons.twig">
{#
    This file is part of LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    This file render the load or save buttons without javascript needed
#}
{% if aSurveyInfo.aNavigator.load.show == "Y" %}
    <button {{ aSurveyInfo.attr.loadbutton }} accesskey="l" class="{{ aSurveyInfo.class.loadbutton }} action--ls-button-submit btn btn-outline-secondary">{{ gT("Load unfinished survey") }}</button>
{% endif %}
{% if aSurveyInfo.aNavigator.save.show == "Y" %}
<button {{ aSurveyInfo.attr.savebutton }} accesskey="s" class='{{ aSurveyInfo.class.savebutton }} action--ls-button-submit btn btn-outline-secondary'>
    {{ gT('Resume later') }}
</button>
{% endif %}
</file>

<file path="themes/survey/vanilla/views/subviews/navigation/save_links.twig">
{#
LimeSurvey
Copyright (C) 2007-2026 The LimeSurvey Project Team
All rights reserved.
License: GNU/GPL License v2 or later, see LICENSE.php
LimeSurvey is free software. This version may have been modified pursuant
to the GNU General Public License, and as distributed it includes or
is derivative of works licensed under the GNU General Public License or
other free or open source software licenses.
See COPYRIGHT.php for copyright notices and details.



(¯`·._.·(¯`·._.·  Save/Load buttons  ·._.·´¯)·._.·´¯)

Display the buttons to load/save a survey.
There are many cases when those button are not shown:
via survey configuration, at start page, when survey is completed, etc
#}
{% if aSurveyInfo.aNavigator.load.show == "Y" %}
    <!-- Load unfinished survey button -->
    <li class="nav-item ls-no-js-hidden px-2" {{ aSurveyInfo.attr.loadlinksli }}>
        <a href="#" data-limesurvey-submit='{ "loadall":"loadall" }'
           class='nav-link ls-link-action ls-link-loadall'>
            {{ gT('Load unfinished survey') }}
        </a>
    </li>
{% endif %}

{% if aSurveyInfo.access_mode == "O" and aSurveyInfo.hastokenstable == true and not aSurveyInfo.filltoken %}
... (37 lines truncated)
</file>

<file path="themes/survey/vanilla/views/subviews/print/print_group.twig">
<div class="survey-group {{odd_even}}">
    <h2>{{group.groupname}}</h2>
    <div class="group-desc">
        {{group.groupdescription}}
    </div>
    {% for question in group.questions %}
        {% set questionTemplate = './subviews/print/print_question.twig' %}
        {{ include(questionTemplate) }}
    {% endfor %}
</div>
</file>

<file path="themes/survey/vanilla/views/subviews/print/print_question.twig">
<div id="question{{question.qid}}" class="{{question.class}} question-wrapper">
    <div class="q-text">
        <h3>{{question.number}} {{question.code ? '[' ~ question.code ~ ']' : ''}}{{question.text}}
            <span class="mandatory">{{question.mandatory}}</span>
        </h3>
        <p class="q-scenaria">{{question.scenario}}</p>
        <p class="q-type-help">{{question.type_help}}</p>
        <p class="q-man-message">{{question.man_message}}</p>
        <p class="q-validation">{{question.valid_message}}</p>
        <p class="q-fvalidation">{{question.file_valid_message}}</p>
    </div>
    <div class="q-answer">
        {{question.answer}}
    </div>
    <div class="q-help">
        {{question.help}}
    </div>
</div>
</file>

<file path="themes/survey/vanilla/views/subviews/printanswers/question_types/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="themes/survey/vanilla/views/subviews/printanswers/question_types/template_array-10-pt.twig">
{% extends "./subviews/printanswers/printanswers_question.twig" %}
 {% block question_answer %}
 <div class="col-lg-8">
    {% for subquestionId, subquestion in question.subquestions %}
        <div class="row">
            <div class="col-lg-4 text-end">
                {{subquestion.answervalue}}
            </div>
            <div class="col-lg-8 text-start">
                <b>{{subquestion.question}} ({{subquestion.qid}})</b>
            </div>
        </div>
    {% endfor %}
</div>
{% endblock %}
</file>

<file path="themes/survey/vanilla/views/subviews/printanswers/question_types/template_array-5-pt.twig">
{% extends "./subviews/printanswers/printanswers_question.twig" %}
{% block question_answer %}
 <div class="col-lg-8">
    {% for subquestionId, subquestion in question.subquestions %}
        <div class="row">
            <div class="col-lg-4 text-end">
                {{subquestion.answervalue}}
            </div>
            <div class="col-lg-8 text-start">
                <b>{{subquestion.question}} ({{subquestion.qid}})</b>
            </div>
        </div>
    {% endfor %}
</div>

{% endblock %}
</file>

<file path="themes/survey/vanilla/views/subviews/printanswers/question_types/template_array-flexible-column.twig">
{% extends "./subviews/printanswers/printanswers_question.twig" %}
 {% block question_answer %}
 <div class="col-lg-8">
    {% for subquestionId, subquestion in question.subquestions %}
        <div class="row">
            <div class="col-lg-4 text-end">
                {{subquestion.answeroption.answer}} - {{subquestion.answervalue}}
            </div>
            <div class="col-lg-8 text-start">
                <b>{{subquestion.question}} ({{subquestion.qid}})</b>
            </div>
        </div>
    {% endfor %}
</div>
{% endblock %}
</file>

<file path="themes/survey/vanilla/views/subviews/printanswers/question_types/template_array-flexible-dual-scale.twig">
{% extends "./subviews/printanswers/printanswers_question.twig" %}
 {% block question_answer %}
 <div class="col-lg-8">
    <table class="table table-condensed table-striped">
    {% for subquestionId, subquestion in question.subquestions %}
        {% if loop.first %}
            <tr>
                <th></th>
                {% for colname, value in question.dualscale_header %}
                    <th><b>{{value}}</b></th>
                {% endfor %}                    
            </tr>
        {% endif %}
        
        <tr>
            <td>
                {{subquestion.question}} ({{subquestion.title}})
            </td>
            {% for colname, value in subquestion.answervalues %}
                <td>
                    {{value}}
                </td>    
            {% endfor %}
        </tr>
    {% endfor %}
    </table>
</div>
{% endblock %}
</file>

<file path="themes/survey/vanilla/views/subviews/printanswers/question_types/template_array-flexible-row.twig">
{% extends "./subviews/printanswers/printanswers_question.twig" %}
 {% block question_answer %}
 <div class="col-lg-8">
    {% for subquestionId, subquestion in question.subquestions %}
        <div class="row">
            <div class="col-lg-4 text-end">
                {{subquestion.answeroption.answer}} - {{subquestion.answervalue}}
            </div>
            <div class="col-lg-8 text-start">
                <b>{{subquestion.question}} ({{subquestion.qid}})</b>
            </div>
        </div>
    {% endfor %}
</div>
{% endblock %}
</file>

<file path="themes/survey/vanilla/views/subviews/printanswers/question_types/template_array-increase-same-decrease.twig">
{% extends "./subviews/printanswers/printanswers_question.twig" %}
 {% block question_answer %}
 <div class="col-lg-8">
    {% for subquestionId, subquestion in question.subquestions %}
        <div class="row">
            <div class="col-lg-4 text-end">
            {% if subquestion.answervalue is same as("I") %}
                {{ gT("Increase") }} <i class="fa fa-plus"></i>
            {% elseif subquestion.answervalue is same as("S") %}
                {{ gT("Same") }} <i class="fa fa-circle"></i>
            {% elseif subquestion.answervalue is same as("D") %}
                {{ gT("Decrease") }} <i class="fa fa-minus"></i>
            {% else %}

            {% endif %}
            </div>
            <div class="col-lg-8 text-start">
                <b>{{subquestion.question}} ({{subquestion.qid}})</b>
            </div>
        </div>
    {% endfor %}
</div>
{% endblock %}
</file>

<file path="themes/survey/vanilla/views/subviews/printanswers/question_types/template_array-multi-flexi-text.twig">
{% extends "./subviews/printanswers/printanswers_question.twig" %}
 {% block question_answer %}
 <div class="col-lg-8">
    <table class="table table-condensed table-striped">
    {% for subquestionId, subquestion in question.subquestions %}
        {% if loop.first %}
            <tr>
                <th></th>
                {% for colname, value in subquestion.answervalueslabels %}
                    <th class="text-center"><b>{{value}} - {{colname}}</b></th>
                {% endfor %}
            </tr>
        {% endif %}
        
        <tr>
            <td>
                {{subquestion.question}} - {{subquestion.title}}
            </td>
            {% for colname, value in subquestion.answervalues %}
                <td>
                    {{value|escape}}
                </td>
            {% endfor %}
        </tr>
    {% endfor %}
    </table>
</div>
{% endblock %}
</file>

<file path="themes/survey/vanilla/views/subviews/printanswers/question_types/template_array-multi-flexi.twig">
{% extends "./subviews/printanswers/printanswers_question.twig" %}
 {% block question_answer %}
 <div class="col-lg-8">
    <table class="table table-condensed table-striped">
    {% for subquestionId, subquestion in question.subquestions %}
        {% if loop.first %}
            <tr>
                <th></th>
                {% for colname, value in subquestion.answervalueslabels %}
                    <th class="text-center"><b>{{value}} - {{colname}}</b></th>
                {% endfor %}                    
            </tr>
        {% endif %}
        
        <tr>
            <td>
                {{subquestion.question}} - {{subquestion.title}}
            </td>
            {% for colname, value in subquestion.answervalues %}
                <td class="text-center">
                    {{value}}
                </td>    
            {% endfor %}
        </tr>
    {% endfor %}
    </table>
</div>
{% endblock %}
</file>

<file path="themes/survey/vanilla/views/subviews/printanswers/question_types/template_array-yes-uncertain-no.twig">
{% extends "./subviews/printanswers/printanswers_question.twig" %}
 {% block question_answer %}
 <div class="col-lg-8">
    {% for subquestionId, subquestion in question.subquestions %}
        <div class="row">
            <div class="col-lg-4 text-end">
                {% if subquestion.answervalue is same as("Y") %}
                    {{ gT("Yes") }} <i class="fa fa-check-square-o"></i>
                {% elseif subquestion.answervalue is same as("N") %}
                    {{ gT("No") }} <i class="fa fa-square-o"></i>
                {% elseif subquestion.answervalue is same as("U") %}
                    {{ gT("Uncertain") }} <i class="fa fa-minus-square-o"></i>
                {% else %}

                {% endif %}
            </div>
            <div class="col-lg-8 text-start">
                <b>{{subquestion.question}} ({{subquestion.qid}})</b>
            </div>
        </div>
    {% endfor %}
</div>
{% endblock %}
</file>

<file path="themes/survey/vanilla/views/subviews/printanswers/question_types/template_boilerplate.twig">
{% extends "./subviews/printanswers/printanswers_question.twig" %}
{% block question_answer %}
    <div class="col-2">
            {{question.answervalue}}
    </div>
{% endblock %}
</file>

<file path="themes/survey/vanilla/views/subviews/printanswers/question_types/template_choice-5-pt-radio.twig">
{% extends "./subviews/printanswers/printanswers_question.twig" %}
 {% block question_answer %} 
 <div class="col-lg-8">
    <div class="row">
        <div class="col-lg-4 text-end">
        </div>
        <div class="col-lg-8 text-start">
            {{question.answervalue}}
        </div>
    </div>
</div>
{% endblock %}
</file>

<file path="themes/survey/vanilla/views/subviews/printanswers/question_types/template_date.twig">
{% extends "./subviews/printanswers/printanswers_question.twig" %}
 {% block question_answer %}
 <div class="col-lg-8">
    <div class="row">
        <div class="col-lg-4 text-end">
        </div>
        <div class="col-lg-8 text-start">
            {% if question.answervalue %}
                {{question.answervalue|date(question.dateformat.phpdate)}}
            {% endif %}
        </div>
    </div>
</div>
{% endblock %}
</file>

<file path="themes/survey/vanilla/views/subviews/printanswers/question_types/template_equation.twig">
{% extends "./subviews/printanswers/printanswers_question.twig" %}
 {% block question_answer %}
 <div class="col-lg-8">
    <div class="row">
        <div class="col-lg-4 text-end">
        </div>
        <div class="col-lg-8 text-start">
            {{question.answervalue}}
        </div>
    </div>
</div>
{% endblock %}
</file>

<file path="themes/survey/vanilla/views/subviews/printanswers/question_types/template_gender.twig">
{% extends "./subviews/printanswers/printanswers_question.twig" %}
 {% block question_answer %}
 <div class="col-lg-8">
    <div class="row">
        <div class="col-lg-4 text-end">
        </div>
        <div class="col-lg-8 text-start">
            {% if question.answervalue is same as("M") %}
                {{ gT("Male") }} <i class="fa fa-mars"></i>
            {% elseif question.answervalue is same as("F") %}
                {{ gT("Female") }} <i class="fa fa-venus"></i>
            {% else %}
                {{question.answervalue}}
            {% endif %}
        </div>
    </div>
</div>
{% endblock %}
</file>

<file path="themes/survey/vanilla/views/subviews/printanswers/question_types/template_generic_question.twig">
{% extends "./subviews/printanswers/printanswers_question.twig" %}
 {% block question_answer %}
 <div class="col-lg-8">
    {% if question.subquestions is empty %}
            {{question.answervalue}}
    {% else %}
            {% for subquestionId, subquestion in question.subquestions %}
                <div class="row">
                    <div class="col-lg-4 text-end">
                        <b>{{subquestion.question}} ({{subquestion.qid}})</b>
                    </div>
                    <div class="col-lg-8 text-start">
                        {{subquestion.answervalue}}
                    </div>
                </div>
            {% endfor %}
    {% endif %}
</div>
{% endblock %}
</file>

<file path="themes/survey/vanilla/views/subviews/printanswers/question_types/template_language.twig">
{% extends "./subviews/printanswers/printanswers_question.twig" %}
 {% block question_answer %}
 <div class="col-lg-8">
    <div class="row">
        <div class="col-lg-4 text-end">
        </div>
        <div class="col-lg-8 text-start">
            {{question.languageArray.description}} ({{question.answervalue}})
        </div>
    </div>
</div>
{% endblock %}
</file>

<file path="themes/survey/vanilla/views/subviews/printanswers/question_types/template_list-dropdown.twig">
{% extends "./subviews/printanswers/printanswers_question.twig" %}
 {% block question_answer %}
 <div class="col-lg-8">
    <div class="row">
        <div class="col-lg-4 text-end">
        </div>
        <div class="col-lg-8 text-start">
            {{question.answervalue}} -
            {% if question.answercode == '-oth-' %}
                {{question.answeroption.answer|escape}}
            {% else %}
                {{question.answeroption.answer}}
            {%endif %}
        </div>
    </div>
</div>
{% endblock %}
</file>

<file path="themes/survey/vanilla/views/subviews/printanswers/question_types/template_list-radio-flexible.twig">
{% extends "./subviews/printanswers/printanswers_question.twig" %}
 {% block question_answer %}
 <div class="col-lg-8">
    {% if question.subquestions is empty %}
            {{question.answervalue}}
    {% else %}
            {% for subquestionId, subquestion in question.subquestions %}
                <div class="row">
                    <div class="col-lg-4 text-end">
                        <b>{{subquestion.question}} ({{subquestion.qid}})</b>
                    </div>
                    <div class="col-lg-8 text-start">
                        {{subquestion.answervalue}}
                    </div>
                </div>
            {% endfor %}
    {% endif %}
</div>
{% endblock %}
</file>

<file path="themes/survey/vanilla/views/subviews/printanswers/question_types/template_list-radio.twig">
{% extends "./subviews/printanswers/printanswers_question.twig" %}
 {% block question_answer %}
 <div class="col-lg-8">
    <div class="row">
        <div class="col-lg-4 text-end">
            {% if question.answercode == '-oth-' %}
                {{question.answeroption.answer|escape}}
            {% elseif question.question_theme_name == 'image_select-listradio' and question.answeroption.answer|isImageUrl %}
                <img src="{{ question.answeroption.answer|escape('html') }}" style="max-width:150px;max-height:150px;" />
            {% else %}
                {{question.answeroption.answer}}
            {%endif %}
        </div>
        <div class="col-lg-8 text-start">
            <b>{{question.answervalue}}</b>
        </div>
    </div>
</div>
{% endblock %}
</file>

<file path="themes/survey/vanilla/views/subviews/printanswers/question_types/template_list-with-comment.twig">
{% extends "./subviews/printanswers/printanswers_question.twig" %}
 {% block question_answer %}
 <div class="col-lg-8">
    <div class="row">
        <div class="col-lg-4 text-end">
        </div>
        <div class="col-lg-8 text-start">
            {{question.answervalue}} - {{question.answeroption.answer}}
        </div>
    </div>
    <div class="row">
        <div class="col-md-4 text-right">
        </div>
        <div class="col-md-8 text-left">
            {{question.comment.answervalue|escape}}
        </div>
    </div>
</div>
{% endblock %}
</file>

<file path="themes/survey/vanilla/views/subviews/printanswers/question_types/template_multiple-opt-comments.twig">
{% extends "./subviews/printanswers/printanswers_question.twig" %}
 {% block question_answer %}
 <div class="col-lg-8">
    {% for subquestionId, subquestion in question.subquestions %}
        <div class="row">
            <div class="col-lg-4 text-end">
                {% if subquestion.answervalue is same as("Y") %}
                    <i class="fa fa-check-square-o"></i>
                {% else %}
                    {{subquestion.answervalue|escape}}
                {% endif %}
            </div>
            <div class="col-lg-4 text-start">
                <b>{{subquestion.question}} ({{subquestion.qid}})</b>
            </div>
            <div class="col-lg-4 text-start">
                    {{subquestion.comment.answervalue|escape}}
            </div>
        </div>
    {% endfor %}
</div>
{% endblock %}
</file>

<file path="themes/survey/vanilla/views/subviews/printanswers/question_types/template_multiple-opt.twig">
{% extends "./subviews/printanswers/printanswers_question.twig" %}
 {% block question_answer %}
 <div class="col-lg-8">
    {% for subquestionId, subquestion in question.subquestions %}
        <div class="row">
            <div class="col-lg-4 text-end">
                {% if subquestion.answervalue is same as("Y") %}
                    <i class="fa fa-check-square-o"></i>
                {% else %}
                    {{subquestion.answervalue|escape}}
                {% endif %}
            </div>
            <div class="col-lg-8 text-start">
                <b>
                    {% if question.question_theme_name == 'image_select-multiplechoice' and subquestion.question|isImageUrl %}
                        <img src="{{ subquestion.question|escape('html') }}" style="max-width:150px;max-height:150px;" />
                    {% else %}
                        {{subquestion.question}}
                    {% endif %}
                    {% if subquestion.qid != 'other' %} ({{subquestion.qid}}){% endif %}
                </b>
            </div>
        </div>
    {% endfor %}
</div>
{% endblock %}
</file>

<file path="themes/survey/vanilla/views/subviews/printanswers/question_types/template_multiple-short-txt.twig">
{% extends "./subviews/printanswers/printanswers_question.twig" %}
 {% block question_answer %}
 <div class="col-lg-8 child-row-spacing">
    {% for subquestionId, subquestion in question.subquestions %}
        <div class="row">
            <div class="col-lg-8">
                {{subquestion.answervalue|escape}}
            </div>
            <div class="col-lg-4 text-start">
                <b>{{subquestion.question}} ({{subquestion.qid}})</b>
            </div>
        </div>
    {% endfor %}
</div>
{% endblock %}
</file>

<file path="themes/survey/vanilla/views/subviews/printanswers/question_types/template_numeric-multi.twig">
{% extends "./subviews/printanswers/printanswers_question.twig" %}
 {% block question_answer %}
 <div class="col-lg-8">
    {% for subquestionId, subquestion in question.subquestions %}
        <div class="row">
            <div class="col-lg-4 text-end">
                {{subquestion.answervalue}}
            </div>
            <div class="col-lg-8 text-start">
                <b>{{subquestion.question}} ({{subquestion.qid}})</b>
            </div>
        </div>
    {% endfor %}
</div>
{% endblock %}
</file>

<file path="themes/survey/vanilla/views/subviews/printanswers/question_types/template_numeric.twig">
{% extends "./subviews/printanswers/printanswers_question.twig" %}
 {% block question_answer %}
 <div class="col-lg-8">
    <div class="row">
        <div class="col-lg-4 text-end">
        </div>
        <div class="col-lg-8 text-start">
            {{question.answervalue}}
        </div>
    </div>
</div>
{% endblock %}
</file>

<file path="themes/survey/vanilla/views/subviews/printanswers/question_types/template_ranking.twig">
{% extends "./subviews/printanswers/printanswers_question.twig" %}
 {% block question_answer %}
 <div class="col-lg-8">
    {% for iterator, rankedvalue in question.answervalues %}
        <div class="row">
            <div class="col-lg-4 text-end">
                <b>{{gT('Rank')}} #{{(iterator+1)}}:</b>
            </div>
            <div class="col-lg-8 text-start">
                {{rankedvalue.value}}  - {{rankedvalue.answertext}}
            </div>
        </div>
    {% endfor %}

</div>
{% endblock %}
</file>

<file path="themes/survey/vanilla/views/subviews/printanswers/question_types/template_text-huge.twig">
{% extends "./subviews/printanswers/printanswers_question.twig" %}
 {% block question_answer %}
 <div class="col-lg-8 text-break-pre">
    {{question.answervalue|escape}}
    <br/>
</div>
{% endblock %}
</file>

<file path="themes/survey/vanilla/views/subviews/printanswers/question_types/template_text-long.twig">
{% extends "./subviews/printanswers/printanswers_question.twig" %}
 {% block question_answer %}
 <div class="col-lg-8 text-break-pre">
    {% if (aSurveyInfo.printPdf != 1) %}
    {{question.answervalue|escape}}
    {% else %}
    {{question.answervalue|nl2br}}
    {% endif %}
    <br/>
</div>
{% endblock %}
</file>

<file path="themes/survey/vanilla/views/subviews/printanswers/question_types/template_text-short.twig">
{% extends "./subviews/printanswers/printanswers_question.twig" %}
 {% block question_answer %}
<div class="col-lg-8">
    {{question.answervalue|escape}}
</div>
{% endblock %}
</file>

<file path="themes/survey/vanilla/views/subviews/printanswers/question_types/template_upload-files.twig">
{% extends "./subviews/printanswers/printanswers_question.twig" %}
 {% block question_answer %}
<div class="col-lg-8">
    {% for file in question.fileinfo %}
        <div class="row">
                    <div class="col-lg-4 text-end">
                        <b>{{file.title}}</b></a>
                    </div>
                    <div class="col-lg-8 text-start">
                        {{file.comment == '' ? gT('No comment') : file.comment}}
                    </div>
                    <div class="col-lg-4 text-end">
                        {{ gT("File type") }} "{{file.ext}}"
                    </div>
                    <div class="col-lg-8 text-start">
                    </div>
                </div>
    {% endfor %}
</div>
{% endblock %}
</file>

<file path="themes/survey/vanilla/views/subviews/printanswers/question_types/template_yes-no.twig">
{% extends "./subviews/printanswers/printanswers_question.twig" %}
 {% block question_answer %}
 <div class="col-lg-8">
    <div class="row">
        <div class="col-lg-4 text-end">
        </div>
        <div class="col-lg-8 text-start">
            {% if question.answervalue is same as("Y") %}
                {{ gT("Yes") }} <i class="fa fa-check"></i>
            {% elseif question.answervalue is same as("N") %}
                {{ gT("No") }} <i class="fa fa-close"></i>
            {% else %}
                {{question.answervalue}}
            {% endif %}
        </div>
    </div>
</div>
{% endblock %}
</file>

<file path="themes/survey/vanilla/views/subviews/printanswers/question_types/text_question.twig">
{% extends "./subviews/printanswers/printanswers_question.twig" %}
 {% block question_answer %}
 <div class="col-lg-8">
    {% if question.subquestions is empty %}
            {{question.answervalue | escape}}
    {% else %}
            {% for subquestionId, subquestion in question.subquestions %}
                <div class="row">
                    <div class="col-lg-4 text-end">
                        <b>{{subquestion.question}} ({{subquestion.qid}})</b>
                    </div>
                    <div class="col-lg-8 text-start">
                        {{subquestion.answervalue}}
                    </div>
                </div>
            {% endfor %}
    {% endif %}
</div>
{% endblock %}
</file>

<file path="themes/survey/vanilla/views/subviews/printanswers/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="themes/survey/vanilla/views/subviews/printanswers/printanswers_foot.twig">
</div>
</file>

<file path="themes/survey/vanilla/views/subviews/printanswers/printanswers_head.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.

    (¯`·._.·(¯`·._.· Registration form._.·´¯)·._.·´¯)

    This is the head for the printanswers table.
    It is used for the rendering of the responses at the end of the survey.

#}

{% if (aSurveyInfo.printPdf == 1) %} 
{{ include('./subviews/printanswers/printanswers_style.twig') }}
<style> 
    body{ 
        font-size: 11pt;
        line-height: 80%; 
    } 
    div{
        margin: 0;
        padding: 0;
    }
    .question-container-printanswers{
... (24 lines truncated)
</file>

<file path="themes/survey/vanilla/views/subviews/printanswers/printanswers_question.twig">
<div class="row question-container-printanswers" style="page-break-inside:avoid;"> 
    {% block question_name %}
    <div class="col-md-4">
        <b>{{question.question}} ({{question.qid}})</b><br/>
        <small>{{ gT("Type:") }} ({{question.type}}/{{question.questionclass}})</small>
    </div>
    {% endblock  %}
    {% block question_answer %}
        {{ include('./subviews/printanswers/question_types/template_generic_question.twig') }}
    {% endblock  %}
</div>
</file>

<file path="themes/survey/vanilla/views/subviews/printanswers/printanswers_style.twig">
<style>
/*!
 * Bootstrap v3.3.7 (http://getbootstrap.com)
 * Copyright 2011-2016 Twitter, Inc.
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 */
code,
kbd,
pre,
samp {
  font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
}
code {
  padding: 2px 4px;
  font-size: 90%;
  color: #c7254e;
  background-color: #f9f2f4;
  border-radius: 4px;
}
kbd {
  padding: 2px 4px;
  font-size: 90%;
  color: #fff;
  background-color: #333;
  border-radius: 3px;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.25);
}
kbd kbd {
  padding: 0;
  font-size: 100%;
... (1770 lines truncated)
</file>

<file path="themes/survey/vanilla/views/subviews/printanswers/printanswers_table.twig">
{% if (aSurveyInfo.printPdf != 1) %} 
    <div class="row">
        <div class="col-sm-12">
            <h2>{{ sprintf(gT("Survey name (ID): %s (%s)"), aSurveyInfo.surveyls_title, aSurveyInfo.sid) }}</h2>
        </div>
    </div>
{% endif %} 

{% for groupid,group in aSurveyInfo.groupArray %}
    {% if (aSurveyInfo.printPdf == 1) %} 
    <br pagebreak="true" /> 
    {% endif %}
    <groupsection class="groupSection"> 
        <div class="row">
            <div class="col-12">
                <h3>{{group.group_name}} ({{group.gid}})</h3>
            </div>
        </div>
        <div class="row">
            <div class="container-fluid col-11 col-md-10 offset-1 offset-lg-2">
                {% for questionId,question in group.answerArray %}
                {% set questionTemplate = './subviews/printanswers/question_types/template_' ~ question.questionclass ~ '.twig' %}
                {{ include(questionTemplate) }}
                {% endfor %} 
            </div>
        </div>
    </groupsection> 
{% endfor %}
</file>

<file path="themes/survey/vanilla/views/subviews/printanswers/README.md">
![LimeSurvey Logo](https://account.limesurvey.org/images/logos/logo_main.png)
# LimeSurvey Bootstrap Vanilla Survey Theme

## Print answers directory

The views to print the survey.
In future version of LimeSurvey (3.5 or 4.x ) the subfolder "question_type" will not exist anymore, and each question theme will have its own view for the print rendering.
**If you create a template from scratchn, you can update the content of those files, but keep the structure of that directory (file name, directories, etc)**
</file>

<file path="themes/survey/vanilla/views/subviews/privacy/allinone_mode_welcome_privacy.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.



    (¯`·._.·(¯`·._.·  Test Welcome / Privacy for All in one mode  ·._.·´¯)·._.·´¯)

    This file is only a piece of logic, it doesn't show nothing. We use it to hide complexity in layout.twig

    When survey is in All In One mode, if welcome or privacy message are activated, they must be shown on the page.
#}
{% if aSurveyInfo.format == 'A' %}
    {% if aSurveyInfo.showwelcome is not defined or aSurveyInfo.showwelcome != 'N' %}
        {{ include('./subviews/messages/welcome.twig') }}
    {% endif %}

    {{ include('./subviews/privacy/privacy.twig') }}
{% endif %}
</file>

<file path="themes/survey/vanilla/views/subviews/privacy/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="themes/survey/vanilla/views/subviews/privacy/privacy_datasecurity_notice_label.twig">
{# 
    use aSurveyInfo datasecurity_notice_label
#}
{% set dataSecurityNoticeLabel = aSurveyInfo.datasecurity_notice_label %}
{% set STARTPOLICYLINK = "" %}
{% set ENDPOLICYLINK = "" %}
{% if(aSurveyInfo.showsurveypolicynotice == 2) %}
    {% set STARTPOLICYLINK = "<a href='#data-security-modal-" ~ aSurveyInfo.sid ~ "' data-bs-toggle='collapse'>" %}
    {% set ENDPOLICYLINK = "</a>" %}
    {% if( strpos( " " ~ dataSecurityNoticeLabel, '{STARTPOLICYLINK}') == false and strpos( " " ~ dataSecurityNoticeLabel, '{ENDPOLICYLINK}') == false) %}
        {% set dataSecurityNoticeLabel = dataSecurityNoticeLabel ~ "<br/> {STARTPOLICYLINK}" ~ gT("Show policy") ~ "{ENDPOLICYLINK}" %}
    {% endif %}
{% endif %}
{% set haveENDPOLICYLINK = strpos( " " ~ dataSecurityNoticeLabel, '{ENDPOLICYLINK}') %}
{% set dataSecurityNoticeLabel = str_replace('{STARTPOLICYLINK}', STARTPOLICYLINK, dataSecurityNoticeLabel) %}
{% set dataSecurityNoticeLabel = str_replace('{ENDPOLICYLINK}', ENDPOLICYLINK, dataSecurityNoticeLabel) %}
{% if( haveENDPOLICYLINK == false ) %}
    {% set dataSecurityNoticeLabel = dataSecurityNoticeLabel ~ ENDPOLICYLINK %}
{% endif %}
{{ dataSecurityNoticeLabel }}
</file>

<file path="themes/survey/vanilla/views/subviews/privacy/privacy_modal.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.

    (¯`·._.·(¯`·._.· Privacy with modal ·._.·´¯)·._.·´¯)

    Show the privacy message and the data security message will be available in a modal

#}
{% set describedbyprivacy = "datasecurity_notice" %}
{% set privacychecked = "" %}
{% if getPost('datasecurity_accepted') %}
    {% set privacychecked = "checked" %}
{%endif %}
{% if aSurveyInfo.datasecurity_error %}
<div class="{{ aSurveyInfo.class.activealert }} alert alert-danger alert-dismissible alert-dismissible {% if not aSurveyInfo.datasecuritynotaccepted %}ls-js-hidden {% endif %}" {{ aSurveyInfo.attr.activealert }} id="datasecurity_error">
	<a {{ aSurveyInfo.attr.activealertbutton }} class="{{ aSurveyInfo.class.activealertbutton }} btn-close" aria-hidden="true"></a>
	{{ aSurveyInfo.datasecurity_error }}
</div>
	{% if aSurveyInfo.datasecuritynotaccepted %}
		{% set describedbyprivacy = "datasecurity_error " ~ describedbyprivacy %}
	{% endif %}
{% endif %}
... (45 lines truncated)
</file>

<file path="themes/survey/vanilla/views/subviews/privacy/privacy_text.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.

    (¯`·._.·(¯`·._.· Privacy with modal ·._.·´¯)·._.·´¯)

    Show the privacy message and the data security message will be available in a modal

#}
<div class="privacy-block">
    {% set describeprivacy = "" %}
    {% set privacychecked = "" %}
    {% if getPost('datasecurity_accepted') %}
        {% set privacychecked = "checked" %}
    {%endif %}
    {% if aSurveyInfo.datasecurity_notice %}
        <div class="limit-text-window {{ aSurveyInfo.class.privacydatasectextbody }}" id="datasecurity_notice">
            {{ aSurveyInfo.datasecurity_notice }}
        </div>
        {% set describeprivacy = "datasecurity_notice" %}
    {% endif %}
    {% if aSurveyInfo.datasecurity_error %}
    <div class="{{ aSurveyInfo.class.activealert }} alert alert-danger alert-dismissible alert-dismissible {% if not aSurveyInfo.datasecuritynotaccepted %}ls-js-hidden {% endif %}" {{ aSurveyInfo.attr.activealert }} id="datasecurity_error">
... (38 lines truncated)
</file>

<file path="themes/survey/vanilla/views/subviews/privacy/privacy.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.

    (¯`·._.·(¯`·._.· Privacy ·._.·´¯)·._.·´¯)

    Show the privacy message (in All in One Mode)
    see: allinone_mode_welcome_privacy.twig

#}

<!-- Privacy message -->

<div class="{{ aSurveyInfo.class.privacycontainer }} row" {{ aSurveyInfo.attr.privacycontainer }}>
    <div class="{{ aSurveyInfo.class.privacycol }} col-12 col-centered" {{ aSurveyInfo.attr.privacycol }}>
        {% if (aSurveyInfo.options.hideprivacyinfo == "off" ) %}
            {% block anonymous %}
                {% if (aSurveyInfo.anonymized == "Y") %}
                <div class="{{ aSurveyInfo.class.privacyhead }} h4 text-primary " {{ aSurveyInfo.attr.privacyhead }}>
                    {{ gT("This survey is anonymous.") }}
                </div>
                <div>
                    <p class="{{ aSurveyInfo.class.privacybody }}" {{ aSurveyInfo.attr.privacybody }}>
... (23 lines truncated)
</file>

<file path="themes/survey/vanilla/views/subviews/registration/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="themes/survey/vanilla/views/subviews/registration/register_error.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.

    (¯`·._.·(¯`·._.· Registration errors._.·´¯)·._.·´¯)

    If there where errors on registration show them here

#}
{% if aSurveyInfo.errors is not empty %}
    <ul class='{{ aSurveyInfo.class.registerul }} alert alert-danger list-unstyled' {{ aSurveyInfo.attr.registerul }} >
        {% for error in aSurveyInfo.errors  %}
            <!-- Error Html warnings -->
                <li {{ aSurveyInfo.attr.registerulli }} >{{ error }}</li>
                <br/>
        {% endfor %}
    </ul>
{% endif %}
</file>

<file path="themes/survey/vanilla/views/subviews/registration/register_form.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.

    (¯`·._.·(¯`·._.· Registration form._.·´¯)·._.·´¯)

    This is the registration form for participant registration on a survey.

#}
<div class="{{ aSurveyInfo.class.registerform }} row" {{ aSurveyInfo.attr.registerform }}>
    {{ C.Html.form(aSurveyInfo.sRegisterFormUrl,'post',({'id' : 'limesurvey', 'role' : 'form', 'class' : 'form'})) }}

    {{aSurveyInfo.registerform.hiddeninputs}}

    <div class='{{ aSurveyInfo.class.registerformcol }} col-lg-8 offset-lg-2' {{ aSurveyInfo.attr.registerformcol }}>
        <div class="ls-js-hidden mb-3">
            {{ include('./subviews/navigation/language_changer.twig') }}
        </div>
        {# Participants first name #}
        <div class='{{ aSurveyInfo.class.registerformcolrow }} mb-3' {{ aSurveyInfo.attr.registerformcolrow }}>
            <label for='register_firstname' class='{{ aSurveyInfo.class.registerformcolrowlabel }} control-label '>{{ gT("First name:") }}</label>
            <div class="">
                {{ C.Html.textField('register_firstname', aSurveyInfo.sFirstName, ({'id' : 'register_firstname','class' : 'form-control'})) }}
... (114 lines truncated)
</file>

<file path="themes/survey/vanilla/views/subviews/registration/register_head.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.

    (¯`·._.·(¯`·._.· Registration head·._.·´¯)·._.·´¯)

    This file generates the top container for the participant registration page.

#}

<div class="d-flex justify-content-end ls-no-js-hidden">
    {{ include('./subviews/navigation/language_changer.twig') }}
</div>

<div class="{{ aSurveyInfo.class.registerhead }} row h2" {{ aSurveyInfo.attr.registerhead }}>
    {{aSurveyInfo.registration.head}}
</div>
</file>

<file path="themes/survey/vanilla/views/subviews/registration/register_message.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.

    (¯`·._.·(¯`·._.· Registration message._.·´¯)·._.·´¯)

    If there is a message on the registration page, like "Survey has not started, or Register now! here it is displayed

#}

{% if registerSuccess %}
    <h2 {{ aSurveyInfo.attr.registermessageb }} >{{ gT("Thank you for registering.") }}</h2>
    <p>{{ gT("You will receive an email shortly. But if you already registered, you will not receive another email.") }}</p>
{% else %}
    {% if sStartDate %}
    <h2 {{ aSurveyInfo.attr.registermessagea }} > {{ gT("You may register for this survey but you have to wait for the {{sStartDate}} before starting the survey.") }}</h2>
    {% else %}
    <h2  {{ aSurveyInfo.attr.registermessageb }} >{{ gT("You may register for this survey if you wish to take part.") }}</h2>
    {% endif %}
    <p  {{ aSurveyInfo.attr.registermessagec }} >{{ gT("Enter your details below, and an email containing the link to participate in this survey will be sent immediately.") }}</p>
{% endif %}

{% if  not empty(aSurveyInfo.aErrors) %}
... (7 lines truncated)
</file>

<file path="themes/survey/vanilla/views/subviews/registration/register_privacy.twig">
{% extends './subviews/privacy/privacy.twig' %}
</file>

<file path="themes/survey/vanilla/views/subviews/registration/register_success.twig">
<div class="row">
    <div class='{{ aSurveyInfo.class.registersuccessblock }}' {{ aSurveyInfo.attr.registersuccessblock }} >
        <ul class='{{ aSurveyInfo.class.registersuccesslist }}' {{ aSurveyInfo.attr.registersuccesslist }}>
            <li class='{{ aSurveyInfo.class.registersuccesslistitem }}' {{ aSurveyInfo.attr.registersuccesslistitem }}>
                <div class="row">
                    <div class='{{ aSurveyInfo.class.registersuccesslistlabel }}' {{ aSurveyInfo.attr.registersuccesslistlabel }}>
                        {{ gT("First name") }}
                    </div>
                    <div class='{{ aSurveyInfo.class.registersuccesslistcontent }}' {{ aSurveyInfo.attr.registersuccesslistcontent }}>
                        {{ aSurveyInfo.sFirstName }}
                    </div>
                </div>
            </li>
            <li class='{{ aSurveyInfo.class.registersuccesslistitem }}' {{ aSurveyInfo.attr.registersuccesslistitem }}>
                <div class="row">
                    <div class='{{ aSurveyInfo.class.registersuccesslistlabel }}' {{ aSurveyInfo.attr.registersuccesslistlabel }}>
                        {{ gT("Last name") }}

                    </div>
                    <div class='{{ aSurveyInfo.class.registersuccesslistcontent }}' {{ aSurveyInfo.attr.registersuccesslistcontent }}>
                        {{ aSurveyInfo.sLastName }}

                    </div>
                </div>
            </li>
            <li class='{{ aSurveyInfo.class.registersuccesslistitem }}' {{ aSurveyInfo.attr.registersuccesslistitem }}>
                <div class="row">
                    <div class='{{ aSurveyInfo.class.registersuccesslistlabel }}' {{ aSurveyInfo.attr.registersuccesslistlabel }}>
                        {{ gT("Email address") }}

... (11 lines truncated)
</file>

<file path="themes/survey/vanilla/views/subviews/registration/required.twig">
<small class="{{ aSurveyInfo.class.required  }} text-danger asterisk fa fa-asterisk float-start small" {{ aSurveyInfo.attr.required  }} >&nbsp;</small>
<span class="{{ aSurveyInfo.class.requiredspan  }} visually-hidden text-danger asterisk" {{ aSurveyInfo.attr.requiredspan  }} > ({{ gT("Mandatory") }})</span>
</file>

<file path="themes/survey/vanilla/views/subviews/statistics_user/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="themes/survey/vanilla/views/subviews/statistics_user/statistics_user_content.twig">
<div class="public-stats__content">
    {% if statisticsoutput %}
        {{ statisticsoutput }}
    {% endif %}
</div>
</file>

<file path="themes/survey/vanilla/views/subviews/statistics_user/statistics_user_foot.twig">
</div>
            <input type='hidden' class='hidemenubutton'/>
        </div>
    </div>
</div>
</file>

<file path="themes/survey/vanilla/views/subviews/statistics_user/statistics_user_head.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.

    (¯`·._.·(¯`·._.· Public Statistics Header ._.·´¯)·._.·´¯)

    This is the head for the public statistics page.

#}

<div class="container public-stats">
    <div class="row">
        <div class="col-12">
            <div id='statsContainer'>
                <div id='statsHeader'>
                    <h2 class='statsSurveyTitle public-stats__title'>{{ aSurveyInfo.surveyls_title }}</h2>
                    <div class='statsNumRecords public-stats__num-records'>{{ gT("Total records in survey") }} : {{ totalrecords }}</div>
                </div>
</file>

<file path="themes/survey/vanilla/views/subviews/survey/group_subviews/group_container.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.



    (¯`·._.·(¯`·._.· Group Container  ·._.·´¯)·._.·´¯)


    The container div itself could often change from a template to another, so we clearly separate it.
    NOTE: see views/subviews/survey/group.twig comments for more infos
#}

<div class="{{ aSurveyInfo.class.groupcontainer }} space-col" {{ aSurveyInfo.attr.groupcontainer }}>

    {# Group Name #}
    {{ include('./subviews/survey/group_subviews/group_name.twig') }}

    {# Group Description #}
    {{ include('./subviews/survey/group_subviews/group_desc.twig') }}

    {#
        PRESENT THE QUESTIONS
... (19 lines truncated)
</file>

<file path="themes/survey/vanilla/views/subviews/survey/group_subviews/group_desc.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.



    (¯`·._.·(¯`·._.· Group Name  ·._.·´¯)·._.·´¯)

    Presentation of the group description

    NOTE: see views/subviews/survey/group.twig comments for more infos
#}

{% if aGroup.showgroupinfo == 'D' or aGroup.showgroupinfo == 'B' %}
    {% if aGroup.description != '' %}
        <!-- Group description -->
        <div class="{{ aSurveyInfo.class.groupdesc }} row space-col" {{ aSurveyInfo.attr.groupdesc }}>
            <div class="col-12 well">
            {{ processString(aGroup.description) }}
            </div>
        </div>
    {% endif %}
{% endif %}
... (1 lines truncated)
</file>

<file path="themes/survey/vanilla/views/subviews/survey/group_subviews/group_name.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.



    (¯`·._.·(¯`·._.· Group Name  ·._.·´¯)·._.·´¯)

    Presentation of the group name

    NOTE: see views/subviews/survey/group.twig comments for more infos
#}

<!-- Group Name -->
{% if aGroup.showgroupinfo == 'N' or aGroup.showgroupinfo == 'B' %}
    <div class="{{ aSurveyInfo.class.grouptitle }} text-center h3 space-col" {{ aSurveyInfo.attr.grouptitle }}>
        {{ processString(aGroup.name) }}
    </div>
{% endif %}
</file>

<file path="themes/survey/vanilla/views/subviews/survey/group_subviews/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="themes/survey/vanilla/views/subviews/survey/question_subviews/answers.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.



    (¯`·._.·(¯`·._.· Answers  ·._.·´¯)·._.·´¯)

    The rendering of the answers: the input elements the survey respondent interacts with.
    The container div itself could often change from a template to another, so we clearly separate it.
    NOTE: see views/subviews/survey/question.twig comments for more infos

#}

<!-- Answer -->
<div class="{{ aSurveyInfo.class.answercontainer }} col-12" {{ aSurveyInfo.attr.answercontainer }}>
    {# NOTE: If you want to customize the question rendering, use a question theme #}
    {{ aQuestion.answer | raw }}
</div>
</file>

<file path="themes/survey/vanilla/views/subviews/survey/question_subviews/asterisk.twig">
{#
/**
 * This file render the asterisk for mandatory questions
 */
#}
<!-- The asterisk alone would convey "mandatory" by symbol only, so the word is shown too -->
<div class="asterisk">
  <sup class="text-danger fa fa-asterisk small" aria-hidden='true'></sup>
  <span class="text-danger small">{{ gT("Required") }}</span>
</div>
</file>

<file path="themes/survey/vanilla/views/subviews/survey/question_subviews/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="themes/survey/vanilla/views/subviews/survey/question_subviews/question_text_container.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.



    (¯`·._.·(¯`·._.· Question Text Container  ·._.·´¯)·._.·´¯)

    This file render the quetion text.
    The container div itself could often change from a template to another, so we clearly separate it.
    NOTE: see views/subviews/survey/question.twig comments for more infos

#}

<!-- Question text -->
<div class="{{ aSurveyInfo.class.questiontitlecontainer }}  col-12 " {{ aSurveyInfo.attr.questiontitlecontainer }} >
    {{ include('./subviews/survey/question_subviews/question_text_content.twig') }}
</div>
</file>

<file path="themes/survey/vanilla/views/subviews/survey/question_subviews/question_text_content.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.



    (¯`·._.·(¯`·._.· Question Text Content  ·._.·´¯)·._.·´¯)

    This file render the quetion text content.
    NOTE: see views/subviews/survey/question.twig comments for more infos
#}
{# Use twig from core, if the question is mandatory,return ./subviews/survey/question_subviews/asterisk.twig #}
{% if (aQuestion.mandatory == 'Y') %}
    {{ include('./subviews/survey/question_subviews/asterisk.twig') }}
{% endif %}

{# If the question number is to be shown (set in survey settings) #}
{% if (aShow.question_number) %}
    <span class='{{ aSurveyInfo.class.questionnumber }}' {{ aSurveyInfo.attr.questionnumber }} >
        {{ aQuestion.number }}
    </span>
{% endif %}

... (14 lines truncated)
</file>

<file path="themes/survey/vanilla/views/subviews/survey/question_subviews/survey_question_help.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.



    (¯`·._.·(¯`·._.· Survey Question Help  ·._.·´¯)·._.·´¯)

    The additional question help as entered by the survey creator in question editing
    NOTE: see views/subviews/survey/question.twig comments for more infos
#}

<!-- Survey question help -->
<div class="{{ aSurveyInfo.class.helpcontainer }}  text-info col-12 " {{ aSurveyInfo.attr.helpcontainer }}>
    {% if aQuestion.help.show %}
        <div class="{{ aSurveyInfo.class.lsquestionhelp }}">
            {{ aQuestion.help.text | raw }}
        </div>
    {% else %}
            {{ aQuestion.help.text | raw }}
    {% endif %}
</div>
</file>

<file path="themes/survey/vanilla/views/subviews/survey/question_subviews/valid_message_and_help.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.



    (¯`·._.·(¯`·._.· Valid message and helper  ·._.·´¯)·._.·´¯)

    This file render the quetion text.
    The container div itself could often change from a template to another, so we clearly separate it.
    NOTE: see views/subviews/survey/question.twig comments for more infos

#}

<!-- LimeSurvey valid message and help -->
<div class="{{ aSurveyInfo.class.questionvalidcontainer }} text-info col-12" {{ aSurveyInfo.attr.questionvalidcontainer }}>
    {{ aQuestion.valid_message      | raw }} {# The validation message, eg: "Only numbers may be entered in this field.". This text is inside EM Helper, and can be changed by creating a translation file #}
    {{ aQuestion.man_message        | raw }} {# The question mandatory error message: "This question is mandatory!". This text is inside EM Helper, and can be changed by creating a translation file #}
    {{ aQuestion.file_valid_message | raw }} {# Used only for file upload question type... TODO: check if we can remove it and use valid_message for file upload question type too #}
</div>
</file>

<file path="themes/survey/vanilla/views/subviews/survey/group.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.

    (¯`·._.·(¯`·._.· Group  ·._.·´¯)·._.·´¯)

    This file is one of the most important of the rendering progress.
    It will display the group and the questions inside the group via the for statement that includes question.twig

    Here, you have access to the array aGroup that contains the data of the current group and the array of questions of this group: aQuestions
    To see what's inside aGroup, turn debug mode on and copy the following line to the end of this file:
    {{ dump(aGroup) }}

#}

<!-- START OF GROUP: {{ aGroup.name }} {{ aGroup.gid }}  -->
<div id='group-{{ aGroup.gseq }}' class="{{ aSurveyInfo.class.groupoutercontainer }}{{ aGroup.class }} space-col" {{ aSurveyInfo.attr.questiongroup }}>

    {# The container div itself could often change from a template to another, so we clearly separate it. #}
    {{ include('./subviews/survey/group_subviews/group_container.twig') }}

</div>
<!-- END OF GROUP: {{ aGroup.name }} {{ aGroup.gid }}  -->
... (1 lines truncated)
</file>

<file path="themes/survey/vanilla/views/subviews/survey/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="themes/survey/vanilla/views/subviews/survey/question_container.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.



    (¯`·._.·(¯`·._.· Question Container  ·._.·´¯)·._.·´¯)

    The div containing the question is one of tag that could often change from a template to another
    Different classes, options, etc
    So we separate it
#}
<!-- Question {{ aQuestion.qid  }}  -->
<div {{ aQuestion.attributes }} class="row {{ aQuestion.class }} {{ aQuestion.input_error_class }} {{ aSurveyInfo.class.questioncontainer }}" {{ aSurveyInfo.attr.questioncontainer }}>
    {{ include('./subviews/survey/question.twig') }}
</div>
<!-- End of question  {{ aQuestion.qid  }}  -->
</file>

<file path="themes/survey/vanilla/views/subviews/survey/question.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.



    (¯`·._.·(¯`·._.· Question Layout  ·._.·´¯)·._.·´¯)

    This file is one of the most important of the rendering progress.
    It will render a question. It's included in the for loop in group.twig

    Here, you have access to the array aQuestion that contains the data of the current question.
    To see what's inside aQuestion, turn debug mode on, and copy the following line to the end of this file:
    {{ dump(aQuestion) }}

    All content of aQuestion itself is generated from qanda_helper.
    To modify it, you must create a question theme and apply it to the question in its display settings
    (here, you're inside the survey theme, applied to the survey in its settings).

#}


{# Showing question code/number is a survey level setting, so it's inside the array aSurveyInfo #}
... (25 lines truncated)
</file>

<file path="themes/survey/vanilla/views/subviews/survey/README.md">
![LimeSurvey Logo](https://account.limesurvey.org/images/logos/logo_main.png)
# LimeSurvey Bootstrap Vanilla Survey Theme

## Survey directory
The subviews to render the question groups and the questions.

group.twig is the main view here. It's rendered from content/main.twig, and then via a each loop it renders each relevant group and question.
We tried to atomize it as much as possible, so if a user update one of those views via the template manager, only a small amount of HTML will be loaded from local template.
</file>

<file path="themes/survey/vanilla/views/subviews/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="themes/survey/vanilla/views/subviews/README.md">
![LimeSurvey Logo](https://account.limesurvey.org/images/logos/logo_main.png)
# LimeSurvey Bootstrap Vanilla Survey Theme

## subviews directory
The subview directory contains only subdirectories.
If you're creating a template from scratch, there is no obligation to respect this structure.

* content/      
    The directory content contains all the subviews render from layout_global.
    They are used to render any page directly related to survey taking.
    If you're creating a template from scratch, you can place those subviews wherever you want (by updating the path of sViewContent in the global layout).
    **But those views must exist with the very same name.**

* header/       
    Anything on top of the survey form. (including the survey form tag).
    *Those subviews are hard included in other views. So if you create a template from scratch, you can named them as you want (or you can even not create them at all)*

* messages/     
    Messages sent to the user, such as the modals, alerts, warning, welcome, or assessments results
    *Those subviews are hard included in other views. So if you create a template from scratch, you can named them as you want (or you can even not create them at all)*

* navigation/
    Anything causing a page reload: navigator (next, prev, submit, etc), clear all, save, change language, question index, etc
    *Those subviews are hard included in other views. So if you create a template from scratch, you can named them as you want (or you can even not create them at all)*

* printanswers/
    The views to print the survey. In future version of LimeSurvey (3.5 or 4.x ) The subfolder "question_type" will not exist anymore, and each question theme will have its own view for the print rendering.
    **If you create a template from scratch, you can update the content of those files, but keep the structure of that directory (file name, directories, etc)**

* privacy/
... (11 lines truncated)
</file>

<file path="themes/survey/vanilla/views/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="themes/survey/vanilla/views/layout_errors.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.



    (¯`·._.·(¯`·._.· Vanilla Theme Errors Layout  ·._.·´¯)·._.·´¯)

    This layout is used to render errors that block survey rendering.
    Eg: wrong survey ID, empty group in preview group, etc.

    It has no obligation to be the same layout as layout_global.twig, it can be completely different.

    NOTE: To see it: just try to preview a survey with an empty group.

    NOTE: see layout_global.twig for more infos
#}

{# We register a specific css file for that layout. #}
{{ registerTemplateCssFile('css/errors.css') }}
{% set aError     = aSurveyInfo.aError    %}

<!DOCTYPE html>
... (68 lines truncated)
</file>

<file path="themes/survey/vanilla/views/layout_global.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.

    (¯`·._.·(¯`·._.· Global Layout  ·._.·´¯)·._.·´¯)

    This is the global layout that will be used to displayed most pages (less the error page)
    If you're creating your own template, remember there is no obligation to respect the current file flow of this template.
    This is different from the old LimeSurvey template engine, where you had to provide every one of the pstpl files.
    Here, you must have a file called main_layout.twig (called from SurveyRuntimeHelper::run() ).
    Other than that, you're free to organize your files and inclusions as you want.



    (¯`·._.·(¯`·._.· Bootstrap ·._.·´¯)·._.·´¯)

    LimeSurvey uses Bootstrap.
    See: https://getbootstrap.com

    This template is an instance of Bootswatch Theme Flatly.
    See: https://bootswatch.com/


... (120 lines truncated)
</file>

<file path="themes/survey/vanilla/views/layout_maintenance.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.



    (¯`·._.·(¯`·._.· Vanilla Theme Maintenance Layout  ·._.·´¯)·._.·´¯)

    This layout is used to render message explaining that maintenance mode is activated.

#}

{# We register a specific css file for that layout. #}
{{ registerTemplateCssFile('css/maintenance.css') }}

<!DOCTYPE html>
<html lang="{{ aSurveyInfo.htmllanguagecode }}" dir="{{ aSurveyInfo.dir }}" class="{{ aSurveyInfo.languagecode }} dir-{{ aSurveyInfo.dir }} {{ aSurveyInfo.class.html }}" {{ aSurveyInfo.attr.html }}>

    <head>
        <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />

... (30 lines truncated)
</file>

<file path="themes/survey/vanilla/views/layout_print.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.

    (¯`·._.·(¯`·._.· Print Layout  ·._.·´¯)·._.·´¯)

    This is the layout that will be used to print the survey to pdf
    If you're creating your own template, remember there is no obligation to respect the current file flow of this template.
    This is different from the old LimeSurvey template engine, where you had to provide every one of the pstpl files.
    Here, you must have a file called layout_global.twig (called from SurveyRuntimeHelper::run() ).
    Other than that, you're free to organize your files and inclusions as you want.
#}
<!DOCTYPE html>
<html lang="{{ aSurveyInfo.htmllanguagecode }}" dir="{{ aSurveyInfo.dir }}" class="{{ aSurveyInfo.languagecode }} dir-{{ aSurveyInfo.dir }} {{ aSurveyInfo.class.html }}" {{ aSurveyInfo.attr.html }}>
    <head>
        <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
        <title>{{print.sitename}} - {{ aSurveyInfo.surveyls_title }}</title>
    </head>
    <body>

    {# DO NOT REMOVE This is for automated testing to validate we see that page #}
    <x-test id="action::printableSurvey"></x-test>

... (27 lines truncated)
</file>

<file path="themes/survey/vanilla/views/layout_printanswers.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.

    (¯`·._.·(¯`·._.· Print Answers Layout  ·._.·´¯)·._.·´¯)

    This is the layout that will be used to print the answers. 

#}
{% extends 'layout_global.twig' %}
{% block ajaxindicator %}{% endblock %}
{% block pjaxbegin %}{% endblock %}
{% block body %}
    {% block nav_bar %}
        {% if (not aSurveyInfo.printPdf) %} 
            {{ parent() }}
        {% endif %}
    {% endblock %}
    {% block content %}
        {% set sViewContent =  './subviews/content/' ~ aSurveyInfo.include_content ~ '.twig' %}
        {% include './subviews/content/outerframe.twig' with {'include_content': sViewContent } %}
    {% endblock %}
    {% if (not aSurveyInfo.printPdf) %} 
... (15 lines truncated)
</file>

<file path="themes/survey/vanilla/views/layout_statistics_user.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.

    (¯`·._.·(¯`·._.· Public Statistics Layout  ·._.·´¯)·._.·´¯)

    This is the layout that will be used to show the public statistics. 

#}
{% extends 'layout_global.twig' %}
{% block ajaxindicator %}{% endblock %}
{% block pjaxbegin %}{% endblock %}
{% block body %}
    {% block nav_bar %}
        {{ parent() }}
    {% endblock %}
    {{ registerScript("StatisticsUserBaseScripts", "var graphUrl = '" ~ graphUrl ~ "';", "POS_BEGIN") }}
    {% block content %}
        {% set sViewContent =  './subviews/content/' ~ aSurveyInfo.include_content ~ '.twig' %}
        {% include './subviews/content/outerframe.twig' with {'include_content': sViewContent } %}
    {% endblock %}
{% endblock %}
{% block footer %}
... (4 lines truncated)
</file>

<file path="themes/survey/vanilla/views/layout_survey_list.twig">
{#
LimeSurvey
Copyright (C) 2007-2026 The LimeSurvey Project Team
All rights reserved.
License: GNU/GPL License v2 or later, see LICENSE.php
LimeSurvey is free software. This version may have been modified pursuant
to the GNU General Public License, and as distributed it includes or
is derivative of works licensed under the GNU General Public License or
other free or open source software licenses.
See COPYRIGHT.php for copyright notices and details.
(¯`·._.·(¯`·._.· Survey List Layout  ·._.·´¯)·._.·´¯)
This file renders the list of publicly listed surveys in your LimeSurvey home page.
NOTE: see layout_main.twig for more infos
#}



{#
LimeSurvey
Copyright (C) 2007-2026 The LimeSurvey Project Team
All rights reserved.
License: GNU/GPL License v2 or later, see LICENSE.php
LimeSurvey is free software. This version may have been modified pursuant
to the GNU General Public License, and as distributed it includes or
is derivative of works licensed under the GNU General Public License or
other free or open source software licenses.
See COPYRIGHT.php for copyright notices and details.

(¯`·._.·(¯`·._.· Global Layout  ·._.·´¯)·._.·´¯)

... (196 lines truncated)
</file>

<file path="themes/survey/vanilla/views/layout_user_forms.twig">
{#
    LimeSurvey
    Copyright (C) 2007-2026 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.

    (¯`·._.·(¯`·._.· User Forms Layout  ·._.·´¯)·._.·´¯)

    This file renders the user forms such as: token (survey participant), and register.
    => it is a direct child of layout_global
    NOTE: see layout_global.twig for more infos
#}
{% extends "layout_global.twig" %}
</file>

<file path="themes/survey/vanilla/views/README.md">
![LimeSurvey Logo](https://account.limesurvey.org/images/logos/logo_main.png)
# LimeSurvey Bootstrap Vanilla Survey Theme

## Views directory
The view directory contains all the necessary views to render the frontend.

* layout_global.twig: render the pages for survey taking
* layout_user_forms.twig: renders the user forms such as: token (survey participant), and register.
* layout_survey_list.twig: render the survey list (if this theme is set as default)
* layout_errors.twig: used to render errors that block survey rendering. ( wrong survey id, empty group in preview group, etc.)


Each one of the layout can have a complete different look & feel from the other layouts.
In vanilla, layout_user_forms and layout_global are pretty similar, and share some subviews: this is not an obligation at all.

## Content system
layout_global.twig renders the specific content via this statement:
```
{% set sViewContent =  './subviews/content/' ~ aSurveyInfo.include_content ~ '.twig' %}
{% include './subviews/content/outerframe.twig' with {'include_content': sViewContent } %}
```

see: https://github.com/LimeSurvey/LimeSurvey/blob/7ffc17fbb872791a9ba1a6b6ab68cec0263f3eca/themes/survey/vanilla/views/layout_global.twig#L103-L111

So, if you're creating a template from scratch, you're free to place the content views where ever you want. Just update the definition of sViewContent in layout_global
</file>

<file path="themes/survey/vanilla/config.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <metadata>
        <name>vanilla</name>
        <title>Bootstrap Vanilla</title>
        <type>theme</type>
        <creationDate>16/10/2017</creationDate>
        <author>LimeSurvey GmbH</author>
        <authorEmail>info@limesurvey.org</authorEmail>
        <authorUrl>http://www.limesurvey.org</authorUrl>
        <copyright>Copyright (C) 2005 - 2019 LimeSurvey Gmbh, Inc. All rights reserved.</copyright>
        <license>GNU General Public License version 2 or later</license>
        <version>3.0.1</version>
        <apiVersion>3</apiVersion>
        <description twig="on"><![CDATA[{{gT("A clean and simple base that can be used by developers to create their own Bootstrap based theme.")}}]]></description>
        <lastUpdate>2021-06-26 17:00:00</lastUpdate>
    </metadata>
    <compatibility>
        <version>7.0</version>
        <version>6.0</version>
    </compatibility>
    <files>
        <css>
            <add>css/base.css</add>
            <add>css/theme.css</add>
            <add>css/noTablesOnMobile.css</add>
            <add>css/custom.css</add>
        </css>
        <js>
            <add>scripts/theme.js</add>
... (51 lines truncated)
</file>
                    <file type="view" role="subview">./subviews/footer/footer.twig</file>
                    <file type="view" role="content">./subviews/content/main.twig</file>
                    <file type="view" role="subview">./subviews/messages/justsaved.twig</file>
                    <file type="view" role="subview">./subviews/survey/group.twig</file>
                    <file type="view" role="subview">./subviews/survey/group_subviews/group_container.twig</file>
                    <file type="view" role="subview">./subviews/survey/group_subviews/group_desc.twig</file>
                    <file type="view" role="subview">./subviews/survey/group_subviews/group_name.twig</file>
                    <file type="view" role="subview">./subviews/survey/question.twig</file>
                    <file type="view" role="subview">./subviews/survey/question_container.twig</file>
                    <file type="view" role="subview">./subviews/survey/question_subviews/question_text_container.twig</file>
                    <file type="view" role="subview">./subviews/survey/question_subviews/question_text_content.twig</file>
                    <file type="view" role="subview">./subviews/survey/question_subviews/answers.twig</file>
                    <file type="view" role="subview">./subviews/survey/question_subviews/survey_question_help.twig</file>
                    <file type="view" role="subview">./subviews/survey/question_subviews/valid_message_and_help.twig</file>
                    <file type="css">./css/theme.css</file>
                    <file type="js">./scripts/theme.js</file>
                    <file type="css">./css/custom.css</file>
                    <file type="js">./scripts/custom.js</file>
                </question>
                <surveylist>
                    <screen_title  type="data"  role="title" twig="on"><![CDATA[ {{gT('Survey list')}} ]]></screen_title>
                    <file type="view" role="layout">layout_survey_list.twig</file>
                    <file type="view" role="subview">./subviews/footer/footer.twig</file>
                    <file type="view" role="subview">./subviews/content/mainrow.twig</file>
                    <file type="view" role="subview">./subviews/content/outerframe.twig</file>
                    <file type="view" role="subview">./subviews/navigation/language_changer_form.twig</file>
                    <file type="css">./css/theme.css</file>
                    <file type="js">./scripts/theme.js</file>
                    <file type="css">./css/custom.css</file>
                    <file type="js">./scripts/custom.js</file>
                </surveylist>
                <welcome>
                    <screen_title  type="data"  role="title" twig="on"><![CDATA[ {{gT('Welcome')}} ]]></screen_title>
                    <file type="view" role="layout">layout_global.twig</file>
                    <file type="view" role="subview">./subviews/footer/footer.twig</file>
                    <file type="view" role="subview">./subviews/content/mainrow.twig</file>
                    <file type="view" role="subview">./subviews/content/outerframe.twig</file>
                    <file type="view" role="content">./subviews/content/firstpage.twig</file>
                    <file type="view" role="subview">./subviews/header/head.twig</file>
                    <file type="view" role="subview">./subviews/header/custom_header.twig</file>
                    <file type="view" role="subview">./subviews/header/nav_bar.twig</file>
                    <file type="view" role="subview">./subviews/header/progress_bar.twig</file>
                    <file type="view" role="subview">./subviews/messages/welcome.twig</file>
                    <file type="view" role="subview">./subviews/messages/warnings.twig</file>
                    <file type="view" role="subview">./subviews/messages/no_js_alert.twig</file>
                    <file type="view" role="subview">./subviews/privacy/privacy.twig</file>
                    <file type="view" role="subview">./subviews/navigation/language_changer.twig</file>
                    <file type="view" role="subview">./subviews/logincomponents/captcha.twig</file>
                    <file type="view" role="subview">./subviews/logincomponents/token.twig</file>
                    <file type="css">./css/theme.css</file>
                    <file type="js">./scripts/theme.js</file>
                    <file type="css">./css/custom.css</file>
                    <file type="js">./scripts/custom.js</file>
                </welcome>
                <completed>
                    <screen_title  type="data"  role="title" twig="on"><![CDATA[ {{gT('Completed')}} ]]></screen_title>
                    <file type="view" role="layout">layout_global.twig</file>
                    <file type="view" role="subview">./subviews/footer/footer.twig</file>
                    <file type="view" role="subview">./subviews/content/mainrow.twig</file>
                    <file type="view" role="subview">./subviews/content/outerframe.twig</file>
                    <file type="view" role="content">./subviews/content/submit.twig</file>
                    <file type="css">./css/theme.css</file>
                    <file type="js">./scripts/theme.js</file>
                    <file type="css">./css/custom.css</file>
                    <file type="js">./scripts/custom.js</file>
                </completed>
                <assessments>
                    <screen_title  type="data"  role="title" twig="on"><![CDATA[ {{gT('Assessments')}} ]]></screen_title>
                    <file type="view" role="layout">layout_global.twig</file>
                    <file type="view" role="subview">./subviews/footer/footer.twig</file>
                    <file type="view" role="subview">./subviews/content/mainrow.twig</file>
                    <file type="view" role="subview">./subviews/content/outerframe.twig</file>
                    <file type="view" role="content">./subviews/content/submit.twig</file>
                    <file type="view" role="subview">./subviews/messages/assessments.twig</file>
                    <file type="css">./css/theme.css</file>
                    <file type="js">./scripts/theme.js</file>
                    <file type="css">./css/custom.css</file>
                    <file type="js">./scripts/custom.js</file>
                </assessments>
                <error>
                    <screen_title  type="data"  role="title" twig="on"><![CDATA[ {{gT('Error')}} ]]></screen_title>
                    <file type="view" role="layout">layout_errors.twig</file>
                    <file type="view" role="subview">./subviews/footer/footer.twig</file>
                </error>
                <clearall>
                    <screen_title  type="data"  role="title" twig="on"><![CDATA[ {{gT('Clear all')}} ]]></screen_title>
                    <file type="view" role="layout">layout_global.twig</file>
                    <file type="view" role="subview">./subviews/footer/footer.twig</file>
                    <file type="view" role="subview">./subviews/content/mainrow.twig</file>
                    <file type="view" role="subview">./subviews/content/outerframe.twig</file>
                    <file type="view" role="content">./subviews/content/clearall.twig</file>
                    <file type="css">./css/theme.css</file>
                    <file type="js">./scripts/theme.js</file>
                    <file type="css">./css/custom.css</file>
                    <file type="js">./scripts/custom.js</file>
                </clearall>
                <load>
                    <screen_title  type="data"  role="title" twig="on"><![CDATA[ {{gT('Load')}} ]]></screen_title>
                    <file type="view" role="layout">layout_global.twig</file>
                    <file type="view" role="subview">./subviews/footer/footer.twig</file>
                    <file type="view" role="subview">./subviews/content/mainrow.twig</file>
                    <file type="view" role="subview">./subviews/content/outerframe.twig</file>
                    <file type="view" role="content">./subviews/content/load.twig</file>
                    <file type="css">./css/theme.css</file>
                    <file type="js">./scripts/theme.js</file>
                    <file type="css">./css/custom.css</file>
                    <file type="js">./scripts/custom.js</file>
                </load>
                <save>
                    <screen_title  type="data"  role="title" twig="on"><![CDATA[ {{gT('Save')}} ]]></screen_title>
                    <file type="view" role="layout">layout_global.twig</file>
                    <file type="view" role="subview">./subviews/footer/footer.twig</file>
                    <file type="view" role="subview">./subviews/content/mainrow.twig</file>
                    <file type="view" role="subview">./subviews/content/outerframe.twig</file>
                    <file type="view" role="content">./subviews/content/save.twig</file>
                    <file type="css">./css/theme.css</file>
                    <file type="js">./scripts/theme.js</file>
                    <file type="css">./css/custom.css</file>
                    <file type="js">./scripts/custom.js</file>
                </save>
                <register>
                    <screen_title  type="data"  role="title" twig="on"><![CDATA[ {{gT('Registration')}} ]]></screen_title>
                    <file type="view" role="layout">layout_global.twig</file>
                    <file type="view" role="subview">./subviews/footer/footer.twig</file>
                    <file type="view" role="content">./subviews/content/register.twig</file>
                    <file type="view" role="subview">./subviews/registration/register_error.twig</file>
                    <file type="view" role="subview">./subviews/registration/register_head.twig</file>
                    <file type="view" role="subview">./subviews/registration/register_message.twig</file>
                    <file type="view" role="subview">./subviews/registration/register_success.twig</file>
                    <file type="view" role="subview">./subviews/registration/register_form.twig</file>
                    <file type="view" role="subview">./subviews/registration/required.twig</file>
                </register>
                <printanswers>
                    <screen_title  type="data"  role="title" twig="on"><![CDATA[ {{gT('Print answers')}} ]]></screen_title>
                    <file type="view" role="layout">layout_printanswers.twig</file>
                    <file type="view" role="subview">./subviews/content/outerframe.twig</file>
                    <file type="view" role="content">./subviews/content/printanswers.twig</file>
                    <file type="view" role="subview">./subviews/printanswers/printanswers_head.twig</file>
                    <file type="view" role="subview">./subviews/printanswers/printanswers_table.twig</file>
                    <file type="view" role="subview">./subviews/printanswers/printanswers_question.twig</file>
                    <file type="view" role="subview">./subviews/printanswers/printanswers_foot.twig</file>
                </printanswers>
                <statistics_user>
                    <screen_title  type="data"  role="title" twig="on"><![CDATA[ {{gT('Public statistics')}} ]]></screen_title>
                    <file type="view" role="layout">layout_statistics_user.twig</file>
                    <file type="view" role="subview">./subviews/content/outerframe.twig</file>
                    <file type="view" role="content">./subviews/content/statistics_user.twig</file>
                    <file type="view" role="subview">./subviews/statistics_user/statistics_user_head.twig</file>
                    <file type="view" role="subview">./subviews/statistics_user/statistics_user_content.twig</file>
                    <file type="view" role="subview">./subviews/statistics_user/statistics_user_foot.twig</file>
                </statistics_user>
                <pdf>
                    <screen_title  type="data"  role="title" twig="on"><![CDATA[ {{gT('PDF')}} ]]></screen_title>
                    <file type="view" role="layout">layout_print.twig</file>
                </pdf>
                <quotas>
                  <screen_title  type="data"  role="title" twig="on"><![CDATA[ {{gT('Quotas exceeded')}} ]]></screen_title>
                  <file type="view" role="layout">layout_global.twig</file>
                  <file type="view" role="content">./subviews/content/quotas.twig</file>
                  <file type="view" role="subview">./subviews/header/start_form.twig</file>
                </quotas>
                <navigation>
                    <screen_title  type="data"  role="title" twig="on"><![CDATA[ {{gT('Navigation')}} ]]></screen_title>
                    <file type="view" role="layout">layout_global.twig</file>
                    <file type="view" role="subview">./subviews/footer/footer.twig</file>
                    <file type="view" role="content">./subviews/content/main.twig</file>
                    <file type="view" role="subview">./subviews/navigation/ajax_indicator.twig</file>
                    <file type="view" role="subview">./subviews/navigation/clearall_links.twig</file>
                    <file type="view" role="subview">./subviews/navigation/save_links.twig</file>
                    <file type="view" role="subview">./subviews/navigation/language_changer_top_menu.twig</file>
                    <file type="view" role="subview">./subviews/navigation/language_changer.twig</file>
                    <file type="view" role="subview">./subviews/navigation/question_index_menu.twig</file>
                    <file type="view" role="subview">./subviews/navigation/navigator.twig</file>
                    <file type="view" role="subview">./subviews/navigation/navigator_complement.twig</file>
                    <file type="view" role="subview">./subviews/navigation/clearall_buttons.twig</file>
                    <file type="view" role="subview">./subviews/navigation/save_buttons.twig</file>
                    <file type="view" role="subview">./subviews/navigation/question_index_buttons.twig</file>
                    <file type="view" role="subview">./subviews/navigation/question_index_questions_buttons.twig</file>
                    <file type="view" role="subview">./subviews/navigation/question_index_groups_buttons.twig</file>
                </navigation>
                <token>
                  <screen_title  type="data"  role="title" twig="on"><![CDATA[ {{gT('Participant')}} ]]></screen_title>
                  <file type="view" role="layout">layout_user_forms.twig</file>
                  <file type="view" role="content">./subviews/content/userforms.twig</file>
                  <file type="view" role="subview">./subviews/logincomponents/token.twig</file>
                  <file type="view" role="subview">./subviews/logincomponents/captcha.twig</file>
                </token>
            </screens>
            <default_data>
              <survey type="core">
                <name type="data" twig="on"><![CDATA[ {{ gT("Template Sample") }} ]]></name>
                <description type="data" twig="on"><![CDATA[<p>{{ gT('This is a sample survey description. It could be quite long.') }}</p><p>{{ gT("But this one isn't.") }}<p>]]></description>
                <welcome  type="data" twig="on"><![CDATA[<p>{{ gT('Welcome to this sample survey')}} <p> <p> {{ gT('You should have a great time doing this') }} <p> ]]></welcome>
                <therearexquestions  type="data" twig="on"><![CDATA[gT('There are 2 questions in this survey.'])]]></therearexquestions>
                <surveyls_url type="data" twig="on">"https://www.limesurvey.org/"</surveyls_url>
                <surveyls_urldescription type="data" twig="on"><![CDATA[ gT("Some URL description") ]]></surveyls_urldescription>
                <showsurveypolicynotice>2</showsurveypolicynotice>
                <datasecurity_notice_label type="data" twig="on"><![CDATA[ {STARTPOLICYLINK}{{ gT('Show privacy policy') }}{ENDPOLICYLINK} ]]></datasecurity_notice_label>
                <datasecurity_notice type="data" twig="on"><![CDATA[ {{ gT("Your privacy policy text is shown here.") }} ]]></datasecurity_notice>
              </survey>
              <group type="core">
                <name type="data" twig="on"><![CDATA[ {{ gT("Group 1: The first lot of questions") }} ]]></name>
                <description type="data" twig="on"><![CDATA[ {{ gT("This group description is fairly vacuous, but quite important.") }} ]]></description>
              </group>
              <question_1 type="core">
                <code type="data" >'Q1 '</code>
                <text type="data" twig="on"><![CDATA[ {{ gT("How many roads must a man walk down?") }} ]]></text>
                <valid_message type="data" twig="on"><![CDATA[ <div id="vmsg_4496_num_answers" class="em_num_answers emtip error"><span class="fa fa-exclamation-circle" aria-hidden="true"></span> {{ gT("Choose one of the following answers") }} </div> ]]></valid_message>
              </question_1>
              <question_2 type="core">
                <code type="data" >'Q2 '</code>
                <text type="data" twig="on"><![CDATA[ {{ gT("Please explain something in detail:") }} ]]></text>
                <valid_message type="data" twig="on"><![CDATA[<div id="vmsg_4496_num_answers" class="em_num_answers emtip error"><span class="fa fa-exclamation-circle" aria-hidden="true"></span> {{ gT("Hint when response is not valid") }} </div> ]]></valid_message>
              </question_2>
              <assessments  type="core">
                <name type="data" twig="on"><![CDATA[ {{ gT("Welcome to the Assessment") }} ]]></name>
                <message type="data" twig="on"><![CDATA[ {{ gT("You got {TOTAL} points out of 3 possible points.") }} ]]></message>
              </assessments>
              <quotas type="custom" arrayName="aQuotas">
                <sMessage type="data" twig="on"><![CDATA[ {{ gT("Sorry your responses have exceeded a quota on this survey.") }} ]]></sMessage>
                <sUrl type="data">http://limesurvey.org</sUrl>
                <sUrlDescription type="data" twig="on"><![CDATA[ {{ gT("End url") }} ]]></sUrlDescription>
                <bShowNavigator type="data">false</bShowNavigator>
              </quotas>
              <userforms type="custom" arrayName="aForm">
                <sType type="data">token</sType>
              </userforms>
            </default_data>
        </template_editor>
    </engine>
    <updaters disabled="disabled">
    </updaters>
</config>
</file>

<file path="themes/survey/vanilla/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="themes/survey/vanilla/README.md">
![LimeSurvey Logo](https://account.limesurvey.org/images/logos/logo_main.png)
# LimeSurvey Bootstrap Vanilla Survey Theme

## About
A clean and simple base that can be used by developers to create their own Bootstrap based theme.
</file>

<file path="themes/survey/index.html">

</file>

<file path="upload/admintheme/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="upload/global/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="upload/labels/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="upload/labels/readme.txt">
This folder has to be writeable. Set file permissions to 775 or 777 depending on your webserver configuration.
</file>

<file path="upload/plugins/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="upload/surveys/.htaccess">
<FilesMatch "^fu_[a-z0-9_]*$">
    <IfModule mod_version.c>
        <IfVersion < 2.4>
            Order deny,allow
            Deny from all
        </IfVersion>
        <IfVersion >= 2.4>
           Require all denied
           <IfModule mod_access_compat.c>
               Order deny,allow
               Deny from all
           </IfModule>
        </IfVersion>
    </IfModule>
    <IfModule !mod_version.c>
        <IfModule !mod_authz_core.c>
            Order deny,allow
            Deny from all
        </IfModule>
        <IfModule mod_authz_core.c>
            Require all denied
        </IfModule>
    </IfModule>
</FilesMatch>
</file>

<file path="upload/themes/survey/generalfiles/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="upload/themes/survey/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="upload/themes/index.html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>LimeSurvey</title>
</head>
<body>
</body>
</html>
</file>

<file path="upload/twig/extensions/HelloWorld_Twig_Extension/HelloWorld_Twig_Extension.php">
<?php
use Twig\Extension\AbstractExtension;
class HelloWorld_Twig_Extension extends AbstractExtension
{
  public static function helloWorld()
  {
    return "Hello World!";
  }
}
</file>

<file path="upload/twig/extensions/HelloWorld_Twig_Extension/HelloWorld_Twig_Extension.xml">
<?xml version="1.0" encoding="UTF-8"?>
<config>
      <metadata>
          <name>HelloWorld_Twig_Extension</name>
          <title>HelloWorld Twig Extension</title>
          <creationDate>26/07/2019</creationDate>
          <author>LimeSurvey GmbH</author>
          <authorEmail>info@limesurvey.org</authorEmail>
          <authorUrl>http://www.limesurvey.org</authorUrl>
          <copyright>Copyright (C) 2005 - 2016 LimeSurvey Gmbh, Inc. All rights reserved.</copyright>
          <license>GNU General Public License version 2 or later</license>
          <version>1.0</version>
          <apiVersion>3</apiVersion>
          <description><![CDATA[<strong>HelloWorld Twig Extension</strong><br>A custom twig extension show case.]]></description>
          <last_update>2018-04-11 17:00:00</last_update>
      </metadata>
      <sandboxConfig>
        <tags></tags>
        <methods></methods>
        <functions>
          <function twig-name="helloWorld" extension-name="HelloWorld_Twig_Extension::helloWorld" />
        </functions>
        <properties></properties>
        <filters></filters>
      </sandboxConfig>
</config>
</file>

<file path="upload/twig/extensions/HelloWorld_Twig_Extension/README.md">
#  HelloWorld LS Custom Twig Extension

This is an example to show you how to add custom twig extensions to LimeSurvey.

Remember to turn the functionality on in your config file:

```
'use_custom_twig_extensions'=>true,
```
</file>

<file path="upload/twig/extensions/README.md">
# Custom Twig Extension for LimeSurvey

Coming with the 4.X Verson of LimeSurvey you will be able to add your own twig extension so you can create your own functions available from Survey / Question Themes.
It comes with an exemle: HelloWorld_Twig_Extension.

In LS3, it is available by configuration. You must update your config.php to allow it by adding:
```
'use_custom_twig_extensions'=>true,
```
</file>

<file path=".codespellrc">
[codespell]
skip = vendor,node_modules,./.git,*.min.js,*.min.css,build,dist,./upload,.gitignore,.DS_Store,*.lock,*.lss,./assets/packages,./application/extensions/yiiwheels,./application/extensions/yii-jsoneditor,./application/extensions/captchaExtended,./docs/swagger/swagger-ui*,./docs/release_notes.txt,./locale,./editor/public/tinymce,./editor/public/remixicon,./assets/fonts,./assets/scripts/admin/bootstrap-switch.js,./application/extensions/bootstrap5/helpers/TbHtml.php,./themes/*/*/css,package-lock.json,./docs/credits.txt,./assets/scripts/admin/json-js,./application/helpers/adodb,./application/core/plugins/TwoFactorAdminLogin/helper/phpqrcode.php
check-filenames = true
builtin = clear,rare
ignore-words-list = clas,nd,ser,sav,nax,bu,fo,datas,rollin,optin,ded,slanguage,slanguages,currenty,smove,afile,acount,ascript,ascripts,ontext,sord,idel,ans,vas,te,ot,eacf,pre-select,groupe,doble,titel,ist,cna,curren,afterall,cript,unsecure,invokable,lightening,allways,serie,notin,acounts,alpha-numeric
</file>

<file path=".eslintrc.json">
{
    "env": {
        "es6": true
    },
    "globals": {
        "LS" : "writable",
        "$" : "readonly"
    },
    "rules": {
        "semi": ["warn", "always"],
        "indent": ["warn", 4]
    }
}
</file>

<file path=".htaccess">
<IfModule mod_rewrite.c>
    RewriteEngine on

    # Pass Authorization header to PHP (required for PHP-FPM/CGI setups)
    RewriteCond %{HTTP:Authorization} .+
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    # issue #20691: determine the base path dynamically from the request URI
    # instead of relying on Apache's implicit rewrite-base detection, which
    # can be wrong on shared hosting (e.g. IONOS) where suexec/mod_userdir
    # make the filesystem path diverge from the URL path
    RewriteCond %{REQUEST_URI}::$1 ^(.*?/)(.*)::\2$
    RewriteRule ^(.*)$ - [E=BASE:%1]

    # If the request is NOT for the editor folder"
    RewriteCond %{REQUEST_URI} !/editor/ [NC]
    # if a directory or a file exists, use it directly
    RewriteCond %{REQUEST_FILENAME} !-f
    # RewriteCond %{REQUEST_FILENAME} !-d

    # otherwise forward it to index.php
    RewriteRule ^ %{ENV:BASE}index.php

    # deny access to hidden files and directories except .well-known
    RewriteCond %{REQUEST_URI} !^/\.well-known
    RewriteRule ^(.*/)?\.+ - [F]

    # issue #19865
    RewriteRule ^setdebug.php - [F]

... (45 lines truncated)
</file>

<file path="composer.json">
{
	"name" : "limesurvey/limesurvey",
	"description" : "The most popular FOSS online survey tool on the web",
	"homepage" : "https://www.limesurvey.org/",
	"license": "GPL-2.0-or-later",
	"authors" : [{
			"name" : "LimeSurvey Team",
			"email" : "support@limesurvey.org",
			"homepage" : "https://www.limesurvey.org",
			"role" : "Developer"
		}
	],
	"support" : {
		"wiki" : "https://manual.limesurvey.org/LimeSurvey_Manual",
		"source" : "https://github.com/LimeSurvey/LimeSurvey",
		"issues" : "https://community.limesurvey.org/bug-tracker/",
		"forum" : "https://forums.limesurvey.org"
	},
	"autoload": {
		"psr-4": {
			"LimeSurvey\\PluginManager\\": [
				"application/libraries/PluginManager/",
				"application/libraries/PluginManager/Storage"
			],
			"LimeSurvey\\Menu\\": "application/libraries/MenuObjects/",
			"LimeSurvey\\Libraries\\": "application/libraries/",
			"LimeSurvey\\ExtensionInstaller\\": "application/libraries/ExtensionInstaller/",
			"LimeSurvey\\Helpers\\": "application/helpers",
			"LimeSurvey\\Helpers\\Update\\": [
                "application/helpers/update",
... (94 lines truncated)
</file>

<file path="CONTRIBUTING.md">
# How to contribute

Third-party patches are essential for keeping LimeSurvey great. We simply can't
access the huge number of platforms and myriad configurations for running
LimeSurvey. We want to keep it as easy as possible to contribute changes that
get things working in your environment. There are a few guidelines that we
need contributors to follow so that we can have a chance of keeping on
top of things.

## Getting started

* Make sure you have a [LimeSurvey account](https://www.limesurvey.org)
* Make sure you have a [GitHub account](https://github.com/signup/free)
* Read the [manual entry about contributions](https://manual.limesurvey.org/How_to_contribute_new_features)
* Submit a ticket at https://bugs.limesurvey.org for your issue, assuming one does not already exist.
  * Clearly describe the issue including steps to reproduce when it is a bug.
  * Make sure you fill in the earliest version that you know has the issue.
* Fork the repository on GitHub

## Making changes

* Create a topic branch from where you want to base your work.
  * Bug fixes go into the master branch
  * New features go into the develop branch
  * To quickly create a topic branch based on develop; `git checkout -b
    fix/develop/my_contribution develop`. Please avoid working directly on the
    `develop` or `master` branch.
* Make commits of logical units.
* Check for unnecessary whitespace with `git diff --check` before committing.
* Make sure your commit messages are in the proper format - check out our 
... (38 lines truncated)
</file>

<file path="gulpfile.js">
const {watch, series, parallel} = require('gulp');
const {src, dest} = require('gulp');
const uglify = require('gulp-uglify');
const rename = require('gulp-rename');
const sass = require('gulp-sass')(require('sass'));
const gulppostcss = require('gulp-postcss');
const autoprefixer = require('autoprefixer');
const cssnano = require('cssnano');
const rtlcss = require('gulp-rtlcss');
const replace = require('gulp-replace');
const merge = require('merge-stream');
const babelify = require('babelify');
const source = require('vinyl-source-stream');
const buffer = require('vinyl-buffer');
const browserify = require('browserify');
const fs = require('fs');
function js_minify() {
    return browserify({
        entries: ['assets/bootstrap_5/js/bootstrap_5.js']
    })
        .transform(babelify, {
            presets: ['@babel/preset-env'],
            retainLines: false,
            compact: false,
            global: true
        })
        .bundle()
        .pipe(source('assets/bootstrap_5/js/bootstrap_5.js'))
        .pipe(rename('bootstrap_5.js'))
        .pipe(buffer())
... (202 lines truncated)
</file>

<file path="index.php">
<?php
$system_path = "vendor/yiisoft/yii/framework";
$application_folder = dirname(__FILE__) . "/application";
if (realpath($system_path) !== false) {
    $system_path = realpath($system_path).'/';
}
$system_path = rtrim($system_path, '/').'/';
if (!is_dir($system_path)) {
    exit("Your system folder path does not appear to be set correctly. Please open the following file and correct this: ".pathinfo(__FILE__, PATHINFO_BASENAME));
}
define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME));
define('ROOT', dirname(__FILE__));
define('EXT', '.php');
define('BASEPATH', str_replace("\\", "/", $system_path));
// Path to the front controller (this file)
define('FCPATH', str_replace(SELF, '', __FILE__));
// Name of the "system folder"
define('SYSDIR', trim(strrchr(trim(BASEPATH, '/'), '/'), '/'));
if (is_dir($application_folder)) {
    define('APPPATH', $application_folder.'/');
} else {
    if (!is_dir(BASEPATH . $application_folder . '/')) {
        exit("Your application folder path does not appear to be set correctly. Please open the following file and correct this: ".SELF);
    }
    define('APPPATH', BASEPATH . $application_folder . '/');
}
include __DIR__ . '/setdebug.php';
if (version_compare(PHP_VERSION, '5.3.3', '<')) {
    die('This script can only be run on PHP version 5.3.3 or later! Your version: '.PHP_VERSION.'<br />');
}
... (7 lines truncated)
</file>

<file path="LICENSE">
LimeSurvey - The free & open-source survey software tool

  Copyright 2003 LimeSurvey Project Team / Carsten Schmitz

  This program is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 2 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program.  If not, see <http://www.gnu.org/licenses/>.

----------

                    GNU GENERAL PUBLIC LICENSE
                       Version 2, June 1991

 Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 Everyone is permitted to copy and distribute verbatim copies
 of this license document, but changing it is not allowed.

                            Preamble

  The licenses for most software are designed to take away your
... (945 lines truncated)
</file>

<file path="manifest.yml">
---
applications:
- name: limesurvey
  memory: 1G
  buildpack: php_buildpack
</file>

<file path="open-api-gen.php">
<?php
include_once './vendor/autoload.php';
use GoldSpecDigital\ObjectOrientedOAS\Objects\Info;
use GoldSpecDigital\ObjectOrientedOAS\Objects\MediaType;
use GoldSpecDigital\ObjectOrientedOAS\Objects\Example;
use GoldSpecDigital\ObjectOrientedOAS\Objects\Operation;
use GoldSpecDigital\ObjectOrientedOAS\Objects\PathItem;
use GoldSpecDigital\ObjectOrientedOAS\Objects\Parameter;
use GoldSpecDigital\ObjectOrientedOAS\Objects\Schema;
use GoldSpecDigital\ObjectOrientedOAS\Objects\RequestBody;
use GoldSpecDigital\ObjectOrientedOAS\Objects\Response;
use GoldSpecDigital\ObjectOrientedOAS\Objects\Components;
use GoldSpecDigital\ObjectOrientedOAS\Objects\SecurityScheme;
use GoldSpecDigital\ObjectOrientedOAS\Objects\SecurityRequirement;
use GoldSpecDigital\ObjectOrientedOAS\Objects\Response\Schema as ResponseSchema;
use GoldSpecDigital\ObjectOrientedOAS\Objects\Tag;
use GoldSpecDigital\ObjectOrientedOAS\OpenApi;
$versionNum = !empty($argv[1]) ? ltrim($argv[1], 'v') : '1';
$version = 'v' . $versionNum;
$rest = include_once(__DIR__ . '/application/config/rest/' . $version . '.php');
$outputFile = __DIR__ . '/docs/open-api/' . $version . '.json';
$apiConfig = isset($rest[$version]) ? $rest[$version] : [];
$info = Info::create()
    ->title(
        !empty($apiConfig['title'])
            ? $apiConfig['title']
            : 'Title'
    )
    ->version($versionNum)
    ->description(
... (237 lines truncated)
</file>

<file path="package.json">
{
  "devDependencies": {
    "@babel/core": "^7.21.4",
    "@babel/preset-env": "^7.21.4",
    "@popperjs/core": "^2.11.5",
    "autoprefixer": "^10.4.2",
    "babelify": "^10.0.0",
    "browserify": "^17.0.1",
    "cssnano": "^5.0.17",
    "gulp": "^5.0.1",
    "gulp-cli": "^3.1.0",
    "gulp-concat": "^2.6.1",
    "gulp-postcss": "^9.0.1",
    "gulp-rename": "^2.0.0",
    "gulp-replace": "^1.1.3",
    "gulp-rtlcss": "^2.0.0",
    "gulp-sass": "^5.1.0",
    "gulp-uglify": "^3.0.2",
    "merge-stream": "^2.0.0",
    "postcss": "^8.4.7",
    "sass": "~1.103.0",
    "vinyl-buffer": "^1.0.1",
    "vinyl-source-stream": "^2.0.0"
  },
  "dependencies": {
    "@eonasdan/tempus-dominus": "^6.9.11",
    "ace-builds": "^1.10.0",
    "bootstrap": "~5.1.3",
    "chart.js": "^4.4.7",
    "datatables.net-bs5": "^1.12.1",
... (30 lines truncated)
</file>

<file path="phpci.yml">
build_settings:
    clone_depth: 1
    verbose: false
    ignore:
        - "vendor"
        - "tests"
        - "tmp"
        - "framework"
        - "upload"
        - "docs"
        - "vendor"
        - "locale"
    mysql:
        host: "localhost"
        user: "root"
        pass: ""
setup:
#    mysql:
#        - "DROP DATABASE IF EXISTS test;"
#        - "CREATE DATABASE test;"
#        - "GRANT ALL PRIVILEGES ON test.* TO test@'localhost' IDENTIFIED BY 'test';"
#    composer:
#        action: "install"
test:
    php_mess_detector:
        allow_failures: false
        suffixes:
            - "php"
complete:
</file>

<file path="phpcs.ruleset.xml">
<?xml version="1.0"?>
<ruleset name="LimeSurveyPSR12">
    <rule ref="PSR12">
        <exclude name="PSR1.Classes.ClassDeclaration.MissingNamespace" />
        <exclude name="Generic.Files.LineLength"/>
    </rule>
    <rule ref="Generic.Files.ByteOrderMark"/>
</ruleset>
</file>

<file path="phpunit.xml">
<?xml version="1.0"?>
<phpunit
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    bootstrap="tests/bootstrap.php"
    stderr="true"
    colors="true"
    xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.6/phpunit.xsd"
    >
  <coverage processUncoveredFiles="true">
    <include>
      <directory suffix=".php">application/models/services</directory>
    </include>
    <report>
      <clover outputFile="cov.xml"/>
    </report>
  </coverage>
  <testsuites>
    <testsuite name="unit">
      <directory>tests/unit</directory>
    </testsuite>
    <testsuite name="functional">
      <directory>tests/functional</directory>
    </testsuite>
    <testsuite name="acceptance">
      <directory>tests/functional/acceptance</directory>
    </testsuite>
    <testsuite name="remotecontrolunit">
      <file>tests/unit/CsrfHttpRequestTest.php</file>
      <file>tests/unit/helpers/RemoteControlGetAvailableSiteSettingsTest.php</file>
      <file>tests/unit/helpers/RemoteControlGetUploadedFilesTest.php</file>
      <file>tests/unit/helpers/RemoteControlQuotaTest.php</file>
      <directory>tests/unit/helpers/remotecontrol</directory>
    </testsuite>
    <testsuite name="remotecontrolfunctional">
      <file>tests/functional/backend/RemoteControlJsonrpcTest.php</file>
      <file>tests/functional/backend/RemoteControlXmlrpcTest.php</file>
    </testsuite>
    <testsuite name="survey">
      <file>tests/functional/backend/AccessModeChangeTest.php</file>
      <file>tests/functional/backend/CreateSurveyTest.php</file>
      <file>tests/functional/backend/InstallationControllerTest.php</file>
    </testsuite>
    <testsuite name="question-a">
      <file>tests/functional/backend/SaveQuestionAttributesTest.php</file>
      <file>tests/functional/backend/QuestionThemeTest.php</file>
      <file>tests/functional/backend/LabelSetsCreateUpdate.php</file>
      <file>tests/functional/frontend/ArrayNumberCheckboxTest.php</file>
      <file>tests/functional/frontend/MultipleChoiceMandatoryWithCommentTest.php</file>
      <file>tests/functional/frontend/ListRadioOtherPositionTest.php</file>
      <file>tests/functional/frontend/MultipleChoiceWithExpressionTest.php</file>
      <file>tests/functional/frontend/RankingArrayFilterMaxColumnTest.php</file>
    </testsuite>
    <testsuite name="question-b">
      <file>tests/functional/backend/CreateQuestionTest.php</file>
      <file>tests/functional/backend/SaveDualScaleAnswerOptionsTest.php</file>
      <file>tests/functional/backend/QuestionGroupEditorTest.php</file>
      <file>tests/functional/backend/SaveSubquestionRelevanceTest.php</file>
      <file>tests/functional/backend/OldCodesReplacementTest.php</file>
      <file>tests/functional/backend/QuestionAttributeFunctionalTest.php</file>
      <file>tests/functional/frontend/MultipleChoiceNextPreviousTest.php</file>
      <file>tests/functional/frontend/RankingFilterHideShowTest.php</file>
      <file>tests/functional/frontend/AnswersAlphabeticalOrderTest.php</file>
    </testsuite>
    <testsuite name="expression">
      <file>tests/functional/frontend/AllInOneConditionGroupTest.php</file>
      <file>tests/functional/frontend/AutoCalcTest.php</file>
      <file>tests/functional/frontend/EmCacheSurveyTest.php</file>
      <file>tests/functional/frontend/GroupExpressionUpdateGoodQidTest.php</file>
      <file>tests/functional/frontend/IntvalFloatvalTest.php</file>
      <file>tests/functional/frontend/JsPhpCompareTest.php</file>
      <file>tests/functional/frontend/MinMaxCompareTest.php</file>
      <file>tests/functional/frontend/ScreenOutTest.php</file>
      <file>tests/functional/frontend/SelfExpressionTest.php</file>
      <file>tests/functional/acceptance/15246-fixed-em-function/FixedFunctionExpressionPluginTest.php</file>
      <file>tests/functional/acceptance/15532-em-warnings/ExpressionWarningsOnLogicTest.php</file>
    </testsuite>
    <testsuite name="validation">
      <file>tests/functional/frontend/DateTimeValidationTest.php</file>
      <file>tests/functional/frontend/MandatorySoftTest.php</file>
    </testsuite>
    <testsuite name="navigation">
      <file>tests/functional/acceptance/14782-override-translation/LSMessageSourceTest.php</file>
      <file>tests/functional/frontend/EndUrlRedirectTest.php</file>
      <file>tests/functional/frontend/GroupRandomizationTest.php</file>
      <file>tests/functional/frontend/LanguageChangerTest.php</file>
      <file>tests/functional/frontend/PreviewGroupAndQuestionTest.php</file>
      <file>tests/functional/frontend/ShortUrlTest.php</file>
      <file>tests/functional/frontend/SurveyIndexNavigationTest.php</file>
      <file>tests/functional/frontend/SurveyNavigationTest.php</file>
      <file>tests/functional/frontend/TimerMessagesEscapingTest.php</file>
      <file>tests/functional/frontend/TokenAttributeInDescriptionTest.php</file>
    </testsuite>
    <testsuite name="import-export">
      <file>tests/functional/backend/ImportExportIrrelevantTest.php</file>
      <file>tests/functional/backend/ImportResponsesTest.php</file>
      <file>tests/functional/backend/SaveEditedResponseTest.php</file>
    </testsuite>
    <testsuite name="theme">
      <file>tests/functional/backend/ThemeControllerTest.php</file>
    </testsuite>
    <testsuite name="admin">
      <file>tests/functional/backend/AdminViewsTest.php</file>
      <file>tests/functional/backend/NoGreenBarTest.php</file>
      <file>tests/functional/acceptance/18282-FailedEmail/FailedEmailTest.php</file>
      <file>tests/functional/frontend/ReactEditorWorksTest.php</file>
    </testsuite>
    <testsuite name="user">
      <file>tests/functional/backend/UserManagementTest.php</file>
      <file>tests/functional/acceptance/19201-user-status/UserStatusControllerTest.php</file>
      <file>tests/functional/acceptance/19201-user-status/UserStatusTest.php</file>
    </testsuite>
    <testsuite name="plugin">
      <file>tests/functional/backend/SettingsPluginTest.php</file>
      <file>tests/functional/frontend/AnswerOptionsFunctionsPluginTest.php</file>
      <file>tests/functional/frontend/VariableExpressionEndPluginTest.php</file>
    </testsuite>
    <testsuite name="security">
      <file>tests/functional/backend/XssAndScriptCheckTest.php</file>
      <file>tests/functional/backend/XssAndScriptForSuperadminCheckTest.php</file>
      <file>tests/functional/backend/GetGroupAndQuestionIdPermissionTest.php</file>
      <file>tests/functional/acceptance/15997-ip-anonymize/IpAddressAnonymizeTest.php</file>
    </testsuite>
    <testsuite name="api">
      <file>tests/functional/backend/LimesurveyApiTest.php</file>
      <file>tests/functional/backend/RemoteControlJsonrpcTest.php</file>
      <file>tests/functional/backend/RemoteControlXmlrpcTest.php</file>
    </testsuite>
  </testsuites>
  <logging/>
</phpunit>
</file>

<file path="psalm-all.xml">
<?xml version="1.0"?>
<psalm
    errorLevel="8"
    reportMixedIssues="false"
    useDocblockTypes="false"
    findUnusedBaselineEntry="false"
    findUnusedCode="false"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="https://getpsalm.org/schema/config"
    xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
    autoloader="tests/phpstan/phpstan_bootstrap.php"
>
    <issueHandlers>
        <UndefinedDocblockClass errorLevel="suppress" />
        <UndefinedClass errorLevel="suppress" />
        <EmptyArrayAccess errorLevel="suppress" />
        <UndefinedConstant errorLevel="suppress" />
        <ParadoxicalCondition errorLevel="suppress" />
        <InvalidStaticInvocation errorLevel="suppress" />
        <UndefinedGlobalVariable errorLevel="suppress" />
        <NoValue errorLevel="suppress" />
        <UnusedClass errorLevel="suppress" />
        <UnsupportedPropertyReferenceUsage errorLevel="suppress" />
        <MissingOverrideAttribute errorLevel="suppress" />
    </issueHandlers>
    <projectFiles>
        <directory name="application/" />
        <ignoreFiles>
            <directory name="vendor" />
            <directory name="assets/packages/pchart" />
... (20 lines truncated)
</file>

<file path="psalm-strict.xml">
<?xml version="1.0"?>
<psalm
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="https://getpsalm.org/schema/config"
    xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
    autoloader="tests/phpstan/phpstan_bootstrap.php"
>
    <issueHandlers>
        <RiskyTruthyFalsyComparison errorLevel="suppress" />
        <UnsupportedReferenceUsage errorLevel="suppress" />
        <UnsupportedPropertyReferenceUsage errorLevel="suppress" />
        <UndefinedMagicPropertyAssignment errorLevel="suppress" />
        <MissingClassConstType errorLevel="suppress" />
    </issueHandlers>
    <projectFiles>
        <file name="application/models/FailedEmail.php" />
        <file name="application/controllers/FailedEmailController.php" />
        <file name="application/controllers/RestController.php" />
        <file name="application/models/services/SurveyPermissions.php" />
        <file name="application/extensions/AlertWidget/AlertWidget.php" />
        <file name="application/extensions/BreadcrumbWidget/BreadcrumbWidget.php" />
        <file name="application/controllers/AjaxAlertController.php" />
        <directory name="application/libraries/FormExtension" />
        <directory name="application/libraries/Api" />
        <ignoreFiles>
            <directory name="vendor" />
        </ignoreFiles>
    </projectFiles>
</psalm>
</file>

<file path="psalm.xml">
<?xml version="1.0"?>
<psalm
    errorLevel="5"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="https://getpsalm.org/schema/config"
    xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
    autoloader="tests/phpstan/phpstan_bootstrap.php"
>
    <issueHandlers>
        <InvalidArgument errorLevel="suppress" />
        <InvalidPropertyFetch errorLevel="suppress" />
        <InvalidArrayOffset errorLevel="suppress" />
        <PossiblyUnusedMethod errorLevel="suppress" />
        <PossiblyUnusedParam errorLevel="suppress" />
    </issueHandlers>
    <projectFiles>
        <directory name="application/datavalueobjects" />
        <directory name="application/models/services" />
        <directory name="application/libraries/ExtensionInstaller" />
        <directory name="application/helpers/update/updates" />
        <directory name="application/core/plugins/ExpressionAnswerOptions" />
        <directory name="application/commands" />
        <file name="application/models/QuestionAttribute.php" />
        <file name="application/libraries/PluginManager/LimesurveyApi.php" />
        <file name="application/models/ArchivedTableSettings.php" />
        <file name="application/helpers/update/updatedb_helper.php" />
        <ignoreFiles>
            <directory name="vendor" />
        </ignoreFiles>
    </projectFiles>
... (2 lines truncated)
</file>

<file path="publiccode.yml">
publiccodeYmlVersion: 0.5.0
name: LimeSurvey
url: https://github.com/LimeSurvey/LimeSurvey
logo: https://www.limesurvey.org/images/2022/logo_limesurvey_eu.svg
platforms:
  - web
categories:
  - survey
  - data-collection
  - data-analytics
  - data-visualization
organisation:
  uri: https://www.limesurvey.org
  name: LimeSurvey GmbH
fundedBy:
  - name: LimeSurvey GmbH
    uri: https://www.limesurvey.org
roadmap: https://www.limesurvey.org/manual/LimeSurvey_roadmap
developmentStatus: stable
softwareType: standalone/web
description:
  en:
    localisedName: LimeSurvey
    shortDescription: LimeSurvey is an open‑source web app for creating, publishing,
      and analyzing online surveys with multilingual support and advanced logic.
    longDescription: LimeSurvey is an open‑source web application that enables
      organizations to design, publish, and manage online surveys of any
      complexity. It supports more than 30 question types, advanced conditional
      logic, and fully customizable templates, allowing public institutions to
      create structured questionnaires tailored to diverse research and feedback
... (59 lines truncated)
</file>

<file path="README.md">
<div id="top"></div>
<p align="center">
<img src="https://www.limesurvey.org/images/limesurvey/svg/logo_limesurvey_head.svg" width="400" alt='LimeSurvey Logo' />
</p>

# LimeSurvey: The world’s #1 open-source survey platform 
It's what we love and do best since 2006...

🌐 [Website](https://www.limesurvey.org) · 🔮 [Demo](https://demo.limesurvey.org/admin) · 📚 [Documentation](https://www.limesurvey.org/manual) · ⚙️ [Request a feature](https://bugs.limesurvey.org) · 🐛 [Report a bug](https://bugs.limesurvey.org) · 🗨️ [Forums](https://forums.limesurvey.org) · 🗨️ [Discord](https://discord.gg/DEjguXn)

[LimeSurvey](https://www.limesurvey.org) is a free and open-source online survey platform used by businesses of all sizes, professionals, academic institutions, teachers, students, governments, financial institutes, and [Anja](https://www.linkedin.com/in/anja-meinders-ba3b29213/) from HR (who is hiring and looking for a **DevOps** and **Technical Support Engineer/Developer**  – [drop her a Lime…](https://www.linkedin.com/in/anja-meinders-ba3b29213/)) in 80+ countries worldwide. It offers features like conditional logic, question branching, customizable templates, multilingual support, and GDPR compliance.

## 🌟 Why LimeSurvey?

LimeSurvey is perfect for you if you are...

- 📊 Gathering feedback from customers, employees, or stakeholders
- 🎓 Conducting academic research or field studies
- 🌍 Running multilingual surveys for global audiences
- 🔐 Prioritizing privacy and GDPR compliance in data collection
- 🛠 Needing customizable, flexible survey platform for various projects
- 🚀 Scaling surveys for startups, mid-sized businesses, or large organizations
- 🎯 Looking for an open-source solution with no vendor lock-in

## 🚀 Features

- ✅ **Unlimited surveys**
- ✅ **Unlimited questions**
- ✅ **30+ question types**
- ✅ **900+ survey templates**
... (58 lines truncated)
</file>

<file path="SECURITY.md">
# Security Policy

We take the security of LimeSurvey seriously and welcome reports from security researchers, users, and the community.

## Reporting a Vulnerability

If your report concerns an issue with any of the LimeSurvey websites (https://*.limesurvey.org) or LimeSurvey Cloud, please contact support@limesurvey.org.

For LimeSurvey Community Edition (CE), please report (suspected) security vulnerabilities by creating a bug report on https://bugs.limesurvey.org (you might need to register an account there first) and marking it as severity **security** and/or category **Security**. 
This is necessary to ensure proper reaction time.

Please do not disclose the issue publicly until we have had the opportunity to investigate and, where applicable, release a fix.

To help us triage your report as quickly as possible, please include where you can:

- A description of the vulnerability and its potential impact
- If the vulnerability is exploited, already.
- Steps to reproduce, or a proof-of-concept
- The affected LimeSurvey version(s) and edition (Community/Cloud)

## What to Expect From Us

- **Acknowledgement:** You will receive a response from us within 48 hours.
- **Triage and severity assessment:** Once we confirm the issue, we assess and assign it a severity rating (based on CVSS).
- **Remediation:** We aim to release a fix as soon as possible depending on complexity — historically within a few days for confirmed, high-severity issues.
- **Coordinated disclosure:** We ask that you do not publicly disclose the vulnerability until a fix is available, or for 90 days after your report, whichever comes first — unless we agree on a different timeline together.
- **Public disclosure of fixes:** Once a fix is released, we publish a security advisory describing the vulnerability, its severity, and the affected and fixed versions at [link to changelog / security advisories page].

## CVE Identifiers

... (31 lines truncated)
</file>

<file path="setdebug.php">
<?php
if (!defined('BASEPATH')) {
    http_response_code(403);
    exit('No direct script access allowed');
}
if (!defined('YII_DEBUG')) {
    if (file_exists(APPPATH . 'config' . DIRECTORY_SEPARATOR . 'config.php')) {
        $settings = include(APPPATH . 'config' . DIRECTORY_SEPARATOR . 'config.php');
    } else {
        $settings = [];
    }
    if (isset($settings['config']['debug'])) {
        $effectiveDebug = (int) $settings['config']['debug'];
        $envDebug = getenv('LS_DEBUG');
        if ($envDebug !== false && preg_match('/^[0-2]$/', (string) $envDebug)) {
            $effectiveDebug = min($effectiveDebug, (int) $envDebug);
        }
        if ($effectiveDebug > 0) {
            @ini_set("display_errors", 1);
            define('YII_DEBUG', true);
            if ($effectiveDebug > 1) {
                error_reporting(E_ALL);
                @ini_set('zend.assertions', 1);
            } else {
                error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);
            }
        } else {
            @ini_set("display_errors", 0);
            define('YII_DEBUG', false);
            error_reporting(0);
... (7 lines truncated)
</file>

</files>
