{"version":3,"file":"UnitValue.CvxLI_UI.mjs","names":["__esmMin","init_jsx_runtime","c","p","addPropertyControls","ControlType","init_framer_BL70qLPA","useTornante","init_TornanteStore","CM_PER_IN","LB_PER_KG","FT_PER_M","KM_PER_MI","UnitValue","imperial","s","v","props","iv","iu","mu","shown","text","font","init_UnitValue"],"sources":["https:/framerusercontent.com/modules/hH3dez4wbtZNVYY1SNGc/eA9Rr2KL8UlO4YeDYJN7/UnitValue.js"],"sourcesContent":["// UnitValue: any CMS number in the visitor's units, with tabular figures.\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{CM_PER_IN,FT_PER_M,KM_PER_MI,LB_PER_KG,useTornante}from\"https://framerusercontent.com/modules/WpajxHK7bfTZXPgovpWs/M23MAJYEOdryZmBGtGGH/TornanteStore.js\";/**\n * Unit Value\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n * @framerIntrinsicWidth 96\n * @framerIntrinsicHeight 40\n */export default function UnitValue(props){const imperial=useTornante(s=>s.units)===\"imperial\";const v=Number(props.value)||0;const table={Distance:[v/KM_PER_MI,\"mi\",\"km\"],Elevation:[v*FT_PER_M,\"ft\",\"m\"],Weight:[v*LB_PER_KG,\"lb\",\"kg\"],Height:[v/10/CM_PER_IN,\"in\",\"mm\"],Speed:[v/KM_PER_MI,\"mph\",\"km/h\"]};const[iv,iu,mu]=table[props.kind];const shown=imperial?iv:v;const text=new Intl.NumberFormat(\"en-GB\",{maximumFractionDigits:props.digits,minimumFractionDigits:props.digits}).format(shown);const font={fontFamily:\"'Mona Sans Variable', 'Mona Sans', sans-serif\",fontWeight:props.weight,fontSize:props.size,lineHeight:1,fontVariantNumeric:\"tabular-nums\",fontFeatureSettings:\"'tnum' 1\",fontVariationSettings:`'wdth' ${props.wdth}`,whiteSpace:\"nowrap\"};return /*#__PURE__*/_jsxs(\"span\",{style:{...props.style,...font,color:props.color,display:\"inline-block\"},children:[props.prefix,text,/*#__PURE__*/_jsx(\"span\",{style:{fontSize:\"0.42em\",fontWeight:500,marginLeft:\"0.3em\",color:props.unitColor,fontVariationSettings:\"'wdth' 112\"},children:imperial?iu:mu})]});}UnitValue.displayName=\"Unit Value\";UnitValue.defaultProps={value:0,kind:\"Distance\",digits:0,prefix:\"\",color:\"#EEF2F6\",unitColor:\"#9AA5B1\",size:34,wdth:80,weight:700};addPropertyControls(UnitValue,{value:{type:ControlType.Number,title:\"Value\",defaultValue:0,min:0,max:1e5,step:.1},kind:{type:ControlType.Enum,title:\"Kind\",options:[\"Distance\",\"Elevation\",\"Weight\",\"Height\",\"Speed\"],defaultValue:\"Distance\",description:\"Enter metric. Visitors see their own units.\"},digits:{type:ControlType.Number,title:\"Decimals\",min:0,max:2,step:1,defaultValue:0},prefix:{type:ControlType.String,title:\"Prefix\",defaultValue:\"\"},color:{type:ControlType.Color,title:\"Colour\",defaultValue:\"#EEF2F6\"},unitColor:{type:ControlType.Color,title:\"Unit colour\",defaultValue:\"#9AA5B1\"},size:{type:ControlType.Number,title:\"Size\",min:10,max:120,step:1,defaultValue:34},wdth:{type:ControlType.Number,title:\"Width\",min:75,max:125,step:1,defaultValue:80},weight:{type:ControlType.Number,title:\"Weight\",min:200,max:900,step:10,defaultValue:700}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"UnitValue\",\"slots\":[],\"annotations\":{\"framerIntrinsicWidth\":\"96\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"auto\",\"framerSupportedLayoutHeight\":\"auto\",\"framerIntrinsicHeight\":\"40\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./UnitValue.map"],"mappings":"A,uPAOG,SAAwBa,EAAU,EAAM,CAAC,IAAMC,EAASP,EAAY,GAAGQ,EAAE,KAAK,IAAI,WAAiBC,EAAE,OAAOC,EAAM,KAAK,GAAG,EAAwL,CAACC,EAAGC,EAAGC,GAAI,CA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