{"version":3,"file":"Function.C0hT2Nq4.mjs","names":["useState","useEffect","useEffect","_jsx","__esmMin","init_ssg_sandbox_shims","init_npm_react_18_3_1","init_jsx_runtime","c","ce","_e","useObserveData","init_framer_ChujFWHC","createStore","state1","dataStore","Data","setDataStore","newState","storeState","storeSetters","setStoreState","setter","useStore","state","setState","init_createStore","init_store_js__1_0","getPropertiesByTag","init_Utilities","elemProps","elementTag","key","childrenProps","result","init_Utilities_LgUQ","getTitles","Component","props","store","setStore","html","content","ptagProps","atagProps","headings","headingsArray","i","element","SearchShortcutKey","handleKeyDown","event","e","input","init_Function"],"sources":["https:/framerusercontent.com/modules/vj7bFUjvEQFgEzNBkdoG/vf3CKm378wlVcBk7IhSU/createStore.js","https:/framer.com/m/framer/store.js@^1.0.0","https:/framerusercontent.com/modules/1rYQMgPBy2BHwN1a8Z5O/YgTH7d8XoflBisXAiR7m/Utilities.js","https:/framer.com/m/Utilities-LgUQ.js@YgTH7d8XoflBisXAiR7m","https:/framerusercontent.com/modules/5Zw7qJ6zQVnKUBGcyIon/Ri9scuWEPSipk2U3P8Ok/Function.js"],"sourcesContent":["import{useState,useEffect}from\"react\";import{Data,useObserveData}from\"framer\";export function createStore(state1){// Use Data so that a Preview reload resets the state\nconst dataStore=Data({state:Object.freeze({...state1})});// Create a set function that updates the state\nconst setDataStore=newState=>{// If the state is an object, make sure we copy it\nif(typeof newState===\"function\"){newState=newState(dataStore.state);}dataStore.state=Object.freeze({...dataStore.state,...newState});};// Store the initial state, copy the object if it's an object\nlet storeState=typeof state1===\"object\"?Object.freeze({...state1}):state1;// Keep a list of all the listeners, in the form of React hook setters\nconst storeSetters=new Set();// Create a set function that updates all the listeners / setters\nconst setStoreState=newState=>{// If the state is an object, make sure we copy it\nif(typeof newState===\"function\"){newState=newState(storeState);}storeState=typeof newState===\"object\"?Object.freeze({...storeState,...newState}):newState;// Update all the listeners / setters with the new value\nstoreSetters.forEach(setter=>setter(storeState));};// Create the actual hook based on everything above\nfunction useStore(){// Create the hook we are going to use as a listener\nconst[state,setState]=useState(storeState);// If we unmount the component using this hook, we need to remove the listener\n// @ts-ignore\nuseEffect(()=>{// But right now, we need to add the listener\nstoreSetters.add(setState);return()=>storeSetters.delete(setState);},[]);// If Data context exists, use Data, otherwise use vanilla React state\nif(useObserveData()===true){useObserveData();return[dataStore.state,setDataStore];}else{// Return the state and a function to update the central store\nreturn[state,setStoreState];}}return useStore;}\nexport const __FramerMetadata__ = {\"exports\":{\"createStore\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./createStore.map","/*\n * createStore (framer/store@1.0.1)\n *\n * Learn More: https://www.framer.com/asset-urls\n */\n\nexport * from \"https://framerusercontent.com/modules/vj7bFUjvEQFgEzNBkdoG/vf3CKm378wlVcBk7IhSU/createStore.js\"\n","/**\n * Reusable framer utilities\n * @description This file contains utility functions which can be used in any code-overides or\n * code-components in framer.\n * @author Manjunath\n * @see {@link https://manjumjn.com/}\n *//**\n * These annotations control how your component sizes\n * Learn more: https://www.framer.com/developers/#code-components-auto-sizing\n *\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */import{jsx as _jsx}from\"react/jsx-runtime\";export default function Utilities(props){return /*#__PURE__*/_jsx(\"div\",{});}/**\n * Get element props by tag inside the component\n * @param {Object} elementProps Component props\n * @param {String} elementTag Tag of props to be returned. Eg: a, div, p\n * @returns {Object} props of the `elementTag`\n */export const getPropertiesByTag=(elemProps,elementTag)=>{// Check if the current object is of the target type\nif(elemProps.type===elementTag){return elemProps;}// Iterate through object properties that can hold nested objects (children and props)\nfor(const key of[\"children\",\"props\"]){if(elemProps[key]&&typeof elemProps[key]===\"object\"){// Check if props has more children, if so get first one\nconst childrenProps=Array.isArray(elemProps[key])?elemProps[key][0]:elemProps[key];// Recursively search for the target type within the nested object\nconst result=getPropertiesByTag(childrenProps,elementTag);if(result){return result;}}}// Not found in current object or its children/props\nreturn null;};\nexport const __FramerMetadata__ = {\"exports\":{\"getPropertiesByTag\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"default\":{\"type\":\"reactComponent\",\"name\":\"Utilities\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"auto\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Utilities.map","/*\n * Utilities\n *\n * Learn More: https://www.framer.com/asset-urls\n */\n\nexport * from \"https://framerusercontent.com/modules/1rYQMgPBy2BHwN1a8Z5O/YgTH7d8XoflBisXAiR7m/Utilities.js\"\nexport { default } from \"https://framerusercontent.com/modules/1rYQMgPBy2BHwN1a8Z5O/YgTH7d8XoflBisXAiR7m/Utilities.js\"\n","import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef,useState}from\"react\";import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";import{getPropertiesByTag}from\"https://framer.com/m/Utilities-LgUQ.js@YgTH7d8XoflBisXAiR7m\";const useStore=createStore({titles:[],chagedLink:false,className:\"\",pTagStyle:{},pTagClass:\"\",aTagClass:\"\"});function getSecondPart(str){return str.split(\"/\")[1];}export function getLinks(Component){return props=>{const[boolean,setBoolean]=useState(false);const[store,setStore]=useStore();const Link=useRef(null);useEffect(()=>{setBoolean(window.location.href.includes(props.link));setStore({chagedLink:true});},[]);props.className+=\" sidebar-link\";return /*#__PURE__*/_jsx(Component,{...props,variant:boolean?\"Select\":\"Default\",ref:Link});};}export function getTitles(Component){return props=>{const[store,setStore]=useStore();useEffect(()=>{var _ptagProps_props,_ptagProps_props1,_atagProps_props;var html=document.querySelector(\"html\");html.style.scrollBehavior=\"smooth\";var content=document.getElementById(\"content-data\");if(!content){return;}const ptagProps=getPropertiesByTag(props,\"p\");const atagProps=getPropertiesByTag(ptagProps||{},\"a\");var headings=content.querySelectorAll(\"h2\");var headingsArray=[];for(let i=0;i<headings.length;i++){const element=headings[i];element.style.position=\"relative\";element.insertAdjacentHTML(\"beforeend\",`<span id=\"title-${i}\" style=\"position: absolute; top:-144px;\"></span>`);headingsArray.push(element.innerText.replace(/(\\r\\n|\\n|\\r)/gm,\"\"));}setStore({titles:headingsArray,pTagStyle:(ptagProps===null||ptagProps===void 0?void 0:(_ptagProps_props=ptagProps.props)===null||_ptagProps_props===void 0?void 0:_ptagProps_props.style)||{},pTagClass:(ptagProps===null||ptagProps===void 0?void 0:(_ptagProps_props1=ptagProps.props)===null||_ptagProps_props1===void 0?void 0:_ptagProps_props1.className)||\"\",aTagClass:(atagProps===null||atagProps===void 0?void 0:(_atagProps_props=atagProps.props)===null||_atagProps_props===void 0?void 0:_atagProps_props.className)||\"\"});},[]);const divStyles={display:\"flex\",flexDirection:\"column\",gap:\"12px\"};return /*#__PURE__*/_jsx(\"div\",{style:divStyles,children:Array.isArray(store.titles)?store.titles.map((element,i)=>{return element&&/*#__PURE__*/_jsx(\"p\",{className:`framer-text ${store.pTagClass}`,style:store.pTagStyle,children:/*#__PURE__*/_jsx(\"a\",{href:\"#title-\"+i,className:`framer-text ${store.aTagClass}`,children:element},i)});}):null});};}export function setActiveStateFromLink(Component){return props=>{const card=useRef(null);const[boolean,setBoolean]=useState(false);useEffect(()=>{var _card_current;var cardHref=(_card_current=card.current)===null||_card_current===void 0?void 0:_card_current.getAttribute(\"href\");if(!cardHref)return;setBoolean(String(window.location.href).includes(getSecondPart(String(cardHref))));},[]);props.className+=\" collection-card\";return /*#__PURE__*/_jsx(Component,{...props,ref:card,variant:boolean?\"Select\":\"Default\"});};}export function SearchShortcutKey(Component){function handleKeyDown(event){var e=event;console.log(e);console.log(e.keyCode);console.log(e.metaKey);console.log(e.key);if(e.keyCode===75&&e.altKey||// (e.keyCode === 75 && e.ctrlKey) ||\ne.keyCode===75&&e.metaKey){console.log(\"search\");var input=document.querySelector(\".search-input button\");console.log(input);input.click();}}return props=>{useEffect(()=>{document.addEventListener(\"keydown\",handleKeyDown);var input=document.querySelector(\".search-input\");console.log(input);console.log(\"useeffect\");},[]);props.className+=\" search-input\";return /*#__PURE__*/_jsx(Component,{...props});};}\nexport const __FramerMetadata__ = {\"exports\":{\"setActiveStateFromLink\":{\"type\":\"reactHoc\",\"name\":\"setActiveStateFromLink\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"SearchShortcutKey\":{\"type\":\"reactHoc\",\"name\":\"SearchShortcutKey\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"getTitles\":{\"type\":\"reactHoc\",\"name\":\"getTitles\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"getLinks\":{\"type\":\"reactHoc\",\"name\":\"getLinks\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Function.map"],"mappings":"A,oLAA8E,SAAgBa,EAAYC,EAAO,CACjH,IAAMC,EAAUC,EAAK,CAAC,MAAM,OAAO,OAAO,CAAC,GAAGF,CAAM,CAAC,CAAC,CAAC,EACjDG,EAAaC,GAAU,CAC1B,OAAOA,GAAW,aAAYA,EAASA,EAASH,EAAU,KAAK,GAAGA,EAAU,MAAM,OAAO,OAAO,CAAC,GAAGA,EAAU,MAAM,GAAGG,CAAQ,CAAC,CAAE,EACjIC,EAAW,OAAOL,GAAS,SAAS,OAAO,OAAO,CAAC,GAAGA,CAAM,CAAC,EAAEA,EAC7DM,kBAAa,IAAI,IACjBC,EAAcH,GAAU,CAC3B,OAAOA,GAAW,aAAYA,EAASA,EAASC,CAAU,GAAGA,EAAW,OAAOD,GAAW,SAAS,OAAO,OAAO,CAAC,GAAGC,EAAW,GAAGD,CAAQ,CAAC,EAAEA,EACjJE,EAAa,QAAQE,GAAQA,EAAOH,CAAU,CAAC,CAAE,EACjD,SAASI,GAAU,CACnB,GAAK,CAACC,EAAMC,GAAUzB,EAASmB,CAAU,EAKzC,OAHAlB,OACAmB,EAAa,IAAIK,CAAQ,MAAYL,EAAa,OAAO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