// Generated by purs version 0.14.5
"use strict";
var $foreign = require("./foreign.js");
var Data_Function_Uncurried = require("../Data.Function.Uncurried/index.js");
var Data_Functor = require("../Data.Functor/index.js");
var Data_Maybe = require("../Data.Maybe/index.js");
var Data_Nullable = require("../Data.Nullable/index.js");
var Data_Ordering = require("../Data.Ordering/index.js");
var Text = (function () {
    function Text() {

    };
    Text.value = new Text();
    return Text;
})();
var File = (function () {
    function File() {

    };
    File.value = new File();
    return File;
})();
var showDataTransferItemKind = {
    show: function (v) {
        if (v instanceof Text) {
            return "Text";
        };
        if (v instanceof File) {
            return "File";
        };
        throw new Error("Failed pattern match at Web.HTML.Event.DataTransfer.DataTransferItem (line 25, column 10 - line 27, column 19): " + [ v.constructor.name ]);
    }
};
var eqDataTransferItemKind = {
    eq: function (x) {
        return function (y) {
            if (x instanceof Text && y instanceof Text) {
                return true;
            };
            if (x instanceof File && y instanceof File) {
                return true;
            };
            return false;
        };
    }
};
var ordDataTransferItemKind = {
    compare: function (x) {
        return function (y) {
            if (x instanceof Text && y instanceof Text) {
                return Data_Ordering.EQ.value;
            };
            if (x instanceof Text) {
                return Data_Ordering.LT.value;
            };
            if (y instanceof Text) {
                return Data_Ordering.GT.value;
            };
            if (x instanceof File && y instanceof File) {
                return Data_Ordering.EQ.value;
            };
            throw new Error("Failed pattern match at Web.HTML.Event.DataTransfer.DataTransferItem (line 22, column 1 - line 22, column 41): " + [ x.constructor.name, y.constructor.name ]);
        };
    },
    Eq0: function () {
        return eqDataTransferItemKind;
    }
};
var length = $foreign["_length"];
var kind = Data_Function_Uncurried.runFn5($foreign["_kind"])(Data_Maybe.Nothing.value)(Data_Maybe.Just.create)(Text.value)(File.value);
var dataTransferItem = Data_Functor.map(Data_Functor.functorFn)(Data_Functor.map(Data_Functor.functorFn)(Data_Nullable.toMaybe))($foreign["_dataTransferItem"]);
module.exports = {
    Text: Text,
    File: File,
    dataTransferItem: dataTransferItem,
    kind: kind,
    length: length,
    eqDataTransferItemKind: eqDataTransferItemKind,
    ordDataTransferItemKind: ordDataTransferItemKind,
    showDataTransferItemKind: showDataTransferItemKind,
    type_: $foreign.type_
};
