GE Lua Documentation

Press F to search!

weight

Definition


-- @/lua/ge/extensions/ui/vehicleSelector/vehicleSpecifications.lua:247
  weight = function(value)
    if not type(value) == 'number' then
      return tostring(value)
    end
    -- value is in kg
    local weightUnit = settings.getValue('uiUnitWeight')
    local decimals = value >= 100 and 0 or (value >= 10 and 1 or 2)
    if weightUnit == 'kg' then
      return string.format("%0."..decimals.."f kg", value)
    else
      -- convert kg to lb
      local lbValue = value * CONVERSIONS.KG_TO_LB
      local lbDecimals = lbValue >= 100 and 0 or (lbValue >= 10 and 1 or 2)
      return string.format("%0."..lbDecimals.."f lb", lbValue)
    end
  end,

Callers

@/lua/ge/extensions/editor/decalSpline.lua
          end
          im.tooltip("Set the weight (similar to probability) of component 1.")
          if im.IsItemActivated() then
            end
            im.tooltip("Set the weight (similar to probability) of component 2.")
            if im.IsItemActivated() then
            end
            im.tooltip("Set the weight (similar to probability) of component 3.")
            if im.IsItemActivated() then
            end
            im.tooltip("Set the weight (similar to probability) of component 4.")
            if im.IsItemActivated() then
@/ui/ui-vue/dist/index.js
Parent:`,parent$1,`
Child:`,prioNode),warnPrioNesting=!0)}let active=document.activeElement;(!active||!prioNode.contains(active))&&(rectNode=prioNode)}let rect=rectNode.getBoundingClientRect();if(rect.right<0||rect.bottom<0||rect.left>screen.width||rect.top>screen.height){node.classList.remove(MENU_NAVIGATION_CLASS);continue}node.classList.add(MENU_NAVIGATION_CLASS),node.tabIndex=0;let lnk={dom:node,rect};links.up&&links.up.push(lnk),links.down&&links.down.push(lnk),links.left&&links.left.push(lnk),links.right&&links.right.push(lnk)}return links.up&&links.up.sort((a$1,b)=>a$1.rect.top-b.rect.top),links.down&&links.down.sort((a$1,b)=>a$1.rect.bottom-b.rect.bottom),links.left&&links.left.sort((a$1,b)=>a$1.rect.left-b.rect.left),links.right&&links.right.sort((a$1,b)=>a$1.rect.right-b.rect.right),links}function isAvailable(node){if(!isVisibleFast(node))return!1;let style=document.defaultView.getComputedStyle(node,null);return style[`pointer-events`]===`none`||!isVisible(node,style)?!1:!isOccluded(node)}function isOccluded(node,dontIgnoreOffscreen=!1){let rects=node.getClientRects();for(let rect of rects)if(!isOccluded$1(node,rect,dontIgnoreOffscreen))return!1;return!0}function getDistanceFast(curr,goal,direction$1,usePerpendicular=!1){let dx=Math.min(goal.right,curr.right)-Math.max(goal.left,curr.left),dy=Math.min(goal.bottom,curr.bottom)-Math.max(goal.top,curr.top);dx===goal.right-goal.left&&(dx=curr.right-goal.left),dy===goal.bottom-goal.top&&(dy=curr.bottom-goal.top);let res=1/0;if(direction$1===DIR.DOWN&&goal.bottom>curr.bottom?res=Math.max(0,goal.bottom-curr.top)-dx:direction$1===DIR.UP&&goal.topcurr.right?res=Math.max(0,goal.left-curr.right)-dy:direction$1===DIR.LEFT&&goal.left{let firstLink=null,firstElementDistance=2**53-1;for(let link of links){let distance=link.rect.top*link.rect.top+link.rect.left*link.rect.left;distance>firstElementDistance||(firstElementDistance=distance,firstLink=link)}if(!firstLink){console.log(`Couldn't locate any button anywhere. Menu navigation won't work`);return}focusOnElement(firstLink.dom),scrollFix(firstLink,direction$1)}),!0;if(active.nodeName===`MD-SLIDER`&&(direction$1===DIR.LEFT||direction$1===DIR.RIGHT)||active.nodeName===`MD-OPTION`&&(direction$1===DIR.UP||direction$1===DIR.DOWN)||active.nodeName===`INPUT`&&active.type===`range`&&(direction$1===DIR.LEFT||direction$1===DIR.RIGHT))return fireKey(active,direction$1),!0;let{nearestLink,fixScroll}=findNext(links,direction$1,active);if(nearestLink)return focusOnElement(nearestLink.dom),fixScroll?.(),nearestLink.dom;if(links.length===0){let mdBackdrops=[...document.querySelectorAll(`md-backdrop, .md-scroll-mask`)];if(mdBackdrops.length>0){for(let el of mdBackdrops)try{el.parentNode.removeChild(el)}catch{}return navigateNext(links,direction$1,activeOverride)}}return!1}function findNext(links,direction$1,activeOverride=null){let active=activeOverride||document.activeElement,activeRect=active.getBoundingClientRect(),fixScroll=!0;if(isScrolling(direction$1)&&isOccluded(active,activeRect,!0)){let axis,boundsame,boundchange;switch(direction$1){case DIR.UP:case DIR.DOWN:axis=`vertical`,boundsame=[`left`,`right`],boundchange=[`top`,`bottom`];break;case DIR.LEFT:case DIR.RIGHT:axis=`horizontal`,boundsame=[`top`,`bottom`],boundchange=[`left`,`right`];break}if(navScrolling[axis].area){let bounds=navScrolling[axis].area.bounds,axisBound=activeRect[boundchange[1]]scrollFix(nearestLink,direction$1):null}}var navScrolling={running:!1,listening:{vertical:!1,horizontal:!1},dom:null,rect:null,vertical:{active:!1,amount:0,area:null},horizontal:{active:!1,amount:0,area:null},hint:{show:!1}};function drawScrollHint(){let show=isScrolling();if(navScrolling.hint.show===show)return;navScrolling.hint.show=show;let elem=document.getElementById(`xf_scroll`);elem&&(elem.style.display=show?``:`none`)}function navigateScroll(axis,amount){if(axis===AXIS_V&&(amount=-amount),navScrolling[axis].amount=amount*15,Math.abs(navScrolling[axis].amount)<1){navScrolling[axis].active=!1;return}navScrolling[axis].active=!0;let dom=document.activeElement;navScrolling.dom!==dom&&(navScrolling.dom=dom,navScrolling.rect=dom.getBoundingClientRect(),navScrolling[axis===AXIS_H?AXIS_V:AXIS_H].active=!1);let area=findScrollable(navScrolling,axis,!0);if(navScrolling[axis].area=area,!area){navScrolling[axis].active=!1;return}return navScrolling.running||window.requestAnimationFrame(function scrl(){let set={};for(let axis$1 of[AXIS_V,AXIS_H]){let cur=navScrolling[axis$1];if(!cur.active||!cur.area)continue;let pos=cur.area.parent[cur.area.readby]+navScrolling[axis$1].amount;pos>cur.area.fullsize?cur.active=!1:set[cur.area.moveby]=pos}navScrolling.running=Object.keys(set).length>0,navScrolling.running&&(area.parent.scrollTo({...set,behavior:`instant`}),document.dispatchEvent(new CustomEvent(`mdtooltiphide`)),window.requestAnimationFrame(scrl))}),!0}function scrollCatch(axis,enable){if(navScrolling.listening[axis]===enable)return;let cur=isScrolling();navScrolling.listening[axis]=enable,cur!==isScrolling()&&(bngApi.engineLua(`local o = scenetree.findObject("MenuScrollActionMap"); if o then o:${enable?`push`:`pop`}() end`),window.bngVue.uiNavTracker&&(enable?window.bngVue.uiNavTracker.addEvent(UI_SCROLL_ACTION_EVENTS[axis],TRACKER_ID):window.bngVue.uiNavTracker.removeEvent(UI_SCROLL_ACTION_EVENTS[axis],TRACKER_ID)))}function isScrolling(direction$1=void 0){let scrolling=!1;return direction$1?direction$1===DIR.UP||direction$1===DIR.DOWN?scrolling=navScrolling.listening.vertical:(direction$1===DIR.LEFT||direction$1===DIR.RIGHT)&&(scrolling=navScrolling.listening.horizontal):scrolling=navScrolling.listening.horizontal||navScrolling.listening.vertical,scrolling}function isScrollListening(axis=void 0){let listening=!1;return listening=axis?navScrolling.listening[axis]:navScrolling.listening.horizontal||navScrolling.listening.vertical,listening}function findScrollable(link,axis,thumbstick){axis!==AXIS_V&&axis!==AXIS_H&&(axis=AXIS_V);let opts=axis===AXIS_H?{moveby:`left`,readby:`scrollLeft`,size:`width`,scroll:`scrollWidth`,client:`clientWidth`,overflow:`overflow-x`}:{moveby:`top`,readby:`scrollTop`,size:`height`,scroll:`scrollHeight`,client:`clientHeight`,overflow:`overflow-y`},forced=!1,parent,fullsize,size$3,node=link.dom?.parentNode;function setParent(node$1){if(!node$1)return;if(thumbstick){let noNav=node$1.attributes.getNamedItem(SCROLL_ATTR);if(noNav&&noNav.value===`false`)return}let styles$1=document.defaultView.getComputedStyle(node$1,null);(styles$1[opts.overflow]===`auto`||styles$1[opts.overflow]===`scroll`)&&(fullsize=node$1[opts.scroll],size$3=node$1[opts.client],fullsize>size$3&&(parent=node$1))}for(;node&&node.isConnected&&node.nodeType===Node.ELEMENT_NODE&&!((!thumbstick||node.attributes.getNamedItem(`bng-nav-scroll`))&&(setParent(node),parent));)node=node.parentNode;if(!parent){let elems$2=document.querySelectorAll(`[${SCROLL_FORCE_ATTR}]`);for(let elem of elems$2)if(setParent(elem),parent){forced=!0;break}}if(scrollCatch(axis,!!parent),drawScrollHint(),!parent)return null;let start=0,styles=document.defaultView.getComputedStyle(parent,null);[`relative`,`absolute`,`static`,`fixed`].includes(styles.position)&&(start+=parent.getBoundingClientRect()[opts.moveby]);let pad=link.rect?Math.max(size$3/4,link.rect[opts.size]):size$3/4,bounds=[start+pad,start+size$3-pad];return{parent,moveby:opts.moveby,readby:opts.readby,bounds,fullsize,start:0,finish:fullsize-size$3,forced}}function scrollFix(link,direction$1){let area=findScrollable(link,direction$1===DIR.UP||direction$1===DIR.DOWN?AXIS_V:AXIS_H);if(!area){document.querySelector(`[bng-nav-scroll], [bng-nav-scroll-force]`)&&findScrollable(link,direction$1===DIR.LEFT||direction$1===DIR.RIGHT?AXIS_V:AXIS_H);return}if(area.forced)return;let mov=-1;direction$1===DIR.UP||direction$1===DIR.DOWN?link.rect.toparea.bounds[1]&&(mov=Math.min(area.parent.scrollTop-area.bounds[1]+link.rect.bottom,area.finish)):link.rect.leftarea.bounds[1]&&(mov=Math.min(area.parent.scrollLeft-area.bounds[1]+link.rect.right,area.finish)),mov>-1&&area.parent.scrollTo({[area.moveby]:mov,behavior:`instant`})}function fireKey(element,direction$1){let key=DIR_KEYS[direction$1];key&&dispatchKey(key,element)}function handleUINavEvent(e,restrictTo=void 0){let d=e.detail,handled=!1;if(d.name in UI_SCALAR_EVENT_ACTIONS){let axis=UI_SCALAR_EVENT_ACTIONS[d.name],value=d.value;if(value!==0&&THUMBSTICK_DEADZONE>0&&Math.abs(value)>THUMBSTICK_DEADZONE){let adjustedValue=(axis===AXIS_V?-value:value)>0?1:-1,direction$1=axis===AXIS_H?adjustedValue>0?DIR.RIGHT:DIR.LEFT:adjustedValue>0?DIR.DOWN:DIR.UP;lastScalarValue[axis]!==adjustedValue&&(lastScalarValue[axis]=adjustedValue,navigate(collectRects(direction$1,restrictTo),direction$1))}else lastScalarValue[axis]=0;handled=!0}if(d.name in UI_NAV_EVENT_ACTIONS){let action=UI_NAV_EVENT_ACTIONS[d.name];switch(action){case`up`:case`down`:case`left`:case`right`:d.value==1&&(navigate(collectRects(action,restrictTo),action),handled=!0);break;case`confirm`:if(d.value==1){let activeEl=document.activeElement;isNavigable$1(activeEl)&&(typeof activeEl.click==`function`?activeEl.click():activeEl.dispatchEvent(new CustomEvent(`click`))),handled=!0}break}}else if(d.name in UI_SCROLL_EVENT_ACTIONS){let axis=UI_SCROLL_EVENT_ACTIONS[d.name];navigateScroll(axis,d.value),handled=isScrollListening(axis)}handled&&e.preventDefault()}var SCOPED_NAV_ATTR$1=`bng-scoped-nav`,UI_NAV_ACTION_GROUP$1=`UINavActions`,GAME_UI_NAVIGATION_EVENT$1=`UINavigation`,GAME_UI_NAV_MAP_ENABLED_EVENT$1=`MenuActionMapEnabled`,DOM_UI_NAVIGATION_EVENT$1=`ui_nav`,UI_SCOPE_ATTR$3=`bng-ui-scope`,UI_EVENT_ATTR$1=`ui-nav-event`,ACTIONS_BY_UI_EVENT$1={focus_u:`menu_item_up`,focus_r:`menu_item_right`,focus_d:`menu_item_down`,focus_l:`menu_item_left`,menu:`toggleMenues`,back:`menu_item_back`,details:`cui_details`,advanced:`cui_advanced`,camera:`cui_camera`,logs:`cui_logs`,tab_l:`menu_tab_left`,tab_r:`menu_tab_right`,modifier:`cui_modifier`,action_4:`cui_action_4`,focus_ud:`menu_item_focus_ud`,focus_lr:`menu_item_focus_lr`,rotate_h_cam:`menu_item_radial_right_x`,rotate_v_cam:`menu_item_radial_right_y`,ok:`menu_item_select`,cancel:`cui_cancel`,action_2:`cui_action_2`,action_3:`cui_action_3`,gameplay_interact:`cui_gameplay_interact`,context:`cui_context`},UI_EVENTS_BY_ACTION$1=Object.assign({},...Object.entries(ACTIONS_BY_UI_EVENT$1).map(([k,v])=>({[v]:k}))),UI_EVENTS$1={focus_u:`focus_u`,focus_r:`focus_r`,focus_d:`focus_d`,focus_l:`focus_l`,pause:`pause`,menu:`menu`,back:`back`,details:`details`,advanced:`advanced`,camera:`camera`,logs:`logs`,tab_l:`tab_l`,tab_r:`tab_r`,modifier:`modifier`,zoom_out:`zoom_out`,zoom_in:`zoom_in`,subtab_l:`subtab_l`,subtab_r:`subtab_r`,center_cam:`center_cam`,action_4:`action_4`,move_ud:`move_ud`,move_lr:`move_lr`,focus_ud:`focus_ud`,focus_lr:`focus_lr`,rotate_h_cam:`rotate_h_cam`,rotate_v_cam:`rotate_v_cam`,ok:`ok`,cancel:`cancel`,action_2:`action_2`,action_3:`action_3`,gameplay_interact:`gameplay_interact`,context:`context`},UI_EVENT_GROUPS$1={focusMove:[UI_EVENTS$1.focus_u,UI_EVENTS$1.focus_d,UI_EVENTS$1.focus_l,UI_EVENTS$1.focus_r],focusMoveScalar:[UI_EVENTS$1.focus_ud,UI_EVENTS$1.focus_lr],moveScalar:[UI_EVENTS$1.move_ud,UI_EVENTS$1.move_lr],navigation:[UI_EVENTS$1.focus_u,UI_EVENTS$1.focus_d,UI_EVENTS$1.focus_l,UI_EVENTS$1.focus_r,UI_EVENTS$1.focus_ud,UI_EVENTS$1.focus_lr,UI_EVENTS$1.move_ud,UI_EVENTS$1.move_lr],allEvents:Object.keys(ACTIONS_BY_UI_EVENT$1)},setFilteredEvents=(...events$3)=>{clearFilteredEvents();let actionsToFilter=[...new Set(events$3.flat(1/0))].map(event=>ACTIONS_BY_UI_EVENT$1[event]);Lua_default.extensions.core_input_actionFilter.setGroup(UI_NAV_ACTION_GROUP$1,actionsToFilter),Lua_default.extensions.core_input_actionFilter.addAction(0,UI_NAV_ACTION_GROUP$1,!0)};setFilteredEvents.allExcept=(...events$3)=>{let eventsToNotFilter=[...new Set(events$3.flat(1/0))];setFilteredEvents(UI_EVENT_GROUPS$1.allEvents.filter(ev=>!eventsToNotFilter.includes(ev)))};var clearFilteredEvents=()=>{Lua_default.extensions.core_input_actionFilter.addAction(0,UI_NAV_ACTION_GROUP$1,!1),Lua_default.extensions.core_input_actionFilter.setGroup(UI_NAV_ACTION_GROUP$1,[])};const clamp=(val,min$1,max$1)=>Math.min(Math.max(val,min$1),max$1),round=(val,step=1)=>{if(val===void 0)throw Error(`The function at least needs a value`);return Math.round(val/step+2**-52)*step},roundDec=(val,dec=0)=>{if(val===void 0)throw Error(`The function at least needs a value`);if(dec>15)throw Error(`Floating point won't be precise after 15th decimal`);if(val===0)return 0;if(!Number.isInteger(dec))throw Error(`Decimal point must be an integer`);let pow=10**dec;return Math.round(val*pow+2**-52)/pow},roundDecSample=(val,sample=0)=>{let dec=getDecimalPlaces(sample);return dec===0?round(val):roundDec(val,dec)},getDecimalPlaces=num=>{if(Number.isInteger(num)||!Number.isFinite(num))return 0;let dec=0;for(;!Number.isInteger(num)&&Number.isFinite(num)&&(num*=10,dec++,!(dec>15)););return dec};var UIUnits_default=class{uiUnits={uiUnitLength:`metric`,uiUnitTemperature:`f`,uiUnitWeight:`lb`,uiUnitConsumptionRate:`imperial`,uiUnitTorque:`imperial`,uiUnitEnergy:`imperial`,uiUnitDate:`us`,uiUnitPower:`bhp`,uiUnitVolume:`gal`,uiUnitPressure:`psi`};mapping={length:`uiUnitLength`,speed:`uiUnitLength`,temperature:`uiUnitTemperature`,weight:`uiUnitWeight`,consumptionRate:`uiUnitConsumptionRate`,torque:`uiUnitTorque`,energy:`uiUnitEnergy`,date:`uiUnitDate`,power:`uiUnitPower`,volume:`uiUnitVolume`,pressure:`uiUnitPressure`,lengthMinor:`uiUnitLength`};userSettings={uiLanguage:`en-US`};eventBus={};api={};constructor(eventBus$1,api$1){this.eventBus=eventBus$1,this.api=api$1,this.beamBucks=this.beamBucks.bind(this),this.eventBus.on(`SettingsChanged`,data=>this.onSettingsChanged(data)),api$1.engineLua(`settings.notifyUI()`)}onSettingsChanged(data){for(let name in this.uiUnits)data.values[name]!==void 0&&(this.uiUnits[name]=data.values[name]);for(let name in this.userSettings)data.values[name]!==void 0&&(this.userSettings[name]=data.values[name].replace(/_/g,`-`))}buildString(func,val,numDecs,system){if([`division`,`buildString`,`date`].includes(func)||typeof this[func]!=`function`)throw Error(`Cannot use this function to build a string`);this.mapping[func]!==void 0&&system===void 0&&(system=this.uiUnits[this.mapping[func]]);let helper=this[func](val,system);return helper===null?``:typeof helper.val==`string`?helper.val:typeof helper.val==`number`?(helper.val<0&&helper.val>-(10**-numDecs)&&(helper.val=0),Intl.NumberFormat(this.userSettings.uiLanguage,{style:`decimal`,minimumFractionDigits:numDecs,maximumFractionDigits:numDecs}).format(helper.val)+` `+helper.unit):``}division(func1,func2,val1,val2,numDecs,system1,system2){let unsupported=[`division`,`weightPower`,`buildString`,`date`];if(unsupported.includes(func1)||typeof this[func1]!=`function`||unsupported.includes(func2)||typeof this[func2]!=`function`)throw Error(`Cannot use these functions`);let helper1=this[func1](val1,system1),helper2=this[func2](val2,system2);if(helper1!==null&&helper2!==null){let newVal=helper1.val/helper2.val;return{val:numDecs===void 0?newVal:roundDec(newVal,numDecs),unit:`${helper1.unit}/${helper2.unit}`}}else return console.error(`got null`,arguments),null}weightPower(x){let helper=this.division(`weight`,`power`,1,1);return helper===null?null:{val:helper.val*x,unit:helper.unit}}length(meters,system=this.uiUnits.uiUnitLength){if(system===`metric`)return meters<.01?{val:meters*1e3,unit:`mm`}:meters<1?{val:meters*100,unit:`cm`}:meters<1e3?{val:meters,unit:`m`}:{val:meters*.001,unit:`km`};if(system===`imperial`){let yd=meters*1.0936;return yd<1?{val:yd*36,unit:`in`}:yd<3?{val:yd*3,unit:`ft`}:{val:yd*568182e-9,unit:`mi`}}return null}distance=this.length;lengthMinor(meters,system=this.uiUnits.uiUnitLength){return system===`metric`?{val:meters*1,unit:`m`}:system===`imperial`?{val:meters*1.0936*3,unit:`ft`}:null}area(squareMeters,system=this.uiUnits.uiUnitLength){if(system===`metric`)return squareMeters<1e3?{val:squareMeters,unit:`sq m`}:{val:squareMeters*.001*.001,unit:`sq km`};if(system===`imperial`){let sqrYards=squareMeters*1.0936*1.0936;return sqrYards<1760?{val:sqrYards,unit:`sq yd`}:{val:sqrYards*568182e-9*568182e-9,unit:`sq mi`}}return null}temperature(x,system=this.uiUnits.uiUnitTemperature){switch(system){case`c`:return{val:x,unit:`°C`};case`f`:return{val:x*1.8+32,unit:`°F`};case`k`:return{val:x+273.15,unit:`K`};default:return null}}volume(x,system=this.uiUnits.uiUnitVolume){switch(system){case`l`:return{val:x,unit:`L`};case`gal`:return{val:x*.2642,unit:`gal`};default:return null}}pressure(x,system=this.uiUnits.uiUnitPressure){switch(system){case`inHg`:return{val:x*.2953,unit:`in.Hg`};case`bar`:return{val:x*.01,unit:`Bar`};case`psi`:return{val:x*.145038,unit:`PSI`};case`kPa`:return{val:x,unit:`kPa`};default:return null}}weight(x,system=this.uiUnits.uiUnitWeight){switch(system){case`kg`:return{val:x,unit:`kg`};case`lb`:return{val:2.20462262*x,unit:`lbs`};default:return null}}consumptionRate(x,system=this.uiUnits.uiUnitConsumptionRate){switch(system){case`metric`:return{val:1e5*x>5e4?`n/a`:1e5*x,unit:`L/100km`};case`imperial`:return{val:x===0?0:235*1e-5/x,unit:`MPG`};default:return null}}speed(x,system=this.uiUnits.uiUnitLength){switch(system){case`metric`:return{val:3.6*x,unit:`km/h`};case`imperial`:return{val:2.23693629*x,unit:`mph`};default:return null}}power(x,system=this.uiUnits.uiUnitPower){switch(system){case`kw`:return{val:.735499*x,unit:`kW`};case`hp`:return{val:x,unit:`PS`};case`bhp`:return{val:.98632*x,unit:`bhp`};default:return null}}torque(x,system=this.uiUnits.uiUnitTorque){switch(system===`metric`?system=`kg`:system===`imperial`&&(system=`lb`),system){case`kg`:return{val:x,unit:`Nm`};case`lb`:return{val:.7375621495*x,unit:`lb-ft`};default:return null}}energy(x,system=this.uiUnits.uiUnitEnergy){switch(system===`metric`?system=`j`:system===`imperial`&&(system=`ft lb`),system){case`j`:return{val:x,unit:`J`};case`ft lb`:return{val:.7375621495*x,unit:`ft lb`};default:return null}}date(x,system=this.uiUnits.uiUnitDate){switch(system){case`ger`:return x.toLocaleDateString(`de-DE`);case`uk`:return x.toLocaleDateString(`en-GB`);case`us`:return x.toLocaleDateString(`en-US`);default:return null}}beamBucks(x){return Intl.NumberFormat(this.userSettings.uiLanguage,{style:`decimal`,maximumFractionDigits:2,minimumFractionDigits:2}).format(+x)}},lite_default=class{constructor(){this.processing=!1,this.pending=0,this.finishCallback=null,this.angularRootScope=window.globalAngularRootScope,this.angularTimeout=null,this.angularTimeoutRetry=null,this.angularTimeoutWarned=!1,this.safetyTimeout=2e3,this.safetyTimer=null,this.warned=!1}setAngularRootScope(rootScope){this.angularRootScope=rootScope,this.angularTimeout=null,this.angularTimeoutRetry&&=(clearTimeout(this.angularTimeoutRetry),null)}getAngularTimeout(){if(this.angularTimeout!==null)return typeof this.angularTimeout==`function`?this.angularTimeout:null;let code;this.angularTimeoutRetry&&(code=`retry`,clearTimeout(this.angularTimeoutRetry));try{if(window.angular!==void 0&&window.angular.element){let injector=window.angular.element(document).injector();if(injector)return this.angularTimeout=injector.get(`$timeout`),this.angularTimeoutWarned&&console.log(`Stream Coordinator: Angular $timeout service resolved after retry`),this.angularTimeout;code=`no-injector`}else code=`no-angular`}catch{code=`error`}return this.angularTimeout=!1,this.angularTimeoutRetry||=setTimeout(()=>{this.angularTimeout||=null},5e3),console.warn(`Stream Coordinator: Angular $timeout service not available (${code})`),this.angularTimeoutWarned=!0,null}beforeBroadcast(){this.processing||(this.processing=!0,this.finishCallback=null,this.pending=0,this.safetyTimer&&clearTimeout(this.safetyTimer),this.safetyTimer=setTimeout(()=>{this.processing&&this.forceComplete()},this.safetyTimeout))}afterBroadcast(callback){if(callback&&typeof callback==`function`?this.finishCallback=()=>{this.finishCallback=void 0,Promise.resolve().then(callback)}:this.finishCallback=void 0,!this.processing){this.finishCallback?.();return}this.startDeferredWork()}startDeferredWork(){this.pending=0;let angularTimeout=this.getAngularTimeout();angularTimeout&&(this.angularRootScope||=window.globalAngularRootScope,this.angularRootScope&&(this.pending++,angularTimeout(()=>this.onOperationComplete(),0))),window.Vue?.nextTick&&(this.pending++,window.Vue.nextTick(()=>this.onOperationComplete())),this.pending===0&&(this.warned||(this.warned=!0,console.warn(`Stream Coordinator: No Angular $timeout() nor Vue.nextTick() detected, using only Promise microtask instead`)),this.complete())}onOperationComplete(){this.processing&&(this.pending--,this.pending<=0&&this.complete())}complete(){this.processing&&(this.safetyTimer&&=(clearTimeout(this.safetyTimer),null),Promise.resolve().then(()=>{this.processing=!1,window.beamng?.uiFrameCallback?.(),this.finishCallback?.()}))}forceComplete(){this.complete()}},dependencies,bridge$3;const useBridge=()=>{if(bridge$3)return bridge$3;if(window.bridge)return bridge$3=window.bridge;let events$3=new dependencies.Emitter,coordinator=new lite_default(events$3);Hooks_default.setStreamCoordinator(coordinator);let api$1=dependencies.overrideAPI||new BeamNGAPI_default(events$3,dependencies.beamng);return bridge$3={api:api$1,lua:Lua_default,events:events$3,streams:new StreamManager_default(api$1),coordinator,hooks:Hooks_default,units:new UIUnits_default(events$3,api$1),gameBlurrer:GameBlurrer_default,beamNG:dependencies.beamng},bridge$3},setBridgeDependencies=deps$1=>dependencies=deps$1;var DEBUG=1,INFO=2,WARN=4,ERROR=8,consoleLogMethods={[DEBUG]:`log`,[INFO]:`info`,[WARN]:`warn`,[ERROR]:`error`},consoleLogProvider={log(level$1,...msgs){level$1 in consoleLogMethods&&console[consoleLogMethods[level$1]](...msgs)}},level=14,providersInUse=[consoleLogProvider],STACK_TRACE=Symbol(`Stack trace`),_stackTrace=()=>`
`+Error().stack,_log=(lvl,...msgs)=>{level&lvl&&(msgs=msgs.map(msg=>msg===STACK_TRACE?_stackTrace():msg),providersInUse.forEach(p$1=>p$1.log&&p$1.log(lvl,...msgs)))},_assert=async(lvl,cond,...msgs)=>{level&lvl&&(cond?cond instanceof Promise?cond.then(res=>!res&&_log(lvl,...msgs)):typeof cond==`function`&&!await cond()&&_log(lvl,...msgs):_log(lvl,...msgs))},logger={DEBUG,INFO,WARN,ERROR,setProviders:(...providers)=>providersInUse=providers,set level(val){return level=val},get level(){return level},STACK_TRACE,log:(...msgs)=>_log(DEBUG,...msgs),debug:(...msgs)=>_log(DEBUG,...msgs),info:(...msgs)=>_log(INFO,...msgs),warn:(...msgs)=>_log(WARN,...msgs),error:(...msgs)=>_log(ERROR,...msgs),assert:(cond,...msgs)=>_assert(DEBUG,cond,...msgs),assertDebug:(cond,...msgs)=>_assert(DEBUG,cond,...msgs),assertInfo:(cond,...msgs)=>_assert(INFO,cond,...msgs),assertWarn:(cond,...msgs)=>_assert(WARN,cond,...msgs),assertError:(cond,...msgs)=>_assert(ERROR,cond,...msgs)};window.BNG_Logger=logger;var logger_default=logger;function warn(msg,err){typeof console<`u`&&(console.warn(`[intlify] `+msg),err&&console.warn(err.stack))}var inBrowser=typeof window<`u`,makeSymbol=(name,shareable=!1)=>shareable?Symbol.for(name):Symbol(name),generateFormatCacheKey=(locale,key,source)=>friendlyJSONstringify({l:locale,k:key,s:source}),friendlyJSONstringify=json=>JSON.stringify(json).replace(/\u2028/g,`\\u2028`).replace(/\u2029/g,`\\u2029`).replace(/\u0027/g,`\\u0027`),isNumber=val=>typeof val==`number`&&isFinite(val),isRegExp=val=>toTypeString(val)===`[object RegExp]`,isEmptyObject=val=>isPlainObject(val)&&Object.keys(val).length===0,assign$1=Object.assign,_create=Object.create,create=(obj=null)=>_create(obj),_globalThis,getGlobalThis=()=>_globalThis||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:create();function escapeHtml(rawText){return rawText.replace(/&/g,`&`).replace(//g,`>`).replace(/"/g,`"`).replace(/'/g,`'`).replace(/\//g,`/`).replace(/=/g,`=`)}function escapeAttributeValue(value){return value.replace(/&(?![a-zA-Z0-9#]{2,6};)/g,`&`).replace(/"/g,`"`).replace(/'/g,`'`).replace(//g,`>`)}function sanitizeTranslatedHtml(html){return html=html.replace(/(\w+)\s*=\s*"([^"]*)"/g,(_,attrName,attrValue)=>`${attrName}="${escapeAttributeValue(attrValue)}"`),html=html.replace(/(\w+)\s*=\s*'([^']*)'/g,(_,attrName,attrValue)=>`${attrName}='${escapeAttributeValue(attrValue)}'`),/\s*on\w+\s*=\s*["']?[^"'>]+["']?/gi.test(html)&&(html=html.replace(/(\s+)(on)(\w+\s*=)/gi,`$1on$3`)),[/(\s+(?:href|src|action|formaction)\s*=\s*["']?)\s*javascript:/gi,/(style\s*=\s*["'][^"']*url\s*\(\s*)javascript:/gi].forEach(pattern=>{html=html.replace(pattern,`$1javascript:`)}),html}var hasOwnProperty=Object.prototype.hasOwnProperty;function hasOwn(obj,key){return hasOwnProperty.call(obj,key)}var isArray$1=Array.isArray,isFunction=val=>typeof val==`function`,isString=val=>typeof val==`string`,isBoolean=val=>typeof val==`boolean`,isObject=val=>typeof val==`object`&&!!val,isPromise=val=>isObject(val)&&isFunction(val.then)&&isFunction(val.catch),objectToString=Object.prototype.toString,toTypeString=value=>objectToString.call(value),isPlainObject=val=>toTypeString(val)===`[object Object]`,toDisplayString$1=val=>val==null?``:isArray$1(val)||isPlainObject(val)&&val.toString===objectToString?JSON.stringify(val,null,2):String(val);function join(items$2,separator=``){return items$2.reduce((str,item,index)=>index===0?str+item:str+separator+item,``)}var isNotObjectOrIsArray=val=>!isObject(val)||isArray$1(val);function deepCopy(src,des){if(isNotObjectOrIsArray(src)||isNotObjectOrIsArray(des))throw Error(`Invalid value`);let stack$2=[{src,des}];for(;stack$2.length;){let{src:src$1,des:des$1}=stack$2.pop();Object.keys(src$1).forEach(key=>{key!==`__proto__`&&(isObject(src$1[key])&&!isObject(des$1[key])&&(des$1[key]=Array.isArray(src$1[key])?[]:create()),isNotObjectOrIsArray(des$1[key])||isNotObjectOrIsArray(src$1[key])?des$1[key]=src$1[key]:stack$2.push({src:src$1[key],des:des$1[key]}))})}}function createPosition(line,column,offset$2){return{line,column,offset:offset$2}}function createLocation(start,end,source){let loc={start,end};return source!=null&&(loc.source=source),loc}var CompileErrorCodes={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14,UNHANDLED_CODEGEN_NODE_TYPE:15,UNHANDLED_MINIFIER_NODE_TYPE:16},COMPILE_ERROR_CODES_EXTEND_POINT=17,errorMessages={[CompileErrorCodes.EXPECTED_TOKEN]:`Expected token: '{0}'`,[CompileErrorCodes.INVALID_TOKEN_IN_PLACEHOLDER]:`Invalid token in placeholder: '{0}'`,[CompileErrorCodes.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER]:`Unterminated single quote in placeholder`,[CompileErrorCodes.UNKNOWN_ESCAPE_SEQUENCE]:`Unknown escape sequence: \\{0}`,[CompileErrorCodes.INVALID_UNICODE_ESCAPE_SEQUENCE]:`Invalid unicode escape sequence: {0}`,[CompileErrorCodes.UNBALANCED_CLOSING_BRACE]:`Unbalanced closing brace`,[CompileErrorCodes.UNTERMINATED_CLOSING_BRACE]:`Unterminated closing brace`,[CompileErrorCodes.EMPTY_PLACEHOLDER]:`Empty placeholder`,[CompileErrorCodes.NOT_ALLOW_NEST_PLACEHOLDER]:`Not allowed nest placeholder`,[CompileErrorCodes.INVALID_LINKED_FORMAT]:`Invalid linked format`,[CompileErrorCodes.MUST_HAVE_MESSAGES_IN_PLURAL]:`Plural must have messages`,[CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_MODIFIER]:`Unexpected empty linked modifier`,[CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_KEY]:`Unexpected empty linked key`,[CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS]:`Unexpected lexical analysis in token: '{0}'`,[CompileErrorCodes.UNHANDLED_CODEGEN_NODE_TYPE]:`unhandled codegen node type: '{0}'`,[CompileErrorCodes.UNHANDLED_MINIFIER_NODE_TYPE]:`unhandled mimifier node type: '{0}'`};function createCompileError(code,loc,options={}){let{domain,messages,args}=options,msg=code,error=SyntaxError(String(msg));return error.code=code,loc&&(error.location=loc),error.domain=domain,error}function defaultOnError(error){throw error}var CHAR_SP=` `,CHAR_CR=`\r`,CHAR_LF=`
@/ui/ui-vue/src/bridge/libs/UIUnits.js
   */
  weight(x, system = this.uiUnits.uiUnitWeight) {
    switch (system) {
@/lua/ge/extensions/editor/meshSpline.lua
              end
              im.tooltip("Set the weight (similar to probability) of the main mesh.")
              if im.IsItemActivated() then
                end
                im.tooltip("Set the weight (similar to probability) of the variation 1 mesh.")
                if im.IsItemActivated() then
                end
                im.tooltip("Set the weight (similar to probability) of the variation 2 mesh.")
                if im.IsItemActivated() then
                end
                im.tooltip("Set the weight (similar to probability) of the variation 3 mesh.")
                if im.IsItemActivated() then