{"version":3,"file":"utils.CihUUGEg.mjs","names":["useMemo","useState"],"sources":["https:/framerusercontent.com/modules/19BkzxjVBT3VP0Ykl3DY/RGqU3tpLfAWuPhUCcIcu/types.js","https:/framerusercontent.com/modules/HpmklHRFex5a5HMDftQo/68qKhfBFUFzEc5l3sS28/SuspenseValue.js","https:/framerusercontent.com/modules/IdMJ4CymCWCh4cOBkZlb/JaBD733GrAZQYolmaTcm/utils.js"],"sourcesContent":["export const sandpackDefaultLanguages=[\"JavaScript\",\"JSX\",\"TypeScript\",\"TSX\",\"CSS\",\"SCSS\",\"Less\",\"HTML\"];export const supportedLanguages=[\"Angular\",\"C\",\"C#\",\"C++\",\"CSS\",\"Go\",\"Haskell\",\"HTML\",\"Java\",\"JavaScript\",\"JSX\",\"Julia\",\"Kotlin\",\"Less\",\"Lua\",\"Markdown\",\"MATLAB\",\"Nginx\",\"Objective-C\",\"Perl\",\"PHP\",\"Python\",\"Ruby\",\"Rust\",\"Scala\",\"SCSS\",\"Shell\",\"SQL\",\"Swift\",\"TSX\",\"TypeScript\",\"Vue\",\"YAML\"];\nexport const __FramerMetadata__ = {\"exports\":{\"BorderProperties\":{\"type\":\"tsType\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"BorderPropertiesOld\":{\"type\":\"tsType\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"SupportedLanguages\":{\"type\":\"tsType\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"FontProperties\":{\"type\":\"tsType\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"supportedLanguages\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"sandpackDefaultLanguages\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"BorderRadiusProperties\":{\"type\":\"tsType\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"PaddingProperties\":{\"type\":\"tsType\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./types.map","function _define_property(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}export class SuspenseValue{read(){const status=this.status;// The component did rerender and we already set the status below.\nif(status){switch(status.type){// If the promise is still pending we need to suspend again.\ncase\"pending\":throw status.promise;// If the promise is fulfilled we can return the value\n// synchronously.\ncase\"fulfilled\":return status.value;// If the promise was rejected we can throw the error so we can\n// catch it with an ErrorBoundary in an ancestor.\ncase\"rejected\":throw status.reason;}}// Attach a callback to the promise to store the resolved value or the error\n// on the promise so we can synchronously read it later.\nconst promise=this.resolver().then(value=>{this.status={type:\"fulfilled\",value};},reason=>{this.status={type:\"rejected\",reason};});// This is the first time the promise is passed into the function. We set\n// the status field so we can early return above.\nthis.status={type:\"pending\",promise};// We throw the promise to suspend rendering. React will wait until the\n// promise is settled and rerender the component afterwards. When React\n// rerenders the component we can return the value in the code above.\nthrow promise;}constructor(resolver){_define_property(this,\"resolver\",void 0);_define_property(this,\"status\",void 0);this.resolver=resolver;}}\nexport const __FramerMetadata__ = {\"exports\":{\"SuspenseValue\":{\"type\":\"class\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SuspenseValue.map","import{Color,RenderTarget,clampRGB}from\"framer\";import{useState,useMemo}from\"react\";export function getFileExtensions(language){switch(language){case\"JavaScript\":return[\"js\"];case\"JSX\":return[\"jsx\"];case\"TypeScript\":return[\"ts\"];case\"TSX\":return[\"tsx\"];case\"CSS\":return[\"css\"];case\"SCSS\":return[\"scss\"];case\"Less\":return[\"less\"];case\"HTML\":return[\"html\",\"htm\"];case\"Angular\":return[\"ts\"];case\"C\":return[\"c\"];case\"C#\":return[\"cs\"];case\"C++\":return[\"cpp\",\"cxx\",\"cc\",\"h\",\"hpp\"];case\"Go\":return[\"go\"];case\"Haskell\":return[\"hs\"];case\"Java\":return[\"java\"];case\"Julia\":return[\"jl\"];case\"Kotlin\":return[\"kt\",\"kts\"];case\"Lua\":return[\"lua\"];case\"Markdown\":return[\"md\"];case\"MATLAB\":return[\"m\"];case\"Nginx\":return[\"conf\"];case\"Objective-C\":return[\"m\",\"mm\"];case\"Perl\":return[\"pl\"];case\"PHP\":return[\"php\",\"php4\",\"php5\",\"phtml\"];case\"Python\":return[\"py\"];case\"Ruby\":return[\"rb\"];case\"Rust\":return[\"rs\"];case\"Scala\":return[\"scala\"];case\"Shell\":return[\"sh\"];case\"SQL\":return[\"sql\"];case\"Swift\":return[\"swift\"];case\"Vue\":return[\"vue\"];case\"YAML\":return[\"yaml\",\"yml\"];default:return[];}}export function useBorder(props,collapseEqualBorders=true){const style={};const{borderWidth=0,borderColor=\"unset\",borderStyle=\"none\",borderBottomWidth=0,borderLeftWidth=0,borderRightWidth=0,borderTopWidth=0}=normalizeBorderProperties(props);const isMixedBorderWidth=borderTopWidth!==borderBottomWidth||borderTopWidth!==borderLeftWidth||borderTopWidth!==borderRightWidth;let borderTop;let borderBottom;let borderLeft;let borderRight;if(!isMixedBorderWidth){borderTop=borderBottom=borderLeft=borderRight=borderWidth;}else{borderTop=borderTopWidth;borderRight=borderRightWidth;borderBottom=borderBottomWidth;borderLeft=borderLeftWidth;}if(collapseEqualBorders&&borderTop===borderBottom&&borderTop===borderLeft&&borderTop===borderRight){style.border=`${borderTop}px ${borderStyle} ${borderColor}`;}else{style.borderStyle=borderStyle;style.borderColor=borderColor;style.borderTopWidth=`${borderTop}px`;style.borderBottomWidth=`${borderBottom}px`;style.borderLeftWidth=`${borderLeft}px`;style.borderRightWidth=`${borderRight}px`;}return style;}function normalizeBorderProperties(border){const normalizedProps={borderWidth:border.borderWidth,borderColor:border.borderColor,borderStyle:border.borderStyle};if(\"borderBottomWidth\"in border||\"borderLeftWidth\"in border||\"borderRightWidth\"in border||\"borderTopWidth\"in border){normalizedProps.borderBottomWidth=border.borderBottomWidth;normalizedProps.borderLeftWidth=border.borderLeftWidth;normalizedProps.borderRightWidth=border.borderRightWidth;normalizedProps.borderTopWidth=border.borderTopWidth;}else if(\"borderWidthBottom\"in border||\"borderWidthLeft\"in border||\"borderWidthRight\"in border||\"borderWidthTop\"in border){normalizedProps.borderBottomWidth=border.borderWidthBottom;normalizedProps.borderLeftWidth=border.borderWidthLeft;normalizedProps.borderRightWidth=border.borderWidthRight;normalizedProps.borderTopWidth=border.borderWidthTop;}return normalizedProps;}// Chunks a string into meaningful groups of characters (words, acronyms or numbers)\nconst groupsRegex=/[A-Z]{2,}|[A-Z][a-z]+|[a-z]+|[A-Z]|\\d+/gu;function capitalizeFirstLetter(value){return value.charAt(0).toUpperCase()+value.slice(1);}export function titleCase(value){const groups=value.match(groupsRegex)||[];return groups.map(capitalizeFirstLetter).join(\" \");}export function useRadius(props){const{borderRadius,isMixedBorderRadius,topLeftRadius,topRightRadius,bottomRightRadius,bottomLeftRadius}=props;const radiusValue=useMemo(()=>isMixedBorderRadius?`${topLeftRadius}px ${topRightRadius}px ${bottomRightRadius}px ${bottomLeftRadius}px`:`${borderRadius}px`,[borderRadius,isMixedBorderRadius,topLeftRadius,topRightRadius,bottomRightRadius,bottomLeftRadius]);return radiusValue;}export function usePadding(props){const{padding,paddingBottom,paddingLeft,paddingPerSide,paddingRight,paddingTop}=props;const paddingValue=useMemo(()=>paddingPerSide?`${paddingTop}px ${paddingRight}px ${paddingBottom}px ${paddingLeft}px`:`${padding}px`,[padding,paddingBottom,paddingLeft,paddingPerSide,paddingRight,paddingTop]);return paddingValue;}export function useIsOnCanvas(){const[onCanvas]=useState(()=>RenderTarget.current()===RenderTarget.canvas);return onCanvas;}export function isObject(value){return value!==null&&typeof value===\"object\";}// From https://github.com/codesandbox/sandpack/blob/36560cb4f0fc8f5f8b18f5a3d3952799690eba77/sandpack-react/src/utils/stringUtils.ts#L81\nexport function isDarkColor(color){let r=0;let g=0;let b=0;if(color.startsWith(\"#\")){if(color.length<7){return true;}r=parseInt(color.substr(1,2),16);g=parseInt(color.substr(3,2),16);b=parseInt(color.substr(5,2),16);}else{color=Color.isP3String(color)?clampRGB(color):color;const rgbValues=color.replace(\"rgb(\",\"\").replace(\"rgba(\",\"\").replace(\")\",\"\").split(\",\");if(rgbValues.length<3){return true;}r=parseInt(rgbValues[0],10);g=parseInt(rgbValues[1],10);b=parseInt(rgbValues[2],10);}const yiq=(r*299+g*587+b*114)/1e3;return yiq<128;}\nexport const __FramerMetadata__ = {\"exports\":{\"getFileExtensions\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"isObject\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"isDarkColor\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"usePadding\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useIsOnCanvas\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useBorder\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"titleCase\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useRadius\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./utils.map"],"mappings":"2LAAsH,EAAmB,0MAAiQ,ICA1Y,SAAS,EAAiB,EAAI,EAAI,EAAM,CAAmI,OAA/H,KAAO,EAAK,OAAO,eAAe,EAAI,EAAI,CAAO,QAAM,WAAW,GAAK,aAAa,GAAK,SAAS,GAAK,CAAC,CAAO,EAAI,GAAK,EAAc,kBAAkB,EAAb,KAA0B,CAAC,MAAM,CAAC,IAAM,EAAO,KAAK,OAC3O,GAAG,EAAQ,OAAO,EAAO,KAAd,CACX,IAAI,UAAU,MAAM,EAAO,QAE3B,IAAI,YAAY,OAAO,EAAO,MAE9B,IAAI,WAAW,MAAM,EAAO,OAE5B,IAAM,EAAQ,KAAK,UAAU,CAAC,KAAK,GAAO,CAAC,KAAK,OAAO,CAAC,K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