<div class="modal-content" data-test-modal="edit-posts-access" {{did-insert this.setup}}>
    <header class="modal-header">
        <h1>Change {{concat @data.type}} access {{unless @data.selectionList.isSingle (concat 'for ' @data.selectionList.count ' ' @data.type 's')}}</h1>
    </header>
    <button type="button" class="close" title="Close" {{on "click" (fn @close false)}} data-test-button="close">{{svg-jar "close"}}<span class="hidden">Close</span></button>

    <div class="modal-body mb9">
        <GhFormGroup @errors={{this.post.errors}} @hasValidated={{this.post.hasValidated}} @property="visibility">
            <GhPsmVisibilityInput @post={{this.post}} @triggerId="visibility-input" />
        </GhFormGroup>

        {{#if (eq this.post.visibility "tiers")}}
            <GhFormGroup @errors={{this.post.errors}} @hasValidated={{this.post.hasValidated}} @property="tiers" class="nt3" data-test-visibility-segment-select>
                <GhPostSettingsMenu::VisibilitySegmentSelect
                    @tiers={{this.post.tiers}}
                    @onChange={{this.setVisibility}}
                    @renderInPlace={{true}}
                    @hideOptionsWhenAllSelected={{true}}
                />
                <GhErrorMessage @errors={{this.post.errors}} @property="tiers" data-test-error="tiers" />
            </GhFormGroup>
        {{/if}}

    </div>

    <div class="modal-footer">
        <button class="gh-btn" data-test-button="cancel" type="button" {{on "click" (fn @close false)}}><span>Cancel</span></button>

        <GhTaskButton
            @buttonText="Save"
            @runningText="Saving"
            @showSuccess={{false}}
            @task={{this.save}}
            @class="gh-btn gh-btn-icon gh-btn-black"
            data-test-button="confirm"
        />
    </div>
</div>
