<commit_before>import AsyncStorage from "@react-native-community/async-storage"
import { MenuItem } from "lib/Components/MenuItem"
import { Text } from "palette"
import React from "react"
import { Alert } from "react-native"
import create from "zustand"
import { persist } from "zustand/middleware"

interface PaletteFlagState {
  allowV3: boolean
  setAllowV3: (value: boolean) => void
  toggleAllowV3: () => void
}

export const usePaletteFlagStore = create<PaletteFlagState>(
  persist(
    (set) => ({
      allowV3: __TEST__ || __STORYBOOK__,
      setAllowV3: (value) => set((_state) => ({ allowV3: value })),
      toggleAllowV3: () => set((state) => ({ allowV3: !state.allowV3 })),
    }),
    { name: "z-devtoggle-palette", getStorage: () => AsyncStorage }
  )
)

export const DevTogglePaletteFlag = () => {
  const currentValue = usePaletteFlagStore((state) => state.allowV3)<commit_msg>feat: Enable Palette V3 for all users (#5387)<commit_after>import { MenuItem } from "lib/Components/MenuItem"
import { Text } from "palette"
import React from "react"
import { Alert } from "react-native"
import create from "zustand"

interface PaletteFlagState {
  allowV3: boolean
  setAllowV3: (value: boolean) => void
  toggleAllowV3: () => void
}

export const usePaletteFlagStore = create<PaletteFlagState>((set) => ({
  allowV3: true,
  setAllowV3: (value) => set((_state) => ({ allowV3: value })),
  toggleAllowV3: () => set((state) => ({ allowV3: !state.allowV3 })),
}))

export const DevTogglePaletteFlag = () => {
  const currentValue = usePaletteFlagStore((state) => state.allowV3)
{'fraction_non_alphanumeric': 0.1485210824417873, 'fraction_numerical': 0.015733165512901194, 'mean_word_length': 4.824175824175824, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 24, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2945852', 'n_tokens_mistral': 528, 'n_tokens_neox': 518, 'n_words': 125}