"use strict";
(globalThis["webpackChunkcore_controller"] = globalThis["webpackChunkcore_controller"] || []).push([["272"], {
392: (function (__unused_webpack_module, exports, __webpack_require__) {
/**
 * @license React
 * react-compiler-runtime.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */


var ReactSharedInternals =
  (__webpack_require__(696)/* .__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE */.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE);
exports.c = function (size) {
  return ReactSharedInternals.H.useMemoCache(size);
};


}),
631: (function (__unused_webpack_module, exports) {
/**
 * @license React
 * react-jsx-runtime.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */


var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
  REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
function jsxProd(type, config, maybeKey) {
  var key = null;
  void 0 !== maybeKey && (key = "" + maybeKey);
  void 0 !== config.key && (key = "" + config.key);
  if ("key" in config) {
    maybeKey = {};
    for (var propName in config)
      "key" !== propName && (maybeKey[propName] = config[propName]);
  } else maybeKey = config;
  config = maybeKey.ref;
  return {
    $$typeof: REACT_ELEMENT_TYPE,
    type: type,
    key: key,
    ref: void 0 !== config ? config : null,
    props: maybeKey
  };
}
exports.Fragment = REACT_FRAGMENT_TYPE;
exports.jsx = jsxProd;
exports.jsxs = jsxProd;


}),
827: (function (module, __unused_webpack_exports, __webpack_require__) {
/**
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */



if (true) {
  module.exports = __webpack_require__(392);
} else {}


}),
893: (function (module, __unused_webpack_exports, __webpack_require__) {


if (true) {
  module.exports = __webpack_require__(631);
} else {}


}),
180: (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  "default": () => (/* binding */ ControllerSupport)
});

// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js
var jsx_runtime = __webpack_require__(893);
// EXTERNAL MODULE: ./node_modules/react/compiler-runtime.js
var compiler_runtime = __webpack_require__(827);
;// CONCATENATED MODULE: ./src/shared.ts
function getFormattedMappedName({ code, mode }, name) {
    console.log(`${code} - ${mode} - ${name}`);
    const mappedName = getMappedName({
        code,
        mode
    }, name);
    if (mappedName.name !== undefined) {
        return `${mappedName.name} - (${mappedName.output})`;
    } else {
        return mappedName.output;
    }
}
function getMappedName({ code, mode }, name) {
    // We can map all regular letters to ascii chars
    if (mode === 'keyboard' && code >= 65 && code <= 90) {
        return {
            output: String.fromCharCode(code),
            name
        };
    }
    if (mode in readableOutputs) {
        const category = readableOutputs[mode];
        if (code in category) {
            return {
                output: category[code],
                name
            };
        }
    }
    return {
        output: `Unknown (${mode} - ${code})`,
        name
    };
}
const readableInputs = (/* unused pure expression or super */ null && ({
    stick: {
        1: 'Left Stick',
        2: 'Right Stick'
    },
    stickbutton: {
        1: 'Up',
        3: 'Right',
        5: 'Down',
        7: 'Left'
    },
    trigger: {
        5: 'Left Trigger',
        6: 'Right Trigger'
    },
    triggerbutton: {
        2: 'Trigger Pull'
    },
    dpadbutton: {
        1: 'Up',
        2: 'Right',
        4: 'Down',
        8: 'Left'
    },
    button: {
        1: 'A',
        2: 'B',
        3: 'X',
        4: 'Y',
        5: 'Select',
        7: 'Start'
    }
}));
const readableOutputs = {
    mousemovement: {
        1: 'Mouse Up',
        2: 'Mouse Down',
        3: 'Mouse Left',
        4: 'Mouse Right'
    },
    mousebutton: {
        1: 'Left Mouse Button',
        3: 'Right Mouse Button'
    },
    keyboard: {
        16777216: 'Escape',
        16777220: 'Enter',
        16777234: 'Arrow Left',
        16777235: 'Arrow Up',
        16777236: 'Arrow Right',
        16777237: 'Arrow Down'
    }
};

// EXTERNAL MODULE: consume shared module (default) react@19.1.0 (strict) (fallback: G:\Data\Projects\launcher\extensions\core-controller\node_modules\react\index.js)
var consume_shared_module_default_react_19_1_strict_fallback_G_Data_Projects_launcher_extensions_core_controller_node_modules_react_index_js_ = __webpack_require__(696);
;// CONCATENATED MODULE: ./src/components/ControllerSupport.tsx




function ControllerSupport(props) {
    const $ = (0,compiler_runtime.c)(27);
    const controllerConfig = props.game.extData?.controller?.config;
    let t0;
    bb0: {
        if (!controllerConfig) {
            let t1;
            if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
                t1 = /*#__PURE__*/ (0,jsx_runtime.jsx)(jsx_runtime.Fragment, {});
                $[0] = t1;
            } else {
                t1 = $[0];
            }
            t0 = t1;
            break bb0;
        }
        let list;
        if ($[1] !== controllerConfig.button || $[2] !== controllerConfig.dpad || $[3] !== controllerConfig.stick || $[4] !== controllerConfig.trigger) {
            list = [];
            let isDpadSameAsLeftStick = false;
            const leftStick = controllerConfig.stick ? controllerConfig.stick.find(_temp) : undefined;
            const rightStick = controllerConfig.stick ? controllerConfig.stick.find(_temp2) : undefined;
            if (controllerConfig.dpad && leftStick) {
                let allMatch = true;
                for (const button of controllerConfig.dpad.dpadbutton){
                    const stickButton = leftStick.stickbutton.find((s_1)=>s_1.name === button.name);
                    if (stickButton) {
                        if (stickButton.slots.slot.code !== button.slots.slot.code || stickButton.slots.slot.mode !== button.slots.slot.mode) {
                            allMatch = false;
                        }
                    } else {
                        allMatch = false;
                    }
                }
                isDpadSameAsLeftStick = allMatch;
            }
            if (controllerConfig.dpad) {
                const t1 = isDpadSameAsLeftStick ? "Dpad / Left Stick" : "Dpad";
                let t2;
                if ($[6] !== t1) {
                    t2 = /*#__PURE__*/ (0,jsx_runtime.jsx)("div", {
                        className: "controller-config-subheader",
                        children: t1
                    });
                    $[6] = t1;
                    $[7] = t2;
                } else {
                    t2 = $[7];
                }
                list.push(t2);
                let inner;
                if ($[8] !== controllerConfig.dpad.dpadbutton) {
                    inner = [];
                    for (const button_0 of controllerConfig.dpad.dpadbutton){
                        inner.push(/*#__PURE__*/ (0,jsx_runtime.jsxs)("div", {
                            className: "controller-config-button",
                            children: [
                                /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", {
                                    className: "controller-config-button--input",
                                    children: [
                                        button_0.name,
                                        ":"
                                    ]
                                }),
                                /*#__PURE__*/ (0,jsx_runtime.jsx)("div", {
                                    className: "controller-config-button--output",
                                    children: getFormattedMappedName(button_0.slots.slot, button_0.actionName)
                                })
                            ]
                        }));
                    }
                    $[8] = controllerConfig.dpad.dpadbutton;
                    $[9] = inner;
                } else {
                    inner = $[9];
                }
                let t3;
                if ($[10] !== inner) {
                    t3 = /*#__PURE__*/ (0,jsx_runtime.jsx)("div", {
                        className: "controller-config-subsection",
                        children: inner
                    });
                    $[10] = inner;
                    $[11] = t3;
                } else {
                    t3 = $[11];
                }
                list.push(t3);
            }
            if (controllerConfig.button) {
                let t1;
                if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
                    t1 = /*#__PURE__*/ (0,jsx_runtime.jsx)("div", {
                        className: "controller-config-subheader",
                        children: "Buttons"
                    });
                    $[12] = t1;
                } else {
                    t1 = $[12];
                }
                list.push(t1);
                let inner_0;
                if ($[13] !== controllerConfig.button) {
                    inner_0 = [];
                    for (const button_1 of controllerConfig.button){
                        inner_0.push(/*#__PURE__*/ (0,jsx_runtime.jsxs)("div", {
                            className: "controller-config-button",
                            children: [
                                /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", {
                                    className: "controller-config-button--input",
                                    children: [
                                        button_1.name,
                                        ":"
                                    ]
                                }),
                                /*#__PURE__*/ (0,jsx_runtime.jsx)("div", {
                                    className: "controller-config-button--output",
                                    children: getFormattedMappedName(button_1.slots.slot, button_1.actionName)
                                })
                            ]
                        }));
                    }
                    $[13] = controllerConfig.button;
                    $[14] = inner_0;
                } else {
                    inner_0 = $[14];
                }
                let t2;
                if ($[15] !== inner_0) {
                    t2 = /*#__PURE__*/ (0,jsx_runtime.jsx)("div", {
                        className: "controller-config-subsection",
                        children: inner_0
                    });
                    $[15] = inner_0;
                    $[16] = t2;
                } else {
                    t2 = $[16];
                }
                list.push(t2);
            }
            if (!isDpadSameAsLeftStick && leftStick) {
                let isMouseMovement = true;
                for (const button_2 of leftStick.stickbutton){
                    if (button_2.slots.slot.mode !== "mousemovement") {
                        isMouseMovement = false;
                        break;
                    }
                }
                list.push(/*#__PURE__*/ (0,jsx_runtime.jsx)("div", {
                    className: "controller-config-subheader",
                    children: leftStick.name
                }));
                const inner_1 = [];
                if (isMouseMovement) {
                    let t1;
                    if ($[17] === Symbol.for("react.memo_cache_sentinel")) {
                        t1 = /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", {
                            className: "controller-config-button",
                            children: [
                                /*#__PURE__*/ (0,jsx_runtime.jsx)("div", {
                                    className: "controller-config-button--input",
                                    children: "All Directions:"
                                }),
                                /*#__PURE__*/ (0,jsx_runtime.jsx)("div", {
                                    className: "controller-config-button--output",
                                    children: "Mouse Movement"
                                })
                            ]
                        });
                        $[17] = t1;
                    } else {
                        t1 = $[17];
                    }
                    inner_1.push(t1);
                } else {
                    for (const button_3 of leftStick.stickbutton){
                        inner_1.push(/*#__PURE__*/ (0,jsx_runtime.jsxs)("div", {
                            className: "controller-config-button",
                            children: [
                                /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", {
                                    className: "controller-config-button--input",
                                    children: [
                                        button_3.name,
                                        ":"
                                    ]
                                }),
                                /*#__PURE__*/ (0,jsx_runtime.jsx)("div", {
                                    className: "controller-config-button--output",
                                    children: getFormattedMappedName(button_3.slots.slot, button_3.actionName)
                                })
                            ]
                        }, button_3.uq_index));
                    }
                }
                let t1;
                if ($[18] !== inner_1) {
                    t1 = /*#__PURE__*/ (0,jsx_runtime.jsx)("div", {
                        className: "controller-config-subsection",
                        children: inner_1
                    });
                    $[18] = inner_1;
                    $[19] = t1;
                } else {
                    t1 = $[19];
                }
                list.push(t1);
            }
            if (rightStick) {
                let isMouseMovement_0 = true;
                for (const button_4 of rightStick.stickbutton){
                    if (button_4.slots.slot.mode !== "mousemovement") {
                        isMouseMovement_0 = false;
                        break;
                    }
                }
                list.push(/*#__PURE__*/ (0,jsx_runtime.jsx)("div", {
                    className: "controller-config-subheader",
                    children: rightStick.name
                }));
                const inner_2 = [];
                if (isMouseMovement_0) {
                    let t1;
                    if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
                        t1 = /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", {
                            className: "controller-config-button",
                            children: [
                                /*#__PURE__*/ (0,jsx_runtime.jsx)("div", {
                                    className: "controller-config-button--input",
                                    children: "All Directions:"
                                }),
                                /*#__PURE__*/ (0,jsx_runtime.jsx)("div", {
                                    className: "controller-config-button--output",
                                    children: "Mouse Movement"
                                })
                            ]
                        });
                        $[20] = t1;
                    } else {
                        t1 = $[20];
                    }
                    inner_2.push(t1);
                } else {
                    for (const button_5 of rightStick.stickbutton){
                        inner_2.push(/*#__PURE__*/ (0,jsx_runtime.jsxs)("div", {
                            className: "controller-config-button",
                            children: [
                                /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", {
                                    className: "controller-config-button--input",
                                    children: [
                                        button_5.name,
                                        ":"
                                    ]
                                }),
                                /*#__PURE__*/ (0,jsx_runtime.jsx)("div", {
                                    className: "controller-config-button--output",
                                    children: getFormattedMappedName(button_5.slots.slot, button_5.actionName)
                                })
                            ]
                        }, button_5.uq_index));
                    }
                }
                let t1;
                if ($[21] !== inner_2) {
                    t1 = /*#__PURE__*/ (0,jsx_runtime.jsx)("div", {
                        className: "controller-config-subsection",
                        children: inner_2
                    });
                    $[21] = inner_2;
                    $[22] = t1;
                } else {
                    t1 = $[22];
                }
                list.push(t1);
            }
            if (controllerConfig.trigger) {
                for (const trigger of controllerConfig.trigger){
                    list.push(/*#__PURE__*/ (0,jsx_runtime.jsx)("div", {
                        className: "controller-config-subheader",
                        children: trigger.name
                    }));
                    list.push(/*#__PURE__*/ (0,jsx_runtime.jsx)("div", {
                        className: "controller-config-subsection",
                        children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", {
                            className: "controller-config-button",
                            children: [
                                /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", {
                                    className: "controller-config-button--input",
                                    children: [
                                        trigger.triggerbutton.name,
                                        ":"
                                    ]
                                }),
                                /*#__PURE__*/ (0,jsx_runtime.jsx)("div", {
                                    className: "controller-config-button--output",
                                    children: getFormattedMappedName(trigger.triggerbutton.slots.slot, trigger.triggerbutton.actionName)
                                })
                            ]
                        }, trigger.uq_index)
                    }));
                }
            }
            $[1] = controllerConfig.button;
            $[2] = controllerConfig.dpad;
            $[3] = controllerConfig.stick;
            $[4] = controllerConfig.trigger;
            $[5] = list;
        } else {
            list = $[5];
        }
        t0 = list;
    }
    const mappedTable = t0;
    if (controllerConfig) {
        let t1;
        if ($[23] === Symbol.for("react.memo_cache_sentinel")) {
            t1 = /*#__PURE__*/ (0,jsx_runtime.jsx)("p", {
                children: "Controller Configuration: "
            });
            $[23] = t1;
        } else {
            t1 = $[23];
        }
        let t2;
        if ($[24] !== mappedTable) {
            t2 = /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", {
                className: "browse-right-sidebar__row",
                children: [
                    t1,
                    /*#__PURE__*/ (0,jsx_runtime.jsx)("div", {
                        className: "controller-config-inner",
                        children: mappedTable
                    })
                ]
            });
            $[24] = mappedTable;
            $[25] = t2;
        } else {
            t2 = $[25];
        }
        return t2;
    } else {
        let t1;
        if ($[26] === Symbol.for("react.memo_cache_sentinel")) {
            t1 = /*#__PURE__*/ (0,jsx_runtime.jsx)(jsx_runtime.Fragment, {});
            $[26] = t1;
        } else {
            t1 = $[26];
        }
        return t1;
    }
}
function _temp2(s_0) {
    return s_0.name === "Right Stick";
}
function _temp(s) {
    return s.name === "Left Stick";
}


}),

}]);