{"version":3,"file":"DeviceStoreRedirect.B52wp6UC.mjs","names":["useMemo","useCallback","__esmMin","init_ssg_sandbox_shims","navigator","ne","window","init_jsx_runtime","pe","p","init_npm_react_18_3_1","ce","init_framer_BWFVvmND","addPropertyControls","ControlType","DeviceStoreRedirect","props","sanitizedIosUrl","iosUrl","sanitizedAndroidUrl","androidUrl","redirectTo","targetUrl","currentHref","loopKey","autoRedirect","userAgent","platform","maxTouchPoints","isAndroid","isiPhoneOrIPod","isiPad","wrapperStyle","cardStyle","linkStyle","fallbackTitle","iosLabel","androidLabel","init_DeviceStoreRedirect"],"sources":["https:/framerusercontent.com/modules/R0smGcxA5e4Ijuztr11K/w0o1mfRqUUt0jFd6YPBo/DeviceStoreRedirect.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useCallback,useEffect,useMemo}from\"react\";import{addPropertyControls,ControlType}from\"framer\";// User request: Create a utility redirect page component that detects Android vs iPhone/iPad/iPod in the browser and redirects to the correct app store with loop protection, while showing a compact fallback with two accessible links and property controls for urls, labels, title, and auto-redirect behavior.\n/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function DeviceStoreRedirect(props){const{iosUrl,androidUrl,fallbackTitle,iosLabel,androidLabel,autoRedirect}=props;const sanitizedIosUrl=useMemo(()=>iosUrl?.trim()||\"\",[iosUrl]);const sanitizedAndroidUrl=useMemo(()=>androidUrl?.trim()||\"\",[androidUrl]);const redirectTo=useCallback(targetUrl=>{if(typeof window===\"undefined\")return;if(!targetUrl)return;const currentHref=window.location.href;if(currentHref===targetUrl||currentHref.startsWith(targetUrl))return;const loopKey=`device-store-redirect:${window.location.pathname}:${targetUrl}`;const alreadyRedirected=typeof window.sessionStorage!==\"undefined\"?window.sessionStorage.getItem(loopKey)===\"1\":false;if(alreadyRedirected)return;if(typeof window.sessionStorage!==\"undefined\"){window.sessionStorage.setItem(loopKey,\"1\");}window.location.replace(targetUrl);},[]);useEffect(()=>{if(!autoRedirect)return;if(typeof window===\"undefined\"||typeof navigator===\"undefined\")return;const userAgent=navigator.userAgent||\"\";const platform=navigator.platform||\"\";const maxTouchPoints=navigator.maxTouchPoints||0;const isAndroid=/Android/i.test(userAgent);const isiPhoneOrIPod=/iPhone|iPod/i.test(userAgent);const isiPad=/iPad/i.test(userAgent)||platform===\"MacIntel\"&&maxTouchPoints>1;const isIOS=isiPhoneOrIPod||isiPad;if(isAndroid){redirectTo(sanitizedAndroidUrl);return;}if(isIOS){redirectTo(sanitizedIosUrl);}},[autoRedirect,redirectTo,sanitizedAndroidUrl,sanitizedIosUrl]);const wrapperStyle=useMemo(()=>({position:\"relative\",width:\"100%\",height:\"100%\",minHeight:120,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",padding:16,boxSizing:\"border-box\",background:\"transparent\",color:\"#000000\"}),[]);const cardStyle=useMemo(()=>({width:\"100%\",maxWidth:320,borderRadius:12,border:\"1px solid #EEEEEE\",background:\"#FFFFFF\",padding:14,display:\"flex\",flexDirection:\"column\",gap:10,textAlign:\"center\"}),[]);const linkStyle=useMemo(()=>({display:\"block\",width:\"100%\",textDecoration:\"none\",borderRadius:8,border:\"1px solid #EEEEEE\",background:\"#F5F5F5\",color:\"#000000\",padding:\"10px 12px\",fontSize:14,lineHeight:\"1em\",letterSpacing:\"-0.01em\",fontWeight:600,boxSizing:\"border-box\"}),[]);return /*#__PURE__*/_jsx(\"main\",{style:wrapperStyle,children:/*#__PURE__*/_jsxs(\"section\",{style:cardStyle,\"aria-live\":\"polite\",children:[/*#__PURE__*/_jsx(\"p\",{style:{margin:0,fontSize:15,lineHeight:\"1.3em\",letterSpacing:\"-0.01em\",fontWeight:500},children:fallbackTitle}),/*#__PURE__*/_jsx(\"a\",{href:sanitizedIosUrl,style:linkStyle,children:iosLabel}),/*#__PURE__*/_jsx(\"a\",{href:sanitizedAndroidUrl,style:linkStyle,children:androidLabel})]})});}addPropertyControls(DeviceStoreRedirect,{iosUrl:{type:ControlType.Link,title:\"iOS URL\",defaultValue:\"https://apps.apple.com/us/app/tenzr-mobile/id6445857915\"},androidUrl:{type:ControlType.Link,title:\"Android URL\",defaultValue:\"https://play.google.com/store/apps/details?id=com.tenzrhealth.hermes\"},fallbackTitle:{type:ControlType.String,title:\"Title\",defaultValue:\"Opening the right store…\"},iosLabel:{type:ControlType.String,title:\"iOS Label\",defaultValue:\"Download for iPhone or iPad\"},androidLabel:{type:ControlType.String,title:\"Android Label\",defaultValue:\"Download for Android\"},autoRedirect:{type:ControlType.Boolean,title:\"Auto Redirect\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"DeviceStoreRedirect\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./DeviceStoreRedirect.map"],"mappings":"A,+MAIG,SAAwBe,EAAoB,EAAM,CAAC,GAAK,CAAC,SAAO,aAAW,gBAAc,WAAS,eAAa,gBAAcC,EAAYC,EAAgBjB,MAAYkB,GAAQ,KAAK,GAAG,GAAG,CAACA,CAAM,CAAC,EAAQC,EAAoBnB,MAAYoB,GAAY,KAAK,GAAG,GAAG,CAACA,CAAU,CAAC,EAAQC,EAAWpB,EAAY,GAAW,CAAuC,GAA5BK,IAAS,QAAsB,CAACgB,EAAU,OAAO,IAAMC,EAAYjB,EAAO,SAAS,KAAK,GAAGiB,IAAcD,GAAWC,EAAY,WAAWD,CAAS,EAAE,OAAO,IAAME,EAAQ,yBAAyBlB,EAAO,SAAS,SAAS,GAAGgB,KAA2ChB,EAAO,iBAAiB,QAAYA,EAAO,eAAe,QAAQkB,CAAO,IAAI,OAAgDlB,EAAO,iBAAiB,QAAaA,EAAO,eAAe,QAAQkB,EAAQ,GAAG,EAAGlB,EAAO,SAAS,QAAQgB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