def copy_factory(src, dest):
    """Copy Dash I/O Factory

    When a Dash component has been wrapped in additional layout to make
    a composite it is necessary to copy the embedded component I/O definition
    to the outermost component. This will then allow the composite component
    to be referenced in Dash callbacks.

    Arguments:
        src {obj} -- The source Dash component
        dest {obj} -- The destination Dash component

    Returns:
        [Obj] -- The destination component
    """

    def _copy():
        dest.input.component = src.input.component
        dest.output.component = src.output.component
        dest.state.component = src.state.component

    if hasattr(dest, 'id'):
        _copy()
    else:
        dest.id = src.id + '#container'
        _copy()
        #dest.id = None

    return dest