{"version":3,"file":"StoreButtons.bISchOl2.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/6wqWmjfvdNBXqJOHf35Q/YJpEynI6LV7rrvwJywo2/Platform.js","https:/framerusercontent.com/modules/GqOW1Ug8ZbfAOXQRGAZA/QtLRX6VDa6nksbnukrks/StoreButtons.js"],"sourcesContent":["/**\n * Works out which app store a visitor should be sent to.\n *\n *   iPhone, iPod, iPad (including iPadOS in \"desktop site\" mode) -> \"ios\"\n *   Android phones and tablets                                     -> \"android\"\n *   Windows, Mac, Linux, ChromeOS, anything unknown                -> \"other\"\n *\n * \"other\" means there is no store to open on that device, so callers show both\n * buttons (and a QR code) instead of guessing.\n */export const IOS_URL=\"https://apps.apple.com/in/app/kurrent-charge/id1546715144\";export const ANDROID_URL=\"https://play.google.com/store/apps/details?id=com.namp.kurrent\";export function detectPlatform(userAgent,platform=\"\",maxTouchPoints=0){// Check Android first: some Android UAs also contain \"like iPhone\" style text in webviews.\nif(/android/i.test(userAgent))return\"android\";if(/iPhone|iPad|iPod/i.test(userAgent))return\"ios\";// iPadOS 13+ in desktop mode reports itself as a Mac, but a real Mac has no touch screen.\nif((platform===\"MacIntel\"||/Macintosh/i.test(userAgent))&&maxTouchPoints>1)return\"ios\";return\"other\";}/** Browser-only helper. Returns \"other\" during server rendering. */export function detectCurrentPlatform(){if(typeof navigator===\"undefined\")return\"other\";return detectPlatform(navigator.userAgent,navigator.platform,navigator.maxTouchPoints);}\nexport const __FramerMetadata__ = {\"exports\":{\"detectPlatform\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"detectCurrentPlatform\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"Platform\":{\"type\":\"tsType\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"ANDROID_URL\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"IOS_URL\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Platform.map","import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{ANDROID_URL,IOS_URL,detectCurrentPlatform}from\"https://framerusercontent.com/modules/6wqWmjfvdNBXqJOHf35Q/YJpEynI6LV7rrvwJywo2/Platform.js\";const ORANGE=\"#E64C2A\";const ORANGE_DEEP=\"#C23A1C\";const CREAM=\"#F1EFEB\";const INK=\"#161616\";function AppleIcon({size}){return /*#__PURE__*/_jsxs(\"svg\",{width:size,height:size,viewBox:\"0 0 24 24\",\"aria-hidden\":\"true\",style:{display:\"block\",flexShrink:0},children:[/*#__PURE__*/_jsx(\"rect\",{x:\"1.5\",y:\"1.5\",width:\"21\",height:\"21\",rx:\"5.2\",fill:\"#0A84FF\"}),/*#__PURE__*/_jsx(\"svg\",{x:\"5\",y:\"5\",width:\"14\",height:\"14\",viewBox:\"0 0 24 24\",\"aria-hidden\":\"true\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M8.8086 14.9194l6.1107-11.0368c.0837-.1513.1682-.302.2437-.4584.0685-.142.1267-.2854.1646-.4403.0803-.3259.0588-.6656-.066-.9767-.1238-.3095-.3417-.5678-.6201-.7355a1.4175 1.4175 0 0 0-.921-.1924c-.3207.043-.6135.1935-.8443.4288-.1094.1118-.1996.2361-.2832.369-.092.1463-.175.2979-.259.4492l-.3864.6979-.3865-.6979c-.0837-.1515-.1667-.303-.2587-.4492-.0837-.1329-.1739-.2572-.2835-.369-.2305-.2353-.5233-.3857-.844-.429a1.4181 1.4181 0 0 0-.921.1926c-.2784.1677-.4964.426-.6203.7355-.1246.311-.1461.6508-.066.9767.038.155.0962.2984.1648.4403.0753.1564.1598.307.2437.4584l1.248 2.2543-4.8625 8.7825H2.0295c-.1676 0-.3351-.0007-.5026.0092-.1522.009-.3004.0284-.448.0714-.3108.0906-.5822.2798-.7783.548-.195.2665-.3006.5929-.3006.9279 0 .3352.1057.6612.3006.9277.196.2683.4675.4575.7782.548.1477.043.296.0623.4481.0715.1675.01.335.009.5026.009h13.0974c.0171-.0357.059-.1294.1-.2697.415-1.4151-.6156-2.843-2.0347-2.843zM3.113 18.5418l-.7922 1.5008c-.0818.1553-.1644.31-.2384.4705-.067.1458-.124.293-.1611.452-.0785.3346-.0576.6834.0645 1.0029.1212.3175.3346.583.607.7549.2727.172.5891.2416.9013.1975.3139-.044.6005-.1986.8263-.4402.1072-.1148.1954-.2424.2772-.3787.0902-.1503.1714-.3059.2535-.4612L6 19.4636c-.0896-.149-.9473-1.4704-2.887-.9218m20.5861-3.0056a1.4707 1.4707 0 0 0-.779-.5407c-.1476-.0425-.2961-.0616-.4483-.0705-.1678-.0099-.3352-.0091-.503-.0091H18.648l-4.3891-7.817c-.6655.7005-.9632 1.485-1.0773 2.1976-.1655 1.0333.0367 2.0934.546 3.0004l5.2741 9.3933c.084.1494.167.299.2591.4435.0837.131.1739.2537.2836.364.231.2323.5238.3809.8449.4232.3192.0424.643-.0244.9217-.1899.2784-.1653.4968-.4204.621-.7257.1246-.3072.146-.6425.0658-.9641-.0381-.1529-.0962-.2945-.165-.4346-.0753-.1543-.1598-.303-.2438-.4524l-1.216-2.1662h1.596c.1677 0 .3351.0009.5029-.009.1522-.009.3007-.028.4483-.0705a1.4707 1.4707 0 0 0 .779-.5407A1.5386 1.5386 0 0 0 24 16.452a1.539 1.539 0 0 0-.3009-.9158Z\",fill:\"#FFFFFF\"})})]});}function PlayIcon({size}){return /*#__PURE__*/_jsxs(\"svg\",{width:size,height:size,viewBox:\"0 0 24 24\",\"aria-hidden\":\"true\",style:{display:\"block\",flexShrink:0},children:[/*#__PURE__*/_jsx(\"path\",{d:\"M22.018 13.298l-3.919 2.218-3.515-3.493 3.543-3.521 3.891 2.202a1.49 1.49 0 0 1 0 2.594z\",fill:\"#FBBC04\"}),/*#__PURE__*/_jsx(\"path\",{d:\"M1.337.924a1.486 1.486 0 0 0-.112.568v21.017c0 .217.045.419.124.6l11.155-11.087L1.337.924z\",fill:\"#4285F4\"}),/*#__PURE__*/_jsx(\"path\",{d:\"M13.544 10.989l3.258-3.238L3.45.195a1.466 1.466 0 0 0-.946-.179l11.04 10.973z\",fill:\"#34A853\"}),/*#__PURE__*/_jsx(\"path\",{d:\"M13.544 13.056l-11 10.933c.298.036.612-.016.906-.183l13.324-7.54-3.23-3.21z\",fill:\"#EA4335\"})]});}export default function StoreButtons(props){const{iosLabel,androidLabel,direction,align,onDark,size,gap,labelFont,style}=props;// Server and first paint use \"other\" so the page matches what the server rendered.\nconst[platform,setPlatform]=useState(\"other\");const[hover,setHover]=useState(null);useEffect(()=>{setPlatform(detectCurrentPlatform());},[]);const pad=size===\"large\"?\"16px 28px\":\"13px 22px\";const iconSize=size===\"large\"?22:19;function look(which){const primary=platform===which;const hovered=hover===which;if(primary){return{background:hovered?ORANGE_DEEP:ORANGE,color:CREAM};}if(onDark){return{background:hovered?\"rgba(241,239,235,0.22)\":\"rgba(241,239,235,0.12)\",color:CREAM};}return{background:hovered?\"rgba(22,22,22,0.14)\":\"rgba(22,22,22,0.08)\",color:INK};}const base={display:\"inline-flex\",alignItems:\"center\",justifyContent:\"center\",gap:10,padding:pad,borderRadius:100,textDecoration:\"none\",whiteSpace:\"nowrap\",cursor:\"pointer\",transition:\"background-color 0.2s cubic-bezier(0.44, 0, 0.56, 1)\",...labelFont};const justify=align===\"start\"?\"flex-start\":align===\"end\"?\"flex-end\":\"center\";const isRow=direction===\"row\";return /*#__PURE__*/_jsx(\"div\",{style:{...style,display:\"flex\",justifyContent:justify,alignItems:\"center\"},children:/*#__PURE__*/_jsxs(\"div\",{style:{display:\"grid\",width:\"max-content\",maxWidth:\"100%\",gridTemplateColumns:isRow?\"repeat(2, 1fr)\":\"1fr\",gap},children:[/*#__PURE__*/_jsxs(\"a\",{href:IOS_URL,target:\"_blank\",rel:\"noopener noreferrer\",\"aria-label\":\"Download Kurrent Charge for iPhone on the App Store\",onMouseEnter:()=>setHover(\"ios\"),onMouseLeave:()=>setHover(null),style:{...base,...look(\"ios\"),boxSizing:\"border-box\",width:\"100%\",minWidth:0},children:[/*#__PURE__*/_jsx(AppleIcon,{size:iconSize}),/*#__PURE__*/_jsx(\"span\",{children:iosLabel})]}),/*#__PURE__*/_jsxs(\"a\",{href:ANDROID_URL,target:\"_blank\",rel:\"noopener noreferrer\",\"aria-label\":\"Download Kurrent Charge for Android on Google Play\",onMouseEnter:()=>setHover(\"android\"),onMouseLeave:()=>setHover(null),style:{...base,...look(\"android\"),boxSizing:\"border-box\",width:\"100%\",minWidth:0},children:[/*#__PURE__*/_jsx(PlayIcon,{size:iconSize}),/*#__PURE__*/_jsx(\"span\",{children:androidLabel})]})]})});}StoreButtons.defaultProps={iosLabel:\"Download for iOS\",androidLabel:\"Download for Android\",direction:\"row\",align:\"start\",onDark:true,size:\"medium\",gap:12};addPropertyControls(StoreButtons,{iosLabel:{type:ControlType.String,title:\"iOS label\",defaultValue:\"Download for iOS\"},androidLabel:{type:ControlType.String,title:\"Android label\",defaultValue:\"Download for Android\"},direction:{type:ControlType.Enum,title:\"Direction\",options:[\"row\",\"column\"],optionTitles:[\"Row\",\"Column\"],defaultValue:\"row\",displaySegmentedControl:true},align:{type:ControlType.Enum,title:\"Align\",options:[\"start\",\"center\",\"end\"],optionTitles:[\"Start\",\"Center\",\"End\"],defaultValue:\"start\",displaySegmentedControl:true},onDark:{type:ControlType.Boolean,title:\"Background\",enabledTitle:\"Dark\",disabledTitle:\"Light\",defaultValue:true},size:{type:ControlType.Enum,title:\"Size\",options:[\"medium\",\"large\"],optionTitles:[\"Medium\",\"Large\"],defaultValue:\"medium\",displaySegmentedControl:true},gap:{type:ControlType.Number,title:\"Gap\",defaultValue:12,min:0,max:40,unit:\"px\"},labelFont:{type:ControlType.Font,title:\"Label font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"16px\",variant:\"Semibold\",lineHeight:\"1em\",letterSpacing:\"0em\"}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"StoreButtons\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./StoreButtons.map"],"mappings":"4LAS8K,SAAgB,EAAe,EAAU,EAAS,GAAG,EAAe,EAAE,CAE7J,MADpF,WAAW,KAAK,CAAS,EAAQ,UAAa,oBAAoB,KAAK,CAAS,IAC/E,IAAW,YAAY,aAAa,KAAK,CAAS,IAAI,EAAe,EAAQ,MAAY,OAAQ,CAAqE,SAAgB,GAAuB,CAAiD,OAAtC,IAAY,OAAkB,QAAe,EAAe,EAAU,UAAU,EAAU,SAAS,EAAU,cAAc,CAAE,uBAFzU,EAAQ,4DAAyE,EAAY,oECTsR,SAAS,EAAU,CAAC,QAAM,CAAC,OAAoB,EAAM,MAAM,CAAC,MAAM,EAAK,OAAO,EAAK,QAAQ,YAAY,cAAc,OAAO,MAAM,CAAC,QAAQ,QAAQ,WAAW,CAAC,EAAE,SAAS,CAAc,EAAK,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,MAAM,KAAK,OAAO,KAAK,GAAG,MAAM,KAAK,SAAS,CAAC,EAAe,EAAK,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,MAAM,KAAK,OAAO,KAAK,QAAQ,YAAY,cAAc,OAAO,SAAsB,EAAK,OAAO,CAAC,EAAE,o2DAAo2D,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAE,CAAC,SAAS,EAAS,CAAC,QAAM,CAAC,OAAoB,EAAM,MAAM,CAAC,MAAM,EAAK,OAAO,EAAK,QAAQ,YAAY,cAAc,OAAO,MAAM,CAAC,QAAQ,QAAQ,WAAW,CAAC,EAAE,SAAS,CAAc,EAAK,OAAO,CAAC,EAAE,2FAA2F,KAAK,SAAS,CAAC,EAAe,EAAK,OAAO,CAAC,EAAE,6FAA6F,KAAK,SAAS,C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