import { ActionFormData } from "@minecraft/server-ui";
const mainPage = new ActionFormData()
    .title({
    rawtext: [{ translate: "dialog.kicu_mmad:guidebook_contents.title", with: ["\n"] }],
})
    .body({
    rawtext: [
        { translate: "dialog.kicu_mmad:guidebook_contents.part_1", with: ["\n"] },
        { translate: "dialog.kicu_mmad:guidebook_contents.part_2", with: ["\n"] },
        { translate: "dialog.kicu_mmad:guidebook_contents.part_3", with: ["\n"] },
    ],
})
    .button({
    rawtext: [{ translate: "dialog.kicu_mmad:guidebook_contents.button_1", with: ["\n"] }],
})
    .button({
    rawtext: [{ translate: "dialog.kicu_mmad:guidebook_contents.button_2", with: ["\n"] }],
})
    .button({
    rawtext: [{ translate: "dialog.kicu_mmad:guidebook_contents.button_3", with: ["\n"] }],
})
    .button({
    rawtext: [{ translate: "dialog.kicu_mmad:guidebook_contents.button_4", with: ["\n"] }],
})
    .button({
    rawtext: [{ translate: "dialog.kicu_mmad:guidebook_contents.button_5", with: ["\n"] }],
})
    .button({
    rawtext: [{ translate: "dialog.kicu_mmad:guidebook_contents.button_6", with: ["\n"] }],
})
    .button({
    rawtext: [{ translate: "dialog.kicu_mmad:guidebook_contents.button_7", with: ["\n"] }],
})
    .button({
    rawtext: [{ translate: "dialog.kicu_mmad:guidebook_contents.button_8", with: ["\n"] }],
})
    .button({
    rawtext: [{ translate: "dialog.kicu_mmad:guidebook_contents.button_9", with: ["\n"] }],
})
    .button({
    rawtext: [{ translate: "dialog.kicu_mmad:guidebook_contents.button_10", with: ["\n"] }],
})
    .button({
    rawtext: [{ translate: "dialog.kicu_mmad:guidebook_contents.button_11", with: ["\n"] }],
});
const eggPage = new ActionFormData().title("Eggs").body("Egg Stuff!").button("Back");
const otherPage = new ActionFormData().title("Other").button("Back").body("Other Stuff!");
const formPageIdentifier = {
    0: "mounts",
    1: "nests",
    2: "eggs",
    3: "mythicmaterial",
    4: "saddles",
    5: "callinghorn",
    6: "flying",
    7: "attacking",
    8: "armor",
    9: "changelog",
    10: "credits",
};
const formPageCount = {
    0: 3,
    1: 12,
    2: 5,
    3: 2,
    4: 7,
    5: 1,
    6: 2,
    7: 7,
    8: 9,
    9: 17,
    10: 2,
};
function getPageData(page) {
    let pageBody = [];
    for (let x = 1; x <= formPageCount[page]; x++) {
        pageBody.push({ translate: "dialog.kicu_mmad:guidebook_" + formPageIdentifier[page] + ".part_" + x, with: ["\n"] });
    }
    return new ActionFormData()
        .title({
        rawtext: [{ translate: "dialog.kicu_mmad:guidebook_" + formPageIdentifier[page] + ".title", with: ["\n"] }],
    })
        .body({ rawtext: pageBody })
        .button("dialog.kicu_mmad:guidebook.back");
}
export async function openMainPage(player, log) {
    mainPage.show(player).then((response) => {
        if (response.selection || response.selection === 0) {
            log(response.selection.toString());
            openSubPage(player, response.selection, log);
        }
    });
}
function openSubPage(player, pageNumber, log) {
    const page = getPageData(pageNumber);
    page.show(player).then((response) => {
        if (response.selection === 0) {
            openMainPage(player, log);
        }
    });
}

//# sourceMappingURL=../../../../../_KiCuMountsBPDebug/kicu/mmad/F/Form.js.map
