<commit_before>import $ from 'jquery'
import loadingImg from './loadingImg'
import * as u from './util'
import * as Bacon from 'baconjs'
import { invalidImageSelector } from './util'

const SCREENSHOT_LIMIT_ERROR = () => new Bacon.Error('Screenshot limit reached!')
const fileTypes = ['image/png', 'image/jpeg']

export function onPaste(e, saver, onValueChanged, limit) {
    const clipboardData = e.originalEvent.clipboardData
    const file = clipboardData.items && clipboardData.items.length > 0 && clipboardData.items[0].getAsFile()<commit_msg>Fix clipboard screenshot not as first item<commit_after>import $ from 'jquery'
import loadingImg from './loadingImg'
import * as u from './util'
import * as Bacon from 'baconjs'
import { invalidImageSelector } from './util'

const SCREENSHOT_LIMIT_ERROR = () => new Bacon.Error('Screenshot limit reached!')
const fileTypes = ['image/png', 'image/jpeg']

export function onPaste(e, saver, onValueChanged, limit) {
    const clipboardData = e.originalEvent.clipboardData
    const file =
        clipboardData.items &&
        clipboardData.items.length > 0 &&
        clipboardData.items[clipboardData.items.length - 1].getAsFile()
{'fraction_non_alphanumeric': 0.11969439728353141, 'fraction_numerical': 0.003395585738539898, 'mean_word_length': 4.668269230769231, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6491626', 'n_tokens_mistral': 362, 'n_tokens_neox': 351, 'n_words': 98}