local ____lualib = require("lualib_bundle")
local Map = ____lualib.Map
local __TS__New = ____lualib.__TS__New
local __TS__Class = ____lualib.__TS__Class
local __TS__ClassExtends = ____lualib.__TS__ClassExtends
local ____exports = {}
local ____cachedEnumValues = require("arrays.cachedEnumValues")
local PLAYER_FORM_VALUES = ____cachedEnumValues.PLAYER_FORM_VALUES
local ____ModCallbackCustom = require("enums.ModCallbackCustom")
local ModCallbackCustom = ____ModCallbackCustom.ModCallbackCustom
local ____playerDataStructures = require("functions.playerDataStructures")
local defaultMapGetPlayer = ____playerDataStructures.defaultMapGetPlayer
local ____DefaultMap = require("classes.DefaultMap")
local DefaultMap = ____DefaultMap.DefaultMap
local ____CustomCallback = require("classes.private.CustomCallback")
local CustomCallback = ____CustomCallback.CustomCallback
local v = {run = {playersTransformationsMap = __TS__New(
    DefaultMap,
    function() return __TS__New(Map) end
)}}
____exports.PostTransformation = __TS__Class()
local PostTransformation = ____exports.PostTransformation
PostTransformation.name = "PostTransformation"
__TS__ClassExtends(PostTransformation, CustomCallback)
function PostTransformation.prototype.____constructor(self)
    CustomCallback.prototype.____constructor(self)
    self.v = v
    self.shouldFire = function(____, fireArgs, optionalArgs)
        local _player, playerForm = table.unpack(fireArgs)
        local callbackPlayerForm = table.unpack(optionalArgs)
        return callbackPlayerForm == nil or callbackPlayerForm == playerForm
    end
    self.postPEffectUpdateReordered = function(____, player)
        local playerTransformationsMap = defaultMapGetPlayer(nil, v.run.playersTransformationsMap, player)
        for ____, playerForm in ipairs(PLAYER_FORM_VALUES) do
            local hasForm = player:HasPlayerForm(playerForm)
            local storedForm = playerTransformationsMap:get(playerForm)
            if storedForm == nil then
                storedForm = false
            end
            if hasForm ~= storedForm then
                playerTransformationsMap:set(playerForm, hasForm)
                self:fire(player, playerForm, hasForm)
            end
        end
    end
    self.customCallbacksUsed = {{ModCallbackCustom.POST_PEFFECT_UPDATE_REORDERED, self.postPEffectUpdateReordered}}
end
return ____exports
