<commit_before><main class="container">
    <h1>Add Preprint</h1>

    {{#cp-panels accordion=true}}
        {{#with _names.[0] as |name|}}
            {{#preprint-form-section id='preprint-form-upload' open=true name=name allowOpen=true errorAction=(action 'error')}}
                {{preprint-form-header name=name valid=uploadValid}}
                {{#preprint-form-body}}
                    {{#liquid-bind filePickerState class='translate' as |currentState|}}
                        <div class={{currentState}}>
                            {{#if (eq currentState _State.START)}}
                                <button class="col-md-4" {{action 'changeState' _State.NEW}}>Upload a New File</button>
                                <button class="col-md-4" {{action 'changeState' _State.EXISTING}}>Select a file from OSF</button>

                            {{else if (eq currentState _State.NEW)}}
                                {{file-uploader
                                    node=node
                                    userNodes=userNodes
                                    osfFile=selectedFile
                                    changeState=(action 'changeState')}}

                            {{else if (eq currentState _State.EXISTING)}}
                                {{preprint-form-project-select
                                  userNodes=userNodes
                                  fileSelect=true
                                  selectedNode=node
                                  selectedFile=selectedFile
                                  selectFile=(action "selectExistingFile")
                                  highlightSuccessOrFailure=(action 'highlightSuccessOrFailure')
                                  shouldCreateChild=shouldCreateChild}}
                                {{! TODO: cleanup created component if needed }}
                                <button class="btn btn-default" {{action 'changeState' _State.START}}>Back</button>
                                {{! TODO: check if project and file are selected before allowing user to continue }}
                                <button class="btn btn-primary" disabled={{unless node true}} {{action (if shouldCreateChild 'addChild' 'next') name}}>Next</button>
                            {{else}}
                                {{log 'preprint-form-upload: bad state'}}<commit_msg>File must be selected before next button is visible.<commit_after><main class="container">
    <h1>Add Preprint</h1>

    {{#cp-panels accordion=true}}
        {{#with _names.[0] as |name|}}
            {{#preprint-form-section id='preprint-form-upload' open=true name=name allowOpen=true errorAction=(action 'error')}}
                {{preprint-form-header name=name valid=uploadValid}}
                {{#preprint-form-body}}
                    {{#liquid-bind filePickerState class='translate' as |currentState|}}
                        <div class={{currentState}}>
                            {{#if (eq currentState _State.START)}}
                                <button class="col-md-4" {{action 'changeState' _State.NEW}}>Upload a New File</button>
                                <button class="col-md-4" {{action 'changeState' _State.EXISTING}}>Select a file from OSF</button>

                            {{else if (eq currentState _State.NEW)}}
                                {{file-uploader
                                    node=node
                                    userNodes=userNodes
                                    osfFile=selectedFile
                                    changeState=(action 'changeState')}}

                            {{else if (eq currentState _State.EXISTING)}}
                                {{preprint-form-project-select
                                  userNodes=userNodes
                                  fileSelect=true
                                  selectedNode=node
                                  selectedFile=selectedFile
                                  selectFile=(action "selectExistingFile")
                                  highlightSuccessOrFailure=(action 'highlightSuccessOrFailure')
                                  shouldCreateChild=shouldCreateChild}}
                                {{! TODO: cleanup created component if needed }}
                                <button class="btn btn-default" {{action 'changeState' _State.START}}>Back</button>
                                {{! TODO: check if project and file are selected before allowing user to continue }}
                                <button class="btn btn-primary" disabled={{unless (and node selectedFile) true}} {{action (if shouldCreateChild 'addChild' 'next') name}}>Next</button>
                            {{else}}
                                {{log 'preprint-form-upload: bad state'}}
{'fraction_non_alphanumeric': 0.09958592132505176, 'fraction_numerical': 0.002070393374741201, 'mean_word_length': 1.3026692087702574, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 26, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5361241', 'n_tokens_mistral': 1098, 'n_tokens_neox': 1039, 'n_words': 243}