{"version":3,"file":"WithProteinDownload.CiMmsMbF.mjs","names":["pageKey"],"sources":["https:/framerusercontent.com/modules/Lh1NlRDGmpeA7Z3RpuvE/lErvIFQQXMPhjGL8sWfm/WithProteinDownload.js"],"sourcesContent":["/**\n * 단백질 다운로드 데모를 위한 단백질 결과 pdf구현 샘플 코드\n */import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef}from\"react\";//페이지 키로 변경\nconst normalizePageKey=pathname=>{const key=pathname.trim().toLowerCase();if(key===\"s-iv\")return\"iv\";if(key===\"s-pav\")return\"pav\";if(key===\"s-final-report\")return\"final\";if(key===\"s-target-selection\")return\"all\";return null;};//depth로 path가 구성될 경우 마지막 세그먼트 기준으로 parsing\nconst getCurrentPageKey=()=>{const pathname=window.location.pathname.replace(/\\/+$/,\"\")// 뒤 슬래시 제거\n;const segments=pathname.split(\"/\").filter(Boolean);const last=segments[segments.length-1]||\"index\";return normalizePageKey(last);};//단백질 코드에 특수문제 있을경우 제거\nconst toSafeCode=()=>{const currentParams=new URLSearchParams(window.location.search);const code=currentParams.get(\"code\");return String(code??\"\").trim().replace(/\\s+/g,\"-\").replace(/[^a-zA-Z0-9-_]/g,\"\");};//클릭시 새창 오픈\nexport function withProteinDownload(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const{code,tracking,...rest}=props;const handleClick=()=>{const pageKey=getCurrentPageKey();if(!pageKey)return;const safe=toSafeCode();if(!safe)return;const url=LINK_MAP[pageKey]?.[safe];if(!url)return;if(tracking){//gtm 트래킹 sitesetting > genernal에 정의\nwindow.handleDemoEvent(tracking);}window.open(url,\"_blank\",\"noopener,noreferrer\");};return /*#__PURE__*/_jsx(Component,{ref:ref,...rest,onClick:handleClick});});}export function withProteinDownloadByTypeParameter(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const{code,tracking,...rest}=props;const handleClick=()=>{const currentParams=new URLSearchParams(window.location.search);const pageKey=currentParams.get(\"type\");if(!pageKey)return;const safe=toSafeCode();const url=getDownloadUrl(pageKey,safe);if(!url)return;if(tracking){//gtm 트래킹 sitesetting > genernal에 정의\nwindow.handleDemoEvent(tracking);}window.open(url,\"_blank\",\"noopener,noreferrer\");};return /*#__PURE__*/_jsx(Component,{ref:ref,...rest,onClick:handleClick});});}function currentUrlParameterMerge(baseUrl){const target=new URL(baseUrl,window.location.origin);const currentParams=new URLSearchParams(window.location.search);// 현재 페이지의 쿼리 파라미터를 baseUrl에 병합\ncurrentParams.forEach((value,key)=>{if(!target.searchParams.has(key)){target.searchParams.set(key,value);}});return target;}function getDownloadUrl(pageKey,code){if(pageKey===\"all\"){return\"https://drive.google.com/file/d/1k2CkPQog7wNyPmuNjSu7iX_92lH3LdWQ/view?usp=sharing\";}return LINK_MAP[pageKey]?.[code];}// downloaded 쿠키 읽기 전용\nfunction hasDownloadedCookie(){return document.cookie.split(\"; \").some(part=>part.trim().startsWith(\"downloaded=\"));}export function routingPage(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const{code,link,tracking,...rest}=props;const handleClick=()=>{const isDownloaded=hasDownloadedCookie();const pageKey=getCurrentPageKey();if(isDownloaded){const pageKey=getCurrentPageKey()//현재 url 키 기준으로 Parsing\n;if(!pageKey)return;const safe=toSafeCode();const url=getDownloadUrl(pageKey,safe);if(!url)return;if(tracking){//gtm 트래킹 sitesetting > genernal에 정의\nwindow.handleDemoEvent(tracking);}window.open(url,\"_blank\",\"noopener,noreferrer\");return;}const target=currentUrlParameterMerge(\"/simulator\");//const nextPageKey = navigatePageKey() //다음 이동할 페이지키 구분 (현재 url 기준으로 다음단계의 key 정의)\nif(pageKey){target.searchParams.set(\"type\",pageKey);}window.open(target.toString(),\"_blank\",\"noopener,noreferrer\");};return /*#__PURE__*/_jsx(Component,{ref:ref,...rest,onClick:handleClick});});}const LINK_MAP={iv:{tnks2:\"https://framerusercontent.com/assets/6Z8vQfsoSpcs2L3cLcbkJsSU4.pdf\",p38:\"https://framerusercontent.com/assets/KZyszZ3SjQIkNBZFDEQEAjaKWY0.pdf\",shp2:\"https://framerusercontent.com/assets/qD9PJmA0yzPPZxXxQn7ul1SuNY.pdf\",bace:\"https://framerusercontent.com/assets/GcCSm74bmZL5NzGpqy5Aw5cqyE.pdf\",mcl1:\"https://framerusercontent.com/assets/nuUrBEcKGSxbdAqOOLiY4rjYo.pdf\",pfkfb3:\"https://framerusercontent.com/assets/pg1qZniK5P0Sga57YmVMTwfHaM.pdf\",ptp1b:\"https://framerusercontent.com/assets/yKJJtdQPLRq3e7CyA4JKkJlM.pdf\",eg5:\"https://framerusercontent.com/assets/ZnloFUGrHVMdFxOivmWPkEwLM.pdf\",hif2a:\"https://framerusercontent.com/assets/SEbdjrPJSgwtlCtiXSdWHobA.pdf\",cmet:\"https://framerusercontent.com/assets/fjLWoOG3aJVJZ49vjyNlPDEQ7LA.pdf\",cdk2:\"https://framerusercontent.com/assets/AqAZecAJp14oagGi3KdJnaOkc3Q.pdf\",syk:\"https://framerusercontent.com/assets/5aBRhykDeZVVgNtBY730vkzDOjQ.pdf\"},pav:{tnks2:\"https://framerusercontent.com/assets/N6OZ24ElROr4RaHelvB43zOyo.pdf\",p38:\"https://framerusercontent.com/assets/pQ2vkDJbVlp5i5rLg9xEce7HOk.pdf\",shp2:\"https://framerusercontent.com/assets/sMTGIvXFZnKjhj5yZYcPKZJKBs.pdf\",bace:\"https://framerusercontent.com/assets/SgmeMa45nQyAixpZipkirSWsow.pdf\",mcl1:\"https://framerusercontent.com/assets/wbUkTW06eG3U0CReyUqlC68HQ9U.pdf\",pfkfb3:\"https://framerusercontent.com/assets/QXklutaiSOLQh6soddvYRNObKQ.pdf\",ptp1b:\"https://framerusercontent.com/assets/eQ0PeYgn28MPnF8Zzs0q9zPLmaU.pdf\",eg5:\"https://framerusercontent.com/assets/gZ3ZBvxef56f49IAMPBmXGrtk.pdf\",hif2a:\"https://framerusercontent.com/assets/PdJYelHG3OSU00LLDoVxW54kNRI.pdf\",cmet:\"https://framerusercontent.com/assets/2eYcNEeWKOmrEGWg5jrmzeBe2TY.pdf\",cdk2:\"https://framerusercontent.com/assets/wGEcUPY7FKgGUg2kKNJhrtZA.pdf\",syk:\"https://framerusercontent.com/assets/eNZ2s8VTU1tzRQjtiCsmrxOYcg.pdf\"},final:{tnks2:\"https://framerusercontent.com/assets/M9QFpDUX8qPbLylemNkAAJqRD4.pdf\",p38:\"https://framerusercontent.com/assets/UyDgGsVYqQiaCYfuiOAgiB2FNM.pdf\",shp2:\"https://framerusercontent.com/assets/e0I1Q6dFbyBPoHIi31s5oWNTx4.pdf\",bace:\"https://framerusercontent.com/assets/QCBjy50cHNSNkGEm69h1SDvOfzM.pdf\",mcl1:\"https://framerusercontent.com/assets/8GRXBPTTh3PDBd4uTjyIZMhN20.pdf\",pfkfb3:\"https://framerusercontent.com/assets/qFSX3DCo5rVjRJA1uewpGLxJ4w.pdf\",ptp1b:\"https://framerusercontent.com/assets/nq8ohuP3IcPq3NGTN6nCtqQTrI.pdf\",eg5:\"https://framerusercontent.com/assets/ZwhKdiAbsCwhcqTW4w6TEmdJ8U.pdf\",hif2a:\"https://framerusercontent.com/assets/NHSZzOMzJecZ11JafApQYPsGj9E.pdf\",cmet:\"https://framerusercontent.com/assets/9x9qEsx2Jay2Mc946BsfEyaxAxA.pdf\",cdk2:\"https://framerusercontent.com/assets/ioDCwhoV0OW3Adib86ipqEYfWo.pdf\",syk:\"https://framerusercontent.com/assets/t4iJJnTzbaPGOI5tc8sZ8GU4.pdf\"}};\nexport const __FramerMetadata__ = {\"exports\":{\"routingPage\":{\"type\":\"reactHoc\",\"name\":\"routingPage\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withProteinDownload\":{\"type\":\"reactHoc\",\"name\":\"withProteinDownload\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withProteinDownloadByTypeParameter\":{\"type\":\"reactHoc\",\"name\":\"withProteinDownloadByTypeParameter\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./WithProtein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