@file:Suppress("UNCHECKED_CAST", "USELESS_CAST", "INAPPLICABLE_JVM_NAME", "UNUSED_ANONYMOUS_PARAMETER", "SENSELESS_COMPARISON", "NAME_SHADOWING", "UNNECESSARY_NOT_NULL_ASSERTION")
package uni.UNIHelloUniAppX
import io.dcloud.uniapp.*
import io.dcloud.uniapp.extapi.*
import io.dcloud.uniapp.framework.*
import io.dcloud.uniapp.runtime.*
import io.dcloud.uniapp.vue.*
import io.dcloud.uniapp.vue.shared.*
import io.dcloud.unicloud.*
import io.dcloud.uts.*
import io.dcloud.uts.Map
import io.dcloud.uts.Set
import io.dcloud.uts.UTSAndroid
import kotlin.properties.Delegates
open class GenUniModulesUniCollapseComponentsUniCollapseItemUniCollapseItem : VueComponent {
    constructor(__ins: ComponentInternalInstance) : super(__ins) {}
    open var title: String by `$props`
    open var open: Boolean by `$props`
    open var disabled: Boolean by `$props`
    open var titleWrapClass: Any? by `$props`
    open var titleClass: Any? by `$props`
    open var titleOpenClass: Any? by `$props`
    open var titleDisabledClass: Any? by `$props`
    open var arrowClass: Any? by `$props`
    open var arrowOpenClass: Any? by `$props`
    open var arrowDisabledClass: Any? by `$props`
    open var is_open: Boolean
        get() {
            return unref(this.`$exposed`["is_open"]) as Boolean
        }
        set(value) {
            setRefValue(this.`$exposed`, "is_open", value)
        }
    open var openOrClose: (open: Boolean) -> Unit
        get() {
            return unref(this.`$exposed`["openOrClose"]) as (open: Boolean) -> Unit
        }
        set(value) {
            setRefValue(this.`$exposed`, "openOrClose", value)
        }
    open var openCollapse: (open: Boolean) -> Unit
        get() {
            return unref(this.`$exposed`["openCollapse"]) as (open: Boolean) -> Unit
        }
        set(value) {
            setRefValue(this.`$exposed`, "openCollapse", value)
        }
    companion object {
        @Suppress("UNUSED_PARAMETER", "UNUSED_VARIABLE")
        var setup: (__props: GenUniModulesUniCollapseComponentsUniCollapseItemUniCollapseItem, __setupCtx: SetupContext) -> Any? = fun(__props, __setupCtx): Any? {
            val __expose = __setupCtx.expose
            val __ins = getCurrentInstance()!!
            val _ctx = __ins.proxy as GenUniModulesUniCollapseComponentsUniCollapseItemUniCollapseItem
            val _cache = __ins.renderCache
            val props = __props
            fun emit(event: String, vararg do_not_transform_spread: Any?) {
                __ins.emit(event, *do_not_transform_spread)
            }
            var is_open = ref<Boolean>(props.open)
            var box_is_open = ref<Boolean>(props.open)
            var transition_enabled = ref<Boolean>(false)
            var contentWrapRef = ref<UniViewElement?>(null)
            var contentRef = ref<UniViewElement?>(null)
            val elId = ref("uni_collapse_item_" + Math.ceil(Math.random() * 10e5).toString(36))
            val contentTransitionDelay: Number = 16
            var enableTransitionTimer: Number = 0
            var isAndroidArrowRenderFix = false
            isAndroidArrowRenderFix = true
            val registerChild = inject<((child: ItemChildType) -> Unit)?>(UNI_COLLAPSE_REGISTER_CHILD, null)
            val unregisterChild = inject<((elId: String) -> Unit)?>(UNI_COLLAPSE_UNREGISTER_CHILD, null)
            val collapseToggle = inject<((elId: String) -> Unit)?>(UNI_COLLAPSE_CHILD_TOGGLE, null)
            val arrowPlatformClass = computed(fun(): String {
                return if (isAndroidArrowRenderFix) {
                    "down_arrow--android-fix"
                } else {
                    ""
                }
            }
            )
            val isDarkMode = computed(fun(): Boolean {
                return state.isDarkMode
            }
            )
            val arrowStateClass = computed(fun(): String {
                if (!is_open.value) {
                    return ""
                }
                return if (isAndroidArrowRenderFix) {
                    "down_arrow--android-active"
                } else {
                    "down_arrow--active"
                }
            }
            )
            val arrowDisabledClass = computed(fun(): String {
                return if (props.disabled) {
                    "down_arrow--disabled"
                } else {
                    ""
                }
            }
            )
            fun gen_clearEnableTransitionTimer_fn() {
                if (enableTransitionTimer != 0) {
                    clearTimeout(enableTransitionTimer)
                    enableTransitionTimer = 0
                }
            }
            val clearEnableTransitionTimer = ::gen_clearEnableTransitionTimer_fn
            fun gen_openOrClose_fn(open: Boolean) {
                box_is_open.value = open
            }
            val openOrClose = ::gen_openOrClose_fn
            fun gen_applyOpenState_fn(open: Boolean, syncSiblings: Boolean, triggerEmit: Boolean) {
                if (is_open.value == open && box_is_open.value == open) {
                    return
                }
                if (open && syncSiblings && collapseToggle != null) {
                    collapseToggle(elId.value)
                }
                is_open.value = open
                openOrClose(open)
                if (triggerEmit) {
                    emit("change", open)
                }
            }
            val applyOpenState = ::gen_applyOpenState_fn
            fun gen_openCollapse_fn(open: Boolean) {
                if (props.disabled) {
                    return
                }
                applyOpenState(open, true, true)
            }
            val openCollapse = ::gen_openCollapse_fn
            onMounted(fun(){
                if (registerChild != null) {
                    val child = ItemChildType(is_open = is_open, elId = elId.value, openOrClose = openOrClose)
                    registerChild(child)
                }
                if (is_open.value && collapseToggle != null) {
                    collapseToggle(elId.value)
                }
                nextTick(fun(){
                    enableTransitionTimer = setTimeout(fun(){
                        enableTransitionTimer = 0
                        transition_enabled.value = true
                    }
                    , contentTransitionDelay)
                }
                )
            }
            )
            onUnmounted(fun(){
                clearEnableTransitionTimer()
                if (unregisterChild != null) {
                    unregisterChild(elId.value)
                }
            }
            )
            watch(fun(): Boolean {
                return props.open
            }
            , fun(value: Boolean){
                applyOpenState(value, false, false)
            }
            )
            __expose(_uM("is_open" to is_open, "openOrClose" to openOrClose, "openCollapse" to openCollapse))
            return fun(): Any? {
                return _cE("view", _uM("class" to _nC(_uA(
                    "uni-collapse-item-root",
                    if (unref(isDarkMode)) {
                        "theme-dark"
                    } else {
                        "theme-light"
                    }
                ))), _uA(
                    _cE("view", _uM("class" to _nC(_uA(
                        "uni-collapse-item__title",
                        props.titleWrapClass
                    )), "onClick" to fun(){
                        openCollapse(!unref(is_open))
                    }
                    ), _uA(
                        _cE("view", _uM("class" to "uni-collapse-item__title-main"), _uA(
                            renderSlot(_ctx.`$slots`, "title", GenUniModulesUniCollapseComponentsUniCollapseItemUniCollapseItemSlotDataTitle(open = unref(is_open), disabled = props.disabled), fun(): UTSArray<Any> {
                                return _uA(
                                    _cE("text", _uM("class" to _nC(_uA(
                                        "uni-collapse-item__title-text",
                                        _uA(
                                            _uM("open--active" to unref(is_open), "is-disabled" to props.disabled),
                                            props.titleClass,
                                            if (unref(is_open)) {
                                                props.titleOpenClass
                                            } else {
                                                ""
                                            }
                                            ,
                                            if (props.disabled) {
                                                props.titleDisabledClass
                                            } else {
                                                ""
                                            }
                                        )
                                    ))), _tD(props.title), 3)
                                )
                            }
                            )
                        )),
                        _cE("view", _uM("class" to _nC(_uA(
                            "down_arrow",
                            _uA(
                                unref(arrowPlatformClass),
                                unref(arrowStateClass),
                                unref(arrowDisabledClass),
                                props.arrowClass,
                                if (unref(is_open)) {
                                    props.arrowOpenClass
                                } else {
                                    ""
                                }
                                ,
                                if (props.disabled) {
                                    props.arrowDisabledClass
                                } else {
                                    ""
                                }
                            )
                        ))), null, 2)
                    ), 10, _uA(
                        "onClick"
                    )),
                    _cE("view", _uM("ref_key" to "contentWrapRef", "ref" to contentWrapRef, "class" to _nC(_uA(
                        "uni-collapse-item__content",
                        _uA(
                            if (unref(transition_enabled)) {
                                "content-transition--active"
                            } else {
                                ""
                            }
                            ,
                            if (unref(box_is_open)) {
                                "content-state-open"
                            } else {
                                "content-state-close"
                            }
                        )
                    ))), _uA(
                        _cE("view", _uM("ref_key" to "contentRef", "ref" to contentRef, "class" to _nC(_uA(
                            "uni-collapse-item__content-box",
                            _uA(
                                if (unref(transition_enabled)) {
                                    "content-transition--active"
                                } else {
                                    ""
                                }
                                ,
                                if (unref(box_is_open)) {
                                    "content-box-open"
                                } else {
                                    "content-box-close"
                                }
                            )
                        ))), _uA(
                            renderSlot(_ctx.`$slots`, "default")
                        ), 2)
                    ), 2)
                ), 2)
            }
        }
        var name = "UniCollapseItem"
        val styles: Map<String, Map<String, Map<String, Any>>> by lazy {
            _nCS(_uA(
                styles0
            ))
        }
        val styles0: Map<String, Map<String, Map<String, Any>>>
            get() {
                return _uM("uni-collapse-item-root" to _pS(_uM("backgroundColor" to "var(--list-background-color, #ffffff)")), "uni-collapse-item__title" to _pS(_uM("flexDirection" to "row", "alignItems" to "center", "paddingTop" to 12, "paddingRight" to 12, "paddingBottom" to 12, "paddingLeft" to 12, "backgroundColor" to "var(--list-background-color, #ffffff)")), "uni-collapse-item__title-main" to _pS(_uM("flexGrow" to 1, "flexShrink" to 1, "flexBasis" to "0%", "flexDirection" to "row", "alignItems" to "center")), "uni-collapse-item__title-text" to _pS(_uM("flexGrow" to 1, "flexShrink" to 1, "flexBasis" to "0%", "fontSize" to 14, "fontWeight" to 400, "color" to "var(--text-color, #333333)")), "open--active" to _pS(_uM("opacity" to 0.78)), "is-disabled" to _pS(_uM("opacity" to 0.45)), "down_arrow" to _pS(_uM("width" to 8, "height" to 8, "marginLeft" to 12, "marginTop" to -3, "transform" to "rotate(45deg)", "borderRightWidth" to 1, "borderRightStyle" to "solid", "borderRightColor" to "var(--arrow-color, #999999)", "borderBottomWidth" to 1, "borderBottomStyle" to "solid", "borderBottomColor" to "var(--arrow-color, #999999)", "transitionProperty" to "transform,borderRightColor,borderBottomColor", "transitionDuration" to "150ms")), "down_arrow--active" to _pS(_uM("marginTop" to 0, "transform" to "rotate(-135deg)")), "down_arrow--android-fix" to _pS(_uM("transitionProperty" to "transform")), "down_arrow--android-active" to _pS(_uM("marginTop" to 0, "transform" to "rotate(-135deg)")), "down_arrow--disabled" to _pS(_uM("opacity" to 0.45)), "uni-collapse-item__content" to _pS(_uM("overflow" to "hidden", "width" to "100%", "maxHeight" to 0, "backgroundColor" to "var(--list-background-color, #ffffff)", "transitionProperty" to "maxHeight")), "uni-collapse-item__content-box" to _pS(_uM("width" to "100%", "opacity" to 0, "transform" to "translateY(-8px)", "transitionProperty" to "opacity,transform")), "content-state-open" to _pS(_uM("maxHeight" to 2000)), "content-state-close" to _pS(_uM("maxHeight" to 0)), "content-box-open" to _pS(_uM("opacity" to 1, "transform" to "translateY(0px)")), "content-box-close" to _pS(_uM("opacity" to 0, "transform" to "translateY(-8px)")), "content-transition--active" to _pS(_uM("transitionDuration" to "180ms", "transitionTimingFunction" to "ease")), "@TRANSITION" to _uM("down_arrow" to _uM("property" to "transform,borderRightColor,borderBottomColor", "duration" to "150ms"), "down_arrow--android-fix" to _uM("property" to "transform"), "content-transition--active" to _uM("duration" to "180ms", "timingFunction" to "ease"), "uni-collapse-item__content" to _uM("property" to "maxHeight"), "uni-collapse-item__content-box" to _uM("property" to "opacity,transform")))
            }
        var inheritAttrs = true
        var inject: Map<String, Map<String, Any?>> = _uM()
        var emits: Map<String, Any?> = _uM("change" to null)
        var props = _nP(_uM("title" to _uM("type" to "String", "required" to false, "default" to ""), "open" to _uM("type" to "Boolean", "required" to false, "default" to false), "disabled" to _uM("type" to "Boolean", "required" to false, "default" to false), "titleWrapClass" to _uM("required" to false, "default" to "", "externalClasses" to true, "skipCheck" to true), "titleClass" to _uM("required" to false, "default" to "", "externalClasses" to true, "skipCheck" to true), "titleOpenClass" to _uM("required" to false, "default" to "", "externalClasses" to true, "skipCheck" to true), "titleDisabledClass" to _uM("required" to false, "default" to "", "externalClasses" to true, "skipCheck" to true), "arrowClass" to _uM("required" to false, "default" to "", "externalClasses" to true, "skipCheck" to true), "arrowOpenClass" to _uM("required" to false, "default" to "", "externalClasses" to true, "skipCheck" to true), "arrowDisabledClass" to _uM("required" to false, "default" to "", "externalClasses" to true, "skipCheck" to true)))
        var propsNeedCastKeys = _uA(
            "title",
            "open",
            "disabled",
            "titleWrapClass",
            "titleClass",
            "titleOpenClass",
            "titleDisabledClass",
            "arrowClass",
            "arrowOpenClass",
            "arrowDisabledClass"
        )
        var components: Map<String, CreateVueComponent> = _uM()
    }
}
