PageSourceSearch

https://iconaapp.com/assets/country-required-gate-nsuKYtjE.js

js iconaapp.com collected 2026-10-06 15:23:43 UTC 3,125 bytes, 1 lines download raw bytes

1import{a as g,b as y,i as f,l as j,r as o,j as e,B as v}from"./index-WHULU0jW.js";import{C,a as N,b as S}from"./card-BlH5Drk3.js";import{S as w,a as k,b as A,c as E,d as G}from"./select-GrX3B2N2.js";import{A as T,a as B}from"./alert-CnyCenlc.js";import{G as d}from"./globe-Jm8oSgPd.js";import"./index-BdQq_4o_.js";import"./index-DXGq4QHA.js";import"./index-BFruoVYP.js";import"./chevron-down-6yZoXBwj.js";import"./chevron-up-CBx5ZPzc.js";function M(){const{updateCountry:u,logout:m}=g(),{settings:x}=y(),{toast:n}=f(),b=j(x.allowed_countries??null),[s,h]=o.useState(""),[r,i]=o.useState(!1),[l,a]=o.useState(""),p=async()=>{if(!s){a("Please select your country to continue.");return}try{a(""),i(!0),await u(s),n({title:"Country saved",description:"Thanks! You're all set."})}catch(t){const c=(t==null?void 0:t.message)||"Failed to save your country. Please try again.";a(c),n({variant:"destructive",title:"Could not save country",description:c})}finally{i(!1)}};return e.jsxs("div",{className:"min-h-screen flex flex-col items-center justify-center bg-background relative overflow-hidden p-4",children:[e.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-background via-background to-primary/5 pointer-events-none"}),e.jsxs("div",{className:"relative z-10 w-full max-w-md",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx("div",{className:"flex items-center justify-center w-16 h-16 mx-auto mb-4 rounded-2xl bg-primary/10",children:e.jsx(d,{className:"h-8 w-8 text-primary"})}),e.jsx("h1",{className:"text-2xl font-bold text-foreground mb-2",children:"Select your country"}),e.jsx("p",{className:"text-muted-foreground",children:"We need to know your country before you can continue using the app."})]}),e.jsxs(C,{className:"shadow-2xl border border-border/50 bg-card/80 backdrop-blur-sm","data-testid":"card-country-gate",children:[e.jsx(N,{className:"pb-2"}),e.jsxs(S,{className:"space-y-6 pb-8 pt-6",children:[l&&e.jsx(T,{variant:"destructive","data-testid":"alert-country-error",children:e.jsx(B,{children:l})}),e.jsxs(w,{value:s,onValueChange:h,disabled:r,children:[e.jsx(k,{className:"h-12 bg-input border-border text-foreground","data-testid":"select-country-gate",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx(d,{className:"h-4 w-4 text-muted-foreground mr-3"}),e.jsx(A,{placeholder:"Select Country"})]})}),e.jsx(E,{className:"max-h-60",children:b.map(t=>e.jsx(G,{value:t.name,children:t.name},t.isoCode))})]}),e.jsx(v,{type:"button",onClick:p,className:"w-full bg-gradient-to-r from-primary to-accent hover:from-primary/90 hover:to-accent/90 text-white font-medium h-12 text-lg",disabled:r,"data-testid":"button-save-country",children:r?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"h-5 w-5 animate-spin rounded-full border-2 border-current border-t-transparent mr-3"}),"Saving..."]}):"Continue"}),e.jsx("button",{type:"button",onClick:()=>m(),disabled:r,className:"w-full text-sm text-muted-foreground hover:text-foreground transition-colors","data-testid":"button-logout-country-gate",children:"Log out"})]})]})]})]})}export{M as CountryRequiredGate};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.