module Pages.Arguments exposing (Model, Msg, page)

import Config.Colour as T exposing (..)
import Config.Format as O exposing (..)
import Config.Identity as I exposing (..)
import Debate.Arguments.Medicine.ApoBCVD exposing (..)
import Debate.Arguments.Nutrition.AnabolicKeto exposing (..)
import Debate.Arguments.Nutrition.AntagonisticPleiotropy exposing (..)
import Debate.Arguments.Nutrition.CarbsObesity exposing (..)
import Debate.Arguments.Nutrition.DietaryCholesterol exposing (..)
import Debate.Arguments.Nutrition.FructoseNAFLD exposing (..)
import Debate.Arguments.Nutrition.HealthPromotingFoods exposing (..)
import Debate.Arguments.Nutrition.HealthSeeker exposing (..)
import Debate.Arguments.Nutrition.HealthyChocolate exposing (..)
import Debate.Arguments.Nutrition.HealthyDairy exposing (..)
import Debate.Arguments.Nutrition.HealthyFattyFish exposing (..)
import Debate.Arguments.Nutrition.HealthyFibre exposing (..)
import Debate.Arguments.Nutrition.HealthyFood exposing (..)
import Debate.Arguments.Nutrition.HealthyPlantFoods exposing (..)
import Debate.Arguments.Nutrition.HealthySeedOils exposing (..)
import Debate.Arguments.Nutrition.HealthySoy exposing (..)
import Debate.Arguments.Nutrition.Malondialdehyde exposing (..)
import Debate.Arguments.Nutrition.Omega3Omega6Ratio exposing (..)
import Debate.Arguments.Nutrition.PlantBasedCVDReversal exposing (..)
import Debate.Arguments.Nutrition.PolyphenolReductio exposing (..)
import Debate.Arguments.Nutrition.SodiumCVD exposing (..)
import Debate.Arguments.Nutrition.TMAOCausality exposing (..)
import Debate.Arguments.Nutrition.UnhealthyCoconutOil exposing (..)
import Debate.Arguments.Nutrition.UnhealthyProcessedMeat exposing (..)
import Debate.Arguments.Nutrition.UnhealthyRedMeat exposing (..)
import Debate.Arguments.Nutrition.UnhealthySaturatedFat exposing (..)
import Debate.Arguments.Philosophy.Abortion exposing (..)
import Debate.Arguments.Philosophy.Agnosticism exposing (..)
import Debate.Arguments.Philosophy.AgriculturalPredation exposing (..)
import Debate.Arguments.Philosophy.AnimalRights exposing (..)
import Debate.Arguments.Philosophy.AntiRewilding exposing (..)
import Debate.Arguments.Philosophy.AntiVandalism exposing (..)
import Debate.Arguments.Philosophy.ColonizingNature exposing (..)
import Debate.Arguments.Philosophy.CropDeaths exposing (..)
import Debate.Arguments.Philosophy.DairyCowRape exposing (..)
import Debate.Arguments.Philosophy.EfilismPatrolSquad exposing (..)
import Debate.Arguments.Philosophy.EthicalSlurs exposing (..)
import Debate.Arguments.Philosophy.FineTuning exposing (..)
import Debate.Arguments.Philosophy.ImmortalityReductio exposing (..)
import Debate.Arguments.Philosophy.OddOrderPredators exposing (..)
import Debate.Arguments.Philosophy.Ostroveganism exposing (..)
import Debate.Arguments.Philosophy.PollinationReductio exposing (..)
import Debate.Arguments.Philosophy.ScratcherPioneers exposing (..)
import Debate.Arguments.Philosophy.TransPeople exposing (..)
import Debate.Arguments.Philosophy.VeganSocietyReductio exposing (..)
import Debate.Arguments.Politics.BoobyTrapPagers exposing (..)
import Debate.Arguments.Science.EpidemiologyCausality exposing (..)
import Debate.Arguments.Science.FlatEarthDebunk exposing (..)
import Debate.Arguments.Science.TruncatedMeta exposing (..)
import Debate.Helpers exposing (..)
import Effect exposing (Effect)
import Element exposing (..)
import Element.Border as D exposing (..)
import Element.Font as F
import Html
import Html.Attributes as H exposing (style, title, wrap)
import Layouts
import Page exposing (Page)
import Route exposing (Route)
import Shared
import View exposing (View)


page : Shared.Model -> Route () -> Page Model Msg
page shared route =
    Page.new
        { init = init
        , update = update
        , subscriptions = subscriptions
        , view = view
        }
        |> Page.withLayout toLayout


toLayout : Model -> Layouts.Layout Msg
toLayout model =
    Layouts.Navbar {}



-- INIT


type alias Model =
    {}


init : () -> ( Model, Effect Msg )
init () =
    ( {}
    , Effect.none
    )



-- UPDATE


type Msg
    = NoOp


update : Msg -> Model -> ( Model, Effect Msg )
update msg model =
    case msg of
        NoOp ->
            ( model
            , Effect.none
            )



-- SUBSCRIPTIONS


subscriptions : Model -> Sub Msg
subscriptions model =
    Sub.none



-- VIEW


view : Model -> View Msg
view model =
    { title = debateName
    , attributes = []
    , element = debateContainer
    }


debateContainer : Element msg
debateContainer =
    topLevelContainer debateList


debateList : Element msg
debateList =
    column
        pageList
    <|
        List.map
            (\category ->
                column [ spacing 20 ]
                    [ el (nonHighlightedTitleFormat ++ [ centerX ]) (text category.categoryName)
                    , column [] (List.map argumentMaker category.arguments)
                    ]
            )
            [ { categoryName = "Medicine"
              , arguments =
                    [ argumentApoBCVD
                    ]
              }
            , { categoryName = "Nutrition"
              , arguments =
                    [ argumentAnabolicKeto
                    , argumentAntagonisticPleiotropy
                    , argumentCarbsObesity
                    , argumentDietaryCholesterol
                    , argumentFructoseNAFLD
                    , argumentHealthPromotingFoods
                    , argumentHealthSeeker
                    , argumentHealthyChocolate
                    , argumentHealthyDairy
                    , argumentHealthyFattyFish
                    , argumentHealthyFibre
                    , argumentHealthyFood
                    , argumentHealthyPlantFoods
                    , argumentHealthySeedOils
                    , argumentHealthySoy
                    , argumentMalondialdehyde
                    , argumentOmega3Omega6Ratio
                    , argumentPlantBasedCVDReversal
                    , argumentPolyphenolReductio
                    , argumentSodiumCVD
                    , argumentTMAOCausality
                    , argumentUnhealthyCoconutOil
                    , argumentUnhealthyProcessedMeat
                    , argumentUnhealthyRedMeat
                    , argumentUnhealthySaturatedFat
                    ]
              }
            , { categoryName = "Philosophy"
              , arguments =
                    [ argumentAbortion
                    , argumentAgnosticism
                    , argumentAgriculturalPredation
                    , argumentAnimalRights
                    , argumentAntiRewilding
                    , argumentAntiVandalism
                    , argumentColonizingNature
                    , argumentCropDeaths
                    , argumentDairyCowRape
                    , argumentEfilismPatrolSquad
                    , argumentEthicalSlurs
                    , argumentFineTuning
                    , argumentImmortalityReductio
                    , argumentOddOrderPredators
                    , argumentOstroveganism
                    , argumentPollinationReductio
                    , argumentScratcherPioneers
                    , argumentTransPeople
                    , argumentVeganSocietyReductio
                    ]
              }
            , { categoryName = "Politics"
              , arguments =
                    [ argumentBoobyTrapPagers
                    ]
              }
            , { categoryName = "Science"
              , arguments =
                    [ argumentEpidemiologyCausality
                    , argumentFlatEarthDebunk
                    , argumentTruncatedMeta
                    ]
              }
            ]
