From 8ce6b8671e1834d658df2ba2eec112130b52b495 Mon Sep 17 00:00:00 2001 From: anubra266 Date: Sun, 29 Dec 2024 20:26:49 -0800 Subject: [PATCH 01/11] feat: cascader component --- .xstate/cascader.js | 275 ++++++++ examples/lit-ts/package.json | 1 + examples/next-ts/package.json | 3 +- examples/next-ts/pages/cascader.tsx | 97 +++ examples/nuxt-ts/package.json | 1 + examples/nuxt-ts/pages/cascader.vue | 20 + examples/preact-ts/package.json | 1 + examples/react-19/package.json | 3 +- examples/solid-ts/package.json | 1 + examples/solid-ts/src/routes/cascader.tsx | 29 + examples/svelte-ts/package.json | 1 + examples/vanilla-ts/package.json | 1 + packages/machines/cascader/README.md | 19 + packages/machines/cascader/package.json | 38 ++ .../machines/cascader/src/cascader.anatomy.ts | 16 + .../cascader/src/cascader.collection.ts | 10 + .../machines/cascader/src/cascader.connect.ts | 390 +++++++++++ .../machines/cascader/src/cascader.dom.ts | 21 + .../machines/cascader/src/cascader.machine.ts | 606 ++++++++++++++++++ .../machines/cascader/src/cascader.props.ts | 6 + .../machines/cascader/src/cascader.types.ts | 332 ++++++++++ .../machines/cascader/src/cascader.utils.ts | 62 ++ packages/machines/cascader/src/index.ts | 6 + packages/machines/cascader/tsconfig.json | 7 + pnpm-lock.yaml | 86 ++- shared/src/cascader-data.ts | 224 +++++++ shared/src/controls.ts | 13 + shared/src/css/cascader.css | 113 ++++ shared/src/data.ts | 1 + shared/src/routes.ts | 1 + shared/src/style.css | 1 + 31 files changed, 2378 insertions(+), 7 deletions(-) create mode 100644 .xstate/cascader.js create mode 100644 examples/next-ts/pages/cascader.tsx create mode 100644 examples/nuxt-ts/pages/cascader.vue create mode 100644 examples/solid-ts/src/routes/cascader.tsx create mode 100644 packages/machines/cascader/README.md create mode 100644 packages/machines/cascader/package.json create mode 100644 packages/machines/cascader/src/cascader.anatomy.ts create mode 100644 packages/machines/cascader/src/cascader.collection.ts create mode 100644 packages/machines/cascader/src/cascader.connect.ts create mode 100644 packages/machines/cascader/src/cascader.dom.ts create mode 100644 packages/machines/cascader/src/cascader.machine.ts create mode 100644 packages/machines/cascader/src/cascader.props.ts create mode 100644 packages/machines/cascader/src/cascader.types.ts create mode 100644 packages/machines/cascader/src/cascader.utils.ts create mode 100644 packages/machines/cascader/src/index.ts create mode 100644 packages/machines/cascader/tsconfig.json create mode 100644 shared/src/cascader-data.ts create mode 100644 shared/src/css/cascader.css diff --git a/.xstate/cascader.js b/.xstate/cascader.js new file mode 100644 index 0000000000..68fe9ba9b5 --- /dev/null +++ b/.xstate/cascader.js @@ -0,0 +1,275 @@ +"use strict"; + +var _xstate = require("xstate"); +const { + actions, + createMachine, + assign +} = _xstate; +const { + choose +} = actions; +const fetchMachine = createMachine({ + id: "cascader", + context: { + "isTriggerClickEvent": false, + "isOpenControlled": false, + "isOpenControlled": false, + "isTriggerClickEvent": false, + "isTriggerArrowUpEvent": false, + "isTriggerArrowDownEvent || isTriggerEnterEvent": false, + "isOpenControlled": false, + "isOpenControlled": false, + "isOpenControlled": false, + "isOpenControlled": false, + "isOpenControlled": false, + "isOpenControlled": false, + "isOpenControlled": false, + "isLeafNode && closeOnSelect && isOpenControlled": false, + "isLeafNode && closeOnSelect": false, + "isLeafNode": false, + "isClickTrigger": false, + "hasHighlightedItem": false, + "hasHighlightedItem": false, + "hasHighlightedItem && loop && isLastItemHighlighted": false, + "hasHighlightedItem": false, + "hasHighlightedItem && loop && isFirstItemHighlighted": false, + "hasHighlightedItem": false, + "isHighlightedItemInSubLevel": false, + "isOpenControlled": false, + "hasHighlightedItem": false, + "isHoverTrigger": false + }, + initial: ctx.open ? "open" : "idle", + entry: ["syncSelectedItems", "syncHighlightedItem"], + on: { + "HIGHLIGHTED_VALUE.SET": { + actions: ["setHighlightedItem"] + }, + "ITEM.SELECT": { + actions: ["selectItem"] + }, + "ITEM.CLEAR": { + actions: ["clearItem"] + }, + "VALUE.SET": { + actions: ["setSelectedItems"] + }, + "VALUE.CLEAR": { + actions: ["clearSelectedItems"] + } + }, + on: { + UPDATE_CONTEXT: { + actions: "updateContext" + } + }, + states: { + idle: { + tags: ["closed"], + on: { + "CONTROLLED.OPEN": [{ + cond: "isTriggerClickEvent", + target: "open", + actions: ["setInitialFocus", "highlightFirstSelectedItem"] + }, { + target: "open", + actions: ["setInitialFocus"] + }], + "TRIGGER.CLICK": [{ + cond: "isOpenControlled", + actions: ["invokeOnOpen"] + }, { + target: "open", + actions: ["invokeOnOpen", "setInitialFocus", "highlightFirstSelectedItem"] + }], + "TRIGGER.FOCUS": { + target: "focused" + }, + OPEN: [{ + cond: "isOpenControlled", + actions: ["invokeOnOpen"] + }, { + target: "open", + actions: ["setInitialFocus", "invokeOnOpen"] + }] + } + }, + focused: { + tags: ["closed"], + on: { + "CONTROLLED.OPEN": [{ + cond: "isTriggerClickEvent", + target: "open", + actions: ["setInitialFocus", "highlightFirstSelectedItem"] + }, { + cond: "isTriggerArrowUpEvent", + target: "open", + actions: ["setInitialFocus", "highlightComputedLastItem"] + }, { + cond: "isTriggerArrowDownEvent || isTriggerEnterEvent", + target: "open", + actions: ["setInitialFocus", "highlightComputedFirstItem"] + }, { + target: "open", + actions: ["setInitialFocus"] + }], + OPEN: [{ + cond: "isOpenControlled", + actions: ["invokeOnOpen"] + }, { + target: "open", + actions: ["setInitialFocus", "invokeOnOpen"] + }], + "TRIGGER.BLUR": { + target: "idle" + }, + "TRIGGER.CLICK": [{ + cond: "isOpenControlled", + actions: ["invokeOnOpen"] + }, { + target: "open", + actions: ["setInitialFocus", "invokeOnOpen", "highlightFirstSelectedItem"] + }], + "TRIGGER.ENTER": [{ + cond: "isOpenControlled", + actions: ["invokeOnOpen"] + }, { + target: "open", + actions: ["setInitialFocus", "invokeOnOpen", "highlightComputedFirstItem"] + }], + "TRIGGER.ARROW_UP": [{ + cond: "isOpenControlled", + actions: ["invokeOnOpen"] + }, { + target: "open", + actions: ["setInitialFocus", "invokeOnOpen", "highlightComputedLastItem"] + }], + "TRIGGER.ARROW_DOWN": [{ + cond: "isOpenControlled", + actions: ["invokeOnOpen"] + }, { + target: "open", + actions: ["setInitialFocus", "invokeOnOpen", "highlightComputedFirstItem"] + }] + } + }, + open: { + tags: ["open"], + exit: ["scrollListsToTop"], + activities: ["trackDismissableElement", "computePlacement", "scrollToHighlightedItems"], + on: { + "CONTROLLED.CLOSE": { + target: "focused", + actions: ["focusTriggerEl", "clearHighlightedItem"] + }, + CLOSE: [{ + cond: "isOpenControlled", + actions: ["invokeOnClose"] + }, { + target: "focused", + actions: ["invokeOnClose", "focusTriggerEl", "clearHighlightedItem"] + }], + "TRIGGER.CLICK": [{ + cond: "isOpenControlled", + actions: ["invokeOnClose"] + }, { + target: "focused", + actions: ["invokeOnClose", "clearHighlightedItem"] + }], + "ITEM.CLICK": [ + // === Grouped transitions (based on `closeOnSelect` and `isOpenControlled`) === + { + cond: "isLeafNode && closeOnSelect && isOpenControlled", + actions: ["selectItemAtIndexPath", "invokeOnClose"] + }, { + cond: "isLeafNode && closeOnSelect", + target: "focused", + actions: ["selectItemAtIndexPath", "invokeOnClose", "focusTriggerEl", "clearHighlightedItem"] + }, { + cond: "isLeafNode", + actions: ["highlightItem", "selectItemAtIndexPath"] + }, + // === + { + cond: "isClickTrigger", + actions: ["highlightItem"] + }], + "CONTENT.HOME": [{ + cond: "hasHighlightedItem", + actions: ["highlightFirstItem"] + }, { + actions: ["highlightFirstItemInRoot"] + }], + "CONTENT.END": [{ + cond: "hasHighlightedItem", + actions: ["highlightLastItem"] + }, { + actions: ["highlightLastItemInRoot"] + }], + "CONTENT.ARROW_DOWN": [{ + cond: "hasHighlightedItem && loop && isLastItemHighlighted", + actions: ["highlightFirstItem"] + }, { + cond: "hasHighlightedItem", + actions: ["highlightNextItem"] + }, { + actions: ["highlightFirstItemInRoot"] + }], + "CONTENT.ARROW_UP": [{ + cond: "hasHighlightedItem && loop && isFirstItemHighlighted", + actions: ["highlightLastItem"] + }, { + cond: "hasHighlightedItem", + actions: ["highlightPreviousItem"] + }, { + actions: ["highlightLastItemInRoot"] + }], + "CONTENT.ARROW_LEFT": [{ + cond: "isHighlightedItemInSubLevel", + actions: ["highlightItemParent"] + }, { + cond: "isOpenControlled", + actions: ["invokeOnClose"] + }, { + target: "focused", + actions: ["invokeOnClose", "focusTriggerEl", "clearHighlightedItem"] + }], + "CONTENT.ARROW_RIGHT": { + cond: "hasHighlightedItem", + actions: ["highlightItemFirstChild"] + }, + "ITEM.POINTER_MOVE": { + cond: "isHoverTrigger", + actions: ["highlightItem"] + }, + "POSITIONING.SET": { + actions: ["reposition"] + } + } + } + } +}, { + actions: { + updateContext: assign((context, event) => { + return { + [event.contextKey]: true + }; + }) + }, + guards: { + "isTriggerClickEvent": ctx => ctx["isTriggerClickEvent"], + "isOpenControlled": ctx => ctx["isOpenControlled"], + "isTriggerArrowUpEvent": ctx => ctx["isTriggerArrowUpEvent"], + "isTriggerArrowDownEvent || isTriggerEnterEvent": ctx => ctx["isTriggerArrowDownEvent || isTriggerEnterEvent"], + "isLeafNode && closeOnSelect && isOpenControlled": ctx => ctx["isLeafNode && closeOnSelect && isOpenControlled"], + "isLeafNode && closeOnSelect": ctx => ctx["isLeafNode && closeOnSelect"], + "isLeafNode": ctx => ctx["isLeafNode"], + "isClickTrigger": ctx => ctx["isClickTrigger"], + "hasHighlightedItem": ctx => ctx["hasHighlightedItem"], + "hasHighlightedItem && loop && isLastItemHighlighted": ctx => ctx["hasHighlightedItem && loop && isLastItemHighlighted"], + "hasHighlightedItem && loop && isFirstItemHighlighted": ctx => ctx["hasHighlightedItem && loop && isFirstItemHighlighted"], + "isHighlightedItemInSubLevel": ctx => ctx["isHighlightedItemInSubLevel"], + "isHoverTrigger": ctx => ctx["isHoverTrigger"] + } +}); \ No newline at end of file diff --git a/examples/lit-ts/package.json b/examples/lit-ts/package.json index 62d6f42d8f..7e4fe18af7 100644 --- a/examples/lit-ts/package.json +++ b/examples/lit-ts/package.json @@ -21,6 +21,7 @@ "@zag-js/auto-resize": "workspace:*", "@zag-js/avatar": "workspace:*", "@zag-js/carousel": "workspace:*", + "@zag-js/cascader": "workspace:*", "@zag-js/checkbox": "workspace:*", "@zag-js/clipboard": "workspace:*", "@zag-js/collapsible": "workspace:*", diff --git a/examples/next-ts/package.json b/examples/next-ts/package.json index 0e3521278b..d5ef02e928 100644 --- a/examples/next-ts/package.json +++ b/examples/next-ts/package.json @@ -21,6 +21,7 @@ "@zag-js/auto-resize": "workspace:*", "@zag-js/avatar": "workspace:*", "@zag-js/carousel": "workspace:*", + "@zag-js/cascader": "workspace:*", "@zag-js/checkbox": "workspace:*", "@zag-js/clipboard": "workspace:*", "@zag-js/collapsible": "workspace:*", @@ -112,4 +113,4 @@ "typescript": "5.7.2" }, "license": "MIT" -} +} \ No newline at end of file diff --git a/examples/next-ts/pages/cascader.tsx b/examples/next-ts/pages/cascader.tsx new file mode 100644 index 0000000000..2d2f346ea7 --- /dev/null +++ b/examples/next-ts/pages/cascader.tsx @@ -0,0 +1,97 @@ +import * as cascader from "@zag-js/cascader" +import { useMachine, normalizeProps, Portal } from "@zag-js/react" +import { cascaderControls, cascaderData } from "@zag-js/shared" +import { useId } from "react" +import { StateVisualizer } from "../components/state-visualizer" +import { Toolbar } from "../components/toolbar" +import { useControls } from "../hooks/use-controls" + +interface Node { + label: string + value: string + children?: Node[] +} + +const collection = cascader.collection({ + nodeToValue: (node) => node.value, + nodeToString: (node) => node.label, + rootNode: cascaderData, +}) + +interface TreeNodeProps { + node: Node + indexPath: number[] + api: cascader.Api +} + +const TreeNode = (props: TreeNodeProps): JSX.Element => { + const { node, indexPath, api } = props + + const nodeProps = { indexPath, node } + const nodeState = api.getNodeState(nodeProps) + // TODO encapsulate + const activeIndex = api.highlightedIndexPath[nodeState.depth] ?? -1 + const children = collection.getNodeChildren(node) + const activeNode = activeIndex >= 0 ? children[activeIndex] : null + const isBranchActiveNode = activeNode && collection.isBranchNode(activeNode) + + return ( + <> + + {isBranchActiveNode && } + + ) +} + +export default function Page() { + const controls = useControls(cascaderControls) + + const [state, send] = useMachine(cascader.machine({ id: useId(), collection }), { + context: controls.context, + }) + + const api = cascader.connect(state, send, normalizeProps) + + return ( + <> +
+
+ + {/* control */} +
+ + {/* */} +
+ + {/* UI select */} + +
+
    + +
+
+
+
+
+ + + + + + ) +} diff --git a/examples/nuxt-ts/package.json b/examples/nuxt-ts/package.json index 3440dceb97..938d818120 100644 --- a/examples/nuxt-ts/package.json +++ b/examples/nuxt-ts/package.json @@ -18,6 +18,7 @@ "@zag-js/auto-resize": "workspace:*", "@zag-js/avatar": "workspace:*", "@zag-js/carousel": "workspace:*", + "@zag-js/cascader": "workspace:*", "@zag-js/checkbox": "workspace:*", "@zag-js/clipboard": "workspace:*", "@zag-js/collapsible": "workspace:*", diff --git a/examples/nuxt-ts/pages/cascader.vue b/examples/nuxt-ts/pages/cascader.vue new file mode 100644 index 0000000000..050d5ae2ad --- /dev/null +++ b/examples/nuxt-ts/pages/cascader.vue @@ -0,0 +1,20 @@ + + + diff --git a/examples/preact-ts/package.json b/examples/preact-ts/package.json index d31b7e9a43..c3c42bc1d3 100644 --- a/examples/preact-ts/package.json +++ b/examples/preact-ts/package.json @@ -17,6 +17,7 @@ "@zag-js/auto-resize": "workspace:*", "@zag-js/avatar": "workspace:*", "@zag-js/carousel": "workspace:*", + "@zag-js/cascader": "workspace:*", "@zag-js/checkbox": "workspace:*", "@zag-js/clipboard": "workspace:*", "@zag-js/collapsible": "workspace:*", diff --git a/examples/react-19/package.json b/examples/react-19/package.json index dc1b02b327..9179e12c39 100644 --- a/examples/react-19/package.json +++ b/examples/react-19/package.json @@ -18,6 +18,7 @@ "@zag-js/auto-resize": "workspace:*", "@zag-js/avatar": "workspace:*", "@zag-js/carousel": "workspace:*", + "@zag-js/cascader": "workspace:*", "@zag-js/checkbox": "workspace:*", "@zag-js/clipboard": "workspace:*", "@zag-js/collapsible": "workspace:*", @@ -102,4 +103,4 @@ "typescript-eslint": "^8.7.0", "vite": "^6.0.4" } -} +} \ No newline at end of file diff --git a/examples/solid-ts/package.json b/examples/solid-ts/package.json index 5eac74b4fd..9a731bcc56 100644 --- a/examples/solid-ts/package.json +++ b/examples/solid-ts/package.json @@ -21,6 +21,7 @@ "@zag-js/auto-resize": "workspace:*", "@zag-js/avatar": "workspace:*", "@zag-js/carousel": "workspace:*", + "@zag-js/cascader": "workspace:*", "@zag-js/checkbox": "workspace:*", "@zag-js/clipboard": "workspace:*", "@zag-js/collapsible": "workspace:*", diff --git a/examples/solid-ts/src/routes/cascader.tsx b/examples/solid-ts/src/routes/cascader.tsx new file mode 100644 index 0000000000..ae6faa0e72 --- /dev/null +++ b/examples/solid-ts/src/routes/cascader.tsx @@ -0,0 +1,29 @@ +import * as cascader from "@zag-js/cascader" +import { normalizeProps, useMachine, mergeProps } from "@zag-js/solid" +import { createMemo, createUniqueId } from "solid-js" +import { cascaderControls, cascaderData } from "@zag-js/shared" +import { StateVisualizer } from "../components/state-visualizer" +import { Toolbar } from "../components/toolbar" +import { useControls } from "../hooks/use-controls" + +export default function Page() { + const controls = useControls(cascaderControls) + + const [state, send] = useMachine(cascader.machine({ id: createUniqueId() }), { + context: controls.context, + }) + + const api = createMemo(() => cascader.connect(state, send, normalizeProps)) + + return ( + <> +
+
+
+ + + + + + ) +} diff --git a/examples/svelte-ts/package.json b/examples/svelte-ts/package.json index 9803df65e2..3e8407696d 100644 --- a/examples/svelte-ts/package.json +++ b/examples/svelte-ts/package.json @@ -19,6 +19,7 @@ "@zag-js/auto-resize": "workspace:*", "@zag-js/avatar": "workspace:*", "@zag-js/carousel": "workspace:*", + "@zag-js/cascader": "workspace:*", "@zag-js/checkbox": "workspace:*", "@zag-js/clipboard": "workspace:*", "@zag-js/collapsible": "workspace:*", diff --git a/examples/vanilla-ts/package.json b/examples/vanilla-ts/package.json index ed89bc1647..5d016a0944 100644 --- a/examples/vanilla-ts/package.json +++ b/examples/vanilla-ts/package.json @@ -22,6 +22,7 @@ "@zag-js/auto-resize": "workspace:*", "@zag-js/avatar": "workspace:*", "@zag-js/carousel": "workspace:*", + "@zag-js/cascader": "workspace:*", "@zag-js/checkbox": "workspace:*", "@zag-js/clipboard": "workspace:*", "@zag-js/collapsible": "workspace:*", diff --git a/packages/machines/cascader/README.md b/packages/machines/cascader/README.md new file mode 100644 index 0000000000..009595e85b --- /dev/null +++ b/packages/machines/cascader/README.md @@ -0,0 +1,19 @@ +# @zag-js/cascader + +Core logic for the cascader widget implemented as a state machine + +## Installation + +```sh +yarn add @zag-js/cascader +# or +npm i @zag-js/cascader +``` + +## Contribution + +Yes please! See the [contributing guidelines](https://github.com/chakra-ui/zag/blob/main/CONTRIBUTING.md) for details. + +## Licence + +This project is licensed under the terms of the [MIT license](https://github.com/chakra-ui/zag/blob/main/LICENSE). diff --git a/packages/machines/cascader/package.json b/packages/machines/cascader/package.json new file mode 100644 index 0000000000..070cf29d39 --- /dev/null +++ b/packages/machines/cascader/package.json @@ -0,0 +1,38 @@ +{ + "name": "@zag-js/cascader", + "version": "0.0.0", + "description": "Core logic for the cascader widget implemented as a state machine", + "keywords": ["js", "machine", "xstate", "statechart", "component", "chakra-ui", "cascader"], + "author": "Abraham Aremu ", + "homepage": "https://github.com/chakra-ui/zag#readme", + "license": "MIT", + "main": "src/index.ts", + "repository": "https://github.com/chakra-ui/zag/tree/main/packages/cascader", + "sideEffects": false, + "files": ["dist", "src"], + "scripts": { + "build": "tsup", + "lint": "eslint src", + "typecheck": "tsc --noEmit", + "prepack": "clean-package", + "postpack": "clean-package restore" + }, + "publishConfig": { + "access": "public" + }, + "bugs": { + "url": "https://github.com/chakra-ui/zag/issues" + }, + "dependencies": { + "@zag-js/anatomy": "workspace:*", + "@zag-js/collection": "workspace:*", + "@zag-js/core": "workspace:*", + "@zag-js/dom-query": "workspace:*", + "@zag-js/utils": "workspace:*", + "@zag-js/types": "workspace:*" + }, + "devDependencies": { + "clean-package": "2.2.0" + }, + "clean-package": "../../../clean-package.config.json" +} diff --git a/packages/machines/cascader/src/cascader.anatomy.ts b/packages/machines/cascader/src/cascader.anatomy.ts new file mode 100644 index 0000000000..15ace65674 --- /dev/null +++ b/packages/machines/cascader/src/cascader.anatomy.ts @@ -0,0 +1,16 @@ +import { createAnatomy } from "@zag-js/anatomy" + +export const anatomy = createAnatomy("cascader").parts( + "root", + "label", + "control", + "trigger", + "clearTrigger", + "positioner", + "content", + "list", + "item", + "itemText", +) + +export const parts = anatomy.build() diff --git a/packages/machines/cascader/src/cascader.collection.ts b/packages/machines/cascader/src/cascader.collection.ts new file mode 100644 index 0000000000..8b74128c96 --- /dev/null +++ b/packages/machines/cascader/src/cascader.collection.ts @@ -0,0 +1,10 @@ +import { TreeCollection, type TreeCollectionOptions } from "@zag-js/collection" +import { ref } from "@zag-js/core" + +export const collection = (options: TreeCollectionOptions): TreeCollection => { + return ref(new TreeCollection(options)) +} + +collection.empty = (): TreeCollection => { + return ref(new TreeCollection({ rootNode: { children: [] } })) +} diff --git a/packages/machines/cascader/src/cascader.connect.ts b/packages/machines/cascader/src/cascader.connect.ts new file mode 100644 index 0000000000..dac74de3bb --- /dev/null +++ b/packages/machines/cascader/src/cascader.connect.ts @@ -0,0 +1,390 @@ +import type { NormalizeProps, PropTypes } from "@zag-js/types" +import { getEventKey, isLeftClick, type EventKeyMap } from "@zag-js/dom-event" + +import type { State, Send, MachineApi, NodeProps, NodeState } from "./cascader.types" +import { parts } from "./cascader.anatomy" +import { dom } from "./cascader.dom" +import { ariaAttr, dataAttr, isEditableElement, isSelfTarget, isValidTabEvent } from "@zag-js/dom-query" +import { getPlacementStyles } from "@zag-js/popper" + +export function connect( + state: State, + send: Send, + normalize: NormalizeProps, +): MachineApi { + const disabled = state.context.isDisabled + const invalid = state.context.invalid + const readOnly = state.context.readOnly + const required = state.context.required + const interactive = state.context.isInteractive + + const highlightedIndexPath = state.context.highlightedIndexPath + const highlightedItem = state.context.highlightedItem + const selectedItems = state.context.selectedItems + const highlightedValue = state.context.highlightedValue + + const open = state.hasTag("open") + const focused = state.matches("focused") + + const collection = state.context.collection + + const popperStyles = getPlacementStyles({ + ...state.context.positioning, + placement: state.context.currentPlacement, + }) + + function getNodeState(props: NodeProps): NodeState { + const { node, indexPath } = props + const value = collection.getNodeValue(node) + const isBranch = collection.isBranchNode(node) + const highlighted = highlightedIndexPath.join(",").startsWith(indexPath.join(",")) + const depth = indexPath.length + const selected = state.context.value.includes(value) + + return { + value, + valuePath: collection.getValuePath(indexPath), + disabled: Boolean(node.disabled), + depth, + isBranch, + highlighted, + selected, + } + } + + return { + open: open, + collection: state.context.collection, + disabled, + focused, + multiple: !!state.context.multiple, + empty: state.context.value.length === 0, + highlightedValue, + highlightedItem, + highlightedIndexPath, + hasSelectedItems: state.context.hasSelectedItems, + selectedItems, + + reposition(options = {}) { + send({ type: "POSITIONING.SET", options }) + }, + focus() { + dom.getTriggerEl(state.context)?.focus({ preventScroll: true }) + }, + setOpen(nextOpen) { + if (nextOpen === open) return + send(nextOpen ? "OPEN" : "CLOSE") + }, + selectValue(value) { + send({ type: "ITEM.SELECT", value }) + }, + setValue(value) { + send({ type: "VALUE.SET", value }) + }, + selectAll() { + send({ type: "VALUE.SET", value: collection.getValues() }) + }, + highlightValue(value) { + send({ type: "HIGHLIGHTED_VALUE.SET", value }) + }, + clearValue(value) { + if (value) { + send({ type: "ITEM.CLEAR", value }) + } else { + send({ type: "VALUE.CLEAR" }) + } + }, + + getRootProps() { + return normalize.element({ + ...parts.root.attrs, + id: dom.getRootId(state.context), + dir: state.context.dir, + "data-invalid": dataAttr(invalid), + "data-readonly": dataAttr(readOnly), + }) + }, + + getLabelProps() { + return normalize.element({ + ...parts.label.attrs, + id: dom.getLabelId(state.context), + dir: state.context.dir, + "data-disabled": dataAttr(disabled), + "data-invalid": dataAttr(invalid), + "data-readonly": dataAttr(readOnly), + // htmlFor: dom.getHiddenSelectId(state.context), + onClick(event) { + if (event.defaultPrevented) return + if (disabled) return + dom.getTriggerEl(state.context)?.focus({ preventScroll: true }) + }, + }) + }, + + getControlProps() { + return normalize.element({ + ...parts.control.attrs, + dir: state.context.dir, + id: dom.getControlId(state.context), + "data-state": open ? "open" : "closed", + "data-focus": dataAttr(focused), + "data-disabled": dataAttr(disabled), + "data-invalid": dataAttr(invalid), + }) + }, + + getTriggerProps() { + return normalize.button({ + ...parts.trigger.attrs, + dir: state.context.dir, + id: dom.getTriggerId(state.context), + "data-state": open ? "open" : "closed", + "data-disabled": dataAttr(disabled), + "data-invalid": dataAttr(invalid), + "data-readonly": dataAttr(readOnly), + "data-focus": dataAttr(focused), + type: "button", + disabled: disabled, + "aria-labelledby": dom.getLabelId(state.context), + "aria-controls": dom.getContentId(state.context), + "aria-expanded": open, + "aria-haspopup": "listbox", + "aria-invalid": invalid, + "data-placement": state.context.currentPlacement, + // "data-placeholder-shown": dataAttr(!hasSelectedItems), + + onPointerDown(event) { + if (!isLeftClick(event)) return + if (!interactive) return + event.currentTarget.dataset.pointerType = event.pointerType + if (disabled || event.pointerType === "touch") return + send({ type: "TRIGGER.CLICK" }) + }, + onClick(event) { + if (!interactive || event.button) return + if (event.currentTarget.dataset.pointerType === "touch") { + send({ type: "TRIGGER.CLICK" }) + } + }, + + onFocus() { + send("TRIGGER.FOCUS") + }, + onBlur() { + send("TRIGGER.BLUR") + }, + + onKeyDown(event) { + if (event.defaultPrevented) return + if (!interactive) return + + const keyMap: EventKeyMap = { + ArrowUp() { + send({ type: "TRIGGER.ARROW_UP" }) + }, + ArrowDown(event) { + send({ type: event.altKey ? "OPEN" : "TRIGGER.ARROW_DOWN" }) + }, + ArrowLeft() { + send({ type: "OPEN" }) + }, + ArrowRight() { + send({ type: "OPEN" }) + }, + Enter() { + send({ type: "TRIGGER.ENTER" }) + }, + Space() { + send({ type: "TRIGGER.ENTER" }) + }, + } + + const exec = keyMap[getEventKey(event, state.context)] + + if (exec) { + exec(event) + event.preventDefault() + return + } + }, + }) + }, + + getClearTriggerProps() { + return normalize.button({ + ...parts.clearTrigger.attrs, + id: dom.getClearTriggerId(state.context), + type: "button", + "aria-label": "Clear value", + "data-invalid": dataAttr(invalid), + disabled: disabled, + // hidden: !state.context.hasSelectedItems, + dir: state.context.dir, + onClick(event) { + if (event.defaultPrevented) return + send("CLEAR.CLICK") + }, + }) + }, + + getPositionerProps() { + return normalize.element({ + ...parts.positioner.attrs, + dir: state.context.dir, + id: dom.getPositionerId(state.context), + style: popperStyles.floating, + }) + }, + + getContentProps() { + const highlightedValue = collection.getNodeValue(collection.at(highlightedIndexPath)) + const ariaActiveDescendant = highlightedIndexPath.length + ? dom.getItemId(state.context, highlightedValue) + : undefined + + return normalize.element({ + hidden: !open, + ...parts.content.attrs, + dir: state.context.dir, + id: dom.getContentId(state.context), + role: "tree", + "data-state": open ? "open" : "closed", + "data-placement": state.context.currentPlacement, + "data-activedescendant": ariaActiveDescendant, + "aria-activedescendant": ariaActiveDescendant, + "aria-multiselectable": state.context.multiple, + "aria-labelledby": dom.getLabelId(state.context), + "aria-required": required, + "aria-readonly": readOnly, + + tabIndex: 0, + onKeyDown(event) { + if (!interactive) return + if (!isSelfTarget(event)) return + + // cascader should not be navigated using tab key so we prevent it + if (event.key === "Tab") { + const valid = isValidTabEvent(event) + if (!valid) { + event.preventDefault() + return + } + } + + const keyMap: EventKeyMap = { + ArrowRight() { + send({ type: "CONTENT.ARROW_RIGHT" }) + }, + ArrowLeft() { + send({ type: "CONTENT.ARROW_LEFT" }) + }, + Backspace() { + send({ type: "CONTENT.ARROW_LEFT", src: "keydown.backspace" }) + }, + ArrowUp() { + send({ type: "CONTENT.ARROW_UP" }) + }, + ArrowDown() { + send({ type: "CONTENT.ARROW_DOWN" }) + }, + Home() { + send({ type: "CONTENT.HOME" }) + }, + End() { + send({ type: "CONTENT.END" }) + }, + Enter() { + if (!highlightedIndexPath.length) return + send({ type: "ITEM.CLICK", src: "keydown.enter", indexPath: highlightedIndexPath }) + }, + Space() { + if (!highlightedIndexPath.length) return + send({ type: "ITEM.CLICK", src: "keydown.space", indexPath: highlightedIndexPath }) + }, + } + + const exec = keyMap[getEventKey(event)] + + if (exec) { + exec(event) + event.preventDefault() + return + } + + if (isEditableElement(event.target)) { + return + } + }, + }) + }, + + getNodeState, + + getListProps(props) { + const itemState = getNodeState(props) + + return normalize.element({ + ...parts.list.attrs, + id: dom.getListId(state.context, itemState.value), + dir: state.context.dir, + role: "group", + "aria-level": itemState.depth, + }) + }, + + getItemProps(props) { + const itemState = getNodeState(props) + + const { indexPath, closeOnSelect } = props + + return normalize.element({ + ...parts.item.attrs, + id: dom.getItemId(state.context, itemState.value), + dir: state.context.dir, + role: "treeitem", + "data-index-path": props.indexPath.join(","), + "aria-expanded": itemState.isBranch ? itemState.highlighted : false, + "aria-controls": itemState.isBranch ? dom.getListId(state.context, itemState.value) : undefined, + "data-value": itemState.value, + // "aria-selected": itemState.selected, + // "data-state": itemState.selected ? "checked" : "unchecked", + "data-highlighted": dataAttr(itemState.highlighted), + "data-disabled": dataAttr(itemState.disabled), + "aria-disabled": ariaAttr(itemState.disabled), + // "data-selected": dataAttr(itemState.selected), + onDoubleClick() { + if (itemState.disabled) return + send("CLOSE") + }, + onPointerMove(event) { + if (itemState.disabled || event.pointerType !== "mouse") return + if (state.context.highlightedIndexPath.join(",") === props.indexPath.join(",")) return + // We only want to highlight items that have children (mouse only) + if (!itemState.isBranch) return + send({ type: "ITEM.POINTER_MOVE", indexPath }) + }, + onClick(event) { + if (event.defaultPrevented) return + if (itemState.disabled) return + send({ type: "ITEM.CLICK", src: "pointerup", indexPath, closeOnSelect }) + }, + onTouchEnd(event) { + // prevent clicking elements behind content + event.preventDefault() + event.stopPropagation() + }, + }) + }, + + getItemTextProps(props) { + const itemState = getNodeState(props) + return normalize.element({ + ...parts.itemText.attrs, + // "data-state": itemState.selected ? "checked" : "unchecked", + "data-disabled": dataAttr(itemState.disabled), + "data-highlighted": dataAttr(itemState.highlighted), + }) + }, + } +} diff --git a/packages/machines/cascader/src/cascader.dom.ts b/packages/machines/cascader/src/cascader.dom.ts new file mode 100644 index 0000000000..fc605709c0 --- /dev/null +++ b/packages/machines/cascader/src/cascader.dom.ts @@ -0,0 +1,21 @@ +import { createScope, queryAll } from "@zag-js/dom-query" +import type { MachineContext as Ctx } from "./cascader.types" + +export const dom = createScope({ + getRootId: (ctx: Ctx) => ctx.ids?.root ?? `cascader:${ctx.id}`, + getLabelId: (ctx: Ctx) => ctx.ids?.label ?? `cascader:${ctx.id}:label`, + getControlId: (ctx: Ctx) => ctx.ids?.control ?? `cascader:${ctx.id}:control`, + getTriggerId: (ctx: Ctx) => ctx.ids?.trigger ?? `cascader:${ctx.id}:trigger`, + getClearTriggerId: (ctx: Ctx) => ctx.ids?.clearTrigger ?? `cascader:${ctx.id}:clear-trigger`, + getPositionerId: (ctx: Ctx) => ctx.ids?.positioner ?? `cascader:${ctx.id}:positioner`, + getContentId: (ctx: Ctx) => ctx.ids?.content ?? `cascader:${ctx.id}:content`, + getListId: (ctx: Ctx, value: string) => ctx.ids?.list?.(value) ?? `cascader:${ctx.id}:list:${value}`, + getItemId: (ctx: Ctx, value: string) => ctx.ids?.item?.(value) ?? `cascader:${ctx.id}:item:${value}`, + + getTriggerEl: (ctx: Ctx) => dom.getById(ctx, dom.getTriggerId(ctx)), + getClearTriggerEl: (ctx: Ctx) => dom.getById(ctx, dom.getClearTriggerId(ctx)), + getContentEl: (ctx: Ctx) => dom.getById(ctx, dom.getContentId(ctx)), + getPositionerEl: (ctx: Ctx) => dom.getById(ctx, dom.getPositionerId(ctx)), + + getListEls: (ctx: Ctx) => queryAll(dom.getContentEl(ctx), `[data-part=list]`), +}) diff --git a/packages/machines/cascader/src/cascader.machine.ts b/packages/machines/cascader/src/cascader.machine.ts new file mode 100644 index 0000000000..b2d6c522db --- /dev/null +++ b/packages/machines/cascader/src/cascader.machine.ts @@ -0,0 +1,606 @@ +import { createMachine, guards } from "@zag-js/core" +import { compact, isEqual } from "@zag-js/utils" +import { trackDismissableElement } from "@zag-js/dismissable" +import type { MachineContext, MachineState, UserDefinedContext } from "./cascader.types" +import { getInitialFocus, observeAttributes, query, raf, scrollIntoView } from "@zag-js/dom-query" +import { dom } from "./cascader.dom" +import { getPlacement } from "@zag-js/popper" +import { collection } from "./cascader.collection" +import * as utils from "./cascader.utils" +const { and, or } = guards + +export function machine(userContext: UserDefinedContext) { + const ctx = compact(userContext) + return createMachine, MachineState>( + { + id: "cascader", + context: { + disabled: false, + readOnly: false, + loopFocus: false, + expandTrigger: "hover", + closeOnSelect: !ctx.multiple, + multiple: false, + value: [], + highlightedValue: null, + ...ctx, + highlightedItem: null, + selectedItems: [], + highlightedIndexPath: [], + valueIndexPaths: [], + fieldsetDisabled: false, + collection: ctx.collection ?? collection.empty(), + positioning: { + placement: "bottom-start", + gutter: 8, + ...ctx.positioning, + }, + }, + + computed: { + isDisabled: (ctx) => !!ctx.disabled || ctx.fieldsetDisabled, + isInteractive: (ctx) => !(ctx.isDisabled || ctx.readOnly), + }, + + initial: ctx.open ? "open" : "idle", + + entry: ["syncSelectedItems", "syncHighlightedItem"], + + watch: { + open: ["toggleVisibility"], + value: ["syncSelectedItems"], + highlightedValue: ["syncHighlightedItem"], + }, + + on: { + "HIGHLIGHTED_VALUE.SET": { + actions: ["setHighlightedItem"], + }, + "ITEM.SELECT": { + actions: ["selectItem"], + }, + "ITEM.CLEAR": { + actions: ["clearItem"], + }, + "VALUE.SET": { + actions: ["setSelectedItems"], + }, + "VALUE.CLEAR": { + actions: ["clearSelectedItems"], + }, + }, + + states: { + idle: { + tags: ["closed"], + on: { + "CONTROLLED.OPEN": [ + { + guard: "isTriggerClickEvent", + target: "open", + actions: ["setInitialFocus", "highlightFirstSelectedItem"], + }, + { + target: "open", + actions: ["setInitialFocus"], + }, + ], + "TRIGGER.CLICK": [ + { + guard: "isOpenControlled", + actions: ["invokeOnOpen"], + }, + { + target: "open", + actions: ["invokeOnOpen", "setInitialFocus", "highlightFirstSelectedItem"], + }, + ], + "TRIGGER.FOCUS": { + target: "focused", + }, + OPEN: [ + { + guard: "isOpenControlled", + actions: ["invokeOnOpen"], + }, + { + target: "open", + actions: ["setInitialFocus", "invokeOnOpen"], + }, + ], + }, + }, + + focused: { + tags: ["closed"], + on: { + "CONTROLLED.OPEN": [ + { + guard: "isTriggerClickEvent", + target: "open", + actions: ["setInitialFocus", "highlightFirstSelectedItem"], + }, + { + guard: "isTriggerArrowUpEvent", + target: "open", + actions: ["setInitialFocus", "highlightComputedLastItem"], + }, + { + guard: or("isTriggerArrowDownEvent", "isTriggerEnterEvent"), + target: "open", + actions: ["setInitialFocus", "highlightComputedFirstItem"], + }, + { + target: "open", + actions: ["setInitialFocus"], + }, + ], + OPEN: [ + { + guard: "isOpenControlled", + actions: ["invokeOnOpen"], + }, + { + target: "open", + actions: ["setInitialFocus", "invokeOnOpen"], + }, + ], + "TRIGGER.BLUR": { + target: "idle", + }, + "TRIGGER.CLICK": [ + { + guard: "isOpenControlled", + actions: ["invokeOnOpen"], + }, + { + target: "open", + actions: ["setInitialFocus", "invokeOnOpen", "highlightFirstSelectedItem"], + }, + ], + "TRIGGER.ENTER": [ + { + guard: "isOpenControlled", + actions: ["invokeOnOpen"], + }, + { + target: "open", + actions: ["setInitialFocus", "invokeOnOpen", "highlightComputedFirstItem"], + }, + ], + "TRIGGER.ARROW_UP": [ + { + guard: "isOpenControlled", + actions: ["invokeOnOpen"], + }, + { + target: "open", + actions: ["setInitialFocus", "invokeOnOpen", "highlightComputedLastItem"], + }, + ], + "TRIGGER.ARROW_DOWN": [ + { + guard: "isOpenControlled", + actions: ["invokeOnOpen"], + }, + { + target: "open", + actions: ["setInitialFocus", "invokeOnOpen", "highlightComputedFirstItem"], + }, + ], + }, + }, + + open: { + tags: ["open"], + exit: ["scrollListsToTop"], + activities: ["trackDismissableElement", "computePlacement", "scrollToHighlightedItems"], + on: { + "CONTROLLED.CLOSE": { + target: "focused", + actions: ["focusTriggerEl", "clearHighlightedItem"], + }, + CLOSE: [ + { + guard: "isOpenControlled", + actions: ["invokeOnClose"], + }, + { + target: "focused", + actions: ["invokeOnClose", "focusTriggerEl", "clearHighlightedItem"], + }, + ], + "TRIGGER.CLICK": [ + { + guard: "isOpenControlled", + actions: ["invokeOnClose"], + }, + { + target: "focused", + actions: ["invokeOnClose", "clearHighlightedItem"], + }, + ], + "ITEM.CLICK": [ + // === Grouped transitions (based on `closeOnSelect` and `isOpenControlled`) === + { + guard: and("isLeafNode", "closeOnSelect", "isOpenControlled"), + actions: ["selectItemAtIndexPath", "invokeOnClose"], + }, + { + guard: and("isLeafNode", "closeOnSelect"), + target: "focused", + actions: ["selectItemAtIndexPath", "invokeOnClose", "focusTriggerEl", "clearHighlightedItem"], + }, + { + guard: "isLeafNode", + actions: ["highlightItem", "selectItemAtIndexPath"], + }, + // === + { + guard: "isClickTrigger", + actions: ["highlightItem"], + }, + ], + + "CONTENT.HOME": [ + { + guard: "hasHighlightedItem", + actions: ["highlightFirstItem"], + }, + { + actions: ["highlightFirstItemInRoot"], + }, + ], + "CONTENT.END": [ + { + guard: "hasHighlightedItem", + actions: ["highlightLastItem"], + }, + { + actions: ["highlightLastItemInRoot"], + }, + ], + "CONTENT.ARROW_DOWN": [ + { + guard: and("hasHighlightedItem", "loop", "isLastItemHighlighted"), + actions: ["highlightFirstItem"], + }, + { + guard: "hasHighlightedItem", + actions: ["highlightNextItem"], + }, + { + actions: ["highlightFirstItemInRoot"], + }, + ], + "CONTENT.ARROW_UP": [ + { + guard: and("hasHighlightedItem", "loop", "isFirstItemHighlighted"), + actions: ["highlightLastItem"], + }, + { + guard: "hasHighlightedItem", + actions: ["highlightPreviousItem"], + }, + { + actions: ["highlightLastItemInRoot"], + }, + ], + "CONTENT.ARROW_LEFT": [ + { + guard: "isHighlightedItemInSubLevel", + actions: ["highlightItemParent"], + }, + { + guard: "isOpenControlled", + actions: ["invokeOnClose"], + }, + { + target: "focused", + actions: ["invokeOnClose", "focusTriggerEl", "clearHighlightedItem"], + }, + ], + "CONTENT.ARROW_RIGHT": { + guard: "hasHighlightedItem", + actions: ["highlightItemFirstChild"], + }, + "ITEM.POINTER_MOVE": { + guard: "isHoverTrigger", + actions: ["highlightItem"], + }, + "POSITIONING.SET": { + actions: ["reposition"], + }, + }, + }, + }, + }, + { + guards: { + // context assertions + loop: (ctx) => !!ctx.loopFocus, + isInteractive: (ctx) => !(ctx.isDisabled || ctx.readOnly), + hasHighlightedItem: (ctx) => ctx.highlightedIndexPath.length > 0, + hasSelectedItems: (ctx) => ctx.value.length > 0, + isHoverTrigger: (ctx) => ctx.expandTrigger === "hover", + isClickTrigger: (ctx) => ctx.expandTrigger === "click", + closeOnSelect: (ctx, evt) => !!(evt.closeOnSelect ?? ctx.closeOnSelect), + // state assertions + isFirstItemHighlighted: (ctx) => ctx.highlightedIndexPath.at(-1) === 0, + isLastItemHighlighted: (ctx) => { + const itemIndex = ctx.highlightedIndexPath.at(-1) + if (!itemIndex && itemIndex !== 0) return false + + const parentIndexPath = ctx.highlightedIndexPath.slice(0, -1) + const nextSibling = ctx.collection.at([...parentIndexPath, itemIndex + 1]) + + return !nextSibling + }, + isHighlightedItemInSubLevel: (ctx) => ctx.highlightedIndexPath.length > 1, + isLeafNode: (ctx, evt) => !ctx.collection.isBranchNode(ctx.collection.at(evt.indexPath)), + // guard assertions (for controlled mode) + isOpenControlled: (ctx) => !!ctx["open.controlled"], + isTriggerClickEvent: (_ctx, evt) => evt.previousEvent?.type === "TRIGGER.CLICK", + isTriggerEnterEvent: (_ctx, evt) => evt.previousEvent?.type === "TRIGGER.ENTER", + isTriggerArrowUpEvent: (_ctx, evt) => evt.previousEvent?.type === "TRIGGER.ARROW_UP", + isTriggerArrowDownEvent: (_ctx, evt) => evt.previousEvent?.type === "TRIGGER.ARROW_DOWN", + }, + activities: { + trackFormControlState(ctx, _evt, { initialContext }) { + // return trackFormControl(dom.getHiddenSelectEl(ctx), { + // onFieldsetDisabledChange(disabled) { + // ctx.fieldsetDisabled = disabled + // }, + // onFormReset() { + // set.selectedItems(ctx, initialContext.value) + // }, + // }) + }, + trackDismissableElement(ctx, _evt, { send }) { + const contentEl = () => dom.getContentEl(ctx) + let restoreFocus = true + return trackDismissableElement(contentEl, { + defer: true, + exclude: [dom.getTriggerEl(ctx), dom.getClearTriggerEl(ctx)], + onFocusOutside: ctx.onFocusOutside, + onPointerDownOutside: ctx.onPointerDownOutside, + onInteractOutside(event) { + ctx.onInteractOutside?.(event) + restoreFocus = !(event.detail.focusable || event.detail.contextmenu) + }, + onDismiss() { + send({ type: "CLOSE", src: "interact-outside", restoreFocus }) + }, + }) + }, + computePlacement(ctx) { + ctx.currentPlacement = ctx.positioning.placement + const triggerEl = () => dom.getTriggerEl(ctx) + const positionerEl = () => dom.getPositionerEl(ctx) + return getPlacement(triggerEl, positionerEl, { + defer: true, + ...ctx.positioning, + onComplete(data) { + ctx.currentPlacement = data.placement + }, + }) + }, + scrollToHighlightedItems(ctx, _evt, { getState }) { + const exec = () => { + if (!ctx.highlightedIndexPath.length) return + const state = getState() + + // don't scroll into view if we're using the pointer + if (state.event.type.includes("POINTER")) return + + // scroll to highlighted items in each list + dom.getListEls(ctx).forEach((listEl) => { + const itemEl = query(listEl, "[data-part=item][data-highlighted]") + if (!itemEl) return + scrollIntoView(itemEl, { rootEl: listEl, block: "nearest" }) + }) + } + + raf(() => exec()) + + const contentEl = () => dom.getContentEl(ctx) + return observeAttributes(contentEl, { + defer: true, + attributes: ["data-activedescendant"], + callback() { + exec() + }, + }) + }, + }, + actions: { + reposition(ctx, evt) { + const positionerEl = () => dom.getPositionerEl(ctx) + getPlacement(dom.getTriggerEl(ctx), positionerEl, { + ...ctx.positioning, + ...evt.options, + defer: true, + listeners: false, + onComplete(data) { + ctx.currentPlacement = data.placement + }, + }) + }, + setInitialFocus(ctx) { + raf(() => { + const element = getInitialFocus({ + root: dom.getContentEl(ctx), + }) + element?.focus({ preventScroll: true }) + }) + }, + focusTriggerEl(ctx, evt) { + const restoreFocus = evt.restoreFocus ?? evt.previousEvent?.restoreFocus + if (restoreFocus != null && !restoreFocus) return + raf(() => { + const element = dom.getTriggerEl(ctx) + element?.focus({ preventScroll: true }) + }) + }, + scrollListsToTop(ctx) { + dom.getListEls(ctx).forEach((listEl) => { + listEl.scrollTo(0, 0) + }) + }, + invokeOnOpen(ctx) { + ctx.onOpenChange?.({ open: true }) + }, + invokeOnClose(ctx) { + ctx.onOpenChange?.({ open: false }) + }, + clearHighlightedItem(ctx) { + set.highlightedItem(ctx, []) + }, + highlightItem(ctx, evt) { + set.highlightedItem(ctx, evt.indexPath) + }, + highlightItemFirstChild(ctx) { + const item = ctx.collection.at(ctx.highlightedIndexPath) + if (!ctx.collection.isBranchNode(item)) return + ctx.highlightedIndexPath.push(0) + }, + highlightItemParent(ctx) { + ctx.highlightedIndexPath.pop() + }, + highlightFirstItem(ctx) { + ctx.highlightedIndexPath[ctx.highlightedIndexPath.length - 1] = 0 + }, + highlightLastItem(ctx) { + const siblings = utils.getSiblings(ctx) + if (!siblings) return + + ctx.highlightedIndexPath[ctx.highlightedIndexPath.length - 1] = siblings.length - 1 + }, + highlightFirstItemInRoot(ctx) { + set.highlightedItem(ctx, [0]) + }, + highlightLastItemInRoot(ctx) { + const rootNodes = ctx.collection.getNodeChildren(ctx.collection.rootNode) + set.highlightedItem(ctx, [rootNodes.length - 1]) + }, + highlightNextItem(ctx) { + const nextSibling = utils.getNextSibling(ctx) + set.highlightedItem(ctx, nextSibling) + }, + highlightPreviousItem(ctx) { + const previousSibling = utils.getPreviousSibling(ctx) + set.highlightedItem(ctx, previousSibling) + }, + highlightFirstSelectedItem(ctx) { + const firstSelected = ctx.valueIndexPaths[0] + if (!firstSelected) return + set.highlightedItem(ctx, firstSelected) + }, + highlightComputedFirstItem(ctx) { + const firstItem = ctx.valueIndexPaths.length > 0 ? ctx.valueIndexPaths[0] : [0] + set.highlightedItem(ctx, firstItem) + }, + highlightComputedLastItem(ctx) { + const lastItem = ctx.valueIndexPaths.length > 0 ? ctx.valueIndexPaths.at(-1) : [0] + set.highlightedItem(ctx, lastItem) + }, + selectItemAtIndexPath(ctx, evt) { + set.selectedItem(ctx, evt.indexPath) + }, + setHighlightedItem(ctx, evt) { + const item = ctx.collection.getIndexPath(evt.value) + set.highlightedItem(ctx, item) + }, + selectItem(ctx, evt) { + const item = ctx.collection.getIndexPath(evt.value) + set.selectedItem(ctx, item) + }, + clearItem(ctx, evt) { + const value = ctx.value.filter((v) => v !== evt.value) + set.selectedItems(ctx, value) + }, + setSelectedItems(ctx, evt) { + set.selectedItems(ctx, evt.value) + }, + clearSelectedItems(ctx) { + set.selectedItems(ctx, []) + }, + syncSelectedItems(ctx) { + sync.valueChange(ctx) + }, + syncHighlightedItem(ctx) { + sync.highlightChange(ctx) + }, + }, + }, + ) +} + +const sync = { + valueChange: (ctx: MachineContext) => { + ctx.valueIndexPaths = ctx.value.map((value) => ctx.collection.getIndexPath(value)!) + ctx.selectedItems = ctx.valueIndexPaths.map((path) => ctx.collection.at(path)) + }, + highlightChange: (ctx: MachineContext) => { + if (!ctx.highlightedValue) { + ctx.highlightedIndexPath = [] + return + } + const indexPath = ctx.collection.getIndexPath(ctx.highlightedValue) + ctx.highlightedIndexPath = indexPath ?? [] + const item = ctx.collection.at(ctx.highlightedIndexPath) + if (item) ctx.highlightedItem = item + }, +} + +const invoke = { + valueChange: (ctx: MachineContext) => { + sync.valueChange(ctx) + ctx.onValueChange?.({ + indexPaths: Array.from(ctx.valueIndexPaths), + value: ctx.valueIndexPaths.map((path) => ctx.collection.getNodeValue(ctx.collection.at(path))), + }) + }, + highlightChange: (ctx: MachineContext) => { + sync.highlightChange(ctx) + ctx.onHighlightChange?.({ + indexPath: ctx.highlightedIndexPath, + value: ctx.collection.getNodeValue(ctx.collection.at(ctx.highlightedIndexPath)), + }) + }, +} + +const set = { + selectedItem(ctx: MachineContext, indexPath: number[] | undefined) { + if (!indexPath) return + + const item = ctx.collection.at(indexPath) + const value = ctx.collection.getNodeValue(item) + + if (ctx.value.includes(value)) return + + if (ctx.multiple) { + ctx.valueIndexPaths.push(indexPath) + ctx.value.push(value) + } else { + ctx.valueIndexPaths = [indexPath] + ctx.value = [value] + } + + invoke.valueChange(ctx) + }, + selectedItems: (ctx: MachineContext, value: string[]) => { + if (isEqual(ctx.value, value)) return + + ctx.value = value + invoke.valueChange(ctx) + }, + highlightedItem(ctx: MachineContext, indexPath: number[] | undefined) { + if (!indexPath) return + ctx.highlightedIndexPath = indexPath + + const item = ctx.collection.at(indexPath) + ctx.highlightedValue = ctx.collection.getNodeValue(item) + invoke.highlightChange(ctx) + }, +} diff --git a/packages/machines/cascader/src/cascader.props.ts b/packages/machines/cascader/src/cascader.props.ts new file mode 100644 index 0000000000..d27e8bc4a3 --- /dev/null +++ b/packages/machines/cascader/src/cascader.props.ts @@ -0,0 +1,6 @@ +import { createProps } from "@zag-js/types" +import { createSplitProps } from "@zag-js/utils" +import type { UserDefinedContext } from "./cascader.types" + +export const props = createProps()([]) +export const splitProps = createSplitProps>(props) diff --git a/packages/machines/cascader/src/cascader.types.ts b/packages/machines/cascader/src/cascader.types.ts new file mode 100644 index 0000000000..2a8e565078 --- /dev/null +++ b/packages/machines/cascader/src/cascader.types.ts @@ -0,0 +1,332 @@ +import type { TreeCollection, TreeNode } from "@zag-js/collection" +import type { Machine, StateMachine as S } from "@zag-js/core" +import type { InteractOutsideHandlers } from "@zag-js/dismissable" +import type { CommonProperties, DirectionProperty, PropTypes, RequiredBy } from "@zag-js/types" +import type { Placement, PositioningOptions } from "@zag-js/popper" + +/* ----------------------------------------------------------------------------- + * Callback details + * -----------------------------------------------------------------------------*/ + +export interface HighlightChangeDetails { + indexPath: number[] + value: string +} + +export interface ValueChangeDetails { + indexPaths: number[][] + value: string[] +} + +export interface OpenChangeDetails { + open: boolean +} + +export type ElementIds = Partial<{ + root: string + label: string + control: string + trigger: string + clearTrigger: string + positioner: string + content: string + list(value: string): string + item(value: string): string +}> + +interface PublicContext extends DirectionProperty, CommonProperties, InteractOutsideHandlers { + /** + * The tree collection data + */ + collection: TreeCollection + /** + * The ids of the tree elements. Useful for composition. + */ + ids?: ElementIds | undefined + /** + * The `name` attribute of the underlying input. + */ + name?: string | undefined + /** + * The associate form of the underlying input. + */ + form?: string | undefined + /** + * The positioning options of the menu. + */ + positioning: PositioningOptions + /** + * Whether the cascader is disabled + */ + disabled?: boolean | undefined + /** + * Whether the cascader is invalid + */ + invalid?: boolean | undefined + /** + * Whether the cascader is read-only + */ + readOnly?: boolean | undefined + /** + * Whether the cascader is required + */ + required?: boolean | undefined + /** + * Whether the cascader should close after an item is selected + * @default true + */ + closeOnSelect?: boolean | undefined + /** + * The callback fired when the highlighted item changes. + */ + onHighlightChange?: ((details: HighlightChangeDetails) => void) | undefined + /** + * The callback fired when the selected item changes. + */ + onValueChange?: ((details: ValueChangeDetails) => void) | undefined + /** + * Function called when the popup is opened + */ + onOpenChange?: ((details: OpenChangeDetails) => void) | undefined + /** + * Whether to loop the keyboard navigation through the options + * @default false + */ + loopFocus?: boolean | undefined + /** + * Whether to allow multiple selection + */ + multiple?: boolean | undefined + /** + * The trigger to expand the menu + * @default "hover" + */ + expandTrigger: "click" | "hover" + /** + * Whether the cascader menu is open + */ + open?: boolean | undefined + /** + * Whether the cascader's open state is controlled by the user + */ + "open.controlled"?: boolean | undefined + /** + * The highlighted item + */ + highlightedValue: string | null + /** + * The selected items + */ + value: string[] +} + +interface PrivateContext { + /** + * @internal + * The current placement of the menu + */ + currentPlacement?: Placement | undefined + /** + * @internal + * Whether the fieldset is disabled + */ + fieldsetDisabled: boolean + /** + * The index path of the highlighted item + */ + highlightedIndexPath: number[] + /** + * The highlighted item + */ + highlightedItem: V | null + /** + * The index path of the highlighted item + */ + valueIndexPaths: number[][] + /** + * @computed + * The selected items + */ + selectedItems: V[] +} + +type ComputedContext = Readonly<{ + /** + * @computed + * Whether there's a selected option + */ + hasSelectedItems: boolean + /** + * @computed + * Whether the cascader is interactive + */ + isInteractive: boolean + /** + * @computed + * Whether the cascader is disabled + */ + isDisabled: boolean +}> + +export type UserDefinedContext = RequiredBy, "id" | "collection"> + +export interface MachineContext extends PublicContext, PrivateContext, ComputedContext {} + +export interface MachineState { + value: "idle" | "focused" | "open" + tags: "open" | "closed" +} + +export type State = S.State, MachineState> + +export type Send = S.Send + +export type Service = Machine + +/* ----------------------------------------------------------------------------- + * Component API + * -----------------------------------------------------------------------------*/ + +export interface NodeProps { + /** + * The tree node + */ + node: TreeNode + /** + * The index path of the tree node + */ + indexPath: number[] + /** + * Whether the cascader should be closed when the option is selected. + */ + closeOnSelect?: boolean | undefined +} + +export interface NodeState { + /** + * The value of the tree item + */ + value: string + /** + * The value path of the tree item + */ + valuePath: string[] + /** + * Whether the tree item is disabled + */ + disabled: boolean + /** + * Whether the item is selected + */ + selected: boolean + /** + * Whether the item is highlighted + */ + highlighted: boolean + /** + * The depth of the tree item + */ + depth: number + /** + * Whether the tree item is a branch + */ + isBranch: boolean +} + +export interface MachineApi { + /** + * The tree collection data + */ + collection: TreeCollection + /** + * The index path of the highlighted item + */ + highlightedIndexPath: number[] + /** + * The value of the highlighted item + */ + highlightedValue: string | null + /** + * The highlighted item + */ + highlightedItem: V | null + /** + * Function to highlight a value + */ + highlightValue(value: string): void + /** + * The selected items + */ + selectedItems: V[] + /** + * Whether there's a selected option + */ + hasSelectedItems: boolean + /** + * Whether the cascader is open + */ + open: boolean + /** + * Whether the cascader is focused + */ + focused: boolean + /** + * Whether the cascader value is empty + */ + empty: boolean + /** + * Function to select a value + */ + selectValue(value: string): void + /** + * Function to select all values + */ + selectAll(): void + /** + * Function to set the value of the cascader + */ + setValue(value: string[]): void + /** + * Function to clear the value of the cascader. + * If a value is provided, it will only clear that value, otherwise, it will clear all values. + */ + clearValue(value?: string): void + /** + * Function to focus on the cascader trigger + */ + focus(): void + /** + * Function to open or close the cascader + */ + setOpen(open: boolean): void + /** + * Function to set the positioning options of the cascader + */ + reposition(options?: Partial): void + /** + * Whether the cascader allows multiple selections + */ + multiple: boolean + /** + * Whether the cascader is disabled + */ + disabled: boolean + + getNodeState(props: NodeProps): NodeState + getRootProps(): T["element"] + getLabelProps(): T["label"] + getControlProps(): T["element"] + getTriggerProps(): T["button"] + getClearTriggerProps(): T["button"] + getPositionerProps(): T["element"] + getContentProps(): T["element"] + getListProps(props: NodeProps): T["element"] + getItemProps(props: NodeProps): T["element"] + getItemTextProps(props: NodeProps): T["element"] +} + +/* ----------------------------------------------------------------------------- + * Re-exported types + * -----------------------------------------------------------------------------*/ + +export type { TreeNode, PositioningOptions } diff --git a/packages/machines/cascader/src/cascader.utils.ts b/packages/machines/cascader/src/cascader.utils.ts new file mode 100644 index 0000000000..dfa13bf699 --- /dev/null +++ b/packages/machines/cascader/src/cascader.utils.ts @@ -0,0 +1,62 @@ +import type { MachineContext } from "./cascader.types" + +export function getSiblings(ctx: MachineContext) { + // Slice the last index off to get the parent’s index path + const parentIndexPath = ctx.highlightedIndexPath.slice(0, -1) + // Get the parent node + const parentNode = ctx.collection.at(parentIndexPath) + if (!parentNode) return + + // Get the parent's children (siblings of the highlighted node) + const siblings = ctx.collection.getNodeChildren(parentNode) + if (siblings.length <= 1) return + return siblings +} + +export function getNextSibling(ctx: MachineContext) { + const siblings = getSiblings(ctx) + if (!siblings) return + const currentIndex = ctx.highlightedIndexPath[ctx.highlightedIndexPath.length - 1] + + // Find next enabled sibling + for (let i = currentIndex + 1; i < siblings.length; i++) { + if (!ctx.collection.getNodeDisabled(siblings[i])) { + return [...ctx.highlightedIndexPath.slice(0, -1), i] + } + } + + // If loop is enabled, search from start + if (ctx.loopFocus) { + for (let i = 0; i < currentIndex; i++) { + if (!ctx.collection.getNodeDisabled(siblings[i])) { + return [...ctx.highlightedIndexPath.slice(0, -1), i] + } + } + } + + return ctx.highlightedIndexPath +} + +export function getPreviousSibling(ctx: MachineContext) { + const siblings = getSiblings(ctx) + if (!siblings) return + const currentIndex = ctx.highlightedIndexPath[ctx.highlightedIndexPath.length - 1] + + // Find previous enabled sibling + for (let i = currentIndex - 1; i >= 0; i--) { + if (!ctx.collection.getNodeDisabled(siblings[i])) { + return [...ctx.highlightedIndexPath.slice(0, -1), i] + } + } + + // If loop is enabled, search from end + if (ctx.loopFocus) { + for (let i = siblings.length - 1; i > currentIndex; i--) { + if (!ctx.collection.getNodeDisabled(siblings[i])) { + return [...ctx.highlightedIndexPath.slice(0, -1), i] + } + } + } + + return ctx.highlightedIndexPath +} diff --git a/packages/machines/cascader/src/index.ts b/packages/machines/cascader/src/index.ts new file mode 100644 index 0000000000..8b44528cae --- /dev/null +++ b/packages/machines/cascader/src/index.ts @@ -0,0 +1,6 @@ +export { anatomy } from "./cascader.anatomy" +export { collection } from "./cascader.collection" +export { connect } from "./cascader.connect" +export { machine } from "./cascader.machine" +export * from "./cascader.props" +export type { MachineApi as Api, UserDefinedContext as Context, ElementIds, Service, TreeNode } from "./cascader.types" diff --git a/packages/machines/cascader/tsconfig.json b/packages/machines/cascader/tsconfig.json new file mode 100644 index 0000000000..8e781cd154 --- /dev/null +++ b/packages/machines/cascader/tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "../../../tsconfig.json", + "include": ["src"], + "compilerOptions": { + "tsBuildInfoFile": "node_modules/.cache/.tsbuildinfo" + } +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 06866f2d35..4e2941a824 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -109,7 +109,7 @@ importers: version: 3.4.2 prettier-plugin-svelte: specifier: 3.3.2 - version: 3.3.2(prettier@3.4.2)(svelte@5.14.5) + version: 3.3.2(prettier@3.4.2)(svelte@5.16.0) signale: specifier: 1.4.0 version: 1.4.0 @@ -176,6 +176,9 @@ importers: '@zag-js/carousel': specifier: workspace:* version: link:../../packages/machines/carousel + '@zag-js/cascader': + specifier: workspace:* + version: link:../../packages/machines/cascader '@zag-js/checkbox': specifier: workspace:* version: link:../../packages/machines/checkbox @@ -432,6 +435,9 @@ importers: '@zag-js/carousel': specifier: workspace:* version: link:../../packages/machines/carousel + '@zag-js/cascader': + specifier: workspace:* + version: link:../../packages/machines/cascader '@zag-js/checkbox': specifier: workspace:* version: link:../../packages/machines/checkbox @@ -724,6 +730,9 @@ importers: '@zag-js/carousel': specifier: workspace:* version: link:../../packages/machines/carousel + '@zag-js/cascader': + specifier: workspace:* + version: link:../../packages/machines/cascader '@zag-js/checkbox': specifier: workspace:* version: link:../../packages/machines/checkbox @@ -986,6 +995,9 @@ importers: '@zag-js/carousel': specifier: workspace:* version: link:../../packages/machines/carousel + '@zag-js/cascader': + specifier: workspace:* + version: link:../../packages/machines/cascader '@zag-js/checkbox': specifier: workspace:* version: link:../../packages/machines/checkbox @@ -1245,6 +1257,9 @@ importers: '@zag-js/carousel': specifier: workspace:* version: link:../../packages/machines/carousel + '@zag-js/cascader': + specifier: workspace:* + version: link:../../packages/machines/cascader '@zag-js/checkbox': specifier: workspace:* version: link:../../packages/machines/checkbox @@ -1528,6 +1543,9 @@ importers: '@zag-js/carousel': specifier: workspace:* version: link:../../packages/machines/carousel + '@zag-js/cascader': + specifier: workspace:* + version: link:../../packages/machines/cascader '@zag-js/checkbox': specifier: workspace:* version: link:../../packages/machines/checkbox @@ -1774,6 +1792,9 @@ importers: '@zag-js/carousel': specifier: workspace:* version: link:../../packages/machines/carousel + '@zag-js/cascader': + specifier: workspace:* + version: link:../../packages/machines/cascader '@zag-js/checkbox': specifier: workspace:* version: link:../../packages/machines/checkbox @@ -2045,6 +2066,9 @@ importers: '@zag-js/carousel': specifier: workspace:* version: link:../../packages/machines/carousel + '@zag-js/cascader': + specifier: workspace:* + version: link:../../packages/machines/cascader '@zag-js/checkbox': specifier: workspace:* version: link:../../packages/machines/checkbox @@ -2541,6 +2565,31 @@ importers: specifier: 2.2.0 version: 2.2.0 + packages/machines/cascader: + dependencies: + '@zag-js/anatomy': + specifier: workspace:* + version: link:../../anatomy + '@zag-js/collection': + specifier: workspace:* + version: link:../../utilities/collection + '@zag-js/core': + specifier: workspace:* + version: link:../../core + '@zag-js/dom-query': + specifier: workspace:* + version: link:../../utilities/dom-query + '@zag-js/types': + specifier: workspace:* + version: link:../../types + '@zag-js/utils': + specifier: workspace:* + version: link:../../utilities/core + devDependencies: + clean-package: + specifier: 2.2.0 + version: 2.2.0 + packages/machines/checkbox: dependencies: '@zag-js/anatomy': @@ -8022,6 +8071,10 @@ packages: resolution: {integrity: sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==} engines: {node: '>=0.8'} + clsx@2.1.1: + resolution: {integrity: sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==} + engines: {node: '>=6'} + cluster-key-slot@1.1.2: resolution: {integrity: sha512-RMr0FhtfXemyinomL4hrWcYJxmX6deFdCxpJzhDttxgO1+bcCnkk+9drydLVDmAMG7NE6aN/fl4F7ucU/90gAA==} engines: {node: '>=0.10.0'} @@ -12366,6 +12419,10 @@ packages: resolution: {integrity: sha512-Qk4LbKHo8K6RtdSuiwI7w66Q+Ypab0V8E7WSZHEKKym4em8n+a0rl3VyRBpGV+/MnNmoi7xlGEjS2omwe0RzhA==} engines: {node: '>=18'} + svelte@5.16.0: + resolution: {integrity: sha512-Ygqsiac6UogVED2ruKclU+pOeMThxWtp9LG+li7BXeDKC2paVIsRTMkNmcON4Zejerd1s5sZHWx6ZtU85xklVg==} + engines: {node: '>=18'} + svg-parser@2.0.4: resolution: {integrity: sha512-e4hG1hRwoOdRb37cIMSgzNsxyzKfayW6VOflrwvR+/bzrkyxY/31WkbgnQpgtrNp1SdpJvpUAGTa/ZoiPNDuRQ==} @@ -17617,6 +17674,8 @@ snapshots: clone@1.0.4: {} + clsx@2.1.1: {} + cluster-key-slot@1.1.2: {} code-block-writer@13.0.3: {} @@ -21446,7 +21505,7 @@ snapshots: klona: 2.0.6 knitwork: 1.1.0 listhen: 1.9.0 - magic-string: 0.30.13 + magic-string: 0.30.14 mime: 4.0.4 mlly: 1.7.2 mri: 1.2.0 @@ -22300,10 +22359,10 @@ snapshots: dependencies: fast-diff: 1.3.0 - prettier-plugin-svelte@3.3.2(prettier@3.4.2)(svelte@5.14.5): + prettier-plugin-svelte@3.3.2(prettier@3.4.2)(svelte@5.16.0): dependencies: prettier: 3.4.2 - svelte: 5.14.5 + svelte: 5.16.0 prettier@2.8.8: {} @@ -23224,6 +23283,23 @@ snapshots: magic-string: 0.30.14 zimmerframe: 1.1.2 + svelte@5.16.0: + dependencies: + '@ampproject/remapping': 2.3.0 + '@jridgewell/sourcemap-codec': 1.5.0 + '@types/estree': 1.0.6 + acorn: 8.14.0 + acorn-typescript: 1.4.13(acorn@8.14.0) + aria-query: 5.3.2 + axobject-query: 4.1.0 + clsx: 2.1.1 + esm-env: 1.2.1 + esrap: 1.3.2 + is-reference: 3.0.3 + locate-character: 3.0.0 + magic-string: 0.30.14 + zimmerframe: 1.1.2 + svg-parser@2.0.4: {} svg-tags@1.0.0: {} @@ -23513,7 +23589,7 @@ snapshots: dependencies: acorn: 8.14.0 estree-walker: 3.0.3 - magic-string: 0.30.13 + magic-string: 0.30.14 unplugin: 1.15.0 transitivePeerDependencies: - webpack-sources diff --git a/shared/src/cascader-data.ts b/shared/src/cascader-data.ts new file mode 100644 index 0000000000..635af86a23 --- /dev/null +++ b/shared/src/cascader-data.ts @@ -0,0 +1,224 @@ +export const cascaderData = { + label: "ROOT", + value: "", + children: [ + { + label: "Africa", + value: "africa", + children: [ + { + label: "Nigeria", + value: "nigeria", + children: [ + { label: "Lagos", value: "lagos" }, + { label: "Kano", value: "kano" }, + { label: "Rivers", value: "rivers" }, + { label: "Oyo", value: "oyo" }, + { label: "Kaduna", value: "kaduna" }, + ], + }, + { + label: "South Africa", + value: "south-africa", + children: [ + { label: "Gauteng", value: "gauteng" }, + { label: "Western Cape", value: "western-cape" }, + { label: "KwaZulu-Natal", value: "kwazulu-natal" }, + { label: "Eastern Cape", value: "eastern-cape" }, + { label: "Free State", value: "free-state" }, + ], + }, + ], + }, + + { + label: "Antarctica", + value: "antarctica", + disabled: true, + }, + { + label: "Asia", + value: "asia", + children: [ + { + label: "China", + value: "china", + children: [ + { label: "Beijing", value: "beijing" }, + { label: "Shanghai", value: "shanghai" }, + { label: "Guangdong", value: "guangdong" }, + { label: "Zhejiang", value: "zhejiang" }, + { label: "Sichuan", value: "sichuan" }, + ], + }, + { + label: "India", + value: "india", + children: [ + { label: "Maharashtra", value: "maharashtra" }, + { label: "Delhi", value: "delhi" }, + { label: "Karnataka", value: "karnataka" }, + { label: "Tamil Nadu", value: "tamil-nadu" }, + { label: "Uttar Pradesh", value: "uttar-pradesh" }, + ], + }, + ], + }, + { + label: "Australia", + value: "australia", + children: [ + { + label: "Australia", + value: "australia", + children: [ + { label: "New South Wales", value: "new-south-wales" }, + { label: "Victoria", value: "victoria" }, + { label: "Queensland", value: "queensland" }, + { label: "Western Australia", value: "western-australia" }, + { label: "South Australia", value: "south-australia" }, + { label: "Tasmania", value: "tasmania" }, + { label: "Northern Territory", value: "northern-territory" }, + { + label: "Australian Capital Territory", + value: "australian-capital-territory", + }, + ], + }, + { + label: "New Zealand", + value: "new-zealand", + children: [ + { label: "Auckland", value: "auckland" }, + { label: "Wellington", value: "wellington" }, + { label: "Canterbury", value: "canterbury" }, + { label: "Otago", value: "otago" }, + { label: "Hawke's Bay", value: "hawkes-bay" }, + ], + }, + ], + }, + { + label: "Europe", + value: "europe", + children: [ + { + label: "United Kingdom", + value: "united-kingdom", + children: [ + { label: "England", value: "england" }, + { label: "Scotland", value: "scotland" }, + { label: "Wales", value: "wales" }, + { label: "Northern Ireland", value: "northern-ireland" }, + ], + }, + { + label: "Germany", + value: "germany", + children: [ + { label: "Bavaria", value: "bavaria" }, + { label: "Berlin", value: "berlin" }, + { label: "Hamburg", value: "hamburg" }, + { label: "Hesse", value: "hesse" }, + { label: "Saxony", value: "saxony" }, + ], + }, + ], + }, + { + label: "North America", + value: "north-america", + children: [ + { + label: "United States", + value: "united-states", + children: [ + { label: "California", value: "california" }, + { label: "Texas", value: "texas" }, + { label: "Florida", value: "florida" }, + { label: "New York", value: "new-york" }, + { label: "Illinois", value: "illinois" }, + { label: "Pennsylvania", value: "pennsylvania" }, + { label: "Ohio", value: "ohio" }, + { label: "Georgia", value: "georgia" }, + { label: "North Carolina", value: "north-carolina" }, + { label: "Michigan", value: "michigan" }, + ], + }, + { + label: "Canada", + value: "canada", + children: [ + { label: "Ontario", value: "ontario" }, + { label: "Quebec", value: "quebec" }, + { label: "British Columbia", value: "british-columbia" }, + { label: "Alberta", value: "alberta" }, + { label: "Manitoba", value: "manitoba" }, + { label: "Saskatchewan", value: "saskatchewan" }, + { label: "Nova Scotia", value: "nova-scotia" }, + { label: "New Brunswick", value: "new-brunswick" }, + { + label: "Newfoundland and Labrador", + value: "newfoundland-and-labrador", + }, + { label: "Prince Edward Island", value: "prince-edward-island" }, + ], + }, + { + label: "Mexico", + value: "mexico", + children: [ + { label: "Chihuahua", value: "chihuahua" }, + { label: "Jalisco", value: "jalisco" }, + { label: "Puebla", value: "puebla" }, + { label: "Guanajuato", value: "guanajuato" }, + { label: "Veracruz", value: "veracruz" }, + { label: "Yucatán", value: "yucatan" }, + { label: "Mexico City", value: "mexico-city" }, + { label: "Oaxaca", value: "oaxaca" }, + { label: "Sinaloa", value: "sinaloa" }, + { label: "Sonora", value: "sonora" }, + ], + }, + ], + }, + { + label: "South America", + value: "south-america", + children: [ + { + label: "Brazil", + value: "brazil", + children: [ + { label: "São Paulo", value: "sao-paulo" }, + { label: "Rio de Janeiro", value: "rio-de-janeiro" }, + { label: "Bahia", value: "bahia" }, + { label: "Minas Gerais", value: "minas-gerais" }, + { label: "Paraná", value: "parana" }, + { label: "Rio Grande do Sul", value: "rio-grande-do-sul" }, + { label: "Pernambuco", value: "pernambuco" }, + { label: "Ceará", value: "ceara" }, + { label: "Pará", value: "para" }, + { label: "Santa Catarina", value: "santa-catarina" }, + ], + }, + { + label: "Argentina", + value: "argentina", + children: [ + { label: "Buenos Aires", value: "buenos-aires" }, + { label: "Córdoba", value: "cordoba" }, + { label: "Santa Fe", value: "santa-fe" }, + { label: "Mendoza", value: "mendoza" }, + { label: "Tucumán", value: "tucuman" }, + { label: "Salta", value: "salta" }, + { label: "Entre Ríos", value: "entre-rios" }, + { label: "Misiones", value: "misiones" }, + { label: "Corrientes", value: "corrientes" }, + { label: "Chaco", value: "chaco" }, + ], + }, + ], + }, + ], +} diff --git a/shared/src/controls.ts b/shared/src/controls.ts index 89ef0dfe95..d946124e42 100644 --- a/shared/src/controls.ts +++ b/shared/src/controls.ts @@ -6,6 +6,19 @@ export const accordionControls = defineControls({ orientation: { type: "select", options: ["horizontal", "vertical"] as const, defaultValue: "vertical" }, }) +export const cascaderControls = defineControls({ + disabled: { type: "boolean", defaultValue: false }, + readOnly: { type: "boolean", defaultValue: false }, + loopFocus: { type: "boolean", defaultValue: false }, + closeOnSelect: { type: "boolean", defaultValue: true }, + multiple: { type: "boolean", defaultValue: false }, + expandTrigger: { + type: "select", + defaultValue: "hover", + options: ["hover", "click"] as const, + }, +}) + export const checkboxControls = defineControls({ name: { type: "string", defaultValue: "checkbox" }, disabled: { type: "boolean", defaultValue: false }, diff --git a/shared/src/css/cascader.css b/shared/src/css/cascader.css new file mode 100644 index 0000000000..484d3b857f --- /dev/null +++ b/shared/src/css/cascader.css @@ -0,0 +1,113 @@ +[data-scope="cascader"][data-part="control"] { + display: flex; + flex-direction: column; + row-gap: 6px; + align-items: flex-start; +} + +[data-scope="cascader"][data-part="label"] { + font-size: 14px; +} + +[data-scope="cascader"][data-part="label"][data-disabled] { + cursor: default; + color: gray; +} + +[data-scope="cascader"][data-part="label"][data-invalid] { + color: red; +} + +[data-scope="cascader"][data-part="trigger"] { + padding: 4px 12px; + border-radius: 4px; + border: none; + display: flex; + align-items: center; + justify-content: space-between; + column-gap: 6px; + cursor: default; + background: #eeeeee; + font-size: 14px; + border: 1px solid slategray; + + & svg { + width: 14px; + height: 14px; + } +} + +.cascader svg { + position: relative; + top: 1px; +} + +[data-scope="cascader"][data-part="trigger"]:disabled { + cursor: default; +} + +[data-scope="cascader"][data-part="trigger"][data-invalid] { + border: 2px solid red; +} + +[data-scope="cascader"][data-part="positioner"] { + width: max-content; +} + +[data-scope="cascader"][data-part="content"] { + margin-top: 4px; + max-height: min(var(--available-height), 400px); + display: flex; + background: white; + width: fit-content; + margin-top: 4px; +} + +[data-scope="cascader"][data-part="list"] { + list-style-type: none; + max-height: min(var(--available-height), 400px); + margin: 0; + min-width: 151px; + overflow-y: auto; + height: 120px; + border-right: 1px solid #e8e8e8; + padding: 8px; + overscroll-behavior: contain; + position: relative; +} + +.cascader input { + position: sticky; + top: 0; +} + +[data-scope="cascader"][data-part="item"] { + padding: 4px 8px; + cursor: pointer; + display: flex; + align-items: center; + border-radius: 4px; +} + +[data-scope="cascader"][data-part="item"]:not(:first-child) { + margin-top: 2px; +} + +[data-scope="cascader"][data-part="item"][data-disabled] { + color: #777; + cursor: not-allowed; +} + +[data-scope="cascader"][data-part="item"]:not([data-disabled]):not([data-highlighted]):hover { + background: rgba(107, 107, 110, 0.105); +} + +[data-scope="cascader"][data-part="item"][data-highlighted] { + background: rgb(0, 0, 195); + color: white; +} + +[data-scope="cascader"][data-part="item-text"] { + flex: 1; + width: 100%; +} diff --git a/shared/src/data.ts b/shared/src/data.ts index 4919f19ee1..9ca0d796fb 100644 --- a/shared/src/data.ts +++ b/shared/src/data.ts @@ -1,6 +1,7 @@ import type { StepDetails } from "@zag-js/tour" import { countryList } from "./country-list" +export { cascaderData } from "./cascader-data" export { paginationData } from "./pagination-data" export const selectData = countryList.map((country) => ({ diff --git a/shared/src/routes.ts b/shared/src/routes.ts index 493a322ee6..fb074e39e7 100644 --- a/shared/src/routes.ts +++ b/shared/src/routes.ts @@ -4,6 +4,7 @@ type RouteData = { } export const routesData: RouteData[] = [ + { label: "Cascader", path: "/cascader" }, { label: "Angle Slider", path: "/angle-slider" }, { label: "Steps", path: "/steps" }, { label: "QR Code", path: "/qr-code" }, diff --git a/shared/src/style.css b/shared/src/style.css index fd7291414b..14859c7cbc 100644 --- a/shared/src/style.css +++ b/shared/src/style.css @@ -4,6 +4,7 @@ @import url("./css/avatar.css"); @import url("./css/carousel.css"); +@import url("./css/cascader.css"); @import url("./css/checkbox.css"); @import url("./css/clipboard.css"); @import url("./css/collapsible.css"); From f59598386a22094b6e281b7a5a239b65134f8522 Mon Sep 17 00:00:00 2001 From: anubra266 Date: Sun, 29 Dec 2024 20:32:22 -0800 Subject: [PATCH 02/11] chore: props types --- .../machines/cascader/src/cascader.props.ts | 29 ++++++++++++++++++- .../machines/cascader/src/cascader.types.ts | 2 +- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/packages/machines/cascader/src/cascader.props.ts b/packages/machines/cascader/src/cascader.props.ts index d27e8bc4a3..772a29012c 100644 --- a/packages/machines/cascader/src/cascader.props.ts +++ b/packages/machines/cascader/src/cascader.props.ts @@ -2,5 +2,32 @@ import { createProps } from "@zag-js/types" import { createSplitProps } from "@zag-js/utils" import type { UserDefinedContext } from "./cascader.types" -export const props = createProps()([]) +export const props = createProps()([ + "closeOnSelect", + "collection", + "dir", + "disabled", + "form", + "getRootNode", + "highlightedValue", + "id", + "ids", + "invalid", + "loopFocus", + "multiple", + "name", + "onFocusOutside", + "onHighlightChange", + "onInteractOutside", + "onOpenChange", + "onPointerDownOutside", + "onValueChange", + "open.controlled", + "open", + "positioning", + "required", + "readOnly", + "value", + "expandTrigger", +]) export const splitProps = createSplitProps>(props) diff --git a/packages/machines/cascader/src/cascader.types.ts b/packages/machines/cascader/src/cascader.types.ts index 2a8e565078..ef01f72986 100644 --- a/packages/machines/cascader/src/cascader.types.ts +++ b/packages/machines/cascader/src/cascader.types.ts @@ -168,7 +168,7 @@ type ComputedContext = Readonly<{ isDisabled: boolean }> -export type UserDefinedContext = RequiredBy, "id" | "collection"> +export type UserDefinedContext = RequiredBy, "id" | "collection"> export interface MachineContext extends PublicContext, PrivateContext, ComputedContext {} From 175e15a1456f33484396901fa0edbfd290ff1337 Mon Sep 17 00:00:00 2001 From: anubra266 Date: Sun, 29 Dec 2024 20:35:17 -0800 Subject: [PATCH 03/11] chore: add clear trigger --- .xstate/cascader.js | 3 +++ examples/next-ts/pages/cascader.tsx | 2 +- .../machines/cascader/src/cascader.connect.ts | 15 ++++++++------- .../machines/cascader/src/cascader.machine.ts | 3 +++ 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/.xstate/cascader.js b/.xstate/cascader.js index 68fe9ba9b5..9d1eeb4cc6 100644 --- a/.xstate/cascader.js +++ b/.xstate/cascader.js @@ -57,6 +57,9 @@ const fetchMachine = createMachine({ }, "VALUE.CLEAR": { actions: ["clearSelectedItems"] + }, + "CLEAR.CLICK": { + actions: ["clearSelectedItems", "focusTriggerEl"] } }, on: { diff --git a/examples/next-ts/pages/cascader.tsx b/examples/next-ts/pages/cascader.tsx index 2d2f346ea7..d9c460134a 100644 --- a/examples/next-ts/pages/cascader.tsx +++ b/examples/next-ts/pages/cascader.tsx @@ -75,7 +75,7 @@ export default function Page() { {api.selectedItems.map((i) => i.label).join(", ") || "Select option"} {/* */} - {/* */} + {/* UI select */} diff --git a/packages/machines/cascader/src/cascader.connect.ts b/packages/machines/cascader/src/cascader.connect.ts index dac74de3bb..d25e14a74b 100644 --- a/packages/machines/cascader/src/cascader.connect.ts +++ b/packages/machines/cascader/src/cascader.connect.ts @@ -23,6 +23,8 @@ export function connect( const selectedItems = state.context.selectedItems const highlightedValue = state.context.highlightedValue + const hasSelectedItems = state.context.hasSelectedItems + const open = state.hasTag("open") const focused = state.matches("focused") @@ -113,7 +115,6 @@ export function connect( "data-disabled": dataAttr(disabled), "data-invalid": dataAttr(invalid), "data-readonly": dataAttr(readOnly), - // htmlFor: dom.getHiddenSelectId(state.context), onClick(event) { if (event.defaultPrevented) return if (disabled) return @@ -152,7 +153,7 @@ export function connect( "aria-haspopup": "listbox", "aria-invalid": invalid, "data-placement": state.context.currentPlacement, - // "data-placeholder-shown": dataAttr(!hasSelectedItems), + "data-placeholder-shown": dataAttr(!hasSelectedItems), onPointerDown(event) { if (!isLeftClick(event)) return @@ -219,7 +220,7 @@ export function connect( "aria-label": "Clear value", "data-invalid": dataAttr(invalid), disabled: disabled, - // hidden: !state.context.hasSelectedItems, + hidden: !hasSelectedItems, dir: state.context.dir, onClick(event) { if (event.defaultPrevented) return @@ -347,12 +348,12 @@ export function connect( "aria-expanded": itemState.isBranch ? itemState.highlighted : false, "aria-controls": itemState.isBranch ? dom.getListId(state.context, itemState.value) : undefined, "data-value": itemState.value, - // "aria-selected": itemState.selected, - // "data-state": itemState.selected ? "checked" : "unchecked", + "aria-selected": itemState.selected, + "data-state": itemState.selected ? "checked" : "unchecked", "data-highlighted": dataAttr(itemState.highlighted), "data-disabled": dataAttr(itemState.disabled), "aria-disabled": ariaAttr(itemState.disabled), - // "data-selected": dataAttr(itemState.selected), + "data-selected": dataAttr(itemState.selected), onDoubleClick() { if (itemState.disabled) return send("CLOSE") @@ -381,7 +382,7 @@ export function connect( const itemState = getNodeState(props) return normalize.element({ ...parts.itemText.attrs, - // "data-state": itemState.selected ? "checked" : "unchecked", + "data-state": itemState.selected ? "checked" : "unchecked", "data-disabled": dataAttr(itemState.disabled), "data-highlighted": dataAttr(itemState.highlighted), }) diff --git a/packages/machines/cascader/src/cascader.machine.ts b/packages/machines/cascader/src/cascader.machine.ts index b2d6c522db..06ad8cc332 100644 --- a/packages/machines/cascader/src/cascader.machine.ts +++ b/packages/machines/cascader/src/cascader.machine.ts @@ -68,6 +68,9 @@ export function machine(userContext: UserDefinedContext) { "VALUE.CLEAR": { actions: ["clearSelectedItems"], }, + "CLEAR.CLICK": { + actions: ["clearSelectedItems", "focusTriggerEl"], + }, }, states: { From fcca042e6032eb7aa8c880e557944890ddcd2276 Mon Sep 17 00:00:00 2001 From: anubra266 Date: Sun, 29 Dec 2024 20:37:44 -0800 Subject: [PATCH 04/11] chore: cleanup --- packages/machines/cascader/src/cascader.connect.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/packages/machines/cascader/src/cascader.connect.ts b/packages/machines/cascader/src/cascader.connect.ts index d25e14a74b..ddf041545a 100644 --- a/packages/machines/cascader/src/cascader.connect.ts +++ b/packages/machines/cascader/src/cascader.connect.ts @@ -239,10 +239,7 @@ export function connect( }, getContentProps() { - const highlightedValue = collection.getNodeValue(collection.at(highlightedIndexPath)) - const ariaActiveDescendant = highlightedIndexPath.length - ? dom.getItemId(state.context, highlightedValue) - : undefined + const ariaActiveDescendant = highlightedValue ? dom.getItemId(state.context, highlightedValue) : undefined return normalize.element({ hidden: !open, @@ -296,11 +293,11 @@ export function connect( send({ type: "CONTENT.END" }) }, Enter() { - if (!highlightedIndexPath.length) return + if (!highlightedValue) return send({ type: "ITEM.CLICK", src: "keydown.enter", indexPath: highlightedIndexPath }) }, Space() { - if (!highlightedIndexPath.length) return + if (!highlightedValue) return send({ type: "ITEM.CLICK", src: "keydown.space", indexPath: highlightedIndexPath }) }, } From 4553eb9a8c66fb9c98f2fc1f56b83e36fffaa355 Mon Sep 17 00:00:00 2001 From: anubra266 Date: Sun, 29 Dec 2024 20:39:19 -0800 Subject: [PATCH 05/11] chore: cleanup --- packages/machines/cascader/src/cascader.machine.ts | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/packages/machines/cascader/src/cascader.machine.ts b/packages/machines/cascader/src/cascader.machine.ts index 06ad8cc332..e47304413d 100644 --- a/packages/machines/cascader/src/cascader.machine.ts +++ b/packages/machines/cascader/src/cascader.machine.ts @@ -349,16 +349,6 @@ export function machine(userContext: UserDefinedContext) { isTriggerArrowDownEvent: (_ctx, evt) => evt.previousEvent?.type === "TRIGGER.ARROW_DOWN", }, activities: { - trackFormControlState(ctx, _evt, { initialContext }) { - // return trackFormControl(dom.getHiddenSelectEl(ctx), { - // onFieldsetDisabledChange(disabled) { - // ctx.fieldsetDisabled = disabled - // }, - // onFormReset() { - // set.selectedItems(ctx, initialContext.value) - // }, - // }) - }, trackDismissableElement(ctx, _evt, { send }) { const contentEl = () => dom.getContentEl(ctx) let restoreFocus = true From feac63c286ae4b2a1bf9a5b999209199753322b4 Mon Sep 17 00:00:00 2001 From: anubra266 Date: Tue, 31 Dec 2024 01:04:36 -0800 Subject: [PATCH 06/11] chore: update --- .xstate/cascader.js | 8 +- examples/next-ts/package.json | 8 +- examples/next-ts/pages/cascader.tsx | 33 +- .../machines/cascader/src/cascader.connect.ts | 14 +- .../machines/cascader/src/cascader.machine.ts | 18 +- pnpm-lock.yaml | 277 +- shared/src/cascader-data.ts | 16857 +++++++++++++++- shared/src/css/cascader.css | 2 +- 8 files changed, 16912 insertions(+), 305 deletions(-) diff --git a/.xstate/cascader.js b/.xstate/cascader.js index 9d1eeb4cc6..2cddf65fc0 100644 --- a/.xstate/cascader.js +++ b/.xstate/cascader.js @@ -74,7 +74,7 @@ const fetchMachine = createMachine({ "CONTROLLED.OPEN": [{ cond: "isTriggerClickEvent", target: "open", - actions: ["setInitialFocus", "highlightFirstSelectedItem"] + actions: ["setInitialFocus", "highlightLastSelectedItem"] }, { target: "open", actions: ["setInitialFocus"] @@ -84,7 +84,7 @@ const fetchMachine = createMachine({ actions: ["invokeOnOpen"] }, { target: "open", - actions: ["invokeOnOpen", "setInitialFocus", "highlightFirstSelectedItem"] + actions: ["invokeOnOpen", "setInitialFocus", "highlightLastSelectedItem"] }], "TRIGGER.FOCUS": { target: "focused" @@ -104,7 +104,7 @@ const fetchMachine = createMachine({ "CONTROLLED.OPEN": [{ cond: "isTriggerClickEvent", target: "open", - actions: ["setInitialFocus", "highlightFirstSelectedItem"] + actions: ["setInitialFocus", "highlightLastSelectedItem"] }, { cond: "isTriggerArrowUpEvent", target: "open", @@ -132,7 +132,7 @@ const fetchMachine = createMachine({ actions: ["invokeOnOpen"] }, { target: "open", - actions: ["setInitialFocus", "invokeOnOpen", "highlightFirstSelectedItem"] + actions: ["setInitialFocus", "invokeOnOpen", "highlightLastSelectedItem"] }], "TRIGGER.ENTER": [{ cond: "isOpenControlled", diff --git a/examples/next-ts/package.json b/examples/next-ts/package.json index 62689c561f..5eb81b0789 100644 --- a/examples/next-ts/package.json +++ b/examples/next-ts/package.json @@ -100,16 +100,16 @@ "textarea-caret": "^3.1.0" }, "devDependencies": { + "@atlaskit/pragmatic-drag-and-drop": "1.3.1", + "@atlaskit/pragmatic-drag-and-drop-auto-scroll": "1.4.0", + "@atlaskit/pragmatic-drag-and-drop-flourish": "1.1.2", + "@atlaskit/pragmatic-drag-and-drop-hitbox": "1.0.3", "@types/form-serialize": "0.7.4", "@types/node": "22.10.2", "@types/react": "^18", "@types/react-dom": "^18", "eslint-plugin-react": "7.37.2", "eslint-plugin-react-hooks": "5.0.0", - "@atlaskit/pragmatic-drag-and-drop": "1.3.1", - "@atlaskit/pragmatic-drag-and-drop-flourish": "1.1.2", - "@atlaskit/pragmatic-drag-and-drop-hitbox": "1.0.3", - "@atlaskit/pragmatic-drag-and-drop-auto-scroll": "1.4.0", "typescript": "5.7.2" }, "license": "MIT" diff --git a/examples/next-ts/pages/cascader.tsx b/examples/next-ts/pages/cascader.tsx index d9c460134a..a78f2922c7 100644 --- a/examples/next-ts/pages/cascader.tsx +++ b/examples/next-ts/pages/cascader.tsx @@ -9,12 +9,16 @@ import { useControls } from "../hooks/use-controls" interface Node { label: string value: string - children?: Node[] + continents?: Node[] + countries?: Node[] + code?: string + states?: Node[] } const collection = cascader.collection({ nodeToValue: (node) => node.value, nodeToString: (node) => node.label, + nodeToChildren: (node) => node.continents ?? node.countries ?? node.states, rootNode: cascaderData, }) @@ -24,26 +28,39 @@ interface TreeNodeProps { api: cascader.Api } +// "Regional Indicator Symbol Letter A" - "Latin Capital Letter A" +const UNICODE_BASE = 127462 - "A".charCodeAt(0) + +// Country code should contain exactly 2 uppercase characters from A..Z +const COUNTRY_CODE_REGEX = /^[A-Z]{2}$/ + +export const getEmojiFlag = (countryCode: string): string => + COUNTRY_CODE_REGEX.test(countryCode) + ? String.fromCodePoint(...countryCode.split("").map((letter) => UNICODE_BASE + letter.toUpperCase().charCodeAt(0))) + : "" + const TreeNode = (props: TreeNodeProps): JSX.Element => { const { node, indexPath, api } = props const nodeProps = { indexPath, node } const nodeState = api.getNodeState(nodeProps) + // TODO encapsulate - const activeIndex = api.highlightedIndexPath[nodeState.depth] ?? -1 + const activeIndex = api.highlightedIndexPath[nodeState.depth - 1] ?? -1 const children = collection.getNodeChildren(node) const activeNode = activeIndex >= 0 ? children[activeIndex] : null const isBranchActiveNode = activeNode && collection.isBranchNode(activeNode) - return ( <>
    - {node.children?.map((item, index) => { + {children?.map((item, index) => { const itemProps = { indexPath: [...indexPath, index], node: item } const itemState = api.getNodeState(itemProps) return ( -
  • - {item.label} +
  • + + {getEmojiFlag(item.code)} {item.label} + {itemState.isBranch &&   ⦔}
  • @@ -58,7 +75,7 @@ const TreeNode = (props: TreeNodeProps): JSX.Element => { export default function Page() { const controls = useControls(cascaderControls) - const [state, send] = useMachine(cascader.machine({ id: useId(), collection }), { + const [state, send] = useMachine(cascader.machine({ id: useId(), collection, value: ["réunion"] }), { context: controls.context, }) @@ -90,7 +107,7 @@ export default function Page() { - + ) diff --git a/packages/machines/cascader/src/cascader.connect.ts b/packages/machines/cascader/src/cascader.connect.ts index ddf041545a..94f2a1d007 100644 --- a/packages/machines/cascader/src/cascader.connect.ts +++ b/packages/machines/cascader/src/cascader.connect.ts @@ -35,12 +35,20 @@ export function connect( placement: state.context.currentPlacement, }) + function isPrefixOfHighlight(indexPath: number[], highlightedIndexPath: number[]) { + // If indexPath is longer, it can't be a prefix. + if (indexPath.length > highlightedIndexPath.length) return false + + // Check each element in indexPath against the corresponding element + return indexPath.every((val, idx) => val === highlightedIndexPath[idx]) + } + function getNodeState(props: NodeProps): NodeState { const { node, indexPath } = props const value = collection.getNodeValue(node) const isBranch = collection.isBranchNode(node) - const highlighted = highlightedIndexPath.join(",").startsWith(indexPath.join(",")) - const depth = indexPath.length + const highlighted = isPrefixOfHighlight(indexPath, highlightedIndexPath) + const depth = indexPath.length + 1 const selected = state.context.value.includes(value) return { @@ -357,7 +365,7 @@ export function connect( }, onPointerMove(event) { if (itemState.disabled || event.pointerType !== "mouse") return - if (state.context.highlightedIndexPath.join(",") === props.indexPath.join(",")) return + if (highlightedValue === itemState.value) return // We only want to highlight items that have children (mouse only) if (!itemState.isBranch) return send({ type: "ITEM.POINTER_MOVE", indexPath }) diff --git a/packages/machines/cascader/src/cascader.machine.ts b/packages/machines/cascader/src/cascader.machine.ts index e47304413d..a40978434d 100644 --- a/packages/machines/cascader/src/cascader.machine.ts +++ b/packages/machines/cascader/src/cascader.machine.ts @@ -81,7 +81,7 @@ export function machine(userContext: UserDefinedContext) { { guard: "isTriggerClickEvent", target: "open", - actions: ["setInitialFocus", "highlightFirstSelectedItem"], + actions: ["setInitialFocus", "highlightLastSelectedItem"], }, { target: "open", @@ -95,7 +95,7 @@ export function machine(userContext: UserDefinedContext) { }, { target: "open", - actions: ["invokeOnOpen", "setInitialFocus", "highlightFirstSelectedItem"], + actions: ["invokeOnOpen", "setInitialFocus", "highlightLastSelectedItem"], }, ], "TRIGGER.FOCUS": { @@ -121,7 +121,7 @@ export function machine(userContext: UserDefinedContext) { { guard: "isTriggerClickEvent", target: "open", - actions: ["setInitialFocus", "highlightFirstSelectedItem"], + actions: ["setInitialFocus", "highlightLastSelectedItem"], }, { guard: "isTriggerArrowUpEvent", @@ -158,7 +158,7 @@ export function machine(userContext: UserDefinedContext) { }, { target: "open", - actions: ["setInitialFocus", "invokeOnOpen", "highlightFirstSelectedItem"], + actions: ["setInitialFocus", "invokeOnOpen", "highlightLastSelectedItem"], }, ], "TRIGGER.ENTER": [ @@ -484,10 +484,12 @@ export function machine(userContext: UserDefinedContext) { const previousSibling = utils.getPreviousSibling(ctx) set.highlightedItem(ctx, previousSibling) }, - highlightFirstSelectedItem(ctx) { - const firstSelected = ctx.valueIndexPaths[0] - if (!firstSelected) return - set.highlightedItem(ctx, firstSelected) + highlightLastSelectedItem(ctx) { + const lastSelected = ctx.valueIndexPaths.at(-1) + console.log({ lastSelected }) + + if (!lastSelected) return + set.highlightedItem(ctx, lastSelected) }, highlightComputedFirstItem(ctx) { const firstItem = ctx.valueIndexPaths.length > 0 ? ctx.valueIndexPaths[0] : [0] diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5178a51675..06a2332261 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -955,7 +955,7 @@ importers: devDependencies: '@nuxt/devtools': specifier: latest - version: 1.6.4(rollup@4.24.3)(vite@5.4.11(@types/node@22.10.2)(terser@5.36.0))(vue@3.5.13(typescript@5.7.2)) + version: 1.7.0(rollup@4.24.3)(vite@5.4.11(@types/node@22.10.2)(terser@5.36.0))(vue@3.5.13(typescript@5.7.2)) '@types/form-serialize': specifier: 0.7.4 version: 0.7.4 @@ -4654,6 +4654,10 @@ packages: resolution: {integrity: sha512-i2VbegsRfwa9yq3xmfDX3tG2yh9K0cCqwpSyVG2nPxifh0EOnucAZUeO/g4lW2Zfg03aPJNtPfxQbDHzXc7H+w==} engines: {node: '>=6.9.0'} + '@babel/standalone@7.26.4': + resolution: {integrity: sha512-SF+g7S2mhTT1b7CHyfNjDkPU1corxg4LPYsyP0x5KuCl+EbtBQHRLqr9N3q7e7+x7NQ5LYxQf8mJ2PmzebLr0A==} + engines: {node: '>=6.9.0'} + '@babel/template@7.25.9': resolution: {integrity: sha512-9DGttpmPvIxBb/2uwpVo3dqJ+O6RooAFOS+lB+xDqoE2PVCE8nfoHMdZLpfCQRLwvohzXISPZcgxt80xLfsuwg==} engines: {node: '>=6.9.0'} @@ -6156,17 +6160,17 @@ packages: '@nuxt/devalue@2.0.2': resolution: {integrity: sha512-GBzP8zOc7CGWyFQS6dv1lQz8VVpz5C2yRszbXufwG/9zhStTIH50EtD87NmWbTMwXDvZLNg8GIpb1UFdH93JCA==} - '@nuxt/devtools-kit@1.6.4': - resolution: {integrity: sha512-jpLYrXFm8T74j8ZjU6lheghe3gdr7PcNluvh/KOl+t6l7AtsQilkTmCZ4YoaiaWLM+5c5mkc72qd7ECgZb0tCw==} + '@nuxt/devtools-kit@1.7.0': + resolution: {integrity: sha512-+NgZ2uP5BuneqvQbe7EdOEaFEDy8762c99pLABtn7/Ur0ExEsQJMP7pYjjoTfKubhBqecr5Vo9yHkPBj1eHulQ==} peerDependencies: vite: '*' - '@nuxt/devtools-wizard@1.6.4': - resolution: {integrity: sha512-YTInHKL3SnRjczZDIhN8kXaiYf8+ddBMU5nwShPxmutcaVQZ8FMiJHRIzyWnS10AxayPKGVzJh3fLF/BiUwgcg==} + '@nuxt/devtools-wizard@1.7.0': + resolution: {integrity: sha512-86Gd92uEw0Dh2ErIYT9TMIrMOISE96fCRN4rxeryTvyiowQOsyrbkCeMNYrEehoRL+lohoyK6iDmFajadPNwWQ==} hasBin: true - '@nuxt/devtools@1.6.4': - resolution: {integrity: sha512-uzHFXVEQnmxcbtbcpXjDEyILMp/jJNF1DN2/wSBm0r7UD82qaD2Aa66gX7dTY2+E0HG6aSNkZky3Ck8ehSk8nQ==} + '@nuxt/devtools@1.7.0': + resolution: {integrity: sha512-uvnjt5Zowkz7tZmnks2cGreg1XZIiSyVzQ2MYiRXACodlXcwJ0dpUS3WTxu8BR562K+772oRdvKie9AQlyZUgg==} hasBin: true peerDependencies: vite: '*' @@ -6175,10 +6179,18 @@ packages: resolution: {integrity: sha512-r9r8bISBBisvfcNgNL3dSIQHSBe0v5YkX5zwNblIC2T0CIEgxEVoM5rq9O5wqgb5OEydsHTtT2hL57vdv6VT2w==} engines: {node: ^14.18.0 || >=16.10.0} + '@nuxt/kit@3.15.0': + resolution: {integrity: sha512-Q7k11wDTLIbBgoTfRYNrciK7PvjKklewrKd5PRMJCpn9Lmuqkq59HErNfJXFrBKHsE3Ld0DB6WUtpPGOvWJZoQ==} + engines: {node: '>=18.20.5'} + '@nuxt/schema@3.14.1592': resolution: {integrity: sha512-A1d/08ueX8stTXNkvGqnr1eEXZgvKn+vj6s7jXhZNWApUSqMgItU4VK28vrrdpKbjIPwq2SwhnGOHUYvN9HwCQ==} engines: {node: ^14.18.0 || >=16.10.0} + '@nuxt/schema@3.15.0': + resolution: {integrity: sha512-sAgLgSOj/SZxUmlJ/Q3TLRwIAqmiiZ5gCBrT+eq9CowIj7bgxX92pT720pDLEDs4wlXiTTsqC8nyqXQis8pPyA==} + engines: {node: ^14.18.0 || >=16.10.0} + '@nuxt/telemetry@2.6.0': resolution: {integrity: sha512-h4YJ1d32cU7tDKjjhjtIIEck4WF/w3DTQBT348E9Pz85YLttnLqktLM0Ez9Xc2LzCeUgBDQv1el7Ob/zT3KUqg==} hasBin: true @@ -7391,27 +7403,15 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@vue/compiler-core@3.5.12': - resolution: {integrity: sha512-ISyBTRMmMYagUxhcpyEH0hpXRd/KqDU4ymofPgl2XAkY9ZhQ+h0ovEZJIiPop13UmR/54oA2cgMDjgroRelaEw==} - '@vue/compiler-core@3.5.13': resolution: {integrity: sha512-oOdAkwqUfW1WqpwSYJce06wvt6HljgY3fGeM9NcVA1HaYOij3mZG9Rkysn0OHuyUAGMbEbARIpsG+LPVlBJ5/Q==} - '@vue/compiler-dom@3.5.12': - resolution: {integrity: sha512-9G6PbJ03uwxLHKQ3P42cMTi85lDRvGLB2rSGOiQqtXELat6uI4n8cNz9yjfVHRPIu+MsK6TE418Giruvgptckg==} - '@vue/compiler-dom@3.5.13': resolution: {integrity: sha512-ZOJ46sMOKUjO3e94wPdCzQ6P1Lx/vhp2RSvfaab88Ajexs0AHeV0uasYhi99WPaogmBlRHNRuly8xV75cNTMDA==} - '@vue/compiler-sfc@3.5.12': - resolution: {integrity: sha512-2k973OGo2JuAa5+ZlekuQJtitI5CgLMOwgl94BzMCsKZCX/xiqzJYzapl4opFogKHqwJk34vfsaKpfEhd1k5nw==} - '@vue/compiler-sfc@3.5.13': resolution: {integrity: sha512-6VdaljMpD82w6c2749Zhf5T9u5uLBWKnVue6XWxprDobftnletJ8+oel7sexFfM3qIxNmVE7LSFGTpv6obNyaQ==} - '@vue/compiler-ssr@3.5.12': - resolution: {integrity: sha512-eLwc7v6bfGBSM7wZOGPmRavSWzNFF6+PdRhE+VFJhNCgHiF8AM7ccoqcv5kBXA2eWUfigD7byekvf/JsOfKvPA==} - '@vue/compiler-ssr@3.5.13': resolution: {integrity: sha512-wMH6vrYHxQl/IybKJagqbquvxpWCuVYpoUJfCqFZwa/JY1GdATAQ+TgVtgrwwMZ0D07QhA99rs/EAAWfvG6KpA==} @@ -7454,9 +7454,6 @@ packages: peerDependencies: vue: 3.5.13 - '@vue/shared@3.5.12': - resolution: {integrity: sha512-L2RPSAwUFbgZH20etwrXyVyCBu9OxRSi8T/38QsvnkJyvq2LufW2lDCOzm7t/U9C1mkhJGWYfCuFBCmIuNivrg==} - '@vue/shared@3.5.13': resolution: {integrity: sha512-/hnE/qP5ZoGpol0a5mDi45bOd7t3tjYJBjsgCsivow7D48cJeV5l05RD82lPqi7gRiphZM37rnhW1l6ZoCNNnQ==} @@ -8150,6 +8147,10 @@ packages: resolution: {integrity: sha512-I5qxpzLv+sJhTVEoLYNcTW+bThDCPsit0vLNKShZx6rLtpilNpmmeTPaeqJb9ZE9dV3DGaeby6Vuhrw38WjeyQ==} engines: {node: ^14.18.0 || >=16.10.0} + consola@3.3.3: + resolution: {integrity: sha512-Qil5KwghMzlqd51UXM0b6fyaGHtOC22scxrwrz4A2882LyUMwQjnvaedN1HAeXzphspQ6CpHkzMAWxBTUruDLg==} + engines: {node: ^14.18.0 || >=16.10.0} + console-control-strings@1.1.0: resolution: {integrity: sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==} @@ -9629,6 +9630,10 @@ packages: resolution: {integrity: sha512-InwqeHHN2XpumIkMvpl/DCJVrAHgCsG5+cn1XlnLWGwtZBm8QJfSusItfrwx81CTp5agNZqpKU2J/ccC5nGT4A==} engines: {node: '>= 4'} + ignore@7.0.0: + resolution: {integrity: sha512-lcX8PNQygAa22u/0BysEY8VhaFRzlOkvdlKczDPnJvrkJD1EuqzEky5VYYKM2iySIuaVIDv9N190DfSreSLw2A==} + engines: {node: '>= 4'} + image-meta@0.2.1: resolution: {integrity: sha512-K6acvFaelNxx8wc2VjbIzXKDVB0Khs0QT35U6NkGfTdCmjLNcO2945m7RFNR9/RPVFm48hq7QPzK8uGH18HCGw==} @@ -10163,6 +10168,9 @@ packages: knitwork@1.1.0: resolution: {integrity: sha512-oHnmiBUVHz1V+URE77PNot2lv3QiYU2zQf1JjOVkMt3YDKGbu8NAFr+c4mcNOhdsGrB/VpVbRwPwhiXrPhxQbw==} + knitwork@1.2.0: + resolution: {integrity: sha512-xYSH7AvuQ6nXkq42x0v5S8/Iry+cfulBz/DJQzhIyESdLD7425jXsPy4vn5cCXU+HhRN2kVw51Vd1K6/By4BQg==} + kolorist@1.8.0: resolution: {integrity: sha512-Y+60/zizpJ3HRH8DCss+q95yr6145JXZo46OTpFvDZWLfRCE4qChOyk1b26nMaNpfHHgxagk9dXT5OP0Tfe+dQ==} @@ -12660,6 +12668,9 @@ packages: unctx@2.3.1: resolution: {integrity: sha512-PhKke8ZYauiqh3FEMVNm7ljvzQiph0Mt3GBRve03IJm7ukfaON2OBK795tLwhbyfzknuRRkW0+Ze+CQUmzOZ+A==} + unctx@2.4.1: + resolution: {integrity: sha512-AbaYw0Nm4mK4qjhns67C+kgxR2YWiwlDBPzxrN8h8C6VtAdCgditAY5Dezu3IJy4XVqAnbrXt9oQJvsn3fyozg==} + undici-types@5.26.5: resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} @@ -12775,6 +12786,10 @@ packages: resolution: {integrity: sha512-5liCNPuJW8dqh3+DM6uNM2EI3MLLpCKp/KY+9pB5M2S2SR2qvvDHhKgBOaTWEbZTAws3CXfB0rKTIolWKL05VQ==} engines: {node: '>=14.0.0'} + unplugin@2.1.2: + resolution: {integrity: sha512-Q3LU0e4zxKfRko1wMV2HmP8lB9KWislY7hxXpxd+lGx0PRInE4vhMBVEZwpdVYHvtqzhSrzuIfErsob6bQfCzw==} + engines: {node: '>=18.12.0'} + unstorage@1.13.0: resolution: {integrity: sha512-nrUXbFW00q8SqrJSgyyZ7OhNK1ugAF1wmOJu4V90Ww0V5b3CJSlcZt/V6D+2DktCuBZAoIcSIsn6gifwi8JgnQ==} peerDependencies: @@ -12871,6 +12886,10 @@ packages: resolution: {integrity: sha512-reBOnkJBFfBZ8pCKaeHgfZLcehXtM6UTxc+vqs1JvCps0c4amLNp3fhdGBZwYp+VLyoY9n3X5KOP7lCyWBUX9A==} hasBin: true + untyped@1.5.2: + resolution: {integrity: sha512-eL/8PlhLcMmlMDtNPKhyyz9kEBDS3Uk4yMu/ewlkT2WFbtzScjHWPJLdQLmaGPUKjXzwe9MumOtOgc4Fro96Kg==} + hasBin: true + unwasm@0.3.9: resolution: {integrity: sha512-LDxTx/2DkFURUd+BU1vUsF/moj0JsoTvl+2tcg2AUOiEzVturhGGx17/IMgGvKUYdZwr33EJHtChCJuhu9Ouvg==} @@ -13028,10 +13047,10 @@ packages: '@testing-library/jest-dom': optional: true - vite-plugin-vue-inspector@5.1.3: - resolution: {integrity: sha512-pMrseXIDP1Gb38mOevY+BvtNGNqiqmqa2pKB99lnLsADQww9w9xMbAfT4GB6RUoaOkSPrtlXqpq2Fq+Dj2AgFg==} + vite-plugin-vue-inspector@5.3.1: + resolution: {integrity: sha512-cBk172kZKTdvGpJuzCCLg8lJ909wopwsu3Ve9FsL1XsnLBiRT9U3MePcqrgGHgCX2ZgkqZmAGR8taxw+TV6s7A==} peerDependencies: - vite: ^3.0.0-0 || ^4.0.0-0 || ^5.0.0-0 + vite: ^3.0.0-0 || ^4.0.0-0 || ^5.0.0-0 || ^6.0.0-0 vite-tsconfig-paths@5.1.4: resolution: {integrity: sha512-cYj0LRuLV2c2sMqhqhGpaO3LretdtMn/BVX4cPLanIZuwwrkVl+lK84E/miEXkCHWXuq65rhNN4rXsBcOB3S4w==} @@ -13701,6 +13720,8 @@ snapshots: '@babel/standalone@7.26.2': {} + '@babel/standalone@7.26.4': {} + '@babel/template@7.25.9': dependencies: '@babel/code-frame': 7.26.2 @@ -14754,7 +14775,7 @@ snapshots: '@eslint/config-array@0.19.0': dependencies: '@eslint/object-schema': 2.1.4 - debug: 4.4.0(supports-color@9.4.0) + debug: 4.4.0 minimatch: 3.1.2 transitivePeerDependencies: - supports-color @@ -14794,7 +14815,7 @@ snapshots: '@eslint/eslintrc@3.2.0': dependencies: ajv: 6.12.6 - debug: 4.4.0(supports-color@9.4.0) + debug: 4.4.0 espree: 10.3.0 globals: 14.0.0 ignore: 5.3.2 @@ -15180,21 +15201,20 @@ snapshots: '@nuxt/devalue@2.0.2': {} - '@nuxt/devtools-kit@1.6.4(magicast@0.3.5)(rollup@4.24.3)(vite@5.4.11(@types/node@22.10.2)(terser@5.36.0))': + '@nuxt/devtools-kit@1.7.0(magicast@0.3.5)(rollup@4.24.3)(vite@5.4.11(@types/node@22.10.2)(terser@5.36.0))': dependencies: - '@nuxt/kit': 3.14.1592(magicast@0.3.5)(rollup@4.24.3) - '@nuxt/schema': 3.14.1592(magicast@0.3.5)(rollup@4.24.3) + '@nuxt/kit': 3.15.0(magicast@0.3.5)(rollup@4.24.3) + '@nuxt/schema': 3.15.0(magicast@0.3.5)(rollup@4.24.3) execa: 7.2.0 vite: 5.4.11(@types/node@22.10.2)(terser@5.36.0) transitivePeerDependencies: - magicast - rollup - supports-color - - webpack-sources - '@nuxt/devtools-wizard@1.6.4': + '@nuxt/devtools-wizard@1.7.0': dependencies: - consola: 3.2.3 + consola: 3.3.3 diff: 7.0.0 execa: 7.2.0 global-directory: 4.0.1 @@ -15205,16 +15225,16 @@ snapshots: rc9: 2.1.2 semver: 7.6.3 - '@nuxt/devtools@1.6.4(rollup@4.24.3)(vite@5.4.11(@types/node@22.10.2)(terser@5.36.0))(vue@3.5.13(typescript@5.7.2))': + '@nuxt/devtools@1.7.0(rollup@4.24.3)(vite@5.4.11(@types/node@22.10.2)(terser@5.36.0))(vue@3.5.13(typescript@5.7.2))': dependencies: '@antfu/utils': 0.7.10 - '@nuxt/devtools-kit': 1.6.4(magicast@0.3.5)(rollup@4.24.3)(vite@5.4.11(@types/node@22.10.2)(terser@5.36.0)) - '@nuxt/devtools-wizard': 1.6.4 - '@nuxt/kit': 3.14.1592(magicast@0.3.5)(rollup@4.24.3) + '@nuxt/devtools-kit': 1.7.0(magicast@0.3.5)(rollup@4.24.3)(vite@5.4.11(@types/node@22.10.2)(terser@5.36.0)) + '@nuxt/devtools-wizard': 1.7.0 + '@nuxt/kit': 3.15.0(magicast@0.3.5)(rollup@4.24.3) '@vue/devtools-core': 7.6.8(vite@5.4.11(@types/node@22.10.2)(terser@5.36.0))(vue@3.5.13(typescript@5.7.2)) '@vue/devtools-kit': 7.6.8 birpc: 0.2.19 - consola: 3.2.3 + consola: 3.3.3 cronstrue: 2.52.0 destr: 2.0.3 error-stack-parser-es: 0.1.5 @@ -15241,8 +15261,8 @@ snapshots: tinyglobby: 0.2.10 unimport: 3.14.5(rollup@4.24.3) vite: 5.4.11(@types/node@22.10.2)(terser@5.36.0) - vite-plugin-inspect: 0.8.9(@nuxt/kit@3.14.1592(magicast@0.3.5)(rollup@4.24.3))(rollup@4.24.3)(vite@5.4.11(@types/node@22.10.2)(terser@5.36.0)) - vite-plugin-vue-inspector: 5.1.3(vite@5.4.11(@types/node@22.10.2)(terser@5.36.0)) + vite-plugin-inspect: 0.8.9(@nuxt/kit@3.15.0(magicast@0.3.5)(rollup@4.24.3))(rollup@4.24.3)(vite@5.4.11(@types/node@22.10.2)(terser@5.36.0)) + vite-plugin-vue-inspector: 5.3.1(vite@5.4.11(@types/node@22.10.2)(terser@5.36.0)) which: 3.0.1 ws: 8.18.0 transitivePeerDependencies: @@ -15251,7 +15271,6 @@ snapshots: - supports-color - utf-8-validate - vue - - webpack-sources '@nuxt/kit@3.14.1592(magicast@0.3.5)(rollup@4.24.3)': dependencies: @@ -15281,6 +15300,33 @@ snapshots: - supports-color - webpack-sources + '@nuxt/kit@3.15.0(magicast@0.3.5)(rollup@4.24.3)': + dependencies: + '@nuxt/schema': 3.15.0(magicast@0.3.5)(rollup@4.24.3) + c12: 2.0.1(magicast@0.3.5) + consola: 3.3.3 + defu: 6.1.4 + destr: 2.0.3 + globby: 14.0.2 + ignore: 7.0.0 + jiti: 2.4.2 + klona: 2.0.6 + knitwork: 1.2.0 + mlly: 1.7.3 + ohash: 1.1.4 + pathe: 1.1.2 + pkg-types: 1.2.1 + scule: 1.3.0 + semver: 7.6.3 + ufo: 1.5.4 + unctx: 2.4.1 + unimport: 3.14.5(rollup@4.24.3) + untyped: 1.5.2 + transitivePeerDependencies: + - magicast + - rollup + - supports-color + '@nuxt/schema@3.14.1592(magicast@0.3.5)(rollup@4.24.3)': dependencies: c12: 2.0.1(magicast@0.3.5) @@ -15301,6 +15347,26 @@ snapshots: - rollup - supports-color + '@nuxt/schema@3.15.0(magicast@0.3.5)(rollup@4.24.3)': + dependencies: + c12: 2.0.1(magicast@0.3.5) + compatx: 0.1.8 + consola: 3.3.3 + defu: 6.1.4 + hookable: 5.5.3 + pathe: 1.1.2 + pkg-types: 1.2.1 + scule: 1.3.0 + std-env: 3.8.0 + ufo: 1.5.4 + uncrypto: 0.1.3 + unimport: 3.14.5(rollup@4.24.3) + untyped: 1.5.2 + transitivePeerDependencies: + - magicast + - rollup + - supports-color + '@nuxt/telemetry@2.6.0(magicast@0.3.5)(rollup@4.24.3)': dependencies: '@nuxt/kit': 3.14.1592(magicast@0.3.5)(rollup@4.24.3) @@ -15788,7 +15854,7 @@ snapshots: estree-walker: 2.0.2 glob: 8.1.0 is-reference: 1.2.1 - magic-string: 0.30.14 + magic-string: 0.30.17 optionalDependencies: rollup: 4.24.3 @@ -15799,7 +15865,7 @@ snapshots: estree-walker: 2.0.2 fdir: 6.4.2(picomatch@4.0.2) is-reference: 1.2.1 - magic-string: 0.30.14 + magic-string: 0.30.17 picomatch: 4.0.2 optionalDependencies: rollup: 4.24.3 @@ -15808,7 +15874,7 @@ snapshots: dependencies: '@rollup/pluginutils': 5.1.3(rollup@4.24.3) estree-walker: 2.0.2 - magic-string: 0.30.14 + magic-string: 0.30.17 optionalDependencies: rollup: 4.24.3 @@ -15831,14 +15897,14 @@ snapshots: '@rollup/plugin-replace@5.0.7(rollup@4.24.3)': dependencies: '@rollup/pluginutils': 5.1.3(rollup@4.24.3) - magic-string: 0.30.14 + magic-string: 0.30.17 optionalDependencies: rollup: 4.24.3 '@rollup/plugin-replace@6.0.1(rollup@4.24.3)': dependencies: '@rollup/pluginutils': 5.1.3(rollup@4.24.3) - magic-string: 0.30.14 + magic-string: 0.30.17 optionalDependencies: rollup: 4.24.3 @@ -16806,18 +16872,10 @@ snapshots: '@babel/helper-module-imports': 7.25.9 '@babel/helper-plugin-utils': 7.25.9 '@babel/parser': 7.26.3 - '@vue/compiler-sfc': 3.5.12 + '@vue/compiler-sfc': 3.5.13 transitivePeerDependencies: - supports-color - '@vue/compiler-core@3.5.12': - dependencies: - '@babel/parser': 7.26.3 - '@vue/shared': 3.5.12 - entities: 4.5.0 - estree-walker: 2.0.2 - source-map-js: 1.2.1 - '@vue/compiler-core@3.5.13': dependencies: '@babel/parser': 7.26.3 @@ -16826,28 +16884,11 @@ snapshots: estree-walker: 2.0.2 source-map-js: 1.2.1 - '@vue/compiler-dom@3.5.12': - dependencies: - '@vue/compiler-core': 3.5.12 - '@vue/shared': 3.5.12 - '@vue/compiler-dom@3.5.13': dependencies: '@vue/compiler-core': 3.5.13 '@vue/shared': 3.5.13 - '@vue/compiler-sfc@3.5.12': - dependencies: - '@babel/parser': 7.26.3 - '@vue/compiler-core': 3.5.12 - '@vue/compiler-dom': 3.5.12 - '@vue/compiler-ssr': 3.5.12 - '@vue/shared': 3.5.12 - estree-walker: 2.0.2 - magic-string: 0.30.14 - postcss: 8.4.49 - source-map-js: 1.2.1 - '@vue/compiler-sfc@3.5.13': dependencies: '@babel/parser': 7.26.3 @@ -16860,11 +16901,6 @@ snapshots: postcss: 8.4.49 source-map-js: 1.2.1 - '@vue/compiler-ssr@3.5.12': - dependencies: - '@vue/compiler-dom': 3.5.12 - '@vue/shared': 3.5.12 - '@vue/compiler-ssr@3.5.13': dependencies: '@vue/compiler-dom': 3.5.13 @@ -16938,8 +16974,6 @@ snapshots: '@vue/shared': 3.5.13 vue: 3.5.13(typescript@5.7.2) - '@vue/shared@3.5.12': {} - '@vue/shared@3.5.13': {} JSONStream@1.3.5: @@ -17370,7 +17404,7 @@ snapshots: dotenv: 16.4.7 giget: 1.2.3 jiti: 1.21.6 - mlly: 1.7.2 + mlly: 1.7.3 ohash: 1.1.4 pathe: 1.1.2 perfect-debounce: 1.0.0 @@ -17703,6 +17737,8 @@ snapshots: consola@3.2.3: {} + consola@3.3.3: {} + console-control-strings@1.1.0: {} constant-case@3.0.4: @@ -17951,6 +17987,10 @@ snapshots: dependencies: ms: 2.1.3 + debug@4.4.0: + dependencies: + ms: 2.1.3 + debug@4.4.0(supports-color@9.4.0): dependencies: ms: 2.1.3 @@ -18413,7 +18453,7 @@ snapshots: '@typescript-eslint/parser': 8.18.2(eslint@9.17.0(jiti@2.4.2))(typescript@5.7.2) eslint: 9.17.0(jiti@2.4.2) eslint-import-resolver-node: 0.3.9 - eslint-import-resolver-typescript: 3.6.3(@typescript-eslint/parser@8.18.2(eslint@9.17.0(jiti@2.4.2))(typescript@5.7.2))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.18.2(eslint@9.17.0(jiti@2.4.2))(typescript@5.7.2))(eslint@9.17.0(jiti@2.4.2)))(eslint@9.17.0(jiti@2.4.2)) + eslint-import-resolver-typescript: 3.6.3(@typescript-eslint/parser@8.18.2(eslint@9.17.0(jiti@2.4.2))(typescript@5.7.2))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.31.0)(eslint@9.17.0(jiti@2.4.2)) eslint-plugin-import: 2.31.0(@typescript-eslint/parser@8.18.2(eslint@9.17.0(jiti@2.4.2))(typescript@5.7.2))(eslint-import-resolver-typescript@3.6.3)(eslint@9.17.0(jiti@2.4.2)) eslint-plugin-jsx-a11y: 6.10.2(eslint@9.17.0(jiti@2.4.2)) eslint-plugin-react: 7.37.2(eslint@9.17.0(jiti@2.4.2)) @@ -18469,13 +18509,13 @@ snapshots: - eslint-import-resolver-webpack - supports-color - eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@8.18.2(eslint@9.17.0(jiti@2.4.2))(typescript@5.7.2))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.18.2(eslint@9.17.0(jiti@2.4.2))(typescript@5.7.2))(eslint@9.17.0(jiti@2.4.2)))(eslint@9.17.0(jiti@2.4.2)): + eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@8.18.2(eslint@9.17.0(jiti@2.4.2))(typescript@5.7.2))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.31.0)(eslint@9.17.0(jiti@2.4.2)): dependencies: '@nolyfill/is-core-module': 1.0.39 debug: 4.4.0(supports-color@9.4.0) enhanced-resolve: 5.17.1 eslint: 9.17.0(jiti@2.4.2) - eslint-module-utils: 2.12.0(@typescript-eslint/parser@8.18.2(eslint@9.17.0(jiti@2.4.2))(typescript@5.7.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@8.18.2(eslint@9.17.0(jiti@2.4.2))(typescript@5.7.2))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.18.2(eslint@9.17.0(jiti@2.4.2))(typescript@5.7.2))(eslint@9.17.0(jiti@2.4.2)))(eslint@9.17.0(jiti@2.4.2)))(eslint@9.17.0(jiti@2.4.2)) + eslint-module-utils: 2.12.0(@typescript-eslint/parser@8.18.2(eslint@9.17.0(jiti@2.4.2))(typescript@5.7.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3)(eslint@9.17.0(jiti@2.4.2)) fast-glob: 3.3.2 get-tsconfig: 4.8.1 is-bun-module: 1.2.1 @@ -18499,14 +18539,14 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-module-utils@2.12.0(@typescript-eslint/parser@8.18.2(eslint@9.17.0(jiti@2.4.2))(typescript@5.7.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@8.18.2(eslint@9.17.0(jiti@2.4.2))(typescript@5.7.2))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.18.2(eslint@9.17.0(jiti@2.4.2))(typescript@5.7.2))(eslint@9.17.0(jiti@2.4.2)))(eslint@9.17.0(jiti@2.4.2)))(eslint@9.17.0(jiti@2.4.2)): + eslint-module-utils@2.12.0(@typescript-eslint/parser@8.18.2(eslint@9.17.0(jiti@2.4.2))(typescript@5.7.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3)(eslint@9.17.0(jiti@2.4.2)): dependencies: debug: 3.2.7 optionalDependencies: '@typescript-eslint/parser': 8.18.2(eslint@9.17.0(jiti@2.4.2))(typescript@5.7.2) eslint: 9.17.0(jiti@2.4.2) eslint-import-resolver-node: 0.3.9 - eslint-import-resolver-typescript: 3.6.3(@typescript-eslint/parser@8.18.2(eslint@9.17.0(jiti@2.4.2))(typescript@5.7.2))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.18.2(eslint@9.17.0(jiti@2.4.2))(typescript@5.7.2))(eslint@9.17.0(jiti@2.4.2)))(eslint@9.17.0(jiti@2.4.2)) + eslint-import-resolver-typescript: 3.6.3(@typescript-eslint/parser@8.18.2(eslint@9.17.0(jiti@2.4.2))(typescript@5.7.2))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.31.0)(eslint@9.17.0(jiti@2.4.2)) transitivePeerDependencies: - supports-color @@ -18561,7 +18601,7 @@ snapshots: doctrine: 2.1.0 eslint: 9.17.0(jiti@2.4.2) eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.12.0(@typescript-eslint/parser@8.18.2(eslint@9.17.0(jiti@2.4.2))(typescript@5.7.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@8.18.2(eslint@9.17.0(jiti@2.4.2))(typescript@5.7.2))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.18.2(eslint@9.17.0(jiti@2.4.2))(typescript@5.7.2))(eslint@9.17.0(jiti@2.4.2)))(eslint@9.17.0(jiti@2.4.2)))(eslint@9.17.0(jiti@2.4.2)) + eslint-module-utils: 2.12.0(@typescript-eslint/parser@8.18.2(eslint@9.17.0(jiti@2.4.2))(typescript@5.7.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3)(eslint@9.17.0(jiti@2.4.2)) hasown: 2.0.2 is-core-module: 2.15.1 is-glob: 4.0.3 @@ -18839,7 +18879,7 @@ snapshots: ajv: 6.12.6 chalk: 4.1.2 cross-spawn: 7.0.6 - debug: 4.4.0(supports-color@9.4.0) + debug: 4.4.0 escape-string-regexp: 4.0.0 eslint-scope: 8.2.0 eslint-visitor-keys: 4.2.0 @@ -19139,7 +19179,7 @@ snapshots: flat-cache@4.0.1: dependencies: - flatted: 3.3.1 + flatted: 3.3.2 keyv: 4.5.4 flatted@3.3.1: {} @@ -19737,6 +19777,8 @@ snapshots: ignore@6.0.2: {} + ignore@7.0.0: {} + image-meta@0.2.1: {} imagescript@1.3.0: {} @@ -20206,6 +20248,8 @@ snapshots: knitwork@1.1.0: {} + knitwork@1.2.0: {} + kolorist@1.8.0: {} language-subtag-registry@0.3.23: {} @@ -20283,8 +20327,8 @@ snapshots: get-port-please: 3.1.2 h3: 1.13.0 http-shutdown: 1.2.2 - jiti: 2.3.3 - mlly: 1.7.2 + jiti: 2.4.2 + mlly: 1.7.3 node-forge: 1.3.1 pathe: 1.1.2 std-env: 3.8.0 @@ -20330,7 +20374,7 @@ snapshots: local-pkg@0.5.0: dependencies: - mlly: 1.7.2 + mlly: 1.7.3 pkg-types: 1.2.1 local-pkg@0.5.1: @@ -20472,7 +20516,7 @@ snapshots: magic-string-ast@0.6.2: dependencies: - magic-string: 0.30.14 + magic-string: 0.30.17 magic-string@0.30.13: dependencies: @@ -21532,7 +21576,7 @@ snapshots: nuxt@3.14.1592(@parcel/watcher@2.4.1)(@types/node@22.10.2)(eslint@9.17.0(jiti@2.4.2))(ioredis@5.4.1)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.24.3)(terser@5.36.0)(typescript@5.7.2)(vite@5.4.11(@types/node@22.10.2)(terser@5.36.0)): dependencies: '@nuxt/devalue': 2.0.2 - '@nuxt/devtools': 1.6.4(rollup@4.24.3)(vite@5.4.11(@types/node@22.10.2)(terser@5.36.0))(vue@3.5.13(typescript@5.7.2)) + '@nuxt/devtools': 1.7.0(rollup@4.24.3)(vite@5.4.11(@types/node@22.10.2)(terser@5.36.0))(vue@3.5.13(typescript@5.7.2)) '@nuxt/kit': 3.14.1592(magicast@0.3.5)(rollup@4.24.3) '@nuxt/schema': 3.14.1592(magicast@0.3.5)(rollup@4.24.3) '@nuxt/telemetry': 2.6.0(magicast@0.3.5)(rollup@4.24.3) @@ -21656,7 +21700,7 @@ snapshots: nypm@0.4.1: dependencies: citty: 0.1.6 - consola: 3.2.3 + consola: 3.3.3 pathe: 1.1.2 pkg-types: 1.2.1 tinyexec: 0.3.1 @@ -23482,6 +23526,13 @@ snapshots: transitivePeerDependencies: - webpack-sources + unctx@2.4.1: + dependencies: + acorn: 8.14.0 + estree-walker: 3.0.3 + magic-string: 0.30.17 + unplugin: 2.1.2 + undici-types@5.26.5: {} undici-types@5.28.4: {} @@ -23537,8 +23588,8 @@ snapshots: estree-walker: 3.0.3 fast-glob: 3.3.2 local-pkg: 0.5.0 - magic-string: 0.30.14 - mlly: 1.7.2 + magic-string: 0.30.17 + mlly: 1.7.3 pathe: 1.1.2 pkg-types: 1.2.1 scule: 1.3.0 @@ -23573,7 +23624,7 @@ snapshots: escape-string-regexp: 5.0.0 estree-walker: 3.0.3 local-pkg: 0.5.1 - magic-string: 0.30.14 + magic-string: 0.30.17 mlly: 1.7.3 pathe: 1.1.2 picomatch: 4.0.2 @@ -23705,6 +23756,11 @@ snapshots: acorn: 8.14.0 webpack-virtual-modules: 0.6.2 + unplugin@2.1.2: + dependencies: + acorn: 8.14.0 + webpack-virtual-modules: 0.6.2 + unstorage@1.13.0(ioredis@5.4.1): dependencies: anymatch: 3.1.3 @@ -23757,11 +23813,24 @@ snapshots: transitivePeerDependencies: - supports-color + untyped@1.5.2: + dependencies: + '@babel/core': 7.26.0 + '@babel/standalone': 7.26.4 + '@babel/types': 7.26.3 + citty: 0.1.6 + defu: 6.1.4 + jiti: 2.4.2 + knitwork: 1.2.0 + scule: 1.3.0 + transitivePeerDependencies: + - supports-color + unwasm@0.3.9: dependencies: knitwork: 1.1.0 - magic-string: 0.30.14 - mlly: 1.7.2 + magic-string: 0.30.17 + mlly: 1.7.3 pathe: 1.1.2 pkg-types: 1.2.1 unplugin: 1.15.0 @@ -23999,7 +24068,7 @@ snapshots: - rollup - supports-color - vite-plugin-inspect@0.8.9(@nuxt/kit@3.14.1592(magicast@0.3.5)(rollup@4.24.3))(rollup@4.24.3)(vite@5.4.11(@types/node@22.10.2)(terser@5.36.0)): + vite-plugin-inspect@0.8.9(@nuxt/kit@3.15.0(magicast@0.3.5)(rollup@4.24.3))(rollup@4.24.3)(vite@5.4.11(@types/node@22.10.2)(terser@5.36.0)): dependencies: '@antfu/utils': 0.7.10 '@rollup/pluginutils': 5.1.3(rollup@4.24.3) @@ -24012,7 +24081,7 @@ snapshots: sirv: 3.0.0 vite: 5.4.11(@types/node@22.10.2)(terser@5.36.0) optionalDependencies: - '@nuxt/kit': 3.14.1592(magicast@0.3.5)(rollup@4.24.3) + '@nuxt/kit': 3.15.0(magicast@0.3.5)(rollup@4.24.3) transitivePeerDependencies: - rollup - supports-color @@ -24030,7 +24099,7 @@ snapshots: transitivePeerDependencies: - supports-color - vite-plugin-vue-inspector@5.1.3(vite@5.4.11(@types/node@22.10.2)(terser@5.36.0)): + vite-plugin-vue-inspector@5.3.1(vite@5.4.11(@types/node@22.10.2)(terser@5.36.0)): dependencies: '@babel/core': 7.26.0 '@babel/plugin-proposal-decorators': 7.25.9(@babel/core@7.26.0) @@ -24038,9 +24107,9 @@ snapshots: '@babel/plugin-syntax-import-meta': 7.10.4(@babel/core@7.26.0) '@babel/plugin-transform-typescript': 7.25.9(@babel/core@7.26.0) '@vue/babel-plugin-jsx': 1.2.5(@babel/core@7.26.0) - '@vue/compiler-dom': 3.5.12 + '@vue/compiler-dom': 3.5.13 kolorist: 1.8.0 - magic-string: 0.30.14 + magic-string: 0.30.17 vite: 5.4.11(@types/node@22.10.2)(terser@5.36.0) transitivePeerDependencies: - supports-color diff --git a/shared/src/cascader-data.ts b/shared/src/cascader-data.ts index 635af86a23..f85b6b0fdb 100644 --- a/shared/src/cascader-data.ts +++ b/shared/src/cascader-data.ts @@ -1,221 +1,16732 @@ export const cascaderData = { - label: "ROOT", - value: "", - children: [ + label: "World", + value: "world", + continents: [ { label: "Africa", value: "africa", - children: [ + countries: [ + { + label: "Algeria", + value: "algeria", + code: "DZ", + states: [ + { + label: "Adrar", + value: "adrar:01", + }, + { + label: "Alger", + value: "alger:16", + }, + { + label: "Annaba", + value: "annaba:23", + }, + { + label: "Aïn Defla", + value: "aïn-defla:44", + }, + { + label: "Aïn Témouchent", + value: "aïn-témouchent:46", + }, + { + label: "Batna", + value: "batna:05", + }, + { + label: "Biskra", + value: "biskra:07", + }, + { + label: "Blida", + value: "blida:09", + }, + { + label: "Bordj Bou Arréridj", + value: "bordj-bou-arréridj:34", + }, + { + label: "Bouira", + value: "bouira:10", + }, + { + label: "Boumerdès", + value: "boumerdès:35", + }, + { + label: "Béchar", + value: "béchar:08", + }, + { + label: "Béjaïa", + value: "béjaïa:06", + }, + { + label: "Chlef", + value: "chlef:02", + }, + { + label: "Constantine", + value: "constantine:25", + }, + { + label: "Djelfa", + value: "djelfa:17", + }, + { + label: "El Bayadh", + value: "el-bayadh:32", + }, + { + label: "El Oued", + value: "el-oued:39", + }, + { + label: "El Tarf", + value: "el-tarf:36", + }, + { + label: "Ghardaïa", + value: "ghardaïa:47", + }, + { + label: "Guelma", + value: "guelma:24", + }, + { + label: "Illizi", + value: "illizi:33", + }, + { + label: "Jijel", + value: "jijel:18", + }, + { + label: "Khenchela", + value: "khenchela:40", + }, + { + label: "Laghouat", + value: "laghouat:03", + }, + { + label: "Mascara", + value: "mascara:29", + }, + { + label: "Mila", + value: "mila:43", + }, + { + label: "Mostaganem", + value: "mostaganem:27", + }, + { + label: "Msila", + value: "msila:28", + }, + { + label: "Médéa", + value: "médéa:26", + }, + { + label: "Naama", + value: "naama:45", + }, + { + label: "Oran", + value: "oran:31", + }, + { + label: "Ouargla", + value: "ouargla:30", + }, + { + label: "Oum el Bouaghi", + value: "oum-el-bouaghi:04", + }, + { + label: "Relizane", + value: "relizane:48", + }, + { + label: "Saïda", + value: "saïda:20", + }, + { + label: "Sidi Bel Abbès", + value: "sidi-bel-abbès:22", + }, + { + label: "Skikda", + value: "skikda:21", + }, + { + label: "Souk Ahras", + value: "souk-ahras:41", + }, + { + label: "Sétif", + value: "sétif:19", + }, + { + label: "Tamanghasset", + value: "tamanghasset:11", + }, + { + label: "Tiaret", + value: "tiaret:14", + }, + { + label: "Tindouf", + value: "tindouf:37", + }, + { + label: "Tipaza", + value: "tipaza:42", + }, + { + label: "Tissemsilt", + value: "tissemsilt:38", + }, + { + label: "Tizi Ouzou", + value: "tizi-ouzou:15", + }, + { + label: "Tlemcen", + value: "tlemcen:13", + }, + { + label: "Tébessa", + value: "tébessa:12", + }, + ], + }, + { + label: "Angola", + value: "angola", + code: "AO", + states: [ + { + label: "Bengo", + value: "bengo:BGO", + }, + { + label: "Benguela", + value: "benguela:BGU", + }, + { + label: "Bié", + value: "bié:BIE", + }, + { + label: "Cabinda", + value: "cabinda:CAB", + }, + { + label: "Cunene", + value: "cunene:CNN", + }, + { + label: "Huambo", + value: "huambo:HUA", + }, + { + label: "Huíla", + value: "huíla:HUI", + }, + { + label: "Kuando Kubango", + value: "kuando-kubango:CCU", + }, + { + label: "Kwanza Norte", + value: "kwanza-norte:CNO", + }, + { + label: "Kwanza Sul", + value: "kwanza-sul:CUS", + }, + { + label: "Luanda", + value: "luanda:LUA", + }, + { + label: "Lunda Norte", + value: "lunda-norte:LNO", + }, + { + label: "Lunda Sul", + value: "lunda-sul:LSU", + }, + { + label: "Malange", + value: "malange:MAL", + }, + { + label: "Moxico", + value: "moxico:MOX", + }, + { + label: "Namibe", + value: "namibe:NAM", + }, + { + label: "Uíge", + value: "uíge:UIG", + }, + { + label: "Zaire", + value: "zaire:ZAI", + }, + ], + }, + { + label: "Benin", + value: "benin", + code: "BJ", + states: [ + { + label: "Alibori", + value: "alibori:AL", + }, + { + label: "Atakora", + value: "atakora:AK", + }, + { + label: "Atlantique", + value: "atlantique:AQ", + }, + { + label: "Borgou", + value: "borgou:BO", + }, + { + label: "Collines", + value: "collines:CO", + }, + { + label: "Donga", + value: "donga:DO", + }, + { + label: "Kouffo", + value: "kouffo:KO", + }, + { + label: "Littoral", + value: "littoral:LI", + }, + { + label: "Mono", + value: "mono:MO", + }, + { + label: "Ouémé", + value: "ouémé:OU", + }, + { + label: "Plateau", + value: "plateau:PL", + }, + { + label: "Zou", + value: "zou:ZO", + }, + ], + }, + { + label: "Botswana", + value: "botswana", + code: "BW", + states: [ + { + label: "Central", + value: "central:CE", + }, + { + label: "Chobe", + value: "chobe:CH", + }, + { + label: "Francistown", + value: "francistown:FR", + }, + { + label: "Gaborone", + value: "gaborone:GA", + }, + { + label: "Ghanzi", + value: "ghanzi:GH", + }, + { + label: "Jwaneng", + value: "jwaneng:JW", + }, + { + label: "Kgalagadi", + value: "kgalagadi:KG", + }, + { + label: "Kgatleng", + value: "kgatleng:KL", + }, + { + label: "Kweneng", + value: "kweneng:KW", + }, + { + label: "Lobatse", + value: "lobatse:LO", + }, + { + label: "North-East", + value: "north-east:NE", + }, + { + label: "North-West", + value: "north-west:NW", + }, + { + label: "Selibe Phikwe", + value: "selibe-phikwe:SP", + }, + { + label: "South-East", + value: "south-east:SE", + }, + { + label: "Southern", + value: "southern:SO", + }, + { + label: "Sowa Town", + value: "sowa-town:ST", + }, + ], + }, + { + label: "British Indian Ocean Territory", + value: "british-indian-ocean-territory", + code: "IO", + states: [], + }, + { + label: "Burkina Faso", + value: "burkina-faso", + code: "BF", + states: [ + { + label: "Boucle du Mouhoun", + value: "boucle-du-mouhoun:01", + }, + { + label: "Cascades", + value: "cascades:02", + }, + { + label: "Centre", + value: "centre:03", + }, + { + label: "Centre-Est", + value: "centre-est:04", + }, + { + label: "Centre-Nord", + value: "centre-nord:05", + }, + { + label: "Centre-Ouest", + value: "centre-ouest:06", + }, + { + label: "Centre-Sud", + value: "centre-sud:07", + }, + { + label: "Est", + value: "est:08", + }, + { + label: "Hauts-Bassins", + value: "hauts-bassins:09", + }, + { + label: "Nord", + value: "nord:10", + }, + { + label: "Plateau-Central", + value: "plateau-central:11", + }, + { + label: "Sahel", + value: "sahel:12", + }, + { + label: "Sud-Ouest", + value: "sud-ouest:13", + }, + ], + }, + { + label: "Burundi", + value: "burundi", + code: "BI", + states: [ + { + label: "Bubanza", + value: "bubanza:BB", + }, + { + label: "Bujumbura Mairie", + value: "bujumbura-mairie:BM", + }, + { + label: "Bujumbura Rural", + value: "bujumbura-rural:BL", + }, + { + label: "Bururi", + value: "bururi:BR", + }, + { + label: "Cankuzo", + value: "cankuzo:CA", + }, + { + label: "Cibitoke", + value: "cibitoke:CI", + }, + { + label: "Gitega", + value: "gitega:GI", + }, + { + label: "Karuzi", + value: "karuzi:KR", + }, + { + label: "Kayanza", + value: "kayanza:KY", + }, + { + label: "Kirundo", + value: "kirundo:KI", + }, + { + label: "Makamba", + value: "makamba:MA", + }, + { + label: "Muramvya", + value: "muramvya:MU", + }, + { + label: "Muyinga", + value: "muyinga:MY", + }, + { + label: "Mwaro", + value: "mwaro:MW", + }, + { + label: "Ngozi", + value: "ngozi:NG", + }, + { + label: "Rutana", + value: "rutana:RT", + }, + { + label: "Ruyigi", + value: "ruyigi:RY", + }, + ], + }, + { + label: "Cameroon", + value: "cameroon", + code: "CM", + states: [ + { + label: "Adamaoua", + value: "adamaoua:AD", + }, + { + label: "Centre", + value: "centre:CE", + }, + { + label: "East", + value: "east:ES", + }, + { + label: "Far North", + value: "far-north:EN", + }, + { + label: "Littoral", + value: "littoral:LT", + }, + { + label: "North", + value: "north:NO", + }, + { + label: "North-West", + value: "north-west:NW", + }, + { + label: "South", + value: "south:SU", + }, + { + label: "South-West", + value: "south-west:SW", + }, + { + label: "West", + value: "west:OU", + }, + ], + }, + { + label: "Cape Verde", + value: "cape-verde", + code: "CV", + states: [ + { + label: "Ilhas de Barlavento", + value: "ilhas-de-barlavento:B", + }, + { + label: "Ilhas de Sotavento", + value: "ilhas-de-sotavento:S", + }, + ], + }, + { + label: "Central African Republic", + value: "central-african-republic", + code: "CF", + states: [ + { + label: "Bamingui-Bangoran", + value: "bamingui-bangoran:BB", + }, + { + label: "Bangui", + value: "bangui:BGF", + }, + { + label: "Basse-Kotto", + value: "basse-kotto:BK", + }, + { + label: "Gribingui", + value: "gribingui:KB", + }, + { + label: "Haut-Mbomou", + value: "haut-mbomou:HM", + }, + { + label: "Haute-Kotto", + value: "haute-kotto:HK", + }, + { + label: "Haute-Sangha / Mambéré-Kadéï", + value: "haute-sangha-/-mambéré-kadéï:HS", + }, + { + label: "Kémo-Gribingui", + value: "kémo-gribingui:KG", + }, + { + label: "Lobaye", + value: "lobaye:LB", + }, + { + label: "Mbomou", + value: "mbomou:MB", + }, + { + label: "Nana-Mambéré", + value: "nana-mambéré:NM", + }, + { + label: "Ombella-Mpoko", + value: "ombella-mpoko:MP", + }, + { + label: "Ouaka", + value: "ouaka:UK", + }, + { + label: "Ouham", + value: "ouham:AC", + }, + { + label: "Ouham-Pendé", + value: "ouham-pendé:OP", + }, + { + label: "Sangha", + value: "sangha:SE", + }, + { + label: "Vakaga", + value: "vakaga:VK", + }, + ], + }, + { + label: "Chad", + value: "chad", + code: "TD", + states: [ + { + label: "Al Baṭḩah", + value: "al-baṭḩah:BA", + }, + { + label: "Al Buḩayrah", + value: "al-buḩayrah:LC", + }, + { + label: "Baḩr al Ghazāl", + value: "baḩr-al-ghazāl:BG", + }, + { + label: "Būrkū", + value: "būrkū:BO", + }, + { + label: "Innīdī", + value: "innīdī:EN", + }, + { + label: "Kānim", + value: "kānim:KA", + }, + { + label: "Lūqūn al Gharbī", + value: "lūqūn-al-gharbī:LO", + }, + { + label: "Lūqūn ash Sharqī", + value: "lūqūn-ash-sharqī:LR", + }, + { + label: "Madīnat Injamīnā", + value: "madīnat-injamīnā:ND", + }, + { + label: "Māndūl", + value: "māndūl:MA", + }, + { + label: "Māyū Kībbī al Gharbī", + value: "māyū-kībbī-al-gharbī:MO", + }, + { + label: "Māyū Kībbī ash Sharqī", + value: "māyū-kībbī-ash-sharqī:ME", + }, + { + label: "Qīrā", + value: "qīrā:GR", + }, + { + label: "Salāmāt", + value: "salāmāt:SA", + }, + { + label: "Shārī Bāqirmī", + value: "shārī-bāqirmī:CB", + }, + { + label: "Shārī al Awsaṭ", + value: "shārī-al-awsaṭ:MC", + }, + { + label: "Sīlā", + value: "sīlā:SI", + }, + { + label: "Tibastī", + value: "tibastī:TI", + }, + { + label: "Tānjilī", + value: "tānjilī:TA", + }, + { + label: "Waddāy", + value: "waddāy:OD", + }, + { + label: "Wādī Fīrā", + value: "wādī-fīrā:WF", + }, + { + label: "Ḥajjar Lamīs", + value: "ḥajjar-lamīs:HL", + }, + ], + }, + { + label: "Comoros", + value: "comoros", + code: "KM", + states: [ + { + label: "Anjouan", + value: "anjouan:A", + }, + { + label: "Grande Comore", + value: "grande-comore:G", + }, + { + label: "Mohéli", + value: "mohéli:M", + }, + ], + }, + { + label: "Republic of the Congo", + value: "republic-of-the-congo", + code: "CG", + states: [ + { + label: "Bouenza", + value: "bouenza:11", + }, + { + label: "Brazzaville", + value: "brazzaville:BZV", + }, + { + label: "Cuvette", + value: "cuvette:8", + }, + { + label: "Cuvette-Ouest", + value: "cuvette-ouest:15", + }, + { + label: "Kouilou", + value: "kouilou:5", + }, + { + label: "Likouala", + value: "likouala:7", + }, + { + label: "Lékoumou", + value: "lékoumou:2", + }, + { + label: "Niari", + value: "niari:9", + }, + { + label: "Plateaux", + value: "plateaux:14", + }, + { + label: "Pointe-Noire", + value: "pointe-noire:16", + }, + { + label: "Pool", + value: "pool:12", + }, + { + label: "Sangha", + value: "sangha:13", + }, + ], + }, + { + label: "Democratic Republic of the Congo", + value: "democratic-republic-of-the-congo", + code: "CD", + states: [ + { + label: "Bandundu", + value: "bandundu:BN", + }, + { + label: "Bas-Congo", + value: "bas-congo:BC", + }, + { + label: "Kasai-Occidental", + value: "kasai-occidental:KW", + }, + { + label: "Kasai-Oriental", + value: "kasai-oriental:KE", + }, + { + label: "Katanga", + value: "katanga:KA", + }, + { + label: "Kinshasa", + value: "kinshasa:KN", + }, + { + label: "Maniema", + value: "maniema:MA", + }, + { + label: "Nord-Kivu", + value: "nord-kivu:NK", + }, + { + label: "Orientale", + value: "orientale:OR", + }, + { + label: "Sud-Kivu", + value: "sud-kivu:SK", + }, + { + label: "Équateur", + value: "équateur:EQ", + }, + ], + }, + { + label: "Djibouti", + value: "djibouti", + code: "DJ", + states: [ + { + label: "Ali Sabieh", + value: "ali-sabieh:AS", + }, + { + label: "Arta", + value: "arta:AR", + }, + { + label: "Dikhil", + value: "dikhil:DI", + }, + { + label: "Djibouti", + value: "djibouti:DJ", + }, + { + label: "Obock", + value: "obock:OB", + }, + { + label: "Tadjourah", + value: "tadjourah:TA", + }, + ], + }, + { + label: "Egypt", + value: "egypt", + code: "EG", + states: [ + { + label: "Ad Daqahlīyah", + value: "ad-daqahlīyah:DK", + }, + { + label: "Al Baḩr al Aḩmar", + value: "al-baḩr-al-aḩmar:BA", + }, + { + label: "Al Buḩayrah", + value: "al-buḩayrah:BH", + }, + { + label: "Al Fayyūm", + value: "al-fayyūm:FYM", + }, + { + label: "Al Gharbīyah", + value: "al-gharbīyah:GH", + }, + { + label: "Al Iskandarīyah", + value: "al-iskandarīyah:ALX", + }, + { + label: "Al Ismāٰīlīyah", + value: "al-ismāٰīlīyah:IS", + }, + { + label: "Al Jīzah", + value: "al-jīzah:GZ", + }, + { + label: "Al Minyā", + value: "al-minyā:MN", + }, + { + label: "Al Minūfīyah", + value: "al-minūfīyah:MNF", + }, + { + label: "Al Qalyūbīyah", + value: "al-qalyūbīyah:KB", + }, + { + label: "Al Qāhirah", + value: "al-qāhirah:C", + }, + { + label: "Al Uqşur", + value: "al-uqşur:LX", + }, + { + label: "Al Wādī al Jadīd", + value: "al-wādī-al-jadīd:WAD", + }, + { + label: "As Suways", + value: "as-suways:SUZ", + }, + { + label: "As Sādis min Uktūbar", + value: "as-sādis-min-uktūbar:SU", + }, + { + label: "Ash Sharqīyah", + value: "ash-sharqīyah:SHR", + }, + { + label: "Aswān", + value: "aswān:ASN", + }, + { + label: "Asyūţ", + value: "asyūţ:AST", + }, + { + label: "Banī Suwayf", + value: "banī-suwayf:BNS", + }, + { + label: "Būr Saٰīd", + value: "būr-saٰīd:PTS", + }, + { + label: "Dumyāţ", + value: "dumyāţ:DT", + }, + { + label: "Janūb Sīnā'", + value: "janūb-sīnā':JS", + }, + { + label: "Kafr ash Shaykh", + value: "kafr-ash-shaykh:KFS", + }, + { + label: "Maţrūḩ", + value: "maţrūḩ:MT", + }, + { + label: "Qinā", + value: "qinā:KN", + }, + { + label: "Shamāl Sīnā'", + value: "shamāl-sīnā':SIN", + }, + { + label: "Sūhāj", + value: "sūhāj:SHG", + }, + { + label: "Ḩulwān", + value: "ḩulwān:HU", + }, + ], + }, + { + label: "Equatorial Guinea", + value: "equatorial-guinea", + code: "GQ", + states: [ + { + label: "Región Continental", + value: "región-continental:C", + }, + { + label: "Región Insular", + value: "región-insular:I", + }, + ], + }, + { + label: "Eritrea", + value: "eritrea", + code: "ER", + states: [ + { + label: "Al Awsaţ", + value: "al-awsaţ:MA", + }, + { + label: "Al Janūbĩ", + value: "al-janūbĩ:DU", + }, + { + label: "Ansabā", + value: "ansabā:AN", + }, + { + label: "Janūbī al Baḩrī al Aḩmar", + value: "janūbī-al-baḩrī-al-aḩmar:DK", + }, + { + label: "Qāsh-Barkah", + value: "qāsh-barkah:GB", + }, + { + label: "Shimālī al Baḩrī al Aḩmar", + value: "shimālī-al-baḩrī-al-aḩmar:SK", + }, + ], + }, + { + label: "Ethiopia", + value: "ethiopia", + code: "ET", + states: [ + { + label: "Bīnshangul Gumuz", + value: "bīnshangul-gumuz:BE", + }, + { + label: "Dirē Dawa", + value: "dirē-dawa:DD", + }, + { + label: "Gambēla Hizboch", + value: "gambēla-hizboch:GA", + }, + { + label: "Hārerī Hizb", + value: "hārerī-hizb:HA", + }, + { + label: "Oromīya", + value: "oromīya:OR", + }, + { + label: "Sumalē", + value: "sumalē:SO", + }, + { + label: "Tigray", + value: "tigray:TI", + }, + { + label: "YeDebub Bihēroch Bihēreseboch na Hizboch", + value: "yedebub-bihēroch-bihēreseboch-na-hizboch:SN", + }, + { + label: "Ādīs Ābeba", + value: "ādīs-ābeba:AA", + }, + { + label: "Āfar", + value: "āfar:AF", + }, + { + label: "Āmara", + value: "āmara:AM", + }, + ], + }, + { + label: "French Southern and Antarctic Lands", + value: "french-southern-and-antarctic-lands", + code: "TF", + states: [], + }, + { + label: "Gabon", + value: "gabon", + code: "GA", + states: [ + { + label: "Estuaire", + value: "estuaire:1", + }, + { + label: "Haut-Ogooué", + value: "haut-ogooué:2", + }, + { + label: "Moyen-Ogooué", + value: "moyen-ogooué:3", + }, + { + label: "Ngounié", + value: "ngounié:4", + }, + { + label: "Nyanga", + value: "nyanga:5", + }, + { + label: "Ogooué-Ivindo", + value: "ogooué-ivindo:6", + }, + { + label: "Ogooué-Lolo", + value: "ogooué-lolo:7", + }, + { + label: "Ogooué-Maritime", + value: "ogooué-maritime:8", + }, + { + label: "Woleu-Ntem", + value: "woleu-ntem:9", + }, + ], + }, + { + label: "The Gambia", + value: "the-gambia", + code: "GM", + states: [ + { + label: "Banjul", + value: "banjul:B", + }, + { + label: "Central River", + value: "central-river:M", + }, + { + label: "Lower River", + value: "lower-river:L", + }, + { + label: "North Bank", + value: "north-bank:N", + }, + { + label: "Upper River", + value: "upper-river:U", + }, + { + label: "Western", + value: "western:W", + }, + ], + }, + { + label: "Ghana", + value: "ghana", + code: "GH", + states: [ + { + label: "Ashanti", + value: "ashanti:AH", + }, + { + label: "Brong-Ahafo", + value: "brong-ahafo:BA", + }, + { + label: "Central", + value: "central:CP", + }, + { + label: "Eastern", + value: "eastern:EP", + }, + { + label: "Greater Accra", + value: "greater-accra:AA", + }, + { + label: "Northern", + value: "northern:NP", + }, + { + label: "Upper East", + value: "upper-east:UE", + }, + { + label: "Upper West", + value: "upper-west:UW", + }, + { + label: "Volta", + value: "volta:TV", + }, + { + label: "Western", + value: "western:WP", + }, + ], + }, + { + label: "Guinea", + value: "guinea", + code: "GN", + states: [ + { + label: "Boké", + value: "boké:B", + }, + { + label: "Conakry", + value: "conakry:C", + }, + { + label: "Faranah", + value: "faranah:F", + }, + { + label: "Kankan", + value: "kankan:K", + }, + { + label: "Kindia", + value: "kindia:D", + }, + { + label: "Labé", + value: "labé:L", + }, + { + label: "Mamou", + value: "mamou:M", + }, + { + label: "Nzérékoré", + value: "nzérékoré:N", + }, + ], + }, + { + label: "Guinea-Bissau", + value: "guinea-bissau", + code: "GW", + states: [ + { + label: "Leste", + value: "leste:L", + }, + { + label: "Norte", + value: "norte:N", + }, + { + label: "Sul", + value: "sul:S", + }, + ], + }, + { + label: "Ivory Coast", + value: "ivory-coast", + code: "CI", + states: [ + { + label: "18 Montagnes", + value: "18-montagnes:06", + }, + { + label: "Agnébi", + value: "agnébi:16", + }, + { + label: "Bafing", + value: "bafing:17", + }, + { + label: "Bas-Sassandra", + value: "bas-sassandra:09", + }, + { + label: "Denguélé", + value: "denguélé:10", + }, + { + label: "Fromager", + value: "fromager:18", + }, + { + label: "Haut-Sassandra", + value: "haut-sassandra:02", + }, + { + label: "Lacs", + value: "lacs:07", + }, + { + label: "Lagunes", + value: "lagunes:01", + }, + { + label: "Marahoué", + value: "marahoué:12", + }, + { + label: "Moyen-Cavally", + value: "moyen-cavally:19", + }, + { + label: "Moyen-Comoé", + value: "moyen-comoé:05", + }, + { + label: "Nzi-Comoé", + value: "nzi-comoé:11", + }, + { + label: "Savanes", + value: "savanes:03", + }, + { + label: "Sud-Bandama", + value: "sud-bandama:15", + }, + { + label: "Sud-Comoé", + value: "sud-comoé:13", + }, + { + label: "Vallée du Bandama", + value: "vallée-du-bandama:04", + }, + { + label: "Worodougou", + value: "worodougou:14", + }, + { + label: "Zanzan", + value: "zanzan:08", + }, + ], + }, + { + label: "Kenya", + value: "kenya", + code: "KE", + states: [ + { + label: "Central", + value: "central:200", + }, + { + label: "Coast", + value: "coast:300", + }, + { + label: "Eastern", + value: "eastern:400", + }, + { + label: "Nairobi", + value: "nairobi:110", + }, + { + label: "North-Eastern", + value: "north-eastern:500", + }, + { + label: "Nyanza", + value: "nyanza:600", + }, + { + label: "Rift Valley", + value: "rift-valley:700", + }, + { + label: "Western", + value: "western:800", + }, + ], + }, + { + label: "Lesotho", + value: "lesotho", + code: "LS", + states: [ + { + label: "Berea", + value: "berea:D", + }, + { + label: "Butha-Buthe", + value: "butha-buthe:B", + }, + { + label: "Leribe", + value: "leribe:C", + }, + { + label: "Mafeteng", + value: "mafeteng:E", + }, + { + label: "Maseru", + value: "maseru:A", + }, + { + label: "Mohale's Hoek", + value: "mohale's-hoek:F", + }, + { + label: "Mokhotlong", + value: "mokhotlong:J", + }, + { + label: "Qacha's Nek", + value: "qacha's-nek:H", + }, + { + label: "Quthing", + value: "quthing:G", + }, + { + label: "Thaba-Tseka", + value: "thaba-tseka:K", + }, + ], + }, + { + label: "Liberia", + value: "liberia", + code: "LR", + states: [ + { + label: "Bomi", + value: "bomi:BM", + }, + { + label: "Bong", + value: "bong:BG", + }, + { + label: "Gbarpolu", + value: "gbarpolu:GP", + }, + { + label: "Grand Bassa", + value: "grand-bassa:GB", + }, + { + label: "Grand Cape Mount", + value: "grand-cape-mount:CM", + }, + { + label: "Grand Gedeh", + value: "grand-gedeh:GG", + }, + { + label: "Grand Kru", + value: "grand-kru:GK", + }, + { + label: "Lofa", + value: "lofa:LO", + }, + { + label: "Margibi", + value: "margibi:MG", + }, + { + label: "Maryland", + value: "maryland:MY", + }, + { + label: "Montserrado", + value: "montserrado:MO", + }, + { + label: "Nimba", + value: "nimba:NI", + }, + { + label: "River Gee", + value: "river-gee:RG", + }, + { + label: "Rivercess", + value: "rivercess:RI", + }, + { + label: "Sinoe", + value: "sinoe:SI", + }, + ], + }, + { + label: "Libya", + value: "libya", + code: "LY", + states: [ + { + label: "Al Buţnān", + value: "al-buţnān:BU", + }, + { + label: "Al Jabal al Akhḑar", + value: "al-jabal-al-akhḑar:JA", + }, + { + label: "Al Jabal al Gharbī", + value: "al-jabal-al-gharbī:JG", + }, + { + label: "Al Jifārah", + value: "al-jifārah:JI", + }, + { + label: "Al Jufrah", + value: "al-jufrah:JU", + }, + { + label: "Al Kufrah", + value: "al-kufrah:KF", + }, + { + label: "Al Marj", + value: "al-marj:MJ", + }, + { + label: "Al Marqab", + value: "al-marqab:MB", + }, + { + label: "Al Wāḩāt", + value: "al-wāḩāt:WA", + }, + { + label: "An Nuqaţ al Khams", + value: "an-nuqaţ-al-khams:NQ", + }, + { + label: "Az Zāwiyah", + value: "az-zāwiyah:ZA", + }, + { + label: "Banghāzī", + value: "banghāzī:BA", + }, + { + label: "Darnah", + value: "darnah:DR", + }, + { + label: "Ghāt", + value: "ghāt:GT", + }, + { + label: "Mişrātah", + value: "mişrātah:MI", + }, + { + label: "Murzuq", + value: "murzuq:MQ", + }, + { + label: "Nālūt", + value: "nālūt:NL", + }, + { + label: "Sabhā", + value: "sabhā:SB", + }, + { + label: "Surt", + value: "surt:SR", + }, + { + label: "Wādī al Ḩayāt", + value: "wādī-al-ḩayāt:WD", + }, + { + label: "Wādī ash Shāţiʾ", + value: "wādī-ash-shāţiʾ:WS", + }, + { + label: "Ţarābulus", + value: "ţarābulus:TB", + }, + ], + }, + { + label: "Madagascar", + value: "madagascar", + code: "MG", + states: [ + { + label: "Antananarivo", + value: "antananarivo:T", + }, + { + label: "Antsiranana", + value: "antsiranana:D", + }, + { + label: "Fianarantsoa", + value: "fianarantsoa:F", + }, + { + label: "Mahajanga", + value: "mahajanga:M", + }, + { + label: "Toamasina", + value: "toamasina:A", + }, + { + label: "Toliara", + value: "toliara:U", + }, + ], + }, + { + label: "Malawi", + value: "malawi", + code: "MW", + states: [ + { + label: "Central Region", + value: "central-region:C", + }, + { + label: "Northern Region", + value: "northern-region:N", + }, + { + label: "Southern Region", + value: "southern-region:S", + }, + ], + }, + { + label: "Mali", + value: "mali", + code: "ML", + states: [ + { + label: "Bamako", + value: "bamako:BKO", + }, + { + label: "Gao", + value: "gao:7", + }, + { + label: "Kayes", + value: "kayes:1", + }, + { + label: "Kidal", + value: "kidal:8", + }, + { + label: "Koulikoro", + value: "koulikoro:2", + }, + { + label: "Mopti", + value: "mopti:5", + }, + { + label: "Sikasso", + value: "sikasso:3", + }, + { + label: "Ségou", + value: "ségou:4", + }, + { + label: "Tombouctou", + value: "tombouctou:6", + }, + ], + }, + { + label: "Mauritania", + value: "mauritania", + code: "MR", + states: [ + { + label: "Adrar", + value: "adrar:07", + }, + { + label: "Assaba", + value: "assaba:03", + }, + { + label: "Brakna", + value: "brakna:05", + }, + { + label: "Dakhlet Nouâdhibou", + value: "dakhlet-nouâdhibou:08", + }, + { + label: "Gorgol", + value: "gorgol:04", + }, + { + label: "Guidimaka", + value: "guidimaka:10", + }, + { + label: "Hodh ech Chargui", + value: "hodh-ech-chargui:01", + }, + { + label: "Hodh el Gharbi", + value: "hodh-el-gharbi:02", + }, + { + label: "Inchiri", + value: "inchiri:12", + }, + { + label: "Nouakchott", + value: "nouakchott:NKC", + }, + { + label: "Tagant", + value: "tagant:09", + }, + { + label: "Tiris Zemmour", + value: "tiris-zemmour:11", + }, + { + label: "Trarza", + value: "trarza:06", + }, + ], + }, + { + label: "Mauritius", + value: "mauritius", + code: "MU", + states: [ + { + label: "Agalega Islands", + value: "agalega-islands:AG", + }, + { + label: "Beau Bassin-Rose Hill", + value: "beau-bassin-rose-hill:BR", + }, + { + label: "Black River", + value: "black-river:BL", + }, + { + label: "Cargados Carajos Shoals", + value: "cargados-carajos-shoals:CC", + }, + { + label: "Curepipe", + value: "curepipe:CU", + }, + { + label: "Flacq", + value: "flacq:FL", + }, + { + label: "Grand Port", + value: "grand-port:GP", + }, + { + label: "Moka", + value: "moka:MO", + }, + { + label: "Pamplemousses", + value: "pamplemousses:PA", + }, + { + label: "Plaines Wilhems", + value: "plaines-wilhems:PW", + }, + { + label: "Port Louis", + value: "port-louis:PL", + }, + { + label: "Port Louis", + value: "port-louis:PU", + }, + { + label: "Quatre Bornes", + value: "quatre-bornes:QB", + }, + { + label: "Rivière du Rempart", + value: "rivière-du-rempart:RR", + }, + { + label: "Rodrigues Island", + value: "rodrigues-island:RO", + }, + { + label: "Savanne", + value: "savanne:SA", + }, + { + label: "Vacoas-Phoenix", + value: "vacoas-phoenix:VP", + }, + ], + }, + { + label: "Mayotte", + value: "mayotte", + code: "YT", + states: [], + }, + { + label: "Morocco", + value: "morocco", + code: "MA", + states: [ + { + label: "Chaouia-Ouardigha", + value: "chaouia-ouardigha:09", + }, + { + label: "Doukhala-Abda", + value: "doukhala-abda:10", + }, + { + label: "Fès-Boulemane", + value: "fès-boulemane:05", + }, + { + label: "Gharb-Chrarda-Beni Hssen", + value: "gharb-chrarda-beni-hssen:02", + }, + { + label: "Grand Casablanca", + value: "grand-casablanca:08", + }, + { + label: "Guelmim-Es Smara", + value: "guelmim-es-smara:14", + }, + { + label: "L'Oriental", + value: "l'oriental:04", + }, + { + label: "Laâyoune-Boujdour-Sakia el Hamra", + value: "laâyoune-boujdour-sakia-el-hamra:15", + }, + { + label: "Marrakech-Tensift-Al Haouz", + value: "marrakech-tensift-al-haouz:11", + }, + { + label: "Meknès-Tafilalet", + value: "meknès-tafilalet:06", + }, + { + label: "Oued ed Dahab-Lagouira", + value: "oued-ed-dahab-lagouira:16", + }, + { + label: "Rabat-Salé-Zemmour-Zaer", + value: "rabat-salé-zemmour-zaer:07", + }, + { + label: "Souss-Massa-Drâa", + value: "souss-massa-drâa:13", + }, + { + label: "Tadla-Azilal", + value: "tadla-azilal:12", + }, + { + label: "Tanger-Tétouan", + value: "tanger-tétouan:01", + }, + { + label: "Taza-Al Hoceima-Taounate", + value: "taza-al-hoceima-taounate:03", + }, + ], + }, + { + label: "Mozambique", + value: "mozambique", + code: "MZ", + states: [ + { + label: "Cabo Delgado", + value: "cabo-delgado:P", + }, + { + label: "Gaza", + value: "gaza:G", + }, + { + label: "Inhambane", + value: "inhambane:I", + }, + { + label: "Manica", + value: "manica:B", + }, + { + label: "Maputo", + value: "maputo:MPM", + }, + { + label: "Maputo", + value: "maputo:L", + }, + { + label: "Nampula", + value: "nampula:N", + }, + { + label: "Niassa", + value: "niassa:A", + }, + { + label: "Sofala", + value: "sofala:S", + }, + { + label: "Tete", + value: "tete:T", + }, + { + label: "Zambézia", + value: "zambézia:Q", + }, + ], + }, + { + label: "Namibia", + value: "namibia", + code: "NA", + states: [ + { + label: "Erongo", + value: "erongo:ER", + }, + { + label: "Hardap", + value: "hardap:HA", + }, + { + label: "Karas", + value: "karas:KA", + }, + { + label: "Kavango East", + value: "kavango-east:KE", + }, + { + label: "Kavango West", + value: "kavango-west:KW", + }, + { + label: "Khomas", + value: "khomas:KH", + }, + { + label: "Kunene", + value: "kunene:KU", + }, + { + label: "Ohangwena", + value: "ohangwena:OW", + }, + { + label: "Omaheke", + value: "omaheke:OH", + }, + { + label: "Omusati", + value: "omusati:OS", + }, + { + label: "Oshana", + value: "oshana:ON", + }, + { + label: "Oshikoto", + value: "oshikoto:OT", + }, + { + label: "Otjozondjupa", + value: "otjozondjupa:OD", + }, + { + label: "Zambezi", + value: "zambezi:CA", + }, + ], + }, + { + label: "Niger", + value: "niger", + code: "NE", + states: [ + { + label: "Agadez", + value: "agadez:1", + }, + { + label: "Diffa", + value: "diffa:2", + }, + { + label: "Dosso", + value: "dosso:3", + }, + { + label: "Maradi", + value: "maradi:4", + }, + { + label: "Niamey", + value: "niamey:8", + }, + { + label: "Tahoua", + value: "tahoua:5", + }, + { + label: "Tillabéri", + value: "tillabéri:6", + }, + { + label: "Zinder", + value: "zinder:7", + }, + ], + }, { label: "Nigeria", value: "nigeria", - children: [ - { label: "Lagos", value: "lagos" }, - { label: "Kano", value: "kano" }, - { label: "Rivers", value: "rivers" }, - { label: "Oyo", value: "oyo" }, - { label: "Kaduna", value: "kaduna" }, + code: "NG", + states: [ + { + label: "Abia", + value: "abia:AB", + }, + { + label: "Abuja Federal Capital Territory", + value: "abuja-federal-capital-territory:FC", + }, + { + label: "Adamawa", + value: "adamawa:AD", + }, + { + label: "Akwa Ibom", + value: "akwa-ibom:AK", + }, + { + label: "Anambra", + value: "anambra:AN", + }, + { + label: "Bauchi", + value: "bauchi:BA", + }, + { + label: "Bayelsa", + value: "bayelsa:BY", + }, + { + label: "Benue", + value: "benue:BE", + }, + { + label: "Borno", + value: "borno:BO", + }, + { + label: "Cross River", + value: "cross-river:CR", + }, + { + label: "Delta", + value: "delta:DE", + }, + { + label: "Ebonyi", + value: "ebonyi:EB", + }, + { + label: "Edo", + value: "edo:ED", + }, + { + label: "Ekiti", + value: "ekiti:EK", + }, + { + label: "Enugu", + value: "enugu:EN", + }, + { + label: "Gombe", + value: "gombe:GO", + }, + { + label: "Imo", + value: "imo:IM", + }, + { + label: "Jigawa", + value: "jigawa:JI", + }, + { + label: "Kaduna", + value: "kaduna:KD", + }, + { + label: "Kano", + value: "kano:KN", + }, + { + label: "Katsina", + value: "katsina:KT", + }, + { + label: "Kebbi", + value: "kebbi:KE", + }, + { + label: "Kogi", + value: "kogi:KO", + }, + { + label: "Kwara", + value: "kwara:KW", + }, + { + label: "Lagos", + value: "lagos:LA", + }, + { + label: "Nassarawa", + value: "nassarawa:NA", + }, + { + label: "Niger", + value: "niger:NI", + }, + { + label: "Ogun", + value: "ogun:OG", + }, + { + label: "Ondo", + value: "ondo:ON", + }, + { + label: "Osun", + value: "osun:OS", + }, + { + label: "Oyo", + value: "oyo:OY", + }, + { + label: "Plateau", + value: "plateau:PL", + }, + { + label: "Rivers", + value: "rivers:RI", + }, + { + label: "Sokoto", + value: "sokoto:SO", + }, + { + label: "Taraba", + value: "taraba:TA", + }, + { + label: "Yobe", + value: "yobe:YO", + }, + { + label: "Zamfara", + value: "zamfara:ZA", + }, + ], + }, + { + label: "Réunion", + value: "réunion", + code: "RE", + states: [], + }, + { + label: "Rwanda", + value: "rwanda", + code: "RW", + states: [ + { + label: "Est", + value: "est:02", + }, + { + label: "Nord", + value: "nord:03", + }, + { + label: "Ouest", + value: "ouest:04", + }, + { + label: "Sud", + value: "sud:05", + }, + { + label: "Ville de Kigali", + value: "ville-de-kigali:01", + }, + ], + }, + { + label: "Saint Helena", + value: "saint-helena", + code: "SH", + states: [ + { + label: "Ascension", + value: "ascension:AC", + }, + { + label: "Saint Helena", + value: "saint-helena:HL", + }, + { + label: "Tristan da Cunha", + value: "tristan-da-cunha:TA", + }, + ], + }, + { + label: "São Tomé and Príncipe", + value: "são-tomé-and-príncipe", + code: "ST", + states: [ + { + label: "Príncipe", + value: "príncipe:P", + }, + { + label: "São Tomé", + value: "são-tomé:S", + }, + ], + }, + { + label: "Senegal", + value: "senegal", + code: "SN", + states: [ + { + label: "Dakar", + value: "dakar:DK", + }, + { + label: "Diourbel", + value: "diourbel:DB", + }, + { + label: "Fatick", + value: "fatick:FK", + }, + { + label: "Kaffrine", + value: "kaffrine:KA", + }, + { + label: "Kaolack", + value: "kaolack:KL", + }, + { + label: "Kolda", + value: "kolda:KD", + }, + { + label: "Kédougou", + value: "kédougou:KE", + }, + { + label: "Louga", + value: "louga:LG", + }, + { + label: "Matam", + value: "matam:MT", + }, + { + label: "Saint-Louis", + value: "saint-louis:SL", + }, + { + label: "Sédhiou", + value: "sédhiou:SE", + }, + { + label: "Tambacounda", + value: "tambacounda:TC", + }, + { + label: "Thiès", + value: "thiès:TH", + }, + { + label: "Ziguinchor", + value: "ziguinchor:ZG", + }, + ], + }, + { + label: "Seychelles", + value: "seychelles", + code: "SC", + states: [ + { + label: "Anse Boileau", + value: "anse-boileau:02", + }, + { + label: "Anse Etoile", + value: "anse-etoile:03", + }, + { + label: "Anse Royale", + value: "anse-royale:05", + }, + { + label: "Anse aux Pins", + value: "anse-aux-pins:01", + }, + { + label: "Au Cap", + value: "au-cap:04", + }, + { + label: "Baie Lazare", + value: "baie-lazare:06", + }, + { + label: "Baie Sainte Anne", + value: "baie-sainte-anne:07", + }, + { + label: "Beau Vallon", + value: "beau-vallon:08", + }, + { + label: "Bel Air", + value: "bel-air:09", + }, + { + label: "Bel Ombre", + value: "bel-ombre:10", + }, + { + label: "Cascade", + value: "cascade:11", + }, + { + label: "English River", + value: "english-river:16", + }, + { + label: "Glacis", + value: "glacis:12", + }, + { + label: "Grand Anse Mahe", + value: "grand-anse-mahe:13", + }, + { + label: "Grand Anse Praslin", + value: "grand-anse-praslin:14", + }, + { + label: "La Digue", + value: "la-digue:15", + }, + { + label: "Les Mamelles", + value: "les-mamelles:24", + }, + { + label: "Mont Buxton", + value: "mont-buxton:17", + }, + { + label: "Mont Fleuri", + value: "mont-fleuri:18", + }, + { + label: "Plaisance", + value: "plaisance:19", + }, + { + label: "Pointe Larue", + value: "pointe-larue:20", + }, + { + label: "Port Glaud", + value: "port-glaud:21", + }, + { + label: "Roche Caiman", + value: "roche-caiman:25", + }, + { + label: "Saint Louis", + value: "saint-louis:22", + }, + { + label: "Takamaka", + value: "takamaka:23", + }, + ], + }, + { + label: "Sierra Leone", + value: "sierra-leone", + code: "SL", + states: [ + { + label: "Eastern", + value: "eastern:E", + }, + { + label: "Northern", + value: "northern:N", + }, + { + label: "Southern", + value: "southern:S", + }, + { + label: "Western Area", + value: "western-area:W", + }, + ], + }, + { + label: "Somalia", + value: "somalia", + code: "SO", + states: [ + { + label: "Awdal", + value: "awdal:AW", + }, + { + label: "Bakool", + value: "bakool:BK", + }, + { + label: "Banaadir", + value: "banaadir:BN", + }, + { + label: "Bari", + value: "bari:BR", + }, + { + label: "Bay", + value: "bay:BY", + }, + { + label: "Galguduud", + value: "galguduud:GA", + }, + { + label: "Gedo", + value: "gedo:GE", + }, + { + label: "Hiiraan", + value: "hiiraan:HI", + }, + { + label: "Jubbada Dhexe", + value: "jubbada-dhexe:JD", + }, + { + label: "Jubbada Hoose", + value: "jubbada-hoose:JH", + }, + { + label: "Mudug", + value: "mudug:MU", + }, + { + label: "Nugaal", + value: "nugaal:NU", + }, + { + label: "Sanaag", + value: "sanaag:SA", + }, + { + label: "Shabeellaha Dhexe", + value: "shabeellaha-dhexe:SD", + }, + { + label: "Shabeellaha Hoose", + value: "shabeellaha-hoose:SH", + }, + { + label: "Sool", + value: "sool:SO", + }, + { + label: "Togdheer", + value: "togdheer:TO", + }, + { + label: "Woqooyi Galbeed", + value: "woqooyi-galbeed:WO", + }, + ], + }, + { + label: "South Africa", + value: "south-africa", + code: "ZA", + states: [ + { + label: "Eastern Cape", + value: "eastern-cape:EC", + }, + { + label: "Free State", + value: "free-state:FS", + }, + { + label: "Gauteng", + value: "gauteng:GT", + }, + { + label: "KwaZulu-Natal", + value: "kwazulu-natal:NL", + }, + { + label: "Limpopo", + value: "limpopo:LP", + }, + { + label: "Mpumalanga", + value: "mpumalanga:MP", + }, + { + label: "North West", + value: "north-west:NW", + }, + { + label: "Northern Cape", + value: "northern-cape:NC", + }, + { + label: "Western Cape", + value: "western-cape:WC", + }, + ], + }, + { + label: "South Sudan", + value: "south-sudan", + code: "SS", + states: [ + { + label: "Central Equatoria", + value: "central-equatoria:EC", + }, + { + label: "Eastern Equatoria", + value: "eastern-equatoria:EE", + }, + { + label: "Jonglei", + value: "jonglei:JG", + }, + { + label: "Lakes", + value: "lakes:LK", + }, + { + label: "Northern Bahr el Ghazal", + value: "northern-bahr-el-ghazal:BN", + }, + { + label: "Unity", + value: "unity:UY", + }, + { + label: "Upper Nile", + value: "upper-nile:NU", + }, + { + label: "Warrap", + value: "warrap:WR", + }, + { + label: "Western Bahr el Ghazal", + value: "western-bahr-el-ghazal:BW", + }, + { + label: "Western Equatoria", + value: "western-equatoria:EW", + }, + ], + }, + { + label: "Sudan", + value: "sudan", + code: "SD", + states: [ + { + label: "Al Baḩr al Aḩmar", + value: "al-baḩr-al-aḩmar:RS", + }, + { + label: "Al Jazīrah", + value: "al-jazīrah:GZ", + }, + { + label: "Al Kharţūm", + value: "al-kharţūm:KH", + }, + { + label: "Al Qaḑārif", + value: "al-qaḑārif:GD", + }, + { + label: "An Nīl", + value: "an-nīl:NR", + }, + { + label: "An Nīl al Abyaḑ", + value: "an-nīl-al-abyaḑ:NW", + }, + { + label: "An Nīl al Azraq", + value: "an-nīl-al-azraq:NB", + }, + { + label: "Ash Shamālīyah", + value: "ash-shamālīyah:NO", + }, + { + label: "Gharb Dārfūr", + value: "gharb-dārfūr:DW", + }, + { + label: "Janūb Dārfūr", + value: "janūb-dārfūr:DS", + }, + { + label: "Janūb Kurdufān", + value: "janūb-kurdufān:KS", + }, + { + label: "Kassalā", + value: "kassalā:KA", + }, + { + label: "Shamāl Dārfūr", + value: "shamāl-dārfūr:DN", + }, + { + label: "Shamāl Kurdufān", + value: "shamāl-kurdufān:KN", + }, + { + label: "Sharq Dārfūr", + value: "sharq-dārfūr:DE", + }, + { + label: "Sinnār", + value: "sinnār:SI", + }, + { + label: "Zalingei", + value: "zalingei:DC", + }, + ], + }, + { + label: "Swaziland", + value: "swaziland", + code: "SZ", + states: [ + { + label: "Hhohho", + value: "hhohho:HH", + }, + { + label: "Lubombo", + value: "lubombo:LU", + }, + { + label: "Manzini", + value: "manzini:MA", + }, + { + label: "Shiselweni", + value: "shiselweni:SH", + }, + ], + }, + { + label: "Tanzania", + value: "tanzania", + code: "TZ", + states: [ + { + label: "Arusha", + value: "arusha:01", + }, + { + label: "Dar es Salaam", + value: "dar-es-salaam:02", + }, + { + label: "Dodoma", + value: "dodoma:03", + }, + { + label: "Iringa", + value: "iringa:04", + }, + { + label: "Kagera", + value: "kagera:05", + }, + { + label: "Kaskazini Pemba", + value: "kaskazini-pemba:06", + }, + { + label: "Kaskazini Unguja", + value: "kaskazini-unguja:07", + }, + { + label: "Kigoma", + value: "kigoma:08", + }, + { + label: "Kilimanjaro", + value: "kilimanjaro:09", + }, + { + label: "Kusini Pemba", + value: "kusini-pemba:10", + }, + { + label: "Kusini Unguja", + value: "kusini-unguja:11", + }, + { + label: "Lindi", + value: "lindi:12", + }, + { + label: "Manyara", + value: "manyara:26", + }, + { + label: "Mara", + value: "mara:13", + }, + { + label: "Mbeya", + value: "mbeya:14", + }, + { + label: "Mjini Magharibi", + value: "mjini-magharibi:15", + }, + { + label: "Morogoro", + value: "morogoro:16", + }, + { + label: "Mtwara", + value: "mtwara:17", + }, + { + label: "Mwanza", + value: "mwanza:18", + }, + { + label: "Pwani", + value: "pwani:19", + }, + { + label: "Rukwa", + value: "rukwa:20", + }, + { + label: "Ruvuma", + value: "ruvuma:21", + }, + { + label: "Shinyanga", + value: "shinyanga:22", + }, + { + label: "Singida", + value: "singida:23", + }, + { + label: "Tabora", + value: "tabora:24", + }, + { + label: "Tanga", + value: "tanga:25", + }, + ], + }, + { + label: "Togo", + value: "togo", + code: "TG", + states: [ + { + label: "Centre", + value: "centre:C", + }, + { + label: "Kara", + value: "kara:K", + }, + { + label: "Maritime", + value: "maritime:M", + }, + { + label: "Plateaux", + value: "plateaux:P", + }, + { + label: "Savannes", + value: "savannes:S", + }, + ], + }, + { + label: "Tunisia", + value: "tunisia", + code: "TN", + states: [ + { + label: "Ariana", + value: "ariana:12", + }, + { + label: "Ben Arous", + value: "ben-arous:13", + }, + { + label: "Bizerte", + value: "bizerte:23", + }, + { + label: "Béja", + value: "béja:31", + }, + { + label: "Gabès", + value: "gabès:81", + }, + { + label: "Gafsa", + value: "gafsa:71", + }, + { + label: "Jendouba", + value: "jendouba:32", + }, + { + label: "Kairouan", + value: "kairouan:41", + }, + { + label: "Kasserine", + value: "kasserine:42", + }, + { + label: "Kebili", + value: "kebili:73", + }, + { + label: "La Manouba", + value: "la-manouba:14", + }, + { + label: "Le Kef", + value: "le-kef:33", + }, + { + label: "Mahdia", + value: "mahdia:53", + }, + { + label: "Medenine", + value: "medenine:82", + }, + { + label: "Monastir", + value: "monastir:52", + }, + { + label: "Nabeul", + value: "nabeul:21", + }, + { + label: "Sfax", + value: "sfax:61", + }, + { + label: "Sidi Bouzid", + value: "sidi-bouzid:43", + }, + { + label: "Siliana", + value: "siliana:34", + }, + { + label: "Sousse", + value: "sousse:51", + }, + { + label: "Tataouine", + value: "tataouine:83", + }, + { + label: "Tozeur", + value: "tozeur:72", + }, + { + label: "Tunis", + value: "tunis:11", + }, + { + label: "Zaghouan", + value: "zaghouan:22", + }, + ], + }, + { + label: "Uganda", + value: "uganda", + code: "UG", + states: [ + { + label: "Central", + value: "central:C", + }, + { + label: "Eastern", + value: "eastern:E", + }, + { + label: "Northern", + value: "northern:N", + }, + { + label: "Western", + value: "western:W", + }, + ], + }, + { + label: "Western Sahara", + value: "western-sahara", + code: "EH", + states: [], + }, + { + label: "Zambia", + value: "zambia", + code: "ZM", + states: [ + { + label: "Central", + value: "central:02", + }, + { + label: "Copperbelt", + value: "copperbelt:08", + }, + { + label: "Eastern", + value: "eastern:03", + }, + { + label: "Luapula", + value: "luapula:04", + }, + { + label: "Lusaka", + value: "lusaka:09", + }, + { + label: "North-Western", + value: "north-western:06", + }, + { + label: "Northern", + value: "northern:05", + }, + { + label: "Southern", + value: "southern:07", + }, + { + label: "Western", + value: "western:01", + }, + ], + }, + { + label: "Zimbabwe", + value: "zimbabwe", + code: "ZW", + states: [ + { + label: "Bulawayo", + value: "bulawayo:BU", + }, + { + label: "Harare", + value: "harare:HA", + }, + { + label: "Manicaland", + value: "manicaland:MA", + }, + { + label: "Mashonaland Central", + value: "mashonaland-central:MC", + }, + { + label: "Mashonaland East", + value: "mashonaland-east:ME", + }, + { + label: "Mashonaland West", + value: "mashonaland-west:MW", + }, + { + label: "Masvingo", + value: "masvingo:MV", + }, + { + label: "Matabeleland North", + value: "matabeleland-north:MN", + }, + { + label: "Matabeleland South", + value: "matabeleland-south:MS", + }, + { + label: "Midlands", + value: "midlands:MI", + }, + ], + }, + ], + }, + { + label: "Antarctica", + value: "antarctica", + disabled: true, + }, + { + label: "Asia", + value: "asia", + countries: [ + { + label: "Afghanistan", + value: "afghanistan", + code: "AF", + states: [ + { + label: "Badakhshān", + value: "badakhshān:BDS", + }, + { + label: "Baghlān", + value: "baghlān:BGL", + }, + { + label: "Balkh", + value: "balkh:BAL", + }, + { + label: "Bādghīs", + value: "bādghīs:BDG", + }, + { + label: "Bāmyān", + value: "bāmyān:BAM", + }, + { + label: "Dāykundī", + value: "dāykundī:DAY", + }, + { + label: "Farāh", + value: "farāh:FRA", + }, + { + label: "Fāryāb", + value: "fāryāb:FYB", + }, + { + label: "Ghaznī", + value: "ghaznī:GHA", + }, + { + label: "Ghōr", + value: "ghōr:GHO", + }, + { + label: "Helmand", + value: "helmand:HEL", + }, + { + label: "Herāt", + value: "herāt:HER", + }, + { + label: "Jowzjān", + value: "jowzjān:JOW", + }, + { + label: "Kandahār", + value: "kandahār:KAN", + }, + { + label: "Khōst", + value: "khōst:KHO", + }, + { + label: "Kunar", + value: "kunar:KNR", + }, + { + label: "Kunduz", + value: "kunduz:KDZ", + }, + { + label: "Kābul", + value: "kābul:KAB", + }, + { + label: "Kāpīsā", + value: "kāpīsā:KAP", + }, + { + label: "Laghmān", + value: "laghmān:LAG", + }, + { + label: "Lōgar", + value: "lōgar:LOG", + }, + { + label: "Nangarhār", + value: "nangarhār:NAN", + }, + { + label: "Nīmrōz", + value: "nīmrōz:NIM", + }, + { + label: "Nūristān", + value: "nūristān:NUR", + }, + { + label: "Paktiyā", + value: "paktiyā:PIA", + }, + { + label: "Paktīkā", + value: "paktīkā:PKA", + }, + { + label: "Panjshayr", + value: "panjshayr:PAN", + }, + { + label: "Parwān", + value: "parwān:PAR", + }, + { + label: "Samangān", + value: "samangān:SAM", + }, + { + label: "Sar-e Pul", + value: "sar-e-pul:SAR", + }, + { + label: "Takhār", + value: "takhār:TAK", + }, + { + label: "Uruzgān", + value: "uruzgān:URU", + }, + { + label: "Wardak", + value: "wardak:WAR", + }, + { + label: "Zābul", + value: "zābul:ZAB", + }, + ], + }, + { + label: "Armenia", + value: "armenia", + code: "AM", + states: [ + { + label: "Aragac̣otn", + value: "aragac̣otn:AG", + }, + { + label: "Ararat", + value: "ararat:AR", + }, + { + label: "Armavir", + value: "armavir:AV", + }, + { + label: "Erevan", + value: "erevan:ER", + }, + { + label: "Geġark'unik'", + value: "geġark'unik':GR", + }, + { + label: "Kotayk'", + value: "kotayk':KT", + }, + { + label: "Loṙi", + value: "loṙi:LO", + }, + { + label: "Syunik'", + value: "syunik':SU", + }, + { + label: "Tavuš", + value: "tavuš:TV", + }, + { + label: "Vayoć Jor", + value: "vayoć-jor:VD", + }, + { + label: "Širak", + value: "širak:SH", + }, + ], + }, + { + label: "Azerbaijan", + value: "azerbaijan", + code: "AZ", + states: [ + { + label: "Naxçıvan", + value: "naxçıvan:NX", + }, + ], + }, + { + label: "Bahrain", + value: "bahrain", + code: "BH", + states: [ + { + label: "Al Janūbīyah", + value: "al-janūbīyah:14", + }, + { + label: "Al Manāmah", + value: "al-manāmah:13", + }, + { + label: "Al Muḩarraq", + value: "al-muḩarraq:15", + }, + { + label: "Al Wusţá", + value: "al-wusţá:16", + }, + { + label: "Ash Shamālīyah", + value: "ash-shamālīyah:17", + }, + ], + }, + { + label: "Bangladesh", + value: "bangladesh", + code: "BD", + states: [ + { + label: "Barisal", + value: "barisal:A", + }, + { + label: "Chittagong", + value: "chittagong:B", + }, + { + label: "Dhaka", + value: "dhaka:C", + }, + { + label: "Khulna", + value: "khulna:D", + }, + { + label: "Rajshahi", + value: "rajshahi:E", + }, + { + label: "Rangpur", + value: "rangpur:F", + }, + { + label: "Sylhet", + value: "sylhet:G", + }, + ], + }, + { + label: "Bhutan", + value: "bhutan", + code: "BT", + states: [ + { + label: "Bumthang", + value: "bumthang:33", + }, + { + label: "Chhukha", + value: "chhukha:12", + }, + { + label: "Dagana", + value: "dagana:22", + }, + { + label: "Gasa", + value: "gasa:GA", + }, + { + label: "Ha", + value: "ha:13", + }, + { + label: "Lhuentse", + value: "lhuentse:44", + }, + { + label: "Monggar", + value: "monggar:42", + }, + { + label: "Paro", + value: "paro:11", + }, + { + label: "Pemagatshel", + value: "pemagatshel:43", + }, + { + label: "Punakha", + value: "punakha:23", + }, + { + label: "Samdrup Jongkha", + value: "samdrup-jongkha:45", + }, + { + label: "Samtse", + value: "samtse:14", + }, + { + label: "Sarpang", + value: "sarpang:31", + }, + { + label: "Thimphu", + value: "thimphu:15", + }, + { + label: "Trashi Yangtse", + value: "trashi-yangtse:TY", + }, + { + label: "Trashigang", + value: "trashigang:41", + }, + { + label: "Trongsa", + value: "trongsa:32", + }, + { + label: "Tsirang", + value: "tsirang:21", + }, + { + label: "Wangdue Phodrang", + value: "wangdue-phodrang:24", + }, + { + label: "Zhemgang", + value: "zhemgang:34", + }, + ], + }, + { + label: "Brunei", + value: "brunei", + code: "BN", + states: [ + { + label: "Belait", + value: "belait:BE", + }, + { + label: "Brunei-Muara", + value: "brunei-muara:BM", + }, + { + label: "Temburong", + value: "temburong:TE", + }, + { + label: "Tutong", + value: "tutong:TU", + }, + ], + }, + { + label: "Cambodia", + value: "cambodia", + code: "KH", + states: [ + { + label: "Baat Dambang", + value: "baat-dambang:2", + }, + { + label: "Banteay Mean Chey", + value: "banteay-mean-chey:1", + }, + { + label: "Kampong Chaam", + value: "kampong-chaam:3", + }, + { + label: "Kampong Chhnang", + value: "kampong-chhnang:4", + }, + { + label: "Kampong Spueu", + value: "kampong-spueu:5", + }, + { + label: "Kampong Thum", + value: "kampong-thum:6", + }, + { + label: "Kampot", + value: "kampot:7", + }, + { + label: "Kandaal", + value: "kandaal:8", + }, + { + label: "Kaoh Kong", + value: "kaoh-kong:9", + }, + { + label: "Kracheh", + value: "kracheh:10", + }, + { + label: "Krong Kaeb", + value: "krong-kaeb:23", + }, + { + label: "Krong Pailin", + value: "krong-pailin:24", + }, + { + label: "Krong Preah Sihanouk", + value: "krong-preah-sihanouk:18", + }, + { + label: "Mondol Kiri", + value: "mondol-kiri:11", + }, + { + label: "Otdar Mean Chey", + value: "otdar-mean-chey:22", + }, + { + label: "Phnom Penh", + value: "phnom-penh:12", + }, + { + label: "Pousaat", + value: "pousaat:15", + }, + { + label: "Preah Vihear", + value: "preah-vihear:13", + }, + { + label: "Prey Veaeng", + value: "prey-veaeng:14", + }, + { + label: "Rotanak Kiri", + value: "rotanak-kiri:16", + }, + { + label: "Siem Reab", + value: "siem-reab:17", + }, + { + label: "Stueng Traeng", + value: "stueng-traeng:19", + }, + { + label: "Svaay Rieng", + value: "svaay-rieng:20", + }, + { + label: "Taakaev", + value: "taakaev:21", + }, + ], + }, + { + label: "China", + value: "china", + code: "CN", + states: [ + { + label: "Guangxi", + value: "guangxi:45", + }, + { + label: "Nei Mongol", + value: "nei-mongol:15", + }, + { + label: "Ningxia", + value: "ningxia:64", + }, + { + label: "Xinjiang", + value: "xinjiang:65", + }, + { + label: "Xizang", + value: "xizang:54", + }, + { + label: "Beijing", + value: "beijing:11", + }, + { + label: "Chongqing", + value: "chongqing:50", + }, + { + label: "Shanghai", + value: "shanghai:31", + }, + { + label: "Tianjin", + value: "tianjin:12", + }, + { + label: "Anhui", + value: "anhui:34", + }, + { + label: "Fujian", + value: "fujian:35", + }, + { + label: "Gansu", + value: "gansu:62", + }, + { + label: "Guangdong", + value: "guangdong:44", + }, + { + label: "Guizhou", + value: "guizhou:52", + }, + { + label: "Hainan", + value: "hainan:46", + }, + { + label: "Hebei", + value: "hebei:13", + }, + { + label: "Heilongjiang", + value: "heilongjiang:23", + }, + { + label: "Henan", + value: "henan:41", + }, + { + label: "Hubei", + value: "hubei:42", + }, + { + label: "Hunan", + value: "hunan:43", + }, + { + label: "Jiangsu", + value: "jiangsu:32", + }, + { + label: "Jiangxi", + value: "jiangxi:36", + }, + { + label: "Jilin", + value: "jilin:22", + }, + { + label: "Liaoning", + value: "liaoning:21", + }, + { + label: "Qinghai", + value: "qinghai:63", + }, + { + label: "Shaanxi", + value: "shaanxi:61", + }, + { + label: "Shandong", + value: "shandong:37", + }, + { + label: "Shanxi", + value: "shanxi:14", + }, + { + label: "Sichuan", + value: "sichuan:51", + }, + { + label: "Taiwan", + value: "taiwan:71", + }, + { + label: "Yunnan", + value: "yunnan:53", + }, + { + label: "Zhejiang", + value: "zhejiang:33", + }, + { + label: "Hong Kong", + value: "hong-kong:91", + }, + { + label: "Macao", + value: "macao:92", + }, + { + label: "Hong Kong Island", + value: "hong-kong-island:", + }, + { + label: "Kowloon", + value: "kowloon:KOWLOON", + }, + { + label: "New Territories", + value: "new-territories:NEW TERRITORIES", + }, + ], + }, + { + label: "Georgia", + value: "georgia", + code: "GE", + states: [ + { + label: "Abkhazia", + value: "abkhazia:AB", + }, + { + label: "Ajaria", + value: "ajaria:AJ", + }, + { + label: "Guria", + value: "guria:GU", + }, + { + label: "Imereti", + value: "imereti:IM", + }, + { + label: "K'akheti", + value: "k'akheti:KA", + }, + { + label: "Kvemo Kartli", + value: "kvemo-kartli:KK", + }, + { + label: "Mtskheta-Mtianeti", + value: "mtskheta-mtianeti:MM", + }, + { + label: "Rach'a-Lechkhumi-Kvemo Svaneti", + value: "rach'a-lechkhumi-kvemo-svaneti:RL", + }, + { + label: "Samegrelo-Zemo Svaneti", + value: "samegrelo-zemo-svaneti:SZ", + }, + { + label: "Samtskhe-Javakheti", + value: "samtskhe-javakheti:SJ", + }, + { + label: "Shida Kartli", + value: "shida-kartli:SK", + }, + { + label: "Tbilisi", + value: "tbilisi:TB", + }, + ], + }, + { + label: "Hong Kong", + value: "hong-kong", + code: "HK", + states: [], + }, + { + label: "India", + value: "india", + code: "IN", + states: [ + { + label: "Andaman and Nicobar Islands", + value: "andaman-and-nicobar-islands:AN", + }, + { + label: "Chandigarh", + value: "chandigarh:CH", + }, + { + label: "Dadra and Nagar Haveli", + value: "dadra-and-nagar-haveli:DN", + }, + { + label: "Daman and Diu", + value: "daman-and-diu:DD", + }, + { + label: "Delhi", + value: "delhi:DL", + }, + { + label: "Lakshadweep", + value: "lakshadweep:LD", + }, + { + label: "Puducherry", + value: "puducherry:PY", + }, + { + label: "Andhra Pradesh", + value: "andhra-pradesh:AP", + }, + { + label: "Arunachal Pradesh", + value: "arunachal-pradesh:AR", + }, + { + label: "Assam", + value: "assam:AS", + }, + { + label: "Bihar", + value: "bihar:BR", + }, + { + label: "Chhattisgarh", + value: "chhattisgarh:CT", + }, + { + label: "Goa", + value: "goa:GA", + }, + { + label: "Gujarat", + value: "gujarat:GJ", + }, + { + label: "Haryana", + value: "haryana:HR", + }, + { + label: "Himachal Pradesh", + value: "himachal-pradesh:HP", + }, + { + label: "Jammu and Kashmir", + value: "jammu-and-kashmir:JK", + }, + { + label: "Jharkhand", + value: "jharkhand:JH", + }, + { + label: "Karnataka", + value: "karnataka:KA", + }, + { + label: "Kerala", + value: "kerala:KL", + }, + { + label: "Madhya Pradesh", + value: "madhya-pradesh:MP", + }, + { + label: "Maharashtra", + value: "maharashtra:MH", + }, + { + label: "Manipur", + value: "manipur:MN", + }, + { + label: "Meghalaya", + value: "meghalaya:ML", + }, + { + label: "Mizoram", + value: "mizoram:MZ", + }, + { + label: "Nagaland", + value: "nagaland:NL", + }, + { + label: "Odisha", + value: "odisha:OR", + }, + { + label: "Punjab", + value: "punjab:PB", + }, + { + label: "Rajasthan", + value: "rajasthan:RJ", + }, + { + label: "Sikkim", + value: "sikkim:SK", + }, + { + label: "Tamil Nadu", + value: "tamil-nadu:TN", + }, + { + label: "Telangana", + value: "telangana:TG", + }, + { + label: "Tripura", + value: "tripura:TR", + }, + { + label: "Uttar Pradesh", + value: "uttar-pradesh:UP", + }, + { + label: "Uttarakhand", + value: "uttarakhand:UT", + }, + { + label: "West Bengal", + value: "west-bengal:WB", + }, + ], + }, + { + label: "Indonesia", + value: "indonesia", + code: "ID", + states: [ + { + label: "Jawa", + value: "jawa:JW", + }, + { + label: "Kalimantan", + value: "kalimantan:KA", + }, + { + label: "Maluku", + value: "maluku:ML", + }, + { + label: "Nusa Tenggara", + value: "nusa-tenggara:NU", + }, + { + label: "Papua", + value: "papua:PP", + }, + { + label: "Sulawesi", + value: "sulawesi:SL", + }, + { + label: "Sumatera", + value: "sumatera:SM", + }, + ], + }, + { + label: "Iran", + value: "iran", + code: "IR", + states: [ + { + label: "Alborz", + value: "alborz:32", + }, + { + label: "Ardabīl", + value: "ardabīl:03", + }, + { + label: "Būshehr", + value: "būshehr:06", + }, + { + label: "Chahār Maḩāll va Bakhtīārī", + value: "chahār-maḩāll-va-bakhtīārī:08", + }, + { + label: "Eşfahān", + value: "eşfahān:04", + }, + { + label: "Fārs", + value: "fārs:14", + }, + { + label: "Golestān", + value: "golestān:27", + }, + { + label: "Gīlān", + value: "gīlān:19", + }, + { + label: "Hamadān", + value: "hamadān:24", + }, + { + label: "Hormozgān", + value: "hormozgān:23", + }, + { + label: "Kermān", + value: "kermān:15", + }, + { + label: "Kermānshāh", + value: "kermānshāh:17", + }, + { + label: "Khorāsān-e Janūbī", + value: "khorāsān-e-janūbī:29", + }, + { + label: "Khorāsān-e Razavī", + value: "khorāsān-e-razavī:30", + }, + { + label: "Khorāsān-e Shemālī", + value: "khorāsān-e-shemālī:31", + }, + { + label: "Khūzestān", + value: "khūzestān:10", + }, + { + label: "Kohgīlūyeh va Būyer Aḩmad", + value: "kohgīlūyeh-va-būyer-aḩmad:18", + }, + { + label: "Kordestān", + value: "kordestān:16", + }, + { + label: "Lorestān", + value: "lorestān:20", + }, + { + label: "Markazī", + value: "markazī:22", + }, + { + label: "Māzandarān", + value: "māzandarān:21", + }, + { + label: "Qazvīn", + value: "qazvīn:28", + }, + { + label: "Qom", + value: "qom:26", + }, + { + label: "Semnān", + value: "semnān:12", + }, + { + label: "Sīstān va Balūchestān", + value: "sīstān-va-balūchestān:13", + }, + { + label: "Tehrān", + value: "tehrān:07", + }, + { + label: "Yazd", + value: "yazd:25", + }, + { + label: "Zanjān", + value: "zanjān:11", + }, + { + label: "Āz̄arbāyjān-e Gharbī", + value: "āz̄arbāyjān-e-gharbī:02", + }, + { + label: "Āz̄arbāyjān-e Sharqī", + value: "āz̄arbāyjān-e-sharqī:01", + }, + { + label: "Īlām", + value: "īlām:05", + }, + ], + }, + { + label: "Iraq", + value: "iraq", + code: "IQ", + states: [ + { + label: "Al Anbār", + value: "al-anbār:AN", + }, + { + label: "Al Başrah", + value: "al-başrah:BA", + }, + { + label: "Al Muthanná", + value: "al-muthanná:MU", + }, + { + label: "Al Qādisīyah", + value: "al-qādisīyah:QA", + }, + { + label: "An Najaf", + value: "an-najaf:NA", + }, + { + label: "Arbīl", + value: "arbīl:AR", + }, + { + label: "As Sulaymānīyah", + value: "as-sulaymānīyah:SU", + }, + { + label: "At Ta'mīm", + value: "at-ta'mīm:TS", + }, + { + label: "Baghdād", + value: "baghdād:BG", + }, + { + label: "Bābil", + value: "bābil:BB", + }, + { + label: "Dahūk", + value: "dahūk:DA", + }, + { + label: "Dhī Qār", + value: "dhī-qār:DQ", + }, + { + label: "Diyālá", + value: "diyālá:DI", + }, + { + label: "Karbalā'", + value: "karbalā':KA", + }, + { + label: "Maysān", + value: "maysān:MA", + }, + { + label: "Nīnawá", + value: "nīnawá:NI", + }, + { + label: "Wāsiţ", + value: "wāsiţ:WA", + }, + { + label: "Şalāḩ ad Dīn", + value: "şalāḩ-ad-dīn:SD", + }, + ], + }, + { + label: "Israel", + value: "israel", + code: "IL", + states: [ + { + label: "HaDarom", + value: "hadarom:D", + }, + { + label: "HaMerkaz", + value: "hamerkaz:M", + }, + { + label: "HaTsafon", + value: "hatsafon:Z", + }, + { + label: "H̱efa", + value: "ẖefa:HA", + }, + { + label: "Tel-Aviv", + value: "tel-aviv:TA", + }, + { + label: "Yerushalayim", + value: "yerushalayim:JM", + }, + ], + }, + { + label: "Japan", + value: "japan", + code: "JP", + states: [ + { + label: "Aiti", + value: "aiti:23", + }, + { + label: "Akita", + value: "akita:05", + }, + { + label: "Aomori", + value: "aomori:02", + }, + { + label: "Ehime", + value: "ehime:38", + }, + { + label: "Gihu", + value: "gihu:21", + }, + { + label: "Gunma", + value: "gunma:10", + }, + { + label: "Hirosima", + value: "hirosima:34", + }, + { + label: "Hokkaidô", + value: "hokkaidô:01", + }, + { + label: "Hukui", + value: "hukui:18", + }, + { + label: "Hukuoka", + value: "hukuoka:40", + }, + { + label: "Hukusima", + value: "hukusima:07", + }, + { + label: "Hyôgo", + value: "hyôgo:28", + }, + { + label: "Ibaraki", + value: "ibaraki:08", + }, + { + label: "Isikawa", + value: "isikawa:17", + }, + { + label: "Iwate", + value: "iwate:03", + }, + { + label: "Kagawa", + value: "kagawa:37", + }, + { + label: "Kagosima", + value: "kagosima:46", + }, + { + label: "Kanagawa", + value: "kanagawa:14", + }, + { + label: "Kumamoto", + value: "kumamoto:43", + }, + { + label: "Kyôto", + value: "kyôto:26", + }, + { + label: "Kôti", + value: "kôti:39", + }, + { + label: "Mie", + value: "mie:24", + }, + { + label: "Miyagi", + value: "miyagi:04", + }, + { + label: "Miyazaki", + value: "miyazaki:45", + }, + { + label: "Nagano", + value: "nagano:20", + }, + { + label: "Nagasaki", + value: "nagasaki:42", + }, + { + label: "Nara", + value: "nara:29", + }, + { + label: "Niigata", + value: "niigata:15", + }, + { + label: "Okayama", + value: "okayama:33", + }, + { + label: "Okinawa", + value: "okinawa:47", + }, + { + label: "Saga", + value: "saga:41", + }, + { + label: "Saitama", + value: "saitama:11", + }, + { + label: "Siga", + value: "siga:25", + }, + { + label: "Simane", + value: "simane:32", + }, + { + label: "Sizuoka", + value: "sizuoka:22", + }, + { + label: "Tiba", + value: "tiba:12", + }, + { + label: "Tokusima", + value: "tokusima:36", + }, + { + label: "Totigi", + value: "totigi:09", + }, + { + label: "Tottori", + value: "tottori:31", + }, + { + label: "Toyama", + value: "toyama:16", + }, + { + label: "Tôkyô", + value: "tôkyô:13", + }, + { + label: "Wakayama", + value: "wakayama:30", + }, + { + label: "Yamagata", + value: "yamagata:06", + }, + { + label: "Yamaguti", + value: "yamaguti:35", + }, + { + label: "Yamanasi", + value: "yamanasi:19", + }, + { + label: "Ôita", + value: "ôita:44", + }, + { + label: "Ôsaka", + value: "ôsaka:27", + }, + ], + }, + { + label: "Jordan", + value: "jordan", + code: "JO", + states: [ + { + label: "Al Balqā'", + value: "al-balqā':BA", + }, + { + label: "Al ʽAqabah", + value: "al-ʽaqabah:AQ", + }, + { + label: "Az Zarqā'", + value: "az-zarqā':AZ", + }, + { + label: "Aţ Ţafīlah", + value: "aţ-ţafīlah:AT", + }, + { + label: "Irbid", + value: "irbid:IR", + }, + { + label: "Jerash", + value: "jerash:JA", + }, + { + label: "Karak", + value: "karak:KA", + }, + { + label: "Ma'ān", + value: "ma'ān:MN", + }, + { + label: "Mafraq", + value: "mafraq:MA", + }, + { + label: "Mādabā", + value: "mādabā:MD", + }, + { + label: "ʽAjlūn", + value: "ʽajlūn:AJ", + }, + { + label: "‘Ammān", + value: "‘ammān:AM", + }, + ], + }, + { + label: "Kazakhstan", + value: "kazakhstan", + code: "KZ", + states: [ + { + label: "Almaty", + value: "almaty:ALA", + }, + { + label: "Almaty oblysy", + value: "almaty-oblysy:ALM", + }, + { + label: "Aqmola oblysy", + value: "aqmola-oblysy:AKM", + }, + { + label: "Aqtöbe oblysy", + value: "aqtöbe-oblysy:AKT", + }, + { + label: "Astana", + value: "astana:AST", + }, + { + label: "Atyraū oblysy", + value: "atyraū-oblysy:ATY", + }, + { + label: "Batys Qazaqstan oblysy", + value: "batys-qazaqstan-oblysy:ZAP", + }, + { + label: "Mangghystaū oblysy", + value: "mangghystaū-oblysy:MAN", + }, + { + label: "Ongtüstik Qazaqstan oblysy", + value: "ongtüstik-qazaqstan-oblysy:YUZ", + }, + { + label: "Pavlodar oblysy", + value: "pavlodar-oblysy:PAV", + }, + { + label: "Qaraghandy oblysy", + value: "qaraghandy-oblysy:KAR", + }, + { + label: "Qostanay oblysy", + value: "qostanay-oblysy:KUS", + }, + { + label: "Qyzylorda oblysy", + value: "qyzylorda-oblysy:KZY", + }, + { + label: "Shyghys Qazaqstan oblysy", + value: "shyghys-qazaqstan-oblysy:VOS", + }, + { + label: "Soltüstik Qazaqstan oblysy", + value: "soltüstik-qazaqstan-oblysy:SEV", + }, + { + label: "Zhambyl oblysy", + value: "zhambyl-oblysy:ZHA", + }, + ], + }, + { + label: "Kuwait", + value: "kuwait", + code: "KW", + states: [ + { + label: "Al Aḩmadi", + value: "al-aḩmadi:AH", + }, + { + label: "Al Farwānīyah", + value: "al-farwānīyah:FA", + }, + { + label: "Al Jahrā’", + value: "al-jahrā’:JA", + }, + { + label: "Al Kuwayt", + value: "al-kuwayt:KU", + }, + { + label: "Mubārak al Kabīr", + value: "mubārak-al-kabīr:MU", + }, + { + label: "Ḩawallī", + value: "ḩawallī:HA", + }, + ], + }, + { + label: "Kyrgyzstan", + value: "kyrgyzstan", + code: "KG", + states: [ + { + label: "Batken", + value: "batken:B", + }, + { + label: "Bishkek", + value: "bishkek:GB", + }, + { + label: "Chü", + value: "chü:C", + }, + { + label: "Jalal-Abad", + value: "jalal-abad:J", + }, + { + label: "Naryn", + value: "naryn:N", + }, + { + label: "Osh", + value: "osh:O", + }, + { + label: "Talas", + value: "talas:T", + }, + { + label: "Ysyk-Köl", + value: "ysyk-köl:Y", + }, + ], + }, + { + label: "Laos", + value: "laos", + code: "LA", + states: [ + { + label: "Attapu", + value: "attapu:AT", + }, + { + label: "Bokèo", + value: "bokèo:BK", + }, + { + label: "Bolikhamxai", + value: "bolikhamxai:BL", + }, + { + label: "Champasak", + value: "champasak:CH", + }, + { + label: "Houaphan", + value: "houaphan:HO", + }, + { + label: "Khammouan", + value: "khammouan:KH", + }, + { + label: "Louang Namtha", + value: "louang-namtha:LM", + }, + { + label: "Louangphabang", + value: "louangphabang:LP", + }, + { + label: "Oudômxai", + value: "oudômxai:OU", + }, + { + label: "Phôngsali", + value: "phôngsali:PH", + }, + { + label: "Salavan", + value: "salavan:SL", + }, + { + label: "Savannakhét", + value: "savannakhét:SV", + }, + { + label: "Vientiane", + value: "vientiane:VT", + }, + { + label: "Vientiane", + value: "vientiane:VI", + }, + { + label: "Xaignabouli", + value: "xaignabouli:XA", + }, + { + label: "Xaisômboun", + value: "xaisômboun:XN", + }, + { + label: "Xiangkhoang", + value: "xiangkhoang:XI", + }, + { + label: "Xékong", + value: "xékong:XE", + }, + ], + }, + { + label: "Lebanon", + value: "lebanon", + code: "LB", + states: [ + { + label: "Aakkâr", + value: "aakkâr:AK", + }, + { + label: "Baalbek-Hermel", + value: "baalbek-hermel:BH", + }, + { + label: "Beyrouth", + value: "beyrouth:BA", + }, + { + label: "Béqaa", + value: "béqaa:BI", + }, + { + label: "Liban-Nord", + value: "liban-nord:AS", + }, + { + label: "Liban-Sud", + value: "liban-sud:JA", + }, + { + label: "Mont-Liban", + value: "mont-liban:JL", + }, + { + label: "Nabatîyé", + value: "nabatîyé:NA", + }, + ], + }, + { + label: "Macau", + value: "macau", + code: "MO", + states: [], + }, + { + label: "Malaysia", + value: "malaysia", + code: "MY", + states: [ + { + label: "Wilayah Persekutuan Kuala Lumpur", + value: "wilayah-persekutuan-kuala-lumpur:14", + }, + { + label: "Wilayah Persekutuan Labuan", + value: "wilayah-persekutuan-labuan:15", + }, + { + label: "Wilayah Persekutuan Putrajaya", + value: "wilayah-persekutuan-putrajaya:16", + }, + { + label: "Johor", + value: "johor:01", + }, + { + label: "Kedah", + value: "kedah:02", + }, + { + label: "Kelantan", + value: "kelantan:03", + }, + { + label: "Melaka", + value: "melaka:04", + }, + { + label: "Negeri Sembilan", + value: "negeri-sembilan:05", + }, + { + label: "Pahang", + value: "pahang:06", + }, + { + label: "Perak", + value: "perak:08", + }, + { + label: "Perlis", + value: "perlis:09", + }, + { + label: "Pulau Pinang", + value: "pulau-pinang:07", + }, + { + label: "Sabah", + value: "sabah:12", + }, + { + label: "Sarawak", + value: "sarawak:13", + }, + { + label: "Selangor", + value: "selangor:10", + }, + { + label: "Terengganu", + value: "terengganu:11", + }, + ], + }, + { + label: "Maldives", + value: "maldives", + code: "MV", + states: [ + { + label: "Central", + value: "central:CE", + }, + { + label: "Male", + value: "male:MLE", + }, + { + label: "North", + value: "north:NO", + }, + { + label: "North Central", + value: "north-central:NC", + }, + { + label: "South", + value: "south:SU", + }, + { + label: "South Central", + value: "south-central:SC", + }, + { + label: "Upper North", + value: "upper-north:UN", + }, + { + label: "Upper South", + value: "upper-south:US", + }, + ], + }, + { + label: "Mongolia", + value: "mongolia", + code: "MN", + states: [ + { + label: "Arhangay", + value: "arhangay:073", + }, + { + label: "Bayan-Ölgiy", + value: "bayan-ölgiy:071", + }, + { + label: "Bayanhongor", + value: "bayanhongor:069", + }, + { + label: "Bulgan", + value: "bulgan:067", + }, + { + label: "Darhan uul", + value: "darhan-uul:037", + }, + { + label: "Dornod", + value: "dornod:061", + }, + { + label: "Dornogovĭ", + value: "dornogovĭ:063", + }, + { + label: "Dundgovĭ", + value: "dundgovĭ:059", + }, + { + label: "Dzavhan", + value: "dzavhan:057", + }, + { + label: "Govĭ-Altay", + value: "govĭ-altay:065", + }, + { + label: "Govĭ-Sümber", + value: "govĭ-sümber:064", + }, + { + label: "Hentiy", + value: "hentiy:039", + }, + { + label: "Hovd", + value: "hovd:043", + }, + { + label: "Hövsgöl", + value: "hövsgöl:041", + }, + { + label: "Orhon", + value: "orhon:035", + }, + { + label: "Selenge", + value: "selenge:049", + }, + { + label: "Sühbaatar", + value: "sühbaatar:051", + }, + { + label: "Töv", + value: "töv:047", + }, + { + label: "Ulaanbaatar", + value: "ulaanbaatar:1", + }, + { + label: "Uvs", + value: "uvs:046", + }, + { + label: "Ömnögovĭ", + value: "ömnögovĭ:053", + }, + { + label: "Övörhangay", + value: "övörhangay:055", + }, + ], + }, + { + label: "Myanmar", + value: "myanmar", + code: "MM", + states: [ + { + label: "Ayeyarwady", + value: "ayeyarwady:07", + }, + { + label: "Bago", + value: "bago:02", + }, + { + label: "Chin", + value: "chin:14", + }, + { + label: "Kachin", + value: "kachin:11", + }, + { + label: "Kayah", + value: "kayah:12", + }, + { + label: "Kayin", + value: "kayin:13", + }, + { + label: "Magway", + value: "magway:03", + }, + { + label: "Mandalay", + value: "mandalay:04", + }, + { + label: "Mon", + value: "mon:15", + }, + { + label: "Rakhine", + value: "rakhine:16", + }, + { + label: "Sagaing", + value: "sagaing:01", + }, + { + label: "Shan", + value: "shan:17", + }, + { + label: "Tanintharyi", + value: "tanintharyi:05", + }, + { + label: "Yangon", + value: "yangon:06", + }, + ], + }, + { + label: "Nepal", + value: "nepal", + code: "NP", + states: [ + { + label: "Madhya Pashchimanchal", + value: "madhya-pashchimanchal:2", + }, + { + label: "Madhyamanchal", + value: "madhyamanchal:1", + }, + { + label: "Pashchimanchal", + value: "pashchimanchal:3", + }, + { + label: "Purwanchal", + value: "purwanchal:4", + }, + { + label: "Sudur Pashchimanchal", + value: "sudur-pashchimanchal:5", + }, + ], + }, + { + label: "North Korea", + value: "north-korea", + code: "KP", + states: [ + { + label: "Chagang", + value: "chagang:04", + }, + { + label: "Kangwon", + value: "kangwon:07", + }, + { + label: "North Hamgyong", + value: "north-hamgyong:09", + }, + { + label: "North Hwanghae", + value: "north-hwanghae:06", + }, + { + label: "North Pyongan", + value: "north-pyongan:03", + }, + { + label: "Pyongyang", + value: "pyongyang:01", + }, + { + label: "Rason", + value: "rason:13", + }, + { + label: "Ryanggang", + value: "ryanggang:10", + }, + { + label: "South Hamgyong", + value: "south-hamgyong:08", + }, + { + label: "South Hwanghae", + value: "south-hwanghae:05", + }, + { + label: "South Pyongan", + value: "south-pyongan:02", + }, + ], + }, + { + label: "Oman", + value: "oman", + code: "OM", + states: [ + { + label: "Ad Dākhilīyah", + value: "ad-dākhilīyah:DA", + }, + { + label: "Al Buraymī", + value: "al-buraymī:BU", + }, + { + label: "Al Bāţinah", + value: "al-bāţinah:BA", + }, + { + label: "Al Wusţá", + value: "al-wusţá:WU", + }, + { + label: "Ash Sharqīyah", + value: "ash-sharqīyah:SH", + }, + { + label: "Az̧ Z̧āhirah", + value: "az̧-z̧āhirah:ZA", + }, + { + label: "Masqaţ", + value: "masqaţ:MA", + }, + { + label: "Musandam", + value: "musandam:MU", + }, + { + label: "Z̧ufār", + value: "z̧ufār:ZU", + }, + ], + }, + { + label: "Pakistan", + value: "pakistan", + code: "PK", + states: [ + { + label: "Azad Kashmir", + value: "azad-kashmir:JK", + }, + { + label: "Balochistan", + value: "balochistan:BA", + }, + { + label: "Federally Administered Tribal Areas", + value: "federally-administered-tribal-areas:TA", + }, + { + label: "Gilgit-Baltistan", + value: "gilgit-baltistan:GB", + }, + { + label: "Islamabad", + value: "islamabad:IS", + }, + { + label: "Khyber Pakhtunkhwa", + value: "khyber-pakhtunkhwa:KP", + }, + { + label: "Punjab", + value: "punjab:PB", + }, + { + label: "Sindh", + value: "sindh:SD", + }, + ], + }, + { + label: "Palestine", + value: "palestine", + code: "PS", + states: [ + { + label: "Bethlehem", + value: "bethlehem:BTH", + }, + { + label: "Deir El Balah", + value: "deir-el-balah:DEB", + }, + { + label: "Gaza", + value: "gaza:GZA", + }, + { + label: "Hebron", + value: "hebron:HBN", + }, + { + label: "Jenin", + value: "jenin:JEN", + }, + { + label: "Jericho – Al Aghwar", + value: "jericho-–-al-aghwar:JRH", + }, + { + label: "Jerusalem", + value: "jerusalem:JEM", + }, + { + label: "Khan Yunis", + value: "khan-yunis:KYS", + }, + { + label: "Nablus", + value: "nablus:NBS", + }, + { + label: "North Gaza", + value: "north-gaza:NGZ", + }, + { + label: "Qalqilya", + value: "qalqilya:QQA", + }, + { + label: "Rafah", + value: "rafah:RFH", + }, + { + label: "Ramallah", + value: "ramallah:RBH", + }, + { + label: "Salfit", + value: "salfit:SLT", + }, + { + label: "Tubas", + value: "tubas:TBS", + }, + { + label: "Tulkarm", + value: "tulkarm:TKM", + }, + ], + }, + { + label: "Philippines", + value: "philippines", + code: "PH", + states: [ + { + label: "Autonomous Region in Muslim Mindanao", + value: "autonomous-region-in-muslim-mindanao:14", + }, + { + label: "Bicol", + value: "bicol:05", + }, + { + label: "Cagayan Valley", + value: "cagayan-valley:02", + }, + { + label: "Calabarzon", + value: "calabarzon:40", + }, + { + label: "Caraga", + value: "caraga:13", + }, + { + label: "Central Luzon", + value: "central-luzon:03", + }, + { + label: "Central Visayas", + value: "central-visayas:07", + }, + { + label: "Cordillera Administrative Region", + value: "cordillera-administrative-region:15", + }, + { + label: "Davao", + value: "davao:11", + }, + { + label: "Eastern Visayas", + value: "eastern-visayas:08", + }, + { + label: "Ilocos", + value: "ilocos:01", + }, + { + label: "Mimaropa", + value: "mimaropa:41", + }, + { + label: "National Capital Region", + value: "national-capital-region:00", + }, + { + label: "Northern Mindanao", + value: "northern-mindanao:10", + }, + { + label: "Soccsksargen", + value: "soccsksargen:12", + }, + { + label: "Western Visayas", + value: "western-visayas:06", + }, + { + label: "Zamboanga Peninsula", + value: "zamboanga-peninsula:09", + }, + ], + }, + { + label: "Qatar", + value: "qatar", + code: "QA", + states: [ + { + label: "Ad Dawḩah", + value: "ad-dawḩah:DA", + }, + { + label: "Al Khawr wa adh Dhakhīrah", + value: "al-khawr-wa-adh-dhakhīrah:KH", + }, + { + label: "Al Wakrah", + value: "al-wakrah:WA", + }, + { + label: "Ar Rayyān", + value: "ar-rayyān:RA", + }, + { + label: "Ash Shamāl", + value: "ash-shamāl:MS", + }, + { + label: "Az̧ Za̧`āyin", + value: "az̧-za̧`āyin:ZA", + }, + { + label: "Umm Şalāl", + value: "umm-şalāl:US", + }, + ], + }, + { + label: "Saudi Arabia", + value: "saudi-arabia", + code: "SA", + states: [ + { + label: "Al Bāḩah", + value: "al-bāḩah:11", + }, + { + label: "Al Jawf", + value: "al-jawf:12", + }, + { + label: "Al Madīnah", + value: "al-madīnah:03", + }, + { + label: "Al Qaşīm", + value: "al-qaşīm:05", + }, + { + label: "Al Ḩudūd ash Shamālīyah", + value: "al-ḩudūd-ash-shamālīyah:08", + }, + { + label: "Ar Riyāḑ", + value: "ar-riyāḑ:01", + }, + { + label: "Ash Sharqīyah", + value: "ash-sharqīyah:04", + }, + { + label: "Jīzān", + value: "jīzān:09", + }, + { + label: "Makkah", + value: "makkah:02", + }, + { + label: "Najrān", + value: "najrān:10", + }, + { + label: "Tabūk", + value: "tabūk:07", + }, + { + label: "ٰĀsīr", + value: "ٰāsīr:14", + }, + { + label: "Ḩā'il", + value: "ḩā'il:06", + }, + ], + }, + { + label: "Singapore", + value: "singapore", + code: "SG", + states: [ + { + label: "Central Singapore", + value: "central-singapore:01", + }, + { + label: "North East", + value: "north-east:02", + }, + { + label: "North West", + value: "north-west:03", + }, + { + label: "South East", + value: "south-east:04", + }, + { + label: "South West", + value: "south-west:05", + }, + ], + }, + { + label: "South Korea", + value: "south-korea", + code: "KR", + states: [ + { + label: "Busan-gwangyeoksi", + value: "busan-gwangyeoksi:26", + }, + { + label: "Chungcheongbuk-do", + value: "chungcheongbuk-do:43", + }, + { + label: "Chungcheongnam-do", + value: "chungcheongnam-do:44", + }, + { + label: "Daegu-gwangyeoksi", + value: "daegu-gwangyeoksi:27", + }, + { + label: "Daejeon-gwangyeoksi", + value: "daejeon-gwangyeoksi:30", + }, + { + label: "Gangwon-do", + value: "gangwon-do:42", + }, + { + label: "Gwangju-gwangyeoksi", + value: "gwangju-gwangyeoksi:29", + }, + { + label: "Gyeonggi-do", + value: "gyeonggi-do:41", + }, + { + label: "Gyeongsangbuk-do", + value: "gyeongsangbuk-do:47", + }, + { + label: "Gyeongsangnam-do", + value: "gyeongsangnam-do:48", + }, + { + label: "Incheon-gwangyeoksi", + value: "incheon-gwangyeoksi:28", + }, + { + label: "Jeju-teukbyeoljachido", + value: "jeju-teukbyeoljachido:49", + }, + { + label: "Jeollabuk-do", + value: "jeollabuk-do:45", + }, + { + label: "Jeollanam-do", + value: "jeollanam-do:46", + }, + { + label: "Sejong", + value: "sejong:50", + }, + { + label: "Seoul-teukbyeolsi", + value: "seoul-teukbyeolsi:11", + }, + { + label: "Ulsan-gwangyeoksi", + value: "ulsan-gwangyeoksi:31", + }, + ], + }, + { + label: "Sri Lanka", + value: "sri-lanka", + code: "LK", + states: [ + { + label: "Central Province", + value: "central-province:2", + }, + { + label: "Eastern Province", + value: "eastern-province:5", + }, + { + label: "North Central Province", + value: "north-central-province:7", + }, + { + label: "North Western Province", + value: "north-western-province:6", + }, + { + label: "Northern Province", + value: "northern-province:4", + }, + { + label: "Sabaragamuwa Province", + value: "sabaragamuwa-province:9", + }, + { + label: "Southern Province", + value: "southern-province:3", + }, + { + label: "Uva Province", + value: "uva-province:8", + }, + { + label: "Western Province", + value: "western-province:1", + }, + ], + }, + { + label: "Syria", + value: "syria", + code: "SY", + states: [ + { + label: "Al Lādhiqīyah", + value: "al-lādhiqīyah:LA", + }, + { + label: "Al Qunayţirah", + value: "al-qunayţirah:QU", + }, + { + label: "Al Ḩasakah", + value: "al-ḩasakah:HA", + }, + { + label: "Ar Raqqah", + value: "ar-raqqah:RA", + }, + { + label: "As Suwaydā'", + value: "as-suwaydā':SU", + }, + { + label: "Darٰā", + value: "darٰā:DR", + }, + { + label: "Dayr az Zawr", + value: "dayr-az-zawr:DY", + }, + { + label: "Dimashq", + value: "dimashq:DI", + }, + { + label: "Idlib", + value: "idlib:ID", + }, + { + label: "Rīf Dimashq", + value: "rīf-dimashq:RD", + }, + { + label: "Ţarţūs", + value: "ţarţūs:TA", + }, + { + label: "Ḩalab", + value: "ḩalab:HL", + }, + { + label: "Ḩamāh", + value: "ḩamāh:HM", + }, + { + label: "Ḩimş", + value: "ḩimş:HI", + }, + ], + }, + { + label: "Taiwan", + value: "taiwan", + code: "TW", + states: [ + { + label: "Changhua", + value: "changhua:CHA", + }, + { + label: "Chiayi", + value: "chiayi:CYQ", + }, + { + label: "Chiayi", + value: "chiayi:CYI", + }, + { + label: "Hsinchu", + value: "hsinchu:HSZ", + }, + { + label: "Hsinchu", + value: "hsinchu:HSQ", + }, + { + label: "Hualien", + value: "hualien:HUA", + }, + { + label: "Ilan", + value: "ilan:ILA", + }, + { + label: "Kaohsiung", + value: "kaohsiung:KHQ", + }, + { + label: "Kaohsiung", + value: "kaohsiung:KHH", + }, + { + label: "Keelung", + value: "keelung:KEE", + }, + { + label: "Miaoli", + value: "miaoli:MIA", + }, + { + label: "Nantou", + value: "nantou:NAN", + }, + { + label: "Penghu", + value: "penghu:PEN", + }, + { + label: "Pingtung", + value: "pingtung:PIF", + }, + { + label: "Taichung", + value: "taichung:TXG", + }, + { + label: "Taichung", + value: "taichung:TXQ", + }, + { + label: "Tainan", + value: "tainan:TNN", + }, + { + label: "Tainan", + value: "tainan:TNQ", + }, + { + label: "Taipei", + value: "taipei:TPE", + }, + { + label: "Taipei", + value: "taipei:TPQ", + }, + { + label: "Taitung", + value: "taitung:TTT", + }, + { + label: "Taoyuan", + value: "taoyuan:TAO", + }, + { + label: "Yunlin", + value: "yunlin:YUN", + }, + ], + }, + { + label: "Tajikistan", + value: "tajikistan", + code: "TJ", + states: [ + { + label: "Dushanbe", + value: "dushanbe:DU", + }, + { + label: "Khatlon", + value: "khatlon:KT", + }, + { + label: "Kŭhistoni Badakhshon", + value: "kŭhistoni-badakhshon:GB", + }, + { + label: "Sughd", + value: "sughd:SU", + }, + ], + }, + { + label: "Thailand", + value: "thailand", + code: "TH", + states: [ + { + label: "Amnat Charoen", + value: "amnat-charoen:37", + }, + { + label: "Ang Thong", + value: "ang-thong:15", + }, + { + label: "Bueng Kan", + value: "bueng-kan:38", + }, + { + label: "Buri Ram", + value: "buri-ram:31", + }, + { + label: "Chachoengsao", + value: "chachoengsao:24", + }, + { + label: "Chai Nat", + value: "chai-nat:18", + }, + { + label: "Chaiyaphum", + value: "chaiyaphum:36", + }, + { + label: "Chanthaburi", + value: "chanthaburi:22", + }, + { + label: "Chiang Mai", + value: "chiang-mai:50", + }, + { + label: "Chiang Rai", + value: "chiang-rai:57", + }, + { + label: "Chon Buri", + value: "chon-buri:20", + }, + { + label: "Chumphon", + value: "chumphon:86", + }, + { + label: "Kalasin", + value: "kalasin:46", + }, + { + label: "Kamphaeng Phet", + value: "kamphaeng-phet:62", + }, + { + label: "Kanchanaburi", + value: "kanchanaburi:71", + }, + { + label: "Khon Kaen", + value: "khon-kaen:40", + }, + { + label: "Krabi", + value: "krabi:81", + }, + { + label: "Krung Thep Maha Nakhon", + value: "krung-thep-maha-nakhon:10", + }, + { + label: "Lampang", + value: "lampang:52", + }, + { + label: "Lamphun", + value: "lamphun:51", + }, + { + label: "Loei", + value: "loei:42", + }, + { + label: "Lop Buri", + value: "lop-buri:16", + }, + { + label: "Mae Hong Son", + value: "mae-hong-son:58", + }, + { + label: "Maha Sarakham", + value: "maha-sarakham:44", + }, + { + label: "Mukdahan", + value: "mukdahan:49", + }, + { + label: "Nakhon Nayok", + value: "nakhon-nayok:26", + }, + { + label: "Nakhon Pathom", + value: "nakhon-pathom:73", + }, + { + label: "Nakhon Phanom", + value: "nakhon-phanom:48", + }, + { + label: "Nakhon Ratchasima", + value: "nakhon-ratchasima:30", + }, + { + label: "Nakhon Sawan", + value: "nakhon-sawan:60", + }, + { + label: "Nakhon Si Thammarat", + value: "nakhon-si-thammarat:80", + }, + { + label: "Nan", + value: "nan:55", + }, + { + label: "Narathiwat", + value: "narathiwat:96", + }, + { + label: "Nong Bua Lam Phu", + value: "nong-bua-lam-phu:39", + }, + { + label: "Nong Khai", + value: "nong-khai:43", + }, + { + label: "Nonthaburi", + value: "nonthaburi:12", + }, + { + label: "Pathum Thani", + value: "pathum-thani:13", + }, + { + label: "Pattani", + value: "pattani:94", + }, + { + label: "Phangnga", + value: "phangnga:82", + }, + { + label: "Phatthalung", + value: "phatthalung:93", + }, + { + label: "Phatthaya", + value: "phatthaya:S", + }, + { + label: "Phayao", + value: "phayao:56", + }, + { + label: "Phetchabun", + value: "phetchabun:67", + }, + { + label: "Phetchaburi", + value: "phetchaburi:76", + }, + { + label: "Phichit", + value: "phichit:66", + }, + { + label: "Phitsanulok", + value: "phitsanulok:65", + }, + { + label: "Phra Nakhon Si Ayutthaya", + value: "phra-nakhon-si-ayutthaya:14", + }, + { + label: "Phrae", + value: "phrae:54", + }, + { + label: "Phuket", + value: "phuket:83", + }, + { + label: "Prachin Buri", + value: "prachin-buri:25", + }, + { + label: "Prachuap Khiri Khan", + value: "prachuap-khiri-khan:77", + }, + { + label: "Ranong", + value: "ranong:85", + }, + { + label: "Ratchaburi", + value: "ratchaburi:70", + }, + { + label: "Rayong", + value: "rayong:21", + }, + { + label: "Roi Et", + value: "roi-et:45", + }, + { + label: "Sa Kaeo", + value: "sa-kaeo:27", + }, + { + label: "Sakon Nakhon", + value: "sakon-nakhon:47", + }, + { + label: "Samut Prakan", + value: "samut-prakan:11", + }, + { + label: "Samut Sakhon", + value: "samut-sakhon:74", + }, + { + label: "Samut Songkhram", + value: "samut-songkhram:75", + }, + { + label: "Saraburi", + value: "saraburi:19", + }, + { + label: "Satun", + value: "satun:91", + }, + { + label: "Si Sa Ket", + value: "si-sa-ket:33", + }, + { + label: "Sing Buri", + value: "sing-buri:17", + }, + { + label: "Songkhla", + value: "songkhla:90", + }, + { + label: "Sukhothai", + value: "sukhothai:64", + }, + { + label: "Suphan Buri", + value: "suphan-buri:72", + }, + { + label: "Surat Thani", + value: "surat-thani:84", + }, + { + label: "Surin", + value: "surin:32", + }, + { + label: "Tak", + value: "tak:63", + }, + { + label: "Trang", + value: "trang:92", + }, + { + label: "Trat", + value: "trat:23", + }, + { + label: "Ubon Ratchathani", + value: "ubon-ratchathani:34", + }, + { + label: "Udon Thani", + value: "udon-thani:41", + }, + { + label: "Uthai Thani", + value: "uthai-thani:61", + }, + { + label: "Uttaradit", + value: "uttaradit:53", + }, + { + label: "Yala", + value: "yala:95", + }, + { + label: "Yasothon", + value: "yasothon:35", + }, + ], + }, + { + label: "East Timor", + value: "east-timor", + code: "TL", + states: [ + { + label: "Aileu", + value: "aileu:AL", + }, + { + label: "Ainaro", + value: "ainaro:AN", + }, + { + label: "Baucau", + value: "baucau:BA", + }, + { + label: "Bobonaro", + value: "bobonaro:BO", + }, + { + label: "Cova Lima", + value: "cova-lima:CO", + }, + { + label: "Díli", + value: "díli:DI", + }, + { + label: "Ermera", + value: "ermera:ER", + }, + { + label: "Lautem", + value: "lautem:LA", + }, + { + label: "Liquiça", + value: "liquiça:LI", + }, + { + label: "Manatuto", + value: "manatuto:MT", + }, + { + label: "Manufahi", + value: "manufahi:MF", + }, + { + label: "Oecussi", + value: "oecussi:OE", + }, + { + label: "Viqueque", + value: "viqueque:VI", + }, + ], + }, + { + label: "Turkey", + value: "turkey", + code: "TR", + states: [ + { + label: "Adana", + value: "adana:01", + }, + { + label: "Adıyaman", + value: "adıyaman:02", + }, + { + label: "Afyonkarahisar", + value: "afyonkarahisar:03", + }, + { + label: "Aksaray", + value: "aksaray:68", + }, + { + label: "Amasya", + value: "amasya:05", + }, + { + label: "Ankara", + value: "ankara:06", + }, + { + label: "Antalya", + value: "antalya:07", + }, + { + label: "Ardahan", + value: "ardahan:75", + }, + { + label: "Artvin", + value: "artvin:08", + }, + { + label: "Aydın", + value: "aydın:09", + }, + { + label: "Ağrı", + value: "ağrı:04", + }, + { + label: "Balıkesir", + value: "balıkesir:10", + }, + { + label: "Bartın", + value: "bartın:74", + }, + { + label: "Batman", + value: "batman:72", + }, + { + label: "Bayburt", + value: "bayburt:69", + }, + { + label: "Bilecik", + value: "bilecik:11", + }, + { + label: "Bingöl", + value: "bingöl:12", + }, + { + label: "Bitlis", + value: "bitlis:13", + }, + { + label: "Bolu", + value: "bolu:14", + }, + { + label: "Burdur", + value: "burdur:15", + }, + { + label: "Bursa", + value: "bursa:16", + }, + { + label: "Denizli", + value: "denizli:20", + }, + { + label: "Diyarbakır", + value: "diyarbakır:21", + }, + { + label: "Düzce", + value: "düzce:81", + }, + { + label: "Edirne", + value: "edirne:22", + }, + { + label: "Elazığ", + value: "elazığ:23", + }, + { + label: "Erzincan", + value: "erzincan:24", + }, + { + label: "Erzurum", + value: "erzurum:25", + }, + { + label: "Eskişehir", + value: "eskişehir:26", + }, + { + label: "Gaziantep", + value: "gaziantep:27", + }, + { + label: "Giresun", + value: "giresun:28", + }, + { + label: "Gümüşhane", + value: "gümüşhane:29", + }, + { + label: "Hakkâri", + value: "hakkâri:30", + }, + { + label: "Hatay", + value: "hatay:31", + }, + { + label: "Isparta", + value: "isparta:32", + }, + { + label: "Iğdır", + value: "iğdır:76", + }, + { + label: "Kahramanmaraş", + value: "kahramanmaraş:46", + }, + { + label: "Karabük", + value: "karabük:78", + }, + { + label: "Karaman", + value: "karaman:70", + }, + { + label: "Kars", + value: "kars:36", + }, + { + label: "Kastamonu", + value: "kastamonu:37", + }, + { + label: "Kayseri", + value: "kayseri:38", + }, + { + label: "Kilis", + value: "kilis:79", + }, + { + label: "Kocaeli", + value: "kocaeli:41", + }, + { + label: "Konya", + value: "konya:42", + }, + { + label: "Kütahya", + value: "kütahya:43", + }, + { + label: "Kırklareli", + value: "kırklareli:39", + }, + { + label: "Kırıkkale", + value: "kırıkkale:71", + }, + { + label: "Kırşehir", + value: "kırşehir:40", + }, + { + label: "Malatya", + value: "malatya:44", + }, + { + label: "Manisa", + value: "manisa:45", + }, + { + label: "Mardin", + value: "mardin:47", + }, + { + label: "Mersin", + value: "mersin:33", + }, + { + label: "Muğla", + value: "muğla:48", + }, + { + label: "Muş", + value: "muş:49", + }, + { + label: "Nevşehir", + value: "nevşehir:50", + }, + { + label: "Niğde", + value: "niğde:51", + }, + { + label: "Ordu", + value: "ordu:52", + }, + { + label: "Osmaniye", + value: "osmaniye:80", + }, + { + label: "Rize", + value: "rize:53", + }, + { + label: "Sakarya", + value: "sakarya:54", + }, + { + label: "Samsun", + value: "samsun:55", + }, + { + label: "Siirt", + value: "siirt:56", + }, + { + label: "Sinop", + value: "sinop:57", + }, + { + label: "Sivas", + value: "sivas:58", + }, + { + label: "Tekirdağ", + value: "tekirdağ:59", + }, + { + label: "Tokat", + value: "tokat:60", + }, + { + label: "Trabzon", + value: "trabzon:61", + }, + { + label: "Tunceli", + value: "tunceli:62", + }, + { + label: "Uşak", + value: "uşak:64", + }, + { + label: "Van", + value: "van:65", + }, + { + label: "Yalova", + value: "yalova:77", + }, + { + label: "Yozgat", + value: "yozgat:66", + }, + { + label: "Zonguldak", + value: "zonguldak:67", + }, + { + label: "Çanakkale", + value: "çanakkale:17", + }, + { + label: "Çankırı", + value: "çankırı:18", + }, + { + label: "Çorum", + value: "çorum:19", + }, + { + label: "İstanbul", + value: "i̇stanbul:34", + }, + { + label: "İzmir", + value: "i̇zmir:35", + }, + { + label: "Şanlıurfa", + value: "şanlıurfa:63", + }, + { + label: "Şırnak", + value: "şırnak:73", + }, + ], + }, + { + label: "Turkmenistan", + value: "turkmenistan", + code: "TM", + states: [ + { + label: "Ahal", + value: "ahal:A", + }, + { + label: "Aşgabat", + value: "aşgabat:S", + }, + { + label: "Balkan", + value: "balkan:B", + }, + { + label: "Daşoguz", + value: "daşoguz:D", + }, + { + label: "Lebap", + value: "lebap:L", + }, + { + label: "Mary", + value: "mary:M", + }, + ], + }, + { + label: "United Arab Emirates", + value: "united-arab-emirates", + code: "AE", + states: [ + { + label: "'Ajmān", + value: "'ajmān:AJ", + }, + { + label: "Abū Z̧aby", + value: "abū-z̧aby:AZ", + }, + { + label: "Al Fujayrah", + value: "al-fujayrah:FU", + }, + { + label: "Ash Shāriqah", + value: "ash-shāriqah:SH", + }, + { + label: "Dubayy", + value: "dubayy:DU", + }, + { + label: "Ra's al Khaymah", + value: "ra's-al-khaymah:RK", + }, + { + label: "Umm al Qaywayn", + value: "umm-al-qaywayn:UQ", + }, + ], + }, + { + label: "Uzbekistan", + value: "uzbekistan", + code: "UZ", + states: [ + { + label: "Andijon", + value: "andijon:AN", + }, + { + label: "Buxoro", + value: "buxoro:BU", + }, + { + label: "Farg‘ona", + value: "farg‘ona:FA", + }, + { + label: "Jizzax", + value: "jizzax:JI", + }, + { + label: "Namangan", + value: "namangan:NG", + }, + { + label: "Navoiy", + value: "navoiy:NW", + }, + { + label: "Qashqadaryo", + value: "qashqadaryo:QA", + }, + { + label: "Qoraqalpog‘iston Respublikasi", + value: "qoraqalpog‘iston-respublikasi:QR", + }, + { + label: "Samarqand", + value: "samarqand:SA", + }, + { + label: "Sirdaryo", + value: "sirdaryo:SI", + }, + { + label: "Surxondaryo", + value: "surxondaryo:SU", + }, + { + label: "Toshkent", + value: "toshkent:TO", + }, + { + label: "Toshkent", + value: "toshkent:TK", + }, + { + label: "Xorazm", + value: "xorazm:XO", + }, + ], + }, + { + label: "Vietnam", + value: "vietnam", + code: "VN", + states: [ + { + label: "An Giang", + value: "an-giang:44", + }, + { + label: "Bà Rịa–Vũng Tàu", + value: "bà-rịa–vũng-tàu:43", + }, + { + label: "Bình Dương", + value: "bình-dương:57", + }, + { + label: "Bình Phước", + value: "bình-phước:58", + }, + { + label: "Bình Thuận", + value: "bình-thuận:40", + }, + { + label: "Bình Định", + value: "bình-định:31", + }, + { + label: "Bạc Liêu", + value: "bạc-liêu:55", + }, + { + label: "Bắc Giang", + value: "bắc-giang:54", + }, + { + label: "Bắc Kạn", + value: "bắc-kạn:53", + }, + { + label: "Bắc Ninh", + value: "bắc-ninh:56", + }, + { + label: "Bến Tre", + value: "bến-tre:50", + }, + { + label: "Cao Bằng", + value: "cao-bằng:04", + }, + { + label: "Cà Mau", + value: "cà-mau:59", + }, + { + label: "Cần Thơ", + value: "cần-thơ:CT", + }, + { + label: "Gia Lai", + value: "gia-lai:30", + }, + { + label: "Hà Giang", + value: "hà-giang:03", + }, + { + label: "Hà Nam", + value: "hà-nam:63", + }, + { + label: "Hà Nội", + value: "hà-nội:HN", + }, + { + label: "Hà Tây", + value: "hà-tây:15", + }, + { + label: "Hà Tĩnh", + value: "hà-tĩnh:23", + }, + { + label: "Hòa Bình", + value: "hòa-bình:14", + }, + { + label: "Hưng Yên", + value: "hưng-yên:66", + }, + { + label: "Hải Dương", + value: "hải-dương:61", + }, + { + label: "Hải Phòng", + value: "hải-phòng:HP", + }, + { + label: "Hậu Giang", + value: "hậu-giang:73", + }, + { + label: "Hồ Chí Minh", + value: "hồ-chí-minh:SG", + }, + { + label: "Khánh Hòa", + value: "khánh-hòa:34", + }, + { + label: "Kiên Giang", + value: "kiên-giang:47", + }, + { + label: "Kon Tum", + value: "kon-tum:28", + }, + { + label: "Lai Châu", + value: "lai-châu:01", + }, + { + label: "Long An", + value: "long-an:41", + }, + { + label: "Lào Cai", + value: "lào-cai:02", + }, + { + label: "Lâm Đồng", + value: "lâm-đồng:35", + }, + { + label: "Lạng Sơn", + value: "lạng-sơn:09", + }, + { + label: "Nam Định", + value: "nam-định:67", + }, + { + label: "Nghệ An", + value: "nghệ-an:22", + }, + { + label: "Ninh Bình", + value: "ninh-bình:18", + }, + { + label: "Ninh Thuận", + value: "ninh-thuận:36", + }, + { + label: "Phú Thọ", + value: "phú-thọ:68", + }, + { + label: "Phú Yên", + value: "phú-yên:32", + }, + { + label: "Quảng Bình", + value: "quảng-bình:24", + }, + { + label: "Quảng Nam", + value: "quảng-nam:27", + }, + { + label: "Quảng Ngãi", + value: "quảng-ngãi:29", + }, + { + label: "Quảng Ninh", + value: "quảng-ninh:13", + }, + { + label: "Quảng Trị", + value: "quảng-trị:25", + }, + { + label: "Sóc Trăng", + value: "sóc-trăng:52", + }, + { + label: "Sơn La", + value: "sơn-la:05", + }, + { + label: "Thanh Hóa", + value: "thanh-hóa:21", + }, + { + label: "Thái Bình", + value: "thái-bình:20", + }, + { + label: "Thái Nguyên", + value: "thái-nguyên:69", + }, + { + label: "Thừa Thiên–Huế", + value: "thừa-thiên–huế:26", + }, + { + label: "Tiền Giang", + value: "tiền-giang:46", + }, + { + label: "Trà Vinh", + value: "trà-vinh:51", + }, + { + label: "Tuyên Quang", + value: "tuyên-quang:07", + }, + { + label: "Tây Ninh", + value: "tây-ninh:37", + }, + { + label: "Vĩnh Long", + value: "vĩnh-long:49", + }, + { + label: "Vĩnh Phúc", + value: "vĩnh-phúc:70", + }, + { + label: "Yên Bái", + value: "yên-bái:06", + }, + { + label: "Điện Biên", + value: "điện-biên:71", + }, + { + label: "Đà Nẵng", + value: "đà-nẵng:DN", + }, + { + label: "Đắk Lắk", + value: "đắk-lắk:33", + }, + { + label: "Đắk Nông", + value: "đắk-nông:72", + }, + { + label: "Đồng Nai", + value: "đồng-nai:39", + }, + { + label: "Đồng Tháp", + value: "đồng-tháp:45", + }, + ], + }, + { + label: "Yemen", + value: "yemen", + code: "YE", + states: [ + { + label: "'Adan", + value: "'adan:AD", + }, + { + label: "'Amrān", + value: "'amrān:AM", + }, + { + label: "Abyān", + value: "abyān:AB", + }, + { + label: "Al Bayḑā'", + value: "al-bayḑā':BA", + }, + { + label: "Al Jawf", + value: "al-jawf:JA", + }, + { + label: "Al Mahrah", + value: "al-mahrah:MR", + }, + { + label: "Al Maḩwīt", + value: "al-maḩwīt:MW", + }, + { + label: "Al Ḩudaydah", + value: "al-ḩudaydah:HU", + }, + { + label: "Aḑ Ḑāli'", + value: "aḑ-ḑāli':DA", + }, + { + label: "Dhamār", + value: "dhamār:DH", + }, + { + label: "Ibb", + value: "ibb:IB", + }, + { + label: "Laḩij", + value: "laḩij:LA", + }, + { + label: "Ma'rib", + value: "ma'rib:MA", + }, + { + label: "Raymah", + value: "raymah:RA", + }, + { + label: "Shabwah", + value: "shabwah:SH", + }, + { + label: "Tā‘izz", + value: "tā‘izz:TA", + }, + { + label: "Şan‘ā'", + value: "şan‘ā':SA", + }, + { + label: "Şan‘ā'", + value: "şan‘ā':SN", + }, + { + label: "Şā‘dah", + value: "şā‘dah:SD", + }, + { + label: "Ḩajjah", + value: "ḩajjah:HJ", + }, + { + label: "Ḩaḑramawt", + value: "ḩaḑramawt:HD", + }, + ], + }, + ], + }, + { + label: "Europe", + value: "europe", + countries: [ + { + label: "Åland Islands", + value: "åland-islands", + code: "AX", + states: [], + }, + { + label: "Albania", + value: "albania", + code: "AL", + states: [ + { + label: "Berat", + value: "berat:01", + }, + { + label: "Dibër", + value: "dibër:09", + }, + { + label: "Durrës", + value: "durrës:02", + }, + { + label: "Elbasan", + value: "elbasan:03", + }, + { + label: "Fier", + value: "fier:04", + }, + { + label: "Gjirokastër", + value: "gjirokastër:05", + }, + { + label: "Korçë", + value: "korçë:06", + }, + { + label: "Kukës", + value: "kukës:07", + }, + { + label: "Lezhë", + value: "lezhë:08", + }, + { + label: "Shkodër", + value: "shkodër:10", + }, + { + label: "Tiranë", + value: "tiranë:11", + }, + { + label: "Vlorë", + value: "vlorë:12", + }, + ], + }, + { + label: "Andorra", + value: "andorra", + code: "AD", + states: [ + { + label: "Andorra la Vella", + value: "andorra-la-vella:07", + }, + { + label: "Canillo", + value: "canillo:02", + }, + { + label: "Encamp", + value: "encamp:03", + }, + { + label: "Escaldes-Engordany", + value: "escaldes-engordany:08", + }, + { + label: "La Massana", + value: "la-massana:04", + }, + { + label: "Ordino", + value: "ordino:05", + }, + { + label: "Sant Julià de Lòria", + value: "sant-julià-de-lòria:06", + }, + ], + }, + { + label: "Austria", + value: "austria", + code: "AT", + states: [ + { + label: "Burgenland", + value: "burgenland:B", + }, + { + label: "Kärnten", + value: "kärnten:K", + }, + { + label: "Niederösterreich", + value: "niederösterreich:NÖ", + }, + { + label: "Oberösterreich", + value: "oberösterreich:OÖ", + }, + { + label: "Salzburg", + value: "salzburg:S", + }, + { + label: "Steiermark", + value: "steiermark:ST", + }, + { + label: "Tirol", + value: "tirol:T", + }, + { + label: "Vorarlberg", + value: "vorarlberg:V", + }, + { + label: "Wien", + value: "wien:W", + }, + ], + }, + { + label: "Belarus", + value: "belarus", + code: "BY", + states: [ + { + label: "Brestskaya voblasts'", + value: "brestskaya-voblasts':BR", + }, + { + label: "Homyel'skaya voblasts'", + value: "homyel'skaya-voblasts':HO", + }, + { + label: "Horad Minsk", + value: "horad-minsk:HM", + }, + { + label: "Hrodzenskaya voblasts'", + value: "hrodzenskaya-voblasts':HR", + }, + { + label: "Mahilyowskaya voblasts'", + value: "mahilyowskaya-voblasts':MA", + }, + { + label: "Minskaya voblasts'", + value: "minskaya-voblasts':MI", + }, + { + label: "Vitsyebskaya voblasts'", + value: "vitsyebskaya-voblasts':VI", + }, + ], + }, + { + label: "Belgium", + value: "belgium", + code: "BE", + states: [ + { + label: "Brussels Hoofdstedelijk Gewest", + value: "brussels-hoofdstedelijk-gewest:BRU", + }, + { + label: "Région Wallonne", + value: "région-wallonne:WAL", + }, + { + label: "Vlaams Gewest", + value: "vlaams-gewest:VLG", + }, + ], + }, + { + label: "Bosnia and Herzegovina", + value: "bosnia-and-herzegovina", + code: "BA", + states: [ + { + label: "Brčko distrikt", + value: "brčko-distrikt:BRC", + }, + { + label: "Federacija Bosna i Hercegovina", + value: "federacija-bosna-i-hercegovina:BIH", + }, + { + label: "Republika Srpska", + value: "republika-srpska:SRP", + }, + ], + }, + { + label: "Bulgaria", + value: "bulgaria", + code: "BG", + states: [ + { + label: "Blagoevgrad", + value: "blagoevgrad:01", + }, + { + label: "Burgas", + value: "burgas:02", + }, + { + label: "Dobrich", + value: "dobrich:08", + }, + { + label: "Gabrovo", + value: "gabrovo:07", + }, + { + label: "Haskovo", + value: "haskovo:26", + }, + { + label: "Kardzhali", + value: "kardzhali:09", + }, + { + label: "Kyustendil", + value: "kyustendil:10", + }, + { + label: "Lovech", + value: "lovech:11", + }, + { + label: "Montana", + value: "montana:12", + }, + { + label: "Pazardzhik", + value: "pazardzhik:13", + }, + { + label: "Pernik", + value: "pernik:14", + }, + { + label: "Pleven", + value: "pleven:15", + }, + { + label: "Plovdiv", + value: "plovdiv:16", + }, + { + label: "Razgrad", + value: "razgrad:17", + }, + { + label: "Ruse", + value: "ruse:18", + }, + { + label: "Shumen", + value: "shumen:27", + }, + { + label: "Silistra", + value: "silistra:19", + }, + { + label: "Sliven", + value: "sliven:20", + }, + { + label: "Smolyan", + value: "smolyan:21", + }, + { + label: "Sofia", + value: "sofia:23", + }, + { + label: "Sofia-Grad", + value: "sofia-grad:22", + }, + { + label: "Stara Zagora", + value: "stara-zagora:24", + }, + { + label: "Targovishte", + value: "targovishte:25", + }, + { + label: "Varna", + value: "varna:03", + }, + { + label: "Veliko Tarnovo", + value: "veliko-tarnovo:04", + }, + { + label: "Vidin", + value: "vidin:05", + }, + { + label: "Vratsa", + value: "vratsa:06", + }, + { + label: "Yambol", + value: "yambol:28", + }, + ], + }, + { + label: "Croatia", + value: "croatia", + code: "HR", + states: [ + { + label: "Bjelovarsko-bilogorska županija", + value: "bjelovarsko-bilogorska-županija:07", + }, + { + label: "Brodsko-posavska županija", + value: "brodsko-posavska-županija:12", + }, + { + label: "Dubrovačko-neretvanska županija", + value: "dubrovačko-neretvanska-županija:19", + }, + { + label: "Grad Zagreb", + value: "grad-zagreb:21", + }, + { + label: "Istarska županija", + value: "istarska-županija:18", + }, + { + label: "Karlovačka županija", + value: "karlovačka-županija:04", + }, + { + label: "Koprivničko-križevačka županija", + value: "koprivničko-križevačka-županija:06", + }, + { + label: "Krapinsko-zagorska županija", + value: "krapinsko-zagorska-županija:02", + }, + { + label: "Ličko-senjska županija", + value: "ličko-senjska-županija:09", + }, + { + label: "Međimurska županija", + value: "međimurska-županija:20", + }, + { + label: "Osječko-baranjska županija", + value: "osječko-baranjska-županija:14", + }, + { + label: "Požeško-slavonska županija", + value: "požeško-slavonska-županija:11", + }, + { + label: "Primorsko-goranska županija", + value: "primorsko-goranska-županija:08", + }, + { + label: "Sisačko-moslavačka županija", + value: "sisačko-moslavačka-županija:03", + }, + { + label: "Splitsko-dalmatinska županija", + value: "splitsko-dalmatinska-županija:17", + }, + { + label: "Varaždinska županija", + value: "varaždinska-županija:05", + }, + { + label: "Virovitičko-podravska županija", + value: "virovitičko-podravska-županija:10", + }, + { + label: "Vukovarsko-srijemska županija", + value: "vukovarsko-srijemska-županija:16", + }, + { + label: "Zadarska županija", + value: "zadarska-županija:13", + }, + { + label: "Zagrebačka županija", + value: "zagrebačka-županija:01", + }, + { + label: "Šibensko-kninska županija", + value: "šibensko-kninska-županija:15", + }, + ], + }, + { + label: "Cyprus", + value: "cyprus", + code: "CY", + states: [ + { + label: "Ammochostos", + value: "ammochostos:04", + }, + { + label: "Keryneia", + value: "keryneia:06", + }, + { + label: "Larnaka", + value: "larnaka:03", + }, + { + label: "Lefkosia", + value: "lefkosia:01", + }, + { + label: "Lemesos", + value: "lemesos:02", + }, + { + label: "Pafos", + value: "pafos:05", + }, + ], + }, + { + label: "Czech Republic", + value: "czech-republic", + code: "CZ", + states: [ + { + label: "Jihomoravský kraj", + value: "jihomoravský-kraj:JM", + }, + { + label: "Jihočeský kraj", + value: "jihočeský-kraj:JC", + }, + { + label: "Karlovarský kraj", + value: "karlovarský-kraj:KA", + }, + { + label: "Královéhradecký kraj", + value: "královéhradecký-kraj:KR", + }, + { + label: "Liberecký kraj", + value: "liberecký-kraj:LI", + }, + { + label: "Moravskoslezský kraj", + value: "moravskoslezský-kraj:MO", + }, + { + label: "Olomoucký kraj", + value: "olomoucký-kraj:OL", + }, + { + label: "Pardubický kraj", + value: "pardubický-kraj:PA", + }, + { + label: "Plzeňský kraj", + value: "plzeňský-kraj:PL", + }, + { + label: "Praha, hlavní město", + value: "praha,-hlavní-město:PR", + }, + { + label: "Středočeský kraj", + value: "středočeský-kraj:ST", + }, + { + label: "Vysočina", + value: "vysočina:VY", + }, + { + label: "Zlínský kraj", + value: "zlínský-kraj:ZL", + }, + { + label: "Ústecký kraj", + value: "ústecký-kraj:US", + }, + ], + }, + { + label: "Denmark", + value: "denmark", + code: "DK", + states: [ + { + label: "Hovedstaden", + value: "hovedstaden:84", + }, + { + label: "Midtjylland", + value: "midtjylland:82", + }, + { + label: "Nordjylland", + value: "nordjylland:81", + }, + { + label: "Sjælland", + value: "sjælland:85", + }, + { + label: "Syddanmark", + value: "syddanmark:83", + }, + ], + }, + { + label: "Estonia", + value: "estonia", + code: "EE", + states: [ + { + label: "Harjumaa", + value: "harjumaa:37", + }, + { + label: "Hiiumaa", + value: "hiiumaa:39", + }, + { + label: "Ida-Virumaa", + value: "ida-virumaa:44", + }, + { + label: "Järvamaa", + value: "järvamaa:51", + }, + { + label: "Jõgevamaa", + value: "jõgevamaa:49", + }, + { + label: "Lääne-Virumaa", + value: "lääne-virumaa:59", + }, + { + label: "Läänemaa", + value: "läänemaa:57", + }, + { + label: "Pärnumaa", + value: "pärnumaa:67", + }, + { + label: "Põlvamaa", + value: "põlvamaa:65", + }, + { + label: "Raplamaa", + value: "raplamaa:70", + }, + { + label: "Saaremaa", + value: "saaremaa:74", + }, + { + label: "Tartumaa", + value: "tartumaa:78", + }, + { + label: "Valgamaa", + value: "valgamaa:82", + }, + { + label: "Viljandimaa", + value: "viljandimaa:84", + }, + { + label: "Võrumaa", + value: "võrumaa:86", + }, + ], + }, + { + label: "Faroe Islands", + value: "faroe-islands", + code: "FO", + states: [], + }, + { + label: "Finland", + value: "finland", + code: "FI", + states: [ + { + label: "Ahvenanmaan maakunta", + value: "ahvenanmaan-maakunta:01", + }, + { + label: "Etelä-Karjala", + value: "etelä-karjala:02", + }, + { + label: "Etelä-Pohjanmaa", + value: "etelä-pohjanmaa:03", + }, + { + label: "Etelä-Savo", + value: "etelä-savo:04", + }, + { + label: "Kainuu", + value: "kainuu:05", + }, + { + label: "Kanta-Häme", + value: "kanta-häme:06", + }, + { + label: "Keski-Pohjanmaa", + value: "keski-pohjanmaa:07", + }, + { + label: "Keski-Suomi", + value: "keski-suomi:08", + }, + { + label: "Kymenlaakso", + value: "kymenlaakso:09", + }, + { + label: "Lappi", + value: "lappi:10", + }, + { + label: "Pirkanmaa", + value: "pirkanmaa:11", + }, + { + label: "Pohjanmaa", + value: "pohjanmaa:12", + }, + { + label: "Pohjois-Karjala", + value: "pohjois-karjala:13", + }, + { + label: "Pohjois-Pohjanmaa", + value: "pohjois-pohjanmaa:14", + }, + { + label: "Pohjois-Savo", + value: "pohjois-savo:15", + }, + { + label: "Päijät-Häme", + value: "päijät-häme:16", + }, + { + label: "Satakunta", + value: "satakunta:17", + }, + { + label: "Uusimaa", + value: "uusimaa:18", + }, + { + label: "Varsinais-Suomi", + value: "varsinais-suomi:19", + }, + ], + }, + { + label: "France", + value: "france", + code: "FR", + states: [ + { + label: "Alsace", + value: "alsace:A", + }, + { + label: "Aquitaine", + value: "aquitaine:B", + }, + { + label: "Auvergne", + value: "auvergne:C", + }, + { + label: "Brittany", + value: "brittany:E", + }, + { + label: "Burgundy", + value: "burgundy:D", + }, + { + label: "Centre-Val de Loire", + value: "centre-val-de-loire:F", + }, + { + label: "Champagne-Ardenne", + value: "champagne-ardenne:G", + }, + { + label: "Corsica", + value: "corsica:H", + }, + { + label: "Franche-Comté", + value: "franche-comté:I", + }, + { + label: "Languedoc-Roussillon", + value: "languedoc-roussillon:K", + }, + { + label: "Limousin", + value: "limousin:L", + }, + { + label: "Lorraine", + value: "lorraine:M", + }, + { + label: "Lower Normandy", + value: "lower-normandy:P", + }, + { + label: "Midi-Pyrénées", + value: "midi-pyrénées:N", + }, + { + label: "Nord-Pas-de-Calais", + value: "nord-pas-de-calais:O", + }, + { + label: "Pays de la Loire", + value: "pays-de-la-loire:R", + }, + { + label: "Picardy", + value: "picardy:S", + }, + { + label: "Poitou-Charentes", + value: "poitou-charentes:T", + }, + { + label: "Provence-Alpes-Côte d'Azur", + value: "provence-alpes-côte-d'azur:U", + }, + { + label: "Rhône-Alpes", + value: "rhône-alpes:V", + }, + { + label: "Upper Normandy", + value: "upper-normandy:Q", + }, + { + label: "Île-de-France", + value: "île-de-france:J", + }, + ], + }, + { + label: "Germany", + value: "germany", + code: "DE", + states: [ + { + label: "Baden-Württemberg", + value: "baden-württemberg:BW", + }, + { + label: "Bayern", + value: "bayern:BY", + }, + { + label: "Berlin", + value: "berlin:BE", + }, + { + label: "Brandenburg", + value: "brandenburg:BB", + }, + { + label: "Bremen", + value: "bremen:HB", + }, + { + label: "Hamburg", + value: "hamburg:HH", + }, + { + label: "Hessen", + value: "hessen:HE", + }, + { + label: "Mecklenburg-Vorpommern", + value: "mecklenburg-vorpommern:MV", + }, + { + label: "Niedersachsen", + value: "niedersachsen:NI", + }, + { + label: "Nordrhein-Westfalen", + value: "nordrhein-westfalen:NW", + }, + { + label: "Rheinland-Pfalz", + value: "rheinland-pfalz:RP", + }, + { + label: "Saarland", + value: "saarland:SL", + }, + { + label: "Sachsen", + value: "sachsen:SN", + }, + { + label: "Sachsen-Anhalt", + value: "sachsen-anhalt:ST", + }, + { + label: "Schleswig-Holstein", + value: "schleswig-holstein:SH", + }, + { + label: "Thüringen", + value: "thüringen:TH", + }, + ], + }, + { + label: "Gibraltar", + value: "gibraltar", + code: "GI", + states: [], + }, + { + label: "Greece", + value: "greece", + code: "GR", + states: [ + { + label: "Anatoliki Makedonia kai Thraki", + value: "anatoliki-makedonia-kai-thraki:A", + }, + { + label: "Attiki", + value: "attiki:I", + }, + { + label: "Dytiki Ellada", + value: "dytiki-ellada:G", + }, + { + label: "Dytiki Makedonia", + value: "dytiki-makedonia:C", + }, + { + label: "Ionia Nisia", + value: "ionia-nisia:F", + }, + { + label: "Ipeiros", + value: "ipeiros:D", + }, + { + label: "Kentriki Makedonia", + value: "kentriki-makedonia:B", + }, + { + label: "Kriti", + value: "kriti:M", + }, + { + label: "Notio Aigaio", + value: "notio-aigaio:L", + }, + { + label: "Peloponnisos", + value: "peloponnisos:J", + }, + { + label: "Sterea Ellada", + value: "sterea-ellada:H", + }, + { + label: "Thessalia", + value: "thessalia:E", + }, + { + label: "Voreio Aigaio", + value: "voreio-aigaio:K", + }, + ], + }, + { + label: "Guernsey", + value: "guernsey", + code: "GG", + states: [], + }, + { + label: "Holy See", + value: "holy-see", + code: "VA", + states: [], + }, + { + label: "Hungary", + value: "hungary", + code: "HU", + states: [ + { + label: "Baranya", + value: "baranya:BA", + }, + { + label: "Borsod-Abaúj-Zemplén", + value: "borsod-abaúj-zemplén:BZ", + }, + { + label: "Budapest", + value: "budapest:BU", + }, + { + label: "Bács-Kiskun", + value: "bács-kiskun:BK", + }, + { + label: "Békés", + value: "békés:BE", + }, + { + label: "Békéscsaba", + value: "békéscsaba:BC", + }, + { + label: "Csongrád", + value: "csongrád:CS", + }, + { + label: "Debrecen", + value: "debrecen:DE", + }, + { + label: "Dunaújváros", + value: "dunaújváros:DU", + }, + { + label: "Eger", + value: "eger:EG", + }, + { + label: "Fejér", + value: "fejér:FE", + }, + { + label: "Győr", + value: "győr:GY", + }, + { + label: "Győr-Moson-Sopron", + value: "győr-moson-sopron:GS", + }, + { + label: "Hajdú-Bihar", + value: "hajdú-bihar:HB", + }, + { + label: "Heves", + value: "heves:HE", + }, + { + label: "Hódmezővásárhely", + value: "hódmezővásárhely:HV", + }, + { + label: "Jász-Nagykun-Szolnok", + value: "jász-nagykun-szolnok:JN", + }, + { + label: "Kaposvár", + value: "kaposvár:KV", + }, + { + label: "Kecskemét", + value: "kecskemét:KM", + }, + { + label: "Komárom-Esztergom", + value: "komárom-esztergom:KE", + }, + { + label: "Miskolc", + value: "miskolc:MI", + }, + { + label: "Nagykanizsa", + value: "nagykanizsa:NK", + }, + { + label: "Nyíregyháza", + value: "nyíregyháza:NY", + }, + { + label: "Nógrád", + value: "nógrád:NO", + }, + { + label: "Pest", + value: "pest:PE", + }, + { + label: "Pécs", + value: "pécs:PS", + }, + { + label: "Salgótarján", + value: "salgótarján:ST", + }, + { + label: "Somogy", + value: "somogy:SO", + }, + { + label: "Sopron", + value: "sopron:SN", + }, + { + label: "Szabolcs-Szatmár-Bereg", + value: "szabolcs-szatmár-bereg:SZ", + }, + { + label: "Szeged", + value: "szeged:SD", + }, + { + label: "Szekszárd", + value: "szekszárd:SS", + }, + { + label: "Szolnok", + value: "szolnok:SK", + }, + { + label: "Szombathely", + value: "szombathely:SH", + }, + { + label: "Székesfehérvár", + value: "székesfehérvár:SF", + }, + { + label: "Tatabánya", + value: "tatabánya:TB", + }, + { + label: "Tolna", + value: "tolna:TO", + }, + { + label: "Vas", + value: "vas:VA", + }, + { + label: "Veszprém", + value: "veszprém:VE", + }, + { + label: "Veszprém", + value: "veszprém:VM", + }, + { + label: "Zala", + value: "zala:ZA", + }, + { + label: "Zalaegerszeg", + value: "zalaegerszeg:ZE", + }, + { + label: "Érd", + value: "érd:ER", + }, + ], + }, + { + label: "Iceland", + value: "iceland", + code: "IS", + states: [ + { + label: "Austurland", + value: "austurland:7", + }, + { + label: "Höfuðborgarsvæði utan Reykjavíkur", + value: "höfuðborgarsvæði-utan-reykjavíkur:1", + }, + { + label: "Norðurland eystra", + value: "norðurland-eystra:6", + }, + { + label: "Norðurland vestra", + value: "norðurland-vestra:5", + }, + { + label: "Reykjavík", + value: "reykjavík:0", + }, + { + label: "Suðurland", + value: "suðurland:8", + }, + { + label: "Suðurnes", + value: "suðurnes:2", + }, + { + label: "Vestfirðir", + value: "vestfirðir:4", + }, + { + label: "Vesturland", + value: "vesturland:3", + }, + ], + }, + { + label: "Republic of Ireland", + value: "republic-of-ireland", + code: "IE", + states: [ + { + label: "Connaught", + value: "connaught:C", + }, + { + label: "Leinster", + value: "leinster:L", + }, + { + label: "Munster", + value: "munster:M", + }, + { + label: "Ulster", + value: "ulster:U", + }, + ], + }, + { + label: "Isle of Man", + value: "isle-of-man", + code: "IM", + states: [], + }, + { + label: "Italy", + value: "italy", + code: "IT", + states: [ + { + label: "Abruzzo", + value: "abruzzo:65", + }, + { + label: "Basilicata", + value: "basilicata:77", + }, + { + label: "Calabria", + value: "calabria:78", + }, + { + label: "Campania", + value: "campania:72", + }, + { + label: "Emilia-Romagna", + value: "emilia-romagna:45", + }, + { + label: "Friuli-Venezia Giulia", + value: "friuli-venezia-giulia:36", + }, + { + label: "Lazio", + value: "lazio:62", + }, + { + label: "Liguria", + value: "liguria:42", + }, + { + label: "Lombardia", + value: "lombardia:25", + }, + { + label: "Marche", + value: "marche:57", + }, + { + label: "Molise", + value: "molise:67", + }, + { + label: "Piemonte", + value: "piemonte:21", + }, + { + label: "Puglia", + value: "puglia:75", + }, + { + label: "Sardegna", + value: "sardegna:88", + }, + { + label: "Sicilia", + value: "sicilia:82", + }, + { + label: "Toscana", + value: "toscana:52", + }, + { + label: "Trentino-Alto Adige", + value: "trentino-alto-adige:32", + }, + { + label: "Umbria", + value: "umbria:55", + }, + { + label: "Valle d'Aosta", + value: "valle-d'aosta:23", + }, + { + label: "Veneto", + value: "veneto:34", + }, + ], + }, + { + label: "Jersey", + value: "jersey", + code: "JE", + states: [], + }, + { + label: "Latvia", + value: "latvia", + code: "LV", + states: [ + { + label: "Aglonas novads", + value: "aglonas-novads:001", + }, + { + label: "Aizkraukles novads", + value: "aizkraukles-novads:002", + }, + { + label: "Aizputes novads", + value: "aizputes-novads:003", + }, + { + label: "Aknīstes novads", + value: "aknīstes-novads:004", + }, + { + label: "Alojas novads", + value: "alojas-novads:005", + }, + { + label: "Alsungas novads", + value: "alsungas-novads:006", + }, + { + label: "Alūksnes novads", + value: "alūksnes-novads:007", + }, + { + label: "Amatas novads", + value: "amatas-novads:008", + }, + { + label: "Apes novads", + value: "apes-novads:009", + }, + { + label: "Auces novads", + value: "auces-novads:010", + }, + { + label: "Babītes novads", + value: "babītes-novads:012", + }, + { + label: "Baldones novads", + value: "baldones-novads:013", + }, + { + label: "Baltinavas novads", + value: "baltinavas-novads:014", + }, + { + label: "Balvu novads", + value: "balvu-novads:015", + }, + { + label: "Bauskas novads", + value: "bauskas-novads:016", + }, + { + label: "Beverīnas novads", + value: "beverīnas-novads:017", + }, + { + label: "Brocēnu novads", + value: "brocēnu-novads:018", + }, + { + label: "Burtnieku novads", + value: "burtnieku-novads:019", + }, + { + label: "Carnikavas novads", + value: "carnikavas-novads:020", + }, + { + label: "Cesvaines novads", + value: "cesvaines-novads:021", + }, + { + label: "Ciblas novads", + value: "ciblas-novads:023", + }, + { + label: "Cēsu novads", + value: "cēsu-novads:022", + }, + { + label: "Dagdas novads", + value: "dagdas-novads:024", + }, + { + label: "Daugavpils", + value: "daugavpils:DGV", + }, + { + label: "Daugavpils novads", + value: "daugavpils-novads:025", + }, + { + label: "Dobeles novads", + value: "dobeles-novads:026", + }, + { + label: "Dundagas novads", + value: "dundagas-novads:027", + }, + { + label: "Durbes novads", + value: "durbes-novads:028", + }, + { + label: "Engures novads", + value: "engures-novads:029", + }, + { + label: "Garkalnes novads", + value: "garkalnes-novads:031", + }, + { + label: "Grobiņas novads", + value: "grobiņas-novads:032", + }, + { + label: "Gulbenes novads", + value: "gulbenes-novads:033", + }, + { + label: "Iecavas novads", + value: "iecavas-novads:034", + }, + { + label: "Ikšķiles novads", + value: "ikšķiles-novads:035", + }, + { + label: "Ilūkstes novads", + value: "ilūkstes-novads:036", + }, + { + label: "Inčukalna novads", + value: "inčukalna-novads:037", + }, + { + label: "Jaunjelgavas novads", + value: "jaunjelgavas-novads:038", + }, + { + label: "Jaunpiebalgas novads", + value: "jaunpiebalgas-novads:039", + }, + { + label: "Jaunpils novads", + value: "jaunpils-novads:040", + }, + { + label: "Jelgava", + value: "jelgava:JEL", + }, + { + label: "Jelgavas novads", + value: "jelgavas-novads:041", + }, + { + label: "Jēkabpils", + value: "jēkabpils:JKB", + }, + { + label: "Jēkabpils novads", + value: "jēkabpils-novads:042", + }, + { + label: "Jūrmala", + value: "jūrmala:JUR", + }, + { + label: "Kandavas novads", + value: "kandavas-novads:043", + }, + { + label: "Kocēnu novads", + value: "kocēnu-novads:045", + }, + { + label: "Kokneses novads", + value: "kokneses-novads:046", + }, + { + label: "Krimuldas novads", + value: "krimuldas-novads:048", + }, + { + label: "Krustpils novads", + value: "krustpils-novads:049", + }, + { + label: "Krāslavas novads", + value: "krāslavas-novads:047", + }, + { + label: "Kuldīgas novads", + value: "kuldīgas-novads:050", + }, + { + label: "Kārsavas novads", + value: "kārsavas-novads:044", + }, + { + label: "Lielvārdes novads", + value: "lielvārdes-novads:053", + }, + { + label: "Liepāja", + value: "liepāja:LPX", + }, + { + label: "Limbažu novads", + value: "limbažu-novads:054", + }, + { + label: "Lubānas novads", + value: "lubānas-novads:057", + }, + { + label: "Ludzas novads", + value: "ludzas-novads:058", + }, + { + label: "Līgatnes novads", + value: "līgatnes-novads:055", + }, + { + label: "Līvānu novads", + value: "līvānu-novads:056", + }, + { + label: "Madonas novads", + value: "madonas-novads:059", + }, + { + label: "Mazsalacas novads", + value: "mazsalacas-novads:060", + }, + { + label: "Mālpils novads", + value: "mālpils-novads:061", + }, + { + label: "Mārupes novads", + value: "mārupes-novads:062", + }, + { + label: "Mērsraga novads", + value: "mērsraga-novads:063", + }, + { + label: "Naukšēnu novads", + value: "naukšēnu-novads:064", + }, + { + label: "Neretas novads", + value: "neretas-novads:065", + }, + { + label: "Nīcas novads", + value: "nīcas-novads:066", + }, + { + label: "Ogres novads", + value: "ogres-novads:067", + }, + { + label: "Olaines novads", + value: "olaines-novads:068", + }, + { + label: "Ozolnieku novads", + value: "ozolnieku-novads:069", + }, + { + label: "Preiļu novads", + value: "preiļu-novads:073", + }, + { + label: "Priekules novads", + value: "priekules-novads:074", + }, + { + label: "Priekuļu novads", + value: "priekuļu-novads:075", + }, + { + label: "Pārgaujas novads", + value: "pārgaujas-novads:070", + }, + { + label: "Pāvilostas novads", + value: "pāvilostas-novads:071", + }, + { + label: "Pļaviņu novads", + value: "pļaviņu-novads:072", + }, + { + label: "Raunas novads", + value: "raunas-novads:076", + }, + { + label: "Riebiņu novads", + value: "riebiņu-novads:078", + }, + { + label: "Rojas novads", + value: "rojas-novads:079", + }, + { + label: "Ropažu novads", + value: "ropažu-novads:080", + }, + { + label: "Rucavas novads", + value: "rucavas-novads:081", + }, + { + label: "Rugāju novads", + value: "rugāju-novads:082", + }, + { + label: "Rundāles novads", + value: "rundāles-novads:083", + }, + { + label: "Rēzekne", + value: "rēzekne:REZ", + }, + { + label: "Rēzeknes novads", + value: "rēzeknes-novads:077", + }, + { + label: "Rīga", + value: "rīga:RIX", + }, + { + label: "Rūjienas novads", + value: "rūjienas-novads:084", + }, + { + label: "Salacgrīvas novads", + value: "salacgrīvas-novads:086", + }, + { + label: "Salas novads", + value: "salas-novads:085", + }, + { + label: "Salaspils novads", + value: "salaspils-novads:087", + }, + { + label: "Saldus novads", + value: "saldus-novads:088", + }, + { + label: "Saulkrastu novads", + value: "saulkrastu-novads:089", + }, + { + label: "Siguldas novads", + value: "siguldas-novads:091", + }, + { + label: "Skrundas novads", + value: "skrundas-novads:093", + }, + { + label: "Skrīveru novads", + value: "skrīveru-novads:092", + }, + { + label: "Smiltenes novads", + value: "smiltenes-novads:094", + }, + { + label: "Stopiņu novads", + value: "stopiņu-novads:095", + }, + { + label: "Strenču novads", + value: "strenču-novads:096", + }, + { + label: "Sējas novads", + value: "sējas-novads:090", + }, + { + label: "Talsu novads", + value: "talsu-novads:097", + }, + { + label: "Tukuma novads", + value: "tukuma-novads:099", + }, + { + label: "Tērvetes novads", + value: "tērvetes-novads:098", + }, + { + label: "Vaiņodes novads", + value: "vaiņodes-novads:100", + }, + { + label: "Valkas novads", + value: "valkas-novads:101", + }, + { + label: "Valmiera", + value: "valmiera:VMR", + }, + { + label: "Varakļānu novads", + value: "varakļānu-novads:102", + }, + { + label: "Vecpiebalgas novads", + value: "vecpiebalgas-novads:104", + }, + { + label: "Vecumnieku novads", + value: "vecumnieku-novads:105", + }, + { + label: "Ventspils", + value: "ventspils:VEN", + }, + { + label: "Ventspils novads", + value: "ventspils-novads:106", + }, + { + label: "Viesītes novads", + value: "viesītes-novads:107", + }, + { + label: "Viļakas novads", + value: "viļakas-novads:108", + }, + { + label: "Viļānu novads", + value: "viļānu-novads:109", + }, + { + label: "Vārkavas novads", + value: "vārkavas-novads:103", + }, + { + label: "Zilupes novads", + value: "zilupes-novads:110", + }, + { + label: "Ādažu novads", + value: "ādažu-novads:011", + }, + { + label: "Ērgļu novads", + value: "ērgļu-novads:030", + }, + { + label: "Ķeguma novads", + value: "ķeguma-novads:051", + }, + { + label: "Ķekavas novads", + value: "ķekavas-novads:052", + }, + ], + }, + { + label: "Liechtenstein", + value: "liechtenstein", + code: "LI", + states: [ + { + label: "Balzers", + value: "balzers:01", + }, + { + label: "Eschen", + value: "eschen:02", + }, + { + label: "Gamprin", + value: "gamprin:03", + }, + { + label: "Mauren", + value: "mauren:04", + }, + { + label: "Planken", + value: "planken:05", + }, + { + label: "Ruggell", + value: "ruggell:06", + }, + { + label: "Schaan", + value: "schaan:07", + }, + { + label: "Schellenberg", + value: "schellenberg:08", + }, + { + label: "Triesen", + value: "triesen:09", + }, + { + label: "Triesenberg", + value: "triesenberg:10", + }, + { + label: "Vaduz", + value: "vaduz:11", + }, + ], + }, + { + label: "Lithuania", + value: "lithuania", + code: "LT", + states: [ + { + label: "Alytaus Apskritis", + value: "alytaus-apskritis:AL", + }, + { + label: "Kauno Apskritis", + value: "kauno-apskritis:KU", + }, + { + label: "Klaipėdos Apskritis", + value: "klaipėdos-apskritis:KL", + }, + { + label: "Marijampolės Apskritis", + value: "marijampolės-apskritis:MR", + }, + { + label: "Panevėžio Apskritis", + value: "panevėžio-apskritis:PN", + }, + { + label: "Tauragės Apskritis", + value: "tauragės-apskritis:TA", + }, + { + label: "Telšių Apskritis", + value: "telšių-apskritis:TE", + }, + { + label: "Utenos Apskritis", + value: "utenos-apskritis:UT", + }, + { + label: "Vilniaus Apskritis", + value: "vilniaus-apskritis:VL", + }, + { + label: "Šiaulių Apskritis", + value: "šiaulių-apskritis:SA", + }, + ], + }, + { + label: "Luxembourg", + value: "luxembourg", + code: "LU", + states: [ + { + label: "Diekirch", + value: "diekirch:D", + }, + { + label: "Grevenmacher", + value: "grevenmacher:G", + }, + { + label: "Luxembourg", + value: "luxembourg:L", + }, + ], + }, + { + label: "Republic of Macedonia", + value: "republic-of-macedonia", + code: "MK", + states: [ + { + label: "Aerodrom", + value: "aerodrom:01", + }, + { + label: "Aračinovo", + value: "aračinovo:02", + }, + { + label: "Berovo", + value: "berovo:03", + }, + { + label: "Bitola", + value: "bitola:04", + }, + { + label: "Bogdanci", + value: "bogdanci:05", + }, + { + label: "Bogovinje", + value: "bogovinje:06", + }, + { + label: "Bosilovo", + value: "bosilovo:07", + }, + { + label: "Brvenica", + value: "brvenica:08", + }, + { + label: "Butel", + value: "butel:09", + }, + { + label: "Centar", + value: "centar:77", + }, + { + label: "Centar Župa", + value: "centar-župa:78", + }, + { + label: "Debar", + value: "debar:21", + }, + { + label: "Debarca", + value: "debarca:22", + }, + { + label: "Delčevo", + value: "delčevo:23", + }, + { + label: "Demir Hisar", + value: "demir-hisar:25", + }, + { + label: "Demir Kapija", + value: "demir-kapija:24", + }, + { + label: "Dojran", + value: "dojran:26", + }, + { + label: "Dolneni", + value: "dolneni:27", + }, + { + label: "Drugovo", + value: "drugovo:28", + }, + { + label: "Gazi Baba", + value: "gazi-baba:17", + }, + { + label: "Gevgelija", + value: "gevgelija:18", + }, + { + label: "Gjorče Petrov", + value: "gjorče-petrov:29", + }, + { + label: "Gostivar", + value: "gostivar:19", + }, + { + label: "Gradsko", + value: "gradsko:20", + }, + { + label: "Ilinden", + value: "ilinden:34", + }, + { + label: "Jegunovce", + value: "jegunovce:35", + }, + { + label: "Karbinci", + value: "karbinci:37", + }, + { + label: "Karpoš", + value: "karpoš:38", + }, + { + label: "Kavadarci", + value: "kavadarci:36", + }, + { + label: "Kisela Voda", + value: "kisela-voda:39", + }, + { + label: "Kičevo", + value: "kičevo:40", + }, + { + label: "Konče", + value: "konče:41", + }, + { + label: "Kočani", + value: "kočani:42", + }, + { + label: "Kratovo", + value: "kratovo:43", + }, + { + label: "Kriva Palanka", + value: "kriva-palanka:44", + }, + { + label: "Krivogaštani", + value: "krivogaštani:45", + }, + { + label: "Kruševo", + value: "kruševo:46", + }, + { + label: "Kumanovo", + value: "kumanovo:47", + }, + { + label: "Lipkovo", + value: "lipkovo:48", + }, + { + label: "Lozovo", + value: "lozovo:49", + }, + { + label: "Makedonska Kamenica", + value: "makedonska-kamenica:51", + }, + { + label: "Makedonski Brod", + value: "makedonski-brod:52", + }, + { + label: "Mavrovo i Rostuša", + value: "mavrovo-i-rostuša:50", + }, + { + label: "Mogila", + value: "mogila:53", + }, + { + label: "Negotino", + value: "negotino:54", + }, + { + label: "Novaci", + value: "novaci:55", + }, + { + label: "Novo Selo", + value: "novo-selo:56", + }, + { + label: "Ohrid", + value: "ohrid:58", + }, + { + label: "Oslomej", + value: "oslomej:57", + }, + { + label: "Pehčevo", + value: "pehčevo:60", + }, + { + label: "Petrovec", + value: "petrovec:59", + }, + { + label: "Plasnica", + value: "plasnica:61", + }, + { + label: "Prilep", + value: "prilep:62", + }, + { + label: "Probištip", + value: "probištip:63", + }, + { + label: "Radoviš", + value: "radoviš:64", + }, + { + label: "Rankovce", + value: "rankovce:65", + }, + { + label: "Resen", + value: "resen:66", + }, + { + label: "Rosoman", + value: "rosoman:67", + }, + { + label: "Saraj", + value: "saraj:68", + }, + { + label: "Sopište", + value: "sopište:70", + }, + { + label: "Staro Nagoričane", + value: "staro-nagoričane:71", + }, + { + label: "Struga", + value: "struga:72", + }, + { + label: "Strumica", + value: "strumica:73", + }, + { + label: "Studeničani", + value: "studeničani:74", + }, + { + label: "Sveti Nikole", + value: "sveti-nikole:69", + }, + { + label: "Tearce", + value: "tearce:75", + }, + { + label: "Tetovo", + value: "tetovo:76", + }, + { + label: "Valandovo", + value: "valandovo:10", + }, + { + label: "Vasilevo", + value: "vasilevo:11", + }, + { + label: "Veles", + value: "veles:13", + }, + { + label: "Vevčani", + value: "vevčani:12", + }, + { + label: "Vinica", + value: "vinica:14", + }, + { + label: "Vraneštica", + value: "vraneštica:15", + }, + { + label: "Vrapčište", + value: "vrapčište:16", + }, + { + label: "Zajas", + value: "zajas:31", + }, + { + label: "Zelenikovo", + value: "zelenikovo:32", + }, + { + label: "Zrnovci", + value: "zrnovci:33", + }, + { + label: "Čair", + value: "čair:79", + }, + { + label: "Čaška", + value: "čaška:80", + }, + { + label: "Češinovo-Obleševo", + value: "češinovo-obleševo:81", + }, + { + label: "Čučer Sandevo", + value: "čučer-sandevo:82", + }, + { + label: "Štip", + value: "štip:83", + }, + { + label: "Šuto Orizari", + value: "šuto-orizari:84", + }, + { + label: "Želino", + value: "želino:30", + }, + ], + }, + { + label: "Malta", + value: "malta", + code: "MT", + states: [ + { + label: "Attard", + value: "attard:01", + }, + { + label: "Balzan", + value: "balzan:02", + }, + { + label: "Birgu", + value: "birgu:03", + }, + { + label: "Birkirkara", + value: "birkirkara:04", + }, + { + label: "Birżebbuġa", + value: "birżebbuġa:05", + }, + { + label: "Bormla", + value: "bormla:06", + }, + { + label: "Dingli", + value: "dingli:07", + }, + { + label: "Fgura", + value: "fgura:08", + }, + { + label: "Floriana", + value: "floriana:09", + }, + { + label: "Fontana", + value: "fontana:10", + }, + { + label: "Gudja", + value: "gudja:11", + }, + { + label: "Għajnsielem", + value: "għajnsielem:13", + }, + { + label: "Għarb", + value: "għarb:14", + }, + { + label: "Għargħur", + value: "għargħur:15", + }, + { + label: "Għasri", + value: "għasri:16", + }, + { + label: "Għaxaq", + value: "għaxaq:17", + }, + { + label: "Gżira", + value: "gżira:12", + }, + { + label: "Iklin", + value: "iklin:19", + }, + { + label: "Isla", + value: "isla:20", + }, + { + label: "Kalkara", + value: "kalkara:21", + }, + { + label: "Kerċem", + value: "kerċem:22", + }, + { + label: "Kirkop", + value: "kirkop:23", + }, + { + label: "Lija", + value: "lija:24", + }, + { + label: "Luqa", + value: "luqa:25", + }, + { + label: "Marsa", + value: "marsa:26", + }, + { + label: "Marsaskala", + value: "marsaskala:27", + }, + { + label: "Marsaxlokk", + value: "marsaxlokk:28", + }, + { + label: "Mdina", + value: "mdina:29", + }, + { + label: "Mellieħa", + value: "mellieħa:30", + }, + { + label: "Mosta", + value: "mosta:32", + }, + { + label: "Mqabba", + value: "mqabba:33", + }, + { + label: "Msida", + value: "msida:34", + }, + { + label: "Mtarfa", + value: "mtarfa:35", + }, + { + label: "Munxar", + value: "munxar:36", + }, + { + label: "Mġarr", + value: "mġarr:31", + }, + { + label: "Nadur", + value: "nadur:37", + }, + { + label: "Naxxar", + value: "naxxar:38", + }, + { + label: "Paola", + value: "paola:39", + }, + { + label: "Pembroke", + value: "pembroke:40", + }, + { + label: "Pietà", + value: "pietà:41", + }, + { + label: "Qala", + value: "qala:42", + }, + { + label: "Qormi", + value: "qormi:43", + }, + { + label: "Qrendi", + value: "qrendi:44", + }, + { + label: "Rabat Għawdex", + value: "rabat-għawdex:45", + }, + { + label: "Rabat Malta", + value: "rabat-malta:46", + }, + { + label: "Safi", + value: "safi:47", + }, + { + label: "San Lawrenz", + value: "san-lawrenz:50", + }, + { + label: "San Pawl il-Baħar", + value: "san-pawl-il-baħar:51", + }, + { + label: "San Ġiljan", + value: "san-ġiljan:48", + }, + { + label: "San Ġwann", + value: "san-ġwann:49", + }, + { + label: "Sannat", + value: "sannat:52", + }, + { + label: "Santa Luċija", + value: "santa-luċija:53", + }, + { + label: "Santa Venera", + value: "santa-venera:54", + }, + { + label: "Siġġiewi", + value: "siġġiewi:55", + }, + { + label: "Sliema", + value: "sliema:56", + }, + { + label: "Swieqi", + value: "swieqi:57", + }, + { + label: "Ta' Xbiex", + value: "ta'-xbiex:58", + }, + { + label: "Tarxien", + value: "tarxien:59", + }, + { + label: "Valletta", + value: "valletta:60", + }, + { + label: "Xagħra", + value: "xagħra:61", + }, + { + label: "Xewkija", + value: "xewkija:62", + }, + { + label: "Xgħajra", + value: "xgħajra:63", + }, + { + label: "Ħamrun", + value: "ħamrun:18", + }, + { + label: "Żabbar", + value: "żabbar:64", + }, + { + label: "Żebbuġ Għawdex", + value: "żebbuġ-għawdex:65", + }, + { + label: "Żebbuġ Malta", + value: "żebbuġ-malta:66", + }, + { + label: "Żejtun", + value: "żejtun:67", + }, + { + label: "Żurrieq", + value: "żurrieq:68", + }, + ], + }, + { + label: "Moldova", + value: "moldova", + code: "MD", + states: [ + { + label: "Anenii Noi", + value: "anenii-noi:AN", + }, + { + label: "Basarabeasca", + value: "basarabeasca:BS", + }, + { + label: "Briceni", + value: "briceni:BR", + }, + { + label: "Bălţi", + value: "bălţi:BA", + }, + { + label: "Cahul", + value: "cahul:CA", + }, + { + label: "Cantemir", + value: "cantemir:CT", + }, + { + label: "Chişinău", + value: "chişinău:CU", + }, + { + label: "Cimişlia", + value: "cimişlia:CM", + }, + { + label: "Criuleni", + value: "criuleni:CR", + }, + { + label: "Călăraşi", + value: "călăraşi:CL", + }, + { + label: "Căuşeni", + value: "căuşeni:CS", + }, + { + label: "Donduşeni", + value: "donduşeni:DO", + }, + { + label: "Drochia", + value: "drochia:DR", + }, + { + label: "Dubăsari", + value: "dubăsari:DU", + }, + { + label: "Edineţ", + value: "edineţ:ED", + }, + { + label: "Floreşti", + value: "floreşti:FL", + }, + { + label: "Făleşti", + value: "făleşti:FA", + }, + { + label: "Glodeni", + value: "glodeni:GL", + }, + { + label: "Găgăuzia, Unitatea teritorială autonomă", + value: "găgăuzia,-unitatea-teritorială-autonomă:GA", + }, + { + label: "Hînceşti", + value: "hînceşti:HI", + }, + { + label: "Ialoveni", + value: "ialoveni:IA", + }, + { + label: "Leova", + value: "leova:LE", + }, + { + label: "Nisporeni", + value: "nisporeni:NI", + }, + { + label: "Ocniţa", + value: "ocniţa:OC", + }, + { + label: "Orhei", + value: "orhei:OR", + }, + { + label: "Rezina", + value: "rezina:RE", + }, + { + label: "Rîşcani", + value: "rîşcani:RI", + }, + { + label: "Soroca", + value: "soroca:SO", + }, + { + label: "Străşeni", + value: "străşeni:ST", + }, + { + label: "Stînga Nistrului, unitatea teritorială din", + value: "stînga-nistrului,-unitatea-teritorială-din:SN", + }, + { + label: "Sîngerei", + value: "sîngerei:SI", + }, + { + label: "Taraclia", + value: "taraclia:TA", + }, + { + label: "Teleneşti", + value: "teleneşti:TE", + }, + { + label: "Tighina", + value: "tighina:BD", + }, + { + label: "Ungheni", + value: "ungheni:UN", + }, + { + label: "Şoldăneşti", + value: "şoldăneşti:SD", + }, + { + label: "Ştefan Vodă", + value: "ştefan-vodă:SV", + }, + ], + }, + { + label: "Monaco", + value: "monaco", + code: "MC", + states: [ + { + label: "Fontvieille", + value: "fontvieille:FO", + }, + { + label: "Jardin Exotique", + value: "jardin-exotique:JE", + }, + { + label: "La Colle", + value: "la-colle:CL", + }, + { + label: "La Condamine", + value: "la-condamine:CO", + }, + { + label: "La Gare", + value: "la-gare:GA", + }, + { + label: "La Source", + value: "la-source:SO", + }, + { + label: "Larvotto", + value: "larvotto:LA", + }, + { + label: "Malbousquet", + value: "malbousquet:MA", + }, + { + label: "Monaco-Ville", + value: "monaco-ville:MO", + }, + { + label: "Moneghetti", + value: "moneghetti:MG", + }, + { + label: "Monte-Carlo", + value: "monte-carlo:MC", + }, + { + label: "Moulins", + value: "moulins:MU", + }, + { + label: "Port-Hercule", + value: "port-hercule:PH", + }, + { + label: "Saint-Roman", + value: "saint-roman:SR", + }, + { + label: "Sainte-Dévote", + value: "sainte-dévote:SD", + }, + { + label: "Spélugues", + value: "spélugues:SP", + }, + { + label: "Vallon de la Rousse", + value: "vallon-de-la-rousse:VR", + }, + ], + }, + { + label: "Montenegro", + value: "montenegro", + code: "ME", + states: [ + { + label: "Andrijevica", + value: "andrijevica:01", + }, + { + label: "Bar", + value: "bar:02", + }, + { + label: "Berane", + value: "berane:03", + }, + { + label: "Bijelo Polje", + value: "bijelo-polje:04", + }, + { + label: "Budva", + value: "budva:05", + }, + { + label: "Cetinje", + value: "cetinje:06", + }, + { + label: "Danilovgrad", + value: "danilovgrad:07", + }, + { + label: "Gusinje", + value: "gusinje:22", + }, + { + label: "Herceg-Novi", + value: "herceg-novi:08", + }, + { + label: "Kolašin", + value: "kolašin:09", + }, + { + label: "Kotor", + value: "kotor:10", + }, + { + label: "Mojkovac", + value: "mojkovac:11", + }, + { + label: "Nikšić", + value: "nikšić:12", + }, + { + label: "Petnjica", + value: "petnjica:23", + }, + { + label: "Plav", + value: "plav:13", + }, + { + label: "Pljevlja", + value: "pljevlja:14", + }, + { + label: "Plužine", + value: "plužine:15", + }, + { + label: "Podgorica", + value: "podgorica:16", + }, + { + label: "Rožaje", + value: "rožaje:17", + }, + { + label: "Tivat", + value: "tivat:19", + }, + { + label: "Ulcinj", + value: "ulcinj:20", + }, + { + label: "Šavnik", + value: "šavnik:18", + }, + { + label: "Žabljak", + value: "žabljak:21", + }, + ], + }, + { + label: "Netherlands", + value: "netherlands", + code: "NL", + states: [ + { + label: "Drenthe", + value: "drenthe:DR", + }, + { + label: "Flevoland", + value: "flevoland:FL", + }, + { + label: "Fryslân", + value: "fryslân:FR", + }, + { + label: "Gelderland", + value: "gelderland:GE", + }, + { + label: "Groningen", + value: "groningen:GR", + }, + { + label: "Limburg", + value: "limburg:LI", + }, + { + label: "Noord-Brabant", + value: "noord-brabant:NB", + }, + { + label: "Noord-Holland", + value: "noord-holland:NH", + }, + { + label: "Overijssel", + value: "overijssel:OV", + }, + { + label: "Utrecht", + value: "utrecht:UT", + }, + { + label: "Zeeland", + value: "zeeland:ZE", + }, + { + label: "Zuid-Holland", + value: "zuid-holland:ZH", + }, + { + label: "Aruba", + value: "aruba:AW", + }, + { + label: "Curaçao", + value: "curaçao:CW", + }, + { + label: "Sint Maarten", + value: "sint-maarten:SX", + }, + { + label: "Bonaire", + value: "bonaire:BQ1", + }, + { + label: "Saba", + value: "saba:BQ2", + }, + { + label: "Sint Eustatius", + value: "sint-eustatius:BQ3", + }, + ], + }, + { + label: "Norway", + value: "norway", + code: "NO", + states: [ + { + label: "Akershus", + value: "akershus:02", + }, + { + label: "Aust-Agder", + value: "aust-agder:09", + }, + { + label: "Buskerud", + value: "buskerud:06", + }, + { + label: "Finnmark", + value: "finnmark:20", + }, + { + label: "Hedmark", + value: "hedmark:04", + }, + { + label: "Hordaland", + value: "hordaland:12", + }, + { + label: "Jan Mayen", + value: "jan-mayen:22", + }, + { + label: "Møre og Romsdal", + value: "møre-og-romsdal:15", + }, + { + label: "Nord-Trøndelag", + value: "nord-trøndelag:17", + }, + { + label: "Nordland", + value: "nordland:18", + }, + { + label: "Oppland", + value: "oppland:05", + }, + { + label: "Oslo", + value: "oslo:03", + }, + { + label: "Rogaland", + value: "rogaland:11", + }, + { + label: "Sogn og Fjordane", + value: "sogn-og-fjordane:14", + }, + { + label: "Svalbard", + value: "svalbard:21", + }, + { + label: "Sør-Trøndelag", + value: "sør-trøndelag:16", + }, + { + label: "Telemark", + value: "telemark:08", + }, + { + label: "Troms", + value: "troms:19", + }, + { + label: "Vest-Agder", + value: "vest-agder:10", + }, + { + label: "Vestfold", + value: "vestfold:07", + }, + { + label: "Østfold", + value: "østfold:01", + }, + ], + }, + { + label: "Poland", + value: "poland", + code: "PL", + states: [ + { + label: "Dolnośląskie", + value: "dolnośląskie:DS", + }, + { + label: "Kujawsko-pomorskie", + value: "kujawsko-pomorskie:KP", + }, + { + label: "Lubelskie", + value: "lubelskie:LU", + }, + { + label: "Lubuskie", + value: "lubuskie:LB", + }, + { + label: "Mazowieckie", + value: "mazowieckie:MZ", + }, + { + label: "Małopolskie", + value: "małopolskie:MA", + }, + { + label: "Opolskie", + value: "opolskie:OP", + }, + { + label: "Podkarpackie", + value: "podkarpackie:PK", + }, + { + label: "Podlaskie", + value: "podlaskie:PD", + }, + { + label: "Pomorskie", + value: "pomorskie:PM", + }, + { + label: "Warmińsko-mazurskie", + value: "warmińsko-mazurskie:WN", + }, + { + label: "Wielkopolskie", + value: "wielkopolskie:WP", + }, + { + label: "Zachodniopomorskie", + value: "zachodniopomorskie:ZP", + }, + { + label: "Łódzkie", + value: "łódzkie:LD", + }, + { + label: "Śląskie", + value: "śląskie:SL", + }, + { + label: "Świętokrzyskie", + value: "świętokrzyskie:SK", + }, + ], + }, + { + label: "Portugal", + value: "portugal", + code: "PT", + states: [ + { + label: "Aveiro", + value: "aveiro:01", + }, + { + label: "Beja", + value: "beja:02", + }, + { + label: "Braga", + value: "braga:03", + }, + { + label: "Bragança", + value: "bragança:04", + }, + { + label: "Castelo Branco", + value: "castelo-branco:05", + }, + { + label: "Coimbra", + value: "coimbra:06", + }, + { + label: "Faro", + value: "faro:08", + }, + { + label: "Guarda", + value: "guarda:09", + }, + { + label: "Leiria", + value: "leiria:10", + }, + { + label: "Lisboa", + value: "lisboa:11", + }, + { + label: "Portalegre", + value: "portalegre:12", + }, + { + label: "Porto", + value: "porto:13", + }, + { + label: "Região Autónoma da Madeira", + value: "região-autónoma-da-madeira:30", + }, + { + label: "Região Autónoma dos Açores", + value: "região-autónoma-dos-açores:20", + }, + { + label: "Santarém", + value: "santarém:14", + }, + { + label: "Setúbal", + value: "setúbal:15", + }, + { + label: "Viana do Castelo", + value: "viana-do-castelo:16", + }, + { + label: "Vila Real", + value: "vila-real:17", + }, + { + label: "Viseu", + value: "viseu:18", + }, + { + label: "Évora", + value: "évora:07", + }, + ], + }, + { + label: "Republic of Kosovo", + value: "republic-of-kosovo", + code: "XK", + states: [], + }, + { + label: "Romania", + value: "romania", + code: "RO", + states: [ + { + label: "Alba", + value: "alba:AB", + }, + { + label: "Arad", + value: "arad:AR", + }, + { + label: "Argeș", + value: "argeș:AG", + }, + { + label: "Bacău", + value: "bacău:BC", + }, + { + label: "Bihor", + value: "bihor:BH", + }, + { + label: "Bistrița-Năsăud", + value: "bistrița-năsăud:BN", + }, + { + label: "Botoșani", + value: "botoșani:BT", + }, + { + label: "Brașov", + value: "brașov:BV", + }, + { + label: "Brăila", + value: "brăila:BR", + }, + { + label: "București", + value: "bucurești:B", + }, + { + label: "Buzău", + value: "buzău:BZ", + }, + { + label: "Caraș-Severin", + value: "caraș-severin:CS", + }, + { + label: "Cluj", + value: "cluj:CJ", + }, + { + label: "Constanța", + value: "constanța:CT", + }, + { + label: "Covasna", + value: "covasna:CV", + }, + { + label: "Călărași", + value: "călărași:CL", + }, + { + label: "Dolj", + value: "dolj:DJ", + }, + { + label: "Dâmbovița", + value: "dâmbovița:DB", + }, + { + label: "Galați", + value: "galați:GL", + }, + { + label: "Giurgiu", + value: "giurgiu:GR", + }, + { + label: "Gorj", + value: "gorj:GJ", + }, + { + label: "Harghita", + value: "harghita:HR", + }, + { + label: "Hunedoara", + value: "hunedoara:HD", + }, + { + label: "Ialomița", + value: "ialomița:IL", + }, + { + label: "Iași", + value: "iași:IS", + }, + { + label: "Ilfov", + value: "ilfov:IF", + }, + { + label: "Maramureș", + value: "maramureș:MM", + }, + { + label: "Mehedinți", + value: "mehedinți:MH", + }, + { + label: "Mureș", + value: "mureș:MS", + }, + { + label: "Neamț", + value: "neamț:NT", + }, + { + label: "Olt", + value: "olt:OT", + }, + { + label: "Prahova", + value: "prahova:PH", + }, + { + label: "Satu Mare", + value: "satu-mare:SM", + }, + { + label: "Sibiu", + value: "sibiu:SB", + }, + { + label: "Suceava", + value: "suceava:SV", + }, + { + label: "Sălaj", + value: "sălaj:SJ", + }, + { + label: "Teleorman", + value: "teleorman:TR", + }, + { + label: "Timiș", + value: "timiș:TM", + }, + { + label: "Tulcea", + value: "tulcea:TL", + }, + { + label: "Vaslui", + value: "vaslui:VS", + }, + { + label: "Vrancea", + value: "vrancea:VN", + }, + { + label: "Vâlcea", + value: "vâlcea:VL", + }, + ], + }, + { + label: "Russia", + value: "russia", + code: "RU", + states: [ + { + label: "Amurskaya oblast'", + value: "amurskaya-oblast':AMU", + }, + { + label: "Arkhangel'skaya oblast'", + value: "arkhangel'skaya-oblast':ARK", + }, + { + label: "Astrakhanskaya oblast'", + value: "astrakhanskaya-oblast':AST", + }, + { + label: "Belgorodskaya oblast'", + value: "belgorodskaya-oblast':BEL", + }, + { + label: "Bryanskaya oblast'", + value: "bryanskaya-oblast':BRY", + }, + { + label: "Chelyabinskaya oblast'", + value: "chelyabinskaya-oblast':CHE", + }, + { + label: "Irkutskaya oblast'", + value: "irkutskaya-oblast':IRK", + }, + { + label: "Ivanovskaya oblast'", + value: "ivanovskaya-oblast':IVA", + }, + { + label: "Kaliningradskaya oblast'", + value: "kaliningradskaya-oblast':KGD", + }, + { + label: "Kaluzhskaya oblast'", + value: "kaluzhskaya-oblast':KLU", + }, + { + label: "Kemerovskaya oblast'", + value: "kemerovskaya-oblast':KEM", + }, + { + label: "Kirovskaya oblast'", + value: "kirovskaya-oblast':KIR", + }, + { + label: "Kostromskaya oblast'", + value: "kostromskaya-oblast':KOS", + }, + { + label: "Kurganskaya oblast'", + value: "kurganskaya-oblast':KGN", + }, + { + label: "Kurskaya oblast'", + value: "kurskaya-oblast':KRS", + }, + { + label: "Leningradskaya oblast'", + value: "leningradskaya-oblast':LEN", + }, + { + label: "Lipetskaya oblast'", + value: "lipetskaya-oblast':LIP", + }, + { + label: "Magadanskaya oblast'", + value: "magadanskaya-oblast':MAG", + }, + { + label: "Moskovskaya oblast'", + value: "moskovskaya-oblast':MOS", + }, + { + label: "Murmanskaya oblast'", + value: "murmanskaya-oblast':MUR", + }, + { + label: "Nizhegorodskaya oblast'", + value: "nizhegorodskaya-oblast':NIZ", + }, + { + label: "Novgorodskaya oblast'", + value: "novgorodskaya-oblast':NGR", + }, + { + label: "Novosibirskaya oblast'", + value: "novosibirskaya-oblast':NVS", + }, + { + label: "Omskaya oblast'", + value: "omskaya-oblast':OMS", + }, + { + label: "Orenburgskaya oblast'", + value: "orenburgskaya-oblast':ORE", + }, + { + label: "Orlovskaya oblast'", + value: "orlovskaya-oblast':ORL", + }, + { + label: "Penzenskaya oblast'", + value: "penzenskaya-oblast':PNZ", + }, + { + label: "Pskovskaya oblast'", + value: "pskovskaya-oblast':PSK", + }, + { + label: "Rostovskaya oblast'", + value: "rostovskaya-oblast':ROS", + }, + { + label: "Ryazanskaya oblast'", + value: "ryazanskaya-oblast':RYA", + }, + { + label: "Sakhalinskaya oblast'", + value: "sakhalinskaya-oblast':SAK", + }, + { + label: "Samarskaya oblast'", + value: "samarskaya-oblast':SAM", + }, + { + label: "Saratovskaya oblast'", + value: "saratovskaya-oblast':SAR", + }, + { + label: "Smolenskaya oblast'", + value: "smolenskaya-oblast':SMO", + }, + { + label: "Sverdlovskaya oblast'", + value: "sverdlovskaya-oblast':SVE", + }, + { + label: "Tambovskaya oblast'", + value: "tambovskaya-oblast':TAM", + }, + { + label: "Tomskaya oblast'", + value: "tomskaya-oblast':TOM", + }, + { + label: "Tul'skaya oblast'", + value: "tul'skaya-oblast':TUL", + }, + { + label: "Tverskaya oblast'", + value: "tverskaya-oblast':TVE", + }, + { + label: "Tyumenskaya oblast'", + value: "tyumenskaya-oblast':TYU", + }, + { + label: "Ul'yanovskaya oblast'", + value: "ul'yanovskaya-oblast':ULY", + }, + { + label: "Vladimirskaya oblast'", + value: "vladimirskaya-oblast':VLA", + }, + { + label: "Volgogradskaya oblast'", + value: "volgogradskaya-oblast':VGG", + }, + { + label: "Vologodskaya oblast'", + value: "vologodskaya-oblast':VLG", + }, + { + label: "Voronezhskaya oblast'", + value: "voronezhskaya-oblast':VOR", + }, + { + label: "Yaroslavskaya oblast'", + value: "yaroslavskaya-oblast':YAR", + }, + { + label: "Altayskiy kray", + value: "altayskiy-kray:ALT", + }, + { + label: "Kamchatskiy kray", + value: "kamchatskiy-kray:KAM", + }, + { + label: "Khabarovskiy kray", + value: "khabarovskiy-kray:KHA", + }, + { + label: "Krasnodarskiy kray", + value: "krasnodarskiy-kray:KDA", + }, + { + label: "Krasnoyarskiy kray", + value: "krasnoyarskiy-kray:KYA", + }, + { + label: "Permskiy kray", + value: "permskiy-kray:PER", + }, + { + label: "Primorskiy kray", + value: "primorskiy-kray:PRI", + }, + { + label: "Stavropol'skiy kray", + value: "stavropol'skiy-kray:STA", + }, + { + label: "Zabaykal'skiy kray", + value: "zabaykal'skiy-kray:ZAB", + }, + { + label: "Moskva", + value: "moskva:MOW", + }, + { + label: "Sankt-Peterburg", + value: "sankt-peterburg:SPE", + }, + { + label: "Chukotskiy avtonomnyy okrug", + value: "chukotskiy-avtonomnyy-okrug:CHU", + }, + { + label: "Khanty-Mansiyskiy avtonomnyy okrug-Yugra", + value: "khanty-mansiyskiy-avtonomnyy-okrug-yugra:KHM", + }, + { + label: "Nenetskiy avtonomnyy okrug", + value: "nenetskiy-avtonomnyy-okrug:NEN", + }, + { + label: "Yamalo-Nenetskiy avtonomnyy okrug", + value: "yamalo-nenetskiy-avtonomnyy-okrug:YAN", + }, + { + label: "Yevreyskaya avtonomnaya oblast'", + value: "yevreyskaya-avtonomnaya-oblast':YEV", + }, + { + label: "Adygeya, Respublika", + value: "adygeya,-respublika:AD", + }, + { + label: "Altay, Respublika", + value: "altay,-respublika:AL", + }, + { + label: "Bashkortostan, Respublika", + value: "bashkortostan,-respublika:BA", + }, + { + label: "Buryatiya, Respublika", + value: "buryatiya,-respublika:BU", + }, + { + label: "Chechenskaya Respublika", + value: "chechenskaya-respublika:CE", + }, + { + label: "Chuvashskaya Respublika", + value: "chuvashskaya-respublika:CU", + }, + { + label: "Dagestan, Respublika", + value: "dagestan,-respublika:DA", + }, + { + label: "Ingushetiya, Respublika", + value: "ingushetiya,-respublika:IN", + }, + { + label: "Kabardino-Balkarskaya Respublika", + value: "kabardino-balkarskaya-respublika:KB", + }, + { + label: "Kalmykiya, Respublika", + value: "kalmykiya,-respublika:KL", + }, + { + label: "Karachayevo-Cherkesskaya Respublika", + value: "karachayevo-cherkesskaya-respublika:KC", + }, + { + label: "Kareliya, Respublika", + value: "kareliya,-respublika:KR", + }, + { + label: "Khakasiya, Respublika", + value: "khakasiya,-respublika:KK", + }, + { + label: "Komi, Respublika", + value: "komi,-respublika:KO", + }, + { + label: "Mariy El, Respublika", + value: "mariy-el,-respublika:ME", + }, + { + label: "Mordoviya, Respublika", + value: "mordoviya,-respublika:MO", + }, + { + label: "Sakha, Respublika", + value: "sakha,-respublika:SA", + }, + { + label: "Severnaya Osetiya-Alaniya, Respublika", + value: "severnaya-osetiya-alaniya,-respublika:SE", + }, + { + label: "Tatarstan, Respublika", + value: "tatarstan,-respublika:TA", + }, + { + label: "Tyva, Respublika", + value: "tyva,-respublika:TY", + }, + { + label: "Udmurtskaya Respublika", + value: "udmurtskaya-respublika:UD", + }, + ], + }, + { + label: "San Marino", + value: "san-marino", + code: "SM", + states: [ + { + label: "Acquaviva", + value: "acquaviva:01", + }, + { + label: "Borgo Maggiore", + value: "borgo-maggiore:06", + }, + { + label: "Chiesanuova", + value: "chiesanuova:02", + }, + { + label: "Domagnano", + value: "domagnano:03", + }, + { + label: "Faetano", + value: "faetano:04", + }, + { + label: "Fiorentino", + value: "fiorentino:05", + }, + { + label: "Montegiardino", + value: "montegiardino:08", + }, + { + label: "San Marino", + value: "san-marino:07", + }, + { + label: "Serravalle", + value: "serravalle:09", + }, + ], + }, + { + label: "Serbia", + value: "serbia", + code: "RS", + states: [ + { + label: "Kosovo-Metohija", + value: "kosovo-metohija:KM", + }, + { + label: "Vojvodina", + value: "vojvodina:VO", + }, + ], + }, + { + label: "Slovakia", + value: "slovakia", + code: "SK", + states: [ + { + label: "Banskobystrický kraj", + value: "banskobystrický-kraj:BC", + }, + { + label: "Bratislavský kraj", + value: "bratislavský-kraj:BL", + }, + { + label: "Košický kraj", + value: "košický-kraj:KI", + }, + { + label: "Nitriansky kraj", + value: "nitriansky-kraj:NI", + }, + { + label: "Prešovský kraj", + value: "prešovský-kraj:PV", + }, + { + label: "Trenčiansky kraj", + value: "trenčiansky-kraj:TC", + }, + { + label: "Trnavský kraj", + value: "trnavský-kraj:TA", + }, + { + label: "Žilinský kraj", + value: "žilinský-kraj:ZI", + }, + ], + }, + { + label: "Slovenia", + value: "slovenia", + code: "SI", + states: [ + { + label: "Ajdovščina", + value: "ajdovščina:001", + }, + { + label: "Apače", + value: "apače:195", + }, + { + label: "Beltinci", + value: "beltinci:002", + }, + { + label: "Benedikt", + value: "benedikt:148", + }, + { + label: "Bistrica ob Sotli", + value: "bistrica-ob-sotli:149", + }, + { + label: "Bled", + value: "bled:003", + }, + { + label: "Bloke", + value: "bloke:150", + }, + { + label: "Bohinj", + value: "bohinj:004", + }, + { + label: "Borovnica", + value: "borovnica:005", + }, + { + label: "Bovec", + value: "bovec:006", + }, + { + label: "Braslovče", + value: "braslovče:151", + }, + { + label: "Brda", + value: "brda:007", + }, + { + label: "Brezovica", + value: "brezovica:008", + }, + { + label: "Brežice", + value: "brežice:009", + }, + { + label: "Cankova", + value: "cankova:152", + }, + { + label: "Celje", + value: "celje:011", + }, + { + label: "Cerklje na Gorenjskem", + value: "cerklje-na-gorenjskem:012", + }, + { + label: "Cerknica", + value: "cerknica:013", + }, + { + label: "Cerkno", + value: "cerkno:014", + }, + { + label: "Cerkvenjak", + value: "cerkvenjak:153", + }, + { + label: "Cirkulane", + value: "cirkulane:196", + }, + { + label: "Destrnik", + value: "destrnik:018", + }, + { + label: "Divača", + value: "divača:019", + }, + { + label: "Dobje", + value: "dobje:154", + }, + { + label: "Dobrepolje", + value: "dobrepolje:020", + }, + { + label: "Dobrna", + value: "dobrna:155", + }, + { + label: "Dobrova–Polhov Gradec", + value: "dobrova–polhov-gradec:021", + }, + { + label: "Dobrovnik", + value: "dobrovnik:156", + }, + { + label: "Dol pri Ljubljani", + value: "dol-pri-ljubljani:022", + }, + { + label: "Dolenjske Toplice", + value: "dolenjske-toplice:157", + }, + { + label: "Domžale", + value: "domžale:023", + }, + { + label: "Dornava", + value: "dornava:024", + }, + { + label: "Dravograd", + value: "dravograd:025", + }, + { + label: "Duplek", + value: "duplek:026", + }, + { + label: "Gorenja vas–Poljane", + value: "gorenja-vas–poljane:027", + }, + { + label: "Gorišnica", + value: "gorišnica:028", + }, + { + label: "Gorje", + value: "gorje:207", + }, + { + label: "Gornja Radgona", + value: "gornja-radgona:029", + }, + { + label: "Gornji Grad", + value: "gornji-grad:030", + }, + { + label: "Gornji Petrovci", + value: "gornji-petrovci:031", + }, + { + label: "Grad", + value: "grad:158", + }, + { + label: "Grosuplje", + value: "grosuplje:032", + }, + { + label: "Hajdina", + value: "hajdina:159", + }, + { + label: "Hodoš", + value: "hodoš:161", + }, + { + label: "Horjul", + value: "horjul:162", + }, + { + label: "Hoče–Slivnica", + value: "hoče–slivnica:160", + }, + { + label: "Hrastnik", + value: "hrastnik:034", + }, + { + label: "Hrpelje-Kozina", + value: "hrpelje-kozina:035", + }, + { + label: "Idrija", + value: "idrija:036", + }, + { + label: "Ig", + value: "ig:037", + }, + { + label: "Ilirska Bistrica", + value: "ilirska-bistrica:038", + }, + { + label: "Ivančna Gorica", + value: "ivančna-gorica:039", + }, + { + label: "Izola", + value: "izola:040", + }, + { + label: "Jesenice", + value: "jesenice:041", + }, + { + label: "Jezersko", + value: "jezersko:163", + }, + { + label: "Juršinci", + value: "juršinci:042", + }, + { + label: "Kamnik", + value: "kamnik:043", + }, + { + label: "Kanal", + value: "kanal:044", + }, + { + label: "Kidričevo", + value: "kidričevo:045", + }, + { + label: "Kobarid", + value: "kobarid:046", + }, + { + label: "Kobilje", + value: "kobilje:047", + }, + { + label: "Komen", + value: "komen:049", + }, + { + label: "Komenda", + value: "komenda:164", + }, + { + label: "Koper", + value: "koper:050", + }, + { + label: "Kosanjevica na Krki", + value: "kosanjevica-na-krki:197", + }, + { + label: "Kostel", + value: "kostel:165", + }, + { + label: "Kozje", + value: "kozje:051", + }, + { + label: "Kočevje", + value: "kočevje:048", + }, + { + label: "Kranj", + value: "kranj:052", + }, + { + label: "Kranjska Gora", + value: "kranjska-gora:053", + }, + { + label: "Križevci", + value: "križevci:166", + }, + { + label: "Krško", + value: "krško:054", + }, + { + label: "Kungota", + value: "kungota:055", + }, + { + label: "Kuzma", + value: "kuzma:056", + }, + { + label: "Laško", + value: "laško:057", + }, + { + label: "Lenart", + value: "lenart:058", + }, + { + label: "Lendava", + value: "lendava:059", + }, + { + label: "Litija", + value: "litija:060", + }, + { + label: "Ljubljana", + value: "ljubljana:061", + }, + { + label: "Ljubno", + value: "ljubno:062", + }, + { + label: "Ljutomer", + value: "ljutomer:063", + }, + { + label: "Log-Dragomer", + value: "log-dragomer:208", + }, + { + label: "Logatec", + value: "logatec:064", + }, + { + label: "Lovrenc na Pohorju", + value: "lovrenc-na-pohorju:167", + }, + { + label: "Loška Dolina", + value: "loška-dolina:065", + }, + { + label: "Loški Potok", + value: "loški-potok:066", + }, + { + label: "Lukovica", + value: "lukovica:068", + }, + { + label: "Luče", + value: "luče:067", + }, + { + label: "Majšperk", + value: "majšperk:069", + }, + { + label: "Makole", + value: "makole:198", + }, + { + label: "Maribor", + value: "maribor:070", + }, + { + label: "Markovci", + value: "markovci:168", + }, + { + label: "Medvode", + value: "medvode:071", + }, + { + label: "Mengeš", + value: "mengeš:072", + }, + { + label: "Metlika", + value: "metlika:073", + }, + { + label: "Mežica", + value: "mežica:074", + }, + { + label: "Miklavž na Dravskem Polju", + value: "miklavž-na-dravskem-polju:169", + }, + { + label: "Miren–Kostanjevica", + value: "miren–kostanjevica:075", + }, + { + label: "Mirna Peč", + value: "mirna-peč:170", + }, + { + label: "Mislinja", + value: "mislinja:076", + }, + { + label: "Mokronog–Trebelno", + value: "mokronog–trebelno:199", + }, + { + label: "Moravske Toplice", + value: "moravske-toplice:078", + }, + { + label: "Moravče", + value: "moravče:077", + }, + { + label: "Mozirje", + value: "mozirje:079", + }, + { + label: "Murska Sobota", + value: "murska-sobota:080", + }, + { + label: "Muta", + value: "muta:081", + }, + { + label: "Naklo", + value: "naklo:082", + }, + { + label: "Nazarje", + value: "nazarje:083", + }, + { + label: "Nova Gorica", + value: "nova-gorica:084", + }, + { + label: "Novo Mesto", + value: "novo-mesto:085", + }, + { + label: "Odranci", + value: "odranci:086", + }, + { + label: "Oplotnica", + value: "oplotnica:171", + }, + { + label: "Ormož", + value: "ormož:087", + }, + { + label: "Osilnica", + value: "osilnica:088", + }, + { + label: "Pesnica", + value: "pesnica:089", + }, + { + label: "Piran", + value: "piran:090", + }, + { + label: "Pivka", + value: "pivka:091", + }, + { + label: "Podlehnik", + value: "podlehnik:172", + }, + { + label: "Podvelka", + value: "podvelka:093", + }, + { + label: "Podčetrtek", + value: "podčetrtek:092", + }, + { + label: "Poljčane", + value: "poljčane:200", + }, + { + label: "Polzela", + value: "polzela:173", + }, + { + label: "Postojna", + value: "postojna:094", + }, + { + label: "Prebold", + value: "prebold:174", + }, + { + label: "Preddvor", + value: "preddvor:095", + }, + { + label: "Prevalje", + value: "prevalje:175", + }, + { + label: "Ptuj", + value: "ptuj:096", + }, + { + label: "Puconci", + value: "puconci:097", + }, + { + label: "Radenci", + value: "radenci:100", + }, + { + label: "Radeče", + value: "radeče:099", + }, + { + label: "Radlje ob Dravi", + value: "radlje-ob-dravi:101", + }, + { + label: "Radovljica", + value: "radovljica:102", + }, + { + label: "Ravne na Koroškem", + value: "ravne-na-koroškem:103", + }, + { + label: "Razkrižje", + value: "razkrižje:176", + }, + { + label: "Rače–Fram", + value: "rače–fram:098", + }, + { + label: "Renče-Vogrsko", + value: "renče-vogrsko:201", + }, + { + label: "Rečica ob Savinji", + value: "rečica-ob-savinji:209", + }, + { + label: "Ribnica", + value: "ribnica:104", + }, + { + label: "Ribnica na Pohorju", + value: "ribnica-na-pohorju:177", + }, + { + label: "Rogatec", + value: "rogatec:107", + }, + { + label: "Rogaška Slatina", + value: "rogaška-slatina:106", + }, + { + label: "Rogašovci", + value: "rogašovci:105", + }, + { + label: "Ruše", + value: "ruše:108", + }, + { + label: "Selnica ob Dravi", + value: "selnica-ob-dravi:178", + }, + { + label: "Semič", + value: "semič:109", + }, + { + label: "Sevnica", + value: "sevnica:110", + }, + { + label: "Sežana", + value: "sežana:111", + }, + { + label: "Slovenj Gradec", + value: "slovenj-gradec:112", + }, + { + label: "Slovenska Bistrica", + value: "slovenska-bistrica:113", + }, + { + label: "Slovenske Konjice", + value: "slovenske-konjice:114", + }, + { + label: "Sodražica", + value: "sodražica:179", + }, + { + label: "Solčava", + value: "solčava:180", + }, + { + label: "Središče ob Dravi", + value: "središče-ob-dravi:202", + }, + { + label: "Starše", + value: "starše:115", + }, + { + label: "Straža", + value: "straža:203", + }, + { + label: "Sveta Ana", + value: "sveta-ana:181", + }, + { + label: "Sveta Trojica v Slovenskih Goricah", + value: "sveta-trojica-v-slovenskih-goricah:204", + }, + { + label: "Sveti Andraž v Slovenskih Goricah", + value: "sveti-andraž-v-slovenskih-goricah:182", + }, + { + label: "Sveti Jurij", + value: "sveti-jurij:116", + }, + { + label: "Sveti Jurij v Slovenskih Goricah", + value: "sveti-jurij-v-slovenskih-goricah:210", + }, + { + label: "Sveti Tomaž", + value: "sveti-tomaž:205", + }, + { + label: "Tabor", + value: "tabor:184", + }, + { + label: "Tišina", + value: "tišina:010", + }, + { + label: "Tolmin", + value: "tolmin:128", + }, + { + label: "Trbovlje", + value: "trbovlje:129", + }, + { + label: "Trebnje", + value: "trebnje:130", + }, + { + label: "Trnovska Vas", + value: "trnovska-vas:185", + }, + { + label: "Trzin", + value: "trzin:186", + }, + { + label: "Tržič", + value: "tržič:131", + }, + { + label: "Turnišče", + value: "turnišče:132", + }, + { + label: "Velenje", + value: "velenje:133", + }, + { + label: "Velika Polana", + value: "velika-polana:187", + }, + { + label: "Velike Lašče", + value: "velike-lašče:134", + }, + { + label: "Veržej", + value: "veržej:188", + }, + { + label: "Videm", + value: "videm:135", + }, + { + label: "Vipava", + value: "vipava:136", + }, + { + label: "Vitanje", + value: "vitanje:137", + }, + { + label: "Vodice", + value: "vodice:138", + }, + { + label: "Vojnik", + value: "vojnik:139", + }, + { + label: "Vransko", + value: "vransko:189", + }, + { + label: "Vrhnika", + value: "vrhnika:140", + }, + { + label: "Vuzenica", + value: "vuzenica:141", + }, + { + label: "Zagorje ob Savi", + value: "zagorje-ob-savi:142", + }, + { + label: "Zavrč", + value: "zavrč:143", + }, + { + label: "Zreče", + value: "zreče:144", + }, + { + label: "Črenšovci", + value: "črenšovci:015", + }, + { + label: "Črna na Koroškem", + value: "črna-na-koroškem:016", + }, + { + label: "Črnomelj", + value: "črnomelj:017", + }, + { + label: "Šalovci", + value: "šalovci:033", + }, + { + label: "Šempeter–Vrtojba", + value: "šempeter–vrtojba:183", + }, + { + label: "Šentilj", + value: "šentilj:118", + }, + { + label: "Šentjernej", + value: "šentjernej:119", + }, + { + label: "Šentjur", + value: "šentjur:120", + }, + { + label: "Šentrupert", + value: "šentrupert:211", + }, + { + label: "Šenčur", + value: "šenčur:117", + }, + { + label: "Škocjan", + value: "škocjan:121", + }, + { + label: "Škofja Loka", + value: "škofja-loka:122", + }, + { + label: "Škofljica", + value: "škofljica:123", + }, + { + label: "Šmarje pri Jelšah", + value: "šmarje-pri-jelšah:124", + }, + { + label: "Šmarješke Toplice", + value: "šmarješke-toplice:206", + }, + { + label: "Šmartno ob Paki", + value: "šmartno-ob-paki:125", + }, + { + label: "Šmartno pri Litiji", + value: "šmartno-pri-litiji:194", + }, + { + label: "Šoštanj", + value: "šoštanj:126", + }, + { + label: "Štore", + value: "štore:127", + }, + { + label: "Žalec", + value: "žalec:190", + }, + { + label: "Železniki", + value: "železniki:146", + }, + { + label: "Žetale", + value: "žetale:191", + }, + { + label: "Žiri", + value: "žiri:147", + }, + { + label: "Žirovnica", + value: "žirovnica:192", + }, + { + label: "Žužemberk", + value: "žužemberk:193", + }, + ], + }, + { + label: "Spain", + value: "spain", + code: "ES", + states: [ + { + label: "A Coruña", + value: "a-coruña:C", + }, + { + label: "Albacete", + value: "albacete:AB", + }, + { + label: "Alicante", + value: "alicante:A", + }, + { + label: "Almería", + value: "almería:AL", + }, + { + label: "Asturias", + value: "asturias:O", + }, + { + label: "Badajoz", + value: "badajoz:BA", + }, + { + label: "Balears", + value: "balears:PM", + }, + { + label: "Barcelona", + value: "barcelona:B", + }, + { + label: "Burgos", + value: "burgos:BU", + }, + { + label: "Cantabria", + value: "cantabria:S", + }, + { + label: "Castellón", + value: "castellón:CS", + }, + { + label: "Ciudad Real", + value: "ciudad-real:CR", + }, + { + label: "Cuenca", + value: "cuenca:CU", + }, + { + label: "Cáceres", + value: "cáceres:CC", + }, + { + label: "Cádiz", + value: "cádiz:CA", + }, + { + label: "Córdoba", + value: "córdoba:CO", + }, + { + label: "Girona", + value: "girona:GI", + }, + { + label: "Granada", + value: "granada:GR", + }, + { + label: "Guadalajara", + value: "guadalajara:GU", + }, + { + label: "Guipúzcoa", + value: "guipúzcoa:SS", + }, + { + label: "Huelva", + value: "huelva:H", + }, + { + label: "Huesca", + value: "huesca:HU", + }, + { + label: "Jaén", + value: "jaén:J", + }, + { + label: "La Rioja", + value: "la-rioja:LO", + }, + { + label: "Las Palmas", + value: "las-palmas:GC", + }, + { + label: "León", + value: "león:LE", + }, + { + label: "Lleida", + value: "lleida:L", + }, + { + label: "Lugo", + value: "lugo:LU", + }, + { + label: "Madrid", + value: "madrid:M", + }, + { + label: "Murcia", + value: "murcia:MU", + }, + { + label: "Málaga", + value: "málaga:MA", + }, + { + label: "Navarra", + value: "navarra:NA", + }, + { + label: "Ourense", + value: "ourense:OR", + }, + { + label: "Palencia", + value: "palencia:P", + }, + { + label: "Pontevedra", + value: "pontevedra:PO", + }, + { + label: "Salamanca", + value: "salamanca:SA", + }, + { + label: "Santa Cruz de Tenerife", + value: "santa-cruz-de-tenerife:TF", + }, + { + label: "Segovia", + value: "segovia:SG", + }, + { + label: "Sevilla", + value: "sevilla:SE", + }, + { + label: "Soria", + value: "soria:SO", + }, + { + label: "Tarragona", + value: "tarragona:T", + }, + { + label: "Teruel", + value: "teruel:TE", + }, + { + label: "Toledo", + value: "toledo:TO", + }, + { + label: "Valencia", + value: "valencia:V", + }, + { + label: "Valladolid", + value: "valladolid:VA", + }, + { + label: "Vizcaya", + value: "vizcaya:BI", + }, + { + label: "Zamora", + value: "zamora:ZA", + }, + { + label: "Zaragoza", + value: "zaragoza:Z", + }, + { + label: "Álava", + value: "álava:VI", + }, + { + label: "Ávila", + value: "ávila:AV", + }, + { + label: "Ceuta", + value: "ceuta:CE", + }, + { + label: "Melilla", + value: "melilla:ML", + }, + { + label: "Andalucía", + value: "andalucía:AN", + }, + { + label: "Aragón", + value: "aragón:AR", + }, + { + label: "Asturias, Principado de", + value: "asturias,-principado-de:AS", + }, + { + label: "Canarias", + value: "canarias:CN", + }, + { + label: "Cantabria", + value: "cantabria:CB", + }, + { + label: "Castilla y León", + value: "castilla-y-león:CL", + }, + { + label: "Castilla-La Mancha", + value: "castilla-la-mancha:CM", + }, + { + label: "Catalunya", + value: "catalunya:CT", + }, + { + label: "Extremadura", + value: "extremadura:EX", + }, + { + label: "Galicia", + value: "galicia:GA", + }, + { + label: "Illes Balears", + value: "illes-balears:IB", + }, + { + label: "La Rioja", + value: "la-rioja:RI", + }, + { + label: "Madrid, Comunidad de", + value: "madrid,-comunidad-de:MD", + }, + { + label: "Murcia, Región de", + value: "murcia,-región-de:MC", + }, + { + label: "Navarra, Comunidad Foral de", + value: "navarra,-comunidad-foral-de:NC", + }, + { + label: "País Vasco", + value: "país-vasco:PV", + }, + { + label: "Valenciana, Comunidad", + value: "valenciana,-comunidad:VC", + }, + ], + }, + { + label: "Svalbard and Jan Mayen", + value: "svalbard-and-jan-mayen", + code: "SJ", + states: [], + }, + { + label: "Sweden", + value: "sweden", + code: "SE", + states: [ + { + label: "Blekinge län", + value: "blekinge-län:K", + }, + { + label: "Dalarnas län", + value: "dalarnas-län:W", + }, + { + label: "Gotlands län", + value: "gotlands-län:I", + }, + { + label: "Gävleborgs län", + value: "gävleborgs-län:X", + }, + { + label: "Hallands län", + value: "hallands-län:N", + }, + { + label: "Jämtlands län", + value: "jämtlands-län:Z", + }, + { + label: "Jönköpings län", + value: "jönköpings-län:F", + }, + { + label: "Kalmar län", + value: "kalmar-län:H", + }, + { + label: "Kronobergs län", + value: "kronobergs-län:G", + }, + { + label: "Norrbottens län", + value: "norrbottens-län:BD", + }, + { + label: "Skåne län", + value: "skåne-län:M", + }, + { + label: "Stockholms län", + value: "stockholms-län:AB", + }, + { + label: "Södermanlands län", + value: "södermanlands-län:D", + }, + { + label: "Uppsala län", + value: "uppsala-län:C", + }, + { + label: "Värmlands län", + value: "värmlands-län:S", + }, + { + label: "Västerbottens län", + value: "västerbottens-län:AC", + }, + { + label: "Västernorrlands län", + value: "västernorrlands-län:Y", + }, + { + label: "Västmanlands län", + value: "västmanlands-län:U", + }, + { + label: "Västra Götalands län", + value: "västra-götalands-län:O", + }, + { + label: "Örebro län", + value: "örebro-län:T", + }, + { + label: "Östergötlands län", + value: "östergötlands-län:E", + }, + ], + }, + { + label: "Switzerland", + value: "switzerland", + code: "CH", + states: [ + { + label: "Aargau", + value: "aargau:AG", + }, + { + label: "Appenzell Ausserrhoden", + value: "appenzell-ausserrhoden:AR", + }, + { + label: "Appenzell Innerrhoden", + value: "appenzell-innerrhoden:AI", + }, + { + label: "Basel-Landschaft", + value: "basel-landschaft:BL", + }, + { + label: "Basel-Stadt", + value: "basel-stadt:BS", + }, + { + label: "Bern", + value: "bern:BE", + }, + { + label: "Fribourg", + value: "fribourg:FR", + }, + { + label: "Genève", + value: "genève:GE", + }, + { + label: "Glarus", + value: "glarus:GL", + }, + { + label: "Graubünden", + value: "graubünden:GR", + }, + { + label: "Jura", + value: "jura:JU", + }, + { + label: "Luzern", + value: "luzern:LU", + }, + { + label: "Neuchâtel", + value: "neuchâtel:NE", + }, + { + label: "Nidwalden", + value: "nidwalden:NW", + }, + { + label: "Obwalden", + value: "obwalden:OW", + }, + { + label: "Sankt Gallen", + value: "sankt-gallen:SG", + }, + { + label: "Schaffhausen", + value: "schaffhausen:SH", + }, + { + label: "Schwyz", + value: "schwyz:SZ", + }, + { + label: "Solothurn", + value: "solothurn:SO", + }, + { + label: "Thurgau", + value: "thurgau:TG", + }, + { + label: "Ticino", + value: "ticino:TI", + }, + { + label: "Uri", + value: "uri:UR", + }, + { + label: "Valais", + value: "valais:VS", + }, + { + label: "Vaud", + value: "vaud:VD", + }, + { + label: "Zug", + value: "zug:ZG", + }, + { + label: "Zürich", + value: "zürich:ZH", + }, + ], + }, + { + label: "Ukraine", + value: "ukraine", + code: "UA", + states: [ + { + label: "Avtonomna Respublika Krym", + value: "avtonomna-respublika-krym:43", + }, + { + label: "Cherkas'ka Oblast'", + value: "cherkas'ka-oblast':71", + }, + { + label: "Chernihivs'ka Oblast'", + value: "chernihivs'ka-oblast':74", + }, + { + label: "Chernivets'ka Oblast'", + value: "chernivets'ka-oblast':77", + }, + { + label: "Dnipropetrovs'ka Oblast'", + value: "dnipropetrovs'ka-oblast':12", + }, + { + label: "Donets'ka Oblast'", + value: "donets'ka-oblast':14", + }, + { + label: "Ivano-Frankivs'ka Oblast'", + value: "ivano-frankivs'ka-oblast':26", + }, + { + label: "Kharkivs'ka Oblast'", + value: "kharkivs'ka-oblast':63", + }, + { + label: "Khersons'ka Oblast'", + value: "khersons'ka-oblast':65", + }, + { + label: "Khmel'nyts'ka Oblast'", + value: "khmel'nyts'ka-oblast':68", + }, + { + label: "Kirovohrads'ka Oblast'", + value: "kirovohrads'ka-oblast':35", + }, + { + label: "Kyïv", + value: "kyïv:30", + }, + { + label: "Kyïvs'ka Oblast'", + value: "kyïvs'ka-oblast':32", + }, + { + label: "L'vivs'ka Oblast'", + value: "l'vivs'ka-oblast':46", + }, + { + label: "Luhans'ka Oblast'", + value: "luhans'ka-oblast':09", + }, + { + label: "Mykolaïvs'ka Oblast'", + value: "mykolaïvs'ka-oblast':48", + }, + { + label: "Odes'ka Oblast'", + value: "odes'ka-oblast':51", + }, + { + label: "Poltavs'ka Oblast'", + value: "poltavs'ka-oblast':53", + }, + { + label: "Rivnens'ka Oblast'", + value: "rivnens'ka-oblast':56", + }, + { + label: "Sevastopol'", + value: "sevastopol':40", + }, + { + label: "Sums'ka Oblast'", + value: "sums'ka-oblast':59", + }, + { + label: "Ternopil's'ka Oblast'", + value: "ternopil's'ka-oblast':61", + }, + { + label: "Vinnyts'ka Oblast'", + value: "vinnyts'ka-oblast':05", + }, + { + label: "Volyns'ka Oblast'", + value: "volyns'ka-oblast':07", + }, + { + label: "Zakarpats'ka Oblast'", + value: "zakarpats'ka-oblast':21", + }, + { + label: "Zaporiz'ka Oblast'", + value: "zaporiz'ka-oblast':23", + }, + { + label: "Zhytomyrs'ka Oblast'", + value: "zhytomyrs'ka-oblast':18", + }, + ], + }, + { + label: "United Kingdom", + value: "united-kingdom", + code: "GB", + states: [ + { + label: "Barking and Dagenham", + value: "barking-and-dagenham:BDG", + }, + { + label: "Barnet", + value: "barnet:BNE", + }, + { + label: "Bexley", + value: "bexley:BEX", + }, + { + label: "Brent", + value: "brent:BEN", + }, + { + label: "Bromley", + value: "bromley:BRY", + }, + { + label: "Camden", + value: "camden:CMD", + }, + { + label: "Croydon", + value: "croydon:CRY", + }, + { + label: "Ealing", + value: "ealing:EAL", + }, + { + label: "Enfield", + value: "enfield:ENF", + }, + { + label: "Greenwich", + value: "greenwich:GRE", + }, + { + label: "Hackney", + value: "hackney:HCK", + }, + { + label: "Hammersmith and Fulham", + value: "hammersmith-and-fulham:HMF", + }, + { + label: "Haringey", + value: "haringey:HRY", + }, + { + label: "Harrow", + value: "harrow:HRW", + }, + { + label: "Havering", + value: "havering:HAV", + }, + { + label: "Hillingdon", + value: "hillingdon:HIL", + }, + { + label: "Hounslow", + value: "hounslow:HNS", + }, + { + label: "Islington", + value: "islington:ISL", + }, + { + label: "Kensington and Chelsea", + value: "kensington-and-chelsea:KEC", + }, + { + label: "Kingston upon Thames", + value: "kingston-upon-thames:KTT", + }, + { + label: "Lambeth", + value: "lambeth:LBH", + }, + { + label: "Lewisham", + value: "lewisham:LEW", + }, + { + label: "Merton", + value: "merton:MRT", + }, + { + label: "Newham", + value: "newham:NWM", + }, + { + label: "Redbridge", + value: "redbridge:RDB", + }, + { + label: "Richmond upon Thames", + value: "richmond-upon-thames:RIC", + }, + { + label: "Southwark", + value: "southwark:SWK", + }, + { + label: "Sutton", + value: "sutton:STN", + }, + { + label: "Tower Hamlets", + value: "tower-hamlets:TWH", + }, + { + label: "Waltham Forest", + value: "waltham-forest:WFT", + }, + { + label: "Wandsworth", + value: "wandsworth:WND", + }, + { + label: "Westminster", + value: "westminster:WSM", + }, + { + label: "England and Wales", + value: "england-and-wales:EAW", + }, + { + label: "Great Britain", + value: "great-britain:GBN", + }, + { + label: "United Kingdom", + value: "united-kingdom:UKM", + }, + { + label: "London, City of", + value: "london,-city-of:LND", + }, + { + label: "Aberdeen City", + value: "aberdeen-city:ABE", + }, + { + label: "Aberdeenshire", + value: "aberdeenshire:ABD", + }, + { + label: "Angus", + value: "angus:ANS", + }, + { + label: "Argyll and Bute", + value: "argyll-and-bute:AGB", + }, + { + label: "Clackmannanshire", + value: "clackmannanshire:CLK", + }, + { + label: "Dumfries and Galloway", + value: "dumfries-and-galloway:DGY", + }, + { + label: "Dundee City", + value: "dundee-city:DND", + }, + { + label: "East Ayrshire", + value: "east-ayrshire:EAY", + }, + { + label: "East Dunbartonshire", + value: "east-dunbartonshire:EDU", + }, + { + label: "East Lothian", + value: "east-lothian:ELN", + }, + { + label: "East Renfrewshire", + value: "east-renfrewshire:ERW", + }, + { + label: "Edinburgh, City of", + value: "edinburgh,-city-of:EDH", + }, + { + label: "Eilean Siar", + value: "eilean-siar:ELS", + }, + { + label: "Falkirk", + value: "falkirk:FAL", + }, + { + label: "Fife", + value: "fife:FIF", + }, + { + label: "Glasgow City", + value: "glasgow-city:GLG", + }, + { + label: "Highland", + value: "highland:HLD", + }, + { + label: "Inverclyde", + value: "inverclyde:IVC", + }, + { + label: "Midlothian", + value: "midlothian:MLN", + }, + { + label: "Moray", + value: "moray:MRY", + }, + { + label: "North Ayrshire", + value: "north-ayrshire:NAY", + }, + { + label: "North Lanarkshire", + value: "north-lanarkshire:NLK", + }, + { + label: "Orkney Islands", + value: "orkney-islands:ORK", + }, + { + label: "Perth and Kinross", + value: "perth-and-kinross:PKN", + }, + { + label: "Renfrewshire", + value: "renfrewshire:RFW", + }, + { + label: "Scottish Borders, The", + value: "scottish-borders,-the:SCB", + }, + { + label: "Shetland Islands", + value: "shetland-islands:ZET", + }, + { + label: "South Ayrshire", + value: "south-ayrshire:SAY", + }, + { + label: "South Lanarkshire", + value: "south-lanarkshire:SLK", + }, + { + label: "Stirling", + value: "stirling:STG", + }, + { + label: "West Dunbartonshire", + value: "west-dunbartonshire:WDU", + }, + { + label: "West Lothian", + value: "west-lothian:WLN", + }, + { + label: "England", + value: "england:ENG", + }, + { + label: "Scotland", + value: "scotland:SCT", + }, + { + label: "Wales", + value: "wales:WLS", + }, + { + label: "Antrim", + value: "antrim:ANT", + }, + { + label: "Ards", + value: "ards:ARD", + }, + { + label: "Armagh", + value: "armagh:ARM", + }, + { + label: "Ballymena", + value: "ballymena:BLA", + }, + { + label: "Ballymoney", + value: "ballymoney:BLY", + }, + { + label: "Banbridge", + value: "banbridge:BNB", + }, + { + label: "Belfast", + value: "belfast:BFS", + }, + { + label: "Carrickfergus", + value: "carrickfergus:CKF", + }, + { + label: "Castlereagh", + value: "castlereagh:CSR", + }, + { + label: "Coleraine", + value: "coleraine:CLR", + }, + { + label: "Cookstown", + value: "cookstown:CKT", + }, + { + label: "Craigavon", + value: "craigavon:CGV", + }, + { + label: "Derry", + value: "derry:DRY", + }, + { + label: "Down", + value: "down:DOW", + }, + { + label: "Dungannon and South Tyrone", + value: "dungannon-and-south-tyrone:DGN", + }, + { + label: "Fermanagh", + value: "fermanagh:FER", + }, + { + label: "Larne", + value: "larne:LRN", + }, + { + label: "Limavady", + value: "limavady:LMV", + }, + { + label: "Lisburn", + value: "lisburn:LSB", + }, + { + label: "Magherafelt", + value: "magherafelt:MFT", + }, + { + label: "Moyle", + value: "moyle:MYL", + }, + { + label: "Newry and Mourne District", + value: "newry-and-mourne-district:NYM", + }, + { + label: "Newtownabbey", + value: "newtownabbey:NTA", + }, + { + label: "North Down", + value: "north-down:NDN", + }, + { + label: "Omagh", + value: "omagh:OMH", + }, + { + label: "Strabane", + value: "strabane:STB", + }, + { + label: "Barnsley", + value: "barnsley:BNS", + }, + { + label: "Birmingham", + value: "birmingham:BIR", + }, + { + label: "Bolton", + value: "bolton:BOL", + }, + { + label: "Bradford", + value: "bradford:BRD", + }, + { + label: "Bury", + value: "bury:BUR", + }, + { + label: "Calderdale", + value: "calderdale:CLD", + }, + { + label: "Coventry", + value: "coventry:COV", + }, + { + label: "Doncaster", + value: "doncaster:DNC", + }, + { + label: "Dudley", + value: "dudley:DUD", + }, + { + label: "Gateshead", + value: "gateshead:GAT", + }, + { + label: "Kirklees", + value: "kirklees:KIR", + }, + { + label: "Knowsley", + value: "knowsley:KWL", + }, + { + label: "Leeds", + value: "leeds:LDS", + }, + { + label: "Liverpool", + value: "liverpool:LIV", + }, + { + label: "Manchester", + value: "manchester:MAN", + }, + { + label: "Newcastle upon Tyne", + value: "newcastle-upon-tyne:NET", + }, + { + label: "North Tyneside", + value: "north-tyneside:NTY", + }, + { + label: "Oldham", + value: "oldham:OLD", + }, + { + label: "Rochdale", + value: "rochdale:RCH", + }, + { + label: "Rotherham", + value: "rotherham:ROT", + }, + { + label: "Salford", + value: "salford:SLF", + }, + { + label: "Sandwell", + value: "sandwell:SAW", + }, + { + label: "Sefton", + value: "sefton:SFT", + }, + { + label: "Sheffield", + value: "sheffield:SHF", + }, + { + label: "Solihull", + value: "solihull:SOL", + }, + { + label: "South Tyneside", + value: "south-tyneside:STY", + }, + { + label: "St. Helens", + value: "st.-helens:SHN", + }, + { + label: "Stockport", + value: "stockport:SKP", + }, + { + label: "Sunderland", + value: "sunderland:SND", + }, + { + label: "Tameside", + value: "tameside:TAM", + }, + { + label: "Trafford", + value: "trafford:TRF", + }, + { + label: "Wakefield", + value: "wakefield:WKF", + }, + { + label: "Walsall", + value: "walsall:WLL", + }, + { + label: "Wigan", + value: "wigan:WGN", + }, + { + label: "Wirral", + value: "wirral:WRL", + }, + { + label: "Wolverhampton", + value: "wolverhampton:WLV", + }, + { + label: "Northern Ireland", + value: "northern-ireland:NIR", + }, + { + label: "Buckinghamshire", + value: "buckinghamshire:BKM", + }, + { + label: "Cambridgeshire", + value: "cambridgeshire:CAM", + }, + { + label: "Cumbria", + value: "cumbria:CMA", + }, + { + label: "Derbyshire", + value: "derbyshire:DBY", + }, + { + label: "Devon", + value: "devon:DEV", + }, + { + label: "Dorset", + value: "dorset:DOR", + }, + { + label: "East Sussex", + value: "east-sussex:ESX", + }, + { + label: "Essex", + value: "essex:ESS", + }, + { + label: "Gloucestershire", + value: "gloucestershire:GLS", + }, + { + label: "Hampshire", + value: "hampshire:HAM", + }, + { + label: "Hertfordshire", + value: "hertfordshire:HRT", + }, + { + label: "Kent", + value: "kent:KEN", + }, + { + label: "Lancashire", + value: "lancashire:LAN", + }, + { + label: "Leicestershire", + value: "leicestershire:LEC", + }, + { + label: "Lincolnshire", + value: "lincolnshire:LIN", + }, + { + label: "Norfolk", + value: "norfolk:NFK", + }, + { + label: "North Yorkshire", + value: "north-yorkshire:NYK", + }, + { + label: "Northamptonshire", + value: "northamptonshire:NTH", + }, + { + label: "Nottinghamshire", + value: "nottinghamshire:NTT", + }, + { + label: "Oxfordshire", + value: "oxfordshire:OXF", + }, + { + label: "Somerset", + value: "somerset:SOM", + }, + { + label: "Staffordshire", + value: "staffordshire:STS", + }, + { + label: "Suffolk", + value: "suffolk:SFK", + }, + { + label: "Surrey", + value: "surrey:SRY", + }, + { + label: "Warwickshire", + value: "warwickshire:WAR", + }, + { + label: "West Sussex", + value: "west-sussex:WSX", + }, + { + label: "Worcestershire", + value: "worcestershire:WOR", + }, + { + label: "Bath and North East Somerset", + value: "bath-and-north-east-somerset:BAS", + }, + { + label: "Bedford", + value: "bedford:BDF", + }, + { + label: "Blackburn with Darwen", + value: "blackburn-with-darwen:BBD", + }, + { + label: "Blackpool", + value: "blackpool:BPL", + }, + { + label: "Blaenau Gwent", + value: "blaenau-gwent:BGW", + }, + { + label: "Bournemouth", + value: "bournemouth:BMH", + }, + { + label: "Bracknell Forest", + value: "bracknell-forest:BRC", + }, + { + label: "Bridgend", + value: "bridgend:BGE", + }, + { + label: "Brighton and Hove", + value: "brighton-and-hove:BNH", + }, + { + label: "Bristol, City of", + value: "bristol,-city-of:BST", + }, + { + label: "Caerphilly", + value: "caerphilly:CAY", + }, + { + label: "Cardiff", + value: "cardiff:CRF", + }, + { + label: "Carmarthenshire", + value: "carmarthenshire:CMN", + }, + { + label: "Central Bedfordshire", + value: "central-bedfordshire:CBF", + }, + { + label: "Ceredigion", + value: "ceredigion:CGN", + }, + { + label: "Cheshire East", + value: "cheshire-east:CHE", + }, + { + label: "Cheshire West and Chester", + value: "cheshire-west-and-chester:CHW", + }, + { + label: "Conwy", + value: "conwy:CWY", + }, + { + label: "Cornwall", + value: "cornwall:CON", + }, + { + label: "Darlington", + value: "darlington:DAL", + }, + { + label: "Denbighshire", + value: "denbighshire:DEN", + }, + { + label: "Derby", + value: "derby:DER", + }, + { + label: "Durham, County", + value: "durham,-county:DUR", + }, + { + label: "East Riding of Yorkshire", + value: "east-riding-of-yorkshire:ERY", + }, + { + label: "Flintshire", + value: "flintshire:FLN", + }, + { + label: "Gwynedd", + value: "gwynedd:GWN", + }, + { + label: "Halton", + value: "halton:HAL", + }, + { + label: "Hartlepool", + value: "hartlepool:HPL", + }, + { + label: "Herefordshire", + value: "herefordshire:HEF", + }, + { + label: "Isle of Anglesey", + value: "isle-of-anglesey:AGY", + }, + { + label: "Isle of Wight", + value: "isle-of-wight:IOW", + }, + { + label: "Isles of Scilly", + value: "isles-of-scilly:IOS", + }, + { + label: "Kingston upon Hull", + value: "kingston-upon-hull:KHL", + }, + { + label: "Leicester", + value: "leicester:LCE", + }, + { + label: "Luton", + value: "luton:LUT", + }, + { + label: "Medway", + value: "medway:MDW", + }, + { + label: "Merthyr Tydfil", + value: "merthyr-tydfil:MTY", + }, + { + label: "Middlesbrough", + value: "middlesbrough:MDB", + }, + { + label: "Milton Keynes", + value: "milton-keynes:MIK", + }, + { + label: "Monmouthshire", + value: "monmouthshire:MON", + }, + { + label: "Neath Port Talbot", + value: "neath-port-talbot:NTL", + }, + { + label: "Newport", + value: "newport:NWP", + }, + { + label: "North East Lincolnshire", + value: "north-east-lincolnshire:NEL", + }, + { + label: "North Lincolnshire", + value: "north-lincolnshire:NLN", + }, + { + label: "North Somerset", + value: "north-somerset:NSM", + }, + { + label: "Northumberland", + value: "northumberland:NBL", + }, + { + label: "Nottingham", + value: "nottingham:NGM", + }, + { + label: "Pembrokeshire", + value: "pembrokeshire:PEM", + }, + { + label: "Peterborough", + value: "peterborough:PTE", + }, + { + label: "Plymouth", + value: "plymouth:PLY", + }, + { + label: "Poole", + value: "poole:POL", + }, + { + label: "Portsmouth", + value: "portsmouth:POR", + }, + { + label: "Powys", + value: "powys:POW", + }, + { + label: "Reading", + value: "reading:RDG", + }, + { + label: "Redcar and Cleveland", + value: "redcar-and-cleveland:RCC", + }, + { + label: "Rhondda, Cynon, Taff", + value: "rhondda,-cynon,-taff:RCT", + }, + { + label: "Rutland", + value: "rutland:RUT", + }, + { + label: "Shropshire", + value: "shropshire:SHR", + }, + { + label: "Slough", + value: "slough:SLG", + }, + { + label: "South Gloucestershire", + value: "south-gloucestershire:SGC", + }, + { + label: "Southampton", + value: "southampton:STH", + }, + { + label: "Southend-on-Sea", + value: "southend-on-sea:SOS", + }, + { + label: "Stockton-on-Tees", + value: "stockton-on-tees:STT", + }, + { + label: "Stoke-on-Trent", + value: "stoke-on-trent:STE", + }, + { + label: "Swansea", + value: "swansea:SWA", + }, + { + label: "Swindon", + value: "swindon:SWD", + }, + { + label: "Telford and Wrekin", + value: "telford-and-wrekin:TFW", + }, + { + label: "Thurrock", + value: "thurrock:THR", + }, + { + label: "Torbay", + value: "torbay:TOB", + }, + { + label: "Torfaen", + value: "torfaen:TOF", + }, + { + label: "Vale of Glamorgan, The", + value: "vale-of-glamorgan,-the:VGL", + }, + { + label: "Warrington", + value: "warrington:WRT", + }, + { + label: "West Berkshire", + value: "west-berkshire:WBK", + }, + { + label: "Wiltshire", + value: "wiltshire:WIL", + }, + { + label: "Windsor and Maidenhead", + value: "windsor-and-maidenhead:WNM", + }, + { + label: "Wokingham", + value: "wokingham:WOK", + }, + { + label: "Wrexham", + value: "wrexham:WRX", + }, + { + label: "York", + value: "york:YOR", + }, + ], + }, + ], + }, + { + label: "North America", + value: "north-america", + countries: [ + { + label: "Anguilla", + value: "anguilla", + code: "AI", + states: [], + }, + { + label: "Antigua and Barbuda", + value: "antigua-and-barbuda", + code: "AG", + states: [ + { + label: "Barbuda", + value: "barbuda:10", + }, + { + label: "Redonda", + value: "redonda:11", + }, + { + label: "Saint George", + value: "saint-george:03", + }, + { + label: "Saint John", + value: "saint-john:04", + }, + { + label: "Saint Mary", + value: "saint-mary:05", + }, + { + label: "Saint Paul", + value: "saint-paul:06", + }, + { + label: "Saint Peter", + value: "saint-peter:07", + }, + { + label: "Saint Philip", + value: "saint-philip:08", + }, + ], + }, + { + label: "Aruba", + value: "aruba", + code: "AW", + states: [], + }, + { + label: "The Bahamas", + value: "the-bahamas", + code: "BS", + states: [ + { + label: "Acklins", + value: "acklins:AK", + }, + { + label: "Berry Islands", + value: "berry-islands:BY", + }, + { + label: "Bimini", + value: "bimini:BI", + }, + { + label: "Black Point", + value: "black-point:BP", + }, + { + label: "Cat Island", + value: "cat-island:CI", + }, + { + label: "Central Abaco", + value: "central-abaco:CO", + }, + { + label: "Central Andros", + value: "central-andros:CS", + }, + { + label: "Central Eleuthera", + value: "central-eleuthera:CE", + }, + { + label: "City of Freeport", + value: "city-of-freeport:FP", + }, + { + label: "Crooked Island and Long Cay", + value: "crooked-island-and-long-cay:CK", + }, + { + label: "East Grand Bahama", + value: "east-grand-bahama:EG", + }, + { + label: "Exuma", + value: "exuma:EX", + }, + { + label: "Grand Cay", + value: "grand-cay:GC", + }, + { + label: "Harbour Island", + value: "harbour-island:HI", + }, + { + label: "Hope Town", + value: "hope-town:HT", + }, + { + label: "Inagua", + value: "inagua:IN", + }, + { + label: "Long Island", + value: "long-island:LI", + }, + { + label: "Mangrove Cay", + value: "mangrove-cay:MC", + }, + { + label: "Mayaguana", + value: "mayaguana:MG", + }, + { + label: "Moores Island", + value: "moores-island:MI", + }, + { + label: "North Abaco", + value: "north-abaco:NO", + }, + { + label: "North Andros", + value: "north-andros:NS", + }, + { + label: "North Eleuthera", + value: "north-eleuthera:NE", + }, + { + label: "Ragged Island", + value: "ragged-island:RI", + }, + { + label: "Rum Cay", + value: "rum-cay:RC", + }, + { + label: "San Salvador", + value: "san-salvador:SS", + }, + { + label: "South Abaco", + value: "south-abaco:SO", + }, + { + label: "South Andros", + value: "south-andros:SA", + }, + { + label: "South Eleuthera", + value: "south-eleuthera:SE", + }, + { + label: "Spanish Wells", + value: "spanish-wells:SW", + }, + { + label: "West Grand Bahama", + value: "west-grand-bahama:WG", + }, + ], + }, + { + label: "Barbados", + value: "barbados", + code: "BB", + states: [ + { + label: "Christ Church", + value: "christ-church:01", + }, + { + label: "Saint Andrew", + value: "saint-andrew:02", + }, + { + label: "Saint George", + value: "saint-george:03", + }, + { + label: "Saint James", + value: "saint-james:04", + }, + { + label: "Saint John", + value: "saint-john:05", + }, + { + label: "Saint Joseph", + value: "saint-joseph:06", + }, + { + label: "Saint Lucy", + value: "saint-lucy:07", + }, + { + label: "Saint Michael", + value: "saint-michael:08", + }, + { + label: "Saint Peter", + value: "saint-peter:09", + }, + { + label: "Saint Philip", + value: "saint-philip:10", + }, + { + label: "Saint Thomas", + value: "saint-thomas:11", + }, + ], + }, + { + label: "Belize", + value: "belize", + code: "BZ", + states: [ + { + label: "Belize", + value: "belize:BZ", + }, + { + label: "Cayo", + value: "cayo:CY", + }, + { + label: "Corozal", + value: "corozal:CZL", + }, + { + label: "Orange Walk", + value: "orange-walk:OW", + }, + { + label: "Stann Creek", + value: "stann-creek:SC", + }, + { + label: "Toledo", + value: "toledo:TOL", + }, + ], + }, + { + label: "Bermuda", + value: "bermuda", + code: "BM", + states: [], + }, + { + label: "Bonaire", + value: "bonaire", + code: "BQ", + states: [], + }, + { + label: "United States Minor Outlying Islands", + value: "united-states-minor-outlying-islands", + code: "UM", + states: [ + { + label: "Baker Island", + value: "baker-island:81", + }, + { + label: "Howland Island", + value: "howland-island:84", + }, + { + label: "Jarvis Island", + value: "jarvis-island:86", + }, + { + label: "Johnston Atoll", + value: "johnston-atoll:67", + }, + { + label: "Kingman Reef", + value: "kingman-reef:89", + }, + { + label: "Midway Islands", + value: "midway-islands:71", + }, + { + label: "Navassa Island", + value: "navassa-island:76", + }, + { + label: "Palmyra Atoll", + value: "palmyra-atoll:95", + }, + { + label: "Wake Island", + value: "wake-island:79", + }, + ], + }, + { + label: "Virgin Islands (British)", + value: "virgin-islands-(british)", + code: "VG", + states: [], + }, + { + label: "Virgin Islands (U.S.)", + value: "virgin-islands-(u.s.)", + code: "VI", + states: [], + }, + { + label: "Canada", + value: "canada", + code: "CA", + states: [ + { + label: "Alberta", + value: "alberta:AB", + }, + { + label: "British Columbia", + value: "british-columbia:BC", + }, + { + label: "Manitoba", + value: "manitoba:MB", + }, + { + label: "New Brunswick", + value: "new-brunswick:NB", + }, + { + label: "Newfoundland and Labrador", + value: "newfoundland-and-labrador:NL", + }, + { + label: "Nova Scotia", + value: "nova-scotia:NS", + }, + { + label: "Ontario", + value: "ontario:ON", + }, + { + label: "Prince Edward Island", + value: "prince-edward-island:PE", + }, + { + label: "Quebec", + value: "quebec:QC", + }, + { + label: "Saskatchewan", + value: "saskatchewan:SK", + }, + { + label: "Northwest Territories", + value: "northwest-territories:NT", + }, + { + label: "Nunavut", + value: "nunavut:NU", + }, + { + label: "Yukon", + value: "yukon:YT", + }, + ], + }, + { + label: "Cayman Islands", + value: "cayman-islands", + code: "KY", + states: [], + }, + { + label: "Costa Rica", + value: "costa-rica", + code: "CR", + states: [ + { + label: "Alajuela", + value: "alajuela:A", + }, + { + label: "Cartago", + value: "cartago:C", + }, + { + label: "Guanacaste", + value: "guanacaste:G", + }, + { + label: "Heredia", + value: "heredia:H", + }, + { + label: "Limón", + value: "limón:L", + }, + { + label: "Puntarenas", + value: "puntarenas:P", + }, + { + label: "San José", + value: "san-josé:SJ", + }, + ], + }, + { + label: "Cuba", + value: "cuba", + code: "CU", + states: [ + { + label: "Artemisa", + value: "artemisa:15", + }, + { + label: "Camagüey", + value: "camagüey:09", + }, + { + label: "Ciego de Ávila", + value: "ciego-de-ávila:08", + }, + { + label: "Cienfuegos", + value: "cienfuegos:06", + }, + { + label: "Granma", + value: "granma:12", + }, + { + label: "Guantánamo", + value: "guantánamo:14", + }, + { + label: "Holguín", + value: "holguín:11", + }, + { + label: "Isla de la Juventud", + value: "isla-de-la-juventud:99", + }, + { + label: "La Habana", + value: "la-habana:03", + }, + { + label: "Las Tunas", + value: "las-tunas:10", + }, + { + label: "Matanzas", + value: "matanzas:04", + }, + { + label: "Mayabeque", + value: "mayabeque:16", + }, + { + label: "Pinar del Río", + value: "pinar-del-río:01", + }, + { + label: "Sancti Spíritus", + value: "sancti-spíritus:07", + }, + { + label: "Santiago de Cuba", + value: "santiago-de-cuba:13", + }, + { + label: "Villa Clara", + value: "villa-clara:05", + }, + ], + }, + { + label: "Curaçao", + value: "curaçao", + code: "CW", + states: [], + }, + { + label: "Dominica", + value: "dominica", + code: "DM", + states: [ + { + label: "Saint Andrew", + value: "saint-andrew:02", + }, + { + label: "Saint David", + value: "saint-david:03", + }, + { + label: "Saint George", + value: "saint-george:04", + }, + { + label: "Saint John", + value: "saint-john:05", + }, + { + label: "Saint Joseph", + value: "saint-joseph:06", + }, + { + label: "Saint Luke", + value: "saint-luke:07", + }, + { + label: "Saint Mark", + value: "saint-mark:08", + }, + { + label: "Saint Patrick", + value: "saint-patrick:09", + }, + { + label: "Saint Paul", + value: "saint-paul:10", + }, + { + label: "Saint Peter", + value: "saint-peter:11", + }, + ], + }, + { + label: "Dominican Republic", + value: "dominican-republic", + code: "DO", + states: [ + { + label: "Cibao Nordeste", + value: "cibao-nordeste:33", + }, + { + label: "Cibao Noroeste", + value: "cibao-noroeste:34", + }, + { + label: "Cibao Norte", + value: "cibao-norte:35", + }, + { + label: "Cibao Sur", + value: "cibao-sur:36", + }, + { + label: "El Valle", + value: "el-valle:37", + }, + { + label: "Enriquillo", + value: "enriquillo:38", + }, + { + label: "Higuamo", + value: "higuamo:39", + }, + { + label: "Ozama", + value: "ozama:40", + }, + { + label: "Valdesia", + value: "valdesia:41", + }, + { + label: "Yuma", + value: "yuma:42", + }, + ], + }, + { + label: "El Salvador", + value: "el-salvador", + code: "SV", + states: [ + { + label: "Ahuachapán", + value: "ahuachapán:AH", + }, + { + label: "Cabañas", + value: "cabañas:CA", + }, + { + label: "Chalatenango", + value: "chalatenango:CH", + }, + { + label: "Cuscatlán", + value: "cuscatlán:CU", + }, + { + label: "La Libertad", + value: "la-libertad:LI", + }, + { + label: "La Paz", + value: "la-paz:PA", + }, + { + label: "La Unión", + value: "la-unión:UN", + }, + { + label: "Morazán", + value: "morazán:MO", + }, + { + label: "San Miguel", + value: "san-miguel:SM", + }, + { + label: "San Salvador", + value: "san-salvador:SS", + }, + { + label: "San Vicente", + value: "san-vicente:SV", + }, + { + label: "Santa Ana", + value: "santa-ana:SA", + }, + { + label: "Sonsonate", + value: "sonsonate:SO", + }, + { + label: "Usulután", + value: "usulután:US", + }, + ], + }, + { + label: "Greenland", + value: "greenland", + code: "GL", + states: [ + { + label: "Kommune Kujalleq", + value: "kommune-kujalleq:KU", + }, + { + label: "Kommuneqarfik Sermersooq", + value: "kommuneqarfik-sermersooq:SM", + }, + { + label: "Qaasuitsup Kommunia", + value: "qaasuitsup-kommunia:QA", + }, + { + label: "Qeqqata Kommunia", + value: "qeqqata-kommunia:QE", + }, + ], + }, + { + label: "Grenada", + value: "grenada", + code: "GD", + states: [ + { + label: "Saint Andrew", + value: "saint-andrew:01", + }, + { + label: "Saint David", + value: "saint-david:02", + }, + { + label: "Saint George", + value: "saint-george:03", + }, + { + label: "Saint John", + value: "saint-john:04", + }, + { + label: "Saint Mark", + value: "saint-mark:05", + }, + { + label: "Saint Patrick", + value: "saint-patrick:06", + }, + { + label: "Southern Grenadine Islands", + value: "southern-grenadine-islands:10", + }, + ], + }, + { + label: "Guadeloupe", + value: "guadeloupe", + code: "GP", + states: [], + }, + { + label: "Guatemala", + value: "guatemala", + code: "GT", + states: [ + { + label: "Alta Verapaz", + value: "alta-verapaz:AV", + }, + { + label: "Baja Verapaz", + value: "baja-verapaz:BV", + }, + { + label: "Chimaltenango", + value: "chimaltenango:CM", + }, + { + label: "Chiquimula", + value: "chiquimula:CQ", + }, + { + label: "El Progreso", + value: "el-progreso:PR", + }, + { + label: "Escuintla", + value: "escuintla:ES", + }, + { + label: "Guatemala", + value: "guatemala:GU", + }, + { + label: "Huehuetenango", + value: "huehuetenango:HU", + }, + { + label: "Izabal", + value: "izabal:IZ", + }, + { + label: "Jalapa", + value: "jalapa:JA", + }, + { + label: "Jutiapa", + value: "jutiapa:JU", + }, + { + label: "Petén", + value: "petén:PE", + }, + { + label: "Quetzaltenango", + value: "quetzaltenango:QZ", + }, + { + label: "Quiché", + value: "quiché:QC", + }, + { + label: "Retalhuleu", + value: "retalhuleu:RE", + }, + { + label: "Sacatepéquez", + value: "sacatepéquez:SA", + }, + { + label: "San Marcos", + value: "san-marcos:SM", + }, + { + label: "Santa Rosa", + value: "santa-rosa:SR", + }, + { + label: "Sololá", + value: "sololá:SO", + }, + { + label: "Suchitepéquez", + value: "suchitepéquez:SU", + }, + { + label: "Totonicapán", + value: "totonicapán:TO", + }, + { + label: "Zacapa", + value: "zacapa:ZA", + }, + ], + }, + { + label: "Haiti", + value: "haiti", + code: "HT", + states: [ + { + label: "Artibonite", + value: "artibonite:AR", + }, + { + label: "Centre", + value: "centre:CE", + }, + { + label: "Grande-Anse", + value: "grande-anse:GA", + }, + { + label: "Nippes", + value: "nippes:NI", + }, + { + label: "Nord", + value: "nord:ND", + }, + { + label: "Nord-Est", + value: "nord-est:NE", + }, + { + label: "Nord-Ouest", + value: "nord-ouest:NO", + }, + { + label: "Ouest", + value: "ouest:OU", + }, + { + label: "Sud", + value: "sud:SD", + }, + { + label: "Sud-Est", + value: "sud-est:SE", + }, + ], + }, + { + label: "Honduras", + value: "honduras", + code: "HN", + states: [ + { + label: "Atlántida", + value: "atlántida:AT", + }, + { + label: "Choluteca", + value: "choluteca:CH", + }, + { + label: "Colón", + value: "colón:CL", + }, + { + label: "Comayagua", + value: "comayagua:CM", + }, + { + label: "Copán", + value: "copán:CP", + }, + { + label: "Cortés", + value: "cortés:CR", + }, + { + label: "El Paraíso", + value: "el-paraíso:EP", + }, + { + label: "Francisco Morazán", + value: "francisco-morazán:FM", + }, + { + label: "Gracias a Dios", + value: "gracias-a-dios:GD", + }, + { + label: "Intibucá", + value: "intibucá:IN", + }, + { + label: "Islas de la Bahía", + value: "islas-de-la-bahía:IB", + }, + { + label: "La Paz", + value: "la-paz:LP", + }, + { + label: "Lempira", + value: "lempira:LE", + }, + { + label: "Ocotepeque", + value: "ocotepeque:OC", + }, + { + label: "Olancho", + value: "olancho:OL", + }, + { + label: "Santa Bárbara", + value: "santa-bárbara:SB", + }, + { + label: "Valle", + value: "valle:VA", + }, + { + label: "Yoro", + value: "yoro:YO", + }, + ], + }, + { + label: "Jamaica", + value: "jamaica", + code: "JM", + states: [ + { + label: "Clarendon", + value: "clarendon:13", + }, + { + label: "Hanover", + value: "hanover:09", + }, + { + label: "Kingston", + value: "kingston:01", + }, + { + label: "Manchester", + value: "manchester:12", + }, + { + label: "Portland", + value: "portland:04", + }, + { + label: "Saint Andrew", + value: "saint-andrew:02", + }, + { + label: "Saint Ann", + value: "saint-ann:06", + }, + { + label: "Saint Catherine", + value: "saint-catherine:14", + }, + { + label: "Saint Elizabeth", + value: "saint-elizabeth:11", + }, + { + label: "Saint James", + value: "saint-james:08", + }, + { + label: "Saint Mary", + value: "saint-mary:05", + }, + { + label: "Saint Thomas", + value: "saint-thomas:03", + }, + { + label: "Trelawny", + value: "trelawny:07", + }, + { + label: "Westmoreland", + value: "westmoreland:10", + }, + ], + }, + { + label: "Martinique", + value: "martinique", + code: "MQ", + states: [], + }, + { + label: "Mexico", + value: "mexico", + code: "MX", + states: [ + { + label: "Distrito Federal", + value: "distrito-federal:DIF", + }, + { + label: "Aguascalientes", + value: "aguascalientes:AGU", + }, + { + label: "Baja California", + value: "baja-california:BCN", + }, + { + label: "Baja California Sur", + value: "baja-california-sur:BCS", + }, + { + label: "Campeche", + value: "campeche:CAM", + }, + { + label: "Chiapas", + value: "chiapas:CHP", + }, + { + label: "Chihuahua", + value: "chihuahua:CHH", + }, + { + label: "Coahuila", + value: "coahuila:COA", + }, + { + label: "Colima", + value: "colima:COL", + }, + { + label: "Durango", + value: "durango:DUR", + }, + { + label: "Guanajuato", + value: "guanajuato:GUA", + }, + { + label: "Guerrero", + value: "guerrero:GRO", + }, + { + label: "Hidalgo", + value: "hidalgo:HID", + }, + { + label: "Jalisco", + value: "jalisco:JAL", + }, + { + label: "Michoacán", + value: "michoacán:MIC", + }, + { + label: "Morelos", + value: "morelos:MOR", + }, + { + label: "México", + value: "méxico:MEX", + }, + { + label: "Nayarit", + value: "nayarit:NAY", + }, + { + label: "Nuevo León", + value: "nuevo-león:NLE", + }, + { + label: "Oaxaca", + value: "oaxaca:OAX", + }, + { + label: "Puebla", + value: "puebla:PUE", + }, + { + label: "Querétaro", + value: "querétaro:QUE", + }, + { + label: "Quintana Roo", + value: "quintana-roo:ROO", + }, + { + label: "San Luis Potosí", + value: "san-luis-potosí:SLP", + }, + { + label: "Sinaloa", + value: "sinaloa:SIN", + }, + { + label: "Sonora", + value: "sonora:SON", + }, + { + label: "Tabasco", + value: "tabasco:TAB", + }, + { + label: "Tamaulipas", + value: "tamaulipas:TAM", + }, + { + label: "Tlaxcala", + value: "tlaxcala:TLA", + }, + { + label: "Veracruz", + value: "veracruz:VER", + }, + { + label: "Yucatán", + value: "yucatán:YUC", + }, + { + label: "Zacatecas", + value: "zacatecas:ZAC", + }, + ], + }, + { + label: "Montserrat", + value: "montserrat", + code: "MS", + states: [], + }, + { + label: "Nicaragua", + value: "nicaragua", + code: "NI", + states: [ + { + label: "Atlántico Norte", + value: "atlántico-norte:AN", + }, + { + label: "Atlántico Sur", + value: "atlántico-sur:AS", + }, + { + label: "Boaco", + value: "boaco:BO", + }, + { + label: "Carazo", + value: "carazo:CA", + }, + { + label: "Chinandega", + value: "chinandega:CI", + }, + { + label: "Chontales", + value: "chontales:CO", + }, + { + label: "Estelí", + value: "estelí:ES", + }, + { + label: "Granada", + value: "granada:GR", + }, + { + label: "Jinotega", + value: "jinotega:JI", + }, + { + label: "León", + value: "león:LE", + }, + { + label: "Madriz", + value: "madriz:MD", + }, + { + label: "Managua", + value: "managua:MN", + }, + { + label: "Masaya", + value: "masaya:MS", + }, + { + label: "Matagalpa", + value: "matagalpa:MT", + }, + { + label: "Nueva Segovia", + value: "nueva-segovia:NS", + }, + { + label: "Rivas", + value: "rivas:RI", + }, + { + label: "Río San Juan", + value: "río-san-juan:SJ", + }, + ], + }, + { + label: "Panama", + value: "panama", + code: "PA", + states: [ + { + label: "Bocas del Toro", + value: "bocas-del-toro:1", + }, + { + label: "Chiriquí", + value: "chiriquí:4", + }, + { + label: "Coclé", + value: "coclé:2", + }, + { + label: "Colón", + value: "colón:3", + }, + { + label: "Darién", + value: "darién:5", + }, + { + label: "Emberá", + value: "emberá:EM", + }, + { + label: "Herrera", + value: "herrera:6", + }, + { + label: "Kuna Yala", + value: "kuna-yala:KY", + }, + { + label: "Los Santos", + value: "los-santos:7", + }, + { + label: "Ngöbe-Buglé", + value: "ngöbe-buglé:NB", + }, + { + label: "Panamá", + value: "panamá:8", + }, + { + label: "Panamá Oeste", + value: "panamá-oeste:10", + }, + { + label: "Veraguas", + value: "veraguas:9", + }, + ], + }, + { + label: "Puerto Rico", + value: "puerto-rico", + code: "PR", + states: [], + }, + { + label: "Saint Barthélemy", + value: "saint-barthélemy", + code: "BL", + states: [], + }, + { + label: "Saint Kitts and Nevis", + value: "saint-kitts-and-nevis", + code: "KN", + states: [ + { + label: "Nevis", + value: "nevis:N", + }, + { + label: "Saint Kitts", + value: "saint-kitts:K", + }, + ], + }, + { + label: "Saint Lucia", + value: "saint-lucia", + code: "LC", + states: [ + { + label: "Anse la Raye", + value: "anse-la-raye:01", + }, + { + label: "Castries", + value: "castries:02", + }, + { + label: "Choiseul", + value: "choiseul:03", + }, + { + label: "Dauphin", + value: "dauphin:04", + }, + { + label: "Dennery", + value: "dennery:05", + }, + { + label: "Gros Islet", + value: "gros-islet:06", + }, + { + label: "Laborie", + value: "laborie:07", + }, + { + label: "Micoud", + value: "micoud:08", + }, + { + label: "Praslin", + value: "praslin:09", + }, + { + label: "Soufrière", + value: "soufrière:10", + }, + { + label: "Vieux Fort", + value: "vieux-fort:11", + }, + ], + }, + { + label: "Saint Martin", + value: "saint-martin", + code: "MF", + states: [], + }, + { + label: "Saint Pierre and Miquelon", + value: "saint-pierre-and-miquelon", + code: "PM", + states: [], + }, + { + label: "Saint Vincent and the Grenadines", + value: "saint-vincent-and-the-grenadines", + code: "VC", + states: [ + { + label: "Charlotte", + value: "charlotte:01", + }, + { + label: "Grenadines", + value: "grenadines:06", + }, + { + label: "Saint Andrew", + value: "saint-andrew:02", + }, + { + label: "Saint David", + value: "saint-david:03", + }, + { + label: "Saint George", + value: "saint-george:04", + }, + { + label: "Saint Patrick", + value: "saint-patrick:05", + }, + ], + }, + { + label: "Sint Maarten", + value: "sint-maarten", + code: "SX", + states: [], + }, + { + label: "Trinidad and Tobago", + value: "trinidad-and-tobago", + code: "TT", + states: [ + { + label: "Arima", + value: "arima:ARI", + }, + { + label: "Chaguanas", + value: "chaguanas:CHA", + }, + { + label: "Couva-Tabaquite-Talparo", + value: "couva-tabaquite-talparo:CTT", + }, + { + label: "Diego Martin", + value: "diego-martin:DMN", + }, + { + label: "Eastern Tobago", + value: "eastern-tobago:ETO", + }, + { + label: "Penal-Debe", + value: "penal-debe:PED", + }, + { + label: "Point Fortin", + value: "point-fortin:PTF", + }, + { + label: "Port of Spain", + value: "port-of-spain:POS", + }, + { + label: "Princes Town", + value: "princes-town:PRT", + }, + { + label: "Rio Claro-Mayaro", + value: "rio-claro-mayaro:RCM", + }, + { + label: "San Fernando", + value: "san-fernando:SFO", + }, + { + label: "San Juan-Laventille", + value: "san-juan-laventille:SJL", + }, + { + label: "Sangre Grande", + value: "sangre-grande:SGE", + }, + { + label: "Siparia", + value: "siparia:SIP", + }, + { + label: "Tunapuna-Piarco", + value: "tunapuna-piarco:TUP", + }, + { + label: "Western Tobago", + value: "western-tobago:WTO", + }, + ], + }, + { + label: "Turks and Caicos Islands", + value: "turks-and-caicos-islands", + code: "TC", + states: [], + }, + { + label: "United States", + value: "united-states", + code: "US", + states: [ + { + label: "District of Columbia", + value: "district-of-columbia:DC", + }, + { + label: "American Samoa", + value: "american-samoa:AS", + }, + { + label: "Guam", + value: "guam:GU", + }, + { + label: "Northern Mariana Islands", + value: "northern-mariana-islands:MP", + }, + { + label: "Puerto Rico", + value: "puerto-rico:PR", + }, + { + label: "United States Minor Outlying Islands", + value: "united-states-minor-outlying-islands:UM", + }, + { + label: "Virgin Islands, U.S.", + value: "virgin-islands,-u.s.:VI", + }, + { + label: "Alabama", + value: "alabama:AL", + }, + { + label: "Alaska", + value: "alaska:AK", + }, + { + label: "Arizona", + value: "arizona:AZ", + }, + { + label: "Arkansas", + value: "arkansas:AR", + }, + { + label: "California", + value: "california:CA", + }, + { + label: "Colorado", + value: "colorado:CO", + }, + { + label: "Connecticut", + value: "connecticut:CT", + }, + { + label: "Delaware", + value: "delaware:DE", + }, + { + label: "Florida", + value: "florida:FL", + }, + { + label: "Georgia", + value: "georgia:GA", + }, + { + label: "Hawaii", + value: "hawaii:HI", + }, + { + label: "Idaho", + value: "idaho:ID", + }, + { + label: "Illinois", + value: "illinois:IL", + }, + { + label: "Indiana", + value: "indiana:IN", + }, + { + label: "Iowa", + value: "iowa:IA", + }, + { + label: "Kansas", + value: "kansas:KS", + }, + { + label: "Kentucky", + value: "kentucky:KY", + }, + { + label: "Louisiana", + value: "louisiana:LA", + }, + { + label: "Maine", + value: "maine:ME", + }, + { + label: "Maryland", + value: "maryland:MD", + }, + { + label: "Massachusetts", + value: "massachusetts:MA", + }, + { + label: "Michigan", + value: "michigan:MI", + }, + { + label: "Minnesota", + value: "minnesota:MN", + }, + { + label: "Mississippi", + value: "mississippi:MS", + }, + { + label: "Missouri", + value: "missouri:MO", + }, + { + label: "Montana", + value: "montana:MT", + }, + { + label: "Nebraska", + value: "nebraska:NE", + }, + { + label: "Nevada", + value: "nevada:NV", + }, + { + label: "New Hampshire", + value: "new-hampshire:NH", + }, + { + label: "New Jersey", + value: "new-jersey:NJ", + }, + { + label: "New Mexico", + value: "new-mexico:NM", + }, + { + label: "New York", + value: "new-york:NY", + }, + { + label: "North Carolina", + value: "north-carolina:NC", + }, + { + label: "North Dakota", + value: "north-dakota:ND", + }, + { + label: "Ohio", + value: "ohio:OH", + }, + { + label: "Oklahoma", + value: "oklahoma:OK", + }, + { + label: "Oregon", + value: "oregon:OR", + }, + { + label: "Pennsylvania", + value: "pennsylvania:PA", + }, + { + label: "Rhode Island", + value: "rhode-island:RI", + }, + { + label: "South Carolina", + value: "south-carolina:SC", + }, + { + label: "South Dakota", + value: "south-dakota:SD", + }, + { + label: "Tennessee", + value: "tennessee:TN", + }, + { + label: "Texas", + value: "texas:TX", + }, + { + label: "Utah", + value: "utah:UT", + }, + { + label: "Vermont", + value: "vermont:VT", + }, + { + label: "Virginia", + value: "virginia:VA", + }, + { + label: "Washington", + value: "washington:WA", + }, + { + label: "West Virginia", + value: "west-virginia:WV", + }, + { + label: "Wisconsin", + value: "wisconsin:WI", + }, + { + label: "Wyoming", + value: "wyoming:WY", + }, + ], + }, + ], + }, + { + label: "Oceania", + value: "oceania", + countries: [ + { + label: "American Samoa", + value: "american-samoa", + code: "AS", + states: [], + }, + { + label: "Australia", + value: "australia", + code: "AU", + states: [ + { + label: "Australian Capital Territory", + value: "australian-capital-territory:ACT", + }, + { + label: "New South Wales", + value: "new-south-wales:NSW", + }, + { + label: "Northern Territory", + value: "northern-territory:NT", + }, + { + label: "Queensland", + value: "queensland:QLD", + }, + { + label: "South Australia", + value: "south-australia:SA", + }, + { + label: "Tasmania", + value: "tasmania:TAS", + }, + { + label: "Victoria", + value: "victoria:VIC", + }, + { + label: "Western Australia", + value: "western-australia:WA", + }, + ], + }, + { + label: "Christmas Island", + value: "christmas-island", + code: "CX", + states: [], + }, + { + label: "Cocos (Keeling) Islands", + value: "cocos-(keeling)-islands", + code: "CC", + states: [], + }, + { + label: "Cook Islands", + value: "cook-islands", + code: "CK", + states: [], + }, + { + label: "Fiji", + value: "fiji", + code: "FJ", + states: [ + { + label: "Central", + value: "central:C", + }, + { + label: "Eastern", + value: "eastern:E", + }, + { + label: "Northern", + value: "northern:N", + }, + { + label: "Rotuma", + value: "rotuma:R", + }, + { + label: "Western", + value: "western:W", + }, + ], + }, + { + label: "French Polynesia", + value: "french-polynesia", + code: "PF", + states: [], + }, + { + label: "Guam", + value: "guam", + code: "GU", + states: [], + }, + { + label: "Kiribati", + value: "kiribati", + code: "KI", + states: [ + { + label: "Gilbert Islands", + value: "gilbert-islands:G", + }, + { + label: "Line Islands", + value: "line-islands:L", + }, + { + label: "Phoenix Islands", + value: "phoenix-islands:P", + }, + ], + }, + { + label: "Marshall Islands", + value: "marshall-islands", + code: "MH", + states: [ + { + label: "Ralik chain", + value: "ralik-chain:L", + }, + { + label: "Ratak chain", + value: "ratak-chain:T", + }, + ], + }, + { + label: "Federated States of Micronesia", + value: "federated-states-of-micronesia", + code: "FM", + states: [ + { + label: "Chuuk", + value: "chuuk:TRK", + }, + { + label: "Kosrae", + value: "kosrae:KSA", + }, + { + label: "Pohnpei", + value: "pohnpei:PNI", + }, + { + label: "Yap", + value: "yap:YAP", + }, + ], + }, + { + label: "Nauru", + value: "nauru", + code: "NR", + states: [ + { + label: "Aiwo", + value: "aiwo:01", + }, + { + label: "Anabar", + value: "anabar:02", + }, + { + label: "Anetan", + value: "anetan:03", + }, + { + label: "Anibare", + value: "anibare:04", + }, + { + label: "Baiti", + value: "baiti:05", + }, + { + label: "Boe", + value: "boe:06", + }, + { + label: "Buada", + value: "buada:07", + }, + { + label: "Denigomodu", + value: "denigomodu:08", + }, + { + label: "Ewa", + value: "ewa:09", + }, + { + label: "Ijuw", + value: "ijuw:10", + }, + { + label: "Meneng", + value: "meneng:11", + }, + { + label: "Nibok", + value: "nibok:12", + }, + { + label: "Uaboe", + value: "uaboe:13", + }, + { + label: "Yaren", + value: "yaren:14", + }, + ], + }, + { + label: "New Caledonia", + value: "new-caledonia", + code: "NC", + states: [], + }, + { + label: "New Zealand", + value: "new-zealand", + code: "NZ", + states: [ + { + label: "North Island", + value: "north-island:N", + }, + { + label: "South Island", + value: "south-island:S", + }, + { + label: "Auckland", + value: "auckland:AUK", + }, + { + label: "Bay of Plenty", + value: "bay-of-plenty:BOP", + }, + { + label: "Canterbury", + value: "canterbury:CAN", + }, + { + label: "Hawke's Bay", + value: "hawke's-bay:HKB", + }, + { + label: "Manawatu-Wanganui", + value: "manawatu-wanganui:MWT", + }, + { + label: "Northland", + value: "northland:NTL", + }, + { + label: "Otago", + value: "otago:OTA", + }, + { + label: "Southland", + value: "southland:STL", + }, + { + label: "Taranaki", + value: "taranaki:TKI", + }, + { + label: "Waikato", + value: "waikato:WKO", + }, + { + label: "Wellington", + value: "wellington:WGN", + }, + { + label: "West Coast", + value: "west-coast:WTC", + }, + { + label: "Chatham Islands Territory", + value: "chatham-islands-territory:CIT", + }, + { + label: "Gisborne District", + value: "gisborne-district:GIS", + }, + { + label: "Marlborough District", + value: "marlborough-district:MBH", + }, + { + label: "Nelson City", + value: "nelson-city:NSN", + }, + { + label: "Tasman District", + value: "tasman-district:TAS", + }, + ], + }, + { + label: "Niue", + value: "niue", + code: "NU", + states: [], + }, + { + label: "Norfolk Island", + value: "norfolk-island", + code: "NF", + states: [], + }, + { + label: "Northern Mariana Islands", + value: "northern-mariana-islands", + code: "MP", + states: [], + }, + { + label: "Palau", + value: "palau", + code: "PW", + states: [ + { + label: "Aimeliik", + value: "aimeliik:002", + }, + { + label: "Airai", + value: "airai:004", + }, + { + label: "Angaur", + value: "angaur:010", + }, + { + label: "Hatobohei", + value: "hatobohei:050", + }, + { + label: "Kayangel", + value: "kayangel:100", + }, + { + label: "Koror", + value: "koror:150", + }, + { + label: "Melekeok", + value: "melekeok:212", + }, + { + label: "Ngaraard", + value: "ngaraard:214", + }, + { + label: "Ngarchelong", + value: "ngarchelong:218", + }, + { + label: "Ngardmau", + value: "ngardmau:222", + }, + { + label: "Ngatpang", + value: "ngatpang:224", + }, + { + label: "Ngchesar", + value: "ngchesar:226", + }, + { + label: "Ngeremlengui", + value: "ngeremlengui:227", + }, + { + label: "Ngiwal", + value: "ngiwal:228", + }, + { + label: "Peleliu", + value: "peleliu:350", + }, + { + label: "Sonsorol", + value: "sonsorol:370", + }, + ], + }, + { + label: "Papua New Guinea", + value: "papua-new-guinea", + code: "PG", + states: [ + { + label: "Bougainville", + value: "bougainville:NSB", + }, + { + label: "Central", + value: "central:CPM", + }, + { + label: "Chimbu", + value: "chimbu:CPK", + }, + { + label: "East New Britain", + value: "east-new-britain:EBR", + }, + { + label: "East Sepik", + value: "east-sepik:ESW", + }, + { + label: "Eastern Highlands", + value: "eastern-highlands:EHG", + }, + { + label: "Enga", + value: "enga:EPW", + }, + { + label: "Gulf", + value: "gulf:GPK", + }, + { + label: "Madang", + value: "madang:MPM", + }, + { + label: "Manus", + value: "manus:MRL", + }, + { + label: "Milne Bay", + value: "milne-bay:MBA", + }, + { + label: "Morobe", + value: "morobe:MPL", + }, + { + label: "National Capital District", + value: "national-capital-district:NCD", + }, + { + label: "New Ireland", + value: "new-ireland:NIK", + }, + { + label: "Northern", + value: "northern:NPP", + }, + { + label: "Sandaun", + value: "sandaun:SAN", + }, + { + label: "Southern Highlands", + value: "southern-highlands:SHM", + }, + { + label: "West New Britain", + value: "west-new-britain:WBK", + }, + { + label: "Western", + value: "western:WPD", + }, + { + label: "Western Highlands", + value: "western-highlands:WHM", + }, + ], + }, + { + label: "Pitcairn Islands", + value: "pitcairn-islands", + code: "PN", + states: [], + }, + { + label: "Samoa", + value: "samoa", + code: "WS", + states: [ + { + label: "A'ana", + value: "a'ana:AA", + }, + { + label: "Aiga-i-le-Tai", + value: "aiga-i-le-tai:AL", + }, + { + label: "Atua", + value: "atua:AT", + }, + { + label: "Fa'asaleleaga", + value: "fa'asaleleaga:FA", + }, + { + label: "Gaga'emauga", + value: "gaga'emauga:GE", + }, + { + label: "Gagaifomauga", + value: "gagaifomauga:GI", + }, + { + label: "Palauli", + value: "palauli:PA", + }, + { + label: "Satupa'itea", + value: "satupa'itea:SA", + }, + { + label: "Tuamasaga", + value: "tuamasaga:TU", + }, + { + label: "Va'a-o-Fonoti", + value: "va'a-o-fonoti:VF", + }, + { + label: "Vaisigano", + value: "vaisigano:VS", + }, + ], + }, + { + label: "Solomon Islands", + value: "solomon-islands", + code: "SB", + states: [ + { + label: "Capital Territory", + value: "capital-territory:CT", + }, + { + label: "Central", + value: "central:CE", + }, + { + label: "Choiseul", + value: "choiseul:CH", + }, + { + label: "Guadalcanal", + value: "guadalcanal:GU", + }, + { + label: "Isabel", + value: "isabel:IS", + }, + { + label: "Makira-Ulawa", + value: "makira-ulawa:MK", + }, + { + label: "Malaita", + value: "malaita:ML", + }, + { + label: "Rennell and Bellona", + value: "rennell-and-bellona:RB", + }, + { + label: "Temotu", + value: "temotu:TE", + }, + { + label: "Western", + value: "western:WE", + }, + ], + }, + { + label: "Tokelau", + value: "tokelau", + code: "TK", + states: [], + }, + { + label: "Tonga", + value: "tonga", + code: "TO", + states: [ + { + label: "'Eua", + value: "'eua:01", + }, + { + label: "Ha'apai", + value: "ha'apai:02", + }, + { + label: "Niuas", + value: "niuas:03", + }, + { + label: "Tongatapu", + value: "tongatapu:04", + }, + { + label: "Vava'u", + value: "vava'u:05", + }, + ], + }, + { + label: "Tuvalu", + value: "tuvalu", + code: "TV", + states: [ + { + label: "Funafuti", + value: "funafuti:FUN", + }, + { + label: "Nanumanga", + value: "nanumanga:NMG", + }, + { + label: "Nanumea", + value: "nanumea:NMA", + }, + { + label: "Niutao", + value: "niutao:NIT", + }, + { + label: "Nui", + value: "nui:NUI", + }, + { + label: "Nukufetau", + value: "nukufetau:NKF", + }, + { + label: "Nukulaelae", + value: "nukulaelae:NKL", + }, + { + label: "Vaitupu", + value: "vaitupu:VAI", + }, + ], + }, + { + label: "Vanuatu", + value: "vanuatu", + code: "VU", + states: [ + { + label: "Malampa", + value: "malampa:MAP", + }, + { + label: "Pénama", + value: "pénama:PAM", + }, + { + label: "Sanma", + value: "sanma:SAM", + }, + { + label: "Shéfa", + value: "shéfa:SEE", + }, + { + label: "Taféa", + value: "taféa:TAE", + }, + { + label: "Torba", + value: "torba:TOB", + }, + ], + }, + { + label: "Wallis and Futuna", + value: "wallis-and-futuna", + code: "WF", + states: [], + }, + ], + }, + { + label: "South America", + value: "south-america", + countries: [ + { + label: "Argentina", + value: "argentina", + code: "AR", + states: [ + { + label: "Buenos Aires", + value: "buenos-aires:B", + }, + { + label: "Catamarca", + value: "catamarca:K", + }, + { + label: "Chaco", + value: "chaco:H", + }, + { + label: "Chubut", + value: "chubut:U", + }, + { + label: "Ciudad Autónoma de Buenos Aires", + value: "ciudad-autónoma-de-buenos-aires:C", + }, + { + label: "Corrientes", + value: "corrientes:W", + }, + { + label: "Córdoba", + value: "córdoba:X", + }, + { + label: "Entre Ríos", + value: "entre-ríos:E", + }, + { + label: "Formosa", + value: "formosa:P", + }, + { + label: "Jujuy", + value: "jujuy:Y", + }, + { + label: "La Pampa", + value: "la-pampa:L", + }, + { + label: "La Rioja", + value: "la-rioja:F", + }, + { + label: "Mendoza", + value: "mendoza:M", + }, + { + label: "Misiones", + value: "misiones:N", + }, + { + label: "Neuquén", + value: "neuquén:Q", + }, + { + label: "Río Negro", + value: "río-negro:R", + }, + { + label: "Salta", + value: "salta:A", + }, + { + label: "San Juan", + value: "san-juan:J", + }, + { + label: "San Luis", + value: "san-luis:D", + }, + { + label: "Santa Cruz", + value: "santa-cruz:Z", + }, + { + label: "Santa Fe", + value: "santa-fe:S", + }, + { + label: "Santiago del Estero", + value: "santiago-del-estero:G", + }, + { + label: "Tierra del Fuego", + value: "tierra-del-fuego:V", + }, + { + label: "Tucumán", + value: "tucumán:T", + }, ], }, { - label: "South Africa", - value: "south-africa", - children: [ - { label: "Gauteng", value: "gauteng" }, - { label: "Western Cape", value: "western-cape" }, - { label: "KwaZulu-Natal", value: "kwazulu-natal" }, - { label: "Eastern Cape", value: "eastern-cape" }, - { label: "Free State", value: "free-state" }, + label: "Bolivia", + value: "bolivia", + code: "BO", + states: [ + { + label: "Chuquisaca", + value: "chuquisaca:H", + }, + { + label: "Cochabamba", + value: "cochabamba:C", + }, + { + label: "El Beni", + value: "el-beni:B", + }, + { + label: "La Paz", + value: "la-paz:L", + }, + { + label: "Oruro", + value: "oruro:O", + }, + { + label: "Pando", + value: "pando:N", + }, + { + label: "Potosí", + value: "potosí:P", + }, + { + label: "Santa Cruz", + value: "santa-cruz:S", + }, + { + label: "Tarija", + value: "tarija:T", + }, ], }, - ], - }, - - { - label: "Antarctica", - value: "antarctica", - disabled: true, - }, - { - label: "Asia", - value: "asia", - children: [ { - label: "China", - value: "china", - children: [ - { label: "Beijing", value: "beijing" }, - { label: "Shanghai", value: "shanghai" }, - { label: "Guangdong", value: "guangdong" }, - { label: "Zhejiang", value: "zhejiang" }, - { label: "Sichuan", value: "sichuan" }, + label: "Brazil", + value: "brazil", + code: "BR", + states: [ + { + label: "Acre", + value: "acre:AC", + }, + { + label: "Alagoas", + value: "alagoas:AL", + }, + { + label: "Amapá", + value: "amapá:AP", + }, + { + label: "Amazonas", + value: "amazonas:AM", + }, + { + label: "Bahia", + value: "bahia:BA", + }, + { + label: "Ceará", + value: "ceará:CE", + }, + { + label: "Distrito Federal", + value: "distrito-federal:DF", + }, + { + label: "Espírito Santo", + value: "espírito-santo:ES", + }, + { + label: "Goiás", + value: "goiás:GO", + }, + { + label: "Maranhão", + value: "maranhão:MA", + }, + { + label: "Mato Grosso", + value: "mato-grosso:MT", + }, + { + label: "Mato Grosso do Sul", + value: "mato-grosso-do-sul:MS", + }, + { + label: "Minas Gerais", + value: "minas-gerais:MG", + }, + { + label: "Paraná", + value: "paraná:PR", + }, + { + label: "Paraíba", + value: "paraíba:PB", + }, + { + label: "Pará", + value: "pará:PA", + }, + { + label: "Pernambuco", + value: "pernambuco:PE", + }, + { + label: "Piauí", + value: "piauí:PI", + }, + { + label: "Rio Grande do Norte", + value: "rio-grande-do-norte:RN", + }, + { + label: "Rio Grande do Sul", + value: "rio-grande-do-sul:RS", + }, + { + label: "Rio de Janeiro", + value: "rio-de-janeiro:RJ", + }, + { + label: "Rondônia", + value: "rondônia:RO", + }, + { + label: "Roraima", + value: "roraima:RR", + }, + { + label: "Santa Catarina", + value: "santa-catarina:SC", + }, + { + label: "Sergipe", + value: "sergipe:SE", + }, + { + label: "São Paulo", + value: "são-paulo:SP", + }, + { + label: "Tocantins", + value: "tocantins:TO", + }, ], }, { - label: "India", - value: "india", - children: [ - { label: "Maharashtra", value: "maharashtra" }, - { label: "Delhi", value: "delhi" }, - { label: "Karnataka", value: "karnataka" }, - { label: "Tamil Nadu", value: "tamil-nadu" }, - { label: "Uttar Pradesh", value: "uttar-pradesh" }, + label: "Chile", + value: "chile", + code: "CL", + states: [ + { + label: "Aisén del General Carlos Ibañez del Campo", + value: "aisén-del-general-carlos-ibañez-del-campo:AI", + }, + { + label: "Antofagasta", + value: "antofagasta:AN", + }, + { + label: "Araucanía", + value: "araucanía:AR", + }, + { + label: "Arica y Parinacota", + value: "arica-y-parinacota:AP", + }, + { + label: "Atacama", + value: "atacama:AT", + }, + { + label: "Bío-Bío", + value: "bío-bío:BI", + }, + { + label: "Coquimbo", + value: "coquimbo:CO", + }, + { + label: "Libertador General Bernardo O'Higgins", + value: "libertador-general-bernardo-o'higgins:LI", + }, + { + label: "Los Lagos", + value: "los-lagos:LL", + }, + { + label: "Los Ríos", + value: "los-ríos:LR", + }, + { + label: "Magallanes", + value: "magallanes:MA", + }, + { + label: "Maule", + value: "maule:ML", + }, + { + label: "Región Metropolitana de Santiago", + value: "región-metropolitana-de-santiago:RM", + }, + { + label: "Tarapacá", + value: "tarapacá:TA", + }, + { + label: "Valparaíso", + value: "valparaíso:VS", + }, ], }, - ], - }, - { - label: "Australia", - value: "australia", - children: [ { - label: "Australia", - value: "australia", - children: [ - { label: "New South Wales", value: "new-south-wales" }, - { label: "Victoria", value: "victoria" }, - { label: "Queensland", value: "queensland" }, - { label: "Western Australia", value: "western-australia" }, - { label: "South Australia", value: "south-australia" }, - { label: "Tasmania", value: "tasmania" }, - { label: "Northern Territory", value: "northern-territory" }, + label: "Colombia", + value: "colombia", + code: "CO", + states: [ + { + label: "Amazonas", + value: "amazonas:AMA", + }, + { + label: "Antioquia", + value: "antioquia:ANT", + }, + { + label: "Arauca", + value: "arauca:ARA", + }, + { + label: "Atlántico", + value: "atlántico:ATL", + }, + { + label: "Bolívar", + value: "bolívar:BOL", + }, + { + label: "Boyacá", + value: "boyacá:BOY", + }, + { + label: "Caldas", + value: "caldas:CAL", + }, + { + label: "Caquetá", + value: "caquetá:CAQ", + }, + { + label: "Casanare", + value: "casanare:CAS", + }, + { + label: "Cauca", + value: "cauca:CAU", + }, + { + label: "Cesar", + value: "cesar:CES", + }, + { + label: "Chocó", + value: "chocó:CHO", + }, + { + label: "Cundinamarca", + value: "cundinamarca:CUN", + }, + { + label: "Córdoba", + value: "córdoba:COR", + }, + { + label: "Distrito Capital de Bogotá", + value: "distrito-capital-de-bogotá:DC", + }, + { + label: "Guainía", + value: "guainía:GUA", + }, + { + label: "Guaviare", + value: "guaviare:GUV", + }, + { + label: "Huila", + value: "huila:HUI", + }, + { + label: "La Guajira", + value: "la-guajira:LAG", + }, + { + label: "Magdalena", + value: "magdalena:MAG", + }, + { + label: "Meta", + value: "meta:MET", + }, + { + label: "Nariño", + value: "nariño:NAR", + }, + { + label: "Norte de Santander", + value: "norte-de-santander:NSA", + }, + { + label: "Putumayo", + value: "putumayo:PUT", + }, + { + label: "Quindío", + value: "quindío:QUI", + }, + { + label: "Risaralda", + value: "risaralda:RIS", + }, + { + label: "San Andrés, Providencia y Santa Catalina", + value: "san-andrés,-providencia-y-santa-catalina:SAP", + }, + { + label: "Santander", + value: "santander:SAN", + }, + { + label: "Sucre", + value: "sucre:SUC", + }, + { + label: "Tolima", + value: "tolima:TOL", + }, + { + label: "Valle del Cauca", + value: "valle-del-cauca:VAC", + }, + { + label: "Vaupés", + value: "vaupés:VAU", + }, + { + label: "Vichada", + value: "vichada:VID", + }, + ], + }, + { + label: "Ecuador", + value: "ecuador", + code: "EC", + states: [ + { + label: "Azuay", + value: "azuay:A", + }, + { + label: "Bolívar", + value: "bolívar:B", + }, + { + label: "Carchi", + value: "carchi:C", + }, + { + label: "Cañar", + value: "cañar:F", + }, + { + label: "Chimborazo", + value: "chimborazo:H", + }, + { + label: "Cotopaxi", + value: "cotopaxi:X", + }, + { + label: "El Oro", + value: "el-oro:O", + }, + { + label: "Esmeraldas", + value: "esmeraldas:E", + }, + { + label: "Galápagos", + value: "galápagos:W", + }, + { + label: "Guayas", + value: "guayas:G", + }, + { + label: "Imbabura", + value: "imbabura:I", + }, + { + label: "Loja", + value: "loja:L", + }, + { + label: "Los Ríos", + value: "los-ríos:R", + }, + { + label: "Manabí", + value: "manabí:M", + }, + { + label: "Morona-Santiago", + value: "morona-santiago:S", + }, + { + label: "Napo", + value: "napo:N", + }, + { + label: "Orellana", + value: "orellana:D", + }, + { + label: "Pastaza", + value: "pastaza:Y", + }, + { + label: "Pichincha", + value: "pichincha:P", + }, + { + label: "Santa Elena", + value: "santa-elena:SE", + }, + { + label: "Santo Domingo de los Tsáchilas", + value: "santo-domingo-de-los-tsáchilas:SD", + }, { - label: "Australian Capital Territory", - value: "australian-capital-territory", + label: "Sucumbíos", + value: "sucumbíos:U", + }, + { + label: "Tungurahua", + value: "tungurahua:T", + }, + { + label: "Zamora-Chinchipe", + value: "zamora-chinchipe:Z", }, ], }, { - label: "New Zealand", - value: "new-zealand", - children: [ - { label: "Auckland", value: "auckland" }, - { label: "Wellington", value: "wellington" }, - { label: "Canterbury", value: "canterbury" }, - { label: "Otago", value: "otago" }, - { label: "Hawke's Bay", value: "hawkes-bay" }, - ], + label: "Falkland Islands", + value: "falkland-islands", + code: "FK", + states: [], }, - ], - }, - { - label: "Europe", - value: "europe", - children: [ { - label: "United Kingdom", - value: "united-kingdom", - children: [ - { label: "England", value: "england" }, - { label: "Scotland", value: "scotland" }, - { label: "Wales", value: "wales" }, - { label: "Northern Ireland", value: "northern-ireland" }, - ], + label: "French Guiana", + value: "french-guiana", + code: "GF", + states: [], }, { - label: "Germany", - value: "germany", - children: [ - { label: "Bavaria", value: "bavaria" }, - { label: "Berlin", value: "berlin" }, - { label: "Hamburg", value: "hamburg" }, - { label: "Hesse", value: "hesse" }, - { label: "Saxony", value: "saxony" }, + label: "Guyana", + value: "guyana", + code: "GY", + states: [ + { + label: "Barima-Waini", + value: "barima-waini:BA", + }, + { + label: "Cuyuni-Mazaruni", + value: "cuyuni-mazaruni:CU", + }, + { + label: "Demerara-Mahaica", + value: "demerara-mahaica:DE", + }, + { + label: "East Berbice-Corentyne", + value: "east-berbice-corentyne:EB", + }, + { + label: "Essequibo Islands-West Demerara", + value: "essequibo-islands-west-demerara:ES", + }, + { + label: "Mahaica-Berbice", + value: "mahaica-berbice:MA", + }, + { + label: "Pomeroon-Supenaam", + value: "pomeroon-supenaam:PM", + }, + { + label: "Potaro-Siparuni", + value: "potaro-siparuni:PT", + }, + { + label: "Upper Demerara-Berbice", + value: "upper-demerara-berbice:UD", + }, + { + label: "Upper Takutu-Upper Essequibo", + value: "upper-takutu-upper-essequibo:UT", + }, ], }, - ], - }, - { - label: "North America", - value: "north-america", - children: [ { - label: "United States", - value: "united-states", - children: [ - { label: "California", value: "california" }, - { label: "Texas", value: "texas" }, - { label: "Florida", value: "florida" }, - { label: "New York", value: "new-york" }, - { label: "Illinois", value: "illinois" }, - { label: "Pennsylvania", value: "pennsylvania" }, - { label: "Ohio", value: "ohio" }, - { label: "Georgia", value: "georgia" }, - { label: "North Carolina", value: "north-carolina" }, - { label: "Michigan", value: "michigan" }, + label: "Paraguay", + value: "paraguay", + code: "PY", + states: [ + { + label: "Alto Paraguay", + value: "alto-paraguay:16", + }, + { + label: "Alto Paraná", + value: "alto-paraná:10", + }, + { + label: "Amambay", + value: "amambay:13", + }, + { + label: "Asunción", + value: "asunción:ASU", + }, + { + label: "Boquerón", + value: "boquerón:19", + }, + { + label: "Caaguazú", + value: "caaguazú:5", + }, + { + label: "Caazapá", + value: "caazapá:6", + }, + { + label: "Canindeyú", + value: "canindeyú:14", + }, + { + label: "Central", + value: "central:11", + }, + { + label: "Concepción", + value: "concepción:1", + }, + { + label: "Cordillera", + value: "cordillera:3", + }, + { + label: "Guairá", + value: "guairá:4", + }, + { + label: "Itapúa", + value: "itapúa:7", + }, + { + label: "Misiones", + value: "misiones:8", + }, + { + label: "Paraguarí", + value: "paraguarí:9", + }, + { + label: "Presidente Hayes", + value: "presidente-hayes:15", + }, + { + label: "San Pedro", + value: "san-pedro:2", + }, + { + label: "Ñeembucú", + value: "ñeembucú:12", + }, ], }, { - label: "Canada", - value: "canada", - children: [ - { label: "Ontario", value: "ontario" }, - { label: "Quebec", value: "quebec" }, - { label: "British Columbia", value: "british-columbia" }, - { label: "Alberta", value: "alberta" }, - { label: "Manitoba", value: "manitoba" }, - { label: "Saskatchewan", value: "saskatchewan" }, - { label: "Nova Scotia", value: "nova-scotia" }, - { label: "New Brunswick", value: "new-brunswick" }, + label: "Peru", + value: "peru", + code: "PE", + states: [ { - label: "Newfoundland and Labrador", - value: "newfoundland-and-labrador", + label: "Amazonas", + value: "amazonas:AMA", + }, + { + label: "Ancash", + value: "ancash:ANC", + }, + { + label: "Apurímac", + value: "apurímac:APU", + }, + { + label: "Arequipa", + value: "arequipa:ARE", + }, + { + label: "Ayacucho", + value: "ayacucho:AYA", + }, + { + label: "Cajamarca", + value: "cajamarca:CAJ", + }, + { + label: "Cusco", + value: "cusco:CUS", + }, + { + label: "El Callao", + value: "el-callao:CAL", + }, + { + label: "Huancavelica", + value: "huancavelica:HUV", + }, + { + label: "Huánuco", + value: "huánuco:HUC", + }, + { + label: "Ica", + value: "ica:ICA", + }, + { + label: "Junín", + value: "junín:JUN", + }, + { + label: "La Libertad", + value: "la-libertad:LAL", + }, + { + label: "Lambayeque", + value: "lambayeque:LAM", + }, + { + label: "Lima", + value: "lima:LIM", + }, + { + label: "Loreto", + value: "loreto:LOR", + }, + { + label: "Madre de Dios", + value: "madre-de-dios:MDD", + }, + { + label: "Moquegua", + value: "moquegua:MOQ", + }, + { + label: "Municipalidad Metropolitana de Lima", + value: "municipalidad-metropolitana-de-lima:LMA", + }, + { + label: "Pasco", + value: "pasco:PAS", + }, + { + label: "Piura", + value: "piura:PIU", + }, + { + label: "Puno", + value: "puno:PUN", + }, + { + label: "San Martín", + value: "san-martín:SAM", + }, + { + label: "Tacna", + value: "tacna:TAC", + }, + { + label: "Tumbes", + value: "tumbes:TUM", + }, + { + label: "Ucayali", + value: "ucayali:UCA", }, - { label: "Prince Edward Island", value: "prince-edward-island" }, ], }, { - label: "Mexico", - value: "mexico", - children: [ - { label: "Chihuahua", value: "chihuahua" }, - { label: "Jalisco", value: "jalisco" }, - { label: "Puebla", value: "puebla" }, - { label: "Guanajuato", value: "guanajuato" }, - { label: "Veracruz", value: "veracruz" }, - { label: "Yucatán", value: "yucatan" }, - { label: "Mexico City", value: "mexico-city" }, - { label: "Oaxaca", value: "oaxaca" }, - { label: "Sinaloa", value: "sinaloa" }, - { label: "Sonora", value: "sonora" }, + label: "South Georgia", + value: "south-georgia", + code: "GS", + states: [], + }, + { + label: "Suriname", + value: "suriname", + code: "SR", + states: [ + { + label: "Brokopondo", + value: "brokopondo:BR", + }, + { + label: "Commewijne", + value: "commewijne:CM", + }, + { + label: "Coronie", + value: "coronie:CR", + }, + { + label: "Marowijne", + value: "marowijne:MA", + }, + { + label: "Nickerie", + value: "nickerie:NI", + }, + { + label: "Para", + value: "para:PR", + }, + { + label: "Paramaribo", + value: "paramaribo:PM", + }, + { + label: "Saramacca", + value: "saramacca:SA", + }, + { + label: "Sipaliwini", + value: "sipaliwini:SI", + }, + { + label: "Wanica", + value: "wanica:WA", + }, ], }, - ], - }, - { - label: "South America", - value: "south-america", - children: [ { - label: "Brazil", - value: "brazil", - children: [ - { label: "São Paulo", value: "sao-paulo" }, - { label: "Rio de Janeiro", value: "rio-de-janeiro" }, - { label: "Bahia", value: "bahia" }, - { label: "Minas Gerais", value: "minas-gerais" }, - { label: "Paraná", value: "parana" }, - { label: "Rio Grande do Sul", value: "rio-grande-do-sul" }, - { label: "Pernambuco", value: "pernambuco" }, - { label: "Ceará", value: "ceara" }, - { label: "Pará", value: "para" }, - { label: "Santa Catarina", value: "santa-catarina" }, + label: "Uruguay", + value: "uruguay", + code: "UY", + states: [ + { + label: "Artigas", + value: "artigas:AR", + }, + { + label: "Canelones", + value: "canelones:CA", + }, + { + label: "Cerro Largo", + value: "cerro-largo:CL", + }, + { + label: "Colonia", + value: "colonia:CO", + }, + { + label: "Durazno", + value: "durazno:DU", + }, + { + label: "Flores", + value: "flores:FS", + }, + { + label: "Florida", + value: "florida:FD", + }, + { + label: "Lavalleja", + value: "lavalleja:LA", + }, + { + label: "Maldonado", + value: "maldonado:MA", + }, + { + label: "Montevideo", + value: "montevideo:MO", + }, + { + label: "Paysandú", + value: "paysandú:PA", + }, + { + label: "Rivera", + value: "rivera:RV", + }, + { + label: "Rocha", + value: "rocha:RO", + }, + { + label: "Río Negro", + value: "río-negro:RN", + }, + { + label: "Salto", + value: "salto:SA", + }, + { + label: "San José", + value: "san-josé:SJ", + }, + { + label: "Soriano", + value: "soriano:SO", + }, + { + label: "Tacuarembó", + value: "tacuarembó:TA", + }, + { + label: "Treinta y Tres", + value: "treinta-y-tres:TT", + }, ], }, { - label: "Argentina", - value: "argentina", - children: [ - { label: "Buenos Aires", value: "buenos-aires" }, - { label: "Córdoba", value: "cordoba" }, - { label: "Santa Fe", value: "santa-fe" }, - { label: "Mendoza", value: "mendoza" }, - { label: "Tucumán", value: "tucuman" }, - { label: "Salta", value: "salta" }, - { label: "Entre Ríos", value: "entre-rios" }, - { label: "Misiones", value: "misiones" }, - { label: "Corrientes", value: "corrientes" }, - { label: "Chaco", value: "chaco" }, + label: "Venezuela", + value: "venezuela", + code: "VE", + states: [ + { + label: "Amazonas", + value: "amazonas:Z", + }, + { + label: "Anzoátegui", + value: "anzoátegui:B", + }, + { + label: "Apure", + value: "apure:C", + }, + { + label: "Aragua", + value: "aragua:D", + }, + { + label: "Barinas", + value: "barinas:E", + }, + { + label: "Bolívar", + value: "bolívar:F", + }, + { + label: "Carabobo", + value: "carabobo:G", + }, + { + label: "Cojedes", + value: "cojedes:H", + }, + { + label: "Delta Amacuro", + value: "delta-amacuro:Y", + }, + { + label: "Dependencias Federales", + value: "dependencias-federales:W", + }, + { + label: "Distrito Capital", + value: "distrito-capital:A", + }, + { + label: "Falcón", + value: "falcón:I", + }, + { + label: "Guárico", + value: "guárico:J", + }, + { + label: "Lara", + value: "lara:K", + }, + { + label: "Miranda", + value: "miranda:M", + }, + { + label: "Monagas", + value: "monagas:N", + }, + { + label: "Mérida", + value: "mérida:L", + }, + { + label: "Nueva Esparta", + value: "nueva-esparta:O", + }, + { + label: "Portuguesa", + value: "portuguesa:P", + }, + { + label: "Sucre", + value: "sucre:R", + }, + { + label: "Trujillo", + value: "trujillo:T", + }, + { + label: "Táchira", + value: "táchira:S", + }, + { + label: "Vargas", + value: "vargas:X", + }, + { + label: "Yaracuy", + value: "yaracuy:U", + }, + { + label: "Zulia", + value: "zulia:V", + }, ], }, ], diff --git a/shared/src/css/cascader.css b/shared/src/css/cascader.css index 484d3b857f..03e5e287f1 100644 --- a/shared/src/css/cascader.css +++ b/shared/src/css/cascader.css @@ -67,7 +67,7 @@ list-style-type: none; max-height: min(var(--available-height), 400px); margin: 0; - min-width: 151px; + width: 170px; overflow-y: auto; height: 120px; border-right: 1px solid #e8e8e8; From c8665f1cf717da1478c56dbeb7983acf0ebc4a0c Mon Sep 17 00:00:00 2001 From: anubra266 Date: Tue, 31 Dec 2024 09:26:09 -0800 Subject: [PATCH 07/11] chore: cleanup --- examples/next-ts/pages/cascader.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/next-ts/pages/cascader.tsx b/examples/next-ts/pages/cascader.tsx index a78f2922c7..eebbd9fb2a 100644 --- a/examples/next-ts/pages/cascader.tsx +++ b/examples/next-ts/pages/cascader.tsx @@ -75,7 +75,7 @@ const TreeNode = (props: TreeNodeProps): JSX.Element => { export default function Page() { const controls = useControls(cascaderControls) - const [state, send] = useMachine(cascader.machine({ id: useId(), collection, value: ["réunion"] }), { + const [state, send] = useMachine(cascader.machine({ id: useId(), collection }), { context: controls.context, }) From 6fb5d57b99f6584658d9c6c3c2b39aec7b0361cc Mon Sep 17 00:00:00 2001 From: anubra266 Date: Tue, 31 Dec 2024 09:30:28 -0800 Subject: [PATCH 08/11] chore: add indicator --- examples/next-ts/pages/cascader.tsx | 2 +- packages/machines/cascader/src/cascader.anatomy.ts | 1 + packages/machines/cascader/src/cascader.connect.ts | 12 ++++++++++++ packages/machines/cascader/src/cascader.types.ts | 1 + 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/examples/next-ts/pages/cascader.tsx b/examples/next-ts/pages/cascader.tsx index eebbd9fb2a..d45b60b377 100644 --- a/examples/next-ts/pages/cascader.tsx +++ b/examples/next-ts/pages/cascader.tsx @@ -90,7 +90,7 @@ export default function Page() {
    diff --git a/packages/machines/cascader/src/cascader.anatomy.ts b/packages/machines/cascader/src/cascader.anatomy.ts index 15ace65674..198a548412 100644 --- a/packages/machines/cascader/src/cascader.anatomy.ts +++ b/packages/machines/cascader/src/cascader.anatomy.ts @@ -9,6 +9,7 @@ export const anatomy = createAnatomy("cascader").parts( "positioner", "content", "list", + "indicator", "item", "itemText", ) diff --git a/packages/machines/cascader/src/cascader.connect.ts b/packages/machines/cascader/src/cascader.connect.ts index 94f2a1d007..cdd0274651 100644 --- a/packages/machines/cascader/src/cascader.connect.ts +++ b/packages/machines/cascader/src/cascader.connect.ts @@ -339,6 +339,18 @@ export function connect( }) }, + getIndicatorProps() { + return normalize.element({ + ...parts.indicator.attrs, + dir: state.context.dir, + "aria-hidden": true, + "data-state": open ? "open" : "closed", + "data-disabled": dataAttr(disabled), + "data-invalid": dataAttr(invalid), + "data-readonly": dataAttr(readOnly), + }) + }, + getItemProps(props) { const itemState = getNodeState(props) diff --git a/packages/machines/cascader/src/cascader.types.ts b/packages/machines/cascader/src/cascader.types.ts index ef01f72986..8f31923c12 100644 --- a/packages/machines/cascader/src/cascader.types.ts +++ b/packages/machines/cascader/src/cascader.types.ts @@ -317,6 +317,7 @@ export interface MachineApi { getLabelProps(): T["label"] getControlProps(): T["element"] getTriggerProps(): T["button"] + getIndicatorProps(): T["element"] getClearTriggerProps(): T["button"] getPositionerProps(): T["element"] getContentProps(): T["element"] From 42c282845b5b6b8ae3a039a21088a770f365bdb3 Mon Sep 17 00:00:00 2001 From: anubra266 Date: Sat, 4 Jan 2025 12:28:30 -0800 Subject: [PATCH 09/11] chore: update navigation --- .../machines/cascader/src/cascader.connect.ts | 4 +- .../machines/cascader/src/cascader.machine.ts | 27 +++++++---- .../machines/cascader/src/cascader.utils.ts | 48 ------------------- 3 files changed, 21 insertions(+), 58 deletions(-) diff --git a/packages/machines/cascader/src/cascader.connect.ts b/packages/machines/cascader/src/cascader.connect.ts index cdd0274651..024bbd8b14 100644 --- a/packages/machines/cascader/src/cascader.connect.ts +++ b/packages/machines/cascader/src/cascader.connect.ts @@ -1,5 +1,5 @@ -import type { NormalizeProps, PropTypes } from "@zag-js/types" -import { getEventKey, isLeftClick, type EventKeyMap } from "@zag-js/dom-event" +import type { NormalizeProps, PropTypes, EventKeyMap } from "@zag-js/types" +import { getEventKey, isLeftClick } from "@zag-js/dom-query" import type { State, Send, MachineApi, NodeProps, NodeState } from "./cascader.types" import { parts } from "./cascader.anatomy" diff --git a/packages/machines/cascader/src/cascader.machine.ts b/packages/machines/cascader/src/cascader.machine.ts index a40978434d..10df0c10d9 100644 --- a/packages/machines/cascader/src/cascader.machine.ts +++ b/packages/machines/cascader/src/cascader.machine.ts @@ -455,19 +455,26 @@ export function machine(userContext: UserDefinedContext) { highlightItemFirstChild(ctx) { const item = ctx.collection.at(ctx.highlightedIndexPath) if (!ctx.collection.isBranchNode(item)) return - ctx.highlightedIndexPath.push(0) + + const newPath = [...ctx.highlightedIndexPath, 0] + set.highlightedItem(ctx, newPath) }, highlightItemParent(ctx) { - ctx.highlightedIndexPath.pop() + const parentPath = ctx.highlightedIndexPath.slice(0, -1) + set.highlightedItem(ctx, parentPath) }, highlightFirstItem(ctx) { - ctx.highlightedIndexPath[ctx.highlightedIndexPath.length - 1] = 0 + const newPath = [...ctx.highlightedIndexPath] + newPath[newPath.length - 1] = 0 + set.highlightedItem(ctx, newPath) }, highlightLastItem(ctx) { const siblings = utils.getSiblings(ctx) if (!siblings) return - ctx.highlightedIndexPath[ctx.highlightedIndexPath.length - 1] = siblings.length - 1 + const newPath = [...ctx.highlightedIndexPath] + newPath[newPath.length - 1] = siblings.length - 1 + set.highlightedItem(ctx, newPath) }, highlightFirstItemInRoot(ctx) { set.highlightedItem(ctx, [0]) @@ -477,12 +484,16 @@ export function machine(userContext: UserDefinedContext) { set.highlightedItem(ctx, [rootNodes.length - 1]) }, highlightNextItem(ctx) { - const nextSibling = utils.getNextSibling(ctx) - set.highlightedItem(ctx, nextSibling) + const nextSibling = ctx.collection.getNextSibling(ctx.highlightedIndexPath) + if (!nextSibling) return + const value = ctx.collection.getNodeValue(nextSibling) + set.highlightedItem(ctx, ctx.collection.getIndexPath(value)) }, highlightPreviousItem(ctx) { - const previousSibling = utils.getPreviousSibling(ctx) - set.highlightedItem(ctx, previousSibling) + const previousSibling = ctx.collection.getPreviousSibling(ctx.highlightedIndexPath) + if (!previousSibling) return + const value = ctx.collection.getNodeValue(previousSibling) + set.highlightedItem(ctx, ctx.collection.getIndexPath(value)) }, highlightLastSelectedItem(ctx) { const lastSelected = ctx.valueIndexPaths.at(-1) diff --git a/packages/machines/cascader/src/cascader.utils.ts b/packages/machines/cascader/src/cascader.utils.ts index dfa13bf699..b77a992e48 100644 --- a/packages/machines/cascader/src/cascader.utils.ts +++ b/packages/machines/cascader/src/cascader.utils.ts @@ -12,51 +12,3 @@ export function getSiblings(ctx: MachineContext) { if (siblings.length <= 1) return return siblings } - -export function getNextSibling(ctx: MachineContext) { - const siblings = getSiblings(ctx) - if (!siblings) return - const currentIndex = ctx.highlightedIndexPath[ctx.highlightedIndexPath.length - 1] - - // Find next enabled sibling - for (let i = currentIndex + 1; i < siblings.length; i++) { - if (!ctx.collection.getNodeDisabled(siblings[i])) { - return [...ctx.highlightedIndexPath.slice(0, -1), i] - } - } - - // If loop is enabled, search from start - if (ctx.loopFocus) { - for (let i = 0; i < currentIndex; i++) { - if (!ctx.collection.getNodeDisabled(siblings[i])) { - return [...ctx.highlightedIndexPath.slice(0, -1), i] - } - } - } - - return ctx.highlightedIndexPath -} - -export function getPreviousSibling(ctx: MachineContext) { - const siblings = getSiblings(ctx) - if (!siblings) return - const currentIndex = ctx.highlightedIndexPath[ctx.highlightedIndexPath.length - 1] - - // Find previous enabled sibling - for (let i = currentIndex - 1; i >= 0; i--) { - if (!ctx.collection.getNodeDisabled(siblings[i])) { - return [...ctx.highlightedIndexPath.slice(0, -1), i] - } - } - - // If loop is enabled, search from end - if (ctx.loopFocus) { - for (let i = siblings.length - 1; i > currentIndex; i--) { - if (!ctx.collection.getNodeDisabled(siblings[i])) { - return [...ctx.highlightedIndexPath.slice(0, -1), i] - } - } - } - - return ctx.highlightedIndexPath -} From 225c995450cdb6ce858e810cd13fadd14bcbb885 Mon Sep 17 00:00:00 2001 From: anubra266 Date: Sun, 5 Jan 2025 05:17:48 -0800 Subject: [PATCH 10/11] chore: fix highlight --- packages/machines/cascader/src/cascader.connect.ts | 11 ++++++----- shared/src/css/cascader.css | 9 +++++---- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/packages/machines/cascader/src/cascader.connect.ts b/packages/machines/cascader/src/cascader.connect.ts index 024bbd8b14..6ac760f143 100644 --- a/packages/machines/cascader/src/cascader.connect.ts +++ b/packages/machines/cascader/src/cascader.connect.ts @@ -361,16 +361,19 @@ export function connect( id: dom.getItemId(state.context, itemState.value), dir: state.context.dir, role: "treeitem", - "data-index-path": props.indexPath.join(","), + "aria-haspopup": itemState.isBranch ? "menu" : undefined, "aria-expanded": itemState.isBranch ? itemState.highlighted : false, "aria-controls": itemState.isBranch ? dom.getListId(state.context, itemState.value) : undefined, - "data-value": itemState.value, + "aria-owns": itemState.isBranch ? dom.getListId(state.context, itemState.value) : undefined, "aria-selected": itemState.selected, + "aria-disabled": ariaAttr(itemState.disabled), + "data-value": itemState.value, "data-state": itemState.selected ? "checked" : "unchecked", "data-highlighted": dataAttr(itemState.highlighted), "data-disabled": dataAttr(itemState.disabled), - "aria-disabled": ariaAttr(itemState.disabled), "data-selected": dataAttr(itemState.selected), + "data-type": itemState.isBranch ? "branch" : "leaf", + "data-index-path": props.indexPath.join(","), onDoubleClick() { if (itemState.disabled) return send("CLOSE") @@ -378,8 +381,6 @@ export function connect( onPointerMove(event) { if (itemState.disabled || event.pointerType !== "mouse") return if (highlightedValue === itemState.value) return - // We only want to highlight items that have children (mouse only) - if (!itemState.isBranch) return send({ type: "ITEM.POINTER_MOVE", indexPath }) }, onClick(event) { diff --git a/shared/src/css/cascader.css b/shared/src/css/cascader.css index 03e5e287f1..7055c9fa8d 100644 --- a/shared/src/css/cascader.css +++ b/shared/src/css/cascader.css @@ -98,15 +98,16 @@ cursor: not-allowed; } -[data-scope="cascader"][data-part="item"]:not([data-disabled]):not([data-highlighted]):hover { - background: rgba(107, 107, 110, 0.105); -} - [data-scope="cascader"][data-part="item"][data-highlighted] { background: rgb(0, 0, 195); color: white; } +[data-scope="cascader"][data-part="item"][data-highlighted][data-type="leaf"] { + background: rgba(107, 107, 110, 0.105); + color: inherit; +} + [data-scope="cascader"][data-part="item-text"] { flex: 1; width: 100%; From 5f42573a66b22dc9dbac9aadf6cc0bc60a872c5c Mon Sep 17 00:00:00 2001 From: Abraham Date: Sat, 18 Jan 2025 13:19:07 -0800 Subject: [PATCH 11/11] Update examples/next-ts/pages/cascader.tsx --- examples/next-ts/pages/cascader.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/next-ts/pages/cascader.tsx b/examples/next-ts/pages/cascader.tsx index d45b60b377..b07e73f905 100644 --- a/examples/next-ts/pages/cascader.tsx +++ b/examples/next-ts/pages/cascader.tsx @@ -45,9 +45,10 @@ const TreeNode = (props: TreeNodeProps): JSX.Element => { const nodeProps = { indexPath, node } const nodeState = api.getNodeState(nodeProps) + const children = collection.getNodeChildren(node) + // TODO encapsulate const activeIndex = api.highlightedIndexPath[nodeState.depth - 1] ?? -1 - const children = collection.getNodeChildren(node) const activeNode = activeIndex >= 0 ? children[activeIndex] : null const isBranchActiveNode = activeNode && collection.isBranchNode(activeNode) return (